@signalwire/cfb 0.0.13 → 0.0.14-dev.202407231304.b07fa9b.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 +19 -19
- package/package.json +3 -3
package/dist/main.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
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.
|
|
2
|
+
* Visual Builder v0.0.13 [b07fa9b] (https://signalwire.com)
|
|
3
3
|
* Copyright 2018-2024 SignalWire.
|
|
4
4
|
*/
|
|
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:{}},
|
|
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:{}},re={};/**
|
|
6
6
|
* @license React
|
|
7
7
|
* react.production.min.js
|
|
8
8
|
*
|
|
@@ -10,7 +10,7 @@ function qo(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 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};
|
|
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};function lp(){throw Error("act(...) is not supported in production builds of React.")}re.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}},re.Component=jr,re.Fragment=qv,re.Profiler=Zv,re.PureComponent=za,re.StrictMode=Jv,re.Suspense=r_,re.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=u_,re.act=lp,re.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}},re.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},re.createElement=sp,re.createFactory=function(e){var t=sp.bind(null,e);return t.type=e,t},re.createRef=function(){return{current:null}},re.forwardRef=function(e){return{$$typeof:n_,render:e}},re.isValidElement=Ya,re.lazy=function(e){return{$$typeof:s_,_payload:{_status:-1,_result:e},_init:c_}},re.memo=function(e,t){return{$$typeof:o_,type:e,compare:t===void 0?null:t}},re.startTransition=function(e){var t=Ci.transition;Ci.transition={};try{e()}finally{Ci.transition=t}},re.unstable_act=lp,re.useCallback=function(e,t){return Ke.current.useCallback(e,t)},re.useContext=function(e){return Ke.current.useContext(e)},re.useDebugValue=function(){},re.useDeferredValue=function(e){return Ke.current.useDeferredValue(e)},re.useEffect=function(e,t){return Ke.current.useEffect(e,t)},re.useId=function(){return Ke.current.useId()},re.useImperativeHandle=function(e,t,n){return Ke.current.useImperativeHandle(e,t,n)},re.useInsertionEffect=function(e,t){return Ke.current.useInsertionEffect(e,t)},re.useLayoutEffect=function(e,t){return Ke.current.useLayoutEffect(e,t)},re.useMemo=function(e,t){return Ke.current.useMemo(e,t)},re.useReducer=function(e,t,n){return Ke.current.useReducer(e,t,n)},re.useRef=function(e){return Ke.current.useRef(e)},re.useState=function(e){return Ke.current.useState(e)},re.useSyncExternalStore=function(e,t,n){return Ke.current.useSyncExternalStore(e,t,n)},re.useTransition=function(){return Ke.current.useTransition()},re.version="18.3.1",Qf.exports=re;var O=Qf.exports;const H=Ba(O),ap=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 qo(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 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_="/api/swml_scripts",I_=w_(O_(),1),C_=()=>new Date().toISOString(),Zo=I_.default.getLogger("signalwire"),L_=Zo.methodFactory;Zo.methodFactory=(e,t,n)=>{let r=L_(e,t,n);return function(...o){o.unshift(C_(),"-"),r(...o)}};var b_=Zo.getLevel();Zo.setLevel(b_);var Ne=()=>Zo,D_=(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(),k_=e=>typeof e=="object"&&e!==null&&"id"in e&&"type"in e&&"data"in e&&"position"in e,P_=e=>{if(!k_(e))throw qa.error("nodeToDBShape: Invalid node",e),new Error;return{data:e.data,id:e.id,position:e.position,type:e.type}},M_=e=>typeof e=="object"&&e!==null&&"id"in e&&"source"in e&&"sourceHandle"in e&&"target"in e&&"targetHandle"in e,U_=e=>{if(!M_(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),F_=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=()=>D_(),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=F_(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]}},j_=/\bmale\b/i,V_=/\bfemale\b/i,$_=e=>{if(e){if(V_.test(e))return"female";if(j_.test(e))return"male"}},dp=(e,t)=>{if(typeof e=="object"&&!Array.isArray(e)){t.language&&(e.say_language=t.language);let n=$_(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},H_={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 H_[e.__type](e.node)}catch(t){throw Ne().error("Unknown Verb",e),t}},B_="1.0.0",z_=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:B_}},W_=class Kv extends Error{constructor(t,n){super(n),this.code=t,this.message=n,Qa(this,"name","AuthError"),Object.setPrototypeOf(this,Kv.prototype)}},G_=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 Y_(e,t){let n=await fetch(e,t);if(!n.ok){if(n.status===401)throw new W_(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 G_(n.status,o,r)}try{n.parsedBody??(n.parsedBody=await n.json())}catch{}return n}var K_=({timeout:e=3e4,...t},n=Y_)=>async(r,o)=>{let s={...o!=null&&o.body?{"Content-Type":"application/json"}:{},...t.headers,...o==null?void 0:o.headers},i=Q_({...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)}},X_=e=>typeof e=="string"?e:JSON.stringify(e),Q_=e=>Object.entries(e).reduce((t,[n,r])=>n==="body"?{...t,body:X_(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=K_(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(P_),edges:r.edges.map(U_)},relayml:z_({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)}],J_=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=J_(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={};/**
|
|
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 cp(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=cp,Ti.jsxs=cp,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_(Xa(n,"default",{value:e,enumerable:!0}),e)),Qa=(e,t,n)=>x_(e,typeof t!="symbol"?t+"":t,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_="/api/swml_scripts",I_=w_(O_()),C_=()=>new Date().toISOString(),Zo=I_.default.getLogger("signalwire"),L_=Zo.methodFactory;Zo.methodFactory=(e,t,n)=>{let r=L_(e,t,n);return function(...o){o.unshift(C_(),"-"),r(...o)}};var b_=Zo.getLevel();Zo.setLevel(b_);var Ne=()=>Zo,D_=(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(),k_=e=>typeof e=="object"&&e!==null&&"id"in e&&"type"in e&&"data"in e&&"position"in e,P_=e=>{if(!k_(e))throw qa.error("nodeToDBShape: Invalid node",e),new Error;return{data:e.data,id:e.id,position:e.position,type:e.type}},M_=e=>typeof e=="object"&&e!==null&&"id"in e&&"source"in e&&"sourceHandle"in e&&"target"in e&&"targetHandle"in e,U_=e=>{if(!M_(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}},up=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),F_=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=()=>D_(),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}},dp=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=dp(o),l=Vr(r),a=F_(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:dp(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]}},j_=/\bmale\b/i,V_=/\bfemale\b/i,$_=e=>{if(e){if(V_.test(e))return"female";if(j_.test(e))return"male"}},fp=(e,t)=>{if(typeof e=="object"&&!Array.isArray(e)){t.language&&(e.say_language=t.language);let n=$_(t.gender);n&&(e.say_gender=n),t.voice&&(e.say_voice=t.voice)}return e},pp=(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},H_={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=fp(pp({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=fp(pp({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=up(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 H_[e.__type](e.node)}catch(t){throw Ne().error("Unknown Verb",e),t}},B_="1.0.0",z_=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=up(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:B_}},W_=class Kv extends Error{constructor(t,n){super(n),this.code=t,this.message=n,Qa(this,"name","AuthError"),Object.setPrototypeOf(this,Kv.prototype)}},G_=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 Y_(e,t){let n=await fetch(e,t);if(!n.ok){if(n.status===401)throw new W_(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 G_(n.status,o,r)}try{n.parsedBody??(n.parsedBody=await n.json())}catch{}return n}var K_=({timeout:e=3e4,...t},n=Y_)=>async(r,o)=>{let s={...o!=null&&o.body?{"Content-Type":"application/json"}:{},...t.headers,...o==null?void 0:o.headers},i=Q_({...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)}},X_=e=>typeof e=="string"?e:JSON.stringify(e),Q_=e=>Object.entries(e).reduce((t,[n,r])=>n==="body"?{...t,body:X_(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=K_(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(P_),edges:r.edges.map(U_)},relayml:z_({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)}],J_=e=>{let t=rc.findIndex(n=>n.from===e);return t>=0?rc.slice(t):rc},hp=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=J_(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={},mp={exports:{}},dt={},gp={exports:{}},Ep={};/**
|
|
22
22
|
* @license React
|
|
23
23
|
* scheduler.production.min.js
|
|
24
24
|
*
|
|
@@ -26,7 +26,7 @@ function qo(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(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}}}})(
|
|
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}}}})(Ep),gp.exports=Ep;var Z_=gp.exports;/**
|
|
30
30
|
* @license React
|
|
31
31
|
* react-dom.production.min.js
|
|
32
32
|
*
|
|
@@ -34,14 +34,14 @@ function qo(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
|
|
37
|
+
*/var yp=O,ft=Z_;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 vp=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++)vp.add(t[e])}var rn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),sc=Object.prototype.hasOwnProperty,eS=/^[: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]*$/,_p={},Sp={};function tS(e){return sc.call(Sp,e)?!0:sc.call(_p,e)?!1:eS.test(e)?Sp[e]=!0:(_p[e]=!0,!1)}function nS(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 rS(e,t,n,r){if(t===null||typeof t>"u"||nS(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")&&(rS(t,n,o,r)&&(n=null),r||o===null?tS(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=yp.__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"),xp=Symbol.for("react.provider"),Rp=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"),Np=Symbol.for("react.offscreen"),wp=Symbol.iterator;function ts(e){return e===null||typeof e!="object"?null:(e=wp&&e[wp]||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
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
39
|
`),s=r.stack.split(`
|
|
40
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 oS(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 sS(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 iS(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=iS(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},lS=["Webkit","ms","Moz","O"];Object.keys(ss).forEach(function(e){lS.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 aS=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(aS[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 cS(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,uS={onError:function(e){as=!0,Mi=e}};function dS(e,t,n,r,o,s,i,l,a){as=!1,Mi=null,cS.apply(uS,arguments)}function fS(e,t,n,r,o,s,i,l,a){if(dS.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 pS(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=pS(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,hS=ft.unstable_shouldYield,mS=ft.unstable_requestPaint,we=ft.unstable_now,gS=ft.unstable_getCurrentPriorityLevel,bc=ft.unstable_ImmediatePriority,Xp=ft.unstable_UserBlockingPriority,Fi=ft.unstable_NormalPriority,ES=ft.unstable_LowPriority,Qp=ft.unstable_IdlePriority,ji=null,zt=null;function yS(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:SS,vS=Math.log,_S=Math.LN2;function SS(e){return e>>>=0,e===0?32:31-(vS(e)/_S|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 xS(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 RS(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]=xS(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 NS(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=[],wS="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 OS(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 TS(){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,TS)))}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 AS(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 IS(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(OS(o,e,t,n,r))r.stopPropagation();else if(rh(e,r),t&4&&-1<wS.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(gS()){case bc:return 1;case Xp:return 4;case Fi:case ES: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}),CS=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),LS=ve({},Qi,{dataTransfer:0}),bS=pt(LS),DS=ve({},gs,{relatedTarget:0}),zc=pt(DS),kS=ve({},Kr,{animationName:0,elapsedTime:0,pseudoElement:0}),PS=pt(kS),MS=ve({},Kr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),US=pt(MS),FS=ve({},Kr,{data:0}),uh=pt(FS),jS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},VS={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"},$S={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function HS(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=$S[e])?!!t[e]:!1}function Wc(){return HS}var BS=ve({},gs,{key:function(e){if(e.key){var t=jS[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"?VS[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}}),zS=pt(BS),WS=ve({},Qi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),dh=pt(WS),GS=ve({},gs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Wc}),YS=pt(GS),KS=ve({},Kr,{propertyName:0,elapsedTime:0,pseudoElement:0}),XS=pt(KS),QS=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(QS),JS=[9,13,27,32],Gc=rn&&"CompositionEvent"in window,ys=null;rn&&"documentMode"in document&&(ys=document.documentMode);var ZS=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 JS.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 ex(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 tx(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 nx={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"?!!nx[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 rx(e){Mh(e,0)}function qi(e){var t=eo(e);if(Op(t))return e}function ox(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(rx,t)}}function sx(e,t,n){e==="focusin"?(Sh(),vs=t,_s=n,vs.attachEvent("onpropertychange",xh)):e==="focusout"&&Sh()}function ix(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return qi(_s)}function lx(e,t){if(e==="click")return qi(t)}function ax(e,t){if(e==="input"||e==="change")return qi(t)}function cx(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Dt=typeof Object.is=="function"?Object.is:cx;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 ux(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 dx=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],fx=eu.toLowerCase(),px=eu[0].toUpperCase()+eu.slice(1);In(fx,"on"+px)}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(" "),hx=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,fS(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"&&(hx.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=AS;break;case 4:o=IS;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=zS;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=bS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=YS;break;case Ih:case Ch:case Lh:h=PS;break;case bh:h=XS;break;case"scroll":h=CS;break;case"wheel":h=qS;break;case"copy":case"cut":case"paste":h=US;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=ox;else if(Eh(p))if(vh)x=ax;else{x=ix;var R=sx}else(h=p.nodeName)&&h.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(x=lx);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(dx)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=ZS?ex(e,n):tx(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 mx=/\r\n?/g,gx=/\u0000|\uFFFD/g;function jh(e){return(typeof e=="string"?e:""+e).replace(mx,`
|
|
42
|
-
`).replace(gx,"")}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,Ex=typeof clearTimeout=="function"?clearTimeout:void 0,Vh=typeof Promise=="function"?Promise:void 0,yx=typeof queueMicrotask=="function"?queueMicrotask:typeof Vh<"u"?function(e){return Vh.resolve(null).then(e).catch(vx)}:iu;function vx(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,_x="__reactListeners$"+Zr,Sx="__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,sS(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 xx(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 Rx=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,Nx=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?Ax:Ix,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=Cx,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=Tx.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 wx(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 Ox(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 Tx(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},Ax={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=Ox.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=wx.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=Nx++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Ix={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},Cx={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+=oS(r),r=r.return;while(r);var o=n}catch(s){o=`
|
|
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 oS(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 Rp:return(e.displayName||"Context")+".Consumer";case xp: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 sS(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 Op(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function iS(e){var t=Op(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=iS(e))}function Tp(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Op(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 Ap(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 Ip(e,t){t=t.checked,t!=null&&ac(e,"checked",t,!1)}function _c(e,t){Ip(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 Cp(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 Lp(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 bp(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 Dp(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function kp(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"?kp(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Pi,Pp=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},lS=["Webkit","ms","Moz","O"];Object.keys(ss).forEach(function(e){lS.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ss[t]=ss[e]})});function Mp(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 Up(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=Mp(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var aS=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(aS[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 Fp(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 jp(e){Wr?Gr?Gr.push(e):Gr=[e]:Wr=e}function Vp(){if(Wr){var e=Wr,t=Gr;if(Gr=Wr=null,Fp(e),t)for(e=0;e<t.length;e++)Fp(t[e])}}function $p(e,t){return e(t)}function Hp(){}var Ic=!1;function Bp(e,t,n){if(Ic)return e(t,n);Ic=!0;try{return $p(e,t,n)}finally{Ic=!1,(Wr!==null||Gr!==null)&&(Hp(),Vp())}}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 cS(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,uS={onError:function(e){as=!0,Mi=e}};function dS(e,t,n,r,o,s,i,l,a){as=!1,Mi=null,cS.apply(uS,arguments)}function fS(e,t,n,r,o,s,i,l,a){if(dS.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 zp(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 Wp(e){if(sr(e)!==e)throw Error(G(188))}function pS(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 Wp(o),e;if(s===r)return Wp(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 Gp(e){return e=pS(e),e!==null?Yp(e):null}function Yp(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Yp(e);if(t!==null)return t;e=e.sibling}return null}var Kp=ft.unstable_scheduleCallback,Xp=ft.unstable_cancelCallback,hS=ft.unstable_shouldYield,mS=ft.unstable_requestPaint,we=ft.unstable_now,gS=ft.unstable_getCurrentPriorityLevel,bc=ft.unstable_ImmediatePriority,Qp=ft.unstable_UserBlockingPriority,Fi=ft.unstable_NormalPriority,ES=ft.unstable_LowPriority,qp=ft.unstable_IdlePriority,ji=null,zt=null;function yS(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:SS,vS=Math.log,_S=Math.LN2;function SS(e){return e>>>=0,e===0?32:31-(vS(e)/_S|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 xS(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 RS(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]=xS(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 Jp(){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 NS(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 Zp(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var eh,Mc,th,nh,rh,Uc=!1,Bi=[],Nn=null,wn=null,On=null,ds=new Map,fs=new Map,Tn=[],wS="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 oh(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 OS(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 sh(e){var t=ir(e.target);if(t!==null){var n=sr(t);if(n!==null){if(t=n.tag,t===13){if(t=zp(n),t!==null){e.blockedOn=t,rh(e.priority,function(){th(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 ih(e,t,n){zi(e)&&n.delete(t)}function TS(){Uc=!1,Nn!==null&&zi(Nn)&&(Nn=null),wn!==null&&zi(wn)&&(wn=null),On!==null&&zi(On)&&(On=null),ds.forEach(ih),fs.forEach(ih)}function hs(e,t){e.blockedOn===t&&(e.blockedOn=null,Uc||(Uc=!0,ft.unstable_scheduleCallback(ft.unstable_NormalPriority,TS)))}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);)sh(n),n.blockedOn===null&&Tn.shift()}var Yr=on.ReactCurrentBatchConfig,Wi=!0;function AS(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 IS(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),oh(e,r);else if(OS(o,e,t,n,r))r.stopPropagation();else if(oh(e,r),t&4&&-1<wS.indexOf(e)){for(;o!==null;){var s=Ts(o);if(s!==null&&eh(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=zp(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 lh(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(gS()){case bc:return 1;case Qp:return 4;case Fi:case ES:return 16;case qp:return 536870912;default:return 16}default:return 16}}var An=null,Vc=null,Yi=null;function ah(){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 ch(){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:ch,this.isPropagationStopped=ch,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}),CS=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}}),uh=pt(Qi),LS=ve({},Qi,{dataTransfer:0}),bS=pt(LS),DS=ve({},gs,{relatedTarget:0}),zc=pt(DS),kS=ve({},Kr,{animationName:0,elapsedTime:0,pseudoElement:0}),PS=pt(kS),MS=ve({},Kr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),US=pt(MS),FS=ve({},Kr,{data:0}),dh=pt(FS),jS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},VS={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"},$S={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function HS(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=$S[e])?!!t[e]:!1}function Wc(){return HS}var BS=ve({},gs,{key:function(e){if(e.key){var t=jS[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"?VS[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}}),zS=pt(BS),WS=ve({},Qi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),fh=pt(WS),GS=ve({},gs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Wc}),YS=pt(GS),KS=ve({},Kr,{propertyName:0,elapsedTime:0,pseudoElement:0}),XS=pt(KS),QS=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(QS),JS=[9,13,27,32],Gc=rn&&"CompositionEvent"in window,ys=null;rn&&"documentMode"in document&&(ys=document.documentMode);var ZS=rn&&"TextEvent"in window&&!ys,ph=rn&&(!Gc||ys&&8<ys&&11>=ys),hh=" ",mh=!1;function gh(e,t){switch(e){case"keyup":return JS.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Eh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Xr=!1;function ex(e,t){switch(e){case"compositionend":return Eh(t);case"keypress":return t.which!==32?null:(mh=!0,hh);case"textInput":return e=t.data,e===hh&&mh?null:e;default:return null}}function tx(e,t){if(Xr)return e==="compositionend"||!Gc&&gh(e,t)?(e=ah(),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 ph&&t.locale!=="ko"?null:t.data;default:return null}}var nx={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 yh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!nx[e.type]:t==="textarea"}function vh(e,t,n,r){jp(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 rx(e){Uh(e,0)}function qi(e){var t=eo(e);if(Tp(t))return e}function ox(e,t){if(e==="change")return t}var _h=!1;if(rn){var Yc;if(rn){var Kc="oninput"in document;if(!Kc){var Sh=document.createElement("div");Sh.setAttribute("oninput","return;"),Kc=typeof Sh.oninput=="function"}Yc=Kc}else Yc=!1;_h=Yc&&(!document.documentMode||9<document.documentMode)}function xh(){vs&&(vs.detachEvent("onpropertychange",Rh),_s=vs=null)}function Rh(e){if(e.propertyName==="value"&&qi(_s)){var t=[];vh(t,_s,e,Tc(e)),Bp(rx,t)}}function sx(e,t,n){e==="focusin"?(xh(),vs=t,_s=n,vs.attachEvent("onpropertychange",Rh)):e==="focusout"&&xh()}function ix(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return qi(_s)}function lx(e,t){if(e==="click")return qi(t)}function ax(e,t){if(e==="input"||e==="change")return qi(t)}function cx(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Dt=typeof Object.is=="function"?Object.is:cx;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 Nh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function wh(e,t){var n=Nh(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=Nh(n)}}function Oh(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Oh(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Th(){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 ux(e){var t=Th(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Oh(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=wh(n,s);var i=wh(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 dx=rn&&"documentMode"in document&&11>=document.documentMode,Qr=null,Qc=null,xs=null,qc=!1;function Ah(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={},Ih={};rn&&(Ih=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 Ih)return Jc[e]=t[n];return e}var Ch=Zi("animationend"),Lh=Zi("animationiteration"),bh=Zi("animationstart"),Dh=Zi("transitionend"),kh=new Map,Ph="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){kh.set(e,t),or(t,[e])}for(var Zc=0;Zc<Ph.length;Zc++){var eu=Ph[Zc],fx=eu.toLowerCase(),px=eu[0].toUpperCase()+eu.slice(1);In(fx,"on"+px)}In(Ch,"onAnimationEnd"),In(Lh,"onAnimationIteration"),In(bh,"onAnimationStart"),In("dblclick","onDoubleClick"),In("focusin","onFocus"),In("focusout","onBlur"),In(Dh,"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(" "),hx=new Set("cancel close invalid load scroll toggle".split(" ").concat(Rs));function Mh(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,fS(r,t,void 0,e),e.currentTarget=null}function Uh(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;Mh(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;Mh(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)||(Fh(t,e,2,!1),n.add(r))}function tu(e,t,n){var r=0;t&&(r|=4),Fh(n,e,r,t)}var el="_reactListening"+Math.random().toString(36).slice(2);function Ns(e){if(!e[el]){e[el]=!0,vp.forEach(function(n){n!=="selectionchange"&&(hx.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 Fh(e,t,n,r){switch(lh(t)){case 1:var o=AS;break;case 4:o=IS;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}Bp(function(){var c=s,u=Tc(n),f=[];e:{var p=kh.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=zS;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=uh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=bS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=YS;break;case Ch:case Lh:case bh:h=PS;break;case Dh:h=XS;break;case"scroll":h=CS;break;case"wheel":h=qS;break;case"copy":case"cut":case"paste":h=US;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=fh}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=uh,_="onMouseLeave",m="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(y=fh,_="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&&jh(f,p,h,y,!1),E!==null&&v!==null&&jh(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=ox;else if(yh(p))if(_h)x=ax;else{x=ix;var R=sx}else(h=p.nodeName)&&h.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(x=lx);if(x&&(x=x(e,c))){vh(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":(yh(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,Ah(f,n,u);break;case"selectionchange":if(dx)break;case"keydown":case"keyup":Ah(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?gh(e,n)&&(L="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(L="onCompositionStart");L&&(ph&&n.locale!=="ko"&&(Xr||L!=="onCompositionStart"?L==="onCompositionEnd"&&Xr&&(T=ah()):(An=u,Vc="value"in An?An.value:An.textContent,Xr=!0)),R=tl(c,L),0<R.length&&(L=new dh(L,e,null,n,u),f.push({event:L,listeners:R}),T?L.data=T:(T=Eh(n),T!==null&&(L.data=T)))),(T=ZS?ex(e,n):tx(e,n))&&(c=tl(c,"onBeforeInput"),0<c.length&&(u=new dh("onBeforeInput","beforeinput",null,n,u),f.push({event:u,listeners:c}),u.data=T))}Uh(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 jh(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 mx=/\r\n?/g,gx=/\u0000|\uFFFD/g;function Vh(e){return(typeof e=="string"?e:""+e).replace(mx,`
|
|
42
|
+
`).replace(gx,"")}function nl(e,t,n){if(t=Vh(t),Vh(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,Ex=typeof clearTimeout=="function"?clearTimeout:void 0,$h=typeof Promise=="function"?Promise:void 0,yx=typeof queueMicrotask=="function"?queueMicrotask:typeof $h<"u"?function(e){return $h.resolve(null).then(e).catch(vx)}:iu;function vx(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 Hh(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,_x="__reactListeners$"+Zr,Sx="__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=Hh(e);e!==null;){if(n=e[Wt])return n;e=Hh(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 Bh(e,t,n){if(He.current!==bn)throw Error(G(168));fe(He,t),fe(et,n)}function zh(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,sS(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 Wh(e,t,n){var r=e.stateNode;if(!r)throw Error(G(169));n?(e=zh(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 Gh(e){ln===null?ln=[e]:ln.push(e)}function xx(e){ll=!0,Gh(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)),Kp(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 Yh(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),Yh(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 Kh(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 Xh(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(!Xh(e,t)){if(pu(e))throw Error(G(418));t=Cn(n.nextSibling);var r=ht;t&&Xh(e,t)?Kh(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 Qh(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 Qh(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;)Kh(e,t),t=Cn(t.nextSibling)}if(Qh(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 Rx=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 Jh(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 Zh(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 em(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 tm(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 nm=new yp.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 rm(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 om(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 sm(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=nm,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===nm&&(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 im(e){var t=e._init;return t(e._payload)}function lm(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&&im(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&&im(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=lm(!0),am=lm(!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 cm(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,Nx=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?Ax:Ix,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=Cx,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 um(){}function dm(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(hm.bind(null,n,r,e),[e]),r.getSnapshot!==t||s||ke!==null&&ke.memoizedState.tag&1){if(n.flags|=2048,Ps(9,pm.bind(null,n,r,o,t),void 0,null),Pe===null)throw Error(G(349));fr&30||fm(n,t,o)}return o}function fm(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 pm(e,t,n,r){t.value=n,t.getSnapshot=r,mm(t)&&gm(e)}function hm(e,t,n){return n(function(){mm(t)&&gm(e)})}function mm(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Dt(e,n)}catch{return!0}}function gm(e){var t=un(e,1);t!==null&&Ft(t,e,1,-1)}function Em(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=Tx.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 ym(){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 vm(e,t){return _l(8390656,8,e,t)}function ku(e,t){return Sl(2048,8,e,t)}function _m(e,t){return Sl(4,2,e,t)}function Sm(e,t){return Sl(4,4,e,t)}function xm(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 Rm(e,t,n){return n=n!=null?n.concat([e]):null,Sl(4,4,xm.bind(null,t,e),n)}function Pu(){}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]:(n.memoizedState=[e,t],e)}function wm(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 Om(e,t,n){return fr&21?(Dt(n,t)||(n=Jp(),Se.lanes|=n,pr|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,nt=!0),e.memoizedState=n)}function wx(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 Tm(){return Ot().memoizedState}function Ox(e,t,n){var r=jn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Am(e))Im(t,n);else if(n=Jh(e,t,n,r),n!==null){var o=qe();Ft(n,e,r,o),Cm(n,t,r)}}function Tx(e,t,n){var r=jn(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Am(e))Im(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=Jh(e,t,o,r),n!==null&&(o=qe(),Ft(n,e,r,o),Cm(n,t,r))}}function Am(e){var t=e.alternate;return e===Se||t!==null&&t===Se}function Im(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 Cm(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},Ax={readContext:wt,useCallback:function(e,t){return Yt().memoizedState=[e,t===void 0?null:t],e},useContext:wt,useEffect:vm,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,_l(4194308,4,xm.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=Ox.bind(null,Se,e),[r.memoizedState,e]},useRef:function(e){var t=Yt();return e={current:e},t.memoizedState=e},useState:Em,useDebugValue:Pu,useDeferredValue:function(e){return Yt().memoizedState=e},useTransition:function(){var e=Em(!1),t=e[0];return e=wx.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||fm(r,t,n)}o.memoizedState=n;var s={value:n,getSnapshot:t};return o.queue=s,vm(hm.bind(null,r,s,e),[e]),r.flags|=2048,Ps(9,pm.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=Nx++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Ix={readContext:wt,useCallback:Nm,useContext:wt,useEffect:ku,useImperativeHandle:Rm,useInsertionEffect:_m,useLayoutEffect:Sm,useMemo:wm,useReducer:bu,useRef:ym,useState:function(){return bu(ks)},useDebugValue:Pu,useDeferredValue:function(e){var t=Ot();return Om(t,be.memoizedState,e)},useTransition:function(){var e=bu(ks)[0],t=Ot().memoizedState;return[e,t]},useMutableSource:um,useSyncExternalStore:dm,useId:Tm,unstable_isNewReconciler:!1},Cx={readContext:wt,useCallback:Nm,useContext:wt,useEffect:ku,useImperativeHandle:Rm,useInsertionEffect:_m,useLayoutEffect:Sm,useMemo:wm,useReducer:Du,useRef:ym,useState:function(){return Du(ks)},useDebugValue:Pu,useDeferredValue:function(e){var t=Ot();return be===null?t.memoizedState=e:Om(t,be.memoizedState,e)},useTransition:function(){var e=Du(ks)[0],t=Ot().memoizedState;return[e,t]},useMutableSource:um,useSyncExternalStore:dm,useId:Tm,unstable_isNewReconciler:!1};function uo(e,t){try{var n="",r=t;do n+=oS(r),r=r.return;while(r);var o=n}catch(s){o=`
|
|
43
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 Lx=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 Lx;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=Wx.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 bx=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,bx.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 Dx(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 Dx(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=Gx.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 kx(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 Px(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 Mx(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,Ux=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 Fx(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[_x],delete t[Sx])),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 Ux),t.forEach(function(r){var o=Yx.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 jx(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 Vx=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:Rx.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;RS(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?xx(lg.bind(null,e)):Wh(lg.bind(null,e)),yx(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{Bx();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)&&!$x(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*Vx(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 $x(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,Ex(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{Hx();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 Hx(){for(;Ae!==null;)ug(Ae)}function Bx(){for(;Ae!==null&&!hS();)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=Mx(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=Px(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,zx(e,t,n,r)}finally{Tt.transition=o,ue=r}return null}function zx(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(NS(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,Fx(e,n),tg(n,e),ux(ou),Wi=!!ru,ou=ru=null,e.current=n,jx(n),mS(),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),yS(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 Wx(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 Gx(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),pg(e,n)}function Yx(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,kx(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=Xx(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 Kx(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 Kx(e,t,n,r)}function sd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Xx(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 Qx(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 Qx(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 Jx(){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 Zx(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=Zx(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 eR={usingClientEntryPoint:!1,Events:[Ts,eo,ol,Fp,jp,nd]},$s={findFiberByHostInstance:ir,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},tR={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||Jx,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(tR),zt=Hl}catch{}}dt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=eR,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={};/**
|
|
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 Lx=typeof WeakMap=="function"?WeakMap:Map;function Lm(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 bm(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 Dm(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Lx;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=Wx.bind(null,e,t,n),t.then(e,e))}function km(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 Pm(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 bx=on.ReactCurrentOwner,nt=!1;function Qe(e,t,n,r){t.child=e===null?am(t,null,n,r):ao(t,e.child,n,r)}function Mm(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 Um(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,Fm(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 Fm(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 jm(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 Vm(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 $m(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),om(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)&&sm(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||rm(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,Zh(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)&&sm(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||rm(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){Vm(e,t);var i=(t.flags&128)!==0;if(!r&&!i)return o&&Wh(t,n,!1),fn(e,t,s);r=t.stateNode,bx.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&&Wh(t,n,!0),t.child}function Hm(e){var t=e.stateNode;t.pendingContext?Bh(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Bh(e,t.context,!1),Nu(e,t.containerInfo)}function Bm(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 zm(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 Dx(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 Dx(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=Gx.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 Wm(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 Gm(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&&Wm(e,n,t);else if(e.tag===19)Wm(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 kx(e,t,n){switch(t.tag){case 3:Hm(t),so();break;case 5:cm(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?zm(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 Gm(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,jm(e,t,n)}return fn(e,t,n)}var Ym,zu,Km,Xm;Ym=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(){},Km=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)}},Xm=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 Px(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)Km(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":Ap(r,s),pe("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},pe("invalid",r);break;case"textarea":Lp(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),Cp(r,s,!0);break;case"textarea":Di(r),Dp(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=kp(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,Ym(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":Ap(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":Lp(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"?Up(e,a):s==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,a!=null&&Pp(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),Cp(e,r,!1);break;case"textarea":Di(e),Dp(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)Xm(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 Mx(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,Ux=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 Qm=!1;function Fx(e,t){if(ru=Wi,e=Th(),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=Qm,Qm=!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[_x],delete t[Sx])),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 Jm(e){return e.tag===5||e.tag===3||e.tag===4}function Zm(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Jm(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;)eg(e,t,n),n=n.sibling}function eg(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 tg(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Ux),t.forEach(function(r){var o=Yx.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));eg(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;)ng(t,e),t=t.sibling}function ng(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&&Ip(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"?Up(o,f):u==="dangerouslySetInnerHTML"?Pp(o,f):u==="children"?os(o,f):ac(o,u,f,c)}switch(l){case"input":_c(o,s);break;case"textarea":bp(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&&tg(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){sg(f);continue}}h!==null?(h.return=p,K=h):sg(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=Mp("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&&tg(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(Jm(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=Zm(e);Ku(e,s,o);break;case 3:case 4:var i=r.stateNode.containerInfo,l=Zm(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 jx(e,t,n){K=e,rg(e)}function rg(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?ig(o):a!==null?(a.return=i,K=a):ig(o);for(;s!==null;)K=s,rg(s),s=s.sibling;K=o,wl=l,We=c}og(e)}else o.subtreeFlags&8772&&s!==null?(s.return=o,K=s):og(e)}}function og(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&&tm(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}tm(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 sg(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 ig(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 Vx=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:Rx.transition!==null?(Dl===0&&(Dl=Jp()),Dl):(e=ue,e!==0||(e=window.event,e=e===void 0?16:lh(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;RS(e,t);var r=Hi(e,e===Pe?je:0);if(r===0)n!==null&&Xp(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Xp(n),t===1)e.tag===0?xx(ag.bind(null,e)):Gh(ag.bind(null,e)),yx(function(){!(se&6)&&Dn()}),n=null;else{switch(Zp(r)){case 1:n=bc;break;case 4:n=Qp;break;case 16:n=Fi;break;case 536870912:n=qp;break;default:n=Fi}n=gg(n,lg.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function lg(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=ug();(Pe!==e||je!==t)&&(pn=null,ho=we()+500,mr(e,t));do try{Bx();break}catch(l){cg(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)&&!$x(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*Vx(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?lg.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 $x(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 ag(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,Ex(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 cg(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=km(i);if(h!==null){h.flags&=-257,Pm(h,i,l,s,t),h.mode&1&&Dm(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)){Dm(s,c,t),od();break e}a=Error(G(426))}}else if(me&&l.mode&1){var v=km(i);if(v!==null){!(v.flags&65536)&&(v.flags|=256),Pm(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=Lm(s,a,t);em(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 _=bm(s,l,t);em(s,_);break e}}s=s.return}while(s!==null)}fg(n)}catch(x){t=x,Ae===n&&n!==null&&(Ae=n=n.return);continue}break}while(!0)}function ug(){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=ug();(Pe!==e||je!==t)&&(pn=null,mr(e,t));do try{Hx();break}catch(o){cg(e,o)}while(!0);if(Eu(),se=n,Tl.current=r,Ae!==null)throw Error(G(261));return Pe=null,je=0,De}function Hx(){for(;Ae!==null;)dg(Ae)}function Bx(){for(;Ae!==null&&!hS();)dg(Ae)}function dg(e){var t=mg(e.alternate,e,gt);e.memoizedProps=e.pendingProps,t===null?fg(e):Ae=t,Xu.current=null}function fg(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Mx(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=Px(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,zx(e,t,n,r)}finally{Tt.transition=o,ue=r}return null}function zx(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(NS(e,s),e===Pe&&(Ae=Pe=null,je=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Cl||(Cl=!0,gg(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,Fx(e,n),ng(n,e),ux(ou),Wi=!!ru,ou=ru=null,e.current=n,jx(n),mS(),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),yS(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=Zp(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 pg(e,t,n){t=uo(n,t),t=Lm(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)pg(e,e,n);else for(;t!==null;){if(t.tag===3){pg(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=bm(t,e,1),t=Pn(t,e,1),e=qe(),t!==null&&(us(t,1,e),ot(t,e));break}}t=t.return}}function Wx(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 hg(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 Gx(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),hg(e,n)}function Yx(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),hg(e,n)}var mg;mg=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,kx(e,t,n);nt=!!(e.flags&131072)}else nt=!1,me&&t.flags&1048576&&Yh(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=Xx(r),e=Pt(r,e),o){case 0:t=Fu(null,t,r,e,n);break e;case 1:t=$m(null,t,r,e,n);break e;case 11:t=Mm(null,t,r,e,n);break e;case 14:t=Um(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),$m(e,t,r,o,n);case 3:e:{if(Hm(t),e===null)throw Error(G(387));r=t.pendingProps,s=t.memoizedState,o=s.element,Zh(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=Bm(e,t,r,n,o);break e}else if(r!==o){o=uo(Error(G(424)),t),t=Bm(e,t,r,n,o);break e}else for(mt=Cn(t.stateNode.containerInfo.firstChild),ht=t,me=!0,kt=null,n=am(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 cm(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),Vm(e,t),Qe(e,t,i,n),t.child;case 6:return e===null&&hu(t),null;case 13:return zm(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),Mm(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),Um(e,t,r,o,n);case 15:return Fm(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),om(t,r,o),Ru(t,r,o,n),ju(null,t,r,!0,e,n);case 19:return Gm(e,t,n);case 22:return jm(e,t,n)}throw Error(G(156,t.tag))};function gg(e,t){return Kp(e,t)}function Kx(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 Kx(e,t,n,r)}function sd(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Xx(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 Np:return Ml(n,o,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case xp:i=10;break e;case Rp: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=Np,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 Qx(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 Qx(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 Eg(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 zh(e,n,t)}return t}function yg(e,t,n,r,o,s,i,l,a){return e=ad(n,r,!0,e,o,s,i,l,a),e.context=Eg(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=Eg(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 vg(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){vg(e,t),(e=e.alternate)&&vg(e,t)}function Jx(){return null}var _g=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=nh();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&&sh(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 Sg(){}function Zx(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=yg(t,r,e,0,null,!1,!1,"",Sg);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,"",Sg);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=Zx(n,t,e,o,r);return Fl(i)}eh=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)}},th=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)}},nh=function(){return ue},rh=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));Tp(r),_c(r,o)}}}break;case"textarea":bp(e,n);break;case"select":t=n.value,t!=null&&zr(e,!!n.multiple,t,!1)}},$p=nd,Hp=hr;var eR={usingClientEntryPoint:!1,Events:[Ts,eo,ol,jp,Vp,nd]},$s={findFiberByHostInstance:ir,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},tR={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=Gp(e),e===null?null:e.stateNode},findFiberByHostInstance:$s.findFiberByHostInstance||Jx,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(tR),zt=Hl}catch{}}dt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=eR,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=_g;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=Gp(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=_g;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(i=n.onRecoverableError)),t=yg(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 xg(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(xg)}catch(e){console.error(e)}}xg(),mp.exports=dt;var Bl=mp.exports,Rg=Bl;oc.createRoot=Rg.createRoot,oc.hydrateRoot=Rg.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 Ng={exports:{}},wg={},Og={exports:{}},Tg={};/**
|
|
45
45
|
* @license React
|
|
46
46
|
* use-sync-external-store-shim.production.min.js
|
|
47
47
|
*
|
|
@@ -49,7 +49,7 @@ Error generating stack: `+s.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 go=O;function nR(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var rR=typeof Object.is=="function"?Object.is:nR,oR=go.useState,sR=go.useEffect,iR=go.useLayoutEffect,lR=go.useDebugValue;function aR(e,t){var n=t(),r=oR({inst:{value:n,getSnapshot:t}}),o=r[0].inst,s=r[1];return iR(function(){o.value=n,o.getSnapshot=t,fd(o)&&s({inst:o})},[e,n,t]),sR(function(){return fd(o)&&s({inst:o}),e(function(){fd(o)&&s({inst:o})})},[e]),lR(n),n}function fd(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!rR(e,n)}catch{return!0}}function cR(e,t){return t()}var uR=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?cR:aR;
|
|
52
|
+
*/var go=O;function nR(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var rR=typeof Object.is=="function"?Object.is:nR,oR=go.useState,sR=go.useEffect,iR=go.useLayoutEffect,lR=go.useDebugValue;function aR(e,t){var n=t(),r=oR({inst:{value:n,getSnapshot:t}}),o=r[0].inst,s=r[1];return iR(function(){o.value=n,o.getSnapshot=t,fd(o)&&s({inst:o})},[e,n,t]),sR(function(){return fd(o)&&s({inst:o}),e(function(){fd(o)&&s({inst:o})})},[e]),lR(n),n}function fd(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!rR(e,n)}catch{return!0}}function cR(e,t){return t()}var uR=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?cR:aR;Tg.useSyncExternalStore=go.useSyncExternalStore!==void 0?go.useSyncExternalStore:uR,Og.exports=Tg;var dR=Og.exports;/**
|
|
53
53
|
* @license React
|
|
54
54
|
* use-sync-external-store-shim/with-selector.production.min.js
|
|
55
55
|
*
|
|
@@ -57,14 +57,14 @@ Error generating stack: `+s.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 zl=O,fR=dR;function pR(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var hR=typeof Object.is=="function"?Object.is:pR,mR=fR.useSyncExternalStore,gR=zl.useRef,ER=zl.useEffect,yR=zl.useMemo,vR=zl.useDebugValue;Ng.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var s=gR(null);if(s.current===null){var i={hasValue:!1,value:null};s.current=i}else i=s.current;s=yR(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,hR(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=mR(e,s[0],s[1]);return ER(function(){i.hasValue=!0,i.value=l},[l]),vR(l),l},Rg.exports=Ng;var _R=Rg.exports;const Tg=Ba(_R);var SR={VITE_APP_VERSION_HASH:"1510b28",VITE_BASE_URL:"http://localhost:8080",VITE_BASIC_AUTH:"7bfc11e6-4eee-4015-9289-20a6baf44443:PTf2c0aaa85a8064ee8ed44bc969a75280710be8d4b27af8a8",VITE_FLOW_DATA_VERSION:"0.0.10",VITE_DEFAULT_STYLE_HREF:"https://cdn.signalwire.com/npm/@signalwire/cfb@latest/dist/style.css",VITE_DEFAULT_VOICES_URL:"https://cdn.signalwire.com/npm/@signalwire/cfb@latest/dist/voices.json",BASE_URL:"/cfb/",MODE:"production",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:()=>{(SR?"production":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:xR}=H,{useSyncExternalStoreWithSelector:RR}=Tg;function Cg(e,t=e.getState,n){const r=RR(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return xR(r),r}const Lg=(e,t)=>{const n=Ig(e),r=(o,s=t)=>Cg(n,o,s);return Object.assign(r,n),r},NR=(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 wR={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 OR(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=OR(e+"",n),o,s=-1,i=r.length;if(arguments.length<2){for(;++s<i;)if((o=(e=r[s]).type)&&(o=TR(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 TR(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]=wR,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 AR(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 IR(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function kg(e){var t=Yl(e);return(t.local?IR:AR)(t)}function CR(){}function hd(e){return e==null?CR:function(){return this.querySelector(e)}}function LR(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 bR(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function DR(){return[]}function Pg(e){return e==null?DR:function(){return this.querySelectorAll(e)}}function kR(e){return function(){return bR(e.apply(this,arguments))}}function PR(e){typeof e=="function"?e=kR(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 MR=Array.prototype.find;function UR(e){return function(){return MR.call(this.children,e)}}function FR(){return this.firstElementChild}function jR(e){return this.select(e==null?FR:UR(typeof e=="function"?e:Ug(e)))}var VR=Array.prototype.filter;function $R(){return Array.from(this.children)}function HR(e){return function(){return VR.call(this.children,e)}}function BR(e){return this.selectAll(e==null?$R:HR(typeof e=="function"?e:Ug(e)))}function zR(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 WR(){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 GR(e){return function(){return e}}function YR(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 KR(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 XR(e){return e.__data__}function QR(e,t){if(!arguments.length)return Array.from(this,XR);var n=t?KR:YR,r=this._parents,o=this._groups;typeof e!="function"&&(e=GR(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 JR(){return new Et(this._exit||this._groups.map(Fg),this._parents)}function ZR(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 eN(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 tN(){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 nN(e){e||(e=rN);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 rN(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function oN(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function sN(){return Array.from(this)}function iN(){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 lN(){let e=0;for(const t of this)++e;return e}function aN(){return!this.node()}function cN(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 uN(e){return function(){this.removeAttribute(e)}}function dN(e){return function(){this.removeAttributeNS(e.space,e.local)}}function fN(e,t){return function(){this.setAttribute(e,t)}}function pN(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function hN(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function mN(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 gN(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?dN:uN:typeof t=="function"?n.local?mN:hN:n.local?pN:fN)(n,t))}function jg(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function EN(e){return function(){this.style.removeProperty(e)}}function yN(e,t,n){return function(){this.style.setProperty(e,t,n)}}function vN(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function _N(e,t,n){return arguments.length>1?this.each((t==null?EN:typeof t=="function"?vN:yN)(e,t,n??"")):Eo(this.node(),e)}function Eo(e,t){return e.style.getPropertyValue(t)||jg(e).getComputedStyle(e,null).getPropertyValue(t)}function SN(e){return function(){delete this[e]}}function xN(e,t){return function(){this[e]=t}}function RN(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function NN(e,t){return arguments.length>1?this.each((t==null?SN:typeof t=="function"?RN:xN)(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 wN(e){return function(){Hg(this,e)}}function ON(e){return function(){Bg(this,e)}}function TN(e,t){return function(){(t.apply(this,arguments)?Hg:Bg)(this,e)}}function AN(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"?TN:t?wN:ON)(n,t))}function IN(){this.textContent=""}function CN(e){return function(){this.textContent=e}}function LN(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function bN(e){return arguments.length?this.each(e==null?IN:(typeof e=="function"?LN:CN)(e)):this.node().textContent}function DN(){this.innerHTML=""}function kN(e){return function(){this.innerHTML=e}}function PN(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function MN(e){return arguments.length?this.each(e==null?DN:(typeof e=="function"?PN:kN)(e)):this.node().innerHTML}function UN(){this.nextSibling&&this.parentNode.appendChild(this)}function FN(){return this.each(UN)}function jN(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function VN(){return this.each(jN)}function $N(e){var t=typeof e=="function"?e:kg(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function HN(){return null}function BN(e,t){var n=typeof e=="function"?e:kg(e),r=t==null?HN:typeof t=="function"?t:hd(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function zN(){var e=this.parentNode;e&&e.removeChild(this)}function WN(){return this.each(zN)}function GN(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function YN(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function KN(e){return this.select(e?YN:GN)}function XN(e){return arguments.length?this.property("__data__",e):this.node().__data__}function QN(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 JN(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 ZN(e,t,n){return function(){var r=this.__on,o,s=QN(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 e1(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?ZN:JN,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 t1(e,t){return function(){return zg(this,e,t)}}function n1(e,t){return function(){return zg(this,e,t.apply(this,arguments))}}function r1(e,t){return this.each((typeof t=="function"?n1:t1)(e,t))}function*o1(){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 s1(){return this}Et.prototype=Hs.prototype={constructor:Et,select:LR,selectAll:PR,selectChild:jR,selectChildren:BR,filter:zR,data:QR,enter:WR,exit:JR,join:ZR,merge:eN,selection:s1,order:tN,sort:nN,call:oN,nodes:sN,node:iN,size:lN,empty:aN,each:cN,attr:gN,style:_N,property:NN,classed:AN,text:bN,html:MN,raise:FN,lower:VN,append:$N,insert:BN,remove:WN,clone:KN,datum:XN,on:e1,dispatch:r1,[Symbol.iterator]:o1};function jt(e){return typeof e=="string"?new Et([[document.querySelector(e)]],[document.documentElement]):new Et([[e]],Wg)}function i1(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Xt(e,t){if(e=i1(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 l1={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 a1(e){return!e.ctrlKey&&!e.button}function c1(){return this.parentNode}function u1(e,t){return t??{x:e.x,y:e.y}}function d1(){return navigator.maxTouchPoints||"ontouchstart"in this}function f1(){var e=a1,t=c1,n=u1,r=d1,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,l1).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*",p1=/^#([0-9a-f]{3,8})$/,h1=new RegExp(`^rgb\\(${vo},${vo},${vo}\\)$`),m1=new RegExp(`^rgb\\(${Qt},${Qt},${Qt}\\)$`),g1=new RegExp(`^rgba\\(${vo},${vo},${vo},${Gs}\\)$`),E1=new RegExp(`^rgba\\(${Qt},${Qt},${Qt},${Gs}\\)$`),y1=new RegExp(`^hsl\\(${Gs},${Qt},${Qt}\\)$`),v1=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:_1,formatHsl:S1,formatRgb:qg,toString:qg});function Qg(){return this.rgb().formatHex()}function _1(){return this.rgb().formatHex8()}function S1(){return nE(this).formatHsl()}function qg(){return this.rgb().formatRgb()}function Ys(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=p1.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=h1.exec(e))?new st(t[1],t[2],t[3],1):(t=m1.exec(e))?new st(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=g1.exec(e))?ql(t[1],t[2],t[3],t[4]):(t=E1.exec(e))?ql(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=y1.exec(e))?tE(t[1],t[2]/100,t[3]/100,1):(t=v1.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 x1(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?x1(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:R1,formatRgb:eE,toString:eE}));function Zg(){return`#${vr(this.r)}${vr(this.g)}${vr(this.b)}`}function R1(){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 N1(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,N1,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 w1(e,t){return function(n){return e+n*t}}function O1(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 T1(e){return(e=+e)==1?sE:function(t,n){return n-t?O1(t,n,e):oE(isNaN(t)?n:t)}}function sE(e,t){var n=t-e;return n?w1(e,n):oE(isNaN(e)?t:e)}const iE=function e(t){var n=T1(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 A1(e){return function(){return e}}function I1(e){return function(t){return e(t)+""}}function C1(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]?I1(a[0].x):A1(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 L1(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 b1(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 D1=cE(L1,"px, ","px)","deg)"),k1=cE(b1,", ",")",")"),P1=1e-12;function uE(e){return((e=Math.exp(e))+1/e)/2}function M1(e){return((e=Math.exp(e))-1/e)/2}function U1(e){return((e=Math.exp(2*e))-1)/(e+1)}const F1=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<P1)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*U1(t*L+x)-M1(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(j1),_r=qs.now()+ra)}function j1(){_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 V1(){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{V1()}finally{_o=0,H1(),_r=0}}function $1(){var e=qs.now(),t=e-na;t>dE&&(ra-=t,na=e)}function H1(){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($1,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 B1=Wl("start","end","cancel","interrupt"),z1=[],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;W1(e,n,{name:t,index:r,group:o,on:B1,tween:z1,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 W1(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 G1(e){return this.each(function(){aa(this,e)})}function Y1(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 K1(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 X1(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?Y1:K1)(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):C1)(e,t)}function Q1(e){return function(){this.removeAttribute(e)}}function q1(e){return function(){this.removeAttributeNS(e.space,e.local)}}function J1(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 Z1(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 ew(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 tw(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 nw(e,t){var n=Yl(e),r=n==="transform"?k1:vE;return this.attrTween(e,typeof t=="function"?(n.local?tw:ew)(n,r,Id(this,"attr."+e,t)):t==null?(n.local?q1:Q1)(n):(n.local?Z1:J1)(n,r,t))}function rw(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function ow(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function sw(e,t){var n,r;function o(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&ow(e,s)),n}return o._value=t,o}function iw(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 lw(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?sw:iw)(r,t))}function aw(e,t){return function(){Ad(this,e).delay=+t.apply(this,arguments)}}function cw(e,t){return t=+t,function(){Ad(this,e).delay=t}}function uw(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?aw:cw)(t,e)):$t(this.node(),t).delay}function dw(e,t){return function(){qt(this,e).duration=+t.apply(this,arguments)}}function fw(e,t){return t=+t,function(){qt(this,e).duration=t}}function pw(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?dw:fw)(t,e)):$t(this.node(),t).duration}function hw(e,t){if(typeof t!="function")throw new Error;return function(){qt(this,e).ease=t}}function mw(e){var t=this._id;return arguments.length?this.each(hw(t,e)):$t(this.node(),t).ease}function gw(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;qt(this,e).ease=n}}function Ew(e){if(typeof e!="function")throw new Error;return this.each(gw(this._id,e))}function yw(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 vw(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 _w(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 Sw(e,t,n){var r,o,s=_w(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 xw(e,t){var n=this._id;return arguments.length<2?$t(this.node(),n).on.on(e):this.each(Sw(n,e,t))}function Rw(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Nw(){return this.on("end.remove",Rw(this._id))}function ww(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 Ow(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 Tw=Hs.prototype.constructor;function Aw(){return new Tw(this._groups,this._parents)}function Iw(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 Cw(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 Lw(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 bw(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 Dw(e,t,n){var r=(e+="")=="transform"?D1:vE;return t==null?this.styleTween(e,Iw(e,r)).on("end.style."+e,_E(e)):typeof t=="function"?this.styleTween(e,Lw(e,r,Id(this,"style."+e,t))).each(bw(this._id,e)):this.styleTween(e,Cw(e,r,t),n).on("end.style."+e,null)}function kw(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function Pw(e,t,n){var r,o;function s(){var i=t.apply(this,arguments);return i!==o&&(r=(o=i)&&kw(e,i,n)),r}return s._value=t,s}function Mw(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,Pw(e,t,n??""))}function Uw(e){return function(){this.textContent=e}}function Fw(e){return function(){var t=e(this);this.textContent=t??""}}function jw(e){return this.tween("text",typeof e=="function"?Fw(Id(this,"text",e)):Uw(e==null?"":e+""))}function Vw(e){return function(t){this.textContent=e.call(this,t)}}function $w(e){var t,n;function r(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&Vw(o)),t}return r._value=e,r}function Hw(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,$w(e))}function Bw(){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 zw(){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 Ww=0;function hn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function SE(){return++Ww}var mn=Hs.prototype;hn.prototype={constructor:hn,select:ww,selectAll:Ow,selectChild:mn.selectChild,selectChildren:mn.selectChildren,filter:yw,merge:vw,selection:Aw,transition:Bw,call:mn.call,nodes:mn.nodes,node:mn.node,size:mn.size,empty:mn.empty,each:mn.each,on:xw,attr:nw,attrTween:lw,style:Dw,styleTween:Mw,text:jw,textTween:Hw,remove:Nw,tween:X1,delay:uw,duration:pw,ease:mw,easeVarying:Ew,end:zw,[Symbol.iterator]:mn[Symbol.iterator]};function Gw(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Yw={time:null,delay:0,duration:250,ease:Gw};function Kw(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 Xw(e){var t,n;e instanceof hn?(t=e._id,e=e._name):(t=SE(),(n=Yw).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||Kw(a,t));return new hn(r,this._parents,e,t)}Hs.prototype.interrupt=G1,Hs.prototype.transition=Xw;const ca=e=>()=>e;function Qw(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 Jw(){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 Zw(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function eO(){return navigator.maxTouchPoints||"ontouchstart"in this}function tO(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 nO(){var e=qw,t=Jw,n=tO,r=Zw,o=eO,s=[0,1/0],i=[[-1/0,-1/0],[1/0,1/0]],l=250,a=F1,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 Qw(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),rO=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])},oO=e=>e.userSelectionActive?"none":"all";function Zs({position:e,children:t,className:n,style:r,...o}){const s=de(oO),i=`${e}`.split("-");return H.createElement("div",{className:Je(["react-flow__panel",n,...i]),style:{...r,pointerEvents:s},...o},t)}function sO({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 iO=({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 lO=O.memo(iO);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)},aO=(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}),cO=({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)},uO=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"],dO=(e,t)=>{},fO=e=>"nativeEvent"in e;function Pd(e){var o,s;const t=fO(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(lO,{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}},pO=({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 hO({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=pO({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 mO(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]=hO({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=mO(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 gO({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]=gO({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),EO=jd.Provider;jd.Consumer;const yO=()=>O.useContext(jd),vO=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("&")}`,_O=(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 vO(e)?n={...e}:n={...e,id:FE(e)},_O(n,t)?t:t.concat(n)},SO=(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 aO(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 cO(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 xO(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 RO={source:null,target:null,sourceHandle:null,targetHandle:null},WE=()=>({handleDomNode:null,isValid:!1,connection:RO,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 NO({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 wO(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=NO({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}=xO(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:wO(!!_,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,OO=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),TO=(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=yO(),{connectOnClick:g,noPanClassName:S}=de(OO,Ge),{connecting:_,clickConnecting:x}=de(TO(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 AO=e=>({selectedNodes:e.getNodes().filter(t=>t.selected),selectedEdges:e.edges.filter(t=>t.selected)}),ma=e=>e.id;function IO(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(AO,IO);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 CO=e=>!!e.onSelectionChange;function LO({onSelectionChange:e}){const t=de(CO);return e||t?H.createElement(t0,{onSelectionChange:e}):null}const bO=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 DO=({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(bO,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"},kO={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",PO="react-flow__aria-live",MO=e=>e.ariaLiveMessage;function UO({rfId:e}){const t=de(MO);return H.createElement("div",{id:`${PO}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:kO},t)}function FO({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(UO,{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 jO(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 VO(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:jO(e,o)}),i==null||i(e)),t!=null&&t.length&&(c&&r({edges:VO(t,s)}),l==null||l(t))}const To=()=>{},$O={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},HO=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection}),BO=()=>{const e=Ie(),{d3Zoom:t,d3Selection:n}=de(HO,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}:$O,[t,n])};function Kd(){const e=BO(),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=uO(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 zO={actInsideInputWithModifier:!1};var WO=({deleteKeyCode:e,multiSelectionKeyCode:t})=>{const n=Ie(),{deleteElements:r}=Kd(),o=Oo(e,zO),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 GO(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},YO=(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},KO=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),XO=({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(KO,Ge),b=Oo(v),k=O.useRef(0),F=O.useRef(!1),C=O.useRef();return GO(P),O.useEffect(()=>{if(P.current){const D=P.current.getBoundingClientRect(),U=nO().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)&&YO(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)},QO=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function qO(){const{userSelectionActive:e,userSelectionRect:t}=de(QO,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 JO(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))},ZO=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(ZO,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 eT(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 tT(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=tT(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 nT(){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=nT();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=eT(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=f1().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(EO,{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 rT=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 oT({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=Ie(),{width:o,height:s,x:i,y:l,transformString:a,userSelectionActive:c}=de(rT,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 sT=O.memo(oT);const iT=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(iT),$=Oo(f),B=Oo(m),W=B||I,z=B||R,Y=$||p&&W!==!0;return WO({deleteKeyCode:l,multiSelectionKeyCode:v}),H.createElement(XO,{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(sT,{onSelectionContextMenu:k,noPanClassName:C,disableKeyboardA11y:D})))};x0.displayName="FlowRenderer";var lT=O.memo(x0);function aT(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 cT(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 uT=({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]},dT=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(dT,Ge),l=aT(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,_=uT({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 fT=O.memo(R0);const pT=(e,t,n)=>n===q.Left?e-t:n===q.Right?e+t:e,hT=(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:pT(t,r,e),cy:hT(n,r,e),r,stroke:"transparent",fill:"transparent"}),mT=()=>!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||mT,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 gT(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 ET=(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 yT({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 vT=[{level:0,isMaxLevel:!0,edges:[]}];function _T(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?vT:s}function ST(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)&&yT({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 _T(r,t,n)}const xT=({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"}),RT=({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]:xT,[ni.ArrowClosed]:RT};function NT(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 wT=({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=NT(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},OT=({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(OT({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(wT,{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 TT=O.memo(C0);const AT=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(AT,Ge),P=ST(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(TT,{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}=ET(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 IT=O.memo(L0);const CT=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function LT({children:e}){const t=de(CT);return H.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:t}},e)}function bT(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 DT={[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?DT[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 kT=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function PT({containerStyle:e,style:t,type:n,component:r}){const{nodeId:o,handleType:s,nodesConnectable:i,width:l,height:a,connectionStatus:c}=de(kT,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,cT),xt=D0(t,gT);return bT(s),H.createElement(lT,{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(LT,null,H.createElement(IT,{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(PT,{style:g,type:m,component:S,containerStyle:_})),H.createElement("div",{className:"react-flow__edgelabel-renderer"}),H.createElement(fT,{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 MT=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:dO,isValidConnection:void 0},UT=()=>NR((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=UT()),H.createElement(rO,{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 FT={input:JE,default:Wd,output:e0,group:Gd},jT={default:ha,straight:Fd,step:Ud,smoothstep:fa,simplebezier:Md},VT=[0,0],$T=[15,15],HT={x:0,y:0,zoom:1},BT={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=FT,edgeTypes:i=jT,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=$T,onlyRenderVisibleElements:tn=!1,selectNodesOnDrag:Le=!0,nodesDraggable:ye,nodesConnectable:ut,nodesFocusable:St,nodeOrigin:ee=VT,edgesFocusable:Cr,edgesUpdatable:Lr,elementsSelectable:Ri,defaultViewport:Ko=HT,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:ND,onEdgeContextMenu:wD,onEdgeDoubleClick:OD,onEdgeMouseEnter:TD,onEdgeMouseMove:AD,onEdgeMouseLeave:ID,onEdgeUpdateStart:CD,onEdgeUpdateEnd:LD,edgeUpdaterRadius:bD=10,onNodesChange:DD,onEdgesChange:kD,noDragClassName:PD="nodrag",noWheelClassName:MD="nowheel",noPanClassName:Wv="nopan",fitView:UD=!1,fitViewOptions:FD,connectOnClick:jD=!0,attributionPosition:VD,proOptions:$D,defaultEdgeOptions:HD,elevateNodesOnSelect:BD=!0,elevateEdgesOnSelect:zD=!1,disableKeyboardA11y:Gv=!1,autoPanOnConnect:WD=!0,autoPanOnNodeDrag:GD=!0,connectionRadius:YD=20,isValidConnection:KD,onError:XD,style:QD,id:Yv,nodeDragThreshold:qD,...JD},ZD)=>{const Kf=Yv||"1";return H.createElement("div",{...JD,style:{...QD,...BT},ref:ZD,className:Je(["react-flow",o]),"data-testid":"rf__wrapper",id:Yv},H.createElement(P0,null,H.createElement(MT,{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:ND,onEdgeContextMenu:wD,onEdgeDoubleClick:OD,onEdgeMouseEnter:TD,onEdgeMouseMove:AD,onEdgeMouseLeave:ID,onEdgeUpdateStart:CD,onEdgeUpdateEnd:LD,edgeUpdaterRadius:bD,defaultMarkerColor:Ni,noDragClassName:PD,noWheelClassName:MD,noPanClassName:Wv,elevateEdgesOnSelect:zD,rfId:Kf,disableKeyboardA11y:Gv,nodeOrigin:ee,nodeExtent:Dr}),H.createElement(DO,{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:BD,minZoom:br,maxZoom:tr,nodeExtent:Dr,onNodesChange:DD,onEdgesChange:kD,snapToGrid:Re,snapGrid:Me,connectionMode:D,translateExtent:Xo,connectOnClick:jD,defaultEdgeOptions:HD,fitView:UD,fitViewOptions:FD,onNodesDelete:I,onEdgesDelete:j,onNodeDragStart:T,onNodeDrag:L,onNodeDragStop:P,onSelectionDrag:w,onSelectionDragStart:M,onSelectionDragStop:b,noPanClassName:Wv,nodeOrigin:ee,rfId:Kf,autoPanOnConnect:WD,autoPanOnNodeDrag:GD,onError:XD,connectionRadius:YD,isValidConnection:KD,nodeDragThreshold:qD}),H.createElement(LO,{onSelectionChange:V}),Ur,H.createElement(sO,{proOptions:$D,position:VD}),H.createElement(FO,{rfId:Kf,disableKeyboardA11y:Gv})))});M0.displayName="ReactFlow";const zT=e=>{var t;return(t=e.domNode)==null?void 0:t.querySelector(".react-flow__edgelabel-renderer")};function WT({children:e}){const t=de(zT);return t?Bl.createPortal(e,t):null}function GT(){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 YT({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 KT=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}),XT={includeHiddenNodes:!1};function QT(e=XT){return de(KT(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 JT(){return H.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},H.createElement("path",{d:"M0 0h32v4.2H0z"}))}function ZT(){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 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 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 tA(){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 nA=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(nA,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(JT,null))),n&&H.createElement(ii,{className:"react-flow__controls-fitview",onClick:T,title:"fit view","aria-label":"fit view"},H.createElement(ZT,null)),r&&H.createElement(ii,{className:"react-flow__controls-interactive",onClick:L,title:"toggle interactivity","aria-label":"toggle interactivity"},y?H.createElement(tA,null):H.createElement(eA,null)),u)};U0.displayName="Controls";var rA=O.memo(U0),Ct;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Ct||(Ct={}));function oA({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 sA({color:e,radius:t}){return H.createElement("circle",{cx:t,cy:t,r:t,fill:e})}const iA={[Ct.Dots]:"#91919a",[Ct.Lines]:"#eee",[Ct.Cross]:"#e2e2e2"},lA={[Ct.Dots]:1,[Ct.Lines]:1,[Ct.Cross]:6},aA=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(aA,Ge),p=i||iA[t],h=r||lA[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(sA,{color:p,radius:g/s}):H.createElement(oA,{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 cA=O.memo(F0),j0={VITE_APP_VERSION_HASH:"1510b28",VITE_BASE_URL:"http://localhost:8080",VITE_BASIC_AUTH:"7bfc11e6-4eee-4015-9289-20a6baf44443:PTf2c0aaa85a8064ee8ed44bc969a75280710be8d4b27af8a8",VITE_FLOW_DATA_VERSION:"0.0.10",VITE_DEFAULT_STYLE_HREF:"https://cdn.signalwire.com/npm/@signalwire/cfb@latest/dist/style.css",VITE_DEFAULT_VOICES_URL:"https://cdn.signalwire.com/npm/@signalwire/cfb@latest/dist/voices.json",BASE_URL:"/cfb/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{useDebugValue:uA}=H,{useSyncExternalStoreWithSelector:dA}=Tg;let V0=!1;function fA(e,t=e.getState,n){(j0?"production":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=dA(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return uA(r),r}const $0=e=>{(j0?"production":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)=>fA(t,r,o);return Object.assign(n,t),n},bo=e=>e?$0(e):$0;var pA={VITE_APP_VERSION_HASH:"1510b28",VITE_BASE_URL:"http://localhost:8080",VITE_BASIC_AUTH:"7bfc11e6-4eee-4015-9289-20a6baf44443:PTf2c0aaa85a8064ee8ed44bc969a75280710be8d4b27af8a8",VITE_FLOW_DATA_VERSION:"0.0.10",VITE_DEFAULT_STYLE_HREF:"https://cdn.signalwire.com/npm/@signalwire/cfb@latest/dist/style.css",VITE_DEFAULT_VOICES_URL:"https://cdn.signalwire.com/npm/@signalwire/cfb@latest/dist/voices.json",BASE_URL:"/cfb/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const hA=!1,mA=pA.VITE_IS_STAGING,gA=mA?"staging":"prod",EA="0.0.12",li="0.0.10",H0=230,yA=640,B0=20,Do={markerEnd:{height:20,type:ni.ArrowClosed,width:20},style:{stroke:"inherit",strokeWidth:1.5},type:"floating"},vA="422",_A="404",z0="document-sync",nf=1e3,SA=1e3,xA=300,RA=5e3,W0=300,NA="Shift+Backspace",wA="Meta",OA="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},TA=(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",AA=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}`)}),IA=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 CA=(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},LA=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:[]})},bA={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||bA,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 DA(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 kA(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 PA(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 MA={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function UA(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,t=>MA[t]):e}const FA=[" ",",","?","!",";"];function jA(e,t,n){t=t||"",n=n||"";const r=FA.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(),DA(["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&&!jA(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 VA=[{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}],$A={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 HA=["v1","v2","v3"],BA=["v4"],ly={zero:0,one:1,two:2,few:3,many:4,other:5};function zA(){const e={};return VA.forEach(t=>{t.lngs.forEach(n=>{e[n]={numbers:t.nr,plurals:$A[t.fc]}})}),e}class WA{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||BA.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=zA()}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!HA.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=PA(e,t,n);return!s&&o&&typeof n=="string"&&(s=xa(e,n,r),s===void 0&&(s=xa(t,n,r))),s}class GA{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:UA,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 YA(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 KA{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}=YA(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 XA(e,t){e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)}class QA 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=>{kA(a.loaded,[s],i),XA(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 qA(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:[]},qA(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=KA);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 WA(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 GA(this.options),p.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},p.backendConnector=new QA(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 JA(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 ZA(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 eI(e){var t=ZA(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,eI(r.key),r)}}function tI(e,t,n){return t&&dy(e.prototype,t),n&&dy(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}var fy=[],nI=fy.forEach,rI=fy.slice;function oI(e){return nI.call(rI.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]+$/,sI=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=sI(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)}},iI={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)}},lI={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},aI={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},cI={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)}},uI={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}},dI={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}},fI={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}},pI={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 hI(){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]:{};JA(this,e),this.type="languageDetector",this.detectors={},this.init(t,n)}return tI(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=oI(r,this.options||{},hI()),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(iI),this.addDetector(lI),this.addDetector(aI),this.addDetector(cI),this.addDetector(uI),this.addDetector(dI),this.addDetector(fI),this.addDetector(pI)}},{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 mI={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 gI=Ba(mI);var EI=/\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],(gI[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(EI),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 yI=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,vI=/^\s*$/,_I=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 SI={parse:function(e,t){t||(t={}),t.components||(t.components=_I);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(yI,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);vI.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 xI(){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 RI=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,NI={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},wI=e=>NI[e];let uf={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:e=>e.replace(RI,wI)};function OI(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};uf={...uf,...e}}function TI(){return uf}let Sy;function AI(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 II(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 CI(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 LI(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=SI.parse(`<0>${t}</0>`),f={...a,...o};function p(v,m,g){const S=ff(v),_=E(S,m.children,g);return II(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?CI({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 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 y=f||xy();if(!y)return xI("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={...TI(),...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=LI(c||t,P,y,m,L,h),j=r!==void 0?r:m.defaultTransParent;return j?O.createElement(j,E,I):I}const DI={type:"3rdParty",init(e){OI(e.options.react),AI(e)}},kI=O.createContext();function PI(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(kI)||{},m=f||y||xy(),g=p||m&&m.t.bind(m);return bI({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 MI={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"]},UI={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"]},FI={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"]},jI={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"]},VI=jI,$I={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"]},HI={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"]},BI={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"]},zI={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"]},WI={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"]},GI={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"]},YI={prefix:"fas",iconName:"circle-small",icon:[320,512,[],"e122","M0 256a160 160 0 1 1 320 0A160 160 0 1 1 0 256z"]},KI={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"]},XI={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"]},QI={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"]},qI={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"]},JI={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"]},ZI={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 eC={"arrow-left":GI,"arrow-right":zI,"arrow-turn-down-right":BI,"arrows-rotate":HI,bars:UI,bolt:XI,"circle-check":$I,"circle-exclamation":FI,"circle-info":KI,"circle-question":WI,"circle-small":YI,"circle-xmark":ZI,"clock-rotate-left":qI,"dot-circle":VI,"trash-can":MI,"triangle-exclamation":JI,xmark:QI},re=O.forwardRef(function({className:t="",size:n="",tag:r},o){const s=eC[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)})]})]})})},tC=e=>{const t=Q(n=>n.viewport.zoom);return d.jsx(Uo,{scale:t,...e})},nC=Ne(),rC=100,oC=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){nC.error(`Node with id ${c} not found`);return}const f=((h=o==null?void 0:o.getNode(c))==null?void 0:h.height)??oC,p=((E=o==null?void 0:o.getNode(c))==null?void 0:E.width)??H0;o==null||o.fitBounds({height:f+rC,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"})]})},sC=({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})]}),iC=({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(tC,{handleDelete:()=>i(r),label:A(N.REMOVE_NODE,{title:o}),show:s})]})},lC=({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)]})}),aC=({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}},cC=({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}=aC({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(cC,{id:t,isConnectable:n}),d.jsx(iC,{connected:!a||u,deletable:i,isRoot:r,nodeId:t,nodeTitle:o,selected:s}),l&&d.jsx(lC,{valid:c}),e]})})},uC=({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=IA(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})]})},dC=({label:e,vars:t={}})=>d.jsx(PI,{components:{a:d.jsx("a",{className:"underline hover:text-background/80",href:t.linkTo||"#",target:"_blank",rel:"noopener noreferrer"}),code:d.jsx(sC,{}),p:d.jsx("p",{className:"mb-2"})},i18nKey:e}),fC={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 ${fC[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})]}),pC=({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(pC,{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 hC(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 mC(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 gC(){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 EC(e){return!vC()&&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 yC(){return/apple/i.test(navigator.vendor)}function vC(){const e=/android/i;return e.test(Cy())||e.test(gC())}function _C(){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 SC(e){return"nativeEvent"in e}function xC(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 RC="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function NC(e){return vt(e)&&e.matches(RC)}const Vo=Math.min,Or=Math.max,Ia=Math.round,Ca=Math.floor,Jn=e=>({x:e,y:e}),wC={left:"right",right:"left",bottom:"top",top:"bottom"},OC={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 TC(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 AC(e){const t=ba(e);return[_f(e),t,_f(t)]}function _f(e){return e.replace(/start|end/g,t=>OC[t])}function IC(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 CC(e,t,n,r){const o=gi(e);let s=IC(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=>wC[t])}function LC(e){return{top:0,right:0,bottom:0,left:0,...e}}function Dy(e){return typeof e!="number"?LC(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 bC=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}}}),DC=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)]:AC(l));!p&&E!=="none"&&_.push(...CC(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=TC(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 kC(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 PC=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 kC(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}}}}},MC=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 UC=Jn(0);function Fy(e){const t=it(e);return!mf()||!t.visualViewport?UC:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function FC(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=FC(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 jC(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 VC(e){return Array.from(e.getClientRects())}function jy(e){return Ar(vn(e)).left+Aa(e).scrollLeft}function $C(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 HC(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 BC(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=HC(e,n);else if(t==="document")r=$C(vn(e));else if(ge(t))r=BC(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 zC(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 WC(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?zC(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 GC(e){return Uy(e)}function YC(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&&hC(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||mC(e)||n}const KC=async function(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||By,s=this.getDimensions;return{reference:YC(t,await o(n),r),floating:{x:0,y:0,...await s(n)}}};function XC(e){return _t(e).direction==="rtl"}const QC={convertOffsetParentRelativeRectToViewportRelativeRect:jC,getDocumentElement:vn,getClippingRect:WC,getOffsetParent:By,getElementRects:KC,getClientRects:VC,getDimensions:GC,getScale:$o,isElement:ge,isRTL:XC};function qC(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 JC(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?qC(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 ZC=(e,t,n)=>{const r=new Map,o={platform:QC,...n},s={...o.platform,_c:r};return bC(e,t,{...o,platform:s})},e2=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 t2(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),ZC(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 n2=lp.useInsertionEffect||(e=>e());function Ho(e){const t=O.useRef(()=>{});return n2(()=>{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,r2=0;const Ky=()=>"floating-ui-"+r2++;function o2(){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||o2;function s2(){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 i2=O.createContext(null),l2=O.createContext(null),Rf=()=>{var e;return((e=O.useContext(i2))==null?void 0:e.id)||null},Nf=()=>O.useContext(l2);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 a2(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 c2={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},u2={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 d2(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,SC(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)&&!xC(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,[c2[E]]:b=>{h&&r(!1,b.nativeEvent,"reference-press")}},floating:{onKeyDown:j,onMouseDown(){R.current=!0},onMouseUp(){R.current=!0},[u2[p]]:()=>{x.current=!0}}}:{},[c,h,p,E,r,j])}function f2(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=t2(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(()=>s2())[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 p2(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){EC(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(yC()&&_C())throw Error();if(!E.matches(":focus-visible"))return}catch{if(!p.current&&!NC(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 h2(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 m2=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function g2(e,t){var n;t===void 0&&(t={});const{open:r,floatingId:o}=e,{enabled:s=!0,role:i="dialog"}=t,l=(n=m2.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 E2(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function y2(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=E2(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 v2({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=f2({middleware:[PC(8),DC({boundary:document.querySelector(`#${c}`)||void 0}),MC({padding:4}),e2({element:u,padding:e??{bottom:0,left:8,right:8,top:8}})],onOpenChange:E,open:h,placement:l,strategy:"fixed",whileElementsMounted:JC}),v=y.context,m=a2(v,{enabled:s==null,handleClose:r?y2():null,move:!1}),g=p2(v,{enabled:s==null}),S=d2(v,{escapeKey:t,outsidePress:i}),_=g2(v,{role:a}),x=h2([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},_2=({children:e,...t})=>{const n=v2(t);return d.jsx(nv.Provider,{value:n,children:e})},S2={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"},x2=()=>{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=`${S2[o]}`;return d.jsx("div",{ref:e.arrowRef,style:r,className:`tooltip-arrow absolute h-2 w-2 rotate-45 bg-inherit
|
|
60
|
+
*/var zl=O,fR=dR;function pR(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var hR=typeof Object.is=="function"?Object.is:pR,mR=fR.useSyncExternalStore,gR=zl.useRef,ER=zl.useEffect,yR=zl.useMemo,vR=zl.useDebugValue;wg.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var s=gR(null);if(s.current===null){var i={hasValue:!1,value:null};s.current=i}else i=s.current;s=yR(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,hR(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=mR(e,s[0],s[1]);return ER(function(){i.hasValue=!0,i.value=l},[l]),vR(l),l},Ng.exports=wg;var _R=Ng.exports;const Ag=Ba(_R);var SR={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 Ig=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:()=>{(SR?"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},Cg=e=>e?Ig(e):Ig,{useDebugValue:xR}=H,{useSyncExternalStoreWithSelector:RR}=Ag;function Lg(e,t=e.getState,n){const r=RR(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return xR(r),r}const bg=(e,t)=>{const n=Cg(e),r=(o,s=t)=>Lg(n,o,s);return Object.assign(r,n),r},NR=(e,t)=>e?bg(e,t):bg;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 wR={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 OR(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=OR(e+"",n),o,s=-1,i=r.length;if(arguments.length<2){for(;++s<i;)if((o=(e=r[s]).type)&&(o=TR(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]=Dg(n[o],e.name,t);else if(t==null)for(o in n)n[o]=Dg(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 TR(e,t){for(var n=0,r=e.length,o;n<r;++n)if((o=e[n]).name===t)return o.value}function Dg(e,t,n){for(var r=0,o=e.length;r<o;++r)if(e[r].name===t){e[r]=wR,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 kg={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)),kg.hasOwnProperty(t)?{space:kg[t],local:e}:e}function AR(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 IR(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Pg(e){var t=Yl(e);return(t.local?IR:AR)(t)}function CR(){}function hd(e){return e==null?CR:function(){return this.querySelector(e)}}function LR(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 bR(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function DR(){return[]}function Mg(e){return e==null?DR:function(){return this.querySelectorAll(e)}}function kR(e){return function(){return bR(e.apply(this,arguments))}}function PR(e){typeof e=="function"?e=kR(e):e=Mg(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 Ug(e){return function(){return this.matches(e)}}function Fg(e){return function(t){return t.matches(e)}}var MR=Array.prototype.find;function UR(e){return function(){return MR.call(this.children,e)}}function FR(){return this.firstElementChild}function jR(e){return this.select(e==null?FR:UR(typeof e=="function"?e:Fg(e)))}var VR=Array.prototype.filter;function $R(){return Array.from(this.children)}function HR(e){return function(){return VR.call(this.children,e)}}function BR(e){return this.selectAll(e==null?$R:HR(typeof e=="function"?e:Fg(e)))}function zR(e){typeof e!="function"&&(e=Ug(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 jg(e){return new Array(e.length)}function WR(){return new Et(this._enter||this._groups.map(jg),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 GR(e){return function(){return e}}function YR(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 KR(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 XR(e){return e.__data__}function QR(e,t){if(!arguments.length)return Array.from(this,XR);var n=t?KR:YR,r=this._parents,o=this._groups;typeof e!="function"&&(e=GR(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 JR(){return new Et(this._exit||this._groups.map(jg),this._parents)}function ZR(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 eN(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 tN(){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 nN(e){e||(e=rN);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 rN(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function oN(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function sN(){return Array.from(this)}function iN(){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 lN(){let e=0;for(const t of this)++e;return e}function aN(){return!this.node()}function cN(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 uN(e){return function(){this.removeAttribute(e)}}function dN(e){return function(){this.removeAttributeNS(e.space,e.local)}}function fN(e,t){return function(){this.setAttribute(e,t)}}function pN(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function hN(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function mN(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 gN(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?dN:uN:typeof t=="function"?n.local?mN:hN:n.local?pN:fN)(n,t))}function Vg(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function EN(e){return function(){this.style.removeProperty(e)}}function yN(e,t,n){return function(){this.style.setProperty(e,t,n)}}function vN(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function _N(e,t,n){return arguments.length>1?this.each((t==null?EN:typeof t=="function"?vN:yN)(e,t,n??"")):Eo(this.node(),e)}function Eo(e,t){return e.style.getPropertyValue(t)||Vg(e).getComputedStyle(e,null).getPropertyValue(t)}function SN(e){return function(){delete this[e]}}function xN(e,t){return function(){this[e]=t}}function RN(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function NN(e,t){return arguments.length>1?this.each((t==null?SN:typeof t=="function"?RN:xN)(e,t)):this.node()[e]}function $g(e){return e.trim().split(/^|\s+/)}function md(e){return e.classList||new Hg(e)}function Hg(e){this._node=e,this._names=$g(e.getAttribute("class")||"")}Hg.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 Bg(e,t){for(var n=md(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function zg(e,t){for(var n=md(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function wN(e){return function(){Bg(this,e)}}function ON(e){return function(){zg(this,e)}}function TN(e,t){return function(){(t.apply(this,arguments)?Bg:zg)(this,e)}}function AN(e,t){var n=$g(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"?TN:t?wN:ON)(n,t))}function IN(){this.textContent=""}function CN(e){return function(){this.textContent=e}}function LN(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function bN(e){return arguments.length?this.each(e==null?IN:(typeof e=="function"?LN:CN)(e)):this.node().textContent}function DN(){this.innerHTML=""}function kN(e){return function(){this.innerHTML=e}}function PN(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function MN(e){return arguments.length?this.each(e==null?DN:(typeof e=="function"?PN:kN)(e)):this.node().innerHTML}function UN(){this.nextSibling&&this.parentNode.appendChild(this)}function FN(){return this.each(UN)}function jN(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function VN(){return this.each(jN)}function $N(e){var t=typeof e=="function"?e:Pg(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function HN(){return null}function BN(e,t){var n=typeof e=="function"?e:Pg(e),r=t==null?HN:typeof t=="function"?t:hd(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function zN(){var e=this.parentNode;e&&e.removeChild(this)}function WN(){return this.each(zN)}function GN(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function YN(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function KN(e){return this.select(e?YN:GN)}function XN(e){return arguments.length?this.property("__data__",e):this.node().__data__}function QN(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 JN(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 ZN(e,t,n){return function(){var r=this.__on,o,s=QN(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 e1(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?ZN:JN,o=0;o<s;++o)this.each(l(r[o],t,n));return this}function Wg(e,t,n){var r=Vg(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 t1(e,t){return function(){return Wg(this,e,t)}}function n1(e,t){return function(){return Wg(this,e,t.apply(this,arguments))}}function r1(e,t){return this.each((typeof t=="function"?n1:t1)(e,t))}function*o1(){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 Gg=[null];function Et(e,t){this._groups=e,this._parents=t}function Hs(){return new Et([[document.documentElement]],Gg)}function s1(){return this}Et.prototype=Hs.prototype={constructor:Et,select:LR,selectAll:PR,selectChild:jR,selectChildren:BR,filter:zR,data:QR,enter:WR,exit:JR,join:ZR,merge:eN,selection:s1,order:tN,sort:nN,call:oN,nodes:sN,node:iN,size:lN,empty:aN,each:cN,attr:gN,style:_N,property:NN,classed:AN,text:bN,html:MN,raise:FN,lower:VN,append:$N,insert:BN,remove:WN,clone:KN,datum:XN,on:e1,dispatch:r1,[Symbol.iterator]:o1};function jt(e){return typeof e=="string"?new Et([[document.querySelector(e)]],[document.documentElement]):new Et([[e]],Gg)}function i1(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Xt(e,t){if(e=i1(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 l1={passive:!1},Bs={capture:!0,passive:!1};function gd(e){e.stopImmediatePropagation()}function yo(e){e.preventDefault(),e.stopImmediatePropagation()}function Yg(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 Kg(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 a1(e){return!e.ctrlKey&&!e.button}function c1(){return this.parentNode}function u1(e,t){return t??{x:e.x,y:e.y}}function d1(){return navigator.maxTouchPoints||"ontouchstart"in this}function f1(){var e=a1,t=c1,n=u1,r=d1,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,l1).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),Yg(_.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),Kg(_.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 Xg(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*",p1=/^#([0-9a-f]{3,8})$/,h1=new RegExp(`^rgb\\(${vo},${vo},${vo}\\)$`),m1=new RegExp(`^rgb\\(${Qt},${Qt},${Qt}\\)$`),g1=new RegExp(`^rgba\\(${vo},${vo},${vo},${Gs}\\)$`),E1=new RegExp(`^rgba\\(${Qt},${Qt},${Qt},${Gs}\\)$`),y1=new RegExp(`^hsl\\(${Gs},${Qt},${Qt}\\)$`),v1=new RegExp(`^hsla\\(${Gs},${Qt},${Qt},${Gs}\\)$`),Qg={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:_1,formatHsl:S1,formatRgb:Jg,toString:Jg});function qg(){return this.rgb().formatHex()}function _1(){return this.rgb().formatHex8()}function S1(){return rE(this).formatHsl()}function Jg(){return this.rgb().formatRgb()}function Ys(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=p1.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Zg(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=h1.exec(e))?new st(t[1],t[2],t[3],1):(t=m1.exec(e))?new st(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=g1.exec(e))?ql(t[1],t[2],t[3],t[4]):(t=E1.exec(e))?ql(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=y1.exec(e))?nE(t[1],t[2]/100,t[3]/100,1):(t=v1.exec(e))?nE(t[1],t[2]/100,t[3]/100,t[4]):Qg.hasOwnProperty(e)?Zg(Qg[e]):e==="transparent"?new st(NaN,NaN,NaN,0):null}function Zg(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 x1(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?x1(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,Xg(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:eE,formatHex:eE,formatHex8:R1,formatRgb:tE,toString:tE}));function eE(){return`#${vr(this.r)}${vr(this.g)}${vr(this.b)}`}function R1(){return`#${vr(this.r)}${vr(this.g)}${vr(this.b)}${vr((isNaN(this.opacity)?1:this.opacity)*255)}`}function tE(){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 nE(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 rE(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 N1(e,t,n,r){return arguments.length===1?rE(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,N1,Xg(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(oE(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("}${oE(this.h)}, ${Zl(this.s)*100}%, ${Zl(this.l)*100}%${e===1?")":`, ${e})`}`}}));function oE(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 sE=e=>()=>e;function w1(e,t){return function(n){return e+n*t}}function O1(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 T1(e){return(e=+e)==1?iE:function(t,n){return n-t?O1(t,n,e):sE(isNaN(t)?n:t)}}function iE(e,t){var n=t-e;return n?w1(e,n):sE(isNaN(e)?t:e)}const lE=function e(t){var n=T1(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=iE(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 A1(e){return function(){return e}}function I1(e){return function(t){return e(t)+""}}function C1(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]?I1(a[0].x):A1(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 aE=180/Math.PI,Rd={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function cE(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)*aE,skewX:Math.atan(a)*aE,scaleX:i,scaleY:l}}var ea;function L1(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Rd:cE(t.a,t.b,t.c,t.d,t.e,t.f)}function b1(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,cE(e.a,e.b,e.c,e.d,e.e,e.f))}function uE(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 D1=uE(L1,"px, ","px)","deg)"),k1=uE(b1,", ",")",")"),P1=1e-12;function dE(e){return((e=Math.exp(e))+1/e)/2}function M1(e){return((e=Math.exp(e))-1/e)/2}function U1(e){return((e=Math.exp(2*e))-1)/(e+1)}const F1=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<P1)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=dE(x),I=c/(n*g)*(P*U1(t*L+x)-M1(x));return[l+I*h,a+I*E,c*P/dE(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,fE=1e3,ta,Qs,na=0,_r=0,ra=0,qs=typeof performance=="object"&&performance.now?performance:Date,pE=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Nd(){return _r||(pE(j1),_r=qs.now()+ra)}function j1(){_r=0}function oa(){this._call=this._time=this._next=null}oa.prototype=hE.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 hE(e,t,n){var r=new oa;return r.restart(e,t,n),r}function V1(){Nd(),++_o;for(var e=ta,t;e;)(t=_r-e._time)>=0&&e._call.call(void 0,t),e=e._next;--_o}function mE(){_r=(na=qs.now())+ra,_o=Ks=0;try{V1()}finally{_o=0,H1(),_r=0}}function $1(){var e=qs.now(),t=e-na;t>fE&&(ra-=t,na=e)}function H1(){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(mE,e-qs.now()-ra)),Xs&&(Xs=clearInterval(Xs))):(Xs||(na=qs.now(),Xs=setInterval($1,fE)),_o=1,pE(mE))}}function gE(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 B1=Wl("start","end","cancel","interrupt"),z1=[],EE=0,yE=1,Od=2,sa=3,vE=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;W1(e,n,{name:t,index:r,group:o,on:B1,tween:z1,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:EE})}function Ad(e,t){var n=$t(e,t);if(n.state>EE)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 W1(e,t,n){var r=e.__transition,o;r[t]=n,n.timer=hE(s,0,n.time);function s(c){n.state=yE,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!==yE)return a();for(u in r)if(h=r[u],h.name===n.name){if(h.state===sa)return gE(i);h.state===vE?(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(gE(function(){n.state===sa&&(n.state=vE,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 G1(e){return this.each(function(){aa(this,e)})}function Y1(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 K1(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 X1(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?Y1:K1)(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 _E(e,t){var n;return(typeof t=="number"?Hn:t instanceof Ys?lE:(n=Ys(t))?(t=n,lE):C1)(e,t)}function Q1(e){return function(){this.removeAttribute(e)}}function q1(e){return function(){this.removeAttributeNS(e.space,e.local)}}function J1(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 Z1(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 ew(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 tw(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 nw(e,t){var n=Yl(e),r=n==="transform"?k1:_E;return this.attrTween(e,typeof t=="function"?(n.local?tw:ew)(n,r,Id(this,"attr."+e,t)):t==null?(n.local?q1:Q1)(n):(n.local?Z1:J1)(n,r,t))}function rw(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function ow(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function sw(e,t){var n,r;function o(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&ow(e,s)),n}return o._value=t,o}function iw(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 lw(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?sw:iw)(r,t))}function aw(e,t){return function(){Ad(this,e).delay=+t.apply(this,arguments)}}function cw(e,t){return t=+t,function(){Ad(this,e).delay=t}}function uw(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?aw:cw)(t,e)):$t(this.node(),t).delay}function dw(e,t){return function(){qt(this,e).duration=+t.apply(this,arguments)}}function fw(e,t){return t=+t,function(){qt(this,e).duration=t}}function pw(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?dw:fw)(t,e)):$t(this.node(),t).duration}function hw(e,t){if(typeof t!="function")throw new Error;return function(){qt(this,e).ease=t}}function mw(e){var t=this._id;return arguments.length?this.each(hw(t,e)):$t(this.node(),t).ease}function gw(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;qt(this,e).ease=n}}function Ew(e){if(typeof e!="function")throw new Error;return this.each(gw(this._id,e))}function yw(e){typeof e!="function"&&(e=Ug(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 vw(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 _w(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 Sw(e,t,n){var r,o,s=_w(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 xw(e,t){var n=this._id;return arguments.length<2?$t(this.node(),n).on.on(e):this.each(Sw(n,e,t))}function Rw(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Nw(){return this.on("end.remove",Rw(this._id))}function ww(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 Ow(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Mg(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 Tw=Hs.prototype.constructor;function Aw(){return new Tw(this._groups,this._parents)}function Iw(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 SE(e){return function(){this.style.removeProperty(e)}}function Cw(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 Lw(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 bw(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=SE(t)):void 0;(c!==n||o!==u)&&(r=(n=c).copy()).on(i,o=u),a.on=r}}function Dw(e,t,n){var r=(e+="")=="transform"?D1:_E;return t==null?this.styleTween(e,Iw(e,r)).on("end.style."+e,SE(e)):typeof t=="function"?this.styleTween(e,Lw(e,r,Id(this,"style."+e,t))).each(bw(this._id,e)):this.styleTween(e,Cw(e,r,t),n).on("end.style."+e,null)}function kw(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function Pw(e,t,n){var r,o;function s(){var i=t.apply(this,arguments);return i!==o&&(r=(o=i)&&kw(e,i,n)),r}return s._value=t,s}function Mw(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,Pw(e,t,n??""))}function Uw(e){return function(){this.textContent=e}}function Fw(e){return function(){var t=e(this);this.textContent=t??""}}function jw(e){return this.tween("text",typeof e=="function"?Fw(Id(this,"text",e)):Uw(e==null?"":e+""))}function Vw(e){return function(t){this.textContent=e.call(this,t)}}function $w(e){var t,n;function r(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&Vw(o)),t}return r._value=e,r}function Hw(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,$w(e))}function Bw(){for(var e=this._name,t=this._id,n=xE(),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 zw(){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 Ww=0;function hn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function xE(){return++Ww}var mn=Hs.prototype;hn.prototype={constructor:hn,select:ww,selectAll:Ow,selectChild:mn.selectChild,selectChildren:mn.selectChildren,filter:yw,merge:vw,selection:Aw,transition:Bw,call:mn.call,nodes:mn.nodes,node:mn.node,size:mn.size,empty:mn.empty,each:mn.each,on:xw,attr:nw,attrTween:lw,style:Dw,styleTween:Mw,text:jw,textTween:Hw,remove:Nw,tween:X1,delay:uw,duration:pw,ease:mw,easeVarying:Ew,end:zw,[Symbol.iterator]:mn[Symbol.iterator]};function Gw(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Yw={time:null,delay:0,duration:250,ease:Gw};function Kw(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 Xw(e){var t,n;e instanceof hn?(t=e._id,e=e._name):(t=xE(),(n=Yw).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||Kw(a,t));return new hn(r,this._parents,e,t)}Hs.prototype.interrupt=G1,Hs.prototype.transition=Xw;const ca=e=>()=>e;function Qw(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 Jw(){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 RE(){return this.__zoom||Bn}function Zw(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function eO(){return navigator.maxTouchPoints||"ontouchstart"in this}function tO(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 nO(){var e=qw,t=Jw,n=tO,r=Zw,o=eO,s=[0,1/0],i=[[-1/0,-1/0],[1/0,1/0]],l=250,a=F1,c=Wl("start","zoom","end"),u,f,p,h=500,E=150,y=0,v=10;function m(w){w.property("__zoom",RE).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",RE),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 Qw(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;Yg(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),Kg(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),rO=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.`},NE=En.error001();function de(e,t){const n=O.useContext(ua);if(n===null)throw new Error(NE);return Lg(n,e,t)}const Ie=()=>{const e=O.useContext(ua);if(e===null)throw new Error(NE);return O.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy}),[e])},oO=e=>e.userSelectionActive?"none":"all";function Zs({position:e,children:t,className:n,style:r,...o}){const s=de(oO),i=`${e}`.split("-");return H.createElement("div",{className:Je(["react-flow__panel",n,...i]),style:{...r,pointerEvents:s},...o},t)}function sO({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 iO=({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 lO=O.memo(iO);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])}),wE=(e,t,n)=>e<t?So(Math.abs(e-t),1,50)/50:e>n?-So(Math.abs(e-n),1,50)/50:0,OE=(e,t)=>{const n=wE(e.x,35,t.width-35)*20,r=wE(e.y,35,t.height-35)*20;return[n,r]},TE=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},aO=(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}),cO=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),AE=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)},uO=e=>It(e.width)&&It(e.height)&&It(e.x)&&It(e.y),It=e=>!isNaN(e)&&isFinite(e),Ce=Symbol.for("internals"),IE=["Enter"," ","Escape"],dO=(e,t)=>{},fO=e=>"nativeEvent"in e;function Pd(e){var o,s;const t=fO(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 CE=e=>"clientX"in e,zn=(e,t)=>{var s,i;const n=CE(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(lO,{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 LE({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 bE({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 DE({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 kE({sourceX:e,sourceY:t,sourcePosition:n=q.Bottom,targetX:r,targetY:o,targetPosition:s=q.Top}){const[i,l]=DE({pos:n,x1:e,y1:t,x2:r,y2:o}),[a,c]=DE({pos:s,x1:r,y1:o,x2:e,y2:t}),[u,f,p,h]=bE({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]=kE({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 PE={[q.Left]:{x:-1,y:0},[q.Right]:{x:1,y:0},[q.Top]:{x:0,y:-1},[q.Bottom]:{x:0,y:1}},pO=({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},ME=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function hO({source:e,sourcePosition:t=q.Bottom,target:n,targetPosition:r=q.Top,center:o,offset:s}){const i=PE[t],l=PE[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=pO({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]=LE({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 mO(e,t,n,r){const o=Math.min(ME(e,t)/2,ME(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]=hO({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=mO(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 gO({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[o,s,i,l]=LE({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]=gO({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 UE({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 FE({sourceX:e,sourceY:t,sourcePosition:n=q.Bottom,targetX:r,targetY:o,targetPosition:s=q.Top,curvature:i=.25}){const[l,a]=UE({pos:n,x1:e,y1:t,x2:r,y2:o,c:i}),[c,u]=UE({pos:s,x1:r,y1:o,x2:e,y2:t,c:i}),[f,p,h,E]=bE({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]=FE({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),EO=jd.Provider;jd.Consumer;const yO=()=>O.useContext(jd),vO=e=>"id"in e&&"source"in e&&"target"in e,jE=({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("&")}`,_O=(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)),VE=(e,t)=>{if(!e.source||!e.target)return t;let n;return vO(e)?n={...e}:n={...e,id:jE(e)},_O(n,t)?t:t.concat(n)},SO=(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?jE(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},$E=({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 aO(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 cO(n)},HE=(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},BE=(e,t)=>{const n=e.map(r=>r.id);return t.filter(r=>n.includes(r.source)||n.includes(r.target))},zE=(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 WE(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 xO(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:GE()};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 RO={source:null,target:null,sourceHandle:null,targetHandle:null},GE=()=>({handleDomNode:null,isValid:!1,connection:RO,endHandle:null});function YE(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={...GE(),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 NO({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=WE(s,i,"source",`${t}-${n}-${r}`),a=WE(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 wO(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function KE({event:e,handleId:t,nodeId:n,onConnect:r,isTarget:o,getState:s,setState:i,isValidConnection:l,edgeUpdaterType:a,onEdgeUpdateEnd:c}){const u=TE(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=NO({nodes:m(),nodeId:n,handleId:t,handleType:L}),F=()=>{if(!h)return;const[U,$]=OE(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}=xO(U,u,$d(j,$,!1,[1,1]),E,k,z=>YE(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?$E({x:_.x,y:_.y},$):j,connectionStatus:wO(!!_,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 XE=()=>!0,OO=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),TO=(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}},QE=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=yO(),{connectOnClick:g,noPanClassName:S}=de(OO,Ge),{connecting:_,clickConnecting:x}=de(TO(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(VE(b,k))}M==null||M(b),l==null||l(b)},T=j=>{if(!m)return;const V=CE(j);o&&(V&&j.button===0||!V)&&KE({event:j,handleId:E,nodeId:m,onConnect:R,isTarget:y,getState:v.getState,setState:v.setState,isValidConnection:n||v.getState().isValidConnection||XE}),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=TE(j.target),C=n||k||XE,{connection:D,isValid:U}=YE({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)});QE.displayName="Handle";var No=O.memo(QE);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 JE=({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}));JE.displayName="InputNode";var ZE=O.memo(JE);const e0=({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);e0.displayName="OutputNode";var t0=O.memo(e0);const Gd=()=>null;Gd.displayName="GroupNode";const AO=e=>({selectedNodes:e.getNodes().filter(t=>t.selected),selectedEdges:e.edges.filter(t=>t.selected)}),ma=e=>e.id;function IO(e,t){return Ge(e.selectedNodes.map(ma),t.selectedNodes.map(ma))&&Ge(e.selectedEdges.map(ma),t.selectedEdges.map(ma))}const n0=O.memo(({onSelectionChange:e})=>{const t=Ie(),{selectedNodes:n,selectedEdges:r}=de(AO,IO);return O.useEffect(()=>{const o={nodes:n,edges:r};e==null||e(o),t.getState().onSelectionChange.forEach(s=>s(o))},[n,r,e]),null});n0.displayName="SelectionListener";const CO=e=>!!e.onSelectionChange;function LO({onSelectionChange:e}){const t=de(CO);return e||t?H.createElement(n0,{onSelectionChange:e}):null}const bO=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 DO=({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(bO,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},r0={display:"none"},kO={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},o0="react-flow__node-desc",s0="react-flow__edge-desc",PO="react-flow__aria-live",MO=e=>e.ariaLiveMessage;function UO({rfId:e}){const t=de(MO);return H.createElement("div",{id:`${PO}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:kO},t)}function FO({rfId:e,disableKeyboardA11y:t}){return H.createElement(H.Fragment,null,H.createElement("div",{id:`${o0}-${e}`,style:r0},"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:`${s0}-${e}`,style:r0},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!t&&H.createElement(UO,{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=l0(h.code,l);s.current.add(h[y]),i0(i,s.current,!1)&&(h.preventDefault(),r(!0))},f=h=>{if((!o.current||o.current&&!t.actInsideInputWithModifier)&&Pd(h))return!1;const y=l0(h.code,l);i0(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 i0(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(o=>t.has(o)))}function l0(e,t){return t.includes(e)?"code":"key"}function a0(e,t,n,r){var i,l;if(!e.parentNode)return n;const o=t.get(e.parentNode),s=Ro(o,r);return a0(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 c0(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}=a0(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)}),c0(o,n,s),o}function u0(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}=zE(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 jO(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 VO(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:jO(e,o)}),i==null||i(e)),t!=null&&t.length&&(c&&r({edges:VO(t,s)}),l==null||l(t))}const To=()=>{},$O={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},HO=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection}),BO=()=>{const e=Ie(),{d3Zoom:t,d3Selection:n}=de(HO,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=>u0(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}=zE(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=$E(o,s);return{x:c.x+l,y:c.y+a}},viewportInitialized:!0}:$O,[t,n])};function Kd(){const e=BO(),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=BE(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=uO(y),m=v?null:t.getState().nodeInternals.get(y.id);return[v?y:AE(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=AE(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 zO={actInsideInputWithModifier:!1};var WO=({deleteKeyCode:e,multiSelectionKeyCode:t})=>{const n=Ie(),{deleteElements:r}=Kd(),o=Oo(e,zO),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 GO(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},YO=(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}`),d0=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),f0=e=>{const t=e.ctrlKey&&da()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t},KO=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),XO=({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(KO,Ge),b=Oo(v),k=O.useRef(0),F=O.useRef(!1),C=O.useRef();return GO(P),O.useEffect(()=>{if(P.current){const D=P.current.getBoundingClientRect(),U=nO().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(f0),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=f0(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&&d0(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&&d0(f,k.current??0)&&!L.current&&r(D.sourceEvent),L.current=!1,(n||U)&&YO(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)},QO=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function qO(){const{userSelectionActive:e,userSelectionRect:t}=de(QO,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 p0(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 h0(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&&p0(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&&p0(r,i);break}case"remove":return r}return r.push(i),r},n)}function m0(e,t){return h0(e,t)}function JO(e,t){return h0(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))},ZO=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),g0=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(ZO,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=HE(b,Y,F,t===ti.Partial,!0,U),J=BE(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))});g0.displayName="Pane";function E0(e,t){if(!e.parentNode)return!1;const n=t.get(e.parentNode);return n?n.selected?!0:E0(n,t):!1}function y0(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 eT(e,t,n,r){return Array.from(e.values()).filter(o=>(o.selected||o.id===r)&&(!o.parentNode||!E0(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 tT(e,t){return!t||t==="parent"?t:[t[0],[t[1][0]-(e.width||0),t[1][1]-(e.height||0)]]}function v0(e,t,n,r,o=[0,0],s){const i=tT(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 _0=(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 nT(){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 S0({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=nT();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=v0($,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]=OE(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=eT(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=f1().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||!y0(P,`.${n}`,e))&&(!r||y0(P,r,e))});return S.call(T),()=>{S.on(".drag",null)}}}},[e,t,n,r,s,l,o,i,g]),a}function x0(){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}=v0(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=x0(),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(IE.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=S0({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:`${o0}-${D}`,"aria-label":C},H.createElement(EO,{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 rT=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 oT({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=Ie(),{width:o,height:s,x:i,y:l,transformString:a,userSelectionActive:c}=de(rT,Ge),u=x0(),f=O.useRef(null);if(O.useEffect(()=>{var E;n||(E=f.current)==null||E.focus({preventScroll:!0})},[n]),S0({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 sT=O.memo(oT);const iT=e=>e.nodesSelectionActive,R0=({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(iT),$=Oo(f),B=Oo(m),W=B||I,z=B||R,Y=$||p&&W!==!0;return WO({deleteKeyCode:l,multiSelectionKeyCode:v}),H.createElement(XO,{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(g0,{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(sT,{onSelectionContextMenu:k,noPanClassName:C,disableKeyboardA11y:D})))};R0.displayName="FlowRenderer";var lT=O.memo(R0);function aT(e){return de(O.useCallback(n=>e?HE(n.nodeInternals,{x:0,y:0,width:n.width,height:n.height},n.transform,!0):n.getNodes(),[e]))}function cT(e){const t={input:si(e.input||ZE),default:si(e.default||Wd),output:si(e.output||t0),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 uT=({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]},dT=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),N0=e=>{const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:o,updateNodeDimensions:s,onError:i}=de(dT,Ge),l=aT(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,_=uT({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})}))};N0.displayName="NodeRenderer";var fT=O.memo(N0);const pT=(e,t,n)=>n===q.Left?e-t:n===q.Right?e+t:e,hT=(e,t,n)=>n===q.Top?e-t:n===q.Bottom?e+t:e,w0="react-flow__edgeupdater",O0=({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([w0,`${w0}-${l}`]),cx:pT(t,r,e),cy:hT(n,r,e),r,stroke:"transparent",fill:"transparent"}),mT=()=>!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||mT,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)};KE({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(IE.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?`${s0}-${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(O0,{position:T,centerX:S,centerY:_,radius:F,onMouseDown:tr,onMouseEnter:nr,onMouseOut:Dr,type:"source"}),(X==="target"||X===!0)&&H.createElement(O0,{position:L,centerX:x,centerY:R,radius:F,onMouseDown:Xo,onMouseEnter:nr,onMouseOut:Dr,type:"target"})))};return t.displayName="EdgeWrapper",O.memo(t)};function gT(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 T0(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 A0(e,t){return e?e.length===1||!t?e[0]:t&&e.find(n=>n.id===t)||null:null}const ET=(e,t,n,r,o,s)=>{const i=T0(n,e,t),l=T0(s,r,o);return{sourceX:i.x,sourceY:i.y,targetX:l.x,targetY:l.y}};function yT({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 I0(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 vT=[{level:0,isMaxLevel:!0,edges:[]}];function _T(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?vT:s}function ST(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)&&yT({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 _T(r,t,n)}const xT=({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"}),RT=({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"}),C0={[ni.Arrow]:xT,[ni.ArrowClosed]:RT};function NT(e){const t=Ie();return O.useMemo(()=>{var o,s;return Object.prototype.hasOwnProperty.call(C0,e)?C0[e]:((s=(o=t.getState()).onError)==null||s.call(o,"009",En.error009(e)),null)},[e])}const wT=({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=NT(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},OT=({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))},L0=({defaultColor:e,rfId:t})=>{const n=de(O.useCallback(OT({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(wT,{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})))};L0.displayName="MarkerDefinitions";var TT=O.memo(L0);const AT=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}),b0=({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(AT,Ge),P=ST(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(TT,{defaultColor:e,rfId:r}),H.createElement("g",null,j.map(M=>{const[w,b,k]=I0(T.get(M.source)),[F,C,D]=I0(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=A0(b.source,M.sourceHandle),z=A0(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}=ET(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};b0.displayName="EdgeRenderer";var IT=O.memo(b0);const CT=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function LT({children:e}){const t=de(CT);return H.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:t}},e)}function bT(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 DT={[q.Left]:q.Right,[q.Right]:q.Left,[q.Top]:q.Bottom,[q.Bottom]:q.Top},D0=({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?DT[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?[_]=FE(x):r===Gn.Step?[_]=ri({...x,borderRadius:0}):r===Gn.SmoothStep?[_]=ri(x):r===Gn.SimpleBezier?[_]=kE(x):_=`M${v},${m} ${a},${c}`,H.createElement("path",{d:_,fill:"none",className:"react-flow__connection-path",style:n})};D0.displayName="ConnectionLine";const kT=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function PT({containerStyle:e,style:t,type:n,component:r}){const{nodeId:o,handleType:s,nodesConnectable:i,width:l,height:a,connectionStatus:c}=de(kT,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(D0,{nodeId:o,handleType:s,style:t,type:n,CustomComponent:r,connectionStatus:c})))}function k0(e,t){return O.useRef(null),Ie(),O.useMemo(()=>t(e),[e])}const P0=({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=k0(e,cT),xt=k0(t,gT);return bT(s),H.createElement(lT,{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(LT,null,H.createElement(IT,{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(PT,{style:g,type:m,component:S,containerStyle:_})),H.createElement("div",{className:"react-flow__edgelabel-renderer"}),H.createElement(fT,{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})))};P0.displayName="GraphView";var MT=O.memo(P0);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:dO,isValidConnection:void 0},UT=()=>NR((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:_0(".source",v.nodeElement,p,c),target:_0(".target",v.nodeElement,p,c)}},...g}),y.push({id:m.id,type:"dimensions",dimensions:g}))}return y},[]);c0(o,c);const E=i||s&&!i&&u0(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=m0(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=UT()),H.createElement(rO,{value:t.current},e)};tf.displayName="ReactFlowProvider";const M0=({children:e})=>O.useContext(ua)?H.createElement(H.Fragment,null,e):H.createElement(tf,null,e);M0.displayName="ReactFlowWrapper";const FT={input:ZE,default:Wd,output:t0,group:Gd},jT={default:ha,straight:Fd,step:Ud,smoothstep:fa,simplebezier:Md},VT=[0,0],$T=[15,15],HT={x:0,y:0,zoom:1},BT={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},U0=O.forwardRef(({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:o,nodeTypes:s=FT,edgeTypes:i=jT,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=$T,onlyRenderVisibleElements:tn=!1,selectNodesOnDrag:Le=!0,nodesDraggable:ye,nodesConnectable:ut,nodesFocusable:St,nodeOrigin:ee=VT,edgesFocusable:Cr,edgesUpdatable:Lr,elementsSelectable:Ri,defaultViewport:Ko=HT,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:RD,onEdgeContextMenu:ND,onEdgeDoubleClick:wD,onEdgeMouseEnter:OD,onEdgeMouseMove:TD,onEdgeMouseLeave:AD,onEdgeUpdateStart:ID,onEdgeUpdateEnd:CD,edgeUpdaterRadius:LD=10,onNodesChange:bD,onEdgesChange:DD,noDragClassName:kD="nodrag",noWheelClassName:PD="nowheel",noPanClassName:Wv="nopan",fitView:MD=!1,fitViewOptions:UD,connectOnClick:FD=!0,attributionPosition:jD,proOptions:VD,defaultEdgeOptions:$D,elevateNodesOnSelect:HD=!0,elevateEdgesOnSelect:BD=!1,disableKeyboardA11y:Gv=!1,autoPanOnConnect:zD=!0,autoPanOnNodeDrag:WD=!0,connectionRadius:GD=20,isValidConnection:YD,onError:KD,style:XD,id:Yv,nodeDragThreshold:QD,...qD},JD)=>{const Kf=Yv||"1";return H.createElement("div",{...qD,style:{...XD,...BT},ref:JD,className:Je(["react-flow",o]),"data-testid":"rf__wrapper",id:Yv},H.createElement(M0,null,H.createElement(MT,{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:RD,onEdgeContextMenu:ND,onEdgeDoubleClick:wD,onEdgeMouseEnter:OD,onEdgeMouseMove:TD,onEdgeMouseLeave:AD,onEdgeUpdateStart:ID,onEdgeUpdateEnd:CD,edgeUpdaterRadius:LD,defaultMarkerColor:Ni,noDragClassName:kD,noWheelClassName:PD,noPanClassName:Wv,elevateEdgesOnSelect:BD,rfId:Kf,disableKeyboardA11y:Gv,nodeOrigin:ee,nodeExtent:Dr}),H.createElement(DO,{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:HD,minZoom:br,maxZoom:tr,nodeExtent:Dr,onNodesChange:bD,onEdgesChange:DD,snapToGrid:Re,snapGrid:Me,connectionMode:D,translateExtent:Xo,connectOnClick:FD,defaultEdgeOptions:$D,fitView:MD,fitViewOptions:UD,onNodesDelete:I,onEdgesDelete:j,onNodeDragStart:T,onNodeDrag:L,onNodeDragStop:P,onSelectionDrag:w,onSelectionDragStart:M,onSelectionDragStop:b,noPanClassName:Wv,nodeOrigin:ee,rfId:Kf,autoPanOnConnect:zD,autoPanOnNodeDrag:WD,onError:KD,connectionRadius:GD,isValidConnection:YD,nodeDragThreshold:QD}),H.createElement(LO,{onSelectionChange:V}),Ur,H.createElement(sO,{proOptions:VD,position:jD}),H.createElement(FO,{rfId:Kf,disableKeyboardA11y:Gv})))});U0.displayName="ReactFlow";const zT=e=>{var t;return(t=e.domNode)==null?void 0:t.querySelector(".react-flow__edgelabel-renderer")};function WT({children:e}){const t=de(zT);return t?Bl.createPortal(e,t):null}function GT(){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 YT({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 KT=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}),XT={includeHiddenNodes:!1};function QT(e=XT){return de(KT(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 JT(){return H.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},H.createElement("path",{d:"M0 0h32v4.2H0z"}))}function ZT(){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 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 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 tA(){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 nA=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom}),F0=({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(nA,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(JT,null))),n&&H.createElement(ii,{className:"react-flow__controls-fitview",onClick:T,title:"fit view","aria-label":"fit view"},H.createElement(ZT,null)),r&&H.createElement(ii,{className:"react-flow__controls-interactive",onClick:L,title:"toggle interactivity","aria-label":"toggle interactivity"},y?H.createElement(tA,null):H.createElement(eA,null)),u)};F0.displayName="Controls";var rA=O.memo(F0),Ct;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Ct||(Ct={}));function oA({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 sA({color:e,radius:t}){return H.createElement("circle",{cx:t,cy:t,r:t,fill:e})}const iA={[Ct.Dots]:"#91919a",[Ct.Lines]:"#eee",[Ct.Cross]:"#e2e2e2"},lA={[Ct.Dots]:1,[Ct.Lines]:1,[Ct.Cross]:6},aA=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function j0({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(aA,Ge),p=i||iA[t],h=r||lA[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(sA,{color:p,radius:g/s}):H.createElement(oA,{dimensions:S,color:p,lineWidth:o})),H.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${f+e})`}))}j0.displayName="Background";var cA=O.memo(j0),V0={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:uA}=H,{useSyncExternalStoreWithSelector:dA}=Ag;let $0=!1;function fA(e,t=e.getState,n){(V0?"staging":void 0)!=="production"&&n&&!$0&&(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"),$0=!0);const r=dA(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return uA(r),r}const H0=e=>{(V0?"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"?Cg(e):e,n=(r,o)=>fA(t,r,o);return Object.assign(n,t),n},bo=e=>e?H0(e):H0,pA=!1,hA="staging",mA="0.0.13",li="0.0.10",B0=230,gA=640,z0=20,Do={markerEnd:{height:20,type:ni.ArrowClosed,width:20},style:{stroke:"inherit",strokeWidth:1.5},type:"floating"},EA="422",yA="404",W0="document-sync",nf=1e3,vA=1e3,_A=300,SA=5e3,G0=300,xA="Shift+Backspace",RA="Meta",NA="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},wA=(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)},Y0=e=>({...e,...Do}),K0=e=>e.type==="handleCall"?{...e,deletable:!1}:e,X0=e=>e==="success"?"positive":"negative",OA=e=>e.toLowerCase().replace(/ /g,"-"),yt=e=>typeof e=="string"?e.trim():e,Q0=(e,t,n)=>e.sort((r,o)=>{const s=r[n],i=o[n];if(typeof s=="string"&&typeof i=="string")return s.toLowerCase().localeCompare(i.toLowerCase());if(typeof s=="number"&&typeof i=="number")return s-i;throw new Error(`sort fn can only sort strings & numbers, but got ${typeof s} and ${typeof i}`)}),TA=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 J0(e){return new Promise(t=>setTimeout(t,e))}const AA=(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},Z0=(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},IA=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"}]}),ey={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:[]})},CA={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||CA,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 ty(e){return e==null?"":""+e}function LA(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 ny(e,t,n){const{obj:r,k:o}=lf(e,t,Object);r[o]=n}function bA(e,t,n,r){const{obj:o,k:s}=lf(e,t,Object);o[s]=o[s]||[],o[s].push(n)}function Sa(e,t){const{obj:n,k:r}=lf(e,t);if(n)return n[r]}function DA(e,t,n){const r=Sa(e,n);return r!==void 0?r:Sa(t,n)}function ry(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]):ry(e[r],t[r],n):e[r]=t[r]);return e}function ko(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var kA={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function PA(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,t=>kA[t]):e}const MA=[" ",",","?","!",";"];function UA(e,t,n){t=t||"",n=n||"";const r=MA.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 oy 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),ny(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?ry(a,r,s):a={...a,...r},ny(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 sy={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 iy={};class Na extends _a{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),LA(["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&&!UA(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=sy.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,!iy[`${y[0]}-${v}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(l)&&(iy[`${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 ly{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 FA=[{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}],jA={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 VA=["v1","v2","v3"],$A=["v4"],ay={zero:0,one:1,two:2,few:3,many:4,other:5};function HA(){const e={};return FA.forEach(t=>{t.lngs.forEach(n=>{e[n]={numbers:t.nr,plurals:jA[t.fc]}})}),e}class BA{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||$A.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=HA()}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)=>ay[o]-ay[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!VA.includes(this.options.compatibilityJSON)}}function cy(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=DA(e,t,n);return!s&&o&&typeof n=="string"&&(s=xa(e,n,r),s===void 0&&(s=xa(t,n,r))),s}class zA{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:PA,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=cy(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(cy(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=ty(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=ty(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 WA(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 GA{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}=WA(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 YA(e,t){e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)}class KA 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=>{bA(a.loaded,[s],i),YA(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 uy(){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 dy(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 XA(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=dy(t),this.services={},this.logger=Jt,this.modules={external:[]},XA(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=uy();this.options={...o,...this.options,...dy(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=GA);const f=new ly(this.options);this.store=new oy(this.options.resources,this.options);const p=this.services;p.logger=Jt,p.resourceStore=this.store,p.languageUtils=f,p.pluralResolver=new BA(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 zA(this.options),p.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},p.backendConnector=new KA(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"&&sy.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 ly(uy());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 oy(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 QA(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);if(ui(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function JA(e){var t=qA(e,"string");return ui(t)=="symbol"?t:String(t)}function ZA(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,JA(r.key),r)}}function eI(e,t,n){return t&&ZA(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var fy=[],tI=fy.forEach,nI=fy.slice;function rI(e){return tI.call(nI.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]+$/,oI=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=oI(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)}},sI={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)}},iI={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},lI={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},aI={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)}},cI={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}},uI={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}},dI={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}},fI={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 pI(){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]:{};QA(this,e),this.type="languageDetector",this.detectors={},this.init(t,n)}return eI(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=rI(r,this.options||{},pI()),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(sI),this.addDetector(iI),this.addDetector(lI),this.addDetector(aI),this.addDetector(cI),this.addDetector(uI),this.addDetector(dI),this.addDetector(fI)}},{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 hI={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 mI=Ba(hI);var gI=/\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],(mI[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(gI),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 EI=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,yI=/^\s*$/,vI=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 _I={parse:function(e,t){t||(t={}),t.components||(t.components=vI);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(EI,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);yI.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 SI(){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 xI=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,RI={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},NI=e=>RI[e];let uf={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:e=>e.replace(xI,NI)};function wI(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};uf={...uf,...e}}function OI(){return uf}let Sy;function TI(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 AI(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 II(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 CI(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=_I.parse(`<0>${t}</0>`),f={...a,...o};function p(v,m,g){const S=ff(v),_=E(S,m.children,g);return AI(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?II({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 LI(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 SI("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={...OI(),...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=CI(c||t,P,y,m,L,h),j=r!==void 0?r:m.defaultTransParent;return j?O.createElement(j,E,I):I}const bI={type:"3rdParty",init(e){wI(e.options.react),TI(e)}},DI=O.createContext();function kI(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(DI)||{},m=f||y||xy(),g=p||m&&m.t.bind(m);return LI({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 PI={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"]},MI={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"]},UI={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"]},FI={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"]},jI=FI,VI={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"]},$I={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"]},HI={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"]},BI={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"]},zI={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"]},WI={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"]},GI={prefix:"fas",iconName:"circle-small",icon:[320,512,[],"e122","M0 256a160 160 0 1 1 320 0A160 160 0 1 1 0 256z"]},YI={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"]},KI={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"]},XI={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"]},QI={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"]},qI={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"]},JI={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 ZI={"arrow-left":WI,"arrow-right":BI,"arrow-turn-down-right":HI,"arrows-rotate":$I,bars:MI,bolt:KI,"circle-check":VI,"circle-exclamation":UI,"circle-info":YI,"circle-question":zI,"circle-small":GI,"circle-xmark":JI,"clock-rotate-left":QI,"dot-circle":jI,"trash-can":PI,"triangle-exclamation":qI,xmark:XI},oe=O.forwardRef(function({className:t="",size:n="",tag:r},o){const s=ZI[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(oe,{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)})]})]})})},eC=e=>{const t=Q(n=>n.viewport.zoom);return d.jsx(Uo,{scale:t,...e})},tC=Ne(),nC=100,rC=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){tC.error(`Node with id ${c} not found`);return}const f=((h=o==null?void 0:o.getNode(c))==null?void 0:h.height)??rC,p=((E=o==null?void 0:o.getNode(c))==null?void 0:E.width)??B0;o==null||o.fitBounds({height:f+nC,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(oe,{className:"absolute left-[.25rem] top-[.5rem] text-foreground/40",tag:s?"arrow-left":"arrow-right"})]})},oC=({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(oe,{size:"lg",tag:"arrow-turn-down-right"})}),d.jsx("div",{className:"w-full overflow-hidden",children:e})]}),sC=({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(oe,{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(oe,{className:"px-1 text-warning",size:"lg",tag:"bolt"}),A(N.NOT_CONNECTED_TO_FLOW)]})]}),t&&!l&&d.jsx(eC,{handleDelete:()=>i(r),label:A(N.REMOVE_NODE,{title:o}),show:s})]})},iC=({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(oe,{size:"lg",tag:"triangle-exclamation"})}),children:A(N.INFO_INVALID_SETTINGS)}),A(N.INVALID_SETTINGS)]})}),lC=({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}},aC=({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}=lC({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:B0},children:[a&&t&&d.jsx(aC,{id:t,isConnectable:n}),d.jsx(sC,{connected:!a||u,deletable:i,isRoot:r,nodeId:t,nodeTitle:o,selected:s}),l&&d.jsx(iC,{valid:c}),e]})})},cC=({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(oe,{tag:"xmark",size:"xs"})]})]})})},wy=({data:e})=>{let t=e.selected&&e[e.selected].trim();return t&&e.selected==="url"&&(t=TA(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})]})},uC=({label:e,vars:t={}})=>d.jsx(kI,{components:{a:d.jsx("a",{className:"underline hover:text-background/80",href:t.linkTo||"#",target:"_blank",rel:"noopener noreferrer"}),code:d.jsx(oC,{}),p:d.jsx("p",{className:"mb-2"})},i18nKey:e}),dC={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 ${dC[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})]}),fC=({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(fC,{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 pC(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 hC(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 mC(){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 gC(e){return!yC()&&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 EC(){return/apple/i.test(navigator.vendor)}function yC(){const e=/android/i;return e.test(Cy())||e.test(mC())}function vC(){return Cy().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function Ly(e,t){const n=["mouse","pen"];return n.push("",void 0),n.includes(e)}function _C(e){return"nativeEvent"in e}function SC(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 xC="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function RC(e){return vt(e)&&e.matches(xC)}const Vo=Math.min,Or=Math.max,Ia=Math.round,Ca=Math.floor,Jn=e=>({x:e,y:e}),NC={left:"right",right:"left",bottom:"top",top:"bottom"},wC={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 OC(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 TC(e){const t=ba(e);return[_f(e),t,_f(t)]}function _f(e){return e.replace(/start|end/g,t=>wC[t])}function AC(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 IC(e,t,n,r){const o=gi(e);let s=AC(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=>NC[t])}function CC(e){return{top:0,right:0,bottom:0,left:0,...e}}function Dy(e){return typeof e!="number"?CC(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 LC=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}}}),bC=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)]:TC(l));!p&&E!=="none"&&_.push(...IC(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=OC(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 DC(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 kC=function(e){return{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:l}=t,a=await DC(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}}}}},PC=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 MC=Jn(0);function Fy(e){const t=it(e);return!mf()||!t.visualViewport?MC:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function UC(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=UC(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 FC(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 jC(e){return Array.from(e.getClientRects())}function jy(e){return Ar(vn(e)).left+Aa(e).scrollLeft}function VC(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 $C(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 HC(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=$C(e,n);else if(t==="document")r=VC(vn(e));else if(ge(t))r=HC(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 BC(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 zC(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?BC(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 WC(e){return Uy(e)}function GC(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&&pC(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||hC(e)||n}const YC=async function(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||By,s=this.getDimensions;return{reference:GC(t,await o(n),r),floating:{x:0,y:0,...await s(n)}}};function KC(e){return _t(e).direction==="rtl"}const XC={convertOffsetParentRelativeRectToViewportRelativeRect:FC,getDocumentElement:vn,getClippingRect:zC,getOffsetParent:By,getElementRects:YC,getClientRects:jC,getDimensions:WC,getScale:$o,isElement:ge,isRTL:KC};function QC(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 qC(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?QC(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 JC=(e,t,n)=>{const r=new Map,o={platform:XC,...n},s={...o.platform,_c:r};return LC(e,t,{...o,platform:s})},ZC=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 e2(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),JC(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 t2=ap.useInsertionEffect||(e=>e());function Ho(e){const t=O.useRef(()=>{});return t2(()=>{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,n2=0;const Ky=()=>"floating-ui-"+n2++;function r2(){const[e,t]=O.useState(()=>xf?Ky():void 0);return Ei(()=>{e==null&&t(Ky())},[]),O.useEffect(()=>{xf||(xf=!0)},[]),e}const Xy=ap.useId||r2;function o2(){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 s2=O.createContext(null),i2=O.createContext(null),Rf=()=>{var e;return((e=O.useContext(s2))==null?void 0:e.id)||null},Nf=()=>O.useContext(i2);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 l2(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 a2={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},c2={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 u2(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,_C(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)&&!SC(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,[a2[E]]:b=>{h&&r(!1,b.nativeEvent,"reference-press")}},floating:{onKeyDown:j,onMouseDown(){R.current=!0},onMouseUp(){R.current=!0},[c2[p]]:()=>{x.current=!0}}}:{},[c,h,p,E,r,j])}function d2(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=e2(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(()=>o2())[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 f2(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){gC(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(EC()&&vC())throw Error();if(!E.matches(":focus-visible"))return}catch{if(!p.current&&!RC(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 p2(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 h2=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function m2(e,t){var n;t===void 0&&(t={});const{open:r,floatingId:o}=e,{enabled:s=!0,role:i="dialog"}=t,l=(n=h2.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 g2(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function E2(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=g2(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 y2({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=d2({middleware:[kC(8),bC({boundary:document.querySelector(`#${c}`)||void 0}),PC({padding:4}),ZC({element:u,padding:e??{bottom:0,left:8,right:8,top:8}})],onOpenChange:E,open:h,placement:l,strategy:"fixed",whileElementsMounted:qC}),v=y.context,m=l2(v,{enabled:s==null,handleClose:r?E2():null,move:!1}),g=f2(v,{enabled:s==null}),S=u2(v,{escapeKey:t,outsidePress:i}),_=m2(v,{role:a}),x=p2([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},v2=({children:e,...t})=>{const n=y2(t);return d.jsx(nv.Provider,{value:n,children:e})},_2={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"},S2=()=>{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=`${_2[o]}`;return d.jsx("div",{ref:e.arrowRef,style:r,className:`tooltip-arrow absolute h-2 w-2 rotate-45 bg-inherit
|
|
62
62
|
before:absolute before:h-2 before:w-2 before:border before:border-foreground/30 before:content-['']
|
|
63
|
-
${s}`})},R2=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(x2,{})]}):null}),N2=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(_2,{...i,placement:r,children:[d.jsx(N2,{asChild:e,children:s}),d.jsx(R2,{style:o!==1?{transform:`scale(${o})`,transformOrigin:rv[l]}:void 0,children:t})]}):d.jsx(d.Fragment,{children:s})},w2={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"},O2={order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag","path","subdomain"],lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupQuerystring:"lng",lookupSessionStorage:"i18nextLng",caches:["localStorage","cookie"],excludeCacheFor:["cimode"]},T2={"en-US":{translation:w2}},A2=async()=>{await Ve.use(Ey).use(DI).init({debug:hA,detection:O2,fallbackLng:"en-US",interpolation:{escapeValue:!1},keySeparator:!1,resources:T2})};function Ua(e,t){return d.jsx(dC,{label:e,vars:t})}const ov=()=>Ve.resolvedLanguage,I2={entries:[],nextLabelIndex:0},Bo=bo((e,t)=>({...I2,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})},C2=(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}}}},L2=e=>typeof e=="object"&&e!==null&&Object.keys(e).length>0,b2=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 L2(a)&&(l=i(l,a)),b2(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}}}},D2=Object.entries(Fa).reduce((e,[,{nodes:t}])=>(Object.entries(t).forEach(([n,{label:r}])=>{e.set(n,r)}),e),new Map),k2=Object.entries(Fa).reduce((e,[,{nodes:t}])=>(Object.entries(t).forEach(([n,{infoLabel:r}])=>{e.set(n,r)}),e),new Map),ja=Ne(),P2={aiAgentMap:new Map,error:"",status:"initial"},M2=(e,t)=>({...P2,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()(M2),U2=()=>en.getState().actions;window.__useAiAgentStore=en;const F2=e=>!!(e&&e>=yA),j2=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=F2("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(),V2=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(vA)?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(),$2={cachedResults:new Map,error:"",results:[],status:"initial",swmlScriptMap:new Map},H2={ids:"ids",name:"name"},B2=(e,t)=>({...$2,actions:{buildParamsFromQuery:n=>{const{searchParams:r}=new URL(n,window.location.href);return LA(H2).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",z2=(e,t)=>{if(e.some(uv)){const{validateScriptsFromNodes:r}=_n.getState().actions;r(e,t)}},_n=bo()(B2),dv=()=>_n.getState().actions;window.__useSwmlScriptStore=_n;const fv=500,W2=100,Oe=Ne(),G2=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},Y2=(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();TA(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:SO(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:JO(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([G2])}),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),z2(g.nodes,l)}catch(a){Oe.error("Could not load flow. URL:",s);let c="unknown";a instanceof Error&&a.message.includes(_A)&&(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;C2(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})},W2),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=D2.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()(j2(V2(Y2))),Te=()=>Q.getState().actions;window.__useRFStore=Q;const K2={"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"}},X2=({errorType:e})=>{const t=Q(s=>s.backButtonHref),{title:n,message:r,status:o}=K2[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"})})}),Q2=({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 q2({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 J2=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}=q2({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(WT,{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)})]})})]})},Z2=/^[\w\d -']+$/,eL=/^\d+$/,tL=/^\d|\*|#$/,nL=/^[\d*#$]{0,12}$/,rL=/^.{1,20}$/,zo={MAX:3600,MIN:0},oL=/^[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(eL)(e):!0,sL=e=>yt(e)?Wo(tL)(e):!0,iL=e=>yt(e)?Wo(Z2)(e):!0,lL=e=>yt(e)?Wo(oL)(e):!0,hv=e=>yt(e)?Wo(nL)(e):!0,aL=e=>yt(e)?Wo(rL)(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:[iL],digit:[sL],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,aL],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,lL],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},cL=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=cL(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}},uL=({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})]})},dL=({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"})}),fL=({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)})]})})),pL=({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)})]})]})},hL=({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,mL={busy:N.BUSY,decline:N.DECLINE,error:N.ERROR,noAnswer:N.NO_ANSWER,success:N.SUCCESS},gL={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(gL[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(mL[i.result])},i.id))})]})},EL=({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))]})]})},yL=({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},vL=({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])})})}),_L=({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})]})),SL=({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"})]})},xL=({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})]})},RL=({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"})]})},NL={failed:N.FAILED,success:N.SUCCESS},gv={aiAgent:uL,answer:dL,cond:fL,condRequest:pL,executeSWML:hL,forwardAddress:Uf,forwardPhone:Uf,forwardResource:Uf,handleCall:yL,hangup:vL,play:_L,promptPlay:EL,record:RL,recordCallStart:SL,recordCallStop:xL,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(NL[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"})]})}},wL={floating:J2},OL=({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:Q2,connectionMode:Wn.Strict,deleteKeyCode:r?NA:null,defaultEdgeOptions:Do,edges:n,edgeTypes:wL,elementsSelectable:r,fitViewOptions:rf,multiSelectionKeyCode:r?wA: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?OA:null,snapGrid:[ya,ya],snapToGrid:!0,children:[d.jsx(cA,{className:"bg-background-alt text-grid",color:"currentColor",gap:[ya,ya],variant:Ct.Dots}),e]})})},TL=()=>{const e=Q(l=>l.initializing),t=Q(l=>l.reactFlowInstance),{setInitializing:n,setViewportChanging:r}=Te(),o=O.useRef(!1),s=QT({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])},AL=()=>{const{onViewportChange:e,onViewportChangeEnd:t,onViewportChangeStart:n}=Te();return TL(),YT({onChange:e,onEnd:t,onStart:n}),null},IL=()=>{const e=Q(n=>n.selectedNode),t=e?k2.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},CL=e=>{var s;const t=O.useRef(),n=GT(),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)}}},LL="/hello/.test('%{foo}')",bL=()=>({id:le(),value:""}),jf=({nodeData:e,handleOnUpdate:t,placeholder:n=LL})=>{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,bL()]})},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)})})]})},DL=Ne(),Si=(e,t)=>[e,t].filter(Boolean).join("-").toLowerCase(),kL={idsByKey:{},languageById:{},voiceById:{}},PL=(e,t)=>({...kL,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="/cfb/voices.json"})=>{try{DL.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()(PL),ML=()=>Vf.getState().actions;window.__useVoiceStore=Vf;const Ev=e=>d.jsx("option",{value:e.id,children:e.name},e.key??e.id),UL=({onChange:e,languageId:t,gender:n,voiceId:r})=>{const{getLanguages:o,getVoicesByKeys:s,getGenderByKeys:i}=ML();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(FL,{nodeData:n,onChange:a,voiceSettingsChangeHandler:c,selected:l,valid:s[l]})]})},FL=({nodeData:e,onChange:t,voiceSettingsChangeHandler:n,selected:r,valid:o})=>{const s=e[r],l={text:d.jsxs(d.Fragment,{children:[d.jsx(UL,{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})},jL=[{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:jL.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})})]}),VL=({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}=U2();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})},$L=["GET","POST","PUT","DELETE"],HL=({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:$L.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})]})},BL=({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})})})},zL=({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]},WL=Ne(),GL=({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=>{WL.error("Error fetching swml scripts",E)})},W0);return()=>clearTimeout(h)},[s,i,e,a,l,u,c]),[n,r,o]},Hf=e=>e==="external",YL={externalValue:"",focusedId:"",focusedName:"",open:!1,query:""},KL=({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({...YL,externalValue:Hf(e)?n:"",query:t??""}),y=Hf(e),v=h.query===""||h.query.toLocaleLowerCase()===t.toLocaleLowerCase(),[m,g]=GL({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=CA(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(XL,{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})}),XL=({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}),QL=({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(KL,{onChange:o,confirmId:e,confirmName:t,confirmUrl:n,valid:i})})]})},qL={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},JL=()=>({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=qL[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,JL()]})},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(QL,{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))})})]})},ZL=()=>({command:"",digit:"",id:le()}),eb=({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,ZL()]})},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})})]})]})]})]})},tb=({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))]})})})},nb=({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})})})},rb=({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"})})]})},ob=({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)})})})},sb=({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"})})}),ib=["GET","POST","PUT","DELETE"],lb=({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:ib.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??""})})]})})},ab=({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})})]})})},cb=()=>({id:le(),key:"",value:""}),ub=({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,cb()]})},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)})})]})},db=e=>({id:le(),key:e}),fb=({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,db(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(
|
|
63
|
+
${s}`})},x2=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(S2,{})]}):null}),R2=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(oe,{tag:"circle-info"}),...i})=>{let l=r.split("-")[0];return l=Object.keys(rv).includes(l)?l:"right",n?d.jsxs(v2,{...i,placement:r,children:[d.jsx(R2,{asChild:e,children:s}),d.jsx(x2,{style:o!==1?{transform:`scale(${o})`,transformOrigin:rv[l]}:void 0,children:t})]}):d.jsx(d.Fragment,{children:s})},N2={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"},w2={order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag","path","subdomain"],lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupQuerystring:"lng",lookupSessionStorage:"i18nextLng",caches:["localStorage","cookie"],excludeCacheFor:["cimode"]},O2={"en-US":{translation:N2}},T2=async()=>{await Ve.use(Ey).use(bI).init({debug:pA,detection:w2,fallbackLng:"en-US",interpolation:{escapeValue:!1},keySeparator:!1,resources:O2})};function Ua(e,t){return d.jsx(uC,{label:e,vars:t})}const ov=()=>Ve.resolvedLanguage,A2={entries:[],nextLabelIndex:0},Bo=bo((e,t)=>({...A2,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})},I2=(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}}}},C2=e=>typeof e=="object"&&e!==null&&Object.keys(e).length>0,L2=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=ey[e]();return C2(a)&&(l=i(l,a)),L2(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}}}},b2=Object.entries(Fa).reduce((e,[,{nodes:t}])=>(Object.entries(t).forEach(([n,{label:r}])=>{e.set(n,r)}),e),new Map),D2=Object.entries(Fa).reduce((e,[,{nodes:t}])=>(Object.entries(t).forEach(([n,{infoLabel:r}])=>{e.set(n,r)}),e),new Map),ja=Ne(),k2={aiAgentMap:new Map,error:"",status:"initial"},P2=(e,t)=>({...k2,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=Q0(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()(P2),M2=()=>en.getState().actions;window.__useAiAgentStore=en;const U2=e=>!!(e&&e>=gA),F2=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=U2("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)===W0,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(),j2=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(EA)?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(),V2={cachedResults:new Map,error:"",results:[],status:"initial",swmlScriptMap:new Map},$2={ids:"ids",name:"name"},H2=(e,t)=>({...V2,actions:{buildParamsFromQuery:n=>{const{searchParams:r}=new URL(n,window.location.href);return IA($2).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=Q0(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})},G0)}})(),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",B2=(e,t)=>{if(e.some(uv)){const{validateScriptsFromNodes:r}=_n.getState().actions;r(e,t)}},_n=bo()(H2),dv=()=>_n.getState().actions;window.__useSwmlScriptStore=_n;const fv=500,z2=100,Oe=Ne(),W2=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},G2=(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 J0(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();wA(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 hp({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(K0),f=c.edges.map(Y0);e({detachedMode:!0,edges:[],initializing:!0,nodes:[]}),await J0(fv),e({edges:f,nodes:u,showDeployedHistoryToast:!0}),sv(u),av(u,s)}},onConnect:n=>{Oe.debug("onConnect"),e({edges:VE(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:SO(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:JO(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 hp({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([W2])}),e({documentLastUpdated:m,documentVersion:h,edges:g.edges.map(Y0),flowId:y,flowTitle:v,httpService:a,nodes:g.nodes.map(K0),reactFlowInstance:n}),sv(g.nodes),av(g.nodes,l),B2(g.nodes,l)}catch(a){Oe.error("Could not load flow. URL:",s);let c="unknown";a instanceof Error&&a.message.includes(yA)&&(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:m0(r,t().nodes)})},onNodesDelete:n=>{Oe.debug("onNodesDelete");const{actions:r}=t(),{partialUpdateNodeData:o}=r;I2(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})},z2),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=b2.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()(F2(j2(G2))),Te=()=>Q.getState().actions;window.__useRFStore=Q;const Y2={"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"}},K2=({errorType:e})=>{const t=Q(s=>s.backButtonHref),{title:n,message:r,status:o}=Y2[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"})})}),X2=({fromHandle:e,fromNode:t,fromPosition:n,fromX:r,fromY:o,toPosition:s,toX:i,toY:l})=>{if(!t)return null;const[a]=ri({borderRadius:z0,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 Q2({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 q2=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}=Q2({isCircular:E,targetNode:h,targetX:a,targetY:c}),[m,g,S]=ri({borderRadius:z0,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(WT,{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(oe,{tag:"trash-can",className:"py-0.5 px-1.5 text-background"}),d.jsx("span",{className:"sr-only",children:A(N.REMOVE_EDGE)})]})})]})},J2=/^[\w\d -']+$/,Z2=/^\d+$/,eL=/^\d|\*|#$/,tL=/^[\d*#$]{0,12}$/,nL=/^.{1,20}$/,zo={MAX:3600,MIN:0},rL=/^[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(Z2)(e):!0,oL=e=>yt(e)?Wo(eL)(e):!0,sL=e=>yt(e)?Wo(J2)(e):!0,iL=e=>yt(e)?Wo(rL)(e):!0,hv=e=>yt(e)?Wo(tL)(e):!0,lL=e=>yt(e)?Wo(nL)(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:[sL],digit:[oL],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,lL],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,iL],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},aL=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=aL(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}},cL=({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})]})},uL=({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"})}),dL=({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)})]})})),fL=({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)})]})]})},pL=({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,hL={busy:N.BUSY,decline:N.DECLINE,error:N.ERROR,noAnswer:N.NO_ANSWER,success:N.SUCCESS},mL={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(mL[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:X0(i.result),id:i.id,isConnectable:n,optionTitle:A(hL[i.result])},i.id))})]})},gL=({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))]})]})},EL=({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},yL=({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])})})}),vL=({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})]})),_L=({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"})]})},SL=({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})]})},xL=({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"})]})},RL={failed:N.FAILED,success:N.SUCCESS},gv={aiAgent:cL,answer:uL,cond:dL,condRequest:fL,executeSWML:pL,forwardAddress:Uf,forwardPhone:Uf,forwardResource:Uf,handleCall:EL,hangup:yL,play:vL,promptPlay:gL,record:xL,recordCallStart:_L,recordCallStop:SL,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:X0(s.result),id:s.id,isConnectable:n,optionTitle:A(RL[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"})]})}},NL={floating:q2},wL=({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(U0,{attributionPosition:"bottom-left",connectionLineComponent:X2,connectionMode:Wn.Strict,deleteKeyCode:r?xA:null,defaultEdgeOptions:Do,edges:n,edgeTypes:NL,elementsSelectable:r,fitViewOptions:rf,multiSelectionKeyCode:r?RA: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?NA:null,snapGrid:[ya,ya],snapToGrid:!0,children:[d.jsx(cA,{className:"bg-background-alt text-grid",color:"currentColor",gap:[ya,ya],variant:Ct.Dots}),e]})})},OL=()=>{const e=Q(l=>l.initializing),t=Q(l=>l.reactFlowInstance),{setInitializing:n,setViewportChanging:r}=Te(),o=O.useRef(!1),s=QT({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])},TL=()=>{const{onViewportChange:e,onViewportChangeEnd:t,onViewportChangeStart:n}=Te();return OL(),YT({onChange:e,onEnd:t,onStart:n}),null},AL=()=>{const e=Q(n=>n.selectedNode),t=e?D2.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(oe,{className:"shrink-0 text-primary",tag:"circle-info",size:"xl"}),d.jsx("div",{className:"text-xs font-medium",children:Ua(t)})]})}):null},IL=e=>{var s;const t=O.useRef(),n=GT(),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)}}},CL="/hello/.test('%{foo}')",LL=()=>({id:le(),value:""}),jf=({nodeData:e,handleOnUpdate:t,placeholder:n=CL})=>{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,LL()]})},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(oe,{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)})})]})},bL=Ne(),Si=(e,t)=>[e,t].filter(Boolean).join("-").toLowerCase(),DL={idsByKey:{},languageById:{},voiceById:{}},kL=(e,t)=>({...DL,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="/cfb/voices.json"})=>{try{bL.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()(kL),PL=()=>Vf.getState().actions;window.__useVoiceStore=Vf;const Ev=e=>d.jsx("option",{value:e.id,children:e.name},e.key??e.id),ML=({onChange:e,languageId:t,gender:n,voiceId:r})=>{const{getLanguages:o,getVoicesByKeys:s,getGenderByKeys:i}=PL();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(UL,{nodeData:n,onChange:a,voiceSettingsChangeHandler:c,selected:l,valid:s[l]})]})},UL=({nodeData:e,onChange:t,voiceSettingsChangeHandler:n,selected:r,valid:o})=>{const s=e[r],l={text:d.jsxs(d.Fragment,{children:[d.jsx(ML,{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})},FL=[{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:FL.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(oe,{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})})]}),jL=({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}=M2();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(oe,{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})},VL=["GET","POST","PUT","DELETE"],$L=({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:VL.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})]})},HL=({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})})})},BL=({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]},zL=Ne(),WL=({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=>{zL.error("Error fetching swml scripts",E)})},G0);return()=>clearTimeout(h)},[s,i,e,a,l,u,c]),[n,r,o]},Hf=e=>e==="external",GL={externalValue:"",focusedId:"",focusedName:"",open:!1,query:""},YL=({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({...GL,externalValue:Hf(e)?n:"",query:t??""}),y=Hf(e),v=h.query===""||h.query.toLocaleLowerCase()===t.toLocaleLowerCase(),[m,g]=WL({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=Z0(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=AA(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=Z0(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(oe,{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(KL,{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})}),KL=({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}),XL=({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(YL,{onChange:o,confirmId:e,confirmName:t,confirmUrl:n,valid:i})})]})},QL={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},qL=()=>({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=QL[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,qL()]})},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(oe,{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(XL,{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))})})]})},JL=()=>({command:"",digit:"",id:le()}),ZL=({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,JL()]})},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(oe,{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})})]})]})]})]})},eb=({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))]})})})},tb=({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})})})},nb=({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"})})]})},rb=({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)})})})},ob=({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"})})}),sb=["GET","POST","PUT","DELETE"],ib=({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:sb.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??""})})]})})},lb=({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})})]})})},ab=()=>({id:le(),key:"",value:""}),cb=({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,ab()]})},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(oe,{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)})})]})},ub=e=>({id:le(),key:e}),db=({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,ub(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(cC,{handleClick:()=>u(v.id),children:v.key},v.id))})]})]})})},wv={aiAgent:({data:e,formUpdate:t})=>d.jsx(jL,{handleOnUpdate:t,nodeData:e}),cond:({data:e,formUpdate:t})=>d.jsx(HL,{handleOnUpdate:t,nodeData:e}),condRequest:({data:e,formUpdate:t})=>d.jsx($L,{handleOnUpdate:t,nodeData:e}),executeSWML:({data:e,formUpdate:t})=>d.jsx(BL,{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(eb,{handleOnUpdate:t,nodeData:e}),play:({data:e,formUpdate:t})=>d.jsx(tb,{handleOnUpdate:t,nodeData:e}),promptPlay:({data:e,formUpdate:t})=>d.jsx(ZL,{handleOnUpdate:t,nodeData:e}),record:({data:e,formUpdate:t})=>d.jsx(ob,{handleOnUpdate:t,nodeData:e}),recordCallStart:({data:e,formUpdate:t})=>d.jsx(nb,{handleOnUpdate:t,nodeData:e}),recordCallStop:({data:e,formUpdate:t})=>d.jsx(rb,{handleOnUpdate:t,nodeData:e}),request:({data:e,formUpdate:t})=>d.jsx(ib,{handleOnUpdate:t,nodeData:e}),sendSms:({data:e,formUpdate:t})=>d.jsx(lb,{handleOnUpdate:t,nodeData:e}),set:({data:e,formUpdate:t})=>d.jsx(cb,{handleOnUpdate:t,nodeData:e}),unset:({data:e,formUpdate:t})=>d.jsx(db,{handleOnUpdate:t,nodeData:e})},fb=(e,t)=>{if("options"in t)switch(e.type){case"promptPlay":case"cond":case"condRequest":return!0}return!1},pb=e=>{if(e in wv)return wv[e]},hb=()=>{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}=IL(n);if(!(n&&s&&r))return null;const l=u=>{fb(n,u)&&i(u),e(r,u)},a=pb(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
|
|
65
65
|
text-background shadow-lg transition-[box-shadow] hover:shadow-none
|
|
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]})}),gb=()=>{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}},Eb={offset:[0,.5,1],opacity:[1,0,0],pointerEvents:["none","none","auto"],transform:["scale(1.1) translateY(0%)","scale(0.5) translateY(-100%)"]},yb={duration:xA*2,easing:"ease-in-out",fill:"forwards"},vb=({durationMs:e,id:t,permanent:n})=>{const r=e??RA,[o,s]=O.useState(null),{deleteToast:i}=Te(),l=O.useCallback(()=>{let a;const c=()=>i(t);return o instanceof HTMLElement?(a=o.animate(Eb,yb),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}=vb({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)})]})})},_b={error:Av,success:Av},Sb=()=>{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=_b[n.status];return d.jsx(r,{durationMs:n.durationMs,id:n.id,message:n.message,permanent:n.permanent,status:n.status},n.id)})})},xb=({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},Rb=({children:e,...t})=>{const n=xb(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})]})},Nb=({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(Rb,{asRole:e,open:t,type:r,children:d.jsx(Nb,{children:n})}),wb=()=>{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(Ob,{})})}):null},Ob=()=>{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)})]})]})},Tb=Ne(),Ab=()=>{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(Ib,{})})})},Ib=()=>{const{deployFlow:e,setShowDeployWarning:t,setShowValidationWarnings:n}=Te(),r=()=>{t(!1),n(!0)},o=()=>{t(!1)},s=()=>{e().catch(i=>{Tb.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)})]})]})},Cb="react-flow__controls-button",Lb="min-w-[3.625rem] cursor-auto select-auto text-center hover:bg-background active:bg-background",bb="hidden sm:flex",Db=O.forwardRef(function({asTag:t="div",children:n,className:r="",hiddenSmallScreen:o=!1,...s},i){const l=t,c=`${Cb} ${l==="button"?"":Lb} ${o?bb:""} ${r}`;return d.jsx(l,{className:c,ref:i,...s,children:n})}),kb=()=>{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(Db,{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"})]})]})})})},Pb=()=>{const e=Q(r=>r.isDraggingNode),t=Q(r=>r.showInteractiveControl),n=r=>{Q.setState({isInteractiveControlOn:r})};return d.jsx(rA,{className:`mt-2.5 rounded-[0.25rem] ${e?"group/control-buttons":""}`,position:"top-left",onInteractiveChange:n,showInteractive:t,children:d.jsx(kb,{})})},Mb=".react-flow__panel",Ub=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}},Fb=e=>{const t=e.querySelectorAll(Mb);return Array.from(t).map(n=>Dv(n).isCursorIntersecting)},jb=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})`}}),Vb=({handleMouseMove:e,handleMouseUp:t,root:n})=>(n.addEventListener("mousemove",e),n.addEventListener("mouseup",t),{removeListeners:()=>{n.removeEventListener("mousemove",e),n.removeEventListener("mouseup",t)}}),$b=()=>{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=Ub*r,E=e.current,y=Dv(n).isCursorIntersecting,v=Fb(n),{resetDragNodeStyles:m,updateDragNodeStyles:g}=jb(E),{removeListeners:S}=Vb({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 Hb={VITE_APP_VERSION_HASH:"1510b28",VITE_BASE_URL:"http://localhost:8080",VITE_BASIC_AUTH:"7bfc11e6-4eee-4015-9289-20a6baf44443:PTf2c0aaa85a8064ee8ed44bc969a75280710be8d4b27af8a8",VITE_FLOW_DATA_VERSION:"0.0.10",VITE_DEFAULT_STYLE_HREF:"https://cdn.signalwire.com/npm/@signalwire/cfb@latest/dist/style.css",VITE_DEFAULT_VOICES_URL:"https://cdn.signalwire.com/npm/@signalwire/cfb@latest/dist/voices.json",BASE_URL:"/cfb/",MODE:"production",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)}}}},Bb=(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},zb=(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},Wb=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?((Hb?"production":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),Bb(e,t)):zb(e,t),Pv=window,Mv={showAllNodes:!1,showDevOptions:!1},Ir=bo()(Wb((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 Gb=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}},Yb=()=>Gb(Mv),Ha={currentColor:{negative:"fill-current",primary:"fill-current"},light:{negative:"fill-negative",primary:"fill-primary"}},Kb={"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]"},Xb=O.forwardRef(function({className:t="",size:n="md",type:r="light"},o){const s=Kb[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})]})}),Qb={[N.FLOW_DATA_VERSION]:li,[N.PKG_VERSION]:EA},qb=()=>{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(Xb,{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(Qb).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)})})]})]})})]})},Jb={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"},Zb=()=>{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=Jb[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(
|
|
68
|
-
`,children:d.jsxs("div",{className:"flex flex-col items-center justify-center gap-y-2 gap-x-2",children:[d.jsx(
|
|
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(
|
|
70
|
-
text-background transition-colors hover:bg-primary/90`,onClick:r,children:A(N.RESTORE)}):null},
|
|
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(oe,{className:"flex-shrink-0 self-start",tag:o}),d.jsx("p",{className:"text-xs font-semibold",children:s})]}),n]})}),mb=()=>{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}},gb={offset:[0,.5,1],opacity:[1,0,0],pointerEvents:["none","none","auto"],transform:["scale(1.1) translateY(0%)","scale(0.5) translateY(-100%)"]},Eb={duration:_A*2,easing:"ease-in-out",fill:"forwards"},yb=({durationMs:e,id:t,permanent:n})=>{const r=e??SA,[o,s]=O.useState(null),{deleteToast:i}=Te(),l=O.useCallback(()=>{let a;const c=()=>i(t);return o instanceof HTMLElement?(a=o.animate(gb,Eb),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}=yb({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(oe,{tag:"circle-xmark",size:"xl"}),d.jsx("span",{className:"sr-only",children:A(N.CLOSE)})]})})},vb={error:Av,success:Av},_b=()=>{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=vb[n.status];return d.jsx(r,{durationMs:n.durationMs,id:n.id,message:n.message,permanent:n.permanent,status:n.status},n.id)})})},Sb=({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},xb=({children:e,...t})=>{const n=Sb(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(oe,{tag:e??"circle-exclamation"})}),t]}),d.jsx("div",{className:"mt-2 text-sm leading-5",children:n})]})},Rb=({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(xb,{asRole:e,open:t,type:r,children:d.jsx(Rb,{children:n})}),Nb=()=>{const t=Q(n=>n.httpError)===W0;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(wb,{})})}):null},wb=()=>{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)})]})]})},Ob=Ne(),Tb=()=>{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(Ab,{})})})},Ab=()=>{const{deployFlow:e,setShowDeployWarning:t,setShowValidationWarnings:n}=Te(),r=()=>{t(!1),n(!0)},o=()=>{t(!1)},s=()=>{e().catch(i=>{Ob.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)})]})]})},Ib="react-flow__controls-button",Cb="min-w-[3.625rem] cursor-auto select-auto text-center hover:bg-background active:bg-background",Lb="hidden sm:flex",bb=O.forwardRef(function({asTag:t="div",children:n,className:r="",hiddenSmallScreen:o=!1,...s},i){const l=t,c=`${Ib} ${l==="button"?"":Cb} ${o?Lb:""} ${r}`;return d.jsx(l,{className:c,ref:i,...s,children:n})}),Db=()=>{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(bb,{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(oe,{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(oe,{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(oe,{tag:"xmark",size:"lg"})]})]})})})},kb=()=>{const e=Q(r=>r.isDraggingNode),t=Q(r=>r.showInteractiveControl),n=r=>{Q.setState({isInteractiveControlOn:r})};return d.jsx(rA,{className:`mt-2.5 rounded-[0.25rem] ${e?"group/control-buttons":""}`,position:"top-left",onInteractiveChange:n,showInteractive:t,children:d.jsx(Db,{})})},Pb=".react-flow__panel",Mb=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}},Ub=e=>{const t=e.querySelectorAll(Pb);return Array.from(t).map(n=>Dv(n).isCursorIntersecting)},Fb=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})`}}),jb=({handleMouseMove:e,handleMouseUp:t,root:n})=>(n.addEventListener("mousemove",e),n.addEventListener("mouseup",t),{removeListeners:()=>{n.removeEventListener("mousemove",e),n.removeEventListener("mouseup",t)}}),Vb=()=>{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=Mb*r,E=e.current,y=Dv(n).isCursorIntersecting,v=Ub(n),{resetDragNodeStyles:m,updateDragNodeStyles:g}=Fb(E),{removeListeners:S}=jb({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=ey[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 $b={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,void 0),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,void 0)),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)}}}},Hb=(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},Bb=(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},zb=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?(($b?"staging":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),Hb(e,t)):Bb(e,t),Pv=window,Mv={showAllNodes:!1,showDevOptions:!1},Ir=bo()(zb((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 Wb=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}},Gb=()=>Wb(Mv),Ha={currentColor:{negative:"fill-current",primary:"fill-current"},light:{negative:"fill-negative",primary:"fill-primary"}},Yb={"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]"},Kb=O.forwardRef(function({className:t="",size:n="md",type:r="light"},o){const s=Yb[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})]})}),Xb={[N.FLOW_DATA_VERSION]:li,[N.PKG_VERSION]:mA},Qb=()=>{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(Kb,{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(oe,{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(Xb).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)})})]})]})})]})},qb={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"},Jb=()=>{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=qb[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(oe,{tag:"circle-exclamation"}):d.jsx(d.Fragment,{})}),children:e==="error"?A(N.MORE_INFO_DEPLOY_ERROR,{message:u.error}):A(N.MORE_INFO_DEPLOY)})]})},Zb=()=>{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(oe,{tag:"arrow-left",className:"text-negative",size:"lg"})]}):null},eD=()=>{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(oe,{tag:"clock-rotate-left",size:"xs"})]}),children:A(N.VERSION_HISTORY)})},tD=({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(oe,{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})})]})]})})},nD=200,jv=Ne(),rD=()=>{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:nD}).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(oe,{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(oe,{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(oe,{className:"text-negative",tag:"circle-exclamation"}):d.jsx(oe,{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(oe,{tag:"circle-exclamation"}),Ua(N.NO_DEPLOYED_VERSIONS)]})}):null,y?d.jsx("ol",{children:e.map((m,g)=>d.jsx(tD,{itemIndex:g,isDisabled:!v,isSelected:g===c,onClick:p,onSelected:f,relativeTimeSince:m.relativeTimeSince,version:m.version},m.id))}):null]})]}):null},oD=()=>{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(sD,{flagName:t},t))})]})},sD=({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})]})},iD=()=>{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(oe,{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."})]})]})})},lD=(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[hA])||t)&&n.push({deprecated:!!o.deprecated,title:A(o.label),type:r}),n),[]).sort((n,r)=>n.title.localeCompare(r.title))}),Vv=Ne(),aD=["action","forwardTo","recording","input","decision"],cD=()=>{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:aD.map(i=>d.jsx("li",{children:d.jsx(uD,{enableNodeButtons:t,group:i,handleOnClick:o,handleDragStart:s,showAllNodes:e})},i))})},uD=({enableNodeButtons:e=!0,group:t,handleOnClick:n,handleDragStart:r,showAllNodes:o})=>{const s=lD(t,o),i=`ngm-heading-${OA(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(oe,{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))})]})},dD=()=>{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},fD={"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,pD=()=>{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=fD[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)},vA)):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(hD,{}):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(oe,{tag:"circle-exclamation"})]}),children:A(n==="document-sync"?N.INFO_STATUS_ERROR_OUT_OF_SYNC:N.INFO_STATUS_ERROR)})]})})},hD=()=>{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})]})},mD=()=>{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(Zb,{}),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(pD,{})}),d.jsxs("menu",{className:"flex items-center justify-center gap-x-1",children:[r?d.jsx(dD,{}):d.jsx(Jb,{}),d.jsx(eD,{})]})]})]})}),d.jsxs("section",{className:"h-full overflow-y-auto",children:[r?null:d.jsx(cD,{}),d.jsx(rD,{})]}),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(Qb,{}),d.jsx(iD,{})]})})]}),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(oe,{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(oD,{})]})})})]})},gD=()=>{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}},ED=({rootAppHeight:e,rootAppWidth:t})=>{Q.setState({rootAppHeight:e,rootAppWidth:t})},yD=()=>{const{observerEntry:e,setTarget:t}=gD();return O.useEffect(()=>{e&&(Ne().log("resized",{rootAppHeight:e.contentRect.height,rootAppWidth:e.contentRect.width}),ED({rootAppHeight:e.contentRect.height,rootAppWidth:e.contentRect.width}))},[e]),{rootTarget:t}};function vD(){Ne().debug("Hello World!");const{rootTarget:e}=yD(),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(K2,{errorType:n}):d.jsxs(d.Fragment,{children:[d.jsx(mD,{}),d.jsx(Nb,{}),d.jsx(Tb,{}),d.jsxs(tf,{children:[d.jsx(TL,{}),d.jsxs(wL,{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(mb,{}),d.jsx(_b,{})]}),d.jsx(Vb,{}),d.jsx(kb,{}),d.jsx(hb,{}),d.jsx(AL,{})]})]})]})})})}const _D='@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(),SD=e=>{if(!e||!e.getFlowURL||!e.updateFlowURL)throw new TypeError("Invalid or missing required params")};function xD(e){SD(e);const{backButtonHref:t,deployFlowURL:n,getAiAgentsURL:r=`${window.location.origin}${T_}`,getFlowURL:o,getSwmlScriptsURL:s=`${window.location.origin}${A_}`,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}),T2().catch(p=>{Bv.error("Error initializing i18n",p)}),Gb(),!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(vD,{})]}));const f=document.createElement("style");document.head.appendChild(f),f.appendChild(document.createTextNode(_D))}Fr.main=xD,Object.defineProperty(Fr,Symbol.toStringTag,{value:"Module"})});
|