@signalwire/cfb 0.0.12 → 0.0.13-dev.202401031635.c449782.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.
package/dist/main.js CHANGED
@@ -1,8 +1,8 @@
1
- (function(Hr,ei){typeof exports=="object"&&typeof module<"u"?ei(exports):typeof define=="function"&&define.amd?define(["exports"],ei):(Hr=typeof globalThis<"u"?globalThis:Hr||self,ei(Hr.CFB={}))})(this,function(Hr){"use strict";/**
2
- * Visual Builder v0.0.11 [c590a61e] (https://signalwire.com)
3
- * Copyright 2018-2023 SignalWire.
1
+ (function(Fr,qo){typeof exports=="object"&&typeof module<"u"?qo(exports):typeof define=="function"&&define.amd?define(["exports"],qo):(Fr=typeof globalThis<"u"?globalThis:Fr||self,qo(Fr.CFB={}))})(this,function(Fr){"use strict";/**
2
+ * Visual Builder v0.0.12 [c449782] (https://signalwire.com)
3
+ * Copyright 2018-2024 SignalWire.
4
4
  */
5
- function ei(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 Yl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Xf={exports:{}},Ls={},qf={exports:{}},ee={};/**
5
+ function qo(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 s=Object.getOwnPropertyDescriptor(r,o);s&&Object.defineProperty(e,o,s.get?s:{enumerable:!0,get:()=>r[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}function Ba(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Xf={exports:{}},Ti={},Qf={exports:{}},oe={};/**
6
6
  * @license React
7
7
  * react.production.min.js
8
8
  *
@@ -10,7 +10,7 @@ function ei(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&
10
10
  *
11
11
  * This source code is licensed under the MIT license found in the
12
12
  * LICENSE file in the root directory of this source tree.
13
- */var ti=Symbol.for("react.element"),x_=Symbol.for("react.portal"),R_=Symbol.for("react.fragment"),N_=Symbol.for("react.strict_mode"),w_=Symbol.for("react.profiler"),O_=Symbol.for("react.provider"),T_=Symbol.for("react.context"),A_=Symbol.for("react.forward_ref"),I_=Symbol.for("react.suspense"),b_=Symbol.for("react.memo"),C_=Symbol.for("react.lazy"),Jf=Symbol.iterator;function L_(e){return e===null||typeof e!="object"?null:(e=Jf&&e[Jf]||e["@@iterator"],typeof e=="function"?e:null)}var Zf={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ep=Object.assign,tp={};function zr(e,t,n){this.props=e,this.context=t,this.refs=tp,this.updater=n||Zf}zr.prototype.isReactComponent={},zr.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},zr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function np(){}np.prototype=zr.prototype;function Kl(e,t,n){this.props=e,this.context=t,this.refs=tp,this.updater=n||Zf}var Ql=Kl.prototype=new np;Ql.constructor=Kl,ep(Ql,zr.prototype),Ql.isPureReactComponent=!0;var rp=Array.isArray,op=Object.prototype.hasOwnProperty,Xl={current:null},ip={key:!0,ref:!0,__self:!0,__source:!0};function sp(e,t,n){var r,o={},i=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)op.call(t,r)&&!ip.hasOwnProperty(r)&&(o[r]=t[r]);var a=arguments.length-2;if(a===1)o.children=n;else if(1<a){for(var l=Array(a),c=0;c<a;c++)l[c]=arguments[c+2];o.children=l}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)o[r]===void 0&&(o[r]=a[r]);return{$$typeof:ti,type:e,key:i,ref:s,props:o,_owner:Xl.current}}function D_(e,t){return{$$typeof:ti,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function ql(e){return typeof e=="object"&&e!==null&&e.$$typeof===ti}function k_(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var ap=/\/+/g;function Jl(e,t){return typeof e=="object"&&e!==null&&e.key!=null?k_(""+e.key):t.toString(36)}function Ds(e,t,n,r,o){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(i){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case ti:case x_:s=!0}}if(s)return s=e,o=o(s),e=r===""?"."+Jl(s,0):r,rp(o)?(n="",e!=null&&(n=e.replace(ap,"$&/")+"/"),Ds(o,t,n,"",function(c){return c})):o!=null&&(ql(o)&&(o=D_(o,n+(!o.key||s&&s.key===o.key?"":(""+o.key).replace(ap,"$&/")+"/")+e)),t.push(o)),1;if(s=0,r=r===""?".":r+":",rp(e))for(var a=0;a<e.length;a++){i=e[a];var l=r+Jl(i,a);s+=Ds(i,t,n,l,o)}else if(l=L_(e),typeof l=="function")for(e=l.call(e),a=0;!(i=e.next()).done;)i=i.value,l=r+Jl(i,a++),s+=Ds(i,t,n,l,o);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function ks(e,t,n){if(e==null)return e;var r=[],o=0;return Ds(e,r,"","",function(i){return t.call(n,i,o++)}),r}function P_(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Ye={current:null},Ps={transition:null},M_={ReactCurrentDispatcher:Ye,ReactCurrentBatchConfig:Ps,ReactCurrentOwner:Xl};ee.Children={map:ks,forEach:function(e,t,n){ks(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return ks(e,function(){t++}),t},toArray:function(e){return ks(e,function(t){return t})||[]},only:function(e){if(!ql(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},ee.Component=zr,ee.Fragment=R_,ee.Profiler=w_,ee.PureComponent=Kl,ee.StrictMode=N_,ee.Suspense=I_,ee.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=M_,ee.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=ep({},e.props),o=e.key,i=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,s=Xl.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)op.call(t,l)&&!ip.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&a!==void 0?a[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var c=0;c<l;c++)a[c]=arguments[c+2];r.children=a}return{$$typeof:ti,type:e.type,key:o,ref:i,props:r,_owner:s}},ee.createContext=function(e){return e={$$typeof:T_,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:O_,_context:e},e.Consumer=e},ee.createElement=sp,ee.createFactory=function(e){var t=sp.bind(null,e);return t.type=e,t},ee.createRef=function(){return{current:null}},ee.forwardRef=function(e){return{$$typeof:A_,render:e}},ee.isValidElement=ql,ee.lazy=function(e){return{$$typeof:C_,_payload:{_status:-1,_result:e},_init:P_}},ee.memo=function(e,t){return{$$typeof:b_,type:e,compare:t===void 0?null:t}},ee.startTransition=function(e){var t=Ps.transition;Ps.transition={};try{e()}finally{Ps.transition=t}},ee.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},ee.useCallback=function(e,t){return Ye.current.useCallback(e,t)},ee.useContext=function(e){return Ye.current.useContext(e)},ee.useDebugValue=function(){},ee.useDeferredValue=function(e){return Ye.current.useDeferredValue(e)},ee.useEffect=function(e,t){return Ye.current.useEffect(e,t)},ee.useId=function(){return Ye.current.useId()},ee.useImperativeHandle=function(e,t,n){return Ye.current.useImperativeHandle(e,t,n)},ee.useInsertionEffect=function(e,t){return Ye.current.useInsertionEffect(e,t)},ee.useLayoutEffect=function(e,t){return Ye.current.useLayoutEffect(e,t)},ee.useMemo=function(e,t){return Ye.current.useMemo(e,t)},ee.useReducer=function(e,t,n){return Ye.current.useReducer(e,t,n)},ee.useRef=function(e){return Ye.current.useRef(e)},ee.useState=function(e){return Ye.current.useState(e)},ee.useSyncExternalStore=function(e,t,n){return Ye.current.useSyncExternalStore(e,t,n)},ee.useTransition=function(){return Ye.current.useTransition()},ee.version="18.2.0",qf.exports=ee;var w=qf.exports;const Wr=Yl(w),lp=ei({__proto__:null,default:Wr},[w]);/**
13
+ */var Jo=Symbol.for("react.element"),Qv=Symbol.for("react.portal"),qv=Symbol.for("react.fragment"),Jv=Symbol.for("react.strict_mode"),Zv=Symbol.for("react.profiler"),e_=Symbol.for("react.provider"),t_=Symbol.for("react.context"),n_=Symbol.for("react.forward_ref"),r_=Symbol.for("react.suspense"),o_=Symbol.for("react.memo"),s_=Symbol.for("react.lazy"),qf=Symbol.iterator;function i_(e){return e===null||typeof e!="object"?null:(e=qf&&e[qf]||e["@@iterator"],typeof e=="function"?e:null)}var Jf={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Zf=Object.assign,ep={};function jr(e,t,n){this.props=e,this.context=t,this.refs=ep,this.updater=n||Jf}jr.prototype.isReactComponent={},jr.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},jr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function tp(){}tp.prototype=jr.prototype;function za(e,t,n){this.props=e,this.context=t,this.refs=ep,this.updater=n||Jf}var Wa=za.prototype=new tp;Wa.constructor=za,Zf(Wa,jr.prototype),Wa.isPureReactComponent=!0;var np=Array.isArray,rp=Object.prototype.hasOwnProperty,Ga={current:null},op={key:!0,ref:!0,__self:!0,__source:!0};function sp(e,t,n){var r,o={},s=null,i=null;if(t!=null)for(r in t.ref!==void 0&&(i=t.ref),t.key!==void 0&&(s=""+t.key),t)rp.call(t,r)&&!op.hasOwnProperty(r)&&(o[r]=t[r]);var l=arguments.length-2;if(l===1)o.children=n;else if(1<l){for(var a=Array(l),c=0;c<l;c++)a[c]=arguments[c+2];o.children=a}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)o[r]===void 0&&(o[r]=l[r]);return{$$typeof:Jo,type:e,key:s,ref:i,props:o,_owner:Ga.current}}function l_(e,t){return{$$typeof:Jo,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Ya(e){return typeof e=="object"&&e!==null&&e.$$typeof===Jo}function a_(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var ip=/\/+/g;function Ka(e,t){return typeof e=="object"&&e!==null&&e.key!=null?a_(""+e.key):t.toString(36)}function Ai(e,t,n,r,o){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var i=!1;if(e===null)i=!0;else switch(s){case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case Jo:case Qv:i=!0}}if(i)return i=e,o=o(i),e=r===""?"."+Ka(i,0):r,np(o)?(n="",e!=null&&(n=e.replace(ip,"$&/")+"/"),Ai(o,t,n,"",function(c){return c})):o!=null&&(Ya(o)&&(o=l_(o,n+(!o.key||i&&i.key===o.key?"":(""+o.key).replace(ip,"$&/")+"/")+e)),t.push(o)),1;if(i=0,r=r===""?".":r+":",np(e))for(var l=0;l<e.length;l++){s=e[l];var a=r+Ka(s,l);i+=Ai(s,t,n,a,o)}else if(a=i_(e),typeof a=="function")for(e=a.call(e),l=0;!(s=e.next()).done;)s=s.value,a=r+Ka(s,l++),i+=Ai(s,t,n,a,o);else if(s==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return i}function Ii(e,t,n){if(e==null)return e;var r=[],o=0;return Ai(e,r,"","",function(s){return t.call(n,s,o++)}),r}function c_(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Ke={current:null},Ci={transition:null},u_={ReactCurrentDispatcher:Ke,ReactCurrentBatchConfig:Ci,ReactCurrentOwner:Ga};oe.Children={map:Ii,forEach:function(e,t,n){Ii(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Ii(e,function(){t++}),t},toArray:function(e){return Ii(e,function(t){return t})||[]},only:function(e){if(!Ya(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},oe.Component=jr,oe.Fragment=qv,oe.Profiler=Zv,oe.PureComponent=za,oe.StrictMode=Jv,oe.Suspense=r_,oe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=u_,oe.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=Zf({},e.props),o=e.key,s=e.ref,i=e._owner;if(t!=null){if(t.ref!==void 0&&(s=t.ref,i=Ga.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(a in t)rp.call(t,a)&&!op.hasOwnProperty(a)&&(r[a]=t[a]===void 0&&l!==void 0?l[a]:t[a])}var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){l=Array(a);for(var c=0;c<a;c++)l[c]=arguments[c+2];r.children=l}return{$$typeof:Jo,type:e.type,key:o,ref:s,props:r,_owner:i}},oe.createContext=function(e){return e={$$typeof:t_,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:e_,_context:e},e.Consumer=e},oe.createElement=sp,oe.createFactory=function(e){var t=sp.bind(null,e);return t.type=e,t},oe.createRef=function(){return{current:null}},oe.forwardRef=function(e){return{$$typeof:n_,render:e}},oe.isValidElement=Ya,oe.lazy=function(e){return{$$typeof:s_,_payload:{_status:-1,_result:e},_init:c_}},oe.memo=function(e,t){return{$$typeof:o_,type:e,compare:t===void 0?null:t}},oe.startTransition=function(e){var t=Ci.transition;Ci.transition={};try{e()}finally{Ci.transition=t}},oe.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},oe.useCallback=function(e,t){return Ke.current.useCallback(e,t)},oe.useContext=function(e){return Ke.current.useContext(e)},oe.useDebugValue=function(){},oe.useDeferredValue=function(e){return Ke.current.useDeferredValue(e)},oe.useEffect=function(e,t){return Ke.current.useEffect(e,t)},oe.useId=function(){return Ke.current.useId()},oe.useImperativeHandle=function(e,t,n){return Ke.current.useImperativeHandle(e,t,n)},oe.useInsertionEffect=function(e,t){return Ke.current.useInsertionEffect(e,t)},oe.useLayoutEffect=function(e,t){return Ke.current.useLayoutEffect(e,t)},oe.useMemo=function(e,t){return Ke.current.useMemo(e,t)},oe.useReducer=function(e,t,n){return Ke.current.useReducer(e,t,n)},oe.useRef=function(e){return Ke.current.useRef(e)},oe.useState=function(e){return Ke.current.useState(e)},oe.useSyncExternalStore=function(e,t,n){return Ke.current.useSyncExternalStore(e,t,n)},oe.useTransition=function(){return Ke.current.useTransition()},oe.version="18.2.0",Qf.exports=oe;var O=Qf.exports;const H=Ba(O),lp=qo({__proto__:null,default:H},[O]);/**
14
14
  * @license React
15
15
  * react-jsx-runtime.production.min.js
16
16
  *
@@ -18,7 +18,7 @@ function ei(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&
18
18
  *
19
19
  * This source code is licensed under the MIT license found in the
20
20
  * LICENSE file in the root directory of this source tree.
21
- */var j_=w,U_=Symbol.for("react.element"),F_=Symbol.for("react.fragment"),V_=Object.prototype.hasOwnProperty,$_=j_.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,B_={key:!0,ref:!0,__self:!0,__source:!0};function cp(e,t,n){var r,o={},i=null,s=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)V_.call(t,r)&&!B_.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:U_,type:e,key:i,ref:s,props:o,_owner:$_.current}}Ls.Fragment=F_,Ls.jsx=cp,Ls.jsxs=cp,Xf.exports=Ls;var u=Xf.exports,H_=Object.create,Zl=Object.defineProperty,z_=Object.getOwnPropertyDescriptor,W_=Object.getOwnPropertyNames,G_=Object.getPrototypeOf,Y_=Object.prototype.hasOwnProperty,K_=(e,t,n)=>t in e?Zl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Q_=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),X_=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of W_(t))!Y_.call(e,o)&&o!==n&&Zl(e,o,{get:()=>t[o],enumerable:!(r=z_(t,o))||r.enumerable});return e},q_=(e,t,n)=>(n=e!=null?H_(G_(e)):{},X_(t||!e||!e.__esModule?Zl(n,"default",{value:e,enumerable:!0}):n,e)),ec=(e,t,n)=>(K_(e,typeof t!="symbol"?t+"":t,n),n),J_=Q_((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(y,g){var m=y[g];if(typeof m.bind=="function")return m.bind(y);try{return Function.prototype.bind.call(m,y)}catch{return function(){return Function.prototype.apply.apply(m,[y,arguments])}}}function a(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function l(y){return y==="debug"&&(y="log"),typeof console===r?!1:y==="trace"&&o?a:console[y]!==void 0?s(console,y):console.log!==void 0?s(console,"log"):n}function c(y,g){for(var m=0;m<i.length;m++){var _=i[m];this[_]=m<y?n:this.methodFactory(_,y,g)}this.log=this.debug}function d(y,g,m){return function(){typeof console!==r&&(c.call(this,g,m),this[y].apply(this,arguments))}}function f(y,g,m){return l(y)||d.apply(this,arguments)}function p(y,g,m){var _=this,S;g=g??"WARN";var x="loglevel";typeof y=="string"?x+=":"+y:typeof y=="symbol"&&(x=void 0);function R(A){var b=(i[A]||"silent").toUpperCase();if(!(typeof window===r||!x)){try{window.localStorage[x]=b;return}catch{}try{window.document.cookie=encodeURIComponent(x)+"="+b+";"}catch{}}}function I(){var A;if(!(typeof window===r||!x)){try{A=window.localStorage[x]}catch{}if(typeof A===r)try{var b=window.document.cookie,V=b.indexOf(encodeURIComponent(x)+"=");V!==-1&&(A=/^([^;]+)/.exec(b.slice(V))[1])}catch{}return _.levels[A]===void 0&&(A=void 0),A}}function L(){if(!(typeof window===r||!x)){try{window.localStorage.removeItem(x);return}catch{}try{window.document.cookie=encodeURIComponent(x)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}_.name=y,_.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},_.methodFactory=m||f,_.getLevel=function(){return S},_.setLevel=function(A,b){if(typeof A=="string"&&_.levels[A.toUpperCase()]!==void 0&&(A=_.levels[A.toUpperCase()]),typeof A=="number"&&A>=0&&A<=_.levels.SILENT){if(S=A,b!==!1&&R(A),c.call(_,A,y),typeof console===r&&A<_.levels.SILENT)return"No console available for logging"}else throw"log.setLevel() called with invalid level: "+A},_.setDefaultLevel=function(A){g=A,I()||_.setLevel(A,!1)},_.resetLevel=function(){_.setLevel(g,!1),L()},_.enableAll=function(A){_.setLevel(_.levels.TRACE,A)},_.disableAll=function(A){_.setLevel(_.levels.SILENT,A)};var U=I();U==null&&(U=g),_.setLevel(U,!1)}var h=new p,E={};h.getLogger=function(y){if(typeof y!="symbol"&&typeof y!="string"||y==="")throw new TypeError("You must supply a name when creating a logger.");var g=E[y];return g||(g=E[y]=new p(y,h.getLevel(),h.methodFactory)),g};var v=typeof window!==r?window.log:void 0;return h.noConflict=function(){return typeof window!==r&&window.log===h&&(window.log=v),h},h.getLoggers=function(){return E},h.default=h,h})}),Z_=q_(J_(),1),eS=()=>new Date().toISOString(),ni=Z_.default.getLogger("signalwire"),tS=ni.methodFactory;ni.methodFactory=(e,t,n)=>{let r=tS(e,t,n);return function(...o){o.unshift(eS(),"-"),r(...o)}};var nS=ni.getLevel();ni.setLevel(nS);var Ie=()=>ni,rS="/api/ai/ai_agents",oS=(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),""),up=Ie(),iS=e=>typeof e=="object"&&e!==null&&"id"in e&&"type"in e&&"data"in e&&"position"in e,sS=e=>{if(!iS(e))throw up.error("nodeToDBShape: Invalid node",e),new Error;return{data:e.data,id:e.id,position:e.position,type:e.type}},aS=e=>typeof e=="object"&&e!==null&&"id"in e&&"source"in e&&"sourceHandle"in e&&"target"in e&&"targetHandle"in e,lS=e=>{if(!aS(e))throw up.error("edgeToDBShape: Invalid edge",e),new Error;return{id:e.id,source:e.source,sourceHandle:e.sourceHandle??null,target:e.target,targetHandle:e.targetHandle??null}},dp=e=>{var t;return(t=e==null?void 0:e.trim())==null?void 0:t.toLowerCase()},Gr=e=>e.replace(/\s/g,""),tc=e=>{if(!(!e||typeof e=="string"&&e.trim().length===0))try{return JSON.parse(e)}catch{return typeof e=="string"?e.trim():e}},nc=e=>typeof e=="string"?e.trim():typeof e=="number"&&isNaN(e)||e==null||typeof e=="object"||typeof e=="function"||typeof e=="symbol"?"":String(e),cS=e=>e.split(",").map(t=>t.trim()).filter(Boolean),Ms=e=>{let t=tc(e);return t&&typeof t=="object"&&Object.keys(t).length?t:void 0},ie=()=>oS(),fp=e=>{let t=e===void 0?void 0:parseInt(e,10);return t===void 0||Number.isNaN(t)||t<=0?void 0:t},rc=({callStateEvents:e,callStateUrl:t,connections:n,defaultFrom:r,defaultTimeout:o,callOrder:i})=>{let s=fp(o),a=Gr(r),l=cS(e),c=t==null?void 0:t.trim(),d=n.map(({connectFrom:p,connectTimeout:h,connectTo:E})=>({call_state_events:l.length>0?l:void 0,call_state_url:c||void 0,from:Gr(p)||a||"%{call.from}",timeout:fp(h)??s,to:Gr(E)}));d.length||d.push({from:"%{call.from}",timeout:void 0,to:""});let f={switch:{case:{connected:[]},default:[{switch:{case:{busy:[],decline:[],error:[],noAnswer:[]},default:["hangup"],variable:"connect_failed_reason"}}],variable:"connect_result"}};switch(i){case"single":return[{connect:d[0]},f];case"serial":return[{connect:{serial:d}},f];case"parallel":return[{connect:{parallel:d}},f];default:return Ie().warn(`The type '${i}' is not supported yet.`),[{connect:d[0]},f]}},uS=/\bmale\b/i,dS=/\bfemale\b/i,fS=e=>{if(e){if(dS.test(e))return"female";if(uS.test(e))return"male"}},pp=(e,t)=>{if(typeof e=="object"&&!Array.isArray(e)){t.language&&(e.say_language=t.language);let n=fS(t.gender);n&&(e.say_gender=n),t.voice&&(e.say_voice=t.voice)}return e},hp=(e,t)=>{var n,r;if(typeof e=="object"&&!Array.isArray(e)){let o="url"in e?e.url:e.play,i,s=(n=t.text)==null?void 0:n.trim();if(Array.isArray(t.url)){let a=t.url.map(l=>l==null?void 0:l.trim()).filter(Boolean);i=(a==null?void 0:a.length)===1?a[0]:a}else i=(r=t.url)==null?void 0:r.trim();(!t.selected||t.selected==="url")&&i?o=i:(!t.selected||t.selected==="text")&&s&&(o=`say:${s}`),"url"in e?e.url=o:e.play=o}return e},pS={aiAgent:({data:{agent:e}})=>({ai:{agent:e}}),answer:({data:{maxDuration:e}})=>e?{answer:{max_duration:e}}:"answer",cond:()=>({cond:[]}),condRequest:({data:e})=>[{request:{body:tc(e.body),connect_timeout:e.connectTimeout,headers:Ms(e.headers),method:e.method,save_variables:e.saveVariables,timeout:e.timeout,url:e.url}},{switch:{case:{success:[]},default:[],variable:"request_result"}}],executeSWML:({data:e})=>({execute:{dest:e.dest,meta:Ms(e.meta),params:Ms(e.params),result:[]}}),forwardAddress:({data:e})=>rc(e),forwardPhone:({data:e})=>rc(e),forwardResource:({data:e})=>rc(e),handleCall:()=>"start",hangup:({data:{reason:e}})=>e?{hangup:{reason:e}}:"hangup",play:({data:e})=>{let{volume:t}=e,n=pp(hp({url:"say:Unknown TTS"},e),e);return t&&(n.volume=t),{play:n}},promptPlay:({data:e})=>{let{digitTimeout:t,initialTimeout:n,options:r,volume:o}=e,i=pp(hp({play:"say:Unknown value"},e),e);o&&(i.volume=o),n&&(i.initial_timeout=parseInt(n,10)),t&&(i.digit_timeout=parseInt(t,10));let s=r.reduce((a,l)=>{let c=dp(l.command);c&&a.speechHints.push(c);let d=Gr(l.digit);return d&&(a.maxDigits=Math.max(a.maxDigits,d.length)),a},{maxDigits:-1,speechHints:[]});return s.speechHints.length&&(i.speech_hints=s.speechHints,i.speech_language="en-US"),s.maxDigits>0&&(i.max_digits=s.maxDigits),[{prompt:i},{switch:{case:{failed:[{play:"say:Error while gathering input."},"hangup"],no_input:[],no_match:[]},default:[{switch:{case:{},default:[],variable:"prompt_value"}}],variable:"prompt_result"}}]},record:({data:e})=>{var n;let t={beep:e.beep,direction:e.direction,format:e.format,input_sensitivity:e.inputSensitivity,stereo:e.stereo,terminators:((n=e.terminators)==null?void 0:n.trim())||void 0};return e.endSilenceTimeout&&(t.end_silence_timeout=parseInt(e.endSilenceTimeout,10)),e.initialTimeout&&(t.initial_timeout=parseInt(e.initialTimeout,10)),e.maxLength&&(t.max_length=parseInt(e.maxLength,10)),{record:t}},recordCallStart:({data:e})=>{var t;return{record_call:{beep:e.beep,control_id:e.controlId,direction:e.direction,format:e.format,input_sensitivity:e.inputSensitivity,stereo:e.stereo,terminators:((t=e.terminators)==null?void 0:t.trim())||void 0}}},recordCallStop:({data:e})=>({stop_record_call:e.controlId}),request:({data:e})=>[{request:{body:tc(e.body),connect_timeout:e.connectTimeout,headers:Ms(e.headers),method:e.method,save_variables:e.saveVariables,timeout:e.timeout,url:e.url}},{switch:{case:{success:[]},default:[],variable:"request_result"}}],sendSms:({data:e})=>{let{fromNumber:t,toNumber:n,body:r}=e;return{send_sms:{body:r,from_number:Gr(t),to_number:Gr(n)}}},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)})},dr=e=>{try{return pS[e.__type](e.node)}catch(t){throw Ie().error("Unknown Verb",e),t}},hS="1.0.0",gS=e=>{let t=Ie(),n=new Set,r=new Map,o=new Set,i=new Map([["main",[]]]),s=new Map,a="",l=S=>i.has(S),c=S=>o.has(S),d=S=>o.add(S);e.nodes.forEach(S=>{r.set(S.id,{children:[],node:S}),S.type==="handleCall"&&(a=S.id)}),e.edges.forEach(S=>{let x=r.get(S.source),R=r.get(S.target);if(!x||!R)return t.warn("Invalid edge:",S);x.children.push(S.target),S.sourceHandle&&s.set(S.sourceHandle,R),n.has(S.target)&&i.set(S.target,[]),n.add(S.target)});let f=[...i.keys()],p=(S,x)=>{var I,L,U;let R=s.get(x.id);if(R){let A=[];i.set(x.id,A),x.digit&&(S[x.digit]=A);let b=dp(x.command);b&&(S[b]=A);let V=l(R.node.id);if(V){let M={transfer:R.node.id};x.digit&&((I=S[x.digit])==null||I.push(M)),b&&!((L=S[b])!=null&&L.includes(M))&&((U=S[b])==null||U.push(M))}g({current:R,sectionName:V?R.node.id:x.id})}return S},h=(S,x)=>{var I;let R=s.get(x.id);if(R){let L=[];i.set(x.id,L),S[x.result]=L;let U=l(R.node.id);U&&((I=S[x.result])==null||I.push({transfer:R.node.id})),g({current:R,sectionName:U?R.node.id:x.id})}return S},E={else:(S,x)=>{if(x.result==="success")return S;let R=s.get(x.id);if(R){let I=[];i.set(x.id,I),S=I;let L=l(R.node.id);L&&S.push({transfer:R.node.id}),g({current:R,sectionName:L?R.node.id:x.id})}return S},then:(S,x)=>{if(x.result!=="success")return S;let R=s.get(x.id);if(R){let I=[];i.set(x.id,I),S=I;let L=l(R.node.id);L&&S.push({transfer:R.node.id}),g({current:R,sectionName:L?R.node.id:x.id})}return S}},v={fallback:S=>{let x=s.get(S),R={else:[]};if(x){let I=[];i.set(S,I),R.else=I;let L=l(x.node.id);L&&R.else.push({transfer:x.node.id}),g({current:x,sectionName:L?x.node.id:S})}return R},options:(S,x)=>{let R=s.get(x.id),I={then:[],when:x.value};if(R){let L=[];i.set(x.id,L),I.then=L;let U=l(R.node.id);U&&I.then.push({transfer:R.node.id}),S.push(I),g({current:R,sectionName:U?R.node.id:x.id})}return S}},y=S=>{let x=s.get(S),R=[];if(x){let I=[];i.set(S,I),R=I;let L=l(x.node.id);L&&R.push({transfer:x.node.id}),g({current:x,sectionName:L?x.node.id:S})}return R},g=({sectionName:S,current:x})=>{var I,L,U;if(c(x.node.id))return;d(x.node.id);let R=i.get(S);if(!R){t.warn("Unknown section name:",S);return}switch(x.node.type){case"promptPlay":{let A=dr({__type:x.node.type,node:x.node});if(!Array.isArray(A)){t.warn("Invalid gather node",A);return}(L=(I=x.node.data)==null?void 0:I.results)!=null&&L.length&&(A[1].switch.case={...A[1].switch.case,...x.node.data.results.reduce(h,{})}),A[1].switch.default[0].switch.case=x.node.data.options.reduce(p,{}),(U=A[1].switch.case)!=null&&U.no_match&&(A[1].switch.default[0].switch.default=A[1].switch.case.no_match),R.push(...A);return}case"cond":{let A=dr({__type:x.node.type,node:x.node});A.cond=x.node.data.options.reduce(v.options,[]),A.cond.push(v.fallback(x.node.data.fallback)),R.push(A);return}case"condRequest":{let A=dr({__type:x.node.type,node:x.node}),b=x.node.data.options.reduce(v.options,[]),V=v.fallback(x.node.data.fallback),M={cond:[...b,V]};A[1].switch.case.success=[M],A[1].switch.default=y(x.node.data.error),R.push(...A);return}case"executeSWML":{let A=dr({__type:x.node.type,node:x.node}),b=x.node.data.options.reduce(v.options,[]),V=v.fallback(x.node.data.fallback);A.execute.result=[...b,V],R.push(A);return}case"forwardPhone":case"forwardAddress":case"forwardResource":{let A=dr({__type:x.node.type,node:x.node});if(!Array.isArray(A)){t.warn("Invalid connect node",A);return}x.node.data.options.length&&(A[1].switch.case.connected=x.node.data.options.reduce(E.then,[]),A[1].switch.default[0].switch.case=x.node.data.options.filter(b=>b.result!=="success").reduce(h,{})),R.push(...A);return}case"request":{let A=dr({__type:x.node.type,node:x.node});if(!Array.isArray(A)){t.warn("Invalid request node",A);return}A[1].switch.case.success=x.node.data.options.reduce(E.then,[]),A[1].switch.default=x.node.data.options.reduce(E.else,[]),R.push(...A);return}default:{let A=dr({__type:x.node.type,node:x.node});x.node.type!=="handleCall"&&R.push(A),x.children.forEach(b=>{let V=r.get(b);if(!V)return t.warn("Invalid Child Node",b);let M=l(b);M&&R.push({transfer:b}),g({current:V,sectionName:M?b:S})});break}}},m=r.get(a);m&&g({current:m,sectionName:"main"});let _={};return f.forEach(S=>{let x=i.get(S);x&&(_[S]=x)}),t.debug("sections",JSON.stringify(_)),{sections:_,version:hS}},mS=class __ extends Error{constructor(t,n){super(n),this.code=t,this.message=n,ec(this,"name","AuthError"),Object.setPrototypeOf(this,__.prototype)}},ES=class S_ extends Error{constructor(t,n,r){super(n),this.code=t,this.message=n,this.response=r,ec(this,"name","HttpError"),Object.setPrototypeOf(this,S_.prototype)}};async function vS(e,t){let n=await fetch(e,t);if(!n.ok){if(n.status===401)throw new mS(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 ES(n.status,o,r)}try{n.parsedBody??(n.parsedBody=await n.json())}catch{}return n}var yS=({timeout:e=3e4,...t},n=vS)=>async(r,o)=>{let i={...o!=null&&o.body?{"Content-Type":"application/json"}:{},...t.headers,...o==null?void 0:o.headers},s=SS({...t,...o,headers:i});s.credentials="same-origin";let a;if(e){let l=new AbortController,c=l.signal;s.signal=c,a=setTimeout(()=>{l.abort()},e)}try{return{body:(await n(xS({searchParams:o==null?void 0:o.searchParams,url:r}),s)).parsedBody}}finally{a&&clearTimeout(a)}},_S=e=>typeof e=="string"?e:JSON.stringify(e),SS=e=>Object.entries(e).reduce((t,[n,r])=>n==="body"?{...t,body:_S(r)}:r!=null?{...t,[n]:r}:t,{}),xS=({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()},gp=e=>{let t=Ie(),n=yS(e);return{deployFlow:async r=>{if(!e.deployFlowURL)throw new Error("deployFlowURL is not defined");let o={document_version:r.documentVersion},i=await n(e.deployFlowURL,{body:o,method:"POST"});return t.info("deployFlow",i.body),i.body},getAiAgents:async()=>{try{if(!e.getAiAgentsURL)throw new Error("getAiAgentsURL is not defined");let{body:r}=await n(e.getAiAgentsURL);return t.info("getAiAgents",r),r}catch(r){throw t.error("Could not load AI agents. URL:",e.getAiAgentsURL),r}},getFlow:async()=>{try{if(!e.getFlowURL)throw new Error("getFlowURL is not defined");let{body:r}=await n(e.getFlowURL);return t.info("getFlow",r),r}catch(r){if(t.error("Could not load flow. URL:",e.getFlowURL),r instanceof Error)throw r;return{}}},getFlowVersions:async(r={})=>{if(!e.deployFlowURL)throw new Error("deployFlowURL is not defined");let{pageNumber:o,pageSize:i}=r,s=new URLSearchParams;o&&s.append("page_number",String(o)),i&&s.append("page_size",String(i));let a=s.toString(),l=e.deployFlowURL+(a?`?${a}`:"");try{let{body:c}=await n(l);return t.info("getFlowVersions",c),c.data}catch(c){throw t.error("Could not load flow versions. URL:",l),c}},putFlow:async r=>{if(!e.updateFlowURL)throw new Error("updateFlowURL is not defined");let o={type:"call_flow",document_version:r.documentVersion+1,flow_data:{flowDataVersion:r.flowDataVersion,nodes:r.nodes.map(sS),edges:r.edges.map(lS)},relayml:gS({nodes:r.nodes,edges:r.edges})},i=await n(e.updateFlowURL,{body:o,method:"PUT"});return t.info("putFlow",i.body),i.body}}},oc=[{from:"0.0.0",to:"0.0.1",run:e=>(e.nodes=e.nodes.map(t=>("missingRequiredParams"in t.data&&delete t.data.missingRequiredParams,t.data.initial=!1,"initialTimeout"in t.data&&(t.data.initialTimeout=nc(t.data.initialTimeout)),(t.type==="play"||t.type==="promptPlay")&&"selected"in t.data&&!t.data.selected&&(t.data.url?t.data.selected="url":t.data.text&&(t.data.selected="text")),t)),e)},{from:"0.0.1",to:"0.0.2",run:e=>(e.nodes=e.nodes.map(t=>{if("terminators"in t.data){let{terminators:n=""}=t.data;n.trim()||delete t.data.terminators}return t}),e)},{from:"0.0.2",to:"0.0.3",run:e=>(e.nodes=e.nodes.map(t=>{if(t.type==="forwardAddress"||t.type==="forwardPhone"||t.type==="forwardResource"){let{destinations:n=[],destinationType:r,initial:o,options:i,sessionTimeout:s,type:a,valid:l}=t.data,c=n.map(d=>({connectFrom:"",connectTimeout:"",connectTo:d,id:ie()}));t.data={callOrder:a,connections:c,defaultFrom:"",defaultTimeout:s?`${s}`:"",destinationType:r,initial:o,options:i,valid:l===void 0||l}}return t}),e)},{from:"0.0.3",to:"0.0.4",run:e=>(e.nodes=e.nodes.map(t=>((t.type==="answer"||t.type==="handleCall"||t.type==="hangup")&&(t.data.valid=!0),t)),e)},{from:"0.0.4",to:"0.0.5",run:e=>(e.nodes=e.nodes.map(t=>((t.type==="forwardAddress"||t.type==="forwardPhone"||t.type==="forwardResource")&&(t.data={callStateEvents:"",callStateUrl:"",...t.data}),t)),e)},{from:"0.0.5",to:"0.0.6",run:e=>(e&&"builderVersion"in e&&typeof e.builderVersion=="string"&&(e.flowDataVersion=e.builderVersion,delete e.builderVersion),e)},{from:"0.0.6",to:"0.0.7",run:e=>(e.nodes=e.nodes.map(t=>{if((t.type==="forwardAddress"||t.type==="forwardPhone"||t.type==="forwardResource")&&"connections"in t.data&&"connections"in t.data){let n=()=>({connectFrom:"",connectTimeout:"",connectTo:"",id:ie()});t.data.connections.length===0&&(t.data.connections=[n()],t.data.valid=!1)}return t}),e)},{from:"0.0.7",to:"0.0.8",run:e=>(e.nodes=e.nodes.map(t=>(t.type==="promptPlay"&&!("digitTimeout"in t.data)&&(t.data={...t.data,digitTimeout:""}),t)),e)},{from:"0.0.8",to:"0.0.9",run:e=>(e.nodes=e.nodes.map(t=>(t.type==="record"&&(t.data={endSilenceTimeout:"",initialTimeout:"",maxLength:"",...t.data}),t)),e)}],RS=e=>{let t=oc.findIndex(n=>n.from===e);return t>=0?oc.slice(t):oc},mp=class{constructor({dbRecord:t}){ec(this,"dbRecord"),this.dbRecord=t}get logger(){return Ie()}get flowData(){return this.dbRecord.flow_data}set flowData(t){this.dbRecord.flow_data=t}updateToVersion(t){this.flowData&&("builderVersion"in this.flowData?this.flowData.builderVersion=t:"flowDataVersion"in this.flowData&&(this.flowData.flowDataVersion=t))}versionFrom(){let t="";return this.flowData&&("builderVersion"in this.flowData?t=this.flowData.builderVersion:"flowDataVersion"in this.flowData&&(t=this.flowData.flowDataVersion)),t}migrateTo(t){let n=this.versionFrom();if(this.flowData&&n!==t){this.logger.info(`Migrate data from "${n}" to "${t}"`);let r=RS(n);for(let{run:o,to:i}of r){try{this.flowData=o(this.flowData),this.updateToVersion(i)}catch(s){console.error("Run migration:",s)}if(i===t)break}this.logger.debug("Migrated flow data",this.flowData)}else this.logger.info("Flow data up to date. No need to migrate!");return this.dbRecord}},ic={},Ep={exports:{}},ut={},vp={exports:{}},yp={};/**
21
+ */var d_=O,f_=Symbol.for("react.element"),p_=Symbol.for("react.fragment"),h_=Object.prototype.hasOwnProperty,m_=d_.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,g_={key:!0,ref:!0,__self:!0,__source:!0};function ap(e,t,n){var r,o={},s=null,i=null;n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(i=t.ref);for(r in t)h_.call(t,r)&&!g_.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:f_,type:e,key:s,ref:i,props:o,_owner:m_.current}}Ti.Fragment=p_,Ti.jsx=ap,Ti.jsxs=ap,Xf.exports=Ti;var d=Xf.exports,E_=Object.create,Xa=Object.defineProperty,y_=Object.getOwnPropertyDescriptor,v_=Object.getOwnPropertyNames,__=Object.getPrototypeOf,S_=Object.prototype.hasOwnProperty,x_=(e,t,n)=>t in e?Xa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,R_=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),N_=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of v_(t))!S_.call(e,o)&&o!==n&&Xa(e,o,{get:()=>t[o],enumerable:!(r=y_(t,o))||r.enumerable});return e},w_=(e,t,n)=>(n=e!=null?E_(__(e)):{},N_(t||!e||!e.__esModule?Xa(n,"default",{value:e,enumerable:!0}):n,e)),Qa=(e,t,n)=>(x_(e,typeof t!="symbol"?t+"":t,n),n),O_=R_((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),s=["trace","debug","info","warn","error"];function i(v,m){var g=v[m];if(typeof g.bind=="function")return g.bind(v);try{return Function.prototype.bind.call(g,v)}catch{return function(){return Function.prototype.apply.apply(g,[v,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(v){return v==="debug"&&(v="log"),typeof console===r?!1:v==="trace"&&o?l:console[v]!==void 0?i(console,v):console.log!==void 0?i(console,"log"):n}function c(v,m){for(var g=0;g<s.length;g++){var S=s[g];this[S]=g<v?n:this.methodFactory(S,v,m)}this.log=this.debug}function u(v,m,g){return function(){typeof console!==r&&(c.call(this,m,g),this[v].apply(this,arguments))}}function f(v,m,g){return a(v)||u.apply(this,arguments)}function p(v,m,g){var S=this,_;m=m??"WARN";var x="loglevel";typeof v=="string"?x+=":"+v:typeof v=="symbol"&&(x=void 0);function R(I){var j=(s[I]||"silent").toUpperCase();if(!(typeof window===r||!x)){try{window.localStorage[x]=j;return}catch{}try{window.document.cookie=encodeURIComponent(x)+"="+j+";"}catch{}}}function T(){var I;if(!(typeof window===r||!x)){try{I=window.localStorage[x]}catch{}if(typeof I===r)try{var j=window.document.cookie,V=j.indexOf(encodeURIComponent(x)+"=");V!==-1&&(I=/^([^;]+)/.exec(j.slice(V))[1])}catch{}return S.levels[I]===void 0&&(I=void 0),I}}function L(){if(!(typeof window===r||!x)){try{window.localStorage.removeItem(x);return}catch{}try{window.document.cookie=encodeURIComponent(x)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}S.name=v,S.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},S.methodFactory=g||f,S.getLevel=function(){return _},S.setLevel=function(I,j){if(typeof I=="string"&&S.levels[I.toUpperCase()]!==void 0&&(I=S.levels[I.toUpperCase()]),typeof I=="number"&&I>=0&&I<=S.levels.SILENT){if(_=I,j!==!1&&R(I),c.call(S,I,v),typeof console===r&&I<S.levels.SILENT)return"No console available for logging"}else throw"log.setLevel() called with invalid level: "+I},S.setDefaultLevel=function(I){m=I,T()||S.setLevel(I,!1)},S.resetLevel=function(){S.setLevel(m,!1),L()},S.enableAll=function(I){S.setLevel(S.levels.TRACE,I)},S.disableAll=function(I){S.setLevel(S.levels.SILENT,I)};var P=T();P==null&&(P=m),S.setLevel(P,!1)}var h=new p,E={};h.getLogger=function(v){if(typeof v!="symbol"&&typeof v!="string"||v==="")throw new TypeError("You must supply a name when creating a logger.");var m=E[v];return m||(m=E[v]=new p(v,h.getLevel(),h.methodFactory)),m};var y=typeof window!==r?window.log:void 0;return h.noConflict=function(){return typeof window!==r&&window.log===h&&(window.log=y),h},h.getLoggers=function(){return E},h.default=h,h})}),T_="/api/ai/ai_agents",A_=w_(O_(),1),I_=()=>new Date().toISOString(),Zo=A_.default.getLogger("signalwire"),C_=Zo.methodFactory;Zo.methodFactory=(e,t,n)=>{let r=C_(e,t,n);return function(...o){o.unshift(I_(),"-"),r(...o)}};var L_=Zo.getLevel();Zo.setLevel(L_);var Ne=()=>Zo,b_=(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),""),qa=Ne(),D_=e=>typeof e=="object"&&e!==null&&"id"in e&&"type"in e&&"data"in e&&"position"in e,k_=e=>{if(!D_(e))throw qa.error("nodeToDBShape: Invalid node",e),new Error;return{data:e.data,id:e.id,position:e.position,type:e.type}},P_=e=>typeof e=="object"&&e!==null&&"id"in e&&"source"in e&&"sourceHandle"in e&&"target"in e&&"targetHandle"in e,M_=e=>{if(!P_(e))throw qa.error("edgeToDBShape: Invalid edge",e),new Error;return{id:e.id,source:e.source,sourceHandle:e.sourceHandle??null,target:e.target,targetHandle:e.targetHandle??null}},cp=e=>{var t;return(t=e==null?void 0:e.trim())==null?void 0:t.toLowerCase()},Vr=e=>e.replace(/\s/g,""),Ja=e=>{if(!(!e||typeof e=="string"&&e.trim().length===0))try{return JSON.parse(e)}catch{return typeof e=="string"?e.trim():e}},Za=e=>typeof e=="string"?e.trim():typeof e=="number"&&isNaN(e)||e==null||typeof e=="object"||typeof e=="function"||typeof e=="symbol"?"":String(e),U_=e=>e.split(",").map(t=>t.trim()).filter(Boolean),Li=e=>{let t=Ja(e);return t&&typeof t=="object"&&Object.keys(t).length?t:void 0},le=()=>b_(),ec=(e,t)=>{try{let n=new URL(e);return t&&(Object.entries(t).forEach(([r,o])=>{o&&n.searchParams.set(r,String(o))}),n.searchParams.sort()),n.toString()}catch(n){throw qa.error("buildUrlWithParams",n),n}},up=e=>{let t=e===void 0?void 0:parseInt(e,10);return t===void 0||Number.isNaN(t)||t<=0?void 0:t},tc=({callStateEvents:e,callStateUrl:t,connections:n,defaultFrom:r,defaultTimeout:o,callOrder:s})=>{let i=up(o),l=Vr(r),a=U_(e),c=t==null?void 0:t.trim(),u=n.map(({connectConfirmUrl:p,connectConfirmEnabled:h,connectFrom:E,connectTimeout:y,connectTo:v})=>({call_state_events:a.length>0?a:void 0,call_state_url:c||void 0,confirm:h?p:void 0,from:Vr(E)||l||"%{call.from}",timeout:up(y)??i,to:Vr(v)}));u.length||u.push({from:"%{call.from}",timeout:void 0,to:""});let f={switch:{case:{connected:[]},default:[{switch:{case:{busy:[],decline:[],error:[],noAnswer:[]},default:["hangup"],variable:"connect_failed_reason"}}],variable:"connect_result"}};switch(s){case"single":return[{connect:u[0]},f];case"serial":return[{connect:{serial:u}},f];case"parallel":return[{connect:{parallel:u}},f];default:return Ne().warn(`The type '${s}' is not supported yet.`),[{connect:u[0]},f]}},F_=/\bmale\b/i,j_=/\bfemale\b/i,V_=e=>{if(e){if(j_.test(e))return"female";if(F_.test(e))return"male"}},dp=(e,t)=>{if(typeof e=="object"&&!Array.isArray(e)){t.language&&(e.say_language=t.language);let n=V_(t.gender);n&&(e.say_gender=n),t.voice&&(e.say_voice=t.voice)}return e},fp=(e,t)=>{var n,r;if(typeof e=="object"&&!Array.isArray(e)){let o="url"in e?e.url:e.play,s,i=(n=t.text)==null?void 0:n.trim();if(Array.isArray(t.url)){let l=t.url.map(a=>a==null?void 0:a.trim()).filter(Boolean);s=(l==null?void 0:l.length)===1?l[0]:l}else s=(r=t.url)==null?void 0:r.trim();(!t.selected||t.selected==="url")&&s?o=s:(!t.selected||t.selected==="text")&&i&&(o=`say:${i}`),"url"in e?e.url=o:e.play=o}return e},$_={aiAgent:({data:{agent:e}})=>({ai:{agent:e}}),answer:({data:{maxDuration:e}})=>e?{answer:{max_duration:e}}:"answer",cond:()=>({cond:[]}),condRequest:({data:e})=>[{request:{body:Ja(e.body),connect_timeout:e.connectTimeout,headers:Li(e.headers),method:e.method,save_variables:e.saveVariables,timeout:e.timeout,url:e.url}},{switch:{case:{success:[]},default:[],variable:"request_result"}}],executeSWML:({data:e})=>({execute:{dest:e.dest,meta:Li(e.meta),params:Li(e.params),result:[]}}),forwardAddress:({data:e})=>tc(e),forwardPhone:({data:e})=>tc(e),forwardResource:({data:e})=>tc(e),handleCall:()=>"start",hangup:({data:{reason:e}})=>e?{hangup:{reason:e}}:"hangup",play:({data:e})=>{let{volume:t}=e,n=dp(fp({url:"say:Unknown TTS"},e),e);return t&&(n.volume=t),{play:n}},promptPlay:({data:e})=>{let{digitTimeout:t,initialTimeout:n,options:r,volume:o}=e,s=dp(fp({play:"say:Unknown value"},e),e);o&&(s.volume=o),n&&(s.initial_timeout=parseInt(n,10)),t&&(s.digit_timeout=parseInt(t,10));let i=r.reduce((l,a)=>{let c=cp(a.command);c&&l.speechHints.push(c);let u=Vr(a.digit);return u&&(l.maxDigits=Math.max(l.maxDigits,u.length)),l},{maxDigits:-1,speechHints:[]});return i.speechHints.length&&(s.speech_hints=i.speechHints,s.speech_language="en-US"),i.maxDigits>0&&(s.max_digits=i.maxDigits),[{prompt:s},{switch:{case:{failed:[{play:"say:Error while gathering input."},"hangup"],no_input:[],no_match:[]},default:[{switch:{case:{},default:[],variable:"prompt_value"}}],variable:"prompt_result"}}]},record:({data:e})=>{var n;let t={beep:e.beep,direction:e.direction,format:e.format,input_sensitivity:e.inputSensitivity,stereo:e.stereo,terminators:((n=e.terminators)==null?void 0:n.trim())||void 0};return e.endSilenceTimeout&&(t.end_silence_timeout=parseInt(e.endSilenceTimeout,10)),e.initialTimeout&&(t.initial_timeout=parseInt(e.initialTimeout,10)),e.maxLength&&(t.max_length=parseInt(e.maxLength,10)),{record:t}},recordCallStart:({data:e})=>{var t;return{record_call:{beep:e.beep,control_id:e.controlId,direction:e.direction,format:e.format,input_sensitivity:e.inputSensitivity,stereo:e.stereo,terminators:((t=e.terminators)==null?void 0:t.trim())||void 0}}},recordCallStop:({data:e})=>({stop_record_call:e.controlId}),request:({data:e})=>[{request:{body:Ja(e.body),connect_timeout:e.connectTimeout,headers:Li(e.headers),method:e.method,save_variables:e.saveVariables,timeout:e.timeout,url:e.url}},{switch:{case:{success:[]},default:[],variable:"request_result"}}],sendSms:({data:e})=>{let{fromNumber:t,toNumber:n,body:r}=e;return{send_sms:{body:r,from_number:Vr(t),to_number:Vr(n)}}},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)})},rr=e=>{try{return $_[e.__type](e.node)}catch(t){throw Ne().error("Unknown Verb",e),t}},H_="1.0.0",B_=e=>{let t=Ne(),n=new Set,r=new Map,o=new Set,s=new Map([["main",[]]]),i=new Map,l="",a=_=>s.has(_),c=_=>o.has(_),u=_=>o.add(_);e.nodes.forEach(_=>{r.set(_.id,{children:[],node:_}),_.type==="handleCall"&&(l=_.id)}),e.edges.forEach(_=>{let x=r.get(_.source),R=r.get(_.target);if(!x||!R)return t.warn("Invalid edge:",_);x.children.push(_.target),_.sourceHandle&&i.set(_.sourceHandle,R),n.has(_.target)&&s.set(_.target,[]),n.add(_.target)});let f=[...s.keys()],p=(_,x)=>{var T,L,P;let R=i.get(x.id);if(R){let I=[];s.set(x.id,I),x.digit&&(_[x.digit]=I);let j=cp(x.command);j&&(_[j]=I);let V=a(R.node.id);if(V){let M={transfer:R.node.id};x.digit&&((T=_[x.digit])==null||T.push(M)),j&&!((L=_[j])!=null&&L.includes(M))&&((P=_[j])==null||P.push(M))}m({current:R,sectionName:V?R.node.id:x.id})}return _},h=(_,x)=>{var T;let R=i.get(x.id);if(R){let L=[];s.set(x.id,L),_[x.result]=L;let P=a(R.node.id);P&&((T=_[x.result])==null||T.push({transfer:R.node.id})),m({current:R,sectionName:P?R.node.id:x.id})}return _},E={else:(_,x)=>{if(x.result==="success")return _;let R=i.get(x.id);if(R){let T=[];s.set(x.id,T),_=T;let L=a(R.node.id);L&&_.push({transfer:R.node.id}),m({current:R,sectionName:L?R.node.id:x.id})}return _},then:(_,x)=>{if(x.result!=="success")return _;let R=i.get(x.id);if(R){let T=[];s.set(x.id,T),_=T;let L=a(R.node.id);L&&_.push({transfer:R.node.id}),m({current:R,sectionName:L?R.node.id:x.id})}return _}},y={fallback:_=>{let x=i.get(_),R={else:[]};if(x){let T=[];s.set(_,T),R.else=T;let L=a(x.node.id);L&&R.else.push({transfer:x.node.id}),m({current:x,sectionName:L?x.node.id:_})}return R},options:(_,x)=>{let R=i.get(x.id),T={then:[],when:x.value};if(R){let L=[];s.set(x.id,L),T.then=L;let P=a(R.node.id);P&&T.then.push({transfer:R.node.id}),_.push(T),m({current:R,sectionName:P?R.node.id:x.id})}return _}},v=_=>{let x=i.get(_),R=[];if(x){let T=[];s.set(_,T),R=T;let L=a(x.node.id);L&&R.push({transfer:x.node.id}),m({current:x,sectionName:L?x.node.id:_})}return R},m=({sectionName:_,current:x})=>{var T,L,P;if(c(x.node.id))return;u(x.node.id);let R=s.get(_);if(!R){t.warn("Unknown section name:",_);return}switch(x.node.type){case"promptPlay":{let I=rr({__type:x.node.type,node:x.node});if(!Array.isArray(I)){t.warn("Invalid gather node",I);return}(L=(T=x.node.data)==null?void 0:T.results)!=null&&L.length&&(I[1].switch.case={...I[1].switch.case,...x.node.data.results.reduce(h,{})}),I[1].switch.default[0].switch.case=x.node.data.options.reduce(p,{}),(P=I[1].switch.case)!=null&&P.no_match&&(I[1].switch.default[0].switch.default=I[1].switch.case.no_match),R.push(...I);return}case"cond":{let I=rr({__type:x.node.type,node:x.node});I.cond=x.node.data.options.reduce(y.options,[]),I.cond.push(y.fallback(x.node.data.fallback)),R.push(I);return}case"condRequest":{let I=rr({__type:x.node.type,node:x.node}),j=x.node.data.options.reduce(y.options,[]),V=y.fallback(x.node.data.fallback),M={cond:[...j,V]};I[1].switch.case.success=[M],I[1].switch.default=v(x.node.data.error),R.push(...I);return}case"executeSWML":{let I=rr({__type:x.node.type,node:x.node}),j=x.node.data.options.reduce(y.options,[]),V=y.fallback(x.node.data.fallback);I.execute.result=[...j,V],R.push(I);return}case"forwardPhone":case"forwardAddress":case"forwardResource":{let I=rr({__type:x.node.type,node:x.node});if(!Array.isArray(I)){t.warn("Invalid connect node",I);return}x.node.data.options.length&&(I[1].switch.case.connected=x.node.data.options.reduce(E.then,[]),I[1].switch.default[0].switch.case=x.node.data.options.filter(j=>j.result!=="success").reduce(h,{})),R.push(...I);return}case"request":{let I=rr({__type:x.node.type,node:x.node});if(!Array.isArray(I)){t.warn("Invalid request node",I);return}I[1].switch.case.success=x.node.data.options.reduce(E.then,[]),I[1].switch.default=x.node.data.options.reduce(E.else,[]),R.push(...I);return}default:{let I=rr({__type:x.node.type,node:x.node});x.node.type!=="handleCall"&&R.push(I),x.children.forEach(j=>{let V=r.get(j);if(!V)return t.warn("Invalid Child Node",j);let M=a(j);M&&R.push({transfer:j}),m({current:V,sectionName:M?j:_})});break}}},g=r.get(l);g&&m({current:g,sectionName:"main"});let S={};return f.forEach(_=>{let x=s.get(_);x&&(S[_]=x)}),t.debug("sections",JSON.stringify(S)),{sections:S,version:H_}},z_=class Kv extends Error{constructor(t,n){super(n),this.code=t,this.message=n,Qa(this,"name","AuthError"),Object.setPrototypeOf(this,Kv.prototype)}},W_=class Xv extends Error{constructor(t,n,r){super(n),this.code=t,this.message=n,this.response=r,Qa(this,"name","HttpError"),Object.setPrototypeOf(this,Xv.prototype)}};async function G_(e,t){let n=await fetch(e,t);if(!n.ok){if(n.status===401)throw new z_(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 W_(n.status,o,r)}try{n.parsedBody??(n.parsedBody=await n.json())}catch{}return n}var Y_=({timeout:e=3e4,...t},n=G_)=>async(r,o)=>{let s={...o!=null&&o.body?{"Content-Type":"application/json"}:{},...t.headers,...o==null?void 0:o.headers},i=X_({...t,...o,headers:s});i.credentials="same-origin";let l;if(e){let a=new AbortController,c=a.signal;i.signal=c,l=setTimeout(()=>{a.abort()},e)}try{return{body:(await n(Q_({searchParams:o==null?void 0:o.searchParams,url:r}),i)).parsedBody}}finally{l&&clearTimeout(l)}},K_=e=>typeof e=="string"?e:JSON.stringify(e),X_=e=>Object.entries(e).reduce((t,[n,r])=>n==="body"?{...t,body:K_(r)}:r!=null?{...t,[n]:r}:t,{}),Q_=({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()},nc=e=>{let t=Ne(),n=Y_(e);return{deployFlow:async r=>{if(!e.deployFlowURL)throw new Error("deployFlowURL is not defined");let o={document_version:r.documentVersion},s=await n(e.deployFlowURL,{body:o,method:"POST"});return t.info("deployFlow",s.body),s.body},getAiAgents:async()=>{try{if(!e.getAiAgentsURL)throw new Error("getAiAgentsURL is not defined");let{body:r}=await n(e.getAiAgentsURL);return t.info("getAiAgents",r),r}catch(r){throw t.error("Could not load AI agents. URL:",e.getAiAgentsURL),r}},getFlow:async()=>{try{if(!e.getFlowURL)throw new Error("getFlowURL is not defined");let{body:r}=await n(e.getFlowURL);return t.info("getFlow",r),r}catch(r){if(t.error("Could not load flow. URL:",e.getFlowURL),r instanceof Error)throw r;return{}}},getFlowVersions:async(r={})=>{if(!e.deployFlowURL)throw new Error("deployFlowURL is not defined");let{pageNumber:o,pageSize:s}=r,i=ec(e.deployFlowURL,{page_number:o,page_size:s});try{let{body:l}=await n(i);return t.info("getFlowVersions",l),l.data}catch(l){throw t.error("Could not load flow versions. URL:",i),l}},getSwmlScripts:async(r={})=>{try{if(!e.getSwmlScriptsURL)throw new Error("getSwmlScriptsURL is not defined");let{ids:o,name:s}=r,i=ec(e.getSwmlScriptsURL,{ids:o,name:s}),{body:l}=await n(i);return t.info("getSwmlScripts",l),l}catch(o){throw t.error("Could not load SWML scripts. URL:",e.getSwmlScriptsURL),o}},putFlow:async r=>{if(!e.updateFlowURL)throw new Error("updateFlowURL is not defined");let o={type:"call_flow",document_version:r.documentVersion+1,flow_data:{flowDataVersion:r.flowDataVersion,nodes:r.nodes.map(k_),edges:r.edges.map(M_)},relayml:B_({nodes:r.nodes,edges:r.edges})},s=await n(e.updateFlowURL,{body:o,method:"PUT"});return t.info("putFlow",s.body),s.body}}},rc=[{from:"0.0.0",to:"0.0.1",run:e=>(e.nodes=e.nodes.map(t=>("missingRequiredParams"in t.data&&delete t.data.missingRequiredParams,t.data.initial=!1,"initialTimeout"in t.data&&(t.data.initialTimeout=Za(t.data.initialTimeout)),(t.type==="play"||t.type==="promptPlay")&&"selected"in t.data&&!t.data.selected&&(t.data.url?t.data.selected="url":t.data.text&&(t.data.selected="text")),t)),e)},{from:"0.0.1",to:"0.0.2",run:e=>(e.nodes=e.nodes.map(t=>{if("terminators"in t.data){let{terminators:n=""}=t.data;n.trim()||delete t.data.terminators}return t}),e)},{from:"0.0.2",to:"0.0.3",run:e=>(e.nodes=e.nodes.map(t=>{if(t.type==="forwardAddress"||t.type==="forwardPhone"||t.type==="forwardResource"){let{destinations:n=[],destinationType:r,initial:o,options:s,sessionTimeout:i,type:l,valid:a}=t.data,c=n.map(u=>({connectFrom:"",connectTimeout:"",connectTo:u,id:le()}));t.data={callOrder:l,connections:c,defaultFrom:"",defaultTimeout:i?`${i}`:"",destinationType:r,initial:o,options:s,valid:a===void 0||a}}return t}),e)},{from:"0.0.3",to:"0.0.4",run:e=>(e.nodes=e.nodes.map(t=>((t.type==="answer"||t.type==="handleCall"||t.type==="hangup")&&(t.data.valid=!0),t)),e)},{from:"0.0.4",to:"0.0.5",run:e=>(e.nodes=e.nodes.map(t=>((t.type==="forwardAddress"||t.type==="forwardPhone"||t.type==="forwardResource")&&(t.data={callStateEvents:"",callStateUrl:"",...t.data}),t)),e)},{from:"0.0.5",to:"0.0.6",run:e=>(e&&"builderVersion"in e&&typeof e.builderVersion=="string"&&(e.flowDataVersion=e.builderVersion,delete e.builderVersion),e)},{from:"0.0.6",to:"0.0.7",run:e=>(e.nodes=e.nodes.map(t=>{if((t.type==="forwardAddress"||t.type==="forwardPhone"||t.type==="forwardResource")&&"connections"in t.data&&"connections"in t.data){let n=()=>({connectFrom:"",connectTimeout:"",connectTo:"",id:le()});t.data.connections.length===0&&(t.data.connections=[n()],t.data.valid=!1)}return t}),e)},{from:"0.0.7",to:"0.0.8",run:e=>(e.nodes=e.nodes.map(t=>(t.type==="promptPlay"&&!("digitTimeout"in t.data)&&(t.data={...t.data,digitTimeout:""}),t)),e)},{from:"0.0.8",to:"0.0.9",run:e=>(e.nodes=e.nodes.map(t=>(t.type==="record"&&(t.data={endSilenceTimeout:"",initialTimeout:"",maxLength:"",...t.data}),t)),e)},{from:"0.0.9",to:"0.0.10",run:e=>(e.nodes=e.nodes.map(t=>((t.type==="forwardAddress"||t.type==="forwardPhone"||t.type==="forwardResource")&&"connections"in t.data&&"connections"in t.data&&(t.data.connections=t.data.connections.map(n=>({connectConfirmDisplayName:"",connectConfirmEnabled:!1,connectConfirmId:"",connectConfirmUrl:"",...n}))),t)),e)}],q_=e=>{let t=rc.findIndex(n=>n.from===e);return t>=0?rc.slice(t):rc},pp=class{constructor({dbRecord:t}){Qa(this,"dbRecord"),this.dbRecord=t}get logger(){return Ne()}get flowData(){return this.dbRecord.flow_data}set flowData(t){this.dbRecord.flow_data=t}updateToVersion(t){this.flowData&&("builderVersion"in this.flowData?this.flowData.builderVersion=t:"flowDataVersion"in this.flowData&&(this.flowData.flowDataVersion=t))}versionFrom(){let t="";return this.flowData&&("builderVersion"in this.flowData?t=this.flowData.builderVersion:"flowDataVersion"in this.flowData&&(t=this.flowData.flowDataVersion)),t}migrateTo(t){let n=this.versionFrom();if(this.flowData&&n!==t){this.logger.info(`Migrate data from "${n}" to "${t}"`);let r=q_(n);for(let{run:o,to:s}of r){try{this.flowData=o(this.flowData),this.updateToVersion(s)}catch(i){console.error("Run migration:",i)}if(s===t)break}this.logger.debug("Migrated flow data",this.flowData)}else this.logger.info("Flow data up to date. No need to migrate!");return this.dbRecord}},oc={},hp={exports:{}},dt={},mp={exports:{}},gp={};/**
22
22
  * @license React
23
23
  * scheduler.production.min.js
24
24
  *
@@ -26,7 +26,7 @@ function ei(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&
26
26
  *
27
27
  * This source code is licensed under the MIT license found in the
28
28
  * LICENSE file in the root directory of this source tree.
29
- */(function(e){function t(D,C){var k=D.length;D.push(C);e:for(;0<k;){var F=k-1>>>1,B=D[F];if(0<o(B,C))D[F]=C,D[k]=B,k=F;else break e}}function n(D){return D.length===0?null:D[0]}function r(D){if(D.length===0)return null;var C=D[0],k=D.pop();if(k!==C){D[0]=k;e:for(var F=0,B=D.length,z=B>>>1;F<z;){var W=2*(F+1)-1,X=D[W],Q=W+1,J=D[Q];if(0>o(X,k))Q<B&&0>o(J,X)?(D[F]=J,D[Q]=k,F=Q):(D[F]=X,D[W]=k,F=W);else if(Q<B&&0>o(J,k))D[F]=J,D[Q]=k,F=Q;else break e}}return C}function o(D,C){var k=D.sortIndex-C.sortIndex;return k!==0?k:D.id-C.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var l=[],c=[],d=1,f=null,p=3,h=!1,E=!1,v=!1,y=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,m=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function _(D){for(var C=n(c);C!==null;){if(C.callback===null)r(c);else if(C.startTime<=D)r(c),C.sortIndex=C.expirationTime,t(l,C);else break;C=n(c)}}function S(D){if(v=!1,_(D),!E)if(n(l)!==null)E=!0,P(x);else{var C=n(c);C!==null&&$(S,C.startTime-D)}}function x(D,C){E=!1,v&&(v=!1,g(L),L=-1),h=!0;var k=p;try{for(_(C),f=n(l);f!==null&&(!(f.expirationTime>C)||D&&!b());){var F=f.callback;if(typeof F=="function"){f.callback=null,p=f.priorityLevel;var B=F(f.expirationTime<=C);C=e.unstable_now(),typeof B=="function"?f.callback=B:f===n(l)&&r(l),_(C)}else r(l);f=n(l)}if(f!==null)var z=!0;else{var W=n(c);W!==null&&$(S,W.startTime-C),z=!1}return z}finally{f=null,p=k,h=!1}}var R=!1,I=null,L=-1,U=5,A=-1;function b(){return!(e.unstable_now()-A<U)}function V(){if(I!==null){var D=e.unstable_now();A=D;var C=!0;try{C=I(!0,D)}finally{C?M():(R=!1,I=null)}}else R=!1}var M;if(typeof m=="function")M=function(){m(V)};else if(typeof MessageChannel<"u"){var O=new MessageChannel,j=O.port2;O.port1.onmessage=V,M=function(){j.postMessage(null)}}else M=function(){y(V,0)};function P(D){I=D,R||(R=!0,M())}function $(D,C){L=y(function(){D(e.unstable_now())},C)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(D){D.callback=null},e.unstable_continueExecution=function(){E||h||(E=!0,P(x))},e.unstable_forceFrameRate=function(D){0>D||125<D?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):U=0<D?Math.floor(1e3/D):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(D){switch(p){case 1:case 2:case 3:var C=3;break;default:C=p}var k=p;p=C;try{return D()}finally{p=k}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(D,C){switch(D){case 1:case 2:case 3:case 4:case 5:break;default:D=3}var k=p;p=D;try{return C()}finally{p=k}},e.unstable_scheduleCallback=function(D,C,k){var F=e.unstable_now();switch(typeof k=="object"&&k!==null?(k=k.delay,k=typeof k=="number"&&0<k?F+k:F):k=F,D){case 1:var B=-1;break;case 2:B=250;break;case 5:B=1073741823;break;case 4:B=1e4;break;default:B=5e3}return B=k+B,D={id:d++,callback:C,priorityLevel:D,startTime:k,expirationTime:B,sortIndex:-1},k>F?(D.sortIndex=k,t(c,D),n(l)===null&&D===n(c)&&(v?(g(L),L=-1):v=!0,$(S,k-F))):(D.sortIndex=B,t(l,D),E||h||(E=!0,P(x))),D},e.unstable_shouldYield=b,e.unstable_wrapCallback=function(D){var C=p;return function(){var k=p;p=C;try{return D.apply(this,arguments)}finally{p=k}}}})(yp),vp.exports=yp;var NS=vp.exports;/**
29
+ */(function(e){function t(C,D){var U=C.length;C.push(D);e:for(;0<U;){var $=U-1>>>1,B=C[$];if(0<o(B,D))C[$]=D,C[U]=B,U=$;else break e}}function n(C){return C.length===0?null:C[0]}function r(C){if(C.length===0)return null;var D=C[0],U=C.pop();if(U!==D){C[0]=U;e:for(var $=0,B=C.length,W=B>>>1;$<W;){var z=2*($+1)-1,Y=C[z],X=z+1,Z=C[X];if(0>o(Y,U))X<B&&0>o(Z,Y)?(C[$]=Z,C[X]=U,$=X):(C[$]=Y,C[z]=U,$=z);else if(X<B&&0>o(Z,U))C[$]=Z,C[X]=U,$=X;else break e}}return D}function o(C,D){var U=C.sortIndex-D.sortIndex;return U!==0?U:C.id-D.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var i=Date,l=i.now();e.unstable_now=function(){return i.now()-l}}var a=[],c=[],u=1,f=null,p=3,h=!1,E=!1,y=!1,v=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function S(C){for(var D=n(c);D!==null;){if(D.callback===null)r(c);else if(D.startTime<=C)r(c),D.sortIndex=D.expirationTime,t(a,D);else break;D=n(c)}}function _(C){if(y=!1,S(C),!E)if(n(a)!==null)E=!0,k(x);else{var D=n(c);D!==null&&F(_,D.startTime-C)}}function x(C,D){E=!1,y&&(y=!1,m(L),L=-1),h=!0;var U=p;try{for(S(D),f=n(a);f!==null&&(!(f.expirationTime>D)||C&&!j());){var $=f.callback;if(typeof $=="function"){f.callback=null,p=f.priorityLevel;var B=$(f.expirationTime<=D);D=e.unstable_now(),typeof B=="function"?f.callback=B:f===n(a)&&r(a),S(D)}else r(a);f=n(a)}if(f!==null)var W=!0;else{var z=n(c);z!==null&&F(_,z.startTime-D),W=!1}return W}finally{f=null,p=U,h=!1}}var R=!1,T=null,L=-1,P=5,I=-1;function j(){return!(e.unstable_now()-I<P)}function V(){if(T!==null){var C=e.unstable_now();I=C;var D=!0;try{D=T(!0,C)}finally{D?M():(R=!1,T=null)}}else R=!1}var M;if(typeof g=="function")M=function(){g(V)};else if(typeof MessageChannel<"u"){var w=new MessageChannel,b=w.port2;w.port1.onmessage=V,M=function(){b.postMessage(null)}}else M=function(){v(V,0)};function k(C){T=C,R||(R=!0,M())}function F(C,D){L=v(function(){C(e.unstable_now())},D)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(C){C.callback=null},e.unstable_continueExecution=function(){E||h||(E=!0,k(x))},e.unstable_forceFrameRate=function(C){0>C||125<C?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<C?Math.floor(1e3/C):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return n(a)},e.unstable_next=function(C){switch(p){case 1:case 2:case 3:var D=3;break;default:D=p}var U=p;p=D;try{return C()}finally{p=U}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(C,D){switch(C){case 1:case 2:case 3:case 4:case 5:break;default:C=3}var U=p;p=C;try{return D()}finally{p=U}},e.unstable_scheduleCallback=function(C,D,U){var $=e.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?$+U:$):U=$,C){case 1:var B=-1;break;case 2:B=250;break;case 5:B=1073741823;break;case 4:B=1e4;break;default:B=5e3}return B=U+B,C={id:u++,callback:D,priorityLevel:C,startTime:U,expirationTime:B,sortIndex:-1},U>$?(C.sortIndex=U,t(c,C),n(a)===null&&C===n(c)&&(y?(m(L),L=-1):y=!0,F(_,U-$))):(C.sortIndex=B,t(a,C),E||h||(E=!0,k(x))),C},e.unstable_shouldYield=j,e.unstable_wrapCallback=function(C){var D=p;return function(){var U=p;p=D;try{return C.apply(this,arguments)}finally{p=U}}}})(gp),mp.exports=gp;var J_=mp.exports;/**
30
30
  * @license React
31
31
  * react-dom.production.min.js
32
32
  *
@@ -34,14 +34,14 @@ function ei(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&
34
34
  *
35
35
  * This source code is licensed under the MIT license found in the
36
36
  * LICENSE file in the root directory of this source tree.
37
- */var _p=w,dt=NS;function H(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Sp=new Set,ri={};function fr(e,t){Yr(e,t),Yr(e+"Capture",t)}function Yr(e,t){for(ri[e]=t,e=0;e<t.length;e++)Sp.add(t[e])}var dn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),sc=Object.prototype.hasOwnProperty,wS=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,xp={},Rp={};function OS(e){return sc.call(Rp,e)?!0:sc.call(xp,e)?!1:wS.test(e)?Rp[e]=!0:(xp[e]=!0,!1)}function TS(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function AS(e,t,n,r){if(t===null||typeof t>"u"||TS(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Ke(e,t,n,r,o,i,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var Me={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Me[e]=new Ke(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Me[t]=new Ke(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){Me[e]=new Ke(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Me[e]=new Ke(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Me[e]=new Ke(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){Me[e]=new Ke(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){Me[e]=new Ke(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){Me[e]=new Ke(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){Me[e]=new Ke(e,5,!1,e.toLowerCase(),null,!1,!1)});var ac=/[\-:]([a-z])/g;function lc(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(ac,lc);Me[t]=new Ke(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(ac,lc);Me[t]=new Ke(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(ac,lc);Me[t]=new Ke(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){Me[e]=new Ke(e,1,!1,e.toLowerCase(),null,!1,!1)}),Me.xlinkHref=new Ke("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){Me[e]=new Ke(e,1,!1,e.toLowerCase(),null,!0,!0)});function cc(e,t,n,r){var o=Me.hasOwnProperty(t)?Me[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(AS(t,n,o,r)&&(n=null),r||o===null?OS(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=n===null?o.type===3?!1:"":n:(t=o.attributeName,r=o.attributeNamespace,n===null?e.removeAttribute(t):(o=o.type,n=o===3||o===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var fn=_p.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,js=Symbol.for("react.element"),Kr=Symbol.for("react.portal"),Qr=Symbol.for("react.fragment"),uc=Symbol.for("react.strict_mode"),dc=Symbol.for("react.profiler"),Np=Symbol.for("react.provider"),wp=Symbol.for("react.context"),fc=Symbol.for("react.forward_ref"),pc=Symbol.for("react.suspense"),hc=Symbol.for("react.suspense_list"),gc=Symbol.for("react.memo"),An=Symbol.for("react.lazy"),Op=Symbol.for("react.offscreen"),Tp=Symbol.iterator;function oi(e){return e===null||typeof e!="object"?null:(e=Tp&&e[Tp]||e["@@iterator"],typeof e=="function"?e:null)}var Ee=Object.assign,mc;function ii(e){if(mc===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);mc=t&&t[1]||""}return`
38
- `+mc+e}var Ec=!1;function vc(e,t){if(!e||Ec)return"";Ec=!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(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var o=c.stack.split(`
39
- `),i=r.stack.split(`
40
- `),s=o.length-1,a=i.length-1;1<=s&&0<=a&&o[s]!==i[a];)a--;for(;1<=s&&0<=a;s--,a--)if(o[s]!==i[a]){if(s!==1||a!==1)do if(s--,a--,0>a||o[s]!==i[a]){var l=`
41
- `+o[s].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=s&&0<=a);break}}}finally{Ec=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?ii(e):""}function IS(e){switch(e.tag){case 5:return ii(e.type);case 16:return ii("Lazy");case 13:return ii("Suspense");case 19:return ii("SuspenseList");case 0:case 2:case 15:return e=vc(e.type,!1),e;case 11:return e=vc(e.type.render,!1),e;case 1:return e=vc(e.type,!0),e;default:return""}}function yc(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 Qr:return"Fragment";case Kr:return"Portal";case dc:return"Profiler";case uc:return"StrictMode";case pc:return"Suspense";case hc:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case wp:return(e.displayName||"Context")+".Consumer";case Np:return(e._context.displayName||"Context")+".Provider";case fc:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case gc:return t=e.displayName||null,t!==null?t:yc(e.type)||"Memo";case An:t=e._payload,e=e._init;try{return yc(e(t))}catch{}}return null}function bS(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 yc(t);case 8:return t===uc?"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 In(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ap(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function CS(e){var t=Ap(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 Us(e){e._valueTracker||(e._valueTracker=CS(e))}function Ip(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Ap(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Fs(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 _c(e,t){var n=t.checked;return Ee({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function bp(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=In(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 Cp(e,t){t=t.checked,t!=null&&cc(e,"checked",t,!1)}function Sc(e,t){Cp(e,t);var n=In(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")?xc(e,t.type,n):t.hasOwnProperty("defaultValue")&&xc(e,t.type,In(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Lp(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 xc(e,t,n){(t!=="number"||Fs(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var si=Array.isArray;function Xr(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=""+In(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 Rc(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(H(91));return Ee({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Dp(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(si(n)){if(1<n.length)throw Error(H(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:In(n)}}function kp(e,t){var n=In(t.value),r=In(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 Pp(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Mp(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 Nc(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Mp(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Vs,jp=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(Vs=Vs||document.createElement("div"),Vs.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Vs.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ai(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var li={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},LS=["Webkit","ms","Moz","O"];Object.keys(li).forEach(function(e){LS.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),li[t]=li[e]})});function Up(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||li.hasOwnProperty(e)&&li[e]?(""+t).trim():t+"px"}function Fp(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=Up(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var DS=Ee({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 wc(e,t){if(t){if(DS[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 Oc(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 Tc=null;function Ac(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ic=null,qr=null,Jr=null;function Vp(e){if(e=bi(e)){if(typeof Ic!="function")throw Error(H(280));var t=e.stateNode;t&&(t=ca(t),Ic(e.stateNode,e.type,t))}}function $p(e){qr?Jr?Jr.push(e):Jr=[e]:qr=e}function Bp(){if(qr){var e=qr,t=Jr;if(Jr=qr=null,Vp(e),t)for(e=0;e<t.length;e++)Vp(t[e])}}function Hp(e,t){return e(t)}function zp(){}var bc=!1;function Wp(e,t,n){if(bc)return e(t,n);bc=!0;try{return Hp(e,t,n)}finally{bc=!1,(qr!==null||Jr!==null)&&(zp(),Bp())}}function ci(e,t){var n=e.stateNode;if(n===null)return null;var r=ca(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 Cc=!1;if(dn)try{var ui={};Object.defineProperty(ui,"passive",{get:function(){Cc=!0}}),window.addEventListener("test",ui,ui),window.removeEventListener("test",ui,ui)}catch{Cc=!1}function kS(e,t,n,r,o,i,s,a,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(d){this.onError(d)}}var di=!1,$s=null,Bs=!1,Lc=null,PS={onError:function(e){di=!0,$s=e}};function MS(e,t,n,r,o,i,s,a,l){di=!1,$s=null,kS.apply(PS,arguments)}function jS(e,t,n,r,o,i,s,a,l){if(MS.apply(this,arguments),di){if(di){var c=$s;di=!1,$s=null}else throw Error(H(198));Bs||(Bs=!0,Lc=c)}}function pr(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 Gp(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 Yp(e){if(pr(e)!==e)throw Error(H(188))}function US(e){var t=e.alternate;if(!t){if(t=pr(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 Yp(o),e;if(i===r)return Yp(o),t;i=i.sibling}throw Error(H(188))}if(n.return!==r.return)n=o,r=i;else{for(var s=!1,a=o.child;a;){if(a===n){s=!0,n=o,r=i;break}if(a===r){s=!0,r=o,n=i;break}a=a.sibling}if(!s){for(a=i.child;a;){if(a===n){s=!0,n=i,r=o;break}if(a===r){s=!0,r=i,n=o;break}a=a.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 Kp(e){return e=US(e),e!==null?Qp(e):null}function Qp(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Qp(e);if(t!==null)return t;e=e.sibling}return null}var Xp=dt.unstable_scheduleCallback,qp=dt.unstable_cancelCallback,FS=dt.unstable_shouldYield,VS=dt.unstable_requestPaint,Re=dt.unstable_now,$S=dt.unstable_getCurrentPriorityLevel,Dc=dt.unstable_ImmediatePriority,Jp=dt.unstable_UserBlockingPriority,Hs=dt.unstable_NormalPriority,BS=dt.unstable_LowPriority,Zp=dt.unstable_IdlePriority,zs=null,Qt=null;function HS(e){if(Qt&&typeof Qt.onCommitFiberRoot=="function")try{Qt.onCommitFiberRoot(zs,e,void 0,(e.current.flags&128)===128)}catch{}}var Dt=Math.clz32?Math.clz32:GS,zS=Math.log,WS=Math.LN2;function GS(e){return e>>>=0,e===0?32:31-(zS(e)/WS|0)|0}var Ws=64,Gs=4194304;function fi(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 Ys(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 a=s&~o;a!==0?r=fi(a):(i&=s,i!==0&&(r=fi(i)))}else s=n&~o,s!==0?r=fi(s):i!==0&&(r=fi(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-Dt(t),o=1<<n,r|=e[n],t&=~o;return r}function YS(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 KS(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var s=31-Dt(i),a=1<<s,l=o[s];l===-1?(!(a&n)||a&r)&&(o[s]=YS(a,t)):l<=t&&(e.expiredLanes|=a),i&=~a}}function kc(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function eh(){var e=Ws;return Ws<<=1,!(Ws&4194240)&&(Ws=64),e}function Pc(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function pi(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Dt(t),e[t]=n}function QS(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-Dt(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}function Mc(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Dt(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var se=0;function th(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var nh,jc,rh,oh,ih,Uc=!1,Ks=[],bn=null,Cn=null,Ln=null,hi=new Map,gi=new Map,Dn=[],XS="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 sh(e,t){switch(e){case"focusin":case"focusout":bn=null;break;case"dragenter":case"dragleave":Cn=null;break;case"mouseover":case"mouseout":Ln=null;break;case"pointerover":case"pointerout":hi.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":gi.delete(t.pointerId)}}function mi(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=bi(t),t!==null&&jc(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function qS(e,t,n,r,o){switch(t){case"focusin":return bn=mi(bn,e,t,n,r,o),!0;case"dragenter":return Cn=mi(Cn,e,t,n,r,o),!0;case"mouseover":return Ln=mi(Ln,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return hi.set(i,mi(hi.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,gi.set(i,mi(gi.get(i)||null,e,t,n,r,o)),!0}return!1}function ah(e){var t=hr(e.target);if(t!==null){var n=pr(t);if(n!==null){if(t=n.tag,t===13){if(t=Gp(n),t!==null){e.blockedOn=t,ih(e.priority,function(){rh(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 Qs(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Vc(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Tc=r,n.target.dispatchEvent(r),Tc=null}else return t=bi(n),t!==null&&jc(t),e.blockedOn=n,!1;t.shift()}return!0}function lh(e,t,n){Qs(e)&&n.delete(t)}function JS(){Uc=!1,bn!==null&&Qs(bn)&&(bn=null),Cn!==null&&Qs(Cn)&&(Cn=null),Ln!==null&&Qs(Ln)&&(Ln=null),hi.forEach(lh),gi.forEach(lh)}function Ei(e,t){e.blockedOn===t&&(e.blockedOn=null,Uc||(Uc=!0,dt.unstable_scheduleCallback(dt.unstable_NormalPriority,JS)))}function vi(e){function t(o){return Ei(o,e)}if(0<Ks.length){Ei(Ks[0],e);for(var n=1;n<Ks.length;n++){var r=Ks[n];r.blockedOn===e&&(r.blockedOn=null)}}for(bn!==null&&Ei(bn,e),Cn!==null&&Ei(Cn,e),Ln!==null&&Ei(Ln,e),hi.forEach(t),gi.forEach(t),n=0;n<Dn.length;n++)r=Dn[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Dn.length&&(n=Dn[0],n.blockedOn===null);)ah(n),n.blockedOn===null&&Dn.shift()}var Zr=fn.ReactCurrentBatchConfig,Xs=!0;function ZS(e,t,n,r){var o=se,i=Zr.transition;Zr.transition=null;try{se=1,Fc(e,t,n,r)}finally{se=o,Zr.transition=i}}function ex(e,t,n,r){var o=se,i=Zr.transition;Zr.transition=null;try{se=4,Fc(e,t,n,r)}finally{se=o,Zr.transition=i}}function Fc(e,t,n,r){if(Xs){var o=Vc(e,t,n,r);if(o===null)ru(e,t,r,qs,n),sh(e,r);else if(qS(o,e,t,n,r))r.stopPropagation();else if(sh(e,r),t&4&&-1<XS.indexOf(e)){for(;o!==null;){var i=bi(o);if(i!==null&&nh(i),i=Vc(e,t,n,r),i===null&&ru(e,t,r,qs,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else ru(e,t,r,null,n)}}var qs=null;function Vc(e,t,n,r){if(qs=null,e=Ac(r),e=hr(e),e!==null)if(t=pr(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Gp(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 qs=e,null}function ch(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($S()){case Dc:return 1;case Jp:return 4;case Hs:case BS:return 16;case Zp:return 536870912;default:return 16}default:return 16}}var kn=null,$c=null,Js=null;function uh(){if(Js)return Js;var e,t=$c,n=t.length,r,o="value"in kn?kn.value:kn.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 Js=o.slice(e,1<r?1-r:void 0)}function Zs(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 ea(){return!0}function dh(){return!1}function ft(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 a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(i):i[a]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?ea:dh,this.isPropagationStopped=dh,this}return Ee(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=ea)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=ea)},persist:function(){},isPersistent:ea}),t}var eo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Bc=ft(eo),yi=Ee({},eo,{view:0,detail:0}),tx=ft(yi),Hc,zc,_i,ta=Ee({},yi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Gc,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!==_i&&(_i&&e.type==="mousemove"?(Hc=e.screenX-_i.screenX,zc=e.screenY-_i.screenY):zc=Hc=0,_i=e),Hc)},movementY:function(e){return"movementY"in e?e.movementY:zc}}),fh=ft(ta),nx=Ee({},ta,{dataTransfer:0}),rx=ft(nx),ox=Ee({},yi,{relatedTarget:0}),Wc=ft(ox),ix=Ee({},eo,{animationName:0,elapsedTime:0,pseudoElement:0}),sx=ft(ix),ax=Ee({},eo,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),lx=ft(ax),cx=Ee({},eo,{data:0}),ph=ft(cx),ux={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},dx={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"},fx={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function px(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=fx[e])?!!t[e]:!1}function Gc(){return px}var hx=Ee({},yi,{key:function(e){if(e.key){var t=ux[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Zs(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?dx[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Gc,charCode:function(e){return e.type==="keypress"?Zs(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Zs(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),gx=ft(hx),mx=Ee({},ta,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),hh=ft(mx),Ex=Ee({},yi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Gc}),vx=ft(Ex),yx=Ee({},eo,{propertyName:0,elapsedTime:0,pseudoElement:0}),_x=ft(yx),Sx=Ee({},ta,{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}),xx=ft(Sx),Rx=[9,13,27,32],Yc=dn&&"CompositionEvent"in window,Si=null;dn&&"documentMode"in document&&(Si=document.documentMode);var Nx=dn&&"TextEvent"in window&&!Si,gh=dn&&(!Yc||Si&&8<Si&&11>=Si),mh=String.fromCharCode(32),Eh=!1;function vh(e,t){switch(e){case"keyup":return Rx.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function yh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var to=!1;function wx(e,t){switch(e){case"compositionend":return yh(t);case"keypress":return t.which!==32?null:(Eh=!0,mh);case"textInput":return e=t.data,e===mh&&Eh?null:e;default:return null}}function Ox(e,t){if(to)return e==="compositionend"||!Yc&&vh(e,t)?(e=uh(),Js=$c=kn=null,to=!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 gh&&t.locale!=="ko"?null:t.data;default:return null}}var Tx={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 _h(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Tx[e.type]:t==="textarea"}function Sh(e,t,n,r){$p(r),t=sa(t,"onChange"),0<t.length&&(n=new Bc("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var xi=null,Ri=null;function Ax(e){Fh(e,0)}function na(e){var t=so(e);if(Ip(t))return e}function Ix(e,t){if(e==="change")return t}var xh=!1;if(dn){var Kc;if(dn){var Qc="oninput"in document;if(!Qc){var Rh=document.createElement("div");Rh.setAttribute("oninput","return;"),Qc=typeof Rh.oninput=="function"}Kc=Qc}else Kc=!1;xh=Kc&&(!document.documentMode||9<document.documentMode)}function Nh(){xi&&(xi.detachEvent("onpropertychange",wh),Ri=xi=null)}function wh(e){if(e.propertyName==="value"&&na(Ri)){var t=[];Sh(t,Ri,e,Ac(e)),Wp(Ax,t)}}function bx(e,t,n){e==="focusin"?(Nh(),xi=t,Ri=n,xi.attachEvent("onpropertychange",wh)):e==="focusout"&&Nh()}function Cx(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return na(Ri)}function Lx(e,t){if(e==="click")return na(t)}function Dx(e,t){if(e==="input"||e==="change")return na(t)}function kx(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var kt=typeof Object.is=="function"?Object.is:kx;function Ni(e,t){if(kt(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(!sc.call(t,o)||!kt(e[o],t[o]))return!1}return!0}function Oh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Th(e,t){var n=Oh(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=Oh(n)}}function Ah(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ah(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ih(){for(var e=window,t=Fs();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Fs(e.document)}return t}function Xc(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 Px(e){var t=Ih(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Ah(n.ownerDocument.documentElement,n)){if(r!==null&&Xc(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=Th(n,i);var s=Th(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 Mx=dn&&"documentMode"in document&&11>=document.documentMode,no=null,qc=null,wi=null,Jc=!1;function bh(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Jc||no==null||no!==Fs(r)||(r=no,"selectionStart"in r&&Xc(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}),wi&&Ni(wi,r)||(wi=r,r=sa(qc,"onSelect"),0<r.length&&(t=new Bc("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=no)))}function ra(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var ro={animationend:ra("Animation","AnimationEnd"),animationiteration:ra("Animation","AnimationIteration"),animationstart:ra("Animation","AnimationStart"),transitionend:ra("Transition","TransitionEnd")},Zc={},Ch={};dn&&(Ch=document.createElement("div").style,"AnimationEvent"in window||(delete ro.animationend.animation,delete ro.animationiteration.animation,delete ro.animationstart.animation),"TransitionEvent"in window||delete ro.transitionend.transition);function oa(e){if(Zc[e])return Zc[e];if(!ro[e])return e;var t=ro[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Ch)return Zc[e]=t[n];return e}var Lh=oa("animationend"),Dh=oa("animationiteration"),kh=oa("animationstart"),Ph=oa("transitionend"),Mh=new Map,jh="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 Pn(e,t){Mh.set(e,t),fr(t,[e])}for(var eu=0;eu<jh.length;eu++){var tu=jh[eu],jx=tu.toLowerCase(),Ux=tu[0].toUpperCase()+tu.slice(1);Pn(jx,"on"+Ux)}Pn(Lh,"onAnimationEnd"),Pn(Dh,"onAnimationIteration"),Pn(kh,"onAnimationStart"),Pn("dblclick","onDoubleClick"),Pn("focusin","onFocus"),Pn("focusout","onBlur"),Pn(Ph,"onTransitionEnd"),Yr("onMouseEnter",["mouseout","mouseover"]),Yr("onMouseLeave",["mouseout","mouseover"]),Yr("onPointerEnter",["pointerout","pointerover"]),Yr("onPointerLeave",["pointerout","pointerover"]),fr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),fr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),fr("onBeforeInput",["compositionend","keypress","textInput","paste"]),fr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),fr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),fr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Oi="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(" "),Fx=new Set("cancel close invalid load scroll toggle".split(" ").concat(Oi));function Uh(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,jS(r,t,void 0,e),e.currentTarget=null}function Fh(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 a=r[s],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==i&&o.isPropagationStopped())break e;Uh(o,a,c),i=l}else for(s=0;s<r.length;s++){if(a=r[s],l=a.instance,c=a.currentTarget,a=a.listener,l!==i&&o.isPropagationStopped())break e;Uh(o,a,c),i=l}}}if(Bs)throw e=Lc,Bs=!1,Lc=null,e}function ue(e,t){var n=t[cu];n===void 0&&(n=t[cu]=new Set);var r=e+"__bubble";n.has(r)||(Vh(t,e,2,!1),n.add(r))}function nu(e,t,n){var r=0;t&&(r|=4),Vh(n,e,r,t)}var ia="_reactListening"+Math.random().toString(36).slice(2);function Ti(e){if(!e[ia]){e[ia]=!0,Sp.forEach(function(n){n!=="selectionchange"&&(Fx.has(n)||nu(n,!1,e),nu(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ia]||(t[ia]=!0,nu("selectionchange",!1,t))}}function Vh(e,t,n,r){switch(ch(t)){case 1:var o=ZS;break;case 4:o=ex;break;default:o=Fc}n=o.bind(null,t,n,e),o=void 0,!Cc||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 a=r.stateNode.containerInfo;if(a===o||a.nodeType===8&&a.parentNode===o)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&(l=s.stateNode.containerInfo,l===o||l.nodeType===8&&l.parentNode===o))return;s=s.return}for(;a!==null;){if(s=hr(a),s===null)return;if(l=s.tag,l===5||l===6){r=i=s;continue e}a=a.parentNode}}r=r.return}Wp(function(){var c=i,d=Ac(n),f=[];e:{var p=Mh.get(e);if(p!==void 0){var h=Bc,E=e;switch(e){case"keypress":if(Zs(n)===0)break e;case"keydown":case"keyup":h=gx;break;case"focusin":E="focus",h=Wc;break;case"focusout":E="blur",h=Wc;break;case"beforeblur":case"afterblur":h=Wc;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=fh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=rx;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=vx;break;case Lh:case Dh:case kh:h=sx;break;case Ph:h=_x;break;case"scroll":h=tx;break;case"wheel":h=xx;break;case"copy":case"cut":case"paste":h=lx;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=hh}var v=(t&4)!==0,y=!v&&e==="scroll",g=v?p!==null?p+"Capture":null:p;v=[];for(var m=c,_;m!==null;){_=m;var S=_.stateNode;if(_.tag===5&&S!==null&&(_=S,g!==null&&(S=ci(m,g),S!=null&&v.push(Ai(m,S,_)))),y)break;m=m.return}0<v.length&&(p=new h(p,E,null,n,d),f.push({event:p,listeners:v}))}}if(!(t&7)){e:{if(p=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",p&&n!==Tc&&(E=n.relatedTarget||n.fromElement)&&(hr(E)||E[pn]))break e;if((h||p)&&(p=d.window===d?d:(p=d.ownerDocument)?p.defaultView||p.parentWindow:window,h?(E=n.relatedTarget||n.toElement,h=c,E=E?hr(E):null,E!==null&&(y=pr(E),E!==y||E.tag!==5&&E.tag!==6)&&(E=null)):(h=null,E=c),h!==E)){if(v=fh,S="onMouseLeave",g="onMouseEnter",m="mouse",(e==="pointerout"||e==="pointerover")&&(v=hh,S="onPointerLeave",g="onPointerEnter",m="pointer"),y=h==null?p:so(h),_=E==null?p:so(E),p=new v(S,m+"leave",h,n,d),p.target=y,p.relatedTarget=_,S=null,hr(d)===c&&(v=new v(g,m+"enter",E,n,d),v.target=_,v.relatedTarget=y,S=v),y=S,h&&E)t:{for(v=h,g=E,m=0,_=v;_;_=oo(_))m++;for(_=0,S=g;S;S=oo(S))_++;for(;0<m-_;)v=oo(v),m--;for(;0<_-m;)g=oo(g),_--;for(;m--;){if(v===g||g!==null&&v===g.alternate)break t;v=oo(v),g=oo(g)}v=null}else v=null;h!==null&&$h(f,p,h,v,!1),E!==null&&y!==null&&$h(f,y,E,v,!0)}}e:{if(p=c?so(c):window,h=p.nodeName&&p.nodeName.toLowerCase(),h==="select"||h==="input"&&p.type==="file")var x=Ix;else if(_h(p))if(xh)x=Dx;else{x=Cx;var R=bx}else(h=p.nodeName)&&h.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(x=Lx);if(x&&(x=x(e,c))){Sh(f,x,n,d);break e}R&&R(e,p,c),e==="focusout"&&(R=p._wrapperState)&&R.controlled&&p.type==="number"&&xc(p,"number",p.value)}switch(R=c?so(c):window,e){case"focusin":(_h(R)||R.contentEditable==="true")&&(no=R,qc=c,wi=null);break;case"focusout":wi=qc=no=null;break;case"mousedown":Jc=!0;break;case"contextmenu":case"mouseup":case"dragend":Jc=!1,bh(f,n,d);break;case"selectionchange":if(Mx)break;case"keydown":case"keyup":bh(f,n,d)}var I;if(Yc)e:{switch(e){case"compositionstart":var L="onCompositionStart";break e;case"compositionend":L="onCompositionEnd";break e;case"compositionupdate":L="onCompositionUpdate";break e}L=void 0}else to?vh(e,n)&&(L="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(L="onCompositionStart");L&&(gh&&n.locale!=="ko"&&(to||L!=="onCompositionStart"?L==="onCompositionEnd"&&to&&(I=uh()):(kn=d,$c="value"in kn?kn.value:kn.textContent,to=!0)),R=sa(c,L),0<R.length&&(L=new ph(L,e,null,n,d),f.push({event:L,listeners:R}),I?L.data=I:(I=yh(n),I!==null&&(L.data=I)))),(I=Nx?wx(e,n):Ox(e,n))&&(c=sa(c,"onBeforeInput"),0<c.length&&(d=new ph("onBeforeInput","beforeinput",null,n,d),f.push({event:d,listeners:c}),d.data=I))}Fh(f,t)})}function Ai(e,t,n){return{instance:e,listener:t,currentTarget:n}}function sa(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=ci(e,n),i!=null&&r.unshift(Ai(e,i,o)),i=ci(e,t),i!=null&&r.push(Ai(e,i,o))),e=e.return}return r}function oo(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function $h(e,t,n,r,o){for(var i=t._reactName,s=[];n!==null&&n!==r;){var a=n,l=a.alternate,c=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&c!==null&&(a=c,o?(l=ci(n,i),l!=null&&s.unshift(Ai(n,l,a))):o||(l=ci(n,i),l!=null&&s.push(Ai(n,l,a)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var Vx=/\r\n?/g,$x=/\u0000|\uFFFD/g;function Bh(e){return(typeof e=="string"?e:""+e).replace(Vx,`
42
- `).replace($x,"")}function aa(e,t,n){if(t=Bh(t),Bh(e)!==t&&n)throw Error(H(425))}function la(){}var ou=null,iu=null;function su(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 au=typeof setTimeout=="function"?setTimeout:void 0,Bx=typeof clearTimeout=="function"?clearTimeout:void 0,Hh=typeof Promise=="function"?Promise:void 0,Hx=typeof queueMicrotask=="function"?queueMicrotask:typeof Hh<"u"?function(e){return Hh.resolve(null).then(e).catch(zx)}:au;function zx(e){setTimeout(function(){throw e})}function lu(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),vi(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);vi(t)}function Mn(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 zh(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 io=Math.random().toString(36).slice(2),Xt="__reactFiber$"+io,Ii="__reactProps$"+io,pn="__reactContainer$"+io,cu="__reactEvents$"+io,Wx="__reactListeners$"+io,Gx="__reactHandles$"+io;function hr(e){var t=e[Xt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[pn]||n[Xt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=zh(e);e!==null;){if(n=e[Xt])return n;e=zh(e)}return t}e=n,n=e.parentNode}return null}function bi(e){return e=e[Xt]||e[pn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function so(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(H(33))}function ca(e){return e[Ii]||null}var uu=[],ao=-1;function jn(e){return{current:e}}function de(e){0>ao||(e.current=uu[ao],uu[ao]=null,ao--)}function ce(e,t){ao++,uu[ao]=e.current,e.current=t}var Un={},Ve=jn(Un),nt=jn(!1),gr=Un;function lo(e,t){var n=e.type.contextTypes;if(!n)return Un;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 rt(e){return e=e.childContextTypes,e!=null}function ua(){de(nt),de(Ve)}function Wh(e,t,n){if(Ve.current!==Un)throw Error(H(168));ce(Ve,t),ce(nt,n)}function Gh(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,bS(e)||"Unknown",o));return Ee({},n,r)}function da(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Un,gr=Ve.current,ce(Ve,e),ce(nt,nt.current),!0}function Yh(e,t,n){var r=e.stateNode;if(!r)throw Error(H(169));n?(e=Gh(e,t,gr),r.__reactInternalMemoizedMergedChildContext=e,de(nt),de(Ve),ce(Ve,e)):de(nt),ce(nt,n)}var hn=null,fa=!1,du=!1;function Kh(e){hn===null?hn=[e]:hn.push(e)}function Yx(e){fa=!0,Kh(e)}function Fn(){if(!du&&hn!==null){du=!0;var e=0,t=se;try{var n=hn;for(se=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}hn=null,fa=!1}catch(o){throw hn!==null&&(hn=hn.slice(e+1)),Xp(Dc,Fn),o}finally{se=t,du=!1}}return null}var co=[],uo=0,pa=null,ha=0,St=[],xt=0,mr=null,gn=1,mn="";function Er(e,t){co[uo++]=ha,co[uo++]=pa,pa=e,ha=t}function Qh(e,t,n){St[xt++]=gn,St[xt++]=mn,St[xt++]=mr,mr=e;var r=gn;e=mn;var o=32-Dt(r)-1;r&=~(1<<o),n+=1;var i=32-Dt(t)+o;if(30<i){var s=o-o%5;i=(r&(1<<s)-1).toString(32),r>>=s,o-=s,gn=1<<32-Dt(t)+o|n<<o|r,mn=i+e}else gn=1<<i|n<<o|r,mn=e}function fu(e){e.return!==null&&(Er(e,1),Qh(e,1,0))}function pu(e){for(;e===pa;)pa=co[--uo],co[uo]=null,ha=co[--uo],co[uo]=null;for(;e===mr;)mr=St[--xt],St[xt]=null,mn=St[--xt],St[xt]=null,gn=St[--xt],St[xt]=null}var pt=null,ht=null,he=!1,Pt=null;function Xh(e,t){var n=Ot(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 qh(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,pt=e,ht=Mn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,pt=e,ht=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=mr!==null?{id:gn,overflow:mn}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Ot(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,pt=e,ht=null,!0):!1;default:return!1}}function hu(e){return(e.mode&1)!==0&&(e.flags&128)===0}function gu(e){if(he){var t=ht;if(t){var n=t;if(!qh(e,t)){if(hu(e))throw Error(H(418));t=Mn(n.nextSibling);var r=pt;t&&qh(e,t)?Xh(r,n):(e.flags=e.flags&-4097|2,he=!1,pt=e)}}else{if(hu(e))throw Error(H(418));e.flags=e.flags&-4097|2,he=!1,pt=e}}}function Jh(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;pt=e}function ga(e){if(e!==pt)return!1;if(!he)return Jh(e),he=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!su(e.type,e.memoizedProps)),t&&(t=ht)){if(hu(e))throw Zh(),Error(H(418));for(;t;)Xh(e,t),t=Mn(t.nextSibling)}if(Jh(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){ht=Mn(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}ht=null}}else ht=pt?Mn(e.stateNode.nextSibling):null;return!0}function Zh(){for(var e=ht;e;)e=Mn(e.nextSibling)}function fo(){ht=pt=null,he=!1}function mu(e){Pt===null?Pt=[e]:Pt.push(e)}var Kx=fn.ReactCurrentBatchConfig;function Mt(e,t){if(e&&e.defaultProps){t=Ee({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}var ma=jn(null),Ea=null,po=null,Eu=null;function vu(){Eu=po=Ea=null}function yu(e){var t=ma.current;de(ma),e._currentValue=t}function _u(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 ho(e,t){Ea=e,Eu=po=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(ot=!0),e.firstContext=null)}function Rt(e){var t=e._currentValue;if(Eu!==e)if(e={context:e,memoizedValue:t,next:null},po===null){if(Ea===null)throw Error(H(308));po=e,Ea.dependencies={lanes:0,firstContext:e}}else po=po.next=e;return t}var vr=null;function Su(e){vr===null?vr=[e]:vr.push(e)}function eg(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,Su(t)):(n.next=o.next,o.next=n),t.interleaved=n,En(e,r)}function En(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 Vn=!1;function xu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function tg(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 vn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function $n(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ne&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,En(e,n)}return o=r.interleaved,o===null?(t.next=t,Su(r)):(t.next=o.next,o.next=t),r.interleaved=t,En(e,n)}function va(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,Mc(e,n)}}function ng(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 ya(e,t,n,r){var o=e.updateQueue;Vn=!1;var i=o.firstBaseUpdate,s=o.lastBaseUpdate,a=o.shared.pending;if(a!==null){o.shared.pending=null;var l=a,c=l.next;l.next=null,s===null?i=c:s.next=c,s=l;var d=e.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==s&&(a===null?d.firstBaseUpdate=c:a.next=c,d.lastBaseUpdate=l))}if(i!==null){var f=o.baseState;s=0,d=c=l=null,a=i;do{var p=a.lane,h=a.eventTime;if((r&p)===p){d!==null&&(d=d.next={eventTime:h,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var E=e,v=a;switch(p=t,h=n,v.tag){case 1:if(E=v.payload,typeof E=="function"){f=E.call(h,f,p);break e}f=E;break e;case 3:E.flags=E.flags&-65537|128;case 0:if(E=v.payload,p=typeof E=="function"?E.call(h,f,p):E,p==null)break e;f=Ee({},f,p);break e;case 2:Vn=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,p=o.effects,p===null?o.effects=[a]:p.push(a))}else h={eventTime:h,lane:p,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(c=d=h,l=f):d=d.next=h,s|=p;if(a=a.next,a===null){if(a=o.shared.pending,a===null)break;p=a,a=p.next,p.next=null,o.lastBaseUpdate=p,o.shared.pending=null}}while(1);if(d===null&&(l=f),o.baseState=l,o.firstBaseUpdate=c,o.lastBaseUpdate=d,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);Sr|=s,e.lanes=s,e.memoizedState=f}}function rg(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 og=new _p.Component().refs;function Ru(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Ee({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var _a={isMounted:function(e){return(e=e._reactInternals)?pr(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Xe(),o=Wn(e),i=vn(r,o);i.payload=t,n!=null&&(i.callback=n),t=$n(e,i,o),t!==null&&(Ft(t,e,o,r),va(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Xe(),o=Wn(e),i=vn(r,o);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=$n(e,i,o),t!==null&&(Ft(t,e,o,r),va(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Xe(),r=Wn(e),o=vn(n,r);o.tag=2,t!=null&&(o.callback=t),t=$n(e,o,r),t!==null&&(Ft(t,e,r,n),va(t,e,r))}};function ig(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?!Ni(n,r)||!Ni(o,i):!0}function sg(e,t,n){var r=!1,o=Un,i=t.contextType;return typeof i=="object"&&i!==null?i=Rt(i):(o=rt(t)?gr:Ve.current,r=t.contextTypes,i=(r=r!=null)?lo(e,o):Un),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=_a,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function ag(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&&_a.enqueueReplaceState(t,t.state,null)}function Nu(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs=og,xu(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=Rt(i):(i=rt(t)?gr:Ve.current,o.context=lo(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Ru(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&&_a.enqueueReplaceState(o,o.state,null),ya(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function Ci(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 a=o.refs;a===og&&(a=o.refs={}),s===null?delete a[i]:a[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 Sa(e,t){throw e=Object.prototype.toString.call(t),Error(H(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function lg(e){var t=e._init;return t(e._payload)}function cg(e){function t(g,m){if(e){var _=g.deletions;_===null?(g.deletions=[m],g.flags|=16):_.push(m)}}function n(g,m){if(!e)return null;for(;m!==null;)t(g,m),m=m.sibling;return null}function r(g,m){for(g=new Map;m!==null;)m.key!==null?g.set(m.key,m):g.set(m.index,m),m=m.sibling;return g}function o(g,m){return g=Yn(g,m),g.index=0,g.sibling=null,g}function i(g,m,_){return g.index=_,e?(_=g.alternate,_!==null?(_=_.index,_<m?(g.flags|=2,m):_):(g.flags|=2,m)):(g.flags|=1048576,m)}function s(g){return e&&g.alternate===null&&(g.flags|=2),g}function a(g,m,_,S){return m===null||m.tag!==6?(m=ad(_,g.mode,S),m.return=g,m):(m=o(m,_),m.return=g,m)}function l(g,m,_,S){var x=_.type;return x===Qr?d(g,m,_.props.children,S,_.key):m!==null&&(m.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===An&&lg(x)===m.type)?(S=o(m,_.props),S.ref=Ci(g,m,_),S.return=g,S):(S=Va(_.type,_.key,_.props,null,g.mode,S),S.ref=Ci(g,m,_),S.return=g,S)}function c(g,m,_,S){return m===null||m.tag!==4||m.stateNode.containerInfo!==_.containerInfo||m.stateNode.implementation!==_.implementation?(m=ld(_,g.mode,S),m.return=g,m):(m=o(m,_.children||[]),m.return=g,m)}function d(g,m,_,S,x){return m===null||m.tag!==7?(m=wr(_,g.mode,S,x),m.return=g,m):(m=o(m,_),m.return=g,m)}function f(g,m,_){if(typeof m=="string"&&m!==""||typeof m=="number")return m=ad(""+m,g.mode,_),m.return=g,m;if(typeof m=="object"&&m!==null){switch(m.$$typeof){case js:return _=Va(m.type,m.key,m.props,null,g.mode,_),_.ref=Ci(g,null,m),_.return=g,_;case Kr:return m=ld(m,g.mode,_),m.return=g,m;case An:var S=m._init;return f(g,S(m._payload),_)}if(si(m)||oi(m))return m=wr(m,g.mode,_,null),m.return=g,m;Sa(g,m)}return null}function p(g,m,_,S){var x=m!==null?m.key:null;if(typeof _=="string"&&_!==""||typeof _=="number")return x!==null?null:a(g,m,""+_,S);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case js:return _.key===x?l(g,m,_,S):null;case Kr:return _.key===x?c(g,m,_,S):null;case An:return x=_._init,p(g,m,x(_._payload),S)}if(si(_)||oi(_))return x!==null?null:d(g,m,_,S,null);Sa(g,_)}return null}function h(g,m,_,S,x){if(typeof S=="string"&&S!==""||typeof S=="number")return g=g.get(_)||null,a(m,g,""+S,x);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case js:return g=g.get(S.key===null?_:S.key)||null,l(m,g,S,x);case Kr:return g=g.get(S.key===null?_:S.key)||null,c(m,g,S,x);case An:var R=S._init;return h(g,m,_,R(S._payload),x)}if(si(S)||oi(S))return g=g.get(_)||null,d(m,g,S,x,null);Sa(m,S)}return null}function E(g,m,_,S){for(var x=null,R=null,I=m,L=m=0,U=null;I!==null&&L<_.length;L++){I.index>L?(U=I,I=null):U=I.sibling;var A=p(g,I,_[L],S);if(A===null){I===null&&(I=U);break}e&&I&&A.alternate===null&&t(g,I),m=i(A,m,L),R===null?x=A:R.sibling=A,R=A,I=U}if(L===_.length)return n(g,I),he&&Er(g,L),x;if(I===null){for(;L<_.length;L++)I=f(g,_[L],S),I!==null&&(m=i(I,m,L),R===null?x=I:R.sibling=I,R=I);return he&&Er(g,L),x}for(I=r(g,I);L<_.length;L++)U=h(I,g,L,_[L],S),U!==null&&(e&&U.alternate!==null&&I.delete(U.key===null?L:U.key),m=i(U,m,L),R===null?x=U:R.sibling=U,R=U);return e&&I.forEach(function(b){return t(g,b)}),he&&Er(g,L),x}function v(g,m,_,S){var x=oi(_);if(typeof x!="function")throw Error(H(150));if(_=x.call(_),_==null)throw Error(H(151));for(var R=x=null,I=m,L=m=0,U=null,A=_.next();I!==null&&!A.done;L++,A=_.next()){I.index>L?(U=I,I=null):U=I.sibling;var b=p(g,I,A.value,S);if(b===null){I===null&&(I=U);break}e&&I&&b.alternate===null&&t(g,I),m=i(b,m,L),R===null?x=b:R.sibling=b,R=b,I=U}if(A.done)return n(g,I),he&&Er(g,L),x;if(I===null){for(;!A.done;L++,A=_.next())A=f(g,A.value,S),A!==null&&(m=i(A,m,L),R===null?x=A:R.sibling=A,R=A);return he&&Er(g,L),x}for(I=r(g,I);!A.done;L++,A=_.next())A=h(I,g,L,A.value,S),A!==null&&(e&&A.alternate!==null&&I.delete(A.key===null?L:A.key),m=i(A,m,L),R===null?x=A:R.sibling=A,R=A);return e&&I.forEach(function(V){return t(g,V)}),he&&Er(g,L),x}function y(g,m,_,S){if(typeof _=="object"&&_!==null&&_.type===Qr&&_.key===null&&(_=_.props.children),typeof _=="object"&&_!==null){switch(_.$$typeof){case js:e:{for(var x=_.key,R=m;R!==null;){if(R.key===x){if(x=_.type,x===Qr){if(R.tag===7){n(g,R.sibling),m=o(R,_.props.children),m.return=g,g=m;break e}}else if(R.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===An&&lg(x)===R.type){n(g,R.sibling),m=o(R,_.props),m.ref=Ci(g,R,_),m.return=g,g=m;break e}n(g,R);break}else t(g,R);R=R.sibling}_.type===Qr?(m=wr(_.props.children,g.mode,S,_.key),m.return=g,g=m):(S=Va(_.type,_.key,_.props,null,g.mode,S),S.ref=Ci(g,m,_),S.return=g,g=S)}return s(g);case Kr:e:{for(R=_.key;m!==null;){if(m.key===R)if(m.tag===4&&m.stateNode.containerInfo===_.containerInfo&&m.stateNode.implementation===_.implementation){n(g,m.sibling),m=o(m,_.children||[]),m.return=g,g=m;break e}else{n(g,m);break}else t(g,m);m=m.sibling}m=ld(_,g.mode,S),m.return=g,g=m}return s(g);case An:return R=_._init,y(g,m,R(_._payload),S)}if(si(_))return E(g,m,_,S);if(oi(_))return v(g,m,_,S);Sa(g,_)}return typeof _=="string"&&_!==""||typeof _=="number"?(_=""+_,m!==null&&m.tag===6?(n(g,m.sibling),m=o(m,_),m.return=g,g=m):(n(g,m),m=ad(_,g.mode,S),m.return=g,g=m),s(g)):n(g,m)}return y}var go=cg(!0),ug=cg(!1),Li={},qt=jn(Li),Di=jn(Li),ki=jn(Li);function yr(e){if(e===Li)throw Error(H(174));return e}function wu(e,t){switch(ce(ki,t),ce(Di,e),ce(qt,Li),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Nc(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Nc(t,e)}de(qt),ce(qt,t)}function mo(){de(qt),de(Di),de(ki)}function dg(e){yr(ki.current);var t=yr(qt.current),n=Nc(t,e.type);t!==n&&(ce(Di,e),ce(qt,n))}function Ou(e){Di.current===e&&(de(qt),de(Di))}var ve=jn(0);function xa(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 Tu=[];function Au(){for(var e=0;e<Tu.length;e++)Tu[e]._workInProgressVersionPrimary=null;Tu.length=0}var Ra=fn.ReactCurrentDispatcher,Iu=fn.ReactCurrentBatchConfig,_r=0,ye=null,be=null,ke=null,Na=!1,Pi=!1,Mi=0,Qx=0;function $e(){throw Error(H(321))}function bu(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!kt(e[n],t[n]))return!1;return!0}function Cu(e,t,n,r,o,i){if(_r=i,ye=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ra.current=e===null||e.memoizedState===null?Zx:e1,e=n(r,o),Pi){i=0;do{if(Pi=!1,Mi=0,25<=i)throw Error(H(301));i+=1,ke=be=null,t.updateQueue=null,Ra.current=t1,e=n(r,o)}while(Pi)}if(Ra.current=Ta,t=be!==null&&be.next!==null,_r=0,ke=be=ye=null,Na=!1,t)throw Error(H(300));return e}function Lu(){var e=Mi!==0;return Mi=0,e}function Jt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ke===null?ye.memoizedState=ke=e:ke=ke.next=e,ke}function Nt(){if(be===null){var e=ye.alternate;e=e!==null?e.memoizedState:null}else e=be.next;var t=ke===null?ye.memoizedState:ke.next;if(t!==null)ke=t,be=e;else{if(e===null)throw Error(H(310));be=e,e={memoizedState:be.memoizedState,baseState:be.baseState,baseQueue:be.baseQueue,queue:be.queue,next:null},ke===null?ye.memoizedState=ke=e:ke=ke.next=e}return ke}function ji(e,t){return typeof t=="function"?t(e):t}function Du(e){var t=Nt(),n=t.queue;if(n===null)throw Error(H(311));n.lastRenderedReducer=e;var r=be,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 a=s=null,l=null,c=i;do{var d=c.lane;if((_r&d)===d)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var f={lane:d,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(a=l=f,s=r):l=l.next=f,ye.lanes|=d,Sr|=d}c=c.next}while(c!==null&&c!==i);l===null?s=r:l.next=a,kt(r,t.memoizedState)||(ot=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){o=e;do i=o.lane,ye.lanes|=i,Sr|=i,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function ku(e){var t=Nt(),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);kt(i,t.memoizedState)||(ot=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function fg(){}function pg(e,t){var n=ye,r=Nt(),o=t(),i=!kt(r.memoizedState,o);if(i&&(r.memoizedState=o,ot=!0),r=r.queue,Pu(mg.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||ke!==null&&ke.memoizedState.tag&1){if(n.flags|=2048,Ui(9,gg.bind(null,n,r,o,t),void 0,null),Pe===null)throw Error(H(349));_r&30||hg(n,t,o)}return o}function hg(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=ye.updateQueue,t===null?(t={lastEffect:null,stores:null},ye.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function gg(e,t,n,r){t.value=n,t.getSnapshot=r,Eg(t)&&vg(e)}function mg(e,t,n){return n(function(){Eg(t)&&vg(e)})}function Eg(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!kt(e,n)}catch{return!0}}function vg(e){var t=En(e,1);t!==null&&Ft(t,e,1,-1)}function yg(e){var t=Jt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ji,lastRenderedState:e},t.queue=e,e=e.dispatch=Jx.bind(null,ye,e),[t.memoizedState,e]}function Ui(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=ye.updateQueue,t===null?(t={lastEffect:null,stores:null},ye.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 _g(){return Nt().memoizedState}function wa(e,t,n,r){var o=Jt();ye.flags|=e,o.memoizedState=Ui(1|t,n,void 0,r===void 0?null:r)}function Oa(e,t,n,r){var o=Nt();r=r===void 0?null:r;var i=void 0;if(be!==null){var s=be.memoizedState;if(i=s.destroy,r!==null&&bu(r,s.deps)){o.memoizedState=Ui(t,n,i,r);return}}ye.flags|=e,o.memoizedState=Ui(1|t,n,i,r)}function Sg(e,t){return wa(8390656,8,e,t)}function Pu(e,t){return Oa(2048,8,e,t)}function xg(e,t){return Oa(4,2,e,t)}function Rg(e,t){return Oa(4,4,e,t)}function Ng(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 wg(e,t,n){return n=n!=null?n.concat([e]):null,Oa(4,4,Ng.bind(null,t,e),n)}function Mu(){}function Og(e,t){var n=Nt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&bu(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Tg(e,t){var n=Nt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&bu(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Ag(e,t,n){return _r&21?(kt(n,t)||(n=eh(),ye.lanes|=n,Sr|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,ot=!0),e.memoizedState=n)}function Xx(e,t){var n=se;se=n!==0&&4>n?n:4,e(!0);var r=Iu.transition;Iu.transition={};try{e(!1),t()}finally{se=n,Iu.transition=r}}function Ig(){return Nt().memoizedState}function qx(e,t,n){var r=Wn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},bg(e))Cg(t,n);else if(n=eg(e,t,n,r),n!==null){var o=Xe();Ft(n,e,r,o),Lg(n,t,r)}}function Jx(e,t,n){var r=Wn(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(bg(e))Cg(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,a=i(s,n);if(o.hasEagerState=!0,o.eagerState=a,kt(a,s)){var l=t.interleaved;l===null?(o.next=o,Su(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}finally{}n=eg(e,t,o,r),n!==null&&(o=Xe(),Ft(n,e,r,o),Lg(n,t,r))}}function bg(e){var t=e.alternate;return e===ye||t!==null&&t===ye}function Cg(e,t){Pi=Na=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Lg(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Mc(e,n)}}var Ta={readContext:Rt,useCallback:$e,useContext:$e,useEffect:$e,useImperativeHandle:$e,useInsertionEffect:$e,useLayoutEffect:$e,useMemo:$e,useReducer:$e,useRef:$e,useState:$e,useDebugValue:$e,useDeferredValue:$e,useTransition:$e,useMutableSource:$e,useSyncExternalStore:$e,useId:$e,unstable_isNewReconciler:!1},Zx={readContext:Rt,useCallback:function(e,t){return Jt().memoizedState=[e,t===void 0?null:t],e},useContext:Rt,useEffect:Sg,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,wa(4194308,4,Ng.bind(null,t,e),n)},useLayoutEffect:function(e,t){return wa(4194308,4,e,t)},useInsertionEffect:function(e,t){return wa(4,2,e,t)},useMemo:function(e,t){var n=Jt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Jt();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=qx.bind(null,ye,e),[r.memoizedState,e]},useRef:function(e){var t=Jt();return e={current:e},t.memoizedState=e},useState:yg,useDebugValue:Mu,useDeferredValue:function(e){return Jt().memoizedState=e},useTransition:function(){var e=yg(!1),t=e[0];return e=Xx.bind(null,e[1]),Jt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ye,o=Jt();if(he){if(n===void 0)throw Error(H(407));n=n()}else{if(n=t(),Pe===null)throw Error(H(349));_r&30||hg(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,Sg(mg.bind(null,r,i,e),[e]),r.flags|=2048,Ui(9,gg.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Jt(),t=Pe.identifierPrefix;if(he){var n=mn,r=gn;n=(r&~(1<<32-Dt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Mi++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=Qx++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},e1={readContext:Rt,useCallback:Og,useContext:Rt,useEffect:Pu,useImperativeHandle:wg,useInsertionEffect:xg,useLayoutEffect:Rg,useMemo:Tg,useReducer:Du,useRef:_g,useState:function(){return Du(ji)},useDebugValue:Mu,useDeferredValue:function(e){var t=Nt();return Ag(t,be.memoizedState,e)},useTransition:function(){var e=Du(ji)[0],t=Nt().memoizedState;return[e,t]},useMutableSource:fg,useSyncExternalStore:pg,useId:Ig,unstable_isNewReconciler:!1},t1={readContext:Rt,useCallback:Og,useContext:Rt,useEffect:Pu,useImperativeHandle:wg,useInsertionEffect:xg,useLayoutEffect:Rg,useMemo:Tg,useReducer:ku,useRef:_g,useState:function(){return ku(ji)},useDebugValue:Mu,useDeferredValue:function(e){var t=Nt();return be===null?t.memoizedState=e:Ag(t,be.memoizedState,e)},useTransition:function(){var e=ku(ji)[0],t=Nt().memoizedState;return[e,t]},useMutableSource:fg,useSyncExternalStore:pg,useId:Ig,unstable_isNewReconciler:!1};function Eo(e,t){try{var n="",r=t;do n+=IS(r),r=r.return;while(r);var o=n}catch(i){o=`
43
- Error generating stack: `+i.message+`
44
- `+i.stack}return{value:e,source:t,stack:o,digest:null}}function ju(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Uu(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var n1=typeof WeakMap=="function"?WeakMap:Map;function Dg(e,t,n){n=vn(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){ka||(ka=!0,Zu=r),Uu(e,t)},n}function kg(e,t,n){n=vn(-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(){Uu(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Uu(e,t),typeof r!="function"&&(Hn===null?Hn=new Set([this]):Hn.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function Pg(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new n1;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=m1.bind(null,e,t,n),t.then(e,e))}function Mg(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 jg(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=vn(-1,1),t.tag=2,$n(n,t,1))),n.lanes|=1),e)}var r1=fn.ReactCurrentOwner,ot=!1;function Qe(e,t,n,r){t.child=e===null?ug(t,null,n,r):go(t,e.child,n,r)}function Ug(e,t,n,r,o){n=n.render;var i=t.ref;return ho(t,o),r=Cu(e,t,n,r,i,o),n=Lu(),e!==null&&!ot?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,yn(e,t,o)):(he&&n&&fu(t),t.flags|=1,Qe(e,t,r,o),t.child)}function Fg(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!sd(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,Vg(e,t,i,r,o)):(e=Va(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:Ni,n(s,r)&&e.ref===t.ref)return yn(e,t,o)}return t.flags|=1,e=Yn(i,r),e.ref=t.ref,e.return=t,t.child=e}function Vg(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(Ni(i,r)&&e.ref===t.ref)if(ot=!1,t.pendingProps=r=i,(e.lanes&o)!==0)e.flags&131072&&(ot=!0);else return t.lanes=e.lanes,yn(e,t,o)}return Fu(e,t,n,r,o)}function $g(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},ce(yo,gt),gt|=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,ce(yo,gt),gt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,ce(yo,gt),gt|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,ce(yo,gt),gt|=r;return Qe(e,t,o,n),t.child}function Bg(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Fu(e,t,n,r,o){var i=rt(n)?gr:Ve.current;return i=lo(t,i),ho(t,o),n=Cu(e,t,n,r,i,o),r=Lu(),e!==null&&!ot?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,yn(e,t,o)):(he&&r&&fu(t),t.flags|=1,Qe(e,t,n,o),t.child)}function Hg(e,t,n,r,o){if(rt(n)){var i=!0;da(t)}else i=!1;if(ho(t,o),t.stateNode===null)Ia(e,t),sg(t,n,r),Nu(t,n,r,o),r=!0;else if(e===null){var s=t.stateNode,a=t.memoizedProps;s.props=a;var l=s.context,c=n.contextType;typeof c=="object"&&c!==null?c=Rt(c):(c=rt(n)?gr:Ve.current,c=lo(t,c));var d=n.getDerivedStateFromProps,f=typeof d=="function"||typeof s.getSnapshotBeforeUpdate=="function";f||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==r||l!==c)&&ag(t,s,r,c),Vn=!1;var p=t.memoizedState;s.state=p,ya(t,r,s,o),l=t.memoizedState,a!==r||p!==l||nt.current||Vn?(typeof d=="function"&&(Ru(t,n,d,r),l=t.memoizedState),(a=Vn||ig(t,n,a,r,p,l,c))?(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=l),s.props=r,s.state=l,s.context=c,r=a):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,tg(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:Mt(t.type,a),s.props=c,f=t.pendingProps,p=s.context,l=n.contextType,typeof l=="object"&&l!==null?l=Rt(l):(l=rt(n)?gr:Ve.current,l=lo(t,l));var h=n.getDerivedStateFromProps;(d=typeof h=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==f||p!==l)&&ag(t,s,r,l),Vn=!1,p=t.memoizedState,s.state=p,ya(t,r,s,o);var E=t.memoizedState;a!==f||p!==E||nt.current||Vn?(typeof h=="function"&&(Ru(t,n,h,r),E=t.memoizedState),(c=Vn||ig(t,n,c,r,p,E,l)||!1)?(d||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,E,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,E,l)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=E),s.props=r,s.state=E,s.context=l,r=c):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),r=!1)}return Vu(e,t,n,r,i,o)}function Vu(e,t,n,r,o,i){Bg(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return o&&Yh(t,n,!1),yn(e,t,i);r=t.stateNode,r1.current=t;var a=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=go(t,e.child,null,i),t.child=go(t,null,a,i)):Qe(e,t,a,i),t.memoizedState=r.state,o&&Yh(t,n,!0),t.child}function zg(e){var t=e.stateNode;t.pendingContext?Wh(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Wh(e,t.context,!1),wu(e,t.containerInfo)}function Wg(e,t,n,r,o){return fo(),mu(o),t.flags|=256,Qe(e,t,n,r),t.child}var $u={dehydrated:null,treeContext:null,retryLane:0};function Bu(e){return{baseLanes:e,cachePool:null,transitions:null}}function Gg(e,t,n){var r=t.pendingProps,o=ve.current,i=!1,s=(t.flags&128)!==0,a;if((a=s)||(a=e!==null&&e.memoizedState===null?!1:(o&2)!==0),a?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),ce(ve,o&1),e===null)return gu(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=$a(s,r,0,null),e=wr(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Bu(n),t.memoizedState=$u,e):Hu(t,s));if(o=e.memoizedState,o!==null&&(a=o.dehydrated,a!==null))return o1(e,t,s,r,a,o,n);if(i){i=r.fallback,s=t.mode,o=e.child,a=o.sibling;var l={mode:"hidden",children:r.children};return!(s&1)&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=Yn(o,l),r.subtreeFlags=o.subtreeFlags&14680064),a!==null?i=Yn(a,i):(i=wr(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?Bu(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},i.memoizedState=s,i.childLanes=e.childLanes&~n,t.memoizedState=$u,r}return i=e.child,e=i.sibling,r=Yn(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 Hu(e,t){return t=$a({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Aa(e,t,n,r){return r!==null&&mu(r),go(t,e.child,null,n),e=Hu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function o1(e,t,n,r,o,i,s){if(n)return t.flags&256?(t.flags&=-257,r=ju(Error(H(422))),Aa(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=$a({mode:"visible",children:r.children},o,0,null),i=wr(i,o,s,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&go(t,e.child,null,s),t.child.memoizedState=Bu(s),t.memoizedState=$u,i);if(!(t.mode&1))return Aa(e,t,s,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var a=r.dgst;return r=a,i=Error(H(419)),r=ju(i,r,void 0),Aa(e,t,s,r)}if(a=(s&e.childLanes)!==0,ot||a){if(r=Pe,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,En(e,o),Ft(r,e,o,-1))}return id(),r=ju(Error(H(421))),Aa(e,t,s,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=E1.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,ht=Mn(o.nextSibling),pt=t,he=!0,Pt=null,e!==null&&(St[xt++]=gn,St[xt++]=mn,St[xt++]=mr,gn=e.id,mn=e.overflow,mr=t),t=Hu(t,r.children),t.flags|=4096,t)}function Yg(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),_u(e.return,t,n)}function zu(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 Kg(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(Qe(e,t,r.children,n),r=ve.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&&Yg(e,n,t);else if(e.tag===19)Yg(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(ce(ve,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&&xa(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),zu(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&&xa(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}zu(t,!0,n,null,i);break;case"together":zu(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ia(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function yn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Sr|=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=Yn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Yn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function i1(e,t,n){switch(t.tag){case 3:zg(t),fo();break;case 5:dg(t);break;case 1:rt(t.type)&&da(t);break;case 4:wu(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;ce(ma,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ce(ve,ve.current&1),t.flags|=128,null):n&t.child.childLanes?Gg(e,t,n):(ce(ve,ve.current&1),e=yn(e,t,n),e!==null?e.sibling:null);ce(ve,ve.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Kg(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),ce(ve,ve.current),r)break;return null;case 22:case 23:return t.lanes=0,$g(e,t,n)}return yn(e,t,n)}var Qg,Wu,Xg,qg;Qg=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}},Wu=function(){},Xg=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,yr(qt.current);var i=null;switch(n){case"input":o=_c(e,o),r=_c(e,r),i=[];break;case"select":o=Ee({},o,{value:void 0}),r=Ee({},r,{value:void 0}),i=[];break;case"textarea":o=Rc(e,o),r=Rc(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=la)}wc(n,r);var s;n=null;for(c in o)if(!r.hasOwnProperty(c)&&o.hasOwnProperty(c)&&o[c]!=null)if(c==="style"){var a=o[c];for(s in a)a.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(ri.hasOwnProperty(c)?i||(i=[]):(i=i||[]).push(c,null));for(c in r){var l=r[c];if(a=o!=null?o[c]:void 0,r.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(s in a)!a.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in l)l.hasOwnProperty(s)&&a[s]!==l[s]&&(n||(n={}),n[s]=l[s])}else n||(i||(i=[]),i.push(c,n)),n=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(i=i||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(i=i||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(ri.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&ue("scroll",e),i||a===l||(i=[])):(i=i||[]).push(c,l))}n&&(i=i||[]).push("style",n);var c=i;(t.updateQueue=c)&&(t.flags|=4)}},qg=function(e,t,n,r){n!==r&&(t.flags|=4)};function Fi(e,t){if(!he)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 Be(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 s1(e,t,n){var r=t.pendingProps;switch(pu(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Be(t),null;case 1:return rt(t.type)&&ua(),Be(t),null;case 3:return r=t.stateNode,mo(),de(nt),de(Ve),Au(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(ga(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Pt!==null&&(nd(Pt),Pt=null))),Wu(e,t),Be(t),null;case 5:Ou(t);var o=yr(ki.current);if(n=t.type,e!==null&&t.stateNode!=null)Xg(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 Be(t),null}if(e=yr(qt.current),ga(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[Xt]=t,r[Ii]=i,e=(t.mode&1)!==0,n){case"dialog":ue("cancel",r),ue("close",r);break;case"iframe":case"object":case"embed":ue("load",r);break;case"video":case"audio":for(o=0;o<Oi.length;o++)ue(Oi[o],r);break;case"source":ue("error",r);break;case"img":case"image":case"link":ue("error",r),ue("load",r);break;case"details":ue("toggle",r);break;case"input":bp(r,i),ue("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},ue("invalid",r);break;case"textarea":Dp(r,i),ue("invalid",r)}wc(n,i),o=null;for(var s in i)if(i.hasOwnProperty(s)){var a=i[s];s==="children"?typeof a=="string"?r.textContent!==a&&(i.suppressHydrationWarning!==!0&&aa(r.textContent,a,e),o=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&aa(r.textContent,a,e),o=["children",""+a]):ri.hasOwnProperty(s)&&a!=null&&s==="onScroll"&&ue("scroll",r)}switch(n){case"input":Us(r),Lp(r,i,!0);break;case"textarea":Us(r),Pp(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=la)}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=Mp(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[Xt]=t,e[Ii]=r,Qg(e,t,!1,!1),t.stateNode=e;e:{switch(s=Oc(n,r),n){case"dialog":ue("cancel",e),ue("close",e),o=r;break;case"iframe":case"object":case"embed":ue("load",e),o=r;break;case"video":case"audio":for(o=0;o<Oi.length;o++)ue(Oi[o],e);o=r;break;case"source":ue("error",e),o=r;break;case"img":case"image":case"link":ue("error",e),ue("load",e),o=r;break;case"details":ue("toggle",e),o=r;break;case"input":bp(e,r),o=_c(e,r),ue("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=Ee({},r,{value:void 0}),ue("invalid",e);break;case"textarea":Dp(e,r),o=Rc(e,r),ue("invalid",e);break;default:o=r}wc(n,o),a=o;for(i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="style"?Fp(e,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&jp(e,l)):i==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&ai(e,l):typeof l=="number"&&ai(e,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(ri.hasOwnProperty(i)?l!=null&&i==="onScroll"&&ue("scroll",e):l!=null&&cc(e,i,l,s))}switch(n){case"input":Us(e),Lp(e,r,!1);break;case"textarea":Us(e),Pp(e);break;case"option":r.value!=null&&e.setAttribute("value",""+In(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?Xr(e,!!r.multiple,i,!1):r.defaultValue!=null&&Xr(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=la)}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 Be(t),null;case 6:if(e&&t.stateNode!=null)qg(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(H(166));if(n=yr(ki.current),yr(qt.current),ga(t)){if(r=t.stateNode,n=t.memoizedProps,r[Xt]=t,(i=r.nodeValue!==n)&&(e=pt,e!==null))switch(e.tag){case 3:aa(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&aa(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Xt]=t,t.stateNode=r}return Be(t),null;case 13:if(de(ve),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(he&&ht!==null&&t.mode&1&&!(t.flags&128))Zh(),fo(),t.flags|=98560,i=!1;else if(i=ga(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[Xt]=t}else fo(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Be(t),i=!1}else Pt!==null&&(nd(Pt),Pt=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||ve.current&1?Ce===0&&(Ce=3):id())),t.updateQueue!==null&&(t.flags|=4),Be(t),null);case 4:return mo(),Wu(e,t),e===null&&Ti(t.stateNode.containerInfo),Be(t),null;case 10:return yu(t.type._context),Be(t),null;case 17:return rt(t.type)&&ua(),Be(t),null;case 19:if(de(ve),i=t.memoizedState,i===null)return Be(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)Fi(i,!1);else{if(Ce!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=xa(e),s!==null){for(t.flags|=128,Fi(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 ce(ve,ve.current&1|2),t.child}e=e.sibling}i.tail!==null&&Re()>_o&&(t.flags|=128,r=!0,Fi(i,!1),t.lanes=4194304)}else{if(!r)if(e=xa(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Fi(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!he)return Be(t),null}else 2*Re()-i.renderingStartTime>_o&&n!==1073741824&&(t.flags|=128,r=!0,Fi(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=Re(),t.sibling=null,n=ve.current,ce(ve,r?n&1|2:n&1),t):(Be(t),null);case 22:case 23:return od(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?gt&1073741824&&(Be(t),t.subtreeFlags&6&&(t.flags|=8192)):Be(t),null;case 24:return null;case 25:return null}throw Error(H(156,t.tag))}function a1(e,t){switch(pu(t),t.tag){case 1:return rt(t.type)&&ua(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return mo(),de(nt),de(Ve),Au(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ou(t),null;case 13:if(de(ve),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(H(340));fo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return de(ve),null;case 4:return mo(),null;case 10:return yu(t.type._context),null;case 22:case 23:return od(),null;case 24:return null;default:return null}}var ba=!1,He=!1,l1=typeof WeakSet=="function"?WeakSet:Set,G=null;function vo(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Se(e,t,r)}else n.current=null}function Gu(e,t,n){try{n()}catch(r){Se(e,t,r)}}var Jg=!1;function c1(e,t){if(ou=Xs,e=Ih(),Xc(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,a=-1,l=-1,c=0,d=0,f=e,p=null;t:for(;;){for(var h;f!==n||o!==0&&f.nodeType!==3||(a=s+o),f!==i||r!==0&&f.nodeType!==3||(l=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&&++c===o&&(a=s),p===i&&++d===r&&(l=s),(h=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=h}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(iu={focusedElem:e,selectionRange:n},Xs=!1,G=t;G!==null;)if(t=G,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,G=e;else for(;G!==null;){t=G;try{var E=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(E!==null){var v=E.memoizedProps,y=E.memoizedState,g=t.stateNode,m=g.getSnapshotBeforeUpdate(t.elementType===t.type?v:Mt(t.type,v),y);g.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var _=t.stateNode.containerInfo;_.nodeType===1?_.textContent="":_.nodeType===9&&_.documentElement&&_.removeChild(_.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(H(163))}}catch(S){Se(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,G=e;break}G=t.return}return E=Jg,Jg=!1,E}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&&Gu(t,n,i)}o=o.next}while(o!==r)}}function Ca(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 Yu(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 Zg(e){var t=e.alternate;t!==null&&(e.alternate=null,Zg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Xt],delete t[Ii],delete t[cu],delete t[Wx],delete t[Gx])),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 em(e){return e.tag===5||e.tag===3||e.tag===4}function tm(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||em(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 Ku(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=la));else if(r!==4&&(e=e.child,e!==null))for(Ku(e,t,n),e=e.sibling;e!==null;)Ku(e,t,n),e=e.sibling}function Qu(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(Qu(e,t,n),e=e.sibling;e!==null;)Qu(e,t,n),e=e.sibling}var je=null,jt=!1;function Bn(e,t,n){for(n=n.child;n!==null;)nm(e,t,n),n=n.sibling}function nm(e,t,n){if(Qt&&typeof Qt.onCommitFiberUnmount=="function")try{Qt.onCommitFiberUnmount(zs,n)}catch{}switch(n.tag){case 5:He||vo(n,t);case 6:var r=je,o=jt;je=null,Bn(e,t,n),je=r,jt=o,je!==null&&(jt?(e=je,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):je.removeChild(n.stateNode));break;case 18:je!==null&&(jt?(e=je,n=n.stateNode,e.nodeType===8?lu(e.parentNode,n):e.nodeType===1&&lu(e,n),vi(e)):lu(je,n.stateNode));break;case 4:r=je,o=jt,je=n.stateNode.containerInfo,jt=!0,Bn(e,t,n),je=r,jt=o;break;case 0:case 11:case 14:case 15:if(!He&&(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)&&Gu(n,t,s),o=o.next}while(o!==r)}Bn(e,t,n);break;case 1:if(!He&&(vo(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Se(n,t,a)}Bn(e,t,n);break;case 21:Bn(e,t,n);break;case 22:n.mode&1?(He=(r=He)||n.memoizedState!==null,Bn(e,t,n),He=r):Bn(e,t,n);break;default:Bn(e,t,n)}}function rm(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new l1),t.forEach(function(r){var o=v1.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function Ut(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,a=s;e:for(;a!==null;){switch(a.tag){case 5:je=a.stateNode,jt=!1;break e;case 3:je=a.stateNode.containerInfo,jt=!0;break e;case 4:je=a.stateNode.containerInfo,jt=!0;break e}a=a.return}if(je===null)throw Error(H(160));nm(i,s,o),je=null,jt=!1;var l=o.alternate;l!==null&&(l.return=null),o.return=null}catch(c){Se(o,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)om(t,e),t=t.sibling}function om(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Ut(t,e),Zt(e),r&4){try{Vi(3,e,e.return),Ca(3,e)}catch(v){Se(e,e.return,v)}try{Vi(5,e,e.return)}catch(v){Se(e,e.return,v)}}break;case 1:Ut(t,e),Zt(e),r&512&&n!==null&&vo(n,n.return);break;case 5:if(Ut(t,e),Zt(e),r&512&&n!==null&&vo(n,n.return),e.flags&32){var o=e.stateNode;try{ai(o,"")}catch(v){Se(e,e.return,v)}}if(r&4&&(o=e.stateNode,o!=null)){var i=e.memoizedProps,s=n!==null?n.memoizedProps:i,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&i.type==="radio"&&i.name!=null&&Cp(o,i),Oc(a,s);var c=Oc(a,i);for(s=0;s<l.length;s+=2){var d=l[s],f=l[s+1];d==="style"?Fp(o,f):d==="dangerouslySetInnerHTML"?jp(o,f):d==="children"?ai(o,f):cc(o,d,f,c)}switch(a){case"input":Sc(o,i);break;case"textarea":kp(o,i);break;case"select":var p=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var h=i.value;h!=null?Xr(o,!!i.multiple,h,!1):p!==!!i.multiple&&(i.defaultValue!=null?Xr(o,!!i.multiple,i.defaultValue,!0):Xr(o,!!i.multiple,i.multiple?[]:"",!1))}o[Ii]=i}catch(v){Se(e,e.return,v)}}break;case 6:if(Ut(t,e),Zt(e),r&4){if(e.stateNode===null)throw Error(H(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(v){Se(e,e.return,v)}}break;case 3:if(Ut(t,e),Zt(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{vi(t.containerInfo)}catch(v){Se(e,e.return,v)}break;case 4:Ut(t,e),Zt(e);break;case 13:Ut(t,e),Zt(e),o=e.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(Ju=Re())),r&4&&rm(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(He=(c=He)||d,Ut(t,e),He=c):Ut(t,e),Zt(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!d&&e.mode&1)for(G=e,d=e.child;d!==null;){for(f=G=d;G!==null;){switch(p=G,h=p.child,p.tag){case 0:case 11:case 14:case 15:Vi(4,p,p.return);break;case 1:vo(p,p.return);var E=p.stateNode;if(typeof E.componentWillUnmount=="function"){r=p,n=p.return;try{t=r,E.props=t.memoizedProps,E.state=t.memoizedState,E.componentWillUnmount()}catch(v){Se(r,n,v)}}break;case 5:vo(p,p.return);break;case 22:if(p.memoizedState!==null){am(f);continue}}h!==null?(h.return=p,G=h):am(f)}d=d.sibling}e:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{o=f.stateNode,c?(i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=f.stateNode,l=f.memoizedProps.style,s=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=Up("display",s))}catch(v){Se(e,e.return,v)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=c?"":f.memoizedProps}catch(v){Se(e,e.return,v)}}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;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:Ut(t,e),Zt(e),r&4&&rm(e);break;case 21:break;default:Ut(t,e),Zt(e)}}function Zt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(em(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&&(ai(o,""),r.flags&=-33);var i=tm(e);Qu(e,i,o);break;case 3:case 4:var s=r.stateNode.containerInfo,a=tm(e);Ku(e,a,s);break;default:throw Error(H(161))}}catch(l){Se(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function u1(e,t,n){G=e,im(e)}function im(e,t,n){for(var r=(e.mode&1)!==0;G!==null;){var o=G,i=o.child;if(o.tag===22&&r){var s=o.memoizedState!==null||ba;if(!s){var a=o.alternate,l=a!==null&&a.memoizedState!==null||He;a=ba;var c=He;if(ba=s,(He=l)&&!c)for(G=o;G!==null;)s=G,l=s.child,s.tag===22&&s.memoizedState!==null?lm(o):l!==null?(l.return=s,G=l):lm(o);for(;i!==null;)G=i,im(i),i=i.sibling;G=o,ba=a,He=c}sm(e)}else o.subtreeFlags&8772&&i!==null?(i.return=o,G=i):sm(e)}}function sm(e){for(;G!==null;){var t=G;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:He||Ca(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!He)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:Mt(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&rg(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}rg(t,s,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var d=c.memoizedState;if(d!==null){var f=d.dehydrated;f!==null&&vi(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(H(163))}He||t.flags&512&&Yu(t)}catch(p){Se(t,t.return,p)}}if(t===e){G=null;break}if(n=t.sibling,n!==null){n.return=t.return,G=n;break}G=t.return}}function am(e){for(;G!==null;){var t=G;if(t===e){G=null;break}var n=t.sibling;if(n!==null){n.return=t.return,G=n;break}G=t.return}}function lm(e){for(;G!==null;){var t=G;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Ca(4,t)}catch(l){Se(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(l){Se(t,o,l)}}var i=t.return;try{Yu(t)}catch(l){Se(t,i,l)}break;case 5:var s=t.return;try{Yu(t)}catch(l){Se(t,s,l)}}}catch(l){Se(t,t.return,l)}if(t===e){G=null;break}var a=t.sibling;if(a!==null){a.return=t.return,G=a;break}G=t.return}}var d1=Math.ceil,La=fn.ReactCurrentDispatcher,Xu=fn.ReactCurrentOwner,wt=fn.ReactCurrentBatchConfig,ne=0,Pe=null,Oe=null,Ue=0,gt=0,yo=jn(0),Ce=0,$i=null,Sr=0,Da=0,qu=0,Bi=null,it=null,Ju=0,_o=1/0,_n=null,ka=!1,Zu=null,Hn=null,Pa=!1,zn=null,Ma=0,Hi=0,ed=null,ja=-1,Ua=0;function Xe(){return ne&6?Re():ja!==-1?ja:ja=Re()}function Wn(e){return e.mode&1?ne&2&&Ue!==0?Ue&-Ue:Kx.transition!==null?(Ua===0&&(Ua=eh()),Ua):(e=se,e!==0||(e=window.event,e=e===void 0?16:ch(e.type)),e):1}function Ft(e,t,n,r){if(50<Hi)throw Hi=0,ed=null,Error(H(185));pi(e,n,r),(!(ne&2)||e!==Pe)&&(e===Pe&&(!(ne&2)&&(Da|=n),Ce===4&&Gn(e,Ue)),st(e,r),n===1&&ne===0&&!(t.mode&1)&&(_o=Re()+500,fa&&Fn()))}function st(e,t){var n=e.callbackNode;KS(e,t);var r=Ys(e,e===Pe?Ue:0);if(r===0)n!==null&&qp(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&qp(n),t===1)e.tag===0?Yx(um.bind(null,e)):Kh(um.bind(null,e)),Hx(function(){!(ne&6)&&Fn()}),n=null;else{switch(th(r)){case 1:n=Dc;break;case 4:n=Jp;break;case 16:n=Hs;break;case 536870912:n=Zp;break;default:n=Hs}n=vm(n,cm.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function cm(e,t){if(ja=-1,Ua=0,ne&6)throw Error(H(327));var n=e.callbackNode;if(So()&&e.callbackNode!==n)return null;var r=Ys(e,e===Pe?Ue:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Fa(e,r);else{t=r;var o=ne;ne|=2;var i=fm();(Pe!==e||Ue!==t)&&(_n=null,_o=Re()+500,Rr(e,t));do try{h1();break}catch(a){dm(e,a)}while(1);vu(),La.current=i,ne=o,Oe!==null?t=0:(Pe=null,Ue=0,t=Ce)}if(t!==0){if(t===2&&(o=kc(e),o!==0&&(r=o,t=td(e,o))),t===1)throw n=$i,Rr(e,0),Gn(e,r),st(e,Re()),n;if(t===6)Gn(e,r);else{if(o=e.current.alternate,!(r&30)&&!f1(o)&&(t=Fa(e,r),t===2&&(i=kc(e),i!==0&&(r=i,t=td(e,i))),t===1))throw n=$i,Rr(e,0),Gn(e,r),st(e,Re()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(H(345));case 2:Nr(e,it,_n);break;case 3:if(Gn(e,r),(r&130023424)===r&&(t=Ju+500-Re(),10<t)){if(Ys(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){Xe(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=au(Nr.bind(null,e,it,_n),t);break}Nr(e,it,_n);break;case 4:if(Gn(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-Dt(r);i=1<<s,s=t[s],s>o&&(o=s),r&=~i}if(r=o,r=Re()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*d1(r/1960))-r,10<r){e.timeoutHandle=au(Nr.bind(null,e,it,_n),r);break}Nr(e,it,_n);break;case 5:Nr(e,it,_n);break;default:throw Error(H(329))}}}return st(e,Re()),e.callbackNode===n?cm.bind(null,e):null}function td(e,t){var n=Bi;return e.current.memoizedState.isDehydrated&&(Rr(e,t).flags|=256),e=Fa(e,t),e!==2&&(t=it,it=n,t!==null&&nd(t)),e}function nd(e){it===null?it=e:it.push.apply(it,e)}function f1(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(!kt(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 Gn(e,t){for(t&=~qu,t&=~Da,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Dt(t),r=1<<n;e[n]=-1,t&=~r}}function um(e){if(ne&6)throw Error(H(327));So();var t=Ys(e,0);if(!(t&1))return st(e,Re()),null;var n=Fa(e,t);if(e.tag!==0&&n===2){var r=kc(e);r!==0&&(t=r,n=td(e,r))}if(n===1)throw n=$i,Rr(e,0),Gn(e,t),st(e,Re()),n;if(n===6)throw Error(H(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Nr(e,it,_n),st(e,Re()),null}function rd(e,t){var n=ne;ne|=1;try{return e(t)}finally{ne=n,ne===0&&(_o=Re()+500,fa&&Fn())}}function xr(e){zn!==null&&zn.tag===0&&!(ne&6)&&So();var t=ne;ne|=1;var n=wt.transition,r=se;try{if(wt.transition=null,se=1,e)return e()}finally{se=r,wt.transition=n,ne=t,!(ne&6)&&Fn()}}function od(){gt=yo.current,de(yo)}function Rr(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Bx(n)),Oe!==null)for(n=Oe.return;n!==null;){var r=n;switch(pu(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&ua();break;case 3:mo(),de(nt),de(Ve),Au();break;case 5:Ou(r);break;case 4:mo();break;case 13:de(ve);break;case 19:de(ve);break;case 10:yu(r.type._context);break;case 22:case 23:od()}n=n.return}if(Pe=e,Oe=e=Yn(e.current,null),Ue=gt=t,Ce=0,$i=null,qu=Da=Sr=0,it=Bi=null,vr!==null){for(t=0;t<vr.length;t++)if(n=vr[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}vr=null}return e}function dm(e,t){do{var n=Oe;try{if(vu(),Ra.current=Ta,Na){for(var r=ye.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}Na=!1}if(_r=0,ke=be=ye=null,Pi=!1,Mi=0,Xu.current=null,n===null||n.return===null){Ce=1,$i=t,Oe=null;break}e:{var i=e,s=n.return,a=n,l=t;if(t=Ue,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,d=a,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var p=d.alternate;p?(d.updateQueue=p.updateQueue,d.memoizedState=p.memoizedState,d.lanes=p.lanes):(d.updateQueue=null,d.memoizedState=null)}var h=Mg(s);if(h!==null){h.flags&=-257,jg(h,s,a,i,t),h.mode&1&&Pg(i,c,t),t=h,l=c;var E=t.updateQueue;if(E===null){var v=new Set;v.add(l),t.updateQueue=v}else E.add(l);break e}else{if(!(t&1)){Pg(i,c,t),id();break e}l=Error(H(426))}}else if(he&&a.mode&1){var y=Mg(s);if(y!==null){!(y.flags&65536)&&(y.flags|=256),jg(y,s,a,i,t),mu(Eo(l,a));break e}}i=l=Eo(l,a),Ce!==4&&(Ce=2),Bi===null?Bi=[i]:Bi.push(i),i=s;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var g=Dg(i,l,t);ng(i,g);break e;case 1:a=l;var m=i.type,_=i.stateNode;if(!(i.flags&128)&&(typeof m.getDerivedStateFromError=="function"||_!==null&&typeof _.componentDidCatch=="function"&&(Hn===null||!Hn.has(_)))){i.flags|=65536,t&=-t,i.lanes|=t;var S=kg(i,a,t);ng(i,S);break e}}i=i.return}while(i!==null)}hm(n)}catch(x){t=x,Oe===n&&n!==null&&(Oe=n=n.return);continue}break}while(1)}function fm(){var e=La.current;return La.current=Ta,e===null?Ta:e}function id(){(Ce===0||Ce===3||Ce===2)&&(Ce=4),Pe===null||!(Sr&268435455)&&!(Da&268435455)||Gn(Pe,Ue)}function Fa(e,t){var n=ne;ne|=2;var r=fm();(Pe!==e||Ue!==t)&&(_n=null,Rr(e,t));do try{p1();break}catch(o){dm(e,o)}while(1);if(vu(),ne=n,La.current=r,Oe!==null)throw Error(H(261));return Pe=null,Ue=0,Ce}function p1(){for(;Oe!==null;)pm(Oe)}function h1(){for(;Oe!==null&&!FS();)pm(Oe)}function pm(e){var t=Em(e.alternate,e,gt);e.memoizedProps=e.pendingProps,t===null?hm(e):Oe=t,Xu.current=null}function hm(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=a1(n,t),n!==null){n.flags&=32767,Oe=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ce=6,Oe=null;return}}else if(n=s1(n,t,gt),n!==null){Oe=n;return}if(t=t.sibling,t!==null){Oe=t;return}Oe=t=e}while(t!==null);Ce===0&&(Ce=5)}function Nr(e,t,n){var r=se,o=wt.transition;try{wt.transition=null,se=1,g1(e,t,n,r)}finally{wt.transition=o,se=r}return null}function g1(e,t,n,r){do So();while(zn!==null);if(ne&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(QS(e,i),e===Pe&&(Oe=Pe=null,Ue=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Pa||(Pa=!0,vm(Hs,function(){return So(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=wt.transition,wt.transition=null;var s=se;se=1;var a=ne;ne|=4,Xu.current=null,c1(e,n),om(n,e),Px(iu),Xs=!!ou,iu=ou=null,e.current=n,u1(n),VS(),ne=a,se=s,wt.transition=i}else e.current=n;if(Pa&&(Pa=!1,zn=e,Ma=o),i=e.pendingLanes,i===0&&(Hn=null),HS(n.stateNode),st(e,Re()),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(ka)throw ka=!1,e=Zu,Zu=null,e;return Ma&1&&e.tag!==0&&So(),i=e.pendingLanes,i&1?e===ed?Hi++:(Hi=0,ed=e):Hi=0,Fn(),null}function So(){if(zn!==null){var e=th(Ma),t=wt.transition,n=se;try{if(wt.transition=null,se=16>e?16:e,zn===null)var r=!1;else{if(e=zn,zn=null,Ma=0,ne&6)throw Error(H(331));var o=ne;for(ne|=4,G=e.current;G!==null;){var i=G,s=i.child;if(G.flags&16){var a=i.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(G=c;G!==null;){var d=G;switch(d.tag){case 0:case 11:case 15:Vi(8,d,i)}var f=d.child;if(f!==null)f.return=d,G=f;else for(;G!==null;){d=G;var p=d.sibling,h=d.return;if(Zg(d),d===c){G=null;break}if(p!==null){p.return=h,G=p;break}G=h}}}var E=i.alternate;if(E!==null){var v=E.child;if(v!==null){E.child=null;do{var y=v.sibling;v.sibling=null,v=y}while(v!==null)}}G=i}}if(i.subtreeFlags&2064&&s!==null)s.return=i,G=s;else e:for(;G!==null;){if(i=G,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Vi(9,i,i.return)}var g=i.sibling;if(g!==null){g.return=i.return,G=g;break e}G=i.return}}var m=e.current;for(G=m;G!==null;){s=G;var _=s.child;if(s.subtreeFlags&2064&&_!==null)_.return=s,G=_;else e:for(s=m;G!==null;){if(a=G,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:Ca(9,a)}}catch(x){Se(a,a.return,x)}if(a===s){G=null;break e}var S=a.sibling;if(S!==null){S.return=a.return,G=S;break e}G=a.return}}if(ne=o,Fn(),Qt&&typeof Qt.onPostCommitFiberRoot=="function")try{Qt.onPostCommitFiberRoot(zs,e)}catch{}r=!0}return r}finally{se=n,wt.transition=t}}return!1}function gm(e,t,n){t=Eo(n,t),t=Dg(e,t,1),e=$n(e,t,1),t=Xe(),e!==null&&(pi(e,1,t),st(e,t))}function Se(e,t,n){if(e.tag===3)gm(e,e,n);else for(;t!==null;){if(t.tag===3){gm(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Hn===null||!Hn.has(r))){e=Eo(n,e),e=kg(t,e,1),t=$n(t,e,1),e=Xe(),t!==null&&(pi(t,1,e),st(t,e));break}}t=t.return}}function m1(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Xe(),e.pingedLanes|=e.suspendedLanes&n,Pe===e&&(Ue&n)===n&&(Ce===4||Ce===3&&(Ue&130023424)===Ue&&500>Re()-Ju?Rr(e,0):qu|=n),st(e,t)}function mm(e,t){t===0&&(e.mode&1?(t=Gs,Gs<<=1,!(Gs&130023424)&&(Gs=4194304)):t=1);var n=Xe();e=En(e,t),e!==null&&(pi(e,t,n),st(e,n))}function E1(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),mm(e,n)}function v1(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),mm(e,n)}var Em;Em=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||nt.current)ot=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return ot=!1,i1(e,t,n);ot=!!(e.flags&131072)}else ot=!1,he&&t.flags&1048576&&Qh(t,ha,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Ia(e,t),e=t.pendingProps;var o=lo(t,Ve.current);ho(t,n),o=Cu(null,t,r,e,o,n);var i=Lu();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,rt(r)?(i=!0,da(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,xu(t),o.updater=_a,t.stateNode=o,o._reactInternals=t,Nu(t,r,e,n),t=Vu(null,t,r,!0,i,n)):(t.tag=0,he&&i&&fu(t),Qe(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Ia(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=_1(r),e=Mt(r,e),o){case 0:t=Fu(null,t,r,e,n);break e;case 1:t=Hg(null,t,r,e,n);break e;case 11:t=Ug(null,t,r,e,n);break e;case 14:t=Fg(null,t,r,Mt(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:Mt(r,o),Fu(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Mt(r,o),Hg(e,t,r,o,n);case 3:e:{if(zg(t),e===null)throw Error(H(387));r=t.pendingProps,i=t.memoizedState,o=i.element,tg(e,t),ya(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=Wg(e,t,r,n,o);break e}else if(r!==o){o=Eo(Error(H(424)),t),t=Wg(e,t,r,n,o);break e}else for(ht=Mn(t.stateNode.containerInfo.firstChild),pt=t,he=!0,Pt=null,n=ug(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(fo(),r===o){t=yn(e,t,n);break e}Qe(e,t,r,n)}t=t.child}return t;case 5:return dg(t),e===null&&gu(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,su(r,o)?s=null:i!==null&&su(r,i)&&(t.flags|=32),Bg(e,t),Qe(e,t,s,n),t.child;case 6:return e===null&&gu(t),null;case 13:return Gg(e,t,n);case 4:return wu(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=go(t,null,r,n):Qe(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Mt(r,o),Ug(e,t,r,o,n);case 7:return Qe(e,t,t.pendingProps,n),t.child;case 8:return Qe(e,t,t.pendingProps.children,n),t.child;case 12:return Qe(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,ce(ma,r._currentValue),r._currentValue=s,i!==null)if(kt(i.value,s)){if(i.children===o.children&&!nt.current){t=yn(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){s=i.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=vn(-1,n&-n),l.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var d=c.pending;d===null?l.next=l:(l.next=d.next,d.next=l),c.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),_u(i.return,n,t),a.lanes|=n;break}l=l.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,a=s.alternate,a!==null&&(a.lanes|=n),_u(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}Qe(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,ho(t,n),o=Rt(o),r=r(o),t.flags|=1,Qe(e,t,r,n),t.child;case 14:return r=t.type,o=Mt(r,t.pendingProps),o=Mt(r.type,o),Fg(e,t,r,o,n);case 15:return Vg(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Mt(r,o),Ia(e,t),t.tag=1,rt(r)?(e=!0,da(t)):e=!1,ho(t,n),sg(t,r,o),Nu(t,r,o,n),Vu(null,t,r,!0,e,n);case 19:return Kg(e,t,n);case 22:return $g(e,t,n)}throw Error(H(156,t.tag))};function vm(e,t){return Xp(e,t)}function y1(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 Ot(e,t,n,r){return new y1(e,t,n,r)}function sd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function _1(e){if(typeof e=="function")return sd(e)?1:0;if(e!=null){if(e=e.$$typeof,e===fc)return 11;if(e===gc)return 14}return 2}function Yn(e,t){var n=e.alternate;return n===null?(n=Ot(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 Va(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")sd(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Qr:return wr(n.children,o,i,t);case uc:s=8,o|=8;break;case dc:return e=Ot(12,n,t,o|2),e.elementType=dc,e.lanes=i,e;case pc:return e=Ot(13,n,t,o),e.elementType=pc,e.lanes=i,e;case hc:return e=Ot(19,n,t,o),e.elementType=hc,e.lanes=i,e;case Op:return $a(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Np:s=10;break e;case wp:s=9;break e;case fc:s=11;break e;case gc:s=14;break e;case An:s=16,r=null;break e}throw Error(H(130,e==null?e:typeof e,""))}return t=Ot(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function wr(e,t,n,r){return e=Ot(7,e,r,t),e.lanes=n,e}function $a(e,t,n,r){return e=Ot(22,e,r,t),e.elementType=Op,e.lanes=n,e.stateNode={isHidden:!1},e}function ad(e,t,n){return e=Ot(6,e,null,t),e.lanes=n,e}function ld(e,t,n){return t=Ot(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function S1(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=Pc(0),this.expirationTimes=Pc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Pc(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function cd(e,t,n,r,o,i,s,a,l){return e=new S1(e,t,n,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Ot(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},xu(i),e}function x1(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Kr,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function ym(e){if(!e)return Un;e=e._reactInternals;e:{if(pr(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(rt(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(rt(n))return Gh(e,n,t)}return t}function _m(e,t,n,r,o,i,s,a,l){return e=cd(n,r,!0,e,o,i,s,a,l),e.context=ym(null),n=e.current,r=Xe(),o=Wn(n),i=vn(r,o),i.callback=t??null,$n(n,i,o),e.current.lanes=o,pi(e,o,r),st(e,r),e}function Ba(e,t,n,r){var o=t.current,i=Xe(),s=Wn(o);return n=ym(n),t.context===null?t.context=n:t.pendingContext=n,t=vn(i,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=$n(o,t,s),e!==null&&(Ft(e,o,s,i),va(e,o,s)),s}function Ha(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 Sm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ud(e,t){Sm(e,t),(e=e.alternate)&&Sm(e,t)}function R1(){return null}var xm=typeof reportError=="function"?reportError:function(e){console.error(e)};function dd(e){this._internalRoot=e}za.prototype.render=dd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(H(409));Ba(e,t,null,null)},za.prototype.unmount=dd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;xr(function(){Ba(null,e,null,null)}),t[pn]=null}};function za(e){this._internalRoot=e}za.prototype.unstable_scheduleHydration=function(e){if(e){var t=oh();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Dn.length&&t!==0&&t<Dn[n].priority;n++);Dn.splice(n,0,e),n===0&&ah(e)}};function fd(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Wa(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Rm(){}function N1(e,t,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var c=Ha(s);i.call(c)}}var s=_m(t,r,e,0,null,!1,!1,"",Rm);return e._reactRootContainer=s,e[pn]=s.current,Ti(e.nodeType===8?e.parentNode:e),xr(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var a=r;r=function(){var c=Ha(l);a.call(c)}}var l=cd(e,0,!1,null,null,!1,!1,"",Rm);return e._reactRootContainer=l,e[pn]=l.current,Ti(e.nodeType===8?e.parentNode:e),xr(function(){Ba(t,l,n,r)}),l}function Ga(e,t,n,r,o){var i=n._reactRootContainer;if(i){var s=i;if(typeof o=="function"){var a=o;o=function(){var l=Ha(s);a.call(l)}}Ba(t,s,e,o)}else s=N1(n,t,e,o,r);return Ha(s)}nh=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=fi(t.pendingLanes);n!==0&&(Mc(t,n|1),st(t,Re()),!(ne&6)&&(_o=Re()+500,Fn()))}break;case 13:xr(function(){var r=En(e,1);if(r!==null){var o=Xe();Ft(r,e,1,o)}}),ud(e,1)}},jc=function(e){if(e.tag===13){var t=En(e,134217728);if(t!==null){var n=Xe();Ft(t,e,134217728,n)}ud(e,134217728)}},rh=function(e){if(e.tag===13){var t=Wn(e),n=En(e,t);if(n!==null){var r=Xe();Ft(n,e,t,r)}ud(e,t)}},oh=function(){return se},ih=function(e,t){var n=se;try{return se=e,t()}finally{se=n}},Ic=function(e,t,n){switch(t){case"input":if(Sc(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=ca(r);if(!o)throw Error(H(90));Ip(r),Sc(r,o)}}}break;case"textarea":kp(e,n);break;case"select":t=n.value,t!=null&&Xr(e,!!n.multiple,t,!1)}},Hp=rd,zp=xr;var w1={usingClientEntryPoint:!1,Events:[bi,so,ca,$p,Bp,rd]},zi={findFiberByHostInstance:hr,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},O1={bundleType:zi.bundleType,version:zi.version,rendererPackageName:zi.rendererPackageName,rendererConfig:zi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:fn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Kp(e),e===null?null:e.stateNode},findFiberByHostInstance:zi.findFiberByHostInstance||R1,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 Ya=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ya.isDisabled&&Ya.supportsFiber)try{zs=Ya.inject(O1),Qt=Ya}catch{}}ut.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=w1,ut.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!fd(t))throw Error(H(200));return x1(e,t,null,n)},ut.createRoot=function(e,t){if(!fd(e))throw Error(H(299));var n=!1,r="",o=xm;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=cd(e,1,!1,null,null,n,!1,r,o),e[pn]=t.current,Ti(e.nodeType===8?e.parentNode:e),new dd(t)},ut.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=Kp(t),e=e===null?null:e.stateNode,e},ut.flushSync=function(e){return xr(e)},ut.hydrate=function(e,t,n){if(!Wa(t))throw Error(H(200));return Ga(null,e,t,!0,n)},ut.hydrateRoot=function(e,t,n){if(!fd(e))throw Error(H(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",s=xm;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=_m(t,null,e,1,n??null,o,!1,i,s),e[pn]=t.current,Ti(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 za(t)},ut.render=function(e,t,n){if(!Wa(t))throw Error(H(200));return Ga(null,e,t,!1,n)},ut.unmountComponentAtNode=function(e){if(!Wa(e))throw Error(H(40));return e._reactRootContainer?(xr(function(){Ga(null,null,e,!1,function(){e._reactRootContainer=null,e[pn]=null})}),!0):!1},ut.unstable_batchedUpdates=rd,ut.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Wa(n))throw Error(H(200));if(e==null||e._reactInternals===void 0)throw Error(H(38));return Ga(e,t,n,!1,r)},ut.version="18.2.0-next-9e3b772b8-20220608";function Nm(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Nm)}catch(e){console.error(e)}}Nm(),Ep.exports=ut;var xo=Ep.exports,wm=xo;ic.createRoot=wm.createRoot,ic.hydrateRoot=wm.hydrateRoot;function qe(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=qe(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var Om={exports:{}},Tm={},Am={exports:{}},Im={};/**
37
+ */var Ep=O,ft=J_;function G(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var yp=new Set,es={};function or(e,t){$r(e,t),$r(e+"Capture",t)}function $r(e,t){for(es[e]=t,e=0;e<t.length;e++)yp.add(t[e])}var rn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),sc=Object.prototype.hasOwnProperty,Z_=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,vp={},_p={};function eS(e){return sc.call(_p,e)?!0:sc.call(vp,e)?!1:Z_.test(e)?_p[e]=!0:(vp[e]=!0,!1)}function tS(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function nS(e,t,n,r){if(t===null||typeof t>"u"||tS(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Xe(e,t,n,r,o,s,i){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=i}var Ue={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ue[e]=new Xe(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ue[t]=new Xe(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ue[e]=new Xe(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ue[e]=new Xe(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Ue[e]=new Xe(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){Ue[e]=new Xe(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){Ue[e]=new Xe(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){Ue[e]=new Xe(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){Ue[e]=new Xe(e,5,!1,e.toLowerCase(),null,!1,!1)});var ic=/[\-:]([a-z])/g;function lc(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(ic,lc);Ue[t]=new Xe(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(ic,lc);Ue[t]=new Xe(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(ic,lc);Ue[t]=new Xe(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){Ue[e]=new Xe(e,1,!1,e.toLowerCase(),null,!1,!1)}),Ue.xlinkHref=new Xe("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){Ue[e]=new Xe(e,1,!1,e.toLowerCase(),null,!0,!0)});function ac(e,t,n,r){var o=Ue.hasOwnProperty(t)?Ue[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(nS(t,n,o,r)&&(n=null),r||o===null?eS(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=n===null?o.type===3?!1:"":n:(t=o.attributeName,r=o.attributeNamespace,n===null?e.removeAttribute(t):(o=o.type,n=o===3||o===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var on=Ep.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,bi=Symbol.for("react.element"),Hr=Symbol.for("react.portal"),Br=Symbol.for("react.fragment"),cc=Symbol.for("react.strict_mode"),uc=Symbol.for("react.profiler"),Sp=Symbol.for("react.provider"),xp=Symbol.for("react.context"),dc=Symbol.for("react.forward_ref"),fc=Symbol.for("react.suspense"),pc=Symbol.for("react.suspense_list"),hc=Symbol.for("react.memo"),xn=Symbol.for("react.lazy"),Rp=Symbol.for("react.offscreen"),Np=Symbol.iterator;function ts(e){return e===null||typeof e!="object"?null:(e=Np&&e[Np]||e["@@iterator"],typeof e=="function"?e:null)}var ve=Object.assign,mc;function ns(e){if(mc===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);mc=t&&t[1]||""}return`
38
+ `+mc+e}var gc=!1;function Ec(e,t){if(!e||gc)return"";gc=!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(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var o=c.stack.split(`
39
+ `),s=r.stack.split(`
40
+ `),i=o.length-1,l=s.length-1;1<=i&&0<=l&&o[i]!==s[l];)l--;for(;1<=i&&0<=l;i--,l--)if(o[i]!==s[l]){if(i!==1||l!==1)do if(i--,l--,0>l||o[i]!==s[l]){var a=`
41
+ `+o[i].replace(" at new "," at ");return e.displayName&&a.includes("<anonymous>")&&(a=a.replace("<anonymous>",e.displayName)),a}while(1<=i&&0<=l);break}}}finally{gc=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?ns(e):""}function rS(e){switch(e.tag){case 5:return ns(e.type);case 16:return ns("Lazy");case 13:return ns("Suspense");case 19:return ns("SuspenseList");case 0:case 2:case 15:return e=Ec(e.type,!1),e;case 11:return e=Ec(e.type.render,!1),e;case 1:return e=Ec(e.type,!0),e;default:return""}}function yc(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 Br:return"Fragment";case Hr:return"Portal";case uc:return"Profiler";case cc:return"StrictMode";case fc:return"Suspense";case pc:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case xp:return(e.displayName||"Context")+".Consumer";case Sp:return(e._context.displayName||"Context")+".Provider";case dc:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case hc:return t=e.displayName||null,t!==null?t:yc(e.type)||"Memo";case xn:t=e._payload,e=e._init;try{return yc(e(t))}catch{}}return null}function oS(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 yc(t);case 8:return t===cc?"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 Rn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function wp(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function sS(e){var t=wp(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,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(i){r=""+i,s.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(i){r=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Di(e){e._valueTracker||(e._valueTracker=sS(e))}function Op(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=wp(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function ki(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 vc(e,t){var n=t.checked;return ve({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Tp(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Rn(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 Ap(e,t){t=t.checked,t!=null&&ac(e,"checked",t,!1)}function _c(e,t){Ap(e,t);var n=Rn(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")?Sc(e,t.type,n):t.hasOwnProperty("defaultValue")&&Sc(e,t.type,Rn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Ip(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 Sc(e,t,n){(t!=="number"||ki(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var rs=Array.isArray;function zr(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=""+Rn(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 xc(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(G(91));return ve({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Cp(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(G(92));if(rs(n)){if(1<n.length)throw Error(G(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Rn(n)}}function Lp(e,t){var n=Rn(t.value),r=Rn(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 bp(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Dp(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 Rc(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Dp(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Pi,kp=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(Pi=Pi||document.createElement("div"),Pi.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Pi.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function os(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ss={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},iS=["Webkit","ms","Moz","O"];Object.keys(ss).forEach(function(e){iS.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ss[t]=ss[e]})});function Pp(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||ss.hasOwnProperty(e)&&ss[e]?(""+t).trim():t+"px"}function Mp(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=Pp(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var lS=ve({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 Nc(e,t){if(t){if(lS[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(G(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(G(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(G(61))}if(t.style!=null&&typeof t.style!="object")throw Error(G(62))}}function wc(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 Oc=null;function Tc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ac=null,Wr=null,Gr=null;function Up(e){if(e=Ts(e)){if(typeof Ac!="function")throw Error(G(280));var t=e.stateNode;t&&(t=ol(t),Ac(e.stateNode,e.type,t))}}function Fp(e){Wr?Gr?Gr.push(e):Gr=[e]:Wr=e}function jp(){if(Wr){var e=Wr,t=Gr;if(Gr=Wr=null,Up(e),t)for(e=0;e<t.length;e++)Up(t[e])}}function Vp(e,t){return e(t)}function $p(){}var Ic=!1;function Hp(e,t,n){if(Ic)return e(t,n);Ic=!0;try{return Vp(e,t,n)}finally{Ic=!1,(Wr!==null||Gr!==null)&&($p(),jp())}}function is(e,t){var n=e.stateNode;if(n===null)return null;var r=ol(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(G(231,t,typeof n));return n}var Cc=!1;if(rn)try{var ls={};Object.defineProperty(ls,"passive",{get:function(){Cc=!0}}),window.addEventListener("test",ls,ls),window.removeEventListener("test",ls,ls)}catch{Cc=!1}function aS(e,t,n,r,o,s,i,l,a){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(u){this.onError(u)}}var as=!1,Mi=null,Ui=!1,Lc=null,cS={onError:function(e){as=!0,Mi=e}};function uS(e,t,n,r,o,s,i,l,a){as=!1,Mi=null,aS.apply(cS,arguments)}function dS(e,t,n,r,o,s,i,l,a){if(uS.apply(this,arguments),as){if(as){var c=Mi;as=!1,Mi=null}else throw Error(G(198));Ui||(Ui=!0,Lc=c)}}function sr(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 Bp(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 zp(e){if(sr(e)!==e)throw Error(G(188))}function fS(e){var t=e.alternate;if(!t){if(t=sr(e),t===null)throw Error(G(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var s=o.alternate;if(s===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===s.child){for(s=o.child;s;){if(s===n)return zp(o),e;if(s===r)return zp(o),t;s=s.sibling}throw Error(G(188))}if(n.return!==r.return)n=o,r=s;else{for(var i=!1,l=o.child;l;){if(l===n){i=!0,n=o,r=s;break}if(l===r){i=!0,r=o,n=s;break}l=l.sibling}if(!i){for(l=s.child;l;){if(l===n){i=!0,n=s,r=o;break}if(l===r){i=!0,r=s,n=o;break}l=l.sibling}if(!i)throw Error(G(189))}}if(n.alternate!==r)throw Error(G(190))}if(n.tag!==3)throw Error(G(188));return n.stateNode.current===n?e:t}function Wp(e){return e=fS(e),e!==null?Gp(e):null}function Gp(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Gp(e);if(t!==null)return t;e=e.sibling}return null}var Yp=ft.unstable_scheduleCallback,Kp=ft.unstable_cancelCallback,pS=ft.unstable_shouldYield,hS=ft.unstable_requestPaint,we=ft.unstable_now,mS=ft.unstable_getCurrentPriorityLevel,bc=ft.unstable_ImmediatePriority,Xp=ft.unstable_UserBlockingPriority,Fi=ft.unstable_NormalPriority,gS=ft.unstable_LowPriority,Qp=ft.unstable_IdlePriority,ji=null,zt=null;function ES(e){if(zt&&typeof zt.onCommitFiberRoot=="function")try{zt.onCommitFiberRoot(ji,e,void 0,(e.current.flags&128)===128)}catch{}}var bt=Math.clz32?Math.clz32:_S,yS=Math.log,vS=Math.LN2;function _S(e){return e>>>=0,e===0?32:31-(yS(e)/vS|0)|0}var Vi=64,$i=4194304;function cs(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 Hi(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,s=e.pingedLanes,i=n&268435455;if(i!==0){var l=i&~o;l!==0?r=cs(l):(s&=i,s!==0&&(r=cs(s)))}else i=n&~o,i!==0?r=cs(i):s!==0&&(r=cs(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,s=t&-t,o>=s||o===16&&(s&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-bt(t),o=1<<n,r|=e[n],t&=~o;return r}function SS(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 xS(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,s=e.pendingLanes;0<s;){var i=31-bt(s),l=1<<i,a=o[i];a===-1?(!(l&n)||l&r)&&(o[i]=SS(l,t)):a<=t&&(e.expiredLanes|=l),s&=~l}}function Dc(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function qp(){var e=Vi;return Vi<<=1,!(Vi&4194240)&&(Vi=64),e}function kc(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function us(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-bt(t),e[t]=n}function RS(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-bt(n),s=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~s}}function Pc(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-bt(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var ue=0;function Jp(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Zp,Mc,eh,th,nh,Uc=!1,Bi=[],Nn=null,wn=null,On=null,ds=new Map,fs=new Map,Tn=[],NS="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 rh(e,t){switch(e){case"focusin":case"focusout":Nn=null;break;case"dragenter":case"dragleave":wn=null;break;case"mouseover":case"mouseout":On=null;break;case"pointerover":case"pointerout":ds.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":fs.delete(t.pointerId)}}function ps(e,t,n,r,o,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[o]},t!==null&&(t=Ts(t),t!==null&&Mc(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function wS(e,t,n,r,o){switch(t){case"focusin":return Nn=ps(Nn,e,t,n,r,o),!0;case"dragenter":return wn=ps(wn,e,t,n,r,o),!0;case"mouseover":return On=ps(On,e,t,n,r,o),!0;case"pointerover":var s=o.pointerId;return ds.set(s,ps(ds.get(s)||null,e,t,n,r,o)),!0;case"gotpointercapture":return s=o.pointerId,fs.set(s,ps(fs.get(s)||null,e,t,n,r,o)),!0}return!1}function oh(e){var t=ir(e.target);if(t!==null){var n=sr(t);if(n!==null){if(t=n.tag,t===13){if(t=Bp(n),t!==null){e.blockedOn=t,nh(e.priority,function(){eh(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 zi(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=jc(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Oc=r,n.target.dispatchEvent(r),Oc=null}else return t=Ts(n),t!==null&&Mc(t),e.blockedOn=n,!1;t.shift()}return!0}function sh(e,t,n){zi(e)&&n.delete(t)}function OS(){Uc=!1,Nn!==null&&zi(Nn)&&(Nn=null),wn!==null&&zi(wn)&&(wn=null),On!==null&&zi(On)&&(On=null),ds.forEach(sh),fs.forEach(sh)}function hs(e,t){e.blockedOn===t&&(e.blockedOn=null,Uc||(Uc=!0,ft.unstable_scheduleCallback(ft.unstable_NormalPriority,OS)))}function ms(e){function t(o){return hs(o,e)}if(0<Bi.length){hs(Bi[0],e);for(var n=1;n<Bi.length;n++){var r=Bi[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Nn!==null&&hs(Nn,e),wn!==null&&hs(wn,e),On!==null&&hs(On,e),ds.forEach(t),fs.forEach(t),n=0;n<Tn.length;n++)r=Tn[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Tn.length&&(n=Tn[0],n.blockedOn===null);)oh(n),n.blockedOn===null&&Tn.shift()}var Yr=on.ReactCurrentBatchConfig,Wi=!0;function TS(e,t,n,r){var o=ue,s=Yr.transition;Yr.transition=null;try{ue=1,Fc(e,t,n,r)}finally{ue=o,Yr.transition=s}}function AS(e,t,n,r){var o=ue,s=Yr.transition;Yr.transition=null;try{ue=4,Fc(e,t,n,r)}finally{ue=o,Yr.transition=s}}function Fc(e,t,n,r){if(Wi){var o=jc(e,t,n,r);if(o===null)nu(e,t,r,Gi,n),rh(e,r);else if(wS(o,e,t,n,r))r.stopPropagation();else if(rh(e,r),t&4&&-1<NS.indexOf(e)){for(;o!==null;){var s=Ts(o);if(s!==null&&Zp(s),s=jc(e,t,n,r),s===null&&nu(e,t,r,Gi,n),s===o)break;o=s}o!==null&&r.stopPropagation()}else nu(e,t,r,null,n)}}var Gi=null;function jc(e,t,n,r){if(Gi=null,e=Tc(r),e=ir(e),e!==null)if(t=sr(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Bp(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 Gi=e,null}function ih(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(mS()){case bc:return 1;case Xp:return 4;case Fi:case gS:return 16;case Qp:return 536870912;default:return 16}default:return 16}}var An=null,Vc=null,Yi=null;function lh(){if(Yi)return Yi;var e,t=Vc,n=t.length,r,o="value"in An?An.value:An.textContent,s=o.length;for(e=0;e<n&&t[e]===o[e];e++);var i=n-e;for(r=1;r<=i&&t[n-r]===o[s-r];r++);return Yi=o.slice(e,1<r?1-r:void 0)}function Ki(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 Xi(){return!0}function ah(){return!1}function pt(e){function t(n,r,o,s,i){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=s,this.target=i,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(s):s[l]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?Xi:ah,this.isPropagationStopped=ah,this}return ve(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=Xi)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Xi)},persist:function(){},isPersistent:Xi}),t}var Kr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},$c=pt(Kr),gs=ve({},Kr,{view:0,detail:0}),IS=pt(gs),Hc,Bc,Es,Qi=ve({},gs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Wc,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!==Es&&(Es&&e.type==="mousemove"?(Hc=e.screenX-Es.screenX,Bc=e.screenY-Es.screenY):Bc=Hc=0,Es=e),Hc)},movementY:function(e){return"movementY"in e?e.movementY:Bc}}),ch=pt(Qi),CS=ve({},Qi,{dataTransfer:0}),LS=pt(CS),bS=ve({},gs,{relatedTarget:0}),zc=pt(bS),DS=ve({},Kr,{animationName:0,elapsedTime:0,pseudoElement:0}),kS=pt(DS),PS=ve({},Kr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),MS=pt(PS),US=ve({},Kr,{data:0}),uh=pt(US),FS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},jS={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"},VS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function $S(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=VS[e])?!!t[e]:!1}function Wc(){return $S}var HS=ve({},gs,{key:function(e){if(e.key){var t=FS[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ki(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?jS[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Wc,charCode:function(e){return e.type==="keypress"?Ki(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ki(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),BS=pt(HS),zS=ve({},Qi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),dh=pt(zS),WS=ve({},gs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Wc}),GS=pt(WS),YS=ve({},Kr,{propertyName:0,elapsedTime:0,pseudoElement:0}),KS=pt(YS),XS=ve({},Qi,{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}),QS=pt(XS),qS=[9,13,27,32],Gc=rn&&"CompositionEvent"in window,ys=null;rn&&"documentMode"in document&&(ys=document.documentMode);var JS=rn&&"TextEvent"in window&&!ys,fh=rn&&(!Gc||ys&&8<ys&&11>=ys),ph=" ",hh=!1;function mh(e,t){switch(e){case"keyup":return qS.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function gh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Xr=!1;function ZS(e,t){switch(e){case"compositionend":return gh(t);case"keypress":return t.which!==32?null:(hh=!0,ph);case"textInput":return e=t.data,e===ph&&hh?null:e;default:return null}}function ex(e,t){if(Xr)return e==="compositionend"||!Gc&&mh(e,t)?(e=lh(),Yi=Vc=An=null,Xr=!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 fh&&t.locale!=="ko"?null:t.data;default:return null}}var tx={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 Eh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!tx[e.type]:t==="textarea"}function yh(e,t,n,r){Fp(r),t=tl(t,"onChange"),0<t.length&&(n=new $c("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var vs=null,_s=null;function nx(e){Mh(e,0)}function qi(e){var t=eo(e);if(Op(t))return e}function rx(e,t){if(e==="change")return t}var vh=!1;if(rn){var Yc;if(rn){var Kc="oninput"in document;if(!Kc){var _h=document.createElement("div");_h.setAttribute("oninput","return;"),Kc=typeof _h.oninput=="function"}Yc=Kc}else Yc=!1;vh=Yc&&(!document.documentMode||9<document.documentMode)}function Sh(){vs&&(vs.detachEvent("onpropertychange",xh),_s=vs=null)}function xh(e){if(e.propertyName==="value"&&qi(_s)){var t=[];yh(t,_s,e,Tc(e)),Hp(nx,t)}}function ox(e,t,n){e==="focusin"?(Sh(),vs=t,_s=n,vs.attachEvent("onpropertychange",xh)):e==="focusout"&&Sh()}function sx(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return qi(_s)}function ix(e,t){if(e==="click")return qi(t)}function lx(e,t){if(e==="input"||e==="change")return qi(t)}function ax(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Dt=typeof Object.is=="function"?Object.is:ax;function Ss(e,t){if(Dt(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(!sc.call(t,o)||!Dt(e[o],t[o]))return!1}return!0}function Rh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Nh(e,t){var n=Rh(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=Rh(n)}}function wh(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?wh(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Oh(){for(var e=window,t=ki();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=ki(e.document)}return t}function Xc(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 cx(e){var t=Oh(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&wh(n.ownerDocument.documentElement,n)){if(r!==null&&Xc(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,s=Math.min(r.start,o);r=r.end===void 0?s:Math.min(r.end,o),!e.extend&&s>r&&(o=r,r=s,s=o),o=Nh(n,s);var i=Nh(n,r);o&&i&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.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 ux=rn&&"documentMode"in document&&11>=document.documentMode,Qr=null,Qc=null,xs=null,qc=!1;function Th(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;qc||Qr==null||Qr!==ki(r)||(r=Qr,"selectionStart"in r&&Xc(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}),xs&&Ss(xs,r)||(xs=r,r=tl(Qc,"onSelect"),0<r.length&&(t=new $c("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Qr)))}function Ji(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var qr={animationend:Ji("Animation","AnimationEnd"),animationiteration:Ji("Animation","AnimationIteration"),animationstart:Ji("Animation","AnimationStart"),transitionend:Ji("Transition","TransitionEnd")},Jc={},Ah={};rn&&(Ah=document.createElement("div").style,"AnimationEvent"in window||(delete qr.animationend.animation,delete qr.animationiteration.animation,delete qr.animationstart.animation),"TransitionEvent"in window||delete qr.transitionend.transition);function Zi(e){if(Jc[e])return Jc[e];if(!qr[e])return e;var t=qr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Ah)return Jc[e]=t[n];return e}var Ih=Zi("animationend"),Ch=Zi("animationiteration"),Lh=Zi("animationstart"),bh=Zi("transitionend"),Dh=new Map,kh="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 In(e,t){Dh.set(e,t),or(t,[e])}for(var Zc=0;Zc<kh.length;Zc++){var eu=kh[Zc],dx=eu.toLowerCase(),fx=eu[0].toUpperCase()+eu.slice(1);In(dx,"on"+fx)}In(Ih,"onAnimationEnd"),In(Ch,"onAnimationIteration"),In(Lh,"onAnimationStart"),In("dblclick","onDoubleClick"),In("focusin","onFocus"),In("focusout","onBlur"),In(bh,"onTransitionEnd"),$r("onMouseEnter",["mouseout","mouseover"]),$r("onMouseLeave",["mouseout","mouseover"]),$r("onPointerEnter",["pointerout","pointerover"]),$r("onPointerLeave",["pointerout","pointerover"]),or("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),or("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),or("onBeforeInput",["compositionend","keypress","textInput","paste"]),or("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),or("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),or("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Rs="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(" "),px=new Set("cancel close invalid load scroll toggle".split(" ").concat(Rs));function Ph(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,dS(r,t,void 0,e),e.currentTarget=null}function Mh(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 s=void 0;if(t)for(var i=r.length-1;0<=i;i--){var l=r[i],a=l.instance,c=l.currentTarget;if(l=l.listener,a!==s&&o.isPropagationStopped())break e;Ph(o,l,c),s=a}else for(i=0;i<r.length;i++){if(l=r[i],a=l.instance,c=l.currentTarget,l=l.listener,a!==s&&o.isPropagationStopped())break e;Ph(o,l,c),s=a}}}if(Ui)throw e=Lc,Ui=!1,Lc=null,e}function pe(e,t){var n=t[au];n===void 0&&(n=t[au]=new Set);var r=e+"__bubble";n.has(r)||(Uh(t,e,2,!1),n.add(r))}function tu(e,t,n){var r=0;t&&(r|=4),Uh(n,e,r,t)}var el="_reactListening"+Math.random().toString(36).slice(2);function Ns(e){if(!e[el]){e[el]=!0,yp.forEach(function(n){n!=="selectionchange"&&(px.has(n)||tu(n,!1,e),tu(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[el]||(t[el]=!0,tu("selectionchange",!1,t))}}function Uh(e,t,n,r){switch(ih(t)){case 1:var o=TS;break;case 4:o=AS;break;default:o=Fc}n=o.bind(null,t,n,e),o=void 0,!Cc||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 nu(e,t,n,r,o){var s=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var i=r.tag;if(i===3||i===4){var l=r.stateNode.containerInfo;if(l===o||l.nodeType===8&&l.parentNode===o)break;if(i===4)for(i=r.return;i!==null;){var a=i.tag;if((a===3||a===4)&&(a=i.stateNode.containerInfo,a===o||a.nodeType===8&&a.parentNode===o))return;i=i.return}for(;l!==null;){if(i=ir(l),i===null)return;if(a=i.tag,a===5||a===6){r=s=i;continue e}l=l.parentNode}}r=r.return}Hp(function(){var c=s,u=Tc(n),f=[];e:{var p=Dh.get(e);if(p!==void 0){var h=$c,E=e;switch(e){case"keypress":if(Ki(n)===0)break e;case"keydown":case"keyup":h=BS;break;case"focusin":E="focus",h=zc;break;case"focusout":E="blur",h=zc;break;case"beforeblur":case"afterblur":h=zc;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=ch;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=LS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=GS;break;case Ih:case Ch:case Lh:h=kS;break;case bh:h=KS;break;case"scroll":h=IS;break;case"wheel":h=QS;break;case"copy":case"cut":case"paste":h=MS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=dh}var y=(t&4)!==0,v=!y&&e==="scroll",m=y?p!==null?p+"Capture":null:p;y=[];for(var g=c,S;g!==null;){S=g;var _=S.stateNode;if(S.tag===5&&_!==null&&(S=_,m!==null&&(_=is(g,m),_!=null&&y.push(ws(g,_,S)))),v)break;g=g.return}0<y.length&&(p=new h(p,E,null,n,u),f.push({event:p,listeners:y}))}}if(!(t&7)){e:{if(p=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",p&&n!==Oc&&(E=n.relatedTarget||n.fromElement)&&(ir(E)||E[sn]))break e;if((h||p)&&(p=u.window===u?u:(p=u.ownerDocument)?p.defaultView||p.parentWindow:window,h?(E=n.relatedTarget||n.toElement,h=c,E=E?ir(E):null,E!==null&&(v=sr(E),E!==v||E.tag!==5&&E.tag!==6)&&(E=null)):(h=null,E=c),h!==E)){if(y=ch,_="onMouseLeave",m="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(y=dh,_="onPointerLeave",m="onPointerEnter",g="pointer"),v=h==null?p:eo(h),S=E==null?p:eo(E),p=new y(_,g+"leave",h,n,u),p.target=v,p.relatedTarget=S,_=null,ir(u)===c&&(y=new y(m,g+"enter",E,n,u),y.target=S,y.relatedTarget=v,_=y),v=_,h&&E)t:{for(y=h,m=E,g=0,S=y;S;S=Jr(S))g++;for(S=0,_=m;_;_=Jr(_))S++;for(;0<g-S;)y=Jr(y),g--;for(;0<S-g;)m=Jr(m),S--;for(;g--;){if(y===m||m!==null&&y===m.alternate)break t;y=Jr(y),m=Jr(m)}y=null}else y=null;h!==null&&Fh(f,p,h,y,!1),E!==null&&v!==null&&Fh(f,v,E,y,!0)}}e:{if(p=c?eo(c):window,h=p.nodeName&&p.nodeName.toLowerCase(),h==="select"||h==="input"&&p.type==="file")var x=rx;else if(Eh(p))if(vh)x=lx;else{x=sx;var R=ox}else(h=p.nodeName)&&h.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(x=ix);if(x&&(x=x(e,c))){yh(f,x,n,u);break e}R&&R(e,p,c),e==="focusout"&&(R=p._wrapperState)&&R.controlled&&p.type==="number"&&Sc(p,"number",p.value)}switch(R=c?eo(c):window,e){case"focusin":(Eh(R)||R.contentEditable==="true")&&(Qr=R,Qc=c,xs=null);break;case"focusout":xs=Qc=Qr=null;break;case"mousedown":qc=!0;break;case"contextmenu":case"mouseup":case"dragend":qc=!1,Th(f,n,u);break;case"selectionchange":if(ux)break;case"keydown":case"keyup":Th(f,n,u)}var T;if(Gc)e:{switch(e){case"compositionstart":var L="onCompositionStart";break e;case"compositionend":L="onCompositionEnd";break e;case"compositionupdate":L="onCompositionUpdate";break e}L=void 0}else Xr?mh(e,n)&&(L="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(L="onCompositionStart");L&&(fh&&n.locale!=="ko"&&(Xr||L!=="onCompositionStart"?L==="onCompositionEnd"&&Xr&&(T=lh()):(An=u,Vc="value"in An?An.value:An.textContent,Xr=!0)),R=tl(c,L),0<R.length&&(L=new uh(L,e,null,n,u),f.push({event:L,listeners:R}),T?L.data=T:(T=gh(n),T!==null&&(L.data=T)))),(T=JS?ZS(e,n):ex(e,n))&&(c=tl(c,"onBeforeInput"),0<c.length&&(u=new uh("onBeforeInput","beforeinput",null,n,u),f.push({event:u,listeners:c}),u.data=T))}Mh(f,t)})}function ws(e,t,n){return{instance:e,listener:t,currentTarget:n}}function tl(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,s=o.stateNode;o.tag===5&&s!==null&&(o=s,s=is(e,n),s!=null&&r.unshift(ws(e,s,o)),s=is(e,t),s!=null&&r.push(ws(e,s,o))),e=e.return}return r}function Jr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Fh(e,t,n,r,o){for(var s=t._reactName,i=[];n!==null&&n!==r;){var l=n,a=l.alternate,c=l.stateNode;if(a!==null&&a===r)break;l.tag===5&&c!==null&&(l=c,o?(a=is(n,s),a!=null&&i.unshift(ws(n,a,l))):o||(a=is(n,s),a!=null&&i.push(ws(n,a,l)))),n=n.return}i.length!==0&&e.push({event:t,listeners:i})}var hx=/\r\n?/g,mx=/\u0000|\uFFFD/g;function jh(e){return(typeof e=="string"?e:""+e).replace(hx,`
42
+ `).replace(mx,"")}function nl(e,t,n){if(t=jh(t),jh(e)!==t&&n)throw Error(G(425))}function rl(){}var ru=null,ou=null;function su(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 iu=typeof setTimeout=="function"?setTimeout:void 0,gx=typeof clearTimeout=="function"?clearTimeout:void 0,Vh=typeof Promise=="function"?Promise:void 0,Ex=typeof queueMicrotask=="function"?queueMicrotask:typeof Vh<"u"?function(e){return Vh.resolve(null).then(e).catch(yx)}:iu;function yx(e){setTimeout(function(){throw e})}function lu(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),ms(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);ms(t)}function Cn(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 $h(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 Zr=Math.random().toString(36).slice(2),Wt="__reactFiber$"+Zr,Os="__reactProps$"+Zr,sn="__reactContainer$"+Zr,au="__reactEvents$"+Zr,vx="__reactListeners$"+Zr,_x="__reactHandles$"+Zr;function ir(e){var t=e[Wt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[sn]||n[Wt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=$h(e);e!==null;){if(n=e[Wt])return n;e=$h(e)}return t}e=n,n=e.parentNode}return null}function Ts(e){return e=e[Wt]||e[sn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function eo(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(G(33))}function ol(e){return e[Os]||null}var cu=[],to=-1;function Ln(e){return{current:e}}function he(e){0>to||(e.current=cu[to],cu[to]=null,to--)}function fe(e,t){to++,cu[to]=e.current,e.current=t}var bn={},He=Ln(bn),et=Ln(!1),lr=bn;function no(e,t){var n=e.type.contextTypes;if(!n)return bn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},s;for(s in n)o[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function tt(e){return e=e.childContextTypes,e!=null}function sl(){he(et),he(He)}function Hh(e,t,n){if(He.current!==bn)throw Error(G(168));fe(He,t),fe(et,n)}function Bh(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(G(108,oS(e)||"Unknown",o));return ve({},n,r)}function il(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||bn,lr=He.current,fe(He,e),fe(et,et.current),!0}function zh(e,t,n){var r=e.stateNode;if(!r)throw Error(G(169));n?(e=Bh(e,t,lr),r.__reactInternalMemoizedMergedChildContext=e,he(et),he(He),fe(He,e)):he(et),fe(et,n)}var ln=null,ll=!1,uu=!1;function Wh(e){ln===null?ln=[e]:ln.push(e)}function Sx(e){ll=!0,Wh(e)}function Dn(){if(!uu&&ln!==null){uu=!0;var e=0,t=ue;try{var n=ln;for(ue=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}ln=null,ll=!1}catch(o){throw ln!==null&&(ln=ln.slice(e+1)),Yp(bc,Dn),o}finally{ue=t,uu=!1}}return null}var ro=[],oo=0,al=null,cl=0,Rt=[],Nt=0,ar=null,an=1,cn="";function cr(e,t){ro[oo++]=cl,ro[oo++]=al,al=e,cl=t}function Gh(e,t,n){Rt[Nt++]=an,Rt[Nt++]=cn,Rt[Nt++]=ar,ar=e;var r=an;e=cn;var o=32-bt(r)-1;r&=~(1<<o),n+=1;var s=32-bt(t)+o;if(30<s){var i=o-o%5;s=(r&(1<<i)-1).toString(32),r>>=i,o-=i,an=1<<32-bt(t)+o|n<<o|r,cn=s+e}else an=1<<s|n<<o|r,cn=e}function du(e){e.return!==null&&(cr(e,1),Gh(e,1,0))}function fu(e){for(;e===al;)al=ro[--oo],ro[oo]=null,cl=ro[--oo],ro[oo]=null;for(;e===ar;)ar=Rt[--Nt],Rt[Nt]=null,cn=Rt[--Nt],Rt[Nt]=null,an=Rt[--Nt],Rt[Nt]=null}var ht=null,mt=null,me=!1,kt=null;function Yh(e,t){var n=At(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 Kh(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,ht=e,mt=Cn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,ht=e,mt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=ar!==null?{id:an,overflow:cn}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=At(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,ht=e,mt=null,!0):!1;default:return!1}}function pu(e){return(e.mode&1)!==0&&(e.flags&128)===0}function hu(e){if(me){var t=mt;if(t){var n=t;if(!Kh(e,t)){if(pu(e))throw Error(G(418));t=Cn(n.nextSibling);var r=ht;t&&Kh(e,t)?Yh(r,n):(e.flags=e.flags&-4097|2,me=!1,ht=e)}}else{if(pu(e))throw Error(G(418));e.flags=e.flags&-4097|2,me=!1,ht=e}}}function Xh(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;ht=e}function ul(e){if(e!==ht)return!1;if(!me)return Xh(e),me=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!su(e.type,e.memoizedProps)),t&&(t=mt)){if(pu(e))throw Qh(),Error(G(418));for(;t;)Yh(e,t),t=Cn(t.nextSibling)}if(Xh(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(G(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){mt=Cn(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}mt=null}}else mt=ht?Cn(e.stateNode.nextSibling):null;return!0}function Qh(){for(var e=mt;e;)e=Cn(e.nextSibling)}function so(){mt=ht=null,me=!1}function mu(e){kt===null?kt=[e]:kt.push(e)}var xx=on.ReactCurrentBatchConfig;function Pt(e,t){if(e&&e.defaultProps){t=ve({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}var dl=Ln(null),fl=null,io=null,gu=null;function Eu(){gu=io=fl=null}function yu(e){var t=dl.current;he(dl),e._currentValue=t}function vu(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 lo(e,t){fl=e,gu=io=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(nt=!0),e.firstContext=null)}function wt(e){var t=e._currentValue;if(gu!==e)if(e={context:e,memoizedValue:t,next:null},io===null){if(fl===null)throw Error(G(308));io=e,fl.dependencies={lanes:0,firstContext:e}}else io=io.next=e;return t}var ur=null;function _u(e){ur===null?ur=[e]:ur.push(e)}function qh(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,un(e,r)}function un(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 kn=!1;function Su(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Jh(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 dn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Pn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,se&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,un(e,n)}return o=r.interleaved,o===null?(t.next=t,_u(r)):(t.next=o.next,o.next=t),r.interleaved=t,un(e,n)}function pl(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,Pc(e,n)}}function Zh(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var i={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?o=s=i:s=s.next=i,n=n.next}while(n!==null);s===null?o=s=t:s=s.next=t}else o=s=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:s,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 hl(e,t,n,r){var o=e.updateQueue;kn=!1;var s=o.firstBaseUpdate,i=o.lastBaseUpdate,l=o.shared.pending;if(l!==null){o.shared.pending=null;var a=l,c=a.next;a.next=null,i===null?s=c:i.next=c,i=a;var u=e.alternate;u!==null&&(u=u.updateQueue,l=u.lastBaseUpdate,l!==i&&(l===null?u.firstBaseUpdate=c:l.next=c,u.lastBaseUpdate=a))}if(s!==null){var f=o.baseState;i=0,u=c=a=null,l=s;do{var p=l.lane,h=l.eventTime;if((r&p)===p){u!==null&&(u=u.next={eventTime:h,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var E=e,y=l;switch(p=t,h=n,y.tag){case 1:if(E=y.payload,typeof E=="function"){f=E.call(h,f,p);break e}f=E;break e;case 3:E.flags=E.flags&-65537|128;case 0:if(E=y.payload,p=typeof E=="function"?E.call(h,f,p):E,p==null)break e;f=ve({},f,p);break e;case 2:kn=!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},u===null?(c=u=h,a=f):u=u.next=h,i|=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(!0);if(u===null&&(a=f),o.baseState=a,o.firstBaseUpdate=c,o.lastBaseUpdate=u,t=o.shared.interleaved,t!==null){o=t;do i|=o.lane,o=o.next;while(o!==t)}else s===null&&(o.shared.lanes=0);pr|=i,e.lanes=i,e.memoizedState=f}}function em(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(G(191,o));o.call(r)}}}var tm=new Ep.Component().refs;function xu(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:ve({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var ml={isMounted:function(e){return(e=e._reactInternals)?sr(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=qe(),o=jn(e),s=dn(r,o);s.payload=t,n!=null&&(s.callback=n),t=Pn(e,s,o),t!==null&&(Ft(t,e,o,r),pl(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=qe(),o=jn(e),s=dn(r,o);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=Pn(e,s,o),t!==null&&(Ft(t,e,o,r),pl(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=qe(),r=jn(e),o=dn(n,r);o.tag=2,t!=null&&(o.callback=t),t=Pn(e,o,r),t!==null&&(Ft(t,e,r,n),pl(t,e,r))}};function nm(e,t,n,r,o,s,i){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,s,i):t.prototype&&t.prototype.isPureReactComponent?!Ss(n,r)||!Ss(o,s):!0}function rm(e,t,n){var r=!1,o=bn,s=t.contextType;return typeof s=="object"&&s!==null?s=wt(s):(o=tt(t)?lr:He.current,r=t.contextTypes,s=(r=r!=null)?no(e,o):bn),t=new t(n,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=ml,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=s),t}function om(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&&ml.enqueueReplaceState(t,t.state,null)}function Ru(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs=tm,Su(e);var s=t.contextType;typeof s=="object"&&s!==null?o.context=wt(s):(s=tt(t)?lr:He.current,o.context=no(e,s)),o.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(xu(e,t,s,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&&ml.enqueueReplaceState(o,o.state,null),hl(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function As(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(G(309));var r=n.stateNode}if(!r)throw Error(G(147,e));var o=r,s=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===s?t.ref:(t=function(i){var l=o.refs;l===tm&&(l=o.refs={}),i===null?delete l[s]:l[s]=i},t._stringRef=s,t)}if(typeof e!="string")throw Error(G(284));if(!n._owner)throw Error(G(290,e))}return e}function gl(e,t){throw e=Object.prototype.toString.call(t),Error(G(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function sm(e){var t=e._init;return t(e._payload)}function im(e){function t(m,g){if(e){var S=m.deletions;S===null?(m.deletions=[g],m.flags|=16):S.push(g)}}function n(m,g){if(!e)return null;for(;g!==null;)t(m,g),g=g.sibling;return null}function r(m,g){for(m=new Map;g!==null;)g.key!==null?m.set(g.key,g):m.set(g.index,g),g=g.sibling;return m}function o(m,g){return m=$n(m,g),m.index=0,m.sibling=null,m}function s(m,g,S){return m.index=S,e?(S=m.alternate,S!==null?(S=S.index,S<g?(m.flags|=2,g):S):(m.flags|=2,g)):(m.flags|=1048576,g)}function i(m){return e&&m.alternate===null&&(m.flags|=2),m}function l(m,g,S,_){return g===null||g.tag!==6?(g=id(S,m.mode,_),g.return=m,g):(g=o(g,S),g.return=m,g)}function a(m,g,S,_){var x=S.type;return x===Br?u(m,g,S.props.children,_,S.key):g!==null&&(g.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===xn&&sm(x)===g.type)?(_=o(g,S.props),_.ref=As(m,g,S),_.return=m,_):(_=Pl(S.type,S.key,S.props,null,m.mode,_),_.ref=As(m,g,S),_.return=m,_)}function c(m,g,S,_){return g===null||g.tag!==4||g.stateNode.containerInfo!==S.containerInfo||g.stateNode.implementation!==S.implementation?(g=ld(S,m.mode,_),g.return=m,g):(g=o(g,S.children||[]),g.return=m,g)}function u(m,g,S,_,x){return g===null||g.tag!==7?(g=Er(S,m.mode,_,x),g.return=m,g):(g=o(g,S),g.return=m,g)}function f(m,g,S){if(typeof g=="string"&&g!==""||typeof g=="number")return g=id(""+g,m.mode,S),g.return=m,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case bi:return S=Pl(g.type,g.key,g.props,null,m.mode,S),S.ref=As(m,null,g),S.return=m,S;case Hr:return g=ld(g,m.mode,S),g.return=m,g;case xn:var _=g._init;return f(m,_(g._payload),S)}if(rs(g)||ts(g))return g=Er(g,m.mode,S,null),g.return=m,g;gl(m,g)}return null}function p(m,g,S,_){var x=g!==null?g.key:null;if(typeof S=="string"&&S!==""||typeof S=="number")return x!==null?null:l(m,g,""+S,_);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case bi:return S.key===x?a(m,g,S,_):null;case Hr:return S.key===x?c(m,g,S,_):null;case xn:return x=S._init,p(m,g,x(S._payload),_)}if(rs(S)||ts(S))return x!==null?null:u(m,g,S,_,null);gl(m,S)}return null}function h(m,g,S,_,x){if(typeof _=="string"&&_!==""||typeof _=="number")return m=m.get(S)||null,l(g,m,""+_,x);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case bi:return m=m.get(_.key===null?S:_.key)||null,a(g,m,_,x);case Hr:return m=m.get(_.key===null?S:_.key)||null,c(g,m,_,x);case xn:var R=_._init;return h(m,g,S,R(_._payload),x)}if(rs(_)||ts(_))return m=m.get(S)||null,u(g,m,_,x,null);gl(g,_)}return null}function E(m,g,S,_){for(var x=null,R=null,T=g,L=g=0,P=null;T!==null&&L<S.length;L++){T.index>L?(P=T,T=null):P=T.sibling;var I=p(m,T,S[L],_);if(I===null){T===null&&(T=P);break}e&&T&&I.alternate===null&&t(m,T),g=s(I,g,L),R===null?x=I:R.sibling=I,R=I,T=P}if(L===S.length)return n(m,T),me&&cr(m,L),x;if(T===null){for(;L<S.length;L++)T=f(m,S[L],_),T!==null&&(g=s(T,g,L),R===null?x=T:R.sibling=T,R=T);return me&&cr(m,L),x}for(T=r(m,T);L<S.length;L++)P=h(T,m,L,S[L],_),P!==null&&(e&&P.alternate!==null&&T.delete(P.key===null?L:P.key),g=s(P,g,L),R===null?x=P:R.sibling=P,R=P);return e&&T.forEach(function(j){return t(m,j)}),me&&cr(m,L),x}function y(m,g,S,_){var x=ts(S);if(typeof x!="function")throw Error(G(150));if(S=x.call(S),S==null)throw Error(G(151));for(var R=x=null,T=g,L=g=0,P=null,I=S.next();T!==null&&!I.done;L++,I=S.next()){T.index>L?(P=T,T=null):P=T.sibling;var j=p(m,T,I.value,_);if(j===null){T===null&&(T=P);break}e&&T&&j.alternate===null&&t(m,T),g=s(j,g,L),R===null?x=j:R.sibling=j,R=j,T=P}if(I.done)return n(m,T),me&&cr(m,L),x;if(T===null){for(;!I.done;L++,I=S.next())I=f(m,I.value,_),I!==null&&(g=s(I,g,L),R===null?x=I:R.sibling=I,R=I);return me&&cr(m,L),x}for(T=r(m,T);!I.done;L++,I=S.next())I=h(T,m,L,I.value,_),I!==null&&(e&&I.alternate!==null&&T.delete(I.key===null?L:I.key),g=s(I,g,L),R===null?x=I:R.sibling=I,R=I);return e&&T.forEach(function(V){return t(m,V)}),me&&cr(m,L),x}function v(m,g,S,_){if(typeof S=="object"&&S!==null&&S.type===Br&&S.key===null&&(S=S.props.children),typeof S=="object"&&S!==null){switch(S.$$typeof){case bi:e:{for(var x=S.key,R=g;R!==null;){if(R.key===x){if(x=S.type,x===Br){if(R.tag===7){n(m,R.sibling),g=o(R,S.props.children),g.return=m,m=g;break e}}else if(R.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===xn&&sm(x)===R.type){n(m,R.sibling),g=o(R,S.props),g.ref=As(m,R,S),g.return=m,m=g;break e}n(m,R);break}else t(m,R);R=R.sibling}S.type===Br?(g=Er(S.props.children,m.mode,_,S.key),g.return=m,m=g):(_=Pl(S.type,S.key,S.props,null,m.mode,_),_.ref=As(m,g,S),_.return=m,m=_)}return i(m);case Hr:e:{for(R=S.key;g!==null;){if(g.key===R)if(g.tag===4&&g.stateNode.containerInfo===S.containerInfo&&g.stateNode.implementation===S.implementation){n(m,g.sibling),g=o(g,S.children||[]),g.return=m,m=g;break e}else{n(m,g);break}else t(m,g);g=g.sibling}g=ld(S,m.mode,_),g.return=m,m=g}return i(m);case xn:return R=S._init,v(m,g,R(S._payload),_)}if(rs(S))return E(m,g,S,_);if(ts(S))return y(m,g,S,_);gl(m,S)}return typeof S=="string"&&S!==""||typeof S=="number"?(S=""+S,g!==null&&g.tag===6?(n(m,g.sibling),g=o(g,S),g.return=m,m=g):(n(m,g),g=id(S,m.mode,_),g.return=m,m=g),i(m)):n(m,g)}return v}var ao=im(!0),lm=im(!1),Is={},Gt=Ln(Is),Cs=Ln(Is),Ls=Ln(Is);function dr(e){if(e===Is)throw Error(G(174));return e}function Nu(e,t){switch(fe(Ls,t),fe(Cs,e),fe(Gt,Is),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Rc(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Rc(t,e)}he(Gt),fe(Gt,t)}function co(){he(Gt),he(Cs),he(Ls)}function am(e){dr(Ls.current);var t=dr(Gt.current),n=Rc(t,e.type);t!==n&&(fe(Cs,e),fe(Gt,n))}function wu(e){Cs.current===e&&(he(Gt),he(Cs))}var _e=Ln(0);function El(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 Ou=[];function Tu(){for(var e=0;e<Ou.length;e++)Ou[e]._workInProgressVersionPrimary=null;Ou.length=0}var yl=on.ReactCurrentDispatcher,Au=on.ReactCurrentBatchConfig,fr=0,Se=null,be=null,ke=null,vl=!1,bs=!1,Ds=0,Rx=0;function Be(){throw Error(G(321))}function Iu(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Dt(e[n],t[n]))return!1;return!0}function Cu(e,t,n,r,o,s){if(fr=s,Se=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,yl.current=e===null||e.memoizedState===null?Tx:Ax,e=n(r,o),bs){s=0;do{if(bs=!1,Ds=0,25<=s)throw Error(G(301));s+=1,ke=be=null,t.updateQueue=null,yl.current=Ix,e=n(r,o)}while(bs)}if(yl.current=xl,t=be!==null&&be.next!==null,fr=0,ke=be=Se=null,vl=!1,t)throw Error(G(300));return e}function Lu(){var e=Ds!==0;return Ds=0,e}function Yt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ke===null?Se.memoizedState=ke=e:ke=ke.next=e,ke}function Ot(){if(be===null){var e=Se.alternate;e=e!==null?e.memoizedState:null}else e=be.next;var t=ke===null?Se.memoizedState:ke.next;if(t!==null)ke=t,be=e;else{if(e===null)throw Error(G(310));be=e,e={memoizedState:be.memoizedState,baseState:be.baseState,baseQueue:be.baseQueue,queue:be.queue,next:null},ke===null?Se.memoizedState=ke=e:ke=ke.next=e}return ke}function ks(e,t){return typeof t=="function"?t(e):t}function bu(e){var t=Ot(),n=t.queue;if(n===null)throw Error(G(311));n.lastRenderedReducer=e;var r=be,o=r.baseQueue,s=n.pending;if(s!==null){if(o!==null){var i=o.next;o.next=s.next,s.next=i}r.baseQueue=o=s,n.pending=null}if(o!==null){s=o.next,r=r.baseState;var l=i=null,a=null,c=s;do{var u=c.lane;if((fr&u)===u)a!==null&&(a=a.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var f={lane:u,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};a===null?(l=a=f,i=r):a=a.next=f,Se.lanes|=u,pr|=u}c=c.next}while(c!==null&&c!==s);a===null?i=r:a.next=l,Dt(r,t.memoizedState)||(nt=!0),t.memoizedState=r,t.baseState=i,t.baseQueue=a,n.lastRenderedState=r}if(e=n.interleaved,e!==null){o=e;do s=o.lane,Se.lanes|=s,pr|=s,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Du(e){var t=Ot(),n=t.queue;if(n===null)throw Error(G(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,s=t.memoizedState;if(o!==null){n.pending=null;var i=o=o.next;do s=e(s,i.action),i=i.next;while(i!==o);Dt(s,t.memoizedState)||(nt=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function cm(){}function um(e,t){var n=Se,r=Ot(),o=t(),s=!Dt(r.memoizedState,o);if(s&&(r.memoizedState=o,nt=!0),r=r.queue,ku(pm.bind(null,n,r,e),[e]),r.getSnapshot!==t||s||ke!==null&&ke.memoizedState.tag&1){if(n.flags|=2048,Ps(9,fm.bind(null,n,r,o,t),void 0,null),Pe===null)throw Error(G(349));fr&30||dm(n,t,o)}return o}function dm(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Se.updateQueue,t===null?(t={lastEffect:null,stores:null},Se.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function fm(e,t,n,r){t.value=n,t.getSnapshot=r,hm(t)&&mm(e)}function pm(e,t,n){return n(function(){hm(t)&&mm(e)})}function hm(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Dt(e,n)}catch{return!0}}function mm(e){var t=un(e,1);t!==null&&Ft(t,e,1,-1)}function gm(e){var t=Yt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ks,lastRenderedState:e},t.queue=e,e=e.dispatch=Ox.bind(null,Se,e),[t.memoizedState,e]}function Ps(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Se.updateQueue,t===null?(t={lastEffect:null,stores:null},Se.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 Em(){return Ot().memoizedState}function _l(e,t,n,r){var o=Yt();Se.flags|=e,o.memoizedState=Ps(1|t,n,void 0,r===void 0?null:r)}function Sl(e,t,n,r){var o=Ot();r=r===void 0?null:r;var s=void 0;if(be!==null){var i=be.memoizedState;if(s=i.destroy,r!==null&&Iu(r,i.deps)){o.memoizedState=Ps(t,n,s,r);return}}Se.flags|=e,o.memoizedState=Ps(1|t,n,s,r)}function ym(e,t){return _l(8390656,8,e,t)}function ku(e,t){return Sl(2048,8,e,t)}function vm(e,t){return Sl(4,2,e,t)}function _m(e,t){return Sl(4,4,e,t)}function Sm(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 xm(e,t,n){return n=n!=null?n.concat([e]):null,Sl(4,4,Sm.bind(null,t,e),n)}function Pu(){}function Rm(e,t){var n=Ot();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Iu(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Nm(e,t){var n=Ot();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Iu(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function wm(e,t,n){return fr&21?(Dt(n,t)||(n=qp(),Se.lanes|=n,pr|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,nt=!0),e.memoizedState=n)}function Nx(e,t){var n=ue;ue=n!==0&&4>n?n:4,e(!0);var r=Au.transition;Au.transition={};try{e(!1),t()}finally{ue=n,Au.transition=r}}function Om(){return Ot().memoizedState}function wx(e,t,n){var r=jn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Tm(e))Am(t,n);else if(n=qh(e,t,n,r),n!==null){var o=qe();Ft(n,e,r,o),Im(n,t,r)}}function Ox(e,t,n){var r=jn(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Tm(e))Am(t,o);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var i=t.lastRenderedState,l=s(i,n);if(o.hasEagerState=!0,o.eagerState=l,Dt(l,i)){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=qh(e,t,o,r),n!==null&&(o=qe(),Ft(n,e,r,o),Im(n,t,r))}}function Tm(e){var t=e.alternate;return e===Se||t!==null&&t===Se}function Am(e,t){bs=vl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Im(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Pc(e,n)}}var xl={readContext:wt,useCallback:Be,useContext:Be,useEffect:Be,useImperativeHandle:Be,useInsertionEffect:Be,useLayoutEffect:Be,useMemo:Be,useReducer:Be,useRef:Be,useState:Be,useDebugValue:Be,useDeferredValue:Be,useTransition:Be,useMutableSource:Be,useSyncExternalStore:Be,useId:Be,unstable_isNewReconciler:!1},Tx={readContext:wt,useCallback:function(e,t){return Yt().memoizedState=[e,t===void 0?null:t],e},useContext:wt,useEffect:ym,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,_l(4194308,4,Sm.bind(null,t,e),n)},useLayoutEffect:function(e,t){return _l(4194308,4,e,t)},useInsertionEffect:function(e,t){return _l(4,2,e,t)},useMemo:function(e,t){var n=Yt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Yt();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=wx.bind(null,Se,e),[r.memoizedState,e]},useRef:function(e){var t=Yt();return e={current:e},t.memoizedState=e},useState:gm,useDebugValue:Pu,useDeferredValue:function(e){return Yt().memoizedState=e},useTransition:function(){var e=gm(!1),t=e[0];return e=Nx.bind(null,e[1]),Yt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Se,o=Yt();if(me){if(n===void 0)throw Error(G(407));n=n()}else{if(n=t(),Pe===null)throw Error(G(349));fr&30||dm(r,t,n)}o.memoizedState=n;var s={value:n,getSnapshot:t};return o.queue=s,ym(pm.bind(null,r,s,e),[e]),r.flags|=2048,Ps(9,fm.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=Yt(),t=Pe.identifierPrefix;if(me){var n=cn,r=an;n=(r&~(1<<32-bt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Ds++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=Rx++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Ax={readContext:wt,useCallback:Rm,useContext:wt,useEffect:ku,useImperativeHandle:xm,useInsertionEffect:vm,useLayoutEffect:_m,useMemo:Nm,useReducer:bu,useRef:Em,useState:function(){return bu(ks)},useDebugValue:Pu,useDeferredValue:function(e){var t=Ot();return wm(t,be.memoizedState,e)},useTransition:function(){var e=bu(ks)[0],t=Ot().memoizedState;return[e,t]},useMutableSource:cm,useSyncExternalStore:um,useId:Om,unstable_isNewReconciler:!1},Ix={readContext:wt,useCallback:Rm,useContext:wt,useEffect:ku,useImperativeHandle:xm,useInsertionEffect:vm,useLayoutEffect:_m,useMemo:Nm,useReducer:Du,useRef:Em,useState:function(){return Du(ks)},useDebugValue:Pu,useDeferredValue:function(e){var t=Ot();return be===null?t.memoizedState=e:wm(t,be.memoizedState,e)},useTransition:function(){var e=Du(ks)[0],t=Ot().memoizedState;return[e,t]},useMutableSource:cm,useSyncExternalStore:um,useId:Om,unstable_isNewReconciler:!1};function uo(e,t){try{var n="",r=t;do n+=rS(r),r=r.return;while(r);var o=n}catch(s){o=`
43
+ Error generating stack: `+s.message+`
44
+ `+s.stack}return{value:e,source:t,stack:o,digest:null}}function Mu(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Uu(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Cx=typeof WeakMap=="function"?WeakMap:Map;function Cm(e,t,n){n=dn(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Il||(Il=!0,Ju=r),Uu(e,t)},n}function Lm(e,t,n){n=dn(-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(){Uu(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){Uu(e,t),typeof r!="function"&&(Un===null?Un=new Set([this]):Un.add(this));var i=t.stack;this.componentDidCatch(t.value,{componentStack:i!==null?i:""})}),n}function bm(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Cx;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=zx.bind(null,e,t,n),t.then(e,e))}function Dm(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 km(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=dn(-1,1),t.tag=2,Pn(n,t,1))),n.lanes|=1),e)}var Lx=on.ReactCurrentOwner,nt=!1;function Qe(e,t,n,r){t.child=e===null?lm(t,null,n,r):ao(t,e.child,n,r)}function Pm(e,t,n,r,o){n=n.render;var s=t.ref;return lo(t,o),r=Cu(e,t,n,r,s,o),n=Lu(),e!==null&&!nt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,fn(e,t,o)):(me&&n&&du(t),t.flags|=1,Qe(e,t,r,o),t.child)}function Mm(e,t,n,r,o){if(e===null){var s=n.type;return typeof s=="function"&&!sd(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,Um(e,t,s,r,o)):(e=Pl(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!(e.lanes&o)){var i=s.memoizedProps;if(n=n.compare,n=n!==null?n:Ss,n(i,r)&&e.ref===t.ref)return fn(e,t,o)}return t.flags|=1,e=$n(s,r),e.ref=t.ref,e.return=t,t.child=e}function Um(e,t,n,r,o){if(e!==null){var s=e.memoizedProps;if(Ss(s,r)&&e.ref===t.ref)if(nt=!1,t.pendingProps=r=s,(e.lanes&o)!==0)e.flags&131072&&(nt=!0);else return t.lanes=e.lanes,fn(e,t,o)}return Fu(e,t,n,r,o)}function Fm(e,t,n){var r=t.pendingProps,o=r.children,s=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},fe(po,gt),gt|=n;else{if(!(n&1073741824))return e=s!==null?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,fe(po,gt),gt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,fe(po,gt),gt|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,fe(po,gt),gt|=r;return Qe(e,t,o,n),t.child}function jm(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Fu(e,t,n,r,o){var s=tt(n)?lr:He.current;return s=no(t,s),lo(t,o),n=Cu(e,t,n,r,s,o),r=Lu(),e!==null&&!nt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,fn(e,t,o)):(me&&r&&du(t),t.flags|=1,Qe(e,t,n,o),t.child)}function Vm(e,t,n,r,o){if(tt(n)){var s=!0;il(t)}else s=!1;if(lo(t,o),t.stateNode===null)Nl(e,t),rm(t,n,r),Ru(t,n,r,o),r=!0;else if(e===null){var i=t.stateNode,l=t.memoizedProps;i.props=l;var a=i.context,c=n.contextType;typeof c=="object"&&c!==null?c=wt(c):(c=tt(n)?lr:He.current,c=no(t,c));var u=n.getDerivedStateFromProps,f=typeof u=="function"||typeof i.getSnapshotBeforeUpdate=="function";f||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(l!==r||a!==c)&&om(t,i,r,c),kn=!1;var p=t.memoizedState;i.state=p,hl(t,r,i,o),a=t.memoizedState,l!==r||p!==a||et.current||kn?(typeof u=="function"&&(xu(t,n,u,r),a=t.memoizedState),(l=kn||nm(t,n,l,r,p,a,c))?(f||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=a),i.props=r,i.state=a,i.context=c,r=l):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{i=t.stateNode,Jh(e,t),l=t.memoizedProps,c=t.type===t.elementType?l:Pt(t.type,l),i.props=c,f=t.pendingProps,p=i.context,a=n.contextType,typeof a=="object"&&a!==null?a=wt(a):(a=tt(n)?lr:He.current,a=no(t,a));var h=n.getDerivedStateFromProps;(u=typeof h=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(l!==f||p!==a)&&om(t,i,r,a),kn=!1,p=t.memoizedState,i.state=p,hl(t,r,i,o);var E=t.memoizedState;l!==f||p!==E||et.current||kn?(typeof h=="function"&&(xu(t,n,h,r),E=t.memoizedState),(c=kn||nm(t,n,c,r,p,E,a)||!1)?(u||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(r,E,a),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(r,E,a)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||l===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=E),i.props=r,i.state=E,i.context=a,r=c):(typeof i.componentDidUpdate!="function"||l===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),r=!1)}return ju(e,t,n,r,s,o)}function ju(e,t,n,r,o,s){jm(e,t);var i=(t.flags&128)!==0;if(!r&&!i)return o&&zh(t,n,!1),fn(e,t,s);r=t.stateNode,Lx.current=t;var l=i&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&i?(t.child=ao(t,e.child,null,s),t.child=ao(t,null,l,s)):Qe(e,t,l,s),t.memoizedState=r.state,o&&zh(t,n,!0),t.child}function $m(e){var t=e.stateNode;t.pendingContext?Hh(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Hh(e,t.context,!1),Nu(e,t.containerInfo)}function Hm(e,t,n,r,o){return so(),mu(o),t.flags|=256,Qe(e,t,n,r),t.child}var Vu={dehydrated:null,treeContext:null,retryLane:0};function $u(e){return{baseLanes:e,cachePool:null,transitions:null}}function Bm(e,t,n){var r=t.pendingProps,o=_e.current,s=!1,i=(t.flags&128)!==0,l;if((l=i)||(l=e!==null&&e.memoizedState===null?!1:(o&2)!==0),l?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),fe(_e,o&1),e===null)return hu(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):(i=r.children,e=r.fallback,s?(r=t.mode,s=t.child,i={mode:"hidden",children:i},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=i):s=Ml(i,r,0,null),e=Er(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=$u(n),t.memoizedState=Vu,e):Hu(t,i));if(o=e.memoizedState,o!==null&&(l=o.dehydrated,l!==null))return bx(e,t,i,r,l,o,n);if(s){s=r.fallback,i=t.mode,o=e.child,l=o.sibling;var a={mode:"hidden",children:r.children};return!(i&1)&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=a,t.deletions=null):(r=$n(o,a),r.subtreeFlags=o.subtreeFlags&14680064),l!==null?s=$n(l,s):(s=Er(s,i,n,null),s.flags|=2),s.return=t,r.return=t,r.sibling=s,t.child=r,r=s,s=t.child,i=e.child.memoizedState,i=i===null?$u(n):{baseLanes:i.baseLanes|n,cachePool:null,transitions:i.transitions},s.memoizedState=i,s.childLanes=e.childLanes&~n,t.memoizedState=Vu,r}return s=e.child,e=s.sibling,r=$n(s,{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 Hu(e,t){return t=Ml({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Rl(e,t,n,r){return r!==null&&mu(r),ao(t,e.child,null,n),e=Hu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function bx(e,t,n,r,o,s,i){if(n)return t.flags&256?(t.flags&=-257,r=Mu(Error(G(422))),Rl(e,t,i,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,o=t.mode,r=Ml({mode:"visible",children:r.children},o,0,null),s=Er(s,o,i,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,t.mode&1&&ao(t,e.child,null,i),t.child.memoizedState=$u(i),t.memoizedState=Vu,s);if(!(t.mode&1))return Rl(e,t,i,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,s=Error(G(419)),r=Mu(s,r,void 0),Rl(e,t,i,r)}if(l=(i&e.childLanes)!==0,nt||l){if(r=Pe,r!==null){switch(i&-i){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|i)?0:o,o!==0&&o!==s.retryLane&&(s.retryLane=o,un(e,o),Ft(r,e,o,-1))}return od(),r=Mu(Error(G(421))),Rl(e,t,i,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=Wx.bind(null,e),o._reactRetry=t,null):(e=s.treeContext,mt=Cn(o.nextSibling),ht=t,me=!0,kt=null,e!==null&&(Rt[Nt++]=an,Rt[Nt++]=cn,Rt[Nt++]=ar,an=e.id,cn=e.overflow,ar=t),t=Hu(t,r.children),t.flags|=4096,t)}function zm(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),vu(e.return,t,n)}function Bu(e,t,n,r,o){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=o)}function Wm(e,t,n){var r=t.pendingProps,o=r.revealOrder,s=r.tail;if(Qe(e,t,r.children,n),r=_e.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&&zm(e,n,t);else if(e.tag===19)zm(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(fe(_e,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&&El(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),Bu(t,!1,o,n,s);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&El(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}Bu(t,!0,n,null,s);break;case"together":Bu(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Nl(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function fn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),pr|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(G(153));if(t.child!==null){for(e=t.child,n=$n(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=$n(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Dx(e,t,n){switch(t.tag){case 3:$m(t),so();break;case 5:am(t);break;case 1:tt(t.type)&&il(t);break;case 4:Nu(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;fe(dl,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(fe(_e,_e.current&1),t.flags|=128,null):n&t.child.childLanes?Bm(e,t,n):(fe(_e,_e.current&1),e=fn(e,t,n),e!==null?e.sibling:null);fe(_e,_e.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Wm(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),fe(_e,_e.current),r)break;return null;case 22:case 23:return t.lanes=0,Fm(e,t,n)}return fn(e,t,n)}var Gm,zu,Ym,Km;Gm=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}},zu=function(){},Ym=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,dr(Gt.current);var s=null;switch(n){case"input":o=vc(e,o),r=vc(e,r),s=[];break;case"select":o=ve({},o,{value:void 0}),r=ve({},r,{value:void 0}),s=[];break;case"textarea":o=xc(e,o),r=xc(e,r),s=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=rl)}Nc(n,r);var i;n=null;for(c in o)if(!r.hasOwnProperty(c)&&o.hasOwnProperty(c)&&o[c]!=null)if(c==="style"){var l=o[c];for(i in l)l.hasOwnProperty(i)&&(n||(n={}),n[i]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(es.hasOwnProperty(c)?s||(s=[]):(s=s||[]).push(c,null));for(c in r){var a=r[c];if(l=o!=null?o[c]:void 0,r.hasOwnProperty(c)&&a!==l&&(a!=null||l!=null))if(c==="style")if(l){for(i in l)!l.hasOwnProperty(i)||a&&a.hasOwnProperty(i)||(n||(n={}),n[i]="");for(i in a)a.hasOwnProperty(i)&&l[i]!==a[i]&&(n||(n={}),n[i]=a[i])}else n||(s||(s=[]),s.push(c,n)),n=a;else c==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,l=l?l.__html:void 0,a!=null&&l!==a&&(s=s||[]).push(c,a)):c==="children"?typeof a!="string"&&typeof a!="number"||(s=s||[]).push(c,""+a):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(es.hasOwnProperty(c)?(a!=null&&c==="onScroll"&&pe("scroll",e),s||l===a||(s=[])):(s=s||[]).push(c,a))}n&&(s=s||[]).push("style",n);var c=s;(t.updateQueue=c)&&(t.flags|=4)}},Km=function(e,t,n,r){n!==r&&(t.flags|=4)};function Ms(e,t){if(!me)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 ze(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 kx(e,t,n){var r=t.pendingProps;switch(fu(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ze(t),null;case 1:return tt(t.type)&&sl(),ze(t),null;case 3:return r=t.stateNode,co(),he(et),he(He),Tu(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(ul(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,kt!==null&&(td(kt),kt=null))),zu(e,t),ze(t),null;case 5:wu(t);var o=dr(Ls.current);if(n=t.type,e!==null&&t.stateNode!=null)Ym(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(G(166));return ze(t),null}if(e=dr(Gt.current),ul(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[Wt]=t,r[Os]=s,e=(t.mode&1)!==0,n){case"dialog":pe("cancel",r),pe("close",r);break;case"iframe":case"object":case"embed":pe("load",r);break;case"video":case"audio":for(o=0;o<Rs.length;o++)pe(Rs[o],r);break;case"source":pe("error",r);break;case"img":case"image":case"link":pe("error",r),pe("load",r);break;case"details":pe("toggle",r);break;case"input":Tp(r,s),pe("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},pe("invalid",r);break;case"textarea":Cp(r,s),pe("invalid",r)}Nc(n,s),o=null;for(var i in s)if(s.hasOwnProperty(i)){var l=s[i];i==="children"?typeof l=="string"?r.textContent!==l&&(s.suppressHydrationWarning!==!0&&nl(r.textContent,l,e),o=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(s.suppressHydrationWarning!==!0&&nl(r.textContent,l,e),o=["children",""+l]):es.hasOwnProperty(i)&&l!=null&&i==="onScroll"&&pe("scroll",r)}switch(n){case"input":Di(r),Ip(r,s,!0);break;case"textarea":Di(r),bp(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=rl)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{i=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Dp(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=i.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=i.createElement(n,{is:r.is}):(e=i.createElement(n),n==="select"&&(i=e,r.multiple?i.multiple=!0:r.size&&(i.size=r.size))):e=i.createElementNS(e,n),e[Wt]=t,e[Os]=r,Gm(e,t,!1,!1),t.stateNode=e;e:{switch(i=wc(n,r),n){case"dialog":pe("cancel",e),pe("close",e),o=r;break;case"iframe":case"object":case"embed":pe("load",e),o=r;break;case"video":case"audio":for(o=0;o<Rs.length;o++)pe(Rs[o],e);o=r;break;case"source":pe("error",e),o=r;break;case"img":case"image":case"link":pe("error",e),pe("load",e),o=r;break;case"details":pe("toggle",e),o=r;break;case"input":Tp(e,r),o=vc(e,r),pe("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=ve({},r,{value:void 0}),pe("invalid",e);break;case"textarea":Cp(e,r),o=xc(e,r),pe("invalid",e);break;default:o=r}Nc(n,o),l=o;for(s in l)if(l.hasOwnProperty(s)){var a=l[s];s==="style"?Mp(e,a):s==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,a!=null&&kp(e,a)):s==="children"?typeof a=="string"?(n!=="textarea"||a!=="")&&os(e,a):typeof a=="number"&&os(e,""+a):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(es.hasOwnProperty(s)?a!=null&&s==="onScroll"&&pe("scroll",e):a!=null&&ac(e,s,a,i))}switch(n){case"input":Di(e),Ip(e,r,!1);break;case"textarea":Di(e),bp(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Rn(r.value));break;case"select":e.multiple=!!r.multiple,s=r.value,s!=null?zr(e,!!r.multiple,s,!1):r.defaultValue!=null&&zr(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=rl)}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 ze(t),null;case 6:if(e&&t.stateNode!=null)Km(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(G(166));if(n=dr(Ls.current),dr(Gt.current),ul(t)){if(r=t.stateNode,n=t.memoizedProps,r[Wt]=t,(s=r.nodeValue!==n)&&(e=ht,e!==null))switch(e.tag){case 3:nl(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&nl(r.nodeValue,n,(e.mode&1)!==0)}s&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Wt]=t,t.stateNode=r}return ze(t),null;case 13:if(he(_e),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(me&&mt!==null&&t.mode&1&&!(t.flags&128))Qh(),so(),t.flags|=98560,s=!1;else if(s=ul(t),r!==null&&r.dehydrated!==null){if(e===null){if(!s)throw Error(G(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(G(317));s[Wt]=t}else so(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ze(t),s=!1}else kt!==null&&(td(kt),kt=null),s=!0;if(!s)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||_e.current&1?De===0&&(De=3):od())),t.updateQueue!==null&&(t.flags|=4),ze(t),null);case 4:return co(),zu(e,t),e===null&&Ns(t.stateNode.containerInfo),ze(t),null;case 10:return yu(t.type._context),ze(t),null;case 17:return tt(t.type)&&sl(),ze(t),null;case 19:if(he(_e),s=t.memoizedState,s===null)return ze(t),null;if(r=(t.flags&128)!==0,i=s.rendering,i===null)if(r)Ms(s,!1);else{if(De!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=El(e),i!==null){for(t.flags|=128,Ms(s,!1),r=i.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)s=n,e=r,s.flags&=14680066,i=s.alternate,i===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=i.childLanes,s.lanes=i.lanes,s.child=i.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=i.memoizedProps,s.memoizedState=i.memoizedState,s.updateQueue=i.updateQueue,s.type=i.type,e=i.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return fe(_e,_e.current&1|2),t.child}e=e.sibling}s.tail!==null&&we()>ho&&(t.flags|=128,r=!0,Ms(s,!1),t.lanes=4194304)}else{if(!r)if(e=El(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ms(s,!0),s.tail===null&&s.tailMode==="hidden"&&!i.alternate&&!me)return ze(t),null}else 2*we()-s.renderingStartTime>ho&&n!==1073741824&&(t.flags|=128,r=!0,Ms(s,!1),t.lanes=4194304);s.isBackwards?(i.sibling=t.child,t.child=i):(n=s.last,n!==null?n.sibling=i:t.child=i,s.last=i)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=we(),t.sibling=null,n=_e.current,fe(_e,r?n&1|2:n&1),t):(ze(t),null);case 22:case 23:return rd(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?gt&1073741824&&(ze(t),t.subtreeFlags&6&&(t.flags|=8192)):ze(t),null;case 24:return null;case 25:return null}throw Error(G(156,t.tag))}function Px(e,t){switch(fu(t),t.tag){case 1:return tt(t.type)&&sl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return co(),he(et),he(He),Tu(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return wu(t),null;case 13:if(he(_e),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(G(340));so()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return he(_e),null;case 4:return co(),null;case 10:return yu(t.type._context),null;case 22:case 23:return rd(),null;case 24:return null;default:return null}}var wl=!1,We=!1,Mx=typeof WeakSet=="function"?WeakSet:Set,K=null;function fo(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){xe(e,t,r)}else n.current=null}function Wu(e,t,n){try{n()}catch(r){xe(e,t,r)}}var Xm=!1;function Ux(e,t){if(ru=Wi,e=Oh(),Xc(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,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var i=0,l=-1,a=-1,c=0,u=0,f=e,p=null;t:for(;;){for(var h;f!==n||o!==0&&f.nodeType!==3||(l=i+o),f!==s||r!==0&&f.nodeType!==3||(a=i+r),f.nodeType===3&&(i+=f.nodeValue.length),(h=f.firstChild)!==null;)p=f,f=h;for(;;){if(f===e)break t;if(p===n&&++c===o&&(l=i),p===s&&++u===r&&(a=i),(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},Wi=!1,K=t;K!==null;)if(t=K,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,K=e;else for(;K!==null;){t=K;try{var E=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(E!==null){var y=E.memoizedProps,v=E.memoizedState,m=t.stateNode,g=m.getSnapshotBeforeUpdate(t.elementType===t.type?y:Pt(t.type,y),v);m.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var S=t.stateNode.containerInfo;S.nodeType===1?S.textContent="":S.nodeType===9&&S.documentElement&&S.removeChild(S.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(G(163))}}catch(_){xe(t,t.return,_)}if(e=t.sibling,e!==null){e.return=t.return,K=e;break}K=t.return}return E=Xm,Xm=!1,E}function Us(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 s=o.destroy;o.destroy=void 0,s!==void 0&&Wu(t,n,s)}o=o.next}while(o!==r)}}function Ol(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 Gu(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 Qm(e){var t=e.alternate;t!==null&&(e.alternate=null,Qm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Wt],delete t[Os],delete t[au],delete t[vx],delete t[_x])),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 qm(e){return e.tag===5||e.tag===3||e.tag===4}function Jm(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||qm(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 Yu(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=rl));else if(r!==4&&(e=e.child,e!==null))for(Yu(e,t,n),e=e.sibling;e!==null;)Yu(e,t,n),e=e.sibling}function Ku(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(Ku(e,t,n),e=e.sibling;e!==null;)Ku(e,t,n),e=e.sibling}var Fe=null,Mt=!1;function Mn(e,t,n){for(n=n.child;n!==null;)Zm(e,t,n),n=n.sibling}function Zm(e,t,n){if(zt&&typeof zt.onCommitFiberUnmount=="function")try{zt.onCommitFiberUnmount(ji,n)}catch{}switch(n.tag){case 5:We||fo(n,t);case 6:var r=Fe,o=Mt;Fe=null,Mn(e,t,n),Fe=r,Mt=o,Fe!==null&&(Mt?(e=Fe,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Fe.removeChild(n.stateNode));break;case 18:Fe!==null&&(Mt?(e=Fe,n=n.stateNode,e.nodeType===8?lu(e.parentNode,n):e.nodeType===1&&lu(e,n),ms(e)):lu(Fe,n.stateNode));break;case 4:r=Fe,o=Mt,Fe=n.stateNode.containerInfo,Mt=!0,Mn(e,t,n),Fe=r,Mt=o;break;case 0:case 11:case 14:case 15:if(!We&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var s=o,i=s.destroy;s=s.tag,i!==void 0&&(s&2||s&4)&&Wu(n,t,i),o=o.next}while(o!==r)}Mn(e,t,n);break;case 1:if(!We&&(fo(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){xe(n,t,l)}Mn(e,t,n);break;case 21:Mn(e,t,n);break;case 22:n.mode&1?(We=(r=We)||n.memoizedState!==null,Mn(e,t,n),We=r):Mn(e,t,n);break;default:Mn(e,t,n)}}function eg(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Mx),t.forEach(function(r){var o=Gx.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function Ut(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];try{var s=e,i=t,l=i;e:for(;l!==null;){switch(l.tag){case 5:Fe=l.stateNode,Mt=!1;break e;case 3:Fe=l.stateNode.containerInfo,Mt=!0;break e;case 4:Fe=l.stateNode.containerInfo,Mt=!0;break e}l=l.return}if(Fe===null)throw Error(G(160));Zm(s,i,o),Fe=null,Mt=!1;var a=o.alternate;a!==null&&(a.return=null),o.return=null}catch(c){xe(o,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)tg(t,e),t=t.sibling}function tg(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Ut(t,e),Kt(e),r&4){try{Us(3,e,e.return),Ol(3,e)}catch(y){xe(e,e.return,y)}try{Us(5,e,e.return)}catch(y){xe(e,e.return,y)}}break;case 1:Ut(t,e),Kt(e),r&512&&n!==null&&fo(n,n.return);break;case 5:if(Ut(t,e),Kt(e),r&512&&n!==null&&fo(n,n.return),e.flags&32){var o=e.stateNode;try{os(o,"")}catch(y){xe(e,e.return,y)}}if(r&4&&(o=e.stateNode,o!=null)){var s=e.memoizedProps,i=n!==null?n.memoizedProps:s,l=e.type,a=e.updateQueue;if(e.updateQueue=null,a!==null)try{l==="input"&&s.type==="radio"&&s.name!=null&&Ap(o,s),wc(l,i);var c=wc(l,s);for(i=0;i<a.length;i+=2){var u=a[i],f=a[i+1];u==="style"?Mp(o,f):u==="dangerouslySetInnerHTML"?kp(o,f):u==="children"?os(o,f):ac(o,u,f,c)}switch(l){case"input":_c(o,s);break;case"textarea":Lp(o,s);break;case"select":var p=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!s.multiple;var h=s.value;h!=null?zr(o,!!s.multiple,h,!1):p!==!!s.multiple&&(s.defaultValue!=null?zr(o,!!s.multiple,s.defaultValue,!0):zr(o,!!s.multiple,s.multiple?[]:"",!1))}o[Os]=s}catch(y){xe(e,e.return,y)}}break;case 6:if(Ut(t,e),Kt(e),r&4){if(e.stateNode===null)throw Error(G(162));o=e.stateNode,s=e.memoizedProps;try{o.nodeValue=s}catch(y){xe(e,e.return,y)}}break;case 3:if(Ut(t,e),Kt(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{ms(t.containerInfo)}catch(y){xe(e,e.return,y)}break;case 4:Ut(t,e),Kt(e);break;case 13:Ut(t,e),Kt(e),o=e.child,o.flags&8192&&(s=o.memoizedState!==null,o.stateNode.isHidden=s,!s||o.alternate!==null&&o.alternate.memoizedState!==null||(qu=we())),r&4&&eg(e);break;case 22:if(u=n!==null&&n.memoizedState!==null,e.mode&1?(We=(c=We)||u,Ut(t,e),We=c):Ut(t,e),Kt(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!u&&e.mode&1)for(K=e,u=e.child;u!==null;){for(f=K=u;K!==null;){switch(p=K,h=p.child,p.tag){case 0:case 11:case 14:case 15:Us(4,p,p.return);break;case 1:fo(p,p.return);var E=p.stateNode;if(typeof E.componentWillUnmount=="function"){r=p,n=p.return;try{t=r,E.props=t.memoizedProps,E.state=t.memoizedState,E.componentWillUnmount()}catch(y){xe(r,n,y)}}break;case 5:fo(p,p.return);break;case 22:if(p.memoizedState!==null){og(f);continue}}h!==null?(h.return=p,K=h):og(f)}u=u.sibling}e:for(u=null,f=e;;){if(f.tag===5){if(u===null){u=f;try{o=f.stateNode,c?(s=o.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(l=f.stateNode,a=f.memoizedProps.style,i=a!=null&&a.hasOwnProperty("display")?a.display:null,l.style.display=Pp("display",i))}catch(y){xe(e,e.return,y)}}}else if(f.tag===6){if(u===null)try{f.stateNode.nodeValue=c?"":f.memoizedProps}catch(y){xe(e,e.return,y)}}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;u===f&&(u=null),f=f.return}u===f&&(u=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:Ut(t,e),Kt(e),r&4&&eg(e);break;case 21:break;default:Ut(t,e),Kt(e)}}function Kt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(qm(n)){var r=n;break e}n=n.return}throw Error(G(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(os(o,""),r.flags&=-33);var s=Jm(e);Ku(e,s,o);break;case 3:case 4:var i=r.stateNode.containerInfo,l=Jm(e);Yu(e,l,i);break;default:throw Error(G(161))}}catch(a){xe(e,e.return,a)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Fx(e,t,n){K=e,ng(e)}function ng(e,t,n){for(var r=(e.mode&1)!==0;K!==null;){var o=K,s=o.child;if(o.tag===22&&r){var i=o.memoizedState!==null||wl;if(!i){var l=o.alternate,a=l!==null&&l.memoizedState!==null||We;l=wl;var c=We;if(wl=i,(We=a)&&!c)for(K=o;K!==null;)i=K,a=i.child,i.tag===22&&i.memoizedState!==null?sg(o):a!==null?(a.return=i,K=a):sg(o);for(;s!==null;)K=s,ng(s),s=s.sibling;K=o,wl=l,We=c}rg(e)}else o.subtreeFlags&8772&&s!==null?(s.return=o,K=s):rg(e)}}function rg(e){for(;K!==null;){var t=K;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:We||Ol(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!We)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:Pt(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&em(t,s,r);break;case 3:var i=t.updateQueue;if(i!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}em(t,i,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 c=t.alternate;if(c!==null){var u=c.memoizedState;if(u!==null){var f=u.dehydrated;f!==null&&ms(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(G(163))}We||t.flags&512&&Gu(t)}catch(p){xe(t,t.return,p)}}if(t===e){K=null;break}if(n=t.sibling,n!==null){n.return=t.return,K=n;break}K=t.return}}function og(e){for(;K!==null;){var t=K;if(t===e){K=null;break}var n=t.sibling;if(n!==null){n.return=t.return,K=n;break}K=t.return}}function sg(e){for(;K!==null;){var t=K;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Ol(4,t)}catch(a){xe(t,n,a)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(a){xe(t,o,a)}}var s=t.return;try{Gu(t)}catch(a){xe(t,s,a)}break;case 5:var i=t.return;try{Gu(t)}catch(a){xe(t,i,a)}}}catch(a){xe(t,t.return,a)}if(t===e){K=null;break}var l=t.sibling;if(l!==null){l.return=t.return,K=l;break}K=t.return}}var jx=Math.ceil,Tl=on.ReactCurrentDispatcher,Xu=on.ReactCurrentOwner,Tt=on.ReactCurrentBatchConfig,se=0,Pe=null,Ae=null,je=0,gt=0,po=Ln(0),De=0,Fs=null,pr=0,Al=0,Qu=0,js=null,rt=null,qu=0,ho=1/0,pn=null,Il=!1,Ju=null,Un=null,Cl=!1,Fn=null,Ll=0,Vs=0,Zu=null,bl=-1,Dl=0;function qe(){return se&6?we():bl!==-1?bl:bl=we()}function jn(e){return e.mode&1?se&2&&je!==0?je&-je:xx.transition!==null?(Dl===0&&(Dl=qp()),Dl):(e=ue,e!==0||(e=window.event,e=e===void 0?16:ih(e.type)),e):1}function Ft(e,t,n,r){if(50<Vs)throw Vs=0,Zu=null,Error(G(185));us(e,n,r),(!(se&2)||e!==Pe)&&(e===Pe&&(!(se&2)&&(Al|=n),De===4&&Vn(e,je)),ot(e,r),n===1&&se===0&&!(t.mode&1)&&(ho=we()+500,ll&&Dn()))}function ot(e,t){var n=e.callbackNode;xS(e,t);var r=Hi(e,e===Pe?je:0);if(r===0)n!==null&&Kp(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Kp(n),t===1)e.tag===0?Sx(lg.bind(null,e)):Wh(lg.bind(null,e)),Ex(function(){!(se&6)&&Dn()}),n=null;else{switch(Jp(r)){case 1:n=bc;break;case 4:n=Xp;break;case 16:n=Fi;break;case 536870912:n=Qp;break;default:n=Fi}n=mg(n,ig.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function ig(e,t){if(bl=-1,Dl=0,se&6)throw Error(G(327));var n=e.callbackNode;if(mo()&&e.callbackNode!==n)return null;var r=Hi(e,e===Pe?je:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=kl(e,r);else{t=r;var o=se;se|=2;var s=cg();(Pe!==e||je!==t)&&(pn=null,ho=we()+500,mr(e,t));do try{Hx();break}catch(l){ag(e,l)}while(!0);Eu(),Tl.current=s,se=o,Ae!==null?t=0:(Pe=null,je=0,t=De)}if(t!==0){if(t===2&&(o=Dc(e),o!==0&&(r=o,t=ed(e,o))),t===1)throw n=Fs,mr(e,0),Vn(e,r),ot(e,we()),n;if(t===6)Vn(e,r);else{if(o=e.current.alternate,!(r&30)&&!Vx(o)&&(t=kl(e,r),t===2&&(s=Dc(e),s!==0&&(r=s,t=ed(e,s))),t===1))throw n=Fs,mr(e,0),Vn(e,r),ot(e,we()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(G(345));case 2:gr(e,rt,pn);break;case 3:if(Vn(e,r),(r&130023424)===r&&(t=qu+500-we(),10<t)){if(Hi(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){qe(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=iu(gr.bind(null,e,rt,pn),t);break}gr(e,rt,pn);break;case 4:if(Vn(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var i=31-bt(r);s=1<<i,i=t[i],i>o&&(o=i),r&=~s}if(r=o,r=we()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*jx(r/1960))-r,10<r){e.timeoutHandle=iu(gr.bind(null,e,rt,pn),r);break}gr(e,rt,pn);break;case 5:gr(e,rt,pn);break;default:throw Error(G(329))}}}return ot(e,we()),e.callbackNode===n?ig.bind(null,e):null}function ed(e,t){var n=js;return e.current.memoizedState.isDehydrated&&(mr(e,t).flags|=256),e=kl(e,t),e!==2&&(t=rt,rt=n,t!==null&&td(t)),e}function td(e){rt===null?rt=e:rt.push.apply(rt,e)}function Vx(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],s=o.getSnapshot;o=o.value;try{if(!Dt(s(),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 Vn(e,t){for(t&=~Qu,t&=~Al,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-bt(t),r=1<<n;e[n]=-1,t&=~r}}function lg(e){if(se&6)throw Error(G(327));mo();var t=Hi(e,0);if(!(t&1))return ot(e,we()),null;var n=kl(e,t);if(e.tag!==0&&n===2){var r=Dc(e);r!==0&&(t=r,n=ed(e,r))}if(n===1)throw n=Fs,mr(e,0),Vn(e,t),ot(e,we()),n;if(n===6)throw Error(G(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,gr(e,rt,pn),ot(e,we()),null}function nd(e,t){var n=se;se|=1;try{return e(t)}finally{se=n,se===0&&(ho=we()+500,ll&&Dn())}}function hr(e){Fn!==null&&Fn.tag===0&&!(se&6)&&mo();var t=se;se|=1;var n=Tt.transition,r=ue;try{if(Tt.transition=null,ue=1,e)return e()}finally{ue=r,Tt.transition=n,se=t,!(se&6)&&Dn()}}function rd(){gt=po.current,he(po)}function mr(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,gx(n)),Ae!==null)for(n=Ae.return;n!==null;){var r=n;switch(fu(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&sl();break;case 3:co(),he(et),he(He),Tu();break;case 5:wu(r);break;case 4:co();break;case 13:he(_e);break;case 19:he(_e);break;case 10:yu(r.type._context);break;case 22:case 23:rd()}n=n.return}if(Pe=e,Ae=e=$n(e.current,null),je=gt=t,De=0,Fs=null,Qu=Al=pr=0,rt=js=null,ur!==null){for(t=0;t<ur.length;t++)if(n=ur[t],r=n.interleaved,r!==null){n.interleaved=null;var o=r.next,s=n.pending;if(s!==null){var i=s.next;s.next=o,r.next=i}n.pending=r}ur=null}return e}function ag(e,t){do{var n=Ae;try{if(Eu(),yl.current=xl,vl){for(var r=Se.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}vl=!1}if(fr=0,ke=be=Se=null,bs=!1,Ds=0,Xu.current=null,n===null||n.return===null){De=1,Fs=t,Ae=null;break}e:{var s=e,i=n.return,l=n,a=t;if(t=je,l.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){var c=a,u=l,f=u.tag;if(!(u.mode&1)&&(f===0||f===11||f===15)){var p=u.alternate;p?(u.updateQueue=p.updateQueue,u.memoizedState=p.memoizedState,u.lanes=p.lanes):(u.updateQueue=null,u.memoizedState=null)}var h=Dm(i);if(h!==null){h.flags&=-257,km(h,i,l,s,t),h.mode&1&&bm(s,c,t),t=h,a=c;var E=t.updateQueue;if(E===null){var y=new Set;y.add(a),t.updateQueue=y}else E.add(a);break e}else{if(!(t&1)){bm(s,c,t),od();break e}a=Error(G(426))}}else if(me&&l.mode&1){var v=Dm(i);if(v!==null){!(v.flags&65536)&&(v.flags|=256),km(v,i,l,s,t),mu(uo(a,l));break e}}s=a=uo(a,l),De!==4&&(De=2),js===null?js=[s]:js.push(s),s=i;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var m=Cm(s,a,t);Zh(s,m);break e;case 1:l=a;var g=s.type,S=s.stateNode;if(!(s.flags&128)&&(typeof g.getDerivedStateFromError=="function"||S!==null&&typeof S.componentDidCatch=="function"&&(Un===null||!Un.has(S)))){s.flags|=65536,t&=-t,s.lanes|=t;var _=Lm(s,l,t);Zh(s,_);break e}}s=s.return}while(s!==null)}dg(n)}catch(x){t=x,Ae===n&&n!==null&&(Ae=n=n.return);continue}break}while(!0)}function cg(){var e=Tl.current;return Tl.current=xl,e===null?xl:e}function od(){(De===0||De===3||De===2)&&(De=4),Pe===null||!(pr&268435455)&&!(Al&268435455)||Vn(Pe,je)}function kl(e,t){var n=se;se|=2;var r=cg();(Pe!==e||je!==t)&&(pn=null,mr(e,t));do try{$x();break}catch(o){ag(e,o)}while(!0);if(Eu(),se=n,Tl.current=r,Ae!==null)throw Error(G(261));return Pe=null,je=0,De}function $x(){for(;Ae!==null;)ug(Ae)}function Hx(){for(;Ae!==null&&!pS();)ug(Ae)}function ug(e){var t=hg(e.alternate,e,gt);e.memoizedProps=e.pendingProps,t===null?dg(e):Ae=t,Xu.current=null}function dg(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Px(n,t),n!==null){n.flags&=32767,Ae=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{De=6,Ae=null;return}}else if(n=kx(n,t,gt),n!==null){Ae=n;return}if(t=t.sibling,t!==null){Ae=t;return}Ae=t=e}while(t!==null);De===0&&(De=5)}function gr(e,t,n){var r=ue,o=Tt.transition;try{Tt.transition=null,ue=1,Bx(e,t,n,r)}finally{Tt.transition=o,ue=r}return null}function Bx(e,t,n,r){do mo();while(Fn!==null);if(se&6)throw Error(G(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(G(177));e.callbackNode=null,e.callbackPriority=0;var s=n.lanes|n.childLanes;if(RS(e,s),e===Pe&&(Ae=Pe=null,je=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Cl||(Cl=!0,mg(Fi,function(){return mo(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=Tt.transition,Tt.transition=null;var i=ue;ue=1;var l=se;se|=4,Xu.current=null,Ux(e,n),tg(n,e),cx(ou),Wi=!!ru,ou=ru=null,e.current=n,Fx(n),hS(),se=l,ue=i,Tt.transition=s}else e.current=n;if(Cl&&(Cl=!1,Fn=e,Ll=o),s=e.pendingLanes,s===0&&(Un=null),ES(n.stateNode),ot(e,we()),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(Il)throw Il=!1,e=Ju,Ju=null,e;return Ll&1&&e.tag!==0&&mo(),s=e.pendingLanes,s&1?e===Zu?Vs++:(Vs=0,Zu=e):Vs=0,Dn(),null}function mo(){if(Fn!==null){var e=Jp(Ll),t=Tt.transition,n=ue;try{if(Tt.transition=null,ue=16>e?16:e,Fn===null)var r=!1;else{if(e=Fn,Fn=null,Ll=0,se&6)throw Error(G(331));var o=se;for(se|=4,K=e.current;K!==null;){var s=K,i=s.child;if(K.flags&16){var l=s.deletions;if(l!==null){for(var a=0;a<l.length;a++){var c=l[a];for(K=c;K!==null;){var u=K;switch(u.tag){case 0:case 11:case 15:Us(8,u,s)}var f=u.child;if(f!==null)f.return=u,K=f;else for(;K!==null;){u=K;var p=u.sibling,h=u.return;if(Qm(u),u===c){K=null;break}if(p!==null){p.return=h,K=p;break}K=h}}}var E=s.alternate;if(E!==null){var y=E.child;if(y!==null){E.child=null;do{var v=y.sibling;y.sibling=null,y=v}while(y!==null)}}K=s}}if(s.subtreeFlags&2064&&i!==null)i.return=s,K=i;else e:for(;K!==null;){if(s=K,s.flags&2048)switch(s.tag){case 0:case 11:case 15:Us(9,s,s.return)}var m=s.sibling;if(m!==null){m.return=s.return,K=m;break e}K=s.return}}var g=e.current;for(K=g;K!==null;){i=K;var S=i.child;if(i.subtreeFlags&2064&&S!==null)S.return=i,K=S;else e:for(i=g;K!==null;){if(l=K,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Ol(9,l)}}catch(x){xe(l,l.return,x)}if(l===i){K=null;break e}var _=l.sibling;if(_!==null){_.return=l.return,K=_;break e}K=l.return}}if(se=o,Dn(),zt&&typeof zt.onPostCommitFiberRoot=="function")try{zt.onPostCommitFiberRoot(ji,e)}catch{}r=!0}return r}finally{ue=n,Tt.transition=t}}return!1}function fg(e,t,n){t=uo(n,t),t=Cm(e,t,1),e=Pn(e,t,1),t=qe(),e!==null&&(us(e,1,t),ot(e,t))}function xe(e,t,n){if(e.tag===3)fg(e,e,n);else for(;t!==null;){if(t.tag===3){fg(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Un===null||!Un.has(r))){e=uo(n,e),e=Lm(t,e,1),t=Pn(t,e,1),e=qe(),t!==null&&(us(t,1,e),ot(t,e));break}}t=t.return}}function zx(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=qe(),e.pingedLanes|=e.suspendedLanes&n,Pe===e&&(je&n)===n&&(De===4||De===3&&(je&130023424)===je&&500>we()-qu?mr(e,0):Qu|=n),ot(e,t)}function pg(e,t){t===0&&(e.mode&1?(t=$i,$i<<=1,!($i&130023424)&&($i=4194304)):t=1);var n=qe();e=un(e,t),e!==null&&(us(e,t,n),ot(e,n))}function Wx(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),pg(e,n)}function Gx(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(G(314))}r!==null&&r.delete(t),pg(e,n)}var hg;hg=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||et.current)nt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return nt=!1,Dx(e,t,n);nt=!!(e.flags&131072)}else nt=!1,me&&t.flags&1048576&&Gh(t,cl,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Nl(e,t),e=t.pendingProps;var o=no(t,He.current);lo(t,n),o=Cu(null,t,r,e,o,n);var s=Lu();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,tt(r)?(s=!0,il(t)):s=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Su(t),o.updater=ml,t.stateNode=o,o._reactInternals=t,Ru(t,r,e,n),t=ju(null,t,r,!0,s,n)):(t.tag=0,me&&s&&du(t),Qe(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Nl(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=Kx(r),e=Pt(r,e),o){case 0:t=Fu(null,t,r,e,n);break e;case 1:t=Vm(null,t,r,e,n);break e;case 11:t=Pm(null,t,r,e,n);break e;case 14:t=Mm(null,t,r,Pt(r.type,e),n);break e}throw Error(G(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Pt(r,o),Fu(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Pt(r,o),Vm(e,t,r,o,n);case 3:e:{if($m(t),e===null)throw Error(G(387));r=t.pendingProps,s=t.memoizedState,o=s.element,Jh(e,t),hl(t,r,null,n);var i=t.memoizedState;if(r=i.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){o=uo(Error(G(423)),t),t=Hm(e,t,r,n,o);break e}else if(r!==o){o=uo(Error(G(424)),t),t=Hm(e,t,r,n,o);break e}else for(mt=Cn(t.stateNode.containerInfo.firstChild),ht=t,me=!0,kt=null,n=lm(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(so(),r===o){t=fn(e,t,n);break e}Qe(e,t,r,n)}t=t.child}return t;case 5:return am(t),e===null&&hu(t),r=t.type,o=t.pendingProps,s=e!==null?e.memoizedProps:null,i=o.children,su(r,o)?i=null:s!==null&&su(r,s)&&(t.flags|=32),jm(e,t),Qe(e,t,i,n),t.child;case 6:return e===null&&hu(t),null;case 13:return Bm(e,t,n);case 4:return Nu(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ao(t,null,r,n):Qe(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Pt(r,o),Pm(e,t,r,o,n);case 7:return Qe(e,t,t.pendingProps,n),t.child;case 8:return Qe(e,t,t.pendingProps.children,n),t.child;case 12:return Qe(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,s=t.memoizedProps,i=o.value,fe(dl,r._currentValue),r._currentValue=i,s!==null)if(Dt(s.value,i)){if(s.children===o.children&&!et.current){t=fn(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var l=s.dependencies;if(l!==null){i=s.child;for(var a=l.firstContext;a!==null;){if(a.context===r){if(s.tag===1){a=dn(-1,n&-n),a.tag=2;var c=s.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?a.next=a:(a.next=u.next,u.next=a),c.pending=a}}s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),vu(s.return,n,t),l.lanes|=n;break}a=a.next}}else if(s.tag===10)i=s.type===t.type?null:s.child;else if(s.tag===18){if(i=s.return,i===null)throw Error(G(341));i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),vu(i,n,t),i=s.sibling}else i=s.child;if(i!==null)i.return=s;else for(i=s;i!==null;){if(i===t){i=null;break}if(s=i.sibling,s!==null){s.return=i.return,i=s;break}i=i.return}s=i}Qe(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,lo(t,n),o=wt(o),r=r(o),t.flags|=1,Qe(e,t,r,n),t.child;case 14:return r=t.type,o=Pt(r,t.pendingProps),o=Pt(r.type,o),Mm(e,t,r,o,n);case 15:return Um(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Pt(r,o),Nl(e,t),t.tag=1,tt(r)?(e=!0,il(t)):e=!1,lo(t,n),rm(t,r,o),Ru(t,r,o,n),ju(null,t,r,!0,e,n);case 19:return Wm(e,t,n);case 22:return Fm(e,t,n)}throw Error(G(156,t.tag))};function mg(e,t){return Yp(e,t)}function Yx(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 At(e,t,n,r){return new Yx(e,t,n,r)}function sd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Kx(e){if(typeof e=="function")return sd(e)?1:0;if(e!=null){if(e=e.$$typeof,e===dc)return 11;if(e===hc)return 14}return 2}function $n(e,t){var n=e.alternate;return n===null?(n=At(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 Pl(e,t,n,r,o,s){var i=2;if(r=e,typeof e=="function")sd(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case Br:return Er(n.children,o,s,t);case cc:i=8,o|=8;break;case uc:return e=At(12,n,t,o|2),e.elementType=uc,e.lanes=s,e;case fc:return e=At(13,n,t,o),e.elementType=fc,e.lanes=s,e;case pc:return e=At(19,n,t,o),e.elementType=pc,e.lanes=s,e;case Rp:return Ml(n,o,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Sp:i=10;break e;case xp:i=9;break e;case dc:i=11;break e;case hc:i=14;break e;case xn:i=16,r=null;break e}throw Error(G(130,e==null?e:typeof e,""))}return t=At(i,n,t,o),t.elementType=e,t.type=r,t.lanes=s,t}function Er(e,t,n,r){return e=At(7,e,r,t),e.lanes=n,e}function Ml(e,t,n,r){return e=At(22,e,r,t),e.elementType=Rp,e.lanes=n,e.stateNode={isHidden:!1},e}function id(e,t,n){return e=At(6,e,null,t),e.lanes=n,e}function ld(e,t,n){return t=At(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Xx(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=kc(0),this.expirationTimes=kc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=kc(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function ad(e,t,n,r,o,s,i,l,a){return e=new Xx(e,t,n,l,a),t===1?(t=1,s===!0&&(t|=8)):t=0,s=At(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Su(s),e}function Qx(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Hr,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function gg(e){if(!e)return bn;e=e._reactInternals;e:{if(sr(e)!==e||e.tag!==1)throw Error(G(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(tt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(G(171))}if(e.tag===1){var n=e.type;if(tt(n))return Bh(e,n,t)}return t}function Eg(e,t,n,r,o,s,i,l,a){return e=ad(n,r,!0,e,o,s,i,l,a),e.context=gg(null),n=e.current,r=qe(),o=jn(n),s=dn(r,o),s.callback=t??null,Pn(n,s,o),e.current.lanes=o,us(e,o,r),ot(e,r),e}function Ul(e,t,n,r){var o=t.current,s=qe(),i=jn(o);return n=gg(n),t.context===null?t.context=n:t.pendingContext=n,t=dn(s,i),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Pn(o,t,i),e!==null&&(Ft(e,o,i,s),pl(e,o,i)),i}function Fl(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 yg(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function cd(e,t){yg(e,t),(e=e.alternate)&&yg(e,t)}function qx(){return null}var vg=typeof reportError=="function"?reportError:function(e){console.error(e)};function ud(e){this._internalRoot=e}jl.prototype.render=ud.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(G(409));Ul(e,t,null,null)},jl.prototype.unmount=ud.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;hr(function(){Ul(null,e,null,null)}),t[sn]=null}};function jl(e){this._internalRoot=e}jl.prototype.unstable_scheduleHydration=function(e){if(e){var t=th();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Tn.length&&t!==0&&t<Tn[n].priority;n++);Tn.splice(n,0,e),n===0&&oh(e)}};function dd(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Vl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function _g(){}function Jx(e,t,n,r,o){if(o){if(typeof r=="function"){var s=r;r=function(){var c=Fl(i);s.call(c)}}var i=Eg(t,r,e,0,null,!1,!1,"",_g);return e._reactRootContainer=i,e[sn]=i.current,Ns(e.nodeType===8?e.parentNode:e),hr(),i}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var l=r;r=function(){var c=Fl(a);l.call(c)}}var a=ad(e,0,!1,null,null,!1,!1,"",_g);return e._reactRootContainer=a,e[sn]=a.current,Ns(e.nodeType===8?e.parentNode:e),hr(function(){Ul(t,a,n,r)}),a}function $l(e,t,n,r,o){var s=n._reactRootContainer;if(s){var i=s;if(typeof o=="function"){var l=o;o=function(){var a=Fl(i);l.call(a)}}Ul(t,i,e,o)}else i=Jx(n,t,e,o,r);return Fl(i)}Zp=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=cs(t.pendingLanes);n!==0&&(Pc(t,n|1),ot(t,we()),!(se&6)&&(ho=we()+500,Dn()))}break;case 13:hr(function(){var r=un(e,1);if(r!==null){var o=qe();Ft(r,e,1,o)}}),cd(e,1)}},Mc=function(e){if(e.tag===13){var t=un(e,134217728);if(t!==null){var n=qe();Ft(t,e,134217728,n)}cd(e,134217728)}},eh=function(e){if(e.tag===13){var t=jn(e),n=un(e,t);if(n!==null){var r=qe();Ft(n,e,t,r)}cd(e,t)}},th=function(){return ue},nh=function(e,t){var n=ue;try{return ue=e,t()}finally{ue=n}},Ac=function(e,t,n){switch(t){case"input":if(_c(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=ol(r);if(!o)throw Error(G(90));Op(r),_c(r,o)}}}break;case"textarea":Lp(e,n);break;case"select":t=n.value,t!=null&&zr(e,!!n.multiple,t,!1)}},Vp=nd,$p=hr;var Zx={usingClientEntryPoint:!1,Events:[Ts,eo,ol,Fp,jp,nd]},$s={findFiberByHostInstance:ir,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},eR={bundleType:$s.bundleType,version:$s.version,rendererPackageName:$s.rendererPackageName,rendererConfig:$s.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:on.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Wp(e),e===null?null:e.stateNode},findFiberByHostInstance:$s.findFiberByHostInstance||qx,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 Hl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Hl.isDisabled&&Hl.supportsFiber)try{ji=Hl.inject(eR),zt=Hl}catch{}}dt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Zx,dt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!dd(t))throw Error(G(200));return Qx(e,t,null,n)},dt.createRoot=function(e,t){if(!dd(e))throw Error(G(299));var n=!1,r="",o=vg;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=ad(e,1,!1,null,null,n,!1,r,o),e[sn]=t.current,Ns(e.nodeType===8?e.parentNode:e),new ud(t)},dt.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(G(188)):(e=Object.keys(e).join(","),Error(G(268,e)));return e=Wp(t),e=e===null?null:e.stateNode,e},dt.flushSync=function(e){return hr(e)},dt.hydrate=function(e,t,n){if(!Vl(t))throw Error(G(200));return $l(null,e,t,!0,n)},dt.hydrateRoot=function(e,t,n){if(!dd(e))throw Error(G(405));var r=n!=null&&n.hydratedSources||null,o=!1,s="",i=vg;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(i=n.onRecoverableError)),t=Eg(t,null,e,1,n??null,o,!1,s,i),e[sn]=t.current,Ns(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 jl(t)},dt.render=function(e,t,n){if(!Vl(t))throw Error(G(200));return $l(null,e,t,!1,n)},dt.unmountComponentAtNode=function(e){if(!Vl(e))throw Error(G(40));return e._reactRootContainer?(hr(function(){$l(null,null,e,!1,function(){e._reactRootContainer=null,e[sn]=null})}),!0):!1},dt.unstable_batchedUpdates=nd,dt.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Vl(n))throw Error(G(200));if(e==null||e._reactInternals===void 0)throw Error(G(38));return $l(e,t,n,!1,r)},dt.version="18.2.0-next-9e3b772b8-20220608";function Sg(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Sg)}catch(e){console.error(e)}}Sg(),hp.exports=dt;var Bl=hp.exports,xg=Bl;oc.createRoot=xg.createRoot,oc.hydrateRoot=xg.hydrateRoot;function Je(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=Je(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var Rg={exports:{}},Ng={},wg={exports:{}},Og={};/**
45
45
  * @license React
46
46
  * use-sync-external-store-shim.production.min.js
47
47
  *
@@ -49,7 +49,7 @@ Error generating stack: `+i.message+`
49
49
  *
50
50
  * This source code is licensed under the MIT license found in the
51
51
  * LICENSE file in the root directory of this source tree.
52
- */var Ro=w;function T1(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var A1=typeof Object.is=="function"?Object.is:T1,I1=Ro.useState,b1=Ro.useEffect,C1=Ro.useLayoutEffect,L1=Ro.useDebugValue;function D1(e,t){var n=t(),r=I1({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return C1(function(){o.value=n,o.getSnapshot=t,pd(o)&&i({inst:o})},[e,n,t]),b1(function(){return pd(o)&&i({inst:o}),e(function(){pd(o)&&i({inst:o})})},[e]),L1(n),n}function pd(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!A1(e,n)}catch{return!0}}function k1(e,t){return t()}var P1=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?k1:D1;Im.useSyncExternalStore=Ro.useSyncExternalStore!==void 0?Ro.useSyncExternalStore:P1,Am.exports=Im;var M1=Am.exports;/**
52
+ */var go=O;function tR(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var nR=typeof Object.is=="function"?Object.is:tR,rR=go.useState,oR=go.useEffect,sR=go.useLayoutEffect,iR=go.useDebugValue;function lR(e,t){var n=t(),r=rR({inst:{value:n,getSnapshot:t}}),o=r[0].inst,s=r[1];return sR(function(){o.value=n,o.getSnapshot=t,fd(o)&&s({inst:o})},[e,n,t]),oR(function(){return fd(o)&&s({inst:o}),e(function(){fd(o)&&s({inst:o})})},[e]),iR(n),n}function fd(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!nR(e,n)}catch{return!0}}function aR(e,t){return t()}var cR=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?aR:lR;Og.useSyncExternalStore=go.useSyncExternalStore!==void 0?go.useSyncExternalStore:cR,wg.exports=Og;var uR=wg.exports;/**
53
53
  * @license React
54
54
  * use-sync-external-store-shim/with-selector.production.min.js
55
55
  *
@@ -57,19 +57,14 @@ 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 Ka=w,j1=M1;function U1(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var F1=typeof Object.is=="function"?Object.is:U1,V1=j1.useSyncExternalStore,$1=Ka.useRef,B1=Ka.useEffect,H1=Ka.useMemo,z1=Ka.useDebugValue;Tm.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=$1(null);if(i.current===null){var s={hasValue:!1,value:null};i.current=s}else s=i.current;i=H1(function(){function l(h){if(!c){if(c=!0,d=h,h=r(h),o!==void 0&&s.hasValue){var E=s.value;if(o(E,h))return f=E}return f=h}if(E=f,F1(d,h))return E;var v=r(h);return o!==void 0&&o(E,v)?E:(d=h,f=v)}var c=!1,d,f,p=n===void 0?null:n;return[function(){return l(t())},p===null?void 0:function(){return l(p())}]},[t,n,r,o]);var a=V1(e,i[0],i[1]);return B1(function(){s.hasValue=!0,s.value=a},[a]),z1(a),a},Om.exports=Tm;var W1=Om.exports;const bm=Yl(W1),Cm=e=>{let t;const n=new Set,r=(l,c)=>{const d=typeof l=="function"?l(t):l;if(!Object.is(d,t)){const f=t;t=c??typeof d!="object"?d:Object.assign({},t,d),n.forEach(p=>p(t,f))}},o=()=>t,a={setState:r,getState:o,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{n.clear()}};return t=e(r,o,a),a},Lm=e=>e?Cm(e):Cm,{useSyncExternalStoreWithSelector:G1}=bm;function Dm(e,t=e.getState,n){const r=G1(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return w.useDebugValue(r),r}const km=(e,t)=>{const n=Lm(e),r=(o,i=t)=>Dm(n,o,i);return Object.assign(r,n),r},Y1=(e,t)=>e?km(e,t):km;function ze(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 K1={value:()=>{}};function Qa(){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 Xa(n)}function Xa(e){this._=e}function Q1(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}})}Xa.prototype=Qa.prototype={constructor:Xa,on:function(e,t){var n=this._,r=Q1(e+"",n),o,i=-1,s=r.length;if(arguments.length<2){for(;++i<s;)if((o=(e=r[i]).type)&&(o=X1(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]=Pm(n[o],e.name,t);else if(t==null)for(o in n)n[o]=Pm(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 Xa(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 X1(e,t){for(var n=0,r=e.length,o;n<r;++n)if((o=e[n]).name===t)return o.value}function Pm(e,t,n){for(var r=0,o=e.length;r<o;++r)if(e[r].name===t){e[r]=K1,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var hd="http://www.w3.org/1999/xhtml";const Mm={svg:"http://www.w3.org/2000/svg",xhtml:hd,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function qa(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Mm.hasOwnProperty(t)?{space:Mm[t],local:e}:e}function q1(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===hd&&t.documentElement.namespaceURI===hd?t.createElement(e):t.createElementNS(n,e)}}function J1(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function jm(e){var t=qa(e);return(t.local?J1:q1)(t)}function Z1(){}function gd(e){return e==null?Z1:function(){return this.querySelector(e)}}function eR(e){typeof e!="function"&&(e=gd(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,a=r[o]=new Array(s),l,c,d=0;d<s;++d)(l=i[d])&&(c=e.call(l,l.__data__,d,i))&&("__data__"in l&&(c.__data__=l.__data__),a[d]=c);return new mt(r,this._parents)}function tR(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function nR(){return[]}function Um(e){return e==null?nR:function(){return this.querySelectorAll(e)}}function rR(e){return function(){return tR(e.apply(this,arguments))}}function oR(e){typeof e=="function"?e=rR(e):e=Um(e);for(var t=this._groups,n=t.length,r=[],o=[],i=0;i<n;++i)for(var s=t[i],a=s.length,l,c=0;c<a;++c)(l=s[c])&&(r.push(e.call(l,l.__data__,c,s)),o.push(l));return new mt(r,o)}function Fm(e){return function(){return this.matches(e)}}function Vm(e){return function(t){return t.matches(e)}}var iR=Array.prototype.find;function sR(e){return function(){return iR.call(this.children,e)}}function aR(){return this.firstElementChild}function lR(e){return this.select(e==null?aR:sR(typeof e=="function"?e:Vm(e)))}var cR=Array.prototype.filter;function uR(){return Array.from(this.children)}function dR(e){return function(){return cR.call(this.children,e)}}function fR(e){return this.selectAll(e==null?uR:dR(typeof e=="function"?e:Vm(e)))}function pR(e){typeof e!="function"&&(e=Fm(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,a=r[o]=[],l,c=0;c<s;++c)(l=i[c])&&e.call(l,l.__data__,c,i)&&a.push(l);return new mt(r,this._parents)}function $m(e){return new Array(e.length)}function hR(){return new mt(this._enter||this._groups.map($m),this._parents)}function Ja(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Ja.prototype={constructor:Ja,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 gR(e){return function(){return e}}function mR(e,t,n,r,o,i){for(var s=0,a,l=t.length,c=i.length;s<c;++s)(a=t[s])?(a.__data__=i[s],r[s]=a):n[s]=new Ja(e,i[s]);for(;s<l;++s)(a=t[s])&&(o[s]=a)}function ER(e,t,n,r,o,i,s){var a,l,c=new Map,d=t.length,f=i.length,p=new Array(d),h;for(a=0;a<d;++a)(l=t[a])&&(p[a]=h=s.call(l,l.__data__,a,t)+"",c.has(h)?o[a]=l:c.set(h,l));for(a=0;a<f;++a)h=s.call(e,i[a],a,i)+"",(l=c.get(h))?(r[a]=l,l.__data__=i[a],c.delete(h)):n[a]=new Ja(e,i[a]);for(a=0;a<d;++a)(l=t[a])&&c.get(p[a])===l&&(o[a]=l)}function vR(e){return e.__data__}function yR(e,t){if(!arguments.length)return Array.from(this,vR);var n=t?ER:mR,r=this._parents,o=this._groups;typeof e!="function"&&(e=gR(e));for(var i=o.length,s=new Array(i),a=new Array(i),l=new Array(i),c=0;c<i;++c){var d=r[c],f=o[c],p=f.length,h=_R(e.call(d,d&&d.__data__,c,r)),E=h.length,v=a[c]=new Array(E),y=s[c]=new Array(E),g=l[c]=new Array(p);n(d,f,v,y,g,h,t);for(var m=0,_=0,S,x;m<E;++m)if(S=v[m]){for(m>=_&&(_=m+1);!(x=y[_])&&++_<E;);S._next=x||null}}return s=new mt(s,r),s._enter=a,s._exit=l,s}function _R(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function SR(){return new mt(this._exit||this._groups.map($m),this._parents)}function xR(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 RR(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),a=new Array(o),l=0;l<s;++l)for(var c=n[l],d=r[l],f=c.length,p=a[l]=new Array(f),h,E=0;E<f;++E)(h=c[E]||d[E])&&(p[E]=h);for(;l<o;++l)a[l]=n[l];return new mt(a,this._parents)}function NR(){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 wR(e){e||(e=OR);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],a=s.length,l=o[i]=new Array(a),c,d=0;d<a;++d)(c=s[d])&&(l[d]=c);l.sort(t)}return new mt(o,this._parents).order()}function OR(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function TR(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function AR(){return Array.from(this)}function IR(){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 bR(){let e=0;for(const t of this)++e;return e}function CR(){return!this.node()}function LR(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var o=t[n],i=0,s=o.length,a;i<s;++i)(a=o[i])&&e.call(a,a.__data__,i,o);return this}function DR(e){return function(){this.removeAttribute(e)}}function kR(e){return function(){this.removeAttributeNS(e.space,e.local)}}function PR(e,t){return function(){this.setAttribute(e,t)}}function MR(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function jR(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function UR(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 FR(e,t){var n=qa(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?kR:DR:typeof t=="function"?n.local?UR:jR:n.local?MR:PR)(n,t))}function Bm(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function VR(e){return function(){this.style.removeProperty(e)}}function $R(e,t,n){return function(){this.style.setProperty(e,t,n)}}function BR(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function HR(e,t,n){return arguments.length>1?this.each((t==null?VR:typeof t=="function"?BR:$R)(e,t,n??"")):No(this.node(),e)}function No(e,t){return e.style.getPropertyValue(t)||Bm(e).getComputedStyle(e,null).getPropertyValue(t)}function zR(e){return function(){delete this[e]}}function WR(e,t){return function(){this[e]=t}}function GR(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function YR(e,t){return arguments.length>1?this.each((t==null?zR:typeof t=="function"?GR:WR)(e,t)):this.node()[e]}function Hm(e){return e.trim().split(/^|\s+/)}function md(e){return e.classList||new zm(e)}function zm(e){this._node=e,this._names=Hm(e.getAttribute("class")||"")}zm.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 Wm(e,t){for(var n=md(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function Gm(e,t){for(var n=md(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function KR(e){return function(){Wm(this,e)}}function QR(e){return function(){Gm(this,e)}}function XR(e,t){return function(){(t.apply(this,arguments)?Wm:Gm)(this,e)}}function qR(e,t){var n=Hm(e+"");if(arguments.length<2){for(var r=md(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each((typeof t=="function"?XR:t?KR:QR)(n,t))}function JR(){this.textContent=""}function ZR(e){return function(){this.textContent=e}}function eN(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function tN(e){return arguments.length?this.each(e==null?JR:(typeof e=="function"?eN:ZR)(e)):this.node().textContent}function nN(){this.innerHTML=""}function rN(e){return function(){this.innerHTML=e}}function oN(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function iN(e){return arguments.length?this.each(e==null?nN:(typeof e=="function"?oN:rN)(e)):this.node().innerHTML}function sN(){this.nextSibling&&this.parentNode.appendChild(this)}function aN(){return this.each(sN)}function lN(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function cN(){return this.each(lN)}function uN(e){var t=typeof e=="function"?e:jm(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function dN(){return null}function fN(e,t){var n=typeof e=="function"?e:jm(e),r=t==null?dN:typeof t=="function"?t:gd(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function pN(){var e=this.parentNode;e&&e.removeChild(this)}function hN(){return this.each(pN)}function gN(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function mN(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function EN(e){return this.select(e?mN:gN)}function vN(e){return arguments.length?this.property("__data__",e):this.node().__data__}function yN(e){return function(t){e.call(this,t,this.__data__)}}function _N(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 SN(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 xN(e,t,n){return function(){var r=this.__on,o,i=yN(t);if(r){for(var s=0,a=r.length;s<a;++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 RN(e,t,n){var r=_N(e+""),o,i=r.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var l=0,c=a.length,d;l<c;++l)for(o=0,d=a[l];o<i;++o)if((s=r[o]).type===d.type&&s.name===d.name)return d.value}return}for(a=t?xN:SN,o=0;o<i;++o)this.each(a(r[o],t,n));return this}function Ym(e,t,n){var r=Bm(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 NN(e,t){return function(){return Ym(this,e,t)}}function wN(e,t){return function(){return Ym(this,e,t.apply(this,arguments))}}function ON(e,t){return this.each((typeof t=="function"?wN:NN)(e,t))}function*TN(){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 Km=[null];function mt(e,t){this._groups=e,this._parents=t}function Wi(){return new mt([[document.documentElement]],Km)}function AN(){return this}mt.prototype=Wi.prototype={constructor:mt,select:eR,selectAll:oR,selectChild:lR,selectChildren:fR,filter:pR,data:yR,enter:hR,exit:SR,join:xR,merge:RR,selection:AN,order:NR,sort:wR,call:TR,nodes:AR,node:IR,size:bR,empty:CR,each:LR,attr:FR,style:HR,property:YR,classed:qR,text:tN,html:iN,raise:aN,lower:cN,append:uN,insert:fN,remove:hN,clone:EN,datum:vN,on:RN,dispatch:ON,[Symbol.iterator]:TN};function Vt(e){return typeof e=="string"?new mt([[document.querySelector(e)]],[document.documentElement]):new mt([[e]],Km)}function IN(e){let t;for(;t=e.sourceEvent;)e=t;return e}function en(e,t){if(e=IN(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 bN={passive:!1},Gi={capture:!0,passive:!1};function Ed(e){e.stopImmediatePropagation()}function wo(e){e.preventDefault(),e.stopImmediatePropagation()}function Qm(e){var t=e.document.documentElement,n=Vt(e).on("dragstart.drag",wo,Gi);"onselectstart"in t?n.on("selectstart.drag",wo,Gi):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Xm(e,t){var n=e.document.documentElement,r=Vt(e).on("dragstart.drag",null);t&&(r.on("click.drag",wo,Gi),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 Za=e=>()=>e;function vd(e,{sourceEvent:t,subject:n,target:r,identifier:o,active:i,x:s,y:a,dx:l,dy:c,dispatch:d}){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:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:d}})}vd.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function CN(e){return!e.ctrlKey&&!e.button}function LN(){return this.parentNode}function DN(e,t){return t??{x:e.x,y:e.y}}function kN(){return navigator.maxTouchPoints||"ontouchstart"in this}function PN(){var e=CN,t=LN,n=DN,r=kN,o={},i=Qa("start","drag","end"),s=0,a,l,c,d,f=0;function p(S){S.on("mousedown.drag",h).filter(r).on("touchstart.drag",y).on("touchmove.drag",g,bN).on("touchend.drag touchcancel.drag",m).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(S,x){if(!(d||!e.call(this,S,x))){var R=_(this,t.call(this,S,x),S,x,"mouse");R&&(Vt(S.view).on("mousemove.drag",E,Gi).on("mouseup.drag",v,Gi),Qm(S.view),Ed(S),c=!1,a=S.clientX,l=S.clientY,R("start",S))}}function E(S){if(wo(S),!c){var x=S.clientX-a,R=S.clientY-l;c=x*x+R*R>f}o.mouse("drag",S)}function v(S){Vt(S.view).on("mousemove.drag mouseup.drag",null),Xm(S.view,c),wo(S),o.mouse("end",S)}function y(S,x){if(e.call(this,S,x)){var R=S.changedTouches,I=t.call(this,S,x),L=R.length,U,A;for(U=0;U<L;++U)(A=_(this,I,S,x,R[U].identifier,R[U]))&&(Ed(S),A("start",S,R[U]))}}function g(S){var x=S.changedTouches,R=x.length,I,L;for(I=0;I<R;++I)(L=o[x[I].identifier])&&(wo(S),L("drag",S,x[I]))}function m(S){var x=S.changedTouches,R=x.length,I,L;for(d&&clearTimeout(d),d=setTimeout(function(){d=null},500),I=0;I<R;++I)(L=o[x[I].identifier])&&(Ed(S),L("end",S,x[I]))}function _(S,x,R,I,L,U){var A=i.copy(),b=en(U||R,x),V,M,O;if((O=n.call(S,new vd("beforestart",{sourceEvent:R,target:p,identifier:L,active:s,x:b[0],y:b[1],dx:0,dy:0,dispatch:A}),I))!=null)return V=O.x-b[0]||0,M=O.y-b[1]||0,function j(P,$,D){var C=b,k;switch(P){case"start":o[L]=j,k=s++;break;case"end":delete o[L],--s;case"drag":b=en(D||$,x),k=s;break}A.call(P,S,new vd(P,{sourceEvent:$,subject:O,target:p,identifier:L,active:k,x:b[0]+V,y:b[1]+M,dx:b[0]-C[0],dy:b[1]-C[1],dispatch:A}),I)}}return p.filter=function(S){return arguments.length?(e=typeof S=="function"?S:Za(!!S),p):e},p.container=function(S){return arguments.length?(t=typeof S=="function"?S:Za(S),p):t},p.subject=function(S){return arguments.length?(n=typeof S=="function"?S:Za(S),p):n},p.touchable=function(S){return arguments.length?(r=typeof S=="function"?S:Za(!!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 yd(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function qm(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Yi(){}var Ki=.7,el=1/Ki,Oo="\\s*([+-]?\\d+)\\s*",Qi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",tn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",MN=/^#([0-9a-f]{3,8})$/,jN=new RegExp(`^rgb\\(${Oo},${Oo},${Oo}\\)$`),UN=new RegExp(`^rgb\\(${tn},${tn},${tn}\\)$`),FN=new RegExp(`^rgba\\(${Oo},${Oo},${Oo},${Qi}\\)$`),VN=new RegExp(`^rgba\\(${tn},${tn},${tn},${Qi}\\)$`),$N=new RegExp(`^hsl\\(${Qi},${tn},${tn}\\)$`),BN=new RegExp(`^hsla\\(${Qi},${tn},${tn},${Qi}\\)$`),Jm={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};yd(Yi,Xi,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Zm,formatHex:Zm,formatHex8:HN,formatHsl:zN,formatRgb:eE,toString:eE});function Zm(){return this.rgb().formatHex()}function HN(){return this.rgb().formatHex8()}function zN(){return iE(this).formatHsl()}function eE(){return this.rgb().formatRgb()}function Xi(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=MN.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?tE(t):n===3?new at(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?tl(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?tl(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=jN.exec(e))?new at(t[1],t[2],t[3],1):(t=UN.exec(e))?new at(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=FN.exec(e))?tl(t[1],t[2],t[3],t[4]):(t=VN.exec(e))?tl(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=$N.exec(e))?oE(t[1],t[2]/100,t[3]/100,1):(t=BN.exec(e))?oE(t[1],t[2]/100,t[3]/100,t[4]):Jm.hasOwnProperty(e)?tE(Jm[e]):e==="transparent"?new at(NaN,NaN,NaN,0):null}function tE(e){return new at(e>>16&255,e>>8&255,e&255,1)}function tl(e,t,n,r){return r<=0&&(e=t=n=NaN),new at(e,t,n,r)}function WN(e){return e instanceof Yi||(e=Xi(e)),e?(e=e.rgb(),new at(e.r,e.g,e.b,e.opacity)):new at}function _d(e,t,n,r){return arguments.length===1?WN(e):new at(e,t,n,r??1)}function at(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}yd(at,_d,qm(Yi,{brighter(e){return e=e==null?el:Math.pow(el,e),new at(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ki:Math.pow(Ki,e),new at(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new at(Or(this.r),Or(this.g),Or(this.b),nl(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:nE,formatHex:nE,formatHex8:GN,formatRgb:rE,toString:rE}));function nE(){return`#${Tr(this.r)}${Tr(this.g)}${Tr(this.b)}`}function GN(){return`#${Tr(this.r)}${Tr(this.g)}${Tr(this.b)}${Tr((isNaN(this.opacity)?1:this.opacity)*255)}`}function rE(){const e=nl(this.opacity);return`${e===1?"rgb(":"rgba("}${Or(this.r)}, ${Or(this.g)}, ${Or(this.b)}${e===1?")":`, ${e})`}`}function nl(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Or(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Tr(e){return e=Or(e),(e<16?"0":"")+e.toString(16)}function oE(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new $t(e,t,n,r)}function iE(e){if(e instanceof $t)return new $t(e.h,e.s,e.l,e.opacity);if(e instanceof Yi||(e=Xi(e)),!e)return new $t;if(e instanceof $t)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,a=i-o,l=(i+o)/2;return a?(t===i?s=(n-r)/a+(n<r)*6:n===i?s=(r-t)/a+2:s=(t-n)/a+4,a/=l<.5?i+o:2-i-o,s*=60):a=l>0&&l<1?0:s,new $t(s,a,l,e.opacity)}function YN(e,t,n,r){return arguments.length===1?iE(e):new $t(e,t,n,r??1)}function $t(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}yd($t,YN,qm(Yi,{brighter(e){return e=e==null?el:Math.pow(el,e),new $t(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ki:Math.pow(Ki,e),new $t(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 at(Sd(e>=240?e-240:e+120,o,r),Sd(e,o,r),Sd(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new $t(sE(this.h),rl(this.s),rl(this.l),nl(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=nl(this.opacity);return`${e===1?"hsl(":"hsla("}${sE(this.h)}, ${rl(this.s)*100}%, ${rl(this.l)*100}%${e===1?")":`, ${e})`}`}}));function sE(e){return e=(e||0)%360,e<0?e+360:e}function rl(e){return Math.max(0,Math.min(1,e||0))}function Sd(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 aE=e=>()=>e;function KN(e,t){return function(n){return e+n*t}}function QN(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 XN(e){return(e=+e)==1?lE:function(t,n){return n-t?QN(t,n,e):aE(isNaN(t)?n:t)}}function lE(e,t){var n=t-e;return n?KN(e,n):aE(isNaN(e)?t:e)}const cE=function e(t){var n=XN(t);function r(o,i){var s=n((o=_d(o)).r,(i=_d(i)).r),a=n(o.g,i.g),l=n(o.b,i.b),c=lE(o.opacity,i.opacity);return function(d){return o.r=s(d),o.g=a(d),o.b=l(d),o.opacity=c(d),o+""}}return r.gamma=e,r}(1);function Kn(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var xd=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Rd=new RegExp(xd.source,"g");function qN(e){return function(){return e}}function JN(e){return function(t){return e(t)+""}}function ZN(e,t){var n=xd.lastIndex=Rd.lastIndex=0,r,o,i,s=-1,a=[],l=[];for(e=e+"",t=t+"";(r=xd.exec(e))&&(o=Rd.exec(t));)(i=o.index)>n&&(i=t.slice(n,i),a[s]?a[s]+=i:a[++s]=i),(r=r[0])===(o=o[0])?a[s]?a[s]+=o:a[++s]=o:(a[++s]=null,l.push({i:s,x:Kn(r,o)})),n=Rd.lastIndex;return n<t.length&&(i=t.slice(n),a[s]?a[s]+=i:a[++s]=i),a.length<2?l[0]?JN(l[0].x):qN(t):(t=l.length,function(c){for(var d=0,f;d<t;++d)a[(f=l[d]).i]=f.x(c);return a.join("")})}var uE=180/Math.PI,Nd={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function dE(e,t,n,r,o,i){var s,a,l;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(l=e*n+t*r)&&(n-=e*l,r-=t*l),(a=Math.sqrt(n*n+r*r))&&(n/=a,r/=a,l/=a),e*r<t*n&&(e=-e,t=-t,l=-l,s=-s),{translateX:o,translateY:i,rotate:Math.atan2(t,e)*uE,skewX:Math.atan(l)*uE,scaleX:s,scaleY:a}}var ol;function ew(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Nd:dE(t.a,t.b,t.c,t.d,t.e,t.f)}function tw(e){return e==null||(ol||(ol=document.createElementNS("http://www.w3.org/2000/svg","g")),ol.setAttribute("transform",e),!(e=ol.transform.baseVal.consolidate()))?Nd:(e=e.matrix,dE(e.a,e.b,e.c,e.d,e.e,e.f))}function fE(e,t,n,r){function o(c){return c.length?c.pop()+" ":""}function i(c,d,f,p,h,E){if(c!==f||d!==p){var v=h.push("translate(",null,t,null,n);E.push({i:v-4,x:Kn(c,f)},{i:v-2,x:Kn(d,p)})}else(f||p)&&h.push("translate("+f+t+p+n)}function s(c,d,f,p){c!==d?(c-d>180?d+=360:d-c>180&&(c+=360),p.push({i:f.push(o(f)+"rotate(",null,r)-2,x:Kn(c,d)})):d&&f.push(o(f)+"rotate("+d+r)}function a(c,d,f,p){c!==d?p.push({i:f.push(o(f)+"skewX(",null,r)-2,x:Kn(c,d)}):d&&f.push(o(f)+"skewX("+d+r)}function l(c,d,f,p,h,E){if(c!==f||d!==p){var v=h.push(o(h)+"scale(",null,",",null,")");E.push({i:v-4,x:Kn(c,f)},{i:v-2,x:Kn(d,p)})}else(f!==1||p!==1)&&h.push(o(h)+"scale("+f+","+p+")")}return function(c,d){var f=[],p=[];return c=e(c),d=e(d),i(c.translateX,c.translateY,d.translateX,d.translateY,f,p),s(c.rotate,d.rotate,f,p),a(c.skewX,d.skewX,f,p),l(c.scaleX,c.scaleY,d.scaleX,d.scaleY,f,p),c=d=null,function(h){for(var E=-1,v=p.length,y;++E<v;)f[(y=p[E]).i]=y.x(h);return f.join("")}}}var nw=fE(ew,"px, ","px)","deg)"),rw=fE(tw,", ",")",")"),ow=1e-12;function pE(e){return((e=Math.exp(e))+1/e)/2}function iw(e){return((e=Math.exp(e))-1/e)/2}function sw(e){return((e=Math.exp(2*e))-1)/(e+1)}const aw=function e(t,n,r){function o(i,s){var a=i[0],l=i[1],c=i[2],d=s[0],f=s[1],p=s[2],h=d-a,E=f-l,v=h*h+E*E,y,g;if(v<ow)g=Math.log(p/c)/t,y=function(I){return[a+I*h,l+I*E,c*Math.exp(t*I*g)]};else{var m=Math.sqrt(v),_=(p*p-c*c+r*v)/(2*c*n*m),S=(p*p-c*c-r*v)/(2*p*n*m),x=Math.log(Math.sqrt(_*_+1)-_),R=Math.log(Math.sqrt(S*S+1)-S);g=(R-x)/t,y=function(I){var L=I*g,U=pE(x),A=c/(n*m)*(U*sw(t*L+x)-iw(x));return[a+A*h,l+A*E,c*U/pE(t*L+x)]}}return y.duration=g*1e3*t/Math.SQRT2,y}return o.rho=function(i){var s=Math.max(.001,+i),a=s*s,l=a*a;return e(s,a,l)},o}(Math.SQRT2,2,4);var To=0,qi=0,Ji=0,hE=1e3,il,Zi,sl=0,Ar=0,al=0,es=typeof performance=="object"&&performance.now?performance:Date,gE=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function wd(){return Ar||(gE(lw),Ar=es.now()+al)}function lw(){Ar=0}function ll(){this._call=this._time=this._next=null}ll.prototype=mE.prototype={constructor:ll,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?wd():+n)+(t==null?0:+t),!this._next&&Zi!==this&&(Zi?Zi._next=this:il=this,Zi=this),this._call=e,this._time=n,Od()},stop:function(){this._call&&(this._call=null,this._time=1/0,Od())}};function mE(e,t,n){var r=new ll;return r.restart(e,t,n),r}function cw(){wd(),++To;for(var e=il,t;e;)(t=Ar-e._time)>=0&&e._call.call(void 0,t),e=e._next;--To}function EE(){Ar=(sl=es.now())+al,To=qi=0;try{cw()}finally{To=0,dw(),Ar=0}}function uw(){var e=es.now(),t=e-sl;t>hE&&(al-=t,sl=e)}function dw(){for(var e,t=il,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:il=n);Zi=e,Od(r)}function Od(e){if(!To){qi&&(qi=clearTimeout(qi));var t=e-Ar;t>24?(e<1/0&&(qi=setTimeout(EE,e-es.now()-al)),Ji&&(Ji=clearInterval(Ji))):(Ji||(sl=es.now(),Ji=setInterval(uw,hE)),To=1,gE(EE))}}function vE(e,t,n){var r=new ll;return t=t==null?0:+t,r.restart(o=>{r.stop(),e(o+t)},t,n),r}var fw=Qa("start","end","cancel","interrupt"),pw=[],yE=0,_E=1,Td=2,cl=3,SE=4,Ad=5,ul=6;function dl(e,t,n,r,o,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;hw(e,n,{name:t,index:r,group:o,on:fw,tween:pw,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:yE})}function Id(e,t){var n=Bt(e,t);if(n.state>yE)throw new Error("too late; already scheduled");return n}function nn(e,t){var n=Bt(e,t);if(n.state>cl)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 hw(e,t,n){var r=e.__transition,o;r[t]=n,n.timer=mE(i,0,n.time);function i(c){n.state=_E,n.timer.restart(s,n.delay,n.time),n.delay<=c&&s(c-n.delay)}function s(c){var d,f,p,h;if(n.state!==_E)return l();for(d in r)if(h=r[d],h.name===n.name){if(h.state===cl)return vE(s);h.state===SE?(h.state=ul,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete r[d]):+d<t&&(h.state=ul,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete r[d])}if(vE(function(){n.state===cl&&(n.state=SE,n.timer.restart(a,n.delay,n.time),a(c))}),n.state=Td,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Td){for(n.state=cl,o=new Array(p=n.tween.length),d=0,f=-1;d<p;++d)(h=n.tween[d].value.call(e,e.__data__,n.index,n.group))&&(o[++f]=h);o.length=f+1}}function a(c){for(var d=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(l),n.state=Ad,1),f=-1,p=o.length;++f<p;)o[f].call(e,d);n.state===Ad&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=ul,n.timer.stop(),delete r[t];for(var c in r)return;delete e.__transition}}function fl(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>Td&&r.state<Ad,r.state=ul,r.timer.stop(),r.on.call(o?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}i&&delete e.__transition}}function gw(e){return this.each(function(){fl(this,e)})}function mw(e,t){var n,r;return function(){var o=nn(this,e),i=o.tween;if(i!==n){r=n=i;for(var s=0,a=r.length;s<a;++s)if(r[s].name===t){r=r.slice(),r.splice(s,1);break}}o.tween=r}}function Ew(e,t,n){var r,o;if(typeof n!="function")throw new Error;return function(){var i=nn(this,e),s=i.tween;if(s!==r){o=(r=s).slice();for(var a={name:t,value:n},l=0,c=o.length;l<c;++l)if(o[l].name===t){o[l]=a;break}l===c&&o.push(a)}i.tween=o}}function vw(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?mw:Ew)(n,e,t))}function bd(e,t,n){var r=e._id;return e.each(function(){var o=nn(this,r);(o.value||(o.value={}))[t]=n.apply(this,arguments)}),function(o){return Bt(o,r).value[t]}}function xE(e,t){var n;return(typeof t=="number"?Kn:t instanceof Xi?cE:(n=Xi(t))?(t=n,cE):ZN)(e,t)}function yw(e){return function(){this.removeAttribute(e)}}function _w(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Sw(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 xw(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 Rw(e,t,n){var r,o,i;return function(){var s,a=n(this),l;return a==null?void this.removeAttribute(e):(s=this.getAttribute(e),l=a+"",s===l?null:s===r&&l===o?i:(o=l,i=t(r=s,a)))}}function Nw(e,t,n){var r,o,i;return function(){var s,a=n(this),l;return a==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),l=a+"",s===l?null:s===r&&l===o?i:(o=l,i=t(r=s,a)))}}function ww(e,t){var n=qa(e),r=n==="transform"?rw:xE;return this.attrTween(e,typeof t=="function"?(n.local?Nw:Rw)(n,r,bd(this,"attr."+e,t)):t==null?(n.local?_w:yw)(n):(n.local?xw:Sw)(n,r,t))}function Ow(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Tw(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Aw(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&Tw(e,i)),n}return o._value=t,o}function Iw(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&Ow(e,i)),n}return o._value=t,o}function bw(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=qa(e);return this.tween(n,(r.local?Aw:Iw)(r,t))}function Cw(e,t){return function(){Id(this,e).delay=+t.apply(this,arguments)}}function Lw(e,t){return t=+t,function(){Id(this,e).delay=t}}function Dw(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Cw:Lw)(t,e)):Bt(this.node(),t).delay}function kw(e,t){return function(){nn(this,e).duration=+t.apply(this,arguments)}}function Pw(e,t){return t=+t,function(){nn(this,e).duration=t}}function Mw(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?kw:Pw)(t,e)):Bt(this.node(),t).duration}function jw(e,t){if(typeof t!="function")throw new Error;return function(){nn(this,e).ease=t}}function Uw(e){var t=this._id;return arguments.length?this.each(jw(t,e)):Bt(this.node(),t).ease}function Fw(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;nn(this,e).ease=n}}function Vw(e){if(typeof e!="function")throw new Error;return this.each(Fw(this._id,e))}function $w(e){typeof e!="function"&&(e=Fm(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,a=r[o]=[],l,c=0;c<s;++c)(l=i[c])&&e.call(l,l.__data__,c,i)&&a.push(l);return new Sn(r,this._parents,this._name,this._id)}function Bw(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),a=0;a<i;++a)for(var l=t[a],c=n[a],d=l.length,f=s[a]=new Array(d),p,h=0;h<d;++h)(p=l[h]||c[h])&&(f[h]=p);for(;a<r;++a)s[a]=t[a];return new Sn(s,this._parents,this._name,this._id)}function Hw(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 zw(e,t,n){var r,o,i=Hw(t)?Id:nn;return function(){var s=i(this,e),a=s.on;a!==r&&(o=(r=a).copy()).on(t,n),s.on=o}}function Ww(e,t){var n=this._id;return arguments.length<2?Bt(this.node(),n).on.on(e):this.each(zw(n,e,t))}function Gw(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Yw(){return this.on("end.remove",Gw(this._id))}function Kw(e){var t=this._name,n=this._id;typeof e!="function"&&(e=gd(e));for(var r=this._groups,o=r.length,i=new Array(o),s=0;s<o;++s)for(var a=r[s],l=a.length,c=i[s]=new Array(l),d,f,p=0;p<l;++p)(d=a[p])&&(f=e.call(d,d.__data__,p,a))&&("__data__"in d&&(f.__data__=d.__data__),c[p]=f,dl(c[p],t,n,p,c,Bt(d,n)));return new Sn(i,this._parents,t,n)}function Qw(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Um(e));for(var r=this._groups,o=r.length,i=[],s=[],a=0;a<o;++a)for(var l=r[a],c=l.length,d,f=0;f<c;++f)if(d=l[f]){for(var p=e.call(d,d.__data__,f,l),h,E=Bt(d,n),v=0,y=p.length;v<y;++v)(h=p[v])&&dl(h,t,n,v,p,E);i.push(p),s.push(d)}return new Sn(i,s,t,n)}var Xw=Wi.prototype.constructor;function qw(){return new Xw(this._groups,this._parents)}function Jw(e,t){var n,r,o;return function(){var i=No(this,e),s=(this.style.removeProperty(e),No(this,e));return i===s?null:i===n&&s===r?o:o=t(n=i,r=s)}}function RE(e){return function(){this.style.removeProperty(e)}}function Zw(e,t,n){var r,o=n+"",i;return function(){var s=No(this,e);return s===o?null:s===r?i:i=t(r=s,n)}}function eO(e,t,n){var r,o,i;return function(){var s=No(this,e),a=n(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(e),No(this,e))),s===l?null:s===r&&l===o?i:(o=l,i=t(r=s,a))}}function tO(e,t){var n,r,o,i="style."+t,s="end."+i,a;return function(){var l=nn(this,e),c=l.on,d=l.value[i]==null?a||(a=RE(t)):void 0;(c!==n||o!==d)&&(r=(n=c).copy()).on(s,o=d),l.on=r}}function nO(e,t,n){var r=(e+="")=="transform"?nw:xE;return t==null?this.styleTween(e,Jw(e,r)).on("end.style."+e,RE(e)):typeof t=="function"?this.styleTween(e,eO(e,r,bd(this,"style."+e,t))).each(tO(this._id,e)):this.styleTween(e,Zw(e,r,t),n).on("end.style."+e,null)}function rO(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function oO(e,t,n){var r,o;function i(){var s=t.apply(this,arguments);return s!==o&&(r=(o=s)&&rO(e,s,n)),r}return i._value=t,i}function iO(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,oO(e,t,n??""))}function sO(e){return function(){this.textContent=e}}function aO(e){return function(){var t=e(this);this.textContent=t??""}}function lO(e){return this.tween("text",typeof e=="function"?aO(bd(this,"text",e)):sO(e==null?"":e+""))}function cO(e){return function(t){this.textContent=e.call(this,t)}}function uO(e){var t,n;function r(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&cO(o)),t}return r._value=e,r}function dO(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,uO(e))}function fO(){for(var e=this._name,t=this._id,n=NE(),r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],a=s.length,l,c=0;c<a;++c)if(l=s[c]){var d=Bt(l,t);dl(l,e,n,c,s,{time:d.time+d.delay+d.duration,delay:0,duration:d.duration,ease:d.ease})}return new Sn(r,this._parents,e,n)}function pO(){var e,t,n=this,r=n._id,o=n.size();return new Promise(function(i,s){var a={value:s},l={value:function(){--o===0&&i()}};n.each(function(){var c=nn(this,r),d=c.on;d!==e&&(t=(e=d).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(l)),c.on=t}),o===0&&i()})}var hO=0;function Sn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function NE(){return++hO}var xn=Wi.prototype;Sn.prototype={constructor:Sn,select:Kw,selectAll:Qw,selectChild:xn.selectChild,selectChildren:xn.selectChildren,filter:$w,merge:Bw,selection:qw,transition:fO,call:xn.call,nodes:xn.nodes,node:xn.node,size:xn.size,empty:xn.empty,each:xn.each,on:Ww,attr:ww,attrTween:bw,style:nO,styleTween:iO,text:lO,textTween:dO,remove:Yw,tween:vw,delay:Dw,duration:Mw,ease:Uw,easeVarying:Vw,end:pO,[Symbol.iterator]:xn[Symbol.iterator]};function gO(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var mO={time:null,delay:0,duration:250,ease:gO};function EO(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 vO(e){var t,n;e instanceof Sn?(t=e._id,e=e._name):(t=NE(),(n=mO).time=wd(),e=e==null?null:e+"");for(var r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],a=s.length,l,c=0;c<a;++c)(l=s[c])&&dl(l,e,t,c,s,n||EO(l,t));return new Sn(r,this._parents,e,t)}Wi.prototype.interrupt=gw,Wi.prototype.transition=vO;const pl=e=>()=>e;function yO(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 Rn(e,t,n){this.k=e,this.x=t,this.y=n}Rn.prototype={constructor:Rn,scale:function(e){return e===1?this:new Rn(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Rn(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 Qn=new Rn(1,0,0);Rn.prototype;function Cd(e){e.stopImmediatePropagation()}function ts(e){e.preventDefault(),e.stopImmediatePropagation()}function _O(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function SO(){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 wE(){return this.__zoom||Qn}function xO(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function RO(){return navigator.maxTouchPoints||"ontouchstart"in this}function NO(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 wO(){var e=_O,t=SO,n=NO,r=xO,o=RO,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,l=aw,c=Qa("start","zoom","end"),d,f,p,h=500,E=150,v=0,y=10;function g(O){O.property("__zoom",wE).on("wheel.zoom",L,{passive:!1}).on("mousedown.zoom",U).on("dblclick.zoom",A).filter(o).on("touchstart.zoom",b).on("touchmove.zoom",V).on("touchend.zoom touchcancel.zoom",M).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}g.transform=function(O,j,P,$){var D=O.selection?O.selection():O;D.property("__zoom",wE),O!==D?x(O,j,P,$):D.interrupt().each(function(){R(this,arguments).event($).start().zoom(null,typeof j=="function"?j.apply(this,arguments):j).end()})},g.scaleBy=function(O,j,P,$){g.scaleTo(O,function(){var D=this.__zoom.k,C=typeof j=="function"?j.apply(this,arguments):j;return D*C},P,$)},g.scaleTo=function(O,j,P,$){g.transform(O,function(){var D=t.apply(this,arguments),C=this.__zoom,k=P==null?S(D):typeof P=="function"?P.apply(this,arguments):P,F=C.invert(k),B=typeof j=="function"?j.apply(this,arguments):j;return n(_(m(C,B),k,F),D,s)},P,$)},g.translateBy=function(O,j,P,$){g.transform(O,function(){return n(this.__zoom.translate(typeof j=="function"?j.apply(this,arguments):j,typeof P=="function"?P.apply(this,arguments):P),t.apply(this,arguments),s)},null,$)},g.translateTo=function(O,j,P,$,D){g.transform(O,function(){var C=t.apply(this,arguments),k=this.__zoom,F=$==null?S(C):typeof $=="function"?$.apply(this,arguments):$;return n(Qn.translate(F[0],F[1]).scale(k.k).translate(typeof j=="function"?-j.apply(this,arguments):-j,typeof P=="function"?-P.apply(this,arguments):-P),C,s)},$,D)};function m(O,j){return j=Math.max(i[0],Math.min(i[1],j)),j===O.k?O:new Rn(j,O.x,O.y)}function _(O,j,P){var $=j[0]-P[0]*O.k,D=j[1]-P[1]*O.k;return $===O.x&&D===O.y?O:new Rn(O.k,$,D)}function S(O){return[(+O[0][0]+ +O[1][0])/2,(+O[0][1]+ +O[1][1])/2]}function x(O,j,P,$){O.on("start.zoom",function(){R(this,arguments).event($).start()}).on("interrupt.zoom end.zoom",function(){R(this,arguments).event($).end()}).tween("zoom",function(){var D=this,C=arguments,k=R(D,C).event($),F=t.apply(D,C),B=P==null?S(F):typeof P=="function"?P.apply(D,C):P,z=Math.max(F[1][0]-F[0][0],F[1][1]-F[0][1]),W=D.__zoom,X=typeof j=="function"?j.apply(D,C):j,Q=l(W.invert(B).concat(z/W.k),X.invert(B).concat(z/X.k));return function(J){if(J===1)J=X;else{var re=Q(J),pe=z/re[2];J=new Rn(pe,B[0]-re[0]*pe,B[1]-re[1]*pe)}k.zoom(null,J)}})}function R(O,j,P){return!P&&O.__zooming||new I(O,j)}function I(O,j){this.that=O,this.args=j,this.active=0,this.sourceEvent=null,this.extent=t.apply(O,j),this.taps=0}I.prototype={event:function(O){return O&&(this.sourceEvent=O),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(O,j){return this.mouse&&O!=="mouse"&&(this.mouse[1]=j.invert(this.mouse[0])),this.touch0&&O!=="touch"&&(this.touch0[1]=j.invert(this.touch0[0])),this.touch1&&O!=="touch"&&(this.touch1[1]=j.invert(this.touch1[0])),this.that.__zoom=j,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(O){var j=Vt(this.that).datum();c.call(O,this.that,new yO(O,{sourceEvent:this.sourceEvent,target:g,type:O,transform:this.that.__zoom,dispatch:c}),j)}};function L(O,...j){if(!e.apply(this,arguments))return;var P=R(this,j).event(O),$=this.__zoom,D=Math.max(i[0],Math.min(i[1],$.k*Math.pow(2,r.apply(this,arguments)))),C=en(O);if(P.wheel)(P.mouse[0][0]!==C[0]||P.mouse[0][1]!==C[1])&&(P.mouse[1]=$.invert(P.mouse[0]=C)),clearTimeout(P.wheel);else{if($.k===D)return;P.mouse=[C,$.invert(C)],fl(this),P.start()}ts(O),P.wheel=setTimeout(k,E),P.zoom("mouse",n(_(m($,D),P.mouse[0],P.mouse[1]),P.extent,s));function k(){P.wheel=null,P.end()}}function U(O,...j){if(p||!e.apply(this,arguments))return;var P=O.currentTarget,$=R(this,j,!0).event(O),D=Vt(O.view).on("mousemove.zoom",B,!0).on("mouseup.zoom",z,!0),C=en(O,P),k=O.clientX,F=O.clientY;Qm(O.view),Cd(O),$.mouse=[C,this.__zoom.invert(C)],fl(this),$.start();function B(W){if(ts(W),!$.moved){var X=W.clientX-k,Q=W.clientY-F;$.moved=X*X+Q*Q>v}$.event(W).zoom("mouse",n(_($.that.__zoom,$.mouse[0]=en(W,P),$.mouse[1]),$.extent,s))}function z(W){D.on("mousemove.zoom mouseup.zoom",null),Xm(W.view,$.moved),ts(W),$.event(W).end()}}function A(O,...j){if(e.apply(this,arguments)){var P=this.__zoom,$=en(O.changedTouches?O.changedTouches[0]:O,this),D=P.invert($),C=P.k*(O.shiftKey?.5:2),k=n(_(m(P,C),$,D),t.apply(this,j),s);ts(O),a>0?Vt(this).transition().duration(a).call(x,k,$,O):Vt(this).call(g.transform,k,$,O)}}function b(O,...j){if(e.apply(this,arguments)){var P=O.touches,$=P.length,D=R(this,j,O.changedTouches.length===$).event(O),C,k,F,B;for(Cd(O),k=0;k<$;++k)F=P[k],B=en(F,this),B=[B,this.__zoom.invert(B),F.identifier],D.touch0?!D.touch1&&D.touch0[2]!==B[2]&&(D.touch1=B,D.taps=0):(D.touch0=B,C=!0,D.taps=1+!!d);d&&(d=clearTimeout(d)),C&&(D.taps<2&&(f=B[0],d=setTimeout(function(){d=null},h)),fl(this),D.start())}}function V(O,...j){if(this.__zooming){var P=R(this,j).event(O),$=O.changedTouches,D=$.length,C,k,F,B;for(ts(O),C=0;C<D;++C)k=$[C],F=en(k,this),P.touch0&&P.touch0[2]===k.identifier?P.touch0[0]=F:P.touch1&&P.touch1[2]===k.identifier&&(P.touch1[0]=F);if(k=P.that.__zoom,P.touch1){var z=P.touch0[0],W=P.touch0[1],X=P.touch1[0],Q=P.touch1[1],J=(J=X[0]-z[0])*J+(J=X[1]-z[1])*J,re=(re=Q[0]-W[0])*re+(re=Q[1]-W[1])*re;k=m(k,Math.sqrt(J/re)),F=[(z[0]+X[0])/2,(z[1]+X[1])/2],B=[(W[0]+Q[0])/2,(W[1]+Q[1])/2]}else if(P.touch0)F=P.touch0[0],B=P.touch0[1];else return;P.zoom("touch",n(_(k,F,B),P.extent,s))}}function M(O,...j){if(this.__zooming){var P=R(this,j).event(O),$=O.changedTouches,D=$.length,C,k;for(Cd(O),p&&clearTimeout(p),p=setTimeout(function(){p=null},h),C=0;C<D;++C)k=$[C],P.touch0&&P.touch0[2]===k.identifier?delete P.touch0:P.touch1&&P.touch1[2]===k.identifier&&delete P.touch1;if(P.touch1&&!P.touch0&&(P.touch0=P.touch1,delete P.touch1),P.touch0)P.touch0[1]=this.__zoom.invert(P.touch0[0]);else if(P.end(),P.taps===2&&(k=en(k,this),Math.hypot(f[0]-k[0],f[1]-k[1])<y)){var F=Vt(this).on("dblclick.zoom");F&&F.apply(this,arguments)}}}return g.wheelDelta=function(O){return arguments.length?(r=typeof O=="function"?O:pl(+O),g):r},g.filter=function(O){return arguments.length?(e=typeof O=="function"?O:pl(!!O),g):e},g.touchable=function(O){return arguments.length?(o=typeof O=="function"?O:pl(!!O),g):o},g.extent=function(O){return arguments.length?(t=typeof O=="function"?O:pl([[+O[0][0],+O[0][1]],[+O[1][0],+O[1][1]]]),g):t},g.scaleExtent=function(O){return arguments.length?(i[0]=+O[0],i[1]=+O[1],g):[i[0],i[1]]},g.translateExtent=function(O){return arguments.length?(s[0][0]=+O[0][0],s[1][0]=+O[1][0],s[0][1]=+O[0][1],s[1][1]=+O[1][1],g):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},g.constrain=function(O){return arguments.length?(n=O,g):n},g.duration=function(O){return arguments.length?(a=+O,g):a},g.interpolate=function(O){return arguments.length?(l=O,g):l},g.on=function(){var O=c.on.apply(c,arguments);return O===c?g:O},g.clickDistance=function(O){return arguments.length?(v=(O=+O)*O,g):Math.sqrt(v)},g.tapDistance=function(O){return arguments.length?(y=+O,g):y},g}const hl=w.createContext(null),OO=hl.Provider,Nn={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"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.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,t)=>`Couldn't create edge for ${e?"target":"source"} handle id: "${e?t.targetHandle:t.sourceHandle}", edge id: ${t.id}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`},OE=Nn.error001();function ae(e,t){const n=w.useContext(hl);if(n===null)throw new Error(OE);return Dm(n,e,t)}const Te=()=>{const e=w.useContext(hl);if(e===null)throw new Error(OE);return w.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy}),[e])},TO=e=>e.userSelectionActive?"none":"all";function ns({position:e,children:t,className:n,style:r,...o}){const i=ae(TO),s=`${e}`.split("-");return u.jsx("div",{className:qe(["react-flow__panel",n,...s]),style:{...r,pointerEvents:i},...o,children:t})}function AO({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:u.jsx(ns,{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:u.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const IO=({x:e,y:t,label:n,labelStyle:r={},labelShowBg:o=!0,labelBgStyle:i={},labelBgPadding:s=[2,4],labelBgBorderRadius:a=2,children:l,className:c,...d})=>{const f=w.useRef(null),[p,h]=w.useState({x:0,y:0,width:0,height:0}),E=qe(["react-flow__edge-textwrapper",c]);return w.useEffect(()=>{if(f.current){const v=f.current.getBBox();h({x:v.x,y:v.y,width:v.width,height:v.height})}},[n]),typeof n>"u"||!n?null:u.jsxs("g",{transform:`translate(${e-p.width/2} ${t-p.height/2})`,className:E,visibility:p.width?"visible":"hidden",...d,children:[o&&u.jsx("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:a,ry:a}),u.jsx("text",{className:"react-flow__edge-text",y:p.height/2,dy:"0.3em",ref:f,style:r,children:n}),l]})};var bO=w.memo(IO);const Ld=e=>({width:e.offsetWidth,height:e.offsetHeight}),Ao=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Dd=(e={x:0,y:0},t)=>({x:Ao(e.x,t[0][0],t[1][0]),y:Ao(e.y,t[0][1],t[1][1])}),TE=(e,t,n)=>e<t?Ao(Math.abs(e-t),1,50)/50:e>n?-Ao(Math.abs(e-n),1,50)/50:0,AE=(e,t)=>{const n=TE(e.x,35,t.width-35)*20,r=TE(e.y,35,t.height-35)*20;return[n,r]},IE=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},CO=(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)}),kd=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),LO=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),bE=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),Pd=(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)},DO=e=>Tt(e.width)&&Tt(e.height)&&Tt(e.x)&&Tt(e.y),Tt=e=>!isNaN(e)&&isFinite(e),Ae=Symbol.for("internals"),CE=["Enter"," ","Escape"],kO=(e,t)=>{},PO=e=>"nativeEvent"in e;function Md(e){var o,i;const t=PO(e)?e.nativeEvent:e,n=((i=(o=t.composedPath)==null?void 0:o.call(t))==null?void 0:i[0])||e.target;return["INPUT","SELECT","TEXTAREA"].includes(n==null?void 0:n.nodeName)||(n==null?void 0:n.hasAttribute("contenteditable"))||!!(n!=null&&n.closest(".nokey"))}const LE=e=>"clientX"in e,Xn=(e,t)=>{var i,s;const n=LE(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)}},gl=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0},Io=({id:e,path:t,labelX:n,labelY:r,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:d,markerEnd:f,markerStart:p,interactionWidth:h=20})=>u.jsxs(u.Fragment,{children:[u.jsx("path",{id:e,style:d,d:t,fill:"none",className:"react-flow__edge-path",markerEnd:f,markerStart:p}),h&&u.jsx("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:h,className:"react-flow__edge-interaction"}),o&&Tt(n)&&Tt(r)?u.jsx(bO,{x:n,y:r,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c}):null]});Io.displayName="BaseEdge";function rs(e,t,n){return n===void 0?n:r=>{const o=t().edges.find(i=>i.id===e);o&&n(r,{...o})}}function DE({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,a=r<t?r+s:r-s;return[i,a,o,s]}function kE({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:o,sourceControlY:i,targetControlX:s,targetControlY:a}){const l=e*.125+o*.375+s*.375+n*.125,c=t*.125+i*.375+a*.375+r*.125,d=Math.abs(l-e),f=Math.abs(c-t);return[l,c,d,f]}var qn;(function(e){e.Strict="strict",e.Loose="loose"})(qn||(qn={}));var Ir;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Ir||(Ir={}));var os;(function(e){e.Partial="partial",e.Full="full"})(os||(os={}));var Jn;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Jn||(Jn={}));var is;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(is||(is={}));var K;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(K||(K={}));function PE({pos:e,x1:t,y1:n,x2:r,y2:o}){return e===K.Left||e===K.Right?[.5*(t+r),n]:[t,.5*(n+o)]}function ME({sourceX:e,sourceY:t,sourcePosition:n=K.Bottom,targetX:r,targetY:o,targetPosition:i=K.Top}){const[s,a]=PE({pos:n,x1:e,y1:t,x2:r,y2:o}),[l,c]=PE({pos:i,x1:r,y1:o,x2:e,y2:t}),[d,f,p,h]=kE({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:s,sourceControlY:a,targetControlX:l,targetControlY:c});return[`M${e},${t} C${s},${a} ${l},${c} ${r},${o}`,d,f,p,h]}const jd=w.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:o=K.Bottom,targetPosition:i=K.Top,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:f,style:p,markerEnd:h,markerStart:E,interactionWidth:v})=>{const[y,g,m]=ME({sourceX:e,sourceY:t,sourcePosition:o,targetX:n,targetY:r,targetPosition:i});return u.jsx(Io,{path:y,labelX:g,labelY:m,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:f,style:p,markerEnd:h,markerStart:E,interactionWidth:v})});jd.displayName="SimpleBezierEdge";const jE={[K.Left]:{x:-1,y:0},[K.Right]:{x:1,y:0},[K.Top]:{x:0,y:-1},[K.Bottom]:{x:0,y:1}},MO=({source:e,sourcePosition:t=K.Bottom,target:n})=>t===K.Left||t===K.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},UE=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function jO({source:e,sourcePosition:t=K.Bottom,target:n,targetPosition:r=K.Top,center:o,offset:i}){const s=jE[t],a=jE[r],l={x:e.x+s.x*i,y:e.y+s.y*i},c={x:n.x+a.x*i,y:n.y+a.y*i},d=MO({source:l,sourcePosition:t,target:c}),f=d.x!==0?"x":"y",p=d[f];let h=[],E,v;const y={x:0,y:0},g={x:0,y:0},[m,_,S,x]=DE({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[f]*a[f]===-1){E=o.x||m,v=o.y||_;const I=[{x:E,y:l.y},{x:E,y:c.y}],L=[{x:l.x,y:v},{x:c.x,y:v}];s[f]===p?h=f==="x"?I:L:h=f==="x"?L:I}else{const I=[{x:l.x,y:c.y}],L=[{x:c.x,y:l.y}];if(f==="x"?h=s.x===p?L:I:h=s.y===p?I:L,t===r){const M=Math.abs(e[f]-n[f]);if(M<=i){const O=Math.min(i-1,i-M);s[f]===p?y[f]=(l[f]>e[f]?-1:1)*O:g[f]=(c[f]>n[f]?-1:1)*O}}if(t!==r){const M=f==="x"?"y":"x",O=s[f]===a[M],j=l[M]>c[M],P=l[M]<c[M];(s[f]===1&&(!O&&j||O&&P)||s[f]!==1&&(!O&&P||O&&j))&&(h=f==="x"?I:L)}const U={x:l.x+y.x,y:l.y+y.y},A={x:c.x+g.x,y:c.y+g.y},b=Math.max(Math.abs(U.x-h[0].x),Math.abs(A.x-h[0].x)),V=Math.max(Math.abs(U.y-h[0].y),Math.abs(A.y-h[0].y));b>=V?(E=(U.x+A.x)/2,v=h[0].y):(E=h[0].x,v=(U.y+A.y)/2)}return[[e,{x:l.x+y.x,y:l.y+y.y},...h,{x:c.x+g.x,y:c.y+g.y},n],E,v,S,x]}function UO(e,t,n,r){const o=Math.min(UE(e,t)/2,UE(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 c=e.x<n.x?-1:1,d=e.y<n.y?1:-1;return`L ${i+o*c},${s}Q ${i},${s} ${i},${s+o*d}`}const a=e.x<n.x?1:-1,l=e.y<n.y?-1:1;return`L ${i},${s+o*l}Q ${i},${s} ${i+o*a},${s}`}function ss({sourceX:e,sourceY:t,sourcePosition:n=K.Bottom,targetX:r,targetY:o,targetPosition:i=K.Top,borderRadius:s=5,centerX:a,centerY:l,offset:c=20}){const[d,f,p,h,E]=jO({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:o},targetPosition:i,center:{x:a,y:l},offset:c});return[d.reduce((y,g,m)=>{let _="";return m>0&&m<d.length-1?_=UO(d[m-1],g,d[m+1],s):_=`${m===0?"M":"L"}${g.x} ${g.y}`,y+=_,y},""),f,p,h,E]}const ml=w.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:d,sourcePosition:f=K.Bottom,targetPosition:p=K.Top,markerEnd:h,markerStart:E,pathOptions:v,interactionWidth:y})=>{const[g,m,_]=ss({sourceX:e,sourceY:t,sourcePosition:f,targetX:n,targetY:r,targetPosition:p,borderRadius:v==null?void 0:v.borderRadius,offset:v==null?void 0:v.offset});return u.jsx(Io,{path:g,labelX:m,labelY:_,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:d,markerEnd:h,markerStart:E,interactionWidth:y})});ml.displayName="SmoothStepEdge";const Ud=w.memo(e=>{var t;return u.jsx(ml,{...e,pathOptions:w.useMemo(()=>{var n;return{borderRadius:0,offset:(n=e.pathOptions)==null?void 0:n.offset}},[(t=e.pathOptions)==null?void 0:t.offset])})});Ud.displayName="StepEdge";function FO({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[o,i,s,a]=DE({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,o,i,s,a]}const Fd=w.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:d,markerEnd:f,markerStart:p,interactionWidth:h})=>{const[E,v,y]=FO({sourceX:e,sourceY:t,targetX:n,targetY:r});return u.jsx(Io,{path:E,labelX:v,labelY:y,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:c,style:d,markerEnd:f,markerStart:p,interactionWidth:h})});Fd.displayName="StraightEdge";function El(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function FE({pos:e,x1:t,y1:n,x2:r,y2:o,c:i}){switch(e){case K.Left:return[t-El(t-r,i),n];case K.Right:return[t+El(r-t,i),n];case K.Top:return[t,n-El(n-o,i)];case K.Bottom:return[t,n+El(o-n,i)]}}function VE({sourceX:e,sourceY:t,sourcePosition:n=K.Bottom,targetX:r,targetY:o,targetPosition:i=K.Top,curvature:s=.25}){const[a,l]=FE({pos:n,x1:e,y1:t,x2:r,y2:o,c:s}),[c,d]=FE({pos:i,x1:r,y1:o,x2:e,y2:t,c:s}),[f,p,h,E]=kE({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:a,sourceControlY:l,targetControlX:c,targetControlY:d});return[`M${e},${t} C${a},${l} ${c},${d} ${r},${o}`,f,p,h,E]}const vl=w.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:o=K.Bottom,targetPosition:i=K.Top,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:f,style:p,markerEnd:h,markerStart:E,pathOptions:v,interactionWidth:y})=>{const[g,m,_]=VE({sourceX:e,sourceY:t,sourcePosition:o,targetX:n,targetY:r,targetPosition:i,curvature:v==null?void 0:v.curvature});return u.jsx(Io,{path:g,labelX:m,labelY:_,label:s,labelStyle:a,labelShowBg:l,labelBgStyle:c,labelBgPadding:d,labelBgBorderRadius:f,style:p,markerEnd:h,markerStart:E,interactionWidth:y})});vl.displayName="BezierEdge";const Vd=w.createContext(null),VO=Vd.Provider;Vd.Consumer;const $O=()=>w.useContext(Vd),BO=e=>"id"in e&&"source"in e&&"target"in e,$E=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`reactflow__edge-${e}${t||""}-${n}${r||""}`,$d=(e,t)=>typeof e>"u"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`,HO=(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)),BE=(e,t)=>{if(!e.source||!e.target)return t;let n;return BO(e)?n={...e}:n={...e,id:$E(e)},HO(n,t)?t:t.concat(n)},zO=(e,t,n,r={shouldReplaceId:!0})=>{const{id:o,...i}=e;if(!t.source||!t.target||!n.find(l=>l.id===o))return n;const a={...i,id:r.shouldReplaceId?$E(t):o,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle};return n.filter(l=>l.id!==o).concat(a)},HE=({x:e,y:t},[n,r,o],i,[s,a])=>{const l={x:(e-n)/o,y:(t-r)/o};return i?{x:s*Math.round(l.x/s),y:a*Math.round(l.y/a)}:l},WO=({x:e,y:t},[n,r,o])=>({x:e*o+n,y:t*o+r}),bo=(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}},Bd=(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}=bo(o,t).positionAbsolute;return CO(r,kd({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 LO(n)},zE=(e,t,[n,r,o]=[0,0,1],i=!1,s=!1,a=[0,0])=>{const l={x:(t.x-n)/o,y:(t.y-r)/o,width:t.width/o,height:t.height/o},c=[];return e.forEach(d=>{const{width:f,height:p,selectable:h=!0,hidden:E=!1}=d;if(s&&!h||E)return!1;const{positionAbsolute:v}=bo(d,a),y={x:v.x,y:v.y,width:f||0,height:p||0},g=Pd(l,y),m=typeof f>"u"||typeof p>"u"||f===null||p===null,_=i&&g>0,S=(f||0)*(p||0);(m||_||g>=S||d.dragging)&&c.push(d)}),c},WE=(e,t)=>{const n=e.map(r=>r.id);return t.filter(r=>n.includes(r.source)||n.includes(r.target))},GE=(e,t,n,r,o,i=.1)=>{const s=t/(e.width*(1+i)),a=n/(e.height*(1+i)),l=Math.min(s,a),c=Ao(l,r,o),d=e.x+e.width/2,f=e.y+e.height/2,p=t/2-d*c,h=n/2-f*c;return[p,h,c]},br=(e,t=0)=>e.transition().duration(t);function YE(e,t,n,r){return(t[n]||[]).reduce((o,i)=>{var s,a;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:(((a=e.positionAbsolute)==null?void 0:a.y)??0)+i.y+i.height/2}),o},[])}function GO(e,t,n,r,o,i){const{x:s,y:a}=Xn(e),c=t.elementsFromPoint(s,a).find(E=>E.classList.contains("react-flow__handle"));if(c){const E=c.getAttribute("data-nodeid");if(E){const v=Hd(void 0,c),y=c.getAttribute("data-handleid"),g=i({nodeId:E,id:y,type:v});if(g)return{handle:{id:y,type:v,nodeId:E,x:n.x,y:n.y},validHandleResult:g}}}let d=[],f=1/0;if(o.forEach(E=>{const v=Math.sqrt((E.x-n.x)**2+(E.y-n.y)**2);if(v<=r){const y=i(E);v<=f&&(v<f?d=[{handle:E,validHandleResult:y}]:v===f&&d.push({handle:E,validHandleResult:y}),f=v)}}),!d.length)return{handle:null,validHandleResult:KE()};if(d.length===1)return d[0];const p=d.some(({validHandleResult:E})=>E.isValid),h=d.some(({handle:E})=>E.type==="target");return d.find(({handle:E,validHandleResult:v})=>h?E.type==="target":p?v.isValid:!0)||d[0]}const YO={source:null,target:null,sourceHandle:null,targetHandle:null},KE=()=>({handleDomNode:null,isValid:!1,connection:YO,endHandle:null});function QE(e,t,n,r,o,i,s){const a=o==="target",l=s.querySelector(`.react-flow__handle[data-id="${e==null?void 0:e.nodeId}-${e==null?void 0:e.id}-${e==null?void 0:e.type}"]`),c={...KE(),handleDomNode:l};if(l){const d=Hd(void 0,l),f=l.getAttribute("data-nodeid"),p=l.getAttribute("data-handleid"),h=l.classList.contains("connectable"),E=l.classList.contains("connectableend"),v={source:a?f:n,sourceHandle:a?p:r,target:a?n:f,targetHandle:a?r:p};c.connection=v,h&&E&&(t===qn.Strict?a&&d==="source"||!a&&d==="target":f!==n||p!==r)&&(c.endHandle={nodeId:f,handleId:p,type:d},c.isValid=i(v))}return c}function KO({nodes:e,nodeId:t,handleId:n,handleType:r}){return e.reduce((o,i)=>{if(i[Ae]){const{handleBounds:s}=i[Ae];let a=[],l=[];s&&(a=YE(i,s,"source",`${t}-${n}-${r}`),l=YE(i,s,"target",`${t}-${n}-${r}`)),o.push(...a,...l)}return o},[])}function Hd(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function zd(e){e==null||e.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function QO(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function XE({event:e,handleId:t,nodeId:n,onConnect:r,isTarget:o,getState:i,setState:s,isValidConnection:a,edgeUpdaterType:l,onEdgeUpdateEnd:c}){const d=IE(e.target),{connectionMode:f,domNode:p,autoPanOnConnect:h,connectionRadius:E,onConnectStart:v,panBy:y,getNodes:g,cancelConnection:m}=i();let _=0,S;const{x,y:R}=Xn(e),I=d==null?void 0:d.elementFromPoint(x,R),L=Hd(l,I),U=p==null?void 0:p.getBoundingClientRect();if(!U||!L)return;let A,b=Xn(e,U),V=!1,M=null,O=!1,j=null;const P=KO({nodes:g(),nodeId:n,handleId:t,handleType:L}),$=()=>{if(!h)return;const[k,F]=AE(b,U);y({x:k,y:F}),_=requestAnimationFrame($)};s({connectionPosition:b,connectionStatus:null,connectionNodeId:n,connectionHandleId:t,connectionHandleType:L,connectionStartHandle:{nodeId:n,handleId:t,type:L},connectionEndHandle:null}),v==null||v(e,{nodeId:n,handleId:t,handleType:L});function D(k){const{transform:F}=i();b=Xn(k,U);const{handle:B,validHandleResult:z}=GO(k,d,HE(b,F,!1,[1,1]),E,P,W=>QE(W,f,n,t,o?"target":"source",a,d));if(S=B,V||($(),V=!0),j=z.handleDomNode,M=z.connection,O=z.isValid,s({connectionPosition:S&&O?WO({x:S.x,y:S.y},F):b,connectionStatus:QO(!!S,O),connectionEndHandle:z.endHandle}),!S&&!O&&!j)return zd(A);M.source!==M.target&&j&&(zd(A),A=j,j.classList.add("connecting","react-flow__handle-connecting"),j.classList.toggle("valid",O),j.classList.toggle("react-flow__handle-valid",O))}function C(k){var F,B;(S||j)&&M&&O&&(r==null||r(M)),(B=(F=i()).onConnectEnd)==null||B.call(F,k),l&&(c==null||c(k)),zd(A),m(),cancelAnimationFrame(_),V=!1,O=!1,M=null,j=null,d.removeEventListener("mousemove",D),d.removeEventListener("mouseup",C),d.removeEventListener("touchmove",D),d.removeEventListener("touchend",C)}d.addEventListener("mousemove",D),d.addEventListener("mouseup",C),d.addEventListener("touchmove",D),d.addEventListener("touchend",C)}const qE=()=>!0,XO=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),qO=(e,t,n)=>r=>{const{connectionStartHandle:o,connectionEndHandle:i,connectionClickStartHandle:s}=r;return{connecting:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.handleId)===t&&(o==null?void 0:o.type)===n||(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.handleId)===t&&(i==null?void 0:i.type)===n,clickConnecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.handleId)===t&&(s==null?void 0:s.type)===n}},JE=w.forwardRef(({type:e="source",position:t=K.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:o=!0,isConnectableEnd:i=!0,id:s,onConnect:a,children:l,className:c,onMouseDown:d,onTouchStart:f,...p},h)=>{var U,A;const E=s||null,v=e==="target",y=Te(),g=$O(),{connectOnClick:m,noPanClassName:_}=ae(XO,ze),{connecting:S,clickConnecting:x}=ae(qO(g,E,e),ze);g||(A=(U=y.getState()).onError)==null||A.call(U,"010",Nn.error010());const R=b=>{const{defaultEdgeOptions:V,onConnect:M,hasDefaultEdges:O}=y.getState(),j={...V,...b};if(O){const{edges:P,setEdges:$}=y.getState();$(BE(j,P))}M==null||M(j),a==null||a(j)},I=b=>{if(!g)return;const V=LE(b);o&&(V&&b.button===0||!V)&&XE({event:b,handleId:E,nodeId:g,onConnect:R,isTarget:v,getState:y.getState,setState:y.setState,isValidConnection:n||y.getState().isValidConnection||qE}),V?d==null||d(b):f==null||f(b)},L=b=>{const{onClickConnectStart:V,onClickConnectEnd:M,connectionClickStartHandle:O,connectionMode:j,isValidConnection:P}=y.getState();if(!g||!O&&!o)return;if(!O){V==null||V(b,{nodeId:g,handleId:E,handleType:e}),y.setState({connectionClickStartHandle:{nodeId:g,type:e,handleId:E}});return}const $=IE(b.target),D=n||P||qE,{connection:C,isValid:k}=QE({nodeId:g,id:E,type:e},j,O.nodeId,O.handleId||null,O.type,D,$);k&&R(C),M==null||M(b),y.setState({connectionClickStartHandle:null})};return u.jsx("div",{"data-handleid":E,"data-nodeid":g,"data-handlepos":t,"data-id":`${g}-${E}-${e}`,className:qe(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",_,c,{source:!v,target:v,connectable:r,connectablestart:o,connectableend:i,connecting:x,connectionindicator:r&&(o&&!S||i&&S)}]),onMouseDown:I,onTouchStart:I,onClick:m?L:void 0,ref:h,...p,children:l})});JE.displayName="Handle";var Co=w.memo(JE);const ZE=({data:e,isConnectable:t,targetPosition:n=K.Top,sourcePosition:r=K.Bottom})=>u.jsxs(u.Fragment,{children:[u.jsx(Co,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,u.jsx(Co,{type:"source",position:r,isConnectable:t})]});ZE.displayName="DefaultNode";var Wd=w.memo(ZE);const ev=({data:e,isConnectable:t,sourcePosition:n=K.Bottom})=>u.jsxs(u.Fragment,{children:[e==null?void 0:e.label,u.jsx(Co,{type:"source",position:n,isConnectable:t})]});ev.displayName="InputNode";var tv=w.memo(ev);const nv=({data:e,isConnectable:t,targetPosition:n=K.Top})=>u.jsxs(u.Fragment,{children:[u.jsx(Co,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]});nv.displayName="OutputNode";var rv=w.memo(nv);const Gd=()=>null;Gd.displayName="GroupNode";const JO=e=>({selectedNodes:e.getNodes().filter(t=>t.selected),selectedEdges:e.edges.filter(t=>t.selected)}),yl=e=>e.id;function ZO(e,t){return ze(e.selectedNodes.map(yl),t.selectedNodes.map(yl))&&ze(e.selectedEdges.map(yl),t.selectedEdges.map(yl))}const ov=w.memo(({onSelectionChange:e})=>{const t=Te(),{selectedNodes:n,selectedEdges:r}=ae(JO,ZO);return w.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});ov.displayName="SelectionListener";const eT=e=>!!e.onSelectionChange;function tT({onSelectionChange:e}){const t=ae(eT);return e||t?u.jsx(ov,{onSelectionChange:e}):null}const nT=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 Lo(e,t){w.useEffect(()=>{typeof e<"u"&&t(e)},[e])}function Z(e,t,n){w.useEffect(()=>{typeof t<"u"&&n({[e]:t})},[t])}const rT=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:o,onConnectStart:i,onConnectEnd:s,onClickConnectStart:a,onClickConnectEnd:l,nodesDraggable:c,nodesConnectable:d,nodesFocusable:f,edgesFocusable:p,edgesUpdatable:h,elevateNodesOnSelect:E,minZoom:v,maxZoom:y,nodeExtent:g,onNodesChange:m,onEdgesChange:_,elementsSelectable:S,connectionMode:x,snapGrid:R,snapToGrid:I,translateExtent:L,connectOnClick:U,defaultEdgeOptions:A,fitView:b,fitViewOptions:V,onNodesDelete:M,onEdgesDelete:O,onNodeDrag:j,onNodeDragStart:P,onNodeDragStop:$,onSelectionDrag:D,onSelectionDragStart:C,onSelectionDragStop:k,noPanClassName:F,nodeOrigin:B,rfId:z,autoPanOnConnect:W,autoPanOnNodeDrag:X,onError:Q,connectionRadius:J,isValidConnection:re})=>{const{setNodes:pe,setEdges:le,setDefaultNodesAndEdges:we,setMinZoom:et,setMaxZoom:yt,setTranslateExtent:_e,setNodeExtent:me,reset:tt}=ae(nT,ze),q=Te();return w.useEffect(()=>{const lr=r==null?void 0:r.map(Pr=>({...Pr,...A}));return we(n,lr),()=>{tt()}},[]),Z("defaultEdgeOptions",A,q.setState),Z("connectionMode",x,q.setState),Z("onConnect",o,q.setState),Z("onConnectStart",i,q.setState),Z("onConnectEnd",s,q.setState),Z("onClickConnectStart",a,q.setState),Z("onClickConnectEnd",l,q.setState),Z("nodesDraggable",c,q.setState),Z("nodesConnectable",d,q.setState),Z("nodesFocusable",f,q.setState),Z("edgesFocusable",p,q.setState),Z("edgesUpdatable",h,q.setState),Z("elementsSelectable",S,q.setState),Z("elevateNodesOnSelect",E,q.setState),Z("snapToGrid",I,q.setState),Z("snapGrid",R,q.setState),Z("onNodesChange",m,q.setState),Z("onEdgesChange",_,q.setState),Z("connectOnClick",U,q.setState),Z("fitViewOnInit",b,q.setState),Z("fitViewOnInitOptions",V,q.setState),Z("onNodesDelete",M,q.setState),Z("onEdgesDelete",O,q.setState),Z("onNodeDrag",j,q.setState),Z("onNodeDragStart",P,q.setState),Z("onNodeDragStop",$,q.setState),Z("onSelectionDrag",D,q.setState),Z("onSelectionDragStart",C,q.setState),Z("onSelectionDragStop",k,q.setState),Z("noPanClassName",F,q.setState),Z("nodeOrigin",B,q.setState),Z("rfId",z,q.setState),Z("autoPanOnConnect",W,q.setState),Z("autoPanOnNodeDrag",X,q.setState),Z("onError",Q,q.setState),Z("connectionRadius",J,q.setState),Z("isValidConnection",re,q.setState),Lo(e,pe),Lo(t,le),Lo(v,et),Lo(y,yt),Lo(L,_e),Lo(g,me),null},iv={display:"none"},oT={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},sv="react-flow__node-desc",av="react-flow__edge-desc",iT="react-flow__aria-live",sT=e=>e.ariaLiveMessage;function aT({rfId:e}){const t=ae(sT);return u.jsx("div",{id:`${iT}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:oT,children:t})}function lT({rfId:e,disableKeyboardA11y:t}){return u.jsxs(u.Fragment,{children:[u.jsxs("div",{id:`${sv}-${e}`,style:iv,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."," "]}),u.jsx("div",{id:`${av}-${e}`,style:iv,children:"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."}),!t&&u.jsx(aT,{rfId:e})]})}const cT=typeof document<"u"?document:null;var Do=(e=null,t={target:cT})=>{const[n,r]=w.useState(!1),o=w.useRef(!1),i=w.useRef(new Set([])),[s,a]=w.useMemo(()=>{if(e!==null){const c=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.split("+")),d=c.reduce((f,p)=>f.concat(...p),[]);return[c,d]}return[[],[]]},[e]);return w.useEffect(()=>{var l,c;if(e!==null){const d=h=>{if(o.current=h.ctrlKey||h.metaKey||h.shiftKey,!o.current&&Md(h))return!1;const E=cv(h.code,a);i.current.add(h[E]),lv(s,i.current,!1)&&(h.preventDefault(),r(!0))},f=h=>{if(!o.current&&Md(h))return!1;const E=cv(h.code,a);lv(s,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(h[E]),h.key==="Meta"&&i.current.clear(),o.current=!1},p=()=>{i.current.clear(),r(!1)};return(l=t==null?void 0:t.target)==null||l.addEventListener("keydown",d),(c=t==null?void 0:t.target)==null||c.addEventListener("keyup",f),window.addEventListener("blur",p),()=>{var h,E;(h=t==null?void 0:t.target)==null||h.removeEventListener("keydown",d),(E=t==null?void 0:t.target)==null||E.removeEventListener("keyup",f),window.removeEventListener("blur",p)}}},[e,r]),n};function lv(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(o=>t.has(o)))}function cv(e,t){return t.includes(e)?"code":"key"}function uv(e,t,n,r){var s,a;if(!e.parentNode)return n;const o=t.get(e.parentNode),i=bo(o,r);return uv(o,t,{x:(n.x??0)+i.x,y:(n.y??0)+i.y,z:(((s=o[Ae])==null?void 0:s.z)??0)>(n.z??0)?((a=o[Ae])==null?void 0:a.z)??0:n.z??0},r)}function dv(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:a}=uv(r,e,{...r.position,z:((o=r[Ae])==null?void 0:o.z)??0},t);r.positionAbsolute={x:i,y:s},r[Ae].z=a,n!=null&&n[r.id]&&(r[Ae].isParent=!0)}})}function Yd(e,t,n,r){const o=new Map,i={},s=r?1e3:0;return e.forEach(a=>{var f;const l=(Tt(a.zIndex)?a.zIndex:0)+(a.selected?s:0),c=t.get(a.id),d={width:c==null?void 0:c.width,height:c==null?void 0:c.height,...a,positionAbsolute:{x:a.position.x,y:a.position.y}};a.parentNode&&(d.parentNode=a.parentNode,i[a.parentNode]=!0),Object.defineProperty(d,Ae,{enumerable:!1,value:{handleBounds:(f=c==null?void 0:c[Ae])==null?void 0:f.handleBounds,z:l}}),o.set(a.id,d)}),dv(o,n,i),o}function fv(e,t={}){const{getNodes:n,width:r,height:o,minZoom:i,maxZoom:s,d3Zoom:a,d3Selection:l,fitViewOnInitDone:c,fitViewOnInit:d,nodeOrigin:f}=e(),p=t.initial&&!c&&d;if(a&&l&&(p||!t.initial)){const E=n().filter(y=>{var m;const g=t.includeHiddenNodes?y.width&&y.height:!y.hidden;return(m=t.nodes)!=null&&m.length?g&&t.nodes.some(_=>_.id===y.id):g}),v=E.every(y=>y.width&&y.height);if(E.length>0&&v){const y=Bd(E,f),[g,m,_]=GE(y,r,o,t.minZoom??i,t.maxZoom??s,t.padding??.1),S=Qn.translate(g,m).scale(_);return typeof t.duration=="number"&&t.duration>0?a.transform(br(l,t.duration),S):a.transform(l,S),!0}}return!1}function uT(e,t){return e.forEach(n=>{const r=t.get(n.id);r&&t.set(r.id,{...r,[Ae]:r[Ae],selected:n.selected})}),new Map(t)}function dT(e,t){return t.map(n=>{const r=e.find(o=>o.id===n.id);return r&&(n.selected=r.selected),n})}function _l({changedNodes:e,changedEdges:t,get:n,set:r}){const{nodeInternals:o,edges:i,onNodesChange:s,onEdgesChange:a,hasDefaultNodes:l,hasDefaultEdges:c}=n();e!=null&&e.length&&(l&&r({nodeInternals:uT(e,o)}),s==null||s(e)),t!=null&&t.length&&(c&&r({edges:dT(t,i)}),a==null||a(t))}const ko=()=>{},fT={zoomIn:ko,zoomOut:ko,zoomTo:ko,getZoom:()=>1,setViewport:ko,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:ko,fitBounds:ko,project:e=>e,viewportInitialized:!1},pT=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection}),hT=()=>{const e=Te(),{d3Zoom:t,d3Selection:n}=ae(pT,ze);return w.useMemo(()=>n&&t?{zoomIn:o=>t.scaleBy(br(n,o==null?void 0:o.duration),1.2),zoomOut:o=>t.scaleBy(br(n,o==null?void 0:o.duration),1/1.2),zoomTo:(o,i)=>t.scaleTo(br(n,i==null?void 0:i.duration),o),getZoom:()=>e.getState().transform[2],setViewport:(o,i)=>{const[s,a,l]=e.getState().transform,c=Qn.translate(o.x??s,o.y??a).scale(o.zoom??l);t.transform(br(n,i==null?void 0:i.duration),c)},getViewport:()=>{const[o,i,s]=e.getState().transform;return{x:o,y:i,zoom:s}},fitView:o=>fv(e.getState,o),setCenter:(o,i,s)=>{const{width:a,height:l,maxZoom:c}=e.getState(),d=typeof(s==null?void 0:s.zoom)<"u"?s.zoom:c,f=a/2-o*d,p=l/2-i*d,h=Qn.translate(f,p).scale(d);t.transform(br(n,s==null?void 0:s.duration),h)},fitBounds:(o,i)=>{const{width:s,height:a,minZoom:l,maxZoom:c}=e.getState(),[d,f,p]=GE(o,s,a,l,c,(i==null?void 0:i.padding)??.1),h=Qn.translate(d,f).scale(p);t.transform(br(n,i==null?void 0:i.duration),h)},project:o=>{const{transform:i,snapToGrid:s,snapGrid:a}=e.getState();return HE(o,i,s,a)},viewportInitialized:!0}:fT,[t,n])};function Kd(){const e=hT(),t=Te(),n=w.useCallback(()=>t.getState().getNodes().map(v=>({...v})),[]),r=w.useCallback(v=>t.getState().nodeInternals.get(v),[]),o=w.useCallback(()=>{const{edges:v=[]}=t.getState();return v.map(y=>({...y}))},[]),i=w.useCallback(v=>{const{edges:y=[]}=t.getState();return y.find(g=>g.id===v)},[]),s=w.useCallback(v=>{const{getNodes:y,setNodes:g,hasDefaultNodes:m,onNodesChange:_}=t.getState(),S=y(),x=typeof v=="function"?v(S):v;if(m)g(x);else if(_){const R=x.length===0?S.map(I=>({type:"remove",id:I.id})):x.map(I=>({item:I,type:"reset"}));_(R)}},[]),a=w.useCallback(v=>{const{edges:y=[],setEdges:g,hasDefaultEdges:m,onEdgesChange:_}=t.getState(),S=typeof v=="function"?v(y):v;if(m)g(S);else if(_){const x=S.length===0?y.map(R=>({type:"remove",id:R.id})):S.map(R=>({item:R,type:"reset"}));_(x)}},[]),l=w.useCallback(v=>{const y=Array.isArray(v)?v:[v],{getNodes:g,setNodes:m,hasDefaultNodes:_,onNodesChange:S}=t.getState();if(_){const R=[...g(),...y];m(R)}else if(S){const x=y.map(R=>({item:R,type:"add"}));S(x)}},[]),c=w.useCallback(v=>{const y=Array.isArray(v)?v:[v],{edges:g=[],setEdges:m,hasDefaultEdges:_,onEdgesChange:S}=t.getState();if(_)m([...g,...y]);else if(S){const x=y.map(R=>({item:R,type:"add"}));S(x)}},[]),d=w.useCallback(()=>{const{getNodes:v,edges:y=[],transform:g}=t.getState(),[m,_,S]=g;return{nodes:v().map(x=>({...x})),edges:y.map(x=>({...x})),viewport:{x:m,y:_,zoom:S}}},[]),f=w.useCallback(({nodes:v,edges:y})=>{const{nodeInternals:g,getNodes:m,edges:_,hasDefaultNodes:S,hasDefaultEdges:x,onNodesDelete:R,onEdgesDelete:I,onNodesChange:L,onEdgesChange:U}=t.getState(),A=(v||[]).map(j=>j.id),b=(y||[]).map(j=>j.id),V=m().reduce((j,P)=>{const $=!A.includes(P.id)&&P.parentNode&&j.find(C=>C.id===P.parentNode);return(typeof P.deletable=="boolean"?P.deletable:!0)&&(A.includes(P.id)||$)&&j.push(P),j},[]),M=_.filter(j=>typeof j.deletable=="boolean"?j.deletable:!0),O=M.filter(j=>b.includes(j.id));if(V||O){const j=WE(V,M),P=[...O,...j],$=P.reduce((D,C)=>(D.includes(C.id)||D.push(C.id),D),[]);if((x||S)&&(x&&t.setState({edges:_.filter(D=>!$.includes(D.id))}),S&&(V.forEach(D=>{g.delete(D.id)}),t.setState({nodeInternals:new Map(g)}))),$.length>0&&(I==null||I(P),U&&U($.map(D=>({id:D,type:"remove"})))),V.length>0&&(R==null||R(V),L)){const D=V.map(C=>({id:C.id,type:"remove"}));L(D)}}},[]),p=w.useCallback(v=>{const y=DO(v),g=y?null:t.getState().nodeInternals.get(v.id);return[y?v:bE(g),g,y]},[]),h=w.useCallback((v,y=!0,g)=>{const[m,_,S]=p(v);return m?(g||t.getState().getNodes()).filter(x=>{if(!S&&(x.id===_.id||!x.positionAbsolute))return!1;const R=bE(x),I=Pd(R,m);return y&&I>0||I>=v.width*v.height}):[]},[]),E=w.useCallback((v,y,g=!0)=>{const[m]=p(v);if(!m)return!1;const _=Pd(m,y);return g&&_>0||_>=v.width*v.height},[]);return w.useMemo(()=>({...e,getNodes:n,getNode:r,getEdges:o,getEdge:i,setNodes:s,setEdges:a,addNodes:l,addEdges:c,toObject:d,deleteElements:f,getIntersectingNodes:h,isNodeIntersecting:E}),[e,n,r,o,i,s,a,l,c,d,f,h,E])}var gT=({deleteKeyCode:e,multiSelectionKeyCode:t})=>{const n=Te(),{deleteElements:r}=Kd(),o=Do(e),i=Do(t);w.useEffect(()=>{if(o){const{edges:s,getNodes:a}=n.getState(),l=a().filter(d=>d.selected),c=s.filter(d=>d.selected);r({nodes:l,edges:c}),n.setState({nodesSelectionActive:!1})}},[o]),w.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])};function mT(e){const t=Te();w.useEffect(()=>{let n;const r=()=>{var i,s;if(!e.current)return;const o=Ld(e.current);(o.height===0||o.width===0)&&((s=(i=t.getState()).onError)==null||s.call(i,"004",Nn.error004())),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 Qd={position:"absolute",width:"100%",height:"100%",top:0,left:0},ET=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,Sl=e=>({x:e.x,y:e.y,zoom:e.k}),Po=(e,t)=>e.target.closest(`.${t}`),pv=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),hv=e=>{const t=e.ctrlKey&&gl()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t},vT=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),yT=({onMove:e,onMoveStart:t,onMoveEnd:n,onPaneContextMenu:r,zoomOnScroll:o=!0,zoomOnPinch:i=!0,panOnScroll:s=!1,panOnScrollSpeed:a=.5,panOnScrollMode:l=Ir.Free,zoomOnDoubleClick:c=!0,elementsSelectable:d,panOnDrag:f=!0,defaultViewport:p,translateExtent:h,minZoom:E,maxZoom:v,zoomActivationKeyCode:y,preventScrolling:g=!0,children:m,noWheelClassName:_,noPanClassName:S})=>{const x=w.useRef(),R=Te(),I=w.useRef(!1),L=w.useRef(!1),U=w.useRef(null),A=w.useRef({x:0,y:0,zoom:0}),{d3Zoom:b,d3Selection:V,d3ZoomHandler:M,userSelectionActive:O}=ae(vT,ze),j=Do(y),P=w.useRef(0),$=w.useRef(!1),D=w.useRef();return mT(U),w.useEffect(()=>{if(U.current){const C=U.current.getBoundingClientRect(),k=wO().scaleExtent([E,v]).translateExtent(h),F=Vt(U.current).call(k),B=Qn.translate(p.x,p.y).scale(Ao(p.zoom,E,v)),z=[[0,0],[C.width,C.height]],W=k.constrain()(B,z,h);k.transform(F,W),k.wheelDelta(hv),R.setState({d3Zoom:k,d3Selection:F,d3ZoomHandler:F.on("wheel.zoom"),transform:[W.x,W.y,W.k],domNode:U.current.closest(".react-flow")})}},[]),w.useEffect(()=>{V&&b&&(s&&!j&&!O?V.on("wheel.zoom",C=>{if(Po(C,_))return!1;C.preventDefault(),C.stopImmediatePropagation();const k=V.property("__zoom").k||1,F=gl();if(C.ctrlKey&&i&&F){const pe=en(C),le=hv(C),we=k*Math.pow(2,le);b.scaleTo(V,we,pe,C);return}const B=C.deltaMode===1?20:1;let z=l===Ir.Vertical?0:C.deltaX*B,W=l===Ir.Horizontal?0:C.deltaY*B;!F&&C.shiftKey&&l!==Ir.Vertical&&(z=C.deltaY*B,W=0),b.translateBy(V,-(z/k)*a,-(W/k)*a,{internal:!0});const X=Sl(V.property("__zoom")),{onViewportChangeStart:Q,onViewportChange:J,onViewportChangeEnd:re}=R.getState();clearTimeout(D.current),$.current||($.current=!0,t==null||t(C,X),Q==null||Q(X)),$.current&&(e==null||e(C,X),J==null||J(X),D.current=setTimeout(()=>{n==null||n(C,X),re==null||re(X),$.current=!1},150))},{passive:!1}):typeof M<"u"&&V.on("wheel.zoom",function(C,k){if(!g||Po(C,_))return null;C.preventDefault(),M.call(this,C,k)},{passive:!1}))},[O,s,l,V,b,M,j,i,g,_,t,e,n]),w.useEffect(()=>{b&&b.on("start",C=>{var B,z;if(!C.sourceEvent||C.sourceEvent.internal)return null;P.current=(B=C.sourceEvent)==null?void 0:B.button;const{onViewportChangeStart:k}=R.getState(),F=Sl(C.transform);I.current=!0,A.current=F,((z=C.sourceEvent)==null?void 0:z.type)==="mousedown"&&R.setState({paneDragging:!0}),k==null||k(F),t==null||t(C.sourceEvent,F)})},[b,t]),w.useEffect(()=>{b&&(O&&!I.current?b.on("zoom",null):O||b.on("zoom",C=>{var F;const{onViewportChange:k}=R.getState();if(R.setState({transform:[C.transform.x,C.transform.y,C.transform.k]}),L.current=!!(r&&pv(f,P.current??0)),(e||k)&&!((F=C.sourceEvent)!=null&&F.internal)){const B=Sl(C.transform);k==null||k(B),e==null||e(C.sourceEvent,B)}}))},[O,b,e,f,r]),w.useEffect(()=>{b&&b.on("end",C=>{if(!C.sourceEvent||C.sourceEvent.internal)return null;const{onViewportChangeEnd:k}=R.getState();if(I.current=!1,R.setState({paneDragging:!1}),r&&pv(f,P.current??0)&&!L.current&&r(C.sourceEvent),L.current=!1,(n||k)&&ET(A.current,C.transform)){const F=Sl(C.transform);A.current=F,clearTimeout(x.current),x.current=setTimeout(()=>{k==null||k(F),n==null||n(C.sourceEvent,F)},s?150:0)}})},[b,s,f,n,r]),w.useEffect(()=>{b&&b.filter(C=>{const k=j||o,F=i&&C.ctrlKey;if(C.button===1&&C.type==="mousedown"&&(Po(C,"react-flow__node")||Po(C,"react-flow__edge")))return!0;if(!f&&!k&&!s&&!c&&!i||O||!c&&C.type==="dblclick"||Po(C,_)&&C.type==="wheel"||Po(C,S)&&C.type!=="wheel"||!i&&C.ctrlKey&&C.type==="wheel"||!k&&!s&&!F&&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 B=Array.isArray(f)&&f.includes(C.button)||!C.button||C.button<=1;return(!C.ctrlKey||C.type==="wheel")&&B})},[O,b,o,i,s,c,f,d,j]),u.jsx("div",{className:"react-flow__renderer",ref:U,style:Qd,children:m})},_T=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function ST(){const{userSelectionActive:e,userSelectionRect:t}=ae(_T,ze);return e&&t?u.jsx("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 gv(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 mv(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(a=>a.id===o.id);if(i.length===0)return r.push(o),r;const s={...o};for(const a of i)if(a)switch(a.type){case"select":{s.selected=a.selected;break}case"position":{typeof a.position<"u"&&(s.position=a.position),typeof a.positionAbsolute<"u"&&(s.positionAbsolute=a.positionAbsolute),typeof a.dragging<"u"&&(s.dragging=a.dragging),s.expandParent&&gv(r,s);break}case"dimensions":{typeof a.dimensions<"u"&&(s.width=a.dimensions.width,s.height=a.dimensions.height),typeof a.updateStyle<"u"&&(s.style={...s.style||{},...a.dimensions}),typeof a.resizing=="boolean"&&(s.resizing=a.resizing),s.expandParent&&gv(r,s);break}case"remove":return r}return r.push(s),r},n)}function Ev(e,t){return mv(e,t)}function xT(e,t){return mv(e,t)}const Zn=(e,t)=>({id:e,type:"select",selected:t});function Mo(e,t){return e.reduce((n,r)=>{const o=t.includes(r.id);return!r.selected&&o?(r.selected=!0,n.push(Zn(r.id,!0))):r.selected&&!o&&(r.selected=!1,n.push(Zn(r.id,!1))),n},[])}const Xd=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},RT=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),vv=w.memo(({isSelecting:e,selectionMode:t=os.Full,panOnDrag:n,onSelectionStart:r,onSelectionEnd:o,onPaneClick:i,onPaneContextMenu:s,onPaneScroll:a,onPaneMouseEnter:l,onPaneMouseMove:c,onPaneMouseLeave:d,children:f})=>{const p=w.useRef(null),h=Te(),E=w.useRef(0),v=w.useRef(0),y=w.useRef(),{userSelectionActive:g,elementsSelectable:m,dragging:_}=ae(RT,ze),S=()=>{h.setState({userSelectionActive:!1,userSelectionRect:null}),E.current=0,v.current=0},x=M=>{i==null||i(M),h.getState().resetSelectedElements(),h.setState({nodesSelectionActive:!1})},R=M=>{if(Array.isArray(n)&&(n!=null&&n.includes(2))){M.preventDefault();return}s==null||s(M)},I=a?M=>a(M):void 0,L=M=>{const{resetSelectedElements:O,domNode:j}=h.getState();if(y.current=j==null?void 0:j.getBoundingClientRect(),!m||!e||M.button!==0||M.target!==p.current||!y.current)return;const{x:P,y:$}=Xn(M,y.current);O(),h.setState({userSelectionRect:{width:0,height:0,startX:P,startY:$,x:P,y:$}}),r==null||r(M)},U=M=>{const{userSelectionRect:O,nodeInternals:j,edges:P,transform:$,onNodesChange:D,onEdgesChange:C,nodeOrigin:k,getNodes:F}=h.getState();if(!e||!y.current||!O)return;h.setState({userSelectionActive:!0,nodesSelectionActive:!1});const B=Xn(M,y.current),z=O.startX??0,W=O.startY??0,X={...O,x:B.x<z?B.x:z,y:B.y<W?B.y:W,width:Math.abs(B.x-z),height:Math.abs(B.y-W)},Q=F(),J=zE(j,X,$,t===os.Partial,!0,k),re=WE(J,P).map(le=>le.id),pe=J.map(le=>le.id);if(E.current!==pe.length){E.current=pe.length;const le=Mo(Q,pe);le.length&&(D==null||D(le))}if(v.current!==re.length){v.current=re.length;const le=Mo(P,re);le.length&&(C==null||C(le))}h.setState({userSelectionRect:X})},A=M=>{if(M.button!==0)return;const{userSelectionRect:O}=h.getState();!g&&O&&M.target===p.current&&(x==null||x(M)),h.setState({nodesSelectionActive:E.current>0}),S(),o==null||o(M)},b=M=>{g&&(h.setState({nodesSelectionActive:E.current>0}),o==null||o(M)),S()},V=m&&(e||g);return u.jsxs("div",{className:qe(["react-flow__pane",{dragging:_,selection:e}]),onClick:V?void 0:Xd(x,p),onContextMenu:Xd(R,p),onWheel:Xd(I,p),onMouseEnter:V?void 0:l,onMouseDown:V?L:void 0,onMouseMove:V?U:c,onMouseUp:V?A:void 0,onMouseLeave:V?b:d,ref:p,style:Qd,children:[f,u.jsx(ST,{})]})});vv.displayName="Pane";function yv(e,t){if(!e.parentNode)return!1;const n=t.get(e.parentNode);return n?n.selected?!0:yv(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 NT(e,t,n,r){return Array.from(e.values()).filter(o=>(o.selected||o.id===r)&&(!o.parentNode||!yv(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 wT(e,t){return!t||t==="parent"?t:[t[0],[t[1][0]-(e.width||0),t[1][1]-(e.height||0)]]}function Sv(e,t,n,r,o=[0,0],i){const s=wT(e,e.extent||r);let a=s;if(e.extent==="parent")if(e.parentNode&&e.width&&e.height){const d=n.get(e.parentNode),{x:f,y:p}=bo(d,o).positionAbsolute;a=d&&Tt(f)&&Tt(p)&&Tt(d.width)&&Tt(d.height)?[[f+e.width*o[0],p+e.height*o[1]],[f+d.width-e.width+e.width*o[0],p+d.height-e.height+e.height*o[1]]]:a}else i==null||i("005",Nn.error005()),a=s;else if(e.extent&&e.parentNode){const d=n.get(e.parentNode),{x:f,y:p}=bo(d,o).positionAbsolute;a=[[e.extent[0][0]+f,e.extent[0][1]+p],[e.extent[1][0]+f,e.extent[1][1]+p]]}let l={x:0,y:0};if(e.parentNode){const d=n.get(e.parentNode);l=bo(d,o).positionAbsolute}const c=a&&a!=="parent"?Dd(t,a):t;return{position:{x:c.x-l.x,y:c.y-l.y},positionAbsolute:c}}function qd({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 xv=(e,t,n,r)=>{const o=t.querySelectorAll(e);if(!o||!o.length)return null;const i=Array.from(o),s=t.getBoundingClientRect(),a={x:s.width*r[0],y:s.height*r[1]};return i.map(l=>{const c=l.getBoundingClientRect();return{id:l.getAttribute("data-handleid"),position:l.getAttribute("data-handlepos"),x:(c.left-s.left-a.x)/n,y:(c.top-s.top-a.y)/n,...Ld(l)}})};function as(e,t,n){return n===void 0?n:r=>{const o=t().nodeInternals.get(e);o&&n(r,{...o})}}function Jd({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:o,unselectNodesAndEdges:i,multiSelectionActive:s,nodeInternals:a,onError:l}=t.getState(),c=a.get(e);if(!c){l==null||l("012",Nn.error012(e));return}t.setState({nodesSelectionActive:!1}),c.selected?(n||c.selected&&s)&&(i({nodes:[c]}),requestAnimationFrame(()=>{var d;return(d=r==null?void 0:r.current)==null?void 0:d.blur()})):o([e])}function OT(){const e=Te();return w.useCallback(({sourceEvent:n})=>{const{transform:r,snapGrid:o,snapToGrid:i}=e.getState(),s=n.touches?n.touches[0].clientX:n.clientX,a=n.touches?n.touches[0].clientY:n.clientY,l={x:(s-r[0])/r[2],y:(a-r[1])/r[2]};return{xSnapped:i?o[0]*Math.round(l.x/o[0]):l.x,ySnapped:i?o[1]*Math.round(l.y/o[1]):l.y,...l}},[])}function Zd(e){return(t,n,r)=>e==null?void 0:e(t,r)}function Rv({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:o,isSelectable:i,selectNodesOnDrag:s}){const a=Te(),[l,c]=w.useState(!1),d=w.useRef([]),f=w.useRef({x:null,y:null}),p=w.useRef(0),h=w.useRef(null),E=w.useRef({x:0,y:0}),v=w.useRef(null),y=w.useRef(!1),g=OT();return w.useEffect(()=>{if(e!=null&&e.current){const m=Vt(e.current),_=({x,y:R})=>{const{nodeInternals:I,onNodeDrag:L,onSelectionDrag:U,updateNodePositions:A,nodeExtent:b,snapGrid:V,snapToGrid:M,nodeOrigin:O,onError:j}=a.getState();f.current={x,y:R};let P=!1,$={x:0,y:0,x2:0,y2:0};if(d.current.length>1&&b){const C=Bd(d.current,O);$=kd(C)}if(d.current=d.current.map(C=>{const k={x:x-C.distance.x,y:R-C.distance.y};M&&(k.x=V[0]*Math.round(k.x/V[0]),k.y=V[1]*Math.round(k.y/V[1]));const F=[[b[0][0],b[0][1]],[b[1][0],b[1][1]]];d.current.length>1&&b&&!C.extent&&(F[0][0]=C.positionAbsolute.x-$.x+b[0][0],F[1][0]=C.positionAbsolute.x+(C.width??0)-$.x2+b[1][0],F[0][1]=C.positionAbsolute.y-$.y+b[0][1],F[1][1]=C.positionAbsolute.y+(C.height??0)-$.y2+b[1][1]);const B=Sv(C,k,I,F,O,j);return P=P||C.position.x!==B.position.x||C.position.y!==B.position.y,C.position=B.position,C.positionAbsolute=B.positionAbsolute,C}),!P)return;A(d.current,!0,!0),c(!0);const D=o?L:Zd(U);if(D&&v.current){const[C,k]=qd({nodeId:o,dragItems:d.current,nodeInternals:I});D(v.current,C,k)}},S=()=>{if(!h.current)return;const[x,R]=AE(E.current,h.current);if(x!==0||R!==0){const{transform:I,panBy:L}=a.getState();f.current.x=(f.current.x??0)-x/I[2],f.current.y=(f.current.y??0)-R/I[2],L({x,y:R})&&_(f.current)}p.current=requestAnimationFrame(S)};if(t)m.on(".drag",null);else{const x=PN().on("start",R=>{var P;const{nodeInternals:I,multiSelectionActive:L,domNode:U,nodesDraggable:A,unselectNodesAndEdges:b,onNodeDragStart:V,onSelectionDragStart:M}=a.getState(),O=o?V:Zd(M);!s&&!L&&o&&((P=I.get(o))!=null&&P.selected||b()),o&&i&&s&&Jd({id:o,store:a,nodeRef:e});const j=g(R);if(f.current=j,d.current=NT(I,A,j,o),O&&d.current){const[$,D]=qd({nodeId:o,dragItems:d.current,nodeInternals:I});O(R.sourceEvent,$,D)}h.current=(U==null?void 0:U.getBoundingClientRect())||null,E.current=Xn(R.sourceEvent,h.current)}).on("drag",R=>{const I=g(R),{autoPanOnNodeDrag:L}=a.getState();!y.current&&L&&(y.current=!0,S()),(f.current.x!==I.xSnapped||f.current.y!==I.ySnapped)&&d.current&&(v.current=R.sourceEvent,E.current=Xn(R.sourceEvent,h.current),_(I))}).on("end",R=>{if(c(!1),y.current=!1,cancelAnimationFrame(p.current),d.current){const{updateNodePositions:I,nodeInternals:L,onNodeDragStop:U,onSelectionDragStop:A}=a.getState(),b=o?U:Zd(A);if(I(d.current,!1,!1),b){const[V,M]=qd({nodeId:o,dragItems:d.current,nodeInternals:L});b(R.sourceEvent,V,M)}}}).filter(R=>{const I=R.target;return!R.button&&(!n||!_v(I,`.${n}`,e))&&(!r||_v(I,r,e))});return m.call(x),()=>{m.on(".drag",null)}}}},[e,t,n,r,i,a,o,s,g]),l}function Nv(){const e=Te();return w.useCallback(n=>{const{nodeInternals:r,nodeExtent:o,updateNodePositions:i,getNodes:s,snapToGrid:a,snapGrid:l,onError:c,nodesDraggable:d}=e.getState(),f=s().filter(m=>m.selected&&(m.draggable||d&&typeof m.draggable>"u")),p=a?l[0]:5,h=a?l[1]:5,E=n.isShiftPressed?4:1,v=n.x*p*E,y=n.y*h*E,g=f.map(m=>{if(m.positionAbsolute){const _={x:m.positionAbsolute.x+v,y:m.positionAbsolute.y+y};a&&(_.x=l[0]*Math.round(_.x/l[0]),_.y=l[1]*Math.round(_.y/l[1]));const{positionAbsolute:S,position:x}=Sv(m,_,r,o,void 0,c);m.position=x,m.positionAbsolute=S}return m});i(g,!0,!1)},[])}const jo={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var ls=e=>{const t=({id:n,type:r,data:o,xPos:i,yPos:s,xPosOrigin:a,yPosOrigin:l,selected:c,onClick:d,onMouseEnter:f,onMouseMove:p,onMouseLeave:h,onContextMenu:E,onDoubleClick:v,style:y,className:g,isDraggable:m,isSelectable:_,isConnectable:S,isFocusable:x,selectNodesOnDrag:R,sourcePosition:I,targetPosition:L,hidden:U,resizeObserver:A,dragHandle:b,zIndex:V,isParent:M,noDragClassName:O,noPanClassName:j,initialized:P,disableKeyboardA11y:$,ariaLabel:D,rfId:C})=>{const k=Te(),F=w.useRef(null),B=w.useRef(I),z=w.useRef(L),W=w.useRef(r),X=_||m||d||f||p||h,Q=Nv(),J=as(n,k.getState,f),re=as(n,k.getState,p),pe=as(n,k.getState,h),le=as(n,k.getState,E),we=as(n,k.getState,v),et=me=>{if(_&&(!R||!m)&&Jd({id:n,store:k,nodeRef:F}),d){const tt=k.getState().nodeInternals.get(n);tt&&d(me,{...tt})}},yt=me=>{if(!Md(me))if(CE.includes(me.key)&&_){const tt=me.key==="Escape";Jd({id:n,store:k,unselect:tt,nodeRef:F})}else!$&&m&&c&&Object.prototype.hasOwnProperty.call(jo,me.key)&&(k.setState({ariaLiveMessage:`Moved selected node ${me.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~i}, y: ${~~s}`}),Q({x:jo[me.key].x,y:jo[me.key].y,isShiftPressed:me.shiftKey}))};w.useEffect(()=>{if(F.current&&!U){const me=F.current;return A==null||A.observe(me),()=>A==null?void 0:A.unobserve(me)}},[U]),w.useEffect(()=>{const me=W.current!==r,tt=B.current!==I,q=z.current!==L;F.current&&(me||tt||q)&&(me&&(W.current=r),tt&&(B.current=I),q&&(z.current=L),k.getState().updateNodeDimensions([{id:n,nodeElement:F.current,forceUpdate:!0}]))},[n,r,I,L]);const _e=Rv({nodeRef:F,disabled:U||!m,noDragClassName:O,handleSelector:b,nodeId:n,isSelectable:_,selectNodesOnDrag:R});return U?null:u.jsx("div",{className:qe(["react-flow__node",`react-flow__node-${r}`,{[j]:m},g,{selected:c,selectable:_,parent:M,dragging:_e}]),ref:F,style:{zIndex:V,transform:`translate(${a}px,${l}px)`,pointerEvents:X?"all":"none",visibility:P?"visible":"hidden",...y},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:J,onMouseMove:re,onMouseLeave:pe,onContextMenu:le,onClick:et,onDoubleClick:we,onKeyDown:x?yt:void 0,tabIndex:x?0:void 0,role:x?"button":void 0,"aria-describedby":$?void 0:`${sv}-${C}`,"aria-label":D,children:u.jsx(VO,{value:n,children:u.jsx(e,{id:n,data:o,type:r,xPos:i,yPos:s,selected:c,isConnectable:S,sourcePosition:I,targetPosition:L,dragging:_e,dragHandle:b,zIndex:V})})})};return t.displayName="NodeWrapper",w.memo(t)};const TT=e=>{const t=e.getNodes().filter(n=>n.selected);return{...Bd(t,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};function AT({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=Te(),{width:o,height:i,x:s,y:a,transformString:l,userSelectionActive:c}=ae(TT,ze),d=Nv(),f=w.useRef(null);if(w.useEffect(()=>{var E;n||(E=f.current)==null||E.focus({preventScroll:!0})},[n]),Rv({nodeRef:f}),c||!o||!i)return null;const p=e?E=>{const v=r.getState().getNodes().filter(y=>y.selected);e(E,v)}:void 0,h=E=>{Object.prototype.hasOwnProperty.call(jo,E.key)&&d({x:jo[E.key].x,y:jo[E.key].y,isShiftPressed:E.shiftKey})};return u.jsx("div",{className:qe(["react-flow__nodesselection","react-flow__container",t]),style:{transform:l},children:u.jsx("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:a,left:s}})})}var IT=w.memo(AT);const bT=e=>e.nodesSelectionActive,wv=({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:s,deleteKeyCode:a,onMove:l,onMoveStart:c,onMoveEnd:d,selectionKeyCode:f,selectionOnDrag:p,selectionMode:h,onSelectionStart:E,onSelectionEnd:v,multiSelectionKeyCode:y,panActivationKeyCode:g,zoomActivationKeyCode:m,elementsSelectable:_,zoomOnScroll:S,zoomOnPinch:x,panOnScroll:R,panOnScrollSpeed:I,panOnScrollMode:L,zoomOnDoubleClick:U,panOnDrag:A,defaultViewport:b,translateExtent:V,minZoom:M,maxZoom:O,preventScrolling:j,onSelectionContextMenu:P,noWheelClassName:$,noPanClassName:D,disableKeyboardA11y:C})=>{const k=ae(bT),F=Do(f),z=Do(g)||A,W=F||p&&z!==!0;return gT({deleteKeyCode:a,multiSelectionKeyCode:y}),u.jsx(yT,{onMove:l,onMoveStart:c,onMoveEnd:d,onPaneContextMenu:i,elementsSelectable:_,zoomOnScroll:S,zoomOnPinch:x,panOnScroll:R,panOnScrollSpeed:I,panOnScrollMode:L,zoomOnDoubleClick:U,panOnDrag:!F&&z,defaultViewport:b,translateExtent:V,minZoom:M,maxZoom:O,zoomActivationKeyCode:m,preventScrolling:j,noWheelClassName:$,noPanClassName:D,children:u.jsxs(vv,{onSelectionStart:E,onSelectionEnd:v,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:s,panOnDrag:z,isSelecting:!!W,selectionMode:h,children:[e,k&&u.jsx(IT,{onSelectionContextMenu:P,noPanClassName:D,disableKeyboardA11y:C})]})})};wv.displayName="FlowRenderer";var CT=w.memo(wv);function LT(e){return ae(w.useCallback(n=>e?zE(n.nodeInternals,{x:0,y:0,width:n.width,height:n.height},n.transform,!0):n.getNodes(),[e]))}function DT(e){const t={input:ls(e.input||tv),default:ls(e.default||Wd),output:ls(e.output||rv),group:ls(e.group||Gd)},n={},r=Object.keys(e).filter(o=>!["input","default","output","group"].includes(o)).reduce((o,i)=>(o[i]=ls(e[i]||Wd),o),n);return{...t,...r}}const kT=({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]},PT=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),Ov=e=>{const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:o,updateNodeDimensions:i,onError:s}=ae(PT,ze),a=LT(e.onlyRenderVisibleElements),l=w.useRef(),c=w.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const d=new ResizeObserver(f=>{const p=f.map(h=>({id:h.target.getAttribute("data-id"),nodeElement:h.target,forceUpdate:!0}));i(p)});return l.current=d,d},[]);return w.useEffect(()=>()=>{var d;(d=l==null?void 0:l.current)==null||d.disconnect()},[]),u.jsx("div",{className:"react-flow__nodes",style:Qd,children:a.map(d=>{var x,R;let f=d.type||"default";e.nodeTypes[f]||(s==null||s("003",Nn.error003(f)),f="default");const p=e.nodeTypes[f]||e.nodeTypes.default,h=!!(d.draggable||t&&typeof d.draggable>"u"),E=!!(d.selectable||o&&typeof d.selectable>"u"),v=!!(d.connectable||n&&typeof d.connectable>"u"),y=!!(d.focusable||r&&typeof d.focusable>"u"),g=e.nodeExtent?Dd(d.positionAbsolute,e.nodeExtent):d.positionAbsolute,m=(g==null?void 0:g.x)??0,_=(g==null?void 0:g.y)??0,S=kT({x:m,y:_,width:d.width??0,height:d.height??0,origin:e.nodeOrigin});return u.jsx(p,{id:d.id,className:d.className,style:d.style,type:f,data:d.data,sourcePosition:d.sourcePosition||K.Bottom,targetPosition:d.targetPosition||K.Top,hidden:d.hidden,xPos:m,yPos:_,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:!!d.selected,isDraggable:h,isSelectable:E,isConnectable:v,isFocusable:y,resizeObserver:c,dragHandle:d.dragHandle,zIndex:((x=d[Ae])==null?void 0:x.z)??0,isParent:!!((R=d[Ae])!=null&&R.isParent),noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,initialized:!!d.width&&!!d.height,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,ariaLabel:d.ariaLabel},d.id)})})};Ov.displayName="NodeRenderer";var MT=w.memo(Ov);const jT=(e,t,n)=>n===K.Left?e-t:n===K.Right?e+t:e,UT=(e,t,n)=>n===K.Top?e-t:n===K.Bottom?e+t:e,Tv="react-flow__edgeupdater",Av=({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:o,onMouseEnter:i,onMouseOut:s,type:a})=>u.jsx("circle",{onMouseDown:o,onMouseEnter:i,onMouseOut:s,className:qe([Tv,`${Tv}-${a}`]),cx:jT(t,r,e),cy:UT(n,r,e),r,stroke:"transparent",fill:"transparent"}),FT=()=>!0;var Uo=e=>{const t=({id:n,className:r,type:o,data:i,onClick:s,onEdgeDoubleClick:a,selected:l,animated:c,label:d,labelStyle:f,labelShowBg:p,labelBgStyle:h,labelBgPadding:E,labelBgBorderRadius:v,style:y,source:g,target:m,sourceX:_,sourceY:S,targetX:x,targetY:R,sourcePosition:I,targetPosition:L,elementsSelectable:U,hidden:A,sourceHandleId:b,targetHandleId:V,onContextMenu:M,onMouseEnter:O,onMouseMove:j,onMouseLeave:P,edgeUpdaterRadius:$,onEdgeUpdate:D,onEdgeUpdateStart:C,onEdgeUpdateEnd:k,markerEnd:F,markerStart:B,rfId:z,ariaLabel:W,isFocusable:X,isUpdatable:Q,pathOptions:J,interactionWidth:re})=>{const pe=w.useRef(null),[le,we]=w.useState(!1),[et,yt]=w.useState(!1),_e=Te(),me=w.useMemo(()=>`url(#${$d(B,z)})`,[B,z]),tt=w.useMemo(()=>`url(#${$d(F,z)})`,[F,z]);if(A)return null;const q=Ge=>{const{edges:_t,addSelectedEdges:Ur}=_e.getState();if(U&&(_e.setState({nodesSelectionActive:!1}),Ur([n])),s){const Fr=_t.find(Vr=>Vr.id===n);s(Ge,Fr)}},lr=rs(n,_e.getState,a),Pr=rs(n,_e.getState,M),As=rs(n,_e.getState,O),Is=rs(n,_e.getState,j),qo=rs(n,_e.getState,P),Mr=(Ge,_t)=>{if(Ge.button!==0)return;const{edges:Ur,isValidConnection:Fr}=_e.getState(),Vr=_t?m:g,Gl=(_t?V:b)||null,$r=_t?"target":"source",Gf=Fr||FT,Yf=_t,Cs=Ur.find(Br=>Br.id===n);yt(!0),C==null||C(Ge,Cs,$r);const Kf=Br=>{yt(!1),k==null||k(Br,Cs,$r)};XE({event:Ge,handleId:Gl,nodeId:Vr,onConnect:Br=>D==null?void 0:D(Cs,Br),isTarget:Yf,getState:_e.getState,setState:_e.setState,isValidConnection:Gf,edgeUpdaterType:$r,onEdgeUpdateEnd:Kf})},cr=Ge=>Mr(Ge,!0),Jo=Ge=>Mr(Ge,!1),ur=()=>we(!0),jr=()=>we(!1),bs=!U&&!s,Zo=Ge=>{var _t;if(CE.includes(Ge.key)&&U){const{unselectNodesAndEdges:Ur,addSelectedEdges:Fr,edges:Vr}=_e.getState();Ge.key==="Escape"?((_t=pe.current)==null||_t.blur(),Ur({edges:[Vr.find($r=>$r.id===n)]})):Fr([n])}};return u.jsxs("g",{className:qe(["react-flow__edge",`react-flow__edge-${o}`,r,{selected:l,animated:c,inactive:bs,updating:le}]),onClick:q,onDoubleClick:lr,onContextMenu:Pr,onMouseEnter:As,onMouseMove:Is,onMouseLeave:qo,onKeyDown:X?Zo:void 0,tabIndex:X?0:void 0,role:X?"button":"img","data-testid":`rf__edge-${n}`,"aria-label":W===null?void 0:W||`Edge from ${g} to ${m}`,"aria-describedby":X?`${av}-${z}`:void 0,ref:pe,children:[!et&&u.jsx(e,{id:n,source:g,target:m,selected:l,animated:c,label:d,labelStyle:f,labelShowBg:p,labelBgStyle:h,labelBgPadding:E,labelBgBorderRadius:v,data:i,style:y,sourceX:_,sourceY:S,targetX:x,targetY:R,sourcePosition:I,targetPosition:L,sourceHandleId:b,targetHandleId:V,markerStart:me,markerEnd:tt,pathOptions:J,interactionWidth:re}),Q&&u.jsxs(u.Fragment,{children:[(Q==="source"||Q===!0)&&u.jsx(Av,{position:I,centerX:_,centerY:S,radius:$,onMouseDown:cr,onMouseEnter:ur,onMouseOut:jr,type:"source"}),(Q==="target"||Q===!0)&&u.jsx(Av,{position:L,centerX:x,centerY:R,radius:$,onMouseDown:Jo,onMouseEnter:ur,onMouseOut:jr,type:"target"})]})]})};return t.displayName="EdgeWrapper",w.memo(t)};function VT(e){const t={default:Uo(e.default||vl),straight:Uo(e.bezier||Fd),step:Uo(e.step||Ud),smoothstep:Uo(e.step||ml),simplebezier:Uo(e.simplebezier||jd)},n={},r=Object.keys(e).filter(o=>!["default","bezier"].includes(o)).reduce((o,i)=>(o[i]=Uo(e[i]||vl),o),n);return{...t,...r}}function Iv(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 K.Top:return{x:r+i/2,y:o};case K.Right:return{x:r+i,y:o+s/2};case K.Bottom:return{x:r+i/2,y:o+s};case K.Left:return{x:r,y:o+s/2}}}function bv(e,t){return e?e.length===1||!t?e[0]:t&&e.find(n=>n.id===t)||null:null}const $T=(e,t,n,r,o,i)=>{const s=Iv(n,e,t),a=Iv(i,r,o);return{sourceX:s.x,sourceY:s.y,targetX:a.x,targetY:a.y}};function BT({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:r,targetWidth:o,targetHeight:i,width:s,height:a,transform:l}){const c={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)};c.x===c.x2&&(c.x2+=1),c.y===c.y2&&(c.y2+=1);const d=kd({x:(0-l[0])/l[2],y:(0-l[1])/l[2],width:s/l[2],height:a/l[2]}),f=Math.max(0,Math.min(d.x2,c.x2)-Math.max(d.x,c.x)),p=Math.max(0,Math.min(d.y2,c.y2)-Math.max(d.y,c.y));return Math.ceil(f*p)>0}function Cv(e){var r,o,i,s,a;const t=((r=e==null?void 0:e[Ae])==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:((a=e==null?void 0:e.positionAbsolute)==null?void 0:a.y)||0,width:(e==null?void 0:e.width)||0,height:(e==null?void 0:e.height)||0},t,!!n]}const HT=[{level:0,isMaxLevel:!0,edges:[]}];function zT(e,t,n=!1){let r=-1;const o=e.reduce((s,a)=>{var d,f;const l=Tt(a.zIndex);let c=l?a.zIndex:0;if(n){const p=t.get(a.target),h=t.get(a.source),E=a.selected||(p==null?void 0:p.selected)||(h==null?void 0:h.selected),v=Math.max(((d=h==null?void 0:h[Ae])==null?void 0:d.z)||0,((f=p==null?void 0:p[Ae])==null?void 0:f.z)||0,1e3);c=(l?a.zIndex:0)+(E?v:0)}return s[c]?s[c].push(a):s[c]=[a],r=c>r?c:r,s},{}),i=Object.entries(o).map(([s,a])=>{const l=+s;return{edges:a,level:l,isMaxLevel:l===r}});return i.length===0?HT:i}function WT(e,t,n){const r=ae(w.useCallback(o=>e?o.edges.filter(i=>{const s=t.get(i.source),a=t.get(i.target);return(s==null?void 0:s.width)&&(s==null?void 0:s.height)&&(a==null?void 0:a.width)&&(a==null?void 0:a.height)&&BT({sourcePos:s.positionAbsolute||{x:0,y:0},targetPos:a.positionAbsolute||{x:0,y:0},sourceWidth:s.width,sourceHeight:s.height,targetWidth:a.width,targetHeight:a.height,width:o.width,height:o.height,transform:o.transform})}):o.edges,[e,t]));return zT(r,t,n)}const GT=({color:e="none",strokeWidth:t=1})=>u.jsx("polyline",{stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:t,fill:"none",points:"-5,-4 0,0 -5,4"}),YT=({color:e="none",strokeWidth:t=1})=>u.jsx("polyline",{stroke:e,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:t,fill:e,points:"-5,-4 0,0 -5,4 -5,-4"}),Lv={[is.Arrow]:GT,[is.ArrowClosed]:YT};function KT(e){const t=Te();return w.useMemo(()=>{var o,i;return Object.prototype.hasOwnProperty.call(Lv,e)?Lv[e]:((i=(o=t.getState()).onError)==null||i.call(o,"009",Nn.error009(e)),null)},[e])}const QT=({id:e,type:t,color:n,width:r=12.5,height:o=12.5,markerUnits:i="strokeWidth",strokeWidth:s,orient:a="auto-start-reverse"})=>{const l=KT(t);return l?u.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:a,refX:"0",refY:"0",children:u.jsx(l,{color:n,strokeWidth:s})}):null},XT=({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 a=$d(s,t);r.includes(a)||(o.push({id:a,color:s.color||e,...s}),r.push(a))}}),o),[]).sort((o,i)=>o.id.localeCompare(i.id))},Dv=({defaultColor:e,rfId:t})=>{const n=ae(w.useCallback(XT({defaultColor:e,rfId:t}),[e,t]),(r,o)=>!(r.length!==o.length||r.some((i,s)=>i.id!==o[s].id)));return u.jsx("defs",{children:n.map(r=>u.jsx(QT,{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))})};Dv.displayName="MarkerDefinitions";var qT=w.memo(Dv);const JT=e=>({nodesConnectable:e.nodesConnectable,edgesFocusable:e.edgesFocusable,edgesUpdatable:e.edgesUpdatable,elementsSelectable:e.elementsSelectable,width:e.width,height:e.height,connectionMode:e.connectionMode,nodeInternals:e.nodeInternals,onError:e.onError}),kv=({defaultMarkerColor:e,onlyRenderVisibleElements:t,elevateEdgesOnSelect:n,rfId:r,edgeTypes:o,noPanClassName:i,onEdgeUpdate:s,onEdgeContextMenu:a,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:d,onEdgeClick:f,edgeUpdaterRadius:p,onEdgeDoubleClick:h,onEdgeUpdateStart:E,onEdgeUpdateEnd:v,children:y})=>{const{edgesFocusable:g,edgesUpdatable:m,elementsSelectable:_,width:S,height:x,connectionMode:R,nodeInternals:I,onError:L}=ae(JT,ze),U=WT(t,I,n);return S?u.jsxs(u.Fragment,{children:[U.map(({level:A,edges:b,isMaxLevel:V})=>u.jsxs("svg",{style:{zIndex:A},width:S,height:x,className:"react-flow__edges react-flow__container",children:[V&&u.jsx(qT,{defaultColor:e,rfId:r}),u.jsx("g",{children:b.map(M=>{const[O,j,P]=Cv(I.get(M.source)),[$,D,C]=Cv(I.get(M.target));if(!P||!C)return null;let k=M.type||"default";o[k]||(L==null||L("011",Nn.error011(k)),k="default");const F=o[k]||o.default,B=R===qn.Strict?D.target:(D.target??[]).concat(D.source??[]),z=bv(j.source,M.sourceHandle),W=bv(B,M.targetHandle),X=(z==null?void 0:z.position)||K.Bottom,Q=(W==null?void 0:W.position)||K.Top,J=!!(M.focusable||g&&typeof M.focusable>"u"),re=typeof s<"u"&&(M.updatable||m&&typeof M.updatable>"u");if(!z||!W)return L==null||L("008",Nn.error008(z,M)),null;const{sourceX:pe,sourceY:le,targetX:we,targetY:et}=$T(O,z,X,$,W,Q);return u.jsx(F,{id:M.id,className:qe([M.className,i]),type:k,data:M.data,selected:!!M.selected,animated:!!M.animated,hidden:!!M.hidden,label:M.label,labelStyle:M.labelStyle,labelShowBg:M.labelShowBg,labelBgStyle:M.labelBgStyle,labelBgPadding:M.labelBgPadding,labelBgBorderRadius:M.labelBgBorderRadius,style:M.style,source:M.source,target:M.target,sourceHandleId:M.sourceHandle,targetHandleId:M.targetHandle,markerEnd:M.markerEnd,markerStart:M.markerStart,sourceX:pe,sourceY:le,targetX:we,targetY:et,sourcePosition:X,targetPosition:Q,elementsSelectable:_,onEdgeUpdate:s,onContextMenu:a,onMouseEnter:l,onMouseMove:c,onMouseLeave:d,onClick:f,edgeUpdaterRadius:p,onEdgeDoubleClick:h,onEdgeUpdateStart:E,onEdgeUpdateEnd:v,rfId:r,ariaLabel:M.ariaLabel,isFocusable:J,isUpdatable:re,pathOptions:"pathOptions"in M?M.pathOptions:void 0,interactionWidth:M.interactionWidth},M.id)})})]},A)),y]}):null};kv.displayName="EdgeRenderer";var ZT=w.memo(kv);const eA=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function tA({children:e}){const t=ae(eA);return u.jsx("div",{className:"react-flow__viewport react-flow__container",style:{transform:t},children:e})}function nA(e){const t=Kd(),n=w.useRef(!1);w.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const rA={[K.Left]:K.Right,[K.Right]:K.Left,[K.Top]:K.Bottom,[K.Bottom]:K.Top},Pv=({nodeId:e,handleType:t,style:n,type:r=Jn.Bezier,CustomComponent:o,connectionStatus:i})=>{var R,I,L;const{fromNode:s,handleId:a,toX:l,toY:c,connectionMode:d}=ae(w.useCallback(U=>({fromNode:U.nodeInternals.get(e),handleId:U.connectionHandleId,toX:(U.connectionPosition.x-U.transform[0])/U.transform[2],toY:(U.connectionPosition.y-U.transform[1])/U.transform[2],connectionMode:U.connectionMode}),[e]),ze),f=(R=s==null?void 0:s[Ae])==null?void 0:R.handleBounds;let p=f==null?void 0:f[t];if(d===qn.Loose&&(p=p||(f==null?void 0:f[t==="source"?"target":"source"])),!s||!p)return null;const h=a?p.find(U=>U.id===a):p[0],E=h?h.x+h.width/2:(s.width??0)/2,v=h?h.y+h.height/2:s.height??0,y=(((I=s.positionAbsolute)==null?void 0:I.x)??0)+E,g=(((L=s.positionAbsolute)==null?void 0:L.y)??0)+v,m=h==null?void 0:h.position,_=m?rA[m]:null;if(!m||!_)return null;if(o)return u.jsx(o,{connectionLineType:r,connectionLineStyle:n,fromNode:s,fromHandle:h,fromX:y,fromY:g,toX:l,toY:c,fromPosition:m,toPosition:_,connectionStatus:i});let S="";const x={sourceX:y,sourceY:g,sourcePosition:m,targetX:l,targetY:c,targetPosition:_};return r===Jn.Bezier?[S]=VE(x):r===Jn.Step?[S]=ss({...x,borderRadius:0}):r===Jn.SmoothStep?[S]=ss(x):r===Jn.SimpleBezier?[S]=ME(x):S=`M${y},${g} ${l},${c}`,u.jsx("path",{d:S,fill:"none",className:"react-flow__connection-path",style:n})};Pv.displayName="ConnectionLine";const oA=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function iA({containerStyle:e,style:t,type:n,component:r}){const{nodeId:o,handleType:i,nodesConnectable:s,width:a,height:l,connectionStatus:c}=ae(oA,ze);return!(o&&i&&a&&s)?null:u.jsx("svg",{style:e,width:a,height:l,className:"react-flow__edges react-flow__connectionline react-flow__container",children:u.jsx("g",{className:qe(["react-flow__connection",c]),children:u.jsx(Pv,{nodeId:o,handleType:i,style:t,type:n,CustomComponent:r,connectionStatus:c})})})}function Mv(e,t){return w.useRef(null),Te(),w.useMemo(()=>t(e),[e])}const jv=({nodeTypes:e,edgeTypes:t,onMove:n,onMoveStart:r,onMoveEnd:o,onInit:i,onNodeClick:s,onEdgeClick:a,onNodeDoubleClick:l,onEdgeDoubleClick:c,onNodeMouseEnter:d,onNodeMouseMove:f,onNodeMouseLeave:p,onNodeContextMenu:h,onSelectionContextMenu:E,onSelectionStart:v,onSelectionEnd:y,connectionLineType:g,connectionLineStyle:m,connectionLineComponent:_,connectionLineContainerStyle:S,selectionKeyCode:x,selectionOnDrag:R,selectionMode:I,multiSelectionKeyCode:L,panActivationKeyCode:U,zoomActivationKeyCode:A,deleteKeyCode:b,onlyRenderVisibleElements:V,elementsSelectable:M,selectNodesOnDrag:O,defaultViewport:j,translateExtent:P,minZoom:$,maxZoom:D,preventScrolling:C,defaultMarkerColor:k,zoomOnScroll:F,zoomOnPinch:B,panOnScroll:z,panOnScrollSpeed:W,panOnScrollMode:X,zoomOnDoubleClick:Q,panOnDrag:J,onPaneClick:re,onPaneMouseEnter:pe,onPaneMouseMove:le,onPaneMouseLeave:we,onPaneScroll:et,onPaneContextMenu:yt,onEdgeUpdate:_e,onEdgeContextMenu:me,onEdgeMouseEnter:tt,onEdgeMouseMove:q,onEdgeMouseLeave:lr,edgeUpdaterRadius:Pr,onEdgeUpdateStart:As,onEdgeUpdateEnd:Is,noDragClassName:qo,noWheelClassName:Mr,noPanClassName:cr,elevateEdgesOnSelect:Jo,disableKeyboardA11y:ur,nodeOrigin:jr,nodeExtent:bs,rfId:Zo})=>{const Ge=Mv(e,DT),_t=Mv(t,VT);return nA(i),u.jsx(CT,{onPaneClick:re,onPaneMouseEnter:pe,onPaneMouseMove:le,onPaneMouseLeave:we,onPaneContextMenu:yt,onPaneScroll:et,deleteKeyCode:b,selectionKeyCode:x,selectionOnDrag:R,selectionMode:I,onSelectionStart:v,onSelectionEnd:y,multiSelectionKeyCode:L,panActivationKeyCode:U,zoomActivationKeyCode:A,elementsSelectable:M,onMove:n,onMoveStart:r,onMoveEnd:o,zoomOnScroll:F,zoomOnPinch:B,zoomOnDoubleClick:Q,panOnScroll:z,panOnScrollSpeed:W,panOnScrollMode:X,panOnDrag:J,defaultViewport:j,translateExtent:P,minZoom:$,maxZoom:D,onSelectionContextMenu:E,preventScrolling:C,noDragClassName:qo,noWheelClassName:Mr,noPanClassName:cr,disableKeyboardA11y:ur,children:u.jsxs(tA,{children:[u.jsx(ZT,{edgeTypes:_t,onEdgeClick:a,onEdgeDoubleClick:c,onEdgeUpdate:_e,onlyRenderVisibleElements:V,onEdgeContextMenu:me,onEdgeMouseEnter:tt,onEdgeMouseMove:q,onEdgeMouseLeave:lr,onEdgeUpdateStart:As,onEdgeUpdateEnd:Is,edgeUpdaterRadius:Pr,defaultMarkerColor:k,noPanClassName:cr,elevateEdgesOnSelect:!!Jo,disableKeyboardA11y:ur,rfId:Zo,children:u.jsx(iA,{style:m,type:g,component:_,containerStyle:S})}),u.jsx("div",{className:"react-flow__edgelabel-renderer"}),u.jsx(MT,{nodeTypes:Ge,onNodeClick:s,onNodeDoubleClick:l,onNodeMouseEnter:d,onNodeMouseMove:f,onNodeMouseLeave:p,onNodeContextMenu:h,selectNodesOnDrag:O,onlyRenderVisibleElements:V,noPanClassName:cr,noDragClassName:qo,disableKeyboardA11y:ur,nodeOrigin:jr,nodeExtent:bs,rfId:Zo})]})})};jv.displayName="GraphView";var sA=w.memo(jv);const ef=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],er={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:ef,nodeExtent:ef,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:qn.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:kO,isValidConnection:void 0},aA=()=>Y1((e,t)=>({...er,setNodes:n=>{const{nodeInternals:r,nodeOrigin:o,elevateNodesOnSelect:i}=t();e({nodeInternals:Yd(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?Yd(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:a,domNode:l,nodeOrigin:c}=t(),d=l==null?void 0:l.querySelector(".react-flow__viewport");if(!d)return;const f=window.getComputedStyle(d),{m22:p}=new window.DOMMatrixReadOnly(f.transform),h=n.reduce((v,y)=>{const g=o.get(y.id);if(g){const m=Ld(y.nodeElement);!!(m.width&&m.height&&(g.width!==m.width||g.height!==m.height||y.forceUpdate))&&(o.set(g.id,{...g,[Ae]:{...g[Ae],handleBounds:{source:xv(".source",y.nodeElement,p,c),target:xv(".target",y.nodeElement,p,c)}},...m}),v.push({id:g.id,type:"dimensions",dimensions:m}))}return v},[]);dv(o,c);const E=s||i&&!s&&fv(t,{initial:!0,...a});e({nodeInternals:new Map(o),fitViewOnInitDone:E}),(h==null?void 0:h.length)>0&&(r==null||r(h))},updateNodePositions:(n,r=!0,o=!1)=>{const{triggerNodeChanges:i}=t(),s=n.map(a=>{const l={id:a.id,type:"position",dragging:o};return r&&(l.positionAbsolute=a.positionAbsolute,l.position=a.position),l});i(s)},triggerNodeChanges:n=>{const{onNodesChange:r,nodeInternals:o,hasDefaultNodes:i,nodeOrigin:s,getNodes:a,elevateNodesOnSelect:l}=t();if(n!=null&&n.length){if(i){const c=Ev(n,a()),d=Yd(c,o,s,l);e({nodeInternals:d})}r==null||r(n)}},addSelectedNodes:n=>{const{multiSelectionActive:r,edges:o,getNodes:i}=t();let s,a=null;r?s=n.map(l=>Zn(l,!0)):(s=Mo(i(),n),a=Mo(o,[])),_l({changedNodes:s,changedEdges:a,get:t,set:e})},addSelectedEdges:n=>{const{multiSelectionActive:r,edges:o,getNodes:i}=t();let s,a=null;r?s=n.map(l=>Zn(l,!0)):(s=Mo(o,n),a=Mo(i(),[])),_l({changedNodes:a,changedEdges:s,get:t,set:e})},unselectNodesAndEdges:({nodes:n,edges:r}={})=>{const{edges:o,getNodes:i}=t(),s=n||i(),a=r||o,l=s.map(d=>(d.selected=!1,Zn(d.id,!1))),c=a.map(d=>Zn(d.id,!1));_l({changedNodes:l,changedEdges:c,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(a=>a.selected).map(a=>Zn(a.id,!1)),s=n.filter(a=>a.selected).map(a=>Zn(a.id,!1));_l({changedNodes:i,changedEdges:s,get:t,set:e})},setNodeExtent:n=>{const{nodeInternals:r}=t();r.forEach(o=>{o.positionAbsolute=Dd(o.position,n)}),e({nodeExtent:n,nodeInternals:new Map(r)})},panBy:n=>{const{transform:r,width:o,height:i,d3Zoom:s,d3Selection:a,translateExtent:l}=t();if(!s||!a||!n.x&&!n.y)return!1;const c=Qn.translate(r[0]+n.x,r[1]+n.y).scale(r[2]),d=[[0,0],[o,i]],f=s==null?void 0:s.constrain()(c,d,l);return s.transform(a,f),r[0]!==f.x||r[1]!==f.y||r[2]!==f.k},cancelConnection:()=>e({connectionNodeId:er.connectionNodeId,connectionHandleId:er.connectionHandleId,connectionHandleType:er.connectionHandleType,connectionStatus:er.connectionStatus,connectionStartHandle:er.connectionStartHandle,connectionEndHandle:er.connectionEndHandle}),reset:()=>e({...er})}),Object.is),tf=({children:e})=>{const t=w.useRef(null);return t.current||(t.current=aA()),u.jsx(OO,{value:t.current,children:e})};tf.displayName="ReactFlowProvider";const Uv=({children:e})=>w.useContext(hl)?u.jsx(u.Fragment,{children:e}):u.jsx(tf,{children:e});Uv.displayName="ReactFlowWrapper";const lA={input:tv,default:Wd,output:rv,group:Gd},cA={default:vl,straight:Fd,step:Ud,smoothstep:ml,simplebezier:jd},uA=[0,0],dA=[15,15],fA={x:0,y:0,zoom:1},pA={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},Fv=w.forwardRef(({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:o,nodeTypes:i=lA,edgeTypes:s=cA,onNodeClick:a,onEdgeClick:l,onInit:c,onMove:d,onMoveStart:f,onMoveEnd:p,onConnect:h,onConnectStart:E,onConnectEnd:v,onClickConnectStart:y,onClickConnectEnd:g,onNodeMouseEnter:m,onNodeMouseMove:_,onNodeMouseLeave:S,onNodeContextMenu:x,onNodeDoubleClick:R,onNodeDragStart:I,onNodeDrag:L,onNodeDragStop:U,onNodesDelete:A,onEdgesDelete:b,onSelectionChange:V,onSelectionDragStart:M,onSelectionDrag:O,onSelectionDragStop:j,onSelectionContextMenu:P,onSelectionStart:$,onSelectionEnd:D,connectionMode:C=qn.Strict,connectionLineType:k=Jn.Bezier,connectionLineStyle:F,connectionLineComponent:B,connectionLineContainerStyle:z,deleteKeyCode:W="Backspace",selectionKeyCode:X="Shift",selectionOnDrag:Q=!1,selectionMode:J=os.Full,panActivationKeyCode:re="Space",multiSelectionKeyCode:pe=gl()?"Meta":"Control",zoomActivationKeyCode:le=gl()?"Meta":"Control",snapToGrid:we=!1,snapGrid:et=dA,onlyRenderVisibleElements:yt=!1,selectNodesOnDrag:_e=!0,nodesDraggable:me,nodesConnectable:tt,nodesFocusable:q,nodeOrigin:lr=uA,edgesFocusable:Pr,edgesUpdatable:As,elementsSelectable:Is,defaultViewport:qo=fA,minZoom:Mr=.5,maxZoom:cr=2,translateExtent:Jo=ef,preventScrolling:ur=!0,nodeExtent:jr,defaultMarkerColor:bs="#b1b1b7",zoomOnScroll:Zo=!0,zoomOnPinch:Ge=!0,panOnScroll:_t=!1,panOnScrollSpeed:Ur=.5,panOnScrollMode:Fr=Ir.Free,zoomOnDoubleClick:Vr=!0,panOnDrag:Gl=!0,onPaneClick:$r,onPaneMouseEnter:Gf,onPaneMouseMove:Yf,onPaneMouseLeave:Cs,onPaneScroll:Kf,onPaneContextMenu:m_,children:Br,onEdgeUpdate:r3,onEdgeContextMenu:o3,onEdgeDoubleClick:i3,onEdgeMouseEnter:s3,onEdgeMouseMove:a3,onEdgeMouseLeave:l3,onEdgeUpdateStart:c3,onEdgeUpdateEnd:u3,edgeUpdaterRadius:d3=10,onNodesChange:f3,onEdgesChange:p3,noDragClassName:h3="nodrag",noWheelClassName:g3="nowheel",noPanClassName:E_="nopan",fitView:m3=!1,fitViewOptions:E3,connectOnClick:v3=!0,attributionPosition:y3,proOptions:_3,defaultEdgeOptions:S3,elevateNodesOnSelect:x3=!0,elevateEdgesOnSelect:R3=!1,disableKeyboardA11y:v_=!1,autoPanOnConnect:N3=!0,autoPanOnNodeDrag:w3=!0,connectionRadius:O3=20,isValidConnection:T3,onError:A3,style:I3,id:y_,...b3},C3)=>{const Qf=y_||"1";return u.jsx("div",{...b3,style:{...I3,...pA},ref:C3,className:qe(["react-flow",o]),"data-testid":"rf__wrapper",id:y_,children:u.jsxs(Uv,{children:[u.jsx(sA,{onInit:c,onMove:d,onMoveStart:f,onMoveEnd:p,onNodeClick:a,onEdgeClick:l,onNodeMouseEnter:m,onNodeMouseMove:_,onNodeMouseLeave:S,onNodeContextMenu:x,onNodeDoubleClick:R,nodeTypes:i,edgeTypes:s,connectionLineType:k,connectionLineStyle:F,connectionLineComponent:B,connectionLineContainerStyle:z,selectionKeyCode:X,selectionOnDrag:Q,selectionMode:J,deleteKeyCode:W,multiSelectionKeyCode:pe,panActivationKeyCode:re,zoomActivationKeyCode:le,onlyRenderVisibleElements:yt,selectNodesOnDrag:_e,defaultViewport:qo,translateExtent:Jo,minZoom:Mr,maxZoom:cr,preventScrolling:ur,zoomOnScroll:Zo,zoomOnPinch:Ge,zoomOnDoubleClick:Vr,panOnScroll:_t,panOnScrollSpeed:Ur,panOnScrollMode:Fr,panOnDrag:Gl,onPaneClick:$r,onPaneMouseEnter:Gf,onPaneMouseMove:Yf,onPaneMouseLeave:Cs,onPaneScroll:Kf,onPaneContextMenu:m_,onSelectionContextMenu:P,onSelectionStart:$,onSelectionEnd:D,onEdgeUpdate:r3,onEdgeContextMenu:o3,onEdgeDoubleClick:i3,onEdgeMouseEnter:s3,onEdgeMouseMove:a3,onEdgeMouseLeave:l3,onEdgeUpdateStart:c3,onEdgeUpdateEnd:u3,edgeUpdaterRadius:d3,defaultMarkerColor:bs,noDragClassName:h3,noWheelClassName:g3,noPanClassName:E_,elevateEdgesOnSelect:R3,rfId:Qf,disableKeyboardA11y:v_,nodeOrigin:lr,nodeExtent:jr}),u.jsx(rT,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:h,onConnectStart:E,onConnectEnd:v,onClickConnectStart:y,onClickConnectEnd:g,nodesDraggable:me,nodesConnectable:tt,nodesFocusable:q,edgesFocusable:Pr,edgesUpdatable:As,elementsSelectable:Is,elevateNodesOnSelect:x3,minZoom:Mr,maxZoom:cr,nodeExtent:jr,onNodesChange:f3,onEdgesChange:p3,snapToGrid:we,snapGrid:et,connectionMode:C,translateExtent:Jo,connectOnClick:v3,defaultEdgeOptions:S3,fitView:m3,fitViewOptions:E3,onNodesDelete:A,onEdgesDelete:b,onNodeDragStart:I,onNodeDrag:L,onNodeDragStop:U,onSelectionDrag:O,onSelectionDragStart:M,onSelectionDragStop:j,noPanClassName:E_,nodeOrigin:lr,rfId:Qf,autoPanOnConnect:N3,autoPanOnNodeDrag:w3,onError:A3,connectionRadius:O3,isValidConnection:T3}),u.jsx(tT,{onSelectionChange:V}),Br,u.jsx(AO,{proOptions:_3,position:y3}),u.jsx(lT,{rfId:Qf,disableKeyboardA11y:v_})]})})});Fv.displayName="ReactFlow";const hA=e=>{var t;return(t=e.domNode)==null?void 0:t.querySelector(".react-flow__edgelabel-renderer")};function gA({children:e}){const t=ae(hA);return t?xo.createPortal(e,t):null}function mA(){const e=Te();return w.useCallback(t=>{const{domNode:n,updateNodeDimensions:r}=e.getState(),i=(Array.isArray(t)?t:[t]).reduce((s,a)=>{const l=n==null?void 0:n.querySelector(`.react-flow__node[data-id="${a}"]`);return l&&s.push({id:a,nodeElement:l,forceUpdate:!0}),s},[]);requestAnimationFrame(()=>r(i))},[])}function EA({onStart:e,onChange:t,onEnd:n}){const r=Te();w.useEffect(()=>{r.setState({onViewportChangeStart:e})},[e]),w.useEffect(()=>{r.setState({onViewportChange:t})},[t]),w.useEffect(()=>{r.setState({onViewportChangeEnd:n})},[n])}const vA=e=>t=>t.nodeInternals.size===0?!1:t.getNodes().filter(n=>e.includeHiddenNodes?!0:!n.hidden).every(n=>{var r;return((r=n[Ae])==null?void 0:r.handleBounds)!==void 0}),yA={includeHiddenNodes:!1};function _A(e=yA){return ae(vA(e))}function SA(){return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:u.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function xA(){return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:u.jsx("path",{d:"M0 0h32v4.2H0z"})})}function RA(){return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:u.jsx("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 NA(){return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:u.jsx("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 wA(){return u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:u.jsx("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 cs=({children:e,className:t,...n})=>u.jsx("button",{type:"button",className:qe(["react-flow__controls-button",t]),...n,children:e});cs.displayName="ControlButton";const OA=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom}),Vv=({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:o,onZoomIn:i,onZoomOut:s,onFitView:a,onInteractiveChange:l,className:c,children:d,position:f="bottom-left"})=>{const p=Te(),[h,E]=w.useState(!1),{isInteractive:v,minZoomReached:y,maxZoomReached:g}=ae(OA,ze),{zoomIn:m,zoomOut:_,fitView:S}=Kd();if(w.useEffect(()=>{E(!0)},[]),!h)return null;const x=()=>{m(),i==null||i()},R=()=>{_(),s==null||s()},I=()=>{S(o),a==null||a()},L=()=>{p.setState({nodesDraggable:!v,nodesConnectable:!v,elementsSelectable:!v}),l==null||l(!v)};return u.jsxs(ns,{className:qe(["react-flow__controls",c]),position:f,style:e,"data-testid":"rf__controls",children:[t&&u.jsxs(u.Fragment,{children:[u.jsx(cs,{onClick:x,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:g,children:u.jsx(SA,{})}),u.jsx(cs,{onClick:R,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:y,children:u.jsx(xA,{})})]}),n&&u.jsx(cs,{className:"react-flow__controls-fitview",onClick:I,title:"fit view","aria-label":"fit view",children:u.jsx(RA,{})}),r&&u.jsx(cs,{className:"react-flow__controls-interactive",onClick:L,title:"toggle interactivity","aria-label":"toggle interactivity",children:v?u.jsx(wA,{}):u.jsx(NA,{})}),d]})};Vv.displayName="Controls";var TA=w.memo(Vv),At;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(At||(At={}));function AA({color:e,dimensions:t,lineWidth:n}){return u.jsx("path",{stroke:e,strokeWidth:n,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`})}function IA({color:e,radius:t}){return u.jsx("circle",{cx:t,cy:t,r:t,fill:e})}const bA={[At.Dots]:"#91919a",[At.Lines]:"#eee",[At.Cross]:"#e2e2e2"},CA={[At.Dots]:1,[At.Lines]:1,[At.Cross]:6},LA=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function $v({id:e,variant:t=At.Dots,gap:n=20,size:r,lineWidth:o=1,offset:i=2,color:s,style:a,className:l}){const c=w.useRef(null),{transform:d,patternId:f}=ae(LA,ze),p=s||bA[t],h=r||CA[t],E=t===At.Dots,v=t===At.Cross,y=Array.isArray(n)?n:[n,n],g=[y[0]*d[2]||1,y[1]*d[2]||1],m=h*d[2],_=v?[m,m]:g,S=E?[m/i,m/i]:[_[0]/i,_[1]/i];return u.jsxs("svg",{className:qe(["react-flow__background",l]),style:{...a,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:c,"data-testid":"rf__background",children:[u.jsx("pattern",{id:f+e,x:d[0]%g[0],y:d[1]%g[1],width:g[0],height:g[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${S[0]},-${S[1]})`,children:E?u.jsx(IA,{color:p,radius:m/i}):u.jsx(AA,{dimensions:_,color:p,lineWidth:o})}),u.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${f+e})`})]})}$v.displayName="Background";var DA=w.memo($v);const{useSyncExternalStoreWithSelector:kA}=bm;let L3=!1;function PA(e,t=e.getState,n){const r=kA(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return w.useDebugValue(r),r}const Bv=e=>{const t=typeof e=="function"?Lm(e):e,n=(r,o)=>PA(t,r,o);return Object.assign(n,t),n},us=e=>e?Bv(e):Bv,MA=!1,jA={}.VITE_IS_STAGING,UA=(()=>jA?"staging":"prod")(),FA="0.0.11",ds="0.0.9",Hv=230,VA=640,zv=20,Fo={markerEnd:{height:20,type:is.ArrowClosed,width:20},style:{stroke:"inherit",strokeWidth:1.5},type:"floating"},$A="422",BA="404",Wv="document-sync",nf=1e3,HA=1e3,zA=300,WA=5e3,GA="Shift+Backspace",YA="Meta",KA="Shift",xl=25,rf={duration:nf,includeHiddenNodes:!1,padding:.3},Gv=()=>{const e={},t=document.querySelector('meta[name="csrf-token"]');return t&&(e["X-CSRF-Token"]=t==null?void 0:t.content),e},QA=(e,t)=>{var i;const n=new Blob([JSON.stringify({edges:t,nodes:e},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)},Yv=e=>({...e,...Fo}),Kv=e=>e.type==="handleCall"?{...e,deletable:!1}:e,Qv=e=>e==="success"?"positive":"negative",XA=e=>e.toLowerCase().replace(/ /g,"-"),It=e=>typeof e=="string"?e.trim():e,qA=(e,t,n)=>e.sort((r,o)=>{const i=n?r[n]:r,s=n?o[n]:o;if(typeof i=="string"&&typeof s=="string")return t==="asc"?i.toLowerCase().localeCompare(s.toLowerCase()):s.toLowerCase().localeCompare(i.toLowerCase());if(typeof i=="number"&&typeof s=="number")return t==="asc"?i-s:s-i;throw new Error(`sort fn can only sort strings & numbers, but got ${typeof i} and ${typeof s}`)}),JA=e=>{try{return new URL(e).pathname.split("/").at(-1)}catch{return""}};function Xv(e,t){const n=[{divisor:1,threshold:60,unit:"second"},{divisor:60,threshold:3600,unit:"minute"},{divisor:3600,threshold:86400,unit:"hour"},{divisor:86400,threshold:86400,unit:"day"}],r=new Intl.RelativeTimeFormat(e,{numeric:"always",...t});return function(i,s={}){const{excludeUnits:a={}}=s,l=new Date().getTime(),c=new Date(i).getTime(),d=Math.floor((l-c)/1e3),f=n.filter(({unit:v})=>!a[v]),{divisor:p,unit:h}=f.find(({threshold:v})=>Math.abs(d)<v)??f[f.length-1],E=Math.floor(d/p);return r.format(-E,h)}}function qv(e){return new Promise(t=>setTimeout(t,e))}const of=()=>({callOrder:"single",callStateEvents:"",callStateUrl:"",connections:[{connectFrom:"",connectTimeout:"",connectTo:"",id:ie()}],defaultFrom:"",defaultTimeout:"",destinationType:"phone",options:[{id:ie(),result:"success"},{id:ie(),result:"noAnswer"},{id:ie(),result:"busy"},{id:ie(),result:"decline"},{id:ie(),result:"error"}]}),Jv={aiAgent:()=>({agent:""}),answer:()=>({valid:!0}),cond:()=>({fallback:ie(),options:[{id:ie(),value:""}]}),condRequest:()=>({body:"",error:ie(),fallback:ie(),headers:"",method:"POST",options:[{id:ie(),value:""}],url:""}),executeSWML:()=>({dest:"",fallback:ie(),meta:"",options:[{id:ie(),value:""}],params:""}),forwardAddress:()=>({...of(),destinationType:"address"}),forwardPhone:()=>({...of(),destinationType:"phone"}),forwardResource:()=>({...of(),destinationType:"resource"}),handleCall:()=>({valid:!0}),hangup:()=>({valid:!0}),play:()=>({selected:"",text:"",url:""}),promptPlay:()=>({digitTimeout:"",initialTimeout:"",options:[{command:"",digit:"",id:ie()}],results:[{id:ie(),result:"no_match"},{id:ie(),result:"no_input"}],selected:"",text:"",url:""}),record:()=>({beep:!1,endSilenceTimeout:"",format:"wav",initialTimeout:"",maxLength:"",stereo:!1,terminators:"",valid:!0}),recordCallStart:()=>({beep:!1,controlId:ie(),format:"wav",label:"",stereo:!1,terminators:""}),recordCallStop:()=>({controlId:""}),request:()=>({body:"",headers:"",method:"POST",options:[{id:ie(),result:"success"},{id:ie(),result:"failed"}],url:""}),sendSms:()=>({body:"",fromNumber:"",media:[],region:"",tags:[],toNumber:""}),set:()=>({variables:[{duplicate:!1,id:ie(),key:"",value:""}]}),unset:()=>({variables:[]})};function We(e){"@babel/helpers - typeof";return We=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},We(e)}function bt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ZA(e,t){if(We(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(We(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Zv(e){var t=ZA(e,"string");return We(t)==="symbol"?t:String(t)}function ey(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 Ct(e,t,n){return t&&ey(e.prototype,t),n&&ey(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function tr(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function sf(e,t){return sf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},sf(e,t)}function Rl(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&&sf(e,t)}function fs(e,t){if(t&&(We(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return tr(e)}function rn(e){return rn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},rn(e)}function Ht(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 eI(e){if(Array.isArray(e))return e}function tI(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ty(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 nI(e,t){if(e){if(typeof e=="string")return ty(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 ty(e,t)}}function rI(){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 oI(e){return eI(e)||tI(e)||nI(e)||rI()}function ny(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 ry(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ny(Object(n),!0).forEach(function(r){Ht(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ny(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var iI={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)}},sI=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};bt(this,e),this.init(t,n)}return Ct(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||iI,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,ry(ry({},{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}(),on=new sI,nr=function(){function e(){bt(this,e),this.observers={}}return Ct(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(l){l.apply(void 0,o)})}if(this.observers["*"]){var a=[].concat(this.observers["*"]);a.forEach(function(l){l.apply(l,[n].concat(o))})}}}]),e}();function ps(){var e,t,n=new Promise(function(r,o){e=r,t=o});return n.resolve=e,n.reject=t,n}function oy(e){return e==null?"":""+e}function aI(e,t,n){e.forEach(function(r){t[r]&&(n[r]=t[r])})}function af(e,t,n){function r(a){return a&&a.indexOf("###")>-1?a.replace(/###/g,"."):a}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 iy(e,t,n){var r=af(e,t,Object),o=r.obj,i=r.k;o[i]=n}function lI(e,t,n,r){var o=af(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 Nl(e,t){var n=af(e,t),r=n.obj,o=n.k;if(r)return r[o]}function sy(e,t,n){var r=Nl(e,n);return r!==void 0?r:Nl(t,n)}function ay(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]):ay(e[r],t[r],n):e[r]=t[r]);return e}function Vo(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var cI={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function uI(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,function(t){return cI[t]}):e}var wl=typeof window<"u"&&window.navigator&&typeof window.navigator.userAgentData>"u"&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,dI=[" ",",","?","!",";"];function fI(e,t,n){t=t||"",n=n||"";var r=dI.filter(function(a){return t.indexOf(a)<0&&n.indexOf(a)<0});if(r.length===0)return!0;var o=new RegExp("(".concat(r.map(function(a){return a==="?"?"\\?":a}).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 Ol(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){Ht(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 pI(e){var t=hI();return function(){var r=rn(e),o;if(t){var i=rn(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return fs(this,o)}}function hI(){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 cy(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,a=r.slice(i,i+s).join(n),l=o[a];l===void 0&&r.length>i+s;)s++,a=r.slice(i,i+s).join(n),l=o[a];if(l===void 0)return;if(l===null)return null;if(t.endsWith(a)){if(typeof l=="string")return l;if(a&&typeof l[a]=="string")return l[a]}var c=r.slice(i+s).join(n);return c?cy(l,c,n):void 0}o=o[r[i]]}return o}}var gI=function(e){Rl(n,e);var t=pI(n);function n(r){var o,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return bt(this,n),o=t.call(this),wl&&nr.call(tr(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 Ct(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 a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},l=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,c=a.ignoreJSONStructure!==void 0?a.ignoreJSONStructure:this.options.ignoreJSONStructure,d=[o,i];s&&typeof s!="string"&&(d=d.concat(s)),s&&typeof s=="string"&&(d=d.concat(l?s.split(l):s)),o.indexOf(".")>-1&&(d=o.split("."));var f=Nl(this.data,d);return f||!c||typeof s!="string"?f:cy(this.data&&this.data[o]&&this.data[o][i],s,l)}},{key:"addResource",value:function(o,i,s,a){var l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},c=this.options.keySeparator;c===void 0&&(c=".");var d=[o,i];s&&(d=d.concat(c?s.split(c):s)),o.indexOf(".")>-1&&(d=o.split("."),a=i,i=d[1]),this.addNamespaces(i),iy(this.data,d,a),l.silent||this.emit("added",o,i,s,a)}},{key:"addResources",value:function(o,i,s){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var l in s)(typeof s[l]=="string"||Object.prototype.toString.apply(s[l])==="[object Array]")&&this.addResource(o,i,l,s[l],{silent:!0});a.silent||this.emit("added",o,i,s)}},{key:"addResourceBundle",value:function(o,i,s,a,l){var c=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},d=[o,i];o.indexOf(".")>-1&&(d=o.split("."),a=s,s=i,i=d[1]),this.addNamespaces(i);var f=Nl(this.data,d)||{};a?ay(f,s,l):f=Ol(Ol({},f),s),iy(this.data,d,f),c.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"?Ol(Ol({},{}),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(a){return i[a]&&Object.keys(i[a]).length>0})}},{key:"toJSON",value:function(){return this.data}}]),n}(nr),uy={processors:{},addPostProcessor:function(t){this.processors[t.name]=t},handle:function(t,n,r,o,i){var s=this;return t.forEach(function(a){s.processors[a]&&(n=s.processors[a].process(n,r,o,i))}),n}};function dy(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 Je(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?dy(Object(n),!0).forEach(function(r){Ht(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dy(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mI(e){var t=EI();return function(){var r=rn(e),o;if(t){var i=rn(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return fs(this,o)}}function EI(){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={},py=function(e){Rl(n,e);var t=mI(n);function n(r){var o,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return bt(this,n),o=t.call(this),wl&&nr.call(tr(o)),aI(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],r,tr(o)),o.options=i,o.options.keySeparator===void 0&&(o.options.keySeparator="."),o.logger=on.create("translator"),o}return Ct(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 a=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,l=i.ns||this.options.defaultNS||[],c=s&&o.indexOf(s)>-1,d=!this.options.userDefinedKeySeparator&&!i.keySeparator&&!this.options.userDefinedNsSeparator&&!i.nsSeparator&&!fI(o,s,a);if(c&&!d){var f=o.match(this.interpolator.nestingRegexp);if(f&&f.length>0)return{key:o,namespaces:l};var p=o.split(s);(s!==a||s===a&&this.options.ns.indexOf(p[0])>-1)&&(l=p.shift()),o=p.join(a)}return typeof l=="string"&&(l=[l]),{key:o,namespaces:l}}},{key:"translate",value:function(o,i,s){var a=this;if(We(i)!=="object"&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),i||(i={}),o==null)return"";Array.isArray(o)||(o=[String(o)]);var l=i.returnDetails!==void 0?i.returnDetails:this.options.returnDetails,c=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,d=this.extractFromKey(o[o.length-1],i),f=d.key,p=d.namespaces,h=p[p.length-1],E=i.lng||this.language,v=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(E&&E.toLowerCase()==="cimode"){if(v){var y=i.nsSeparator||this.options.nsSeparator;return l?{res:"".concat(h).concat(y).concat(f),usedKey:f,exactUsedKey:f,usedLng:E,usedNS:h}:"".concat(h).concat(y).concat(f)}return l?{res:f,usedKey:f,exactUsedKey:f,usedLng:E,usedNS:h}:f}var g=this.resolve(o,i),m=g&&g.res,_=g&&g.usedKey||f,S=g&&g.exactUsedKey||f,x=Object.prototype.toString.apply(m),R=["[object Number]","[object Function]","[object RegExp]"],I=i.joinArrays!==void 0?i.joinArrays:this.options.joinArrays,L=!this.i18nFormat||this.i18nFormat.handleAsObject,U=typeof m!="string"&&typeof m!="boolean"&&typeof m!="number";if(L&&m&&U&&R.indexOf(x)<0&&!(typeof I=="string"&&x==="[object Array]")){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var A=this.options.returnedObjectHandler?this.options.returnedObjectHandler(_,m,Je(Je({},i),{},{ns:p})):"key '".concat(f," (").concat(this.language,")' returned an object instead of string.");return l?(g.res=A,g):A}if(c){var b=x==="[object Array]",V=b?[]:{},M=b?S:_;for(var O in m)if(Object.prototype.hasOwnProperty.call(m,O)){var j="".concat(M).concat(c).concat(O);V[O]=this.translate(j,Je(Je({},i),{joinArrays:!1,ns:p})),V[O]===j&&(V[O]=m[O])}m=V}}else if(L&&typeof I=="string"&&x==="[object Array]")m=m.join(I),m&&(m=this.extendTranslation(m,o,i,s));else{var P=!1,$=!1,D=i.count!==void 0&&typeof i.count!="string",C=n.hasDefaultValue(i),k=D?this.pluralResolver.getSuffix(E,i.count,i):"",F=i["defaultValue".concat(k)]||i.defaultValue;!this.isValidLookup(m)&&C&&(P=!0,m=F),this.isValidLookup(m)||($=!0,m=f);var B=i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,z=B&&$?void 0:m,W=C&&F!==m&&this.options.updateMissing;if($||P||W){if(this.logger.log(W?"updateKey":"missingKey",E,h,f,W?F:m),c){var X=this.resolve(f,Je(Je({},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 re=0;re<J.length;re++)Q.push(J[re]);else this.options.saveMissingTo==="all"?Q=this.languageUtils.toResolveHierarchy(i.lng||this.language):Q.push(i.lng||this.language);var pe=function(we,et,yt){var _e=C&&yt!==m?yt:z;a.options.missingKeyHandler?a.options.missingKeyHandler(we,h,et,_e,W,i):a.backendConnector&&a.backendConnector.saveMissing&&a.backendConnector.saveMissing(we,h,et,_e,W,i),a.emit("missingKey",we,h,et,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&D?Q.forEach(function(le){a.pluralResolver.getSuffixes(le,i).forEach(function(we){pe([le],f+we,i["defaultValue".concat(we)]||F)})}):pe(Q,f,F))}m=this.extendTranslation(m,o,i,g,s),$&&m===f&&this.options.appendNamespaceToMissingKey&&(m="".concat(h,":").concat(f)),($||P)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(h,":").concat(f):f,P?m:void 0):m=this.options.parseMissingKeyHandler(m))}return l?(g.res=m,g):m}},{key:"extendTranslation",value:function(o,i,s,a,l){var c=this;if(this.i18nFormat&&this.i18nFormat.parse)o=this.i18nFormat.parse(o,Je(Je({},this.options.interpolation.defaultVariables),s),a.usedLng,a.usedNS,a.usedKey,{resolved:a});else if(!s.skipInterpolation){s.interpolation&&this.interpolator.init(Je(Je({},s),{interpolation:Je(Je({},this.options.interpolation),s.interpolation)}));var d=typeof o=="string"&&(s&&s.interpolation&&s.interpolation.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables),f;if(d){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=Je(Je({},this.options.interpolation.defaultVariables),h)),o=this.interpolator.interpolate(o,h,s.lng||this.language,s),d){var E=o.match(this.interpolator.nestingRegexp),v=E&&E.length;f<v&&(s.nest=!1)}s.nest!==!1&&(o=this.interpolator.nest(o,function(){for(var m=arguments.length,_=new Array(m),S=0;S<m;S++)_[S]=arguments[S];return l&&l[0]===_[0]&&!s.context?(c.logger.warn("It seems you are nesting recursively key: ".concat(_[0]," in key: ").concat(i[0])),null):c.translate.apply(c,_.concat([i]))},s)),s.interpolation&&this.interpolator.reset()}var y=s.postProcess||this.options.postProcess,g=typeof y=="string"?[y]:y;return o!=null&&g&&g.length&&s.applyPostProcessor!==!1&&(o=uy.handle(g,o,i,this.options&&this.options.postProcessPassResolved?Je({i18nResolved:a},s):s,this)),o}},{key:"resolve",value:function(o){var i=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a,l,c,d,f;return typeof o=="string"&&(o=[o]),o.forEach(function(p){if(!i.isValidLookup(a)){var h=i.extractFromKey(p,s),E=h.key;l=E;var v=h.namespaces;i.options.fallbackNS&&(v=v.concat(i.options.fallbackNS));var y=s.count!==void 0&&typeof s.count!="string",g=y&&!s.ordinal&&s.count===0&&i.pluralResolver.shouldUseIntlApi(),m=s.context!==void 0&&(typeof s.context=="string"||typeof s.context=="number")&&s.context!=="",_=s.lngs?s.lngs:i.languageUtils.toResolveHierarchy(s.lng||i.language,s.fallbackLng);v.forEach(function(S){i.isValidLookup(a)||(f=S,!fy["".concat(_[0],"-").concat(S)]&&i.utils&&i.utils.hasLoadedNamespace&&!i.utils.hasLoadedNamespace(f)&&(fy["".concat(_[0],"-").concat(S)]=!0,i.logger.warn('key "'.concat(l,'" for languages "').concat(_.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!!!")),_.forEach(function(x){if(!i.isValidLookup(a)){d=x;var R=[E];if(i.i18nFormat&&i.i18nFormat.addLookupKeys)i.i18nFormat.addLookupKeys(R,E,x,S,s);else{var I;y&&(I=i.pluralResolver.getSuffix(x,s.count,s));var L="".concat(i.options.pluralSeparator,"zero");if(y&&(R.push(E+I),g&&R.push(E+L)),m){var U="".concat(E).concat(i.options.contextSeparator).concat(s.context);R.push(U),y&&(R.push(U+I),g&&R.push(U+L))}}for(var A;A=R.pop();)i.isValidLookup(a)||(c=A,a=i.getResource(x,S,A,s))}}))})}}),{res:a,usedKey:l,exactUsedKey:c,usedLng:d,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 a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(o,i,s,a):this.resourceStore.getResource(o,i,s,a)}}],[{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}(nr);function lf(e){return e.charAt(0).toUpperCase()+e.slice(1)}var hy=function(){function e(t){bt(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=on.create("languageUtils")}return Ct(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]=lf(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]=lf(o[1].toLowerCase())),r.indexOf(o[2].toLowerCase())>-1&&(o[2]=lf(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(a){if(a.indexOf(s)===0)return a})}}),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=[],a=function(c){c&&(o.isSupportedCode(c)?s.push(c):o.logger.warn("rejecting language code not found in supportedLngs: ".concat(c)))};return typeof n=="string"&&n.indexOf("-")>-1?(this.options.load!=="languageOnly"&&a(this.formatLanguageCode(n)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&a(this.getScriptPartFromCode(n)),this.options.load!=="currentOnly"&&a(this.getLanguagePartFromCode(n))):typeof n=="string"&&a(this.formatLanguageCode(n)),i.forEach(function(l){s.indexOf(l)<0&&a(o.formatLanguageCode(l))}),s}}]),e}(),vI=[{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}],yI={1:function(t){return+(t>1)},2:function(t){return+(t!=1)},3:function(t){return 0},4:function(t){return 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 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 t==1?0:t>=2&&t<=4?1:2},7:function(t){return t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2},8:function(t){return t==1?0:t==2?1:t!=8&&t!=11?2:3},9:function(t){return+(t>=2)},10:function(t){return t==1?0:t==2?1:t<7?2:t<11?3:4},11:function(t){return t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3},12:function(t){return+(t%10!=1||t%100==11)},13:function(t){return+(t!==0)},14:function(t){return t==1?0:t==2?1:t==3?2:3},15:function(t){return t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2},16:function(t){return t%10==1&&t%100!=11?0:t!==0?1:2},17:function(t){return t==1||t%10==1&&t%100!=11?0:1},18:function(t){return t==0?0:t==1?1:2},19:function(t){return t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3},20:function(t){return t==1?0:t==0||t%100>0&&t%100<20?1:2},21:function(t){return t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0},22:function(t){return t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3}},_I=["v1","v2","v3"],gy={zero:0,one:1,two:2,few:3,many:4,other:5};function SI(){var e={};return vI.forEach(function(t){t.lngs.forEach(function(n){e[n]={numbers:t.nr,plurals:yI[t.fc]}})}),e}var xI=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};bt(this,e),this.languageUtils=t,this.options=n,this.logger=on.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=SI()}return Ct(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,a){return gy[s]-gy[a]}).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 a=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()):a():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1?a():this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString()}},{key:"shouldUseIntlApi",value:function(){return!_I.includes(this.options.compatibilityJSON)}}]),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 zt(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){Ht(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}var RI=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};bt(this,e),this.logger=on.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(n){return n},this.init(t)}return Ct(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:uI,this.escapeValue=r.escapeValue!==void 0?r.escapeValue:!0,this.useRawValueToEscape=r.useRawValueToEscape!==void 0?r.useRawValueToEscape:!1,this.prefix=r.prefix?Vo(r.prefix):r.prefixEscaped||"{{",this.suffix=r.suffix?Vo(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?Vo(r.nestingPrefix):r.nestingPrefixEscaped||Vo("$t("),this.nestingSuffix=r.nestingSuffix?Vo(r.nestingSuffix):r.nestingSuffixEscaped||Vo(")"),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,a,l,c,d=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function f(y){return y.replace(/\$/g,"$$$$")}var p=function(g){if(g.indexOf(s.formatSeparator)<0){var m=sy(r,d,g);return s.alwaysFormat?s.format(m,void 0,o,zt(zt(zt({},i),r),{},{interpolationkey:g})):m}var _=g.split(s.formatSeparator),S=_.shift().trim(),x=_.join(s.formatSeparator).trim();return s.format(sy(r,d,S),x,o,zt(zt(zt({},i),r),{},{interpolationkey:S}))};this.resetRegExp();var h=i&&i.missingInterpolationHandler||this.options.missingInterpolationHandler,E=i&&i.interpolation&&i.interpolation.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,v=[{regex:this.regexpUnescape,safeValue:function(g){return f(g)}},{regex:this.regexp,safeValue:function(g){return s.escapeValue?f(s.escape(g)):f(g)}}];return v.forEach(function(y){for(c=0;a=y.regex.exec(n);){var g=a[1].trim();if(l=p(g),l===void 0)if(typeof h=="function"){var m=h(n,a,i);l=typeof m=="string"?m:""}else if(i&&Object.prototype.hasOwnProperty.call(i,g))l="";else if(E){l=a[0];continue}else s.logger.warn("missed to pass in variable ".concat(g," for interpolating ").concat(n)),l="";else typeof l!="string"&&!s.useRawValueToEscape&&(l=oy(l));var _=y.safeValue(l);if(n=n.replace(a[0],_),E?(y.regex.lastIndex+=l.length,y.regex.lastIndex-=a[0].length):y.regex.lastIndex=0,c++,c>=s.maxReplaces)break}}),n}},{key:"nest",value:function(n,r){var o=this,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s,a,l;function c(h,E){var v=this.nestingOptionsSeparator;if(h.indexOf(v)<0)return h;var y=h.split(new RegExp("".concat(v,"[ ]*{"))),g="{".concat(y[1]);h=y[0],g=this.interpolate(g,l);var m=g.match(/'/g),_=g.match(/"/g);(m&&m.length%2===0&&!_||_.length%2!==0)&&(g=g.replace(/'/g,'"'));try{l=JSON.parse(g),E&&(l=zt(zt({},E),l))}catch(S){return this.logger.warn("failed parsing options string in nesting for key ".concat(h),S),"".concat(h).concat(v).concat(g)}return delete l.defaultValue,h}for(;s=this.nestingRegexp.exec(n);){var d=[];l=zt({},i),l=l.replace&&typeof l.replace!="string"?l.replace:l,l.applyPostProcessor=!1,delete l.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(),d=p,f=!0}if(a=r(c.call(this,s[1].trim(),l),l),a&&s[0]===n&&typeof a!="string")return a;typeof a!="string"&&(a=oy(a)),a||(this.logger.warn("missed to resolve ".concat(s[1]," for nesting ").concat(n)),a=""),f&&(a=d.reduce(function(h,E){return o.format(h,E,i.lng,zt(zt({},i),{},{interpolationkey:s[1].trim()}))},a.trim())),n=n.replace(s[0],a),this.regexp.lastIndex=0}return n}}]),e}();function Ey(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 wn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ey(Object(n),!0).forEach(function(r){Ht(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ey(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function NI(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 a=s.split(":"),l=oI(a),c=l[0],d=l.slice(1),f=d.join(":").trim().replace(/^'+|'+$/g,"");n[c.trim()]||(n[c.trim()]=f),f==="false"&&(n[c.trim()]=!1),f==="true"&&(n[c.trim()]=!0),isNaN(f)||(n[c.trim()]=parseInt(f,10))}})}}return{formatName:t,formatOptions:n}}function $o(e){var t={};return function(r,o,i){var s=o+JSON.stringify(i),a=t[s];return a||(a=e(o,i),t[s]=a),a(r)}}var wI=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};bt(this,e),this.logger=on.create("formatter"),this.options=t,this.formats={number:$o(function(n,r){var o=new Intl.NumberFormat(n,wn({},r));return function(i){return o.format(i)}}),currency:$o(function(n,r){var o=new Intl.NumberFormat(n,wn(wn({},r),{},{style:"currency"}));return function(i){return o.format(i)}}),datetime:$o(function(n,r){var o=new Intl.DateTimeFormat(n,wn({},r));return function(i){return o.format(i)}}),relativetime:$o(function(n,r){var o=new Intl.RelativeTimeFormat(n,wn({},r));return function(i){return o.format(i,r.range||"day")}}),list:$o(function(n,r){var o=new Intl.ListFormat(n,wn({},r));return function(i){return o.format(i)}})},this.init(t)}return Ct(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()]=$o(r)}},{key:"format",value:function(n,r,o){var i=this,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},a=r.split(this.formatSeparator),l=a.reduce(function(c,d){var f=NI(d),p=f.formatName,h=f.formatOptions;if(i.formats[p]){var E=c;try{var v=s&&s.formatParams&&s.formatParams[s.interpolationkey]||{},y=v.locale||v.lng||s.locale||s.lng||o;E=i.formats[p](c,y,wn(wn(wn({},h),s),v))}catch(g){i.logger.warn(g)}return E}else i.logger.warn("there was no format function for ".concat(p));return c},n);return l}}]),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){Ht(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 OI(e){var t=TI();return function(){var r=rn(e),o;if(t){var i=rn(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return fs(this,o)}}function TI(){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 AI(e,t){e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)}var II=function(e){Rl(n,e);var t=OI(n);function n(r,o,i){var s,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return bt(this,n),s=t.call(this),wl&&nr.call(tr(s)),s.backend=r,s.store=o,s.services=i,s.languageUtils=i.languageUtils,s.options=a,s.logger=on.create("backendConnector"),s.waitingReads=[],s.maxParallelReads=a.maxParallelReads||10,s.readingCalls=0,s.maxRetries=a.maxRetries>=0?a.maxRetries:5,s.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,s.state={},s.queue=[],s.backend&&s.backend.init&&s.backend.init(i,a.backend,a),s}return Ct(n,[{key:"queueLoad",value:function(o,i,s,a){var l=this,c={},d={},f={},p={};return o.forEach(function(h){var E=!0;i.forEach(function(v){var y="".concat(h,"|").concat(v);!s.reload&&l.store.hasResourceBundle(h,v)?l.state[y]=2:l.state[y]<0||(l.state[y]===1?d[y]===void 0&&(d[y]=!0):(l.state[y]=1,E=!1,d[y]===void 0&&(d[y]=!0),c[y]===void 0&&(c[y]=!0),p[v]===void 0&&(p[v]=!0)))}),E||(f[h]=!0)}),(Object.keys(c).length||Object.keys(d).length)&&this.queue.push({pending:d,pendingCount:Object.keys(d).length,loaded:{},errors:[],callback:a}),{toLoad:Object.keys(c),pending:Object.keys(d),toLoadLanguages:Object.keys(f),toLoadNamespaces:Object.keys(p)}}},{key:"loaded",value:function(o,i,s){var a=o.split("|"),l=a[0],c=a[1];i&&this.emit("failedLoading",l,c,i),s&&this.store.addResourceBundle(l,c,s),this.state[o]=i?-1:2;var d={};this.queue.forEach(function(f){lI(f.loaded,[l],c),AI(f,o),i&&f.errors.push(i),f.pendingCount===0&&!f.done&&(Object.keys(f.loaded).forEach(function(p){d[p]||(d[p]={});var h=f.loaded[p];h.length&&h.forEach(function(E){d[p][E]===void 0&&(d[p][E]=!0)})}),f.done=!0,f.errors.length?f.callback(f.errors):f.callback())}),this.emit("loaded",d),this.queue=this.queue.filter(function(f){return!f.done})}},{key:"read",value:function(o,i,s){var a=this,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,c=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,d=arguments.length>5?arguments[5]:void 0;if(!o.length)return d(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:o,ns:i,fcName:s,tried:l,wait:c,callback:d});return}this.readingCalls++;var f=function(v,y){if(a.readingCalls--,a.waitingReads.length>0){var g=a.waitingReads.shift();a.read(g.lng,g.ns,g.fcName,g.tried,g.wait,g.callback)}if(v&&y&&l<a.maxRetries){setTimeout(function(){a.read.call(a,o,i,s,l+1,c*2,d)},c);return}d(v,y)},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(E){return f(null,E)}).catch(f):f(null,h)}catch(E){f(E)}return}return p(o,i,f)}},{key:"prepareLoading",value:function(o,i){var s=this,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},l=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."),l&&l();typeof o=="string"&&(o=this.languageUtils.toResolveHierarchy(o)),typeof i=="string"&&(i=[i]);var c=this.queueLoad(o,i,a,l);if(!c.toLoad.length)return c.pending.length||l(),null;c.toLoad.forEach(function(d){s.loadOne(d)})}},{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]:"",a=o.split("|"),l=a[0],c=a[1];this.read(l,c,"read",void 0,void 0,function(d,f){d&&i.logger.warn("".concat(s,"loading namespace ").concat(c," for language ").concat(l," failed"),d),!d&&f&&i.logger.log("".concat(s,"loaded namespace ").concat(c," for language ").concat(l),f),i.loaded(o,d,f)})}},{key:"saveMissing",value:function(o,i,s,a,l){var c=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},d=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({},c),{},{isUpdate:l}),p=this.backend.create.bind(this.backend);if(p.length<6)try{var h;p.length===5?h=p(o,i,s,a,f):h=p(o,i,s,a),h&&typeof h.then=="function"?h.then(function(E){return d(null,E)}).catch(d):d(null,h)}catch(E){d(E)}else p(o,i,s,a,d,f)}!o||!o[0]||this.store.addResource(o[0],i,s,a)}}}]),n}(nr);function _y(){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(We(t[1])==="object"&&(n=t[1]),typeof t[1]=="string"&&(n.defaultValue=t[1]),typeof t[2]=="string"&&(n.tDescription=t[2]),We(t[2])==="object"||We(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 xy(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 sn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xy(Object(n),!0).forEach(function(r){Ht(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xy(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bI(e){var t=CI();return function(){var r=rn(e),o;if(t){var i=rn(this).constructor;o=Reflect.construct(r,arguments,i)}else o=r.apply(this,arguments);return fs(this,o)}}function CI(){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 Tl(){}function LI(e){var t=Object.getOwnPropertyNames(Object.getPrototypeOf(e));t.forEach(function(n){typeof e[n]=="function"&&(e[n]=e[n].bind(e))})}var Al=function(e){Rl(n,e);var t=bI(n);function n(){var r,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if(bt(this,n),r=t.call(this),wl&&nr.call(tr(r)),r.options=Sy(o),r.services={},r.logger=on,r.modules={external:[]},LI(tr(r)),i&&!r.isInitialized&&!o.isClone){if(!r.options.initImmediate)return r.init(o,i),fs(r,tr(r));setTimeout(function(){r.init(o,i)},0)}return r}return Ct(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 a=_y();this.options=sn(sn(sn({},a),this.options),Sy(i)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=sn(sn({},a.interpolation),this.options.interpolation)),i.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=i.keySeparator),i.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=i.nsSeparator);function l(g){return g?typeof g=="function"?new g:g:null}if(!this.options.isClone){this.modules.logger?on.init(l(this.modules.logger),this.options):on.init(null,this.options);var c;this.modules.formatter?c=this.modules.formatter:typeof Intl<"u"&&(c=wI);var d=new hy(this.options);this.store=new gI(this.options.resources,this.options);var f=this.services;f.logger=on,f.resourceStore=this.store,f.languageUtils=d,f.pluralResolver=new xI(d,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),c&&(!this.options.interpolation.format||this.options.interpolation.format===a.interpolation.format)&&(f.formatter=l(c),f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new RI(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new II(l(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",function(g){for(var m=arguments.length,_=new Array(m>1?m-1:0),S=1;S<m;S++)_[S-1]=arguments[S];o.emit.apply(o,[g].concat(_))}),this.modules.languageDetector&&(f.languageDetector=l(this.modules.languageDetector),f.languageDetector.init&&f.languageDetector.init(f,this.options.detection,this.options)),this.modules.i18nFormat&&(f.i18nFormat=l(this.modules.i18nFormat),f.i18nFormat.init&&f.i18nFormat.init(this)),this.translator=new py(this.services,this.options),this.translator.on("*",function(g){for(var m=arguments.length,_=new Array(m>1?m-1:0),S=1;S<m;S++)_[S-1]=arguments[S];o.emit.apply(o,[g].concat(_))}),this.modules.external.forEach(function(g){g.init&&g.init(o)})}if(this.format=this.options.interpolation.format,s||(s=Tl),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(g){o[g]=function(){var m;return(m=o.store)[g].apply(m,arguments)}});var E=["addResource","addResources","addResourceBundle","removeResourceBundle"];E.forEach(function(g){o[g]=function(){var m;return(m=o.store)[g].apply(m,arguments),o}});var v=ps(),y=function(){var m=function(S,x){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),v.resolve(x),s(S,x)};if(o.languages&&o.options.compatibilityAPI!=="v1"&&!o.isInitialized)return m(null,o.t.bind(o));o.changeLanguage(o.options.lng,m)};return this.options.resources||!this.options.initImmediate?y():setTimeout(y,0),v}},{key:"loadResources",value:function(o){var i=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Tl,a=s,l=typeof o=="string"?o:this.language;if(typeof o=="function"&&(a=o),!this.options.resources||this.options.partialBundledLanguages){if(l&&l.toLowerCase()==="cimode")return a();var c=[],d=function(h){if(h){var E=i.services.languageUtils.toResolveHierarchy(h);E.forEach(function(v){c.indexOf(v)<0&&c.push(v)})}};if(l)d(l);else{var f=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);f.forEach(function(p){return d(p)})}this.options.preload&&this.options.preload.forEach(function(p){return d(p)}),this.services.backendConnector.load(c,this.options.ns,function(p){!p&&!i.resolvedLanguage&&i.language&&i.setResolvedLanguage(i.language),a(p)})}else a(null)}},{key:"reloadResources",value:function(o,i,s){var a=ps();return o||(o=this.languages),i||(i=this.options.ns),s||(s=Tl),this.services.backendConnector.reload(o,i,function(l){a.resolve(),s(l)}),a}},{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 a=ps();this.emit("languageChanging",o);var l=function(p){s.language=p,s.languages=s.services.languageUtils.toResolveHierarchy(p),s.resolvedLanguage=void 0,s.setResolvedLanguage(p)},c=function(p,h){h?(l(h),s.translator.changeLanguage(h),s.isLanguageChangingTo=void 0,s.emit("languageChanged",h),s.logger.log("languageChanged",h)):s.isLanguageChangingTo=void 0,a.resolve(function(){return s.t.apply(s,arguments)}),i&&i(p,function(){return s.t.apply(s,arguments)})},d=function(p){!o&&!p&&s.services.languageDetector&&(p=[]);var h=typeof p=="string"?p:s.services.languageUtils.getBestMatchFromCodes(p);h&&(s.language||l(h),s.translator.language||s.translator.changeLanguage(h),s.services.languageDetector&&s.services.languageDetector.cacheUserLanguage&&s.services.languageDetector.cacheUserLanguage(h)),s.loadResources(h,function(E){c(E,h)})};return!o&&this.services.languageDetector&&!this.services.languageDetector.async?d(this.services.languageDetector.detect()):!o&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(d):this.services.languageDetector.detect(d):d(o),a}},{key:"getFixedT",value:function(o,i,s){var a=this,l=function c(d,f){var p;if(We(f)!=="object"){for(var h=arguments.length,E=new Array(h>2?h-2:0),v=2;v<h;v++)E[v-2]=arguments[v];p=a.options.overloadTranslationOptionHandler([d,f].concat(E))}else p=sn({},f);p.lng=p.lng||c.lng,p.lngs=p.lngs||c.lngs,p.ns=p.ns||c.ns,p.keyPrefix=p.keyPrefix||s||c.keyPrefix;var y=a.options.keySeparator||".",g;return p.keyPrefix&&Array.isArray(d)?g=d.map(function(m){return"".concat(p.keyPrefix).concat(y).concat(m)}):g=p.keyPrefix?"".concat(p.keyPrefix).concat(y).concat(d):d,a.t(g,p)};return typeof o=="string"?l.lng=o:l.lngs=o,l.ns=i,l.keyPrefix=s,l}},{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 a=this.resolvedLanguage||this.languages[0],l=this.options?this.options.fallbackLng:!1,c=this.languages[this.languages.length-1];if(a.toLowerCase()==="cimode")return!0;var d=function(h,E){var v=i.services.backendConnector.state["".concat(h,"|").concat(E)];return v===-1||v===2};if(s.precheck){var f=s.precheck(this,d);if(f!==void 0)return f}return!!(this.hasResourceBundle(a,o)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||d(a,o)&&(!l||d(c,o)))}},{key:"loadNamespaces",value:function(o,i){var s=this,a=ps();return this.options.ns?(typeof o=="string"&&(o=[o]),o.forEach(function(l){s.options.ns.indexOf(l)<0&&s.options.ns.push(l)}),this.loadResources(function(l){a.resolve(),i&&i(l)}),a):(i&&i(),Promise.resolve())}},{key:"loadLanguages",value:function(o,i){var s=ps();typeof o=="string"&&(o=[o]);var a=this.options.preload||[],l=o.filter(function(c){return a.indexOf(c)<0});return l.length?(this.options.preload=a.concat(l),this.loadResources(function(c){s.resolve(),i&&i(c)}),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 hy(_y());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]:Tl,a=sn(sn(sn({},this.options),i),{isClone:!0}),l=new n(a);(i.debug!==void 0||i.prefix!==void 0)&&(l.logger=l.logger.clone(i));var c=["store","services","language"];return c.forEach(function(d){l[d]=o[d]}),l.services=sn({},this.services),l.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},l.translator=new py(l.services,l.options),l.translator.on("*",function(d){for(var f=arguments.length,p=new Array(f>1?f-1:0),h=1;h<f;h++)p[h-1]=arguments[h];l.emit.apply(l,[d].concat(p))}),l.init(a,s),l.translator.options=l.options,l.translator.backendConnector.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},l}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),n}(nr);Ht(Al,"createInstance",function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new Al(e,t)});var Le=Al.createInstance();Le.createInstance=Al.createInstance,Le.createInstance,Le.dir,Le.init,Le.loadResources,Le.reloadResources,Le.use,Le.changeLanguage,Le.getFixedT,Le.t,Le.exists,Le.setDefaultNamespace,Le.hasLoadedNamespace,Le.loadNamespaces,Le.loadLanguages;var Ry=[],DI=Ry.forEach,kI=Ry.slice;function PI(e){return DI.call(kI.call(arguments,1),function(t){if(t)for(var n in t)e[n]===void 0&&(e[n]=t[n])}),e}var Ny=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,MI=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 a=o.maxAge-0;if(Number.isNaN(a))throw new Error("maxAge should be a Number");s+="; Max-Age=".concat(Math.floor(a))}if(o.domain){if(!Ny.test(o.domain))throw new TypeError("option domain is invalid");s+="; Domain=".concat(o.domain)}if(o.path){if(!Ny.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 l=typeof o.sameSite=="string"?o.sameSite.toLowerCase():o.sameSite;switch(l){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},wy={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=MI(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)}},jI={name:"cookie",lookup:function(t){var n;if(t.lookupCookie&&typeof document<"u"){var r=wy.read(t.lookupCookie);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupCookie&&typeof document<"u"&&wy.create(n.lookupCookie,t,n.cookieMinutes,n.cookieDomain,n.cookieOptions)}},UI={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 a=i[s].indexOf("=");if(a>0){var l=i[s].substring(0,a);l===t.lookupQuerystring&&(n=i[s].substring(a+1))}}}return n}},hs=null,Oy=function(){if(hs!==null)return hs;try{hs=window!=="undefined"&&window.localStorage!==null;var t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{hs=!1}return hs},FI={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)}},gs=null,Ty=function(){if(gs!==null)return gs;try{gs=window!=="undefined"&&window.sessionStorage!==null;var t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{gs=!1}return gs},VI={name:"sessionStorage",lookup:function(t){var n;if(t.lookupSessionStorage&&Ty()){var r=window.sessionStorage.getItem(t.lookupSessionStorage);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupSessionStorage&&Ty()&&window.sessionStorage.setItem(n.lookupSessionStorage,t)}},$I={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}},BI={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}},HI={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}},zI={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 WI(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var Ay=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};bt(this,e),this.type="languageDetector",this.detectors={},this.init(t,n)}return Ct(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=PI(r,this.options||{},WI()),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=o,this.addDetector(jI),this.addDetector(UI),this.addDetector(FI),this.addDetector(VI),this.addDetector($I),this.addDetector(BI),this.addDetector(HI),this.addDetector(zI)}},{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}();Ay.type="languageDetector";function GI(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function cf(e,t){if(e==null)return{};var n=GI(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)r=i[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var YI={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0};const KI=Yl(YI);var QI=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function Iy(e){var t={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},n=e.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(t.name=n[1],(KI[n[1]]||e.charAt(e.length-2)==="/")&&(t.voidElement=!0),t.name.startsWith("!--"))){var r=e.indexOf("-->");return{type:"comment",comment:r!==-1?e.slice(4,r):""}}for(var o=new RegExp(QI),i=null;(i=o.exec(e))!==null;)if(i[0].trim())if(i[1]){var s=i[1].trim(),a=[s,""];s.indexOf("=")>-1&&(a=s.split("=")),t.attrs[a[0]]=a[1],o.lastIndex--}else i[2]&&(t.attrs[i[2]]=i[3].trim().substring(1,i[3].length-1));return t}var XI=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,qI=/^\s*$/,JI=Object.create(null);function by(e,t){switch(t.type){case"text":return e+t.content;case"tag":return e+="<"+t.name+(t.attrs?function(n){var r=[];for(var o in n)r.push(o+'="'+n[o]+'"');return r.length?" "+r.join(" "):""}(t.attrs):"")+(t.voidElement?"/>":">"),t.voidElement?e:e+t.children.reduce(by,"")+"</"+t.name+">";case"comment":return e+"<!--"+t.comment+"-->"}}var ZI={parse:function(e,t){t||(t={}),t.components||(t.components=JI);var n,r=[],o=[],i=-1,s=!1;if(e.indexOf("<")!==0){var a=e.indexOf("<");r.push({type:"text",content:a===-1?e:e.substring(0,a)})}return e.replace(XI,function(l,c){if(s){if(l!=="</"+n.name+">")return;s=!1}var d,f=l.charAt(1)!=="/",p=l.startsWith("<!--"),h=c+l.length,E=e.charAt(h);if(p){var v=Iy(l);return i<0?(r.push(v),r):((d=o[i]).children.push(v),r)}if(f&&(i++,(n=Iy(l)).type==="tag"&&t.components[n.name]&&(n.type="component",s=!0),n.voidElement||s||!E||E==="<"||n.children.push({type:"text",content:e.slice(h,e.indexOf("<",h))}),i===0&&r.push(n),(d=o[i-1])&&d.children.push(n),o[i]=n),(!f||n.voidElement)&&(i>-1&&(n.voidElement||n.name===l.slice(2,-1))&&(i--,n=i===-1?r:o[i]),!s&&E!=="<"&&E)){d=i===-1?r:o[i].children;var y=e.indexOf("<",h),g=e.slice(h,y===-1?void 0:y);qI.test(g)&&(g=" "),(y>-1&&i+d.length>=0||g!==" ")&&d.push({type:"text",content:g})}}),r},stringify:function(e){return e.reduce(function(t,n){return t+by("",n)},"")}};function Il(){if(console&&console.warn){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];typeof n[0]=="string"&&(n[0]="react-i18next:: ".concat(n[0])),(e=console).warn.apply(e,n)}}var Cy={};function eb(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];typeof t[0]=="string"&&Cy[t[0]]||(typeof t[0]=="string"&&(Cy[t[0]]=new Date),Il.apply(void 0,t))}var tb=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,nb={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},rb=function(t){return nb[t]},ob=function(t){return t.replace(tb,rb)};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 Dy(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){Ht(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}var uf={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:ob};function ib(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};uf=Dy(Dy({},uf),e)}function sb(){return uf}var ky;function ab(e){ky=e}function Py(){return ky}var lb=["format"],cb=["children","count","parent","i18nKey","context","tOptions","values","defaults","components","ns","i18n","t","shouldUnescape"];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 De(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){Ht(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 df(e,t){if(!e)return!1;var n=e.props?e.props.children:e.children;return t?n.length>0:!!n}function ff(e){return e?e.props?e.props.children:e.children:[]}function ub(e){return Object.prototype.toString.call(e)!=="[object Array]"?!1:e.every(function(t){return w.isValidElement(t)})}function ms(e){return Array.isArray(e)?e:[e]}function db(e,t){var n=De({},t);return n.props=Object.assign(e.props,t.props),n}function jy(e,t){if(!e)return"";var n="",r=ms(e),o=t.transSupportBasicHtmlNodes&&t.transKeepBasicHtmlNodesFor?t.transKeepBasicHtmlNodesFor:[];return r.forEach(function(i,s){if(typeof i=="string")n+="".concat(i);else if(w.isValidElement(i)){var a=Object.keys(i.props).length,l=o.indexOf(i.type)>-1,c=i.props.children;if(!c&&l&&a===0)n+="<".concat(i.type,"/>");else if(!c&&(!l||a!==0))n+="<".concat(s,"></").concat(s,">");else if(i.props.i18nIsDynamicList)n+="<".concat(s,"></").concat(s,">");else if(l&&a===1&&typeof c=="string")n+="<".concat(i.type,">").concat(c,"</").concat(i.type,">");else{var d=jy(c,t);n+="<".concat(s,">").concat(d,"</").concat(s,">")}}else if(i===null)Il("Trans: the passed in value is invalid - seems you passed in a null child.");else if(We(i)==="object"){var f=i.format,p=cf(i,lb),h=Object.keys(p);if(h.length===1){var E=f?"".concat(h[0],", ").concat(f):h[0];n+="{{".concat(E,"}}")}else Il("react-i18next: the passed in object contained more than one variable - the object should look like {{ value, format }} where format is optional.",i)}else Il("Trans: the passed in value is invalid - seems you passed in a variable like {number} - please pass in variables for interpolation as full objects like {{number}}.",i)}),n}function fb(e,t,n,r,o,i){if(t==="")return[];var s=r.transKeepBasicHtmlNodesFor||[],a=t&&new RegExp(s.join("|")).test(t);if(!e&&!a)return[t];var l={};function c(y){var g=ms(y);g.forEach(function(m){typeof m!="string"&&(df(m)?c(ff(m)):We(m)==="object"&&!w.isValidElement(m)&&Object.assign(l,m))})}c(e);var d=ZI.parse("<0>".concat(t,"</0>")),f=De(De({},l),o);function p(y,g,m){var _=ff(y),S=E(_,g.children,m);return ub(_)&&S.length===0?_:S}function h(y,g,m,_,S){y.dummy&&(y.children=g),m.push(w.cloneElement(y,De(De({},y.props),{},{key:_}),S?void 0:g))}function E(y,g,m){var _=ms(y),S=ms(g);return S.reduce(function(x,R,I){var L=R.children&&R.children[0]&&R.children[0].content&&n.services.interpolator.interpolate(R.children[0].content,f,n.language);if(R.type==="tag"){var U=_[parseInt(R.name,10)];!U&&m.length===1&&m[0][R.name]&&(U=m[0][R.name]),U||(U={});var A=Object.keys(R.attrs).length!==0?db({props:R.attrs},U):U,b=w.isValidElement(A),V=b&&df(R,!0)&&!R.voidElement,M=a&&We(A)==="object"&&A.dummy&&!b,O=We(e)==="object"&&e!==null&&Object.hasOwnProperty.call(e,R.name);if(typeof A=="string"){var j=n.services.interpolator.interpolate(A,f,n.language);x.push(j)}else if(df(A)||V){var P=p(A,R,m);h(A,P,x,I)}else if(M){var $=E(_,R.children,m);x.push(w.cloneElement(A,De(De({},A.props),{},{key:I}),$))}else if(Number.isNaN(parseFloat(R.name)))if(O){var D=p(A,R,m);h(A,D,x,I,R.voidElement)}else if(r.transSupportBasicHtmlNodes&&s.indexOf(R.name)>-1)if(R.voidElement)x.push(w.createElement(R.name,{key:"".concat(R.name,"-").concat(I)}));else{var C=E(_,R.children,m);x.push(w.createElement(R.name,{key:"".concat(R.name,"-").concat(I)},C))}else if(R.voidElement)x.push("<".concat(R.name," />"));else{var k=E(_,R.children,m);x.push("<".concat(R.name,">").concat(k,"</").concat(R.name,">"))}else if(We(A)==="object"&&!b){var F=R.children[0]?L:null;F&&x.push(F)}else R.children.length===1&&L?x.push(w.cloneElement(A,De(De({},A.props),{},{key:I}),L)):x.push(w.cloneElement(A,De(De({},A.props),{},{key:I})))}else if(R.type==="text"){var B=r.transWrapTextNodes,z=i?r.unescape(n.services.interpolator.interpolate(R.content,f,n.language)):n.services.interpolator.interpolate(R.content,f,n.language);B?x.push(w.createElement(B,{key:"".concat(R.name,"-").concat(I)},z)):x.push(z)}return x},[])}var v=E([{dummy:!0,children:e||[]}],d,ms(e||[]));return ff(v[0])}function pb(e){var t=e.children,n=e.count,r=e.parent,o=e.i18nKey,i=e.context,s=e.tOptions,a=s===void 0?{}:s,l=e.values,c=e.defaults,d=e.components,f=e.ns,p=e.i18n,h=e.t,E=e.shouldUnescape,v=cf(e,cb),y=p||Py();if(!y)return eb("You will need to pass in an i18next instance by using i18nextReactModule"),t;var g=h||y.t.bind(y)||function(V){return V};i&&(a.context=i);var m=De(De({},sb()),y.options&&y.options.react),_=f||g.ns||y.options&&y.options.defaultNS;_=typeof _=="string"?[_]:_||["translation"];var S=c||jy(t,m)||m.transEmptyNodeValue||o,x=m.hashTransKey,R=o||(x?x(S):S),I=l?a.interpolation:{interpolation:De(De({},a.interpolation),{},{prefix:"#$?",suffix:"?$#"})},L=De(De(De(De({},a),{},{count:n},l),I),{},{defaultValue:S,ns:_}),U=R?g(R,L):S,A=fb(d||t,U,y,m,L,E),b=r!==void 0?r:m.defaultTransParent;return b?w.createElement(b,v,A):A}var hb={type:"3rdParty",init:function(t){ib(t.options.react),ab(t)}},gb=w.createContext();(function(){function e(){bt(this,e),this.usedNamespaces={}}return Ct(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})();var mb=["children","count","parent","i18nKey","context","tOptions","values","defaults","components","ns","i18n","t","shouldUnescape"];function Uy(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 Eb(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Uy(Object(n),!0).forEach(function(r){Ht(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Uy(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function vb(e){var t=e.children,n=e.count,r=e.parent,o=e.i18nKey,i=e.context,s=e.tOptions,a=s===void 0?{}:s,l=e.values,c=e.defaults,d=e.components,f=e.ns,p=e.i18n,h=e.t,E=e.shouldUnescape,v=cf(e,mb),y=w.useContext(gb)||{},g=y.i18n,m=y.defaultNS,_=p||g||Py(),S=h||_&&_.t.bind(_);return pb(Eb({children:t,count:n,parent:r,i18nKey:o,context:i,tOptions:a,values:l,defaults:c,components:d,ns:f||S&&S.ns||m||_&&_.options&&_.options.defaultNS,i18n:_,t:h,shouldUnescape:E},v))}var yb={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"]},_b={prefix:"fas",iconName:"bars",icon:[448,512,["navicon"],"f0c9","M0 96C0 78.3 14.3 64 32 64H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32z"]},Sb={prefix:"fas",iconName:"circle-exclamation",icon:[512,512,["exclamation-circle"],"f06a","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24V264c0 13.3-10.7 24-24 24s-24-10.7-24-24V152c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]},xb={prefix:"fas",iconName:"circle-dot",icon:[512,512,[128280,"dot-circle"],"f192","M256 512c141.4 0 256-114.6 256-256S397.4 0 256 0S0 114.6 0 256S114.6 512 256 512zm0-160c-53 0-96-43-96-96s43-96 96-96s96 43 96 96s-43 96-96 96z"]},Rb=xb,Nb={prefix:"fas",iconName:"diamond-exclamation",icon:[512,512,[],"e405","M227.7 11.7c15.6-15.6 40.9-15.6 56.6 0l216 216c15.6 15.6 15.6 40.9 0 56.6l-216 216c-15.6 15.6-40.9 15.6-56.6 0l-216-216c-15.6-15.6-15.6-40.9 0-56.6l216-216zM256 128c-13.3 0-24 10.7-24 24V264c0 13.3 10.7 24 24 24s24-10.7 24-24V152c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"]},wb={prefix:"fas",iconName:"circle-check",icon:[512,512,[61533,"check-circle"],"f058","M256 512c141.4 0 256-114.6 256-256S397.4 0 256 0S0 114.6 0 256S114.6 512 256 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"]},Ob={prefix:"fas",iconName:"arrows-rotate",icon:[512,512,[128472,"refresh","sync"],"f021","M89.1 202.6c7.7-21.8 20.2-42.3 37.8-59.8c62.5-62.5 163.8-62.5 226.3 0L370.3 160H320c-17.7 0-32 14.3-32 32s14.3 32 32 32H447.5c0 0 0 0 0 0h.4c17.7 0 32-14.3 32-32V64c0-17.7-14.3-32-32-32s-32 14.3-32 32v51.2L398.4 97.6c-87.5-87.5-229.3-87.5-316.8 0C57.2 122 39.6 150.7 28.8 181.4c-5.9 16.7 2.9 34.9 19.5 40.8s34.9-2.9 40.8-19.5zM23 289.3c-5 1.5-9.8 4.2-13.7 8.2c-4 4-6.7 8.8-8.1 14c-.3 1.2-.6 2.5-.8 3.8c-.3 1.7-.4 3.4-.4 5.1V448c0 17.7 14.3 32 32 32s32-14.3 32-32V396.9l17.6 17.5 0 0c87.5 87.4 229.3 87.4 316.7 0c24.4-24.4 42.1-53.1 52.9-83.7c5.9-16.7-2.9-34.9-19.5-40.8s-34.9 2.9-40.8 19.5c-7.7 21.8-20.2 42.3-37.8 59.8c-62.5 62.5-163.8 62.5-226.3 0l-.1-.1L109.6 352H160c17.7 0 32-14.3 32-32s-14.3-32-32-32H32.4c-1.6 0-3.2 .1-4.8 .3s-3.1 .5-4.6 1z"]},Tb={prefix:"fas",iconName:"arrow-turn-down-right",icon:[512,512,[],"e3d6","M64 64c0-17.7-14.3-32-32-32S0 46.3 0 64V224c0 53 43 96 96 96H402.7l-73.4 73.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l128-128c12.5-12.5 12.5-32.8 0-45.3l-128-128c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L402.7 256H96c-17.7 0-32-14.3-32-32V64z"]},Ab={prefix:"fas",iconName:"arrow-right",icon:[448,512,[8594],"f061","M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z"]},Ib={prefix:"fas",iconName:"circle-question",icon:[512,512,[62108,"question-circle"],"f059","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM169.8 165.3c7.9-22.3 29.1-37.3 52.8-37.3h58.3c34.9 0 63.1 28.3 63.1 63.1c0 22.6-12.1 43.5-31.7 54.8L280 264.4c-.2 13-10.9 23.6-24 23.6c-13.3 0-24-10.7-24-24V250.5c0-8.6 4.6-16.5 12.1-20.8l44.3-25.4c4.7-2.7 7.6-7.7 7.6-13.1c0-8.4-6.8-15.1-15.1-15.1H222.6c-3.4 0-6.4 2.1-7.5 5.3l-.4 1.2c-4.4 12.5-18.2 19-30.6 14.6s-19-18.2-14.6-30.6l.4-1.2zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]},bb={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"]},Cb={prefix:"fas",iconName:"circle-small",icon:[320,512,[],"e122","M320 256c0 88.4-71.6 160-160 160S0 344.4 0 256S71.6 96 160 96s160 71.6 160 160z"]},Lb={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"]},Db={prefix:"fas",iconName:"bolt",icon:[384,512,[9889,"zap"],"f0e7","M317.4 44.6c5.9-13.7 1.5-29.7-10.6-38.5s-28.6-8-39.9 1.8l-256 224C.9 240.7-2.6 254.8 2 267.3S18.7 288 32 288H143.5L66.6 467.4c-5.9 13.7-1.5 29.7 10.6 38.5s28.6 8 39.9-1.8l256-224c10-8.8 13.6-22.9 8.9-35.3s-16.6-20.7-30-20.7H240.5L317.4 44.6z"]},kb={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"]},Pb={prefix:"fas",iconName:"up-from-bracket",icon:[448,512,[],"e590","M73.9 134.1L196.7 11.3C203.9 4.1 213.8 0 224 0s20.1 4.1 27.3 11.3L374.1 134.1c6.4 6.4 9.9 15 9.9 24c0 18.7-15.2 33.9-33.9 33.9H288V320c0 17.7-14.3 32-32 32H192c-17.7 0-32-14.3-32-32V192H97.9C79.2 192 64 176.8 64 158.1c0-9 3.6-17.6 9.9-24zM64 352v64c0 17.7 14.3 32 32 32H352c17.7 0 32-14.3 32-32V352c0-17.7 14.3-32 32-32s32 14.3 32 32v64c0 53-43 96-96 96H96c-53 0-96-43-96-96V352c0-17.7 14.3-32 32-32s32 14.3 32 32z"]},Mb={prefix:"fas",iconName:"clock-rotate-left",icon:[512,512,["history"],"f1da","M75 75L41 41C25.9 25.9 0 36.6 0 57.9V168c0 13.3 10.7 24 24 24H134.1c21.4 0 32.1-25.9 17-41l-30.8-30.8C155 85.5 203 64 256 64c106 0 192 86 192 192s-86 192-192 192c-40.8 0-78.6-12.7-109.7-34.4c-14.5-10.1-34.4-6.6-44.6 7.9s-6.6 34.4 7.9 44.6C151.2 495 201.7 512 256 512c141.4 0 256-114.6 256-256S397.4 0 256 0C185.3 0 121.3 28.7 75 75zm181 53c-13.3 0-24 10.7-24 24V256c0 6.4 2.5 12.5 7 17l72 72c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-65-65V152c0-13.3-10.7-24-24-24z"]},jb={prefix:"fas",iconName:"triangle-exclamation",icon:[512,512,[9888,"exclamation-triangle","warning"],"f071","M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480H40c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24V296c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"]},Ub={prefix:"fas",iconName:"circle-xmark",icon:[512,512,[61532,"times-circle","xmark-circle"],"f057","M256 512c141.4 0 256-114.6 256-256S397.4 0 256 0S0 114.6 0 256S114.6 512 256 512zM175 175c9.4-9.4 24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9z"]};const Fb={"arrow-left":bb,"arrow-right":Ab,"arrow-turn-down-right":Tb,"arrows-rotate":Ob,bars:_b,bolt:Db,"circle-check":wb,"circle-exclamation":Sb,"circle-info":Lb,"circle-question":Ib,"circle-small":Cb,"circle-xmark":Ub,"clock-rotate-left":Mb,"diamond-exclamation":Nb,"dot-circle":Rb,"trash-can":yb,"triangle-exclamation":jb,"up-from-bracket":Pb,xmark:kb},te=w.forwardRef(function({className:t="",size:n="",tag:r},o){const i=Fb[r];return i?u.jsx("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:u.jsx("path",{d:i.icon[4],fill:"currentColor"})}):(Ie().debug(`Unknown icon: ${r}`),null)}),Bo=({className:e="",confirm:t=!0,handleDelete:n,label:r,scale:o=1,show:i=!0,showLabel:s=!1,size:a})=>{const[l,c]=w.useState(!1),[d,f]=w.useState(o);o!==d&&(c(!1),f(o));const p=E=>{E.preventDefault(),c(v=>!v)},h=E=>{E.preventDefault(),n(E)};return u.jsx(sr,{enable:t,open:l,onOpenChange:c,placement:"top",scale:o,trigger:u.jsxs("button",{className:`${i?"visible opacity-100":"invisible opacity-0"} text-xs text-foreground/20 hover:text-negative group-hover/node-wrapper:visible group-hover/node-wrapper:animate-delay-opacity ${e}`,onClick:E=>p(E),children:[u.jsx(te,{tag:"trash-can",size:a})," ",u.jsx("span",{className:`${s?"whitespace-nowrap text-foreground/40 underline hover:text-negative":"sr-only"}`,children:r})]}),children:u.jsxs("div",{className:"text-xs font-semibold",children:[u.jsx("p",{className:"w-full pb-2 text-center",children:T(N.ARE_YOU_SURE)}),u.jsxs("div",{className:"align-center flex justify-between gap-2",children:[u.jsx("button",{className:"rounded bg-secondary py-1 px-2",onClick:E=>p(E),children:T(N.CANCEL)}),u.jsx("button",{className:"rounded bg-negative py-1 px-2",onClick:E=>h(E),children:T(N.DELETE)})]})]})})},Vb=e=>{const t=Y(n=>n.viewport.zoom);return u.jsx(Bo,{scale:t,...e})},$b=Ie(),Bb=100,Hb=100,Fy=({children:e,className:t="",onClickListItem:n})=>{const r=Y(c=>c.nodes),o=Y(c=>c.reactFlowInstance),i=Y(c=>c.validationWarnings),{setSelectedNodes:s}=xe();if(i.size===0)return null;const a=Array.from(i.values());a.sort((c,d)=>c.nodeTitle.toLowerCase().localeCompare(d.nodeTitle.toLowerCase()));const l=c=>{var h,E;const d=r.find(v=>v.id===c);if(!d){$b.error(`Node with id ${c} not found`);return}const f=((h=o==null?void 0:o.getNode(c))==null?void 0:h.height)??Hb,p=((E=o==null?void 0:o.getNode(c))==null?void 0:E.width)??Hv;o==null||o.fitBounds({height:f+Bb,width:p,x:d.position.x,y:d.position.y},{duration:nf}),setTimeout(()=>s([d.id]),nf),n==null||n()};return u.jsxs("div",{className:`hidden max-h-60 flex-col sm:flex ${t}`,children:[e,u.jsxs("p",{className:"mb-2 text-xs",children:[T(N.NUMBER_OF_VALIDATION_WARNINGS,{count:a.length}),":"]}),u.jsx("div",{className:"flex-auto overflow-y-auto",children:u.jsx("ol",{className:"list-inside",children:a.map(c=>u.jsxs("li",{className:"mb-2 text-xs",children:[u.jsx("button",{className:"text-warning underline",onClick:()=>l(c.nodeId),children:T(c.nodeTitle)}),u.jsxs("ol",{className:"my-1 ml-4 flex list-inside flex-col gap-y-1",children:[!c.connected&&u.jsx("li",{children:T(N.NOT_CONNECTED_TO_FLOW)}),!c.valid&&u.jsx("li",{children:T(N.INVALID_SETTINGS)})]})]},c.id))})})]})},Es=e=>{const{className:t="",direction:n="from",valid:r=!0,...o}=e,i=n==="from";return u.jsxs("div",{className:`relative ${t} ${r?"":"invalid"}`,children:[u.jsx("input",{className:`w-full !pl-5 ${r?"":"invalid"}`,placeholder:T(i?N.FROM:N.TO),...o}),u.jsx(te,{className:"absolute left-[.25rem] top-[.5rem] text-foreground/40",tag:i?"arrow-left":"arrow-right"})]})},zb=({children:e})=>u.jsx("span",{className:"whitespace-wrap inline-block",children:u.jsx("code",{className:"mr-[0.5ch] whitespace-pre-wrap rounded-md bg-background p-0 px-[0.5ch] text-sm leading-4 tracking-tighter text-foreground",children:e})}),Lt=({children:e})=>u.jsxs("section",{className:"flex gap-2 overflow-hidden px-4 pb-3 text-xs leading-5",children:[u.jsx("div",{className:"shrink-0 pl-1 text-secondary",children:u.jsx(te,{size:"lg",tag:"arrow-turn-down-right"})}),u.jsx("div",{className:"w-full overflow-hidden",children:e})]}),Wb=({connected:e=!1,deletable:t=!0,isRoot:n=!1,nodeId:r,nodeTitle:o,selected:i=!1})=>{const{removeNode:s}=xe(),a=Y(c=>c.isEdgeConnecting),l=(c=>c?"bg-positive/10 text-positive":e?"bg-focus/30 text-primary":"bg-foreground/10 text-foreground/50")(n);return u.jsxs("div",{className:"flex w-full items-center justify-start gap-x-2 p-4",children:[u.jsx("div",{className:`${l} flex h-5 w-5 shrink-0 items-center justify-center rounded-full`,children:u.jsx(te,{tag:"circle-small"})}),u.jsxs("div",{className:"flex-1",children:[u.jsx("h2",{className:"text-xs font-semibold",children:o}),!e&&u.jsxs("div",{className:"flex items-center justify-start text-tiny font-semibold leading-[14px] text-secondary",children:[u.jsx(te,{className:"px-1 text-warning",size:"lg",tag:"bolt"}),T(N.NOT_CONNECTED_TO_FLOW)]})]}),t&&!a&&u.jsx(Vb,{handleDelete:()=>s(r),label:T(N.REMOVE_NODE,{title:o}),show:i})]})},Gb=({valid:e})=>e?null:u.jsx("div",{className:"m-4 mt-0 inline-block",children:u.jsxs("div",{className:"flex items-start justify-start gap-2 rounded bg-negative/10 px-2 py-1 text-xs text-negative",children:[u.jsx(sr,{placement:"bottom",trigger:u.jsx("div",{role:"tooltip",tabIndex:0,children:u.jsx(te,{size:"lg",tag:"triangle-exclamation"})}),children:T(N.INFO_INVALID_SETTINGS)}),T(N.INVALID_SETTINGS)]})}),Yb=({nodeId:e,valid:t})=>{const{deleteValidationWarning:n,getTargetEdges:r,partialUpdateValidationWarning:o}=xe(),[i,s]=w.useState(!1);return w.useEffect(()=>{let a;const l=()=>{n(e),typeof a=="function"&&a()},c=()=>{const d=Y.getState().nodes.find(f=>f.id===e);if(!d)l();else{const f=r(e).length>0;s(f),o(e,{connected:f,nodeId:e,nodeType:d.type,valid:t})}};return c(),a=Y.subscribe((d,f)=>{const p=d.nodes.length!==f.nodes.length,h=d.edges.length!==f.edges.length,E=d.isEdgeUpdateSuccessful!==f.isEdgeUpdateSuccessful;(h||p||E)&&c()}),()=>{l()}},[n,r,e,o,t]),{isConnectedToFlow:i}},Kb=({id:e,isConnectable:t})=>{if(!e)throw new Error("TargetHandle: id is required");return u.jsx("div",{className:"absolute left-0 top-5 h-3 w-3 -translate-x-1/2",children:u.jsx(Co,{className:"-left-[2px] h-full w-full border-2 border-foreground/40 bg-background transition-colors hover:border-foreground/80",id:`target-${e}`,isConnectable:t,position:K.Left,type:"target"})})},Fe=({children:e,id:t,isConnectable:n=!0,isRoot:r=!1,nodeTitle:o,selected:i,deletable:s=!0,showValidation:a=!0,target:l=!0,valid:c=!0})=>{const{isConnectedToFlow:d}=Yb({nodeId:t,valid:c});return u.jsx("section",{className:`${i?"!border-focus":""} group/node-wrapper rounded-xl border-2 border-background shadow-[0_4px_12px_0_rgba(0,0,0,0.08)] transition-[visibility]`,children:u.jsxs("div",{className:"group/node-wrapper relative rounded-xl bg-background",style:{width:Hv},children:[l&&t&&u.jsx(Kb,{id:t,isConnectable:n}),u.jsx(Wb,{connected:!l||d,deletable:s,isRoot:r,nodeId:t,nodeTitle:o,selected:i}),a&&u.jsx(Gb,{valid:c}),e]})})},Qb=({children:e,handleClick:t,...n})=>{const r=o=>{(o.key==="Backspace"||o.key==="Delete")&&(o.stopPropagation(),t==null||t())};return u.jsx("li",{role:"presentation",children:u.jsxs("div",{className:"flex items-center gap-2 rounded-lg bg-primary/20 p-1 pl-2 text-xs font-medium text-foreground",role:"option","aria-selected":"true",tabIndex:0,children:[e,u.jsxs("button",{className:"px-1",onClick:t,onKeyDown:r,type:"button",...n,children:[u.jsx("span",{className:"sr-only",children:"Remove"}),u.jsx(te,{tag:"xmark",size:"xs"})]})]})})},Vy=({data:e})=>{let t=e.selected&&e[e.selected].trim();return t&&e.selected==="url"&&(t=JA(t)||T(N.PLAY_AUDIO)),t?u.jsx(Lt,{children:u.jsx("div",{className:"max-w-max",children:e.selected==="url"?u.jsx("a",{className:"break-words text-primary underline line-clamp-2",href:e.url,target:"_blank",rel:"noopener noreferrer",children:t}):u.jsx("p",{className:"break-words line-clamp-2",children:t})})}):null},$y=e=>{const{children:t,className:n="",disabled:r=!1,...o}=e;return u.jsxs("div",{className:`relative mb-2 after:pointer-events-none after:absolute after:top-[.725rem] after:right-3 after:h-0 after:w-0 after:border-[5px] after:border-t-[6px] after:border-b-0 after:border-r-transparent after:border-l-transparent after:content-['']
62
- ${r?"after:border-t-foreground/40":"after:border-t-foreground"}`,children:[u.jsx("select",{className:`pr-8 ${n}`,disabled:r,...o,children:t}),u.jsx("p",{className:"requirements w-full",role:"alert",children:T(N.ERROR_SELECTION_REQUIRED)})]})},an=e=>{const{label:t="",id:n="",...r}=e,o=w.useId(),i=n||o;return u.jsxs(u.Fragment,{children:[t&&u.jsx("label",{className:"block pb-1 font-medium",htmlFor:i,children:t}),u.jsx($y,{id:i,...r})]})},Xb=({label:e,vars:t={}})=>u.jsx(vb,{components:{a:u.jsx("a",{className:"underline hover:text-background/80",href:t.linkTo||"#",target:"_blank",rel:"noopener noreferrer"}),code:u.jsx(zb,{}),p:u.jsx("p",{className:"mb-2"})},i18nKey:e}),qb={disabled:"border-disabled cursor-not-allowed",negative:"border-negative hover:bg-negative",positive:"border-positive hover:bg-positive"},Wt=({color:e="positive",enabled:t=!0,id:n,isConnectable:r})=>{if(!n)throw new Error("SourceHandle: id is required");const o=t?e:"disabled",i=Y(d=>d.updatingSourceHandleId),l=!Y(d=>d.edges.some(f=>f.sourceHandle===n))||i===n,c=l&&r&&t;return u.jsx("div",{className:`absolute right-0 top-1/2 h-3 w-3 -translate-y-1/2 translate-x-1/2 ${c?"":"nodrag cursor-not-allowed"}`,children:u.jsx(Co,{className:`-right-[2px] h-full w-full border-2 bg-background transition-colors ${qb[o]??""}`,id:n,isConnectable:l&&r&&t,position:K.Right,type:"source"})})},Ho=({children:e})=>u.jsx("div",{className:"flex w-full flex-col items-start text-xs",children:e}),Gt=({color:e="positive",enabled:t=!0,id:n,isConnectable:r,optionSubtitle:o="",optionTitle:i})=>u.jsxs("div",{className:"relative w-full min-w-[104px] whitespace-nowrap border-t border-foreground/10 py-3",children:[u.jsx("div",{className:"flex flex-col items-start justify-center px-4",children:u.jsxs("div",{className:`${t?"":"text-disabled"} min-h-[1rem] w-full overflow-hidden`,children:[i,o?u.jsx("span",{className:"block text-xxs text-secondary",children:o}):null]})}),u.jsx(Wt,{color:e,enabled:t,id:n,isConnectable:r})]}),Jb=({checked:e=!1,name:t,onClick:n})=>u.jsxs("button",{name:t,onClick:n,type:"button",className:`${e?"bg-primary":"bg-secondary"} relative inline-flex h-4 w-6 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:[u.jsx("span",{className:"sr-only",children:T(e?N.ON:N.OFF)}),u.jsx("span",{className:`pointer-events-none inline-block h-3 w-3 ${e?"translate-x-2":"translate-x-0"} transform rounded-full bg-white shadow transition duration-200 ease-in-out`})]}),pf=({checked:e,clickHandler:t,name:n,subtitle:r,title:o})=>u.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[u.jsxs("div",{className:"flex flex-grow flex-col",children:[u.jsx("span",{className:"text-xs",children:o}),r&&u.jsx("span",{className:"text-xxs text-foreground/50",children:r})]}),u.jsx(Jb,{checked:e,name:n,onClick:t})]}),On=({errorText:e,label:t,name:n,onChange:r,required:o,valid:i,value:s,...a})=>u.jsxs(u.Fragment,{children:[t!=null&&t.trim()?u.jsx("div",{className:"pb-1",children:t}):null,u.jsx("textarea",{"aria-invalid":i?void 0:"true",className:`peer min-h-[77px] w-full resize-y ${i?"":"invalid"}`,inputMode:"text",minLength:1,name:n,onChange:r,required:o,value:s,...a}),u.jsx("p",{className:"requirements",role:"alert",children:e})]});/*!
63
- * tabbable 6.1.1
64
- * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
65
- */var Zb=["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])"],hf=Zb.join(","),By=typeof Element>"u",vs=By?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,bl=!By&&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},Cl=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},e2=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},t2=function(t,n,r){if(Cl(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(hf));return n&&vs.call(t,hf)&&o.unshift(t),o=o.filter(r),o},n2=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var s=i.shift();if(!Cl(s,!1))if(s.tagName==="SLOT"){var a=s.assignedElements(),l=a.length?a:s.children,c=e(l,!0,r);r.flatten?o.push.apply(o,c):o.push({scopeParent:s,candidates:c})}else{var d=vs.call(s,hf);d&&r.filter(s)&&(n||!t.includes(s))&&o.push(s);var f=s.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(s),p=!Cl(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},Hy=function(t,n){return t.tabIndex<0&&(n||/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||e2(t))&&isNaN(parseInt(t.getAttribute("tabindex"),10))?0:t.tabIndex},r2=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},zy=function(t){return t.tagName==="INPUT"},o2=function(t){return zy(t)&&t.type==="hidden"},i2=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},s2=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},a2=function(t){if(!t.name)return!0;var n=t.form||bl(t),r=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},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=s2(o,t.form);return!i||i===t},l2=function(t){return zy(t)&&t.type==="radio"},c2=function(t){return l2(t)&&!a2(t)},u2=function(t){var n,r=t&&bl(t),o=(n=r)===null||n===void 0?void 0:n.host,i=!1;if(r&&r!==t){var s,a,l;for(i=!!((s=o)!==null&&s!==void 0&&(a=s.ownerDocument)!==null&&a!==void 0&&a.contains(o)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!i&&o;){var c,d,f;r=bl(o),o=(c=r)===null||c===void 0?void 0:c.host,i=!!((d=o)!==null&&d!==void 0&&(f=d.ownerDocument)!==null&&f!==void 0&&f.contains(o))}}return i},Wy=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},d2=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var i=vs.call(t,"details>summary:first-of-type"),s=i?t.parentElement:t;if(vs.call(s,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof o=="function"){for(var a=t;t;){var l=t.parentElement,c=bl(t);if(l&&!l.shadowRoot&&o(l)===!0)return Wy(t);t.assignedSlot?t=t.assignedSlot:!l&&c!==t.ownerDocument?t=c.host:t=l}t=a}if(u2(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Wy(t);return!1},f2=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 vs.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},p2=function(t,n){return!(n.disabled||Cl(n)||o2(n)||d2(n,t)||i2(n)||f2(n))},Gy=function(t,n){return!(c2(n)||Hy(n)<0||!p2(t,n))},h2=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},g2=function e(t){var n=[],r=[];return t.forEach(function(o,i){var s=!!o.scopeParent,a=s?o.scopeParent:o,l=Hy(a,s),c=s?e(o.candidates):a;l===0?s?n.push.apply(n,c):n.push(a):r.push({documentOrder:i,tabIndex:l,item:o,isScope:s,content:c})}),r.sort(r2).reduce(function(o,i){return i.isScope?o.push.apply(o,i.content):o.push(i.content),o},[]).concat(n)},Yy=function(t,n){n=n||{};var r;return n.getShadowRoot?r=n2([t],n.includeContainer,{filter:Gy.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:h2}):r=t2(t,n.includeContainer,Gy.bind(null,n)),g2(r)};function ys(e){return e.split("-")[1]}function gf(e){return e==="y"?"height":"width"}function Cr(e){return e.split("-")[0]}function _s(e){return["top","bottom"].includes(Cr(e))?"x":"y"}function Ky(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,a=_s(t),l=gf(a),c=r[l]/2-o[l]/2,d=a==="x";let f;switch(Cr(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(ys(t)){case"start":f[a]-=c*(n&&d?-1:1);break;case"end":f[a]+=c*(n&&d?-1:1)}return f}const m2=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:f}=Ky(c,r,l),p=r,h={},E=0;for(let v=0;v<a.length;v++){const{name:y,fn:g}=a[v],{x:m,y:_,data:S,reset:x}=await g({x:d,y:f,initialPlacement:r,placement:p,strategy:o,middlewareData:h,rects:c,platform:s,elements:{reference:e,floating:t}});d=m??d,f=_??f,h={...h,[y]:{...h[y],...S}},x&&E<=50&&(E++,typeof x=="object"&&(x.placement&&(p=x.placement),x.rects&&(c=x.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):x.rects),{x:d,y:f}=Ky(c,p,l)),v=-1)}return{x:d,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 mf(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function Xy(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:p=!1,padding:h=0}=t,E=Qy(h),v=a[p?f==="floating"?"reference":"floating":f],y=mf(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(v)))==null||n?v:v.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:l})),g=f==="floating"?{...s.floating,x:r,y:o}:s.reference,m=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),_=await(i.isElement==null?void 0:i.isElement(m))&&await(i.getScale==null?void 0:i.getScale(m))||{x:1,y:1},S=mf(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:g,offsetParent:m,strategy:l}):g);return{top:(y.top-S.top+E.top)/_.y,bottom:(S.bottom-y.bottom+E.bottom)/_.y,left:(y.left-S.left+E.left)/_.x,right:(S.right-y.right+E.right)/_.x}}const E2=Math.min,v2=Math.max;function Ef(e,t,n){return v2(e,E2(t,n))}const qy=e=>({name:"arrow",options:e,async fn(t){const{element:n,padding:r=0}=e||{},{x:o,y:i,placement:s,rects:a,platform:l}=t;if(n==null)return{};const c=Qy(r),d={x:o,y:i},f=_s(s),p=gf(f),h=await l.getDimensions(n),E=f==="y"?"top":"left",v=f==="y"?"bottom":"right",y=a.reference[p]+a.reference[f]-d[f]-a.floating[p],g=d[f]-a.reference[f],m=await(l.getOffsetParent==null?void 0:l.getOffsetParent(n));let _=m?f==="y"?m.clientHeight||0:m.clientWidth||0:0;_===0&&(_=a.floating[p]);const S=y/2-g/2,x=c[E],R=_-h[p]-c[v],I=_/2-h[p]/2+S,L=Ef(x,I,R),U=ys(s)!=null&&I!=L&&a.reference[p]/2-(I<x?c[E]:c[v])-h[p]/2<0;return{[f]:d[f]-(U?I<x?x-I:R-I:0),data:{[f]:L,centerOffset:I-L}}}});["top","right","bottom","left"].reduce((e,t)=>e.concat(t,t+"-start",t+"-end"),[]);const y2={left:"right",right:"left",bottom:"top",top:"bottom"};function Ll(e){return e.replace(/left|right|bottom|top/g,t=>y2[t])}function _2(e,t,n){n===void 0&&(n=!1);const r=ys(e),o=_s(e),i=gf(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Ll(s)),{main:s,cross:Ll(s)}}const S2={start:"end",end:"start"};function vf(e){return e.replace(/start|end/g,t=>S2[t])}const x2=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:a,elements:l}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:E=!0,...v}=e,y=Cr(r),g=Cr(s)===s,m=await(a.isRTL==null?void 0:a.isRTL(l.floating)),_=f||(g||!E?[Ll(s)]:function(b){const V=Ll(b);return[vf(b),V,vf(V)]}(s));f||h==="none"||_.push(...function(b,V,M,O){const j=ys(b);let P=function($,D,C){const k=["left","right"],F=["right","left"],B=["top","bottom"],z=["bottom","top"];switch($){case"top":case"bottom":return C?D?F:k:D?k:F;case"left":case"right":return D?B:z;default:return[]}}(Cr(b),M==="start",O);return j&&(P=P.map($=>$+"-"+j),V&&(P=P.concat(P.map(vf)))),P}(s,E,h,m));const S=[s,..._],x=await Xy(t,v),R=[];let I=((n=o.flip)==null?void 0:n.overflows)||[];if(c&&R.push(x[y]),d){const{main:b,cross:V}=_2(r,i,m);R.push(x[b],x[V])}if(I=[...I,{placement:r,overflows:R}],!R.every(b=>b<=0)){var L,U;const b=(((L=o.flip)==null?void 0:L.index)||0)+1,V=S[b];if(V)return{data:{index:b,overflows:I},reset:{placement:V}};let M=(U=I.filter(O=>O.overflows[0]<=0).sort((O,j)=>O.overflows[1]-j.overflows[1])[0])==null?void 0:U.placement;if(!M)switch(p){case"bestFit":{var A;const O=(A=I.map(j=>[j.placement,j.overflows.filter(P=>P>0).reduce((P,$)=>P+$,0)]).sort((j,P)=>j[1]-P[1])[0])==null?void 0:A[0];O&&(M=O);break}case"initialPlacement":M=s}if(r!==M)return{reset:{placement:M}}}return{}}}},R2=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:a,platform:l,elements:c}=i,d=await(l.isRTL==null?void 0:l.isRTL(c.floating)),f=Cr(a),p=ys(a),h=_s(a)==="x",E=["left","top"].includes(f)?-1:1,v=d&&h?-1:1,y=typeof s=="function"?s(i):s;let{mainAxis:g,crossAxis:m,alignmentAxis:_}=typeof y=="number"?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...y};return p&&typeof _=="number"&&(m=p==="end"?-1*_:_),h?{x:m*v,y:g*E}:{x:g*E,y:m*v}}(t,e);return{x:n+o.x,y:r+o.y,data:o}}}};function N2(e){return e==="x"?"y":"x"}const w2=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:a={fn:y=>{let{x:g,y:m}=y;return{x:g,y:m}}},...l}=e,c={x:n,y:r},d=await Xy(t,l),f=_s(Cr(o)),p=N2(f);let h=c[f],E=c[p];if(i){const y=f==="y"?"bottom":"right";h=Ef(h+d[f==="y"?"top":"left"],h,h-d[y])}if(s){const y=p==="y"?"bottom":"right";E=Ef(E+d[p==="y"?"top":"left"],E,E-d[y])}const v=a.fn({...t,[f]:h,[p]:E});return{...v,data:{x:v.x-n,y:v.y-r}}}}};function Et(e){var t;return((t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ln(e){return Et(e).getComputedStyle(e)}const Jy=Math.min,Ss=Math.max,Dl=Math.round;function Zy(e){const t=ln(e);let n=parseFloat(t.width),r=parseFloat(t.height);const o=e.offsetWidth,i=e.offsetHeight,s=Dl(n)!==o||Dl(r)!==i;return s&&(n=o,r=i),{width:n,height:r,fallback:s}}function rr(e){return t0(e)?(e.nodeName||"").toLowerCase():""}let kl;function e0(){if(kl)return kl;const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(kl=e.brands.map(t=>t.brand+"/"+t.version).join(" "),kl):navigator.userAgent}function cn(e){return e instanceof Et(e).HTMLElement}function Yt(e){return e instanceof Et(e).Element}function t0(e){return e instanceof Et(e).Node}function n0(e){return typeof ShadowRoot>"u"?!1:e instanceof Et(e).ShadowRoot||e instanceof ShadowRoot}function Pl(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=ln(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function O2(e){return["table","td","th"].includes(rr(e))}function yf(e){const t=/firefox/i.test(e0()),n=ln(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 _f(){return/^((?!chrome|android).)*safari/i.test(e0())}function Sf(e){return["html","body","#document"].includes(rr(e))}function r0(e){return Yt(e)?e:e.contextElement}const o0={x:1,y:1};function zo(e){const t=r0(e);if(!cn(t))return o0;const n=t.getBoundingClientRect(),{width:r,height:o,fallback:i}=Zy(t);let s=(i?Dl(n.width):n.width)/r,a=(i?Dl(n.height):n.height)/o;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}function Lr(e,t,n,r){var o,i;t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),a=r0(e);let l=o0;t&&(r?Yt(r)&&(l=zo(r)):l=zo(e));const c=a?Et(a):window,d=_f()&&n;let f=(s.left+(d&&((o=c.visualViewport)==null?void 0:o.offsetLeft)||0))/l.x,p=(s.top+(d&&((i=c.visualViewport)==null?void 0:i.offsetTop)||0))/l.y,h=s.width/l.x,E=s.height/l.y;if(a){const v=Et(a),y=r&&Yt(r)?Et(r):r;let g=v.frameElement;for(;g&&r&&y!==v;){const m=zo(g),_=g.getBoundingClientRect(),S=getComputedStyle(g);_.x+=(g.clientLeft+parseFloat(S.paddingLeft))*m.x,_.y+=(g.clientTop+parseFloat(S.paddingTop))*m.y,f*=m.x,p*=m.y,h*=m.x,E*=m.y,f+=_.x,p+=_.y,g=Et(g).frameElement}}return{width:h,height:E,top:p,right:f+h,bottom:p+E,left:f,x:f,y:p}}function or(e){return((t0(e)?e.ownerDocument:e.document)||window.document).documentElement}function Ml(e){return Yt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function i0(e){return Lr(or(e)).left+Ml(e).scrollLeft}function xs(e){if(rr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||n0(e)&&e.host||or(e);return n0(t)?t.host:t}function s0(e){const t=xs(e);return Sf(t)?t.ownerDocument.body:cn(t)&&Pl(t)?t:s0(t)}function ir(e,t){var n;t===void 0&&(t=[]);const r=s0(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),i=Et(r);return o?t.concat(i,i.visualViewport||[],Pl(r)?r:[]):t.concat(r,ir(r))}function a0(e,t,n){let r;if(t==="viewport")r=function(s,a){const l=Et(s),c=or(s),d=l.visualViewport;let f=c.clientWidth,p=c.clientHeight,h=0,E=0;if(d){f=d.width,p=d.height;const v=_f();(!v||v&&a==="fixed")&&(h=d.offsetLeft,E=d.offsetTop)}return{width:f,height:p,x:h,y:E}}(e,n);else if(t==="document")r=function(s){const a=or(s),l=Ml(s),c=s.ownerDocument.body,d=Ss(a.scrollWidth,a.clientWidth,c.scrollWidth,c.clientWidth),f=Ss(a.scrollHeight,a.clientHeight,c.scrollHeight,c.clientHeight);let p=-l.scrollLeft+i0(s);const h=-l.scrollTop;return ln(c).direction==="rtl"&&(p+=Ss(a.clientWidth,c.clientWidth)-d),{width:d,height:f,x:p,y:h}}(or(e));else if(Yt(t))r=function(s,a){const l=Lr(s,!0,a==="fixed"),c=l.top+s.clientTop,d=l.left+s.clientLeft,f=cn(s)?zo(s):{x:1,y:1};return{width:s.clientWidth*f.x,height:s.clientHeight*f.y,x:d*f.x,y:c*f.y}}(t,n);else{const s={...t};if(_f()){var o,i;const a=Et(e);s.x-=((o=a.visualViewport)==null?void 0:o.offsetLeft)||0,s.y-=((i=a.visualViewport)==null?void 0:i.offsetTop)||0}r=s}return mf(r)}function l0(e,t){return cn(e)&&ln(e).position!=="fixed"?t?t(e):e.offsetParent:null}function c0(e,t){const n=Et(e);let r=l0(e,t);for(;r&&O2(r)&&ln(r).position==="static";)r=l0(r,t);return r&&(rr(r)==="html"||rr(r)==="body"&&ln(r).position==="static"&&!yf(r))?n:r||function(o){let i=xs(o);for(;cn(i)&&!Sf(i);){if(yf(i))return i;i=xs(i)}return null}(e)||n}function T2(e,t,n){const r=cn(t),o=or(t),i=Lr(e,!0,n==="fixed",t);let s={scrollLeft:0,scrollTop:0};const a={x:0,y:0};if(r||!r&&n!=="fixed")if((rr(t)!=="body"||Pl(o))&&(s=Ml(t)),cn(t)){const l=Lr(t,!0);a.x=l.x+t.clientLeft,a.y=l.y+t.clientTop}else o&&(a.x=i0(o));return{x:i.left+s.scrollLeft-a.x,y:i.top+s.scrollTop-a.y,width:i.width,height:i.height}}const A2={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=n==="clippingAncestors"?function(c,d){const f=d.get(c);if(f)return f;let p=ir(c).filter(y=>Yt(y)&&rr(y)!=="body"),h=null;const E=ln(c).position==="fixed";let v=E?xs(c):c;for(;Yt(v)&&!Sf(v);){const y=ln(v),g=yf(v);y.position==="fixed"?h=null:(E?g||h:g||y.position!=="static"||!h||!["absolute","fixed"].includes(h.position))?h=y:p=p.filter(m=>m!==v),v=xs(v)}return d.set(c,p),p}(t,this._c):[].concat(n),s=[...i,r],a=s[0],l=s.reduce((c,d)=>{const f=a0(t,d,o);return c.top=Ss(f.top,c.top),c.right=Jy(f.right,c.right),c.bottom=Jy(f.bottom,c.bottom),c.left=Ss(f.left,c.left),c},a0(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=cn(n),i=or(n);if(n===i)return t;let s={scrollLeft:0,scrollTop:0},a={x:1,y:1};const l={x:0,y:0};if((o||!o&&r!=="fixed")&&((rr(n)!=="body"||Pl(i))&&(s=Ml(n)),cn(n))){const c=Lr(n);a=zo(n),l.x=c.x+n.clientLeft,l.y=c.y+n.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-s.scrollLeft*a.x+l.x,y:t.y*a.y-s.scrollTop*a.y+l.y}},isElement:Yt,getDimensions:function(e){return cn(e)?Zy(e):e.getBoundingClientRect()},getOffsetParent:c0,getDocumentElement:or,getScale:zo,async getElementRects(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||c0,i=this.getDimensions;return{reference:T2(t,await o(n),r),floating:{x:0,y:0,...await i(n)}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>ln(e).direction==="rtl"};function I2(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=!0,animationFrame:a=!1}=r,l=o&&!a,c=l||i?[...Yt(e)?ir(e):e.contextElement?ir(e.contextElement):[],...ir(t)]:[];c.forEach(h=>{l&&h.addEventListener("scroll",n,{passive:!0}),i&&h.addEventListener("resize",n)});let d,f=null;if(s){let h=!0;f=new ResizeObserver(()=>{h||n(),h=!1}),Yt(e)&&!a&&f.observe(e),Yt(e)||!e.contextElement||a||f.observe(e.contextElement),f.observe(t)}let p=a?Lr(e):null;return a&&function h(){const E=Lr(e);!p||E.x===p.x&&E.y===p.y&&E.width===p.width&&E.height===p.height||n(),p=E,d=requestAnimationFrame(h)}(),n(),()=>{var h;c.forEach(E=>{l&&E.removeEventListener("scroll",n),i&&E.removeEventListener("resize",n)}),(h=f)==null||h.disconnect(),f=null,a&&cancelAnimationFrame(d)}}const b2=(e,t,n)=>{const r=new Map,o={platform:A2,...n},i={...o.platform,_c:r};return m2(e,t,{...o,platform:i})},C2=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?qy({element:t.current,padding:n}).fn(o):{}:t?qy({element:t,padding:n}).fn(o):{}}}};var jl=typeof document<"u"?w.useLayoutEffect:w.useEffect;function Ul(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(!Ul(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)&&!Ul(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function u0(e){const t=w.useRef(e);return jl(()=>{t.current=e}),t}function L2(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,whileElementsMounted:i,open:s}=e,[a,l]=w.useState({x:null,y:null,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[c,d]=w.useState(r);Ul(c,r)||d(r);const f=w.useRef(null),p=w.useRef(null),h=w.useRef(a),E=u0(i),v=u0(o),[y,g]=w.useState(null),[m,_]=w.useState(null),S=w.useCallback(A=>{f.current!==A&&(f.current=A,g(A))},[]),x=w.useCallback(A=>{p.current!==A&&(p.current=A,_(A))},[]),R=w.useCallback(()=>{if(!f.current||!p.current)return;const A={placement:t,strategy:n,middleware:c};v.current&&(A.platform=v.current),b2(f.current,p.current,A).then(b=>{const V={...b,isPositioned:!0};I.current&&!Ul(h.current,V)&&(h.current=V,xo.flushSync(()=>{l(V)}))})},[c,t,n,v]);jl(()=>{s===!1&&h.current.isPositioned&&(h.current.isPositioned=!1,l(A=>({...A,isPositioned:!1})))},[s]);const I=w.useRef(!1);jl(()=>(I.current=!0,()=>{I.current=!1}),[]),jl(()=>{if(y&&m){if(E.current)return E.current(y,m,R);R()}},[y,m,R,E]);const L=w.useMemo(()=>({reference:f,floating:p,setReference:S,setFloating:x}),[S,x]),U=w.useMemo(()=>({reference:y,floating:m}),[y,m]);return w.useMemo(()=>({...a,update:R,refs:L,elements:U,reference:S,floating:x}),[a,R,L,U,S,x])}var Dr=typeof document<"u"?w.useLayoutEffect:w.useEffect;let xf=!1,D2=0;const d0=()=>"floating-ui-"+D2++;function k2(){const[e,t]=w.useState(()=>xf?d0():void 0);return Dr(()=>{e==null&&t(d0())},[]),w.useEffect(()=>{xf||(xf=!0)},[]),e}const Rf=lp["useId".toString()]||k2;function P2(){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 M2=w.createContext(null),j2=w.createContext(null),f0=()=>{var e;return((e=w.useContext(M2))==null?void 0:e.id)||null},Nf=()=>w.useContext(j2);function Tn(e){return(e==null?void 0:e.ownerDocument)||document}function p0(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function U2(){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 wf(e){return Tn(e).defaultView||window}function Kt(e){return e?e instanceof wf(e).Element:!1}function h0(e){return e?e instanceof wf(e).HTMLElement:!1}function F2(e){if(typeof ShadowRoot>"u")return!1;const t=wf(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function V2(e){if(e.mozInputSource===0&&e.isTrusted)return!0;const t=/Android/i;return(t.test(p0())||t.test(U2()))&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function $2(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 g0(){return/apple/i.test(navigator.vendor)}function B2(){return p0().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function m0(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function E0(e){const t=w.useRef(e);return Dr(()=>{t.current=e}),t}const v0="data-floating-ui-safe-polygon";function Of(e,t,n){return n&&!m0(n)?0:typeof e=="number"?e:e==null?void 0:e[t]}const H2=function(e,t){let{enabled:n=!0,delay:r=0,handleClose:o=null,mouseOnly:i=!1,restMs:s=0,move:a=!0}=t===void 0?{}:t;const{open:l,onOpenChange:c,dataRef:d,events:f,elements:{domReference:p,floating:h},refs:E}=e,v=Nf(),y=f0(),g=E0(o),m=E0(r),_=w.useRef(),S=w.useRef(),x=w.useRef(),R=w.useRef(),I=w.useRef(!0),L=w.useRef(!1),U=w.useRef(()=>{}),A=w.useCallback(()=>{var O;const j=(O=d.current.openEvent)==null?void 0:O.type;return(j==null?void 0:j.includes("mouse"))&&j!=="mousedown"},[d]);w.useEffect(()=>{if(!n)return;function O(){clearTimeout(S.current),clearTimeout(R.current),I.current=!0}return f.on("dismiss",O),()=>{f.off("dismiss",O)}},[n,f]),w.useEffect(()=>{if(!n||!g.current||!l)return;function O(){A()&&c(!1)}const j=Tn(h).documentElement;return j.addEventListener("mouseleave",O),()=>{j.removeEventListener("mouseleave",O)}},[h,l,c,n,g,d,A]);const b=w.useCallback(function(O){O===void 0&&(O=!0);const j=Of(m.current,"close",_.current);j&&!x.current?(clearTimeout(S.current),S.current=setTimeout(()=>c(!1),j)):O&&(clearTimeout(S.current),c(!1))},[m,c]),V=w.useCallback(()=>{U.current(),x.current=void 0},[]),M=w.useCallback(()=>{if(L.current){const O=Tn(E.floating.current).body;O.style.pointerEvents="",O.removeAttribute(v0),L.current=!1}},[E]);return w.useEffect(()=>{if(!n)return;function O(){return d.current.openEvent?["click","mousedown"].includes(d.current.openEvent.type):!1}function j(D){if(clearTimeout(S.current),I.current=!1,i&&!m0(_.current)||s>0&&Of(m.current,"open")===0)return;d.current.openEvent=D;const C=Of(m.current,"open",_.current);C?S.current=setTimeout(()=>{c(!0)},C):c(!0)}function P(D){if(O())return;U.current();const C=Tn(h);if(clearTimeout(R.current),g.current){l||clearTimeout(S.current),x.current=g.current({...e,tree:v,x:D.clientX,y:D.clientY,onClose(){M(),V(),b()}});const k=x.current;C.addEventListener("mousemove",k),U.current=()=>{C.removeEventListener("mousemove",k)};return}b()}function $(D){O()||g.current==null||g.current({...e,tree:v,x:D.clientX,y:D.clientY,onClose(){M(),V(),b()}})(D)}if(Kt(p)){const D=p;return l&&D.addEventListener("mouseleave",$),h==null||h.addEventListener("mouseleave",$),a&&D.addEventListener("mousemove",j,{once:!0}),D.addEventListener("mouseenter",j),D.addEventListener("mouseleave",P),()=>{l&&D.removeEventListener("mouseleave",$),h==null||h.removeEventListener("mouseleave",$),a&&D.removeEventListener("mousemove",j),D.removeEventListener("mouseenter",j),D.removeEventListener("mouseleave",P)}}},[p,h,n,e,i,s,a,b,V,M,c,l,v,m,g,d]),Dr(()=>{var O;if(n&&l&&(O=g.current)!=null&&O.__options.blockPointerEvents&&A()){const $=Tn(h).body;if($.setAttribute(v0,""),$.style.pointerEvents="none",L.current=!0,Kt(p)&&h){var j,P;const D=p,C=v==null||(j=v.nodesRef.current.find(k=>k.id===y))==null||(P=j.context)==null?void 0:P.elements.floating;return C&&(C.style.pointerEvents=""),D.style.pointerEvents="auto",h.style.pointerEvents="auto",()=>{D.style.pointerEvents="",h.style.pointerEvents=""}}}},[n,l,y,h,p,v,g,d,A]),Dr(()=>{l||(_.current=void 0,V(),M())},[l,V,M]),w.useEffect(()=>()=>{V(),clearTimeout(S.current),clearTimeout(R.current),M()},[n,V,M]),w.useMemo(()=>{if(!n)return{};function O(j){_.current=j.pointerType}return{reference:{onPointerDown:O,onPointerEnter:O,onMouseMove(){l||s===0||(clearTimeout(R.current),R.current=setTimeout(()=>{I.current||c(!0)},s))}},floating:{onMouseEnter(){clearTimeout(S.current)},onMouseLeave(){f.emit("dismiss",{type:"mouseLeave",data:{returnFocus:!1}}),b(!1)}}}},[f,n,s,l,c,b])};function Tf(){return Tf=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},Tf.apply(this,arguments)}function y0(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 Wo(e,t){if(!e||!t)return!1;const n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&F2(n)){let r=t;do{if(r&&e===r)return!0;r=r.parentNode||r.host}while(r)}return!1}function Fl(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 a;return o.parentId===s.id&&((a=o.context)==null?void 0:a.open)})})||[],n=n.concat(r);return n}function _0(e){return"composedPath"in e?e.composedPath()[0]:e.target}const S0=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function x0(e,t){const n=Yy(e,S0());t==="prev"&&n.reverse();const r=n.indexOf(y0(Tn(e)));return n.slice(r+1)[0]}function z2(){return x0(document.body,"next")}function W2(){return x0(document.body,"prev")}function Af(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Wo(n,r)}function G2(e){Yy(e,S0()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Y2(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 K2=lp["useInsertionEffect".toString()]||(e=>e());function If(e){const t=w.useRef(()=>{});return K2(()=>{t.current=e}),w.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 R0={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 bf,Cf;function N0(e){e.key==="Tab"&&(bf=e.target,clearTimeout(Cf))}function Q2(e){const t=bf===e.relatedTarget;return bf=e.relatedTarget,clearTimeout(Cf),t}const w0=w.forwardRef(function(t,n){const r=If(t.onFocus),[o,i]=w.useState();return Dr(()=>(g0()&&i("button"),document.addEventListener("keydown",N0),()=>{document.removeEventListener("keydown",N0)}),[]),w.createElement("span",Tf({},t,{ref:n,tabIndex:0,role:o,"aria-hidden":o?void 0:!0,"data-floating-ui-focus-guard":"",style:R0,onFocus:s=>{g0()&&B2()&&!Q2(s)?(s.persist(),Cf=window.setTimeout(()=>{r(s)},50)):r(s)}}))}),O0=w.createContext(null),X2=function(e){let{id:t,enabled:n=!0}=e===void 0?{}:e;const[r,o]=w.useState(null),i=Rf(),s=q2();return Dr(()=>{if(!n)return;const a=t?document.getElementById(t):null;if(a)a.setAttribute("data-floating-ui-portal",""),o(a);else{const l=document.createElement("div");t!==""&&(l.id=t||i),l.setAttribute("data-floating-ui-portal",""),o(l);const c=(s==null?void 0:s.portalNode)||document.body;return c.appendChild(l),()=>{c.removeChild(l)}}},[t,s,i,n]),r},T0=e=>{let{children:t,id:n,root:r=null,preserveTabOrder:o=!0}=e;const i=X2({id:n,enabled:!r}),[s,a]=w.useState(null),l=w.useRef(null),c=w.useRef(null),d=w.useRef(null),f=w.useRef(null),p=!!s&&!s.modal&&!!(r||i)&&o;return w.useEffect(()=>{if(!i||!o||s!=null&&s.modal)return;function h(E){i&&Af(E)&&(E.type==="focusin"?Y2:G2)(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]),w.createElement(O0.Provider,{value:w.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:l,afterOutsideRef:c,beforeInsideRef:d,afterInsideRef:f,portalNode:i,setFocusManagerState:a}),[o,i])},p&&i&&w.createElement(w0,{"data-type":"outside",ref:l,onFocus:h=>{if(Af(h,i)){var E;(E=d.current)==null||E.focus()}else{const v=W2()||(s==null?void 0:s.refs.domReference.current);v==null||v.focus()}}}),p&&i&&w.createElement("span",{"aria-owns":i.id,style:R0}),r?xo.createPortal(t,r):i?xo.createPortal(t,i):null,p&&i&&w.createElement(w0,{"data-type":"outside",ref:c,onFocus:h=>{if(Af(h,i)){var E;(E=f.current)==null||E.focus()}else{const v=z2()||(s==null?void 0:s.refs.domReference.current);v==null||v.focus(),s!=null&&s.closeOnFocusOut&&(s==null||s.onOpenChange(!1))}}}))},q2=()=>w.useContext(O0);function Vl(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 J2={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Z2={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},eC=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}},tC=function(e,t){let{open:n,onOpenChange:r,events:o,nodeId:i,elements:{reference:s,domReference:a,floating:l},dataRef:c}=e,{enabled:d=!0,escapeKey:f=!0,outsidePress:p=!0,outsidePressEvent:h="pointerdown",referencePress:E=!1,referencePressEvent:v="pointerdown",ancestorScroll:y=!1,bubbles:g=!0}=t===void 0?{}:t;const m=Nf(),_=f0()!=null,S=If(typeof p=="function"?p:()=>!1),x=typeof p=="function"?S:p,R=w.useRef(!1),{escapeKeyBubbles:I,outsidePressBubbles:L}=eC(g);return w.useEffect(()=>{if(!n||!d)return;c.current.__escapeKeyBubbles=I,c.current.__outsidePressBubbles=L;function U(O){if(O.key==="Escape"){const j=m?Fl(m.nodesRef.current,i):[];if(j.length>0){let P=!0;if(j.forEach($=>{var D;if((D=$.context)!=null&&D.open&&!$.context.dataRef.current.__escapeKeyBubbles){P=!1;return}}),!P)return}o.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),r(!1)}}function A(O){const j=R.current;if(R.current=!1,j||typeof x=="function"&&!x(O))return;const P=_0(O);if(h0(P)&&l){const C=l.ownerDocument.defaultView||window,k=P.scrollWidth>P.clientWidth,F=P.scrollHeight>P.clientHeight;let B=F&&O.offsetX>P.clientWidth;if(F&&C.getComputedStyle(P).direction==="rtl"&&(B=O.offsetX<=P.offsetWidth-P.clientWidth),B||k&&O.offsetY>P.clientHeight)return}const $=m&&Fl(m.nodesRef.current,i).some(C=>{var k;return Vl(O,(k=C.context)==null?void 0:k.elements.floating)});if(Vl(O,l)||Vl(O,a)||$)return;const D=m?Fl(m.nodesRef.current,i):[];if(D.length>0){let C=!0;if(D.forEach(k=>{var F;if((F=k.context)!=null&&F.open&&!k.context.dataRef.current.__outsidePressBubbles){C=!1;return}}),!C)return}o.emit("dismiss",{type:"outsidePress",data:{returnFocus:_?{preventScroll:!0}:V2(O)||$2(O)}}),r(!1)}function b(){r(!1)}const V=Tn(l);f&&V.addEventListener("keydown",U),x&&V.addEventListener(h,A);let M=[];return y&&(Kt(a)&&(M=ir(a)),Kt(l)&&(M=M.concat(ir(l))),!Kt(s)&&s&&s.contextElement&&(M=M.concat(ir(s.contextElement)))),M=M.filter(O=>{var j;return O!==((j=V.defaultView)==null?void 0:j.visualViewport)}),M.forEach(O=>{O.addEventListener("scroll",b,{passive:!0})}),()=>{f&&V.removeEventListener("keydown",U),x&&V.removeEventListener(h,A),M.forEach(O=>{O.removeEventListener("scroll",b)})}},[c,l,a,s,f,x,h,o,m,i,n,r,y,d,I,L,_]),w.useEffect(()=>{R.current=!1},[x,h]),w.useMemo(()=>d?{reference:{[J2[v]]:()=>{E&&(o.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),r(!1))}},floating:{[Z2[h]]:()=>{R.current=!0}}}:{},[d,o,E,h,v,r])},nC=function(e,t){let{open:n,onOpenChange:r,dataRef:o,events:i,refs:s,elements:{floating:a,domReference:l}}=e,{enabled:c=!0,keyboardOnly:d=!0}=t===void 0?{}:t;const f=w.useRef(""),p=w.useRef(!1),h=w.useRef();return w.useEffect(()=>{if(!c)return;const v=Tn(a).defaultView||window;function y(){!n&&h0(l)&&l===y0(Tn(l))&&(p.current=!0)}return v.addEventListener("blur",y),()=>{v.removeEventListener("blur",y)}},[a,l,n,c]),w.useEffect(()=>{if(!c)return;function E(v){(v.type==="referencePress"||v.type==="escapeKey")&&(p.current=!0)}return i.on("dismiss",E),()=>{i.off("dismiss",E)}},[i,c]),w.useEffect(()=>()=>{clearTimeout(h.current)},[]),w.useMemo(()=>c?{reference:{onPointerDown(E){let{pointerType:v}=E;f.current=v,p.current=!!(v&&d)},onMouseLeave(){p.current=!1},onFocus(E){var v;p.current||E.type==="focus"&&((v=o.current.openEvent)==null?void 0:v.type)==="mousedown"&&o.current.openEvent&&Vl(o.current.openEvent,l)||(o.current.openEvent=E.nativeEvent,r(!0))},onBlur(E){p.current=!1;const v=E.relatedTarget,y=Kt(v)&&v.hasAttribute("data-floating-ui-focus-guard")&&v.getAttribute("data-type")==="outside";h.current=setTimeout(()=>{Wo(s.floating.current,v)||Wo(l,v)||y||r(!1)})}}}:{},[c,d,l,s,o,r])};function A0(e){return w.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})},e)}const rC=function(e,t){let{open:n}=e,{enabled:r=!0,role:o="dialog"}=t===void 0?{}:t;const i=Rf(),s=Rf();return w.useMemo(()=>{const a={id:i,role:o};return r?o==="tooltip"?{reference:{"aria-describedby":n?i:void 0},floating:a}:{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:{...a,...o==="menu"&&{"aria-labelledby":s}}}:{}},[r,o,n,i,s])};function oC(e,t){const[n,r]=e;let o=!1;const i=t.length;for(let s=0,a=i-1;s<i;a=s++){const[l,c]=t[s]||[0,0],[d,f]=t[a]||[0,0];c>=r!=f>=r&&n<=(d-l)*(r-c)/(f-c)+l&&(o=!o)}return o}function iC(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function sC(e){let{restMs:t=0,buffer:n=.5,blockPointerEvents:r=!1}=e===void 0?{}:e,o,i=!1,s=!1;const a=l=>{let{x:c,y:d,placement:f,elements:p,onClose:h,nodeId:E,tree:v}=l;return function(g){function m(){clearTimeout(o),h()}if(clearTimeout(o),!p.domReference||!p.floating||f==null||c==null||d==null)return;const{clientX:_,clientY:S}=g,x=[_,S],R=_0(g),I=g.type==="mouseleave",L=Wo(p.floating,R),U=Wo(p.domReference,R),A=p.domReference.getBoundingClientRect(),b=p.floating.getBoundingClientRect(),V=f.split("-")[0],M=c>b.right-b.width/2,O=d>b.bottom-b.height/2,j=iC(x,A);if(L&&(s=!0,!I))return;if(U&&(s=!1),U&&!I){s=!0;return}if(I&&Kt(g.relatedTarget)&&Wo(p.floating,g.relatedTarget)||v&&Fl(v.nodesRef.current,E).some(C=>{let{context:k}=C;return k==null?void 0:k.open}))return;if(V==="top"&&d>=A.bottom-1||V==="bottom"&&d<=A.top+1||V==="left"&&c>=A.right-1||V==="right"&&c<=A.left+1)return m();let P=[];switch(V){case"top":P=[[b.left,A.top+1],[b.left,b.bottom-1],[b.right,b.bottom-1],[b.right,A.top+1]],i=_>=b.left&&_<=b.right&&S>=b.top&&S<=A.top+1;break;case"bottom":P=[[b.left,b.top+1],[b.left,A.bottom-1],[b.right,A.bottom-1],[b.right,b.top+1]],i=_>=b.left&&_<=b.right&&S>=A.bottom-1&&S<=b.bottom;break;case"left":P=[[b.right-1,b.bottom],[b.right-1,b.top],[A.left+1,b.top],[A.left+1,b.bottom]],i=_>=b.left&&_<=A.left+1&&S>=b.top&&S<=b.bottom;break;case"right":P=[[A.right-1,b.bottom],[A.right-1,b.top],[b.left+1,b.top],[b.left+1,b.bottom]],i=_>=A.right-1&&_<=b.right&&S>=b.top&&S<=b.bottom;break}function $(C){let[k,F]=C;const B=b.width>A.width,z=b.height>A.height;switch(V){case"top":{const W=[B?k+n/2:M?k+n*4:k-n*4,F+n+1],X=[B?k-n/2:M?k+n*4:k-n*4,F+n+1],Q=[[b.left,M||B?b.bottom-n:b.top],[b.right,M?B?b.bottom-n:b.top:b.bottom-n]];return[W,X,...Q]}case"bottom":{const W=[B?k+n/2:M?k+n*4:k-n*4,F-n],X=[B?k-n/2:M?k+n*4:k-n*4,F-n],Q=[[b.left,M||B?b.top+n:b.bottom],[b.right,M?B?b.top+n:b.bottom:b.top+n]];return[W,X,...Q]}case"left":{const W=[k+n+1,z?F+n/2:O?F+n*4:F-n*4],X=[k+n+1,z?F-n/2:O?F+n*4:F-n*4];return[...[[O||z?b.right-n:b.left,b.top],[O?z?b.right-n:b.left:b.right-n,b.bottom]],W,X]}case"right":{const W=[k-n,z?F+n/2:O?F+n*4:F-n*4],X=[k-n,z?F-n/2:O?F+n*4:F-n*4],Q=[[O||z?b.left+n:b.right,b.top],[O?z?b.left+n:b.right:b.left+n,b.bottom]];return[W,X,...Q]}}}const D=i?P:$([c,d]);if(!i){if(s&&!j)return m();oC([_,S],D)?t&&!s&&(o=setTimeout(m,t)):m()}}};return a.__options={blockPointerEvents:r},a}function aC(e){e===void 0&&(e={});const{open:t=!1,onOpenChange:n,nodeId:r}=e,o=L2(e),i=Nf(),s=w.useRef(null),a=w.useRef({}),l=w.useState(()=>P2())[0],[c,d]=w.useState(null),f=w.useCallback(g=>{const m=Kt(g)?{getBoundingClientRect:()=>g.getBoundingClientRect(),contextElement:g}:g;o.refs.setReference(m)},[o.refs]),p=w.useCallback(g=>{(Kt(g)||g===null)&&(s.current=g,d(g)),(Kt(o.refs.reference.current)||o.refs.reference.current===null||g!==null&&!Kt(g))&&o.refs.setReference(g)},[o.refs]),h=w.useMemo(()=>({...o.refs,setReference:p,setPositionReference:f,domReference:s}),[o.refs,p,f]),E=w.useMemo(()=>({...o.elements,domReference:c}),[o.elements,c]),v=If(n),y=w.useMemo(()=>({...o,refs:h,elements:E,dataRef:a,nodeId:r,events:l,open:t,onOpenChange:v}),[o,r,l,t,v,h,E]);return Dr(()=>{const g=i==null?void 0:i.nodesRef.current.find(m=>m.id===r);g&&(g.context=y)}),w.useMemo(()=>({...o,context:y,refs:h,reference:p,positionReference:f}),[o,h,y,p,f])}function Lf(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[a,l]=s;if(a.indexOf("on")===0){if(r.has(a)||r.set(a,[]),typeof l=="function"){var c;(c=r.get(a))==null||c.push(l),o[a]=function(){for(var d,f=arguments.length,p=new Array(f),h=0;h<f;h++)p[h]=arguments[h];(d=r.get(a))==null||d.forEach(E=>E(...p))}}}else o[a]=l}),o),{})}}const lC=function(e){e===void 0&&(e=[]);const t=e,n=w.useCallback(i=>Lf(i,e,"reference"),t),r=w.useCallback(i=>Lf(i,e,"floating"),t),o=w.useCallback(i=>Lf(i,e,"item"),e.map(i=>i==null?void 0:i.item));return w.useMemo(()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:o}),[n,r,o])};function cC({arrowPadding:e,escapeKey:t=!0,initialOpen:n=!1,keepOpenOverContent:r=!1,onOpenChange:o,open:i,outsidePress:s=!0,placement:a,role:l="tooltip"}){const c=Y(R=>R.rootElementId),d=w.useRef(null),[f,p]=w.useState(n),h=i??f,E=o??p,v=aC({middleware:[R2(8),x2({boundary:document.querySelector(`#${c}`)||void 0}),w2({padding:4}),C2({element:d,padding:e??{bottom:0,left:8,right:8,top:8}})],onOpenChange:E,open:h,placement:a,strategy:"fixed",whileElementsMounted:I2}),y=v.context,g=H2(y,{enabled:i==null,handleClose:r?sC():null,move:!1}),m=nC(y,{enabled:i==null}),_=tC(y,{escapeKey:t,outsidePress:s}),S=rC(y,{role:l}),x=lC([g,m,_,S]);return w.useMemo(()=>({arrowRef:d,open:h,setOpen:E,...x,...v}),[h,E,x,v])}const I0=Wr.createContext(null),Df=()=>{const e=Wr.useContext(I0);if(e==null)throw new Error("Tooltip components must be wrapped in <Tooltip />");return e},uC=({children:e,...t})=>{const n=cC(t);return u.jsx(I0.Provider,{value:n,children:e})},dC={bottom:"-top-1 before:border-b-0 before:border-r-0",left:"-right-1 before:border-r-0 before:border-t-0",right:"-left-1 before:border-l-0 before:border-b-0",top:"-bottom-1 before:border-t-0 before:border-l-0"},fC=()=>{var s,a;const e=Df(),[t,n]=w.useState(e.middlewareData.arrow);w.useEffect(()=>{e.middlewareData.arrow&&n(e.middlewareData.arrow)},[e.middlewareData.arrow]);const r={left:(t==null?void 0:t.x)!=null?`${t==null?void 0:t.x}px`:"",top:(t==null?void 0:t.y)!=null?`${t==null?void 0:t.y}px`:""},o=((a=(s=e.placement)==null?void 0:s.split("-"))==null?void 0:a[0])||"top",i=`${dC[o]}`;return u.jsx("div",{ref:e.arrowRef,style:r,className:`tooltip-arrow absolute h-2 w-2 rotate-45 bg-inherit
60
+ */var zl=O,dR=uR;function fR(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var pR=typeof Object.is=="function"?Object.is:fR,hR=dR.useSyncExternalStore,mR=zl.useRef,gR=zl.useEffect,ER=zl.useMemo,yR=zl.useDebugValue;Ng.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var s=mR(null);if(s.current===null){var i={hasValue:!1,value:null};s.current=i}else i=s.current;s=ER(function(){function a(h){if(!c){if(c=!0,u=h,h=r(h),o!==void 0&&i.hasValue){var E=i.value;if(o(E,h))return f=E}return f=h}if(E=f,pR(u,h))return E;var y=r(h);return o!==void 0&&o(E,y)?E:(u=h,f=y)}var c=!1,u,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=hR(e,s[0],s[1]);return gR(function(){i.hasValue=!0,i.value=l},[l]),yR(l),l},Rg.exports=Ng;var vR=Rg.exports;const Tg=Ba(vR);var _R={VITE_BASE_URL:"",VITE_BASIC_AUTH:"signalwire:1aG93uXk",VITE_DEFAULT_STYLE_HREF:"https://cdn.swire.io/npm/@signalwire/cfb@dev/dist/style.css",VITE_DEFAULT_VOICES_URL:"https://cdn.signalwire.com/npm/@signalwire/cfb@dev/dist/voices.json",VITE_FLOW_DATA_VERSION:"0.0.10",VITE_IS_STAGING:"true",BASE_URL:"/cfb/",MODE:"staging",DEV:!1,PROD:!0,SSR:!1};const Ag=e=>{let t;const n=new Set,r=(a,c)=>{const u=typeof a=="function"?a(t):a;if(!Object.is(u,t)){const f=t;t=c??(typeof u!="object"||u===null)?u:Object.assign({},t,u),n.forEach(p=>p(t,f))}},o=()=>t,l={setState:r,getState:o,subscribe:a=>(n.add(a),()=>n.delete(a)),destroy:()=>{(_R?"staging":void 0)!=="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},Ig=e=>e?Ag(e):Ag,{useDebugValue:SR}=H,{useSyncExternalStoreWithSelector:xR}=Tg;function Cg(e,t=e.getState,n){const r=xR(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return SR(r),r}const Lg=(e,t)=>{const n=Ig(e),r=(o,s=t)=>Cg(n,o,s);return Object.assign(r,n),r},RR=(e,t)=>e?Lg(e,t):Lg;function Ge(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 NR={value:()=>{}};function Wl(){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 Gl(n)}function Gl(e){this._=e}function wR(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}})}Gl.prototype=Wl.prototype={constructor:Gl,on:function(e,t){var n=this._,r=wR(e+"",n),o,s=-1,i=r.length;if(arguments.length<2){for(;++s<i;)if((o=(e=r[s]).type)&&(o=OR(n[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<i;)if(o=(e=r[s]).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 Gl(e)},call:function(e,t){if((o=arguments.length-2)>0)for(var n=new Array(o),r=0,o,s;r<o;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],r=0,o=s.length;r<o;++r)s[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,s=r.length;o<s;++o)r[o].value.apply(t,n)}};function OR(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]=NR,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var pd="http://www.w3.org/1999/xhtml";const Dg={svg:"http://www.w3.org/2000/svg",xhtml:pd,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Yl(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Dg.hasOwnProperty(t)?{space:Dg[t],local:e}:e}function TR(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===pd&&t.documentElement.namespaceURI===pd?t.createElement(e):t.createElementNS(n,e)}}function AR(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function kg(e){var t=Yl(e);return(t.local?AR:TR)(t)}function IR(){}function hd(e){return e==null?IR:function(){return this.querySelector(e)}}function CR(e){typeof e!="function"&&(e=hd(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var s=t[o],i=s.length,l=r[o]=new Array(i),a,c,u=0;u<i;++u)(a=s[u])&&(c=e.call(a,a.__data__,u,s))&&("__data__"in a&&(c.__data__=a.__data__),l[u]=c);return new Et(r,this._parents)}function LR(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function bR(){return[]}function Pg(e){return e==null?bR:function(){return this.querySelectorAll(e)}}function DR(e){return function(){return LR(e.apply(this,arguments))}}function kR(e){typeof e=="function"?e=DR(e):e=Pg(e);for(var t=this._groups,n=t.length,r=[],o=[],s=0;s<n;++s)for(var i=t[s],l=i.length,a,c=0;c<l;++c)(a=i[c])&&(r.push(e.call(a,a.__data__,c,i)),o.push(a));return new Et(r,o)}function Mg(e){return function(){return this.matches(e)}}function Ug(e){return function(t){return t.matches(e)}}var PR=Array.prototype.find;function MR(e){return function(){return PR.call(this.children,e)}}function UR(){return this.firstElementChild}function FR(e){return this.select(e==null?UR:MR(typeof e=="function"?e:Ug(e)))}var jR=Array.prototype.filter;function VR(){return Array.from(this.children)}function $R(e){return function(){return jR.call(this.children,e)}}function HR(e){return this.selectAll(e==null?VR:$R(typeof e=="function"?e:Ug(e)))}function BR(e){typeof e!="function"&&(e=Mg(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var s=t[o],i=s.length,l=r[o]=[],a,c=0;c<i;++c)(a=s[c])&&e.call(a,a.__data__,c,s)&&l.push(a);return new Et(r,this._parents)}function Fg(e){return new Array(e.length)}function zR(){return new Et(this._enter||this._groups.map(Fg),this._parents)}function Kl(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Kl.prototype={constructor:Kl,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 WR(e){return function(){return e}}function GR(e,t,n,r,o,s){for(var i=0,l,a=t.length,c=s.length;i<c;++i)(l=t[i])?(l.__data__=s[i],r[i]=l):n[i]=new Kl(e,s[i]);for(;i<a;++i)(l=t[i])&&(o[i]=l)}function YR(e,t,n,r,o,s,i){var l,a,c=new Map,u=t.length,f=s.length,p=new Array(u),h;for(l=0;l<u;++l)(a=t[l])&&(p[l]=h=i.call(a,a.__data__,l,t)+"",c.has(h)?o[l]=a:c.set(h,a));for(l=0;l<f;++l)h=i.call(e,s[l],l,s)+"",(a=c.get(h))?(r[l]=a,a.__data__=s[l],c.delete(h)):n[l]=new Kl(e,s[l]);for(l=0;l<u;++l)(a=t[l])&&c.get(p[l])===a&&(o[l]=a)}function KR(e){return e.__data__}function XR(e,t){if(!arguments.length)return Array.from(this,KR);var n=t?YR:GR,r=this._parents,o=this._groups;typeof e!="function"&&(e=WR(e));for(var s=o.length,i=new Array(s),l=new Array(s),a=new Array(s),c=0;c<s;++c){var u=r[c],f=o[c],p=f.length,h=QR(e.call(u,u&&u.__data__,c,r)),E=h.length,y=l[c]=new Array(E),v=i[c]=new Array(E),m=a[c]=new Array(p);n(u,f,y,v,m,h,t);for(var g=0,S=0,_,x;g<E;++g)if(_=y[g]){for(g>=S&&(S=g+1);!(x=v[S])&&++S<E;);_._next=x||null}}return i=new Et(i,r),i._enter=l,i._exit=a,i}function QR(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function qR(){return new Et(this._exit||this._groups.map(Fg),this._parents)}function JR(e,t,n){var r=this.enter(),o=this,s=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?s.remove():n(s),r&&o?r.merge(o).order():o}function ZR(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,o=n.length,s=r.length,i=Math.min(o,s),l=new Array(o),a=0;a<i;++a)for(var c=n[a],u=r[a],f=c.length,p=l[a]=new Array(f),h,E=0;E<f;++E)(h=c[E]||u[E])&&(p[E]=h);for(;a<o;++a)l[a]=n[a];return new Et(l,this._parents)}function eN(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],o=r.length-1,s=r[o],i;--o>=0;)(i=r[o])&&(s&&i.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(i,s),s=i);return this}function tN(e){e||(e=nN);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),s=0;s<r;++s){for(var i=n[s],l=i.length,a=o[s]=new Array(l),c,u=0;u<l;++u)(c=i[u])&&(a[u]=c);a.sort(t)}return new Et(o,this._parents).order()}function nN(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function rN(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function oN(){return Array.from(this)}function sN(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,s=r.length;o<s;++o){var i=r[o];if(i)return i}return null}function iN(){let e=0;for(const t of this)++e;return e}function lN(){return!this.node()}function aN(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var o=t[n],s=0,i=o.length,l;s<i;++s)(l=o[s])&&e.call(l,l.__data__,s,o);return this}function cN(e){return function(){this.removeAttribute(e)}}function uN(e){return function(){this.removeAttributeNS(e.space,e.local)}}function dN(e,t){return function(){this.setAttribute(e,t)}}function fN(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function pN(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function hN(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 mN(e,t){var n=Yl(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?uN:cN:typeof t=="function"?n.local?hN:pN:n.local?fN:dN)(n,t))}function jg(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function gN(e){return function(){this.style.removeProperty(e)}}function EN(e,t,n){return function(){this.style.setProperty(e,t,n)}}function yN(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function vN(e,t,n){return arguments.length>1?this.each((t==null?gN:typeof t=="function"?yN:EN)(e,t,n??"")):Eo(this.node(),e)}function Eo(e,t){return e.style.getPropertyValue(t)||jg(e).getComputedStyle(e,null).getPropertyValue(t)}function _N(e){return function(){delete this[e]}}function SN(e,t){return function(){this[e]=t}}function xN(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function RN(e,t){return arguments.length>1?this.each((t==null?_N:typeof t=="function"?xN:SN)(e,t)):this.node()[e]}function Vg(e){return e.trim().split(/^|\s+/)}function md(e){return e.classList||new $g(e)}function $g(e){this._node=e,this._names=Vg(e.getAttribute("class")||"")}$g.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 Hg(e,t){for(var n=md(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function Bg(e,t){for(var n=md(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function NN(e){return function(){Hg(this,e)}}function wN(e){return function(){Bg(this,e)}}function ON(e,t){return function(){(t.apply(this,arguments)?Hg:Bg)(this,e)}}function TN(e,t){var n=Vg(e+"");if(arguments.length<2){for(var r=md(this.node()),o=-1,s=n.length;++o<s;)if(!r.contains(n[o]))return!1;return!0}return this.each((typeof t=="function"?ON:t?NN:wN)(n,t))}function AN(){this.textContent=""}function IN(e){return function(){this.textContent=e}}function CN(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function LN(e){return arguments.length?this.each(e==null?AN:(typeof e=="function"?CN:IN)(e)):this.node().textContent}function bN(){this.innerHTML=""}function DN(e){return function(){this.innerHTML=e}}function kN(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function PN(e){return arguments.length?this.each(e==null?bN:(typeof e=="function"?kN:DN)(e)):this.node().innerHTML}function MN(){this.nextSibling&&this.parentNode.appendChild(this)}function UN(){return this.each(MN)}function FN(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function jN(){return this.each(FN)}function VN(e){var t=typeof e=="function"?e:kg(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function $N(){return null}function HN(e,t){var n=typeof e=="function"?e:kg(e),r=t==null?$N:typeof t=="function"?t:hd(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function BN(){var e=this.parentNode;e&&e.removeChild(this)}function zN(){return this.each(BN)}function WN(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function GN(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function YN(e){return this.select(e?GN:WN)}function KN(e){return arguments.length?this.property("__data__",e):this.node().__data__}function XN(e){return function(t){e.call(this,t,this.__data__)}}function QN(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 qN(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,o=t.length,s;n<o;++n)s=t[n],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):t[++r]=s;++r?t.length=r:delete this.__on}}}function JN(e,t,n){return function(){var r=this.__on,o,s=XN(t);if(r){for(var i=0,l=r.length;i<l;++i)if((o=r[i]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=s,o.options=n),o.value=t;return}}this.addEventListener(e.type,s,n),o={type:e.type,name:e.name,value:t,listener:s,options:n},r?r.push(o):this.__on=[o]}}function ZN(e,t,n){var r=QN(e+""),o,s=r.length,i;if(arguments.length<2){var l=this.node().__on;if(l){for(var a=0,c=l.length,u;a<c;++a)for(o=0,u=l[a];o<s;++o)if((i=r[o]).type===u.type&&i.name===u.name)return u.value}return}for(l=t?JN:qN,o=0;o<s;++o)this.each(l(r[o],t,n));return this}function zg(e,t,n){var r=jg(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 e1(e,t){return function(){return zg(this,e,t)}}function t1(e,t){return function(){return zg(this,e,t.apply(this,arguments))}}function n1(e,t){return this.each((typeof t=="function"?t1:e1)(e,t))}function*r1(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,s=r.length,i;o<s;++o)(i=r[o])&&(yield i)}var Wg=[null];function Et(e,t){this._groups=e,this._parents=t}function Hs(){return new Et([[document.documentElement]],Wg)}function o1(){return this}Et.prototype=Hs.prototype={constructor:Et,select:CR,selectAll:kR,selectChild:FR,selectChildren:HR,filter:BR,data:XR,enter:zR,exit:qR,join:JR,merge:ZR,selection:o1,order:eN,sort:tN,call:rN,nodes:oN,node:sN,size:iN,empty:lN,each:aN,attr:mN,style:vN,property:RN,classed:TN,text:LN,html:PN,raise:UN,lower:jN,append:VN,insert:HN,remove:zN,clone:YN,datum:KN,on:ZN,dispatch:n1,[Symbol.iterator]:r1};function jt(e){return typeof e=="string"?new Et([[document.querySelector(e)]],[document.documentElement]):new Et([[e]],Wg)}function s1(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Xt(e,t){if(e=s1(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 i1={passive:!1},Bs={capture:!0,passive:!1};function gd(e){e.stopImmediatePropagation()}function yo(e){e.preventDefault(),e.stopImmediatePropagation()}function Gg(e){var t=e.document.documentElement,n=jt(e).on("dragstart.drag",yo,Bs);"onselectstart"in t?n.on("selectstart.drag",yo,Bs):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Yg(e,t){var n=e.document.documentElement,r=jt(e).on("dragstart.drag",null);t&&(r.on("click.drag",yo,Bs),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 Xl=e=>()=>e;function Ed(e,{sourceEvent:t,subject:n,target:r,identifier:o,active:s,x:i,y:l,dx:a,dy:c,dispatch:u}){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:s,enumerable:!0,configurable:!0},x:{value:i,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:a,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:u}})}Ed.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function l1(e){return!e.ctrlKey&&!e.button}function a1(){return this.parentNode}function c1(e,t){return t??{x:e.x,y:e.y}}function u1(){return navigator.maxTouchPoints||"ontouchstart"in this}function d1(){var e=l1,t=a1,n=c1,r=u1,o={},s=Wl("start","drag","end"),i=0,l,a,c,u,f=0;function p(_){_.on("mousedown.drag",h).filter(r).on("touchstart.drag",v).on("touchmove.drag",m,i1).on("touchend.drag touchcancel.drag",g).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(_,x){if(!(u||!e.call(this,_,x))){var R=S(this,t.call(this,_,x),_,x,"mouse");R&&(jt(_.view).on("mousemove.drag",E,Bs).on("mouseup.drag",y,Bs),Gg(_.view),gd(_),c=!1,l=_.clientX,a=_.clientY,R("start",_))}}function E(_){if(yo(_),!c){var x=_.clientX-l,R=_.clientY-a;c=x*x+R*R>f}o.mouse("drag",_)}function y(_){jt(_.view).on("mousemove.drag mouseup.drag",null),Yg(_.view,c),yo(_),o.mouse("end",_)}function v(_,x){if(e.call(this,_,x)){var R=_.changedTouches,T=t.call(this,_,x),L=R.length,P,I;for(P=0;P<L;++P)(I=S(this,T,_,x,R[P].identifier,R[P]))&&(gd(_),I("start",_,R[P]))}}function m(_){var x=_.changedTouches,R=x.length,T,L;for(T=0;T<R;++T)(L=o[x[T].identifier])&&(yo(_),L("drag",_,x[T]))}function g(_){var x=_.changedTouches,R=x.length,T,L;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),T=0;T<R;++T)(L=o[x[T].identifier])&&(gd(_),L("end",_,x[T]))}function S(_,x,R,T,L,P){var I=s.copy(),j=Xt(P||R,x),V,M,w;if((w=n.call(_,new Ed("beforestart",{sourceEvent:R,target:p,identifier:L,active:i,x:j[0],y:j[1],dx:0,dy:0,dispatch:I}),T))!=null)return V=w.x-j[0]||0,M=w.y-j[1]||0,function b(k,F,C){var D=j,U;switch(k){case"start":o[L]=b,U=i++;break;case"end":delete o[L],--i;case"drag":j=Xt(C||F,x),U=i;break}I.call(k,_,new Ed(k,{sourceEvent:F,subject:w,target:p,identifier:L,active:U,x:j[0]+V,y:j[1]+M,dx:j[0]-D[0],dy:j[1]-D[1],dispatch:I}),T)}}return p.filter=function(_){return arguments.length?(e=typeof _=="function"?_:Xl(!!_),p):e},p.container=function(_){return arguments.length?(t=typeof _=="function"?_:Xl(_),p):t},p.subject=function(_){return arguments.length?(n=typeof _=="function"?_:Xl(_),p):n},p.touchable=function(_){return arguments.length?(r=typeof _=="function"?_:Xl(!!_),p):r},p.on=function(){var _=s.on.apply(s,arguments);return _===s?p:_},p.clickDistance=function(_){return arguments.length?(f=(_=+_)*_,p):Math.sqrt(f)},p}function yd(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Kg(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function zs(){}var Ws=.7,Ql=1/Ws,vo="\\s*([+-]?\\d+)\\s*",Gs="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Qt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",f1=/^#([0-9a-f]{3,8})$/,p1=new RegExp(`^rgb\\(${vo},${vo},${vo}\\)$`),h1=new RegExp(`^rgb\\(${Qt},${Qt},${Qt}\\)$`),m1=new RegExp(`^rgba\\(${vo},${vo},${vo},${Gs}\\)$`),g1=new RegExp(`^rgba\\(${Qt},${Qt},${Qt},${Gs}\\)$`),E1=new RegExp(`^hsl\\(${Gs},${Qt},${Qt}\\)$`),y1=new RegExp(`^hsla\\(${Gs},${Qt},${Qt},${Gs}\\)$`),Xg={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};yd(zs,Ys,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Qg,formatHex:Qg,formatHex8:v1,formatHsl:_1,formatRgb:qg,toString:qg});function Qg(){return this.rgb().formatHex()}function v1(){return this.rgb().formatHex8()}function _1(){return nE(this).formatHsl()}function qg(){return this.rgb().formatRgb()}function Ys(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=f1.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Jg(t):n===3?new st(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?ql(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?ql(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=p1.exec(e))?new st(t[1],t[2],t[3],1):(t=h1.exec(e))?new st(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=m1.exec(e))?ql(t[1],t[2],t[3],t[4]):(t=g1.exec(e))?ql(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=E1.exec(e))?tE(t[1],t[2]/100,t[3]/100,1):(t=y1.exec(e))?tE(t[1],t[2]/100,t[3]/100,t[4]):Xg.hasOwnProperty(e)?Jg(Xg[e]):e==="transparent"?new st(NaN,NaN,NaN,0):null}function Jg(e){return new st(e>>16&255,e>>8&255,e&255,1)}function ql(e,t,n,r){return r<=0&&(e=t=n=NaN),new st(e,t,n,r)}function S1(e){return e instanceof zs||(e=Ys(e)),e?(e=e.rgb(),new st(e.r,e.g,e.b,e.opacity)):new st}function vd(e,t,n,r){return arguments.length===1?S1(e):new st(e,t,n,r??1)}function st(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}yd(st,vd,Kg(zs,{brighter(e){return e=e==null?Ql:Math.pow(Ql,e),new st(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ws:Math.pow(Ws,e),new st(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new st(yr(this.r),yr(this.g),yr(this.b),Jl(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:Zg,formatHex:Zg,formatHex8:x1,formatRgb:eE,toString:eE}));function Zg(){return`#${vr(this.r)}${vr(this.g)}${vr(this.b)}`}function x1(){return`#${vr(this.r)}${vr(this.g)}${vr(this.b)}${vr((isNaN(this.opacity)?1:this.opacity)*255)}`}function eE(){const e=Jl(this.opacity);return`${e===1?"rgb(":"rgba("}${yr(this.r)}, ${yr(this.g)}, ${yr(this.b)}${e===1?")":`, ${e})`}`}function Jl(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function yr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function vr(e){return e=yr(e),(e<16?"0":"")+e.toString(16)}function tE(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Vt(e,t,n,r)}function nE(e){if(e instanceof Vt)return new Vt(e.h,e.s,e.l,e.opacity);if(e instanceof zs||(e=Ys(e)),!e)return new Vt;if(e instanceof Vt)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),s=Math.max(t,n,r),i=NaN,l=s-o,a=(s+o)/2;return l?(t===s?i=(n-r)/l+(n<r)*6:n===s?i=(r-t)/l+2:i=(t-n)/l+4,l/=a<.5?s+o:2-s-o,i*=60):l=a>0&&a<1?0:i,new Vt(i,l,a,e.opacity)}function R1(e,t,n,r){return arguments.length===1?nE(e):new Vt(e,t,n,r??1)}function Vt(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}yd(Vt,R1,Kg(zs,{brighter(e){return e=e==null?Ql:Math.pow(Ql,e),new Vt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ws:Math.pow(Ws,e),new Vt(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 st(_d(e>=240?e-240:e+120,o,r),_d(e,o,r),_d(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new Vt(rE(this.h),Zl(this.s),Zl(this.l),Jl(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=Jl(this.opacity);return`${e===1?"hsl(":"hsla("}${rE(this.h)}, ${Zl(this.s)*100}%, ${Zl(this.l)*100}%${e===1?")":`, ${e})`}`}}));function rE(e){return e=(e||0)%360,e<0?e+360:e}function Zl(e){return Math.max(0,Math.min(1,e||0))}function _d(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 oE=e=>()=>e;function N1(e,t){return function(n){return e+n*t}}function w1(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 O1(e){return(e=+e)==1?sE:function(t,n){return n-t?w1(t,n,e):oE(isNaN(t)?n:t)}}function sE(e,t){var n=t-e;return n?N1(e,n):oE(isNaN(e)?t:e)}const iE=function e(t){var n=O1(t);function r(o,s){var i=n((o=vd(o)).r,(s=vd(s)).r),l=n(o.g,s.g),a=n(o.b,s.b),c=sE(o.opacity,s.opacity);return function(u){return o.r=i(u),o.g=l(u),o.b=a(u),o.opacity=c(u),o+""}}return r.gamma=e,r}(1);function Hn(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var Sd=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,xd=new RegExp(Sd.source,"g");function T1(e){return function(){return e}}function A1(e){return function(t){return e(t)+""}}function I1(e,t){var n=Sd.lastIndex=xd.lastIndex=0,r,o,s,i=-1,l=[],a=[];for(e=e+"",t=t+"";(r=Sd.exec(e))&&(o=xd.exec(t));)(s=o.index)>n&&(s=t.slice(n,s),l[i]?l[i]+=s:l[++i]=s),(r=r[0])===(o=o[0])?l[i]?l[i]+=o:l[++i]=o:(l[++i]=null,a.push({i,x:Hn(r,o)})),n=xd.lastIndex;return n<t.length&&(s=t.slice(n),l[i]?l[i]+=s:l[++i]=s),l.length<2?a[0]?A1(a[0].x):T1(t):(t=a.length,function(c){for(var u=0,f;u<t;++u)l[(f=a[u]).i]=f.x(c);return l.join("")})}var lE=180/Math.PI,Rd={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function aE(e,t,n,r,o,s){var i,l,a;return(i=Math.sqrt(e*e+t*t))&&(e/=i,t/=i),(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,i=-i),{translateX:o,translateY:s,rotate:Math.atan2(t,e)*lE,skewX:Math.atan(a)*lE,scaleX:i,scaleY:l}}var ea;function C1(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Rd:aE(t.a,t.b,t.c,t.d,t.e,t.f)}function L1(e){return e==null||(ea||(ea=document.createElementNS("http://www.w3.org/2000/svg","g")),ea.setAttribute("transform",e),!(e=ea.transform.baseVal.consolidate()))?Rd:(e=e.matrix,aE(e.a,e.b,e.c,e.d,e.e,e.f))}function cE(e,t,n,r){function o(c){return c.length?c.pop()+" ":""}function s(c,u,f,p,h,E){if(c!==f||u!==p){var y=h.push("translate(",null,t,null,n);E.push({i:y-4,x:Hn(c,f)},{i:y-2,x:Hn(u,p)})}else(f||p)&&h.push("translate("+f+t+p+n)}function i(c,u,f,p){c!==u?(c-u>180?u+=360:u-c>180&&(c+=360),p.push({i:f.push(o(f)+"rotate(",null,r)-2,x:Hn(c,u)})):u&&f.push(o(f)+"rotate("+u+r)}function l(c,u,f,p){c!==u?p.push({i:f.push(o(f)+"skewX(",null,r)-2,x:Hn(c,u)}):u&&f.push(o(f)+"skewX("+u+r)}function a(c,u,f,p,h,E){if(c!==f||u!==p){var y=h.push(o(h)+"scale(",null,",",null,")");E.push({i:y-4,x:Hn(c,f)},{i:y-2,x:Hn(u,p)})}else(f!==1||p!==1)&&h.push(o(h)+"scale("+f+","+p+")")}return function(c,u){var f=[],p=[];return c=e(c),u=e(u),s(c.translateX,c.translateY,u.translateX,u.translateY,f,p),i(c.rotate,u.rotate,f,p),l(c.skewX,u.skewX,f,p),a(c.scaleX,c.scaleY,u.scaleX,u.scaleY,f,p),c=u=null,function(h){for(var E=-1,y=p.length,v;++E<y;)f[(v=p[E]).i]=v.x(h);return f.join("")}}}var b1=cE(C1,"px, ","px)","deg)"),D1=cE(L1,", ",")",")"),k1=1e-12;function uE(e){return((e=Math.exp(e))+1/e)/2}function P1(e){return((e=Math.exp(e))-1/e)/2}function M1(e){return((e=Math.exp(2*e))-1)/(e+1)}const U1=function e(t,n,r){function o(s,i){var l=s[0],a=s[1],c=s[2],u=i[0],f=i[1],p=i[2],h=u-l,E=f-a,y=h*h+E*E,v,m;if(y<k1)m=Math.log(p/c)/t,v=function(T){return[l+T*h,a+T*E,c*Math.exp(t*T*m)]};else{var g=Math.sqrt(y),S=(p*p-c*c+r*y)/(2*c*n*g),_=(p*p-c*c-r*y)/(2*p*n*g),x=Math.log(Math.sqrt(S*S+1)-S),R=Math.log(Math.sqrt(_*_+1)-_);m=(R-x)/t,v=function(T){var L=T*m,P=uE(x),I=c/(n*g)*(P*M1(t*L+x)-P1(x));return[l+I*h,a+I*E,c*P/uE(t*L+x)]}}return v.duration=m*1e3*t/Math.SQRT2,v}return o.rho=function(s){var i=Math.max(.001,+s),l=i*i,a=l*l;return e(i,l,a)},o}(Math.SQRT2,2,4);var _o=0,Ks=0,Xs=0,dE=1e3,ta,Qs,na=0,_r=0,ra=0,qs=typeof performance=="object"&&performance.now?performance:Date,fE=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Nd(){return _r||(fE(F1),_r=qs.now()+ra)}function F1(){_r=0}function oa(){this._call=this._time=this._next=null}oa.prototype=pE.prototype={constructor:oa,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Nd():+n)+(t==null?0:+t),!this._next&&Qs!==this&&(Qs?Qs._next=this:ta=this,Qs=this),this._call=e,this._time=n,wd()},stop:function(){this._call&&(this._call=null,this._time=1/0,wd())}};function pE(e,t,n){var r=new oa;return r.restart(e,t,n),r}function j1(){Nd(),++_o;for(var e=ta,t;e;)(t=_r-e._time)>=0&&e._call.call(void 0,t),e=e._next;--_o}function hE(){_r=(na=qs.now())+ra,_o=Ks=0;try{j1()}finally{_o=0,$1(),_r=0}}function V1(){var e=qs.now(),t=e-na;t>dE&&(ra-=t,na=e)}function $1(){for(var e,t=ta,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:ta=n);Qs=e,wd(r)}function wd(e){if(!_o){Ks&&(Ks=clearTimeout(Ks));var t=e-_r;t>24?(e<1/0&&(Ks=setTimeout(hE,e-qs.now()-ra)),Xs&&(Xs=clearInterval(Xs))):(Xs||(na=qs.now(),Xs=setInterval(V1,dE)),_o=1,fE(hE))}}function mE(e,t,n){var r=new oa;return t=t==null?0:+t,r.restart(o=>{r.stop(),e(o+t)},t,n),r}var H1=Wl("start","end","cancel","interrupt"),B1=[],gE=0,EE=1,Od=2,sa=3,yE=4,Td=5,ia=6;function la(e,t,n,r,o,s){var i=e.__transition;if(!i)e.__transition={};else if(n in i)return;z1(e,n,{name:t,index:r,group:o,on:H1,tween:B1,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:gE})}function Ad(e,t){var n=$t(e,t);if(n.state>gE)throw new Error("too late; already scheduled");return n}function qt(e,t){var n=$t(e,t);if(n.state>sa)throw new Error("too late; already running");return n}function $t(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function z1(e,t,n){var r=e.__transition,o;r[t]=n,n.timer=pE(s,0,n.time);function s(c){n.state=EE,n.timer.restart(i,n.delay,n.time),n.delay<=c&&i(c-n.delay)}function i(c){var u,f,p,h;if(n.state!==EE)return a();for(u in r)if(h=r[u],h.name===n.name){if(h.state===sa)return mE(i);h.state===yE?(h.state=ia,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete r[u]):+u<t&&(h.state=ia,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete r[u])}if(mE(function(){n.state===sa&&(n.state=yE,n.timer.restart(l,n.delay,n.time),l(c))}),n.state=Od,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Od){for(n.state=sa,o=new Array(p=n.tween.length),u=0,f=-1;u<p;++u)(h=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(o[++f]=h);o.length=f+1}}function l(c){for(var u=c<n.duration?n.ease.call(null,c/n.duration):(n.timer.restart(a),n.state=Td,1),f=-1,p=o.length;++f<p;)o[f].call(e,u);n.state===Td&&(n.on.call("end",e,e.__data__,n.index,n.group),a())}function a(){n.state=ia,n.timer.stop(),delete r[t];for(var c in r)return;delete e.__transition}}function aa(e,t){var n=e.__transition,r,o,s=!0,i;if(n){t=t==null?null:t+"";for(i in n){if((r=n[i]).name!==t){s=!1;continue}o=r.state>Od&&r.state<Td,r.state=ia,r.timer.stop(),r.on.call(o?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[i]}s&&delete e.__transition}}function W1(e){return this.each(function(){aa(this,e)})}function G1(e,t){var n,r;return function(){var o=qt(this,e),s=o.tween;if(s!==n){r=n=s;for(var i=0,l=r.length;i<l;++i)if(r[i].name===t){r=r.slice(),r.splice(i,1);break}}o.tween=r}}function Y1(e,t,n){var r,o;if(typeof n!="function")throw new Error;return function(){var s=qt(this,e),i=s.tween;if(i!==r){o=(r=i).slice();for(var l={name:t,value:n},a=0,c=o.length;a<c;++a)if(o[a].name===t){o[a]=l;break}a===c&&o.push(l)}s.tween=o}}function K1(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=$t(this.node(),n).tween,o=0,s=r.length,i;o<s;++o)if((i=r[o]).name===e)return i.value;return null}return this.each((t==null?G1:Y1)(n,e,t))}function Id(e,t,n){var r=e._id;return e.each(function(){var o=qt(this,r);(o.value||(o.value={}))[t]=n.apply(this,arguments)}),function(o){return $t(o,r).value[t]}}function vE(e,t){var n;return(typeof t=="number"?Hn:t instanceof Ys?iE:(n=Ys(t))?(t=n,iE):I1)(e,t)}function X1(e){return function(){this.removeAttribute(e)}}function Q1(e){return function(){this.removeAttributeNS(e.space,e.local)}}function q1(e,t,n){var r,o=n+"",s;return function(){var i=this.getAttribute(e);return i===o?null:i===r?s:s=t(r=i,n)}}function J1(e,t,n){var r,o=n+"",s;return function(){var i=this.getAttributeNS(e.space,e.local);return i===o?null:i===r?s:s=t(r=i,n)}}function Z1(e,t,n){var r,o,s;return function(){var i,l=n(this),a;return l==null?void this.removeAttribute(e):(i=this.getAttribute(e),a=l+"",i===a?null:i===r&&a===o?s:(o=a,s=t(r=i,l)))}}function ew(e,t,n){var r,o,s;return function(){var i,l=n(this),a;return l==null?void this.removeAttributeNS(e.space,e.local):(i=this.getAttributeNS(e.space,e.local),a=l+"",i===a?null:i===r&&a===o?s:(o=a,s=t(r=i,l)))}}function tw(e,t){var n=Yl(e),r=n==="transform"?D1:vE;return this.attrTween(e,typeof t=="function"?(n.local?ew:Z1)(n,r,Id(this,"attr."+e,t)):t==null?(n.local?Q1:X1)(n):(n.local?J1:q1)(n,r,t))}function nw(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function rw(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function ow(e,t){var n,r;function o(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&rw(e,s)),n}return o._value=t,o}function sw(e,t){var n,r;function o(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&nw(e,s)),n}return o._value=t,o}function iw(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=Yl(e);return this.tween(n,(r.local?ow:sw)(r,t))}function lw(e,t){return function(){Ad(this,e).delay=+t.apply(this,arguments)}}function aw(e,t){return t=+t,function(){Ad(this,e).delay=t}}function cw(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?lw:aw)(t,e)):$t(this.node(),t).delay}function uw(e,t){return function(){qt(this,e).duration=+t.apply(this,arguments)}}function dw(e,t){return t=+t,function(){qt(this,e).duration=t}}function fw(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?uw:dw)(t,e)):$t(this.node(),t).duration}function pw(e,t){if(typeof t!="function")throw new Error;return function(){qt(this,e).ease=t}}function hw(e){var t=this._id;return arguments.length?this.each(pw(t,e)):$t(this.node(),t).ease}function mw(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;qt(this,e).ease=n}}function gw(e){if(typeof e!="function")throw new Error;return this.each(mw(this._id,e))}function Ew(e){typeof e!="function"&&(e=Mg(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var s=t[o],i=s.length,l=r[o]=[],a,c=0;c<i;++c)(a=s[c])&&e.call(a,a.__data__,c,s)&&l.push(a);return new hn(r,this._parents,this._name,this._id)}function yw(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,o=n.length,s=Math.min(r,o),i=new Array(r),l=0;l<s;++l)for(var a=t[l],c=n[l],u=a.length,f=i[l]=new Array(u),p,h=0;h<u;++h)(p=a[h]||c[h])&&(f[h]=p);for(;l<r;++l)i[l]=t[l];return new hn(i,this._parents,this._name,this._id)}function vw(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 _w(e,t,n){var r,o,s=vw(t)?Ad:qt;return function(){var i=s(this,e),l=i.on;l!==r&&(o=(r=l).copy()).on(t,n),i.on=o}}function Sw(e,t){var n=this._id;return arguments.length<2?$t(this.node(),n).on.on(e):this.each(_w(n,e,t))}function xw(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Rw(){return this.on("end.remove",xw(this._id))}function Nw(e){var t=this._name,n=this._id;typeof e!="function"&&(e=hd(e));for(var r=this._groups,o=r.length,s=new Array(o),i=0;i<o;++i)for(var l=r[i],a=l.length,c=s[i]=new Array(a),u,f,p=0;p<a;++p)(u=l[p])&&(f=e.call(u,u.__data__,p,l))&&("__data__"in u&&(f.__data__=u.__data__),c[p]=f,la(c[p],t,n,p,c,$t(u,n)));return new hn(s,this._parents,t,n)}function ww(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Pg(e));for(var r=this._groups,o=r.length,s=[],i=[],l=0;l<o;++l)for(var a=r[l],c=a.length,u,f=0;f<c;++f)if(u=a[f]){for(var p=e.call(u,u.__data__,f,a),h,E=$t(u,n),y=0,v=p.length;y<v;++y)(h=p[y])&&la(h,t,n,y,p,E);s.push(p),i.push(u)}return new hn(s,i,t,n)}var Ow=Hs.prototype.constructor;function Tw(){return new Ow(this._groups,this._parents)}function Aw(e,t){var n,r,o;return function(){var s=Eo(this,e),i=(this.style.removeProperty(e),Eo(this,e));return s===i?null:s===n&&i===r?o:o=t(n=s,r=i)}}function _E(e){return function(){this.style.removeProperty(e)}}function Iw(e,t,n){var r,o=n+"",s;return function(){var i=Eo(this,e);return i===o?null:i===r?s:s=t(r=i,n)}}function Cw(e,t,n){var r,o,s;return function(){var i=Eo(this,e),l=n(this),a=l+"";return l==null&&(a=l=(this.style.removeProperty(e),Eo(this,e))),i===a?null:i===r&&a===o?s:(o=a,s=t(r=i,l))}}function Lw(e,t){var n,r,o,s="style."+t,i="end."+s,l;return function(){var a=qt(this,e),c=a.on,u=a.value[s]==null?l||(l=_E(t)):void 0;(c!==n||o!==u)&&(r=(n=c).copy()).on(i,o=u),a.on=r}}function bw(e,t,n){var r=(e+="")=="transform"?b1:vE;return t==null?this.styleTween(e,Aw(e,r)).on("end.style."+e,_E(e)):typeof t=="function"?this.styleTween(e,Cw(e,r,Id(this,"style."+e,t))).each(Lw(this._id,e)):this.styleTween(e,Iw(e,r,t),n).on("end.style."+e,null)}function Dw(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function kw(e,t,n){var r,o;function s(){var i=t.apply(this,arguments);return i!==o&&(r=(o=i)&&Dw(e,i,n)),r}return s._value=t,s}function Pw(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,kw(e,t,n??""))}function Mw(e){return function(){this.textContent=e}}function Uw(e){return function(){var t=e(this);this.textContent=t??""}}function Fw(e){return this.tween("text",typeof e=="function"?Uw(Id(this,"text",e)):Mw(e==null?"":e+""))}function jw(e){return function(t){this.textContent=e.call(this,t)}}function Vw(e){var t,n;function r(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&jw(o)),t}return r._value=e,r}function $w(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,Vw(e))}function Hw(){for(var e=this._name,t=this._id,n=SE(),r=this._groups,o=r.length,s=0;s<o;++s)for(var i=r[s],l=i.length,a,c=0;c<l;++c)if(a=i[c]){var u=$t(a,t);la(a,e,n,c,i,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new hn(r,this._parents,e,n)}function Bw(){var e,t,n=this,r=n._id,o=n.size();return new Promise(function(s,i){var l={value:i},a={value:function(){--o===0&&s()}};n.each(function(){var c=qt(this,r),u=c.on;u!==e&&(t=(e=u).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(a)),c.on=t}),o===0&&s()})}var zw=0;function hn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function SE(){return++zw}var mn=Hs.prototype;hn.prototype={constructor:hn,select:Nw,selectAll:ww,selectChild:mn.selectChild,selectChildren:mn.selectChildren,filter:Ew,merge:yw,selection:Tw,transition:Hw,call:mn.call,nodes:mn.nodes,node:mn.node,size:mn.size,empty:mn.empty,each:mn.each,on:Sw,attr:tw,attrTween:iw,style:bw,styleTween:Pw,text:Fw,textTween:$w,remove:Rw,tween:K1,delay:cw,duration:fw,ease:hw,easeVarying:gw,end:Bw,[Symbol.iterator]:mn[Symbol.iterator]};function Ww(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Gw={time:null,delay:0,duration:250,ease:Ww};function Yw(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 Kw(e){var t,n;e instanceof hn?(t=e._id,e=e._name):(t=SE(),(n=Gw).time=Nd(),e=e==null?null:e+"");for(var r=this._groups,o=r.length,s=0;s<o;++s)for(var i=r[s],l=i.length,a,c=0;c<l;++c)(a=i[c])&&la(a,e,t,c,i,n||Yw(a,t));return new hn(r,this._parents,e,t)}Hs.prototype.interrupt=W1,Hs.prototype.transition=Kw;const ca=e=>()=>e;function Xw(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 gn(e,t,n){this.k=e,this.x=t,this.y=n}gn.prototype={constructor:gn,scale:function(e){return e===1?this:new gn(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new gn(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 Bn=new gn(1,0,0);gn.prototype;function Cd(e){e.stopImmediatePropagation()}function Js(e){e.preventDefault(),e.stopImmediatePropagation()}function Qw(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function qw(){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 xE(){return this.__zoom||Bn}function Jw(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Zw(){return navigator.maxTouchPoints||"ontouchstart"in this}function eO(e,t,n){var r=e.invertX(t[0][0])-n[0][0],o=e.invertX(t[1][0])-n[1][0],s=e.invertY(t[0][1])-n[0][1],i=e.invertY(t[1][1])-n[1][1];return e.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),i>s?(s+i)/2:Math.min(0,s)||Math.max(0,i))}function tO(){var e=Qw,t=qw,n=eO,r=Jw,o=Zw,s=[0,1/0],i=[[-1/0,-1/0],[1/0,1/0]],l=250,a=U1,c=Wl("start","zoom","end"),u,f,p,h=500,E=150,y=0,v=10;function m(w){w.property("__zoom",xE).on("wheel.zoom",L,{passive:!1}).on("mousedown.zoom",P).on("dblclick.zoom",I).filter(o).on("touchstart.zoom",j).on("touchmove.zoom",V).on("touchend.zoom touchcancel.zoom",M).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}m.transform=function(w,b,k,F){var C=w.selection?w.selection():w;C.property("__zoom",xE),w!==C?x(w,b,k,F):C.interrupt().each(function(){R(this,arguments).event(F).start().zoom(null,typeof b=="function"?b.apply(this,arguments):b).end()})},m.scaleBy=function(w,b,k,F){m.scaleTo(w,function(){var C=this.__zoom.k,D=typeof b=="function"?b.apply(this,arguments):b;return C*D},k,F)},m.scaleTo=function(w,b,k,F){m.transform(w,function(){var C=t.apply(this,arguments),D=this.__zoom,U=k==null?_(C):typeof k=="function"?k.apply(this,arguments):k,$=D.invert(U),B=typeof b=="function"?b.apply(this,arguments):b;return n(S(g(D,B),U,$),C,i)},k,F)},m.translateBy=function(w,b,k,F){m.transform(w,function(){return n(this.__zoom.translate(typeof b=="function"?b.apply(this,arguments):b,typeof k=="function"?k.apply(this,arguments):k),t.apply(this,arguments),i)},null,F)},m.translateTo=function(w,b,k,F,C){m.transform(w,function(){var D=t.apply(this,arguments),U=this.__zoom,$=F==null?_(D):typeof F=="function"?F.apply(this,arguments):F;return n(Bn.translate($[0],$[1]).scale(U.k).translate(typeof b=="function"?-b.apply(this,arguments):-b,typeof k=="function"?-k.apply(this,arguments):-k),D,i)},F,C)};function g(w,b){return b=Math.max(s[0],Math.min(s[1],b)),b===w.k?w:new gn(b,w.x,w.y)}function S(w,b,k){var F=b[0]-k[0]*w.k,C=b[1]-k[1]*w.k;return F===w.x&&C===w.y?w:new gn(w.k,F,C)}function _(w){return[(+w[0][0]+ +w[1][0])/2,(+w[0][1]+ +w[1][1])/2]}function x(w,b,k,F){w.on("start.zoom",function(){R(this,arguments).event(F).start()}).on("interrupt.zoom end.zoom",function(){R(this,arguments).event(F).end()}).tween("zoom",function(){var C=this,D=arguments,U=R(C,D).event(F),$=t.apply(C,D),B=k==null?_($):typeof k=="function"?k.apply(C,D):k,W=Math.max($[1][0]-$[0][0],$[1][1]-$[0][1]),z=C.__zoom,Y=typeof b=="function"?b.apply(C,D):b,X=a(z.invert(B).concat(W/z.k),Y.invert(B).concat(W/Y.k));return function(Z){if(Z===1)Z=Y;else{var J=X(Z),te=W/J[2];Z=new gn(te,B[0]-J[0]*te,B[1]-J[1]*te)}U.zoom(null,Z)}})}function R(w,b,k){return!k&&w.__zooming||new T(w,b)}function T(w,b){this.that=w,this.args=b,this.active=0,this.sourceEvent=null,this.extent=t.apply(w,b),this.taps=0}T.prototype={event:function(w){return w&&(this.sourceEvent=w),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(w,b){return this.mouse&&w!=="mouse"&&(this.mouse[1]=b.invert(this.mouse[0])),this.touch0&&w!=="touch"&&(this.touch0[1]=b.invert(this.touch0[0])),this.touch1&&w!=="touch"&&(this.touch1[1]=b.invert(this.touch1[0])),this.that.__zoom=b,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(w){var b=jt(this.that).datum();c.call(w,this.that,new Xw(w,{sourceEvent:this.sourceEvent,target:m,type:w,transform:this.that.__zoom,dispatch:c}),b)}};function L(w,...b){if(!e.apply(this,arguments))return;var k=R(this,b).event(w),F=this.__zoom,C=Math.max(s[0],Math.min(s[1],F.k*Math.pow(2,r.apply(this,arguments)))),D=Xt(w);if(k.wheel)(k.mouse[0][0]!==D[0]||k.mouse[0][1]!==D[1])&&(k.mouse[1]=F.invert(k.mouse[0]=D)),clearTimeout(k.wheel);else{if(F.k===C)return;k.mouse=[D,F.invert(D)],aa(this),k.start()}Js(w),k.wheel=setTimeout(U,E),k.zoom("mouse",n(S(g(F,C),k.mouse[0],k.mouse[1]),k.extent,i));function U(){k.wheel=null,k.end()}}function P(w,...b){if(p||!e.apply(this,arguments))return;var k=w.currentTarget,F=R(this,b,!0).event(w),C=jt(w.view).on("mousemove.zoom",B,!0).on("mouseup.zoom",W,!0),D=Xt(w,k),U=w.clientX,$=w.clientY;Gg(w.view),Cd(w),F.mouse=[D,this.__zoom.invert(D)],aa(this),F.start();function B(z){if(Js(z),!F.moved){var Y=z.clientX-U,X=z.clientY-$;F.moved=Y*Y+X*X>y}F.event(z).zoom("mouse",n(S(F.that.__zoom,F.mouse[0]=Xt(z,k),F.mouse[1]),F.extent,i))}function W(z){C.on("mousemove.zoom mouseup.zoom",null),Yg(z.view,F.moved),Js(z),F.event(z).end()}}function I(w,...b){if(e.apply(this,arguments)){var k=this.__zoom,F=Xt(w.changedTouches?w.changedTouches[0]:w,this),C=k.invert(F),D=k.k*(w.shiftKey?.5:2),U=n(S(g(k,D),F,C),t.apply(this,b),i);Js(w),l>0?jt(this).transition().duration(l).call(x,U,F,w):jt(this).call(m.transform,U,F,w)}}function j(w,...b){if(e.apply(this,arguments)){var k=w.touches,F=k.length,C=R(this,b,w.changedTouches.length===F).event(w),D,U,$,B;for(Cd(w),U=0;U<F;++U)$=k[U],B=Xt($,this),B=[B,this.__zoom.invert(B),$.identifier],C.touch0?!C.touch1&&C.touch0[2]!==B[2]&&(C.touch1=B,C.taps=0):(C.touch0=B,D=!0,C.taps=1+!!u);u&&(u=clearTimeout(u)),D&&(C.taps<2&&(f=B[0],u=setTimeout(function(){u=null},h)),aa(this),C.start())}}function V(w,...b){if(this.__zooming){var k=R(this,b).event(w),F=w.changedTouches,C=F.length,D,U,$,B;for(Js(w),D=0;D<C;++D)U=F[D],$=Xt(U,this),k.touch0&&k.touch0[2]===U.identifier?k.touch0[0]=$:k.touch1&&k.touch1[2]===U.identifier&&(k.touch1[0]=$);if(U=k.that.__zoom,k.touch1){var W=k.touch0[0],z=k.touch0[1],Y=k.touch1[0],X=k.touch1[1],Z=(Z=Y[0]-W[0])*Z+(Z=Y[1]-W[1])*Z,J=(J=X[0]-z[0])*J+(J=X[1]-z[1])*J;U=g(U,Math.sqrt(Z/J)),$=[(W[0]+Y[0])/2,(W[1]+Y[1])/2],B=[(z[0]+X[0])/2,(z[1]+X[1])/2]}else if(k.touch0)$=k.touch0[0],B=k.touch0[1];else return;k.zoom("touch",n(S(U,$,B),k.extent,i))}}function M(w,...b){if(this.__zooming){var k=R(this,b).event(w),F=w.changedTouches,C=F.length,D,U;for(Cd(w),p&&clearTimeout(p),p=setTimeout(function(){p=null},h),D=0;D<C;++D)U=F[D],k.touch0&&k.touch0[2]===U.identifier?delete k.touch0:k.touch1&&k.touch1[2]===U.identifier&&delete k.touch1;if(k.touch1&&!k.touch0&&(k.touch0=k.touch1,delete k.touch1),k.touch0)k.touch0[1]=this.__zoom.invert(k.touch0[0]);else if(k.end(),k.taps===2&&(U=Xt(U,this),Math.hypot(f[0]-U[0],f[1]-U[1])<v)){var $=jt(this).on("dblclick.zoom");$&&$.apply(this,arguments)}}}return m.wheelDelta=function(w){return arguments.length?(r=typeof w=="function"?w:ca(+w),m):r},m.filter=function(w){return arguments.length?(e=typeof w=="function"?w:ca(!!w),m):e},m.touchable=function(w){return arguments.length?(o=typeof w=="function"?w:ca(!!w),m):o},m.extent=function(w){return arguments.length?(t=typeof w=="function"?w:ca([[+w[0][0],+w[0][1]],[+w[1][0],+w[1][1]]]),m):t},m.scaleExtent=function(w){return arguments.length?(s[0]=+w[0],s[1]=+w[1],m):[s[0],s[1]]},m.translateExtent=function(w){return arguments.length?(i[0][0]=+w[0][0],i[1][0]=+w[1][0],i[0][1]=+w[0][1],i[1][1]=+w[1][1],m):[[i[0][0],i[0][1]],[i[1][0],i[1][1]]]},m.constrain=function(w){return arguments.length?(n=w,m):n},m.duration=function(w){return arguments.length?(l=+w,m):l},m.interpolate=function(w){return arguments.length?(a=w,m):a},m.on=function(){var w=c.on.apply(c,arguments);return w===c?m:w},m.clickDistance=function(w){return arguments.length?(y=(w=+w)*w,m):Math.sqrt(y)},m.tapDistance=function(w){return arguments.length?(v=+w,m):v},m}const ua=O.createContext(null),nO=ua.Provider,En={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"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.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,t)=>`Couldn't create edge for ${e?"target":"source"} handle id: "${e?t.targetHandle:t.sourceHandle}", edge id: ${t.id}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`},RE=En.error001();function de(e,t){const n=O.useContext(ua);if(n===null)throw new Error(RE);return Cg(n,e,t)}const Ie=()=>{const e=O.useContext(ua);if(e===null)throw new Error(RE);return O.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy}),[e])},rO=e=>e.userSelectionActive?"none":"all";function Zs({position:e,children:t,className:n,style:r,...o}){const s=de(rO),i=`${e}`.split("-");return H.createElement("div",{className:Je(["react-flow__panel",n,...i]),style:{...r,pointerEvents:s},...o},t)}function oO({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:H.createElement(Zs,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://reactflow.dev/pro"},H.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}const sO=({x:e,y:t,label:n,labelStyle:r={},labelShowBg:o=!0,labelBgStyle:s={},labelBgPadding:i=[2,4],labelBgBorderRadius:l=2,children:a,className:c,...u})=>{const f=O.useRef(null),[p,h]=O.useState({x:0,y:0,width:0,height:0}),E=Je(["react-flow__edge-textwrapper",c]);return O.useEffect(()=>{if(f.current){const y=f.current.getBBox();h({x:y.x,y:y.y,width:y.width,height:y.height})}},[n]),typeof n>"u"||!n?null:H.createElement("g",{transform:`translate(${e-p.width/2} ${t-p.height/2})`,className:E,visibility:p.width?"visible":"hidden",...u},o&&H.createElement("rect",{width:p.width+2*i[0],x:-i[0],y:-i[1],height:p.height+2*i[1],className:"react-flow__edge-textbg",style:s,rx:l,ry:l}),H.createElement("text",{className:"react-flow__edge-text",y:p.height/2,dy:"0.3em",ref:f,style:r},n),a)};var iO=O.memo(sO);const Ld=e=>({width:e.offsetWidth,height:e.offsetHeight}),So=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),bd=(e={x:0,y:0},t)=>({x:So(e.x,t[0][0],t[1][0]),y:So(e.y,t[0][1],t[1][1])}),NE=(e,t,n)=>e<t?So(Math.abs(e-t),1,50)/50:e>n?-So(Math.abs(e-n),1,50)/50:0,wE=(e,t)=>{const n=NE(e.x,35,t.width-35)*20,r=NE(e.y,35,t.height-35)*20;return[n,r]},OE=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},lO=(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)}),Dd=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),aO=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),TE=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),kd=(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)},cO=e=>It(e.width)&&It(e.height)&&It(e.x)&&It(e.y),It=e=>!isNaN(e)&&isFinite(e),Ce=Symbol.for("internals"),AE=["Enter"," ","Escape"],uO=(e,t)=>{},dO=e=>"nativeEvent"in e;function Pd(e){var o,s;const t=dO(e)?e.nativeEvent:e,n=((s=(o=t.composedPath)==null?void 0:o.call(t))==null?void 0:s[0])||e.target;return["INPUT","SELECT","TEXTAREA"].includes(n==null?void 0:n.nodeName)||(n==null?void 0:n.hasAttribute("contenteditable"))||!!(n!=null&&n.closest(".nokey"))}const IE=e=>"clientX"in e,zn=(e,t)=>{var s,i;const n=IE(e),r=n?e.clientX:(s=e.touches)==null?void 0:s[0].clientX,o=n?e.clientY:(i=e.touches)==null?void 0:i[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:o-((t==null?void 0:t.top)??0)}},da=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0},xo=({id:e,path:t,labelX:n,labelY:r,label:o,labelStyle:s,labelShowBg:i,labelBgStyle:l,labelBgPadding:a,labelBgBorderRadius:c,style:u,markerEnd:f,markerStart:p,interactionWidth:h=20})=>H.createElement(H.Fragment,null,H.createElement("path",{id:e,style:u,d:t,fill:"none",className:"react-flow__edge-path",markerEnd:f,markerStart:p}),h&&H.createElement("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:h,className:"react-flow__edge-interaction"}),o&&It(n)&&It(r)?H.createElement(iO,{x:n,y:r,label:o,labelStyle:s,labelShowBg:i,labelBgStyle:l,labelBgPadding:a,labelBgBorderRadius:c}):null);xo.displayName="BaseEdge";function ei(e,t,n){return n===void 0?n:r=>{const o=t().edges.find(s=>s.id===e);o&&n(r,{...o})}}function CE({sourceX:e,sourceY:t,targetX:n,targetY:r}){const o=Math.abs(n-e)/2,s=n<e?n+o:n-o,i=Math.abs(r-t)/2,l=r<t?r+i:r-i;return[s,l,o,i]}function LE({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:o,sourceControlY:s,targetControlX:i,targetControlY:l}){const a=e*.125+o*.375+i*.375+n*.125,c=t*.125+s*.375+l*.375+r*.125,u=Math.abs(a-e),f=Math.abs(c-t);return[a,c,u,f]}var Wn;(function(e){e.Strict="strict",e.Loose="loose"})(Wn||(Wn={}));var Sr;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Sr||(Sr={}));var ti;(function(e){e.Partial="partial",e.Full="full"})(ti||(ti={}));var Gn;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Gn||(Gn={}));var ni;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(ni||(ni={}));var q;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(q||(q={}));function bE({pos:e,x1:t,y1:n,x2:r,y2:o}){return e===q.Left||e===q.Right?[.5*(t+r),n]:[t,.5*(n+o)]}function DE({sourceX:e,sourceY:t,sourcePosition:n=q.Bottom,targetX:r,targetY:o,targetPosition:s=q.Top}){const[i,l]=bE({pos:n,x1:e,y1:t,x2:r,y2:o}),[a,c]=bE({pos:s,x1:r,y1:o,x2:e,y2:t}),[u,f,p,h]=LE({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:i,sourceControlY:l,targetControlX:a,targetControlY:c});return[`M${e},${t} C${i},${l} ${a},${c} ${r},${o}`,u,f,p,h]}const Md=O.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:o=q.Bottom,targetPosition:s=q.Top,label:i,labelStyle:l,labelShowBg:a,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:f,style:p,markerEnd:h,markerStart:E,interactionWidth:y})=>{const[v,m,g]=DE({sourceX:e,sourceY:t,sourcePosition:o,targetX:n,targetY:r,targetPosition:s});return H.createElement(xo,{path:v,labelX:m,labelY:g,label:i,labelStyle:l,labelShowBg:a,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:f,style:p,markerEnd:h,markerStart:E,interactionWidth:y})});Md.displayName="SimpleBezierEdge";const kE={[q.Left]:{x:-1,y:0},[q.Right]:{x:1,y:0},[q.Top]:{x:0,y:-1},[q.Bottom]:{x:0,y:1}},fO=({source:e,sourcePosition:t=q.Bottom,target:n})=>t===q.Left||t===q.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},PE=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function pO({source:e,sourcePosition:t=q.Bottom,target:n,targetPosition:r=q.Top,center:o,offset:s}){const i=kE[t],l=kE[r],a={x:e.x+i.x*s,y:e.y+i.y*s},c={x:n.x+l.x*s,y:n.y+l.y*s},u=fO({source:a,sourcePosition:t,target:c}),f=u.x!==0?"x":"y",p=u[f];let h=[],E,y;const v={x:0,y:0},m={x:0,y:0},[g,S,_,x]=CE({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(i[f]*l[f]===-1){E=o.x||g,y=o.y||S;const T=[{x:E,y:a.y},{x:E,y:c.y}],L=[{x:a.x,y},{x:c.x,y}];i[f]===p?h=f==="x"?T:L:h=f==="x"?L:T}else{const T=[{x:a.x,y:c.y}],L=[{x:c.x,y:a.y}];if(f==="x"?h=i.x===p?L:T:h=i.y===p?T:L,t===r){const M=Math.abs(e[f]-n[f]);if(M<=s){const w=Math.min(s-1,s-M);i[f]===p?v[f]=(a[f]>e[f]?-1:1)*w:m[f]=(c[f]>n[f]?-1:1)*w}}if(t!==r){const M=f==="x"?"y":"x",w=i[f]===l[M],b=a[M]>c[M],k=a[M]<c[M];(i[f]===1&&(!w&&b||w&&k)||i[f]!==1&&(!w&&k||w&&b))&&(h=f==="x"?T:L)}const P={x:a.x+v.x,y:a.y+v.y},I={x:c.x+m.x,y:c.y+m.y},j=Math.max(Math.abs(P.x-h[0].x),Math.abs(I.x-h[0].x)),V=Math.max(Math.abs(P.y-h[0].y),Math.abs(I.y-h[0].y));j>=V?(E=(P.x+I.x)/2,y=h[0].y):(E=h[0].x,y=(P.y+I.y)/2)}return[[e,{x:a.x+v.x,y:a.y+v.y},...h,{x:c.x+m.x,y:c.y+m.y},n],E,y,_,x]}function hO(e,t,n,r){const o=Math.min(PE(e,t)/2,PE(t,n)/2,r),{x:s,y:i}=t;if(e.x===s&&s===n.x||e.y===i&&i===n.y)return`L${s} ${i}`;if(e.y===i){const c=e.x<n.x?-1:1,u=e.y<n.y?1:-1;return`L ${s+o*c},${i}Q ${s},${i} ${s},${i+o*u}`}const l=e.x<n.x?1:-1,a=e.y<n.y?-1:1;return`L ${s},${i+o*a}Q ${s},${i} ${s+o*l},${i}`}function ri({sourceX:e,sourceY:t,sourcePosition:n=q.Bottom,targetX:r,targetY:o,targetPosition:s=q.Top,borderRadius:i=5,centerX:l,centerY:a,offset:c=20}){const[u,f,p,h,E]=pO({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:o},targetPosition:s,center:{x:l,y:a},offset:c});return[u.reduce((v,m,g)=>{let S="";return g>0&&g<u.length-1?S=hO(u[g-1],m,u[g+1],i):S=`${g===0?"M":"L"}${m.x} ${m.y}`,v+=S,v},""),f,p,h,E]}const fa=O.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:o,labelStyle:s,labelShowBg:i,labelBgStyle:l,labelBgPadding:a,labelBgBorderRadius:c,style:u,sourcePosition:f=q.Bottom,targetPosition:p=q.Top,markerEnd:h,markerStart:E,pathOptions:y,interactionWidth:v})=>{const[m,g,S]=ri({sourceX:e,sourceY:t,sourcePosition:f,targetX:n,targetY:r,targetPosition:p,borderRadius:y==null?void 0:y.borderRadius,offset:y==null?void 0:y.offset});return H.createElement(xo,{path:m,labelX:g,labelY:S,label:o,labelStyle:s,labelShowBg:i,labelBgStyle:l,labelBgPadding:a,labelBgBorderRadius:c,style:u,markerEnd:h,markerStart:E,interactionWidth:v})});fa.displayName="SmoothStepEdge";const Ud=O.memo(e=>{var t;return H.createElement(fa,{...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])})});Ud.displayName="StepEdge";function mO({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[o,s,i,l]=CE({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,o,s,i,l]}const Fd=O.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:o,labelStyle:s,labelShowBg:i,labelBgStyle:l,labelBgPadding:a,labelBgBorderRadius:c,style:u,markerEnd:f,markerStart:p,interactionWidth:h})=>{const[E,y,v]=mO({sourceX:e,sourceY:t,targetX:n,targetY:r});return H.createElement(xo,{path:E,labelX:y,labelY:v,label:o,labelStyle:s,labelShowBg:i,labelBgStyle:l,labelBgPadding:a,labelBgBorderRadius:c,style:u,markerEnd:f,markerStart:p,interactionWidth:h})});Fd.displayName="StraightEdge";function pa(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function ME({pos:e,x1:t,y1:n,x2:r,y2:o,c:s}){switch(e){case q.Left:return[t-pa(t-r,s),n];case q.Right:return[t+pa(r-t,s),n];case q.Top:return[t,n-pa(n-o,s)];case q.Bottom:return[t,n+pa(o-n,s)]}}function UE({sourceX:e,sourceY:t,sourcePosition:n=q.Bottom,targetX:r,targetY:o,targetPosition:s=q.Top,curvature:i=.25}){const[l,a]=ME({pos:n,x1:e,y1:t,x2:r,y2:o,c:i}),[c,u]=ME({pos:s,x1:r,y1:o,x2:e,y2:t,c:i}),[f,p,h,E]=LE({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:l,sourceControlY:a,targetControlX:c,targetControlY:u});return[`M${e},${t} C${l},${a} ${c},${u} ${r},${o}`,f,p,h,E]}const ha=O.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:o=q.Bottom,targetPosition:s=q.Top,label:i,labelStyle:l,labelShowBg:a,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:f,style:p,markerEnd:h,markerStart:E,pathOptions:y,interactionWidth:v})=>{const[m,g,S]=UE({sourceX:e,sourceY:t,sourcePosition:o,targetX:n,targetY:r,targetPosition:s,curvature:y==null?void 0:y.curvature});return H.createElement(xo,{path:m,labelX:g,labelY:S,label:i,labelStyle:l,labelShowBg:a,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:f,style:p,markerEnd:h,markerStart:E,interactionWidth:v})});ha.displayName="BezierEdge";const jd=O.createContext(null),gO=jd.Provider;jd.Consumer;const EO=()=>O.useContext(jd),yO=e=>"id"in e&&"source"in e&&"target"in e,FE=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`reactflow__edge-${e}${t||""}-${n}${r||""}`,Vd=(e,t)=>typeof e>"u"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`,vO=(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)),jE=(e,t)=>{if(!e.source||!e.target)return t;let n;return yO(e)?n={...e}:n={...e,id:FE(e)},vO(n,t)?t:t.concat(n)},_O=(e,t,n,r={shouldReplaceId:!0})=>{const{id:o,...s}=e;if(!t.source||!t.target||!n.find(a=>a.id===o))return n;const l={...s,id:r.shouldReplaceId?FE(t):o,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle};return n.filter(a=>a.id!==o).concat(l)},$d=({x:e,y:t},[n,r,o],s,[i,l])=>{const a={x:(e-n)/o,y:(t-r)/o};return s?{x:i*Math.round(a.x/i),y:l*Math.round(a.y/l)}:a},VE=({x:e,y:t},[n,r,o])=>({x:e*o+n,y:t*o+r}),Ro=(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}},Hd=(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:s,y:i}=Ro(o,t).positionAbsolute;return lO(r,Dd({x:s,y:i,width:o.width||0,height:o.height||0}))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return aO(n)},$E=(e,t,[n,r,o]=[0,0,1],s=!1,i=!1,l=[0,0])=>{const a={x:(t.x-n)/o,y:(t.y-r)/o,width:t.width/o,height:t.height/o},c=[];return e.forEach(u=>{const{width:f,height:p,selectable:h=!0,hidden:E=!1}=u;if(i&&!h||E)return!1;const{positionAbsolute:y}=Ro(u,l),v={x:y.x,y:y.y,width:f||0,height:p||0},m=kd(a,v),g=typeof f>"u"||typeof p>"u"||f===null||p===null,S=s&&m>0,_=(f||0)*(p||0);(g||S||m>=_||u.dragging)&&c.push(u)}),c},HE=(e,t)=>{const n=e.map(r=>r.id);return t.filter(r=>n.includes(r.source)||n.includes(r.target))},BE=(e,t,n,r,o,s=.1)=>{const i=t/(e.width*(1+s)),l=n/(e.height*(1+s)),a=Math.min(i,l),c=So(a,r,o),u=e.x+e.width/2,f=e.y+e.height/2,p=t/2-u*c,h=n/2-f*c;return{x:p,y:h,zoom:c}},xr=(e,t=0)=>e.transition().duration(t);function zE(e,t,n,r){return(t[n]||[]).reduce((o,s)=>{var i,l;return`${e.id}-${s.id}-${n}`!==r&&o.push({id:s.id||null,type:n,nodeId:e.id,x:(((i=e.positionAbsolute)==null?void 0:i.x)??0)+s.x+s.width/2,y:(((l=e.positionAbsolute)==null?void 0:l.y)??0)+s.y+s.height/2}),o},[])}function SO(e,t,n,r,o,s){const{x:i,y:l}=zn(e),c=t.elementsFromPoint(i,l).find(E=>E.classList.contains("react-flow__handle"));if(c){const E=c.getAttribute("data-nodeid");if(E){const y=Bd(void 0,c),v=c.getAttribute("data-handleid"),m=s({nodeId:E,id:v,type:y});if(m){const g=o.find(S=>S.nodeId===E&&S.type===y&&S.id===v);return{handle:{id:v,type:y,nodeId:E,x:(g==null?void 0:g.x)||n.x,y:(g==null?void 0:g.y)||n.y},validHandleResult:m}}}}let u=[],f=1/0;if(o.forEach(E=>{const y=Math.sqrt((E.x-n.x)**2+(E.y-n.y)**2);if(y<=r){const v=s(E);y<=f&&(y<f?u=[{handle:E,validHandleResult:v}]:y===f&&u.push({handle:E,validHandleResult:v}),f=y)}}),!u.length)return{handle:null,validHandleResult:WE()};if(u.length===1)return u[0];const p=u.some(({validHandleResult:E})=>E.isValid),h=u.some(({handle:E})=>E.type==="target");return u.find(({handle:E,validHandleResult:y})=>h?E.type==="target":p?y.isValid:!0)||u[0]}const xO={source:null,target:null,sourceHandle:null,targetHandle:null},WE=()=>({handleDomNode:null,isValid:!1,connection:xO,endHandle:null});function GE(e,t,n,r,o,s,i){const l=o==="target",a=i.querySelector(`.react-flow__handle[data-id="${e==null?void 0:e.nodeId}-${e==null?void 0:e.id}-${e==null?void 0:e.type}"]`),c={...WE(),handleDomNode:a};if(a){const u=Bd(void 0,a),f=a.getAttribute("data-nodeid"),p=a.getAttribute("data-handleid"),h=a.classList.contains("connectable"),E=a.classList.contains("connectableend"),y={source:l?f:n,sourceHandle:l?p:r,target:l?n:f,targetHandle:l?r:p};c.connection=y,h&&E&&(t===Wn.Strict?l&&u==="source"||!l&&u==="target":f!==n||p!==r)&&(c.endHandle={nodeId:f,handleId:p,type:u},c.isValid=s(y))}return c}function RO({nodes:e,nodeId:t,handleId:n,handleType:r}){return e.reduce((o,s)=>{if(s[Ce]){const{handleBounds:i}=s[Ce];let l=[],a=[];i&&(l=zE(s,i,"source",`${t}-${n}-${r}`),a=zE(s,i,"target",`${t}-${n}-${r}`)),o.push(...l,...a)}return o},[])}function Bd(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function zd(e){e==null||e.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function NO(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function YE({event:e,handleId:t,nodeId:n,onConnect:r,isTarget:o,getState:s,setState:i,isValidConnection:l,edgeUpdaterType:a,onEdgeUpdateEnd:c}){const u=OE(e.target),{connectionMode:f,domNode:p,autoPanOnConnect:h,connectionRadius:E,onConnectStart:y,panBy:v,getNodes:m,cancelConnection:g}=s();let S=0,_;const{x,y:R}=zn(e),T=u==null?void 0:u.elementFromPoint(x,R),L=Bd(a,T),P=p==null?void 0:p.getBoundingClientRect();if(!P||!L)return;let I,j=zn(e,P),V=!1,M=null,w=!1,b=null;const k=RO({nodes:m(),nodeId:n,handleId:t,handleType:L}),F=()=>{if(!h)return;const[U,$]=wE(j,P);v({x:U,y:$}),S=requestAnimationFrame(F)};i({connectionPosition:j,connectionStatus:null,connectionNodeId:n,connectionHandleId:t,connectionHandleType:L,connectionStartHandle:{nodeId:n,handleId:t,type:L},connectionEndHandle:null}),y==null||y(e,{nodeId:n,handleId:t,handleType:L});function C(U){const{transform:$}=s();j=zn(U,P);const{handle:B,validHandleResult:W}=SO(U,u,$d(j,$,!1,[1,1]),E,k,z=>GE(z,f,n,t,o?"target":"source",l,u));if(_=B,V||(F(),V=!0),b=W.handleDomNode,M=W.connection,w=W.isValid,i({connectionPosition:_&&w?VE({x:_.x,y:_.y},$):j,connectionStatus:NO(!!_,w),connectionEndHandle:W.endHandle}),!_&&!w&&!b)return zd(I);M.source!==M.target&&b&&(zd(I),I=b,b.classList.add("connecting","react-flow__handle-connecting"),b.classList.toggle("valid",w),b.classList.toggle("react-flow__handle-valid",w))}function D(U){var $,B;(_||b)&&M&&w&&(r==null||r(M)),(B=($=s()).onConnectEnd)==null||B.call($,U),a&&(c==null||c(U)),zd(I),g(),cancelAnimationFrame(S),V=!1,w=!1,M=null,b=null,u.removeEventListener("mousemove",C),u.removeEventListener("mouseup",D),u.removeEventListener("touchmove",C),u.removeEventListener("touchend",D)}u.addEventListener("mousemove",C),u.addEventListener("mouseup",D),u.addEventListener("touchmove",C),u.addEventListener("touchend",D)}const KE=()=>!0,wO=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),OO=(e,t,n)=>r=>{const{connectionStartHandle:o,connectionEndHandle:s,connectionClickStartHandle:i}=r;return{connecting:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.handleId)===t&&(o==null?void 0:o.type)===n||(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.handleId)===t&&(s==null?void 0:s.type)===n,clickConnecting:(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.handleId)===t&&(i==null?void 0:i.type)===n}},XE=O.forwardRef(({type:e="source",position:t=q.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:o=!0,isConnectableEnd:s=!0,id:i,onConnect:l,children:a,className:c,onMouseDown:u,onTouchStart:f,...p},h)=>{var P,I;const E=i||null,y=e==="target",v=Ie(),m=EO(),{connectOnClick:g,noPanClassName:S}=de(wO,Ge),{connecting:_,clickConnecting:x}=de(OO(m,E,e),Ge);m||(I=(P=v.getState()).onError)==null||I.call(P,"010",En.error010());const R=j=>{const{defaultEdgeOptions:V,onConnect:M,hasDefaultEdges:w}=v.getState(),b={...V,...j};if(w){const{edges:k,setEdges:F}=v.getState();F(jE(b,k))}M==null||M(b),l==null||l(b)},T=j=>{if(!m)return;const V=IE(j);o&&(V&&j.button===0||!V)&&YE({event:j,handleId:E,nodeId:m,onConnect:R,isTarget:y,getState:v.getState,setState:v.setState,isValidConnection:n||v.getState().isValidConnection||KE}),V?u==null||u(j):f==null||f(j)},L=j=>{const{onClickConnectStart:V,onClickConnectEnd:M,connectionClickStartHandle:w,connectionMode:b,isValidConnection:k}=v.getState();if(!m||!w&&!o)return;if(!w){V==null||V(j,{nodeId:m,handleId:E,handleType:e}),v.setState({connectionClickStartHandle:{nodeId:m,type:e,handleId:E}});return}const F=OE(j.target),C=n||k||KE,{connection:D,isValid:U}=GE({nodeId:m,id:E,type:e},b,w.nodeId,w.handleId||null,w.type,C,F);U&&R(D),M==null||M(j),v.setState({connectionClickStartHandle:null})};return H.createElement("div",{"data-handleid":E,"data-nodeid":m,"data-handlepos":t,"data-id":`${m}-${E}-${e}`,className:Je(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",S,c,{source:!y,target:y,connectable:r,connectablestart:o,connectableend:s,connecting:x,connectionindicator:r&&(o&&!_||s&&_)}]),onMouseDown:T,onTouchStart:T,onClick:g?L:void 0,ref:h,...p},a)});XE.displayName="Handle";var No=O.memo(XE);const QE=({data:e,isConnectable:t,targetPosition:n=q.Top,sourcePosition:r=q.Bottom})=>H.createElement(H.Fragment,null,H.createElement(No,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,H.createElement(No,{type:"source",position:r,isConnectable:t}));QE.displayName="DefaultNode";var Wd=O.memo(QE);const qE=({data:e,isConnectable:t,sourcePosition:n=q.Bottom})=>H.createElement(H.Fragment,null,e==null?void 0:e.label,H.createElement(No,{type:"source",position:n,isConnectable:t}));qE.displayName="InputNode";var JE=O.memo(qE);const ZE=({data:e,isConnectable:t,targetPosition:n=q.Top})=>H.createElement(H.Fragment,null,H.createElement(No,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label);ZE.displayName="OutputNode";var e0=O.memo(ZE);const Gd=()=>null;Gd.displayName="GroupNode";const TO=e=>({selectedNodes:e.getNodes().filter(t=>t.selected),selectedEdges:e.edges.filter(t=>t.selected)}),ma=e=>e.id;function AO(e,t){return Ge(e.selectedNodes.map(ma),t.selectedNodes.map(ma))&&Ge(e.selectedEdges.map(ma),t.selectedEdges.map(ma))}const t0=O.memo(({onSelectionChange:e})=>{const t=Ie(),{selectedNodes:n,selectedEdges:r}=de(TO,AO);return O.useEffect(()=>{const o={nodes:n,edges:r};e==null||e(o),t.getState().onSelectionChange.forEach(s=>s(o))},[n,r,e]),null});t0.displayName="SelectionListener";const IO=e=>!!e.onSelectionChange;function CO({onSelectionChange:e}){const t=de(IO);return e||t?H.createElement(t0,{onSelectionChange:e}):null}const LO=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 wo(e,t){O.useEffect(()=>{typeof e<"u"&&t(e)},[e])}function ne(e,t,n){O.useEffect(()=>{typeof t<"u"&&n({[e]:t})},[t])}const bO=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:o,onConnectStart:s,onConnectEnd:i,onClickConnectStart:l,onClickConnectEnd:a,nodesDraggable:c,nodesConnectable:u,nodesFocusable:f,edgesFocusable:p,edgesUpdatable:h,elevateNodesOnSelect:E,minZoom:y,maxZoom:v,nodeExtent:m,onNodesChange:g,onEdgesChange:S,elementsSelectable:_,connectionMode:x,snapGrid:R,snapToGrid:T,translateExtent:L,connectOnClick:P,defaultEdgeOptions:I,fitView:j,fitViewOptions:V,onNodesDelete:M,onEdgesDelete:w,onNodeDrag:b,onNodeDragStart:k,onNodeDragStop:F,onSelectionDrag:C,onSelectionDragStart:D,onSelectionDragStop:U,noPanClassName:$,nodeOrigin:B,rfId:W,autoPanOnConnect:z,autoPanOnNodeDrag:Y,onError:X,connectionRadius:Z,isValidConnection:J,nodeDragThreshold:te})=>{const{setNodes:ce,setEdges:Re,setDefaultNodesAndEdges:Me,setMinZoom:tn,setMaxZoom:Le,setTranslateExtent:ye,setNodeExtent:ut,reset:St}=de(LO,Ge),ee=Ie();return O.useEffect(()=>{const Cr=r==null?void 0:r.map(Lr=>({...Lr,...I}));return Me(n,Cr),()=>{St()}},[]),ne("defaultEdgeOptions",I,ee.setState),ne("connectionMode",x,ee.setState),ne("onConnect",o,ee.setState),ne("onConnectStart",s,ee.setState),ne("onConnectEnd",i,ee.setState),ne("onClickConnectStart",l,ee.setState),ne("onClickConnectEnd",a,ee.setState),ne("nodesDraggable",c,ee.setState),ne("nodesConnectable",u,ee.setState),ne("nodesFocusable",f,ee.setState),ne("edgesFocusable",p,ee.setState),ne("edgesUpdatable",h,ee.setState),ne("elementsSelectable",_,ee.setState),ne("elevateNodesOnSelect",E,ee.setState),ne("snapToGrid",T,ee.setState),ne("snapGrid",R,ee.setState),ne("onNodesChange",g,ee.setState),ne("onEdgesChange",S,ee.setState),ne("connectOnClick",P,ee.setState),ne("fitViewOnInit",j,ee.setState),ne("fitViewOnInitOptions",V,ee.setState),ne("onNodesDelete",M,ee.setState),ne("onEdgesDelete",w,ee.setState),ne("onNodeDrag",b,ee.setState),ne("onNodeDragStart",k,ee.setState),ne("onNodeDragStop",F,ee.setState),ne("onSelectionDrag",C,ee.setState),ne("onSelectionDragStart",D,ee.setState),ne("onSelectionDragStop",U,ee.setState),ne("noPanClassName",$,ee.setState),ne("nodeOrigin",B,ee.setState),ne("rfId",W,ee.setState),ne("autoPanOnConnect",z,ee.setState),ne("autoPanOnNodeDrag",Y,ee.setState),ne("onError",X,ee.setState),ne("connectionRadius",Z,ee.setState),ne("isValidConnection",J,ee.setState),ne("nodeDragThreshold",te,ee.setState),wo(e,ce),wo(t,Re),wo(y,tn),wo(v,Le),wo(L,ye),wo(m,ut),null},n0={display:"none"},DO={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},r0="react-flow__node-desc",o0="react-flow__edge-desc",kO="react-flow__aria-live",PO=e=>e.ariaLiveMessage;function MO({rfId:e}){const t=de(PO);return H.createElement("div",{id:`${kO}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:DO},t)}function UO({rfId:e,disableKeyboardA11y:t}){return H.createElement(H.Fragment,null,H.createElement("div",{id:`${r0}-${e}`,style:n0},"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."," "),H.createElement("div",{id:`${o0}-${e}`,style:n0},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!t&&H.createElement(MO,{rfId:e}))}var Oo=(e=null,t={actInsideInputWithModifier:!0})=>{const[n,r]=O.useState(!1),o=O.useRef(!1),s=O.useRef(new Set([])),[i,l]=O.useMemo(()=>{if(e!==null){const c=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.split("+")),u=c.reduce((f,p)=>f.concat(...p),[]);return[c,u]}return[[],[]]},[e]);return O.useEffect(()=>{const a=typeof document<"u"?document:null,c=(t==null?void 0:t.target)||a;if(e!==null){const u=h=>{if(o.current=h.ctrlKey||h.metaKey||h.shiftKey,(!o.current||o.current&&!t.actInsideInputWithModifier)&&Pd(h))return!1;const y=i0(h.code,l);s.current.add(h[y]),s0(i,s.current,!1)&&(h.preventDefault(),r(!0))},f=h=>{if((!o.current||o.current&&!t.actInsideInputWithModifier)&&Pd(h))return!1;const y=i0(h.code,l);s0(i,s.current,!0)?(r(!1),s.current.clear()):s.current.delete(h[y]),h.key==="Meta"&&s.current.clear(),o.current=!1},p=()=>{s.current.clear(),r(!1)};return c==null||c.addEventListener("keydown",u),c==null||c.addEventListener("keyup",f),window.addEventListener("blur",p),()=>{c==null||c.removeEventListener("keydown",u),c==null||c.removeEventListener("keyup",f),window.removeEventListener("blur",p)}}},[e,r]),n};function s0(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(o=>t.has(o)))}function i0(e,t){return t.includes(e)?"code":"key"}function l0(e,t,n,r){var i,l;if(!e.parentNode)return n;const o=t.get(e.parentNode),s=Ro(o,r);return l0(o,t,{x:(n.x??0)+s.x,y:(n.y??0)+s.y,z:(((i=o[Ce])==null?void 0:i.z)??0)>(n.z??0)?((l=o[Ce])==null?void 0:l.z)??0:n.z??0},r)}function a0(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:s,y:i,z:l}=l0(r,e,{...r.position,z:((o=r[Ce])==null?void 0:o.z)??0},t);r.positionAbsolute={x:s,y:i},r[Ce].z=l,n!=null&&n[r.id]&&(r[Ce].isParent=!0)}})}function Yd(e,t,n,r){const o=new Map,s={},i=r?1e3:0;return e.forEach(l=>{var f;const a=(It(l.zIndex)?l.zIndex:0)+(l.selected?i:0),c=t.get(l.id),u={width:c==null?void 0:c.width,height:c==null?void 0:c.height,...l,positionAbsolute:{x:l.position.x,y:l.position.y}};l.parentNode&&(u.parentNode=l.parentNode,s[l.parentNode]=!0),Object.defineProperty(u,Ce,{enumerable:!1,value:{handleBounds:(f=c==null?void 0:c[Ce])==null?void 0:f.handleBounds,z:a}}),o.set(l.id,u)}),a0(o,n,s),o}function c0(e,t={}){const{getNodes:n,width:r,height:o,minZoom:s,maxZoom:i,d3Zoom:l,d3Selection:a,fitViewOnInitDone:c,fitViewOnInit:u,nodeOrigin:f}=e(),p=t.initial&&!c&&u;if(l&&a&&(p||!t.initial)){const E=n().filter(v=>{var g;const m=t.includeHiddenNodes?v.width&&v.height:!v.hidden;return(g=t.nodes)!=null&&g.length?m&&t.nodes.some(S=>S.id===v.id):m}),y=E.every(v=>v.width&&v.height);if(E.length>0&&y){const v=Hd(E,f),{x:m,y:g,zoom:S}=BE(v,r,o,t.minZoom??s,t.maxZoom??i,t.padding??.1),_=Bn.translate(m,g).scale(S);return typeof t.duration=="number"&&t.duration>0?l.transform(xr(a,t.duration),_):l.transform(a,_),!0}}return!1}function FO(e,t){return e.forEach(n=>{const r=t.get(n.id);r&&t.set(r.id,{...r,[Ce]:r[Ce],selected:n.selected})}),new Map(t)}function jO(e,t){return t.map(n=>{const r=e.find(o=>o.id===n.id);return r&&(n.selected=r.selected),n})}function ga({changedNodes:e,changedEdges:t,get:n,set:r}){const{nodeInternals:o,edges:s,onNodesChange:i,onEdgesChange:l,hasDefaultNodes:a,hasDefaultEdges:c}=n();e!=null&&e.length&&(a&&r({nodeInternals:FO(e,o)}),i==null||i(e)),t!=null&&t.length&&(c&&r({edges:jO(t,s)}),l==null||l(t))}const To=()=>{},VO={zoomIn:To,zoomOut:To,zoomTo:To,getZoom:()=>1,setViewport:To,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:To,fitBounds:To,project:e=>e,screenToFlowPosition:e=>e,flowToScreenPosition:e=>e,viewportInitialized:!1},$O=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection}),HO=()=>{const e=Ie(),{d3Zoom:t,d3Selection:n}=de($O,Ge);return O.useMemo(()=>n&&t?{zoomIn:o=>t.scaleBy(xr(n,o==null?void 0:o.duration),1.2),zoomOut:o=>t.scaleBy(xr(n,o==null?void 0:o.duration),1/1.2),zoomTo:(o,s)=>t.scaleTo(xr(n,s==null?void 0:s.duration),o),getZoom:()=>e.getState().transform[2],setViewport:(o,s)=>{const[i,l,a]=e.getState().transform,c=Bn.translate(o.x??i,o.y??l).scale(o.zoom??a);t.transform(xr(n,s==null?void 0:s.duration),c)},getViewport:()=>{const[o,s,i]=e.getState().transform;return{x:o,y:s,zoom:i}},fitView:o=>c0(e.getState,o),setCenter:(o,s,i)=>{const{width:l,height:a,maxZoom:c}=e.getState(),u=typeof(i==null?void 0:i.zoom)<"u"?i.zoom:c,f=l/2-o*u,p=a/2-s*u,h=Bn.translate(f,p).scale(u);t.transform(xr(n,i==null?void 0:i.duration),h)},fitBounds:(o,s)=>{const{width:i,height:l,minZoom:a,maxZoom:c}=e.getState(),{x:u,y:f,zoom:p}=BE(o,i,l,a,c,(s==null?void 0:s.padding)??.1),h=Bn.translate(u,f).scale(p);t.transform(xr(n,s==null?void 0:s.duration),h)},project:o=>{const{transform:s,snapToGrid:i,snapGrid:l}=e.getState();return console.warn("[DEPRECATED] `project` is deprecated. Instead use `screenToFlowPosition`. There is no need to subtract the react flow bounds anymore! https://reactflow.dev/api-reference/types/react-flow-instance#screen-to-flow-position"),$d(o,s,i,l)},screenToFlowPosition:o=>{const{transform:s,snapToGrid:i,snapGrid:l,domNode:a}=e.getState();if(!a)return o;const{x:c,y:u}=a.getBoundingClientRect(),f={x:o.x-c,y:o.y-u};return $d(f,s,i,l)},flowToScreenPosition:o=>{const{transform:s,domNode:i}=e.getState();if(!i)return o;const{x:l,y:a}=i.getBoundingClientRect(),c=VE(o,s);return{x:c.x+l,y:c.y+a}},viewportInitialized:!0}:VO,[t,n])};function Kd(){const e=HO(),t=Ie(),n=O.useCallback(()=>t.getState().getNodes().map(y=>({...y})),[]),r=O.useCallback(y=>t.getState().nodeInternals.get(y),[]),o=O.useCallback(()=>{const{edges:y=[]}=t.getState();return y.map(v=>({...v}))},[]),s=O.useCallback(y=>{const{edges:v=[]}=t.getState();return v.find(m=>m.id===y)},[]),i=O.useCallback(y=>{const{getNodes:v,setNodes:m,hasDefaultNodes:g,onNodesChange:S}=t.getState(),_=v(),x=typeof y=="function"?y(_):y;if(g)m(x);else if(S){const R=x.length===0?_.map(T=>({type:"remove",id:T.id})):x.map(T=>({item:T,type:"reset"}));S(R)}},[]),l=O.useCallback(y=>{const{edges:v=[],setEdges:m,hasDefaultEdges:g,onEdgesChange:S}=t.getState(),_=typeof y=="function"?y(v):y;if(g)m(_);else if(S){const x=_.length===0?v.map(R=>({type:"remove",id:R.id})):_.map(R=>({item:R,type:"reset"}));S(x)}},[]),a=O.useCallback(y=>{const v=Array.isArray(y)?y:[y],{getNodes:m,setNodes:g,hasDefaultNodes:S,onNodesChange:_}=t.getState();if(S){const R=[...m(),...v];g(R)}else if(_){const x=v.map(R=>({item:R,type:"add"}));_(x)}},[]),c=O.useCallback(y=>{const v=Array.isArray(y)?y:[y],{edges:m=[],setEdges:g,hasDefaultEdges:S,onEdgesChange:_}=t.getState();if(S)g([...m,...v]);else if(_){const x=v.map(R=>({item:R,type:"add"}));_(x)}},[]),u=O.useCallback(()=>{const{getNodes:y,edges:v=[],transform:m}=t.getState(),[g,S,_]=m;return{nodes:y().map(x=>({...x})),edges:v.map(x=>({...x})),viewport:{x:g,y:S,zoom:_}}},[]),f=O.useCallback(({nodes:y,edges:v})=>{const{nodeInternals:m,getNodes:g,edges:S,hasDefaultNodes:_,hasDefaultEdges:x,onNodesDelete:R,onEdgesDelete:T,onNodesChange:L,onEdgesChange:P}=t.getState(),I=(y||[]).map(b=>b.id),j=(v||[]).map(b=>b.id),V=g().reduce((b,k)=>{const F=!I.includes(k.id)&&k.parentNode&&b.find(D=>D.id===k.parentNode);return(typeof k.deletable=="boolean"?k.deletable:!0)&&(I.includes(k.id)||F)&&b.push(k),b},[]),M=S.filter(b=>typeof b.deletable=="boolean"?b.deletable:!0),w=M.filter(b=>j.includes(b.id));if(V||w){const b=HE(V,M),k=[...w,...b],F=k.reduce((C,D)=>(C.includes(D.id)||C.push(D.id),C),[]);if((x||_)&&(x&&t.setState({edges:S.filter(C=>!F.includes(C.id))}),_&&(V.forEach(C=>{m.delete(C.id)}),t.setState({nodeInternals:new Map(m)}))),F.length>0&&(T==null||T(k),P&&P(F.map(C=>({id:C,type:"remove"})))),V.length>0&&(R==null||R(V),L)){const C=V.map(D=>({id:D.id,type:"remove"}));L(C)}}},[]),p=O.useCallback(y=>{const v=cO(y),m=v?null:t.getState().nodeInternals.get(y.id);return[v?y:TE(m),m,v]},[]),h=O.useCallback((y,v=!0,m)=>{const[g,S,_]=p(y);return g?(m||t.getState().getNodes()).filter(x=>{if(!_&&(x.id===S.id||!x.positionAbsolute))return!1;const R=TE(x),T=kd(R,g);return v&&T>0||T>=g.width*g.height}):[]},[]),E=O.useCallback((y,v,m=!0)=>{const[g]=p(y);if(!g)return!1;const S=kd(g,v);return m&&S>0||S>=g.width*g.height},[]);return O.useMemo(()=>({...e,getNodes:n,getNode:r,getEdges:o,getEdge:s,setNodes:i,setEdges:l,addNodes:a,addEdges:c,toObject:u,deleteElements:f,getIntersectingNodes:h,isNodeIntersecting:E}),[e,n,r,o,s,i,l,a,c,u,f,h,E])}const BO={actInsideInputWithModifier:!1};var zO=({deleteKeyCode:e,multiSelectionKeyCode:t})=>{const n=Ie(),{deleteElements:r}=Kd(),o=Oo(e,BO),s=Oo(t);O.useEffect(()=>{if(o){const{edges:i,getNodes:l}=n.getState(),a=l().filter(u=>u.selected),c=i.filter(u=>u.selected);r({nodes:a,edges:c}),n.setState({nodesSelectionActive:!1})}},[o]),O.useEffect(()=>{n.setState({multiSelectionActive:s})},[s])};function WO(e){const t=Ie();O.useEffect(()=>{let n;const r=()=>{var s,i;if(!e.current)return;const o=Ld(e.current);(o.height===0||o.width===0)&&((i=(s=t.getState()).onError)==null||i.call(s,"004",En.error004())),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 Xd={position:"absolute",width:"100%",height:"100%",top:0,left:0},GO=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,Ea=e=>({x:e.x,y:e.y,zoom:e.k}),Ao=(e,t)=>e.target.closest(`.${t}`),u0=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),d0=e=>{const t=e.ctrlKey&&da()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t},YO=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),KO=({onMove:e,onMoveStart:t,onMoveEnd:n,onPaneContextMenu:r,zoomOnScroll:o=!0,zoomOnPinch:s=!0,panOnScroll:i=!1,panOnScrollSpeed:l=.5,panOnScrollMode:a=Sr.Free,zoomOnDoubleClick:c=!0,elementsSelectable:u,panOnDrag:f=!0,defaultViewport:p,translateExtent:h,minZoom:E,maxZoom:y,zoomActivationKeyCode:v,preventScrolling:m=!0,children:g,noWheelClassName:S,noPanClassName:_})=>{const x=O.useRef(),R=Ie(),T=O.useRef(!1),L=O.useRef(!1),P=O.useRef(null),I=O.useRef({x:0,y:0,zoom:0}),{d3Zoom:j,d3Selection:V,d3ZoomHandler:M,userSelectionActive:w}=de(YO,Ge),b=Oo(v),k=O.useRef(0),F=O.useRef(!1),C=O.useRef();return WO(P),O.useEffect(()=>{if(P.current){const D=P.current.getBoundingClientRect(),U=tO().scaleExtent([E,y]).translateExtent(h),$=jt(P.current).call(U),B=Bn.translate(p.x,p.y).scale(So(p.zoom,E,y)),W=[[0,0],[D.width,D.height]],z=U.constrain()(B,W,h);U.transform($,z),U.wheelDelta(d0),R.setState({d3Zoom:U,d3Selection:$,d3ZoomHandler:$.on("wheel.zoom"),transform:[z.x,z.y,z.k],domNode:P.current.closest(".react-flow")})}},[]),O.useEffect(()=>{V&&j&&(i&&!b&&!w?V.on("wheel.zoom",D=>{if(Ao(D,S))return!1;D.preventDefault(),D.stopImmediatePropagation();const U=V.property("__zoom").k||1,$=da();if(D.ctrlKey&&s&&$){const te=Xt(D),ce=d0(D),Re=U*Math.pow(2,ce);j.scaleTo(V,Re,te,D);return}const B=D.deltaMode===1?20:1;let W=a===Sr.Vertical?0:D.deltaX*B,z=a===Sr.Horizontal?0:D.deltaY*B;!$&&D.shiftKey&&a!==Sr.Vertical&&(W=D.deltaY*B,z=0),j.translateBy(V,-(W/U)*l,-(z/U)*l,{internal:!0});const Y=Ea(V.property("__zoom")),{onViewportChangeStart:X,onViewportChange:Z,onViewportChangeEnd:J}=R.getState();clearTimeout(C.current),F.current||(F.current=!0,t==null||t(D,Y),X==null||X(Y)),F.current&&(e==null||e(D,Y),Z==null||Z(Y),C.current=setTimeout(()=>{n==null||n(D,Y),J==null||J(Y),F.current=!1},150))},{passive:!1}):typeof M<"u"&&V.on("wheel.zoom",function(D,U){if(!m||Ao(D,S))return null;D.preventDefault(),M.call(this,D,U)},{passive:!1}))},[w,i,a,V,j,M,b,s,m,S,t,e,n]),O.useEffect(()=>{j&&j.on("start",D=>{var B,W;if(!D.sourceEvent||D.sourceEvent.internal)return null;k.current=(B=D.sourceEvent)==null?void 0:B.button;const{onViewportChangeStart:U}=R.getState(),$=Ea(D.transform);T.current=!0,I.current=$,((W=D.sourceEvent)==null?void 0:W.type)==="mousedown"&&R.setState({paneDragging:!0}),U==null||U($),t==null||t(D.sourceEvent,$)})},[j,t]),O.useEffect(()=>{j&&(w&&!T.current?j.on("zoom",null):w||j.on("zoom",D=>{var $;const{onViewportChange:U}=R.getState();if(R.setState({transform:[D.transform.x,D.transform.y,D.transform.k]}),L.current=!!(r&&u0(f,k.current??0)),(e||U)&&!(($=D.sourceEvent)!=null&&$.internal)){const B=Ea(D.transform);U==null||U(B),e==null||e(D.sourceEvent,B)}}))},[w,j,e,f,r]),O.useEffect(()=>{j&&j.on("end",D=>{if(!D.sourceEvent||D.sourceEvent.internal)return null;const{onViewportChangeEnd:U}=R.getState();if(T.current=!1,R.setState({paneDragging:!1}),r&&u0(f,k.current??0)&&!L.current&&r(D.sourceEvent),L.current=!1,(n||U)&&GO(I.current,D.transform)){const $=Ea(D.transform);I.current=$,clearTimeout(x.current),x.current=setTimeout(()=>{U==null||U($),n==null||n(D.sourceEvent,$)},i?150:0)}})},[j,i,f,n,r]),O.useEffect(()=>{j&&j.filter(D=>{const U=b||o,$=s&&D.ctrlKey;if((f===!0||Array.isArray(f)&&f.includes(1))&&D.button===1&&D.type==="mousedown"&&(Ao(D,"react-flow__node")||Ao(D,"react-flow__edge")))return!0;if(!f&&!U&&!i&&!c&&!s||w||!c&&D.type==="dblclick"||Ao(D,S)&&D.type==="wheel"||Ao(D,_)&&(D.type!=="wheel"||i&&D.type==="wheel"&&!b)||!s&&D.ctrlKey&&D.type==="wheel"||!U&&!i&&!$&&D.type==="wheel"||!f&&(D.type==="mousedown"||D.type==="touchstart")||Array.isArray(f)&&!f.includes(D.button)&&(D.type==="mousedown"||D.type==="touchstart"))return!1;const B=Array.isArray(f)&&f.includes(D.button)||!D.button||D.button<=1;return(!D.ctrlKey||D.type==="wheel")&&B})},[w,j,o,s,i,c,f,u,b]),H.createElement("div",{className:"react-flow__renderer",ref:P,style:Xd},g)},XO=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function QO(){const{userSelectionActive:e,userSelectionRect:t}=de(XO,Ge);return e&&t?H.createElement("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 f0(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 s=Math.abs(t.position.x);n.position.x=n.position.x-s,n.style.width+=s,t.position.x=0}if(t.position.y<0){const s=Math.abs(t.position.y);n.position.y=n.position.y-s,n.style.height+=s,t.position.y=0}n.width=n.style.width,n.height=n.style.height}}}function p0(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 s=e.filter(l=>l.id===o.id);if(s.length===0)return r.push(o),r;const i={...o};for(const l of s)if(l)switch(l.type){case"select":{i.selected=l.selected;break}case"position":{typeof l.position<"u"&&(i.position=l.position),typeof l.positionAbsolute<"u"&&(i.positionAbsolute=l.positionAbsolute),typeof l.dragging<"u"&&(i.dragging=l.dragging),i.expandParent&&f0(r,i);break}case"dimensions":{typeof l.dimensions<"u"&&(i.width=l.dimensions.width,i.height=l.dimensions.height),typeof l.updateStyle<"u"&&(i.style={...i.style||{},...l.dimensions}),typeof l.resizing=="boolean"&&(i.resizing=l.resizing),i.expandParent&&f0(r,i);break}case"remove":return r}return r.push(i),r},n)}function h0(e,t){return p0(e,t)}function qO(e,t){return p0(e,t)}const Yn=(e,t)=>({id:e,type:"select",selected:t});function Io(e,t){return e.reduce((n,r)=>{const o=t.includes(r.id);return!r.selected&&o?(r.selected=!0,n.push(Yn(r.id,!0))):r.selected&&!o&&(r.selected=!1,n.push(Yn(r.id,!1))),n},[])}const Qd=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},JO=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),m0=O.memo(({isSelecting:e,selectionMode:t=ti.Full,panOnDrag:n,onSelectionStart:r,onSelectionEnd:o,onPaneClick:s,onPaneContextMenu:i,onPaneScroll:l,onPaneMouseEnter:a,onPaneMouseMove:c,onPaneMouseLeave:u,children:f})=>{const p=O.useRef(null),h=Ie(),E=O.useRef(0),y=O.useRef(0),v=O.useRef(),{userSelectionActive:m,elementsSelectable:g,dragging:S}=de(JO,Ge),_=()=>{h.setState({userSelectionActive:!1,userSelectionRect:null}),E.current=0,y.current=0},x=M=>{s==null||s(M),h.getState().resetSelectedElements(),h.setState({nodesSelectionActive:!1})},R=M=>{if(Array.isArray(n)&&(n!=null&&n.includes(2))){M.preventDefault();return}i==null||i(M)},T=l?M=>l(M):void 0,L=M=>{const{resetSelectedElements:w,domNode:b}=h.getState();if(v.current=b==null?void 0:b.getBoundingClientRect(),!g||!e||M.button!==0||M.target!==p.current||!v.current)return;const{x:k,y:F}=zn(M,v.current);w(),h.setState({userSelectionRect:{width:0,height:0,startX:k,startY:F,x:k,y:F}}),r==null||r(M)},P=M=>{const{userSelectionRect:w,nodeInternals:b,edges:k,transform:F,onNodesChange:C,onEdgesChange:D,nodeOrigin:U,getNodes:$}=h.getState();if(!e||!v.current||!w)return;h.setState({userSelectionActive:!0,nodesSelectionActive:!1});const B=zn(M,v.current),W=w.startX??0,z=w.startY??0,Y={...w,x:B.x<W?B.x:W,y:B.y<z?B.y:z,width:Math.abs(B.x-W),height:Math.abs(B.y-z)},X=$(),Z=$E(b,Y,F,t===ti.Partial,!0,U),J=HE(Z,k).map(ce=>ce.id),te=Z.map(ce=>ce.id);if(E.current!==te.length){E.current=te.length;const ce=Io(X,te);ce.length&&(C==null||C(ce))}if(y.current!==J.length){y.current=J.length;const ce=Io(k,J);ce.length&&(D==null||D(ce))}h.setState({userSelectionRect:Y})},I=M=>{if(M.button!==0)return;const{userSelectionRect:w}=h.getState();!m&&w&&M.target===p.current&&(x==null||x(M)),h.setState({nodesSelectionActive:E.current>0}),_(),o==null||o(M)},j=M=>{m&&(h.setState({nodesSelectionActive:E.current>0}),o==null||o(M)),_()},V=g&&(e||m);return H.createElement("div",{className:Je(["react-flow__pane",{dragging:S,selection:e}]),onClick:V?void 0:Qd(x,p),onContextMenu:Qd(R,p),onWheel:Qd(T,p),onMouseEnter:V?void 0:a,onMouseDown:V?L:void 0,onMouseMove:V?P:c,onMouseUp:V?I:void 0,onMouseLeave:V?j:u,ref:p,style:Xd},f,H.createElement(QO,null))});m0.displayName="Pane";function g0(e,t){if(!e.parentNode)return!1;const n=t.get(e.parentNode);return n?n.selected?!0:g0(n,t):!1}function E0(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 ZO(e,t,n,r){return Array.from(e.values()).filter(o=>(o.selected||o.id===r)&&(!o.parentNode||!g0(o,e))&&(o.draggable||t&&typeof o.draggable>"u")).map(o=>{var s,i;return{id:o.id,position:o.position||{x:0,y:0},positionAbsolute:o.positionAbsolute||{x:0,y:0},distance:{x:n.x-(((s=o.positionAbsolute)==null?void 0:s.x)??0),y:n.y-(((i=o.positionAbsolute)==null?void 0:i.y)??0)},delta:{x:0,y:0},extent:o.extent,parentNode:o.parentNode,width:o.width,height:o.height,expandParent:o.expandParent}})}function eT(e,t){return!t||t==="parent"?t:[t[0],[t[1][0]-(e.width||0),t[1][1]-(e.height||0)]]}function y0(e,t,n,r,o=[0,0],s){const i=eT(e,e.extent||r);let l=i;if(e.extent==="parent"&&!e.expandParent)if(e.parentNode&&e.width&&e.height){const u=n.get(e.parentNode),{x:f,y:p}=Ro(u,o).positionAbsolute;l=u&&It(f)&&It(p)&&It(u.width)&&It(u.height)?[[f+e.width*o[0],p+e.height*o[1]],[f+u.width-e.width+e.width*o[0],p+u.height-e.height+e.height*o[1]]]:l}else s==null||s("005",En.error005()),l=i;else if(e.extent&&e.parentNode&&e.extent!=="parent"){const u=n.get(e.parentNode),{x:f,y:p}=Ro(u,o).positionAbsolute;l=[[e.extent[0][0]+f,e.extent[0][1]+p],[e.extent[1][0]+f,e.extent[1][1]+p]]}let a={x:0,y:0};if(e.parentNode){const u=n.get(e.parentNode);a=Ro(u,o).positionAbsolute}const c=l&&l!=="parent"?bd(t,l):t;return{position:{x:c.x-a.x,y:c.y-a.y},positionAbsolute:c}}function qd({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 v0=(e,t,n,r)=>{const o=t.querySelectorAll(e);if(!o||!o.length)return null;const s=Array.from(o),i=t.getBoundingClientRect(),l={x:i.width*r[0],y:i.height*r[1]};return s.map(a=>{const c=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),position:a.getAttribute("data-handlepos"),x:(c.left-i.left-l.x)/n,y:(c.top-i.top-l.y)/n,...Ld(a)}})};function oi(e,t,n){return n===void 0?n:r=>{const o=t().nodeInternals.get(e);o&&n(r,{...o})}}function Jd({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:o,unselectNodesAndEdges:s,multiSelectionActive:i,nodeInternals:l,onError:a}=t.getState(),c=l.get(e);if(!c){a==null||a("012",En.error012(e));return}t.setState({nodesSelectionActive:!1}),c.selected?(n||c.selected&&i)&&(s({nodes:[c],edges:[]}),requestAnimationFrame(()=>{var u;return(u=r==null?void 0:r.current)==null?void 0:u.blur()})):o([e])}function tT(){const e=Ie();return O.useCallback(({sourceEvent:n})=>{const{transform:r,snapGrid:o,snapToGrid:s}=e.getState(),i=n.touches?n.touches[0].clientX:n.clientX,l=n.touches?n.touches[0].clientY:n.clientY,a={x:(i-r[0])/r[2],y:(l-r[1])/r[2]};return{xSnapped:s?o[0]*Math.round(a.x/o[0]):a.x,ySnapped:s?o[1]*Math.round(a.y/o[1]):a.y,...a}},[])}function Zd(e){return(t,n,r)=>e==null?void 0:e(t,r)}function _0({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:o,isSelectable:s,selectNodesOnDrag:i}){const l=Ie(),[a,c]=O.useState(!1),u=O.useRef([]),f=O.useRef({x:null,y:null}),p=O.useRef(0),h=O.useRef(null),E=O.useRef({x:0,y:0}),y=O.useRef(null),v=O.useRef(!1),m=O.useRef(!1),g=tT();return O.useEffect(()=>{if(e!=null&&e.current){const S=jt(e.current),_=({x:T,y:L})=>{const{nodeInternals:P,onNodeDrag:I,onSelectionDrag:j,updateNodePositions:V,nodeExtent:M,snapGrid:w,snapToGrid:b,nodeOrigin:k,onError:F}=l.getState();f.current={x:T,y:L};let C=!1,D={x:0,y:0,x2:0,y2:0};if(u.current.length>1&&M){const $=Hd(u.current,k);D=Dd($)}if(u.current=u.current.map($=>{const B={x:T-$.distance.x,y:L-$.distance.y};b&&(B.x=w[0]*Math.round(B.x/w[0]),B.y=w[1]*Math.round(B.y/w[1]));const W=[[M[0][0],M[0][1]],[M[1][0],M[1][1]]];u.current.length>1&&M&&!$.extent&&(W[0][0]=$.positionAbsolute.x-D.x+M[0][0],W[1][0]=$.positionAbsolute.x+($.width??0)-D.x2+M[1][0],W[0][1]=$.positionAbsolute.y-D.y+M[0][1],W[1][1]=$.positionAbsolute.y+($.height??0)-D.y2+M[1][1]);const z=y0($,B,P,W,k,F);return C=C||$.position.x!==z.position.x||$.position.y!==z.position.y,$.position=z.position,$.positionAbsolute=z.positionAbsolute,$}),!C)return;V(u.current,!0,!0),c(!0);const U=o?I:Zd(j);if(U&&y.current){const[$,B]=qd({nodeId:o,dragItems:u.current,nodeInternals:P});U(y.current,$,B)}},x=()=>{if(!h.current)return;const[T,L]=wE(E.current,h.current);if(T!==0||L!==0){const{transform:P,panBy:I}=l.getState();f.current.x=(f.current.x??0)-T/P[2],f.current.y=(f.current.y??0)-L/P[2],I({x:T,y:L})&&_(f.current)}p.current=requestAnimationFrame(x)},R=T=>{var k;const{nodeInternals:L,multiSelectionActive:P,nodesDraggable:I,unselectNodesAndEdges:j,onNodeDragStart:V,onSelectionDragStart:M}=l.getState();m.current=!0;const w=o?V:Zd(M);(!i||!s)&&!P&&o&&((k=L.get(o))!=null&&k.selected||j()),o&&s&&i&&Jd({id:o,store:l,nodeRef:e});const b=g(T);if(f.current=b,u.current=ZO(L,I,b,o),w&&u.current){const[F,C]=qd({nodeId:o,dragItems:u.current,nodeInternals:L});w(T.sourceEvent,F,C)}};if(t)S.on(".drag",null);else{const T=d1().on("start",L=>{const{domNode:P,nodeDragThreshold:I}=l.getState();I===0&&R(L);const j=g(L);f.current=j,h.current=(P==null?void 0:P.getBoundingClientRect())||null,E.current=zn(L.sourceEvent,h.current)}).on("drag",L=>{var V,M;const P=g(L),{autoPanOnNodeDrag:I,nodeDragThreshold:j}=l.getState();if(!v.current&&m.current&&I&&(v.current=!0,x()),!m.current){const w=P.xSnapped-(((V=f==null?void 0:f.current)==null?void 0:V.x)??0),b=P.ySnapped-(((M=f==null?void 0:f.current)==null?void 0:M.y)??0);Math.sqrt(w*w+b*b)>j&&R(L)}(f.current.x!==P.xSnapped||f.current.y!==P.ySnapped)&&u.current&&m.current&&(y.current=L.sourceEvent,E.current=zn(L.sourceEvent,h.current),_(P))}).on("end",L=>{if(m.current&&(c(!1),v.current=!1,m.current=!1,cancelAnimationFrame(p.current),u.current)){const{updateNodePositions:P,nodeInternals:I,onNodeDragStop:j,onSelectionDragStop:V}=l.getState(),M=o?j:Zd(V);if(P(u.current,!1,!1),M){const[w,b]=qd({nodeId:o,dragItems:u.current,nodeInternals:I});M(L.sourceEvent,w,b)}}}).filter(L=>{const P=L.target;return!L.button&&(!n||!E0(P,`.${n}`,e))&&(!r||E0(P,r,e))});return S.call(T),()=>{S.on(".drag",null)}}}},[e,t,n,r,s,l,o,i,g]),a}function S0(){const e=Ie();return O.useCallback(n=>{const{nodeInternals:r,nodeExtent:o,updateNodePositions:s,getNodes:i,snapToGrid:l,snapGrid:a,onError:c,nodesDraggable:u}=e.getState(),f=i().filter(g=>g.selected&&(g.draggable||u&&typeof g.draggable>"u")),p=l?a[0]:5,h=l?a[1]:5,E=n.isShiftPressed?4:1,y=n.x*p*E,v=n.y*h*E,m=f.map(g=>{if(g.positionAbsolute){const S={x:g.positionAbsolute.x+y,y:g.positionAbsolute.y+v};l&&(S.x=a[0]*Math.round(S.x/a[0]),S.y=a[1]*Math.round(S.y/a[1]));const{positionAbsolute:_,position:x}=y0(g,S,r,o,void 0,c);g.position=x,g.positionAbsolute=_}return g});s(m,!0,!1)},[])}const Co={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var si=e=>{const t=({id:n,type:r,data:o,xPos:s,yPos:i,xPosOrigin:l,yPosOrigin:a,selected:c,onClick:u,onMouseEnter:f,onMouseMove:p,onMouseLeave:h,onContextMenu:E,onDoubleClick:y,style:v,className:m,isDraggable:g,isSelectable:S,isConnectable:_,isFocusable:x,selectNodesOnDrag:R,sourcePosition:T,targetPosition:L,hidden:P,resizeObserver:I,dragHandle:j,zIndex:V,isParent:M,noDragClassName:w,noPanClassName:b,initialized:k,disableKeyboardA11y:F,ariaLabel:C,rfId:D})=>{const U=Ie(),$=O.useRef(null),B=O.useRef(T),W=O.useRef(L),z=O.useRef(r),Y=S||g||u||f||p||h,X=S0(),Z=oi(n,U.getState,f),J=oi(n,U.getState,p),te=oi(n,U.getState,h),ce=oi(n,U.getState,E),Re=oi(n,U.getState,y),Me=ye=>{const{nodeDragThreshold:ut}=U.getState();if(S&&(!R||!g||ut>0)&&Jd({id:n,store:U,nodeRef:$}),u){const St=U.getState().nodeInternals.get(n);St&&u(ye,{...St})}},tn=ye=>{if(!Pd(ye))if(AE.includes(ye.key)&&S){const ut=ye.key==="Escape";Jd({id:n,store:U,unselect:ut,nodeRef:$})}else!F&&g&&c&&Object.prototype.hasOwnProperty.call(Co,ye.key)&&(U.setState({ariaLiveMessage:`Moved selected node ${ye.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~s}, y: ${~~i}`}),X({x:Co[ye.key].x,y:Co[ye.key].y,isShiftPressed:ye.shiftKey}))};O.useEffect(()=>{if($.current&&!P){const ye=$.current;return I==null||I.observe(ye),()=>I==null?void 0:I.unobserve(ye)}},[P]),O.useEffect(()=>{const ye=z.current!==r,ut=B.current!==T,St=W.current!==L;$.current&&(ye||ut||St)&&(ye&&(z.current=r),ut&&(B.current=T),St&&(W.current=L),U.getState().updateNodeDimensions([{id:n,nodeElement:$.current,forceUpdate:!0}]))},[n,r,T,L]);const Le=_0({nodeRef:$,disabled:P||!g,noDragClassName:w,handleSelector:j,nodeId:n,isSelectable:S,selectNodesOnDrag:R});return P?null:H.createElement("div",{className:Je(["react-flow__node",`react-flow__node-${r}`,{[b]:g},m,{selected:c,selectable:S,parent:M,dragging:Le}]),ref:$,style:{zIndex:V,transform:`translate(${l}px,${a}px)`,pointerEvents:Y?"all":"none",visibility:k?"visible":"hidden",...v},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:Z,onMouseMove:J,onMouseLeave:te,onContextMenu:ce,onClick:Me,onDoubleClick:Re,onKeyDown:x?tn:void 0,tabIndex:x?0:void 0,role:x?"button":void 0,"aria-describedby":F?void 0:`${r0}-${D}`,"aria-label":C},H.createElement(gO,{value:n},H.createElement(e,{id:n,data:o,type:r,xPos:s,yPos:i,selected:c,isConnectable:_,sourcePosition:T,targetPosition:L,dragging:Le,dragHandle:j,zIndex:V})))};return t.displayName="NodeWrapper",O.memo(t)};const nT=e=>{const t=e.getNodes().filter(n=>n.selected);return{...Hd(t,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};function rT({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=Ie(),{width:o,height:s,x:i,y:l,transformString:a,userSelectionActive:c}=de(nT,Ge),u=S0(),f=O.useRef(null);if(O.useEffect(()=>{var E;n||(E=f.current)==null||E.focus({preventScroll:!0})},[n]),_0({nodeRef:f}),c||!o||!s)return null;const p=e?E=>{const y=r.getState().getNodes().filter(v=>v.selected);e(E,y)}:void 0,h=E=>{Object.prototype.hasOwnProperty.call(Co,E.key)&&u({x:Co[E.key].x,y:Co[E.key].y,isShiftPressed:E.shiftKey})};return H.createElement("div",{className:Je(["react-flow__nodesselection","react-flow__container",t]),style:{transform:a}},H.createElement("div",{ref:f,className:"react-flow__nodesselection-rect",onContextMenu:p,tabIndex:n?void 0:-1,onKeyDown:n?void 0:h,style:{width:o,height:s,top:l,left:i}}))}var oT=O.memo(rT);const sT=e=>e.nodesSelectionActive,x0=({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:s,onPaneScroll:i,deleteKeyCode:l,onMove:a,onMoveStart:c,onMoveEnd:u,selectionKeyCode:f,selectionOnDrag:p,selectionMode:h,onSelectionStart:E,onSelectionEnd:y,multiSelectionKeyCode:v,panActivationKeyCode:m,zoomActivationKeyCode:g,elementsSelectable:S,zoomOnScroll:_,zoomOnPinch:x,panOnScroll:R,panOnScrollSpeed:T,panOnScrollMode:L,zoomOnDoubleClick:P,panOnDrag:I,defaultViewport:j,translateExtent:V,minZoom:M,maxZoom:w,preventScrolling:b,onSelectionContextMenu:k,noWheelClassName:F,noPanClassName:C,disableKeyboardA11y:D})=>{const U=de(sT),$=Oo(f),B=Oo(m),W=B||I,z=B||R,Y=$||p&&W!==!0;return zO({deleteKeyCode:l,multiSelectionKeyCode:v}),H.createElement(KO,{onMove:a,onMoveStart:c,onMoveEnd:u,onPaneContextMenu:s,elementsSelectable:S,zoomOnScroll:_,zoomOnPinch:x,panOnScroll:z,panOnScrollSpeed:T,panOnScrollMode:L,zoomOnDoubleClick:P,panOnDrag:!$&&W,defaultViewport:j,translateExtent:V,minZoom:M,maxZoom:w,zoomActivationKeyCode:g,preventScrolling:b,noWheelClassName:F,noPanClassName:C},H.createElement(m0,{onSelectionStart:E,onSelectionEnd:y,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:s,onPaneScroll:i,panOnDrag:W,isSelecting:!!Y,selectionMode:h},e,U&&H.createElement(oT,{onSelectionContextMenu:k,noPanClassName:C,disableKeyboardA11y:D})))};x0.displayName="FlowRenderer";var iT=O.memo(x0);function lT(e){return de(O.useCallback(n=>e?$E(n.nodeInternals,{x:0,y:0,width:n.width,height:n.height},n.transform,!0):n.getNodes(),[e]))}function aT(e){const t={input:si(e.input||JE),default:si(e.default||Wd),output:si(e.output||e0),group:si(e.group||Gd)},n={},r=Object.keys(e).filter(o=>!["input","default","output","group"].includes(o)).reduce((o,s)=>(o[s]=si(e[s]||Wd),o),n);return{...t,...r}}const cT=({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]},uT=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),R0=e=>{const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:o,updateNodeDimensions:s,onError:i}=de(uT,Ge),l=lT(e.onlyRenderVisibleElements),a=O.useRef(),c=O.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const u=new ResizeObserver(f=>{const p=f.map(h=>({id:h.target.getAttribute("data-id"),nodeElement:h.target,forceUpdate:!0}));s(p)});return a.current=u,u},[]);return O.useEffect(()=>()=>{var u;(u=a==null?void 0:a.current)==null||u.disconnect()},[]),H.createElement("div",{className:"react-flow__nodes",style:Xd},l.map(u=>{var x,R;let f=u.type||"default";e.nodeTypes[f]||(i==null||i("003",En.error003(f)),f="default");const p=e.nodeTypes[f]||e.nodeTypes.default,h=!!(u.draggable||t&&typeof u.draggable>"u"),E=!!(u.selectable||o&&typeof u.selectable>"u"),y=!!(u.connectable||n&&typeof u.connectable>"u"),v=!!(u.focusable||r&&typeof u.focusable>"u"),m=e.nodeExtent?bd(u.positionAbsolute,e.nodeExtent):u.positionAbsolute,g=(m==null?void 0:m.x)??0,S=(m==null?void 0:m.y)??0,_=cT({x:g,y:S,width:u.width??0,height:u.height??0,origin:e.nodeOrigin});return H.createElement(p,{key:u.id,id:u.id,className:u.className,style:u.style,type:f,data:u.data,sourcePosition:u.sourcePosition||q.Bottom,targetPosition:u.targetPosition||q.Top,hidden:u.hidden,xPos:g,yPos:S,xPosOrigin:_.x,yPosOrigin:_.y,selectNodesOnDrag:e.selectNodesOnDrag,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,selected:!!u.selected,isDraggable:h,isSelectable:E,isConnectable:y,isFocusable:v,resizeObserver:c,dragHandle:u.dragHandle,zIndex:((x=u[Ce])==null?void 0:x.z)??0,isParent:!!((R=u[Ce])!=null&&R.isParent),noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,initialized:!!u.width&&!!u.height,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,ariaLabel:u.ariaLabel})}))};R0.displayName="NodeRenderer";var dT=O.memo(R0);const fT=(e,t,n)=>n===q.Left?e-t:n===q.Right?e+t:e,pT=(e,t,n)=>n===q.Top?e-t:n===q.Bottom?e+t:e,N0="react-flow__edgeupdater",w0=({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:o,onMouseEnter:s,onMouseOut:i,type:l})=>H.createElement("circle",{onMouseDown:o,onMouseEnter:s,onMouseOut:i,className:Je([N0,`${N0}-${l}`]),cx:fT(t,r,e),cy:pT(n,r,e),r,stroke:"transparent",fill:"transparent"}),hT=()=>!0;var Lo=e=>{const t=({id:n,className:r,type:o,data:s,onClick:i,onEdgeDoubleClick:l,selected:a,animated:c,label:u,labelStyle:f,labelShowBg:p,labelBgStyle:h,labelBgPadding:E,labelBgBorderRadius:y,style:v,source:m,target:g,sourceX:S,sourceY:_,targetX:x,targetY:R,sourcePosition:T,targetPosition:L,elementsSelectable:P,hidden:I,sourceHandleId:j,targetHandleId:V,onContextMenu:M,onMouseEnter:w,onMouseMove:b,onMouseLeave:k,edgeUpdaterRadius:F,onEdgeUpdate:C,onEdgeUpdateStart:D,onEdgeUpdateEnd:U,markerEnd:$,markerStart:B,rfId:W,ariaLabel:z,isFocusable:Y,isUpdatable:X,pathOptions:Z,interactionWidth:J})=>{const te=O.useRef(null),[ce,Re]=O.useState(!1),[Me,tn]=O.useState(!1),Le=Ie(),ye=O.useMemo(()=>`url(#${Vd(B,W)})`,[B,W]),ut=O.useMemo(()=>`url(#${Vd($,W)})`,[$,W]);if(I)return null;const St=Ye=>{var nn;const{edges:xt,addSelectedEdges:kr,unselectNodesAndEdges:Pr,multiSelectionActive:Mr}=Le.getState(),Sn=xt.find(wi=>wi.id===n);Sn&&(P&&(Le.setState({nodesSelectionActive:!1}),Sn.selected&&Mr?(Pr({nodes:[],edges:[Sn]}),(nn=te.current)==null||nn.blur()):kr([n])),i&&i(Ye,Sn))},ee=ei(n,Le.getState,l),Cr=ei(n,Le.getState,M),Lr=ei(n,Le.getState,w),Ri=ei(n,Le.getState,b),Ko=ei(n,Le.getState,k),br=(Ye,xt)=>{if(Ye.button!==0)return;const{edges:kr,isValidConnection:Pr}=Le.getState(),Mr=xt?g:m,Sn=(xt?V:j)||null,nn=xt?"target":"source",wi=Pr||hT,Gf=xt,Oi=kr.find(Ur=>Ur.id===n);tn(!0),D==null||D(Ye,Oi,nn);const Yf=Ur=>{tn(!1),U==null||U(Ur,Oi,nn)};YE({event:Ye,handleId:Sn,nodeId:Mr,onConnect:Ur=>C==null?void 0:C(Oi,Ur),isTarget:Gf,getState:Le.getState,setState:Le.setState,isValidConnection:wi,edgeUpdaterType:nn,onEdgeUpdateEnd:Yf})},tr=Ye=>br(Ye,!0),Xo=Ye=>br(Ye,!1),nr=()=>Re(!0),Dr=()=>Re(!1),Ni=!P&&!i,Qo=Ye=>{var xt;if(AE.includes(Ye.key)&&P){const{unselectNodesAndEdges:kr,addSelectedEdges:Pr,edges:Mr}=Le.getState();Ye.key==="Escape"?((xt=te.current)==null||xt.blur(),kr({edges:[Mr.find(nn=>nn.id===n)]})):Pr([n])}};return H.createElement("g",{className:Je(["react-flow__edge",`react-flow__edge-${o}`,r,{selected:a,animated:c,inactive:Ni,updating:ce}]),onClick:St,onDoubleClick:ee,onContextMenu:Cr,onMouseEnter:Lr,onMouseMove:Ri,onMouseLeave:Ko,onKeyDown:Y?Qo:void 0,tabIndex:Y?0:void 0,role:Y?"button":"img","data-testid":`rf__edge-${n}`,"aria-label":z===null?void 0:z||`Edge from ${m} to ${g}`,"aria-describedby":Y?`${o0}-${W}`:void 0,ref:te},!Me&&H.createElement(e,{id:n,source:m,target:g,selected:a,animated:c,label:u,labelStyle:f,labelShowBg:p,labelBgStyle:h,labelBgPadding:E,labelBgBorderRadius:y,data:s,style:v,sourceX:S,sourceY:_,targetX:x,targetY:R,sourcePosition:T,targetPosition:L,sourceHandleId:j,targetHandleId:V,markerStart:ye,markerEnd:ut,pathOptions:Z,interactionWidth:J}),X&&H.createElement(H.Fragment,null,(X==="source"||X===!0)&&H.createElement(w0,{position:T,centerX:S,centerY:_,radius:F,onMouseDown:tr,onMouseEnter:nr,onMouseOut:Dr,type:"source"}),(X==="target"||X===!0)&&H.createElement(w0,{position:L,centerX:x,centerY:R,radius:F,onMouseDown:Xo,onMouseEnter:nr,onMouseOut:Dr,type:"target"})))};return t.displayName="EdgeWrapper",O.memo(t)};function mT(e){const t={default:Lo(e.default||ha),straight:Lo(e.bezier||Fd),step:Lo(e.step||Ud),smoothstep:Lo(e.step||fa),simplebezier:Lo(e.simplebezier||Md)},n={},r=Object.keys(e).filter(o=>!["default","bezier"].includes(o)).reduce((o,s)=>(o[s]=Lo(e[s]||ha),o),n);return{...t,...r}}function O0(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,s=(n==null?void 0:n.width)||t.width,i=(n==null?void 0:n.height)||t.height;switch(e){case q.Top:return{x:r+s/2,y:o};case q.Right:return{x:r+s,y:o+i/2};case q.Bottom:return{x:r+s/2,y:o+i};case q.Left:return{x:r,y:o+i/2}}}function T0(e,t){return e?e.length===1||!t?e[0]:t&&e.find(n=>n.id===t)||null:null}const gT=(e,t,n,r,o,s)=>{const i=O0(n,e,t),l=O0(s,r,o);return{sourceX:i.x,sourceY:i.y,targetX:l.x,targetY:l.y}};function ET({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:r,targetWidth:o,targetHeight:s,width:i,height:l,transform:a}){const c={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+s)};c.x===c.x2&&(c.x2+=1),c.y===c.y2&&(c.y2+=1);const u=Dd({x:(0-a[0])/a[2],y:(0-a[1])/a[2],width:i/a[2],height:l/a[2]}),f=Math.max(0,Math.min(u.x2,c.x2)-Math.max(u.x,c.x)),p=Math.max(0,Math.min(u.y2,c.y2)-Math.max(u.y,c.y));return Math.ceil(f*p)>0}function A0(e){var r,o,s,i,l;const t=((r=e==null?void 0:e[Ce])==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((s=e==null?void 0:e.positionAbsolute)==null?void 0:s.y)<"u";return[{x:((i=e==null?void 0:e.positionAbsolute)==null?void 0:i.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]}const yT=[{level:0,isMaxLevel:!0,edges:[]}];function vT(e,t,n=!1){let r=-1;const o=e.reduce((i,l)=>{var u,f;const a=It(l.zIndex);let c=a?l.zIndex:0;if(n){const p=t.get(l.target),h=t.get(l.source),E=l.selected||(p==null?void 0:p.selected)||(h==null?void 0:h.selected),y=Math.max(((u=h==null?void 0:h[Ce])==null?void 0:u.z)||0,((f=p==null?void 0:p[Ce])==null?void 0:f.z)||0,1e3);c=(a?l.zIndex:0)+(E?y:0)}return i[c]?i[c].push(l):i[c]=[l],r=c>r?c:r,i},{}),s=Object.entries(o).map(([i,l])=>{const a=+i;return{edges:l,level:a,isMaxLevel:a===r}});return s.length===0?yT:s}function _T(e,t,n){const r=de(O.useCallback(o=>e?o.edges.filter(s=>{const i=t.get(s.source),l=t.get(s.target);return(i==null?void 0:i.width)&&(i==null?void 0:i.height)&&(l==null?void 0:l.width)&&(l==null?void 0:l.height)&&ET({sourcePos:i.positionAbsolute||{x:0,y:0},targetPos:l.positionAbsolute||{x:0,y:0},sourceWidth:i.width,sourceHeight:i.height,targetWidth:l.width,targetHeight:l.height,width:o.width,height:o.height,transform:o.transform})}):o.edges,[e,t]));return vT(r,t,n)}const ST=({color:e="none",strokeWidth:t=1})=>H.createElement("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),xT=({color:e="none",strokeWidth:t=1})=>H.createElement("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),I0={[ni.Arrow]:ST,[ni.ArrowClosed]:xT};function RT(e){const t=Ie();return O.useMemo(()=>{var o,s;return Object.prototype.hasOwnProperty.call(I0,e)?I0[e]:((s=(o=t.getState()).onError)==null||s.call(o,"009",En.error009(e)),null)},[e])}const NT=({id:e,type:t,color:n,width:r=12.5,height:o=12.5,markerUnits:s="strokeWidth",strokeWidth:i,orient:l="auto-start-reverse"})=>{const a=RT(t);return a?H.createElement("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:s,orient:l,refX:"0",refY:"0"},H.createElement(a,{color:n,strokeWidth:i})):null},wT=({defaultColor:e,rfId:t})=>n=>{const r=[];return n.edges.reduce((o,s)=>([s.markerStart,s.markerEnd].forEach(i=>{if(i&&typeof i=="object"){const l=Vd(i,t);r.includes(l)||(o.push({id:l,color:i.color||e,...i}),r.push(l))}}),o),[]).sort((o,s)=>o.id.localeCompare(s.id))},C0=({defaultColor:e,rfId:t})=>{const n=de(O.useCallback(wT({defaultColor:e,rfId:t}),[e,t]),(r,o)=>!(r.length!==o.length||r.some((s,i)=>s.id!==o[i].id)));return H.createElement("defs",null,n.map(r=>H.createElement(NT,{id:r.id,key:r.id,type:r.type,color:r.color,width:r.width,height:r.height,markerUnits:r.markerUnits,strokeWidth:r.strokeWidth,orient:r.orient})))};C0.displayName="MarkerDefinitions";var OT=O.memo(C0);const TT=e=>({nodesConnectable:e.nodesConnectable,edgesFocusable:e.edgesFocusable,edgesUpdatable:e.edgesUpdatable,elementsSelectable:e.elementsSelectable,width:e.width,height:e.height,connectionMode:e.connectionMode,nodeInternals:e.nodeInternals,onError:e.onError}),L0=({defaultMarkerColor:e,onlyRenderVisibleElements:t,elevateEdgesOnSelect:n,rfId:r,edgeTypes:o,noPanClassName:s,onEdgeUpdate:i,onEdgeContextMenu:l,onEdgeMouseEnter:a,onEdgeMouseMove:c,onEdgeMouseLeave:u,onEdgeClick:f,edgeUpdaterRadius:p,onEdgeDoubleClick:h,onEdgeUpdateStart:E,onEdgeUpdateEnd:y,children:v})=>{const{edgesFocusable:m,edgesUpdatable:g,elementsSelectable:S,width:_,height:x,connectionMode:R,nodeInternals:T,onError:L}=de(TT,Ge),P=_T(t,T,n);return _?H.createElement(H.Fragment,null,P.map(({level:I,edges:j,isMaxLevel:V})=>H.createElement("svg",{key:I,style:{zIndex:I},width:_,height:x,className:"react-flow__edges react-flow__container"},V&&H.createElement(OT,{defaultColor:e,rfId:r}),H.createElement("g",null,j.map(M=>{const[w,b,k]=A0(T.get(M.source)),[F,C,D]=A0(T.get(M.target));if(!k||!D)return null;let U=M.type||"default";o[U]||(L==null||L("011",En.error011(U)),U="default");const $=o[U]||o.default,B=R===Wn.Strict?C.target:(C.target??[]).concat(C.source??[]),W=T0(b.source,M.sourceHandle),z=T0(B,M.targetHandle),Y=(W==null?void 0:W.position)||q.Bottom,X=(z==null?void 0:z.position)||q.Top,Z=!!(M.focusable||m&&typeof M.focusable>"u"),J=typeof i<"u"&&(M.updatable||g&&typeof M.updatable>"u");if(!W||!z)return L==null||L("008",En.error008(W,M)),null;const{sourceX:te,sourceY:ce,targetX:Re,targetY:Me}=gT(w,W,Y,F,z,X);return H.createElement($,{key:M.id,id:M.id,className:Je([M.className,s]),type:U,data:M.data,selected:!!M.selected,animated:!!M.animated,hidden:!!M.hidden,label:M.label,labelStyle:M.labelStyle,labelShowBg:M.labelShowBg,labelBgStyle:M.labelBgStyle,labelBgPadding:M.labelBgPadding,labelBgBorderRadius:M.labelBgBorderRadius,style:M.style,source:M.source,target:M.target,sourceHandleId:M.sourceHandle,targetHandleId:M.targetHandle,markerEnd:M.markerEnd,markerStart:M.markerStart,sourceX:te,sourceY:ce,targetX:Re,targetY:Me,sourcePosition:Y,targetPosition:X,elementsSelectable:S,onEdgeUpdate:i,onContextMenu:l,onMouseEnter:a,onMouseMove:c,onMouseLeave:u,onClick:f,edgeUpdaterRadius:p,onEdgeDoubleClick:h,onEdgeUpdateStart:E,onEdgeUpdateEnd:y,rfId:r,ariaLabel:M.ariaLabel,isFocusable:Z,isUpdatable:J,pathOptions:"pathOptions"in M?M.pathOptions:void 0,interactionWidth:M.interactionWidth})})))),v):null};L0.displayName="EdgeRenderer";var AT=O.memo(L0);const IT=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function CT({children:e}){const t=de(IT);return H.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:t}},e)}function LT(e){const t=Kd(),n=O.useRef(!1);O.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const bT={[q.Left]:q.Right,[q.Right]:q.Left,[q.Top]:q.Bottom,[q.Bottom]:q.Top},b0=({nodeId:e,handleType:t,style:n,type:r=Gn.Bezier,CustomComponent:o,connectionStatus:s})=>{var R,T,L;const{fromNode:i,handleId:l,toX:a,toY:c,connectionMode:u}=de(O.useCallback(P=>({fromNode:P.nodeInternals.get(e),handleId:P.connectionHandleId,toX:(P.connectionPosition.x-P.transform[0])/P.transform[2],toY:(P.connectionPosition.y-P.transform[1])/P.transform[2],connectionMode:P.connectionMode}),[e]),Ge),f=(R=i==null?void 0:i[Ce])==null?void 0:R.handleBounds;let p=f==null?void 0:f[t];if(u===Wn.Loose&&(p=p||(f==null?void 0:f[t==="source"?"target":"source"])),!i||!p)return null;const h=l?p.find(P=>P.id===l):p[0],E=h?h.x+h.width/2:(i.width??0)/2,y=h?h.y+h.height/2:i.height??0,v=(((T=i.positionAbsolute)==null?void 0:T.x)??0)+E,m=(((L=i.positionAbsolute)==null?void 0:L.y)??0)+y,g=h==null?void 0:h.position,S=g?bT[g]:null;if(!g||!S)return null;if(o)return H.createElement(o,{connectionLineType:r,connectionLineStyle:n,fromNode:i,fromHandle:h,fromX:v,fromY:m,toX:a,toY:c,fromPosition:g,toPosition:S,connectionStatus:s});let _="";const x={sourceX:v,sourceY:m,sourcePosition:g,targetX:a,targetY:c,targetPosition:S};return r===Gn.Bezier?[_]=UE(x):r===Gn.Step?[_]=ri({...x,borderRadius:0}):r===Gn.SmoothStep?[_]=ri(x):r===Gn.SimpleBezier?[_]=DE(x):_=`M${v},${m} ${a},${c}`,H.createElement("path",{d:_,fill:"none",className:"react-flow__connection-path",style:n})};b0.displayName="ConnectionLine";const DT=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function kT({containerStyle:e,style:t,type:n,component:r}){const{nodeId:o,handleType:s,nodesConnectable:i,width:l,height:a,connectionStatus:c}=de(DT,Ge);return!(o&&s&&l&&i)?null:H.createElement("svg",{style:e,width:l,height:a,className:"react-flow__edges react-flow__connectionline react-flow__container"},H.createElement("g",{className:Je(["react-flow__connection",c])},H.createElement(b0,{nodeId:o,handleType:s,style:t,type:n,CustomComponent:r,connectionStatus:c})))}function D0(e,t){return O.useRef(null),Ie(),O.useMemo(()=>t(e),[e])}const k0=({nodeTypes:e,edgeTypes:t,onMove:n,onMoveStart:r,onMoveEnd:o,onInit:s,onNodeClick:i,onEdgeClick:l,onNodeDoubleClick:a,onEdgeDoubleClick:c,onNodeMouseEnter:u,onNodeMouseMove:f,onNodeMouseLeave:p,onNodeContextMenu:h,onSelectionContextMenu:E,onSelectionStart:y,onSelectionEnd:v,connectionLineType:m,connectionLineStyle:g,connectionLineComponent:S,connectionLineContainerStyle:_,selectionKeyCode:x,selectionOnDrag:R,selectionMode:T,multiSelectionKeyCode:L,panActivationKeyCode:P,zoomActivationKeyCode:I,deleteKeyCode:j,onlyRenderVisibleElements:V,elementsSelectable:M,selectNodesOnDrag:w,defaultViewport:b,translateExtent:k,minZoom:F,maxZoom:C,preventScrolling:D,defaultMarkerColor:U,zoomOnScroll:$,zoomOnPinch:B,panOnScroll:W,panOnScrollSpeed:z,panOnScrollMode:Y,zoomOnDoubleClick:X,panOnDrag:Z,onPaneClick:J,onPaneMouseEnter:te,onPaneMouseMove:ce,onPaneMouseLeave:Re,onPaneScroll:Me,onPaneContextMenu:tn,onEdgeUpdate:Le,onEdgeContextMenu:ye,onEdgeMouseEnter:ut,onEdgeMouseMove:St,onEdgeMouseLeave:ee,edgeUpdaterRadius:Cr,onEdgeUpdateStart:Lr,onEdgeUpdateEnd:Ri,noDragClassName:Ko,noWheelClassName:br,noPanClassName:tr,elevateEdgesOnSelect:Xo,disableKeyboardA11y:nr,nodeOrigin:Dr,nodeExtent:Ni,rfId:Qo})=>{const Ye=D0(e,aT),xt=D0(t,mT);return LT(s),H.createElement(iT,{onPaneClick:J,onPaneMouseEnter:te,onPaneMouseMove:ce,onPaneMouseLeave:Re,onPaneContextMenu:tn,onPaneScroll:Me,deleteKeyCode:j,selectionKeyCode:x,selectionOnDrag:R,selectionMode:T,onSelectionStart:y,onSelectionEnd:v,multiSelectionKeyCode:L,panActivationKeyCode:P,zoomActivationKeyCode:I,elementsSelectable:M,onMove:n,onMoveStart:r,onMoveEnd:o,zoomOnScroll:$,zoomOnPinch:B,zoomOnDoubleClick:X,panOnScroll:W,panOnScrollSpeed:z,panOnScrollMode:Y,panOnDrag:Z,defaultViewport:b,translateExtent:k,minZoom:F,maxZoom:C,onSelectionContextMenu:E,preventScrolling:D,noDragClassName:Ko,noWheelClassName:br,noPanClassName:tr,disableKeyboardA11y:nr},H.createElement(CT,null,H.createElement(AT,{edgeTypes:xt,onEdgeClick:l,onEdgeDoubleClick:c,onEdgeUpdate:Le,onlyRenderVisibleElements:V,onEdgeContextMenu:ye,onEdgeMouseEnter:ut,onEdgeMouseMove:St,onEdgeMouseLeave:ee,onEdgeUpdateStart:Lr,onEdgeUpdateEnd:Ri,edgeUpdaterRadius:Cr,defaultMarkerColor:U,noPanClassName:tr,elevateEdgesOnSelect:!!Xo,disableKeyboardA11y:nr,rfId:Qo},H.createElement(kT,{style:g,type:m,component:S,containerStyle:_})),H.createElement("div",{className:"react-flow__edgelabel-renderer"}),H.createElement(dT,{nodeTypes:Ye,onNodeClick:i,onNodeDoubleClick:a,onNodeMouseEnter:u,onNodeMouseMove:f,onNodeMouseLeave:p,onNodeContextMenu:h,selectNodesOnDrag:w,onlyRenderVisibleElements:V,noPanClassName:tr,noDragClassName:Ko,disableKeyboardA11y:nr,nodeOrigin:Dr,nodeExtent:Ni,rfId:Qo})))};k0.displayName="GraphView";var PT=O.memo(k0);const ef=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Kn={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:ef,nodeExtent:ef,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:Wn.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:0,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,onSelectionChange:[],multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:uO,isValidConnection:void 0},MT=()=>RR((e,t)=>({...Kn,setNodes:n=>{const{nodeInternals:r,nodeOrigin:o,elevateNodesOnSelect:s}=t();e({nodeInternals:Yd(n,r,o,s)})},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",s=typeof r<"u",i=o?Yd(n,new Map,t().nodeOrigin,t().elevateNodesOnSelect):new Map;e({nodeInternals:i,edges:s?r:[],hasDefaultNodes:o,hasDefaultEdges:s})},updateNodeDimensions:n=>{const{onNodesChange:r,nodeInternals:o,fitViewOnInit:s,fitViewOnInitDone:i,fitViewOnInitOptions:l,domNode:a,nodeOrigin:c}=t(),u=a==null?void 0:a.querySelector(".react-flow__viewport");if(!u)return;const f=window.getComputedStyle(u),{m22:p}=new window.DOMMatrixReadOnly(f.transform),h=n.reduce((y,v)=>{const m=o.get(v.id);if(m){const g=Ld(v.nodeElement);!!(g.width&&g.height&&(m.width!==g.width||m.height!==g.height||v.forceUpdate))&&(o.set(m.id,{...m,[Ce]:{...m[Ce],handleBounds:{source:v0(".source",v.nodeElement,p,c),target:v0(".target",v.nodeElement,p,c)}},...g}),y.push({id:m.id,type:"dimensions",dimensions:g}))}return y},[]);a0(o,c);const E=i||s&&!i&&c0(t,{initial:!0,...l});e({nodeInternals:new Map(o),fitViewOnInitDone:E}),(h==null?void 0:h.length)>0&&(r==null||r(h))},updateNodePositions:(n,r=!0,o=!1)=>{const{triggerNodeChanges:s}=t(),i=n.map(l=>{const a={id:l.id,type:"position",dragging:o};return r&&(a.positionAbsolute=l.positionAbsolute,a.position=l.position),a});s(i)},triggerNodeChanges:n=>{const{onNodesChange:r,nodeInternals:o,hasDefaultNodes:s,nodeOrigin:i,getNodes:l,elevateNodesOnSelect:a}=t();if(n!=null&&n.length){if(s){const c=h0(n,l()),u=Yd(c,o,i,a);e({nodeInternals:u})}r==null||r(n)}},addSelectedNodes:n=>{const{multiSelectionActive:r,edges:o,getNodes:s}=t();let i,l=null;r?i=n.map(a=>Yn(a,!0)):(i=Io(s(),n),l=Io(o,[])),ga({changedNodes:i,changedEdges:l,get:t,set:e})},addSelectedEdges:n=>{const{multiSelectionActive:r,edges:o,getNodes:s}=t();let i,l=null;r?i=n.map(a=>Yn(a,!0)):(i=Io(o,n),l=Io(s(),[])),ga({changedNodes:l,changedEdges:i,get:t,set:e})},unselectNodesAndEdges:({nodes:n,edges:r}={})=>{const{edges:o,getNodes:s}=t(),i=n||s(),l=r||o,a=i.map(u=>(u.selected=!1,Yn(u.id,!1))),c=l.map(u=>Yn(u.id,!1));ga({changedNodes:a,changedEdges:c,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(),s=r().filter(l=>l.selected).map(l=>Yn(l.id,!1)),i=n.filter(l=>l.selected).map(l=>Yn(l.id,!1));ga({changedNodes:s,changedEdges:i,get:t,set:e})},setNodeExtent:n=>{const{nodeInternals:r}=t();r.forEach(o=>{o.positionAbsolute=bd(o.position,n)}),e({nodeExtent:n,nodeInternals:new Map(r)})},panBy:n=>{const{transform:r,width:o,height:s,d3Zoom:i,d3Selection:l,translateExtent:a}=t();if(!i||!l||!n.x&&!n.y)return!1;const c=Bn.translate(r[0]+n.x,r[1]+n.y).scale(r[2]),u=[[0,0],[o,s]],f=i==null?void 0:i.constrain()(c,u,a);return i.transform(l,f),r[0]!==f.x||r[1]!==f.y||r[2]!==f.k},cancelConnection:()=>e({connectionNodeId:Kn.connectionNodeId,connectionHandleId:Kn.connectionHandleId,connectionHandleType:Kn.connectionHandleType,connectionStatus:Kn.connectionStatus,connectionStartHandle:Kn.connectionStartHandle,connectionEndHandle:Kn.connectionEndHandle}),reset:()=>e({...Kn})}),Object.is),tf=({children:e})=>{const t=O.useRef(null);return t.current||(t.current=MT()),H.createElement(nO,{value:t.current},e)};tf.displayName="ReactFlowProvider";const P0=({children:e})=>O.useContext(ua)?H.createElement(H.Fragment,null,e):H.createElement(tf,null,e);P0.displayName="ReactFlowWrapper";const UT={input:JE,default:Wd,output:e0,group:Gd},FT={default:ha,straight:Fd,step:Ud,smoothstep:fa,simplebezier:Md},jT=[0,0],VT=[15,15],$T={x:0,y:0,zoom:1},HT={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},M0=O.forwardRef(({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:o,nodeTypes:s=UT,edgeTypes:i=FT,onNodeClick:l,onEdgeClick:a,onInit:c,onMove:u,onMoveStart:f,onMoveEnd:p,onConnect:h,onConnectStart:E,onConnectEnd:y,onClickConnectStart:v,onClickConnectEnd:m,onNodeMouseEnter:g,onNodeMouseMove:S,onNodeMouseLeave:_,onNodeContextMenu:x,onNodeDoubleClick:R,onNodeDragStart:T,onNodeDrag:L,onNodeDragStop:P,onNodesDelete:I,onEdgesDelete:j,onSelectionChange:V,onSelectionDragStart:M,onSelectionDrag:w,onSelectionDragStop:b,onSelectionContextMenu:k,onSelectionStart:F,onSelectionEnd:C,connectionMode:D=Wn.Strict,connectionLineType:U=Gn.Bezier,connectionLineStyle:$,connectionLineComponent:B,connectionLineContainerStyle:W,deleteKeyCode:z="Backspace",selectionKeyCode:Y="Shift",selectionOnDrag:X=!1,selectionMode:Z=ti.Full,panActivationKeyCode:J="Space",multiSelectionKeyCode:te=da()?"Meta":"Control",zoomActivationKeyCode:ce=da()?"Meta":"Control",snapToGrid:Re=!1,snapGrid:Me=VT,onlyRenderVisibleElements:tn=!1,selectNodesOnDrag:Le=!0,nodesDraggable:ye,nodesConnectable:ut,nodesFocusable:St,nodeOrigin:ee=jT,edgesFocusable:Cr,edgesUpdatable:Lr,elementsSelectable:Ri,defaultViewport:Ko=$T,minZoom:br=.5,maxZoom:tr=2,translateExtent:Xo=ef,preventScrolling:nr=!0,nodeExtent:Dr,defaultMarkerColor:Ni="#b1b1b7",zoomOnScroll:Qo=!0,zoomOnPinch:Ye=!0,panOnScroll:xt=!1,panOnScrollSpeed:kr=.5,panOnScrollMode:Pr=Sr.Free,zoomOnDoubleClick:Mr=!0,panOnDrag:Sn=!0,onPaneClick:nn,onPaneMouseEnter:wi,onPaneMouseMove:Gf,onPaneMouseLeave:Oi,onPaneScroll:Yf,onPaneContextMenu:zv,children:Ur,onEdgeUpdate:SD,onEdgeContextMenu:xD,onEdgeDoubleClick:RD,onEdgeMouseEnter:ND,onEdgeMouseMove:wD,onEdgeMouseLeave:OD,onEdgeUpdateStart:TD,onEdgeUpdateEnd:AD,edgeUpdaterRadius:ID=10,onNodesChange:CD,onEdgesChange:LD,noDragClassName:bD="nodrag",noWheelClassName:DD="nowheel",noPanClassName:Wv="nopan",fitView:kD=!1,fitViewOptions:PD,connectOnClick:MD=!0,attributionPosition:UD,proOptions:FD,defaultEdgeOptions:jD,elevateNodesOnSelect:VD=!0,elevateEdgesOnSelect:$D=!1,disableKeyboardA11y:Gv=!1,autoPanOnConnect:HD=!0,autoPanOnNodeDrag:BD=!0,connectionRadius:zD=20,isValidConnection:WD,onError:GD,style:YD,id:Yv,nodeDragThreshold:KD,...XD},QD)=>{const Kf=Yv||"1";return H.createElement("div",{...XD,style:{...YD,...HT},ref:QD,className:Je(["react-flow",o]),"data-testid":"rf__wrapper",id:Yv},H.createElement(P0,null,H.createElement(PT,{onInit:c,onMove:u,onMoveStart:f,onMoveEnd:p,onNodeClick:l,onEdgeClick:a,onNodeMouseEnter:g,onNodeMouseMove:S,onNodeMouseLeave:_,onNodeContextMenu:x,onNodeDoubleClick:R,nodeTypes:s,edgeTypes:i,connectionLineType:U,connectionLineStyle:$,connectionLineComponent:B,connectionLineContainerStyle:W,selectionKeyCode:Y,selectionOnDrag:X,selectionMode:Z,deleteKeyCode:z,multiSelectionKeyCode:te,panActivationKeyCode:J,zoomActivationKeyCode:ce,onlyRenderVisibleElements:tn,selectNodesOnDrag:Le,defaultViewport:Ko,translateExtent:Xo,minZoom:br,maxZoom:tr,preventScrolling:nr,zoomOnScroll:Qo,zoomOnPinch:Ye,zoomOnDoubleClick:Mr,panOnScroll:xt,panOnScrollSpeed:kr,panOnScrollMode:Pr,panOnDrag:Sn,onPaneClick:nn,onPaneMouseEnter:wi,onPaneMouseMove:Gf,onPaneMouseLeave:Oi,onPaneScroll:Yf,onPaneContextMenu:zv,onSelectionContextMenu:k,onSelectionStart:F,onSelectionEnd:C,onEdgeUpdate:SD,onEdgeContextMenu:xD,onEdgeDoubleClick:RD,onEdgeMouseEnter:ND,onEdgeMouseMove:wD,onEdgeMouseLeave:OD,onEdgeUpdateStart:TD,onEdgeUpdateEnd:AD,edgeUpdaterRadius:ID,defaultMarkerColor:Ni,noDragClassName:bD,noWheelClassName:DD,noPanClassName:Wv,elevateEdgesOnSelect:$D,rfId:Kf,disableKeyboardA11y:Gv,nodeOrigin:ee,nodeExtent:Dr}),H.createElement(bO,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:h,onConnectStart:E,onConnectEnd:y,onClickConnectStart:v,onClickConnectEnd:m,nodesDraggable:ye,nodesConnectable:ut,nodesFocusable:St,edgesFocusable:Cr,edgesUpdatable:Lr,elementsSelectable:Ri,elevateNodesOnSelect:VD,minZoom:br,maxZoom:tr,nodeExtent:Dr,onNodesChange:CD,onEdgesChange:LD,snapToGrid:Re,snapGrid:Me,connectionMode:D,translateExtent:Xo,connectOnClick:MD,defaultEdgeOptions:jD,fitView:kD,fitViewOptions:PD,onNodesDelete:I,onEdgesDelete:j,onNodeDragStart:T,onNodeDrag:L,onNodeDragStop:P,onSelectionDrag:w,onSelectionDragStart:M,onSelectionDragStop:b,noPanClassName:Wv,nodeOrigin:ee,rfId:Kf,autoPanOnConnect:HD,autoPanOnNodeDrag:BD,onError:GD,connectionRadius:zD,isValidConnection:WD,nodeDragThreshold:KD}),H.createElement(CO,{onSelectionChange:V}),Ur,H.createElement(oO,{proOptions:FD,position:UD}),H.createElement(UO,{rfId:Kf,disableKeyboardA11y:Gv})))});M0.displayName="ReactFlow";const BT=e=>{var t;return(t=e.domNode)==null?void 0:t.querySelector(".react-flow__edgelabel-renderer")};function zT({children:e}){const t=de(BT);return t?Bl.createPortal(e,t):null}function WT(){const e=Ie();return O.useCallback(t=>{const{domNode:n,updateNodeDimensions:r}=e.getState(),s=(Array.isArray(t)?t:[t]).reduce((i,l)=>{const a=n==null?void 0:n.querySelector(`.react-flow__node[data-id="${l}"]`);return a&&i.push({id:l,nodeElement:a,forceUpdate:!0}),i},[]);requestAnimationFrame(()=>r(s))},[])}function GT({onStart:e,onChange:t,onEnd:n}){const r=Ie();O.useEffect(()=>{r.setState({onViewportChangeStart:e})},[e]),O.useEffect(()=>{r.setState({onViewportChange:t})},[t]),O.useEffect(()=>{r.setState({onViewportChangeEnd:n})},[n])}const YT=e=>t=>t.nodeInternals.size===0?!1:t.getNodes().filter(n=>e.includeHiddenNodes?!0:!n.hidden).every(n=>{var r;return((r=n[Ce])==null?void 0:r.handleBounds)!==void 0}),KT={includeHiddenNodes:!1};function XT(e=KT){return de(YT(e))}function QT(){return H.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},H.createElement("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"}))}function qT(){return H.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},H.createElement("path",{d:"M0 0h32v4.2H0z"}))}function JT(){return H.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},H.createElement("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 ZT(){return H.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},H.createElement("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 eA(){return H.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},H.createElement("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 ii=({children:e,className:t,...n})=>H.createElement("button",{type:"button",className:Je(["react-flow__controls-button",t]),...n},e);ii.displayName="ControlButton";const tA=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom}),U0=({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:o,onZoomIn:s,onZoomOut:i,onFitView:l,onInteractiveChange:a,className:c,children:u,position:f="bottom-left"})=>{const p=Ie(),[h,E]=O.useState(!1),{isInteractive:y,minZoomReached:v,maxZoomReached:m}=de(tA,Ge),{zoomIn:g,zoomOut:S,fitView:_}=Kd();if(O.useEffect(()=>{E(!0)},[]),!h)return null;const x=()=>{g(),s==null||s()},R=()=>{S(),i==null||i()},T=()=>{_(o),l==null||l()},L=()=>{p.setState({nodesDraggable:!y,nodesConnectable:!y,elementsSelectable:!y}),a==null||a(!y)};return H.createElement(Zs,{className:Je(["react-flow__controls",c]),position:f,style:e,"data-testid":"rf__controls"},t&&H.createElement(H.Fragment,null,H.createElement(ii,{onClick:x,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:m},H.createElement(QT,null)),H.createElement(ii,{onClick:R,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:v},H.createElement(qT,null))),n&&H.createElement(ii,{className:"react-flow__controls-fitview",onClick:T,title:"fit view","aria-label":"fit view"},H.createElement(JT,null)),r&&H.createElement(ii,{className:"react-flow__controls-interactive",onClick:L,title:"toggle interactivity","aria-label":"toggle interactivity"},y?H.createElement(eA,null):H.createElement(ZT,null)),u)};U0.displayName="Controls";var nA=O.memo(U0),Ct;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Ct||(Ct={}));function rA({color:e,dimensions:t,lineWidth:n}){return H.createElement("path",{stroke:e,strokeWidth:n,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`})}function oA({color:e,radius:t}){return H.createElement("circle",{cx:t,cy:t,r:t,fill:e})}const sA={[Ct.Dots]:"#91919a",[Ct.Lines]:"#eee",[Ct.Cross]:"#e2e2e2"},iA={[Ct.Dots]:1,[Ct.Lines]:1,[Ct.Cross]:6},lA=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function F0({id:e,variant:t=Ct.Dots,gap:n=20,size:r,lineWidth:o=1,offset:s=2,color:i,style:l,className:a}){const c=O.useRef(null),{transform:u,patternId:f}=de(lA,Ge),p=i||sA[t],h=r||iA[t],E=t===Ct.Dots,y=t===Ct.Cross,v=Array.isArray(n)?n:[n,n],m=[v[0]*u[2]||1,v[1]*u[2]||1],g=h*u[2],S=y?[g,g]:m,_=E?[g/s,g/s]:[S[0]/s,S[1]/s];return H.createElement("svg",{className:Je(["react-flow__background",a]),style:{...l,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:c,"data-testid":"rf__background"},H.createElement("pattern",{id:f+e,x:u[0]%m[0],y:u[1]%m[1],width:m[0],height:m[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${_[0]},-${_[1]})`},E?H.createElement(oA,{color:p,radius:g/s}):H.createElement(rA,{dimensions:S,color:p,lineWidth:o})),H.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${f+e})`}))}F0.displayName="Background";var aA=O.memo(F0),j0={VITE_BASE_URL:"",VITE_BASIC_AUTH:"signalwire:1aG93uXk",VITE_DEFAULT_STYLE_HREF:"https://cdn.swire.io/npm/@signalwire/cfb@dev/dist/style.css",VITE_DEFAULT_VOICES_URL:"https://cdn.signalwire.com/npm/@signalwire/cfb@dev/dist/voices.json",VITE_FLOW_DATA_VERSION:"0.0.10",VITE_IS_STAGING:"true",BASE_URL:"/cfb/",MODE:"staging",DEV:!1,PROD:!0,SSR:!1};const{useDebugValue:cA}=H,{useSyncExternalStoreWithSelector:uA}=Tg;let V0=!1;function dA(e,t=e.getState,n){(j0?"staging":void 0)!=="production"&&n&&!V0&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),V0=!0);const r=uA(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return cA(r),r}const $0=e=>{(j0?"staging":void 0)!=="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 t=typeof e=="function"?Ig(e):e,n=(r,o)=>dA(t,r,o);return Object.assign(n,t),n},bo=e=>e?$0(e):$0,fA=!1,pA="staging",hA="0.0.12",li="0.0.10",H0=230,mA=640,B0=20,Do={markerEnd:{height:20,type:ni.ArrowClosed,width:20},style:{stroke:"inherit",strokeWidth:1.5},type:"floating"},gA="422",EA="404",z0="document-sync",nf=1e3,yA=1e3,vA=300,_A=5e3,W0=300,SA="Shift+Backspace",xA="Meta",RA="Shift",ya=25,rf={duration:nf,includeHiddenNodes:!1,padding:.3},of=()=>{const e={},t=document.querySelector('meta[name="csrf-token"]');return t&&(e["X-CSRF-Token"]=t==null?void 0:t.content),e},NA=(e,t)=>{var s;const n=new Blob([JSON.stringify({edges:t,nodes:e},null,2)],{type:"application/json"}),r=window.URL.createObjectURL(n),o=window.open();(s=o==null?void 0:o.location)!=null&&s.href&&(o.location.href=r)},G0=e=>({...e,...Do}),Y0=e=>e.type==="handleCall"?{...e,deletable:!1}:e,K0=e=>e==="success"?"positive":"negative",wA=e=>e.toLowerCase().replace(/ /g,"-"),yt=e=>typeof e=="string"?e.trim():e,X0=(e,t,n)=>e.sort((r,o)=>{const s=n?r[n]:r,i=n?o[n]:o;if(typeof s=="string"&&typeof i=="string")return t==="asc"?s.toLowerCase().localeCompare(i.toLowerCase()):i.toLowerCase().localeCompare(s.toLowerCase());if(typeof s=="number"&&typeof i=="number")return t==="asc"?s-i:i-s;throw new Error(`sort fn can only sort strings & numbers, but got ${typeof s} and ${typeof i}`)}),OA=e=>{try{return new URL(e).pathname.split("/").at(-1)}catch{return""}};function Q0(e,t){const n=[{divisor:1,threshold:60,unit:"second"},{divisor:60,threshold:3600,unit:"minute"},{divisor:3600,threshold:86400,unit:"hour"},{divisor:86400,threshold:86400,unit:"day"}],r=new Intl.RelativeTimeFormat(e,{numeric:"always",...t});return function(s,i={}){const{excludeUnits:l={}}=i,a=new Date().getTime(),c=new Date(s).getTime(),u=Math.floor((a-c)/1e3),f=n.filter(({unit:y})=>!l[y]),{divisor:p,unit:h}=f.find(({threshold:y})=>Math.abs(u)<y)??f[f.length-1],E=Math.floor(u/p);return r.format(-E,h)}}function q0(e){return new Promise(t=>setTimeout(t,e))}const TA=(e,t,n)=>{const r=e==="ArrowDown";if(!t)return r?n[0]:n[n.length-1];const o=n.findIndex(l=>l.id===t),s=r?o+1:o-1;if(s<0||s>=n.length)return;const i=n[s];if(!i)throw new Error(`Could not find option at index ${s}`);return i},J0=(e,t,n)=>{const r=e.find(o=>{if(t in o)return o[t]===n});if(!r)throw new Error(`Could not find option with id ${t}`);return r},AA=e=>Object.keys(e),sf=()=>({callOrder:"single",callStateEvents:"",callStateUrl:"",connections:[{connectConfirmDisplayName:"",connectConfirmEnabled:!1,connectConfirmId:"",connectConfirmUrl:"",connectFrom:"",connectTimeout:"",connectTo:"",id:le()}],defaultFrom:"",defaultTimeout:"",destinationType:"phone",options:[{id:le(),result:"success"},{id:le(),result:"noAnswer"},{id:le(),result:"busy"},{id:le(),result:"decline"},{id:le(),result:"error"}]}),Z0={aiAgent:()=>({agent:""}),answer:()=>({valid:!0}),cond:()=>({fallback:le(),options:[{id:le(),value:""}]}),condRequest:()=>({body:"",error:le(),fallback:le(),headers:"",method:"POST",options:[{id:le(),value:""}],url:""}),executeSWML:()=>({dest:"",fallback:le(),meta:"",options:[{id:le(),value:""}],params:""}),forwardAddress:()=>({...sf(),destinationType:"address"}),forwardPhone:()=>({...sf(),destinationType:"phone"}),forwardResource:()=>({...sf(),destinationType:"resource"}),handleCall:()=>({valid:!0}),hangup:()=>({valid:!0}),play:()=>({selected:"",text:"",url:""}),promptPlay:()=>({digitTimeout:"",initialTimeout:"",options:[{command:"",digit:"",id:le()}],results:[{id:le(),result:"no_match"},{id:le(),result:"no_input"}],selected:"",text:"",url:""}),record:()=>({beep:!1,endSilenceTimeout:"",format:"wav",initialTimeout:"",maxLength:"",stereo:!1,terminators:"",valid:!0}),recordCallStart:()=>({beep:!1,controlId:le(),format:"wav",label:"",stereo:!1,terminators:""}),recordCallStop:()=>({controlId:""}),request:()=>({body:"",headers:"",method:"POST",options:[{id:le(),result:"success"},{id:le(),result:"failed"}],url:""}),sendSms:()=>({body:"",fromNumber:"",media:[],region:"",tags:[],toNumber:""}),set:()=>({variables:[{duplicate:!1,id:le(),key:"",value:""}]}),unset:()=>({variables:[]})},IA={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}};class va{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(t,n)}init(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=t||IA,this.options=n,this.debug=n.debug}log(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"log","",!0)}warn(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"warn","",!0)}error(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"error","")}deprecate(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.forward(n,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,r,o){return o&&!this.debug?null:(typeof t[0]=="string"&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new va(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new va(this.logger,t)}}var Jt=new va;class _a{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(r=>{this.observers[r]=this.observers[r]||[],this.observers[r].push(n)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t]=this.observers[t].filter(r=>r!==n)}}emit(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];this.observers[t]&&[].concat(this.observers[t]).forEach(i=>{i(...r)}),this.observers["*"]&&[].concat(this.observers["*"]).forEach(i=>{i.apply(i,[t,...r])})}}function ai(){let e,t;const n=new Promise((r,o)=>{e=r,t=o});return n.resolve=e,n.reject=t,n}function ey(e){return e==null?"":""+e}function CA(e,t,n){e.forEach(r=>{t[r]&&(n[r]=t[r])})}function lf(e,t,n){function r(i){return i&&i.indexOf("###")>-1?i.replace(/###/g,"."):i}function o(){return!e||typeof e=="string"}const s=typeof t!="string"?[].concat(t):t.split(".");for(;s.length>1;){if(o())return{};const i=r(s.shift());!e[i]&&n&&(e[i]=new n),Object.prototype.hasOwnProperty.call(e,i)?e=e[i]:e={}}return o()?{}:{obj:e,k:r(s.shift())}}function ty(e,t,n){const{obj:r,k:o}=lf(e,t,Object);r[o]=n}function LA(e,t,n,r){const{obj:o,k:s}=lf(e,t,Object);o[s]=o[s]||[],r&&(o[s]=o[s].concat(n)),r||o[s].push(n)}function Sa(e,t){const{obj:n,k:r}=lf(e,t);if(n)return n[r]}function bA(e,t,n){const r=Sa(e,n);return r!==void 0?r:Sa(t,n)}function ny(e,t,n){for(const 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]):ny(e[r],t[r],n):e[r]=t[r]);return e}function ko(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var DA={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function kA(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,t=>DA[t]):e}const PA=[" ",",","?","!",";"];function MA(e,t,n){t=t||"",n=n||"";const r=PA.filter(i=>t.indexOf(i)<0&&n.indexOf(i)<0);if(r.length===0)return!0;const o=new RegExp(`(${r.map(i=>i==="?"?"\\?":i).join("|")})`);let s=!o.test(e);if(!s){const i=e.indexOf(n);i>0&&!o.test(e.substring(0,i))&&(s=!0)}return s}function xa(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!e)return;if(e[t])return e[t];const r=t.split(n);let o=e;for(let s=0;s<r.length;++s){if(!o||typeof o[r[s]]=="string"&&s+1<r.length)return;if(o[r[s]]===void 0){let i=2,l=r.slice(s,s+i).join(n),a=o[l];for(;a===void 0&&r.length>s+i;)i++,l=r.slice(s,s+i).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]}const c=r.slice(s+i).join(n);return c?xa(a,c,n):void 0}o=o[r[s]]}return o}function Ra(e){return e&&e.indexOf("_")>0?e.replace("_","-"):e}class ry extends _a{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const s=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,i=o.ignoreJSONStructure!==void 0?o.ignoreJSONStructure:this.options.ignoreJSONStructure;let l=[t,n];r&&typeof r!="string"&&(l=l.concat(r)),r&&typeof r=="string"&&(l=l.concat(s?r.split(s):r)),t.indexOf(".")>-1&&(l=t.split("."));const a=Sa(this.data,l);return a||!i||typeof r!="string"?a:xa(this.data&&this.data[t]&&this.data[t][n],r,s)}addResource(t,n,r,o){let s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const i=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator;let l=[t,n];r&&(l=l.concat(i?r.split(i):r)),t.indexOf(".")>-1&&(l=t.split("."),o=n,n=l[1]),this.addNamespaces(n),ty(this.data,l,o),s.silent||this.emit("added",t,n,r,o)}addResources(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const s in r)(typeof r[s]=="string"||Object.prototype.toString.apply(r[s])==="[object Array]")&&this.addResource(t,n,s,r[s],{silent:!0});o.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,o,s){let i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},l=[t,n];t.indexOf(".")>-1&&(l=t.split("."),o=r,r=n,n=l[1]),this.addNamespaces(n);let a=Sa(this.data,l)||{};o?ny(a,r,s):a={...a,...r},ty(this.data,l,a),i.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(t,n)}:this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(o=>n[o]&&Object.keys(n[o]).length>0)}toJSON(){return this.data}}var oy={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,o){return e.forEach(s=>{this.processors[s]&&(t=this.processors[s].process(t,n,r,o))}),t}};const sy={};class Na extends _a{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),CA(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Jt.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(t==null)return!1;const r=this.resolve(t,n);return r&&r.res!==void 0}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const o=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let s=n.ns||this.options.defaultNS||[];const i=r&&t.indexOf(r)>-1,l=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!MA(t,r,o);if(i&&!l){const a=t.match(this.interpolator.nestingRegexp);if(a&&a.length>0)return{key:t,namespaces:s};const c=t.split(r);(r!==o||r===o&&this.options.ns.indexOf(c[0])>-1)&&(s=c.shift()),t=c.join(o)}return typeof s=="string"&&(s=[s]),{key:t,namespaces:s}}translate(t,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const o=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,s=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:i,namespaces:l}=this.extractFromKey(t[t.length-1],n),a=l[l.length-1],c=n.lng||this.language,u=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(c&&c.toLowerCase()==="cimode"){if(u){const _=n.nsSeparator||this.options.nsSeparator;return o?{res:`${a}${_}${i}`,usedKey:i,exactUsedKey:i,usedLng:c,usedNS:a,usedParams:this.getUsedParamsDetails(n)}:`${a}${_}${i}`}return o?{res:i,usedKey:i,exactUsedKey:i,usedLng:c,usedNS:a,usedParams:this.getUsedParamsDetails(n)}:i}const f=this.resolve(t,n);let p=f&&f.res;const h=f&&f.usedKey||i,E=f&&f.exactUsedKey||i,y=Object.prototype.toString.apply(p),v=["[object Number]","[object Function]","[object RegExp]"],m=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,g=!this.i18nFormat||this.i18nFormat.handleAsObject;if(g&&p&&(typeof p!="string"&&typeof p!="boolean"&&typeof p!="number")&&v.indexOf(y)<0&&!(typeof m=="string"&&y==="[object Array]")){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const _=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,p,{...n,ns:l}):`key '${i} (${this.language})' returned an object instead of string.`;return o?(f.res=_,f.usedParams=this.getUsedParamsDetails(n),f):_}if(s){const _=y==="[object Array]",x=_?[]:{},R=_?E:h;for(const T in p)if(Object.prototype.hasOwnProperty.call(p,T)){const L=`${R}${s}${T}`;x[T]=this.translate(L,{...n,joinArrays:!1,ns:l}),x[T]===L&&(x[T]=p[T])}p=x}}else if(g&&typeof m=="string"&&y==="[object Array]")p=p.join(m),p&&(p=this.extendTranslation(p,t,n,r));else{let _=!1,x=!1;const R=n.count!==void 0&&typeof n.count!="string",T=Na.hasDefaultValue(n),L=R?this.pluralResolver.getSuffix(c,n.count,n):"",P=n.ordinal&&R?this.pluralResolver.getSuffix(c,n.count,{ordinal:!1}):"",I=n[`defaultValue${L}`]||n[`defaultValue${P}`]||n.defaultValue;!this.isValidLookup(p)&&T&&(_=!0,p=I),this.isValidLookup(p)||(x=!0,p=i);const V=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&x?void 0:p,M=T&&I!==p&&this.options.updateMissing;if(x||_||M){if(this.logger.log(M?"updateKey":"missingKey",c,a,i,M?I:p),s){const F=this.resolve(i,{...n,keySeparator:!1});F&&F.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.")}let w=[];const b=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&b&&b[0])for(let F=0;F<b.length;F++)w.push(b[F]);else this.options.saveMissingTo==="all"?w=this.languageUtils.toResolveHierarchy(n.lng||this.language):w.push(n.lng||this.language);const k=(F,C,D)=>{const U=T&&D!==p?D:V;this.options.missingKeyHandler?this.options.missingKeyHandler(F,a,C,U,M,n):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(F,a,C,U,M,n),this.emit("missingKey",F,a,C,p)};this.options.saveMissing&&(this.options.saveMissingPlurals&&R?w.forEach(F=>{this.pluralResolver.getSuffixes(F,n).forEach(C=>{k([F],i+C,n[`defaultValue${C}`]||I)})}):k(w,i,I))}p=this.extendTranslation(p,t,n,f,r),x&&p===i&&this.options.appendNamespaceToMissingKey&&(p=`${a}:${i}`),(x||_)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?p=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${a}:${i}`:i,_?p:void 0):p=this.options.parseMissingKeyHandler(p))}return o?(f.res=p,f.usedParams=this.getUsedParamsDetails(n),f):p}extendTranslation(t,n,r,o,s){var i=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const c=typeof t=="string"&&(r&&r.interpolation&&r.interpolation.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let u;if(c){const p=t.match(this.interpolator.nestingRegexp);u=p&&p.length}let f=r.replace&&typeof r.replace!="string"?r.replace:r;if(this.options.interpolation.defaultVariables&&(f={...this.options.interpolation.defaultVariables,...f}),t=this.interpolator.interpolate(t,f,r.lng||this.language,r),c){const p=t.match(this.interpolator.nestingRegexp),h=p&&p.length;u<h&&(r.nest=!1)}!r.lng&&this.options.compatibilityAPI!=="v1"&&o&&o.res&&(r.lng=o.usedLng),r.nest!==!1&&(t=this.interpolator.nest(t,function(){for(var p=arguments.length,h=new Array(p),E=0;E<p;E++)h[E]=arguments[E];return s&&s[0]===h[0]&&!r.context?(i.logger.warn(`It seems you are nesting recursively key: ${h[0]} in key: ${n[0]}`),null):i.translate(...h,n)},r)),r.interpolation&&this.interpolator.reset()}const l=r.postProcess||this.options.postProcess,a=typeof l=="string"?[l]:l;return t!=null&&a&&a.length&&r.applyPostProcessor!==!1&&(t=oy.handle(a,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...o,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),t}resolve(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r,o,s,i,l;return typeof t=="string"&&(t=[t]),t.forEach(a=>{if(this.isValidLookup(r))return;const c=this.extractFromKey(a,n),u=c.key;o=u;let f=c.namespaces;this.options.fallbackNS&&(f=f.concat(this.options.fallbackNS));const p=n.count!==void 0&&typeof n.count!="string",h=p&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),E=n.context!==void 0&&(typeof n.context=="string"||typeof n.context=="number")&&n.context!=="",y=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);f.forEach(v=>{this.isValidLookup(r)||(l=v,!sy[`${y[0]}-${v}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(l)&&(sy[`${y[0]}-${v}`]=!0,this.logger.warn(`key "${o}" for languages "${y.join(", ")}" won't get resolved as namespace "${l}" 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(m=>{if(this.isValidLookup(r))return;i=m;const g=[u];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(g,u,m,v,n);else{let _;p&&(_=this.pluralResolver.getSuffix(m,n.count,n));const x=`${this.options.pluralSeparator}zero`,R=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(p&&(g.push(u+_),n.ordinal&&_.indexOf(R)===0&&g.push(u+_.replace(R,this.options.pluralSeparator)),h&&g.push(u+x)),E){const T=`${u}${this.options.contextSeparator}${n.context}`;g.push(T),p&&(g.push(T+_),n.ordinal&&_.indexOf(R)===0&&g.push(T+_.replace(R,this.options.pluralSeparator)),h&&g.push(T+x))}}let S;for(;S=g.pop();)this.isValidLookup(r)||(s=S,r=this.getResource(m,v,S,n))}))})}),{res:r,usedKey:o,exactUsedKey:s,usedLng:i,usedNS:l}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,n,r,o):this.resourceStore.getResource(t,n,r,o)}getUsedParamsDetails(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&typeof t.replace!="string";let o=r?t.replace:t;if(r&&typeof t.count<"u"&&(o.count=t.count),this.options.interpolation.defaultVariables&&(o={...this.options.interpolation.defaultVariables,...o}),!r){o={...o};for(const s of n)delete o[s]}return o}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}function af(e){return e.charAt(0).toUpperCase()+e.slice(1)}class iy{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Jt.create("languageUtils")}getScriptPartFromCode(t){if(t=Ra(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=Ra(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(typeof t=="string"&&t.indexOf("-")>-1){const n=["hans","hant","latn","cyrl","cans","mong","arab"];let r=t.split("-");return this.options.lowerCaseLng?r=r.map(o=>o.toLowerCase()):r.length===2?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=af(r[1].toLowerCase()))):r.length===3&&(r[0]=r[0].toLowerCase(),r[1].length===2&&(r[1]=r[1].toUpperCase()),r[0]!=="sgn"&&r[2].length===2&&(r[2]=r[2].toUpperCase()),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=af(r[1].toLowerCase())),n.indexOf(r[2].toLowerCase())>-1&&(r[2]=af(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const o=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(o))&&(n=o)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const o=this.getLanguagePartFromCode(r);if(this.isSupportedCode(o))return n=o;n=this.options.supportedLngs.find(s=>{if(s===o)return s;if(!(s.indexOf("-")<0&&o.indexOf("-")<0)&&s.indexOf(o)===0)return s})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),typeof t=="string"&&(t=[t]),Object.prototype.toString.apply(t)==="[object Array]")return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes(n||this.options.fallbackLng||[],t),o=[],s=i=>{i&&(this.isSupportedCode(i)?o.push(i):this.logger.warn(`rejecting language code not found in supportedLngs: ${i}`))};return typeof t=="string"&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&s(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&s(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&s(this.getLanguagePartFromCode(t))):typeof t=="string"&&s(this.formatLanguageCode(t)),r.forEach(i=>{o.indexOf(i)<0&&s(this.formatLanguageCode(i))}),o}}let UA=[{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}],FA={1:function(e){return+(e>1)},2:function(e){return+(e!=1)},3:function(e){return 0},4:function(e){return e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2},5:function(e){return e==0?0:e==1?1:e==2?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5},6:function(e){return e==1?0:e>=2&&e<=4?1:2},7:function(e){return e==1?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2},8:function(e){return e==1?0:e==2?1:e!=8&&e!=11?2:3},9:function(e){return+(e>=2)},10:function(e){return e==1?0:e==2?1:e<7?2:e<11?3:4},11:function(e){return e==1||e==11?0:e==2||e==12?1:e>2&&e<20?2:3},12:function(e){return+(e%10!=1||e%100==11)},13:function(e){return+(e!==0)},14:function(e){return e==1?0:e==2?1:e==3?2:3},15:function(e){return e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2},16:function(e){return e%10==1&&e%100!=11?0:e!==0?1:2},17:function(e){return e==1||e%10==1&&e%100!=11?0:1},18:function(e){return e==0?0:e==1?1:2},19:function(e){return e==1?0:e==0||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3},20:function(e){return e==1?0:e==0||e%100>0&&e%100<20?1:2},21:function(e){return e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0},22:function(e){return e==1?0:e==2?1:(e<0||e>10)&&e%10==0?2:3}};const jA=["v1","v2","v3"],VA=["v4"],ly={zero:0,one:1,two:2,few:3,many:4,other:5};function $A(){const e={};return UA.forEach(t=>{t.lngs.forEach(n=>{e[n]={numbers:t.nr,plurals:FA[t.fc]}})}),e}class HA{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=n,this.logger=Jt.create("pluralResolver"),(!this.options.compatibilityJSON||VA.includes(this.options.compatibilityJSON))&&(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=$A()}addRule(t,n){this.rules[t]=n}getRule(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(Ra(t),{type:n.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}needsPlural(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return this.shouldUseIntlApi()?r&&r.resolvedOptions().pluralCategories.length>1:r&&r.numbers.length>1}getPluralFormsOfKey(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,r).map(o=>`${n}${o}`)}getSuffixes(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(t,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((o,s)=>ly[o]-ly[s]).map(o=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${o}`):r.numbers.map(o=>this.getSuffix(t,o,n)):[]}getSuffix(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const o=this.getRule(t,r);return o?this.shouldUseIntlApi()?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${o.select(n)}`:this.getSuffixRetroCompatible(o,n):(this.logger.warn(`no plural rule found for: ${t}`),"")}getSuffixRetroCompatible(t,n){const r=t.noAbs?t.plurals(n):t.plurals(Math.abs(n));let o=t.numbers[r];this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1&&(o===2?o="plural":o===1&&(o=""));const s=()=>this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString();return this.options.compatibilityJSON==="v1"?o===1?"":typeof o=="number"?`_plural_${o.toString()}`:s():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&t.numbers.length===2&&t.numbers[0]===1?s():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}shouldUseIntlApi(){return!jA.includes(this.options.compatibilityJSON)}}function ay(e,t,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=bA(e,t,n);return!s&&o&&typeof n=="string"&&(s=xa(e,n,r),s===void 0&&(s=xa(t,n,r))),s}class BA{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Jt.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||(n=>n),this.init(t)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const n=t.interpolation;this.escape=n.escape!==void 0?n.escape:kA,this.escapeValue=n.escapeValue!==void 0?n.escapeValue:!0,this.useRawValueToEscape=n.useRawValueToEscape!==void 0?n.useRawValueToEscape:!1,this.prefix=n.prefix?ko(n.prefix):n.prefixEscaped||"{{",this.suffix=n.suffix?ko(n.suffix):n.suffixEscaped||"}}",this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||",",this.unescapePrefix=n.unescapeSuffix?"":n.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":n.unescapeSuffix||"",this.nestingPrefix=n.nestingPrefix?ko(n.nestingPrefix):n.nestingPrefixEscaped||ko("$t("),this.nestingSuffix=n.nestingSuffix?ko(n.nestingSuffix):n.nestingSuffixEscaped||ko(")"),this.nestingOptionsSeparator=n.nestingOptionsSeparator?n.nestingOptionsSeparator:n.nestingOptionsSeparator||",",this.maxReplaces=n.maxReplaces?n.maxReplaces:1e3,this.alwaysFormat=n.alwaysFormat!==void 0?n.alwaysFormat:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=`${this.prefix}(.+?)${this.suffix}`;this.regexp=new RegExp(t,"g");const n=`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`;this.regexpUnescape=new RegExp(n,"g");const r=`${this.nestingPrefix}(.+?)${this.nestingSuffix}`;this.nestingRegexp=new RegExp(r,"g")}interpolate(t,n,r,o){let s,i,l;const a=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(E){return E.replace(/\$/g,"$$$$")}const u=E=>{if(E.indexOf(this.formatSeparator)<0){const g=ay(n,a,E,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(g,void 0,r,{...o,...n,interpolationkey:E}):g}const y=E.split(this.formatSeparator),v=y.shift().trim(),m=y.join(this.formatSeparator).trim();return this.format(ay(n,a,v,this.options.keySeparator,this.options.ignoreJSONStructure),m,r,{...o,...n,interpolationkey:v})};this.resetRegExp();const f=o&&o.missingInterpolationHandler||this.options.missingInterpolationHandler,p=o&&o.interpolation&&o.interpolation.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:E=>c(E)},{regex:this.regexp,safeValue:E=>this.escapeValue?c(this.escape(E)):c(E)}].forEach(E=>{for(l=0;s=E.regex.exec(t);){const y=s[1].trim();if(i=u(y),i===void 0)if(typeof f=="function"){const m=f(t,s,o);i=typeof m=="string"?m:""}else if(o&&Object.prototype.hasOwnProperty.call(o,y))i="";else if(p){i=s[0];continue}else this.logger.warn(`missed to pass in variable ${y} for interpolating ${t}`),i="";else typeof i!="string"&&!this.useRawValueToEscape&&(i=ey(i));const v=E.safeValue(i);if(t=t.replace(s[0],v),p?(E.regex.lastIndex+=i.length,E.regex.lastIndex-=s[0].length):E.regex.lastIndex=0,l++,l>=this.maxReplaces)break}}),t}nest(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o,s,i;function l(a,c){const u=this.nestingOptionsSeparator;if(a.indexOf(u)<0)return a;const f=a.split(new RegExp(`${u}[ ]*{`));let p=`{${f[1]}`;a=f[0],p=this.interpolate(p,i);const h=p.match(/'/g),E=p.match(/"/g);(h&&h.length%2===0&&!E||E.length%2!==0)&&(p=p.replace(/'/g,'"'));try{i=JSON.parse(p),c&&(i={...c,...i})}catch(y){return this.logger.warn(`failed parsing options string in nesting for key ${a}`,y),`${a}${u}${p}`}return delete i.defaultValue,a}for(;o=this.nestingRegexp.exec(t);){let a=[];i={...r},i=i.replace&&typeof i.replace!="string"?i.replace:i,i.applyPostProcessor=!1,delete i.defaultValue;let c=!1;if(o[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(o[1])){const u=o[1].split(this.formatSeparator).map(f=>f.trim());o[1]=u.shift(),a=u,c=!0}if(s=n(l.call(this,o[1].trim(),i),i),s&&o[0]===t&&typeof s!="string")return s;typeof s!="string"&&(s=ey(s)),s||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${t}`),s=""),c&&(s=a.reduce((u,f)=>this.format(u,f,r.lng,{...r,interpolationkey:o[1].trim()}),s.trim())),t=t.replace(o[0],s),this.regexp.lastIndex=0}return t}}function zA(e){let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const o=r[1].substring(0,r[1].length-1);t==="currency"&&o.indexOf(":")<0?n.currency||(n.currency=o.trim()):t==="relativetime"&&o.indexOf(":")<0?n.range||(n.range=o.trim()):o.split(";").forEach(i=>{if(!i)return;const[l,...a]=i.split(":"),c=a.join(":").trim().replace(/^'+|'+$/g,"");n[l.trim()]||(n[l.trim()]=c),c==="false"&&(n[l.trim()]=!1),c==="true"&&(n[l.trim()]=!0),isNaN(c)||(n[l.trim()]=parseInt(c,10))})}return{formatName:t,formatOptions:n}}function Po(e){const t={};return function(r,o,s){const i=o+JSON.stringify(s);let l=t[i];return l||(l=e(Ra(o),s),t[i]=l),l(r)}}class WA{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Jt.create("formatter"),this.options=t,this.formats={number:Po((n,r)=>{const o=new Intl.NumberFormat(n,{...r});return s=>o.format(s)}),currency:Po((n,r)=>{const o=new Intl.NumberFormat(n,{...r,style:"currency"});return s=>o.format(s)}),datetime:Po((n,r)=>{const o=new Intl.DateTimeFormat(n,{...r});return s=>o.format(s)}),relativetime:Po((n,r)=>{const o=new Intl.RelativeTimeFormat(n,{...r});return s=>o.format(s,r.range||"day")}),list:Po((n,r)=>{const o=new Intl.ListFormat(n,{...r});return s=>o.format(s)})},this.init(t)}init(t){const r=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||","}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=Po(n)}format(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return n.split(this.formatSeparator).reduce((l,a)=>{const{formatName:c,formatOptions:u}=zA(a);if(this.formats[c]){let f=l;try{const p=o&&o.formatParams&&o.formatParams[o.interpolationkey]||{},h=p.locale||p.lng||o.locale||o.lng||r;f=this.formats[c](l,h,{...u,...o,...p})}catch(p){this.logger.warn(p)}return f}else this.logger.warn(`there was no format function for ${c}`);return l},t)}}function GA(e,t){e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)}class YA extends _a{constructor(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=o,this.logger=Jt.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=o.maxParallelReads||10,this.readingCalls=0,this.maxRetries=o.maxRetries>=0?o.maxRetries:5,this.retryTimeout=o.retryTimeout>=1?o.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(r,o.backend,o)}queueLoad(t,n,r,o){const s={},i={},l={},a={};return t.forEach(c=>{let u=!0;n.forEach(f=>{const p=`${c}|${f}`;!r.reload&&this.store.hasResourceBundle(c,f)?this.state[p]=2:this.state[p]<0||(this.state[p]===1?i[p]===void 0&&(i[p]=!0):(this.state[p]=1,u=!1,i[p]===void 0&&(i[p]=!0),s[p]===void 0&&(s[p]=!0),a[f]===void 0&&(a[f]=!0)))}),u||(l[c]=!0)}),(Object.keys(s).length||Object.keys(i).length)&&this.queue.push({pending:i,pendingCount:Object.keys(i).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(s),pending:Object.keys(i),toLoadLanguages:Object.keys(l),toLoadNamespaces:Object.keys(a)}}loaded(t,n,r){const o=t.split("|"),s=o[0],i=o[1];n&&this.emit("failedLoading",s,i,n),r&&this.store.addResourceBundle(s,i,r),this.state[t]=n?-1:2;const l={};this.queue.forEach(a=>{LA(a.loaded,[s],i),GA(a,t),n&&a.errors.push(n),a.pendingCount===0&&!a.done&&(Object.keys(a.loaded).forEach(c=>{l[c]||(l[c]={});const u=a.loaded[c];u.length&&u.forEach(f=>{l[c][f]===void 0&&(l[c][f]=!0)})}),a.done=!0,a.errors.length?a.callback(a.errors):a.callback())}),this.emit("loaded",l),this.queue=this.queue.filter(a=>!a.done)}read(t,n,r){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,i=arguments.length>5?arguments[5]:void 0;if(!t.length)return i(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:o,wait:s,callback:i});return}this.readingCalls++;const l=(c,u)=>{if(this.readingCalls--,this.waitingReads.length>0){const f=this.waitingReads.shift();this.read(f.lng,f.ns,f.fcName,f.tried,f.wait,f.callback)}if(c&&u&&o<this.maxRetries){setTimeout(()=>{this.read.call(this,t,n,r,o+1,s*2,i)},s);return}i(c,u)},a=this.backend[r].bind(this.backend);if(a.length===2){try{const c=a(t,n);c&&typeof c.then=="function"?c.then(u=>l(null,u)).catch(l):l(null,c)}catch(c){l(c)}return}return a(t,n,l)}prepareLoading(t,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=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."),o&&o();typeof t=="string"&&(t=this.languageUtils.toResolveHierarchy(t)),typeof n=="string"&&(n=[n]);const s=this.queueLoad(t,n,r,o);if(!s.toLoad.length)return s.pending.length||o(),null;s.toLoad.forEach(i=>{this.loadOne(i)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=t.split("|"),o=r[0],s=r[1];this.read(o,s,"read",void 0,void 0,(i,l)=>{i&&this.logger.warn(`${n}loading namespace ${s} for language ${o} failed`,i),!i&&l&&this.logger.log(`${n}loaded namespace ${s} for language ${o}`,l),this.loaded(t,i,l)})}saveMissing(t,n,r,o,s){let i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},l=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" 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(!(r==null||r==="")){if(this.backend&&this.backend.create){const a={...i,isUpdate:s},c=this.backend.create.bind(this.backend);if(c.length<6)try{let u;c.length===5?u=c(t,n,r,o,a):u=c(t,n,r,o),u&&typeof u.then=="function"?u.then(f=>l(null,f)).catch(l):l(null,u)}catch(u){l(u)}else c(t,n,r,o,l,a)}!t||!t[0]||this.store.addResource(t[0],n,r,o)}}}function cy(){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:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){let n={};if(typeof t[1]=="object"&&(n=t[1]),typeof t[1]=="string"&&(n.defaultValue=t[1]),typeof t[2]=="string"&&(n.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const r=t[3]||t[2];Object.keys(r).forEach(o=>{n[o]=r[o]})}return n},interpolation:{escapeValue:!0,format:(e,t,n,r)=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function uy(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 wa(){}function KA(e){Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})}class ci extends _a{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=uy(t),this.services={},this.logger=Jt,this.modules={external:[]},KA(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initImmediate)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(){var t=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;typeof n=="function"&&(r=n,n={}),!n.defaultNS&&n.defaultNS!==!1&&n.ns&&(typeof n.ns=="string"?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const o=cy();this.options={...o,...this.options,...uy(n)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...o.interpolation,...this.options.interpolation}),n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);function s(u){return u?typeof u=="function"?new u:u:null}if(!this.options.isClone){this.modules.logger?Jt.init(s(this.modules.logger),this.options):Jt.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:typeof Intl<"u"&&(u=WA);const f=new iy(this.options);this.store=new ry(this.options.resources,this.options);const p=this.services;p.logger=Jt,p.resourceStore=this.store,p.languageUtils=f,p.pluralResolver=new HA(f,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),u&&(!this.options.interpolation.format||this.options.interpolation.format===o.interpolation.format)&&(p.formatter=s(u),p.formatter.init(p,this.options),this.options.interpolation.format=p.formatter.format.bind(p.formatter)),p.interpolator=new BA(this.options),p.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},p.backendConnector=new YA(s(this.modules.backend),p.resourceStore,p,this.options),p.backendConnector.on("*",function(h){for(var E=arguments.length,y=new Array(E>1?E-1:0),v=1;v<E;v++)y[v-1]=arguments[v];t.emit(h,...y)}),this.modules.languageDetector&&(p.languageDetector=s(this.modules.languageDetector),p.languageDetector.init&&p.languageDetector.init(p,this.options.detection,this.options)),this.modules.i18nFormat&&(p.i18nFormat=s(this.modules.i18nFormat),p.i18nFormat.init&&p.i18nFormat.init(this)),this.translator=new Na(this.services,this.options),this.translator.on("*",function(h){for(var E=arguments.length,y=new Array(E>1?E-1:0),v=1;v<E;v++)y[v-1]=arguments[v];t.emit(h,...y)}),this.modules.external.forEach(h=>{h.init&&h.init(this)})}if(this.format=this.options.interpolation.format,r||(r=wa),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.length>0&&u[0]!=="dev"&&(this.options.lng=u[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(u=>{this[u]=function(){return t.store[u](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=function(){return t.store[u](...arguments),t}});const a=ai(),c=()=>{const u=(f,p)=>{this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),a.resolve(p),r(f,p)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return u(null,this.t.bind(this));this.changeLanguage(this.options.lng,u)};return this.options.resources||!this.options.initImmediate?c():setTimeout(c,0),a}loadResources(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:wa;const o=typeof t=="string"?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(o&&o.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const s=[],i=l=>{if(!l||l==="cimode")return;this.services.languageUtils.toResolveHierarchy(l).forEach(c=>{c!=="cimode"&&s.indexOf(c)<0&&s.push(c)})};o?i(o):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(a=>i(a)),this.options.preload&&this.options.preload.forEach(l=>i(l)),this.services.backendConnector.load(s,this.options.ns,l=>{!l&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(l)})}else r(null)}reloadResources(t,n,r){const o=ai();return t||(t=this.languages),n||(n=this.options.ns),r||(r=wa),this.services.backendConnector.reload(t,n,s=>{o.resolve(),r(s)}),o}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&oy.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1))for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}changeLanguage(t,n){var r=this;this.isLanguageChangingTo=t;const o=ai();this.emit("languageChanging",t);const s=a=>{this.language=a,this.languages=this.services.languageUtils.toResolveHierarchy(a),this.resolvedLanguage=void 0,this.setResolvedLanguage(a)},i=(a,c)=>{c?(s(c),this.translator.changeLanguage(c),this.isLanguageChangingTo=void 0,this.emit("languageChanged",c),this.logger.log("languageChanged",c)):this.isLanguageChangingTo=void 0,o.resolve(function(){return r.t(...arguments)}),n&&n(a,function(){return r.t(...arguments)})},l=a=>{!t&&!a&&this.services.languageDetector&&(a=[]);const c=typeof a=="string"?a:this.services.languageUtils.getBestMatchFromCodes(a);c&&(this.language||s(c),this.translator.language||this.translator.changeLanguage(c),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(c)),this.loadResources(c,u=>{i(u,c)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?l(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(l):this.services.languageDetector.detect(l):l(t),o}getFixedT(t,n,r){var o=this;const s=function(i,l){let a;if(typeof l!="object"){for(var c=arguments.length,u=new Array(c>2?c-2:0),f=2;f<c;f++)u[f-2]=arguments[f];a=o.options.overloadTranslationOptionHandler([i,l].concat(u))}else a={...l};a.lng=a.lng||s.lng,a.lngs=a.lngs||s.lngs,a.ns=a.ns||s.ns,a.keyPrefix=a.keyPrefix||r||s.keyPrefix;const p=o.options.keySeparator||".";let h;return a.keyPrefix&&Array.isArray(i)?h=i.map(E=>`${a.keyPrefix}${p}${E}`):h=a.keyPrefix?`${a.keyPrefix}${p}${i}`:i,o.t(h,a)};return typeof t=="string"?s.lng=t:s.lngs=t,s.ns=n,s.keyPrefix=r,s}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t){let n=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;const r=n.lng||this.resolvedLanguage||this.languages[0],o=this.options?this.options.fallbackLng:!1,s=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const i=(l,a)=>{const c=this.services.backendConnector.state[`${l}|${a}`];return c===-1||c===2};if(n.precheck){const l=n.precheck(this,i);if(l!==void 0)return l}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||i(r,t)&&(!o||i(s,t)))}loadNamespaces(t,n){const r=ai();return this.options.ns?(typeof t=="string"&&(t=[t]),t.forEach(o=>{this.options.ns.indexOf(o)<0&&this.options.ns.push(o)}),this.loadResources(o=>{r.resolve(),n&&n(o)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=ai();typeof t=="string"&&(t=[t]);const o=this.options.preload||[],s=t.filter(i=>o.indexOf(i)<0);return s.length?(this.options.preload=o.concat(s),this.loadResources(i=>{r.resolve(),n&&n(i)}),r):(n&&n(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!t)return"rtl";const n=["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"],r=this.services&&this.services.languageUtils||new iy(cy());return n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new ci(t,n)}cloneInstance(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:wa;const r=t.forkResourceStore;r&&delete t.forkResourceStore;const o={...this.options,...t,isClone:!0},s=new ci(o);return(t.debug!==void 0||t.prefix!==void 0)&&(s.logger=s.logger.clone(t)),["store","services","language"].forEach(l=>{s[l]=this[l]}),s.services={...this.services},s.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},r&&(s.store=new ry(this.store.data,o),s.services.resourceStore=s.store),s.translator=new Na(s.services,o),s.translator.on("*",function(l){for(var a=arguments.length,c=new Array(a>1?a-1:0),u=1;u<a;u++)c[u-1]=arguments[u];s.emit(l,...c)}),s.init(o,n),s.translator.options=o,s.translator.backendConnector.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Ve=ci.createInstance();Ve.createInstance=ci.createInstance,Ve.createInstance,Ve.dir,Ve.init,Ve.loadResources,Ve.reloadResources,Ve.use,Ve.changeLanguage,Ve.getFixedT;const A=Ve.t;Ve.exists,Ve.setDefaultNamespace,Ve.hasLoadedNamespace,Ve.loadNamespaces,Ve.loadLanguages;function XA(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ui(e){"@babel/helpers - typeof";return ui=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},ui(e)}function QA(e,t){if(ui(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(ui(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function qA(e){var t=QA(e,"string");return ui(t)=="symbol"?t:String(t)}function dy(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,qA(r.key),r)}}function JA(e,t,n){return t&&dy(e.prototype,t),n&&dy(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}var fy=[],ZA=fy.forEach,eI=fy.slice;function tI(e){return ZA.call(eI.call(arguments,1),function(t){if(t)for(var n in t)e[n]===void 0&&(e[n]=t[n])}),e}var py=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,nI=function(t,n,r){var o=r||{};o.path=o.path||"/";var s=encodeURIComponent(n),i="".concat(t,"=").concat(s);if(o.maxAge>0){var l=o.maxAge-0;if(Number.isNaN(l))throw new Error("maxAge should be a Number");i+="; Max-Age=".concat(Math.floor(l))}if(o.domain){if(!py.test(o.domain))throw new TypeError("option domain is invalid");i+="; Domain=".concat(o.domain)}if(o.path){if(!py.test(o.path))throw new TypeError("option path is invalid");i+="; Path=".concat(o.path)}if(o.expires){if(typeof o.expires.toUTCString!="function")throw new TypeError("option expires is invalid");i+="; Expires=".concat(o.expires.toUTCString())}if(o.httpOnly&&(i+="; HttpOnly"),o.secure&&(i+="; Secure"),o.sameSite){var a=typeof o.sameSite=="string"?o.sameSite.toLowerCase():o.sameSite;switch(a){case!0:i+="; SameSite=Strict";break;case"lax":i+="; SameSite=Lax";break;case"strict":i+="; SameSite=Strict";break;case"none":i+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return i},hy={create:function(t,n,r,o){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};r&&(s.expires=new Date,s.expires.setTime(s.expires.getTime()+r*60*1e3)),o&&(s.domain=o),document.cookie=nI(t,encodeURIComponent(n),s)},read:function(t){for(var n="".concat(t,"="),r=document.cookie.split(";"),o=0;o<r.length;o++){for(var s=r[o];s.charAt(0)===" ";)s=s.substring(1,s.length);if(s.indexOf(n)===0)return s.substring(n.length,s.length)}return null},remove:function(t){this.create(t,"",-1)}},rI={name:"cookie",lookup:function(t){var n;if(t.lookupCookie&&typeof document<"u"){var r=hy.read(t.lookupCookie);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupCookie&&typeof document<"u"&&hy.create(n.lookupCookie,t,n.cookieMinutes,n.cookieDomain,n.cookieOptions)}},oI={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),s=o.split("&"),i=0;i<s.length;i++){var l=s[i].indexOf("=");if(l>0){var a=s[i].substring(0,l);a===t.lookupQuerystring&&(n=s[i].substring(l+1))}}}return n}},di=null,my=function(){if(di!==null)return di;try{di=window!=="undefined"&&window.localStorage!==null;var t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{di=!1}return di},sI={name:"localStorage",lookup:function(t){var n;if(t.lookupLocalStorage&&my()){var r=window.localStorage.getItem(t.lookupLocalStorage);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupLocalStorage&&my()&&window.localStorage.setItem(n.lookupLocalStorage,t)}},fi=null,gy=function(){if(fi!==null)return fi;try{fi=window!=="undefined"&&window.sessionStorage!==null;var t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{fi=!1}return fi},iI={name:"sessionStorage",lookup:function(t){var n;if(t.lookupSessionStorage&&gy()){var r=window.sessionStorage.getItem(t.lookupSessionStorage);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupSessionStorage&&gy()&&window.sessionStorage.setItem(n.lookupSessionStorage,t)}},lI={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}},aI={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}},cI={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}},uI={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 dI(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:function(t){return t}}}var Ey=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};XA(this,e),this.type="languageDetector",this.detectors={},this.init(t,n)}return JA(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||{languageUtils:{}},this.options=tI(r,this.options||{},dI()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=function(s){return s.replace("-","_")}),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=o,this.addDetector(rI),this.addDetector(oI),this.addDetector(sI),this.addDetector(iI),this.addDetector(lI),this.addDetector(aI),this.addDetector(cI),this.addDetector(uI)}},{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(s){if(r.detectors[s]){var i=r.detectors[s].lookup(r.options);i&&typeof i=="string"&&(i=[i]),i&&(o=o.concat(i))}}),o=o.map(function(s){return r.options.convertDetectedLanguage(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(s){o.detectors[s]&&o.detectors[s].cacheUserLanguage(n,o.options)}))}}]),e}();Ey.type="languageDetector";function cf(){return cf=Object.assign?Object.assign.bind():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},cf.apply(this,arguments)}var fI={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0};const pI=Ba(fI);var hI=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function yy(e){var t={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},n=e.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(t.name=n[1],(pI[n[1]]||e.charAt(e.length-2)==="/")&&(t.voidElement=!0),t.name.startsWith("!--"))){var r=e.indexOf("-->");return{type:"comment",comment:r!==-1?e.slice(4,r):""}}for(var o=new RegExp(hI),s=null;(s=o.exec(e))!==null;)if(s[0].trim())if(s[1]){var i=s[1].trim(),l=[i,""];i.indexOf("=")>-1&&(l=i.split("=")),t.attrs[l[0]]=l[1],o.lastIndex--}else s[2]&&(t.attrs[s[2]]=s[3].trim().substring(1,s[3].length-1));return t}var mI=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,gI=/^\s*$/,EI=Object.create(null);function vy(e,t){switch(t.type){case"text":return e+t.content;case"tag":return e+="<"+t.name+(t.attrs?function(n){var r=[];for(var o in n)r.push(o+'="'+n[o]+'"');return r.length?" "+r.join(" "):""}(t.attrs):"")+(t.voidElement?"/>":">"),t.voidElement?e:e+t.children.reduce(vy,"")+"</"+t.name+">";case"comment":return e+"<!--"+t.comment+"-->"}}var yI={parse:function(e,t){t||(t={}),t.components||(t.components=EI);var n,r=[],o=[],s=-1,i=!1;if(e.indexOf("<")!==0){var l=e.indexOf("<");r.push({type:"text",content:l===-1?e:e.substring(0,l)})}return e.replace(mI,function(a,c){if(i){if(a!=="</"+n.name+">")return;i=!1}var u,f=a.charAt(1)!=="/",p=a.startsWith("<!--"),h=c+a.length,E=e.charAt(h);if(p){var y=yy(a);return s<0?(r.push(y),r):((u=o[s]).children.push(y),r)}if(f&&(s++,(n=yy(a)).type==="tag"&&t.components[n.name]&&(n.type="component",i=!0),n.voidElement||i||!E||E==="<"||n.children.push({type:"text",content:e.slice(h,e.indexOf("<",h))}),s===0&&r.push(n),(u=o[s-1])&&u.children.push(n),o[s]=n),(!f||n.voidElement)&&(s>-1&&(n.voidElement||n.name===a.slice(2,-1))&&(s--,n=s===-1?r:o[s]),!i&&E!=="<"&&E)){u=s===-1?r:o[s].children;var v=e.indexOf("<",h),m=e.slice(h,v===-1?void 0:v);gI.test(m)&&(m=" "),(v>-1&&s+u.length>=0||m!==" ")&&u.push({type:"text",content:m})}}),r},stringify:function(e){return e.reduce(function(t,n){return t+vy("",n)},"")}};function Oa(){if(console&&console.warn){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];typeof t[0]=="string"&&(t[0]=`react-i18next:: ${t[0]}`),console.warn(...t)}}const _y={};function vI(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];typeof t[0]=="string"&&_y[t[0]]||(typeof t[0]=="string"&&(_y[t[0]]=new Date),Oa(...t))}const _I=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,SI={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},xI=e=>SI[e];let uf={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:e=>e.replace(_I,xI)};function RI(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};uf={...uf,...e}}function NI(){return uf}let Sy;function wI(e){Sy=e}function xy(){return Sy}function df(e,t){if(!e)return!1;const n=e.props?e.props.children:e.children;return t?n.length>0:!!n}function ff(e){if(!e)return[];const t=e.props?e.props.children:e.children;return e.props&&e.props.i18nIsDynamicList?Mo(t):t}function OI(e){return Object.prototype.toString.call(e)!=="[object Array]"?!1:e.every(t=>O.isValidElement(t))}function Mo(e){return Array.isArray(e)?e:[e]}function TI(e,t){const n={...t};return n.props=Object.assign(e.props,t.props),n}function Ry(e,t){if(!e)return"";let n="";const r=Mo(e),o=t.transSupportBasicHtmlNodes&&t.transKeepBasicHtmlNodesFor?t.transKeepBasicHtmlNodesFor:[];return r.forEach((s,i)=>{if(typeof s=="string")n+=`${s}`;else if(O.isValidElement(s)){const l=Object.keys(s.props).length,a=o.indexOf(s.type)>-1,c=s.props.children;if(!c&&a&&l===0)n+=`<${s.type}/>`;else if(!c&&(!a||l!==0))n+=`<${i}></${i}>`;else if(s.props.i18nIsDynamicList)n+=`<${i}></${i}>`;else if(a&&l===1&&typeof c=="string")n+=`<${s.type}>${c}</${s.type}>`;else{const u=Ry(c,t);n+=`<${i}>${u}</${i}>`}}else if(s===null)Oa("Trans: the passed in value is invalid - seems you passed in a null child.");else if(typeof s=="object"){const{format:l,...a}=s,c=Object.keys(a);if(c.length===1){const u=l?`${c[0]}, ${l}`:c[0];n+=`{{${u}}}`}else Oa("react-i18next: the passed in object contained more than one variable - the object should look like {{ value, format }} where format is optional.",s)}else Oa("Trans: the passed in value is invalid - seems you passed in a variable like {number} - please pass in variables for interpolation as full objects like {{number}}.",s)}),n}function AI(e,t,n,r,o,s){if(t==="")return[];const i=r.transKeepBasicHtmlNodesFor||[],l=t&&new RegExp(i.map(v=>`<${v}`).join("|")).test(t);if(!e&&!l&&!s)return[t];const a={};function c(v){Mo(v).forEach(g=>{typeof g!="string"&&(df(g)?c(ff(g)):typeof g=="object"&&!O.isValidElement(g)&&Object.assign(a,g))})}c(e);const u=yI.parse(`<0>${t}</0>`),f={...a,...o};function p(v,m,g){const S=ff(v),_=E(S,m.children,g);return OI(S)&&_.length===0||v.props&&v.props.i18nIsDynamicList?S:_}function h(v,m,g,S,_){v.dummy?(v.children=m,g.push(O.cloneElement(v,{key:S},_?void 0:m))):g.push(...O.Children.map([v],x=>{const R={...x.props};return delete R.i18nIsDynamicList,H.createElement(x.type,cf({},R,{key:S,ref:x.ref},_?{}:{children:m}))}))}function E(v,m,g){const S=Mo(v);return Mo(m).reduce((x,R,T)=>{const L=R.children&&R.children[0]&&R.children[0].content&&n.services.interpolator.interpolate(R.children[0].content,f,n.language);if(R.type==="tag"){let P=S[parseInt(R.name,10)];g.length===1&&!P&&(P=g[0][R.name]),P||(P={});const I=Object.keys(R.attrs).length!==0?TI({props:R.attrs},P):P,j=O.isValidElement(I),V=j&&df(R,!0)&&!R.voidElement,M=l&&typeof I=="object"&&I.dummy&&!j,w=typeof e=="object"&&e!==null&&Object.hasOwnProperty.call(e,R.name);if(typeof I=="string"){const b=n.services.interpolator.interpolate(I,f,n.language);x.push(b)}else if(df(I)||V){const b=p(I,R,g);h(I,b,x,T)}else if(M){const b=E(S,R.children,g);h(I,b,x,T)}else if(Number.isNaN(parseFloat(R.name)))if(w){const b=p(I,R,g);h(I,b,x,T,R.voidElement)}else if(r.transSupportBasicHtmlNodes&&i.indexOf(R.name)>-1)if(R.voidElement)x.push(O.createElement(R.name,{key:`${R.name}-${T}`}));else{const b=E(S,R.children,g);x.push(O.createElement(R.name,{key:`${R.name}-${T}`},b))}else if(R.voidElement)x.push(`<${R.name} />`);else{const b=E(S,R.children,g);x.push(`<${R.name}>${b}</${R.name}>`)}else if(typeof I=="object"&&!j){const b=R.children[0]?L:null;b&&x.push(b)}else h(I,L,x,T,R.children.length!==1||!L)}else if(R.type==="text"){const P=r.transWrapTextNodes,I=s?r.unescape(n.services.interpolator.interpolate(R.content,f,n.language)):n.services.interpolator.interpolate(R.content,f,n.language);P?x.push(O.createElement(P,{key:`${R.name}-${T}`},I)):x.push(I)}return x},[])}const y=E([{dummy:!0,children:e||[]}],u,Mo(e||[]));return ff(y[0])}function II(e){let{children:t,count:n,parent:r,i18nKey:o,context:s,tOptions:i={},values:l,defaults:a,components:c,ns:u,i18n:f,t:p,shouldUnescape:h,...E}=e;const y=f||xy();if(!y)return vI("You will need to pass in an i18next instance by using i18nextReactModule"),t;const v=p||y.t.bind(y)||(V=>V);s&&(i.context=s);const m={...NI(),...y.options&&y.options.react};let g=u||v.ns||y.options&&y.options.defaultNS;g=typeof g=="string"?[g]:g||["translation"];const S=Ry(t,m),_=a||S||m.transEmptyNodeValue||o,{hashTransKey:x}=m,R=o||(x?x(S||_):S||_);y.options&&y.options.interpolation&&y.options.interpolation.defaultVariables&&(l=l&&Object.keys(l).length>0?{...l,...y.options.interpolation.defaultVariables}:{...y.options.interpolation.defaultVariables});const T=l?i.interpolation:{interpolation:{...i.interpolation,prefix:"#$?",suffix:"?$#"}},L={...i,count:n,...l,...T,defaultValue:_,ns:g},P=R?v(R,L):_;c&&Object.keys(c).forEach(V=>{const M=c[V];if(typeof M.type=="function"||!M.props||!M.props.children||P.indexOf(`${V}/>`)<0&&P.indexOf(`${V} />`)<0)return;function w(){return H.createElement(H.Fragment,null,M)}c[V]=H.createElement(w,null)});const I=AI(c||t,P,y,m,L,h),j=r!==void 0?r:m.defaultTransParent;return j?O.createElement(j,E,I):I}const CI={type:"3rdParty",init(e){RI(e.options.react),wI(e)}},LI=O.createContext();function bI(e){let{children:t,count:n,parent:r,i18nKey:o,context:s,tOptions:i={},values:l,defaults:a,components:c,ns:u,i18n:f,t:p,shouldUnescape:h,...E}=e;const{i18n:y,defaultNS:v}=O.useContext(LI)||{},m=f||y||xy(),g=p||m&&m.t.bind(m);return II({children:t,count:n,parent:r,i18nKey:o,context:s,tOptions:i,values:l,defaults:a,components:c,ns:u||g&&g.ns||v||m&&m.options&&m.options.defaultNS,i18n:m,t:p,shouldUnescape:h,...E})}var DI={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"]},kI={prefix:"fas",iconName:"bars",icon:[448,512,["navicon"],"f0c9","M0 96C0 78.3 14.3 64 32 64H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32z"]},PI={prefix:"fas",iconName:"circle-exclamation",icon:[512,512,["exclamation-circle"],"f06a","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c13.3 0 24 10.7 24 24V264c0 13.3-10.7 24-24 24s-24-10.7-24-24V152c0-13.3 10.7-24 24-24zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]},MI={prefix:"fas",iconName:"circle-dot",icon:[512,512,[128280,"dot-circle"],"f192","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-352a96 96 0 1 1 0 192 96 96 0 1 1 0-192z"]},UI=MI,FI={prefix:"fas",iconName:"circle-check",icon:[512,512,[61533,"check-circle"],"f058","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"]},jI={prefix:"fas",iconName:"arrows-rotate",icon:[512,512,[128472,"refresh","sync"],"f021","M105.1 202.6c7.7-21.8 20.2-42.3 37.8-59.8c62.5-62.5 163.8-62.5 226.3 0L386.3 160H352c-17.7 0-32 14.3-32 32s14.3 32 32 32H463.5c0 0 0 0 0 0h.4c17.7 0 32-14.3 32-32V80c0-17.7-14.3-32-32-32s-32 14.3-32 32v35.2L414.4 97.6c-87.5-87.5-229.3-87.5-316.8 0C73.2 122 55.6 150.7 44.8 181.4c-5.9 16.7 2.9 34.9 19.5 40.8s34.9-2.9 40.8-19.5zM39 289.3c-5 1.5-9.8 4.2-13.7 8.2c-4 4-6.7 8.8-8.1 14c-.3 1.2-.6 2.5-.8 3.8c-.3 1.7-.4 3.4-.4 5.1V432c0 17.7 14.3 32 32 32s32-14.3 32-32V396.9l17.6 17.5 0 0c87.5 87.4 229.3 87.4 316.7 0c24.4-24.4 42.1-53.1 52.9-83.7c5.9-16.7-2.9-34.9-19.5-40.8s-34.9 2.9-40.8 19.5c-7.7 21.8-20.2 42.3-37.8 59.8c-62.5 62.5-163.8 62.5-226.3 0l-.1-.1L125.6 352H160c17.7 0 32-14.3 32-32s-14.3-32-32-32H48.4c-1.6 0-3.2 .1-4.8 .3s-3.1 .5-4.6 1z"]},VI={prefix:"fas",iconName:"arrow-turn-down-right",icon:[512,512,[],"e3d6","M64 64c0-17.7-14.3-32-32-32S0 46.3 0 64V224c0 53 43 96 96 96H402.7l-73.4 73.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l128-128c12.5-12.5 12.5-32.8 0-45.3l-128-128c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L402.7 256H96c-17.7 0-32-14.3-32-32V64z"]},$I={prefix:"fas",iconName:"arrow-right",icon:[448,512,[8594],"f061","M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z"]},HI={prefix:"fas",iconName:"circle-question",icon:[512,512,[62108,"question-circle"],"f059","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM169.8 165.3c7.9-22.3 29.1-37.3 52.8-37.3h58.3c34.9 0 63.1 28.3 63.1 63.1c0 22.6-12.1 43.5-31.7 54.8L280 264.4c-.2 13-10.9 23.6-24 23.6c-13.3 0-24-10.7-24-24V250.5c0-8.6 4.6-16.5 12.1-20.8l44.3-25.4c4.7-2.7 7.6-7.7 7.6-13.1c0-8.4-6.8-15.1-15.1-15.1H222.6c-3.4 0-6.4 2.1-7.5 5.3l-.4 1.2c-4.4 12.5-18.2 19-30.6 14.6s-19-18.2-14.6-30.6l.4-1.2zM224 352a32 32 0 1 1 64 0 32 32 0 1 1 -64 0z"]},BI={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"]},zI={prefix:"fas",iconName:"circle-small",icon:[320,512,[],"e122","M0 256a160 160 0 1 1 320 0A160 160 0 1 1 0 256z"]},WI={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"]},GI={prefix:"fas",iconName:"bolt",icon:[448,512,[9889,"zap"],"f0e7","M349.4 44.6c5.9-13.7 1.5-29.7-10.6-38.5s-28.6-8-39.9 1.8l-256 224c-10 8.8-13.6 22.9-8.9 35.3S50.7 288 64 288H175.5L98.6 467.4c-5.9 13.7-1.5 29.7 10.6 38.5s28.6 8 39.9-1.8l256-224c10-8.8 13.6-22.9 8.9-35.3s-16.6-20.7-30-20.7H272.5L349.4 44.6z"]},YI={prefix:"fas",iconName:"xmark",icon:[384,512,[128473,10005,10006,10060,215,"close","multiply","remove","times"],"f00d","M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"]},KI={prefix:"fas",iconName:"clock-rotate-left",icon:[512,512,["history"],"f1da","M75 75L41 41C25.9 25.9 0 36.6 0 57.9V168c0 13.3 10.7 24 24 24H134.1c21.4 0 32.1-25.9 17-41l-30.8-30.8C155 85.5 203 64 256 64c106 0 192 86 192 192s-86 192-192 192c-40.8 0-78.6-12.7-109.7-34.4c-14.5-10.1-34.4-6.6-44.6 7.9s-6.6 34.4 7.9 44.6C151.2 495 201.7 512 256 512c141.4 0 256-114.6 256-256S397.4 0 256 0C185.3 0 121.3 28.7 75 75zm181 53c-13.3 0-24 10.7-24 24V256c0 6.4 2.5 12.5 7 17l72 72c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-65-65V152c0-13.3-10.7-24-24-24z"]},XI={prefix:"fas",iconName:"triangle-exclamation",icon:[512,512,[9888,"exclamation-triangle","warning"],"f071","M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480H40c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24V296c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"]},QI={prefix:"fas",iconName:"circle-xmark",icon:[512,512,[61532,"times-circle","xmark-circle"],"f057","M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM175 175c9.4-9.4 24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9z"]};const qI={"arrow-left":BI,"arrow-right":$I,"arrow-turn-down-right":VI,"arrows-rotate":jI,bars:kI,bolt:GI,"circle-check":FI,"circle-exclamation":PI,"circle-info":WI,"circle-question":HI,"circle-small":zI,"circle-xmark":QI,"clock-rotate-left":KI,"dot-circle":UI,"trash-can":DI,"triangle-exclamation":XI,xmark:YI},re=O.forwardRef(function({className:t="",size:n="",tag:r},o){const s=qI[r];return s?d.jsx("svg",{"aria-hidden":"true","data-prefix":s.prefix,"data-icon":r,className:`svg-inline--fa fa-${r} ${n?`fa-${n}`:""} ${t}`,focusable:"false",ref:o,role:"img",viewBox:`0 0 ${s.icon[0]} ${s.icon[1]}`,xmlns:"http://www.w3.org/2000/svg",children:d.jsx("path",{d:s.icon[4],fill:"currentColor"})}):(Ne().debug(`Unknown icon: ${r}`),null)}),Uo=({className:e="",confirm:t=!0,handleDelete:n,label:r,scale:o=1,show:s=!0,showLabel:i=!1,size:l})=>{const[a,c]=O.useState(!1),[u,f]=O.useState(o);o!==u&&(c(!1),f(o));const p=E=>{E.preventDefault(),c(y=>!y)},h=E=>{E.preventDefault(),n(E)};return d.jsx(Zn,{enable:t,open:a,onOpenChange:c,placement:"top",scale:o,trigger:d.jsxs("button",{className:`${s?"visible opacity-100":"invisible opacity-0"} text-xs text-foreground/20 hover:text-negative group-hover/node-wrapper:visible group-hover/node-wrapper:animate-delay-opacity ${e}`,onClick:E=>p(E),type:"button",children:[d.jsx(re,{tag:"trash-can",size:l})," ",d.jsx("span",{className:`${i?"whitespace-nowrap text-foreground/40 underline hover:text-negative":"sr-only"}`,children:r})]}),children:d.jsxs("div",{className:"text-xs font-semibold",children:[d.jsx("p",{className:"w-full pb-2 text-center",children:A(N.ARE_YOU_SURE)}),d.jsxs("div",{className:"align-center flex justify-between gap-2",children:[d.jsx("button",{className:"rounded bg-secondary py-1 px-2",onClick:E=>p(E),children:A(N.CANCEL)}),d.jsx("button",{className:"rounded bg-negative py-1 px-2",onClick:E=>h(E),children:A(N.DELETE)})]})]})})},JI=e=>{const t=Q(n=>n.viewport.zoom);return d.jsx(Uo,{scale:t,...e})},ZI=Ne(),eC=100,tC=100,Ny=({children:e,className:t="",onClickListItem:n})=>{const r=Q(c=>c.nodes),o=Q(c=>c.reactFlowInstance),s=Q(c=>c.validationWarnings),{setSelectedNodes:i}=Te();if(s.size===0)return null;const l=Array.from(s.values());l.sort((c,u)=>A(c.nodeTitle).toLowerCase().localeCompare(A(u.nodeTitle).toLowerCase()));const a=c=>{var h,E;const u=r.find(y=>y.id===c);if(!u){ZI.error(`Node with id ${c} not found`);return}const f=((h=o==null?void 0:o.getNode(c))==null?void 0:h.height)??tC,p=((E=o==null?void 0:o.getNode(c))==null?void 0:E.width)??H0;o==null||o.fitBounds({height:f+eC,width:p,x:u.position.x,y:u.position.y},{duration:nf}),setTimeout(()=>i([u.id]),nf),n==null||n()};return d.jsxs("div",{className:`hidden max-h-60 flex-col sm:flex ${t}`,children:[e,d.jsxs("p",{className:"mb-2 text-xs",children:[A(N.NUMBER_OF_VALIDATION_WARNINGS,{count:l.length}),":"]}),d.jsx("div",{className:"flex-auto overflow-y-auto",children:d.jsx("ol",{className:"list-inside",children:l.map(c=>d.jsxs("li",{className:"mb-2 text-xs",children:[d.jsx("button",{className:"text-warning underline",onClick:()=>a(c.nodeId),children:A(c.nodeTitle)}),d.jsxs("ol",{className:"my-1 ml-4 flex list-inside flex-col gap-y-1",children:[!c.connected&&d.jsx("li",{children:A(N.NOT_CONNECTED_TO_FLOW)}),!c.valid&&d.jsx("li",{children:A(N.INVALID_SETTINGS)})]})]},c.id))})})]})},pi=e=>{const{className:t="",direction:n="from",valid:r=!0,...o}=e,s=n==="from";return d.jsxs("div",{className:`relative ${t} ${r?"":"invalid"}`,children:[d.jsx("input",{className:`w-full !pl-5 ${r?"":"invalid"}`,placeholder:A(s?N.FROM:N.TO),...o}),d.jsx(re,{className:"absolute left-[.25rem] top-[.5rem] text-foreground/40",tag:s?"arrow-left":"arrow-right"})]})},nC=({children:e})=>d.jsx("span",{className:"whitespace-wrap inline-block",children:d.jsx("code",{className:"mr-[0.5ch] whitespace-pre-wrap rounded-md bg-background p-0 px-[0.5ch] text-sm leading-4 tracking-tighter text-foreground",children:e})}),Lt=({children:e})=>d.jsxs("section",{className:"flex gap-2 overflow-hidden px-4 pb-3 text-xs leading-5",children:[d.jsx("div",{className:"shrink-0 pl-1 text-secondary",children:d.jsx(re,{size:"lg",tag:"arrow-turn-down-right"})}),d.jsx("div",{className:"w-full overflow-hidden",children:e})]}),rC=({connected:e=!1,deletable:t=!0,isRoot:n=!1,nodeId:r,nodeTitle:o,selected:s=!1})=>{const{removeNode:i}=Te(),l=Q(c=>c.isEdgeConnecting),a=(c=>c?"bg-positive/10 text-positive":e?"bg-focus/30 text-primary":"bg-foreground/10 text-foreground/50")(n);return d.jsxs("div",{className:"flex w-full items-center justify-start gap-x-2 p-4",children:[d.jsx("div",{className:`${a} flex h-5 w-5 shrink-0 items-center justify-center rounded-full`,children:d.jsx(re,{tag:"circle-small"})}),d.jsxs("div",{className:"flex-1",children:[d.jsx("h2",{className:"text-xs font-semibold",children:o}),!e&&d.jsxs("div",{className:"flex items-center justify-start text-tiny font-semibold leading-[14px] text-secondary",children:[d.jsx(re,{className:"px-1 text-warning",size:"lg",tag:"bolt"}),A(N.NOT_CONNECTED_TO_FLOW)]})]}),t&&!l&&d.jsx(JI,{handleDelete:()=>i(r),label:A(N.REMOVE_NODE,{title:o}),show:s})]})},oC=({valid:e})=>e?null:d.jsx("div",{className:"m-4 mt-0 inline-block",children:d.jsxs("div",{className:"flex items-start justify-start gap-2 rounded bg-negative/10 px-2 py-1 text-xs text-negative",children:[d.jsx(Zn,{placement:"bottom",trigger:d.jsx("div",{role:"tooltip",tabIndex:0,children:d.jsx(re,{size:"lg",tag:"triangle-exclamation"})}),children:A(N.INFO_INVALID_SETTINGS)}),A(N.INVALID_SETTINGS)]})}),sC=({nodeId:e,valid:t})=>{const{deleteValidationWarning:n,getTargetEdges:r,partialUpdateValidationWarning:o}=Te(),[s,i]=O.useState(!1);return O.useEffect(()=>{let l;const a=()=>{n(e),typeof l=="function"&&l()},c=()=>{const u=Q.getState().nodes.find(f=>f.id===e);if(!u)a();else{const f=r(e).length>0;i(f),o(e,{connected:f,nodeId:e,nodeType:u.type,valid:t})}};return c(),l=Q.subscribe((u,f)=>{const p=u.nodes.length!==f.nodes.length,h=u.edges.length!==f.edges.length,E=u.isEdgeUpdateSuccessful!==f.isEdgeUpdateSuccessful;(h||p||E)&&c()}),()=>{a()}},[n,r,e,o,t]),{isConnectedToFlow:s}},iC=({id:e,isConnectable:t})=>{if(!e)throw new Error("TargetHandle: id is required");return d.jsx("div",{className:"absolute left-0 top-5 h-3 w-3 -translate-x-1/2",children:d.jsx(No,{className:"-left-[2px] h-full w-full border-2 border-foreground/40 bg-background transition-colors hover:border-foreground/80",id:`target-${e}`,isConnectable:t,position:q.Left,type:"target"})})},$e=({children:e,id:t,isConnectable:n=!0,isRoot:r=!1,nodeTitle:o,selected:s,deletable:i=!0,showValidation:l=!0,target:a=!0,valid:c=!0})=>{const{isConnectedToFlow:u}=sC({nodeId:t,valid:c});return d.jsx("section",{className:`${s?"!border-focus":""} group/node-wrapper rounded-xl border-2 border-background shadow-[0_4px_12px_0_rgba(0,0,0,0.08)] transition-[visibility]`,children:d.jsxs("div",{className:"group/node-wrapper relative rounded-xl bg-background",style:{width:H0},children:[a&&t&&d.jsx(iC,{id:t,isConnectable:n}),d.jsx(rC,{connected:!a||u,deletable:i,isRoot:r,nodeId:t,nodeTitle:o,selected:s}),l&&d.jsx(oC,{valid:c}),e]})})},lC=({children:e,handleClick:t,...n})=>{const r=o=>{(o.key==="Backspace"||o.key==="Delete")&&(o.stopPropagation(),t==null||t())};return d.jsx("li",{role:"presentation",children:d.jsxs("div",{className:"flex items-center gap-2 rounded-lg bg-primary/20 p-1 pl-2 text-xs font-medium text-foreground",role:"option","aria-selected":"true",tabIndex:0,children:[e,d.jsxs("button",{className:"px-1",onClick:t,onKeyDown:r,type:"button",...n,children:[d.jsx("span",{className:"sr-only",children:"Remove"}),d.jsx(re,{tag:"xmark",size:"xs"})]})]})})},wy=({data:e})=>{let t=e.selected&&e[e.selected].trim();return t&&e.selected==="url"&&(t=OA(t)||A(N.PLAY_AUDIO)),t?d.jsx(Lt,{children:d.jsx("div",{className:"max-w-max",children:e.selected==="url"?d.jsx("a",{className:"break-words text-primary underline line-clamp-2",href:e.url,target:"_blank",rel:"noopener noreferrer",children:t}):d.jsx("p",{className:"break-words line-clamp-2",children:t})})}):null},Oy=e=>{const{children:t,className:n="",disabled:r=!1,...o}=e;return d.jsxs("div",{className:`chevron-down relative mb-2 after:rotate-0 after:transition-transform focus-within:after:rotate-180
61
+ ${r?"after:border-t-foreground/40":"after:border-t-foreground"}`,children:[d.jsx("select",{className:`pr-8 ${n}`,disabled:r,...o,children:t}),d.jsx("p",{className:"requirements w-full",role:"alert",children:A(N.ERROR_SELECTION_REQUIRED)})]})},Zt=e=>{const{label:t="",id:n="",...r}=e,o=O.useId(),s=n||o;return d.jsxs(d.Fragment,{children:[t&&d.jsx("label",{className:"block pb-1 font-medium",htmlFor:s,children:t}),d.jsx(Oy,{id:s,...r})]})},aC=({label:e,vars:t={}})=>d.jsx(bI,{components:{a:d.jsx("a",{className:"underline hover:text-background/80",href:t.linkTo||"#",target:"_blank",rel:"noopener noreferrer"}),code:d.jsx(nC,{}),p:d.jsx("p",{className:"mb-2"})},i18nKey:e}),cC={disabled:"border-disabled cursor-not-allowed",negative:"border-negative hover:bg-negative",positive:"border-positive hover:bg-positive"},Ht=({color:e="positive",enabled:t=!0,id:n,isConnectable:r})=>{if(!n)throw new Error("SourceHandle: id is required");const o=t?e:"disabled",s=Q(u=>u.updatingSourceHandleId),a=!Q(u=>u.edges.some(f=>f.sourceHandle===n))||s===n,c=a&&r&&t;return d.jsx("div",{className:`absolute right-0 top-1/2 h-3 w-3 -translate-y-1/2 translate-x-1/2 ${c?"":"nodrag cursor-not-allowed"}`,children:d.jsx(No,{className:`-right-[2px] h-full w-full border-2 bg-background transition-colors ${cC[o]??""}`,id:n,isConnectable:a&&r&&t,position:q.Right,type:"source"})})},Fo=({children:e})=>d.jsx("div",{className:"flex w-full flex-col items-start text-xs",children:e}),Bt=({color:e="positive",enabled:t=!0,id:n,isConnectable:r,optionSubtitle:o="",optionTitle:s})=>d.jsxs("div",{className:"relative w-full min-w-[104px] whitespace-nowrap border-t border-foreground/10 py-3",children:[d.jsx("div",{className:"flex flex-col items-start justify-center px-4",children:d.jsxs("div",{className:`${t?"":"text-disabled"} min-h-[1rem] w-full overflow-hidden`,children:[s,o?d.jsx("span",{className:"block text-xxs text-secondary",children:o}):null]})}),d.jsx(Ht,{color:e,enabled:t,id:n,isConnectable:r})]}),uC=({checked:e=!1,name:t,onClick:n,...r})=>d.jsxs("button",{"aria-checked":e?"true":"false",className:`${e?"bg-primary":"bg-secondary"} relative inline-flex h-4 w-6 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out`,name:t,onClick:n,role:"switch",type:"button",...r,children:[d.jsx("span",{className:"sr-only",children:A(e?N.ON:N.OFF)}),d.jsx("span",{className:`pointer-events-none inline-block h-3 w-3 ${e?"translate-x-2":"translate-x-0"} transform rounded-full bg-white shadow transition duration-200 ease-in-out`})]}),Ta=({checked:e,clickHandler:t,name:n,subtitle:r,title:o,...s})=>d.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[d.jsxs("div",{className:"flex flex-grow flex-col",children:[d.jsx("span",{className:"text-xs font-medium",children:o}),r&&d.jsx("span",{className:"text-xxs text-foreground/50",children:r})]}),d.jsx(uC,{checked:e,name:n,onClick:t,...s})]}),yn=({errorText:e,label:t,name:n,onChange:r,required:o,valid:s,value:i,...l})=>d.jsxs(d.Fragment,{children:[t!=null&&t.trim()?d.jsx("div",{className:"pb-1",children:t}):null,d.jsx("textarea",{"aria-invalid":s?void 0:"true",className:`peer min-h-[77px] w-full resize-y ${s?"":"invalid"}`,inputMode:"text",minLength:1,name:n,onChange:r,required:o,value:i,...l}),d.jsx("p",{className:"requirements",role:"alert",children:e})]});function Xn(e){return Ty(e)?(e.nodeName||"").toLowerCase():"#document"}function it(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function vn(e){var t;return(t=(Ty(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ty(e){return e instanceof Node||e instanceof it(e).Node}function ge(e){return e instanceof Element||e instanceof it(e).Element}function vt(e){return e instanceof HTMLElement||e instanceof it(e).HTMLElement}function pf(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof it(e).ShadowRoot}function hi(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=_t(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function dC(e){return["table","td","th"].includes(Xn(e))}function hf(e){const t=mf(),n=_t(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function fC(e){let t=Rr(e);for(;vt(t)&&!jo(t);){if(hf(t))return t;t=Rr(t)}return null}function mf(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function jo(e){return["html","body","#document"].includes(Xn(e))}function _t(e){return it(e).getComputedStyle(e)}function Aa(e){return ge(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Rr(e){if(Xn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||pf(e)&&e.host||vn(e);return pf(t)?t.host:t}function Ay(e){const t=Rr(e);return jo(t)?e.ownerDocument?e.ownerDocument.body:e.body:vt(t)&&hi(t)?t:Ay(t)}function Qn(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Ay(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=it(o);return s?t.concat(i,i.visualViewport||[],hi(o)?o:[],i.frameElement&&n?Qn(i.frameElement):[]):t.concat(o,Qn(o,[],n))}function Iy(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function qn(e,t){if(!e||!t)return!1;const n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&pf(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Cy(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function pC(){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 hC(e){return!gC()&&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 mC(){return/apple/i.test(navigator.vendor)}function gC(){const e=/android/i;return e.test(Cy())||e.test(pC())}function EC(){return Cy().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function Ly(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function yC(e){return"nativeEvent"in e}function vC(e){return e.matches("html,body")}function Nr(e){return(e==null?void 0:e.ownerDocument)||document}function gf(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)}function wr(e){return"composedPath"in e?e.composedPath()[0]:e.target}const _C="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function SC(e){return vt(e)&&e.matches(_C)}const Vo=Math.min,Or=Math.max,Ia=Math.round,Ca=Math.floor,Jn=e=>({x:e,y:e}),xC={left:"right",right:"left",bottom:"top",top:"bottom"},RC={start:"end",end:"start"};function Ef(e,t,n){return Or(e,Vo(t,n))}function mi(e,t){return typeof e=="function"?e(t):e}function Tr(e){return e.split("-")[0]}function gi(e){return e.split("-")[1]}function by(e){return e==="x"?"y":"x"}function yf(e){return e==="y"?"height":"width"}function La(e){return["top","bottom"].includes(Tr(e))?"y":"x"}function vf(e){return by(La(e))}function NC(e,t,n){n===void 0&&(n=!1);const r=gi(e),o=vf(e),s=yf(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=ba(i)),[i,ba(i)]}function wC(e){const t=ba(e);return[_f(e),t,_f(t)]}function _f(e){return e.replace(/start|end/g,t=>RC[t])}function OC(e,t,n){const r=["left","right"],o=["right","left"],s=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?s:i;default:return[]}}function TC(e,t,n,r){const o=gi(e);let s=OC(Tr(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(_f)))),s}function ba(e){return e.replace(/left|right|bottom|top/g,t=>xC[t])}function AC(e){return{top:0,right:0,bottom:0,left:0,...e}}function Dy(e){return typeof e!="number"?AC(e):{top:e,right:e,bottom:e,left:e}}function Da(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function ky(e,t,n){let{reference:r,floating:o}=e;const s=La(t),i=vf(t),l=yf(i),a=Tr(t),c=s==="y",u=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,p=r[l]/2-o[l]/2;let h;switch(a){case"top":h={x:u,y:r.y-o.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:f};break;case"left":h={x:r.x-o.width,y:f};break;default:h={x:r.x,y:r.y}}switch(gi(t)){case"start":h[i]-=p*(n&&c?-1:1);break;case"end":h[i]+=p*(n&&c?-1:1);break}return h}const IC=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,l=s.filter(Boolean),a=await(i.isRTL==null?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=ky(c,r,a),p=r,h={},E=0;for(let y=0;y<l.length;y++){const{name:v,fn:m}=l[y],{x:g,y:S,data:_,reset:x}=await m({x:u,y:f,initialPlacement:r,placement:p,strategy:o,middlewareData:h,rects:c,platform:i,elements:{reference:e,floating:t}});if(u=g??u,f=S??f,h={...h,[v]:{...h[v],..._}},x&&E<=50){E++,typeof x=="object"&&(x.placement&&(p=x.placement),x.rects&&(c=x.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):x.rects),{x:u,y:f}=ky(c,p,a)),y=-1;continue}}return{x:u,y:f,placement:p,strategy:o,middlewareData:h}};async function Py(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:l,strategy:a}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:p=!1,padding:h=0}=mi(t,e),E=Dy(h),v=l[p?f==="floating"?"reference":"floating":f],m=Da(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(v)))==null||n?v:v.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:c,rootBoundary:u,strategy:a})),g=f==="floating"?{...i.floating,x:r,y:o}:i.reference,S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),_=await(s.isElement==null?void 0:s.isElement(S))?await(s.getScale==null?void 0:s.getScale(S))||{x:1,y:1}:{x:1,y:1},x=Da(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({rect:g,offsetParent:S,strategy:a}):g);return{top:(m.top-x.top+E.top)/_.y,bottom:(x.bottom-m.bottom+E.bottom)/_.y,left:(m.left-x.left+E.left)/_.x,right:(x.right-m.right+E.right)/_.x}}const My=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:l,middlewareData:a}=t,{element:c,padding:u=0}=mi(e,t)||{};if(c==null)return{};const f=Dy(u),p={x:n,y:r},h=vf(o),E=yf(h),y=await i.getDimensions(c),v=h==="y",m=v?"top":"left",g=v?"bottom":"right",S=v?"clientHeight":"clientWidth",_=s.reference[E]+s.reference[h]-p[h]-s.floating[E],x=p[h]-s.reference[h],R=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c));let T=R?R[S]:0;(!T||!await(i.isElement==null?void 0:i.isElement(R)))&&(T=l.floating[S]||s.floating[E]);const L=_/2-x/2,P=T/2-y[E]/2-1,I=Vo(f[m],P),j=Vo(f[g],P),V=I,M=T-y[E]-j,w=T/2-y[E]/2+L,b=Ef(V,w,M),k=!a.arrow&&gi(o)!=null&&w!=b&&s.reference[E]/2-(w<V?I:j)-y[E]/2<0,F=k?w<V?w-V:w-M:0;return{[h]:p[h]+F,data:{[h]:b,centerOffset:w-b-F,...k&&{alignmentOffset:F}},reset:k}}}),CC=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:l,platform:a,elements:c}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:E="none",flipAlignment:y=!0,...v}=mi(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const m=Tr(o),g=Tr(l)===l,S=await(a.isRTL==null?void 0:a.isRTL(c.floating)),_=p||(g||!y?[ba(l)]:wC(l));!p&&E!=="none"&&_.push(...TC(l,y,E,S));const x=[l,..._],R=await Py(t,v),T=[];let L=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&T.push(R[m]),f){const V=NC(o,i,S);T.push(R[V[0]],R[V[1]])}if(L=[...L,{placement:o,overflows:T}],!T.every(V=>V<=0)){var P,I;const V=(((P=s.flip)==null?void 0:P.index)||0)+1,M=x[V];if(M)return{data:{index:V,overflows:L},reset:{placement:M}};let w=(I=L.filter(b=>b.overflows[0]<=0).sort((b,k)=>b.overflows[1]-k.overflows[1])[0])==null?void 0:I.placement;if(!w)switch(h){case"bestFit":{var j;const b=(j=L.map(k=>[k.placement,k.overflows.filter(F=>F>0).reduce((F,C)=>F+C,0)]).sort((k,F)=>k[1]-F[1])[0])==null?void 0:j[0];b&&(w=b);break}case"initialPlacement":w=l;break}if(o!==w)return{reset:{placement:w}}}return{}}}};async function LC(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=Tr(n),l=gi(n),a=La(n)==="y",c=["left","top"].includes(i)?-1:1,u=s&&a?-1:1,f=mi(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:E}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return l&&typeof E=="number"&&(h=l==="end"?E*-1:E),a?{x:h*u,y:p*c}:{x:p*c,y:h*u}}const bC=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:l}=t,a=await LC(t,e);return i===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:o+a.x,y:s+a.y,data:{...a,placement:i}}}}},DC=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:l={fn:v=>{let{x:m,y:g}=v;return{x:m,y:g}}},...a}=mi(e,t),c={x:n,y:r},u=await Py(t,a),f=La(Tr(o)),p=by(f);let h=c[p],E=c[f];if(s){const v=p==="y"?"top":"left",m=p==="y"?"bottom":"right",g=h+u[v],S=h-u[m];h=Ef(g,h,S)}if(i){const v=f==="y"?"top":"left",m=f==="y"?"bottom":"right",g=E+u[v],S=E-u[m];E=Ef(g,E,S)}const y=l.fn({...t,[p]:h,[f]:E});return{...y,data:{x:y.x-n,y:y.y-r}}}}};function Uy(e){const t=_t(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=vt(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,l=Ia(n)!==s||Ia(r)!==i;return l&&(n=s,r=i),{width:n,height:r,$:l}}function Sf(e){return ge(e)?e:e.contextElement}function $o(e){const t=Sf(e);if(!vt(t))return Jn(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Uy(t);let i=(s?Ia(n.width):n.width)/r,l=(s?Ia(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const kC=Jn(0);function Fy(e){const t=it(e);return!mf()||!t.visualViewport?kC:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function PC(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==it(e)?!1:t}function Ar(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Sf(e);let i=Jn(1);t&&(r?ge(r)&&(i=$o(r)):i=$o(e));const l=PC(s,n,r)?Fy(s):Jn(0);let a=(o.left+l.x)/i.x,c=(o.top+l.y)/i.y,u=o.width/i.x,f=o.height/i.y;if(s){const p=it(s),h=r&&ge(r)?it(r):r;let E=p.frameElement;for(;E&&r&&h!==p;){const y=$o(E),v=E.getBoundingClientRect(),m=_t(E),g=v.left+(E.clientLeft+parseFloat(m.paddingLeft))*y.x,S=v.top+(E.clientTop+parseFloat(m.paddingTop))*y.y;a*=y.x,c*=y.y,u*=y.x,f*=y.y,a+=g,c+=S,E=it(E).frameElement}}return Da({width:u,height:f,x:a,y:c})}function MC(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=vt(n),s=vn(n);if(n===s)return t;let i={scrollLeft:0,scrollTop:0},l=Jn(1);const a=Jn(0);if((o||!o&&r!=="fixed")&&((Xn(n)!=="body"||hi(s))&&(i=Aa(n)),vt(n))){const c=Ar(n);l=$o(n),a.x=c.x+n.clientLeft,a.y=c.y+n.clientTop}return{width:t.width*l.x,height:t.height*l.y,x:t.x*l.x-i.scrollLeft*l.x+a.x,y:t.y*l.y-i.scrollTop*l.y+a.y}}function UC(e){return Array.from(e.getClientRects())}function jy(e){return Ar(vn(e)).left+Aa(e).scrollLeft}function FC(e){const t=vn(e),n=Aa(e),r=e.ownerDocument.body,o=Or(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Or(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+jy(e);const l=-n.scrollTop;return _t(r).direction==="rtl"&&(i+=Or(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:l}}function jC(e,t){const n=it(e),r=vn(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,l=0,a=0;if(o){s=o.width,i=o.height;const c=mf();(!c||c&&t==="fixed")&&(l=o.offsetLeft,a=o.offsetTop)}return{width:s,height:i,x:l,y:a}}function VC(e,t){const n=Ar(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=vt(e)?$o(e):Jn(1),i=e.clientWidth*s.x,l=e.clientHeight*s.y,a=o*s.x,c=r*s.y;return{width:i,height:l,x:a,y:c}}function Vy(e,t,n){let r;if(t==="viewport")r=jC(e,n);else if(t==="document")r=FC(vn(e));else if(ge(t))r=VC(t,n);else{const o=Fy(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return Da(r)}function $y(e,t){const n=Rr(e);return n===t||!ge(n)||jo(n)?!1:_t(n).position==="fixed"||$y(n,t)}function $C(e,t){const n=t.get(e);if(n)return n;let r=Qn(e,[],!1).filter(l=>ge(l)&&Xn(l)!=="body"),o=null;const s=_t(e).position==="fixed";let i=s?Rr(e):e;for(;ge(i)&&!jo(i);){const l=_t(i),a=hf(i);!a&&l.position==="fixed"&&(o=null),(s?!a&&!o:!a&&l.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||hi(i)&&!a&&$y(e,i))?r=r.filter(u=>u!==i):o=l,i=Rr(i)}return t.set(e,r),r}function HC(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?$C(t,this._c):[].concat(n),r],l=i[0],a=i.reduce((c,u)=>{const f=Vy(t,u,o);return c.top=Or(f.top,c.top),c.right=Vo(f.right,c.right),c.bottom=Vo(f.bottom,c.bottom),c.left=Or(f.left,c.left),c},Vy(t,l,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function BC(e){return Uy(e)}function zC(e,t,n){const r=vt(t),o=vn(t),s=n==="fixed",i=Ar(e,!0,s,t);let l={scrollLeft:0,scrollTop:0};const a=Jn(0);if(r||!r&&!s)if((Xn(t)!=="body"||hi(o))&&(l=Aa(t)),r){const c=Ar(t,!0,s,t);a.x=c.x+t.clientLeft,a.y=c.y+t.clientTop}else o&&(a.x=jy(o));return{x:i.left+l.scrollLeft-a.x,y:i.top+l.scrollTop-a.y,width:i.width,height:i.height}}function Hy(e,t){return!vt(e)||_t(e).position==="fixed"?null:t?t(e):e.offsetParent}function By(e,t){const n=it(e);if(!vt(e))return n;let r=Hy(e,t);for(;r&&dC(r)&&_t(r).position==="static";)r=Hy(r,t);return r&&(Xn(r)==="html"||Xn(r)==="body"&&_t(r).position==="static"&&!hf(r))?n:r||fC(e)||n}const WC=async function(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||By,s=this.getDimensions;return{reference:zC(t,await o(n),r),floating:{x:0,y:0,...await s(n)}}};function GC(e){return _t(e).direction==="rtl"}const YC={convertOffsetParentRelativeRectToViewportRelativeRect:MC,getDocumentElement:vn,getClippingRect:HC,getOffsetParent:By,getElementRects:WC,getClientRects:UC,getDimensions:BC,getScale:$o,isElement:ge,isRTL:GC};function KC(e,t){let n=null,r;const o=vn(e);function s(){clearTimeout(r),n&&n.disconnect(),n=null}function i(l,a){l===void 0&&(l=!1),a===void 0&&(a=1),s();const{left:c,top:u,width:f,height:p}=e.getBoundingClientRect();if(l||t(),!f||!p)return;const h=Ca(u),E=Ca(o.clientWidth-(c+f)),y=Ca(o.clientHeight-(u+p)),v=Ca(c),g={rootMargin:-h+"px "+-E+"px "+-y+"px "+-v+"px",threshold:Or(0,Vo(1,a))||1};let S=!0;function _(x){const R=x[0].intersectionRatio;if(R!==a){if(!S)return i();R?i(!1,R):r=setTimeout(()=>{i(!1,1e-7)},100)}S=!1}try{n=new IntersectionObserver(_,{...g,root:o.ownerDocument})}catch{n=new IntersectionObserver(_,g)}n.observe(e)}return i(!0),s}function XC(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:a=!1}=r,c=Sf(e),u=o||s?[...c?Qn(c):[],...Qn(t)]:[];u.forEach(m=>{o&&m.addEventListener("scroll",n,{passive:!0}),s&&m.addEventListener("resize",n)});const f=c&&l?KC(c,n):null;let p=-1,h=null;i&&(h=new ResizeObserver(m=>{let[g]=m;g&&g.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{h&&h.observe(t)})),n()}),c&&!a&&h.observe(c),h.observe(t));let E,y=a?Ar(e):null;a&&v();function v(){const m=Ar(e);y&&(m.x!==y.x||m.y!==y.y||m.width!==y.width||m.height!==y.height)&&n(),y=m,E=requestAnimationFrame(v)}return n(),()=>{u.forEach(m=>{o&&m.removeEventListener("scroll",n),s&&m.removeEventListener("resize",n)}),f&&f(),h&&h.disconnect(),h=null,a&&cancelAnimationFrame(E)}}const QC=(e,t,n)=>{const r=new Map,o={platform:YC,...n},s={...o.platform,_c:r};return IC(e,t,{...o,platform:s})},qC=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?My({element:r.current,padding:o}).fn(n):{}:r?My({element:r,padding:o}).fn(n):{}}}};var ka=typeof document<"u"?O.useLayoutEffect:O.useEffect;function Pa(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(!Pa(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(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!Pa(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function zy(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Wy(e,t){const n=zy(e);return Math.round(t*n)/n}function Gy(e){const t=O.useRef(e);return ka(()=>{t.current=e}),t}function JC(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:l=!0,whileElementsMounted:a,open:c}=e,[u,f]=O.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=O.useState(r);Pa(p,r)||h(r);const[E,y]=O.useState(null),[v,m]=O.useState(null),g=O.useCallback(k=>{k!=R.current&&(R.current=k,y(k))},[y]),S=O.useCallback(k=>{k!==T.current&&(T.current=k,m(k))},[m]),_=s||E,x=i||v,R=O.useRef(null),T=O.useRef(null),L=O.useRef(u),P=Gy(a),I=Gy(o),j=O.useCallback(()=>{if(!R.current||!T.current)return;const k={placement:t,strategy:n,middleware:p};I.current&&(k.platform=I.current),QC(R.current,T.current,k).then(F=>{const C={...F,isPositioned:!0};V.current&&!Pa(L.current,C)&&(L.current=C,Bl.flushSync(()=>{f(C)}))})},[p,t,n,I]);ka(()=>{c===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,f(k=>({...k,isPositioned:!1})))},[c]);const V=O.useRef(!1);ka(()=>(V.current=!0,()=>{V.current=!1}),[]),ka(()=>{if(_&&(R.current=_),x&&(T.current=x),_&&x){if(P.current)return P.current(_,x,j);j()}},[_,x,j,P]);const M=O.useMemo(()=>({reference:R,floating:T,setReference:g,setFloating:S}),[g,S]),w=O.useMemo(()=>({reference:_,floating:x}),[_,x]),b=O.useMemo(()=>{const k={position:n,left:0,top:0};if(!w.floating)return k;const F=Wy(w.floating,u.x),C=Wy(w.floating,u.y);return l?{...k,transform:"translate("+F+"px, "+C+"px)",...zy(w.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:F,top:C}},[n,l,w.floating,u.x,u.y]);return O.useMemo(()=>({...u,update:j,refs:M,elements:w,floatingStyles:b}),[u,j,M,w,b])}function Yy(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 ZC=lp.useInsertionEffect||(e=>e());function Ho(e){const t=O.useRef(()=>{});return ZC(()=>{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)},[])}var Ei=typeof document<"u"?O.useLayoutEffect:O.useEffect;let xf=!1,e2=0;const Ky=()=>"floating-ui-"+e2++;function t2(){const[e,t]=O.useState(()=>xf?Ky():void 0);return Ei(()=>{e==null&&t(Ky())},[]),O.useEffect(()=>{xf||(xf=!0)},[]),e}const Xy=lp.useId||t2;function n2(){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){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(o=>o!==n))||[])}}}const r2=O.createContext(null),o2=O.createContext(null),Rf=()=>{var e;return((e=O.useContext(r2))==null?void 0:e.id)||null},Nf=()=>O.useContext(o2);function wf(e){return"data-floating-ui-"+e}function Qy(e){const t=O.useRef(e);return Ei(()=>{t.current=e}),t}const qy=wf("safe-polygon");function Of(e,t,n){return n&&!Ly(n)?0:typeof e=="number"?e:e==null?void 0:e[t]}function s2(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:s,elements:{domReference:i,floating:l},refs:a}=e,{enabled:c=!0,delay:u=0,handleClose:f=null,mouseOnly:p=!1,restMs:h=0,move:E=!0}=t,y=Nf(),v=Rf(),m=Qy(f),g=Qy(u),S=O.useRef(),_=O.useRef(),x=O.useRef(),R=O.useRef(),T=O.useRef(!0),L=O.useRef(!1),P=O.useRef(()=>{}),I=O.useCallback(()=>{var w;const b=(w=o.current.openEvent)==null?void 0:w.type;return(b==null?void 0:b.includes("mouse"))&&b!=="mousedown"},[o]);O.useEffect(()=>{if(!c)return;function w(b){let{open:k}=b;k||(clearTimeout(_.current),clearTimeout(R.current),T.current=!0)}return s.on("openchange",w),()=>{s.off("openchange",w)}},[c,s]),O.useEffect(()=>{if(!c||!m.current||!n)return;function w(k){I()&&r(!1,k,"hover")}const b=Nr(l).documentElement;return b.addEventListener("mouseleave",w),()=>{b.removeEventListener("mouseleave",w)}},[l,n,r,c,m,o,I]);const j=O.useCallback(function(w,b,k){b===void 0&&(b=!0),k===void 0&&(k="hover");const F=Of(g.current,"close",S.current);F&&!x.current?(clearTimeout(_.current),_.current=setTimeout(()=>r(!1,w,k),F)):b&&(clearTimeout(_.current),r(!1,w,k))},[g,r]),V=O.useCallback(()=>{P.current(),x.current=void 0},[]),M=O.useCallback(()=>{if(L.current){const w=Nr(a.floating.current).body;w.style.pointerEvents="",w.removeAttribute(qy),L.current=!1}},[a]);return O.useEffect(()=>{if(!c)return;function w(){return o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1}function b(C){if(clearTimeout(_.current),T.current=!1,p&&!Ly(S.current)||h>0&&Of(g.current,"open")===0)return;const D=Of(g.current,"open",S.current);D?_.current=setTimeout(()=>{r(!0,C,"hover")},D):r(!0,C,"hover")}function k(C){if(w())return;P.current();const D=Nr(l);if(clearTimeout(R.current),m.current){n||clearTimeout(_.current),x.current=m.current({...e,tree:y,x:C.clientX,y:C.clientY,onClose(){M(),V(),j(C,!0,"safe-polygon")}});const $=x.current;D.addEventListener("mousemove",$),P.current=()=>{D.removeEventListener("mousemove",$)};return}(S.current==="touch"?!qn(l,C.relatedTarget):!0)&&j(C)}function F(C){w()||m.current==null||m.current({...e,tree:y,x:C.clientX,y:C.clientY,onClose(){M(),V(),j(C)}})(C)}if(ge(i)){const C=i;return n&&C.addEventListener("mouseleave",F),l==null||l.addEventListener("mouseleave",F),E&&C.addEventListener("mousemove",b,{once:!0}),C.addEventListener("mouseenter",b),C.addEventListener("mouseleave",k),()=>{n&&C.removeEventListener("mouseleave",F),l==null||l.removeEventListener("mouseleave",F),E&&C.removeEventListener("mousemove",b),C.removeEventListener("mouseenter",b),C.removeEventListener("mouseleave",k)}}},[i,l,c,e,p,h,E,j,V,M,r,n,y,g,m,o]),Ei(()=>{var w;if(c&&n&&(w=m.current)!=null&&w.__options.blockPointerEvents&&I()){const k=Nr(l).body;if(k.setAttribute(qy,""),k.style.pointerEvents="none",L.current=!0,ge(i)&&l){var b;const F=i,C=y==null||(b=y.nodesRef.current.find(D=>D.id===v))==null||(b=b.context)==null?void 0:b.elements.floating;return C&&(C.style.pointerEvents=""),F.style.pointerEvents="auto",l.style.pointerEvents="auto",()=>{F.style.pointerEvents="",l.style.pointerEvents=""}}}},[c,n,v,l,i,y,m,o,I]),Ei(()=>{n||(S.current=void 0,V(),M())},[n,V,M]),O.useEffect(()=>()=>{V(),clearTimeout(_.current),clearTimeout(R.current),M()},[c,i,V,M]),O.useMemo(()=>{if(!c)return{};function w(b){S.current=b.pointerType}return{reference:{onPointerDown:w,onPointerEnter:w,onMouseMove(b){n||h===0||(clearTimeout(R.current),R.current=setTimeout(()=>{T.current||r(!0,b.nativeEvent,"hover")},h))}},floating:{onMouseEnter(){clearTimeout(_.current)},onMouseLeave(b){j(b.nativeEvent,!1)}}}},[c,h,n,r,j])}function Ma(e,t){let n=e.filter(o=>{var s;return o.parentId===t&&((s=o.context)==null?void 0:s.open)}),r=n;for(;r.length;)r=e.filter(o=>{var s;return(s=r)==null?void 0:s.some(i=>{var l;return o.parentId===i.id&&((l=o.context)==null?void 0:l.open)})}),n=n.concat(r);return n}const i2={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},l2={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Jy=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function a2(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,nodeId:o,elements:{reference:s,domReference:i,floating:l},dataRef:a}=e,{enabled:c=!0,escapeKey:u=!0,outsidePress:f=!0,outsidePressEvent:p="pointerdown",referencePress:h=!1,referencePressEvent:E="pointerdown",ancestorScroll:y=!1,bubbles:v,capture:m}=t,g=Nf(),S=Ho(typeof f=="function"?f:()=>!1),_=typeof f=="function"?S:f,x=O.useRef(!1),R=O.useRef(!1),{escapeKey:T,outsidePress:L}=Jy(v),{escapeKey:P,outsidePress:I}=Jy(m),j=Ho(b=>{if(!n||!c||!u||b.key!=="Escape")return;const k=g?Ma(g.nodesRef.current,o):[];if(!T&&(b.stopPropagation(),k.length>0)){let F=!0;if(k.forEach(C=>{var D;if((D=C.context)!=null&&D.open&&!C.context.dataRef.current.__escapeKeyBubbles){F=!1;return}}),!F)return}r(!1,yC(b)?b.nativeEvent:b,"escape-key")}),V=Ho(b=>{var k;const F=()=>{var C;j(b),(C=wr(b))==null||C.removeEventListener("keydown",F)};(k=wr(b))==null||k.addEventListener("keydown",F)}),M=Ho(b=>{const k=x.current;x.current=!1;const F=R.current;if(R.current=!1,p==="click"&&F||k||typeof _=="function"&&!_(b))return;const C=wr(b),D="["+wf("inert")+"]",U=Nr(l).querySelectorAll(D);let $=ge(C)?C:null;for(;$&&!jo($);){const z=Rr($);if(jo(z)||!ge(z))break;$=z}if(U.length&&ge(C)&&!vC(C)&&!qn(C,l)&&Array.from(U).every(z=>!qn($,z)))return;if(vt(C)&&l){const z=C.clientWidth>0&&C.scrollWidth>C.clientWidth,Y=C.clientHeight>0&&C.scrollHeight>C.clientHeight;let X=Y&&b.offsetX>C.clientWidth;if(Y&&_t(C).direction==="rtl"&&(X=b.offsetX<=C.offsetWidth-C.clientWidth),X||z&&b.offsetY>C.clientHeight)return}const B=g&&Ma(g.nodesRef.current,o).some(z=>{var Y;return gf(b,(Y=z.context)==null?void 0:Y.elements.floating)});if(gf(b,l)||gf(b,i)||B)return;const W=g?Ma(g.nodesRef.current,o):[];if(W.length>0){let z=!0;if(W.forEach(Y=>{var X;if((X=Y.context)!=null&&X.open&&!Y.context.dataRef.current.__outsidePressBubbles){z=!1;return}}),!z)return}r(!1,b,"outside-press")}),w=Ho(b=>{var k;const F=()=>{var C;M(b),(C=wr(b))==null||C.removeEventListener(p,F)};(k=wr(b))==null||k.addEventListener(p,F)});return O.useEffect(()=>{if(!n||!c)return;a.current.__escapeKeyBubbles=T,a.current.__outsidePressBubbles=L;function b(C){r(!1,C,"ancestor-scroll")}const k=Nr(l);u&&k.addEventListener("keydown",P?V:j,P),_&&k.addEventListener(p,I?w:M,I);let F=[];return y&&(ge(i)&&(F=Qn(i)),ge(l)&&(F=F.concat(Qn(l))),!ge(s)&&s&&s.contextElement&&(F=F.concat(Qn(s.contextElement)))),F=F.filter(C=>{var D;return C!==((D=k.defaultView)==null?void 0:D.visualViewport)}),F.forEach(C=>{C.addEventListener("scroll",b,{passive:!0})}),()=>{u&&k.removeEventListener("keydown",P?V:j,P),_&&k.removeEventListener(p,I?w:M,I),F.forEach(C=>{C.removeEventListener("scroll",b)})}},[a,l,i,s,u,_,p,n,r,y,c,T,L,j,P,V,M,I,w]),O.useEffect(()=>{x.current=!1},[_,p]),O.useMemo(()=>c?{reference:{onKeyDown:j,[i2[E]]:b=>{h&&r(!1,b.nativeEvent,"reference-press")}},floating:{onKeyDown:j,onMouseDown(){R.current=!0},onMouseUp(){R.current=!0},[l2[p]]:()=>{x.current=!0}}}:{},[c,h,p,E,r,j])}function c2(e){var t;e===void 0&&(e={});const{open:n=!1,onOpenChange:r,nodeId:o}=e,[s,i]=O.useState(null),l=((t=e.elements)==null?void 0:t.reference)||s,a=JC(e),c=Nf(),u=Rf()!=null,f=Ho((x,R,T)=>{x&&(h.current.openEvent=R),E.emit("openchange",{open:x,event:R,reason:T,nested:u}),r==null||r(x,R,T)}),p=O.useRef(null),h=O.useRef({}),E=O.useState(()=>n2())[0],y=Xy(),v=O.useCallback(x=>{const R=ge(x)?{getBoundingClientRect:()=>x.getBoundingClientRect(),contextElement:x}:x;a.refs.setReference(R)},[a.refs]),m=O.useCallback(x=>{(ge(x)||x===null)&&(p.current=x,i(x)),(ge(a.refs.reference.current)||a.refs.reference.current===null||x!==null&&!ge(x))&&a.refs.setReference(x)},[a.refs]),g=O.useMemo(()=>({...a.refs,setReference:m,setPositionReference:v,domReference:p}),[a.refs,m,v]),S=O.useMemo(()=>({...a.elements,domReference:l}),[a.elements,l]),_=O.useMemo(()=>({...a,refs:g,elements:S,dataRef:h,nodeId:o,floatingId:y,events:E,open:n,onOpenChange:f}),[a,o,y,E,n,f,g,S]);return Ei(()=>{const x=c==null?void 0:c.nodesRef.current.find(R=>R.id===o);x&&(x.context=_)}),O.useMemo(()=>({...a,context:_,refs:g,elements:S}),[a,g,S,_])}function u2(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:o,refs:s,elements:{floating:i,domReference:l}}=e,{enabled:a=!0,visibleOnly:c=!0}=t,u=O.useRef(!1),f=O.useRef(),p=O.useRef(!0);return O.useEffect(()=>{if(!a)return;const h=it(l);function E(){!n&&vt(l)&&l===Iy(Nr(l))&&(u.current=!0)}function y(){p.current=!0}return h.addEventListener("blur",E),h.addEventListener("keydown",y,!0),()=>{h.removeEventListener("blur",E),h.removeEventListener("keydown",y,!0)}},[i,l,n,a]),O.useEffect(()=>{if(!a)return;function h(E){let{reason:y}=E;(y==="reference-press"||y==="escape-key")&&(u.current=!0)}return o.on("openchange",h),()=>{o.off("openchange",h)}},[o,a]),O.useEffect(()=>()=>{clearTimeout(f.current)},[]),O.useMemo(()=>a?{reference:{onPointerDown(h){hC(h.nativeEvent)||(p.current=!1)},onMouseLeave(){u.current=!1},onFocus(h){if(u.current)return;const E=wr(h.nativeEvent);if(c&&ge(E))try{if(mC()&&EC())throw Error();if(!E.matches(":focus-visible"))return}catch{if(!p.current&&!SC(E))return}r(!0,h.nativeEvent,"focus")},onBlur(h){u.current=!1;const E=h.relatedTarget,y=ge(E)&&E.hasAttribute(wf("focus-guard"))&&E.getAttribute("data-type")==="outside";f.current=window.setTimeout(()=>{const v=Iy(l?l.ownerDocument:document);!E&&v===l||qn(s.floating.current,E)||qn(l,E)||y||r(!1,h.nativeEvent,"focus")})}}}:{},[a,c,l,s,r])}const Zy="active",ev="selected";function Tf(e,t,n){const r=new Map,o=n==="item";let s=e;if(o&&e){const{[Zy]:i,[ev]:l,...a}=e;s=a}return{...n==="floating"&&{tabIndex:-1},...s,...t.map(i=>{const l=i?i[n]:null;return typeof l=="function"?e?l(e):null:l}).concat(e).reduce((i,l)=>(l&&Object.entries(l).forEach(a=>{let[c,u]=a;if(!(o&&[Zy,ev].includes(c)))if(c.indexOf("on")===0){if(r.has(c)||r.set(c,[]),typeof u=="function"){var f;(f=r.get(c))==null||f.push(u),i[c]=function(){for(var p,h=arguments.length,E=new Array(h),y=0;y<h;y++)E[y]=arguments[y];return(p=r.get(c))==null?void 0:p.map(v=>v(...E)).find(v=>v!==void 0)}}}else i[c]=u}),i),{})}}function d2(e){e===void 0&&(e=[]);const t=e,n=O.useCallback(s=>Tf(s,e,"reference"),t),r=O.useCallback(s=>Tf(s,e,"floating"),t),o=O.useCallback(s=>Tf(s,e,"item"),e.map(s=>s==null?void 0:s.item));return O.useMemo(()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:o}),[n,r,o])}const f2=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function p2(e,t){var n;t===void 0&&(t={});const{open:r,floatingId:o}=e,{enabled:s=!0,role:i="dialog"}=t,l=(n=f2.get(i))!=null?n:i,a=Xy(),u=Rf()!=null;return O.useMemo(()=>{if(!s)return{};const f={id:o,...l&&{role:l}};return l==="tooltip"||i==="label"?{reference:{["aria-"+(i==="label"?"labelledby":"describedby")]:r?o:void 0},floating:f}:{reference:{"aria-expanded":r?"true":"false","aria-haspopup":l==="alertdialog"?"dialog":l,"aria-controls":r?o:void 0,...l==="listbox"&&{role:"combobox"},...l==="menu"&&{id:a},...l==="menu"&&u&&{role:"menuitem"},...i==="select"&&{"aria-autocomplete":"none"},...i==="combobox"&&{"aria-autocomplete":"list"}},floating:{...f,...l==="menu"&&{"aria-labelledby":a}},item(p){let{active:h,selected:E}=p;const y={role:"option",...h&&{id:o+"-option"}};switch(i){case"select":return{...y,"aria-selected":h&&E};case"combobox":return{...y,...h&&{"aria-selected":!0}}}return{}}}},[s,i,l,r,o,a,u])}function tv(e,t){const[n,r]=e;let o=!1;const s=t.length;for(let i=0,l=s-1;i<s;l=i++){const[a,c]=t[i]||[0,0],[u,f]=t[l]||[0,0];c>=r!=f>=r&&n<=(u-a)*(r-c)/(f-c)+a&&(o=!o)}return o}function h2(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function m2(e){e===void 0&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e;let o,s=!1,i=null,l=null,a=performance.now();function c(f,p){const h=performance.now(),E=h-a;if(i===null||l===null||E===0)return i=f,l=p,a=h,null;const y=f-i,v=p-l,g=Math.sqrt(y*y+v*v)/E;return i=f,l=p,a=h,g}const u=f=>{let{x:p,y:h,placement:E,elements:y,onClose:v,nodeId:m,tree:g}=f;return function(_){function x(){clearTimeout(o),v()}if(clearTimeout(o),!y.domReference||!y.floating||E==null||p==null||h==null)return;const{clientX:R,clientY:T}=_,L=[R,T],P=wr(_),I=_.type==="mouseleave",j=qn(y.floating,P),V=qn(y.domReference,P),M=y.domReference.getBoundingClientRect(),w=y.floating.getBoundingClientRect(),b=E.split("-")[0],k=p>w.right-w.width/2,F=h>w.bottom-w.height/2,C=h2(L,M),D=w.width>M.width,U=w.height>M.height,$=(D?M:w).left,B=(D?M:w).right,W=(U?M:w).top,z=(U?M:w).bottom;if(j&&(s=!0,!I))return;if(V&&(s=!1),V&&!I){s=!0;return}if(I&&ge(_.relatedTarget)&&qn(y.floating,_.relatedTarget)||g&&Ma(g.nodesRef.current,m).some(Z=>{let{context:J}=Z;return J==null?void 0:J.open}))return;if(b==="top"&&h>=M.bottom-1||b==="bottom"&&h<=M.top+1||b==="left"&&p>=M.right-1||b==="right"&&p<=M.left+1)return x();let Y=[];switch(b){case"top":Y=[[$,M.top+1],[$,w.bottom-1],[B,w.bottom-1],[B,M.top+1]];break;case"bottom":Y=[[$,w.top+1],[$,M.bottom-1],[B,M.bottom-1],[B,w.top+1]];break;case"left":Y=[[w.right-1,z],[w.right-1,W],[M.left+1,W],[M.left+1,z]];break;case"right":Y=[[M.right-1,z],[M.right-1,W],[w.left+1,W],[w.left+1,z]];break}function X(Z){let[J,te]=Z;switch(b){case"top":{const ce=[D?J+t/2:k?J+t*4:J-t*4,te+t+1],Re=[D?J-t/2:k?J+t*4:J-t*4,te+t+1],Me=[[w.left,k||D?w.bottom-t:w.top],[w.right,k?D?w.bottom-t:w.top:w.bottom-t]];return[ce,Re,...Me]}case"bottom":{const ce=[D?J+t/2:k?J+t*4:J-t*4,te-t],Re=[D?J-t/2:k?J+t*4:J-t*4,te-t],Me=[[w.left,k||D?w.top+t:w.bottom],[w.right,k?D?w.top+t:w.bottom:w.top+t]];return[ce,Re,...Me]}case"left":{const ce=[J+t+1,U?te+t/2:F?te+t*4:te-t*4],Re=[J+t+1,U?te-t/2:F?te+t*4:te-t*4];return[...[[F||U?w.right-t:w.left,w.top],[F?U?w.right-t:w.left:w.right-t,w.bottom]],ce,Re]}case"right":{const ce=[J-t,U?te+t/2:F?te+t*4:te-t*4],Re=[J-t,U?te-t/2:F?te+t*4:te-t*4],Me=[[F||U?w.left+t:w.right,w.top],[F?U?w.left+t:w.right:w.left+t,w.bottom]];return[ce,Re,...Me]}}}if(!tv([R,T],Y)){if(s&&!C)return x();if(!I&&r){const Z=c(_.clientX,_.clientY);if(Z!==null&&Z<.1)return x()}tv([R,T],X([p,h]))?!s&&r&&(o=window.setTimeout(x,40)):x()}}};return u.__options={blockPointerEvents:n},u}function g2({arrowPadding:e,escapeKey:t=!0,initialOpen:n=!1,keepOpenOverContent:r=!1,onOpenChange:o,open:s,outsidePress:i=!0,placement:l,role:a="tooltip"}){const c=Q(R=>R.rootElementId),u=O.useRef(null),[f,p]=O.useState(n),h=s??f,E=o??p,y=c2({middleware:[bC(8),CC({boundary:document.querySelector(`#${c}`)||void 0}),DC({padding:4}),qC({element:u,padding:e??{bottom:0,left:8,right:8,top:8}})],onOpenChange:E,open:h,placement:l,strategy:"fixed",whileElementsMounted:XC}),v=y.context,m=s2(v,{enabled:s==null,handleClose:r?m2():null,move:!1}),g=u2(v,{enabled:s==null}),S=a2(v,{escapeKey:t,outsidePress:i}),_=p2(v,{role:a}),x=d2([m,g,S,_]);return O.useMemo(()=>({arrowRef:u,open:h,setOpen:E,...x,...y}),[h,E,x,y])}const nv=H.createContext(null),Af=()=>{const e=H.useContext(nv);if(e==null)throw new Error("Tooltip components must be wrapped in <Tooltip />");return e},E2=({children:e,...t})=>{const n=g2(t);return d.jsx(nv.Provider,{value:n,children:e})},y2={bottom:"-top-1 before:border-b-0 before:border-r-0",left:"-right-1 before:border-r-0 before:border-t-0",right:"-left-1 before:border-l-0 before:border-b-0",top:"-bottom-1 before:border-t-0 before:border-l-0"},v2=()=>{var i,l;const e=Af(),[t,n]=O.useState(e.middlewareData.arrow);O.useEffect(()=>{e.middlewareData.arrow&&n(e.middlewareData.arrow)},[e.middlewareData.arrow]);const r={left:(t==null?void 0:t.x)!=null?`${t==null?void 0:t.x}px`:"",top:(t==null?void 0:t.y)!=null?`${t==null?void 0:t.y}px`:""},o=((l=(i=e.placement)==null?void 0:i.split("-"))==null?void 0:l[0])||"top",s=`${y2[o]}`;return d.jsx("div",{ref:e.arrowRef,style:r,className:`tooltip-arrow absolute h-2 w-2 rotate-45 bg-inherit
66
62
  before:absolute before:h-2 before:w-2 before:border before:border-foreground/30 before:content-['']
67
- ${i}`})},pC=Wr.forwardRef(function(t,n){const{children:r,style:o,...i}=t,{getRootElement:s}=xe(),a=s(),l=Df(),c=A0([l.refs.setFloating,n]);return u.jsx(T0,{root:a,children:l.open&&u.jsxs("div",{className:"relative max-w-md rounded-md bg-foreground p-2 text-sm text-background shadow-sm",ref:c,style:{left:l.x??0,position:l.strategy,top:l.y??0,visibility:l.x==null?"hidden":"visible",...o},...l.getFloatingProps(i),children:[u.jsx("div",{className:"overflow-hidden",children:r}),u.jsx(fC,{})]})})}),hC=w.forwardRef(function({children:t,asChild:n=!1,...r},o){const i=Df(),s=A0([i.refs.setReference,o,t==null?void 0:t.ref]);return n&&w.isValidElement(t)?w.cloneElement(t,i.getReferenceProps({ref:s,...r,...t.props,"data-state":i.open?"open":"closed"})):u.jsx("button",{ref:s,"data-state":i.open?"open":"closed",...i.getReferenceProps(r),children:t})}),b0={bottom:"top",left:"right",right:"left",top:"bottom"},sr=({asChild:e=!0,children:t,enable:n=!0,placement:r="right",scale:o=1,trigger:i=u.jsx(te,{tag:"circle-info"}),...s})=>{let a=r.split("-")[0];return a=Object.keys(b0).includes(a)?a:"right",n?u.jsxs(uC,{...s,placement:r,children:[u.jsx(hC,{asChild:e,children:i}),u.jsx(pC,{style:o!==1?{transform:`scale(${o})`,transformOrigin:b0[a]}:void 0,children:t})]}):u.jsx(u.Fragment,{children:i})},gC={ABOUT:"About",ACTION:"Action",ADD_ADDRESS:"Add address",ADD_AI_AGENT:"Add AI agent",ADD_CONDITION:"Add condition",ADD_OPTION:"Add option",ADD_PHONE_NUMBER:"Add phone number",ADD_RESOURCE:"Add resource",ADD_VARIABLE:"Add variable",ADDRESS_NUMBER:"Address {{index}}",AI_AGENT:"AI Agent",AI_AGENT_NAME:"AI Agent Name",ANSWER_CALL:"Answer Call",API_VERSION:"API Version",ARE_YOU_SURE:"Are you sure?",AUDIO_FILE:"Audio File",BEEP:"Beep",BEEP_SUBTITLE:"Play a beep before recording",BUSY:"Busy",CALL_ADDRESSES:"Call Addresses",CALL_NUMBERS:"Call Numbers",CALL_RESOURCES:"Call Resources",CALL_STATE_EVENTS:"Call State Events",CALL_STATE_URL:"Call State URL",CALLER_PRESSES:"Caller presses",CALLER_SAYS:"Caller says",CANCEL:"Cancel",CAUTION:"Caution",CHOOSE_OPTION_SINGLE_MULTIPLE:"Choose single or multiple",CHOOSE_OPTION_TTS_AUDIO:"Choose how to play the message",CLOSE:"Close",COND_NUMBER:"Cond {{index}}",CONDITION_NUMBER:"Condition {{index}}",CONDITIONS:"Conditions",CONFIRMATION_REMOVE_OPTION:"Are you sure? Removing this option will delete the flow connection and move back the following option, if there is one.",CONFIRMATION_REMOVE_VARIABLE:"Are you sure you want to remove this variable?",DECISION:"Decision",DECLINE:"Decline",DEFAULT_FROM:"Default From",DEFAULT_TIMEOUT:"Default Timeout",DELETE:"Delete",DELETE_NODE:"Delete node",DEPLOY:"Deploy",DEPLOY_WARNING:"Caution - Confirm Deploy",DEPRECATED:"Deprecated",DISCONNECT_CALL_AFTER_RINGING:"Disconnect call after ringing",DOCUMENT_OUT_OF_SYNC:"Document Out of Sync",EDIT_SELECTED_AI_AGENT:"Edit Selected AI Agent",ELSE:"Else",END_SILENCE_TIMEOUT:"End Silence Timeout",ENTER_URL:"Enter URL",ERROR:"Error",ERROR_ADD_AI_AGENT_FIRST:"Please add an AI Agent first.",ERROR_ADD_RECORDING_FIRST:"Please add a Start Call Recording node first.",ERROR_DUPLICATE_COMMAND:"This command is already used. Please use a unique phrase.",ERROR_DUPLICATE_RECORDING_LABEL:"This entry already exists. Please use a unique label.",ERROR_DUPLICATE_TELEPHONE_KEY:"This key is already used. Please use a unique key.",ERROR_DUPLICATE_VARIABLE_KEY:"This variable already exists. Please use a unique key.",ERROR_FETCHING_AI_AGENTS:"Error fetching AI Agents.",ERROR_FETCHING_DEPLOYED_VERSIONS:"Error fetching deployed versions.",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_SELECTION_REQUIRED:"A selection is required.",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.",EXECUTE_SWML:"Execute SWML",FAILED:"Failed",FAILURE:"Failure",FEMALE:"Female",FLOW_DATA_VERSION:"Flow Data Version",FORMAT:"Format",FORWARD:"Forward",FORWARD_TO_ADDRESS:"Forward to Address",FORWARD_TO_PHONE:"Forward to Phone",FORWARD_TO_RESOURCE:"Forward to Resource",FROM:"From",FROM_PHONE_NUMBER:"From Phone Number",GATHER_INPUT:"Gather Input",GENDER:"Gender",GO_BACK:"Go Back",HANDLE_CALL:"Handle Call",HANG_UP:"Hang Up",HANG_UP_CALL:"Hang Up Call",HELP:"Help",HIDDEN:"Hidden",IGNORE:"Ignore",INFO_DEPLOY:"Deploy the latest changes for the current call flow.",INFO_INVALID_SETTINGS:"Please check the settings and ensure that all required fields are filled in correctly.",INFO_NODE_AI_AGENT:"<p>Used to connect to a conversational AI Agent for processing.</p><p>Choose the appropriate AI Agent or create a new one: <a>AI Agents</a></p>",INFO_NODE_COND:`<p>A condition works like a JavaScript <code>if</code> statement.</p><p>A condition field can reference variables that have been set in the flow with <code>%{Key}</code>, Request node responses accessed with <code>%{request_response['object_field']}</code>, or call parameters such as <code>%{call.from}</code>.</p><p>Add additional conditions to create <code>else if</code> conditions.</p><p>The "Cond #" path will be executed for a truthy condition. The "Else" path will be executed for a falsy condition.</p>`,INFO_NODE_CONDREQUEST:"<p>Send a GET, POST, PUT, or DELETE request to any webhook.</p><p>This can be used to submit variables and information about an inbound call to an external server, or you can retrieve information from external servers and use them as variables throughout the call flow. You can also build conditions directly into this module.</p><p>Response variables can be accessed with <code>%{request_response['object_field']}</code>.</p><p>Headers should be input in JSON format. Valid header values are <code>Accept</code>, <code>Authorization</code>, <code>Content-Type</code>, <code>Range</code>, and <code>custom X- headers</code>.</p>",INFO_NODE_EXECUTE_SWML:"Execute a remote SWML document and return to the current document. Use <code>%{return_value.['object_field']}</code> to reference the return values from the external SWML.",INFO_NODE_FORWARD_TO_ADDRESS:"Forwards the current call to the specified Address as defined within your SignalWire space.",INFO_NODE_FORWARD_TO_PHONE:"Forwards the current call to the specified phone number (must be E.164 format).",INFO_NODE_FORWARD_TO_RESOURCE:"Forwards the current call to the specified Resource as defined within your SignalWire space.",INFO_NODE_GATHER_INPUT:"Plays an audio file or Text to Speech phrase and waits for a keypress or spoken input from the caller, allowing them to proceed through the call flow based on their input.",INFO_NODE_HANG_UP:"Ends the call with the ability to provide a reason (hangup, busy, or decline).",INFO_NODE_PLAY:"Plays an audio file or Text to Speech phrase. A valid URL must be provided for the audio file to be played. Text to Speech will read aloud the provided text using the voice option that is selected.",INFO_NODE_RECORD:"Triggers foreground recording of both sides of the call and waits for the recording to end. Options can be set to enable stereo audio, play a notification beep before recording, set a digit to stop recording (terminator), and specify the recording name and format (WAV or MP3).",INFO_NODE_RECORD_CALL_START:"Triggers background recording of both sides of the call. Options can be set to enable stereo audio, play a notification beep before recording, set a digit to stop recording (terminator), and specify the recording name and format (WAV or MP3).",INFO_NODE_RECORD_CALL_STOP:"Triggers a background call recording to stop at a specific point in the call flow, if it has not already been terminated.",INFO_NODE_REQUEST:"<p>Send a GET, POST, PUT, or DELETE request to any webhook.</p><p>This can be used to submit variables and information about an inbound call to an external server, or you can retrieve information from external servers and use them as variables throughout the call flow. You can also build conditions directly into this module.</p><p>Response variables can be accessed with <code>%{request_response['object_field']}</code>.</p><p>Headers should be input in JSON format. Valid header values are <code>Accept</code>, <code>Authorization</code>, <code>Content-Type</code>, <code>Range</code>, and <code>custom X- headers</code>.</p>",INFO_NODE_SEND_SMS:"Sends an SMS message to the specified phone number. The 'From' phone number must be enabled for messaging (a 10DLC number assigned to an active TCR campaign or a verified toll free number).",INFO_NODE_SET_VARIABLES:`<p>Set variables that can be accessed from other node blocks in the call flow.</p><p>The value can be a static value <code>("value")</code>, a variable from another node such as a request response <code>%{request_response.['object_field']}</code>, or a call parameter <code>%{call.from}</code>.</p><p>Access these variables in other blocks with <code>%{Key}</code> and unset variables with the Unset Variables block.</p>`,INFO_NODE_UNSET_VARIABLES:"Unsets script variables.",INFO_NOT_CONNECTED_TO_FLOW:"This node is not connected to the flow and will not be executed during the call. Please connect the node to the flow if you wish to use it.",INFO_STATUS_ERROR:"An error occurred while loading or saving the flow.",INFO_STATUS_ERROR_OUT_OF_SYNC:"This document is locked because another user has made updates to the Call Flow. Refresh the page to discard your changes and unlock the flow with the latest updates.",INITIAL_TIMEOUT:"Initial Timeout",INPUT:"Input",INVALID_SETTINGS:"Invalid settings",JSON_OBJECT:"JSON object to serialize",KEY:"Key",KEYPAD_VALUE:"Keypad value",LANGUAGE:"Language",MALE:"Male",MAXIMUM_RECORDING_LENGTH:"Maximum Recording Length",META:"Meta",METHOD:"Method",MORE_INFO_DEPLOY:"Deploying a Call Flow makes it live.",MORE_INFO_DEPLOY_ERROR:"There was an error deploying the Call Flow. Please try again. {{message}}",MORE_INFO_STATUS_ERROR:"More info on Flow document error",MORE_INFO_TESTING_YOUR_FLOW:"Info on testing your call flow",MORE_INFO_TITLE:"More info {{title}}",MORE_WITH_COUNT:"{{count}} more",NAVIGATE_BACK:"Navigate Back",NO_ANSWER:"No Answer",NO_DEPLOYED_VERSIONS:"<p>No deployed versions found.</p> <p>Deploy a flow to view the history.</p>",NO_INPUT:"No Input",NO_VARIABLES_SET:"Please set variables first",NOT_CONNECTED_TO_FLOW:"Not connected to flow",NUMBER_OF_VALIDATION_WARNINGS_one:"There is {{count}} validation warning in your flow",NUMBER_OF_VALIDATION_WARNINGS_other:"There are {{count}} validation warnings in your flow",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_CALLER_SAYS:"or says",OR_SAYS:"Or says",PARAMS:"Params",PHONE_NUMBER:"Phone Number",PHONE_NUMBER_NUMBER:"Phone Number {{index}}",PKG_VERSION:"Package Version",PLAY_AUDIO:"Play Audio",PLAY_AUDIO_FILE:"Play Audio File",PLAY_AUDIO_TTS:"Play Audio or TTS",PREVIEW_DEPLOYED_VERSION:"You are previewing this version.",REASON:"Reason",RECORD:"Record",RECORD_CALL_START:"Start Call Recording",RECORD_CALL_STOP:"Stop Call Recording",RECORDING:"Recording",RECORDING_NAME:"Recording Name",RECORDING_NAME_DEFAULT:"Recording {{index}}",REMOVE_ADDRESS:"Remove Address {{index}}",REMOVE_CONDITION:"Remove Condition {{index}}",REMOVE_EDGE:"Remove Edge",REMOVE_NODE:"Remove Node {{title}}",REMOVE_OPTION:"Remove Option {{index}}",REMOVE_PHONE_NUMBER:"Remove Phone Number {{index}}",REMOVE_RESOURCE:"Remove Resource {{index}}",REMOVE_VARIABLE:"Remove Variable {{index}}",REQUEST:"Request",REQUEST_BODY:"Body",REQUEST_HEADERS:"Headers (JSON)",REQUIRED_SETTINGS:"Required Settings",RESOURCE_NUMBER:"Resource {{index}}",RESTORE:"Restore",RESTORE_THIS_VERSION:"Restore this version",RESYNC:"Resync",RESYNC_AI_AGENTS:"Resync AI Agents",SAVED:"Saved",SAVE_VARIABLES:"Save Variables",SAVE_VARIABLES_SUBTITLE:"Store the response as variables",SECONDS:"Seconds",SELECT:"Select",SELECT_VARIABLES:"Select Variables",SELECT_VARIABLES_TO_UNSET:"Select Variables to Unset",SEND_SMS:"Send SMS",SEPARATE_WITH_COMMAS:"Separate with commas",SEQUENTIALLY:"Sequentially",SET_VARIABLES:"Set Variables",SIMULTANEOUSLY:"Simultaneously",SMS_TEXT:"SMS Text",SPOKEN_PROMPT:"Spoken prompt",STATUS_DEPLOY:"Deploy",STATUS_DEPLOY_ERROR:"Deploy Error",STATUS_DEPLOYED:"Deployed",STATUS_DEPLOYING:"Deploying...",STATUS_ERROR:"Error",STATUS_LOADING:"Loading...",STATUS_LOCKED:"Locked",STATUS_SAVED:"Saved",STATUS_SAVING:"Saving...",STEREO:"Stereo",STEREO_SUBTITLE:"Enable stereo audio",STRING_OR_JSON:"String or JSON to serialize",SUCCESS:"Success",SWML_VERSION:"SWML Version",TERMINATORS:"Terminators",TEXT:"Text",TEXT_TO_SPEECH:"Text to Speech",TIMEOUT:"Timeout",TO:"To",TO_PHONE_NUMBER:"To Phone Number",TOAST_DEPLOY_WARNING:'<p>There are inconsistencies in your Call Flow which may cause unexpected behavior. Please review the Call Flow before deploying.</p><p>Choose "Deploy" to deploy the Call Flow or "Cancel" to return to editing.</p>',TOAST_DOCUMENT_OUT_OF_SYNC:'<p>Updates have been made to this Call Flow by another user and your recent changes have not been saved.</p><p>Choose "Ignore" to view your changes in a locked state or "Resync" to abandon your changes and adopt the latest updates.</p>',UNKNOWN:"Unknown",UNSET_VARIABLES:"Unset Variables",URL:"URL",VALUE:"Value",VARIABLE_KEY:"Variable {{key}}",VARIABLE_NUMBER:"Variable {{index}}",VERSION_HISTORY:"Version History",VERSION_LIST_ITEM:"Version {{number}}",VERSION_RESTORED:"Version restored",VOICE:"Voice",VOICEMAIL_RECORDING:"Voicemail Recording",WAIT_FOR_DIGIT:"Wait for Digit",WAIT_FOR_INPUT:"Wait for Input",WARNING:"Warning",WRITE_SOMETHING:"Write something"},N={ABOUT:"ABOUT",ACTION:"ACTION",ADDRESS_NUMBER:"ADDRESS_NUMBER",ADD_ADDRESS:"ADD_ADDRESS",ADD_AI_AGENT:"ADD_AI_AGENT",ADD_CONDITION:"ADD_CONDITION",ADD_OPTION:"ADD_OPTION",ADD_PHONE_NUMBER:"ADD_PHONE_NUMBER",ADD_RESOURCE:"ADD_RESOURCE",ADD_VARIABLE:"ADD_VARIABLE",AI_AGENT:"AI_AGENT",AI_AGENT_NAME:"AI_AGENT_NAME",ANSWER_CALL:"ANSWER_CALL",API_VERSION:"API_VERSION",ARE_YOU_SURE:"ARE_YOU_SURE",AUDIO_FILE:"AUDIO_FILE",BEEP:"BEEP",BEEP_SUBTITLE:"BEEP_SUBTITLE",BUSY:"BUSY",CALLER_PRESSES:"CALLER_PRESSES",CALLER_SAYS:"CALLER_SAYS",CALL_ADDRESSES:"CALL_ADDRESSES",CALL_NUMBERS:"CALL_NUMBERS",CALL_RESOURCES:"CALL_RESOURCES",CALL_STATE_EVENTS:"CALL_STATE_EVENTS",CALL_STATE_URL:"CALL_STATE_URL",CANCEL:"CANCEL",CAUTION:"CAUTION",CHOOSE_OPTION_SINGLE_MULTIPLE:"CHOOSE_OPTION_SINGLE_MULTIPLE",CHOOSE_OPTION_TTS_AUDIO:"CHOOSE_OPTION_TTS_AUDIO",CLOSE:"CLOSE",CONDITIONS:"CONDITIONS",CONDITION_NUMBER:"CONDITION_NUMBER",COND_NUMBER:"COND_NUMBER",CONFIRMATION_REMOVE_OPTION:"CONFIRMATION_REMOVE_OPTION",CONFIRMATION_REMOVE_VARIABLE:"CONFIRMATION_REMOVE_VARIABLE",DECISION:"DECISION",DECLINE:"DECLINE",DEFAULT_FROM:"DEFAULT_FROM",DEFAULT_TIMEOUT:"DEFAULT_TIMEOUT",DELETE:"DELETE",DELETE_NODE:"DELETE_NODE",DEPLOY:"DEPLOY",DEPLOY_WARNING:"DEPLOY_WARNING",DEPRECATED:"DEPRECATED",DISCONNECT_CALL_AFTER_RINGING:"DISCONNECT_CALL_AFTER_RINGING",DOCUMENT_OUT_OF_SYNC:"DOCUMENT_OUT_OF_SYNC",EDIT_SELECTED_AI_AGENT:"EDIT_SELECTED_AI_AGENT",ELSE:"ELSE",END_SILENCE_TIMEOUT:"END_SILENCE_TIMEOUT",ENTER_URL:"ENTER_URL",ERROR:"ERROR",ERROR_ADD_AI_AGENT_FIRST:"ERROR_ADD_AI_AGENT_FIRST",ERROR_ADD_RECORDING_FIRST:"ERROR_ADD_RECORDING_FIRST",ERROR_DUPLICATE_COMMAND:"ERROR_DUPLICATE_COMMAND",ERROR_DUPLICATE_RECORDING_LABEL:"ERROR_DUPLICATE_RECORDING_LABEL",ERROR_DUPLICATE_TELEPHONE_KEY:"ERROR_DUPLICATE_TELEPHONE_KEY",ERROR_DUPLICATE_VARIABLE_KEY:"ERROR_DUPLICATE_VARIABLE_KEY",ERROR_FETCHING_AI_AGENTS:"ERROR_FETCHING_AI_AGENTS",ERROR_FETCHING_DEPLOYED_VERSIONS:"ERROR_FETCHING_DEPLOYED_VERSIONS",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_SELECTION_REQUIRED:"ERROR_SELECTION_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",EXECUTE_SWML:"EXECUTE_SWML",FAILED:"FAILED",FAILURE:"FAILURE",FEMALE:"FEMALE",FLOW_DATA_VERSION:"FLOW_DATA_VERSION",FORMAT:"FORMAT",FORWARD:"FORWARD",FORWARD_TO_ADDRESS:"FORWARD_TO_ADDRESS",FORWARD_TO_PHONE:"FORWARD_TO_PHONE",FORWARD_TO_RESOURCE:"FORWARD_TO_RESOURCE",FROM:"FROM",FROM_PHONE_NUMBER:"FROM_PHONE_NUMBER",GATHER_INPUT:"GATHER_INPUT",GENDER:"GENDER",GO_BACK:"GO_BACK",HANDLE_CALL:"HANDLE_CALL",HANG_UP:"HANG_UP",HANG_UP_CALL:"HANG_UP_CALL",HELP:"HELP",HIDDEN:"HIDDEN",IGNORE:"IGNORE",INFO_DEPLOY:"INFO_DEPLOY",INFO_INVALID_SETTINGS:"INFO_INVALID_SETTINGS",INFO_NODE_AI_AGENT:"INFO_NODE_AI_AGENT",INFO_NODE_COND:"INFO_NODE_COND",INFO_NODE_CONDREQUEST:"INFO_NODE_CONDREQUEST",INFO_NODE_EXECUTE_SWML:"INFO_NODE_EXECUTE_SWML",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_PLAY:"INFO_NODE_PLAY",INFO_NODE_RECORD:"INFO_NODE_RECORD",INFO_NODE_RECORD_CALL_START:"INFO_NODE_RECORD_CALL_START",INFO_NODE_RECORD_CALL_STOP:"INFO_NODE_RECORD_CALL_STOP",INFO_NODE_REQUEST:"INFO_NODE_REQUEST",INFO_NODE_SEND_SMS:"INFO_NODE_SEND_SMS",INFO_NODE_SET_VARIABLES:"INFO_NODE_SET_VARIABLES",INFO_NODE_UNSET_VARIABLES:"INFO_NODE_UNSET_VARIABLES",INFO_NOT_CONNECTED_TO_FLOW:"INFO_NOT_CONNECTED_TO_FLOW",INFO_STATUS_ERROR:"INFO_STATUS_ERROR",INFO_STATUS_ERROR_OUT_OF_SYNC:"INFO_STATUS_ERROR_OUT_OF_SYNC",INITIAL_TIMEOUT:"INITIAL_TIMEOUT",INPUT:"INPUT",INVALID_SETTINGS:"INVALID_SETTINGS",JSON_OBJECT:"JSON_OBJECT",KEY:"KEY",KEYPAD_VALUE:"KEYPAD_VALUE",LANGUAGE:"LANGUAGE",MALE:"MALE",MAXIMUM_RECORDING_LENGTH:"MAXIMUM_RECORDING_LENGTH",META:"META",METHOD:"METHOD",MORE_INFO_DEPLOY:"MORE_INFO_DEPLOY",MORE_INFO_DEPLOY_ERROR:"MORE_INFO_DEPLOY_ERROR",MORE_INFO_STATUS_ERROR:"MORE_INFO_STATUS_ERROR",MORE_INFO_TESTING_YOUR_FLOW:"MORE_INFO_TESTING_YOUR_FLOW",MORE_INFO_TITLE:"MORE_INFO_TITLE",MORE_WITH_COUNT:"MORE_WITH_COUNT",NAVIGATE_BACK:"NAVIGATE_BACK",NOT_CONNECTED_TO_FLOW:"NOT_CONNECTED_TO_FLOW",NO_ANSWER:"NO_ANSWER",NO_DEPLOYED_VERSIONS:"NO_DEPLOYED_VERSIONS",NO_INPUT:"NO_INPUT",NO_VARIABLES_SET:"NO_VARIABLES_SET",NUMBER_OF_VALIDATION_WARNINGS:"NUMBER_OF_VALIDATION_WARNINGS",NUMBER_OF_VARIABLES_SELECTED:"NUMBER_OF_VARIABLES_SELECTED",OFF:"OFF",ON:"ON",OPTIONAL:"OPTIONAL",OPTION_NUMBER:"OPTION_NUMBER",OPT_NUMBER:"OPTION_NUMBER",OR_CALLER_SAYS:"OR_CALLER_SAYS",OR_SAYS:"OR_SAYS",PARAMS:"PARAMS",PHONE_NUMBER:"PHONE_NUMBER",PHONE_NUMBER_NUMBER:"PHONE_NUMBER_NUMBER",PKG_VERSION:"PKG_VERSION",PLAY_AUDIO:"PLAY_AUDIO",PLAY_AUDIO_FILE:"PLAY_AUDIO_FILE",PLAY_AUDIO_TTS:"PLAY_AUDIO_TTS",PREVIEW_DEPLOYED_VERSION:"PREVIEW_DEPLOYED_VERSION",REASON:"REASON",RECORD:"RECORD",RECORDING:"RECORDING",RECORDING_NAME:"RECORDING_NAME",RECORDING_NAME_DEFAULT:"RECORDING_NAME_DEFAULT",RECORD_CALL_START:"RECORD_CALL_START",RECORD_CALL_STOP:"RECORD_CALL_STOP",REMOVE_ADDRESS:"REMOVE_ADDRESS",REMOVE_CONDITION:"REMOVE_CONDITION",REMOVE_EDGE:"REMOVE_EDGE",REMOVE_NODE:"REMOVE_NODE",REMOVE_OPTION:"REMOVE_OPTION",REMOVE_PHONE_NUMBER:"REMOVE_PHONE_NUMBER",REMOVE_RESOURCE:"REMOVE_RESOURCE",REMOVE_VARIABLE:"REMOVE_VARIABLE",REQUEST:"REQUEST",REQUEST_BODY:"REQUEST_BODY",REQUEST_HEADERS:"REQUEST_HEADERS",RESOURCE_NUMBER:"RESOURCE_NUMBER",RESTORE:"RESTORE",RESTORE_THIS_VERSION:"RESTORE_THIS_VERSION",RESYNC:"RESYNC",RESYNC_AI_AGENTS:"RESYNC_AI_AGENTS",SAVED:"SAVED",SAVE_VARIABLES:"SAVE_VARIABLES",SAVE_VARIABLES_SUBTITLE:"SAVE_VARIABLES_SUBTITLE",SECONDS:"SECONDS",SELECT:"SELECT",SELECT_VARIABLES:"SELECT_VARIABLES",SELECT_VARIABLES_TO_UNSET:"SELECT_VARIABLES_TO_UNSET",SEND_SMS:"SEND_SMS",SEPARATE_WITH_COMMAS:"SEPARATE_WITH_COMMAS",SEQUENTIALLY:"SEQUENTIALLY",SET_VARIABLES:"SET_VARIABLES",SIMULTANEOUSLY:"SIMULTANEOUSLY",SMS_TEXT:"SMS_TEXT",SPOKEN_PROMPT:"SPOKEN_PROMPT",STATUS_DEPLOY:"STATUS_DEPLOY",STATUS_DEPLOYED:"STATUS_DEPLOYED",STATUS_DEPLOYING:"STATUS_DEPLOYING",STATUS_DEPLOY_ERROR:"STATUS_DEPLOY_ERROR",STATUS_ERROR:"STATUS_ERROR",STATUS_LOADING:"STATUS_LOADING",STATUS_LOCKED:"STATUS_LOCKED",STATUS_SAVED:"STATUS_SAVED",STATUS_SAVING:"STATUS_SAVING",STEREO:"STEREO",STEREO_SUBTITLE:"STEREO_SUBTITLE",STRING_OR_JSON:"STRING_OR_JSON",SUCCESS:"SUCCESS",SWML_VERSION:"SWML_VERSION",TERMINATORS:"TERMINATORS",TEXT:"TEXT",TEXT_TO_SPEECH:"TEXT_TO_SPEECH",TIMEOUT:"TIMEOUT",TO:"TO",TOAST_DEPLOY_WARNING:"TOAST_DEPLOY_WARNING",TOAST_DOCUMENT_OUT_OF_SYNC:"TOAST_DOCUMENT_OUT_OF_SYNC",TO_PHONE_NUMBER:"TO_PHONE_NUMBER",UNKNOWN:"UNKNOWN",UNSET_VARIABLES:"UNSET_VARIABLES",URL:"URL",VALUE:"VALUE",VARIABLE_KEY:"VARIABLE_KEY",VARIABLE_NUMBER:"VARIABLE_NUMBER",VERSION_HISTORY:"VERSION_HISTORY",VERSION_LIST_ITEM:"VERSION_LIST_ITEM",VERSION_RESTORED:"VERSION_RESTORED",VOICE:"VOICE",VOICEMAIL_RECORDING:"VOICEMAIL_RECORDING",WAIT_FOR_DIGIT:"WAIT_FOR_DIGIT",WAIT_FOR_INPUT:"WAIT_FOR_INPUT",WARNING:"WARNING",WRITE_SOMETHING:"WRITE_SOMETHING"},mC={order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag","path","subdomain"],lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupQuerystring:"lng",lookupSessionStorage:"i18nextLng",caches:["localStorage","cookie"],excludeCacheFor:["cimode"]},EC={"en-US":{translation:gC}},vC=async()=>{await Le.use(Ay).use(hb).init({debug:MA,detection:mC,fallbackLng:"en-US",interpolation:{escapeValue:!1},keySeparator:!1,resources:EC})};function T(e,t){return t?Le.t(e,t):Le.t(e)}function $l(e,t={}){return u.jsx(Xb,{label:e,vars:t})}const C0=()=>Le.resolvedLanguage,yC={entries:[],nextLabelIndex:0},Go=us((e,t)=>({...yC,actions:{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="",r=t().nextLabelIndex;do r++,n=T(N.RECORDING_NAME_DEFAULT,{index:r});while(this.isValueDuplicate(n));return e({nextLabelIndex:r}),n},isKeyDuplicate(n){return t().entries.some(r=>r.controlId===n)},isValueDuplicate(n,r){const o=n.trim();return!!t().entries.reduce((s,a)=>{const{label:l,controlId:c}=a;return l!==""&&l===o&&(!r||c!==r)?[...s,a]:s},[]).length},removeEntry(n){e(r=>({entries:r.entries.filter(o=>o.controlId!==n)}))},upsertEntry:n=>{const{actions:r}=t(),{isKeyDuplicate:o}=r;e(i=>{let s=[...i.entries];const a=n.label.trim(),l=!!a;return(o(n.controlId)||!l)&&(s=s.filter(c=>c.controlId!==n.controlId)),l&&s.push({...n,label:a}),{entries:s}})}}})),kf=()=>Go.getState().actions,L0=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})}),Go.setState({entries:t,nextLabelIndex:t.length})},_C=(e,t)=>{const n=[];return t.forEach(r=>{r.type==="recordCallStart"&&r.data.controlId&&(n.push(r.data.controlId),Go.getState().actions.removeEntry(r.data.controlId))}),n.length?e.reduce((r,o)=>o.type==="recordCallStop"&&n.includes(o.data.controlId)?[...r,{...o,data:{...o.data,controlId:""}}]:r,[]):[]},D0={recordCallStart:e=>{const t=Go.getState().actions.getGeneratedLabel();return Go.getState().actions.upsertEntry({controlId:e.data.controlId,label:t}),{...e,data:{...e.data,label:t}}}},SC=e=>typeof e=="object"&&e!==null&&Object.keys(e).length>0,xC=e=>D0[e.type]!==void 0,k0=(e,t={})=>{const{deletable:n=!0,position:r={x:300,y:250},selected:o=!0}=t,i=()=>({data:{initial:!0,valid:!1},deletable:n,id:ie(),position:r,selected:o,type:e}),s=(c,d)=>({...c,data:{...c.data,...d}});let a=i();const l=Jv[e]();return SC(l)&&(a=s(a,l)),xC(a)&&(a=D0[a.type](a)),a},Bl={action:{label:N.ACTION,nodes:{answer:{active:!0,label:N.ANSWER_CALL},hangup:{active:!0,infoLabel:N.INFO_NODE_HANG_UP,label:N.HANG_UP_CALL},play:{active:!0,infoLabel:N.INFO_NODE_PLAY,label:N.PLAY_AUDIO_TTS},sendSms:{active:!0,infoLabel:N.INFO_NODE_SEND_SMS,label:N.SEND_SMS}}},decision:{label:N.DECISION,nodes:{cond:{active:!0,infoLabel:N.INFO_NODE_COND,label:N.CONDITIONS},executeSWML:{active:!0,infoLabel:N.INFO_NODE_EXECUTE_SWML,label:N.EXECUTE_SWML},set:{active:!0,infoLabel:N.INFO_NODE_SET_VARIABLES,label:N.SET_VARIABLES},unset:{active:!0,infoLabel:N.INFO_NODE_UNSET_VARIABLES,label:N.UNSET_VARIABLES}}},forwardTo:{label:N.FORWARD,nodes:{forwardAddress:{active:!1,infoLabel:N.INFO_NODE_FORWARD_TO_ADDRESS,label:N.FORWARD_TO_ADDRESS},forwardPhone:{active:!0,infoLabel:N.INFO_NODE_FORWARD_TO_PHONE,label:N.FORWARD_TO_PHONE},forwardResource:{active:!1,infoLabel:N.INFO_NODE_FORWARD_TO_RESOURCE,label:N.FORWARD_TO_RESOURCE}}},hidden:{label:N.HIDDEN,nodes:{handleCall:{active:!0,label:N.HANDLE_CALL}}},input:{label:N.INPUT,nodes:{aiAgent:{active:!0,infoLabel:N.INFO_NODE_AI_AGENT,label:N.AI_AGENT},condRequest:{active:!0,infoLabel:N.INFO_NODE_CONDREQUEST,label:N.REQUEST},promptPlay:{active:!0,infoLabel:N.INFO_NODE_GATHER_INPUT,label:N.GATHER_INPUT},request:{active:!1,deprecated:!0,infoLabel:N.INFO_NODE_REQUEST,label:N.REQUEST}}},recording:{label:N.RECORD,nodes:{record:{active:!0,infoLabel:N.INFO_NODE_RECORD,label:N.VOICEMAIL_RECORDING},recordCallStart:{active:!0,infoLabel:N.INFO_NODE_RECORD_CALL_START,label:N.RECORD_CALL_START},recordCallStop:{active:!0,infoLabel:N.INFO_NODE_RECORD_CALL_STOP,label:N.RECORD_CALL_STOP}}}},RC=Object.entries(Bl).reduce((e,[,{nodes:t}])=>(Object.entries(t).forEach(([n,{label:r}])=>{e.set(n,r)}),e),new Map),NC=Object.entries(Bl).reduce((e,[,{nodes:t}])=>(Object.entries(t).forEach(([n,{infoLabel:r}])=>{e.set(n,r)}),e),new Map),Hl=Ie(),wC={aiAgentMap:new Map,error:"",status:"initial"},OC=(e,t)=>({...wC,actions:{fetchAiAgents:async()=>{try{const{actions:n}=t(),{getAiAgents:r}=n;if(!r){Hl.error("getAiAgents is not defined");return}e({status:"loading"});const o=await r(),i=qA(o.data,"asc","display_name"),s=new Map(i.map(a=>[a.id,a]));e({aiAgentMap:s,error:"",status:"loaded"})}catch(n){let r="Unknown error";Hl.error("Error fetching aiAgents ",n),n instanceof Error&&(r=n.message),e({aiAgentMap:new Map,error:r,status:"error"})}},init:({getAiAgentsURL:n})=>{if(!n){Hl.error("getAiAgentsURL is not defined");return}const r=gp({getAiAgentsURL:n,headers:Gv()}),o=async()=>await r.getAiAgents();e(i=>({...i,actions:{...i.actions,getAiAgents:o}}))}}}),P0=(e,t)=>{if(e.find(r=>r.type==="aiAgent")){const{fetchAiAgents:r}=un.getState().actions;r().then(()=>{const{aiAgentMap:o,status:i}=un.getState();i==="loaded"&&e.forEach(s=>{if(s.data&&"agent"in s.data){const a=o.has(s.data.agent);a||t(s.id,{agent:a?s.data.agent:"",valid:a})}})}).catch(o=>Hl.error("Error rehydrating AiAgentStore",o))}},un=us()(OC),TC=()=>un.getState().actions;window.__useAiAgentStore=un;const AC=e=>!!(e&&e>=VA),IC=e=>(t,n,r)=>(r.setState=(o,i,...s)=>{const{edges:a,detachedMode:l,httpError:c,initializing:d,isCanvasInteractive:f,isInteractiveControlOn:p,nodes:h,rootAppWidth:E,viewportChanging:v}=n(),y=typeof o=="function"?o(n()):o,g=["detachedMode","httpError","initializing","isInteractiveControlOn","rootAppWidth","viewportChanging"],m="initializing"in y?y.initializing:d;if(g.some(_=>_ in y)){const _=AC("rootAppWidth"in y?y.rootAppWidth:E),S="isInteractiveControlOn"in y?y.isInteractiveControlOn:p,x="detachedMode"in y?y.detachedMode:l,R=("httpError"in y?y.httpError:c)===Wv,I="viewportChanging"in y?y.viewportChanging:v;if(y.isCanvasInteractive=!!(_&&S&&!x&&!m&&!R&&!I),y.showInteractiveControl=_&&!R&&!x,f&&!y.isCanvasInteractive){const L="nodes"in y?y.nodes:h;y.nodes=L.map(A=>({...A,selected:!1}));const U="edges"in y?y.edges:a;y.edges=U.map(A=>({...A,selected:!1})),y.selectedNode=void 0}}t(y,i,...s)},e(r.setState,n,r)),M0=1e3,Rs=Ie(),bC=e=>(t,n,r)=>{let o,i;const s=async()=>{const{httpService:a,nodes:l,edges:c,documentVersion:d}=n();t({dataHandlingStatus:"saving",saveFlowStatus:"saving"}),clearTimeout(i);try{if(!a)throw new Error("Missing httpService");const f=await a.putFlow({documentVersion:d,edges:c,flowDataVersion:ds,nodes:l}),p={documentLastUpdated:f.updated_at,documentVersion:f.document_version},h=n().dataHandlingStatus;switch(h){case"saving":t({...p,dataHandlingStatus:"queueing",deployFlowStatus:"deploy",saveFlowStatus:"saved"});break;case"holding":t({...p,saveFlowStatus:"awaiting-save"}),Rs.debug("Setting up a new save for held changes"),i=setTimeout(()=>{s().catch(E=>{Rs.error("Error Save Flow",E)})},M0);break;default:Rs.debug("Invalid dataHandlingStatus",h)}}catch(f){Rs.error("Put Flow",f),f instanceof Error&&f.message.includes($A)?t({dataHandlingStatus:"holding",httpError:"document-sync",saveFlowStatus:"error"}):t({dataHandlingStatus:"queueing",saveFlowStatus:"error"})}};return r.setState=(a,l,...c)=>{const{dataHandlingStatus:d,detachedMode:f,initializing:p,saveFlowStatus:h}=n(),E=typeof a=="function"?a(n()):a,v="initializing"in E?E.initializing:p,y="detachedMode"in E?E.detachedMode:f;!v&&!y&&(E.nodes||E.edges)?d==="queueing"?(E.saveFlowStatus="awaiting-save",t(E,l,...c),clearTimeout(o),o=setTimeout(()=>{s().catch(m=>{Rs.error("Error Save Flow",m)})},M0)):(E.dataHandlingStatus="holding",t(E,l,...c)):"initializing"in E&&!E.initializing?(E.dataHandlingStatus="queueing",h!=="error"&&(E.saveFlowStatus="saved"),t(E,l,...c)):t(E,l,...c)},e(r.setState,n,r)},j0=500,CC=100,Ne=Ie(),LC=k0("handleCall",{deletable:!1,position:{x:300,y:100}}),Pf={backButtonHref:void 0,colorMode:"light",dataHandlingStatus:"queueing",deployFlowStatus:"deploy",deployFlowURL:"",deployedVersionsList:[],detachedMode:!1,documentLastUpdated:void 0,documentVersion:0,dragNodeType:void 0,edges:[],flowId:"",flowTitle:"",flowWrapperElement:void 0,getFlowURL:"",httpError:void 0,httpService:void 0,initializing:!0,isCanvasInteractive:!1,isDraggingNode:!1,isEdgeConnecting:!1,isEdgeUpdateSuccessful:!1,isInteractiveControlOn:!0,nodes:[],reactFlowInstance:void 0,rootAppHeight:void 0,rootAppWidth:void 0,rootElement:void 0,rootElementId:"",saveFlowStatus:"initial",selectedNode:void 0,showDeployWarning:!1,showDeployedHistory:!1,showDeployedHistoryToast:!1,showInteractiveControl:!0,showValidationWarnings:!1,toastsMap:new Map,updateFlowURL:"",updatingSourceHandleId:void 0,validationWarnings:new Map,viewport:{x:0,y:0,zoom:1},viewportChanging:!1,workingFlowCopy:void 0},DC=(e,t)=>({...Pf,actions:{addNode:({nodeType:n,x:r=150,y:o=150})=>{Ne.debug("Add Node",n);const{nodes:i,reactFlowInstance:s}=t();if(!s)throw new Error("ReactFlowInstance not found");const a=k0(n,{position:s.project({x:r,y:o})}),l=i.map(c=>({...c,selected:!1}));l.push(a),e({nodes:l,selectedNode:a})},addToast:n=>{const{toastsMap:r}=t(),o=ie();r.set(o,{...n,id:o}),e({toastsMap:new Map(r)})},cancelDetachedMode:async()=>{const{actions:n,workingFlowCopy:r}=t(),{cleanUpDetachedMode:o}=n;if(r){const{edges:i,nodes:s,saveFlowStatus:a}=r;e({edges:[],initializing:!0,nodes:[]}),await qv(j0),e({edges:i,nodes:s,saveFlowStatus:a})}else Ne.error("There was no working flow to restore");o()},cleanUpDetachedMode:()=>{e({detachedMode:!1,showDeployedHistory:!1,showDeployedHistoryToast:!1,workingFlowCopy:void 0})},deleteToast:n=>{const{toastsMap:r}=t();r.delete(n)&&e({toastsMap:new Map(r)})},deleteValidationWarning:n=>{const{validationWarnings:r}=t();r.delete(n)&&e({validationWarnings:new Map(r)})},deployFlow:async()=>{Ne.info("Deploying..."),e({deployFlowStatus:"deploying"});try{const{httpService:n,documentVersion:r}=t();if(!n)throw new Error("Missing httpService");const o=await n.deployFlow({documentVersion:r});Ne.info("Deploy response",o),e({deployFlowStatus:"deployed"})}catch(n){throw Ne.info("Deploy error",n),e({deployFlowStatus:"error"}),n}},exportStoreData:()=>{const{nodes:n,edges:r}=t();QA(n,r)},getDeployedVersionsList:async n=>{try{const{httpService:r}=t();if(!r)throw new Error("Missing httpService");const o=await r.getFlowVersions(n),i=Xv(C0());return e({deployedVersionsList:o.map((s,a)=>({id:s.id,relativeTimeSince:i(s.created_at),version:(o.length-a).toFixed(1)}))}),o}catch(r){throw Ne.error("Could not get deployed versions",r),e({deployedVersionsList:[]}),r}},getNodeType:n=>{const r=t().nodes.find(o=>o.id===n);return r==null?void 0:r.type},getRootElement:()=>{const{rootElement:n,rootElementId:r}=t();if(!n)throw new Error(`Root element not found for ID ${r}`);return n.shadowRoot?n.shadowRoot.getRootNode():n},getTargetEdges:n=>t().edges.filter(r=>{const o=r.target===n,i=r.source!==r.target;return o&&i}),getValidationWarnings:()=>t().validationWarnings,migrateAndLoadDeployedFlow:async n=>{const{actions:r,workingFlowCopy:o}=t(),{partialUpdateNodeData:i,saveWorkingFlowCopy:s}=r,l=new mp({dbRecord:n}).migrateTo(ds),{flow_data:c}=l;if(!c)Ne.error("Cannot load flow: missing flowData",c);else{o||s();const d=c.nodes.map(Kv),f=c.edges.map(Yv);e({detachedMode:!0,edges:[],initializing:!0,nodes:[]}),await qv(j0),e({edges:f,nodes:d,showDeployedHistoryToast:!0}),L0(d),P0(d,i)}},onConnect:n=>{Ne.debug("onConnect"),e({edges:BE(n,t().edges)})},onConnectEnd:()=>{Ne.debug("onConnectEnd"),e({isEdgeConnecting:!1})},onConnectStart:()=>{Ne.debug("onConnectStart"),e({isEdgeConnecting:!0})},onEdgeUpdate:(n,r)=>{Ne.debug("onEdgeUpdate"),e({edges:zO(n,r,t().edges),isEdgeUpdateSuccessful:!0})},onEdgeUpdateEnd:(n,r)=>{var o;Ne.debug("onEdgeUpdateEnd"),t().isEdgeUpdateSuccessful?e({isEdgeUpdateSuccessful:!0}):(o=t().reactFlowInstance)==null||o.deleteElements({edges:[{id:r.id}]}),e({updatingSourceHandleId:void 0})},onEdgeUpdateStart:(n,r)=>{Ne.debug("onEdgeUpdateStart"),e({isEdgeUpdateSuccessful:!1,updatingSourceHandleId:r.sourceHandle??void 0})},onEdgesChange:n=>{e({edges:xT(n,t().edges)})},onEdgesDelete:n=>{Ne.debug("onEdgesDelete [noop]",n)},onInit:async n=>{const{actions:r,deployFlowURL:o,getFlowURL:i,updateFlowURL:s}=t(),{partialUpdateNodeData:a}=r;Ne.log("onInit",{getFlowURL:i,updateFlowURL:s});try{const l=gp({deployFlowURL:o,getFlowURL:i,headers:Gv(),updateFlowURL:s}),[c,d]=await Promise.all([l.getFlow(),l.getFlowVersions({pageSize:1})]),p=new mp({dbRecord:c}).migrateTo(ds),{document_version:h,flow_data:E,id:v,title:y,updated_at:g}=p;if(d.length&&d[0]){const{document_version:_}=d[0];_===h&&e({deployFlowStatus:"deployed"})}let m=E;m||(m={edges:Pf.edges,flowDataVersion:ds,nodes:Pf.nodes.concat([LC])}),e({documentLastUpdated:g,documentVersion:h,edges:m.edges.map(Yv),flowId:v,flowTitle:y,httpService:l,nodes:m.nodes.map(Kv),reactFlowInstance:n}),L0(m.nodes),P0(m.nodes,a)}catch(l){Ne.error("Could not load flow. URL:",i);let c="unknown";l instanceof Error&&l.message.includes(BA)&&(c="not-found"),e({httpError:c})}},onNodeDragStart:()=>{e({isDraggingNode:!0})},onNodeDragStop:()=>{e({isDraggingNode:!1})},onNodesChange:n=>{const r=n.filter(o=>o.type!=="dimensions");r.length>0&&e({nodes:Ev(r,t().nodes)})},onNodesDelete:n=>{Ne.debug("onNodesDelete");const{actions:r}=t(),{partialUpdateNodeData:o}=r;_C(t().nodes,n).forEach(s=>{o(s.id,s.data)})},onSelectionChange:({nodes:n})=>{e({selectedNode:n.find(r=>r.selected)})},onViewportChange:(()=>{let n;function r(o){n&&clearTimeout(n),n=setTimeout(()=>{e({viewportChanging:!1})},CC),e({viewport:{...o},viewportChanging:!0})}return r})(),onViewportChangeEnd:()=>{},onViewportChangeStart:()=>{},partialUpdateNodeData:(n,r)=>{var s;Ne.debug("partialUpdateNodeData",n,r);const o=[],i=t().nodes.map(a=>{if(a.id===n){if("options"in r&&"options"in a.data){const l=a.data.options.map(d=>d.id),c=r.options.map(d=>d.id);o.push(...l.filter(d=>!c.includes(d)))}return{...a,data:{...a.data,...r}}}return a});if(o.length){const a=t().edges.filter(l=>l.sourceHandle&&o.includes(l.sourceHandle));Ne.debug("Remove orphaned edges",{edgesToDelete:a,sourceHandleDeleted:o}),(s=t().reactFlowInstance)==null||s.deleteElements({edges:a})}e({nodes:i})},partialUpdateValidationWarning:(n,r)=>{const{validationWarnings:o}=t(),i=a=>a.connected===!1||a.valid===!1,s=o.get(n);if(r.nodeType!=="handleCall"&&!s&&i(r)){const a=RC.get(r.nodeType),l={connected:r.connected,id:ie(),nodeId:r.nodeId,nodeTitle:a,nodeType:r.nodeType,valid:r.valid};o.set(n,l)}else if(s){const a={...s,...r};i(a)?o.set(n,a):o.delete(n)}e({validationWarnings:new Map(o)})},removeEdge:n=>{Ne.debug("removeEdge",n);const r=t().reactFlowInstance;r&&r.deleteElements({edges:[{id:n}]})},removeNode:n=>{Ne.debug("removeNode",n);const r=t().reactFlowInstance;r&&r.deleteElements({nodes:[{id:n}]})},restoreDeployedFlow:()=>{const{actions:n,edges:r,nodes:o}=t(),{cleanUpDetachedMode:i}=n;e({detachedMode:!1,edges:r,nodes:o}),i()},saveWorkingFlowCopy:()=>{const{edges:n,nodes:r,saveFlowStatus:o}=t();e({workingFlowCopy:{edges:n,nodes:r,saveFlowStatus:o}})},setColorMode:n=>{e({colorMode:n})},setDragNodeType:n=>{e({dragNodeType:n})},setFlowWrapperElement:n=>{e({flowWrapperElement:n||void 0})},setInitializing:n=>{e({initializing:n})},setSelectedNodes:n=>{const{nodes:r}=t(),o=r.map(i=>({...i,selected:n.includes(i.id)}));e({nodes:o})},setShowDeployWarning:n=>{e({showDeployWarning:n})},setShowDeployedHistory:n=>{e({showDeployedHistory:n})},setShowValidationWarnings:n=>{e({showValidationWarnings:n})},setViewportChanging:n=>{e({viewportChanging:n})}}}),Y=us()(IC(bC(DC))),xe=()=>Y.getState().actions;window.__useRFStore=Y;const kC={"not-found":{message:"Please ensure that the Call Flow exists and the URL is correct.",status:"404",title:"Call Flow not found"},unknown:{message:"An unknown error occurred. Please try again or go back.",status:"",title:"Unknown error"}},PC=({errorType:e})=>{const t=Y(i=>i.backButtonHref),{title:n,message:r,status:o}=kC[e];return u.jsx("section",{className:"flex min-h-full w-full items-center justify-center bg-background px-6",children:u.jsxs("div",{className:"text-center",children:[o&&u.jsx("p",{className:"text-2xl font-semibold text-foreground/50",children:o}),u.jsx("h1",{className:"mt-4 text-3xl font-bold tracking-tight text-foreground",children:n}),u.jsx("p",{className:"mt-6 leading-7 text-foreground",children:r}),t&&u.jsx("div",{className:"mt-8 flex items-center justify-center gap-x-6",children:u.jsx("a",{href:t,className:"rounded-md bg-foreground px-3.5 py-2.5 text-sm font-semibold text-background shadow-sm transition-colors hover:bg-foreground/80 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-foreground",children:T(N.GO_BACK)})})]})})},e4="",U0=({height:e,strokeWidth:t,toX:n,toY:r,width:o})=>u.jsx("svg",{x:n-o*t/2,y:r-e*t/2,height:e*t,width:o*t,viewBox:`-${o/2} -${e/2} ${o} ${e}`,children:u.jsx("g",{children:u.jsx("polyline",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:t,points:"-5,-4 0,0 -5,4 -5,-4"})})}),MC=({fromHandle:e,fromNode:t,fromPosition:n,fromX:r,fromY:o,toPosition:i,toX:s,toY:a})=>{if(!t)return null;const[l]=ss({borderRadius:zv,sourcePosition:n,sourceX:r,sourceY:o,targetPosition:i,targetX:s,targetY:a}),{height:c,strokeWidth:d,width:f}={...Fo.markerEnd,...Fo.style},p=(e==null?void 0:e.position)===K.Left,h=p?r:s,E=p?o:a;return u.jsxs("g",{className:"cfb-connection-line",children:[u.jsx("path",{fill:"none",strokeWidth:d,className:"animated",d:l}),u.jsx(U0,{height:c,strokeWidth:d,toX:h,toY:E,width:f}),p&&u.jsx("circle",{cx:s-2,cy:a,fill:"none",r:4,strokeWidth:d})]})};function jC({isCircular:e=!1,targetNode:t,targetX:n,targetY:r}){const{width:o,height:i,position:s}=t,a=o??0,l=i??0,c=a/2;return e?{tx:s.x+c,ty:s.y+l}:{tx:n,ty:r}}const UC=e=>{const t={...e,interactionWidth:40},{id:n,source:r,target:o,sourcePosition:i,sourceX:s,sourceY:a,targetX:l,targetY:c}=t,{removeEdge:d}=xe(),f=w.useRef(null),p=ae(w.useCallback(A=>A.nodeInternals.get(r),[r])),h=ae(w.useCallback(A=>A.nodeInternals.get(o),[o]));if(!p||!h)return null;const E=r===o,{tx:v,ty:y}=jC({isCircular:E,targetNode:h,targetX:l,targetY:c}),[g,m,_]=ss({borderRadius:zv,sourcePosition:i,sourceX:s,sourceY:a,targetPosition:E?K.Bottom:K.Left,targetX:v,targetY:y}),S=(A,b)=>{A.stopPropagation(),d(b)},x=A=>{var b,V,M;(b=A.currentTarget)==null||b.classList.add("highlight"),(V=f.current)==null||V.classList.add("animate-delay-opacity","flex"),(M=f.current)==null||M.classList.remove("hidden")},R=A=>{var b,V,M;(b=A.currentTarget)==null||b.classList.remove("highlight"),(V=f.current)==null||V.classList.remove("animate-delay-opacity","flex"),(M=f.current)==null||M.classList.add("hidden")},{height:I,strokeWidth:L,width:U}={...Fo.markerEnd,...Fo.style};return u.jsxs("g",{onMouseEnter:x,onMouseLeave:R,children:[u.jsx(Io,{path:g,...t}),u.jsx(U0,{height:I,strokeWidth:L,toX:v,toY:y,width:U}),u.jsx(gA,{children:u.jsxs("button",{className:"nodrag nopan pointer-events-auto absolute hidden h-[18px] w-[26px] cursor-pointer items-center justify-center rounded-full bg-foreground/90 opacity-0 hover:h-[22px] hover:w-[30px] hover:border-2 hover:border-focus",onClick:A=>S(A,n),ref:f,style:{transform:`translate(-50%, -50%) translate(${m}px,${_}px)`},children:[u.jsx(te,{tag:"trash-can",className:"py-0.5 px-1.5 text-background"}),u.jsx("span",{className:"sr-only",children:T(N.REMOVE_EDGE)})]})})]})},FC=/^[\w\d -']+$/,VC=/^\d+$/,$C=/^\d|\*|#$/,BC=/^[\d*#$]{0,12}$/,HC=/^.{1,20}$/,Yo={MAX:3600,MIN:0},zC=/^[a-z0-9_]{1,20}$/,ge={MAX:99,MIN:1},Ko=e=>t=>!!e.exec(t),vt=e=>It(e)?Ko(VC)(e):!0,WC=e=>It(e)?Ko($C)(e):!0,GC=e=>It(e)?Ko(FC)(e):!0,YC=e=>It(e)?Ko(zC)(e):!0,F0=e=>It(e)?Ko(BC)(e):!0,KC=e=>It(e)?Ko(HC)(e):!0,zl=e=>{if(!It(e))return!0;try{return JSON.parse(e),!0}catch{return!1}},fe=e=>!!It(e),Ns=(e,t)=>{if(typeof e=="string"&&!It(e))return!0;const n=typeof e!="number"?parseInt(e,10):e;return!Number.isNaN(n)&&n>=t},ws=(e,t)=>{if(typeof e=="string"&&!It(e))return!0;const n=typeof e!="number"?parseInt(e,10):e;return!Number.isNaN(n)&&n<=t},ar=(e,t)=>{const n=new Set,r=e.reduce((o,i)=>{const s=i[t];if(typeof s=="string"){const a=s.trim();a&&(n.has(a)&&o.add(a),n.add(a))}return o},new Set);return o=>r.has(o.trim())},Qo={aiAgent:{fieldValidators:{agent:[fe]},validate:e=>Xo({nodeData:e,nodeType:"aiAgent"}),validateField:(e,t)=>oe({name:e,nodeType:"aiAgent",value:t})},cond:{fieldValidators:{value:[fe]},validate:e=>Mf("cond",e),validateField:(e,t)=>oe({name:e,nodeType:"cond",value:t})},condRequest:{fieldValidators:{body:[],headers:[zl],method:[fe],saveVariables:[],url:[fe],value:[fe]},validate:e=>{const t=e,n=[];return["body","headers","method","saveVariables","url"].forEach(o=>{oe({name:o,nodeType:"condRequest",value:t[o]})||n.push(o)}),[...n,...Mf("condRequest",e)]},validateField:(e,t)=>oe({name:e,nodeType:"condRequest",value:t})},executeSWML:{fieldValidators:{dest:[fe],meta:[zl],params:[zl]},validate:e=>{const t=e,n=[];return["dest","params","meta"].forEach(o=>{oe({name:o,nodeType:"executeSWML",value:t[o]})||n.push(o)}),[...n,...Mf("executeSWML",e)]},validateField:(e,t)=>oe({name:e,nodeType:"executeSWML",value:t})},forwardAddress:{fieldValidators:{callOrder:[],callStateEvents:[],callStateUrl:[],connectFrom:[],connectTimeout:[vt],connectTo:[fe],defaultFrom:[],defaultTimeout:[vt],sessionTimeout:[vt]},validate:e=>jf("forwardAddress",e),validateField:(e,t)=>oe({name:e,nodeType:"forwardAddress",value:t})},forwardPhone:{fieldValidators:{callOrder:[],callStateEvents:[],callStateUrl:[],connectFrom:[],connectTimeout:[vt],connectTo:[fe],defaultFrom:[],defaultTimeout:[vt]},validate:e=>jf("forwardPhone",e),validateField:(e,t)=>oe({name:e,nodeType:"forwardPhone",value:t})},forwardResource:{fieldValidators:{callOrder:[],callStateEvents:[],callStateUrl:[],connectFrom:[],connectTimeout:[vt],connectTo:[fe],defaultFrom:[],defaultTimeout:[vt],sessionTimeout:[vt]},validate:e=>jf("forwardResource",e),validateField:(e,t)=>oe({name:e,nodeType:"forwardResource",value:t})},hangup:{fieldValidators:{reason:[]},validate:e=>Uf("hangup",e),validateField:(e,t)=>oe({name:e,nodeType:"hangup",value:t})},play:{fieldValidators:{selected:[fe],text:[fe],url:[fe]},validate:e=>Uf("play",e),validateField:(e,t)=>oe({name:e,nodeType:"play",value:t})},promptPlay:{fieldValidators:{command:[GC],digit:[WC],digitTimeout:[vt,{test:Ns,testValue:ge.MIN},{test:ws,testValue:ge.MAX}],initialTimeout:[vt,{test:Ns,testValue:ge.MIN},{test:ws,testValue:ge.MAX}],selected:[fe],text:[fe],url:[fe]},validate:e=>{const t="promptPlay",n=e,r=ar(n.options,"command"),o=ar(n.options,"digit"),i=Uf("promptPlay",n),s=nc(n.initialTimeout);s!=null&&s.trim()&&!oe({name:"initialTimeout",nodeType:t,value:s})&&i.push("initialTimeout");const a=nc(n.digitTimeout);return a!=null&&a.trim()&&!oe({name:"digitTimeout",nodeType:t,value:a})&&i.push("digitTimeout"),n.options.forEach(l=>{const c=oe({name:"command",nodeType:t,value:l.command})&&!r(l.command),d=oe({name:"digit",nodeType:t,value:l.digit})&&!o(l.digit);c&&d&&(l.command||l.digit)||i.push(`option_${l.id}`)}),i},validateField:(e,t)=>oe({name:e,nodeType:"promptPlay",value:t})},record:{fieldValidators:{beep:[],endSilenceTimeout:[vt,{test:Ns,testValue:ge.MIN},{test:ws,testValue:ge.MAX}],format:[fe],initialTimeout:[vt,{test:Ns,testValue:ge.MIN},{test:ws,testValue:ge.MAX}],maxLength:[vt,{test:Ns,testValue:Yo.MIN},{test:ws,testValue:Yo.MAX}],stereo:[],terminators:[F0]},validate:e=>Xo({nodeData:e,nodeType:"record"}),validateField:(e,t)=>oe({name:e,nodeType:"record",value:t})},recordCallStart:{fieldValidators:{beep:[],controlId:[],format:[fe],label:[fe,KC],stereo:[],terminators:[F0]},validate:e=>Xo({nodeData:e,nodeType:"recordCallStart"}),validateField:(e,t)=>oe({name:e,nodeType:"recordCallStart",value:t})},recordCallStop:{fieldValidators:{controlId:[fe]},validate:e=>Xo({nodeData:e,nodeType:"recordCallStop"}),validateField:(e,t)=>oe({name:e,nodeType:"recordCallStop",value:t})},request:{fieldValidators:{body:[],headers:[zl],method:[fe],saveVariables:[],url:[fe]},validate:e=>Xo({nodeData:e,nodeType:"request"}),validateField:(e,t)=>oe({name:e,nodeType:"request",value:t})},sendSms:{fieldValidators:{body:[fe],fromNumber:[fe],toNumber:[fe]},validate:e=>Xo({nodeData:e,nodeType:"sendSms"}),validateField:(e,t)=>oe({name:e,nodeType:"sendSms",value:t})},set:{fieldValidators:{key:[fe,YC],value:[]},validate:e=>{const t=e,n="set",r=[],o=ar(t.variables,"key");return t.variables.forEach(i=>{const s=oe({name:"key",nodeType:n,value:i.key})&&!o(i.key),a=oe({name:"value",nodeType:n,value:i.value});s&&a||r.push(`variable_${i.id}`)}),r},validateField:(e,t)=>oe({name:e,nodeType:"set",value:t})},unset:{fieldValidators:{},validate:e=>e.variables.length>0?[]:["variables"],validateField:(e,t)=>oe({name:e,nodeType:"unset",value:t})}},lt=e=>{const t=Qo==null?void 0:Qo[e];return{validate:t==null?void 0:t.validate,validateField:t==null?void 0:t.validateField}},V0=(e,t)=>{var r;const n=(r=Qo[e])==null?void 0:r.validate;return n===void 0?[]:n(t)},$0=(e,t)=>{var n;return!e||!t?!1:((n=V0(e,t))==null?void 0:n.length)===0},oe=({name:e,nodeType:t,value:n})=>{var i,s;let r=!0;const o=(s=(i=Qo[t])==null?void 0:i.fieldValidators)==null?void 0:s[e];return o==null||o.forEach(a=>{typeof a=="function"?r=r&&a(n):r=r&&a.test(n,a.testValue)}),r},Xo=({nodeData:e,nodeType:t})=>{var o;const n=((o=Qo[t])==null?void 0:o.fieldValidators)??{},r=[];return Object.keys(n).forEach(i=>{const s=i;oe({name:i,nodeType:t,value:(e==null?void 0:e[s])??""})||r.push(i)}),r},Mf=(e,t)=>{const n=t,r=[];return n.options.forEach(o=>{oe({name:"value",nodeType:e,value:o.value})||r.push(`condition_${o.id}`)}),r},jf=(e,t)=>{var i;const n=[];["callOrder","callStateEvents","callStateUrl","defaultFrom","defaultTimeout"].forEach(s=>{oe({name:s,nodeType:e,value:t[s]})||n.push(s)});const o=["connectFrom","connectTo","connectTimeout"];return(i=t.connections)==null||i.forEach(s=>{o.forEach(a=>{oe({name:a,nodeType:e,value:s[a]})||n.push(`${a}_${s.id}`)})}),n},Uf=(e,t)=>{const n=[];return oe({name:"selected",nodeType:e,value:t==null?void 0:t.selected})||n.push("selected"),t.selected==="url"?oe({name:"url",nodeType:e,value:t.url})||n.push("url"):t.selected==="text"&&(oe({name:"text",nodeType:e,value:t.text})||n.push("text")),n},ct=({data:e,id:t})=>{const n=Y(a=>a.isCanvasInteractive),{getNodeType:r,partialUpdateNodeData:o}=xe(),{isValueDuplicate:i}=kf(),s=r(t);return w.useEffect(()=>{if(s&&n){let a=$0(s,e);s==="recordCallStart"&&"label"in e&&(a=a&&!i(e.label,e.controlId)),a!==e.valid&&o(t,{valid:a})}},[e,t,n,i,o,s]),w.useEffect(()=>{if(s==="aiAgent"&&n){const a=un.subscribe(l=>{if(l.status==="loaded"&&"agent"in e){const c=l.aiAgentMap.has(e.agent),d=c&&$0(s,e);d!==e.valid&&o(t,{agent:c?e.agent:"",valid:d})}});return()=>{a()}}},[e,t,n,o,s]),{getInvalidFields:()=>!s||e.valid?[]:V0(s,e),valid:()=>e.valid}},QC=({data:e,id:t,isConnectable:n,selected:r})=>{ct({data:e,id:t});const o=un(s=>s.aiAgentMap.get(e.agent)),i=o==null?void 0:o.display_name;return u.jsxs(Fe,{id:t,isConnectable:n,nodeTitle:T(N.AI_AGENT),selected:r,valid:e.valid,children:[i&&u.jsx(Lt,{children:u.jsx("p",{className:"truncate text-xs",children:i})}),u.jsx(Wt,{id:t,color:"positive",isConnectable:n})]})},XC=({data:e,id:t,isConnectable:n,selected:r})=>u.jsx(Fe,{id:t,isConnectable:n,nodeTitle:T(N.ANSWER_CALL),selected:r,valid:e.valid,children:u.jsx(Wt,{id:t,isConnectable:n,color:"positive"})}),qC=({id:e,data:t,isConnectable:n,selected:r})=>(ct({data:t,id:e}),u.jsx(Fe,{id:e,isConnectable:n,nodeTitle:T(N.CONDITIONS),selected:r,valid:t.valid,children:u.jsxs(Ho,{children:[t.options.map((o,i)=>{const s=o.value.trim();return u.jsx(Gt,{color:"positive",enabled:!!s,id:o.id,isConnectable:n,optionTitle:s?u.jsx("div",{className:"truncate",children:s}):T(N.CONDITION_NUMBER,{index:i+1})},o.id)}),u.jsx(Gt,{color:"negative",id:t.fallback,isConnectable:n,optionTitle:T(N.ELSE)})]})})),JC=({data:e,id:t,isConnectable:n,selected:r})=>{var i;ct({data:e,id:t});const o=e.url.trim();return u.jsxs(Fe,{id:t,isConnectable:n,nodeTitle:T(N.REQUEST),selected:r,valid:e.valid,children:[o&&u.jsx(Lt,{children:u.jsx("div",{className:"break-all line-clamp-3",children:o})}),u.jsxs(Ho,{children:[(i=e==null?void 0:e.options)==null?void 0:i.map((s,a)=>{const l=s.value.trim();return u.jsx(Gt,{color:"positive",enabled:!!l,id:s.id,isConnectable:n,optionTitle:l?u.jsx("div",{className:"truncate",children:l}):T(N.CONDITION_NUMBER,{index:a+1})},s.id)}),u.jsx(Gt,{color:"negative",id:e.fallback,isConnectable:n,optionTitle:T(N.ELSE)}),u.jsx(Gt,{color:"negative",id:e.error,isConnectable:n,optionTitle:T(N.FAILURE)})]})]})},ZC=({data:e,id:t,isConnectable:n,selected:r})=>{var i;ct({data:e,id:t});const o=e.dest.trim();return u.jsxs(Fe,{id:t,isConnectable:n,nodeTitle:T(N.EXECUTE_SWML),selected:r,valid:e.valid,children:[o&&u.jsx(Lt,{children:u.jsx("div",{className:"break-all line-clamp-3",children:o})}),u.jsxs(Ho,{children:[(i=e==null?void 0:e.options)==null?void 0:i.map((s,a)=>{const l=s.value.trim();return u.jsx(Gt,{color:"positive",enabled:!!l,id:s.id,isConnectable:n,optionTitle:l?u.jsx("div",{className:"truncate",children:l}):T(N.CONDITION_NUMBER,{index:a+1})},s.id)}),u.jsx(Gt,{color:"negative",id:e.fallback,isConnectable:n,optionTitle:T(N.ELSE)})]})]})},Ff=3,eL={busy:N.BUSY,decline:N.DECLINE,error:N.ERROR,noAnswer:N.NO_ANSWER,success:N.SUCCESS},tL={address:N.FORWARD_TO_ADDRESS,phone:N.FORWARD_TO_PHONE,resource:N.FORWARD_TO_RESOURCE},Vf=({id:e,data:t,isConnectable:n,selected:r})=>{ct({data:t,id:e});const o=t.connections.filter(s=>s.connectTo),i=o.slice(0,Ff);return u.jsxs(Fe,{id:e,isConnectable:n,nodeTitle:T(tL[t.destinationType]),selected:r,valid:t.valid,children:[o.length?u.jsxs(Lt,{children:[u.jsx("ul",{children:i.map(s=>u.jsx("li",{className:"pb-2",children:u.jsx("div",{className:"max-w-max truncate rounded bg-secondary/20 px-1 ",children:s.connectTo})},`node-${s.id}`))}),o.length>Ff&&u.jsx("div",{children:`+ ${T(N.MORE_WITH_COUNT,{count:o.length-Ff})}`})]}):null,u.jsx(Ho,{children:t.options.map(s=>u.jsx(Gt,{color:Qv(s.result),id:s.id,isConnectable:n,optionTitle:T(eL[s.result])},s.id))})]})},nL=({id:e,data:t,isConnectable:n,selected:r})=>{ct({data:t,id:e});const o=ar(t.options,"command"),i=ar(t.options,"digit");return u.jsxs(Fe,{id:e,isConnectable:n,nodeTitle:T(N.GATHER_INPUT),selected:r,valid:t.valid,children:[u.jsx(Vy,{data:t}),u.jsxs(Ho,{children:[t.options.map((s,a)=>{const l=s.command.trim(),c=s.digit.trim(),d=!!(l||c)&&!o(s.command)&&!i(s.digit),f=u.jsxs("div",{className:"flex gap-1",children:[T(N.CALLER_PRESSES)," ",u.jsx("span",{className:"truncate rounded bg-secondary/20 px-1",children:c})]}),p=v=>u.jsxs("div",{className:"flex",children:[T(v?N.CALLER_SAYS:N.OR_CALLER_SAYS)," '",u.jsx("span",{className:"truncate",children:l}),"'"]});let h=T(N.OPTION_NUMBER,{index:a+1}),E="";switch(!0){case!!(l&&!c):h=p(!0);break;case!!(!l&&c):h=f;break;case!!(l&&c):h=f,E=p(!1);break}return u.jsx(Gt,{color:"positive",enabled:d,id:s.id,isConnectable:n,optionTitle:h,optionSubtitle:E},s.id)}),t.results.map(s=>u.jsx(Gt,{color:"negative",id:s.id,isConnectable:n,optionTitle:s.result==="no_input"?T(N.NO_INPUT):T(N.UNKNOWN)},s.id))]})]})},rL=({id:e,isConnectable:t,selected:n})=>u.jsx(Fe,{id:e,isConnectable:t,isRoot:!0,nodeTitle:T(N.HANDLE_CALL),selected:n,deletable:!1,showValidation:!1,target:!1,children:u.jsx(Wt,{id:e,color:"positive",isConnectable:t})}),$f={busy:N.BUSY,decline:N.DECLINE,hangup:N.HANG_UP},oL=({data:e,id:t,isConnectable:n,selected:r})=>u.jsx(Fe,{id:t,isConnectable:n,nodeTitle:T(N.HANG_UP_CALL),selected:r,valid:e.valid,children:e.reason&&u.jsx(Lt,{children:u.jsx("section",{className:"text-xs",children:u.jsx("p",{children:T($f[e.reason])})})})}),iL=({data:e,id:t,isConnectable:n,selected:r})=>(ct({data:e,id:t}),u.jsxs(Fe,{id:t,isConnectable:n,nodeTitle:T(N.PLAY_AUDIO_TTS),selected:r,valid:e.valid,children:[u.jsx(Vy,{data:e}),u.jsx(Wt,{id:t,isConnectable:n})]})),sL=({data:e,id:t,isConnectable:n,selected:r})=>{const{label:o,valid:i}=e;return ct({data:e,id:t}),u.jsxs(Fe,{id:t,isConnectable:n,nodeTitle:T(N.RECORD_CALL_START),selected:r,valid:i,children:[o&&i&&u.jsx(Lt,{children:u.jsx("p",{className:"truncate text-xs leading-5",children:o})}),u.jsx(Wt,{id:t,isConnectable:n,color:"positive"})]})},aL=({data:e,id:t,isConnectable:n,selected:r})=>{var s;ct({data:e,id:t});const o=(s=Go(a=>a.entries))==null?void 0:s.find(a=>a.controlId===e.controlId),i=o==null?void 0:o.label;return u.jsxs(Fe,{id:t,isConnectable:n,nodeTitle:T(N.RECORD_CALL_STOP),selected:r,valid:e.valid,children:[i&&u.jsx(Lt,{children:u.jsx("p",{className:"truncate text-xs leading-5",children:i})}),u.jsx(Wt,{id:t,color:"positive",isConnectable:n})]})},lL=({data:e,id:t,isConnectable:n,selected:r})=>{ct({data:e,id:t});const o=new Set(e.terminators);return u.jsxs(Fe,{id:t,isConnectable:n,nodeTitle:T(N.VOICEMAIL_RECORDING),selected:r,valid:e.valid,children:[e.terminators?u.jsxs(Lt,{children:[T(N.TERMINATORS),":"," ",u.jsx("ul",{className:"inline-flex flex-wrap justify-start gap-1",children:[...o].sort().map((i,s)=>u.jsx("li",{className:"rounded bg-secondary/20 px-1",children:i},`${s}-${i}`))})]}):null,u.jsx(Wt,{id:t,isConnectable:n,color:"positive"})]})},cL={failed:N.FAILED,success:N.SUCCESS},B0={aiAgent:QC,answer:XC,cond:qC,condRequest:JC,executeSWML:ZC,forwardAddress:Vf,forwardPhone:Vf,forwardResource:Vf,handleCall:rL,hangup:oL,play:iL,promptPlay:nL,record:lL,recordCallStart:sL,recordCallStop:aL,request:({data:e,id:t,isConnectable:n,selected:r})=>{var o;return ct({data:e,id:t}),u.jsxs(Fe,{id:t,isConnectable:n,nodeTitle:T(N.REQUEST),selected:r,valid:e.valid,children:[u.jsx("p",{className:"p-4 pt-0 text-xs text-negative",children:T(N.DEPRECATED)}),u.jsx(Ho,{children:(o=e==null?void 0:e.options)==null?void 0:o.map(i=>u.jsx(Gt,{color:Qv(i.result),id:i.id,isConnectable:n,optionTitle:T(cL[i.result])},i.id))})]})},sendSms:({data:e,id:t,isConnectable:n,selected:r})=>(ct({data:e,id:t}),u.jsxs(Fe,{id:t,isConnectable:n,nodeTitle:T(N.SEND_SMS),selected:r,valid:e.valid,children:[e.body&&u.jsx(Lt,{children:u.jsx("p",{className:"break-words line-clamp-3",children:e.body})}),u.jsx(Wt,{id:t,isConnectable:n})]})),set:({id:e,data:t,isConnectable:n,selected:r})=>{const{getInvalidFields:o}=ct({data:t,id:e}),i=o().reduce((a,l)=>(l.startsWith("variable_")&&a.push(l.replace("variable_","")),a),[]),s=t.variables.filter(a=>!!a.key);return u.jsxs(Fe,{id:e,isConnectable:n,nodeTitle:T(N.SET_VARIABLES),selected:r,valid:t.valid,children:[s.length>0&&u.jsx(Lt,{children:u.jsx("ul",{className:"flex flex-col",children:s.map(a=>u.jsxs("li",{className:"flex w-full gap-1 pb-2",children:[u.jsx("div",{className:`max-w-[50%] shrink-0 truncate rounded px-1 ${i.includes(a.id)?"bg-negative/10 text-negative":"bg-secondary/20"}`,children:a.key}),"=",a.value&&u.jsx("div",{className:"truncate",children:a.value})]},a.id))})}),u.jsx(Wt,{id:e,isConnectable:n,color:"positive"})]})},unset:({id:e,data:t,isConnectable:n,selected:r})=>{ct({data:t,id:e});const o=t.variables.filter(i=>!!i.key);return u.jsxs(Fe,{id:e,isConnectable:n,nodeTitle:T(N.UNSET_VARIABLES),selected:r,valid:t.valid,children:[o.length>0&&u.jsx(Lt,{children:u.jsx("ul",{children:o.map(i=>u.jsx("li",{className:"pb-2",children:u.jsx("div",{className:"max-w-max truncate rounded bg-secondary/20 px-1",children:i.key})},i.id))})}),u.jsx(Wt,{id:e,isConnectable:n,color:"positive"})]})}},uL={floating:UC},dL=({children:e})=>{const t=Y(_=>_.nodes),n=Y(_=>_.edges),r=Y(_=>_.isCanvasInteractive),{onConnect:o,onConnectEnd:i,onConnectStart:s,onEdgesChange:a,onEdgesDelete:l,onEdgeUpdate:c,onEdgeUpdateEnd:d,onEdgeUpdateStart:f,onInit:p,onNodeDragStart:h,onNodeDragStop:E,onNodesChange:v,onNodesDelete:y,onSelectionChange:g,setFlowWrapperElement:m}=xe();return u.jsx("div",{className:"bg-sw-white !h-auto w-full",ref:_=>m(_),children:u.jsxs(Fv,{attributionPosition:"bottom-left",connectionLineComponent:MC,connectionMode:qn.Strict,deleteKeyCode:r?GA:null,defaultEdgeOptions:Fo,edges:n,edgeTypes:uL,elementsSelectable:r,fitViewOptions:rf,multiSelectionKeyCode:r?YA:null,nodes:t,nodesConnectable:r,nodesDraggable:r,nodeTypes:B0,onConnect:o,onConnectEnd:i,onConnectStart:s,onEdgesChange:a,onEdgesDelete:l,onEdgeUpdate:r?c:void 0,onEdgeUpdateEnd:d,onEdgeUpdateStart:f,onInit:p,onNodeDragStart:h,onNodeDragStop:E,onNodesChange:v,onNodesDelete:y,onSelectionChange:g,selectionKeyCode:r?KA:null,snapGrid:[xl,xl],snapToGrid:!0,children:[u.jsx(DA,{className:"bg-background-alt text-grid",color:"currentColor",gap:[xl,xl],variant:At.Dots}),e]})})},fL=()=>{const e=Y(a=>a.initializing),t=Y(a=>a.reactFlowInstance),{setInitializing:n,setViewportChanging:r}=xe(),o=w.useRef(!1),i=_A({includeHiddenNodes:!0}),s=w.useMemo(()=>()=>{t==null||t.fitView(rf)},[t]);w.useEffect(()=>{let a;e?!o.current&&!i?o.current=!0:o.current&&i&&(clearTimeout(a),r(!0),s(),a=setTimeout(()=>{r(!1)},rf.duration),n(!1),o.current=!1):o.current=!1},[e,s,i,n,r])},pL=()=>{const{onViewportChange:e,onViewportChangeEnd:t,onViewportChangeStart:n}=xe();return fL(),EA({onChange:e,onEnd:t,onStart:n}),null},hL=()=>{const e=Y(n=>n.selectedNode),t=e?NC.get(e.type):void 0;return t?u.jsx(ns,{className:"z-40 max-w-[40%] rounded-md bg-background",position:"bottom-center",children:u.jsxs("div",{className:"justify-left flex items-center gap-2 rounded-md bg-primary/10 p-3 py-4","data-testid":"cfb__info",children:[u.jsx(te,{className:"shrink-0 text-primary",tag:"circle-info",size:"xl"}),u.jsx("div",{className:"text-xs font-medium",children:$l(t)})]})}):null},gL=e=>{var i;const t=w.useRef(),n=mA(),r=e&&"options"in e.data?(i=e.data.options)==null?void 0:i.length:0;return t.current=r,{updateDynamicHandles:s=>{"options"in s&&s.options.length!==t.current&&(e&&n(e.id),t.current=s.options.length)}}},mL="/hello/.test('%{foo}')",EL=()=>({id:ie(),value:""}),Bf=({nodeData:e,handleOnUpdate:t,placeholder:n=mL})=>{const{validateField:r}=lt("cond"),[o,i]=w.useState({options:e.options.map(f=>({id:!0,initial:e.initial,value:r("value",f.value)}))}),s=f=>{f.preventDefault(),i({...o,options:[...o.options,{initial:!0,value:!0}]}),t({options:[...e.options,EL()]})},a=f=>p=>{p.preventDefault();const h=[...o.options];h.splice(f,1),i({...o,options:h});const E=[...e.options];E.splice(f,1),t({options:E})},l=(f,p)=>{const h=[...e.options];if(!h[f])throw new Error(`Option not found at index ${f}`);const{name:E,value:v}=p,y=[...o.options];y[f]={...y[f],initial:!1,[E]:r(E,v)},i({...o,options:y}),h[f]={...h[f],[E]:v},t({options:h})},c=(f,p)=>{const h=f.target,{name:E,value:v}=h;switch(t({initial:!1}),E){case"value":p!==void 0&&l(p,{name:E,value:v});break;default:Ie().error(`Unhandled input name: ${E}`)}},d=({index:f,name:p})=>{const h=o.options[f];return(h==null?void 0:h[p])||(h==null?void 0:h.initial)};return u.jsxs(u.Fragment,{children:[u.jsx("ol",{className:"divide-y-4 divide-foreground/10 border-b-4 border-foreground/10",children:e.options.map((f,p,h)=>u.jsxs("li",{className:"flex pt-3",children:[u.jsx("div",{className:"w-8 shrink-0 text-center",children:u.jsx(te,{className:"text-foreground/60",size:"xs",tag:"bars"})}),u.jsxs("div",{className:"relative mr-3",children:[h.length>1&&u.jsx(Bo,{className:"absolute right-0 top-0",handleDelete:a(p),label:T(N.REMOVE_CONDITION,{index:p+1}),size:"sm",show:!0}),u.jsxs("label",{className:"mb-2 block",children:[T(N.CONDITION_NUMBER,{index:p+1}),u.jsx("input",{className:`w-full ${d({index:p,name:"value"})?"":"invalid"}`,name:"value",onChange:E=>c(E,p),placeholder:n,type:"text",value:f.value}),u.jsx("p",{className:"requirements",role:"alert",children:T(N.ERROR_VALUE_IS_REQUIRED)})]})]})]},f.id))}),u.jsx("div",{className:"p-3 text-right",children:u.jsx("button",{className:"rounded bg-foreground/10 py-1 px-2 font-medium",onClick:s,type:"button",children:T(N.ADD_CONDITION)})})]})},vL=Ie(),Os=(e,t)=>[e,t].filter(Boolean).join("-").toLowerCase(),yL={idsByKey:{},languageById:{},voiceById:{}},_L=(e,t)=>({...yL,actions:{getGenderByKeys:({languageId:n})=>{const{idsByKey:r}=t(),o=(n==null?void 0:n.split(",").map(s=>Os(s)))??[];if(!o.length)return["female","male"];const i=new Set;return o.forEach(s=>{var a;return(a=r[s])==null?void 0:a.forEach(l=>{l.gender&&i.add(l.gender)})}),Array.from(i).sort((s,a)=>s.toLowerCase().localeCompare(a.toLowerCase()))},getLanguages:()=>Object.values(t().languageById).sort((n,r)=>n.name.toLowerCase().localeCompare(r.name.toLowerCase())),getVoicesByKeys:({languageId:n,gender:r})=>{const{voiceById:o,idsByKey:i}=t(),s=(n==null?void 0:n.split(",").map(l=>Os(l,r)))??[];let a=[];return!s.length||s[0]===""?a=Object.values(o):s.forEach(l=>{a=a.concat(i[l]??[])}),a.sort((l,c)=>{const d=/^\w{2,3}-\w{2,}-.+/;return l.name.match(d)&&!c.name.match(d)?1:!l.name.match(d)&&c.name.match(d)?-1:l.name.toLowerCase().localeCompare(c.name.toLowerCase())})},init:async({voicesURL:n="/voices.json"})=>{try{vL.debug("Load voicesURL",n);const o=await(await fetch(n)).json(),i={},s={},a={};o.forEach(l=>{var y,g,m;const c=!!l.premium,d=l.signalwire_id,f=l.gender.toLowerCase(),p={gender:f,id:d,key:`${l.language_code}-${f}-${l.signalwire_id}`,name:`${l.friendly_name.trim()} ${c?"(premium)":""}`,premium:c};i[d]=p,s[l.language_code]={id:l.language_code,name:l.language};const h=Os(l.language_code);h in a||(a[h]=[]),(y=a[h])==null||y.push(p);const E=Os(f);E in a||(a[E]=[]),(g=a[E])==null||g.push(p);const v=Os(l.language_code,f);v in a||(a[v]=[]),(m=a[v])==null||m.push(p)}),e({idsByKey:a,languageById:s,voiceById:i})}catch(r){console.error("Error",r)}}}}),Hf=us()(_L),SL=()=>Hf.getState().actions;window.__useVoiceStore=Hf;const H0=e=>u.jsx("option",{value:e.id,children:e.name},e.key??e.id),xL=({onChange:e,languageId:t,gender:n,voiceId:r})=>{const{getLanguages:o,getVoicesByKeys:i,getGenderByKeys:s}=SL();return u.jsxs(u.Fragment,{children:[u.jsxs(an,{className:"w-full",label:T(N.LANGUAGE),name:"language",onChange:e,value:t??"",children:[u.jsx("option",{value:"",children:T(N.SELECT)}),o().map(H0)]}),u.jsxs(an,{className:"w-full capitalize",label:T(N.GENDER),name:"gender",onChange:e,value:n??"",children:[u.jsx("option",{value:"",children:T(N.SELECT)}),s({languageId:t}).map(a=>u.jsx("option",{value:a,children:a},a))]}),u.jsxs(an,{className:"w-full",label:T(N.VOICE),name:"voice",onChange:e,value:r??"",children:[u.jsx("option",{value:"",children:T(N.SELECT)}),i({gender:n,languageId:t}).map(H0)]})]})},z0={text:N.TEXT_TO_SPEECH,url:N.PLAY_AUDIO_FILE},W0=({handleOnUpdate:e,label:t,nodeData:n,showDefaultOption:r})=>{const{validateField:o}=lt("play"),[i,s]=w.useState({gender:!0,language:!0,selected:n.initial||o("selected",n.selected),text:n.initial||o("text",n.text),url:n.initial||o("url",n.url),voice:!0}),a=n.selected;w.useEffect(()=>{!a&&!r&&e({selected:"url"})},[e,a,r]);const l=d=>{const f=d.target,{name:p,value:h}=f;switch(p){case"selected":case"text":case"url":s({...i,[p]:o(p,h)}),e({initial:!1,[p]:h});break;default:throw new Error(`Unhandled input name: ${p}`)}},c=d=>{const f=d.target,{name:p,value:h}=f;switch(p){case"language":e({gender:void 0,language:h,voice:void 0});break;case"gender":e({gender:h,voice:void 0});break;default:e({[p]:h})}};return u.jsxs(u.Fragment,{children:[u.jsxs("label",{className:"mb-2",children:[u.jsx("span",{className:"sr-only",children:t}),u.jsxs($y,{className:`w-full ${i.selected?"":"invalid"}`,name:"selected",onChange:l,value:a,children:[r&&u.jsx("option",{value:"",children:T(N.SELECT)}),Object.keys(z0).map(d=>u.jsx("option",{value:d,children:T(z0[d])},d))]})]}),a&&u.jsx(RL,{nodeData:n,onChange:l,voiceSettingsChangeHandler:c,selected:a,valid:i[a]})]})},RL=({nodeData:e,onChange:t,voiceSettingsChangeHandler:n,selected:r,valid:o})=>{const i=e[r],a={text:u.jsxs(u.Fragment,{children:[u.jsx(xL,{onChange:n,languageId:e.language,gender:e.gender,voiceId:e.voice}),u.jsx(On,{errorText:T(N.ERROR_VALUE_IS_REQUIRED),inputMode:"text",label:T(N.TEXT),name:r,onChange:t,placeholder:T(N.WRITE_SOMETHING),valid:o,value:i})]}),url:u.jsx(On,{errorText:T(N.ERROR_URL_IS_REQUIRED),inputMode:"url",label:T(N.AUDIO_FILE),name:r,onChange:t,placeholder:T(N.ENTER_URL),valid:o,value:i})}[r];return u.jsx(u.Fragment,{children:a})},NL=[{field:"stereo",subtitle:N.STEREO_SUBTITLE,title:N.STEREO},{field:"beep",subtitle:N.BEEP_SUBTITLE,title:N.BEEP}],G0=({handleOnUpdate:e,nodeData:t,type:n})=>{const{validateField:r}=lt("record"),[o,i]=w.useState({beep:!0,endSilenceTimeout:t.initial||r("endSilenceTimeout",t.endSilenceTimeout),format:!0,initialTimeout:t.initial||r("initialTimeout",t.initialTimeout),maxLength:t.initial||r("maxLength",t.maxLength),stereo:!0,terminators:t.initial||r("terminators",t.terminators)});t.format||e({format:"mp3"});const s=l=>{const c=l.target.name;e({[c]:!t[c]})},a=l=>{const c=l.target,{name:d,value:f}=c;switch(d){case"endSilenceTimeout":case"format":case"initialTimeout":case"maxLength":case"terminators":i({...o,[d]:r(d,f)}),e({initial:!1,[d]:f});break;default:throw new Error(`Unhandled input name: ${d}`)}};return u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"mb-2",children:NL.map(l=>{const c=t[l.field];return u.jsx("div",{children:u.jsx(pf,{checked:c,clickHandler:s,name:l.field,subtitle:T(l.subtitle),title:T(l.title)})},l.field)})}),u.jsxs("label",{className:"mb-2 block",children:[T(N.TERMINATORS),u.jsx("span",{className:"block text-xxs text-foreground/50",children:T(N.SEPARATE_WITH_COMMAS)}),u.jsx("input",{className:`w-full ${o.terminators?"":"invalid"}`,name:"terminators",onChange:a,placeholder:"#*0",type:"text",value:t.terminators}),u.jsx("p",{className:"requirements",role:"alert",children:T(N.ERROR_TERMINATORS)})]}),n==="voicemail"&&u.jsxs(u.Fragment,{children:[u.jsxs("label",{className:"mb-2 block",children:[u.jsx("div",{className:"w-full",children:T(N.MAXIMUM_RECORDING_LENGTH)}),u.jsxs("div",{className:"flex flex-wrap items-center gap-x-2",children:[u.jsx("input",{className:`w-14 ${o.maxLength?"":"invalid"}`,inputMode:"numeric",min:Yo.MIN,max:Yo.MAX,name:"maxLength",onChange:a,placeholder:T(N.SECONDS),type:"number",value:t.maxLength}),u.jsx("p",{className:"requirements w-full",role:"alert",children:T(N.ERROR_NUMBER_MIN_MAX_IS_REQUIRED,{max:Yo.MAX,min:Yo.MIN})})]})]}),u.jsxs("label",{className:"mb-2 block",children:[u.jsx("div",{className:"w-full",children:T(N.INITIAL_TIMEOUT)}),u.jsxs("div",{className:"flex flex-wrap items-center gap-x-2",children:[u.jsx("input",{className:`w-14 ${o.initialTimeout?"":"invalid"}`,inputMode:"numeric",min:ge.MIN,max:ge.MAX,name:"initialTimeout",onChange:a,placeholder:T(N.SECONDS),type:"number",value:t.initialTimeout}),u.jsx("p",{className:"requirements w-full",role:"alert",children:T(N.ERROR_NUMBER_MIN_MAX_IS_REQUIRED,{max:ge.MAX,min:ge.MIN})})]})]}),u.jsxs("label",{className:"mb-2 block",children:[u.jsx("div",{className:"w-full",children:T(N.END_SILENCE_TIMEOUT)}),u.jsxs("div",{className:"flex flex-wrap items-center gap-x-2",children:[u.jsx("input",{className:`w-14 ${o.endSilenceTimeout?"":"invalid"}`,inputMode:"numeric",min:ge.MIN,max:ge.MAX,name:"endSilenceTimeout",onChange:a,placeholder:T(N.SECONDS),type:"number",value:t.endSilenceTimeout}),u.jsx("p",{className:"requirements w-full",role:"alert",children:T(N.ERROR_NUMBER_MIN_MAX_IS_REQUIRED,{max:ge.MAX,min:ge.MIN})})]})]})]}),u.jsxs(an,{className:"w-full",label:T(N.FORMAT),name:"format",onChange:a,value:t.format,children:[u.jsx("option",{value:"mp3",children:"MP3"}),u.jsx("option",{value:"wav",children:"WAV"})]})]})},Ze=({children:e,formRef:t,handleOnChange:n=()=>null,title:r})=>u.jsxs("div",{className:"flex flex-col overflow-hidden","data-testid":"cfb__settings",children:[u.jsxs("div",{className:"flex w-full items-center justify-start gap-x-2 px-4 pb-3",children:[u.jsx("div",{className:"flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-focus/30 text-primary",children:u.jsx(te,{tag:"circle-small"})}),u.jsx("div",{className:"flex-1",children:u.jsx("h2",{className:"text-xs font-semibold",children:r})})]}),u.jsx("form",{className:"flex h-full flex-col overflow-hidden text-xs",noValidate:!0,onChange:n,ref:t,children:u.jsx("div",{className:"flex-1 overflow-y-auto pt-1 pb-4",children:e})})]}),wL=({nodeData:e,handleOnUpdate:t})=>{const{validateField:n}=lt("aiAgent"),[r,o]=w.useState({agent:e.initial||n("agent",e.agent)}),i=un(v=>v.aiAgentMap.values()),s=un(v=>v.error),a=un(v=>v.status),{fetchAiAgents:l}=TC();w.useEffect(()=>{l()},[l]);const c=Array.from(i),d=a==="loading",f=!!s||a==="error",p=f||a==="initial",h=v=>{const y=v.target,{name:g,value:m}=y;o({...r,[g]:n(g,m)}),t({initial:!1,[g]:m})},E=w.useId();return u.jsx(Ze,{title:T(N.AI_AGENT),children:u.jsx("div",{className:"mx-3",children:!f&&c.length?u.jsxs("div",{className:"relative",children:[u.jsxs(an,{id:E,className:`${r.agent?"":"invalid"}`,disabled:p,label:T(N.AI_AGENT_NAME),name:"agent",onChange:h,value:e.agent,children:[u.jsx("option",{value:"",children:T(N.SELECT)}),c.map(v=>u.jsx("option",{value:v.id,children:v.display_name},v.id))]}),u.jsx(Y0,{className:"absolute top-0 right-0 mx-1",handleClickResync:l,isLoading:d}),e.agent&&u.jsx("p",{children:u.jsx(K0,{agent:e.agent,mode:"edit",className:"mb-2",children:T(N.EDIT_SELECTED_AI_AGENT)})})]}):u.jsxs("div",{className:"flex items-end justify-between",children:[u.jsx("p",{role:"alert",className:"text-negative",children:f?u.jsx(u.Fragment,{children:T(N.ERROR_FETCHING_AI_AGENTS)}):u.jsxs(u.Fragment,{children:[T(N.ERROR_ADD_AI_AGENT_FIRST),u.jsx(K0,{mode:"add",className:"mt-2 block",children:T(N.ADD_AI_AGENT)})]})}),u.jsx(Y0,{className:"mx-1",handleClickResync:l,isLoading:d})]})})})},Y0=({className:e="",isLoading:t,handleClickResync:n})=>u.jsx(sr,{placement:"bottom-end",trigger:u.jsxs("button",{className:`overflow-hidden ${t?"text-disabled":""} ${e}`,disabled:t,onClick:n,type:"button",children:[u.jsx(te,{className:`${t?"animate-spin":""}`,tag:"arrows-rotate"}),u.jsx("span",{className:"sr-only",children:T(N.RESYNC_AI_AGENTS)})]}),children:u.jsx("p",{className:"text-sm",children:T(N.RESYNC_AI_AGENTS)})}),K0=({agent:e="",children:t,className:n="",mode:r})=>{const o={add:"",edit:`${e}/edit`};return u.jsx("a",{className:`w-fit text-foreground underline hover:text-foreground/80 ${n}`,href:`/ai_agents/${o[r]}`,target:"_blank",rel:"noopener noreferrer",children:t})},OL=["GET","POST","PUT","DELETE"],TL=({nodeData:e,handleOnUpdate:t})=>{const{validateField:n}=lt("condRequest"),[r,o]=w.useState({body:e.initial||n("body",e.body),headers:e.initial||n("headers",e.headers),method:e.initial||n("method",e.method),saveVariables:e.initial||n("saveVariables",e.saveVariables),url:e.initial||n("url",e.url)}),i=l=>{const c=l.target,{name:d,value:f}=c;switch(t({initial:!1}),d){case"url":case"method":o({...r,[d]:n(d,f)}),t({[d]:f});break;case"headers":o({...r,[d]:n(d,f)}),t({[d]:f});break;case"body":o({...r,[d]:n(d,f)}),t({[d]:f});break;default:throw new Error(`Unhandled input name: ${d}`)}},s=l=>{const{name:c,value:d}=l.target;t({[c]:d})},a=l=>{const{name:c}=l.target,d=!e[c];t({[c]:d})};return u.jsxs(Ze,{title:T(N.REQUEST),children:[u.jsxs("div",{className:"border-b-4 border-foreground/10 px-3",children:[u.jsxs("label",{className:"mb-2 block",children:[T(N.URL),u.jsx("input",{className:`w-full ${r.url?"":"invalid"}`,name:"url",onChange:i,placeholder:"https://u:p@example.com/api/status",type:"text",value:e.url}),u.jsx("p",{className:"requirements w-full",role:"alert",children:T(N.ERROR_VALUE_IS_REQUIRED)})]}),u.jsx("div",{className:"mb-1",children:u.jsx(an,{className:"w-full",label:T(N.METHOD),name:"method",onChange:s,value:e.method,children:OL.map(l=>u.jsx("option",{value:l,children:l},l))})}),u.jsx("div",{className:"mb-4",children:u.jsx(pf,{checked:e.saveVariables,clickHandler:a,name:"saveVariables",subtitle:T(N.SAVE_VARIABLES_SUBTITLE),title:T(N.SAVE_VARIABLES)})}),u.jsx("label",{className:"mb-2 block",children:u.jsx(On,{errorText:T(N.ERROR_INVALID_JSON),inputMode:"text",label:T(N.REQUEST_HEADERS),name:"headers",onChange:i,placeholder:'{"Content-Type": "application/json", "X-Custom-Header": "foo"}',valid:r.headers,value:e.headers})}),u.jsx("label",{className:"mb-2 block",children:u.jsx(On,{errorText:T(N.ERROR_INVALID_JSON),inputMode:"text",label:T(N.REQUEST_BODY),name:"body",onChange:i,placeholder:T(N.STRING_OR_JSON),valid:r.body,value:e.body??""})})]}),u.jsx(Bf,{nodeData:e,handleOnUpdate:t})]})},AL=({nodeData:e,handleOnUpdate:t})=>{const n=w.useRef();return u.jsx(Ze,{formRef:n,title:T(N.CONDITIONS),children:u.jsx("div",{children:u.jsx(Bf,{nodeData:e,handleOnUpdate:t})})})},IL=({nodeData:e,handleOnUpdate:t})=>{const{validateField:n}=lt("executeSWML"),[r,o]=w.useState({dest:e.initial||n("dest",e.dest),meta:e.initial||n("meta",e.meta),params:e.initial||n("params",e.params)}),i=s=>{const a=s.target,{name:l,value:c}=a;switch(t({initial:!1}),l){case"dest":case"params":case"meta":o({...r,[l]:n(l,c)}),t({[l]:c});break;default:throw new Error(`Unhandled input name: ${l}`)}};return u.jsxs(Ze,{title:T(N.EXECUTE_SWML),children:[u.jsxs("div",{className:"border-b-4 border-foreground/10 px-3",children:[u.jsxs("label",{className:"mb-2 block",children:[T(N.URL),u.jsx("input",{className:`w-full ${r.dest?"":"invalid"}`,name:"dest",onChange:i,placeholder:"https://u:p@test.com/go.swml",type:"text",value:e.dest}),u.jsx("p",{className:"requirements w-full",role:"alert",children:T(N.ERROR_VALUE_IS_REQUIRED)})]}),u.jsx("label",{className:"mb-2 block",children:u.jsx(On,{errorText:T(N.ERROR_INVALID_JSON),inputMode:"text",label:T(N.PARAMS),name:"params",onChange:i,placeholder:'{"Content-Type": "application/json", "X-Custom-Header": "foo"}',valid:r.params,value:e.params??""})}),u.jsx("label",{className:"mb-2 block",children:u.jsx(On,{errorText:T(N.ERROR_INVALID_JSON),inputMode:"text",label:T(N.META),name:"meta",onChange:i,placeholder:T(N.JSON_OBJECT),valid:r.meta,value:e.meta??""})})]}),u.jsx(Bf,{nodeData:e,handleOnUpdate:t,placeholder:"return_value === '1'"})]})},bL={forwardAddress:{add:N.ADD_ADDRESS,call:N.CALL_ADDRESSES,optionNumber:N.ADDRESS_NUMBER,remove:N.REMOVE_ADDRESS,title:N.FORWARD_TO_ADDRESS},forwardPhone:{add:N.ADD_PHONE_NUMBER,call:N.CALL_NUMBERS,optionNumber:N.PHONE_NUMBER_NUMBER,remove:N.REMOVE_PHONE_NUMBER,title:N.FORWARD_TO_PHONE},forwardResource:{add:N.ADD_RESOURCE,call:N.CALL_RESOURCES,optionNumber:N.RESOURCE_NUMBER,remove:N.REMOVE_RESOURCE,title:N.FORWARD_TO_RESOURCE}},Q0={parallel:N.SIMULTANEOUSLY,serial:N.SEQUENTIALLY},CL=()=>({connectFrom:"",connectTimeout:"",connectTo:"",id:ie()}),zf=({nodeType:e,nodeData:t,handleOnUpdate:n})=>{var y,g,m;const{validateField:r}=lt(e),o=w.useRef(),[i,s]=w.useState(["serial","parallel"].includes(t.callOrder)?t.callOrder:"serial"),a=bL[e],[l,c]=w.useState({callOrder:t.initial||r("callOrder",i),callStateEvents:t.initial||r("callStateEvents",i),callStateUrl:t.initial||r("callStateUrl",i),connections:(y=t.connections)==null?void 0:y.map(_=>({connectFrom:r("connectFrom",_.connectFrom),connectTimeout:r("connectTimeout",_.connectTimeout),connectTo:r("connectTo",_.connectTo),initial:t.initial})),defaultFrom:t.initial||r("defaultFrom",t.defaultFrom),defaultTimeout:t.initial||r("defaultTimeout",t.defaultTimeout)}),d=_=>{_.preventDefault(),c({...l,connections:[...l.connections,{connectFrom:!0,connectTimeout:!0,connectTo:!0,initial:!0}]}),n({callOrder:i,connections:[...t.connections,CL()]})},f=_=>S=>{S.preventDefault();const x=[...l.connections];x.splice(_,1),c({...l,connections:x});const R=[...t.connections];R.splice(_,1),n({callOrder:R.length===1?"single":i,connections:R})},p=(_,S)=>{const x=[...t.connections];if(!x[_])throw new Error(`Option not found at index ${_}`);const{name:R,value:I}=S,L=[...l.connections];L[_]={...L[_],initial:!1,[R]:r(R,I)},c({...l,connections:L}),x[_]={...x[_],[R]:I},n({connections:x,initial:!1})},h=_=>{const S=_.currentTarget.value;s(S),n({callOrder:S})},E=(_,S)=>{const x=_.target,{name:R,value:I}=x;switch(R){case"callStateEvents":case"callStateUrl":case"defaultTimeout":case"defaultFrom":c({...l,[R]:r(R,I)}),n({initial:!1,[R]:I});break;case"connectFrom":case"connectTimeout":case"connectTo":if(S===void 0)throw new Error(`Option index not provided: ${R}`);p(S,{name:R,value:I});break;default:throw new Error(`Unhandled input name: ${R}`)}},v=({index:_,name:S})=>{const x=l.connections[_];return!!(x!=null&&x[S]||x!=null&&x.initial)};return u.jsxs(Ze,{title:T(a.title),formRef:o,children:[u.jsxs("div",{className:"border-b-4 border-foreground/10 px-3 pb-3",children:[u.jsxs("label",{className:"mb-2 block",children:[T(N.DEFAULT_FROM),u.jsx(Es,{className:"w-full",direction:"from",name:"defaultFrom",onChange:E,placeholder:T(N.FROM),type:"tel",value:t.defaultFrom,valid:l.defaultFrom}),u.jsx("p",{className:"requirements w-full",role:"alert",children:T(N.ERROR_VALUE_IS_REQUIRED)})]}),u.jsxs("label",{className:"mb-2 block",children:[T(N.DEFAULT_TIMEOUT),u.jsxs("div",{className:"flex flex-wrap items-center gap-x-2",children:[u.jsx("input",{className:`w-14 ${l.defaultTimeout?"":"invalid"}`,inputMode:"numeric",min:0,name:"defaultTimeout",onChange:E,placeholder:T(N.SECONDS),type:"number",value:t.defaultTimeout}),u.jsx("p",{className:"requirements w-full",role:"alert",children:T(N.ERROR_NUMBER_IS_REQUIRED)})]})]}),u.jsxs("label",{className:"mb-2 block",children:[T(N.CALL_STATE_URL),u.jsx("input",{className:`w-full ${l.callStateUrl?"":"invalid"}`,name:"callStateUrl",onChange:E,placeholder:"https://example.com/api",type:"url",value:t.callStateUrl}),u.jsx("p",{className:"requirements w-full",role:"alert",children:T(N.ERROR_VALUE_IS_REQUIRED)})]}),u.jsxs("label",{className:"mb-2 block",children:[T(N.CALL_STATE_EVENTS),u.jsx("input",{className:`w-full ${l.callStateEvents?"":"invalid"}`,name:"callStateEvents",onChange:E,placeholder:"Created, ringing, answered, ended",type:"text",value:t.callStateEvents}),u.jsx("p",{className:"requirements w-full",role:"alert",children:T(N.ERROR_VALUE_IS_REQUIRED)})]})]}),u.jsx("ul",{className:"border-foreground-10 divide-y-4 divide-foreground/10 border-b-4",children:(g=t.connections)==null?void 0:g.map((_,S,x)=>u.jsxs("li",{className:"flex pt-3",children:[u.jsx("div",{className:"w-8 shrink-0 text-center",children:u.jsx(te,{className:"text-foreground/60",size:"xs",tag:"bars"})}),u.jsxs("div",{className:"relative mr-3",children:[x.length>1&&u.jsx(Bo,{className:"absolute right-0 top-0",handleDelete:f(S),label:T(a.remove,{index:S+1}),size:"sm",show:!0}),u.jsxs("fieldset",{children:[u.jsx("legend",{children:T(a.optionNumber,{index:S+1})}),u.jsxs("label",{className:"mb-1 block",children:[u.jsx("div",{className:"sr-only",children:T(N.TO)}),u.jsx(Es,{className:"w-full",direction:"to",name:"connectTo",onChange:R=>E(R,S),type:e==="forwardPhone"?"tel":"text",valid:v({index:S,name:"connectTo"}),value:_.connectTo}),u.jsx("p",{className:"requirements",role:"alert",children:T(N.ERROR_VALUE_IS_REQUIRED)})]}),u.jsxs("label",{className:"mb-2 block",children:[u.jsx("div",{className:"sr-only",children:T(N.FROM)}),u.jsx(Es,{className:"w-full",direction:"from",name:"connectFrom",onChange:R=>E(R,S),placeholder:T(N.FROM),type:"text",valid:v({index:S,name:"connectFrom"}),value:_.connectFrom}),u.jsx("p",{className:"requirements",role:"alert",children:T(N.ERROR_VALUE_IS_REQUIRED)})]}),u.jsxs("label",{className:"mb-2 block",children:[T(N.TIMEOUT),u.jsxs("div",{className:"flex flex-wrap items-center gap-x-2",children:[u.jsx("input",{className:`w-14 ${v({index:S,name:"connectTimeout"})?"":"invalid"}`,inputMode:"numeric",min:0,name:"connectTimeout",onChange:R=>E(R,S),placeholder:T(N.SECONDS),type:"number",value:_.connectTimeout}),u.jsx("p",{className:"requirements w-full",role:"alert",children:T(N.ERROR_NUMBER_IS_REQUIRED)})]})]})]})]})]},_.id))}),u.jsx("div",{className:"p-3 pb-6 text-right",children:u.jsx("button",{className:"rounded bg-foreground/10 py-1 px-2 font-medium",onClick:d,type:"button",children:T(a.add)})}),((m=t.connections)==null?void 0:m.length)>1&&u.jsx("div",{className:"mb-4 px-3",children:u.jsx(an,{className:"w-full",label:T(a.call),name:"callOrder",onChange:h,value:i,children:Object.keys(Q0).map(_=>u.jsx("option",{value:_,children:T(Q0[_])},_))})})]})},LL=()=>({command:"",digit:"",id:ie()}),DL=({nodeData:e,handleOnUpdate:t})=>{const{validateField:n}=lt("promptPlay"),r=w.useRef(),[o,i]=w.useState({digitTimeout:e.initial||n("digitTimeout",e.digitTimeout),initialTimeout:e.initial||n("initialTimeout",e.initialTimeout),options:e.options.map(h=>({command:n("command",h.command),digit:n("digit",h.digit),initial:e.initial}))}),s=ar(e.options,"command"),a=ar(e.options,"digit"),l=h=>{h.preventDefault(),i({...o,options:[...o.options,{command:!0,digit:!0,initial:!0}]}),t({options:[...e.options,LL()]})},c=h=>E=>{E.preventDefault();const v=[...o.options];v.splice(h,1),i({...o,options:v});const y=[...e.options];y.splice(h,1),t({options:y})},d=(h,E)=>{const v=[...e.options];if(!v[h])throw new Error(`Option not found at index ${h}`);const{name:y,value:g}=E,m=[...o.options];m[h]={...m[h],initial:!1,[y]:n(y,g)},i({...o,options:m}),v[h]={...v[h],[y]:g},t({options:v})},f=(h,E)=>{const v=h.target,{name:y,value:g}=v;switch(t({initial:!1}),y){case"digit":case"command":E!==void 0&&d(E,{name:y,value:g});break;case"digitTimeout":case"initialTimeout":{i({...o,[y]:n(y,g)}),t({[y]:g});break}default:throw new Error(`Unhandled input field name: ${y}`)}},p=({index:h,name:E})=>{var g;const v=o.options[h];if(v!=null&&v.initial)return!0;if(!(v!=null&&v[E]))return!1;const y=(g=e.options)==null?void 0:g[h];return It(y==null?void 0:y.digit)||It(y==null?void 0:y.command)};return u.jsxs(Ze,{formRef:r,title:T(N.GATHER_INPUT),children:[u.jsx("div",{className:"border-b-4 border-foreground/10 px-3 pb-3",children:u.jsx(W0,{handleOnUpdate:t,label:T(N.CHOOSE_OPTION_TTS_AUDIO),nodeData:e})}),u.jsx("ol",{className:"divide-y-4 divide-foreground/10 border-b-4 border-foreground/10",children:e.options.map((h,E,v)=>{const y=s(h.command),g=a(h.digit);return u.jsxs("li",{className:"flex pt-3",children:[u.jsx("div",{className:"w-8 shrink-0 text-center",children:u.jsx(te,{className:"text-foreground/60",size:"xs",tag:"bars"})}),u.jsxs("div",{className:"relative mr-3",children:[v.length>1&&u.jsx(Bo,{className:"absolute right-0 top-0",handleDelete:c(E),label:T(N.REMOVE_OPTION,{index:E+1}),size:"sm",show:!0}),u.jsxs("fieldset",{children:[u.jsx("legend",{className:"sr-only",children:T(N.OPTION_NUMBER,{index:E+1})}),u.jsxs("label",{className:"mb-2 block",children:[T(N.CALLER_PRESSES),u.jsx("input",{className:`${p({index:E,name:"digit"})&&!g?"":"invalid"}`,name:"digit",onChange:m=>f(m,E),placeholder:T(N.KEYPAD_VALUE),type:"text",value:h.digit}),u.jsx("p",{className:"requirements",role:"alert",children:T(g?N.ERROR_DUPLICATE_TELEPHONE_KEY:N.ERROR_TELEPHONE_KEY_REQUIRED)})]}),u.jsxs("label",{className:"mb-2 block",children:[T(N.OR_SAYS),u.jsx("input",{className:`w-full ${p({index:E,name:"command"})&&!y?"":"invalid"}`,name:"command",onChange:m=>f(m,E),placeholder:T(N.SPOKEN_PROMPT),type:"text",value:h.command}),u.jsx("p",{className:"requirements",role:"alert",children:T(y?N.ERROR_DUPLICATE_COMMAND:N.ERROR_TEXT_IS_REQUIRED)})]})]})]})]},h.id)})}),u.jsx("div",{className:"p-3 pb-6 text-right",children:u.jsx("button",{className:"rounded bg-foreground/10 py-1 px-2 font-medium",onClick:l,type:"button",children:T(N.ADD_OPTION)})}),u.jsxs("div",{className:"px-3",children:[u.jsxs("label",{className:"mb-2 block",children:[u.jsx("div",{className:"w-full",children:T(N.WAIT_FOR_INPUT)}),u.jsxs("div",{className:"flex flex-wrap items-center gap-x-2",children:[u.jsx("input",{className:`w-14 ${o.initialTimeout?"":"invalid"}`,inputMode:"numeric",min:ge.MIN,max:ge.MAX,name:"initialTimeout",onChange:f,placeholder:T(N.SECONDS),type:"number",value:e.initialTimeout}),u.jsx("p",{className:"requirements w-full",role:"alert",children:T(N.ERROR_NUMBER_MIN_MAX_IS_REQUIRED,{max:ge.MAX,min:ge.MIN})})]})]}),u.jsxs("label",{children:[u.jsx("div",{className:"w-full",children:T(N.WAIT_FOR_DIGIT)}),u.jsxs("div",{className:"flex flex-wrap items-center gap-x-2",children:[u.jsx("input",{className:`w-14 ${o.digitTimeout?"":"invalid"}`,inputMode:"numeric",min:ge.MIN,max:ge.MAX,name:"digitTimeout",onChange:f,placeholder:T(N.SECONDS),type:"number",value:e.digitTimeout}),u.jsx("p",{className:"requirements w-full",role:"alert",children:T(N.ERROR_NUMBER_MIN_MAX_IS_REQUIRED,{max:ge.MAX,min:ge.MIN})})]})]})]})]})},kL=({handleOnUpdate:e,nodeData:t})=>{const{validateField:n}=lt("play"),[r,o]=w.useState({reason:t.initial||n("reason",t.reason)}),i=s=>{const a=s.target,{name:l,value:c}=a;switch(l){case"reason":o({...r,[l]:n(l,c)}),e({initial:!1,[l]:c});break;default:throw new Error(`Unhandled input name: ${l}`)}};return u.jsx(Ze,{title:T(N.HANG_UP_CALL),children:u.jsx("div",{className:"mx-3",children:u.jsxs(an,{className:"w-full",label:`${T(N.REASON)} (${T(N.OPTIONAL)})`,name:"reason",onChange:i,value:t.reason,children:[u.jsx("option",{value:"",children:T(N.SELECT)}),Object.keys($f).map(s=>u.jsx("option",{value:s,children:T($f[s])},s))]})})})},PL=({nodeData:e,handleOnUpdate:t})=>{const n=w.useRef();return u.jsx(Ze,{formRef:n,title:T(N.PLAY_AUDIO_TTS),children:u.jsx("div",{className:"mx-3",children:u.jsx(W0,{handleOnUpdate:t,label:T(N.CHOOSE_OPTION_TTS_AUDIO),nodeData:e,showDefaultOption:!0})})})},ML=({nodeData:e,handleOnUpdate:t})=>{const n=w.useRef(),{validateField:r}=lt("recordCallStart"),[o,i]=w.useState({label:e.initial||r("label",e.label)}),[s,a]=w.useState(!1),{upsertEntry:l,isValueDuplicate:c}=kf();w.useEffect(()=>{a(c(e.label,e.controlId))},[c,e.controlId,e.label]);const d=f=>{const p=f.target,{name:h,value:E}=p;i({...o,[h]:r(h,E)}),t({initial:!1,[h]:E}),l({controlId:e.controlId,label:E})};return u.jsxs(Ze,{title:T(N.RECORD_CALL_START),formRef:n,children:[u.jsx("div",{className:"px-3 pb-3",children:u.jsxs("label",{children:[T(N.RECORDING_NAME),u.jsx("input",{className:`w-full ${o.label&&!s?"":"invalid"}`,name:"label",onChange:d,type:"text",value:e.label}),u.jsx("p",{className:"requirements",role:"alert",children:T(s?N.ERROR_DUPLICATE_RECORDING_LABEL:N.ERROR_RECORDING_LABEL_REQUIRED)})]})}),u.jsx("div",{className:"px-3",children:u.jsx(G0,{handleOnUpdate:t,nodeData:e,type:"call"})})]})},jL=({nodeData:e,handleOnUpdate:t})=>{const{validateField:n}=lt("recordCallStop"),[r,o]=w.useState({controlId:e.initial||n("controlId",e.controlId)}),{getEntries:i}=kf(),s=i().sort((l,c)=>l.label.toLowerCase().localeCompare(c.label.toLowerCase())),a=l=>{const c=l.target,{name:d,value:f}=c;o({...r,[d]:n(d,f)}),t({initial:!1,[d]:f})};return u.jsx(Ze,{title:T(N.RECORD_CALL_STOP),children:u.jsx("div",{className:"px-3",children:s.length?u.jsxs(an,{className:`w-full ${r.controlId?"":"invalid"}`,label:T(N.RECORDING_NAME),name:"controlId",value:e.controlId,onChange:a,children:[u.jsx("option",{value:"",children:T(N.SELECT)}),s.map(l=>u.jsx("option",{value:l.controlId,children:l.label},l.controlId))]}):u.jsx("p",{role:"alert",className:"text-negative",children:T(N.ERROR_ADD_RECORDING_FIRST)})})})},UL=({nodeData:e,handleOnUpdate:t})=>u.jsx(Ze,{title:T(N.VOICEMAIL_RECORDING),children:u.jsx("div",{className:"mx-3",children:u.jsx(G0,{handleOnUpdate:t,nodeData:e,type:"voicemail"})})}),FL=["GET","POST","PUT","DELETE"],VL=({nodeData:e,handleOnUpdate:t})=>{const{validateField:n}=lt("request"),[r,o]=w.useState({body:e.initial||n("body",e.body),headers:e.initial||n("headers",e.headers),method:e.initial||n("method",e.method),saveVariables:e.initial||n("saveVariables",e.saveVariables),url:e.initial||n("url",e.url)}),i=l=>{const c=l.target,{name:d,value:f}=c;switch(t({initial:!1}),d){case"url":case"method":o({...r,[d]:n(d,f)}),t({[d]:f});break;case"headers":o({...r,[d]:n(d,f)}),t({[d]:f});break;case"body":o({...r,[d]:n(d,f)}),t({[d]:f});break;default:throw new Error(`Unhandled input name: ${d}`)}},s=l=>{const{name:c,value:d}=l.target;t({[c]:d})},a=l=>{const{name:c}=l.target,d=!e[c];t({[c]:d})};return u.jsx(Ze,{title:T(N.REQUEST),children:u.jsxs("div",{className:"px-3",children:[u.jsxs("label",{className:"mb-2 block",children:[T(N.URL),u.jsx("input",{className:`w-full ${r.url?"":"invalid"}`,name:"url",onChange:i,placeholder:"https://u:p@example.com/api/status",type:"text",value:e.url}),u.jsx("p",{className:"requirements w-full",role:"alert",children:T(N.ERROR_VALUE_IS_REQUIRED)})]}),u.jsx("div",{className:"mb-1",children:u.jsx(an,{className:"w-full",label:T(N.METHOD),name:"method",onChange:s,value:e.method,children:FL.map(l=>u.jsx("option",{value:l,children:l},l))})}),u.jsx("div",{className:"mb-4",children:u.jsx(pf,{checked:e.saveVariables,clickHandler:a,name:"saveVariables",subtitle:T(N.SAVE_VARIABLES_SUBTITLE),title:T(N.SAVE_VARIABLES)})}),u.jsx("label",{className:"mb-2 block",children:u.jsx(On,{errorText:T(N.ERROR_INVALID_JSON),inputMode:"text",label:T(N.REQUEST_HEADERS),name:"headers",onChange:i,placeholder:'{"Content-Type": "application/json", "X-Custom-Header": "foo"}',valid:r.headers,value:e.headers})}),u.jsx("label",{children:u.jsx(On,{errorText:T(N.ERROR_INVALID_JSON),inputMode:"text",label:T(N.REQUEST_BODY),name:"body",onChange:i,placeholder:T(N.STRING_OR_JSON),valid:r.body,value:e.body??""})})]})})},$L=({nodeData:e,handleOnUpdate:t})=>{const{validateField:n}=lt("sendSms"),[r,o]=w.useState({body:e.initial||n("body",e.body),fromNumber:e.initial||n("fromNumber",e.fromNumber),toNumber:e.initial||n("toNumber",e.toNumber)}),i=s=>{const a=s.target,{name:l,value:c}=a;switch(l){case"body":case"fromNumber":case"toNumber":o({...r,[l]:n(l,c)}),t({initial:!1,[l]:c});break;default:throw new Error(`Unhandled input name: ${l}`)}};return u.jsx(Ze,{title:T(N.SEND_SMS),children:u.jsxs("div",{className:"mx-3",children:[u.jsxs("label",{className:"mb-2 block",children:[T(N.TO_PHONE_NUMBER),u.jsx(Es,{className:"w-full",direction:"to",name:"toNumber",onChange:i,placeholder:"+12405550000",type:"tel",valid:r.toNumber,value:e.toNumber}),u.jsx("p",{className:"requirements w-full",role:"alert",children:T(N.ERROR_VALUE_IS_REQUIRED)})]}),u.jsxs("label",{className:"mb-2 block",children:[T(N.FROM_PHONE_NUMBER),u.jsx(Es,{className:"w-full",direction:"from",name:"fromNumber",onChange:i,placeholder:"+12405550000",type:"tel",valid:r.fromNumber,value:e.fromNumber}),u.jsx("p",{className:"requirements w-full",role:"alert",children:T(N.ERROR_VALUE_IS_REQUIRED)})]}),u.jsx("label",{children:u.jsx(On,{errorText:T(N.ERROR_VALUE_IS_REQUIRED),inputMode:"text",label:T(N.SMS_TEXT),name:"body",onChange:i,placeholder:T(N.WRITE_SOMETHING),valid:r.body,value:e.body})})]})})},BL=()=>({id:ie(),key:"",value:""}),HL=({nodeData:e,handleOnUpdate:t})=>{var f;const{validateField:n}=lt("set"),[r,o]=w.useState({variables:e.variables.map(p=>({key:e.initial||n("key",p.key),value:e.initial||n("value",p.value)}))}),i=ar(e.variables,"key"),s=p=>{p==null||p.preventDefault(),o({...r,variables:[...r.variables,{key:!0,value:!0}]}),t({variables:[...e.variables,BL()]})},a=(p,h)=>{const E=[...e.variables];let v=E[p];if(!v)throw new Error(`Variable not found at index ${p}`);const{name:y,value:g}=h,m=[...r.variables];m[p]={...m[p],[y]:n(y,g)},o({...r,variables:m}),v={...E[p],[y]:g},E[p]=v,t({initial:!1,variables:E})},l=p=>h=>{h.preventDefault();const E=[...r.variables];E.splice(p,1),o({...r,variables:E});const v=[...e.variables];v.splice(p,1),t({variables:v})},c=(p,h)=>{const E=p.target,{name:v,value:y}=E;switch(v){case"key":case"value":h!==void 0&&a(h,{name:v,value:y});break;default:throw new Error(`Unhandled input name: ${v}`)}},d=({index:p,name:h})=>{const E=r.variables[p];return E==null?void 0:E[h]};return u.jsxs(Ze,{title:T(N.SET_VARIABLES),children:[u.jsx("ol",{className:"divide-y-4 divide-foreground/10 border-b-4 border-foreground/10",children:(f=e.variables)==null?void 0:f.map((p,h,E)=>{const v=i(p.key);return u.jsxs("li",{className:"flex pt-3",children:[u.jsx("div",{className:"w-8 shrink-0 text-center",children:u.jsx(te,{className:"text-foreground/60",size:"xs",tag:"bars"})}),u.jsxs("div",{className:"relative mr-3",children:[E.length>1&&u.jsx(Bo,{className:"absolute right-0 top-0",handleDelete:l(h),label:T(N.REMOVE_VARIABLE,{index:h+1}),size:"sm",show:!0}),u.jsxs("fieldset",{children:[u.jsx("legend",{className:"sr-only",children:T(N.VARIABLE_NUMBER,{index:h+1})}),u.jsxs("label",{className:"mb-2 block",children:[T(N.KEY),u.jsx("input",{className:`w-full ${d({index:h,name:"key"})&&!v?"":"invalid"}`,name:"key",onChange:y=>c(y,h),type:"text",value:p.key}),u.jsx("p",{className:"requirements",role:"alert",children:T(v?N.ERROR_DUPLICATE_VARIABLE_KEY:N.ERROR_VARIABLE_KEY_REQUIRED)})]}),u.jsxs("label",{className:"mb-2 block",children:[T(N.VALUE),u.jsx("input",{className:`w-full ${d({index:h,name:"value"})?"":"invalid"}`,name:"value",onChange:y=>c(y,h),type:"text",value:p.value}),u.jsx("p",{className:"requirements",role:"alert",children:T(N.ERROR_TEXT_IS_REQUIRED)})]})]})]})]},p.id)})}),u.jsx("div",{className:"p-3 text-right",children:u.jsx("button",{className:"rounded bg-foreground/10 py-1 px-2 font-medium",onClick:s,type:"button",children:T(N.ADD_VARIABLE)})})]})},zL=(e,t)=>{w.useEffect(()=>{var o;const n=(o=e.current)==null?void 0:o.getRootNode(),r=i=>{var a;const s=i.target;s instanceof Node&&!((a=e.current)!=null&&a.contains(s))&&t(i)};return n&&n.addEventListener("pointerdown",r),()=>{n&&n.removeEventListener("pointerdown",r)}},[e,t])},X0=e=>{const[t,n]=w.useReducer((r,o)=>({...r,...o}),e);return[t,n]},WL=e=>({id:ie(),key:e}),GL=({nodeData:e,handleOnUpdate:t})=>{const i={currentFocus:void 0,listOpen:!1,setVariablesList:Y(y=>y.nodes).reduce((y,g)=>{if(g.type==="set"){const m=g.data.variables.map(_=>({id:_.id,key:_.key}));return[...y,...m]}else if(g.type==="unset")return[...y,...g.data.variables];return y},[]).reduce((y,g)=>(y.find(m=>m.key===g.key)||y.push(g),y),[]).map(y=>({...y,selected:!!e.variables.find(g=>g.key===y.key)})).sort((y,g)=>y.key.toLowerCase().localeCompare(g.key.toLowerCase()))},[s,a]=X0(i),l=y=>s.setVariablesList.map(g=>g.id===y?{...g,selected:!g.selected}:g),c=y=>{const g=s.setVariablesList.find(m=>m.id===y);if(!g)throw new Error("Variable not found");if(g.selected)d(g.id);else{const m=[...e.variables,WL(g.key)];a({setVariablesList:l(g.id)}),t({variables:m})}},d=y=>{const g=s.setVariablesList.filter(m=>m.selected&&m.id!==y);a({setVariablesList:l(y)}),t({variables:g})},f=w.useRef(null);zL(f,()=>a({listOpen:!1}));const p=y=>{(y.key==="Escape"||y.key==="Esc")&&a({listOpen:!1})},h=(y,g)=>{y.preventDefault(),(y.key===" "||y.code==="Space"||y.key==="Enter")&&c(g),p(y)},E=()=>{a({listOpen:!s.listOpen})},v=e.variables.length;return u.jsx(Ze,{title:T(N.UNSET_VARIABLES),children:u.jsxs("div",{className:"px-3",children:[u.jsxs("div",{className:"mb-2 flex flex-col",children:[u.jsx("label",{id:"listbox-label",className:"sr-only",children:T(N.SELECT_VARIABLES_TO_UNSET)}),u.jsxs("div",{className:"relative",ref:f,children:[u.jsx("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
68
- after:absolute after:top-[.725rem] after:right-3 after:h-0 after:w-0 after:border-[5px] after:border-t-[6px] after:border-b-0 after:border-r-transparent after:border-l-transparent after:border-t-foreground after:content-['']`,onClick:E,onKeyDown:p,type:"button",children:v>0?T(N.NUMBER_OF_VARIABLES_SELECTED,{count:v}):T(N.SELECT_VARIABLES)}),s.listOpen&&u.jsxs("ul",{"aria-activedescendant":s.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:[!s.setVariablesList.length&&u.jsx("li",{"aria-disabled":"true",className:"relative",role:"option",children:u.jsx("label",{className:"flex select-none items-center py-2 pl-3 pr-9",children:T(N.NO_VARIABLES_SET)})}),s.setVariablesList.map(y=>{if(y.key)return u.jsx("li",{"aria-selected":y.selected,className:"relative",id:y.id,role:"option",children:u.jsxs("label",{className:"flex select-none items-center py-2 pl-3 pr-9",children:[u.jsx("input",{checked:y.selected,className:"mr-2 h-4 w-4 rounded accent-primary",onChange:()=>c(y.id),onKeyDown:g=>h(g,y.id),type:"checkbox"}),y.key]})},y.id)})]})]})]}),v>0&&u.jsxs("section",{className:"pt-3",children:[u.jsx("h3",{className:"mb-2 text-xs font-medium text-foreground",children:T(N.UNSET_VARIABLES)}),u.jsx("ul",{className:"flex flex-wrap gap-2",children:s.setVariablesList.map(y=>y.selected&&u.jsx(Qb,{handleClick:()=>d(y.id),children:y.key},y.id))})]})]})})},q0={aiAgent:({data:e,formUpdate:t})=>u.jsx(wL,{handleOnUpdate:t,nodeData:e}),cond:({data:e,formUpdate:t})=>u.jsx(AL,{handleOnUpdate:t,nodeData:e}),condRequest:({data:e,formUpdate:t})=>u.jsx(TL,{handleOnUpdate:t,nodeData:e}),executeSWML:({data:e,formUpdate:t})=>u.jsx(IL,{handleOnUpdate:t,nodeData:e}),forwardAddress:({data:e,formUpdate:t})=>u.jsx(zf,{handleOnUpdate:t,nodeData:e,nodeType:"forwardAddress"}),forwardPhone:({data:e,formUpdate:t})=>u.jsx(zf,{handleOnUpdate:t,nodeData:e,nodeType:"forwardPhone"}),forwardResource:({data:e,formUpdate:t})=>u.jsx(zf,{handleOnUpdate:t,nodeData:e,nodeType:"forwardResource"}),hangup:({data:e,formUpdate:t})=>u.jsx(kL,{handleOnUpdate:t,nodeData:e}),play:({data:e,formUpdate:t})=>u.jsx(PL,{handleOnUpdate:t,nodeData:e}),promptPlay:({data:e,formUpdate:t})=>u.jsx(DL,{handleOnUpdate:t,nodeData:e}),record:({data:e,formUpdate:t})=>u.jsx(UL,{handleOnUpdate:t,nodeData:e}),recordCallStart:({data:e,formUpdate:t})=>u.jsx(ML,{handleOnUpdate:t,nodeData:e}),recordCallStop:({data:e,formUpdate:t})=>u.jsx(jL,{handleOnUpdate:t,nodeData:e}),request:({data:e,formUpdate:t})=>u.jsx(VL,{handleOnUpdate:t,nodeData:e}),sendSms:({data:e,formUpdate:t})=>u.jsx($L,{handleOnUpdate:t,nodeData:e}),set:({data:e,formUpdate:t})=>u.jsx(HL,{handleOnUpdate:t,nodeData:e}),unset:({data:e,formUpdate:t})=>u.jsx(GL,{handleOnUpdate:t,nodeData:e})},YL=(e,t)=>{if("options"in t)switch(e.type){case"promptPlay":case"cond":case"condRequest":return!0}return!1},KL=e=>{if(e in q0)return q0[e]},QL=()=>{var c;const{partialUpdateNodeData:e,removeNode:t}=xe(),n=Y(d=>d.selectedNode),r=n==null?void 0:n.id,i=(c=Y(d=>d.nodes).find(d=>d.id===r))==null?void 0:c.data,{updateDynamicHandles:s}=gL(n);if(!(n&&i&&r))return null;const a=d=>{YL(n,d)&&s(d),e(r,d)},l=KL(n.type);return l?u.jsxs(ns,{className:"nokey m-0 flex h-full w-[260px] flex-col overflow-hidden rounded-none border border-foreground/10 bg-background pt-4",position:"top-right",children:[u.jsx(l,{data:i,formUpdate:a},r),n.deletable!==!1&&u.jsx("div",{className:"border-t border-foreground/10 p-3",children:u.jsx(Bo,{handleDelete:()=>t(r),label:T(N.DELETE_NODE),show:!0,showLabel:!0})})]}):null},J0=w.forwardRef(function({animate:t=!0,children:n,className:r="",iconTag:o="circle-info",message:i,role:s="alertdialog",status:a},l){const d=a?{error:"bg-negative text-background",success:"bg-positive text-background"}[a]:"";return u.jsxs("div",{className:`flex items-center justify-between rounded-lg bg-foreground p-2
63
+ ${s}`})},_2=H.forwardRef(function(t,n){const{children:r,style:o,...s}=t,i=Af(),l=Yy([i.refs.setFloating,n]);return i.open?d.jsxs("div",{className:"relative max-w-md rounded-md bg-foreground p-2 text-sm text-background shadow-sm",ref:l,style:{left:i.x??0,position:i.strategy,top:i.y??0,visibility:i.x==null?"hidden":"visible",zIndex:10,...o},...i.getFloatingProps(s),children:[d.jsx("div",{className:"overflow-hidden",children:r}),d.jsx(v2,{})]}):null}),S2=O.forwardRef(function({children:t,asChild:n=!1,...r},o){const s=Af(),i=Yy([s.refs.setReference,o,t==null?void 0:t.ref]);return n&&O.isValidElement(t)?O.cloneElement(t,s.getReferenceProps({ref:i,...r,...t.props,"data-state":s.open?"open":"closed"})):d.jsx("button",{ref:i,"data-state":s.open?"open":"closed",...s.getReferenceProps(r),children:t})}),rv={bottom:"top",left:"right",right:"left",top:"bottom"},Zn=({asChild:e=!0,children:t,enable:n=!0,placement:r="right",scale:o=1,trigger:s=d.jsx(re,{tag:"circle-info"}),...i})=>{let l=r.split("-")[0];return l=Object.keys(rv).includes(l)?l:"right",n?d.jsxs(E2,{...i,placement:r,children:[d.jsx(S2,{asChild:e,children:s}),d.jsx(_2,{style:o!==1?{transform:`scale(${o})`,transformOrigin:rv[l]}:void 0,children:t})]}):d.jsx(d.Fragment,{children:s})},x2={ABOUT:"About",ACTION:"Action",ADD_ADDRESS:"Add address",ADD_AI_AGENT:"Add AI agent",ADD_CONDITION:"Add condition",ADD_OPTION:"Add option",ADD_PHONE_NUMBER:"Add phone number",ADD_RESOURCE:"Add resource",ADD_SWML_SCRIPTS:"Add SWML Scripts",ADD_VARIABLE:"Add variable",ADDRESS_NUMBER:"Address {{index}}",AI_AGENT:"AI Agent",AI_AGENT_NAME:"AI Agent Name",ANSWER_CALL:"Answer Call",ARE_YOU_SURE:"Are you sure?",AUDIO_FILE:"Audio File",BEEP:"Beep",BEEP_SUBTITLE:"Play a beep before recording",BUSY:"Busy",CALL_ADDRESSES:"Call Addresses",CALL_NUMBERS:"Call Numbers",CALL_RESOURCES:"Call Resources",CALL_STATE_EVENTS:"Call State Events",CALL_STATE_URL:"Call State URL",CALLER_PRESSES:"Caller presses",CALLER_SAYS:"Caller says",CANCEL:"Cancel",CAUTION:"Caution",CHOOSE_OPTION_TTS_AUDIO:"Choose how to play the message",CLOSE:"Close",CONDITION_NUMBER:"Condition {{index}}",CONDITIONS:"Conditions",DECISION:"Decision",DECLINE:"Decline",DEFAULT_FROM:"Default From",DEFAULT_TIMEOUT:"Default Timeout",DELETE:"Delete",DELETE_NODE:"Delete node",DEPLOY:"Deploy",DEPLOY_WARNING:"Caution - Confirm Deploy",DEPRECATED:"Deprecated",DOCUMENT_OUT_OF_SYNC:"Document Out of Sync",EDIT_SELECTED_AI_AGENT:"Edit Selected AI Agent",ELSE:"Else",END_SILENCE_TIMEOUT:"End Silence Timeout",ENABLE_WHISPER:"Enable Whisper",ENTER_URL:"Enter URL",ERROR:"Error",ERROR_ADD_AI_AGENT_FIRST:"Please add an AI Agent first.",ERROR_ADD_RECORDING_FIRST:"Please add a Start Call Recording node first.",ERROR_DUPLICATE_COMMAND:"This command is already used. Please use a unique phrase.",ERROR_DUPLICATE_RECORDING_LABEL:"This entry already exists. Please use a unique label.",ERROR_DUPLICATE_TELEPHONE_KEY:"This key is already used. Please use a unique key.",ERROR_DUPLICATE_VARIABLE_KEY:"This variable already exists. Please use a unique key.",ERROR_FETCHING_AI_AGENTS:"Error fetching AI Agents.",ERROR_FETCHING_DEPLOYED_VERSIONS:"Error fetching deployed versions.",ERROR_FETCHING_SWML_SCRIPTS:"Error fetching SWML Scripts.",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_SELECTION_REQUIRED:"A selection 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.",EXTERNAL_OPTION_LABEL:"Enter the URL of the external resource.",EXTERNAL_OR_INTERNAL_RESOURCE:"External or Internal Resource",EXTERNAL_URL:"External URL",EXECUTE_SWML:"Execute SWML",FAILED:"Failed",FAILURE:"Failure",FLOW_DATA_VERSION:"Flow Data Version",FORMAT:"Format",FORWARD:"Forward",FORWARD_TO_ADDRESS:"Forward to Address",FORWARD_TO_PHONE:"Forward to Phone",FORWARD_TO_RESOURCE:"Forward to Resource",FROM:"From",FROM_PHONE_NUMBER:"From Phone Number",GATHER_INPUT:"Gather Input",GENDER:"Gender",GO_BACK:"Go Back",HANDLE_VIA:"Handle Via",HANDLE_CALL:"Handle Call",HANG_UP:"Hang Up",HANG_UP_CALL:"Hang Up Call",HELP:"Help",HIDDEN:"Hidden",IGNORE:"Ignore",INFO_DEPLOY:"Deploy the latest changes for the current call flow.",INFO_INVALID_SETTINGS:"Please check the settings and ensure that all required fields are filled in correctly.",INFO_NODE_AI_AGENT:"<p>Used to connect to a conversational AI Agent for processing.</p><p>Choose the appropriate AI Agent or create a new one: <a>AI Agents</a></p>",INFO_NODE_COND:`<p>A condition works like a JavaScript <code>if</code> statement.</p><p>A condition field can reference variables that have been set in the flow with <code>%{Key}</code>, Request node responses accessed with <code>%{request_response['object_field']}</code>, or call parameters such as <code>%{call.from}</code>.</p><p>Add additional conditions to create <code>else if</code> conditions.</p><p>The "Cond #" path will be executed for a truthy condition. The "Else" path will be executed for a falsy condition.</p>`,INFO_NODE_CONDREQUEST:"<p>Send a GET, POST, PUT, or DELETE request to any webhook.</p><p>This can be used to submit variables and information about an inbound call to an external server, or you can retrieve information from external servers and use them as variables throughout the call flow. You can also build conditions directly into this module.</p><p>Response variables can be accessed with <code>%{request_response['object_field']}</code>.</p><p>Headers should be input in JSON format. Valid header values are <code>Accept</code>, <code>Authorization</code>, <code>Content-Type</code>, <code>Range</code>, and <code>custom X- headers</code>.</p>",INFO_NODE_EXECUTE_SWML:"Execute a remote SWML document and return to the current document. Use <code>%{return_value.['object_field']}</code> to reference the return values from the external SWML.",INFO_NODE_FORWARD_TO_ADDRESS:"Forwards the current call to the specified Address as defined within your SignalWire space.",INFO_NODE_FORWARD_TO_PHONE:"Forwards the current call to the specified phone number (must be E.164 format).",INFO_NODE_FORWARD_TO_RESOURCE:"Forwards the current call to the specified Resource as defined within your SignalWire space.",INFO_NODE_GATHER_INPUT:"Plays an audio file or Text to Speech phrase and waits for a keypress or spoken input from the caller, allowing them to proceed through the call flow based on their input.",INFO_NODE_HANG_UP:"Ends the call with the ability to provide a reason (hangup, busy, or decline).",INFO_NODE_PLAY:"Plays an audio file or Text to Speech phrase. A valid URL must be provided for the audio file to be played. Text to Speech will read aloud the provided text using the voice option that is selected.",INFO_NODE_RECORD:"Triggers foreground recording of both sides of the call and waits for the recording to end. Options can be set to enable stereo audio, play a notification beep before recording, set a digit to stop recording (terminator), and specify the recording name and format (WAV or MP3).",INFO_NODE_RECORD_CALL_START:"Triggers background recording of both sides of the call. Options can be set to enable stereo audio, play a notification beep before recording, set a digit to stop recording (terminator), and specify the recording name and format (WAV or MP3).",INFO_NODE_RECORD_CALL_STOP:"Triggers a background call recording to stop at a specific point in the call flow, if it has not already been terminated.",INFO_NODE_REQUEST:"<p>Send a GET, POST, PUT, or DELETE request to any webhook.</p><p>This can be used to submit variables and information about an inbound call to an external server, or you can retrieve information from external servers and use them as variables throughout the call flow. You can also build conditions directly into this module.</p><p>Response variables can be accessed with <code>%{request_response['object_field']}</code>.</p><p>Headers should be input in JSON format. Valid header values are <code>Accept</code>, <code>Authorization</code>, <code>Content-Type</code>, <code>Range</code>, and <code>custom X- headers</code>.</p>",INFO_NODE_SEND_SMS:"Sends an SMS message to the specified phone number. The 'From' phone number must be enabled for messaging (a 10DLC number assigned to an active TCR campaign or a verified toll free number).",INFO_NODE_SET_VARIABLES:`<p>Set variables that can be accessed from other node blocks in the call flow.</p><p>The value can be a static value <code>("value")</code>, a variable from another node such as a request response <code>%{request_response.['object_field']}</code>, or a call parameter <code>%{call.from}</code>.</p><p>Access these variables in other blocks with <code>%{Key}</code> and unset variables with the Unset Variables block.</p>`,INFO_NODE_UNSET_VARIABLES:"Unsets script variables.",INFO_STATUS_ERROR:"An error occurred while loading or saving the flow.",INFO_STATUS_ERROR_OUT_OF_SYNC:"This document is locked because another user has made updates to the Call Flow. Refresh the page to discard your changes and unlock the flow with the latest updates.",INITIAL_TIMEOUT:"Initial Timeout",INPUT:"Input",INVALID_SETTINGS:"Invalid settings",JSON_OBJECT:"JSON object to serialize",KEY:"Key",KEYPAD_VALUE:"Keypad value",LANGUAGE:"Language",MAXIMUM_RECORDING_LENGTH:"Maximum Recording Length",META:"Meta",METHOD:"Method",MORE_INFO_DEPLOY:"Deploying a Call Flow makes it live.",MORE_INFO_DEPLOY_ERROR:"There was an error deploying the Call Flow. Please try again. {{message}}",MORE_INFO_STATUS_ERROR:"More info on Flow document error",MORE_INFO_TESTING_YOUR_FLOW:"Info on testing your call flow",MORE_WITH_COUNT:"{{count}} more",NAVIGATE_BACK:"Navigate Back",NO_ANSWER:"No Answer",NO_DEPLOYED_VERSIONS:"<p>No deployed versions found.</p> <p>Deploy a flow to view the history.</p>",NO_INPUT:"No Input",NO_RESULTS:"No results",NO_SCRIPTS_FOUND:"No scripts found.",NO_VARIABLES_SET:"Please set variables first",NOT_CONNECTED_TO_FLOW:"Not connected to flow",NUMBER_OF_VALIDATION_WARNINGS_one:"There is {{count}} validation warning in your flow",NUMBER_OF_VALIDATION_WARNINGS_other:"There are {{count}} validation warnings in your flow",NUMBER_OF_VARIABLES_SELECTED_one:"{{count}} variable selected",NUMBER_OF_VARIABLES_SELECTED_other:"{{count}} variables selected",OFF:"Off",ON:"On",OPTION_NUMBER:"Option {{index}}",OPTIONAL:"optional",OR_CALLER_SAYS:"or says",OR_SAYS:"Or says",PARAMS:"Params",PHONE_NUMBER:"Phone Number",PHONE_NUMBER_NUMBER:"Phone Number {{index}}",PKG_VERSION:"Package Version",PLAY_AUDIO:"Play Audio",PLAY_AUDIO_FILE:"Play Audio File",PLAY_AUDIO_TTS:"Play Audio or TTS",PREVIEW_DEPLOYED_VERSION:"You are previewing this version.",REASON:"Reason",RECORD:"Record",RECORD_CALL_START:"Start Call Recording",RECORD_CALL_STOP:"Stop Call Recording",RECORDING:"Recording",RECORDING_NAME:"Recording Name",RECORDING_NAME_DEFAULT:"Recording {{index}}",REMOVE_ADDRESS:"Remove Address {{index}}",REMOVE_CONDITION:"Remove Condition {{index}}",REMOVE_EDGE:"Remove Edge",REMOVE_NODE:"Remove Node {{title}}",REMOVE_OPTION:"Remove Option {{index}}",REMOVE_PHONE_NUMBER:"Remove Phone Number {{index}}",REMOVE_RESOURCE:"Remove Resource {{index}}",REMOVE_VARIABLE:"Remove Variable {{index}}",REQUEST:"Request",REQUEST_BODY:"Body",REQUEST_HEADERS:"Headers (JSON)",RESOURCE_NUMBER:"Resource {{index}}",RESTORE:"Restore",RESTORE_THIS_VERSION:"Restore this version",RESYNC:"Resync",RESYNC_AI_AGENTS:"Resync AI Agents",SAVED:"Saved",SAVE_VARIABLES:"Save Variables",SAVE_VARIABLES_SUBTITLE:"Store the response as variables",SCRIPT_NOT_FOUND:"Selected script not found. A selection is required.",SEARCH_FOR_INTERNAL_SCRIPT:"Search for internal script",SECONDS:"Seconds",SELECT:"Select",SELECT_VARIABLES:"Select Variables",SELECT_VARIABLES_TO_UNSET:"Select Variables to Unset",SEND_SMS:"Send SMS",SEPARATE_WITH_COMMAS:"Separate with commas",SEQUENTIALLY:"Sequentially",SET_VARIABLES:"Set Variables",SIMULTANEOUSLY:"Simultaneously",SMS_TEXT:"SMS Text",SPOKEN_PROMPT:"Spoken prompt",STATUS_DEPLOY:"Deploy",STATUS_DEPLOY_ERROR:"Deploy Error",STATUS_DEPLOYED:"Deployed",STATUS_DEPLOYING:"Deploying...",STATUS_ERROR:"Error",STATUS_LOADING:"Loading...",STATUS_LOCKED:"Locked",STATUS_SAVED:"Saved",STATUS_SAVING:"Saving...",STEREO:"Stereo",STEREO_SUBTITLE:"Enable stereo audio",STRING_OR_JSON:"String or JSON to serialize",SUCCESS:"Success",SWML_TO_EXECUTE:"SWML to execute on answer",TERMINATORS:"Terminators",TEXT:"Text",TEXT_TO_SPEECH:"Text to Speech",TIMEOUT:"Timeout",TO:"To",TO_PHONE_NUMBER:"To Phone Number",TOAST_DEPLOY_WARNING:'<p>There are inconsistencies in your Call Flow which may cause unexpected behavior. Please review the Call Flow before deploying.</p><p>Choose "Deploy" to deploy the Call Flow or "Cancel" to return to editing.</p>',TOAST_DOCUMENT_OUT_OF_SYNC:'<p>Updates have been made to this Call Flow by another user and your recent changes have not been saved.</p><p>Choose "Ignore" to view your changes in a locked state or "Resync" to abandon your changes and adopt the latest updates.</p>',TOGGLE_CLOSE:"Toggle close",TOGGLE_OPEN:"Toggle open",UNKNOWN:"Unknown",UNSET_VARIABLES:"Unset Variables",URL:"URL",VALUE:"Value",VARIABLE_KEY:"Variable {{key}}",VARIABLE_NUMBER:"Variable {{index}}",VERSION_HISTORY:"Version History",VERSION_LIST_ITEM:"Version {{number}}",VERSION_RESTORED:"Version restored",VOICE:"Voice",VOICEMAIL_RECORDING:"Voicemail Recording",WAIT_FOR_DIGIT:"Wait for Digit",WAIT_FOR_INPUT:"Wait for Input",WARNING:"Warning",WRITE_SOMETHING:"Write something"},N={ABOUT:"ABOUT",ACTION:"ACTION",ADDRESS_NUMBER:"ADDRESS_NUMBER",ADD_ADDRESS:"ADD_ADDRESS",ADD_AI_AGENT:"ADD_AI_AGENT",ADD_CONDITION:"ADD_CONDITION",ADD_OPTION:"ADD_OPTION",ADD_PHONE_NUMBER:"ADD_PHONE_NUMBER",ADD_RESOURCE:"ADD_RESOURCE",ADD_SWML_SCRIPTS:"ADD_SWML_SCRIPTS",ADD_VARIABLE:"ADD_VARIABLE",AI_AGENT:"AI_AGENT",AI_AGENT_NAME:"AI_AGENT_NAME",ANSWER_CALL:"ANSWER_CALL",ARE_YOU_SURE:"ARE_YOU_SURE",AUDIO_FILE:"AUDIO_FILE",BEEP:"BEEP",BEEP_SUBTITLE:"BEEP_SUBTITLE",BUSY:"BUSY",CALLER_PRESSES:"CALLER_PRESSES",CALLER_SAYS:"CALLER_SAYS",CALL_ADDRESSES:"CALL_ADDRESSES",CALL_NUMBERS:"CALL_NUMBERS",CALL_RESOURCES:"CALL_RESOURCES",CALL_STATE_EVENTS:"CALL_STATE_EVENTS",CALL_STATE_URL:"CALL_STATE_URL",CANCEL:"CANCEL",CAUTION:"CAUTION",CHOOSE_OPTION_TTS_AUDIO:"CHOOSE_OPTION_TTS_AUDIO",CLOSE:"CLOSE",CONDITIONS:"CONDITIONS",CONDITION_NUMBER:"CONDITION_NUMBER",DECISION:"DECISION",DECLINE:"DECLINE",DEFAULT_FROM:"DEFAULT_FROM",DEFAULT_TIMEOUT:"DEFAULT_TIMEOUT",DELETE:"DELETE",DELETE_NODE:"DELETE_NODE",DEPLOY:"DEPLOY",DEPLOY_WARNING:"DEPLOY_WARNING",DEPRECATED:"DEPRECATED",DOCUMENT_OUT_OF_SYNC:"DOCUMENT_OUT_OF_SYNC",EDIT_SELECTED_AI_AGENT:"EDIT_SELECTED_AI_AGENT",ELSE:"ELSE",ENABLE_WHISPER:"ENABLE_WHISPER",END_SILENCE_TIMEOUT:"END_SILENCE_TIMEOUT",ENTER_URL:"ENTER_URL",ERROR:"ERROR",ERROR_ADD_AI_AGENT_FIRST:"ERROR_ADD_AI_AGENT_FIRST",ERROR_ADD_RECORDING_FIRST:"ERROR_ADD_RECORDING_FIRST",ERROR_DUPLICATE_COMMAND:"ERROR_DUPLICATE_COMMAND",ERROR_DUPLICATE_RECORDING_LABEL:"ERROR_DUPLICATE_RECORDING_LABEL",ERROR_DUPLICATE_TELEPHONE_KEY:"ERROR_DUPLICATE_TELEPHONE_KEY",ERROR_DUPLICATE_VARIABLE_KEY:"ERROR_DUPLICATE_VARIABLE_KEY",ERROR_FETCHING_AI_AGENTS:"ERROR_FETCHING_AI_AGENTS",ERROR_FETCHING_DEPLOYED_VERSIONS:"ERROR_FETCHING_DEPLOYED_VERSIONS",ERROR_FETCHING_SWML_SCRIPTS:"ERROR_FETCHING_SWML_SCRIPTS",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_SELECTION_REQUIRED:"ERROR_SELECTION_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",EXECUTE_SWML:"EXECUTE_SWML",EXTERNAL_OPTION_LABEL:"EXTERNAL_OPTION_LABEL",EXTERNAL_OR_INTERNAL_RESOURCE:"EXTERNAL_OR_INTERNAL_RESOURCE",EXTERNAL_URL:"EXTERNAL_URL",FAILED:"FAILED",FAILURE:"FAILURE",FLOW_DATA_VERSION:"FLOW_DATA_VERSION",FORMAT:"FORMAT",FORWARD:"FORWARD",FORWARD_TO_ADDRESS:"FORWARD_TO_ADDRESS",FORWARD_TO_PHONE:"FORWARD_TO_PHONE",FORWARD_TO_RESOURCE:"FORWARD_TO_RESOURCE",FROM:"FROM",FROM_PHONE_NUMBER:"FROM_PHONE_NUMBER",GATHER_INPUT:"GATHER_INPUT",GENDER:"GENDER",GO_BACK:"GO_BACK",HANDLE_CALL:"HANDLE_CALL",HANDLE_VIA:"HANDLE_VIA",HANG_UP:"HANG_UP",HANG_UP_CALL:"HANG_UP_CALL",HELP:"HELP",HIDDEN:"HIDDEN",IGNORE:"IGNORE",INFO_DEPLOY:"INFO_DEPLOY",INFO_INVALID_SETTINGS:"INFO_INVALID_SETTINGS",INFO_NODE_AI_AGENT:"INFO_NODE_AI_AGENT",INFO_NODE_COND:"INFO_NODE_COND",INFO_NODE_CONDREQUEST:"INFO_NODE_CONDREQUEST",INFO_NODE_EXECUTE_SWML:"INFO_NODE_EXECUTE_SWML",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_PLAY:"INFO_NODE_PLAY",INFO_NODE_RECORD:"INFO_NODE_RECORD",INFO_NODE_RECORD_CALL_START:"INFO_NODE_RECORD_CALL_START",INFO_NODE_RECORD_CALL_STOP:"INFO_NODE_RECORD_CALL_STOP",INFO_NODE_REQUEST:"INFO_NODE_REQUEST",INFO_NODE_SEND_SMS:"INFO_NODE_SEND_SMS",INFO_NODE_SET_VARIABLES:"INFO_NODE_SET_VARIABLES",INFO_NODE_UNSET_VARIABLES:"INFO_NODE_UNSET_VARIABLES",INFO_STATUS_ERROR:"INFO_STATUS_ERROR",INFO_STATUS_ERROR_OUT_OF_SYNC:"INFO_STATUS_ERROR_OUT_OF_SYNC",INITIAL_TIMEOUT:"INITIAL_TIMEOUT",INPUT:"INPUT",INVALID_SETTINGS:"INVALID_SETTINGS",JSON_OBJECT:"JSON_OBJECT",KEY:"KEY",KEYPAD_VALUE:"KEYPAD_VALUE",LANGUAGE:"LANGUAGE",MAXIMUM_RECORDING_LENGTH:"MAXIMUM_RECORDING_LENGTH",META:"META",METHOD:"METHOD",MORE_INFO_DEPLOY:"MORE_INFO_DEPLOY",MORE_INFO_DEPLOY_ERROR:"MORE_INFO_DEPLOY_ERROR",MORE_INFO_STATUS_ERROR:"MORE_INFO_STATUS_ERROR",MORE_INFO_TESTING_YOUR_FLOW:"MORE_INFO_TESTING_YOUR_FLOW",MORE_WITH_COUNT:"MORE_WITH_COUNT",NAVIGATE_BACK:"NAVIGATE_BACK",NOT_CONNECTED_TO_FLOW:"NOT_CONNECTED_TO_FLOW",NO_ANSWER:"NO_ANSWER",NO_DEPLOYED_VERSIONS:"NO_DEPLOYED_VERSIONS",NO_INPUT:"NO_INPUT",NO_RESULTS:"NO_RESULTS",NO_SCRIPTS_FOUND:"NO_SCRIPTS_FOUND",NO_VARIABLES_SET:"NO_VARIABLES_SET",NUMBER_OF_VALIDATION_WARNINGS:"NUMBER_OF_VALIDATION_WARNINGS",NUMBER_OF_VARIABLES_SELECTED:"NUMBER_OF_VARIABLES_SELECTED",OFF:"OFF",ON:"ON",OPTIONAL:"OPTIONAL",OPTION_NUMBER:"OPTION_NUMBER",OR_CALLER_SAYS:"OR_CALLER_SAYS",OR_SAYS:"OR_SAYS",PARAMS:"PARAMS",PHONE_NUMBER:"PHONE_NUMBER",PHONE_NUMBER_NUMBER:"PHONE_NUMBER_NUMBER",PKG_VERSION:"PKG_VERSION",PLAY_AUDIO:"PLAY_AUDIO",PLAY_AUDIO_FILE:"PLAY_AUDIO_FILE",PLAY_AUDIO_TTS:"PLAY_AUDIO_TTS",PREVIEW_DEPLOYED_VERSION:"PREVIEW_DEPLOYED_VERSION",REASON:"REASON",RECORD:"RECORD",RECORDING:"RECORDING",RECORDING_NAME:"RECORDING_NAME",RECORDING_NAME_DEFAULT:"RECORDING_NAME_DEFAULT",RECORD_CALL_START:"RECORD_CALL_START",RECORD_CALL_STOP:"RECORD_CALL_STOP",REMOVE_ADDRESS:"REMOVE_ADDRESS",REMOVE_CONDITION:"REMOVE_CONDITION",REMOVE_EDGE:"REMOVE_EDGE",REMOVE_NODE:"REMOVE_NODE",REMOVE_OPTION:"REMOVE_OPTION",REMOVE_PHONE_NUMBER:"REMOVE_PHONE_NUMBER",REMOVE_RESOURCE:"REMOVE_RESOURCE",REMOVE_VARIABLE:"REMOVE_VARIABLE",REQUEST:"REQUEST",REQUEST_BODY:"REQUEST_BODY",REQUEST_HEADERS:"REQUEST_HEADERS",RESOURCE_NUMBER:"RESOURCE_NUMBER",RESTORE:"RESTORE",RESTORE_THIS_VERSION:"RESTORE_THIS_VERSION",RESYNC:"RESYNC",RESYNC_AI_AGENTS:"RESYNC_AI_AGENTS",SAVED:"SAVED",SAVE_VARIABLES:"SAVE_VARIABLES",SAVE_VARIABLES_SUBTITLE:"SAVE_VARIABLES_SUBTITLE",SCRIPT_NOT_FOUND:"SCRIPT_NOT_FOUND",SEARCH_FOR_INTERNAL_SCRIPT:"SEARCH_FOR_INTERNAL_SCRIPT",SECONDS:"SECONDS",SELECT:"SELECT",SELECT_VARIABLES:"SELECT_VARIABLES",SELECT_VARIABLES_TO_UNSET:"SELECT_VARIABLES_TO_UNSET",SEND_SMS:"SEND_SMS",SEPARATE_WITH_COMMAS:"SEPARATE_WITH_COMMAS",SEQUENTIALLY:"SEQUENTIALLY",SET_VARIABLES:"SET_VARIABLES",SIMULTANEOUSLY:"SIMULTANEOUSLY",SMS_TEXT:"SMS_TEXT",SPOKEN_PROMPT:"SPOKEN_PROMPT",STATUS_DEPLOY:"STATUS_DEPLOY",STATUS_DEPLOYED:"STATUS_DEPLOYED",STATUS_DEPLOYING:"STATUS_DEPLOYING",STATUS_DEPLOY_ERROR:"STATUS_DEPLOY_ERROR",STATUS_ERROR:"STATUS_ERROR",STATUS_LOADING:"STATUS_LOADING",STATUS_LOCKED:"STATUS_LOCKED",STATUS_SAVED:"STATUS_SAVED",STATUS_SAVING:"STATUS_SAVING",STEREO:"STEREO",STEREO_SUBTITLE:"STEREO_SUBTITLE",STRING_OR_JSON:"STRING_OR_JSON",SUCCESS:"SUCCESS",SWML_TO_EXECUTE:"SWML_TO_EXECUTE",TERMINATORS:"TERMINATORS",TEXT:"TEXT",TEXT_TO_SPEECH:"TEXT_TO_SPEECH",TIMEOUT:"TIMEOUT",TO:"TO",TOAST_DEPLOY_WARNING:"TOAST_DEPLOY_WARNING",TOAST_DOCUMENT_OUT_OF_SYNC:"TOAST_DOCUMENT_OUT_OF_SYNC",TOGGLE_CLOSE:"TOGGLE_CLOSE",TOGGLE_OPEN:"TOGGLE_OPEN",TO_PHONE_NUMBER:"TO_PHONE_NUMBER",UNKNOWN:"UNKNOWN",UNSET_VARIABLES:"UNSET_VARIABLES",URL:"URL",VALUE:"VALUE",VARIABLE_KEY:"VARIABLE_KEY",VARIABLE_NUMBER:"VARIABLE_NUMBER",VERSION_HISTORY:"VERSION_HISTORY",VERSION_LIST_ITEM:"VERSION_LIST_ITEM",VERSION_RESTORED:"VERSION_RESTORED",VOICE:"VOICE",VOICEMAIL_RECORDING:"VOICEMAIL_RECORDING",WAIT_FOR_DIGIT:"WAIT_FOR_DIGIT",WAIT_FOR_INPUT:"WAIT_FOR_INPUT",WARNING:"WARNING",WRITE_SOMETHING:"WRITE_SOMETHING"},R2={order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag","path","subdomain"],lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupQuerystring:"lng",lookupSessionStorage:"i18nextLng",caches:["localStorage","cookie"],excludeCacheFor:["cimode"]},N2={"en-US":{translation:x2}},w2=async()=>{await Ve.use(Ey).use(CI).init({debug:fA,detection:R2,fallbackLng:"en-US",interpolation:{escapeValue:!1},keySeparator:!1,resources:N2})};function Ua(e,t){return d.jsx(aC,{label:e,vars:t})}const ov=()=>Ve.resolvedLanguage,O2={entries:[],nextLabelIndex:0},Bo=bo((e,t)=>({...O2,actions:{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="",r=t().nextLabelIndex;do r++,n=A(N.RECORDING_NAME_DEFAULT,{index:r});while(this.isValueDuplicate(n));return e({nextLabelIndex:r}),n},isKeyDuplicate(n){return t().entries.some(r=>r.controlId===n)},isValueDuplicate(n,r){const o=n.trim();return!!t().entries.reduce((i,l)=>{const{label:a,controlId:c}=l;return a!==""&&a===o&&(!r||c!==r)?[...i,l]:i},[]).length},removeEntry(n){e(r=>({entries:r.entries.filter(o=>o.controlId!==n)}))},upsertEntry:n=>{const{actions:r}=t(),{isKeyDuplicate:o}=r;e(s=>{let i=[...s.entries];const l=n.label.trim(),a=!!l;return(o(n.controlId)||!a)&&(i=i.filter(c=>c.controlId!==n.controlId)),a&&i.push({...n,label:l}),{entries:i}})}}})),If=()=>Bo.getState().actions,sv=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})}),Bo.setState({entries:t,nextLabelIndex:t.length})},T2=(e,t)=>{const n=[];return t.forEach(r=>{r.type==="recordCallStart"&&r.data.controlId&&(n.push(r.data.controlId),Bo.getState().actions.removeEntry(r.data.controlId))}),n.length?e.reduce((r,o)=>o.type==="recordCallStop"&&n.includes(o.data.controlId)?[...r,{...o,data:{...o.data,controlId:""}}]:r,[]):[]},iv={recordCallStart:e=>{const t=Bo.getState().actions.getGeneratedLabel();return Bo.getState().actions.upsertEntry({controlId:e.data.controlId,label:t}),{...e,data:{...e.data,label:t}}}},A2=e=>typeof e=="object"&&e!==null&&Object.keys(e).length>0,I2=e=>iv[e.type]!==void 0,lv=(e,t={})=>{const{deletable:n=!0,position:r={x:300,y:250},selected:o=!0}=t,s=()=>({data:{initial:!0,valid:!1},deletable:n,id:le(),position:r,selected:o,type:e}),i=(c,u)=>({...c,data:{...c.data,...u}});let l=s();const a=Z0[e]();return A2(a)&&(l=i(l,a)),I2(l)&&(l=iv[l.type](l)),l},Fa={action:{label:N.ACTION,nodes:{answer:{active:!0,label:N.ANSWER_CALL},hangup:{active:!0,infoLabel:N.INFO_NODE_HANG_UP,label:N.HANG_UP_CALL},play:{active:!0,infoLabel:N.INFO_NODE_PLAY,label:N.PLAY_AUDIO_TTS},sendSms:{active:!0,infoLabel:N.INFO_NODE_SEND_SMS,label:N.SEND_SMS}}},decision:{label:N.DECISION,nodes:{cond:{active:!0,infoLabel:N.INFO_NODE_COND,label:N.CONDITIONS},executeSWML:{active:!0,infoLabel:N.INFO_NODE_EXECUTE_SWML,label:N.EXECUTE_SWML},set:{active:!0,infoLabel:N.INFO_NODE_SET_VARIABLES,label:N.SET_VARIABLES},unset:{active:!0,infoLabel:N.INFO_NODE_UNSET_VARIABLES,label:N.UNSET_VARIABLES}}},forwardTo:{label:N.FORWARD,nodes:{forwardAddress:{active:!1,infoLabel:N.INFO_NODE_FORWARD_TO_ADDRESS,label:N.FORWARD_TO_ADDRESS},forwardPhone:{active:!0,infoLabel:N.INFO_NODE_FORWARD_TO_PHONE,label:N.FORWARD_TO_PHONE},forwardResource:{active:!1,infoLabel:N.INFO_NODE_FORWARD_TO_RESOURCE,label:N.FORWARD_TO_RESOURCE}}},hidden:{label:N.HIDDEN,nodes:{handleCall:{active:!0,label:N.HANDLE_CALL}}},input:{label:N.INPUT,nodes:{aiAgent:{active:!0,infoLabel:N.INFO_NODE_AI_AGENT,label:N.AI_AGENT},condRequest:{active:!0,infoLabel:N.INFO_NODE_CONDREQUEST,label:N.REQUEST},promptPlay:{active:!0,infoLabel:N.INFO_NODE_GATHER_INPUT,label:N.GATHER_INPUT},request:{active:!1,deprecated:!0,infoLabel:N.INFO_NODE_REQUEST,label:N.REQUEST}}},recording:{label:N.RECORD,nodes:{record:{active:!0,infoLabel:N.INFO_NODE_RECORD,label:N.VOICEMAIL_RECORDING},recordCallStart:{active:!0,infoLabel:N.INFO_NODE_RECORD_CALL_START,label:N.RECORD_CALL_START},recordCallStop:{active:!0,infoLabel:N.INFO_NODE_RECORD_CALL_STOP,label:N.RECORD_CALL_STOP}}}},C2=Object.entries(Fa).reduce((e,[,{nodes:t}])=>(Object.entries(t).forEach(([n,{label:r}])=>{e.set(n,r)}),e),new Map),L2=Object.entries(Fa).reduce((e,[,{nodes:t}])=>(Object.entries(t).forEach(([n,{infoLabel:r}])=>{e.set(n,r)}),e),new Map),ja=Ne(),b2={aiAgentMap:new Map,error:"",status:"initial"},D2=(e,t)=>({...b2,actions:{fetchAiAgents:async()=>{try{const{actions:n}=t(),{getAiAgents:r}=n;if(!r){ja.error("getAiAgents is not defined");return}e({status:"loading"});const o=await r(),s=X0(o.data,"asc","display_name"),i=new Map(s.map(l=>[l.id,l]));e({aiAgentMap:i,error:"",status:"loaded"})}catch(n){let r="Unknown error";ja.error("Error fetching aiAgents ",n),n instanceof Error&&(r=n.message),e({aiAgentMap:new Map,error:r,status:"error"})}},init:({getAiAgentsURL:n})=>{if(!n){ja.error("getAiAgentsURL is not defined");return}const r=nc({getAiAgentsURL:n,headers:of()}),o=async()=>await r.getAiAgents();e(s=>({...s,actions:{...s.actions,getAiAgents:o}}))}}}),av=(e,t)=>{if(e.find(r=>r.type==="aiAgent")){const{fetchAiAgents:r}=en.getState().actions;r().then(()=>{const{aiAgentMap:o,status:s}=en.getState();s==="loaded"&&e.forEach(i=>{if(i.data&&"agent"in i.data){const l=o.has(i.data.agent);l||t(i.id,{agent:l?i.data.agent:"",valid:l})}})}).catch(o=>ja.error("Error rehydrating AiAgentStore",o))}},en=bo()(D2),k2=()=>en.getState().actions;window.__useAiAgentStore=en;const P2=e=>!!(e&&e>=mA),M2=e=>(t,n,r)=>(r.setState=(o,s,...i)=>{const{edges:l,detachedMode:a,httpError:c,initializing:u,isCanvasInteractive:f,isInteractiveControlOn:p,nodes:h,rootAppWidth:E,viewportChanging:y}=n(),v=typeof o=="function"?o(n()):o,m=["detachedMode","httpError","initializing","isInteractiveControlOn","rootAppWidth","viewportChanging"],g="initializing"in v?v.initializing:u;if(m.some(S=>S in v)){const S=P2("rootAppWidth"in v?v.rootAppWidth:E),_="isInteractiveControlOn"in v?v.isInteractiveControlOn:p,x="detachedMode"in v?v.detachedMode:a,R=("httpError"in v?v.httpError:c)===z0,T="viewportChanging"in v?v.viewportChanging:y;if(v.isCanvasInteractive=!!(S&&_&&!x&&!g&&!R&&!T),v.showInteractiveControl=S&&!R&&!x,f&&!v.isCanvasInteractive){const L="nodes"in v?v.nodes:h;v.nodes=L.map(I=>({...I,selected:!1}));const P="edges"in v?v.edges:l;v.edges=P.map(I=>({...I,selected:!1})),v.selectedNode=void 0}}t(v,s,...i)},e(r.setState,n,r)),cv=1e3,yi=Ne(),U2=e=>(t,n,r)=>{let o,s;const i=async()=>{const{httpService:l,nodes:a,edges:c,documentVersion:u}=n();t({dataHandlingStatus:"saving",saveFlowStatus:"saving"}),clearTimeout(s);try{if(!l)throw new Error("Missing httpService");const f=await l.putFlow({documentVersion:u,edges:c,flowDataVersion:li,nodes:a}),p={documentLastUpdated:f.updated_at,documentVersion:f.document_version},h=n().dataHandlingStatus;switch(h){case"saving":t({...p,dataHandlingStatus:"queueing",deployFlowStatus:"deploy",saveFlowStatus:"saved"});break;case"holding":t({...p,saveFlowStatus:"awaiting-save"}),yi.debug("Setting up a new save for held changes"),s=setTimeout(()=>{i().catch(E=>{yi.error("Error Save Flow",E)})},cv);break;default:yi.debug("Invalid dataHandlingStatus",h)}}catch(f){yi.error("Put Flow",f),f instanceof Error&&f.message.includes(gA)?t({dataHandlingStatus:"holding",httpError:"document-sync",saveFlowStatus:"error"}):t({dataHandlingStatus:"queueing",saveFlowStatus:"error"})}};return r.setState=(l,a,...c)=>{const{dataHandlingStatus:u,detachedMode:f,initializing:p,saveFlowStatus:h}=n(),E=typeof l=="function"?l(n()):l,y="initializing"in E?E.initializing:p,v="detachedMode"in E?E.detachedMode:f;!y&&!v&&(E.nodes||E.edges)?u==="queueing"?(E.saveFlowStatus="awaiting-save",t(E,a,...c),clearTimeout(o),o=setTimeout(()=>{i().catch(g=>{yi.error("Error Save Flow",g)})},cv)):(E.dataHandlingStatus="holding",t(E,a,...c)):"initializing"in E&&!E.initializing?(E.dataHandlingStatus="queueing",h!=="error"&&(E.saveFlowStatus="saved"),t(E,a,...c)):t(E,a,...c)},e(r.setState,n,r)},Va=Ne(),F2={cachedResults:new Map,error:"",results:[],status:"initial",swmlScriptMap:new Map},j2={ids:"ids",name:"name"},V2=(e,t)=>({...F2,actions:{buildParamsFromQuery:n=>{const{searchParams:r}=new URL(n,window.location.href);return AA(j2).reduce((s,i)=>{const l=r.get(i);return l&&(i==="ids"?s[i]=l.split(","):s[i]=l),s},{})},buildQueryFromParams:n=>{const r=ec(window.location.origin,{...n}),{search:o}=new URL(r);return`/${o}`},fetchSwmlScript:async n=>{try{const{actions:r}=t(),{getSwmlScripts:o,updateMapAndCache:s}=r;if(!o){Va.error("getSwmlScripts is not defined");return}e({status:"loading"});const i=await o(n),l=X0(i.data,"asc","display_name"),a=new Map(l.map(c=>[c.id,{displayName:c.display_name,id:c.id,requestUrl:c.request_url}]));s(a,n),e({error:"",results:Array.from(a.values()),status:"loaded"})}catch(r){let o="Unknown error";Va.error("Error fetching swmlScripts ",r),r instanceof Error&&(o=r.message),e({error:o,status:"error"})}},getCachedResults:n=>{const{cachedResults:r,swmlScriptMap:o}=t(),s=r.get(n);if(s)return s.reduce((i,l)=>{const a=o.get(l);return a&&i.push(a),i},[])},init:({getSwmlScriptsURL:n})=>{if(!n){Va.error("getSwmlScriptsURL is not defined");return}const r=nc({getSwmlScriptsURL:n,headers:of()}),o=async s=>await r.getSwmlScripts(s);e(s=>({...s,actions:{...s.actions,getSwmlScripts:o}}))},setResults:n=>{e({results:n})},updateConnection:(n,r)=>{if(n.connectConfirmId!=="external"){const o=r.get(n.connectConfirmId),s={...n};if(o&&o.displayName!==n.connectConfirmDisplayName)return s.connectConfirmDisplayName=o.displayName,s;if(!o)return s.connectConfirmId="",s.connectConfirmUrl="",s}},updateMapAndCache:(n,r)=>{const{actions:o,cachedResults:s,swmlScriptMap:i}=t(),{buildQueryFromParams:l}=o,a=r==null?void 0:r.ids,c=l(r),u=s.get(c),f=(u==null?void 0:u.filter(y=>n.has(y)))??[],p=(a==null?void 0:a.filter(y=>!n.has(y)))??[],h=[...new Set([...p,...f])];h.length>0&&(Array.from(s.entries()).forEach(([v,m])=>{if(v===r){const g=m.filter(S=>!h.includes(S));s.set(v,g)}}),h.forEach(v=>{i.delete(v)})),n.forEach((y,v)=>{i.set(v,y)});const E=Array.from(n.keys());s.set(c,E),e({cachedResults:new Map(s),swmlScriptMap:new Map(i)})},validateCache:(()=>{let n;return()=>{n&&clearTimeout(n),n=setTimeout(async()=>{const{actions:o,swmlScriptMap:s}=t(),{fetchSwmlScript:i}=o,l=Array.from(s.keys());l.length>0&&i&&await i({ids:l})},W0)}})(),validateScriptsFromNodes:(n,r)=>{const{actions:o}=t(),{fetchSwmlScript:s}=o,i=new Set,l=n.filter(c=>uv(c)&&"connections"in c.data&&c.data.connections.some(u=>u.connectConfirmEnabled));if(l.length===0)return;const a=(c,u)=>l.forEach(f=>{const p=f.data.connections.map(h=>c(h)??h);typeof u=="function"&&u(p,f)});a(c=>{c.connectConfirmId!==""&&c.connectConfirmId!=="external"&&c.connectConfirmEnabled&&i.add(c.connectConfirmId)}),i.size!==0&&s({ids:Array.from(i.values())}).then(()=>{const{actions:c,swmlScriptMap:u,status:f}=_n.getState(),{updateConnection:p}=c;f==="loaded"&&a(h=>{const E=p(h,u);return E||h},(h,E)=>{r(E.id,{connections:h})})}).catch(c=>Va.error("Error rehydrating SwmlScriptStore",c))}}}),uv=e=>e.type==="forwardAddress"||e.type==="forwardPhone"||e.type==="forwardResource",$2=(e,t)=>{if(e.some(uv)){const{validateScriptsFromNodes:r}=_n.getState().actions;r(e,t)}},_n=bo()(V2),dv=()=>_n.getState().actions;window.__useSwmlScriptStore=_n;const fv=500,H2=100,Oe=Ne(),B2=lv("handleCall",{deletable:!1,position:{x:300,y:100}}),Cf={backButtonHref:void 0,colorMode:"light",dataHandlingStatus:"queueing",deployFlowStatus:"deploy",deployFlowURL:"",deployedVersionsList:[],detachedMode:!1,documentLastUpdated:void 0,documentVersion:0,dragNodeType:void 0,edges:[],flowId:"",flowTitle:"",flowWrapperElement:void 0,getFlowURL:"",httpError:void 0,httpService:void 0,initializing:!0,isCanvasInteractive:!1,isDraggingNode:!1,isEdgeConnecting:!1,isEdgeUpdateSuccessful:!1,isInteractiveControlOn:!0,nodes:[],reactFlowInstance:void 0,rootAppHeight:void 0,rootAppWidth:void 0,rootElement:void 0,rootElementId:"",saveFlowStatus:"initial",selectedNode:void 0,showDeployWarning:!1,showDeployedHistory:!1,showDeployedHistoryToast:!1,showInteractiveControl:!0,showValidationWarnings:!1,toastsMap:new Map,updateFlowURL:"",updatingSourceHandleId:void 0,validationWarnings:new Map,viewport:{x:0,y:0,zoom:1},viewportChanging:!1,workingFlowCopy:void 0},z2=(e,t)=>({...Cf,actions:{addNode:({nodeType:n,x:r=150,y:o=150})=>{Oe.debug("Add Node",n);const{nodes:s,reactFlowInstance:i}=t();if(!i)throw new Error("ReactFlowInstance not found");const l=lv(n,{position:i.project({x:r,y:o})}),a=s.map(c=>({...c,selected:!1}));a.push(l),e({nodes:a,selectedNode:l})},addToast:n=>{const{toastsMap:r}=t(),o=le();r.set(o,{...n,id:o}),e({toastsMap:new Map(r)})},cancelDetachedMode:async()=>{const{actions:n,workingFlowCopy:r}=t(),{cleanUpDetachedMode:o}=n;if(r){const{edges:s,nodes:i,saveFlowStatus:l}=r;e({edges:[],initializing:!0,nodes:[]}),await q0(fv),e({edges:s,nodes:i,saveFlowStatus:l})}else Oe.error("There was no working flow to restore");o()},cleanUpDetachedMode:()=>{e({detachedMode:!1,showDeployedHistory:!1,showDeployedHistoryToast:!1,workingFlowCopy:void 0})},deleteToast:n=>{const{toastsMap:r}=t();r.delete(n)&&e({toastsMap:new Map(r)})},deleteValidationWarning:n=>{const{validationWarnings:r}=t();r.delete(n)&&e({validationWarnings:new Map(r)})},deployFlow:async()=>{Oe.info("Deploying..."),e({deployFlowStatus:"deploying"});try{const{httpService:n,documentVersion:r}=t();if(!n)throw new Error("Missing httpService");const o=await n.deployFlow({documentVersion:r});Oe.info("Deploy response",o),e({deployFlowStatus:"deployed"})}catch(n){throw Oe.info("Deploy error",n),e({deployFlowStatus:"error"}),n}},exportStoreData:()=>{const{nodes:n,edges:r}=t();NA(n,r)},getDeployedVersionsList:async n=>{try{const{httpService:r}=t();if(!r)throw new Error("Missing httpService");const o=await r.getFlowVersions(n),s=Q0(ov());return e({deployedVersionsList:o.map((i,l)=>({id:i.id,relativeTimeSince:s(i.created_at),version:(o.length-l).toFixed(1)}))}),o}catch(r){throw Oe.error("Could not get deployed versions",r),e({deployedVersionsList:[]}),r}},getNodeType:n=>{const r=t().nodes.find(o=>o.id===n);return r==null?void 0:r.type},getRootElement:()=>{const{rootElement:n,rootElementId:r}=t();if(!n)throw new Error(`Root element not found for ID ${r}`);return n.shadowRoot?n.shadowRoot.getRootNode():n},getTargetEdges:n=>t().edges.filter(r=>{const o=r.target===n,s=r.source!==r.target;return o&&s}),getValidationWarnings:()=>t().validationWarnings,migrateAndLoadDeployedFlow:async n=>{const{actions:r,workingFlowCopy:o}=t(),{partialUpdateNodeData:s,saveWorkingFlowCopy:i}=r,a=new pp({dbRecord:n}).migrateTo(li),{flow_data:c}=a;if(!c)Oe.error("Cannot load flow: missing flowData",c);else{o||i();const u=c.nodes.map(Y0),f=c.edges.map(G0);e({detachedMode:!0,edges:[],initializing:!0,nodes:[]}),await q0(fv),e({edges:f,nodes:u,showDeployedHistoryToast:!0}),sv(u),av(u,s)}},onConnect:n=>{Oe.debug("onConnect"),e({edges:jE(n,t().edges)})},onConnectEnd:()=>{Oe.debug("onConnectEnd"),e({isEdgeConnecting:!1})},onConnectStart:()=>{Oe.debug("onConnectStart"),e({isEdgeConnecting:!0})},onEdgeUpdate:(n,r)=>{Oe.debug("onEdgeUpdate"),e({edges:_O(n,r,t().edges),isEdgeUpdateSuccessful:!0})},onEdgeUpdateEnd:(n,r)=>{var o;Oe.debug("onEdgeUpdateEnd"),t().isEdgeUpdateSuccessful?e({isEdgeUpdateSuccessful:!0}):(o=t().reactFlowInstance)==null||o.deleteElements({edges:[{id:r.id}]}),e({updatingSourceHandleId:void 0})},onEdgeUpdateStart:(n,r)=>{Oe.debug("onEdgeUpdateStart"),e({isEdgeUpdateSuccessful:!1,updatingSourceHandleId:r.sourceHandle??void 0})},onEdgesChange:n=>{e({edges:qO(n,t().edges)})},onEdgesDelete:n=>{Oe.debug("onEdgesDelete [noop]",n)},onInit:async n=>{const{actions:r,deployFlowURL:o,getFlowURL:s,updateFlowURL:i}=t(),{partialUpdateNodeData:l}=r;Oe.log("onInit",{getFlowURL:s,updateFlowURL:i});try{const a=nc({deployFlowURL:o,getFlowURL:s,headers:of(),updateFlowURL:i}),[c,u]=await Promise.all([a.getFlow(),a.getFlowVersions({pageSize:1})]),p=new pp({dbRecord:c}).migrateTo(li),{document_version:h,flow_data:E,id:y,title:v,updated_at:m}=p;if(u.length&&u[0]){const{document_version:S}=u[0];S===h&&e({deployFlowStatus:"deployed"})}let g=E;g||(g={edges:Cf.edges,flowDataVersion:li,nodes:Cf.nodes.concat([B2])}),e({documentLastUpdated:m,documentVersion:h,edges:g.edges.map(G0),flowId:y,flowTitle:v,httpService:a,nodes:g.nodes.map(Y0),reactFlowInstance:n}),sv(g.nodes),av(g.nodes,l),$2(g.nodes,l)}catch(a){Oe.error("Could not load flow. URL:",s);let c="unknown";a instanceof Error&&a.message.includes(EA)&&(c="not-found"),e({httpError:c})}},onNodeDragStart:()=>{e({isDraggingNode:!0})},onNodeDragStop:()=>{e({isDraggingNode:!1})},onNodesChange:n=>{const r=n.filter(o=>o.type!=="dimensions");r.length>0&&e({nodes:h0(r,t().nodes)})},onNodesDelete:n=>{Oe.debug("onNodesDelete");const{actions:r}=t(),{partialUpdateNodeData:o}=r;T2(t().nodes,n).forEach(i=>{o(i.id,i.data)})},onSelectionChange:({nodes:n})=>{e({selectedNode:n.find(r=>r.selected)})},onViewportChange:(()=>{let n;function r(o){n&&clearTimeout(n),n=setTimeout(()=>{e({viewportChanging:!1})},H2),e({viewport:{...o},viewportChanging:!0})}return r})(),onViewportChangeEnd:()=>{},onViewportChangeStart:()=>{},partialUpdateNodeData:(n,r)=>{var i;Oe.debug("partialUpdateNodeData",n,r);const o=[],s=t().nodes.map(l=>{if(l.id===n){if("options"in r&&"options"in l.data){const a=l.data.options.map(u=>u.id),c=r.options.map(u=>u.id);o.push(...a.filter(u=>!c.includes(u)))}return{...l,data:{...l.data,...r}}}return l});if(o.length){const l=t().edges.filter(a=>a.sourceHandle&&o.includes(a.sourceHandle));Oe.debug("Remove orphaned edges",{edgesToDelete:l,sourceHandleDeleted:o}),(i=t().reactFlowInstance)==null||i.deleteElements({edges:l})}e({nodes:s})},partialUpdateValidationWarning:(n,r)=>{const{validationWarnings:o}=t(),s=l=>l.connected===!1||l.valid===!1,i=o.get(n);if(r.nodeType!=="handleCall"&&!i&&s(r)){const l=C2.get(r.nodeType),a={connected:r.connected,id:le(),nodeId:r.nodeId,nodeTitle:l,nodeType:r.nodeType,valid:r.valid};o.set(n,a)}else if(i){const l={...i,...r};s(l)?o.set(n,l):o.delete(n)}e({validationWarnings:new Map(o)})},removeEdge:n=>{Oe.debug("removeEdge",n);const r=t().reactFlowInstance;r&&r.deleteElements({edges:[{id:n}]})},removeNode:n=>{Oe.debug("removeNode",n);const r=t().reactFlowInstance;r&&r.deleteElements({nodes:[{id:n}]})},restoreDeployedFlow:()=>{const{actions:n,edges:r,nodes:o}=t(),{cleanUpDetachedMode:s}=n;e({detachedMode:!1,edges:r,nodes:o}),s()},saveWorkingFlowCopy:()=>{const{edges:n,nodes:r,saveFlowStatus:o}=t();e({workingFlowCopy:{edges:n,nodes:r,saveFlowStatus:o}})},setColorMode:n=>{e({colorMode:n})},setDragNodeType:n=>{e({dragNodeType:n})},setFlowWrapperElement:n=>{e({flowWrapperElement:n||void 0})},setInitializing:n=>{e({initializing:n})},setSelectedNodes:n=>{const{nodes:r}=t(),o=r.map(s=>({...s,selected:n.includes(s.id)}));e({nodes:o})},setShowDeployWarning:n=>{e({showDeployWarning:n})},setShowDeployedHistory:n=>{e({showDeployedHistory:n})},setShowValidationWarnings:n=>{e({showValidationWarnings:n})},setViewportChanging:n=>{e({viewportChanging:n})}}}),Q=bo()(M2(U2(z2))),Te=()=>Q.getState().actions;window.__useRFStore=Q;const W2={"not-found":{message:"Please ensure that the Call Flow exists and the URL is correct.",status:"404",title:"Call Flow not found"},unknown:{message:"An unknown error occurred. Please try again or go back.",status:"",title:"Unknown error"}},G2=({errorType:e})=>{const t=Q(s=>s.backButtonHref),{title:n,message:r,status:o}=W2[e];return d.jsx("section",{className:"flex min-h-full w-full items-center justify-center bg-background px-6",children:d.jsxs("div",{className:"text-center",children:[o&&d.jsx("p",{className:"text-2xl font-semibold text-foreground/50",children:o}),d.jsx("h1",{className:"mt-4 text-3xl font-bold tracking-tight text-foreground",children:n}),d.jsx("p",{className:"mt-6 leading-7 text-foreground",children:r}),t&&d.jsx("div",{className:"mt-8 flex items-center justify-center gap-x-6",children:d.jsx("a",{href:t,className:"rounded-md bg-foreground px-3.5 py-2.5 text-sm font-semibold text-background shadow-sm transition-colors hover:bg-foreground/80 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-foreground",children:A(N.GO_BACK)})})]})})},pv=({height:e,strokeWidth:t,toX:n,toY:r,width:o})=>d.jsx("svg",{x:n-o*t/2,y:r-e*t/2,height:e*t,width:o*t,viewBox:`-${o/2} -${e/2} ${o} ${e}`,children:d.jsx("g",{children:d.jsx("polyline",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:t,points:"-5,-4 0,0 -5,4 -5,-4"})})}),Y2=({fromHandle:e,fromNode:t,fromPosition:n,fromX:r,fromY:o,toPosition:s,toX:i,toY:l})=>{if(!t)return null;const[a]=ri({borderRadius:B0,sourcePosition:n,sourceX:r,sourceY:o,targetPosition:s,targetX:i,targetY:l}),{height:c,strokeWidth:u,width:f}={...Do.markerEnd,...Do.style},p=(e==null?void 0:e.position)===q.Left,h=p?r:i,E=p?o:l;return d.jsxs("g",{className:"cfb-connection-line",children:[d.jsx("path",{fill:"none",strokeWidth:u,className:"animated",d:a}),d.jsx(pv,{height:c,strokeWidth:u,toX:h,toY:E,width:f}),p&&d.jsx("circle",{cx:i-2,cy:l,fill:"none",r:4,strokeWidth:u})]})};function K2({isCircular:e=!1,targetNode:t,targetX:n,targetY:r}){const{width:o,height:s,position:i}=t,l=o??0,a=s??0,c=l/2;return e?{tx:i.x+c,ty:i.y+a}:{tx:n,ty:r}}const X2=e=>{const t={...e,interactionWidth:40},{id:n,source:r,target:o,sourcePosition:s,sourceX:i,sourceY:l,targetX:a,targetY:c}=t,{removeEdge:u}=Te(),f=O.useRef(null),p=de(O.useCallback(I=>I.nodeInternals.get(r),[r])),h=de(O.useCallback(I=>I.nodeInternals.get(o),[o]));if(!p||!h)return null;const E=r===o,{tx:y,ty:v}=K2({isCircular:E,targetNode:h,targetX:a,targetY:c}),[m,g,S]=ri({borderRadius:B0,sourcePosition:s,sourceX:i,sourceY:l,targetPosition:E?q.Bottom:q.Left,targetX:y,targetY:v}),_=(I,j)=>{I.stopPropagation(),u(j)},x=I=>{var j,V,M;(j=I.currentTarget)==null||j.classList.add("highlight"),(V=f.current)==null||V.classList.add("animate-delay-opacity","flex"),(M=f.current)==null||M.classList.remove("hidden")},R=I=>{var j,V,M;(j=I.currentTarget)==null||j.classList.remove("highlight"),(V=f.current)==null||V.classList.remove("animate-delay-opacity","flex"),(M=f.current)==null||M.classList.add("hidden")},{height:T,strokeWidth:L,width:P}={...Do.markerEnd,...Do.style};return d.jsxs("g",{onMouseEnter:x,onMouseLeave:R,children:[d.jsx(xo,{path:m,...t}),d.jsx(pv,{height:T,strokeWidth:L,toX:y,toY:v,width:P}),d.jsx(zT,{children:d.jsxs("button",{className:"nodrag nopan pointer-events-auto absolute hidden h-[18px] w-[26px] cursor-pointer items-center justify-center rounded-full bg-foreground/90 opacity-0 hover:h-[22px] hover:w-[30px] hover:border-2 hover:border-focus",onClick:I=>_(I,n),ref:f,style:{transform:`translate(-50%, -50%) translate(${g}px,${S}px)`},children:[d.jsx(re,{tag:"trash-can",className:"py-0.5 px-1.5 text-background"}),d.jsx("span",{className:"sr-only",children:A(N.REMOVE_EDGE)})]})})]})},Q2=/^[\w\d -']+$/,q2=/^\d+$/,J2=/^\d|\*|#$/,Z2=/^[\d*#$]{0,12}$/,eL=/^.{1,20}$/,zo={MAX:3600,MIN:0},tL=/^[a-z0-9_]{1,20}$/,Ee={MAX:99,MIN:1},Wo=e=>t=>!!e.exec(t),Lf=e=>{if(!yt(e))return!0;try{return!!new URL(e)}catch{return!1}},lt=e=>yt(e)?Wo(q2)(e):!0,nL=e=>yt(e)?Wo(J2)(e):!0,rL=e=>yt(e)?Wo(Q2)(e):!0,oL=e=>yt(e)?Wo(tL)(e):!0,hv=e=>yt(e)?Wo(Z2)(e):!0,sL=e=>yt(e)?Wo(eL)(e):!0,$a=e=>{if(!yt(e))return!0;try{return JSON.parse(e),!0}catch{return!1}},ae=e=>!!yt(e),vi=(e,t)=>{if(typeof e=="string"&&!yt(e))return!0;const n=typeof e!="number"?parseInt(e,10):e;return!Number.isNaN(n)&&n>=t},_i=(e,t)=>{if(typeof e=="string"&&!yt(e))return!0;const n=typeof e!="number"?parseInt(e,10):e;return!Number.isNaN(n)&&n<=t},er=(e,t)=>{const n=new Set,r=e.reduce((o,s)=>{const i=s[t];if(typeof i=="string"){const l=i.trim();l&&(n.has(l)&&o.add(l),n.add(l))}return o},new Set);return o=>r.has(o.trim())},Go={aiAgent:{fieldValidators:{agent:[ae]},validate:e=>Yo({nodeData:e,nodeType:"aiAgent"}),validateField:(e,t)=>ie({name:e,nodeType:"aiAgent",value:t})},cond:{fieldValidators:{value:[ae]},validate:e=>Df("cond",e),validateField:(e,t)=>ie({name:e,nodeType:"cond",value:t})},condRequest:{fieldValidators:{body:[],headers:[$a],method:[ae],saveVariables:[],url:[ae],value:[ae]},validate:e=>{const t=e,n=[];return["body","headers","method","saveVariables","url"].forEach(o=>{ie({name:o,nodeType:"condRequest",value:t[o]})||n.push(o)}),[...n,...Df("condRequest",e)]},validateField:(e,t)=>ie({name:e,nodeType:"condRequest",value:t})},executeSWML:{fieldValidators:{dest:[ae],meta:[$a],params:[$a]},validate:e=>{const t=e,n=[];return["dest","params","meta"].forEach(o=>{ie({name:o,nodeType:"executeSWML",value:t[o]})||n.push(o)}),[...n,...Df("executeSWML",e)]},validateField:(e,t)=>ie({name:e,nodeType:"executeSWML",value:t})},forwardAddress:{fieldValidators:{callOrder:[],callStateEvents:[],callStateUrl:[],connectConfirmDisplayName:[],connectConfirmEnabled:[],connectConfirmId:[ae],connectConfirmUrl:[ae,Lf],connectFrom:[],connectTimeout:[lt],connectTo:[ae],defaultFrom:[],defaultTimeout:[lt],sessionTimeout:[lt]},validate:e=>kf("forwardAddress",e),validateField:(e,t)=>ie({name:e,nodeType:"forwardAddress",value:t})},forwardPhone:{fieldValidators:{callOrder:[],callStateEvents:[],callStateUrl:[],connectConfirmDisplayName:[],connectConfirmEnabled:[],connectConfirmId:[ae],connectConfirmUrl:[ae,Lf],connectFrom:[],connectTimeout:[lt],connectTo:[ae],defaultFrom:[],defaultTimeout:[lt],sessionTimeout:[lt]},validate:e=>kf("forwardPhone",e),validateField:(e,t)=>ie({name:e,nodeType:"forwardPhone",value:t})},forwardResource:{fieldValidators:{callOrder:[],callStateEvents:[],callStateUrl:[],connectConfirmDisplayName:[],connectConfirmEnabled:[],connectConfirmId:[ae],connectConfirmUrl:[ae,Lf],connectFrom:[],connectTimeout:[lt],connectTo:[ae],defaultFrom:[],defaultTimeout:[lt],sessionTimeout:[lt]},validate:e=>kf("forwardResource",e),validateField:(e,t)=>ie({name:e,nodeType:"forwardResource",value:t})},hangup:{fieldValidators:{reason:[]},validate:e=>Pf("hangup",e),validateField:(e,t)=>ie({name:e,nodeType:"hangup",value:t})},play:{fieldValidators:{selected:[ae],text:[ae],url:[ae]},validate:e=>Pf("play",e),validateField:(e,t)=>ie({name:e,nodeType:"play",value:t})},promptPlay:{fieldValidators:{command:[rL],digit:[nL],digitTimeout:[lt,{test:vi,testValue:Ee.MIN},{test:_i,testValue:Ee.MAX}],initialTimeout:[lt,{test:vi,testValue:Ee.MIN},{test:_i,testValue:Ee.MAX}],selected:[ae],text:[ae],url:[ae]},validate:e=>{const t="promptPlay",n=e,r=er(n.options,"command"),o=er(n.options,"digit"),s=Pf("promptPlay",n),i=Za(n.initialTimeout);i!=null&&i.trim()&&!ie({name:"initialTimeout",nodeType:t,value:i})&&s.push("initialTimeout");const l=Za(n.digitTimeout);return l!=null&&l.trim()&&!ie({name:"digitTimeout",nodeType:t,value:l})&&s.push("digitTimeout"),n.options.forEach(a=>{const c=ie({name:"command",nodeType:t,value:a.command})&&!r(a.command),u=ie({name:"digit",nodeType:t,value:a.digit})&&!o(a.digit);c&&u&&(a.command||a.digit)||s.push(`option_${a.id}`)}),s},validateField:(e,t)=>ie({name:e,nodeType:"promptPlay",value:t})},record:{fieldValidators:{beep:[],endSilenceTimeout:[lt,{test:vi,testValue:Ee.MIN},{test:_i,testValue:Ee.MAX}],format:[ae],initialTimeout:[lt,{test:vi,testValue:Ee.MIN},{test:_i,testValue:Ee.MAX}],maxLength:[lt,{test:vi,testValue:zo.MIN},{test:_i,testValue:zo.MAX}],stereo:[],terminators:[hv]},validate:e=>Yo({nodeData:e,nodeType:"record"}),validateField:(e,t)=>ie({name:e,nodeType:"record",value:t})},recordCallStart:{fieldValidators:{beep:[],controlId:[],format:[ae],label:[ae,sL],stereo:[],terminators:[hv]},validate:e=>Yo({nodeData:e,nodeType:"recordCallStart"}),validateField:(e,t)=>ie({name:e,nodeType:"recordCallStart",value:t})},recordCallStop:{fieldValidators:{controlId:[ae]},validate:e=>Yo({nodeData:e,nodeType:"recordCallStop"}),validateField:(e,t)=>ie({name:e,nodeType:"recordCallStop",value:t})},request:{fieldValidators:{body:[],headers:[$a],method:[ae],saveVariables:[],url:[ae]},validate:e=>Yo({nodeData:e,nodeType:"request"}),validateField:(e,t)=>ie({name:e,nodeType:"request",value:t})},sendSms:{fieldValidators:{body:[ae],fromNumber:[ae],toNumber:[ae]},validate:e=>Yo({nodeData:e,nodeType:"sendSms"}),validateField:(e,t)=>ie({name:e,nodeType:"sendSms",value:t})},set:{fieldValidators:{key:[ae,oL],value:[]},validate:e=>{const t=e,n="set",r=[],o=er(t.variables,"key");return t.variables.forEach(s=>{const i=ie({name:"key",nodeType:n,value:s.key})&&!o(s.key),l=ie({name:"value",nodeType:n,value:s.value});i&&l||r.push(`variable_${s.id}`)}),r},validateField:(e,t)=>ie({name:e,nodeType:"set",value:t})},unset:{fieldValidators:{},validate:e=>e.variables.length>0?[]:["variables"],validateField:(e,t)=>ie({name:e,nodeType:"unset",value:t})}},at=e=>{const t=Go==null?void 0:Go[e];return{validate:t==null?void 0:t.validate,validateField:t==null?void 0:t.validateField}},mv=(e,t)=>{var r;const n=(r=Go[e])==null?void 0:r.validate;return n===void 0?[]:n(t)},bf=(e,t)=>{var n;return!e||!t?!1:((n=mv(e,t))==null?void 0:n.length)===0},iL=e=>{var t;return(t=Go[e])==null?void 0:t.fieldValidators},ie=({name:e,nodeType:t,value:n})=>{var s;let r=!0;const o=(s=iL(t))==null?void 0:s[e];return o==null||o.forEach(i=>{typeof i=="function"?r=r&&i(n):r=r&&i.test(n,i.testValue)}),r},Yo=({nodeData:e,nodeType:t})=>{var o;const n=((o=Go[t])==null?void 0:o.fieldValidators)??{},r=[];return Object.keys(n).forEach(s=>{const i=s;ie({name:s,nodeType:t,value:(e==null?void 0:e[i])??""})||r.push(s)}),r},Df=(e,t)=>{const n=t,r=[];return n.options.forEach(o=>{ie({name:"value",nodeType:e,value:o.value})||r.push(`condition_${o.id}`)}),r},kf=(e,t)=>{var s;const n=[];["callOrder","callStateEvents","callStateUrl","defaultFrom","defaultTimeout"].forEach(i=>{ie({name:i,nodeType:e,value:t[i]})||n.push(i)});const o=["connectFrom","connectTo","connectTimeout","connectConfirmUrl","connectConfirmId"];return(s=t.connections)==null||s.forEach(i=>{o.forEach(l=>{!i.connectConfirmEnabled&&(l==="connectConfirmUrl"||l==="connectConfirmId")||ie({name:l,nodeType:e,value:i[l]})||n.push(`${l}_${i.id}`)})}),n},Pf=(e,t)=>{const n=[];return ie({name:"selected",nodeType:e,value:t==null?void 0:t.selected})||n.push("selected"),t.selected==="url"?ie({name:"url",nodeType:e,value:t.url})||n.push("url"):t.selected==="text"&&(ie({name:"text",nodeType:e,value:t.text})||n.push("text")),n},ct=({data:e,id:t})=>{const n=Q(l=>l.isCanvasInteractive),{getNodeType:r,partialUpdateNodeData:o}=Te(),{isValueDuplicate:s}=If(),i=r(t);return O.useEffect(()=>{if(i&&n){let l=bf(i,e);i==="recordCallStart"&&"label"in e&&(l=l&&!s(e.label,e.controlId)),l!==e.valid&&o(t,{valid:l})}},[e,t,n,s,o,i]),O.useEffect(()=>{if(i==="aiAgent"&&n){const l=en.subscribe(a=>{if(a.status==="loaded"&&"agent"in e){const c=a.aiAgentMap.has(e.agent),u=c&&bf(i,e);u!==e.valid&&o(t,{agent:c?e.agent:"",valid:u})}});return()=>{l()}}},[e,t,n,o,i]),O.useEffect(()=>{if((a=>(i==="forwardAddress"||i==="forwardPhone"||i==="forwardResource")&&"connections"in a)(e)&&n){const a=_n.subscribe(c=>{if(c.status==="loaded"){let u=!0;const f=e.connections.map(h=>{const E=c.actions.updateConnection(h,c.swmlScriptMap);return E?(u=!1,E):h}),p=u&&bf(i,e);p!==e.valid&&o(t,{connections:f,valid:p})}});return()=>{a()}}},[e,t,n,o,i]),{getInvalidFields:()=>!i||e.valid?[]:mv(i,e),valid:()=>e.valid}},lL=({data:e,id:t,isConnectable:n,selected:r})=>{ct({data:e,id:t});const o=en(i=>i.aiAgentMap.get(e.agent)),s=o==null?void 0:o.display_name;return d.jsxs($e,{id:t,isConnectable:n,nodeTitle:A(N.AI_AGENT),selected:r,valid:e.valid,children:[s&&d.jsx(Lt,{children:d.jsx("p",{className:"truncate text-xs",children:s})}),d.jsx(Ht,{id:t,color:"positive",isConnectable:n})]})},aL=({data:e,id:t,isConnectable:n,selected:r})=>d.jsx($e,{id:t,isConnectable:n,nodeTitle:A(N.ANSWER_CALL),selected:r,valid:e.valid,children:d.jsx(Ht,{id:t,isConnectable:n,color:"positive"})}),cL=({id:e,data:t,isConnectable:n,selected:r})=>(ct({data:t,id:e}),d.jsx($e,{id:e,isConnectable:n,nodeTitle:A(N.CONDITIONS),selected:r,valid:t.valid,children:d.jsxs(Fo,{children:[t.options.map((o,s)=>{const i=o.value.trim();return d.jsx(Bt,{color:"positive",enabled:!!i,id:o.id,isConnectable:n,optionTitle:i?d.jsx("div",{className:"truncate",children:i}):A(N.CONDITION_NUMBER,{index:s+1})},o.id)}),d.jsx(Bt,{color:"negative",id:t.fallback,isConnectable:n,optionTitle:A(N.ELSE)})]})})),uL=({data:e,id:t,isConnectable:n,selected:r})=>{var s;ct({data:e,id:t});const o=e.url.trim();return d.jsxs($e,{id:t,isConnectable:n,nodeTitle:A(N.REQUEST),selected:r,valid:e.valid,children:[o&&d.jsx(Lt,{children:d.jsx("div",{className:"break-all line-clamp-3",children:o})}),d.jsxs(Fo,{children:[(s=e==null?void 0:e.options)==null?void 0:s.map((i,l)=>{const a=i.value.trim();return d.jsx(Bt,{color:"positive",enabled:!!a,id:i.id,isConnectable:n,optionTitle:a?d.jsx("div",{className:"truncate",children:a}):A(N.CONDITION_NUMBER,{index:l+1})},i.id)}),d.jsx(Bt,{color:"negative",id:e.fallback,isConnectable:n,optionTitle:A(N.ELSE)}),d.jsx(Bt,{color:"negative",id:e.error,isConnectable:n,optionTitle:A(N.FAILURE)})]})]})},dL=({data:e,id:t,isConnectable:n,selected:r})=>{var s;ct({data:e,id:t});const o=e.dest.trim();return d.jsxs($e,{id:t,isConnectable:n,nodeTitle:A(N.EXECUTE_SWML),selected:r,valid:e.valid,children:[o&&d.jsx(Lt,{children:d.jsx("div",{className:"break-all line-clamp-3",children:o})}),d.jsxs(Fo,{children:[(s=e==null?void 0:e.options)==null?void 0:s.map((i,l)=>{const a=i.value.trim();return d.jsx(Bt,{color:"positive",enabled:!!a,id:i.id,isConnectable:n,optionTitle:a?d.jsx("div",{className:"truncate",children:a}):A(N.CONDITION_NUMBER,{index:l+1})},i.id)}),d.jsx(Bt,{color:"negative",id:e.fallback,isConnectable:n,optionTitle:A(N.ELSE)})]})]})},Mf=3,fL={busy:N.BUSY,decline:N.DECLINE,error:N.ERROR,noAnswer:N.NO_ANSWER,success:N.SUCCESS},pL={address:N.FORWARD_TO_ADDRESS,phone:N.FORWARD_TO_PHONE,resource:N.FORWARD_TO_RESOURCE},Uf=({id:e,data:t,isConnectable:n,selected:r})=>{ct({data:t,id:e});const o=t.connections.filter(i=>i.connectTo),s=o.slice(0,Mf);return d.jsxs($e,{id:e,isConnectable:n,nodeTitle:A(pL[t.destinationType]),selected:r,valid:t.valid,children:[o.length?d.jsxs(Lt,{children:[d.jsx("ul",{children:s.map(i=>d.jsx("li",{className:"pb-2",children:d.jsx("div",{className:"max-w-max truncate rounded bg-secondary/20 px-1 ",children:i.connectTo})},`node-${i.id}`))}),o.length>Mf&&d.jsx("div",{children:`+ ${A(N.MORE_WITH_COUNT,{count:o.length-Mf})}`})]}):null,d.jsx(Fo,{children:t.options.map(i=>d.jsx(Bt,{color:K0(i.result),id:i.id,isConnectable:n,optionTitle:A(fL[i.result])},i.id))})]})},hL=({id:e,data:t,isConnectable:n,selected:r})=>{ct({data:t,id:e});const o=er(t.options,"command"),s=er(t.options,"digit");return d.jsxs($e,{id:e,isConnectable:n,nodeTitle:A(N.GATHER_INPUT),selected:r,valid:t.valid,children:[d.jsx(wy,{data:t}),d.jsxs(Fo,{children:[t.options.map((i,l)=>{const a=i.command.trim(),c=i.digit.trim(),u=!!(a||c)&&!o(i.command)&&!s(i.digit),f=d.jsxs("div",{className:"flex gap-1",children:[A(N.CALLER_PRESSES)," ",d.jsx("span",{className:"truncate rounded bg-secondary/20 px-1",children:c})]}),p=y=>d.jsxs("div",{className:"flex",children:[A(y?N.CALLER_SAYS:N.OR_CALLER_SAYS)," '",d.jsx("span",{className:"truncate",children:a}),"'"]});let h=A(N.OPTION_NUMBER,{index:l+1}),E="";switch(!0){case!!(a&&!c):h=p(!0);break;case!!(!a&&c):h=f;break;case!!(a&&c):h=f,E=p(!1);break}return d.jsx(Bt,{color:"positive",enabled:u,id:i.id,isConnectable:n,optionTitle:h,optionSubtitle:E},i.id)}),t.results.map(i=>d.jsx(Bt,{color:"negative",id:i.id,isConnectable:n,optionTitle:i.result==="no_input"?A(N.NO_INPUT):A(N.UNKNOWN)},i.id))]})]})},mL=({id:e,isConnectable:t,selected:n})=>d.jsx($e,{id:e,isConnectable:t,isRoot:!0,nodeTitle:A(N.HANDLE_CALL),selected:n,deletable:!1,showValidation:!1,target:!1,children:d.jsx(Ht,{id:e,color:"positive",isConnectable:t})}),Ff={busy:N.BUSY,decline:N.DECLINE,hangup:N.HANG_UP},gL=({data:e,id:t,isConnectable:n,selected:r})=>d.jsx($e,{id:t,isConnectable:n,nodeTitle:A(N.HANG_UP_CALL),selected:r,valid:e.valid,children:e.reason&&d.jsx(Lt,{children:d.jsx("p",{children:A(Ff[e.reason])})})}),EL=({data:e,id:t,isConnectable:n,selected:r})=>(ct({data:e,id:t}),d.jsxs($e,{id:t,isConnectable:n,nodeTitle:A(N.PLAY_AUDIO_TTS),selected:r,valid:e.valid,children:[d.jsx(wy,{data:e}),d.jsx(Ht,{id:t,isConnectable:n})]})),yL=({data:e,id:t,isConnectable:n,selected:r})=>{const{label:o,valid:s}=e;return ct({data:e,id:t}),d.jsxs($e,{id:t,isConnectable:n,nodeTitle:A(N.RECORD_CALL_START),selected:r,valid:s,children:[o&&s&&d.jsx(Lt,{children:d.jsx("p",{className:"truncate text-xs leading-5",children:o})}),d.jsx(Ht,{id:t,isConnectable:n,color:"positive"})]})},vL=({data:e,id:t,isConnectable:n,selected:r})=>{var i;ct({data:e,id:t});const o=(i=Bo(l=>l.entries))==null?void 0:i.find(l=>l.controlId===e.controlId),s=o==null?void 0:o.label;return d.jsxs($e,{id:t,isConnectable:n,nodeTitle:A(N.RECORD_CALL_STOP),selected:r,valid:e.valid,children:[s&&d.jsx(Lt,{children:d.jsx("p",{className:"truncate text-xs leading-5",children:s})}),d.jsx(Ht,{id:t,color:"positive",isConnectable:n})]})},_L=({data:e,id:t,isConnectable:n,selected:r})=>{ct({data:e,id:t});const o=new Set(e.terminators);return d.jsxs($e,{id:t,isConnectable:n,nodeTitle:A(N.VOICEMAIL_RECORDING),selected:r,valid:e.valid,children:[e.terminators?d.jsxs(Lt,{children:[A(N.TERMINATORS),":"," ",d.jsx("ul",{className:"inline-flex flex-wrap justify-start gap-1",children:[...o].sort().map((s,i)=>d.jsx("li",{className:"rounded bg-secondary/20 px-1",children:s},`${i}-${s}`))})]}):null,d.jsx(Ht,{id:t,isConnectable:n,color:"positive"})]})},SL={failed:N.FAILED,success:N.SUCCESS},gv={aiAgent:lL,answer:aL,cond:cL,condRequest:uL,executeSWML:dL,forwardAddress:Uf,forwardPhone:Uf,forwardResource:Uf,handleCall:mL,hangup:gL,play:EL,promptPlay:hL,record:_L,recordCallStart:yL,recordCallStop:vL,request:({data:e,id:t,isConnectable:n,selected:r})=>{var o;return ct({data:e,id:t}),d.jsxs($e,{id:t,isConnectable:n,nodeTitle:A(N.REQUEST),selected:r,valid:e.valid,children:[d.jsx("p",{className:"p-4 pt-0 text-xs text-negative",children:A(N.DEPRECATED)}),d.jsx(Fo,{children:(o=e==null?void 0:e.options)==null?void 0:o.map(s=>d.jsx(Bt,{color:K0(s.result),id:s.id,isConnectable:n,optionTitle:A(SL[s.result])},s.id))})]})},sendSms:({data:e,id:t,isConnectable:n,selected:r})=>(ct({data:e,id:t}),d.jsxs($e,{id:t,isConnectable:n,nodeTitle:A(N.SEND_SMS),selected:r,valid:e.valid,children:[e.body&&d.jsx(Lt,{children:d.jsx("p",{className:"break-words line-clamp-3",children:e.body})}),d.jsx(Ht,{id:t,isConnectable:n})]})),set:({id:e,data:t,isConnectable:n,selected:r})=>{const{getInvalidFields:o}=ct({data:t,id:e}),s=o().reduce((l,a)=>(a.startsWith("variable_")&&l.push(a.replace("variable_","")),l),[]),i=t.variables.filter(l=>!!l.key);return d.jsxs($e,{id:e,isConnectable:n,nodeTitle:A(N.SET_VARIABLES),selected:r,valid:t.valid,children:[i.length>0&&d.jsx(Lt,{children:d.jsx("ul",{className:"flex flex-col",children:i.map(l=>d.jsxs("li",{className:"flex w-full gap-1 pb-2",children:[d.jsx("div",{className:`max-w-[50%] shrink-0 truncate rounded px-1 ${s.includes(l.id)?"bg-negative/10 text-negative":"bg-secondary/20"}`,children:l.key}),"=",l.value&&d.jsx("div",{className:"truncate",children:l.value})]},l.id))})}),d.jsx(Ht,{id:e,isConnectable:n,color:"positive"})]})},unset:({id:e,data:t,isConnectable:n,selected:r})=>{ct({data:t,id:e});const o=t.variables.filter(s=>!!s.key);return d.jsxs($e,{id:e,isConnectable:n,nodeTitle:A(N.UNSET_VARIABLES),selected:r,valid:t.valid,children:[o.length>0&&d.jsx(Lt,{children:d.jsx("ul",{children:o.map(s=>d.jsx("li",{className:"pb-2",children:d.jsx("div",{className:"max-w-max truncate rounded bg-secondary/20 px-1",children:s.key})},s.id))})}),d.jsx(Ht,{id:e,isConnectable:n,color:"positive"})]})}},xL={floating:X2},RL=({children:e})=>{const t=Q(S=>S.nodes),n=Q(S=>S.edges),r=Q(S=>S.isCanvasInteractive),{onConnect:o,onConnectEnd:s,onConnectStart:i,onEdgesChange:l,onEdgesDelete:a,onEdgeUpdate:c,onEdgeUpdateEnd:u,onEdgeUpdateStart:f,onInit:p,onNodeDragStart:h,onNodeDragStop:E,onNodesChange:y,onNodesDelete:v,onSelectionChange:m,setFlowWrapperElement:g}=Te();return d.jsx("div",{className:"bg-sw-white !h-auto w-full",ref:S=>g(S),children:d.jsxs(M0,{attributionPosition:"bottom-left",connectionLineComponent:Y2,connectionMode:Wn.Strict,deleteKeyCode:r?SA:null,defaultEdgeOptions:Do,edges:n,edgeTypes:xL,elementsSelectable:r,fitViewOptions:rf,multiSelectionKeyCode:r?xA:null,nodes:t,nodesConnectable:r,nodesDraggable:r,nodeTypes:gv,onConnect:o,onConnectEnd:s,onConnectStart:i,onEdgesChange:l,onEdgesDelete:a,onEdgeUpdate:r?c:void 0,onEdgeUpdateEnd:u,onEdgeUpdateStart:f,onInit:p,onNodeDragStart:h,onNodeDragStop:E,onNodesChange:y,onNodesDelete:v,onSelectionChange:m,selectionKeyCode:r?RA:null,snapGrid:[ya,ya],snapToGrid:!0,children:[d.jsx(aA,{className:"bg-background-alt text-grid",color:"currentColor",gap:[ya,ya],variant:Ct.Dots}),e]})})},NL=()=>{const e=Q(l=>l.initializing),t=Q(l=>l.reactFlowInstance),{setInitializing:n,setViewportChanging:r}=Te(),o=O.useRef(!1),s=XT({includeHiddenNodes:!0}),i=O.useMemo(()=>()=>{t==null||t.fitView(rf)},[t]);O.useEffect(()=>{let l;e?!o.current&&!s?o.current=!0:o.current&&s&&(clearTimeout(l),r(!0),i(),l=setTimeout(()=>{r(!1)},rf.duration),n(!1),o.current=!1):o.current=!1},[e,i,s,n,r])},wL=()=>{const{onViewportChange:e,onViewportChangeEnd:t,onViewportChangeStart:n}=Te();return NL(),GT({onChange:e,onEnd:t,onStart:n}),null},OL=()=>{const e=Q(n=>n.selectedNode),t=e?L2.get(e.type):void 0;return t?d.jsx(Zs,{className:"z-40 max-w-[40%] rounded-md bg-background",position:"bottom-center",children:d.jsxs("div",{className:"justify-left flex items-center gap-2 rounded-md bg-primary/10 p-3 py-4","data-testid":"cfb__info",children:[d.jsx(re,{className:"shrink-0 text-primary",tag:"circle-info",size:"xl"}),d.jsx("div",{className:"text-xs font-medium",children:Ua(t)})]})}):null},TL=e=>{var s;const t=O.useRef(),n=WT(),r=e&&"options"in e.data?(s=e.data.options)==null?void 0:s.length:0;return t.current=r,{updateDynamicHandles:i=>{"options"in i&&i.options.length!==t.current&&(e&&n(e.id),t.current=i.options.length)}}},AL="/hello/.test('%{foo}')",IL=()=>({id:le(),value:""}),jf=({nodeData:e,handleOnUpdate:t,placeholder:n=AL})=>{const{validateField:r}=at("cond"),[o,s]=O.useState({options:e.options.map(f=>({id:!0,initial:e.initial,value:r("value",f.value)}))}),i=f=>{f.preventDefault(),s({...o,options:[...o.options,{initial:!0,value:!0}]}),t({options:[...e.options,IL()]})},l=f=>p=>{p.preventDefault();const h=[...o.options];h.splice(f,1),s({...o,options:h});const E=[...e.options];E.splice(f,1),t({options:E})},a=(f,p)=>{const h=[...e.options];if(!h[f])throw new Error(`Option not found at index ${f}`);const{name:E,value:y}=p,v=[...o.options];v[f]={...v[f],initial:!1,[E]:r(E,y)},s({...o,options:v}),h[f]={...h[f],[E]:y},t({options:h})},c=(f,p)=>{const h=f.target,{name:E,value:y}=h;switch(t({initial:!1}),E){case"value":p!==void 0&&a(p,{name:E,value:y});break;default:Ne().error(`Unhandled input name: ${E}`)}},u=({index:f,name:p})=>{const h=o.options[f];return(h==null?void 0:h[p])||(h==null?void 0:h.initial)};return d.jsxs(d.Fragment,{children:[d.jsx("ol",{className:"divide-y-4 divide-foreground/10 border-b-4 border-foreground/10",children:e.options.map((f,p,h)=>d.jsxs("li",{className:"flex pt-3",children:[d.jsx("div",{className:"w-8 shrink-0 text-center",children:d.jsx(re,{className:"text-foreground/60",size:"xs",tag:"bars"})}),d.jsxs("div",{className:"relative mr-3",children:[h.length>1&&d.jsx(Uo,{className:"absolute right-0 top-0",handleDelete:l(p),label:A(N.REMOVE_CONDITION,{index:p+1}),size:"sm",show:!0}),d.jsxs("label",{className:"mb-2 block",children:[A(N.CONDITION_NUMBER,{index:p+1}),d.jsx("input",{className:`w-full ${u({index:p,name:"value"})?"":"invalid"}`,name:"value",onChange:E=>c(E,p),placeholder:n,type:"text",value:f.value}),d.jsx("p",{className:"requirements",role:"alert",children:A(N.ERROR_VALUE_IS_REQUIRED)})]})]})]},f.id))}),d.jsx("div",{className:"p-3 text-right",children:d.jsx("button",{className:"rounded bg-foreground/10 py-1 px-2 font-medium",onClick:i,type:"button",children:A(N.ADD_CONDITION)})})]})},CL=Ne(),Si=(e,t)=>[e,t].filter(Boolean).join("-").toLowerCase(),LL={idsByKey:{},languageById:{},voiceById:{}},bL=(e,t)=>({...LL,actions:{getGenderByKeys:({languageId:n})=>{const{idsByKey:r}=t(),o=(n==null?void 0:n.split(",").map(i=>Si(i)))??[];if(!o.length)return["female","male"];const s=new Set;return o.forEach(i=>{var l;return(l=r[i])==null?void 0:l.forEach(a=>{a.gender&&s.add(a.gender)})}),Array.from(s).sort((i,l)=>i.toLowerCase().localeCompare(l.toLowerCase()))},getLanguages:()=>Object.values(t().languageById).sort((n,r)=>n.name.toLowerCase().localeCompare(r.name.toLowerCase())),getVoicesByKeys:({languageId:n,gender:r})=>{const{voiceById:o,idsByKey:s}=t(),i=(n==null?void 0:n.split(",").map(a=>Si(a,r)))??[];let l=[];return!i.length||i[0]===""?l=Object.values(o):i.forEach(a=>{l=l.concat(s[a]??[])}),l.sort((a,c)=>{const u=/^\w{2,3}-\w{2,}-.+/;return a.name.match(u)&&!c.name.match(u)?1:!a.name.match(u)&&c.name.match(u)?-1:a.name.toLowerCase().localeCompare(c.name.toLowerCase())})},init:async({voicesURL:n="/voices.json"})=>{try{CL.debug("Load voicesURL",n);const o=await(await fetch(n)).json(),s={},i={},l={};o.forEach(a=>{var v,m,g;const c=!!a.premium,u=a.signalwire_id,f=a.gender.toLowerCase(),p={gender:f,id:u,key:`${a.language_code}-${f}-${a.signalwire_id}`,name:`${a.friendly_name.trim()} ${c?"(premium)":""}`,premium:c};s[u]=p,i[a.language_code]={id:a.language_code,name:a.language};const h=Si(a.language_code);h in l||(l[h]=[]),(v=l[h])==null||v.push(p);const E=Si(f);E in l||(l[E]=[]),(m=l[E])==null||m.push(p);const y=Si(a.language_code,f);y in l||(l[y]=[]),(g=l[y])==null||g.push(p)}),e({idsByKey:l,languageById:i,voiceById:s})}catch(r){console.error("Error",r)}}}}),Vf=bo()(bL),DL=()=>Vf.getState().actions;window.__useVoiceStore=Vf;const Ev=e=>d.jsx("option",{value:e.id,children:e.name},e.key??e.id),kL=({onChange:e,languageId:t,gender:n,voiceId:r})=>{const{getLanguages:o,getVoicesByKeys:s,getGenderByKeys:i}=DL();return d.jsxs(d.Fragment,{children:[d.jsxs(Zt,{className:"w-full",label:A(N.LANGUAGE),name:"language",onChange:e,value:t??"",children:[d.jsx("option",{value:"",children:A(N.SELECT)}),o().map(Ev)]}),d.jsxs(Zt,{className:"w-full capitalize",label:A(N.GENDER),name:"gender",onChange:e,value:n??"",children:[d.jsx("option",{value:"",children:A(N.SELECT)}),i({languageId:t}).map(l=>d.jsx("option",{value:l,children:l},l))]}),d.jsxs(Zt,{className:"w-full",label:A(N.VOICE),name:"voice",onChange:e,value:r??"",children:[d.jsx("option",{value:"",children:A(N.SELECT)}),s({gender:n,languageId:t}).map(Ev)]})]})},yv={text:N.TEXT_TO_SPEECH,url:N.PLAY_AUDIO_FILE},vv=({handleOnUpdate:e,label:t,nodeData:n,showDefaultOption:r})=>{const{validateField:o}=at("play"),[s,i]=O.useState({gender:!0,language:!0,selected:n.initial||o("selected",n.selected),text:n.initial||o("text",n.text),url:n.initial||o("url",n.url),voice:!0}),l=n.selected;O.useEffect(()=>{!l&&!r&&e({selected:"url"})},[e,l,r]);const a=u=>{const f=u.target,{name:p,value:h}=f;switch(p){case"selected":case"text":case"url":i({...s,[p]:o(p,h)}),e({initial:!1,[p]:h});break;default:throw new Error(`Unhandled input name: ${p}`)}},c=u=>{const f=u.target,{name:p,value:h}=f;switch(p){case"language":e({gender:void 0,language:h,voice:void 0});break;case"gender":e({gender:h,voice:void 0});break;default:e({[p]:h})}};return d.jsxs(d.Fragment,{children:[d.jsxs("label",{className:"mb-2",children:[d.jsx("span",{className:"sr-only",children:t}),d.jsxs(Oy,{className:`w-full ${s.selected?"":"invalid"}`,name:"selected",onChange:a,value:l,children:[r&&d.jsx("option",{value:"",children:A(N.SELECT)}),Object.keys(yv).map(u=>d.jsx("option",{value:u,children:A(yv[u])},u))]})]}),l&&d.jsx(PL,{nodeData:n,onChange:a,voiceSettingsChangeHandler:c,selected:l,valid:s[l]})]})},PL=({nodeData:e,onChange:t,voiceSettingsChangeHandler:n,selected:r,valid:o})=>{const s=e[r],l={text:d.jsxs(d.Fragment,{children:[d.jsx(kL,{onChange:n,languageId:e.language,gender:e.gender,voiceId:e.voice}),d.jsx(yn,{errorText:A(N.ERROR_VALUE_IS_REQUIRED),inputMode:"text",label:A(N.TEXT),name:r,onChange:t,placeholder:A(N.WRITE_SOMETHING),valid:o,value:s})]}),url:d.jsx(yn,{errorText:A(N.ERROR_URL_IS_REQUIRED),inputMode:"url",label:A(N.AUDIO_FILE),name:r,onChange:t,placeholder:A(N.ENTER_URL),valid:o,value:s})}[r];return d.jsx(d.Fragment,{children:l})},ML=[{field:"stereo",subtitle:N.STEREO_SUBTITLE,title:N.STEREO},{field:"beep",subtitle:N.BEEP_SUBTITLE,title:N.BEEP}],_v=({handleOnUpdate:e,nodeData:t,type:n})=>{const{validateField:r}=at("record"),[o,s]=O.useState({beep:!0,endSilenceTimeout:t.initial||r("endSilenceTimeout",t.endSilenceTimeout),format:!0,initialTimeout:t.initial||r("initialTimeout",t.initialTimeout),maxLength:t.initial||r("maxLength",t.maxLength),stereo:!0,terminators:t.initial||r("terminators",t.terminators)});t.format||e({format:"mp3"});const i=a=>{const c=a.target.name;e({[c]:!t[c]})},l=a=>{const c=a.target,{name:u,value:f}=c;switch(u){case"endSilenceTimeout":case"format":case"initialTimeout":case"maxLength":case"terminators":s({...o,[u]:r(u,f)}),e({initial:!1,[u]:f});break;default:throw new Error(`Unhandled input name: ${u}`)}};return d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"mb-2",children:ML.map(a=>{const c=t[a.field];return d.jsx("div",{children:d.jsx(Ta,{checked:c,clickHandler:i,name:a.field,subtitle:A(a.subtitle),title:A(a.title)})},a.field)})}),d.jsxs("label",{className:"mb-2 block",children:[A(N.TERMINATORS),d.jsx("span",{className:"block text-xxs text-foreground/50",children:A(N.SEPARATE_WITH_COMMAS)}),d.jsx("input",{className:`w-full ${o.terminators?"":"invalid"}`,name:"terminators",onChange:l,placeholder:"#*0",type:"text",value:t.terminators}),d.jsx("p",{className:"requirements",role:"alert",children:A(N.ERROR_TERMINATORS)})]}),n==="voicemail"&&d.jsxs(d.Fragment,{children:[d.jsxs("label",{className:"mb-2 block",children:[d.jsx("div",{className:"w-full",children:A(N.MAXIMUM_RECORDING_LENGTH)}),d.jsxs("div",{className:"flex flex-wrap items-center gap-x-2",children:[d.jsx("input",{className:`w-14 ${o.maxLength?"":"invalid"}`,inputMode:"numeric",min:zo.MIN,max:zo.MAX,name:"maxLength",onChange:l,placeholder:A(N.SECONDS),type:"number",value:t.maxLength}),d.jsx("p",{className:"requirements w-full",role:"alert",children:A(N.ERROR_NUMBER_MIN_MAX_IS_REQUIRED,{max:zo.MAX,min:zo.MIN})})]})]}),d.jsxs("label",{className:"mb-2 block",children:[d.jsx("div",{className:"w-full",children:A(N.INITIAL_TIMEOUT)}),d.jsxs("div",{className:"flex flex-wrap items-center gap-x-2",children:[d.jsx("input",{className:`w-14 ${o.initialTimeout?"":"invalid"}`,inputMode:"numeric",min:Ee.MIN,max:Ee.MAX,name:"initialTimeout",onChange:l,placeholder:A(N.SECONDS),type:"number",value:t.initialTimeout}),d.jsx("p",{className:"requirements w-full",role:"alert",children:A(N.ERROR_NUMBER_MIN_MAX_IS_REQUIRED,{max:Ee.MAX,min:Ee.MIN})})]})]}),d.jsxs("label",{className:"mb-2 block",children:[d.jsx("div",{className:"w-full",children:A(N.END_SILENCE_TIMEOUT)}),d.jsxs("div",{className:"flex flex-wrap items-center gap-x-2",children:[d.jsx("input",{className:`w-14 ${o.endSilenceTimeout?"":"invalid"}`,inputMode:"numeric",min:Ee.MIN,max:Ee.MAX,name:"endSilenceTimeout",onChange:l,placeholder:A(N.SECONDS),type:"number",value:t.endSilenceTimeout}),d.jsx("p",{className:"requirements w-full",role:"alert",children:A(N.ERROR_NUMBER_MIN_MAX_IS_REQUIRED,{max:Ee.MAX,min:Ee.MIN})})]})]})]}),d.jsxs(Zt,{className:"w-full",label:A(N.FORMAT),name:"format",onChange:l,value:t.format,children:[d.jsx("option",{value:"mp3",children:"MP3"}),d.jsx("option",{value:"wav",children:"WAV"})]})]})},Ze=({children:e,formRef:t,handleOnChange:n=()=>null,title:r})=>d.jsxs("div",{className:"flex flex-col overflow-hidden","data-testid":"cfb__settings",children:[d.jsxs("div",{className:"flex w-full items-center justify-start gap-x-2 px-4 pb-3",children:[d.jsx("div",{className:"flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-focus/30 text-primary",children:d.jsx(re,{tag:"circle-small"})}),d.jsx("div",{className:"flex-1",children:d.jsx("h2",{className:"text-xs font-semibold",children:r})})]}),d.jsx("form",{className:"flex h-full flex-col overflow-hidden text-xs",noValidate:!0,onChange:n,ref:t,children:d.jsx("div",{className:"flex-1 overflow-y-auto pt-1 pb-4",children:e})})]}),UL=({nodeData:e,handleOnUpdate:t})=>{const{validateField:n}=at("aiAgent"),[r,o]=O.useState({agent:e.initial||n("agent",e.agent)}),s=en(y=>y.aiAgentMap.values()),i=en(y=>y.error),l=en(y=>y.status),{fetchAiAgents:a}=k2();O.useEffect(()=>{a()},[a]);const c=Array.from(s),u=l==="loading",f=!!i||l==="error",p=f||l==="initial",h=y=>{const v=y.target,{name:m,value:g}=v;o({...r,[m]:n(m,g)}),t({initial:!1,[m]:g})},E=O.useId();return d.jsx(Ze,{title:A(N.AI_AGENT),children:d.jsx("div",{className:"mx-3",children:!f&&c.length?d.jsxs("div",{className:"relative",children:[d.jsxs(Zt,{id:E,className:`${r.agent?"":"invalid"}`,disabled:p,label:A(N.AI_AGENT_NAME),name:"agent",onChange:h,value:e.agent,children:[d.jsx("option",{value:"",children:A(N.SELECT)}),c.map(y=>d.jsx("option",{value:y.id,children:y.display_name},y.id))]}),d.jsx(Sv,{className:"absolute top-0 right-0 mx-1",handleClickResync:a,isLoading:u}),e.agent&&d.jsx("p",{children:d.jsx(xv,{agent:e.agent,mode:"edit",className:"mb-2",children:A(N.EDIT_SELECTED_AI_AGENT)})})]}):d.jsxs("div",{className:"flex items-end justify-between",children:[d.jsx("p",{role:"alert",className:"text-negative",children:f?d.jsx(d.Fragment,{children:A(N.ERROR_FETCHING_AI_AGENTS)}):d.jsxs(d.Fragment,{children:[A(N.ERROR_ADD_AI_AGENT_FIRST),d.jsx(xv,{mode:"add",className:"mt-2 block",children:A(N.ADD_AI_AGENT)})]})}),d.jsx(Sv,{className:"mx-1",handleClickResync:a,isLoading:u})]})})})},Sv=({className:e="",isLoading:t,handleClickResync:n})=>d.jsx(Zn,{placement:"bottom-end",trigger:d.jsxs("button",{className:`overflow-hidden ${t?"text-disabled":""} ${e}`,disabled:t,onClick:n,type:"button",children:[d.jsx(re,{className:`${t?"animate-spin":""}`,tag:"arrows-rotate"}),d.jsx("span",{className:"sr-only",children:A(N.RESYNC_AI_AGENTS)})]}),children:d.jsx("p",{className:"text-sm",children:A(N.RESYNC_AI_AGENTS)})}),xv=({agent:e="",children:t,className:n="",mode:r})=>{const o={add:"",edit:`${e}/edit`};return d.jsx("a",{className:`w-fit text-foreground underline hover:text-foreground/80 ${n}`,href:`/ai_agents/${o[r]}`,target:"_blank",rel:"noopener noreferrer",children:t})},FL=["GET","POST","PUT","DELETE"],jL=({nodeData:e,handleOnUpdate:t})=>{const{validateField:n}=at("condRequest"),[r,o]=O.useState({body:e.initial||n("body",e.body),headers:e.initial||n("headers",e.headers),method:e.initial||n("method",e.method),saveVariables:e.initial||n("saveVariables",e.saveVariables),url:e.initial||n("url",e.url)}),s=a=>{const c=a.target,{name:u,value:f}=c;switch(t({initial:!1}),u){case"url":case"method":o({...r,[u]:n(u,f)}),t({[u]:f});break;case"headers":o({...r,[u]:n(u,f)}),t({[u]:f});break;case"body":o({...r,[u]:n(u,f)}),t({[u]:f});break;default:throw new Error(`Unhandled input name: ${u}`)}},i=a=>{const{name:c,value:u}=a.target;t({[c]:u})},l=a=>{const{name:c}=a.target,u=!e[c];t({[c]:u})};return d.jsxs(Ze,{title:A(N.REQUEST),children:[d.jsxs("div",{className:"border-b-4 border-foreground/10 px-3",children:[d.jsxs("label",{className:"mb-2 block",children:[A(N.URL),d.jsx("input",{className:`w-full ${r.url?"":"invalid"}`,name:"url",onChange:s,placeholder:"https://u:p@example.com/api/status",type:"text",value:e.url}),d.jsx("p",{className:"requirements w-full",role:"alert",children:A(N.ERROR_VALUE_IS_REQUIRED)})]}),d.jsx("div",{className:"mb-1",children:d.jsx(Zt,{className:"w-full",label:A(N.METHOD),name:"method",onChange:i,value:e.method,children:FL.map(a=>d.jsx("option",{value:a,children:a},a))})}),d.jsx("div",{className:"mb-4",children:d.jsx(Ta,{checked:e.saveVariables,clickHandler:l,name:"saveVariables",subtitle:A(N.SAVE_VARIABLES_SUBTITLE),title:A(N.SAVE_VARIABLES)})}),d.jsx("label",{className:"mb-2 block",children:d.jsx(yn,{errorText:A(N.ERROR_INVALID_JSON),inputMode:"text",label:A(N.REQUEST_HEADERS),name:"headers",onChange:s,placeholder:'{"Content-Type": "application/json", "X-Custom-Header": "foo"}',valid:r.headers,value:e.headers})}),d.jsx("label",{className:"mb-2 block",children:d.jsx(yn,{errorText:A(N.ERROR_INVALID_JSON),inputMode:"text",label:A(N.REQUEST_BODY),name:"body",onChange:s,placeholder:A(N.STRING_OR_JSON),valid:r.body,value:e.body??""})})]}),d.jsx(jf,{nodeData:e,handleOnUpdate:t})]})},VL=({nodeData:e,handleOnUpdate:t})=>{const n=O.useRef();return d.jsx(Ze,{formRef:n,title:A(N.CONDITIONS),children:d.jsx("div",{children:d.jsx(jf,{nodeData:e,handleOnUpdate:t})})})},$L=({nodeData:e,handleOnUpdate:t})=>{const{validateField:n}=at("executeSWML"),[r,o]=O.useState({dest:e.initial||n("dest",e.dest),meta:e.initial||n("meta",e.meta),params:e.initial||n("params",e.params)}),s=i=>{const l=i.target,{name:a,value:c}=l;switch(t({initial:!1}),a){case"dest":case"params":case"meta":o({...r,[a]:n(a,c)}),t({[a]:c});break;default:throw new Error(`Unhandled input name: ${a}`)}};return d.jsxs(Ze,{title:A(N.EXECUTE_SWML),children:[d.jsxs("div",{className:"border-b-4 border-foreground/10 px-3",children:[d.jsxs("label",{className:"mb-2 block",children:[A(N.URL),d.jsx("input",{className:`w-full ${r.dest?"":"invalid"}`,name:"dest",onChange:s,placeholder:"https://u:p@test.com/go.swml",type:"text",value:e.dest}),d.jsx("p",{className:"requirements w-full",role:"alert",children:A(N.ERROR_VALUE_IS_REQUIRED)})]}),d.jsx("label",{className:"mb-2 block",children:d.jsx(yn,{errorText:A(N.ERROR_INVALID_JSON),inputMode:"text",label:A(N.PARAMS),name:"params",onChange:s,placeholder:'{"Content-Type": "application/json", "X-Custom-Header": "foo"}',valid:r.params,value:e.params??""})}),d.jsx("label",{className:"mb-2 block",children:d.jsx(yn,{errorText:A(N.ERROR_INVALID_JSON),inputMode:"text",label:A(N.META),name:"meta",onChange:s,placeholder:A(N.JSON_OBJECT),valid:r.meta,value:e.meta??""})})]}),d.jsx(jf,{nodeData:e,handleOnUpdate:t,placeholder:"return_value === '1'"})]})},Rv=(e,t)=>{O.useEffect(()=>{var o;const n=(o=e.current)==null?void 0:o.getRootNode(),r=s=>{var l;const i=s.target;i instanceof Node&&!((l=e.current)!=null&&l.contains(i))&&t(s)};return n&&n.addEventListener("pointerdown",r),()=>{n&&n.removeEventListener("pointerdown",r)}},[e,t])},$f=e=>{const[t,n]=O.useReducer((r,o)=>({...r,...o}),e);return[t,n]},HL=Ne(),BL=({enable:e,searchParams:t})=>{const n=_n(f=>f.results),r=_n(f=>f.status),o=_n(f=>f.error),{buildParamsFromQuery:s,buildQueryFromParams:i,getCachedResults:l,fetchSwmlScript:a,setResults:c}=dv(),u=i(t);return O.useEffect(()=>{if(!e)return;const f=l(u);f&&c(f);const p=s(u),h=setTimeout(()=>{a(p).catch(E=>{HL.error("Error fetching swml scripts",E)})},W0);return()=>clearTimeout(h)},[s,i,e,a,l,u,c]),[n,r,o]},Hf=e=>e==="external",zL={externalValue:"",focusedId:"",focusedName:"",open:!1,query:""},WL=({confirmId:e,confirmName:t,confirmUrl:n,onChange:r,valid:o})=>{var B;const s={displayName:A(N.EXTERNAL_URL),id:"external"},i=O.useRef(null),l=O.useRef(null),a=O.useRef(null),c=O.useRef({}),u=O.useId(),f=O.useId(),p=O.useId(),[h,E]=$f({...zL,externalValue:Hf(e)?n:"",query:t??""}),y=Hf(e),v=h.query===""||h.query.toLocaleLowerCase()===t.toLocaleLowerCase(),[m,g]=BL({enable:h.open&&!h.focusedName,searchParams:{name:v?"":h.query}}),S=[{displayName:A(N.EXTERNAL_URL),id:s.id},...m],_=v?S:m,x=()=>E({focusedId:"",focusedName:""}),R=W=>{E({open:!0,query:W.target.value}),x()},T=W=>{E({externalValue:W.target.value}),r({connectConfirmDisplayName:s.displayName,connectConfirmId:s.id,connectConfirmUrl:W.target.value})},L=()=>{E({focusedId:e,open:!0}),j()},P=()=>{E({open:!1}),x()},I=()=>h.open?P():L(),j=()=>{var W;(W=l.current)==null||W.focus()},V=W=>{const z=J0(S,"id",W);E({query:z.displayName});const Y=X=>"requestUrl"in X?X.requestUrl:h.externalValue;r({connectConfirmDisplayName:z.displayName,connectConfirmId:z.id,connectConfirmUrl:Y(z)}),P()},M=W=>{j(),V(W)},w=W=>{const z=h.focusedId||e||"",Y=TA(W,z,_),X=Y&&c.current[Y==null?void 0:Y.id];if(X){X==null||X.focus({preventScroll:!0}),X==null||X.scrollIntoView({block:"nearest"});const Z=J0(S,"id",X.id);E({focusedId:Z.id,focusedName:Z.displayName}),l.current&&(l.current.value=Z.displayName)}else j();h.open||L()},b=()=>{c.current[h.focusedId]&&V(h.focusedId)},k=()=>{h.query!==t&&E({query:t}),P()},F=W=>{const{key:z}=W;switch(z){case"ArrowDown":case"ArrowUp":W.preventDefault(),w(z),j();break;case"Enter":W.preventDefault(),b();break;case"Escape":W.preventDefault(),k();break}};O.useEffect(()=>{y&&a.current&&a.current.focus()},[y]),Rv(i,P);const C=h.open&&!_.length,D=g==="loading"&&C,U=g==="error",$=t&&e===""&&n==="";return d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:`relative mb-2 block ${U?"after:border-t-foreground/40":"after:border-t-foreground"}`,ref:i,children:[d.jsx("label",{className:"block pb-1 font-medium",id:f,htmlFor:u,children:A(N.HANDLE_VIA)}),d.jsxs("div",{className:"relative pb-1",children:[d.jsx("input",{"aria-activedescendant":h.open?h.focusedId:void 0,"aria-invalid":C,"aria-autocomplete":"list","aria-controls":h.open?u:void 0,"aria-expanded":h.open,"aria-labelledby":f,autoComplete:"off",className:`${U||$?"invalid":""} rounded-md border border-foreground !p-2 !pr-8`,disabled:U,onChange:R,onClick:L,onKeyDown:F,placeholder:h.open?A(N.SEARCH_FOR_INTERNAL_SCRIPT):A(N.EXTERNAL_OR_INTERNAL_RESOURCE),ref:l,role:"combobox",type:"text",value:h.focusedName||h.query}),d.jsxs("button",{"aria-controls":h.open?u:void 0,"aria-expanded":h.open,"aria-haspopup":"listbox","aria-labelledby":`${f} ${p}`,className:`${h.open?"after:rotate-180":"after:rotate-0"} chevron-down absolute inset-y-0 right-0 px-4 after:transition-transform focus-within:!ring-0 focus-within:!ring-offset-0`,disabled:U,id:p,onClick:I,tabIndex:-1,type:"button",children:[D&&d.jsx(re,{className:"absolute top-3 right-7 animate-spin",tag:"arrows-rotate",size:"xs"}),d.jsx("span",{className:"sr-only",children:A(h.open?N.TOGGLE_CLOSE:N.TOGGLE_OPEN)})]}),d.jsxs("p",{className:"requirements w-full",role:"alert",children:[$&&A(N.SCRIPT_NOT_FOUND),U&&A(N.ERROR_FETCHING_SWML_SCRIPTS)]})]}),!U&&h.open&&d.jsx("ul",{className:"max-h-60 w-full overflow-auto rounded shadow-[0px_2px_6px_2px_rgba(0,0,0,0.15),_0px_1px_2px_0px_rgba(0,0,0,0.30)]","aria-labelledby":f,id:u,role:"listbox",onKeyDown:F,children:_.length?d.jsxs(d.Fragment,{children:[_.length===1&&Hf((B=_==null?void 0:_[0])==null?void 0:B.id)&&(g==="loaded"||g==="loading")&&d.jsx(Bf,{displayName:A(g==="loading"?N.STATUS_LOADING:N.NO_SCRIPTS_FOUND)}),_.map(({displayName:W,id:z},Y)=>{const X=e===z,Z=h.focusedId?h.focusedId===z:Y===0;return d.jsx(Bf,{active:X,focus:Z,displayName:W,handleOnClick:()=>M(z),id:z,ref:J=>c.current[z]=J},z)})]}):d.jsx(Bf,{displayName:A(D?N.STATUS_LOADING:N.NO_RESULTS)})})]}),y&&d.jsxs("label",{className:"mb-2 block",children:[d.jsx("span",{className:"sr-only",children:A(N.EXTERNAL_OPTION_LABEL)}),d.jsxs("div",{className:"flex flex-wrap items-center gap-x-2",children:[d.jsx("input",{className:`w-14 ${o?"":"invalid"}`,inputMode:"url",name:"connectConfirmUrl",onChange:T,placeholder:A(N.ENTER_URL),ref:a,type:"url",value:h.externalValue}),d.jsx("p",{className:"requirements w-full",role:"alert",children:A(N.ERROR_URL_IS_REQUIRED)})]})]}),!m.length&&!y&&d.jsx("div",{className:"mb-2",children:d.jsx("p",{children:d.jsx(GL,{children:A(N.ADD_SWML_SCRIPTS)})})})]})},Bf=O.forwardRef(function({active:t,displayName:n,focus:r,handleOnClick:o,id:s},i){const l=!!o,a=l?`cursor-pointer transition-colors hover:bg-primary/5 focus:bg-primary/5 aria-selected:bg-primary/20 ${r?"bg-primary/5":""}`:"";return d.jsx("li",{"aria-selected":t,className:`relative select-none bg-background py-1 px-3 text-xs leading-6 ${a}`,id:s,onClick:o,ref:i,role:l?"option":"presentation",tabIndex:-1,children:n})}),GL=({children:e,className:t=""})=>d.jsx("a",{className:`w-fit text-foreground underline hover:text-foreground/80 ${t}`,href:"/relay-bins",target:"_blank",rel:"noopener noreferrer",children:e}),YL=({confirmId:e,confirmName:t,confirmUrl:n,enabled:r,handleOnChange:o,onCheck:s,valid:i})=>{const l=O.useId(),{validateCache:a}=dv();return O.useEffect(()=>{r&&a()},[r,a]),d.jsxs(d.Fragment,{children:[d.jsx(Ta,{"aria-controls":l,"aria-expanded":r,checked:r,clickHandler:s,name:"connectConfirmEnabled",subtitle:A(N.SWML_TO_EXECUTE),title:A(N.ENABLE_WHISPER)}),r&&d.jsx("div",{id:l,children:d.jsx(WL,{onChange:o,confirmId:e,confirmName:t,confirmUrl:n,valid:i})})]})},KL={forwardAddress:{add:N.ADD_ADDRESS,call:N.CALL_ADDRESSES,optionNumber:N.ADDRESS_NUMBER,remove:N.REMOVE_ADDRESS,title:N.FORWARD_TO_ADDRESS},forwardPhone:{add:N.ADD_PHONE_NUMBER,call:N.CALL_NUMBERS,optionNumber:N.PHONE_NUMBER_NUMBER,remove:N.REMOVE_PHONE_NUMBER,title:N.FORWARD_TO_PHONE},forwardResource:{add:N.ADD_RESOURCE,call:N.CALL_RESOURCES,optionNumber:N.RESOURCE_NUMBER,remove:N.REMOVE_RESOURCE,title:N.FORWARD_TO_RESOURCE}},Nv={parallel:N.SIMULTANEOUSLY,serial:N.SEQUENTIALLY},XL=()=>({connectConfirmDisplayName:"",connectConfirmEnabled:!1,connectConfirmId:"",connectConfirmUrl:"",connectFrom:"",connectTimeout:"",connectTo:"",id:le()}),zf=({nodeType:e,nodeData:t,handleOnUpdate:n})=>{var S,_,x;const{validateField:r}=at(e),o=O.useRef(),[s,i]=O.useState(["serial","parallel"].includes(t.callOrder)?t.callOrder:"serial"),l=KL[e],[a,c]=O.useState({callOrder:t.initial||r("callOrder",s),callStateEvents:t.initial||r("callStateEvents",s),callStateUrl:t.initial||r("callStateUrl",s),connections:(S=t.connections)==null?void 0:S.map(R=>({connectConfirmId:r("connectConfirmId",R.connectConfirmId),connectConfirmUrl:r("connectConfirmUrl",R.connectConfirmUrl),connectFrom:r("connectFrom",R.connectFrom),connectTimeout:r("connectTimeout",R.connectTimeout),connectTo:r("connectTo",R.connectTo),initial:t.initial})),defaultFrom:t.initial||r("defaultFrom",t.defaultFrom),defaultTimeout:t.initial||r("defaultTimeout",t.defaultTimeout)}),u=R=>{R.preventDefault(),c({...a,connections:[...a.connections,{connectConfirmId:!0,connectConfirmUrl:!0,connectFrom:!0,connectTimeout:!0,connectTo:!0,initial:!0}]}),n({callOrder:s,connections:[...t.connections,XL()]})},f=R=>T=>{T.preventDefault();const L=[...a.connections];L.splice(R,1),c({...a,connections:L});const P=[...t.connections];P.splice(R,1),n({callOrder:P.length===1?"single":s,connections:P})},p=(R,T,L)=>{const P=[...t.connections],I=P[R];if(!I)throw new Error(`Option not found at index ${R}`);const j=T==null?void 0:T.name,V=T==null?void 0:T.value,w={...j?{[j]:V}:{},...L,id:I.id},b=[...a.connections],k=Object.keys(w).reduce((D,U)=>{const $=w[U],B=U;return D[B]=r(U,$),D},{initial:!1}),F=b.map((D,U)=>U===R?{...D,...k}:D);c({...a,connections:F});const C=P.map(D=>D.id===w.id?{...D,...w}:D);n({connections:C,initial:!1})},h=R=>{const T=R.currentTarget.value;i(T),n({callOrder:T})},E=(R,T)=>{p(R,void 0,T)},y=(R,T)=>{E(R,{connectConfirmEnabled:T})},v=R=>T=>E(R,{...T}),m=(R,T)=>{const L=R.target,{name:P,value:I}=L;switch(P){case"callStateEvents":case"callStateUrl":case"defaultTimeout":case"defaultFrom":c({...a,[P]:r(P,I)}),n({initial:!1,[P]:I});break;case"connectFrom":case"connectTimeout":case"connectTo":if(T===void 0)throw new Error(`Option index not provided: ${P}`);p(T,{name:P,value:I});break;default:throw new Error(`Unhandled input name: ${P}`)}},g=({index:R,name:T})=>{const L=a.connections[R];return!!(L!=null&&L[T]||L!=null&&L.initial)};return d.jsxs(Ze,{title:A(l.title),formRef:o,children:[d.jsxs("div",{className:"border-b-4 border-foreground/10 px-3 pb-3",children:[d.jsxs("label",{className:"mb-2 block",children:[A(N.DEFAULT_FROM),d.jsx(pi,{className:"w-full",direction:"from",name:"defaultFrom",onChange:m,placeholder:A(N.FROM),type:"tel",value:t.defaultFrom,valid:a.defaultFrom}),d.jsx("p",{className:"requirements w-full",role:"alert",children:A(N.ERROR_VALUE_IS_REQUIRED)})]}),d.jsxs("label",{className:"mb-2 block",children:[A(N.DEFAULT_TIMEOUT),d.jsxs("div",{className:"flex flex-wrap items-center gap-x-2",children:[d.jsx("input",{className:`w-14 ${a.defaultTimeout?"":"invalid"}`,inputMode:"numeric",min:0,name:"defaultTimeout",onChange:m,placeholder:A(N.SECONDS),type:"number",value:t.defaultTimeout}),d.jsx("p",{className:"requirements w-full",role:"alert",children:A(N.ERROR_NUMBER_IS_REQUIRED)})]})]}),d.jsxs("label",{className:"mb-2 block",children:[A(N.CALL_STATE_URL),d.jsx("input",{className:`w-full ${a.callStateUrl?"":"invalid"}`,name:"callStateUrl",onChange:m,placeholder:"https://example.com/api",type:"url",value:t.callStateUrl}),d.jsx("p",{className:"requirements w-full",role:"alert",children:A(N.ERROR_VALUE_IS_REQUIRED)})]}),d.jsxs("label",{className:"mb-2 block",children:[A(N.CALL_STATE_EVENTS),d.jsx("input",{className:`w-full ${a.callStateEvents?"":"invalid"}`,name:"callStateEvents",onChange:m,placeholder:"Created, ringing, answered, ended",type:"text",value:t.callStateEvents}),d.jsx("p",{className:"requirements w-full",role:"alert",children:A(N.ERROR_VALUE_IS_REQUIRED)})]})]}),d.jsx("ul",{className:"border-foreground-10 divide-y-4 divide-foreground/10 border-b-4 pt-2",children:(_=t.connections)==null?void 0:_.map((R,T,L)=>d.jsx("li",{className:"flex flex-col gap-y-2 px-4",children:d.jsxs("fieldset",{children:[d.jsxs("div",{className:"item-center flex justify-between py-4",children:[d.jsxs("legend",{children:[d.jsx(re,{className:"pr-2 text-foreground/60",size:"xs",tag:"bars"}),d.jsx("span",{className:"text-xs font-semibold",children:A(l.optionNumber,{index:T+1})})]}),L.length>1&&d.jsx(Uo,{handleDelete:f(T),label:A(l.remove,{index:T+1}),size:"sm",show:!0})]}),d.jsxs("label",{className:"mb-1 block pl-2",children:[d.jsx("div",{className:"sr-only",children:A(N.TO)}),d.jsx(pi,{className:"w-full",direction:"to",name:"connectTo",onChange:P=>m(P,T),type:e==="forwardPhone"?"tel":"text",valid:g({index:T,name:"connectTo"}),value:R.connectTo}),d.jsx("p",{className:"requirements",role:"alert",children:A(N.ERROR_VALUE_IS_REQUIRED)})]}),d.jsxs("label",{className:"mb-2 block pl-2",children:[d.jsx("div",{className:"sr-only",children:A(N.FROM)}),d.jsx(pi,{className:"w-full",direction:"from",name:"connectFrom",onChange:P=>m(P,T),placeholder:A(N.FROM),type:"text",valid:g({index:T,name:"connectFrom"}),value:R.connectFrom}),d.jsx("p",{className:"requirements",role:"alert",children:A(N.ERROR_VALUE_IS_REQUIRED)})]}),d.jsxs("label",{className:"mb-2 block pl-2",children:[A(N.TIMEOUT),d.jsxs("div",{className:"flex flex-wrap items-center gap-x-2",children:[d.jsx("input",{className:`${g({index:T,name:"connectTimeout"})?"":"invalid"}`,inputMode:"numeric",min:0,name:"connectTimeout",onChange:P=>m(P,T),placeholder:A(N.SECONDS),type:"number",value:R.connectTimeout}),d.jsx("p",{className:"requirements w-full",role:"alert",children:A(N.ERROR_NUMBER_IS_REQUIRED)})]})]}),d.jsx("div",{className:"mb-2 block pl-2",children:d.jsx(YL,{confirmId:R.connectConfirmId,confirmName:R.connectConfirmDisplayName,confirmUrl:R.connectConfirmUrl,enabled:R.connectConfirmEnabled,handleOnChange:v(T),onCheck:()=>y(T,!R.connectConfirmEnabled),valid:g({index:T,name:"connectConfirmUrl"})&&g({index:T,name:"connectConfirmId"})})})]})},R.id))}),d.jsx("div",{className:"p-3 pb-6 text-right",children:d.jsx("button",{className:"rounded bg-foreground/10 py-1 px-2 font-medium",onClick:u,type:"button",children:A(l.add)})}),((x=t.connections)==null?void 0:x.length)>1&&d.jsx("div",{className:"mb-4 px-3",children:d.jsx(Zt,{className:"w-full",label:A(l.call),name:"callOrder",onChange:h,value:s,children:Object.keys(Nv).map(R=>d.jsx("option",{value:R,children:A(Nv[R])},R))})})]})},QL=()=>({command:"",digit:"",id:le()}),qL=({nodeData:e,handleOnUpdate:t})=>{const{validateField:n}=at("promptPlay"),r=O.useRef(),[o,s]=O.useState({digitTimeout:e.initial||n("digitTimeout",e.digitTimeout),initialTimeout:e.initial||n("initialTimeout",e.initialTimeout),options:e.options.map(h=>({command:n("command",h.command),digit:n("digit",h.digit),initial:e.initial}))}),i=er(e.options,"command"),l=er(e.options,"digit"),a=h=>{h.preventDefault(),s({...o,options:[...o.options,{command:!0,digit:!0,initial:!0}]}),t({options:[...e.options,QL()]})},c=h=>E=>{E.preventDefault();const y=[...o.options];y.splice(h,1),s({...o,options:y});const v=[...e.options];v.splice(h,1),t({options:v})},u=(h,E)=>{const y=[...e.options];if(!y[h])throw new Error(`Option not found at index ${h}`);const{name:v,value:m}=E,g=[...o.options];g[h]={...g[h],initial:!1,[v]:n(v,m)},s({...o,options:g}),y[h]={...y[h],[v]:m},t({options:y})},f=(h,E)=>{const y=h.target,{name:v,value:m}=y;switch(t({initial:!1}),v){case"digit":case"command":E!==void 0&&u(E,{name:v,value:m});break;case"digitTimeout":case"initialTimeout":{s({...o,[v]:n(v,m)}),t({[v]:m});break}default:throw new Error(`Unhandled input field name: ${v}`)}},p=({index:h,name:E})=>{var m;const y=o.options[h];if(y!=null&&y.initial)return!0;if(!(y!=null&&y[E]))return!1;const v=(m=e.options)==null?void 0:m[h];return yt(v==null?void 0:v.digit)||yt(v==null?void 0:v.command)};return d.jsxs(Ze,{formRef:r,title:A(N.GATHER_INPUT),children:[d.jsx("div",{className:"border-b-4 border-foreground/10 px-3 pb-3",children:d.jsx(vv,{handleOnUpdate:t,label:A(N.CHOOSE_OPTION_TTS_AUDIO),nodeData:e})}),d.jsx("ol",{className:"divide-y-4 divide-foreground/10 border-b-4 border-foreground/10",children:e.options.map((h,E,y)=>{const v=i(h.command),m=l(h.digit);return d.jsxs("li",{className:"flex pt-3",children:[d.jsx("div",{className:"w-8 shrink-0 text-center",children:d.jsx(re,{className:"text-foreground/60",size:"xs",tag:"bars"})}),d.jsxs("div",{className:"relative mr-3",children:[y.length>1&&d.jsx(Uo,{className:"absolute right-0 top-0",handleDelete:c(E),label:A(N.REMOVE_OPTION,{index:E+1}),size:"sm",show:!0}),d.jsxs("fieldset",{children:[d.jsx("legend",{className:"sr-only",children:A(N.OPTION_NUMBER,{index:E+1})}),d.jsxs("label",{className:"mb-2 block",children:[A(N.CALLER_PRESSES),d.jsx("input",{className:`${p({index:E,name:"digit"})&&!m?"":"invalid"}`,name:"digit",onChange:g=>f(g,E),placeholder:A(N.KEYPAD_VALUE),type:"text",value:h.digit}),d.jsx("p",{className:"requirements",role:"alert",children:A(m?N.ERROR_DUPLICATE_TELEPHONE_KEY:N.ERROR_TELEPHONE_KEY_REQUIRED)})]}),d.jsxs("label",{className:"mb-2 block",children:[A(N.OR_SAYS),d.jsx("input",{className:`w-full ${p({index:E,name:"command"})&&!v?"":"invalid"}`,name:"command",onChange:g=>f(g,E),placeholder:A(N.SPOKEN_PROMPT),type:"text",value:h.command}),d.jsx("p",{className:"requirements",role:"alert",children:A(v?N.ERROR_DUPLICATE_COMMAND:N.ERROR_TEXT_IS_REQUIRED)})]})]})]})]},h.id)})}),d.jsx("div",{className:"p-3 pb-6 text-right",children:d.jsx("button",{className:"rounded bg-foreground/10 py-1 px-2 font-medium",onClick:a,type:"button",children:A(N.ADD_OPTION)})}),d.jsxs("div",{className:"px-3",children:[d.jsxs("label",{className:"mb-2 block",children:[d.jsx("div",{className:"w-full",children:A(N.WAIT_FOR_INPUT)}),d.jsxs("div",{className:"flex flex-wrap items-center gap-x-2",children:[d.jsx("input",{className:`w-14 ${o.initialTimeout?"":"invalid"}`,inputMode:"numeric",min:Ee.MIN,max:Ee.MAX,name:"initialTimeout",onChange:f,placeholder:A(N.SECONDS),type:"number",value:e.initialTimeout}),d.jsx("p",{className:"requirements w-full",role:"alert",children:A(N.ERROR_NUMBER_MIN_MAX_IS_REQUIRED,{max:Ee.MAX,min:Ee.MIN})})]})]}),d.jsxs("label",{children:[d.jsx("div",{className:"w-full",children:A(N.WAIT_FOR_DIGIT)}),d.jsxs("div",{className:"flex flex-wrap items-center gap-x-2",children:[d.jsx("input",{className:`w-14 ${o.digitTimeout?"":"invalid"}`,inputMode:"numeric",min:Ee.MIN,max:Ee.MAX,name:"digitTimeout",onChange:f,placeholder:A(N.SECONDS),type:"number",value:e.digitTimeout}),d.jsx("p",{className:"requirements w-full",role:"alert",children:A(N.ERROR_NUMBER_MIN_MAX_IS_REQUIRED,{max:Ee.MAX,min:Ee.MIN})})]})]})]})]})},JL=({handleOnUpdate:e,nodeData:t})=>{const{validateField:n}=at("play"),[r,o]=O.useState({reason:t.initial||n("reason",t.reason)}),s=i=>{const l=i.target,{name:a,value:c}=l;switch(a){case"reason":o({...r,[a]:n(a,c)}),e({initial:!1,[a]:c});break;default:throw new Error(`Unhandled input name: ${a}`)}};return d.jsx(Ze,{title:A(N.HANG_UP_CALL),children:d.jsx("div",{className:"mx-3",children:d.jsxs(Zt,{className:"w-full",label:`${A(N.REASON)} (${A(N.OPTIONAL)})`,name:"reason",onChange:s,value:t.reason,children:[d.jsx("option",{value:"",children:A(N.SELECT)}),Object.keys(Ff).map(i=>d.jsx("option",{value:i,children:A(Ff[i])},i))]})})})},ZL=({nodeData:e,handleOnUpdate:t})=>{const n=O.useRef();return d.jsx(Ze,{formRef:n,title:A(N.PLAY_AUDIO_TTS),children:d.jsx("div",{className:"mx-3",children:d.jsx(vv,{handleOnUpdate:t,label:A(N.CHOOSE_OPTION_TTS_AUDIO),nodeData:e,showDefaultOption:!0})})})},eb=({nodeData:e,handleOnUpdate:t})=>{const n=O.useRef(),{validateField:r}=at("recordCallStart"),[o,s]=O.useState({label:e.initial||r("label",e.label)}),[i,l]=O.useState(!1),{upsertEntry:a,isValueDuplicate:c}=If();O.useEffect(()=>{l(c(e.label,e.controlId))},[c,e.controlId,e.label]);const u=f=>{const p=f.target,{name:h,value:E}=p;s({...o,[h]:r(h,E)}),t({initial:!1,[h]:E}),a({controlId:e.controlId,label:E})};return d.jsxs(Ze,{title:A(N.RECORD_CALL_START),formRef:n,children:[d.jsx("div",{className:"px-3 pb-3",children:d.jsxs("label",{children:[A(N.RECORDING_NAME),d.jsx("input",{className:`w-full ${o.label&&!i?"":"invalid"}`,name:"label",onChange:u,type:"text",value:e.label}),d.jsx("p",{className:"requirements",role:"alert",children:A(i?N.ERROR_DUPLICATE_RECORDING_LABEL:N.ERROR_RECORDING_LABEL_REQUIRED)})]})}),d.jsx("div",{className:"px-3",children:d.jsx(_v,{handleOnUpdate:t,nodeData:e,type:"call"})})]})},tb=({nodeData:e,handleOnUpdate:t})=>{const{validateField:n}=at("recordCallStop"),[r,o]=O.useState({controlId:e.initial||n("controlId",e.controlId)}),{getEntries:s}=If(),i=s().sort((a,c)=>a.label.toLowerCase().localeCompare(c.label.toLowerCase())),l=a=>{const c=a.target,{name:u,value:f}=c;o({...r,[u]:n(u,f)}),t({initial:!1,[u]:f})};return d.jsx(Ze,{title:A(N.RECORD_CALL_STOP),children:d.jsx("div",{className:"px-3",children:i.length?d.jsxs(Zt,{className:`w-full ${r.controlId?"":"invalid"}`,label:A(N.RECORDING_NAME),name:"controlId",value:e.controlId,onChange:l,children:[d.jsx("option",{value:"",children:A(N.SELECT)}),i.map(a=>d.jsx("option",{value:a.controlId,children:a.label},a.controlId))]}):d.jsx("p",{role:"alert",className:"text-negative",children:A(N.ERROR_ADD_RECORDING_FIRST)})})})},nb=({nodeData:e,handleOnUpdate:t})=>d.jsx(Ze,{title:A(N.VOICEMAIL_RECORDING),children:d.jsx("div",{className:"mx-3",children:d.jsx(_v,{handleOnUpdate:t,nodeData:e,type:"voicemail"})})}),rb=["GET","POST","PUT","DELETE"],ob=({nodeData:e,handleOnUpdate:t})=>{const{validateField:n}=at("request"),[r,o]=O.useState({body:e.initial||n("body",e.body),headers:e.initial||n("headers",e.headers),method:e.initial||n("method",e.method),saveVariables:e.initial||n("saveVariables",e.saveVariables),url:e.initial||n("url",e.url)}),s=a=>{const c=a.target,{name:u,value:f}=c;switch(t({initial:!1}),u){case"url":case"method":o({...r,[u]:n(u,f)}),t({[u]:f});break;case"headers":o({...r,[u]:n(u,f)}),t({[u]:f});break;case"body":o({...r,[u]:n(u,f)}),t({[u]:f});break;default:throw new Error(`Unhandled input name: ${u}`)}},i=a=>{const{name:c,value:u}=a.target;t({[c]:u})},l=a=>{const{name:c}=a.target,u=!e[c];t({[c]:u})};return d.jsx(Ze,{title:A(N.REQUEST),children:d.jsxs("div",{className:"px-3",children:[d.jsxs("label",{className:"mb-2 block",children:[A(N.URL),d.jsx("input",{className:`w-full ${r.url?"":"invalid"}`,name:"url",onChange:s,placeholder:"https://u:p@example.com/api/status",type:"text",value:e.url}),d.jsx("p",{className:"requirements w-full",role:"alert",children:A(N.ERROR_VALUE_IS_REQUIRED)})]}),d.jsx("div",{className:"mb-1",children:d.jsx(Zt,{className:"w-full",label:A(N.METHOD),name:"method",onChange:i,value:e.method,children:rb.map(a=>d.jsx("option",{value:a,children:a},a))})}),d.jsx("div",{className:"mb-4",children:d.jsx(Ta,{checked:e.saveVariables,clickHandler:l,name:"saveVariables",subtitle:A(N.SAVE_VARIABLES_SUBTITLE),title:A(N.SAVE_VARIABLES)})}),d.jsx("label",{className:"mb-2 block",children:d.jsx(yn,{errorText:A(N.ERROR_INVALID_JSON),inputMode:"text",label:A(N.REQUEST_HEADERS),name:"headers",onChange:s,placeholder:'{"Content-Type": "application/json", "X-Custom-Header": "foo"}',valid:r.headers,value:e.headers})}),d.jsx("label",{children:d.jsx(yn,{errorText:A(N.ERROR_INVALID_JSON),inputMode:"text",label:A(N.REQUEST_BODY),name:"body",onChange:s,placeholder:A(N.STRING_OR_JSON),valid:r.body,value:e.body??""})})]})})},sb=({nodeData:e,handleOnUpdate:t})=>{const{validateField:n}=at("sendSms"),[r,o]=O.useState({body:e.initial||n("body",e.body),fromNumber:e.initial||n("fromNumber",e.fromNumber),toNumber:e.initial||n("toNumber",e.toNumber)}),s=i=>{const l=i.target,{name:a,value:c}=l;switch(a){case"body":case"fromNumber":case"toNumber":o({...r,[a]:n(a,c)}),t({initial:!1,[a]:c});break;default:throw new Error(`Unhandled input name: ${a}`)}};return d.jsx(Ze,{title:A(N.SEND_SMS),children:d.jsxs("div",{className:"mx-3",children:[d.jsxs("label",{className:"mb-2 block",children:[A(N.TO_PHONE_NUMBER),d.jsx(pi,{className:"w-full",direction:"to",name:"toNumber",onChange:s,placeholder:"+12405550000",type:"tel",valid:r.toNumber,value:e.toNumber}),d.jsx("p",{className:"requirements w-full",role:"alert",children:A(N.ERROR_VALUE_IS_REQUIRED)})]}),d.jsxs("label",{className:"mb-2 block",children:[A(N.FROM_PHONE_NUMBER),d.jsx(pi,{className:"w-full",direction:"from",name:"fromNumber",onChange:s,placeholder:"+12405550000",type:"tel",valid:r.fromNumber,value:e.fromNumber}),d.jsx("p",{className:"requirements w-full",role:"alert",children:A(N.ERROR_VALUE_IS_REQUIRED)})]}),d.jsx("label",{children:d.jsx(yn,{errorText:A(N.ERROR_VALUE_IS_REQUIRED),inputMode:"text",label:A(N.SMS_TEXT),name:"body",onChange:s,placeholder:A(N.WRITE_SOMETHING),valid:r.body,value:e.body})})]})})},ib=()=>({id:le(),key:"",value:""}),lb=({nodeData:e,handleOnUpdate:t})=>{var f;const{validateField:n}=at("set"),[r,o]=O.useState({variables:e.variables.map(p=>({key:e.initial||n("key",p.key),value:e.initial||n("value",p.value)}))}),s=er(e.variables,"key"),i=p=>{p==null||p.preventDefault(),o({...r,variables:[...r.variables,{key:!0,value:!0}]}),t({variables:[...e.variables,ib()]})},l=(p,h)=>{const E=[...e.variables];let y=E[p];if(!y)throw new Error(`Variable not found at index ${p}`);const{name:v,value:m}=h,g=[...r.variables];g[p]={...g[p],[v]:n(v,m)},o({...r,variables:g}),y={...E[p],[v]:m},E[p]=y,t({initial:!1,variables:E})},a=p=>h=>{h.preventDefault();const E=[...r.variables];E.splice(p,1),o({...r,variables:E});const y=[...e.variables];y.splice(p,1),t({variables:y})},c=(p,h)=>{const E=p.target,{name:y,value:v}=E;switch(y){case"key":case"value":h!==void 0&&l(h,{name:y,value:v});break;default:throw new Error(`Unhandled input name: ${y}`)}},u=({index:p,name:h})=>{const E=r.variables[p];return E==null?void 0:E[h]};return d.jsxs(Ze,{title:A(N.SET_VARIABLES),children:[d.jsx("ol",{className:"divide-y-4 divide-foreground/10 border-b-4 border-foreground/10",children:(f=e.variables)==null?void 0:f.map((p,h,E)=>{const y=s(p.key);return d.jsxs("li",{className:"flex pt-3",children:[d.jsx("div",{className:"w-8 shrink-0 text-center",children:d.jsx(re,{className:"text-foreground/60",size:"xs",tag:"bars"})}),d.jsxs("div",{className:"relative mr-3",children:[E.length>1&&d.jsx(Uo,{className:"absolute right-0 top-0",handleDelete:a(h),label:A(N.REMOVE_VARIABLE,{index:h+1}),size:"sm",show:!0}),d.jsxs("fieldset",{children:[d.jsx("legend",{className:"sr-only",children:A(N.VARIABLE_NUMBER,{index:h+1})}),d.jsxs("label",{className:"mb-2 block",children:[A(N.KEY),d.jsx("input",{className:`w-full ${u({index:h,name:"key"})&&!y?"":"invalid"}`,name:"key",onChange:v=>c(v,h),type:"text",value:p.key}),d.jsx("p",{className:"requirements",role:"alert",children:A(y?N.ERROR_DUPLICATE_VARIABLE_KEY:N.ERROR_VARIABLE_KEY_REQUIRED)})]}),d.jsxs("label",{className:"mb-2 block",children:[A(N.VALUE),d.jsx("input",{className:`w-full ${u({index:h,name:"value"})?"":"invalid"}`,name:"value",onChange:v=>c(v,h),type:"text",value:p.value}),d.jsx("p",{className:"requirements",role:"alert",children:A(N.ERROR_TEXT_IS_REQUIRED)})]})]})]})]},p.id)})}),d.jsx("div",{className:"p-3 text-right",children:d.jsx("button",{className:"rounded bg-foreground/10 py-1 px-2 font-medium",onClick:i,type:"button",children:A(N.ADD_VARIABLE)})})]})},ab=e=>({id:le(),key:e}),cb=({nodeData:e,handleOnUpdate:t})=>{const s={currentFocus:void 0,listOpen:!1,setVariablesList:Q(v=>v.nodes).reduce((v,m)=>{if(m.type==="set"){const g=m.data.variables.map(S=>({id:S.id,key:S.key}));return[...v,...g]}else if(m.type==="unset")return[...v,...m.data.variables];return v},[]).reduce((v,m)=>(v.find(g=>g.key===m.key)||v.push(m),v),[]).map(v=>({...v,selected:!!e.variables.find(m=>m.key===v.key)})).sort((v,m)=>v.key.toLowerCase().localeCompare(m.key.toLowerCase()))},[i,l]=$f(s),a=v=>i.setVariablesList.map(m=>m.id===v?{...m,selected:!m.selected}:m),c=v=>{const m=i.setVariablesList.find(g=>g.id===v);if(!m)throw new Error("Variable not found");if(m.selected)u(m.id);else{const g=[...e.variables,ab(m.key)];l({setVariablesList:a(m.id)}),t({variables:g})}},u=v=>{const m=i.setVariablesList.filter(g=>g.selected&&g.id!==v);l({setVariablesList:a(v)}),t({variables:m})},f=O.useRef(null);Rv(f,()=>l({listOpen:!1}));const p=v=>{(v.key==="Escape"||v.key==="Esc")&&l({listOpen:!1})},h=(v,m)=>{v.preventDefault(),(v.key===" "||v.code==="Space"||v.key==="Enter")&&c(m),p(v)},E=()=>{l({listOpen:!i.listOpen})},y=e.variables.length;return d.jsx(Ze,{title:A(N.UNSET_VARIABLES),children:d.jsxs("div",{className:"px-3",children:[d.jsxs("div",{className:"mb-2 flex flex-col",children:[d.jsx("label",{id:"listbox-label",className:"sr-only",children:A(N.SELECT_VARIABLES_TO_UNSET)}),d.jsxs("div",{className:"relative",ref:f,children:[d.jsx("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
64
+ after:absolute after:top-[.725rem] after:right-3 after:h-0 after:w-0 after:border-[5px] after:border-t-[6px] after:border-b-0 after:border-r-transparent after:border-l-transparent after:border-t-foreground after:content-['']`,onClick:E,onKeyDown:p,type:"button",children:y>0?A(N.NUMBER_OF_VARIABLES_SELECTED,{count:y}):A(N.SELECT_VARIABLES)}),i.listOpen&&d.jsxs("ul",{"aria-activedescendant":i.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:[!i.setVariablesList.length&&d.jsx("li",{"aria-disabled":"true",className:"relative",role:"option",children:d.jsx("label",{className:"flex select-none items-center py-2 pl-3 pr-9",children:A(N.NO_VARIABLES_SET)})}),i.setVariablesList.map(v=>{if(v.key)return d.jsx("li",{"aria-selected":v.selected,className:"relative",id:v.id,role:"option",children:d.jsxs("label",{className:"flex select-none items-center py-2 pl-3 pr-9",children:[d.jsx("input",{checked:v.selected,className:"mr-2 h-4 w-4 rounded accent-primary",onChange:()=>c(v.id),onKeyDown:m=>h(m,v.id),type:"checkbox"}),v.key]})},v.id)})]})]})]}),y>0&&d.jsxs("section",{className:"pt-3",children:[d.jsx("h3",{className:"mb-2 text-xs font-medium text-foreground",children:A(N.UNSET_VARIABLES)}),d.jsx("ul",{className:"flex flex-wrap gap-2",children:i.setVariablesList.map(v=>v.selected&&d.jsx(lC,{handleClick:()=>u(v.id),children:v.key},v.id))})]})]})})},wv={aiAgent:({data:e,formUpdate:t})=>d.jsx(UL,{handleOnUpdate:t,nodeData:e}),cond:({data:e,formUpdate:t})=>d.jsx(VL,{handleOnUpdate:t,nodeData:e}),condRequest:({data:e,formUpdate:t})=>d.jsx(jL,{handleOnUpdate:t,nodeData:e}),executeSWML:({data:e,formUpdate:t})=>d.jsx($L,{handleOnUpdate:t,nodeData:e}),forwardAddress:({data:e,formUpdate:t})=>d.jsx(zf,{handleOnUpdate:t,nodeData:e,nodeType:"forwardAddress"}),forwardPhone:({data:e,formUpdate:t})=>d.jsx(zf,{handleOnUpdate:t,nodeData:e,nodeType:"forwardPhone"}),forwardResource:({data:e,formUpdate:t})=>d.jsx(zf,{handleOnUpdate:t,nodeData:e,nodeType:"forwardResource"}),hangup:({data:e,formUpdate:t})=>d.jsx(JL,{handleOnUpdate:t,nodeData:e}),play:({data:e,formUpdate:t})=>d.jsx(ZL,{handleOnUpdate:t,nodeData:e}),promptPlay:({data:e,formUpdate:t})=>d.jsx(qL,{handleOnUpdate:t,nodeData:e}),record:({data:e,formUpdate:t})=>d.jsx(nb,{handleOnUpdate:t,nodeData:e}),recordCallStart:({data:e,formUpdate:t})=>d.jsx(eb,{handleOnUpdate:t,nodeData:e}),recordCallStop:({data:e,formUpdate:t})=>d.jsx(tb,{handleOnUpdate:t,nodeData:e}),request:({data:e,formUpdate:t})=>d.jsx(ob,{handleOnUpdate:t,nodeData:e}),sendSms:({data:e,formUpdate:t})=>d.jsx(sb,{handleOnUpdate:t,nodeData:e}),set:({data:e,formUpdate:t})=>d.jsx(lb,{handleOnUpdate:t,nodeData:e}),unset:({data:e,formUpdate:t})=>d.jsx(cb,{handleOnUpdate:t,nodeData:e})},ub=(e,t)=>{if("options"in t)switch(e.type){case"promptPlay":case"cond":case"condRequest":return!0}return!1},db=e=>{if(e in wv)return wv[e]},fb=()=>{var c;const{partialUpdateNodeData:e,removeNode:t}=Te(),n=Q(u=>u.selectedNode),r=n==null?void 0:n.id,s=(c=Q(u=>u.nodes).find(u=>u.id===r))==null?void 0:c.data,{updateDynamicHandles:i}=TL(n);if(!(n&&s&&r))return null;const l=u=>{ub(n,u)&&i(u),e(r,u)},a=db(n.type);return a?d.jsxs(Zs,{className:"nokey m-0 flex h-full w-[260px] flex-col overflow-hidden rounded-none border border-foreground/10 bg-background pt-4",position:"top-right",children:[d.jsx(a,{data:s,formUpdate:l},r),n.deletable!==!1&&d.jsx("div",{className:"border-t border-foreground/10 p-3",children:d.jsx(Uo,{handleDelete:()=>t(r),label:A(N.DELETE_NODE),show:!0,showLabel:!0})})]}):null},Ov=O.forwardRef(function({animate:t=!0,children:n,className:r="",iconTag:o="circle-info",message:s,role:i="alertdialog",status:l},a){const u=l?{error:"bg-negative text-background",success:"bg-positive text-background"}[l]:"";return d.jsxs("div",{className:`flex items-center justify-between rounded-lg bg-foreground p-2
69
65
  text-background shadow-lg transition-[box-shadow] hover:shadow-none
70
- ${d} ${t?"animate-from-bottom":""} ${r}`,ref:l,role:s,children:[u.jsxs("div",{className:"flex items-center justify-center gap-x-2",children:[u.jsx(te,{className:"flex-shrink-0 self-start",tag:o}),u.jsx("p",{className:"text-xs font-semibold",children:i})]}),n]})}),XL=()=>{const{addToast:e,restoreDeployedFlow:t,cancelDetachedMode:n}=xe();if(!Y(s=>s.showDeployedHistoryToast))return null;const o=()=>{t(),e({message:T(N.VERSION_RESTORED),status:"success"})},i=()=>{n()};return u.jsx(J0,{animate:!1,className:"gap-x-14",message:T(N.PREVIEW_DEPLOYED_VERSION),role:"dialog",children:u.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-x-2 gap-y-1",children:[u.jsx("button",{className:"rounded bg-primary px-1.5 py-0.5 text-xs font-medium text-background transition-colors hover:bg-primary/90",onClick:o,children:T(N.RESTORE_THIS_VERSION)}),u.jsx("button",{className:"rounded bg-secondary/50 px-1.5 py-0.5 text-xs font-medium text-background transition-colors hover:bg-secondary/40",onClick:i,children:T(N.CANCEL)})]})})},Z0=({onKeyPress:e})=>{const t=Do(["Escape","Esc"]);return w.useEffect(()=>{t&&typeof e=="function"&&e()},[t,e]),{isPressed:t}},qL={offset:[0,.5,1],opacity:[1,0,0],pointerEvents:["none","none","auto"],transform:["scale(1.1) translateY(0%)","scale(0.5) translateY(-100%)"]},JL={duration:zA*2,easing:"ease-in-out",fill:"forwards"},ZL=({durationMs:e,id:t,permanent:n})=>{const r=e??WA,[o,i]=w.useState(null),{deleteToast:s}=xe(),a=w.useCallback(()=>{let l;const c=()=>s(t);return o instanceof HTMLElement?(l=o.animate(qL,JL),l.addEventListener("finish",c,{once:!0})):c(),()=>l==null?void 0:l.removeEventListener("finish",c)},[t,s,o]);return Z0({onKeyPress:a}),w.useEffect(()=>{if(n)return;let l,c;const d=()=>{clearTimeout(l)},f=()=>{d(),l=setTimeout(()=>{c=a()},r)};return f(),o instanceof HTMLElement&&(o.addEventListener("mouseenter",d),o.addEventListener("mouseleave",f)),()=>{d(),o instanceof HTMLElement&&(o.removeEventListener("mouseenter",d),o.removeEventListener("mouseleave",f),c==null||c())}},[a,r,n,o]),{deleteToastCallback:a,setToastRef:i,toastRef:o}},e_=({durationMs:e,id:t,message:n,permanent:r,status:o})=>{const{deleteToastCallback:i,setToastRef:s}=ZL({durationMs:e,id:t,permanent:r});return u.jsx(J0,{className:"w-full max-w-sm",iconTag:o==="success"?"circle-check":"circle-exclamation",message:n,ref:s,status:o,children:u.jsxs("button",{className:"flex-shrink-0 self-start opacity-40 transition-opacity hover:opacity-70",onClick:i,children:[u.jsx(te,{tag:"circle-xmark",size:"xl"}),u.jsx("span",{className:"sr-only",children:T(N.CLOSE)})]})})},eD={error:e_,success:e_},tD=()=>{const e=Y(n=>n.toastsMap);if(e.size===0)return null;const t=Array.from(e.values());return u.jsx("div",{className:"flex w-full flex-col items-center gap-y-1",children:t.map(n=>{const r=eD[n.status];return u.jsx(r,{durationMs:n.durationMs,id:n.id,message:n.message,permanent:n.permanent,status:n.status},n.id)})})},nD=({asRole:e="alert",open:t=!1,type:n="overlay"})=>{const[r,o]=Wr.useState(t);w.useEffect(()=>{o(t)},[t]);const i=w.useCallback(()=>o(!1),[]),s=w.useCallback(()=>o(!0),[]);return{asRole:e,closeContainer:i,isOpen:r,openContainer:s,type:n}},t_=w.createContext(null),Wf=()=>{const e=w.useContext(t_);if(e==null)throw new Error("Toast components must be wrapped in <ToastContainer />");return e},rD=({children:e,...t})=>{const n=nD(t);return u.jsx(t_.Provider,{value:n,children:e})},n_=({iconAs:e,title:t,children:n})=>{const{asRole:r}=Wf();return u.jsxs("div",{className:"max-w-xl rounded-lg bg-foreground p-4 text-background shadow-2xl transition-[transform,box-shadow] duration-500 will-change-transform hover:shadow-none",role:r,children:[u.jsxs("h2",{className:"text-lg font-semibold leading-6 tracking-wide",children:[u.jsx("span",{className:"mr-2",children:u.jsx(te,{tag:e??"circle-exclamation"})}),t]}),u.jsx("div",{className:"mt-2 text-sm leading-5",children:n})]})},oD=({children:e})=>{const{closeContainer:t,isOpen:n,type:r}=Wf(),{getRootElement:o}=xe(),i=o(),s=w.useRef(null);return w.useEffect(()=>{if(!s.current)return;let a,l;const c=d=>{var f,p;if(d.key==="Escape"&&t(),d.key==="Tab"){const h=(p=(f=document.activeElement)==null?void 0:f.shadowRoot)==null?void 0:p.activeElement;d.shiftKey?h===a&&(l==null||l.focus(),d.preventDefault()):h===l&&(a==null||a.focus(),d.preventDefault())}};if(r==="overlay"){const d=s.current.querySelectorAll("button");a=d[0],l=d[d.length-1],l==null||l.focus(),document.addEventListener("keydown",c)}return()=>{document.removeEventListener("keydown",c)}},[t,r]),n?xo.createPortal(u.jsx("section",{className:`flex justify-center ${r==="overlay"?"fixed top-0 z-50 h-full w-full items-start px-6 py-36 backdrop-blur-sm backdrop-grayscale":"absolute top-10 left-1/2 z-10 -translate-x-1/2 translate-y-1/2 items-center"}`,ref:r==="overlay"?s:void 0,children:e}),i):null},r_=({asRole:e,open:t,children:n,type:r})=>u.jsx(rD,{asRole:e,open:t,type:r,children:u.jsx(oD,{children:n})}),iD=()=>{const t=Y(n=>n.httpError)===Wv;return t?u.jsx(r_,{asRole:"dialog",open:t,type:"overlay",children:u.jsx(n_,{title:T(N.DOCUMENT_OUT_OF_SYNC),children:u.jsx(sD,{})})}):null},sD=()=>{const{closeContainer:e}=Wf(),t=()=>{window.location.reload()};return u.jsxs(u.Fragment,{children:[$l(N.TOAST_DOCUMENT_OUT_OF_SYNC),u.jsxs("div",{className:"mt-11 flex items-center justify-center gap-x-6",children:[u.jsx("button",{className:"rounded-md border border-background bg-foreground px-3.5 py-2.5 font-bold tracking-widest text-background",onClick:e,children:T(N.IGNORE)}),u.jsx("button",{className:"rounded-md border border-background bg-positive/70 px-3.5 py-2.5 font-bold tracking-widest text-background",onClick:t,children:T(N.RESYNC)})]})]})},aD=Ie(),lD=()=>{const e=Y(t=>t.showDeployWarning);return u.jsx(r_,{asRole:"dialog",open:e,type:"overlay",children:u.jsx(n_,{title:T(N.DEPLOY_WARNING),children:u.jsx(cD,{})})})},cD=()=>{const{deployFlow:e,setShowDeployWarning:t,setShowValidationWarnings:n}=xe(),r=()=>{t(!1),n(!0)},o=()=>{t(!1)},i=()=>{e().catch(s=>{aD.error(s)}),o()};return u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"mb-4",children:$l(N.TOAST_DEPLOY_WARNING)}),u.jsx(Fy,{onClickListItem:r}),u.jsxs("div",{className:"mt-11 flex items-center justify-center gap-x-6",children:[u.jsx("button",{className:"rounded-md border border-background bg-foreground px-3.5 py-2.5 font-bold tracking-widest text-background",onClick:o,children:T(N.CANCEL)}),u.jsx("button",{className:"rounded-md border border-background bg-positive/70 px-3.5 py-2.5 font-bold tracking-widest text-background",onClick:i,children:T(N.DEPLOY)})]})]})},uD="react-flow__controls-button",dD="min-w-[3.625rem] cursor-auto select-auto text-center hover:bg-background active:bg-background",fD="hidden sm:flex",pD=w.forwardRef(function({asTag:t="div",children:n,className:r="",hiddenSmallScreen:o=!1,...i},s){const a=t,c=`${uD} ${a==="button"?"":dD} ${o?fD:""} ${r}`;return u.jsx(a,{className:c,ref:s,...i,children:n})}),hD=()=>{const e=Y(s=>s.showValidationWarnings),t=Y(s=>s.validationWarnings),n=Y(s=>s.detachedMode),{setShowValidationWarnings:r}=xe(),o=()=>r(!e),i=()=>{e&&r(!1)};return!t.size||n?(i(),null):u.jsx(sr,{onOpenChange:r,open:e,outsidePress:!1,placement:"bottom-start",role:"dialog",trigger:u.jsxs(pD,{className:"text-xs",asTag:"button",onClick:o,hiddenSmallScreen:!0,children:[T(N.WARNING),u.jsxs("div",{className:"flex items-center justify-center pl-1",children:[u.jsx("span",{className:"sr-only",children:T(N.MORE_INFO_STATUS_ERROR)}),u.jsx(te,{className:"text-warning",tag:"circle-exclamation"})]})]}),children:u.jsx(Fy,{children:u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("h2",{className:"text-xs font-semibold",children:[u.jsx(te,{className:"mr-1",tag:"circle-exclamation"}),T(N.CAUTION)]}),u.jsxs("button",{className:"my-0.5 rounded-md py-0.5 px-1.5",onClick:i,children:[u.jsx("span",{className:"sr-only",children:T(N.CLOSE)}),u.jsx(te,{tag:"xmark",size:"lg"})]})]})})})},gD=()=>{const e=Y(r=>r.isDraggingNode),t=Y(r=>r.showInteractiveControl),n=r=>{Y.setState({isInteractiveControlOn:r})};return u.jsx(TA,{className:`mt-2.5 rounded-[0.25rem] ${e?"group/control-buttons":""}`,position:"top-left",onInteractiveChange:n,showInteractive:t,children:u.jsx(hD,{})})},mD=".react-flow__panel",ED=16,o_={cursor:"no-drop",transform:"translate(0px, 0px) scale(1)",visibility:"hidden"},i_=e=>{const t=e.getBoundingClientRect();return{isCursorIntersecting:({clientX:n,clientY:r})=>t.top<=r&&t.bottom>=r&&t.left<=n&&t.right>=n}},vD=e=>{const t=e.querySelectorAll(mD);return Array.from(t).map(n=>i_(n).isCursorIntersecting)},yD=e=>({resetDragNodeStyles:()=>{Object.entries(o_).forEach(([t,n])=>{e.style[t]=n})},updateDragNodeStyles:({isOverDropTarget:t,scale:n,xPos:r,yPos:o})=>{e.style.visibility="visible",e.style.cursor=t?"grabbing":"no-drop",e.style.transform=`translate(${r}px, ${o}px) scale(${n})`}}),_D=({handleMouseMove:e,handleMouseUp:t,root:n})=>(n.addEventListener("mousemove",e),n.addEventListener("mouseup",t),{removeListeners:()=>{n.removeEventListener("mousemove",e),n.removeEventListener("mouseup",t)}}),SD=()=>{const e=w.useRef(null),t=Y(p=>p.dragNodeType),n=Y(p=>p.flowWrapperElement),r=Y(p=>p.viewport.zoom),{addNode:o,getRootElement:i,setDragNodeType:s}=xe(),a=i();if(w.useEffect(()=>{if(e.current&&t&&n&&a){let p=!1;const h=ED*r,E=e.current,v=i_(n).isCursorIntersecting,y=vD(n),{resetDragNodeStyles:g,updateDragNodeStyles:m}=yD(E),{removeListeners:_}=_D({handleMouseMove:S=>{const{clientX:x,clientY:R}=S,I=x-h,L=R-h;p=v({clientX:x,clientY:R})&&!y.some(U=>U({clientX:x,clientY:R})),m({isOverDropTarget:p,scale:p?r:1,xPos:I,yPos:L})},handleMouseUp:S=>{if(p){const x=n.getBoundingClientRect();o({nodeType:t,x:S.clientX-x.left-h,y:S.clientY-x.top-h})}s(void 0)},root:a});return()=>{_(),g()}}},[o,t,n,a,s,r]),!t)return null;const l=B0[t],c=Jv[t](),d=ie(),f={...c,initial:!1,valid:!0};return u.jsx(T0,{root:a,children:u.jsx("section",{className:"react-flow__node fixed left-0 top-0",ref:e,style:o_,children:u.jsx(l,{data:f,dragging:!0,id:d,isConnectable:!0,selected:!0,type:t,xPos:0,yPos:0,zIndex:0})})})};function s_(e,t){let n;try{n=e()}catch{return}return{getItem:o=>{var i;const s=l=>l===null?null:JSON.parse(l,t==null?void 0:t.reviver),a=(i=n.getItem(o))!=null?i:null;return a instanceof Promise?a.then(s):s(a)},setItem:(o,i)=>n.setItem(o,JSON.stringify(i,t==null?void 0:t.replacer)),removeItem:o=>n.removeItem(o)}}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)}}}},xD=(e,t)=>(n,r,o)=>{let i={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:y=>y,version:0,merge:(y,g)=>({...g,...y}),...t},s=!1;const a=new Set,l=new Set;let c;try{c=i.getStorage()}catch{}if(!c)return e((...y)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...y)},r,o);const d=Ts(i.serialize),f=()=>{const y=i.partialize({...r()});let g;const m=d({state:y,version:i.version}).then(_=>c.setItem(i.name,_)).catch(_=>{g=_});if(g)throw g;return m},p=o.setState;o.setState=(y,g)=>{p(y,g),f()};const h=e((...y)=>{n(...y),f()},r,o);let E;const v=()=>{var y;if(!c)return;s=!1,a.forEach(m=>m(r()));const g=((y=i.onRehydrateStorage)==null?void 0:y.call(i,r()))||void 0;return Ts(c.getItem.bind(c))(i.name).then(m=>{if(m)return i.deserialize(m)}).then(m=>{if(m)if(typeof m.version=="number"&&m.version!==i.version){if(i.migrate)return i.migrate(m.state,m.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return m.state}).then(m=>{var _;return E=i.merge(m,(_=r())!=null?_:h),n(E,!0),f()}).then(()=>{g==null||g(E,void 0),s=!0,l.forEach(m=>m(E))}).catch(m=>{g==null||g(void 0,m)})};return o.persist={setOptions:y=>{i={...i,...y},y.getStorage&&(c=y.getStorage())},clearStorage:()=>{c==null||c.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>v(),hasHydrated:()=>s,onHydrate:y=>(a.add(y),()=>{a.delete(y)}),onFinishHydration:y=>(l.add(y),()=>{l.delete(y)})},v(),E||h},RD=(e,t)=>(n,r,o)=>{let i={storage:s_(()=>localStorage),partialize:v=>v,version:0,merge:(v,y)=>({...y,...v}),...t},s=!1;const a=new Set,l=new Set;let c=i.storage;if(!c)return e((...v)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...v)},r,o);const d=()=>{const v=i.partialize({...r()});return c.setItem(i.name,{state:v,version:i.version})},f=o.setState;o.setState=(v,y)=>{f(v,y),d()};const p=e((...v)=>{n(...v),d()},r,o);let h;const E=()=>{var v,y;if(!c)return;s=!1,a.forEach(m=>{var _;return m((_=r())!=null?_:p)});const g=((y=i.onRehydrateStorage)==null?void 0:y.call(i,(v=r())!=null?v:p))||void 0;return Ts(c.getItem.bind(c))(i.name).then(m=>{if(m)if(typeof m.version=="number"&&m.version!==i.version){if(i.migrate)return i.migrate(m.state,m.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return m.state}).then(m=>{var _;return h=i.merge(m,(_=r())!=null?_:p),n(h,!0),d()}).then(()=>{g==null||g(h,void 0),h=r(),s=!0,l.forEach(m=>m(h))}).catch(m=>{g==null||g(void 0,m)})};return o.persist={setOptions:v=>{i={...i,...v},v.storage&&(c=v.storage)},clearStorage:()=>{c==null||c.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>E(),hasHydrated:()=>s,onHydrate:v=>(a.add(v),()=>{a.delete(v)}),onFinishHydration:v=>(l.add(v),()=>{l.delete(v)})},i.skipHydration||E(),h||p},ND=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?xD(e,t):RD(e,t),a_=window,l_={showAllNodes:!1,showDevOptions:!1},kr=us()(ND((e,t)=>({...l_,actions:{getFlagNames:()=>{const n=t();return Object.keys(n).filter(r=>r!=="actions")},toggleFlag:n=>e(r=>({...r,[n]:!r[n]}))}}),{name:"flags",partialize:e=>Object.fromEntries(Object.entries(e).filter(([t])=>t!=="actions")),storage:s_(()=>localStorage),version:0})),c_=()=>kr.getState().actions;kr.subscribe(e=>{console.log("feature flags changed",e)});const wD=e=>{const t=(r,o)=>{kr.setState(i=>({...i,[r]:o}))},n=r=>{const o=kr.getState(),i={...r};return Object.entries(o).forEach(([s,a])=>{s in i&&typeof a=="boolean"&&(i[s]=a)}),i};if(a_){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)}});a_.swFlags=r}},OD=()=>wD(l_),Wl={currentColor:{negative:"fill-current",primary:"fill-current"},light:{negative:"fill-negative",primary:"fill-primary"}},TD={"2xl":"w-[2em] h-[2em]","2xs":"w-[0.75em] h-[0.75em]",lg:"w-[1.25em] h-[1.25em]",md:"w-[1em] h-[1em]",sm:"w-[0.875em] h-[0.875em]",xl:"w-[1.5em] h-[1.5em]",xs:"w-[0.75em] h-[0.75em]"},AD=w.forwardRef(function({className:t="",size:n="md",type:r="light"},o){const i=TD[n];return u.jsxs("svg",{"aria-hidden":"true",className:`${i} ${t}`,focusable:"false",fill:"none",ref:o,role:"img",viewBox:"0 0 64 73",xmlns:"http://www.w3.org/2000/svg",children:[u.jsx("path",{d:"M63.9998 46.5209C63.9998 48.596 63.4369 49.9545 62.3171 51.0736C55.6065 57.7826 48.8931 64.4815 42.177 71.1703C39.841 73.495 36.4374 73.6097 34.1234 71.4843C31.6868 69.2442 31.5903 65.569 33.9726 63.1356C36.9983 60.0482 40.0681 57.003 43.132 53.9537C46.8137 50.2907 50.5034 46.6369 54.2012 42.9926C55.9925 41.2315 58.3929 40.7666 60.5902 41.7669C62.7876 42.7672 63.9315 44.5686 63.9998 46.5209Z",className:Wl[r].primary}),u.jsx("path",{d:"M0.000812669 25.3858C0.0329789 24.3372 0.589857 23.0088 1.68351 21.9159C8.37007 15.2378 15.058 8.56035 21.7472 1.88357C23.1384 0.492799 24.7789 -0.219695 26.739 0.0600696C29.061 0.402228 30.6834 1.69438 31.4393 3.92847C32.1952 6.16256 31.6725 8.18129 30.032 9.85183C26.8355 13.1003 23.5988 16.3166 20.3822 19.5329C16.868 23.0309 13.3444 26.5196 9.81152 29.9989C8.01423 31.762 5.61985 32.1947 3.41647 31.2307C1.27339 30.2988 -0.0373848 28.2438 0.000812669 25.3858Z",className:Wl[r].primary}),u.jsx("path",{d:"M4.59424 32.9836C5.35618 32.9494 5.98342 32.9675 6.60463 32.8849C8.18055 32.688 9.64041 31.953 10.738 30.8038C12.0206 29.4936 13.3093 28.1873 14.6241 26.8489C14.8714 27.0683 15.0262 27.191 15.1609 27.3279C20.1078 32.2791 25.054 37.2324 29.9995 42.1876C31.6219 43.8179 32.1909 45.7843 31.5395 47.9983C30.9123 50.1257 29.4507 51.4883 27.2835 51.9774C25.4078 52.398 23.6186 52.0398 22.2435 50.6751C16.3671 44.8484 10.551 38.9673 4.59424 32.9836Z",className:Wl[r].negative}),u.jsx("path",{d:"M59.4545 40.0944C56.4389 39.7865 54.2878 40.9519 52.4744 42.9585C51.4933 44.0454 50.4178 45.0477 49.3583 46.1164C49.1372 45.9152 48.9824 45.7964 48.8436 45.6555C43.8914 40.7003 38.9418 35.7464 33.9949 30.7938C32.3745 29.1635 31.8076 27.1931 32.4751 24.9791C33.1164 22.8537 34.5799 21.4951 36.7532 21.0181C38.6751 20.5955 40.4623 21.0181 41.8676 22.4109C47.6307 28.1229 53.3677 33.8571 59.0785 39.6134C59.163 39.6899 59.2273 39.7966 59.4545 40.0944Z",className:Wl[r].negative})]})}),ID={[N.FLOW_DATA_VERSION]:ds,[N.PKG_VERSION]:FA},bD=()=>{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=Wr.useRef(null);return u.jsxs(u.Fragment,{children:[u.jsxs("button",{className:"group flex items-center justify-center gap-x-2 text-foreground/50 transition-colors hover:text-foreground/70",onClick:e,children:[u.jsx(AD,{className:"text-foreground/40 transition-colors group-hover:text-foreground/50",size:"xl",type:"currentColor"}),u.jsx("span",{className:"text-xs font-semibold",children:T(N.ABOUT)})]}),u.jsx("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:u.jsxs("div",{className:"h-full px-2 pb-10",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("h2",{className:"text-2xl leading-10",children:T(N.ABOUT)}),u.jsxs("button",{className:"my-0.5 -mr-1.5 rounded-md py-0.5 px-1.5 ",onClick:t,children:[u.jsx("span",{className:"sr-only",children:T(N.CLOSE)}),u.jsx(te,{tag:"xmark",size:"lg"})]})]}),u.jsxs("div",{className:"h-full overflow-y-auto",children:[u.jsx("ul",{className:"mt-1 flex flex-col items-center justify-center text-sm",children:Object.entries(ID).map(([r,o])=>u.jsx("li",{className:"text-foreground/70",children:u.jsxs("p",{children:[T(r),": ",o]})},r))}),u.jsx("div",{className:"mt-6 flex items-center justify-center ",children:u.jsx("button",{className:"rounded-md border border-foreground/10 bg-positive px-3.5 py-2.5 font-bold tracking-widest text-background",onClick:t,children:T(N.CLOSE)})})]})]})})]})},CD={deploy:N.STATUS_DEPLOY,deployed:N.STATUS_DEPLOYED,deploying:N.STATUS_DEPLOYING,error:N.STATUS_DEPLOY_ERROR},u_={deploy:"text-background border-hidden hover:bg-primary/90",deployed:"bg-background text-positive border-positive/20",deploying:"bg-background text-foreground/50 border-foreground/10",error:"bg-negative text-background border-hidden"},LD=()=>{const e=Y(m=>m.deployFlowStatus),t=Y(m=>m.deployFlowURL),n=Y(m=>m.detachedMode),r=Y(m=>m.documentVersion),o=Y(m=>m.httpError),i=Y(m=>m.saveFlowStatus),{deployFlow:s,getValidationWarnings:a,setShowDeployWarning:l}=xe(),c={error:void 0,prevDocVersion:r},[d,f]=X0(c),p=CD[e],h=async()=>{if(a().size>0)l(!0);else try{f({error:void 0}),await s()}catch(m){m instanceof Error?f({error:m.message}):f({error:"Failed to deploy!"})}};w.useEffect(()=>{i==="saved"&&r!==d.prevDocVersion&&f({prevDocVersion:r})},[d.prevDocVersion,r,i,f]);const E=i!=="saved"||e==="deployed"||e==="deploying",v=o==="document-sync"?u_.deploying:u_[e];let y="";e==="deploy"&&(y=i==="saved"?"bg-primary":"bg-focus");const g=`${y} ${v}`;return!t||n?null:u.jsxs("button",{"data-testid":"cfb__deploy-button",className:`flex items-center justify-center rounded border px-1.5 py-0.5
71
- text-xs font-medium transition-colors ${g}`,disabled:E,onClick:h,children:[T(p),u.jsx(sr,{placement:"right",trigger:u.jsx("span",{className:"flex items-center justify-center pl-1",role:"tooltip",tabIndex:0,children:e==="error"?u.jsx(te,{tag:"circle-exclamation"}):u.jsx(u.Fragment,{})}),children:e==="error"?T(N.MORE_INFO_DEPLOY_ERROR,{message:d.error}):T(N.MORE_INFO_DEPLOY)})]})},DD=()=>{const e=Y(t=>t.backButtonHref);return e?u.jsxs("a",{href:e,children:[u.jsx("span",{className:"sr-only",children:T(N.NAVIGATE_BACK)}),u.jsx(te,{tag:"arrow-left",className:"text-negative",size:"lg"})]}):null},kD=()=>{const e=Y(s=>s.showDeployedHistory),t=Y(s=>s.httpError==="document-sync"),{cancelDetachedMode:n,setShowDeployedHistory:r}=xe(),o=()=>{e?n():r(!0)},i=e?"text-background bg-foreground":"text-foreground bg-foreground/10";return u.jsx(sr,{placement:"top",trigger:u.jsxs("button",{className:`flex items-center justify-center rounded border border-transparent p-1 transition-colors ${i}`,disabled:t,onClick:o,type:"button",children:[u.jsx("span",{className:"sr-only",children:T(N.VERSION_HISTORY)}),u.jsx(te,{tag:"clock-rotate-left",size:"xs"})]}),children:T(N.VERSION_HISTORY)})},PD=({isDisabled:e,isSelected:t,itemIndex:n,onClick:r,onSelected:o,relativeTimeSince:i,version:s})=>{var f;const a=w.useRef(null),l=p=>{o(p)},c=()=>{t||(l(n),r(n))},d=p=>{p.preventDefault();const{key:h}=p;(h==="Enter"||h===" ")&&r(n),h==="ArrowUp"&&l(n-1),h==="ArrowDown"&&l(n+1)};return t&&((f=a.current)==null||f.focus()),u.jsx("li",{className:`border-l-2 transition-colors ${t?"border-l-primary/50 bg-primary/10":"border-l-transparent bg-background hover:bg-primary/5"}`,role:"presentation",children:u.jsxs("button",{"aria-selected":t?"true":"false",className:`flex w-full items-start gap-x-2 p-2 pr-4 ${e?"text-disabled":""}`,disabled:e,onClick:c,onKeyDown:d,type:"button",tabIndex:t?0:-1,ref:a,children:[u.jsx(te,{className:`p-1 ${t?"text-primary":"text-foreground/30"}`,tag:"dot-circle"}),u.jsxs("div",{className:"flex flex-col items-start justify-center",children:[u.jsx("h3",{className:"text-xs font-medium",children:T(N.VERSION_LIST_ITEM,{number:s})}),u.jsx("p",{className:"text-xxs",children:u.jsx("time",{children:i})})]})]})})},MD=200,d_=Ie(),jD=()=>{const e=Y(g=>g.deployedVersionsList),t=Y(g=>g.saveFlowStatus),n=Y(g=>g.showDeployedHistory),{cancelDetachedMode:r,getDeployedVersionsList:o,migrateAndLoadDeployedFlow:i}=xe();Z0({onKeyPress:n?r:void 0});const s=w.useRef(),[a,l]=w.useState("loading"),[c,d]=w.useState(null);c!==null&&!n&&d(null);const f=w.useCallback(g=>{g>=0&&g<=e.length-1?d(g):d(null)},[e.length]),p=w.useCallback(g=>{var _;const m=(_=s.current)==null?void 0:_[g];m?(d_.info("load version",m.id),i(m)):d_.error("version not found")},[i]),h=w.useCallback(()=>{l("loading"),o({pageSize:MD}).then(g=>{l("loaded"),s.current=g}).catch(()=>{l("error"),s.current=void 0})},[o]);w.useLayoutEffect(()=>{n&&h()},[h,n]);const E=a==="error",v=e.length>0,y=t==="saved";return n?u.jsxs("div",{"data-testid":"cfb__deployed-versions-sidebar",className:"flex h-full flex-col py-3",children:[u.jsxs("section",{className:"flex items-center justify-between self-stretch px-4 pb-1",children:[u.jsxs("h2",{className:"flex items-center gap-1 text-tiny font-bold uppercase leading-none tracking-wide",children:[u.jsx(te,{className:"text-xs text-foreground/50",tag:"clock-rotate-left"}),T(N.VERSION_HISTORY)]}),u.jsxs("button",{className:"flex items-center justify-center px-0.5",onClick:r,type:"button",children:[u.jsx("span",{className:"sr-only",children:T(N.CLOSE)}),u.jsx(te,{tag:"xmark"})]})]}),u.jsxs("div",{className:`${v?"overflow-y-auto":"h-full"}`,children:[a!=="loaded"?u.jsxs("div",{className:`flex flex-col justify-center gap-y-4 p-4 text-sm leading-none tracking-wide text-foreground/50 ${v?"":"h-full"}`,children:[u.jsxs("div",{className:"flex flex-col items-center justify-center gap-y-2 gap-x-2",children:[E?u.jsx(te,{className:"text-negative",tag:"circle-exclamation"}):u.jsx(te,{className:"animate-spin",tag:"arrows-rotate"}),u.jsx("p",{"aria-live":E?"assertive":"polite",className:`${E?"text-negative":"font-bold uppercase text-foreground/50"}`,role:E?"alert":"status",children:T(E?N.ERROR_FETCHING_DEPLOYED_VERSIONS:N.STATUS_LOADING)})]}),E?u.jsx("div",{className:"flex w-full items-center justify-center",children:u.jsx("button",{className:"rounded border border-primary/50 bg-primary/10 px-3 py-1.5 text-sm font-bold leading-tight tracking-wider text-primary",onClick:h,type:"button",children:T(N.RESYNC)})}):null]}):null,!v&&a==="loaded"?u.jsx("div",{className:`flex h-full flex-col justify-center gap-y-4 p-4 text-sm leading-none tracking-wide text-foreground/50
72
- `,children:u.jsxs("div",{className:"flex flex-col items-center justify-center gap-y-2 gap-x-2",children:[u.jsx(te,{tag:"circle-exclamation"}),$l(N.NO_DEPLOYED_VERSIONS)]})}):null,v?u.jsx("ol",{children:e.map((g,m)=>u.jsx(PD,{itemIndex:m,isDisabled:!y,isSelected:m===c,onClick:p,onSelected:f,relativeTimeSince:g.relativeTimeSince,version:g.version},g.id))}):null]})]}):null},UD=()=>{const{getFlagNames:e}=c_();return u.jsxs("div",{className:"rounded-sm border border-gray-200 p-2",children:[u.jsx("h3",{className:"w-full",children:"Feature Flags"}),u.jsx("div",{className:"flex flex-col gap-y-2 py-2",children:e().map(t=>u.jsx(FD,{flagName:t},t))})]})},FD=({flagName:e})=>{const{toggleFlag:t}=c_(),r=kr(o=>o[e])?"translate-x-5 bg-positive":"translate-x-0 bg-negative";return u.jsxs("label",{className:"flex cursor-pointer items-center",children:[u.jsxs("div",{className:"relative",children:[u.jsx("input",{type:"checkbox",className:"sr-only",onChange:()=>t(e)}),u.jsx("div",{className:"h-5 w-10 rounded-full bg-secondary/20",children:u.jsx("div",{className:`absolute left-1 top-1 h-3 w-3 rounded-full transition ${r}`})})]}),u.jsx("p",{className:"ml-3 text-sm font-medium",children:e})]})},VD=()=>{const[e,t]=w.useState(!1),n=()=>{t(r=>!r)};return u.jsx(sr,{open:e,onOpenChange:t,placement:"bottom",role:"dialog",trigger:u.jsxs("button",{className:"group flex items-center justify-center gap-x-2 text-foreground/50 transition-colors hover:text-foreground/70",onClick:n,children:[u.jsx(te,{className:"text-foreground/40 transition-colors group-hover:text-foreground/50",size:"xl",tag:"circle-question"}),u.jsxs("span",{className:"text-xs font-semibold",children:[T(N.HELP),u.jsx("span",{className:"sr-only",children:T(N.MORE_INFO_TESTING_YOUR_FLOW)})]})]}),children:u.jsxs("section",{className:"p-2",children:[u.jsx("h2",{className:"mb-4 text-2xl font-semibold",children:"Testing Your Call Flow"}),u.jsxs("div",{className:"text-sm",children:[u.jsx("p",{children:"To test the current working version (draft) of your Call Flow, follow these steps:"}),u.jsxs("ol",{className:"my-4 list-inside list-decimal",children:[u.jsxs("li",{className:"mb-2 list-item",children:["Go to the settings tab of the purchased phone number you want to use for testing:  ",u.jsx("a",{className:"underline hover:text-background/80",href:"/phone_numbers",target:"_blank",rel:"noopener noreferrer",children:"Purchased Phone Numbers"})]}),u.jsxs("li",{className:"mb-2",children:["Choose the appropriate Call Flow for handling your calls:  ",u.jsx("a",{className:"underline hover:text-background/80",href:"/call_flows",target:"_blank",rel:"noopener noreferrer",children:"Call Flows"})]}),u.jsx("li",{className:"mb-2",children:"Select the working version (draft) of the chosen Call Flow."}),u.jsx("li",{children:"When you make a call to the number, it should now execute the working version of your Call Flow upon answering."})]}),u.jsx("p",{className:"mt-4 mb-2",children:"In an upcoming update, you will be able to test your selected Call Flow directly from the Call Flow Builder, eliminating the need to manually associate the Call Flow with your number."})]})]})})},$D=(e,t)=>({label:T(Bl[e].label),nodes:Object.entries(Bl[e].nodes).reduce((n,[r,o])=>(((typeof o.active=="boolean"?o.active:o.active[UA])||t)&&n.push({deprecated:!!o.deprecated,title:T(o.label),type:r}),n),[]).sort((n,r)=>n.title.localeCompare(r.title))}),f_=Ie(),BD=["action","forwardTo","recording","input","decision"],HD=()=>{const e=kr(s=>s.showAllNodes),t=Y(s=>s.isCanvasInteractive),{addNode:n,setDragNodeType:r}=xe(),o=w.useCallback(s=>{s.preventDefault();const{nodeType:a}=s.currentTarget.dataset;a?n({nodeType:a}):f_.error("No nodeType found on click event")},[n]),i=w.useCallback(s=>{s.preventDefault();const{nodeType:a}=s.currentTarget.dataset;a?r(a):f_.error("No nodeType found on drag event")},[r]);return u.jsx("ul",{className:"py-3 px-2",id:"sidebar-node-list",children:BD.map(s=>u.jsx("li",{children:u.jsx(zD,{enableNodeButtons:t,group:s,handleOnClick:o,handleDragStart:i,showAllNodes:e})},s))})},zD=({enableNodeButtons:e=!0,group:t,handleOnClick:n,handleDragStart:r,showAllNodes:o})=>{const i=$D(t,o),s=`ngm-heading-${XA(i.label)}`;return u.jsxs(u.Fragment,{children:[u.jsx("h2",{className:"px-2 pb-1 text-tiny font-bold uppercase tracking-wide text-foreground/50",id:s,children:i.label}),u.jsx("ul",{"aria-labelledby":s,className:"flex flex-1 flex-col gap-y-1 pb-2",children:i.nodes.map(a=>u.jsx("li",{children:u.jsxs("button",{className:`flex w-full items-start gap-2 rounded-lg border border-dashed border-transparent bg-primary/5 p-2 transition-colors
73
- hover:border-primary hover:bg-primary/20 enabled:hover:shadow-md`,"data-node-type":a.type,disabled:!e,draggable:e,onClick:e?n:void 0,onDragStart:e?r:void 0,children:[u.jsx(te,{tag:"circle-small",className:"text-primary"}),u.jsxs("span",{className:"text-left text-xs font-medium line-clamp-2",children:[a.title,a.deprecated&&u.jsxs("span",{className:"text-foreground/70",children:[" ",T(N.DEPRECATED)]})]})]})},a.type))})]})},WD=()=>{const{addToast:e,restoreDeployedFlow:t}=xe(),n=Y(o=>o.workingFlowCopy),r=()=>{t(),e({message:T(N.VERSION_RESTORED),status:"success"})};return n?u.jsx("button",{className:`flex items-center justify-center rounded border bg-primary px-1.5 py-0.5 text-xs font-medium
74
- text-background transition-colors hover:bg-primary/90`,onClick:r,children:T(N.RESTORE)}):null},GD={"awaiting-save":N.STATUS_SAVING,"document-sync":N.STATUS_LOCKED,error:N.STATUS_ERROR,initial:N.STATUS_LOADING,saved:N.STATUS_SAVED,saving:N.STATUS_SAVING},p_=e=>(e.preventDefault(),e.returnValue=""),h_=(e,t)=>e==="document-sync"?e:t,YD=()=>{const e=Y(p=>p.detachedMode),t=Y(p=>p.saveFlowStatus),n=Y(p=>p.httpError),[r,o]=w.useState(!0),[i,s]=w.useState(h_(n,t)),a=GD[i],l=t==="error"||n,c=h_(n,t),d=w.useRef(!1);w.useEffect(()=>{c==="initial"&&!d.current?(d.current=!0,s(c),o(!1),setTimeout(()=>{o(!0)},HA)):c!=="initial"&&r&&(d.current=!1,s(c))},[r,c]),w.useEffect(()=>{if(!(t==="saved"||n))return addEventListener("beforeunload",p_,{capture:!0}),()=>{removeEventListener("beforeunload",p_,{capture:!0})}},[n,t]);let f="";switch(!0){case l:f="px-1.5 py-0.5 bg-negative/20 text-negative";break;case i==="saved":f="text-foreground/50";break;default:f="px-1.5 py-0.5 bg-foreground/30 text-background"}return e?null:u.jsx("div",{"aria-live":l?"assertive":"polite","data-testid":"cfb__status",className:"flex",role:l?"alert":"status",children:u.jsxs("div",{className:`flex gap-x-1 rounded text-xxs ${f}`,children:[u.jsx("p",{children:a==="STATUS_SAVED"?u.jsx(KD,{}):T(a)}),l&&u.jsx(sr,{placement:"bottom",trigger:u.jsxs("div",{role:"tooltip",tabIndex:0,children:[u.jsx("span",{className:"sr-only",children:T(N.MORE_INFO_STATUS_ERROR)}),u.jsx(te,{tag:"circle-exclamation"})]}),children:T(n==="document-sync"?N.INFO_STATUS_ERROR_OUT_OF_SYNC:N.INFO_STATUS_ERROR)})]})})},KD=()=>{const e=Y(i=>i.documentLastUpdated),t=w.useCallback((i,...s)=>Xv(C0(),{numeric:"always",style:"narrow"})(i,{excludeUnits:{second:!0},...s}),[]),n=e?t(e):void 0,[r,o]=w.useState(n);return w.useEffect(()=>{if(!e)return;const i=setInterval(()=>{o(t(e))},1e3);return()=>clearInterval(i)},[e,t]),u.jsxs(u.Fragment,{children:[T(N.SAVED)," ",u.jsx("time",{children:r})]})},QD=()=>{const e=kr(s=>s.showDevOptions),{exportStoreData:t}=xe(),n=Y(s=>s.flowTitle),r=Y(s=>s.showDeployedHistory),o=w.useRef(null),i=s=>{s.preventDefault(),o.current&&o.current.showModal()};return u.jsxs(u.Fragment,{children:[u.jsxs("section",{className:"hidden h-full w-1/6 min-w-[160px] shrink-0 flex-col bg-background text-foreground sm:flex",children:[u.jsxs("nav",{className:"flex shrink-0 items-center justify-between px-3 py-2",children:[u.jsx(DD,{}),e&&u.jsx("button",{className:"rounded bg-positive p-1 px-2 text-xs text-background",onClick:i,children:"Dev Options"})]}),u.jsx("section",{className:"px-2 py-2",children:u.jsxs("div",{className:"divide-y divide-foreground/10 rounded-lg border border-foreground/10",children:[u.jsx("h1",{className:"block w-full shrink-0 p-2 text-sm font-semibold leading-tight line-clamp-2",children:n||u.jsx(u.Fragment,{children:" "})}),u.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-1 gap-y-2 p-2",children:[u.jsx("div",{className:"flex-1",children:u.jsx(YD,{})}),u.jsxs("menu",{className:"flex items-center justify-center gap-x-1",children:[r?u.jsx(WD,{}):u.jsx(LD,{}),u.jsx(kD,{})]})]})]})}),u.jsxs("section",{className:"h-full overflow-y-auto",children:[r?null:u.jsx(HD,{}),u.jsx(jD,{})]}),u.jsx("section",{className:"flex flex-col items-start justify-center gap-y-5 px-2 pt-3 pb-4",children:u.jsxs("div",{className:"flex flex-col items-start justify-center gap-y-3 px-2",children:[u.jsx(bD,{}),u.jsx(VD,{})]})})]}),e&&u.jsx("dialog",{className:"z-50 my-10 rounded-lg border border-foreground/10 bg-background text-foreground",ref:o,children:u.jsx("form",{children:u.jsxs("fieldset",{children:[u.jsxs("legend",{className:"flex w-full justify-between pb-2",children:[u.jsx("h1",{className:"text-2xl leading-10",children:"Dev Options"}),u.jsxs("button",{className:"p-1 pt-0 font-semibold",formMethod:"dialog",children:[u.jsx("span",{className:"sr-only",children:"Close"}),u.jsx(te,{tag:"xmark",size:"lg"})]})]}),u.jsxs("div",{className:"mb-1 rounded-sm border border-gray-200 p-2",children:[u.jsx("h3",{className:"w-full",children:"Flow Data"}),u.jsx("div",{className:"flex flex-row gap-x-2 py-2",children:u.jsx("div",{className:"flex items-center",children:u.jsx("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:t,children:"View JSON File"})})})]}),u.jsx(UD,{})]})})})]})},XD=()=>{const e=w.useRef(null),[t,n]=w.useState(),[r,o]=w.useState(null);return w.useLayoutEffect(()=>(e.current=new ResizeObserver(([i])=>n(i)),r&&e.current.observe(r),()=>{var i;return(i=e.current)==null?void 0:i.disconnect()}),[r]),{observerEntry:t,setTarget:o}},qD=({rootAppHeight:e,rootAppWidth:t})=>{Y.setState({rootAppHeight:e,rootAppWidth:t})},JD=()=>{const{observerEntry:e,setTarget:t}=XD();return w.useEffect(()=>{e&&(Ie().log("resized",{rootAppHeight:e.contentRect.height,rootAppWidth:e.contentRect.width}),qD({rootAppHeight:e.contentRect.height,rootAppWidth:e.contentRect.width}))},[e]),{rootTarget:t}},s4="";function ZD(){Ie().debug("Hello World!");const{rootTarget:e}=JD(),t=Y(o=>o.colorMode)??"",n=Y(o=>o.httpError),r=n!==void 0&&n!=="document-sync";return u.jsx(u.Fragment,{children:u.jsx("div",{className:`${t} flex h-full w-full bg-backgroundAlt text-foreground`,ref:e,children:r?u.jsx(PC,{errorType:n}):u.jsxs(u.Fragment,{children:[u.jsx(QD,{}),u.jsx(iD,{}),u.jsx(lD,{}),u.jsxs(tf,{children:[u.jsx(pL,{}),u.jsxs(dL,{children:[u.jsxs(ns,{className:"z-50 m-0 mx-auto mt-2.5 flex w-full min-w-[320px] max-w-lg flex-col items-center gap-y-2 px-4",position:"top-center",children:[u.jsx(XL,{}),u.jsx(tD,{})]}),u.jsx(SD,{}),u.jsx(gD,{}),u.jsx(QL,{}),u.jsx(hL,{})]})]})]})})})}const e3=`@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")}@font-face{font-family:SWInter;font-style:normal;font-weight:500;font-display:swap;src:url(//cdn.signalwire.com/fonts/inter/Inter-Medium.woff2) format("woff2"),url(//cdn.signalwire.com/fonts/inter/Inter-Medium.woff) format("woff")}
75
- `,g_=Ie(),t3=e=>{if(!e||!e.getFlowURL||!e.updateFlowURL)throw new TypeError("Invalid or missing required params")};function n3(e){t3(e);const{getAiAgentsURL:t=`${window.location.origin}${rS}`,backButtonHref:n,rootElementId:r="sw-cfb-root",styleHref:o="https://cdn.signalwire.com/npm/@signalwire/cfb@latest/dist/style.css",voicesURL:i="https://cdn.signalwire.com/npm/@signalwire/cfb@latest/dist/voices.json",getFlowURL:s,updateFlowURL:a,deployFlowURL:l}=e;Hf.getState().actions.init({voicesURL:i}).catch(f=>{g_.error("Error initializing voices",f)});const c=document.getElementById(r);if(Y.setState({backButtonHref:n,deployFlowURL:l,getFlowURL:s,rootElement:c,rootElementId:r,updateFlowURL:a}),t&&un.getState().actions.init({getAiAgentsURL:t}),vC().catch(f=>{g_.error("Error initializing i18n",f)}),OD(),!c)throw new Error(`Id: '${r}' not found in the DOM`);c.attachShadow({mode:"open"}),c.shadowRoot&&ic.createRoot(c.shadowRoot).render(u.jsxs(w.StrictMode,{children:[u.jsx("link",{type:"text/css",rel:"stylesheet",href:o}),u.jsx(ZD,{})]}));const d=document.createElement("style");document.head.appendChild(d),d.appendChild(document.createTextNode(e3))}Hr.main=n3,Object.defineProperty(Hr,Symbol.toStringTag,{value:"Module"})});
66
+ ${u} ${t?"animate-from-bottom":""} ${r}`,ref:a,role:i,children:[d.jsxs("div",{className:"flex items-center justify-center gap-x-2",children:[d.jsx(re,{className:"flex-shrink-0 self-start",tag:o}),d.jsx("p",{className:"text-xs font-semibold",children:s})]}),n]})}),pb=()=>{const{addToast:e,restoreDeployedFlow:t,cancelDetachedMode:n}=Te();if(!Q(i=>i.showDeployedHistoryToast))return null;const o=()=>{t(),e({message:A(N.VERSION_RESTORED),status:"success"})},s=()=>{n()};return d.jsx(Ov,{animate:!1,className:"gap-x-14",message:A(N.PREVIEW_DEPLOYED_VERSION),role:"dialog",children:d.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-x-2 gap-y-1",children:[d.jsx("button",{className:"rounded bg-primary px-1.5 py-0.5 text-xs font-medium text-background transition-colors hover:bg-primary/90",onClick:o,children:A(N.RESTORE_THIS_VERSION)}),d.jsx("button",{className:"rounded bg-secondary/50 px-1.5 py-0.5 text-xs font-medium text-background transition-colors hover:bg-secondary/40",onClick:s,children:A(N.CANCEL)})]})})},Tv=({onKeyPress:e})=>{const t=Oo(["Escape","Esc"]);return O.useEffect(()=>{t&&typeof e=="function"&&e()},[t,e]),{isPressed:t}},hb={offset:[0,.5,1],opacity:[1,0,0],pointerEvents:["none","none","auto"],transform:["scale(1.1) translateY(0%)","scale(0.5) translateY(-100%)"]},mb={duration:vA*2,easing:"ease-in-out",fill:"forwards"},gb=({durationMs:e,id:t,permanent:n})=>{const r=e??_A,[o,s]=O.useState(null),{deleteToast:i}=Te(),l=O.useCallback(()=>{let a;const c=()=>i(t);return o instanceof HTMLElement?(a=o.animate(hb,mb),a.addEventListener("finish",c,{once:!0})):c(),()=>a==null?void 0:a.removeEventListener("finish",c)},[t,i,o]);return Tv({onKeyPress:l}),O.useEffect(()=>{if(n)return;let a,c;const u=()=>{clearTimeout(a)},f=()=>{u(),a=setTimeout(()=>{c=l()},r)};return f(),o instanceof HTMLElement&&(o.addEventListener("mouseenter",u),o.addEventListener("mouseleave",f)),()=>{u(),o instanceof HTMLElement&&(o.removeEventListener("mouseenter",u),o.removeEventListener("mouseleave",f),c==null||c())}},[l,r,n,o]),{deleteToastCallback:l,setToastRef:s,toastRef:o}},Av=({durationMs:e,id:t,message:n,permanent:r,status:o})=>{const{deleteToastCallback:s,setToastRef:i}=gb({durationMs:e,id:t,permanent:r});return d.jsx(Ov,{className:"w-full max-w-sm",iconTag:o==="success"?"circle-check":"circle-exclamation",message:n,ref:i,status:o,children:d.jsxs("button",{className:"flex-shrink-0 self-start opacity-40 transition-opacity hover:opacity-70",onClick:s,children:[d.jsx(re,{tag:"circle-xmark",size:"xl"}),d.jsx("span",{className:"sr-only",children:A(N.CLOSE)})]})})},Eb={error:Av,success:Av},yb=()=>{const e=Q(n=>n.toastsMap);if(e.size===0)return null;const t=Array.from(e.values());return d.jsx("div",{className:"flex w-full flex-col items-center gap-y-1",children:t.map(n=>{const r=Eb[n.status];return d.jsx(r,{durationMs:n.durationMs,id:n.id,message:n.message,permanent:n.permanent,status:n.status},n.id)})})},vb=({asRole:e="alert",open:t=!1,type:n="overlay"})=>{const[r,o]=H.useState(t);O.useEffect(()=>{o(t)},[t]);const s=O.useCallback(()=>o(!1),[]),i=O.useCallback(()=>o(!0),[]);return{asRole:e,closeContainer:s,isOpen:r,openContainer:i,type:n}},Iv=O.createContext(null),Wf=()=>{const e=O.useContext(Iv);if(e==null)throw new Error("Toast components must be wrapped in <ToastContainer />");return e},_b=({children:e,...t})=>{const n=vb(t);return d.jsx(Iv.Provider,{value:n,children:e})},Cv=({iconAs:e,title:t,children:n})=>{const{asRole:r}=Wf();return d.jsxs("div",{className:"max-w-xl rounded-lg bg-foreground p-4 text-background shadow-2xl transition-[transform,box-shadow] duration-500 will-change-transform hover:shadow-none",role:r,children:[d.jsxs("h2",{className:"text-lg font-semibold leading-6 tracking-wide",children:[d.jsx("span",{className:"mr-2",children:d.jsx(re,{tag:e??"circle-exclamation"})}),t]}),d.jsx("div",{className:"mt-2 text-sm leading-5",children:n})]})},Sb=({children:e})=>{const{closeContainer:t,isOpen:n,type:r}=Wf(),{getRootElement:o}=Te(),s=o(),i=O.useRef(null);return O.useEffect(()=>{if(!i.current)return;let l,a;const c=u=>{var f,p;if(u.key==="Escape"&&t(),u.key==="Tab"){const h=(p=(f=document.activeElement)==null?void 0:f.shadowRoot)==null?void 0:p.activeElement;u.shiftKey?h===l&&(a==null||a.focus(),u.preventDefault()):h===a&&(l==null||l.focus(),u.preventDefault())}};if(r==="overlay"){const u=i.current.querySelectorAll("button");l=u[0],a=u[u.length-1],a==null||a.focus(),document.addEventListener("keydown",c)}return()=>{document.removeEventListener("keydown",c)}},[t,r]),n?Bl.createPortal(d.jsx("section",{className:`flex justify-center ${r==="overlay"?"fixed top-0 z-50 h-full w-full items-start px-6 py-36 backdrop-blur-sm backdrop-grayscale":"absolute top-10 left-1/2 z-10 -translate-x-1/2 translate-y-1/2 items-center"}`,ref:r==="overlay"?i:void 0,children:e}),s):null},Lv=({asRole:e,open:t,children:n,type:r})=>d.jsx(_b,{asRole:e,open:t,type:r,children:d.jsx(Sb,{children:n})}),xb=()=>{const t=Q(n=>n.httpError)===z0;return t?d.jsx(Lv,{asRole:"dialog",open:t,type:"overlay",children:d.jsx(Cv,{title:A(N.DOCUMENT_OUT_OF_SYNC),children:d.jsx(Rb,{})})}):null},Rb=()=>{const{closeContainer:e}=Wf(),t=()=>{window.location.reload()};return d.jsxs(d.Fragment,{children:[Ua(N.TOAST_DOCUMENT_OUT_OF_SYNC),d.jsxs("div",{className:"mt-11 flex items-center justify-center gap-x-6",children:[d.jsx("button",{className:"rounded-md border border-background bg-foreground px-3.5 py-2.5 font-bold tracking-widest text-background",onClick:e,children:A(N.IGNORE)}),d.jsx("button",{className:"rounded-md border border-background bg-positive/70 px-3.5 py-2.5 font-bold tracking-widest text-background",onClick:t,children:A(N.RESYNC)})]})]})},Nb=Ne(),wb=()=>{const e=Q(t=>t.showDeployWarning);return d.jsx(Lv,{asRole:"dialog",open:e,type:"overlay",children:d.jsx(Cv,{title:A(N.DEPLOY_WARNING),children:d.jsx(Ob,{})})})},Ob=()=>{const{deployFlow:e,setShowDeployWarning:t,setShowValidationWarnings:n}=Te(),r=()=>{t(!1),n(!0)},o=()=>{t(!1)},s=()=>{e().catch(i=>{Nb.error(i)}),o()};return d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"mb-4",children:Ua(N.TOAST_DEPLOY_WARNING)}),d.jsx(Ny,{onClickListItem:r}),d.jsxs("div",{className:"mt-11 flex items-center justify-center gap-x-6",children:[d.jsx("button",{className:"rounded-md border border-background bg-foreground px-3.5 py-2.5 font-bold tracking-widest text-background",onClick:o,children:A(N.CANCEL)}),d.jsx("button",{className:"rounded-md border border-background bg-positive/70 px-3.5 py-2.5 font-bold tracking-widest text-background",onClick:s,children:A(N.DEPLOY)})]})]})},Tb="react-flow__controls-button",Ab="min-w-[3.625rem] cursor-auto select-auto text-center hover:bg-background active:bg-background",Ib="hidden sm:flex",Cb=O.forwardRef(function({asTag:t="div",children:n,className:r="",hiddenSmallScreen:o=!1,...s},i){const l=t,c=`${Tb} ${l==="button"?"":Ab} ${o?Ib:""} ${r}`;return d.jsx(l,{className:c,ref:i,...s,children:n})}),Lb=()=>{const e=Q(i=>i.showValidationWarnings),t=Q(i=>i.validationWarnings),n=Q(i=>i.detachedMode),{setShowValidationWarnings:r}=Te(),o=()=>r(!e),s=()=>{e&&r(!1)};return!t.size||n?(s(),null):d.jsx(Zn,{onOpenChange:r,open:e,outsidePress:!1,placement:"bottom-start",role:"dialog",trigger:d.jsxs(Cb,{className:"text-xs",asTag:"button",onClick:o,hiddenSmallScreen:!0,children:[A(N.WARNING),d.jsxs("div",{className:"flex items-center justify-center pl-1",children:[d.jsx("span",{className:"sr-only",children:A(N.MORE_INFO_STATUS_ERROR)}),d.jsx(re,{className:"text-warning",tag:"circle-exclamation"})]})]}),children:d.jsx(Ny,{children:d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("h2",{className:"text-xs font-semibold",children:[d.jsx(re,{className:"mr-1",tag:"circle-exclamation"}),A(N.CAUTION)]}),d.jsxs("button",{className:"my-0.5 rounded-md py-0.5 px-1.5",onClick:s,children:[d.jsx("span",{className:"sr-only",children:A(N.CLOSE)}),d.jsx(re,{tag:"xmark",size:"lg"})]})]})})})},bb=()=>{const e=Q(r=>r.isDraggingNode),t=Q(r=>r.showInteractiveControl),n=r=>{Q.setState({isInteractiveControlOn:r})};return d.jsx(nA,{className:`mt-2.5 rounded-[0.25rem] ${e?"group/control-buttons":""}`,position:"top-left",onInteractiveChange:n,showInteractive:t,children:d.jsx(Lb,{})})},Db=".react-flow__panel",kb=16,bv={cursor:"no-drop",transform:"translate(0px, 0px) scale(1)",visibility:"hidden",zIndex:"5"},Dv=e=>{const t=e.getBoundingClientRect();return{isCursorIntersecting:({clientX:n,clientY:r})=>t.top<=r&&t.bottom>=r&&t.left<=n&&t.right>=n}},Pb=e=>{const t=e.querySelectorAll(Db);return Array.from(t).map(n=>Dv(n).isCursorIntersecting)},Mb=e=>({resetDragNodeStyles:()=>{Object.entries(bv).forEach(([t,n])=>{e.style[t]=n})},updateDragNodeStyles:({isOverDropTarget:t,scale:n,xPos:r,yPos:o})=>{e.style.visibility="visible",e.style.cursor=t?"grabbing":"no-drop",e.style.transform=`translate(${r}px, ${o}px) scale(${n})`}}),Ub=({handleMouseMove:e,handleMouseUp:t,root:n})=>(n.addEventListener("mousemove",e),n.addEventListener("mouseup",t),{removeListeners:()=>{n.removeEventListener("mousemove",e),n.removeEventListener("mouseup",t)}}),Fb=()=>{const e=O.useRef(null),t=Q(p=>p.dragNodeType),n=Q(p=>p.flowWrapperElement),r=Q(p=>p.viewport.zoom),{addNode:o,getRootElement:s,setDragNodeType:i}=Te(),l=s();if(O.useEffect(()=>{if(e.current&&t&&n&&l){let p=!1;const h=kb*r,E=e.current,y=Dv(n).isCursorIntersecting,v=Pb(n),{resetDragNodeStyles:m,updateDragNodeStyles:g}=Mb(E),{removeListeners:S}=Ub({handleMouseMove:_=>{const{clientX:x,clientY:R}=_,T=x-h,L=R-h;p=y({clientX:x,clientY:R})&&!v.some(P=>P({clientX:x,clientY:R})),g({isOverDropTarget:p,scale:p?r:1,xPos:T,yPos:L})},handleMouseUp:_=>{if(p){const x=n.getBoundingClientRect();o({nodeType:t,x:_.clientX-x.left-h,y:_.clientY-x.top-h})}i(void 0)},root:l});return()=>{S(),m()}}},[o,t,n,l,i,r]),!t)return null;const a=gv[t],c=Z0[t](),u=le(),f={...c,initial:!1,valid:!0};return d.jsx("section",{className:"react-flow__node fixed left-0 top-0",ref:e,style:bv,children:d.jsx(a,{data:f,dragging:!0,id:u,isConnectable:!0,selected:!0,type:t,xPos:0,yPos:0,zIndex:0})})};var jb={VITE_BASE_URL:"",VITE_BASIC_AUTH:"signalwire:1aG93uXk",VITE_DEFAULT_STYLE_HREF:"https://cdn.swire.io/npm/@signalwire/cfb@dev/dist/style.css",VITE_DEFAULT_VOICES_URL:"https://cdn.signalwire.com/npm/@signalwire/cfb@dev/dist/voices.json",VITE_FLOW_DATA_VERSION:"0.0.10",VITE_IS_STAGING:"true",BASE_URL:"/cfb/",MODE:"staging",DEV:!1,PROD:!0,SSR:!1};function kv(e,t){let n;try{n=e()}catch{return}return{getItem:o=>{var s;const i=a=>a===null?null:JSON.parse(a,t==null?void 0:t.reviver),l=(s=n.getItem(o))!=null?s:null;return l instanceof Promise?l.then(i):i(l)},setItem:(o,s)=>n.setItem(o,JSON.stringify(s,t==null?void 0:t.replacer)),removeItem:o=>n.removeItem(o)}}const xi=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return xi(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return xi(r)(n)}}}},Vb=(e,t)=>(n,r,o)=>{let s={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:v=>v,version:0,merge:(v,m)=>({...m,...v}),...t},i=!1;const l=new Set,a=new Set;let c;try{c=s.getStorage()}catch{}if(!c)return e((...v)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),n(...v)},r,o);const u=xi(s.serialize),f=()=>{const v=s.partialize({...r()});let m;const g=u({state:v,version:s.version}).then(S=>c.setItem(s.name,S)).catch(S=>{m=S});if(m)throw m;return g},p=o.setState;o.setState=(v,m)=>{p(v,m),f()};const h=e((...v)=>{n(...v),f()},r,o);let E;const y=()=>{var v;if(!c)return;i=!1,l.forEach(g=>g(r()));const m=((v=s.onRehydrateStorage)==null?void 0:v.call(s,r()))||void 0;return xi(c.getItem.bind(c))(s.name).then(g=>{if(g)return s.deserialize(g)}).then(g=>{if(g)if(typeof g.version=="number"&&g.version!==s.version){if(s.migrate)return s.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 S;return E=s.merge(g,(S=r())!=null?S:h),n(E,!0),f()}).then(()=>{m==null||m(E,void 0),i=!0,a.forEach(g=>g(E))}).catch(g=>{m==null||m(void 0,g)})};return o.persist={setOptions:v=>{s={...s,...v},v.getStorage&&(c=v.getStorage())},clearStorage:()=>{c==null||c.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>y(),hasHydrated:()=>i,onHydrate:v=>(l.add(v),()=>{l.delete(v)}),onFinishHydration:v=>(a.add(v),()=>{a.delete(v)})},y(),E||h},$b=(e,t)=>(n,r,o)=>{let s={storage:kv(()=>localStorage),partialize:y=>y,version:0,merge:(y,v)=>({...v,...y}),...t},i=!1;const l=new Set,a=new Set;let c=s.storage;if(!c)return e((...y)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),n(...y)},r,o);const u=()=>{const y=s.partialize({...r()});return c.setItem(s.name,{state:y,version:s.version})},f=o.setState;o.setState=(y,v)=>{f(y,v),u()};const p=e((...y)=>{n(...y),u()},r,o);let h;const E=()=>{var y,v;if(!c)return;i=!1,l.forEach(g=>{var S;return g((S=r())!=null?S:p)});const m=((v=s.onRehydrateStorage)==null?void 0:v.call(s,(y=r())!=null?y:p))||void 0;return xi(c.getItem.bind(c))(s.name).then(g=>{if(g)if(typeof g.version=="number"&&g.version!==s.version){if(s.migrate)return s.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 S;return h=s.merge(g,(S=r())!=null?S:p),n(h,!0),u()}).then(()=>{m==null||m(h,void 0),h=r(),i=!0,a.forEach(g=>g(h))}).catch(g=>{m==null||m(void 0,g)})};return o.persist={setOptions:y=>{s={...s,...y},y.storage&&(c=y.storage)},clearStorage:()=>{c==null||c.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>E(),hasHydrated:()=>i,onHydrate:y=>(l.add(y),()=>{l.delete(y)}),onFinishHydration:y=>(a.add(y),()=>{a.delete(y)})},s.skipHydration||E(),h||p},Hb=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?((jb?"staging":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),Vb(e,t)):$b(e,t),Pv=window,Mv={showAllNodes:!1,showDevOptions:!1},Ir=bo()(Hb((e,t)=>({...Mv,actions:{getFlagNames:()=>{const n=t();return Object.keys(n).filter(r=>r!=="actions")},toggleFlag:n=>e(r=>({...r,[n]:!r[n]}))}}),{name:"flags",partialize:e=>Object.fromEntries(Object.entries(e).filter(([t])=>t!=="actions")),storage:kv(()=>localStorage),version:0})),Uv=()=>Ir.getState().actions;Ir.subscribe(e=>{console.log("feature flags changed",e)});const Bb=e=>{const t=(r,o)=>{Ir.setState(s=>({...s,[r]:o}))},n=r=>{const o=Ir.getState(),s={...r};return Object.entries(o).forEach(([i,l])=>{i in s&&typeof l=="boolean"&&(s[i]=l)}),s};if(Pv){const r=new Proxy(n(e),{get:(o,s)=>Reflect.get(o,s),set:(o,s,i)=>{if(typeof i=="boolean"&&s in o)t(s,i);else throw new Error("unknown flag");return Reflect.set(o,s,i)}});Pv.swFlags=r}},zb=()=>Bb(Mv),Ha={currentColor:{negative:"fill-current",primary:"fill-current"},light:{negative:"fill-negative",primary:"fill-primary"}},Wb={"2xl":"w-[2em] h-[2em]","2xs":"w-[0.75em] h-[0.75em]",lg:"w-[1.25em] h-[1.25em]",md:"w-[1em] h-[1em]",sm:"w-[0.875em] h-[0.875em]",xl:"w-[1.5em] h-[1.5em]",xs:"w-[0.75em] h-[0.75em]"},Gb=O.forwardRef(function({className:t="",size:n="md",type:r="light"},o){const s=Wb[n];return d.jsxs("svg",{"aria-hidden":"true",className:`${s} ${t}`,focusable:"false",fill:"none",ref:o,role:"img",viewBox:"0 0 64 73",xmlns:"http://www.w3.org/2000/svg",children:[d.jsx("path",{d:"M63.9998 46.5209C63.9998 48.596 63.4369 49.9545 62.3171 51.0736C55.6065 57.7826 48.8931 64.4815 42.177 71.1703C39.841 73.495 36.4374 73.6097 34.1234 71.4843C31.6868 69.2442 31.5903 65.569 33.9726 63.1356C36.9983 60.0482 40.0681 57.003 43.132 53.9537C46.8137 50.2907 50.5034 46.6369 54.2012 42.9926C55.9925 41.2315 58.3929 40.7666 60.5902 41.7669C62.7876 42.7672 63.9315 44.5686 63.9998 46.5209Z",className:Ha[r].primary}),d.jsx("path",{d:"M0.000812669 25.3858C0.0329789 24.3372 0.589857 23.0088 1.68351 21.9159C8.37007 15.2378 15.058 8.56035 21.7472 1.88357C23.1384 0.492799 24.7789 -0.219695 26.739 0.0600696C29.061 0.402228 30.6834 1.69438 31.4393 3.92847C32.1952 6.16256 31.6725 8.18129 30.032 9.85183C26.8355 13.1003 23.5988 16.3166 20.3822 19.5329C16.868 23.0309 13.3444 26.5196 9.81152 29.9989C8.01423 31.762 5.61985 32.1947 3.41647 31.2307C1.27339 30.2988 -0.0373848 28.2438 0.000812669 25.3858Z",className:Ha[r].primary}),d.jsx("path",{d:"M4.59424 32.9836C5.35618 32.9494 5.98342 32.9675 6.60463 32.8849C8.18055 32.688 9.64041 31.953 10.738 30.8038C12.0206 29.4936 13.3093 28.1873 14.6241 26.8489C14.8714 27.0683 15.0262 27.191 15.1609 27.3279C20.1078 32.2791 25.054 37.2324 29.9995 42.1876C31.6219 43.8179 32.1909 45.7843 31.5395 47.9983C30.9123 50.1257 29.4507 51.4883 27.2835 51.9774C25.4078 52.398 23.6186 52.0398 22.2435 50.6751C16.3671 44.8484 10.551 38.9673 4.59424 32.9836Z",className:Ha[r].negative}),d.jsx("path",{d:"M59.4545 40.0944C56.4389 39.7865 54.2878 40.9519 52.4744 42.9585C51.4933 44.0454 50.4178 45.0477 49.3583 46.1164C49.1372 45.9152 48.9824 45.7964 48.8436 45.6555C43.8914 40.7003 38.9418 35.7464 33.9949 30.7938C32.3745 29.1635 31.8076 27.1931 32.4751 24.9791C33.1164 22.8537 34.5799 21.4951 36.7532 21.0181C38.6751 20.5955 40.4623 21.0181 41.8676 22.4109C47.6307 28.1229 53.3677 33.8571 59.0785 39.6134C59.163 39.6899 59.2273 39.7966 59.4545 40.0944Z",className:Ha[r].negative})]})}),Yb={[N.FLOW_DATA_VERSION]:li,[N.PKG_VERSION]:hA},Kb=()=>{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=H.useRef(null);return d.jsxs(d.Fragment,{children:[d.jsxs("button",{className:"group flex items-center justify-center gap-x-2 text-foreground/50 transition-colors hover:text-foreground/70",onClick:e,children:[d.jsx(Gb,{className:"text-foreground/40 transition-colors group-hover:text-foreground/50",size:"xl",type:"currentColor"}),d.jsx("span",{className:"text-xs font-semibold",children:A(N.ABOUT)})]}),d.jsx("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:d.jsxs("div",{className:"h-full px-2 pb-10",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("h2",{className:"text-2xl leading-10",children:A(N.ABOUT)}),d.jsxs("button",{className:"my-0.5 -mr-1.5 rounded-md py-0.5 px-1.5 ",onClick:t,children:[d.jsx("span",{className:"sr-only",children:A(N.CLOSE)}),d.jsx(re,{tag:"xmark",size:"lg"})]})]}),d.jsxs("div",{className:"h-full overflow-y-auto",children:[d.jsx("ul",{className:"mt-1 flex flex-col items-center justify-center text-sm",children:Object.entries(Yb).map(([r,o])=>d.jsx("li",{className:"text-foreground/70",children:d.jsxs("p",{children:[A(r),": ",o]})},r))}),d.jsx("div",{className:"mt-6 flex items-center justify-center ",children:d.jsx("button",{className:"rounded-md border border-foreground/10 bg-positive px-3.5 py-2.5 font-bold tracking-widest text-background",onClick:t,children:A(N.CLOSE)})})]})]})})]})},Xb={deploy:N.STATUS_DEPLOY,deployed:N.STATUS_DEPLOYED,deploying:N.STATUS_DEPLOYING,error:N.STATUS_DEPLOY_ERROR},Fv={deploy:"text-background border-hidden hover:bg-primary/90",deployed:"bg-background text-positive border-positive/20",deploying:"bg-background text-foreground/50 border-foreground/10",error:"bg-negative text-background border-hidden"},Qb=()=>{const e=Q(g=>g.deployFlowStatus),t=Q(g=>g.deployFlowURL),n=Q(g=>g.detachedMode),r=Q(g=>g.documentVersion),o=Q(g=>g.httpError),s=Q(g=>g.saveFlowStatus),{deployFlow:i,getValidationWarnings:l,setShowDeployWarning:a}=Te(),c={error:void 0,prevDocVersion:r},[u,f]=$f(c),p=Xb[e],h=async()=>{if(l().size>0)a(!0);else try{f({error:void 0}),await i()}catch(g){g instanceof Error?f({error:g.message}):f({error:"Failed to deploy!"})}};O.useEffect(()=>{s==="saved"&&r!==u.prevDocVersion&&f({prevDocVersion:r})},[u.prevDocVersion,r,s,f]);const E=s!=="saved"||e==="deployed"||e==="deploying",y=o==="document-sync"?Fv.deploying:Fv[e];let v="";e==="deploy"&&(v=s==="saved"?"bg-primary":"bg-focus");const m=`${v} ${y}`;return!t||n?null:d.jsxs("button",{"data-testid":"cfb__deploy-button",className:`flex items-center justify-center rounded border px-1.5 py-0.5
67
+ text-xs font-medium transition-colors ${m}`,disabled:E,onClick:h,children:[A(p),d.jsx(Zn,{placement:"right",trigger:d.jsx("span",{className:"flex items-center justify-center pl-1",role:"tooltip",tabIndex:0,children:e==="error"?d.jsx(re,{tag:"circle-exclamation"}):d.jsx(d.Fragment,{})}),children:e==="error"?A(N.MORE_INFO_DEPLOY_ERROR,{message:u.error}):A(N.MORE_INFO_DEPLOY)})]})},qb=()=>{const e=Q(t=>t.backButtonHref);return e?d.jsxs("a",{href:e,children:[d.jsx("span",{className:"sr-only",children:A(N.NAVIGATE_BACK)}),d.jsx(re,{tag:"arrow-left",className:"text-negative",size:"lg"})]}):null},Jb=()=>{const e=Q(i=>i.showDeployedHistory),t=Q(i=>i.httpError==="document-sync"),{cancelDetachedMode:n,setShowDeployedHistory:r}=Te(),o=()=>{e?n():r(!0)},s=e?"text-background bg-foreground":"text-foreground bg-foreground/10";return d.jsx(Zn,{placement:"top",trigger:d.jsxs("button",{className:`flex items-center justify-center rounded border border-transparent p-1 transition-colors ${s}`,disabled:t,onClick:o,type:"button",children:[d.jsx("span",{className:"sr-only",children:A(N.VERSION_HISTORY)}),d.jsx(re,{tag:"clock-rotate-left",size:"xs"})]}),children:A(N.VERSION_HISTORY)})},Zb=({isDisabled:e,isSelected:t,itemIndex:n,onClick:r,onSelected:o,relativeTimeSince:s,version:i})=>{var f,p;const l=O.useRef(null),a=h=>{o(h)},c=()=>{t||(a(n),r(n))},u=h=>{h.preventDefault();const{key:E}=h;(E==="Enter"||E===" ")&&r(n),E==="ArrowUp"&&a(n-1),E==="ArrowDown"&&a(n+1)};return t&&((f=l.current)==null||f.focus({preventScroll:!0}),(p=l.current)==null||p.scrollIntoView({block:"nearest"})),d.jsx("li",{className:`border-l-2 transition-colors ${t?"border-l-primary/50 bg-primary/10":"border-l-transparent bg-background hover:bg-primary/5"}`,role:"presentation",children:d.jsxs("button",{"aria-selected":t?"true":"false",className:`flex w-full items-start gap-x-2 p-2 pr-4 ${e?"text-disabled":""}`,disabled:e,onClick:c,onKeyDown:u,type:"button",tabIndex:t?0:-1,ref:l,children:[d.jsx(re,{className:`p-1 ${t?"text-primary":"text-foreground/30"}`,tag:"dot-circle"}),d.jsxs("div",{className:"flex flex-col items-start justify-center",children:[d.jsx("h3",{className:"text-xs font-medium",children:A(N.VERSION_LIST_ITEM,{number:i})}),d.jsx("p",{className:"text-xxs",children:d.jsx("time",{children:s})})]})]})})},eD=200,jv=Ne(),tD=()=>{const e=Q(m=>m.deployedVersionsList),t=Q(m=>m.saveFlowStatus),n=Q(m=>m.showDeployedHistory),{cancelDetachedMode:r,getDeployedVersionsList:o,migrateAndLoadDeployedFlow:s}=Te();Tv({onKeyPress:n?r:void 0});const i=O.useRef(),[l,a]=O.useState("loading"),[c,u]=O.useState(null);c!==null&&!n&&u(null);const f=O.useCallback(m=>{m>=0&&m<=e.length-1?u(m):u(null)},[e.length]),p=O.useCallback(m=>{var S;const g=(S=i.current)==null?void 0:S[m];g?(jv.info("load version",g.id),s(g)):jv.error("version not found")},[s]),h=O.useCallback(()=>{a("loading"),o({pageSize:eD}).then(m=>{a("loaded"),i.current=m}).catch(()=>{a("error"),i.current=void 0})},[o]);O.useLayoutEffect(()=>{n&&h()},[h,n]);const E=l==="error",y=e.length>0,v=t==="saved";return n?d.jsxs("div",{"data-testid":"cfb__deployed-versions-sidebar",className:"flex h-full flex-col py-3",children:[d.jsxs("section",{className:"flex items-center justify-between self-stretch px-4 pb-1",children:[d.jsxs("h2",{className:"flex items-center gap-1 text-tiny font-bold uppercase leading-none tracking-wide",children:[d.jsx(re,{className:"text-xs text-foreground/50",tag:"clock-rotate-left"}),A(N.VERSION_HISTORY)]}),d.jsxs("button",{className:"flex items-center justify-center px-0.5",onClick:r,type:"button",children:[d.jsx("span",{className:"sr-only",children:A(N.CLOSE)}),d.jsx(re,{tag:"xmark"})]})]}),d.jsxs("div",{className:`${y?"overflow-y-auto":"h-full"}`,children:[l!=="loaded"?d.jsxs("div",{className:`flex flex-col justify-center gap-y-4 p-4 text-sm leading-none tracking-wide text-foreground/50 ${y?"":"h-full"}`,children:[d.jsxs("div",{className:"flex flex-col items-center justify-center gap-y-2 gap-x-2",children:[E?d.jsx(re,{className:"text-negative",tag:"circle-exclamation"}):d.jsx(re,{className:"animate-spin",tag:"arrows-rotate"}),d.jsx("p",{"aria-live":E?"assertive":"polite",className:`${E?"text-negative":"font-bold uppercase text-foreground/50"}`,role:E?"alert":"status",children:A(E?N.ERROR_FETCHING_DEPLOYED_VERSIONS:N.STATUS_LOADING)})]}),E?d.jsx("div",{className:"flex w-full items-center justify-center",children:d.jsx("button",{className:"rounded border border-primary/50 bg-primary/10 px-3 py-1.5 text-sm font-bold leading-tight tracking-wider text-primary",onClick:h,type:"button",children:A(N.RESYNC)})}):null]}):null,!y&&l==="loaded"?d.jsx("div",{className:`flex h-full flex-col justify-center gap-y-4 p-4 text-sm leading-none tracking-wide text-foreground/50
68
+ `,children:d.jsxs("div",{className:"flex flex-col items-center justify-center gap-y-2 gap-x-2",children:[d.jsx(re,{tag:"circle-exclamation"}),Ua(N.NO_DEPLOYED_VERSIONS)]})}):null,y?d.jsx("ol",{children:e.map((m,g)=>d.jsx(Zb,{itemIndex:g,isDisabled:!v,isSelected:g===c,onClick:p,onSelected:f,relativeTimeSince:m.relativeTimeSince,version:m.version},m.id))}):null]})]}):null},nD=()=>{const{getFlagNames:e}=Uv();return d.jsxs("div",{className:"rounded-sm border border-gray-200 p-2",children:[d.jsx("h3",{className:"w-full",children:"Feature Flags"}),d.jsx("div",{className:"flex flex-col gap-y-2 py-2",children:e().map(t=>d.jsx(rD,{flagName:t},t))})]})},rD=({flagName:e})=>{const{toggleFlag:t}=Uv(),r=Ir(o=>o[e])?"translate-x-5 bg-positive":"translate-x-0 bg-negative";return d.jsxs("label",{className:"flex cursor-pointer items-center",children:[d.jsxs("div",{className:"relative",children:[d.jsx("input",{type:"checkbox",className:"sr-only",onChange:()=>t(e)}),d.jsx("div",{className:"h-5 w-10 rounded-full bg-secondary/20",children:d.jsx("div",{className:`absolute left-1 top-1 h-3 w-3 rounded-full transition ${r}`})})]}),d.jsx("p",{className:"ml-3 text-sm font-medium",children:e})]})},oD=()=>{const[e,t]=O.useState(!1),n=()=>{t(r=>!r)};return d.jsx(Zn,{open:e,onOpenChange:t,placement:"bottom",role:"dialog",trigger:d.jsxs("button",{className:"group flex items-center justify-center gap-x-2 text-foreground/50 transition-colors hover:text-foreground/70",onClick:n,children:[d.jsx(re,{className:"text-foreground/40 transition-colors group-hover:text-foreground/50",size:"xl",tag:"circle-question"}),d.jsxs("span",{className:"text-xs font-semibold",children:[A(N.HELP),d.jsx("span",{className:"sr-only",children:A(N.MORE_INFO_TESTING_YOUR_FLOW)})]})]}),children:d.jsxs("section",{className:"p-2",children:[d.jsx("h2",{className:"mb-4 text-2xl font-semibold",children:"Testing Your Call Flow"}),d.jsxs("div",{className:"text-sm",children:[d.jsx("p",{children:"To test the current working version (draft) of your Call Flow, follow these steps:"}),d.jsxs("ol",{className:"my-4 list-inside list-decimal",children:[d.jsxs("li",{className:"mb-2 list-item",children:["Go to the settings tab of the purchased phone number you want to use for testing:  ",d.jsx("a",{className:"underline hover:text-background/80",href:"/phone_numbers",target:"_blank",rel:"noopener noreferrer",children:"Purchased Phone Numbers"})]}),d.jsxs("li",{className:"mb-2",children:["Choose the appropriate Call Flow for handling your calls:  ",d.jsx("a",{className:"underline hover:text-background/80",href:"/call_flows",target:"_blank",rel:"noopener noreferrer",children:"Call Flows"})]}),d.jsx("li",{className:"mb-2",children:"Select the working version (draft) of the chosen Call Flow."}),d.jsx("li",{children:"When you make a call to the number, it should now execute the working version of your Call Flow upon answering."})]}),d.jsx("p",{className:"mt-4 mb-2",children:"In an upcoming update, you will be able to test your selected Call Flow directly from the Call Flow Builder, eliminating the need to manually associate the Call Flow with your number."})]})]})})},sD=(e,t)=>({label:A(Fa[e].label),nodes:Object.entries(Fa[e].nodes).reduce((n,[r,o])=>(((typeof o.active=="boolean"?o.active:o.active[pA])||t)&&n.push({deprecated:!!o.deprecated,title:A(o.label),type:r}),n),[]).sort((n,r)=>n.title.localeCompare(r.title))}),Vv=Ne(),iD=["action","forwardTo","recording","input","decision"],lD=()=>{const e=Ir(i=>i.showAllNodes),t=Q(i=>i.isCanvasInteractive),{addNode:n,setDragNodeType:r}=Te(),o=O.useCallback(i=>{i.preventDefault();const{nodeType:l}=i.currentTarget.dataset;l?n({nodeType:l}):Vv.error("No nodeType found on click event")},[n]),s=O.useCallback(i=>{i.preventDefault();const{nodeType:l}=i.currentTarget.dataset;l?r(l):Vv.error("No nodeType found on drag event")},[r]);return d.jsx("ul",{className:"py-3 px-2",id:"sidebar-node-list",children:iD.map(i=>d.jsx("li",{children:d.jsx(aD,{enableNodeButtons:t,group:i,handleOnClick:o,handleDragStart:s,showAllNodes:e})},i))})},aD=({enableNodeButtons:e=!0,group:t,handleOnClick:n,handleDragStart:r,showAllNodes:o})=>{const s=sD(t,o),i=`ngm-heading-${wA(s.label)}`;return d.jsxs(d.Fragment,{children:[d.jsx("h2",{className:"px-2 pb-1 text-tiny font-bold uppercase tracking-wide text-foreground/50",id:i,children:s.label}),d.jsx("ul",{"aria-labelledby":i,className:"flex flex-1 flex-col gap-y-1 pb-2",children:s.nodes.map(l=>d.jsx("li",{children:d.jsxs("button",{className:`flex w-full items-start gap-2 rounded-lg border border-dashed border-transparent bg-primary/5 p-2 transition-colors
69
+ hover:border-primary hover:bg-primary/20 enabled:hover:shadow-md`,"data-node-type":l.type,disabled:!e,draggable:e,onClick:e?n:void 0,onDragStart:e?r:void 0,children:[d.jsx(re,{tag:"circle-small",className:"text-primary"}),d.jsxs("span",{className:"text-left text-xs font-medium line-clamp-2",children:[l.title,l.deprecated&&d.jsxs("span",{className:"text-foreground/70",children:[" ",A(N.DEPRECATED)]})]})]})},l.type))})]})},cD=()=>{const{addToast:e,restoreDeployedFlow:t}=Te(),n=Q(o=>o.workingFlowCopy),r=()=>{t(),e({message:A(N.VERSION_RESTORED),status:"success"})};return n?d.jsx("button",{className:`flex items-center justify-center rounded border bg-primary px-1.5 py-0.5 text-xs font-medium
70
+ text-background transition-colors hover:bg-primary/90`,onClick:r,children:A(N.RESTORE)}):null},uD={"awaiting-save":N.STATUS_SAVING,"document-sync":N.STATUS_LOCKED,error:N.STATUS_ERROR,initial:N.STATUS_LOADING,saved:N.STATUS_SAVED,saving:N.STATUS_SAVING},$v=e=>(e.preventDefault(),e.returnValue=""),Hv=(e,t)=>e==="document-sync"?e:t,dD=()=>{const e=Q(p=>p.detachedMode),t=Q(p=>p.saveFlowStatus),n=Q(p=>p.httpError),[r,o]=O.useState(!0),[s,i]=O.useState(Hv(n,t)),l=uD[s],a=t==="error"||n,c=Hv(n,t),u=O.useRef(!1);O.useEffect(()=>{c==="initial"&&!u.current?(u.current=!0,i(c),o(!1),setTimeout(()=>{o(!0)},yA)):c!=="initial"&&r&&(u.current=!1,i(c))},[r,c]),O.useEffect(()=>{if(!(t==="saved"||n))return addEventListener("beforeunload",$v,{capture:!0}),()=>{removeEventListener("beforeunload",$v,{capture:!0})}},[n,t]);let f="";switch(!0){case a:f="px-1.5 py-0.5 bg-negative/20 text-negative";break;case s==="saved":f="text-foreground/50";break;default:f="px-1.5 py-0.5 bg-foreground/30 text-background"}return e?null:d.jsx("div",{"aria-live":a?"assertive":"polite","data-testid":"cfb__status",className:"flex",role:a?"alert":"status",children:d.jsxs("div",{className:`flex gap-x-1 rounded text-xxs ${f}`,children:[d.jsx("p",{children:l==="STATUS_SAVED"?d.jsx(fD,{}):A(l)}),a&&d.jsx(Zn,{placement:"bottom",trigger:d.jsxs("div",{role:"tooltip",tabIndex:0,children:[d.jsx("span",{className:"sr-only",children:A(N.MORE_INFO_STATUS_ERROR)}),d.jsx(re,{tag:"circle-exclamation"})]}),children:A(n==="document-sync"?N.INFO_STATUS_ERROR_OUT_OF_SYNC:N.INFO_STATUS_ERROR)})]})})},fD=()=>{const e=Q(s=>s.documentLastUpdated),t=O.useCallback((s,...i)=>Q0(ov(),{numeric:"always",style:"narrow"})(s,{excludeUnits:{second:!0},...i}),[]),n=e?t(e):void 0,[r,o]=O.useState(n);return O.useEffect(()=>{if(!e)return;const s=setInterval(()=>{o(t(e))},1e3);return()=>clearInterval(s)},[e,t]),d.jsxs(d.Fragment,{children:[A(N.SAVED)," ",d.jsx("time",{children:r})]})},pD=()=>{const e=Ir(i=>i.showDevOptions),{exportStoreData:t}=Te(),n=Q(i=>i.flowTitle),r=Q(i=>i.showDeployedHistory),o=O.useRef(null),s=i=>{i.preventDefault(),o.current&&o.current.showModal()};return d.jsxs(d.Fragment,{children:[d.jsxs("section",{className:"hidden h-full w-1/6 min-w-[160px] shrink-0 flex-col bg-background text-foreground sm:flex",children:[d.jsxs("nav",{className:"flex shrink-0 items-center justify-between px-3 py-2",children:[d.jsx(qb,{}),e&&d.jsx("button",{className:"rounded bg-positive p-1 px-2 text-xs text-background",onClick:s,children:"Dev Options"})]}),d.jsx("section",{className:"px-2 py-2",children:d.jsxs("div",{className:"divide-y divide-foreground/10 rounded-lg border border-foreground/10",children:[d.jsx("h1",{className:"block w-full shrink-0 p-2 text-sm font-semibold leading-tight line-clamp-2",children:n||d.jsx(d.Fragment,{children:" "})}),d.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-1 gap-y-2 p-2",children:[d.jsx("div",{className:"flex-1",children:d.jsx(dD,{})}),d.jsxs("menu",{className:"flex items-center justify-center gap-x-1",children:[r?d.jsx(cD,{}):d.jsx(Qb,{}),d.jsx(Jb,{})]})]})]})}),d.jsxs("section",{className:"h-full overflow-y-auto",children:[r?null:d.jsx(lD,{}),d.jsx(tD,{})]}),d.jsx("section",{className:"flex flex-col items-start justify-center gap-y-5 px-2 pt-3 pb-4",children:d.jsxs("div",{className:"flex flex-col items-start justify-center gap-y-3 px-2",children:[d.jsx(Kb,{}),d.jsx(oD,{})]})})]}),e&&d.jsx("dialog",{className:"z-50 my-10 rounded-lg border border-foreground/10 bg-background text-foreground",ref:o,children:d.jsx("form",{children:d.jsxs("fieldset",{children:[d.jsxs("legend",{className:"flex w-full justify-between pb-2",children:[d.jsx("h1",{className:"text-2xl leading-10",children:"Dev Options"}),d.jsxs("button",{className:"p-1 pt-0 font-semibold",formMethod:"dialog",children:[d.jsx("span",{className:"sr-only",children:"Close"}),d.jsx(re,{tag:"xmark",size:"lg"})]})]}),d.jsxs("div",{className:"mb-1 rounded-sm border border-gray-200 p-2",children:[d.jsx("h3",{className:"w-full",children:"Flow Data"}),d.jsx("div",{className:"flex flex-row gap-x-2 py-2",children:d.jsx("div",{className:"flex items-center",children:d.jsx("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:t,children:"View JSON File"})})})]}),d.jsx(nD,{})]})})})]})},hD=()=>{const e=O.useRef(null),[t,n]=O.useState(),[r,o]=O.useState(null);return O.useLayoutEffect(()=>(e.current=new ResizeObserver(([s])=>n(s)),r&&e.current.observe(r),()=>{var s;return(s=e.current)==null?void 0:s.disconnect()}),[r]),{observerEntry:t,setTarget:o}},mD=({rootAppHeight:e,rootAppWidth:t})=>{Q.setState({rootAppHeight:e,rootAppWidth:t})},gD=()=>{const{observerEntry:e,setTarget:t}=hD();return O.useEffect(()=>{e&&(Ne().log("resized",{rootAppHeight:e.contentRect.height,rootAppWidth:e.contentRect.width}),mD({rootAppHeight:e.contentRect.height,rootAppWidth:e.contentRect.width}))},[e]),{rootTarget:t}};function ED(){Ne().debug("Hello World!");const{rootTarget:e}=gD(),t=Q(o=>o.colorMode)??"",n=Q(o=>o.httpError),r=n!==void 0&&n!=="document-sync";return d.jsx(d.Fragment,{children:d.jsx("div",{className:`${t} flex h-full w-full bg-backgroundAlt text-foreground`,ref:e,children:r?d.jsx(G2,{errorType:n}):d.jsxs(d.Fragment,{children:[d.jsx(pD,{}),d.jsx(xb,{}),d.jsx(wb,{}),d.jsxs(tf,{children:[d.jsx(wL,{}),d.jsxs(RL,{children:[d.jsxs(Zs,{className:"z-50 m-0 mx-auto mt-2.5 flex w-full min-w-[320px] max-w-lg flex-col items-center gap-y-2 px-4",position:"top-center",children:[d.jsx(pb,{}),d.jsx(yb,{})]}),d.jsx(Fb,{}),d.jsx(bb,{}),d.jsx(fb,{}),d.jsx(OL,{})]})]})]})})})}const yD='@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")}@font-face{font-family:SWInter;font-style:normal;font-weight:500;font-display:swap;src:url(//cdn.signalwire.com/fonts/inter/Inter-Medium.woff2) format("woff2"),url(//cdn.signalwire.com/fonts/inter/Inter-Medium.woff) format("woff")}',Bv=Ne(),vD=e=>{if(!e||!e.getFlowURL||!e.updateFlowURL)throw new TypeError("Invalid or missing required params")};function _D(e){vD(e);const{backButtonHref:t,deployFlowURL:n,getAiAgentsURL:r=`${window.location.origin}${T_}`,getFlowURL:o,getSwmlScriptsURL:s,rootElementId:i="sw-cfb-root",styleHref:l="https://cdn.swire.io/npm/@signalwire/cfb@dev/dist/style.css",updateFlowURL:a,voicesURL:c="https://cdn.signalwire.com/npm/@signalwire/cfb@dev/dist/voices.json"}=e;Vf.getState().actions.init({voicesURL:c}).catch(p=>{Bv.error("Error initializing voices",p)});const u=document.getElementById(i);if(Q.setState({backButtonHref:t,deployFlowURL:n,getFlowURL:o,rootElement:u,rootElementId:i,updateFlowURL:a}),r&&en.getState().actions.init({getAiAgentsURL:r}),s&&_n.getState().actions.init({getSwmlScriptsURL:s}),w2().catch(p=>{Bv.error("Error initializing i18n",p)}),zb(),!u)throw new Error(`Id: '${i}' not found in the DOM`);u.attachShadow({mode:"open"}),u.shadowRoot&&oc.createRoot(u.shadowRoot).render(d.jsxs(O.StrictMode,{children:[d.jsx("link",{type:"text/css",rel:"stylesheet",href:l}),d.jsx(ED,{})]}));const f=document.createElement("style");document.head.appendChild(f),f.appendChild(document.createTextNode(yD))}Fr.main=_D,Object.defineProperty(Fr,Symbol.toStringTag,{value:"Module"})});