-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.cjs.js
68 lines (60 loc) · 135 KB
/
index.cjs.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react"),x=require("react-observing"),Pr=require("uuid"),jt=require("react-dom");function _r(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const A=_r(c),ea=_r(jt);var un={exports:{}},nt={};/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var qn;function ta(){if(qn)return nt;qn=1;var e=c,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function i(s,l,f){var v,d={},p=null,m=null;f!==void 0&&(p=""+f),l.key!==void 0&&(p=""+l.key),l.ref!==void 0&&(m=l.ref);for(v in l)r.call(l,v)&&!a.hasOwnProperty(v)&&(d[v]=l[v]);if(s&&s.defaultProps)for(v in l=s.defaultProps,l)d[v]===void 0&&(d[v]=l[v]);return{$$typeof:t,type:s,key:p,ref:m,props:d,_owner:o.current}}return nt.Fragment=n,nt.jsx=i,nt.jsxs=i,nt}var rt={};/**
* @license React
* react-jsx-runtime.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Xn;function na(){return Xn||(Xn=1,process.env.NODE_ENV!=="production"&&function(){var e=c,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),s=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),v=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),m=Symbol.for("react.offscreen"),b=Symbol.iterator,u="@@iterator";function y(h){if(h===null||typeof h!="object")return null;var T=b&&h[b]||h[u];return typeof T=="function"?T:null}var g=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function $(h){{for(var T=arguments.length,P=new Array(T>1?T-1:0),N=1;N<T;N++)P[N-1]=arguments[N];C("error",h,P)}}function C(h,T,P){{var N=g.ReactDebugCurrentFrame,U=N.getStackAddendum();U!==""&&(T+="%s",P=P.concat([U]));var G=P.map(function(z){return String(z)});G.unshift("Warning: "+T),Function.prototype.apply.call(console[h],console,G)}}var O=!1,E=!1,S=!1,R=!1,D=!1,_;_=Symbol.for("react.module.reference");function W(h){return!!(typeof h=="string"||typeof h=="function"||h===r||h===a||D||h===o||h===f||h===v||R||h===m||O||E||S||typeof h=="object"&&h!==null&&(h.$$typeof===p||h.$$typeof===d||h.$$typeof===i||h.$$typeof===s||h.$$typeof===l||h.$$typeof===_||h.getModuleId!==void 0))}function L(h,T,P){var N=h.displayName;if(N)return N;var U=T.displayName||T.name||"";return U!==""?P+"("+U+")":P}function k(h){return h.displayName||"Context"}function K(h){if(h==null)return null;if(typeof h.tag=="number"&&$("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof h=="function")return h.displayName||h.name||null;if(typeof h=="string")return h;switch(h){case r:return"Fragment";case n:return"Portal";case a:return"Profiler";case o:return"StrictMode";case f:return"Suspense";case v:return"SuspenseList"}if(typeof h=="object")switch(h.$$typeof){case s:var T=h;return k(T)+".Consumer";case i:var P=h;return k(P._context)+".Provider";case l:return L(h,h.render,"ForwardRef");case d:var N=h.displayName||null;return N!==null?N:K(h.type)||"Memo";case p:{var U=h,G=U._payload,z=U._init;try{return K(z(G))}catch{return null}}}return null}var j=Object.assign,M=0,X,F,Z,I,Y,J,ae;function se(){}se.__reactDisabledLog=!0;function ie(){{if(M===0){X=console.log,F=console.info,Z=console.warn,I=console.error,Y=console.group,J=console.groupCollapsed,ae=console.groupEnd;var h={configurable:!0,enumerable:!0,value:se,writable:!0};Object.defineProperties(console,{info:h,log:h,warn:h,error:h,group:h,groupCollapsed:h,groupEnd:h})}M++}}function de(){{if(M--,M===0){var h={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:j({},h,{value:X}),info:j({},h,{value:F}),warn:j({},h,{value:Z}),error:j({},h,{value:I}),group:j({},h,{value:Y}),groupCollapsed:j({},h,{value:J}),groupEnd:j({},h,{value:ae})})}M<0&&$("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ne=g.ReactCurrentDispatcher,fe;function we(h,T,P){{if(fe===void 0)try{throw Error()}catch(U){var N=U.stack.trim().match(/\n( *(at )?)/);fe=N&&N[1]||""}return`
`+fe+h}}var te=!1,$e;{var Bt=typeof WeakMap=="function"?WeakMap:Map;$e=new Bt}function mt(h,T){if(!h||te)return"";{var P=$e.get(h);if(P!==void 0)return P}var N;te=!0;var U=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var G;G=ne.current,ne.current=null,ie();try{if(T){var z=function(){throw Error()};if(Object.defineProperty(z.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(z,[])}catch(Ee){N=Ee}Reflect.construct(h,[],z)}else{try{z.call()}catch(Ee){N=Ee}h.call(z.prototype)}}else{try{throw Error()}catch(Ee){N=Ee}h()}}catch(Ee){if(Ee&&N&&typeof Ee.stack=="string"){for(var H=Ee.stack.split(`
`),re=N.stack.split(`
`),Q=H.length-1,ee=re.length-1;Q>=1&&ee>=0&&H[Q]!==re[ee];)ee--;for(;Q>=1&&ee>=0;Q--,ee--)if(H[Q]!==re[ee]){if(Q!==1||ee!==1)do if(Q--,ee--,ee<0||H[Q]!==re[ee]){var ve=`
`+H[Q].replace(" at new "," at ");return h.displayName&&ve.includes("<anonymous>")&&(ve=ve.replace("<anonymous>",h.displayName)),typeof h=="function"&&$e.set(h,ve),ve}while(Q>=1&&ee>=0);break}}}finally{te=!1,ne.current=G,de(),Error.prepareStackTrace=U}var Le=h?h.displayName||h.name:"",Yn=Le?we(Le):"";return typeof h=="function"&&$e.set(h,Yn),Yn}function Ut(h,T,P){return mt(h,!1)}function Kt(h){var T=h.prototype;return!!(T&&T.isReactComponent)}function be(h,T,P){if(h==null)return"";if(typeof h=="function")return mt(h,Kt(h));if(typeof h=="string")return we(h);switch(h){case f:return we("Suspense");case v:return we("SuspenseList")}if(typeof h=="object")switch(h.$$typeof){case l:return Ut(h.render);case d:return be(h.type,T,P);case p:{var N=h,U=N._payload,G=N._init;try{return be(G(U),T,P)}catch{}}}return""}var Ae=Object.prototype.hasOwnProperty,pt={},ht=g.ReactDebugCurrentFrame;function Me(h){if(h){var T=h._owner,P=be(h.type,h._source,T?T.type:null);ht.setExtraStackFrame(P)}else ht.setExtraStackFrame(null)}function Gt(h,T,P,N,U){{var G=Function.call.bind(Ae);for(var z in h)if(G(h,z)){var H=void 0;try{if(typeof h[z]!="function"){var re=Error((N||"React class")+": "+P+" type `"+z+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof h[z]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw re.name="Invariant Violation",re}H=h[z](T,z,N,P,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Q){H=Q}H&&!(H instanceof Error)&&(Me(U),$("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",N||"React class",P,z,typeof H),Me(null)),H instanceof Error&&!(H.message in pt)&&(pt[H.message]=!0,Me(U),$("Failed %s type: %s",P,H.message),Me(null))}}}var Ve=Array.isArray;function Yt(h){return Ve(h)}function jo(h){{var T=typeof Symbol=="function"&&Symbol.toStringTag,P=T&&h[Symbol.toStringTag]||h.constructor.name||"Object";return P}}function Mo(h){try{return Vn(h),!1}catch{return!0}}function Vn(h){return""+h}function Wn(h){if(Mo(h))return $("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",jo(h)),Vn(h)}var tt=g.ReactCurrentOwner,Vo={key:!0,ref:!0,__self:!0,__source:!0},Ln,Hn,qt;qt={};function Wo(h){if(Ae.call(h,"ref")){var T=Object.getOwnPropertyDescriptor(h,"ref").get;if(T&&T.isReactWarning)return!1}return h.ref!==void 0}function Lo(h){if(Ae.call(h,"key")){var T=Object.getOwnPropertyDescriptor(h,"key").get;if(T&&T.isReactWarning)return!1}return h.key!==void 0}function Ho(h,T){if(typeof h.ref=="string"&&tt.current&&T&&tt.current.stateNode!==T){var P=K(tt.current.type);qt[P]||($('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',K(tt.current.type),h.ref),qt[P]=!0)}}function Fo(h,T){{var P=function(){Ln||(Ln=!0,$("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",T))};P.isReactWarning=!0,Object.defineProperty(h,"key",{get:P,configurable:!0})}}function zo(h,T){{var P=function(){Hn||(Hn=!0,$("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",T))};P.isReactWarning=!0,Object.defineProperty(h,"ref",{get:P,configurable:!0})}}var Bo=function(h,T,P,N,U,G,z){var H={$$typeof:t,type:h,key:T,ref:P,props:z,_owner:G};return H._store={},Object.defineProperty(H._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(H,"_self",{configurable:!1,enumerable:!1,writable:!1,value:N}),Object.defineProperty(H,"_source",{configurable:!1,enumerable:!1,writable:!1,value:U}),Object.freeze&&(Object.freeze(H.props),Object.freeze(H)),H};function Uo(h,T,P,N,U){{var G,z={},H=null,re=null;P!==void 0&&(Wn(P),H=""+P),Lo(T)&&(Wn(T.key),H=""+T.key),Wo(T)&&(re=T.ref,Ho(T,U));for(G in T)Ae.call(T,G)&&!Vo.hasOwnProperty(G)&&(z[G]=T[G]);if(h&&h.defaultProps){var Q=h.defaultProps;for(G in Q)z[G]===void 0&&(z[G]=Q[G])}if(H||re){var ee=typeof h=="function"?h.displayName||h.name||"Unknown":h;H&&Fo(z,ee),re&&zo(z,ee)}return Bo(h,H,re,U,N,tt.current,z)}}var Xt=g.ReactCurrentOwner,Fn=g.ReactDebugCurrentFrame;function We(h){if(h){var T=h._owner,P=be(h.type,h._source,T?T.type:null);Fn.setExtraStackFrame(P)}else Fn.setExtraStackFrame(null)}var Zt;Zt=!1;function Jt(h){return typeof h=="object"&&h!==null&&h.$$typeof===t}function zn(){{if(Xt.current){var h=K(Xt.current.type);if(h)return`
Check the render method of \``+h+"`."}return""}}function Ko(h){{if(h!==void 0){var T=h.fileName.replace(/^.*[\\\/]/,""),P=h.lineNumber;return`
Check your code at `+T+":"+P+"."}return""}}var Bn={};function Go(h){{var T=zn();if(!T){var P=typeof h=="string"?h:h.displayName||h.name;P&&(T=`
Check the top-level render call using <`+P+">.")}return T}}function Un(h,T){{if(!h._store||h._store.validated||h.key!=null)return;h._store.validated=!0;var P=Go(T);if(Bn[P])return;Bn[P]=!0;var N="";h&&h._owner&&h._owner!==Xt.current&&(N=" It was passed a child from "+K(h._owner.type)+"."),We(h),$('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',P,N),We(null)}}function Kn(h,T){{if(typeof h!="object")return;if(Yt(h))for(var P=0;P<h.length;P++){var N=h[P];Jt(N)&&Un(N,T)}else if(Jt(h))h._store&&(h._store.validated=!0);else if(h){var U=y(h);if(typeof U=="function"&&U!==h.entries)for(var G=U.call(h),z;!(z=G.next()).done;)Jt(z.value)&&Un(z.value,T)}}}function Yo(h){{var T=h.type;if(T==null||typeof T=="string")return;var P;if(typeof T=="function")P=T.propTypes;else if(typeof T=="object"&&(T.$$typeof===l||T.$$typeof===d))P=T.propTypes;else return;if(P){var N=K(T);Gt(P,h.props,"prop",N,h)}else if(T.PropTypes!==void 0&&!Zt){Zt=!0;var U=K(T);$("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",U||"Unknown")}typeof T.getDefaultProps=="function"&&!T.getDefaultProps.isReactClassApproved&&$("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function qo(h){{for(var T=Object.keys(h.props),P=0;P<T.length;P++){var N=T[P];if(N!=="children"&&N!=="key"){We(h),$("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",N),We(null);break}}h.ref!==null&&(We(h),$("Invalid attribute `ref` supplied to `React.Fragment`."),We(null))}}function Gn(h,T,P,N,U,G){{var z=W(h);if(!z){var H="";(h===void 0||typeof h=="object"&&h!==null&&Object.keys(h).length===0)&&(H+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var re=Ko(U);re?H+=re:H+=zn();var Q;h===null?Q="null":Yt(h)?Q="array":h!==void 0&&h.$$typeof===t?(Q="<"+(K(h.type)||"Unknown")+" />",H=" Did you accidentally export a JSX literal instead of a component?"):Q=typeof h,$("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Q,H)}var ee=Uo(h,T,P,U,G);if(ee==null)return ee;if(z){var ve=T.children;if(ve!==void 0)if(N)if(Yt(ve)){for(var Le=0;Le<ve.length;Le++)Kn(ve[Le],h);Object.freeze&&Object.freeze(ve)}else $("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Kn(ve,h)}return h===r?qo(ee):Yo(ee),ee}}function Xo(h,T,P){return Gn(h,T,P,!0)}function Zo(h,T,P){return Gn(h,T,P,!1)}var Jo=Zo,Qo=Xo;rt.Fragment=r,rt.jsx=Jo,rt.jsxs=Qo}()),rt}process.env.NODE_ENV==="production"?un.exports=ta():un.exports=na();var w=un.exports;const Dr=c.createContext({}),ra=({children:e,configs:t,onGetNameSuggestions:n,onGetValueSuggestions:r,onGetValue:o,...a})=>{const i=c.useMemo(()=>({errorColor:(t==null?void 0:t.errorColor)||"red",warningColor:(t==null?void 0:t.warningColor)||"yellow",textDefaultColor:(t==null?void 0:t.textDefaultColor)||"white",borderDefaultColor:(t==null?void 0:t.borderDefaultColor)||"#3c3c3c",inputTextDefault:void 0,inputBorderError:`thin solid ${(t==null?void 0:t.errorColor)||"red"}`,inputTextError:`underline wavy ${(t==null?void 0:t.errorColor)||"red"}`,inputBorderWarning:`thin solid ${(t==null?void 0:t.warningColor)||"yellow"}`,inputTextWarning:`underline wavy ${(t==null?void 0:t.warningColor)||"yellow"}`,inputBorderDefault:`thin solid ${(t==null?void 0:t.borderDefaultColor)||"#3c3c3c"}`}),[t]),s=c.useCallback(v=>n?n(v):[],[n]),l=c.useCallback(v=>r?r(v):[],[r]),f=c.useMemo(()=>{if(o)return v=>o(v)},[o]);return w.jsx(Dr.Provider,{value:{onGetValue:f,configs:i,onGetNameSuggestions:s,onGetValueSuggestions:l,...a},children:e})},qe=()=>c.useContext(Dr),pe=()=>qe().configs;var Ir={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Zn=c.createContext&&c.createContext(Ir),oa=["attr","size","title"];function aa(e,t){if(e==null)return{};var n=sa(e,t),r,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)r=a[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function sa(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,a;for(a=0;a<r.length;a++)o=r[a],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function Rt(){return Rt=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},Rt.apply(this,arguments)}function Jn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Pt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Jn(Object(n),!0).forEach(function(r){ia(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Jn(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ia(e,t,n){return t=ca(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ca(e){var t=la(e,"string");return typeof t=="symbol"?t:String(t)}function la(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ar(e){return e&&e.map((t,n)=>c.createElement(t.tag,Pt({key:n},t.attr),Ar(t.child)))}function Xe(e){return t=>c.createElement(ua,Rt({attr:Pt({},e.attr)},t),Ar(e.child))}function ua(e){var t=n=>{var{attr:r,size:o,title:a}=e,i=aa(e,oa),s=o||n.size||"1em",l;return n.className&&(l=n.className),e.className&&(l=(l?l+" ":"")+e.className),c.createElement("svg",Rt({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,i,{className:l,style:Pt(Pt({color:e.color||n.color},n.style),e.style),height:s,width:s,xmlns:"http://www.w3.org/2000/svg"}),a&&c.createElement("title",null,a),e.children)};return Zn!==void 0?c.createElement(Zn.Consumer,null,n=>t(n)):t(Ir)}function Nr(e){return Xe({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M7.976 10.072l4.357-4.357.62.618L8.284 11h-.618L3 6.333l.619-.618 4.357 4.357z"},child:[]}]})(e)}function da(e){return Xe({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M8.024 5.928l-4.357 4.357-.62-.618L7.716 5h.618L13 9.667l-.619.618-4.357-4.357z"},child:[]}]})(e)}function fa(e){return Xe({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M8 8.707l3.646 3.647.708-.707L8.707 8l3.647-3.646-.707-.708L8 7.293 4.354 3.646l-.707.708L7.293 8l-3.646 3.646.707.708L8 8.707z"},child:[]}]})(e)}function va(e){return Xe({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{d:"M13.23 1h-1.46L3.52 9.25l-.16.22L1 13.59 2.41 15l4.12-2.36.22-.16L15 4.23V2.77L13.23 1zM2.41 13.59l1.51-3 1.45 1.45-2.96 1.55zm3.83-2.06L4.47 9.76l8-8 1.77 1.77-8 8z"},child:[]}]})(e)}function Ze(e){return Xe({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M8.568 1.031A6.8 6.8 0 0 1 12.76 3.05a7.06 7.06 0 0 1 .46 9.39 6.85 6.85 0 0 1-8.58 1.74 7 7 0 0 1-3.12-3.5 7.12 7.12 0 0 1-.23-4.71 7 7 0 0 1 2.77-3.79 6.8 6.8 0 0 1 4.508-1.149zM9.04 13.88a5.89 5.89 0 0 0 3.41-2.07 6.07 6.07 0 0 0-.4-8.06 5.82 5.82 0 0 0-7.43-.74 6.06 6.06 0 0 0 .5 10.29 5.81 5.81 0 0 0 3.92.58zM7.375 6h1.25V5h-1.25v1zm1.25 1v4h-1.25V7h1.25z"},child:[]}]})(e)}function ct(e){return Xe({tag:"svg",attr:{viewBox:"0 0 16 16",fill:"currentColor"},child:[{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M10 3h3v1h-1v9l-1 1H4l-1-1V4H2V3h3V2a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1v1zM9 2H6v1h3V2zM4 13h7V4H4v9zm2-8H5v7h1V5zm1 0h1v7H7V5zm2 0h1v7H9V5z"},child:[]}]})(e)}class _t{static getInputsWidth(){const t=localStorage.getItem("INPUTS_WIDTH");return t?Number(t):60}static setInputsWidth(t){return localStorage.setItem("INPUTS_WIDTH",String(t)),t}static getGroupsInOpen(t){const n=localStorage.getItem(t.toLocaleUpperCase()+"_GROUPS_OPEN");try{return n!==null?JSON.parse(n):!0}catch{return!0}}static setGroupsInOpen(t,n){return localStorage.setItem(t.toLocaleUpperCase()+"_GROUPS_OPEN",String(n)),n}}var q=(e=>(e.stringWithSuggestions="stringWithSuggestions",e.multiExpression="multiExpression",e.yesNoSelection="yesNoSelection",e.inputMultiTags="inputMultiTags",e.fullBigString="fullBigString",e.multiAssign="multiAssign",e.colorPicker="colorPicker",e.fieldsTree="fieldsTree",e.expression="expression",e.optionList="optionList",e.stringList="stringList",e.bigString="bigString",e.selection="selection",e.recursive="recursive",e.viewOnly="viewOnly",e.boolean="boolean",e.string="string",e.number="number",e.binary="binary",e.assign="assign",e.hidden="hidden",e))(q||{});const ma=e=>({description:e.description||x.observe(""),disabled:e.disabled||x.observe(!1),value:e.value||x.observe(""),label:e.label||x.observe(""),name:e.name||x.observe("")}),En=e=>({id:e.id||x.observe(Pr.v4()),value:e.value||x.observe(""),name:e.name||x.observe(void 0),order:e.order||x.observe(void 0),group:e.group||x.observe(void 0),type:e.type||x.observe(q.string),information:e.information||x.observe(void 0),fileMaxSize:e.fileMaxSize||x.observe(void 0),nameHasError:e.nameHasError||x.observe(void 0),propertyType:e.propertyType||x.observe("default"),valueHasError:e.valueHasError||x.observe(void 0),nameHasWarning:e.nameHasWarning||x.observe(void 0),valueHasWarning:e.valueHasWarning||x.observe(void 0),editNameDisabled:e.editNameDisabled||x.observe(void 0),editValueDisabled:e.editValueDisabled||x.observe(void 0),typeOfFilesToAccept:e.typeOfFilesToAccept||x.observe(void 0),nameInputPickerDisabled:e.nameInputPickerDisabled||x.observe(!0),valueInputPickerDisabled:e.valueInputPickerDisabled||x.observe(!0)}),pa=x.observe(_t.getInputsWidth()),ha=({oldWidth:e=0,onChange:t,onResizeEnd:n})=>{const r=c.useRef(0),o=c.useCallback(s=>{t(window.innerWidth-s.pageX-r.current)},[t]),a=c.useCallback(s=>{window.document.body.style.cursor="unset",n&&n(window.innerWidth-s.pageX-r.current),window.onmousemove=null,window.onmouseup=null},[n]),i=c.useCallback(s=>{r.current=window.innerWidth-s.pageX-e,window.document.body.style.cursor="col-resize",window.onmousemove=o,window.onmouseup=a},[e,o,a]);return w.jsx("div",{onMouseDown:i,className:"transition-all border-none cursor-col-resize rounded h-8 w-1 z-10 hover:bg-secondary"})};function V(){return V=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},V.apply(this,arguments)}function B(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function ba(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function On(...e){return t=>e.forEach(n=>ba(n,t))}function oe(...e){return c.useCallback(On(...e),e)}function ke(e,t=[]){let n=[];function r(a,i){const s=c.createContext(i),l=n.length;n=[...n,i];function f(d){const{scope:p,children:m,...b}=d,u=(p==null?void 0:p[e][l])||s,y=c.useMemo(()=>b,Object.values(b));return c.createElement(u.Provider,{value:y},m)}function v(d,p){const m=(p==null?void 0:p[e][l])||s,b=c.useContext(m);if(b)return b;if(i!==void 0)return i;throw new Error(`\`${d}\` must be used within \`${a}\``)}return f.displayName=a+"Provider",[f,v]}const o=()=>{const a=n.map(i=>c.createContext(i));return function(s){const l=(s==null?void 0:s[e])||a;return c.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return o.scopeName=e,[r,ga(o,...t)]}function ga(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(a){const i=r.reduce((s,{useScope:l,scopeName:f})=>{const d=l(a)[`__scope${f}`];return{...s,...d}},{});return c.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}const ot=c.forwardRef((e,t)=>{const{children:n,...r}=e,o=c.Children.toArray(n),a=o.find(xa);if(a){const i=a.props.children,s=o.map(l=>l===a?c.Children.count(i)>1?c.Children.only(null):c.isValidElement(i)?i.props.children:null:l);return c.createElement(dn,V({},r,{ref:t}),c.isValidElement(i)?c.cloneElement(i,void 0,s):null)}return c.createElement(dn,V({},r,{ref:t}),n)});ot.displayName="Slot";const dn=c.forwardRef((e,t)=>{const{children:n,...r}=e;return c.isValidElement(n)?c.cloneElement(n,{...ya(r,n.props),ref:t?On(t,n.ref):n.ref}):c.Children.count(n)>1?c.Children.only(null):null});dn.displayName="SlotClone";const kr=({children:e})=>c.createElement(c.Fragment,null,e);function xa(e){return c.isValidElement(e)&&e.type===kr}function ya(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...s)=>{a(...s),o(...s)}:o&&(n[r]=o):r==="style"?n[r]={...o,...a}:r==="className"&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}const wa=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ue=wa.reduce((e,t)=>{const n=c.forwardRef((r,o)=>{const{asChild:a,...i}=r,s=a?ot:t;return c.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),c.createElement(s,V({},i,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function jr(e,t){e&&jt.flushSync(()=>e.dispatchEvent(t))}function xe(e){const t=c.useRef(e);return c.useEffect(()=>{t.current=e}),c.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function $a(e,t=globalThis==null?void 0:globalThis.document){const n=xe(e);c.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const fn="dismissableLayer.update",Ea="dismissableLayer.pointerDownOutside",Oa="dismissableLayer.focusOutside";let Qn;const Ca=c.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Mr=c.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:s,onDismiss:l,...f}=e,v=c.useContext(Ca),[d,p]=c.useState(null),m=(n=d==null?void 0:d.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,b]=c.useState({}),u=oe(t,D=>p(D)),y=Array.from(v.layers),[g]=[...v.layersWithOutsidePointerEventsDisabled].slice(-1),$=y.indexOf(g),C=d?y.indexOf(d):-1,O=v.layersWithOutsidePointerEventsDisabled.size>0,E=C>=$,S=Sa(D=>{const _=D.target,W=[...v.branches].some(L=>L.contains(_));!E||W||(a==null||a(D),s==null||s(D),D.defaultPrevented||l==null||l())},m),R=Ta(D=>{const _=D.target;[...v.branches].some(L=>L.contains(_))||(i==null||i(D),s==null||s(D),D.defaultPrevented||l==null||l())},m);return $a(D=>{C===v.layers.size-1&&(o==null||o(D),!D.defaultPrevented&&l&&(D.preventDefault(),l()))},m),c.useEffect(()=>{if(d)return r&&(v.layersWithOutsidePointerEventsDisabled.size===0&&(Qn=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),v.layersWithOutsidePointerEventsDisabled.add(d)),v.layers.add(d),er(),()=>{r&&v.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=Qn)}},[d,m,r,v]),c.useEffect(()=>()=>{d&&(v.layers.delete(d),v.layersWithOutsidePointerEventsDisabled.delete(d),er())},[d,v]),c.useEffect(()=>{const D=()=>b({});return document.addEventListener(fn,D),()=>document.removeEventListener(fn,D)},[]),c.createElement(ue.div,V({},f,{ref:u,style:{pointerEvents:O?E?"auto":"none":void 0,...e.style},onFocusCapture:B(e.onFocusCapture,R.onFocusCapture),onBlurCapture:B(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:B(e.onPointerDownCapture,S.onPointerDownCapture)}))});function Sa(e,t=globalThis==null?void 0:globalThis.document){const n=xe(e),r=c.useRef(!1),o=c.useRef(()=>{});return c.useEffect(()=>{const a=s=>{if(s.target&&!r.current){let f=function(){Vr(Ea,n,l,{discrete:!0})};const l={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=f,t.addEventListener("click",o.current,{once:!0})):f()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",a),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Ta(e,t=globalThis==null?void 0:globalThis.document){const n=xe(e),r=c.useRef(!1);return c.useEffect(()=>{const o=a=>{a.target&&!r.current&&Vr(Oa,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function er(){const e=new CustomEvent(fn);document.dispatchEvent(e)}function Vr(e,t,n,{discrete:r}){const o=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?jr(o,a):o.dispatchEvent(a)}const Ge=globalThis!=null&&globalThis.document?c.useLayoutEffect:()=>{},Ra=A.useId||(()=>{});let Pa=0;function Dt(e){const[t,n]=A.useState(Ra());return Ge(()=>{e||n(r=>r??String(Pa++))},[e]),e||(t?`radix-${t}`:"")}const _a=["top","right","bottom","left"],_e=Math.min,ce=Math.max,It=Math.round,bt=Math.floor,De=e=>({x:e,y:e}),Da={left:"right",right:"left",bottom:"top",top:"bottom"},Ia={start:"end",end:"start"};function vn(e,t,n){return ce(e,_e(t,n))}function Oe(e,t){return typeof e=="function"?e(t):e}function Ce(e){return e.split("-")[0]}function Je(e){return e.split("-")[1]}function Cn(e){return e==="x"?"y":"x"}function Sn(e){return e==="y"?"height":"width"}function Qe(e){return["top","bottom"].includes(Ce(e))?"y":"x"}function Tn(e){return Cn(Qe(e))}function Aa(e,t,n){n===void 0&&(n=!1);const r=Je(e),o=Tn(e),a=Sn(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=At(i)),[i,At(i)]}function Na(e){const t=At(e);return[mn(e),t,mn(t)]}function mn(e){return e.replace(/start|end/g,t=>Ia[t])}function ka(e,t,n){const r=["left","right"],o=["right","left"],a=["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?a:i;default:return[]}}function ja(e,t,n,r){const o=Je(e);let a=ka(Ce(e),n==="start",r);return o&&(a=a.map(i=>i+"-"+o),t&&(a=a.concat(a.map(mn)))),a}function At(e){return e.replace(/left|right|bottom|top/g,t=>Da[t])}function Ma(e){return{top:0,right:0,bottom:0,left:0,...e}}function Wr(e){return typeof e!="number"?Ma(e):{top:e,right:e,bottom:e,left:e}}function Nt(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function tr(e,t,n){let{reference:r,floating:o}=e;const a=Qe(t),i=Tn(t),s=Sn(i),l=Ce(t),f=a==="y",v=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,p=r[s]/2-o[s]/2;let m;switch(l){case"top":m={x:v,y:r.y-o.height};break;case"bottom":m={x:v,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:d};break;case"left":m={x:r.x-o.width,y:d};break;default:m={x:r.x,y:r.y}}switch(Je(t)){case"start":m[i]-=p*(n&&f?-1:1);break;case"end":m[i]+=p*(n&&f?-1:1);break}return m}const Va=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:a=[],platform:i}=n,s=a.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(t));let f=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:v,y:d}=tr(f,r,l),p=r,m={},b=0;for(let u=0;u<s.length;u++){const{name:y,fn:g}=s[u],{x:$,y:C,data:O,reset:E}=await g({x:v,y:d,initialPlacement:r,placement:p,strategy:o,middlewareData:m,rects:f,platform:i,elements:{reference:e,floating:t}});v=$??v,d=C??d,m={...m,[y]:{...m[y],...O}},E&&b<=50&&(b++,typeof E=="object"&&(E.placement&&(p=E.placement),E.rects&&(f=E.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):E.rects),{x:v,y:d}=tr(f,p,l)),u=-1)}return{x:v,y:d,placement:p,strategy:o,middlewareData:m}};async function at(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:a,rects:i,elements:s,strategy:l}=e,{boundary:f="clippingAncestors",rootBoundary:v="viewport",elementContext:d="floating",altBoundary:p=!1,padding:m=0}=Oe(t,e),b=Wr(m),y=s[p?d==="floating"?"reference":"floating":d],g=Nt(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(y)))==null||n?y:y.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:f,rootBoundary:v,strategy:l})),$=d==="floating"?{...i.floating,x:r,y:o}:i.reference,C=await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating)),O=await(a.isElement==null?void 0:a.isElement(C))?await(a.getScale==null?void 0:a.getScale(C))||{x:1,y:1}:{x:1,y:1},E=Nt(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:$,offsetParent:C,strategy:l}):$);return{top:(g.top-E.top+b.top)/O.y,bottom:(E.bottom-g.bottom+b.bottom)/O.y,left:(g.left-E.left+b.left)/O.x,right:(E.right-g.right+b.right)/O.x}}const Wa=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:a,platform:i,elements:s,middlewareData:l}=t,{element:f,padding:v=0}=Oe(e,t)||{};if(f==null)return{};const d=Wr(v),p={x:n,y:r},m=Tn(o),b=Sn(m),u=await i.getDimensions(f),y=m==="y",g=y?"top":"left",$=y?"bottom":"right",C=y?"clientHeight":"clientWidth",O=a.reference[b]+a.reference[m]-p[m]-a.floating[b],E=p[m]-a.reference[m],S=await(i.getOffsetParent==null?void 0:i.getOffsetParent(f));let R=S?S[C]:0;(!R||!await(i.isElement==null?void 0:i.isElement(S)))&&(R=s.floating[C]||a.floating[b]);const D=O/2-E/2,_=R/2-u[b]/2-1,W=_e(d[g],_),L=_e(d[$],_),k=W,K=R-u[b]-L,j=R/2-u[b]/2+D,M=vn(k,j,K),X=!l.arrow&&Je(o)!=null&&j!==M&&a.reference[b]/2-(j<k?W:L)-u[b]/2<0,F=X?j<k?j-k:j-K:0;return{[m]:p[m]+F,data:{[m]:M,centerOffset:j-M-F,...X&&{alignmentOffset:F}},reset:X}}}),La=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:a,rects:i,initialPlacement:s,platform:l,elements:f}=t,{mainAxis:v=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:u=!0,...y}=Oe(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const g=Ce(o),$=Ce(s)===s,C=await(l.isRTL==null?void 0:l.isRTL(f.floating)),O=p||($||!u?[At(s)]:Na(s));!p&&b!=="none"&&O.push(...ja(s,u,b,C));const E=[s,...O],S=await at(t,y),R=[];let D=((r=a.flip)==null?void 0:r.overflows)||[];if(v&&R.push(S[g]),d){const k=Aa(o,i,C);R.push(S[k[0]],S[k[1]])}if(D=[...D,{placement:o,overflows:R}],!R.every(k=>k<=0)){var _,W;const k=(((_=a.flip)==null?void 0:_.index)||0)+1,K=E[k];if(K)return{data:{index:k,overflows:D},reset:{placement:K}};let j=(W=D.filter(M=>M.overflows[0]<=0).sort((M,X)=>M.overflows[1]-X.overflows[1])[0])==null?void 0:W.placement;if(!j)switch(m){case"bestFit":{var L;const M=(L=D.map(X=>[X.placement,X.overflows.filter(F=>F>0).reduce((F,Z)=>F+Z,0)]).sort((X,F)=>X[1]-F[1])[0])==null?void 0:L[0];M&&(j=M);break}case"initialPlacement":j=s;break}if(o!==j)return{reset:{placement:j}}}return{}}}};function nr(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function rr(e){return _a.some(t=>e[t]>=0)}const Ha=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=Oe(e,t);switch(r){case"referenceHidden":{const a=await at(t,{...o,elementContext:"reference"}),i=nr(a,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:rr(i)}}}case"escaped":{const a=await at(t,{...o,altBoundary:!0}),i=nr(a,n.floating);return{data:{escapedOffsets:i,escaped:rr(i)}}}default:return{}}}}};async function Fa(e,t){const{placement:n,platform:r,elements:o}=e,a=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=Ce(n),s=Je(n),l=Qe(n)==="y",f=["left","top"].includes(i)?-1:1,v=a&&l?-1:1,d=Oe(t,e);let{mainAxis:p,crossAxis:m,alignmentAxis:b}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return s&&typeof b=="number"&&(m=s==="end"?b*-1:b),l?{x:m*v,y:p*f}:{x:p*f,y:m*v}}const za=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:a,placement:i,middlewareData:s}=t,l=await Fa(t,e);return i===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:a+l.y,data:{...l,placement:i}}}}},Ba=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:s={fn:y=>{let{x:g,y:$}=y;return{x:g,y:$}}},...l}=Oe(e,t),f={x:n,y:r},v=await at(t,l),d=Qe(Ce(o)),p=Cn(d);let m=f[p],b=f[d];if(a){const y=p==="y"?"top":"left",g=p==="y"?"bottom":"right",$=m+v[y],C=m-v[g];m=vn($,m,C)}if(i){const y=d==="y"?"top":"left",g=d==="y"?"bottom":"right",$=b+v[y],C=b-v[g];b=vn($,b,C)}const u=s.fn({...t,[p]:m,[d]:b});return{...u,data:{x:u.x-n,y:u.y-r}}}}},Ua=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:a,middlewareData:i}=t,{offset:s=0,mainAxis:l=!0,crossAxis:f=!0}=Oe(e,t),v={x:n,y:r},d=Qe(o),p=Cn(d);let m=v[p],b=v[d];const u=Oe(s,t),y=typeof u=="number"?{mainAxis:u,crossAxis:0}:{mainAxis:0,crossAxis:0,...u};if(l){const C=p==="y"?"height":"width",O=a.reference[p]-a.floating[C]+y.mainAxis,E=a.reference[p]+a.reference[C]-y.mainAxis;m<O?m=O:m>E&&(m=E)}if(f){var g,$;const C=p==="y"?"width":"height",O=["top","left"].includes(Ce(o)),E=a.reference[d]-a.floating[C]+(O&&((g=i.offset)==null?void 0:g[d])||0)+(O?0:y.crossAxis),S=a.reference[d]+a.reference[C]+(O?0:(($=i.offset)==null?void 0:$[d])||0)-(O?y.crossAxis:0);b<E?b=E:b>S&&(b=S)}return{[p]:m,[d]:b}}}},Ka=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:a}=t,{apply:i=()=>{},...s}=Oe(e,t),l=await at(t,s),f=Ce(n),v=Je(n),d=Qe(n)==="y",{width:p,height:m}=r.floating;let b,u;f==="top"||f==="bottom"?(b=f,u=v===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(u=f,b=v==="end"?"top":"bottom");const y=m-l[b],g=p-l[u],$=!t.middlewareData.shift;let C=y,O=g;if(d){const S=p-l.left-l.right;O=v||$?_e(g,S):S}else{const S=m-l.top-l.bottom;C=v||$?_e(y,S):S}if($&&!v){const S=ce(l.left,0),R=ce(l.right,0),D=ce(l.top,0),_=ce(l.bottom,0);d?O=p-2*(S!==0||R!==0?S+R:ce(l.left,l.right)):C=m-2*(D!==0||_!==0?D+_:ce(l.top,l.bottom))}await i({...t,availableWidth:O,availableHeight:C});const E=await o.getDimensions(a.floating);return p!==E.width||m!==E.height?{reset:{rects:!0}}:{}}}};function Ie(e){return Lr(e)?(e.nodeName||"").toLowerCase():"#document"}function le(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Te(e){var t;return(t=(Lr(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Lr(e){return e instanceof Node||e instanceof le(e).Node}function Se(e){return e instanceof Element||e instanceof le(e).Element}function ye(e){return e instanceof HTMLElement||e instanceof le(e).HTMLElement}function or(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof le(e).ShadowRoot}function lt(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=me(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Ga(e){return["table","td","th"].includes(Ie(e))}function Rn(e){const t=Pn(),n=me(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 Ya(e){let t=Ye(e);for(;ye(t)&&!Mt(t);){if(Rn(t))return t;t=Ye(t)}return null}function Pn(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Mt(e){return["html","body","#document"].includes(Ie(e))}function me(e){return le(e).getComputedStyle(e)}function Vt(e){return Se(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Ye(e){if(Ie(e)==="html")return e;const t=e.assignedSlot||e.parentNode||or(e)&&e.host||Te(e);return or(t)?t.host:t}function Hr(e){const t=Ye(e);return Mt(t)?e.ownerDocument?e.ownerDocument.body:e.body:ye(t)&<(t)?t:Hr(t)}function st(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Hr(e),a=o===((r=e.ownerDocument)==null?void 0:r.body),i=le(o);return a?t.concat(i,i.visualViewport||[],lt(o)?o:[],i.frameElement&&n?st(i.frameElement):[]):t.concat(o,st(o,[],n))}function Fr(e){const t=me(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=ye(e),a=o?e.offsetWidth:n,i=o?e.offsetHeight:r,s=It(n)!==a||It(r)!==i;return s&&(n=a,r=i),{width:n,height:r,$:s}}function _n(e){return Se(e)?e:e.contextElement}function Ue(e){const t=_n(e);if(!ye(t))return De(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:a}=Fr(t);let i=(a?It(n.width):n.width)/r,s=(a?It(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!s||!Number.isFinite(s))&&(s=1),{x:i,y:s}}const qa=De(0);function zr(e){const t=le(e);return!Pn()||!t.visualViewport?qa:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Xa(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==le(e)?!1:t}function Ne(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),a=_n(e);let i=De(1);t&&(r?Se(r)&&(i=Ue(r)):i=Ue(e));const s=Xa(a,n,r)?zr(a):De(0);let l=(o.left+s.x)/i.x,f=(o.top+s.y)/i.y,v=o.width/i.x,d=o.height/i.y;if(a){const p=le(a),m=r&&Se(r)?le(r):r;let b=p,u=b.frameElement;for(;u&&r&&m!==b;){const y=Ue(u),g=u.getBoundingClientRect(),$=me(u),C=g.left+(u.clientLeft+parseFloat($.paddingLeft))*y.x,O=g.top+(u.clientTop+parseFloat($.paddingTop))*y.y;l*=y.x,f*=y.y,v*=y.x,d*=y.y,l+=C,f+=O,b=le(u),u=b.frameElement}}return Nt({width:v,height:d,x:l,y:f})}const Za=[":popover-open",":modal"];function Br(e){return Za.some(t=>{try{return e.matches(t)}catch{return!1}})}function Ja(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const a=o==="fixed",i=Te(r),s=t?Br(t.floating):!1;if(r===i||s&&a)return n;let l={scrollLeft:0,scrollTop:0},f=De(1);const v=De(0),d=ye(r);if((d||!d&&!a)&&((Ie(r)!=="body"||lt(i))&&(l=Vt(r)),ye(r))){const p=Ne(r);f=Ue(r),v.x=p.x+r.clientLeft,v.y=p.y+r.clientTop}return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-l.scrollLeft*f.x+v.x,y:n.y*f.y-l.scrollTop*f.y+v.y}}function Qa(e){return Array.from(e.getClientRects())}function Ur(e){return Ne(Te(e)).left+Vt(e).scrollLeft}function es(e){const t=Te(e),n=Vt(e),r=e.ownerDocument.body,o=ce(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=ce(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+Ur(e);const s=-n.scrollTop;return me(r).direction==="rtl"&&(i+=ce(t.clientWidth,r.clientWidth)-o),{width:o,height:a,x:i,y:s}}function ts(e,t){const n=le(e),r=Te(e),o=n.visualViewport;let a=r.clientWidth,i=r.clientHeight,s=0,l=0;if(o){a=o.width,i=o.height;const f=Pn();(!f||f&&t==="fixed")&&(s=o.offsetLeft,l=o.offsetTop)}return{width:a,height:i,x:s,y:l}}function ns(e,t){const n=Ne(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,a=ye(e)?Ue(e):De(1),i=e.clientWidth*a.x,s=e.clientHeight*a.y,l=o*a.x,f=r*a.y;return{width:i,height:s,x:l,y:f}}function ar(e,t,n){let r;if(t==="viewport")r=ts(e,n);else if(t==="document")r=es(Te(e));else if(Se(t))r=ns(t,n);else{const o=zr(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return Nt(r)}function Kr(e,t){const n=Ye(e);return n===t||!Se(n)||Mt(n)?!1:me(n).position==="fixed"||Kr(n,t)}function rs(e,t){const n=t.get(e);if(n)return n;let r=st(e,[],!1).filter(s=>Se(s)&&Ie(s)!=="body"),o=null;const a=me(e).position==="fixed";let i=a?Ye(e):e;for(;Se(i)&&!Mt(i);){const s=me(i),l=Rn(i);!l&&s.position==="fixed"&&(o=null),(a?!l&&!o:!l&&s.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||lt(i)&&!l&&Kr(e,i))?r=r.filter(v=>v!==i):o=s,i=Ye(i)}return t.set(e,r),r}function os(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?rs(t,this._c):[].concat(n),r],s=i[0],l=i.reduce((f,v)=>{const d=ar(t,v,o);return f.top=ce(d.top,f.top),f.right=_e(d.right,f.right),f.bottom=_e(d.bottom,f.bottom),f.left=ce(d.left,f.left),f},ar(t,s,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function as(e){const{width:t,height:n}=Fr(e);return{width:t,height:n}}function ss(e,t,n){const r=ye(t),o=Te(t),a=n==="fixed",i=Ne(e,!0,a,t);let s={scrollLeft:0,scrollTop:0};const l=De(0);if(r||!r&&!a)if((Ie(t)!=="body"||lt(o))&&(s=Vt(t)),r){const d=Ne(t,!0,a,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else o&&(l.x=Ur(o));const f=i.left+s.scrollLeft-l.x,v=i.top+s.scrollTop-l.y;return{x:f,y:v,width:i.width,height:i.height}}function sr(e,t){return!ye(e)||me(e).position==="fixed"?null:t?t(e):e.offsetParent}function Gr(e,t){const n=le(e);if(!ye(e)||Br(e))return n;let r=sr(e,t);for(;r&&Ga(r)&&me(r).position==="static";)r=sr(r,t);return r&&(Ie(r)==="html"||Ie(r)==="body"&&me(r).position==="static"&&!Rn(r))?n:r||Ya(e)||n}const is=async function(e){const t=this.getOffsetParent||Gr,n=this.getDimensions;return{reference:ss(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,...await n(e.floating)}}};function cs(e){return me(e).direction==="rtl"}const ls={convertOffsetParentRelativeRectToViewportRelativeRect:Ja,getDocumentElement:Te,getClippingRect:os,getOffsetParent:Gr,getElementRects:is,getClientRects:Qa,getDimensions:as,getScale:Ue,isElement:Se,isRTL:cs};function us(e,t){let n=null,r;const o=Te(e);function a(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function i(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),a();const{left:f,top:v,width:d,height:p}=e.getBoundingClientRect();if(s||t(),!d||!p)return;const m=bt(v),b=bt(o.clientWidth-(f+d)),u=bt(o.clientHeight-(v+p)),y=bt(f),$={rootMargin:-m+"px "+-b+"px "+-u+"px "+-y+"px",threshold:ce(0,_e(1,l))||1};let C=!0;function O(E){const S=E[0].intersectionRatio;if(S!==l){if(!C)return i();S?i(!1,S):r=setTimeout(()=>{i(!1,1e-7)},100)}C=!1}try{n=new IntersectionObserver(O,{...$,root:o.ownerDocument})}catch{n=new IntersectionObserver(O,$)}n.observe(e)}return i(!0),a}function ds(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,f=_n(e),v=o||a?[...f?st(f):[],...st(t)]:[];v.forEach(g=>{o&&g.addEventListener("scroll",n,{passive:!0}),a&&g.addEventListener("resize",n)});const d=f&&s?us(f,n):null;let p=-1,m=null;i&&(m=new ResizeObserver(g=>{let[$]=g;$&&$.target===f&&m&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var C;(C=m)==null||C.observe(t)})),n()}),f&&!l&&m.observe(f),m.observe(t));let b,u=l?Ne(e):null;l&&y();function y(){const g=Ne(e);u&&(g.x!==u.x||g.y!==u.y||g.width!==u.width||g.height!==u.height)&&n(),u=g,b=requestAnimationFrame(y)}return n(),()=>{var g;v.forEach($=>{o&&$.removeEventListener("scroll",n),a&&$.removeEventListener("resize",n)}),d==null||d(),(g=m)==null||g.disconnect(),m=null,l&&cancelAnimationFrame(b)}}const fs=Ba,vs=La,ms=Ka,ps=Ha,ir=Wa,hs=Ua,bs=(e,t,n)=>{const r=new Map,o={platform:ls,...n},a={...o.platform,_c:r};return Va(e,t,{...o,platform:a})},gs=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?ir({element:r.current,padding:o}).fn(n):{}:r?ir({element:r,padding:o}).fn(n):{}}}};var Et=typeof document<"u"?c.useLayoutEffect:c.useEffect;function kt(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(!kt(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 a=o[r];if(!(a==="_owner"&&e.$$typeof)&&!kt(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function Yr(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function cr(e,t){const n=Yr(e);return Math.round(t*n)/n}function lr(e){const t=A.useRef(e);return Et(()=>{t.current=e}),t}function xs(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:a,floating:i}={},transform:s=!0,whileElementsMounted:l,open:f}=e,[v,d]=A.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=A.useState(r);kt(p,r)||m(r);const[b,u]=A.useState(null),[y,g]=A.useState(null),$=A.useCallback(F=>{F!==S.current&&(S.current=F,u(F))},[]),C=A.useCallback(F=>{F!==R.current&&(R.current=F,g(F))},[]),O=a||b,E=i||y,S=A.useRef(null),R=A.useRef(null),D=A.useRef(v),_=l!=null,W=lr(l),L=lr(o),k=A.useCallback(()=>{if(!S.current||!R.current)return;const F={placement:t,strategy:n,middleware:p};L.current&&(F.platform=L.current),bs(S.current,R.current,F).then(Z=>{const I={...Z,isPositioned:!0};K.current&&!kt(D.current,I)&&(D.current=I,ea.flushSync(()=>{d(I)}))})},[p,t,n,L]);Et(()=>{f===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,d(F=>({...F,isPositioned:!1})))},[f]);const K=A.useRef(!1);Et(()=>(K.current=!0,()=>{K.current=!1}),[]),Et(()=>{if(O&&(S.current=O),E&&(R.current=E),O&&E){if(W.current)return W.current(O,E,k);k()}},[O,E,k,W,_]);const j=A.useMemo(()=>({reference:S,floating:R,setReference:$,setFloating:C}),[$,C]),M=A.useMemo(()=>({reference:O,floating:E}),[O,E]),X=A.useMemo(()=>{const F={position:n,left:0,top:0};if(!M.floating)return F;const Z=cr(M.floating,v.x),I=cr(M.floating,v.y);return s?{...F,transform:"translate("+Z+"px, "+I+"px)",...Yr(M.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Z,top:I}},[n,s,M.floating,v.x,v.y]);return A.useMemo(()=>({...v,update:k,refs:j,elements:M,floatingStyles:X}),[v,k,j,M,X])}function qr(e){const[t,n]=c.useState(void 0);return Ge(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const a=o[0];let i,s;if("borderBoxSize"in a){const l=a.borderBoxSize,f=Array.isArray(l)?l[0]:l;i=f.inlineSize,s=f.blockSize}else i=e.offsetWidth,s=e.offsetHeight;n({width:i,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const Xr="Popper",[Zr,Wt]=ke(Xr),[ys,Jr]=Zr(Xr),ws=e=>{const{__scopePopper:t,children:n}=e,[r,o]=c.useState(null);return c.createElement(ys,{scope:t,anchor:r,onAnchorChange:o},n)},$s="PopperAnchor",Es=c.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,a=Jr($s,n),i=c.useRef(null),s=oe(t,i);return c.useEffect(()=>{a.onAnchorChange((r==null?void 0:r.current)||i.current)}),r?null:c.createElement(ue.div,V({},o,{ref:s}))}),Qr="PopperContent",[Os,Zl]=Zr(Qr),Cs=c.forwardRef((e,t)=>{var n,r,o,a,i,s,l,f;const{__scopePopper:v,side:d="bottom",sideOffset:p=0,align:m="center",alignOffset:b=0,arrowPadding:u=0,avoidCollisions:y=!0,collisionBoundary:g=[],collisionPadding:$=0,sticky:C="partial",hideWhenDetached:O=!1,updatePositionStrategy:E="optimized",onPlaced:S,...R}=e,D=Jr(Qr,v),[_,W]=c.useState(null),L=oe(t,be=>W(be)),[k,K]=c.useState(null),j=qr(k),M=(n=j==null?void 0:j.width)!==null&&n!==void 0?n:0,X=(r=j==null?void 0:j.height)!==null&&r!==void 0?r:0,F=d+(m!=="center"?"-"+m:""),Z=typeof $=="number"?$:{top:0,right:0,bottom:0,left:0,...$},I=Array.isArray(g)?g:[g],Y=I.length>0,J={padding:Z,boundary:I.filter(Ss),altBoundary:Y},{refs:ae,floatingStyles:se,placement:ie,isPositioned:de,middlewareData:ne}=xs({strategy:"fixed",placement:F,whileElementsMounted:(...be)=>ds(...be,{animationFrame:E==="always"}),elements:{reference:D.anchor},middleware:[za({mainAxis:p+X,alignmentAxis:b}),y&&fs({mainAxis:!0,crossAxis:!1,limiter:C==="partial"?hs():void 0,...J}),y&&vs({...J}),ms({...J,apply:({elements:be,rects:Ae,availableWidth:pt,availableHeight:ht})=>{const{width:Me,height:Gt}=Ae.reference,Ve=be.floating.style;Ve.setProperty("--radix-popper-available-width",`${pt}px`),Ve.setProperty("--radix-popper-available-height",`${ht}px`),Ve.setProperty("--radix-popper-anchor-width",`${Me}px`),Ve.setProperty("--radix-popper-anchor-height",`${Gt}px`)}}),k&&gs({element:k,padding:u}),Ts({arrowWidth:M,arrowHeight:X}),O&&ps({strategy:"referenceHidden",...J})]}),[fe,we]=eo(ie),te=xe(S);Ge(()=>{de&&(te==null||te())},[de,te]);const $e=(o=ne.arrow)===null||o===void 0?void 0:o.x,Bt=(a=ne.arrow)===null||a===void 0?void 0:a.y,mt=((i=ne.arrow)===null||i===void 0?void 0:i.centerOffset)!==0,[Ut,Kt]=c.useState();return Ge(()=>{_&&Kt(window.getComputedStyle(_).zIndex)},[_]),c.createElement("div",{ref:ae.setFloating,"data-radix-popper-content-wrapper":"",style:{...se,transform:de?se.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Ut,"--radix-popper-transform-origin":[(s=ne.transformOrigin)===null||s===void 0?void 0:s.x,(l=ne.transformOrigin)===null||l===void 0?void 0:l.y].join(" ")},dir:e.dir},c.createElement(Os,{scope:v,placedSide:fe,onArrowChange:K,arrowX:$e,arrowY:Bt,shouldHideArrow:mt},c.createElement(ue.div,V({"data-side":fe,"data-align":we},R,{ref:L,style:{...R.style,animation:de?void 0:"none",opacity:(f=ne.hide)!==null&&f!==void 0&&f.referenceHidden?0:void 0}}))))});function Ss(e){return e!==null}const Ts=e=>({name:"transformOrigin",options:e,fn(t){var n,r,o,a,i;const{placement:s,rects:l,middlewareData:f}=t,d=((n=f.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,p=d?0:e.arrowWidth,m=d?0:e.arrowHeight,[b,u]=eo(s),y={start:"0%",center:"50%",end:"100%"}[u],g=((r=(o=f.arrow)===null||o===void 0?void 0:o.x)!==null&&r!==void 0?r:0)+p/2,$=((a=(i=f.arrow)===null||i===void 0?void 0:i.y)!==null&&a!==void 0?a:0)+m/2;let C="",O="";return b==="bottom"?(C=d?y:`${g}px`,O=`${-m}px`):b==="top"?(C=d?y:`${g}px`,O=`${l.floating.height+m}px`):b==="right"?(C=`${-m}px`,O=d?y:`${$}px`):b==="left"&&(C=`${l.floating.width+m}px`,O=d?y:`${$}px`),{data:{x:C,y:O}}}});function eo(e){const[t,n="center"]=e.split("-");return[t,n]}const to=ws,no=Es,ro=Cs,oo=c.forwardRef((e,t)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...o}=e;return r?jt.createPortal(c.createElement(ue.div,V({},o,{ref:t})),r):null});function Rs(e,t){return c.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const ut=e=>{const{present:t,children:n}=e,r=Ps(t),o=typeof n=="function"?n({present:r.isPresent}):c.Children.only(n),a=oe(r.ref,o.ref);return typeof n=="function"||r.isPresent?c.cloneElement(o,{ref:a}):null};ut.displayName="Presence";function Ps(e){const[t,n]=c.useState(),r=c.useRef({}),o=c.useRef(e),a=c.useRef("none"),i=e?"mounted":"unmounted",[s,l]=Rs(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return c.useEffect(()=>{const f=gt(r.current);a.current=s==="mounted"?f:"none"},[s]),Ge(()=>{const f=r.current,v=o.current;if(v!==e){const p=a.current,m=gt(f);e?l("MOUNT"):m==="none"||(f==null?void 0:f.display)==="none"?l("UNMOUNT"):l(v&&p!==m?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Ge(()=>{if(t){const f=d=>{const m=gt(r.current).includes(d.animationName);d.target===t&&m&&jt.flushSync(()=>l("ANIMATION_END"))},v=d=>{d.target===t&&(a.current=gt(r.current))};return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:c.useCallback(f=>{f&&(r.current=getComputedStyle(f)),n(f)},[])}}function gt(e){return(e==null?void 0:e.animationName)||"none"}function Lt({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=_s({defaultProp:t,onChange:n}),a=e!==void 0,i=a?e:r,s=xe(n),l=c.useCallback(f=>{if(a){const d=typeof f=="function"?f(e):f;d!==e&&s(d)}else o(f)},[a,e,o,s]);return[i,l]}function _s({defaultProp:e,onChange:t}){const n=c.useState(e),[r]=n,o=c.useRef(r),a=xe(t);return c.useEffect(()=>{o.current!==r&&(a(r),o.current=r)},[r,o,a]),n}const Ds=c.forwardRef((e,t)=>c.createElement(ue.span,V({},e,{ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}))),Is=Ds,[Ht,Jl]=ke("Tooltip",[Wt]),Dn=Wt(),As="TooltipProvider",Ns=700,pn="tooltip.open",[ks,In]=Ht(As),js=e=>{const{__scopeTooltip:t,delayDuration:n=Ns,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:a}=e,[i,s]=c.useState(!0),l=c.useRef(!1),f=c.useRef(0);return c.useEffect(()=>{const v=f.current;return()=>window.clearTimeout(v)},[]),c.createElement(ks,{scope:t,isOpenDelayed:i,delayDuration:n,onOpen:c.useCallback(()=>{window.clearTimeout(f.current),s(!1)},[]),onClose:c.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>s(!0),r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:c.useCallback(v=>{l.current=v},[]),disableHoverableContent:o},a)},An="Tooltip",[Ms,dt]=Ht(An),Vs=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:a,disableHoverableContent:i,delayDuration:s}=e,l=In(An,e.__scopeTooltip),f=Dn(t),[v,d]=c.useState(null),p=Dt(),m=c.useRef(0),b=i??l.disableHoverableContent,u=s??l.delayDuration,y=c.useRef(!1),[g=!1,$]=Lt({prop:r,defaultProp:o,onChange:R=>{R?(l.onOpen(),document.dispatchEvent(new CustomEvent(pn))):l.onClose(),a==null||a(R)}}),C=c.useMemo(()=>g?y.current?"delayed-open":"instant-open":"closed",[g]),O=c.useCallback(()=>{window.clearTimeout(m.current),y.current=!1,$(!0)},[$]),E=c.useCallback(()=>{window.clearTimeout(m.current),$(!1)},[$]),S=c.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{y.current=!0,$(!0)},u)},[u,$]);return c.useEffect(()=>()=>window.clearTimeout(m.current),[]),c.createElement(to,f,c.createElement(Ms,{scope:t,contentId:p,open:g,stateAttribute:C,trigger:v,onTriggerChange:d,onTriggerEnter:c.useCallback(()=>{l.isOpenDelayed?S():O()},[l.isOpenDelayed,S,O]),onTriggerLeave:c.useCallback(()=>{b?E():window.clearTimeout(m.current)},[E,b]),onOpen:O,onClose:E,disableHoverableContent:b},n))},ur="TooltipTrigger",Ws=c.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=dt(ur,n),a=In(ur,n),i=Dn(n),s=c.useRef(null),l=oe(t,s,o.onTriggerChange),f=c.useRef(!1),v=c.useRef(!1),d=c.useCallback(()=>f.current=!1,[]);return c.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),c.createElement(no,V({asChild:!0},i),c.createElement(ue.button,V({"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute},r,{ref:l,onPointerMove:B(e.onPointerMove,p=>{p.pointerType!=="touch"&&!v.current&&!a.isPointerInTransitRef.current&&(o.onTriggerEnter(),v.current=!0)}),onPointerLeave:B(e.onPointerLeave,()=>{o.onTriggerLeave(),v.current=!1}),onPointerDown:B(e.onPointerDown,()=>{f.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:B(e.onFocus,()=>{f.current||o.onOpen()}),onBlur:B(e.onBlur,o.onClose),onClick:B(e.onClick,o.onClose)})))}),ao="TooltipPortal",[Ls,Hs]=Ht(ao,{forceMount:void 0}),Fs=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,a=dt(ao,t);return c.createElement(Ls,{scope:t,forceMount:n},c.createElement(ut,{present:n||a.open},c.createElement(oo,{asChild:!0,container:o},r)))},it="TooltipContent",zs=c.forwardRef((e,t)=>{const n=Hs(it,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...a}=e,i=dt(it,e.__scopeTooltip);return c.createElement(ut,{present:r||i.open},i.disableHoverableContent?c.createElement(so,V({side:o},a,{ref:t})):c.createElement(Bs,V({side:o},a,{ref:t})))}),Bs=c.forwardRef((e,t)=>{const n=dt(it,e.__scopeTooltip),r=In(it,e.__scopeTooltip),o=c.useRef(null),a=oe(t,o),[i,s]=c.useState(null),{trigger:l,onClose:f}=n,v=o.current,{onPointerInTransitChange:d}=r,p=c.useCallback(()=>{s(null),d(!1)},[d]),m=c.useCallback((b,u)=>{const y=b.currentTarget,g={x:b.clientX,y:b.clientY},$=Ks(g,y.getBoundingClientRect()),C=Gs(g,$),O=Ys(u.getBoundingClientRect()),E=Xs([...C,...O]);s(E),d(!0)},[d]);return c.useEffect(()=>()=>p(),[p]),c.useEffect(()=>{if(l&&v){const b=y=>m(y,v),u=y=>m(y,l);return l.addEventListener("pointerleave",b),v.addEventListener("pointerleave",u),()=>{l.removeEventListener("pointerleave",b),v.removeEventListener("pointerleave",u)}}},[l,v,m,p]),c.useEffect(()=>{if(i){const b=u=>{const y=u.target,g={x:u.clientX,y:u.clientY},$=(l==null?void 0:l.contains(y))||(v==null?void 0:v.contains(y)),C=!qs(g,i);$?p():C&&(p(),f())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[l,v,i,f,p]),c.createElement(so,V({},e,{ref:a}))}),[Us,Ql]=Ht(An,{isInside:!1}),so=c.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:a,onPointerDownOutside:i,...s}=e,l=dt(it,n),f=Dn(n),{onClose:v}=l;return c.useEffect(()=>(document.addEventListener(pn,v),()=>document.removeEventListener(pn,v)),[v]),c.useEffect(()=>{if(l.trigger){const d=p=>{const m=p.target;m!=null&&m.contains(l.trigger)&&v()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,v]),c.createElement(Mr,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:d=>d.preventDefault(),onDismiss:v},c.createElement(ro,V({"data-state":l.stateAttribute},f,s,{ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"}}),c.createElement(kr,null,r),c.createElement(Us,{scope:n,isInside:!0},c.createElement(Is,{id:l.contentId,role:"tooltip"},o||r))))});function Ks(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,o,a)){case a:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Gs(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Ys(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function qs(e,t){const{x:n,y:r}=e;let o=!1;for(let a=0,i=t.length-1;a<t.length;i=a++){const s=t[a].x,l=t[a].y,f=t[i].x,v=t[i].y;l>r!=v>r&&n<(f-s)*(r-l)/(v-l)+s&&(o=!o)}return o}function Xs(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Zs(t)}function Zs(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const a=t[t.length-1],i=t[t.length-2];if((a.x-i.x)*(o.y-i.y)>=(a.y-i.y)*(o.x-i.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const a=n[n.length-1],i=n[n.length-2];if((a.x-i.x)*(o.y-i.y)>=(a.y-i.y)*(o.x-i.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}const Js=js,Qs=Vs,ei=Ws,ti=Fs,ni=zs,et=({text:e,children:t})=>w.jsx(Js,{children:w.jsxs(Qs,{delayDuration:0,children:[w.jsx(ei,{className:"p-0 m-0",tabIndex:-1,children:t}),w.jsx(ti,{children:w.jsx(ni,{className:"p-2 bg-paper z-20 shadow border rounded max-w-xs",children:e})})]})}),he=({children:e,subChildren:t,dividerPositionX:n=0,id:r,name:o,information:a,minWidth:i,nameHasError:s,nameHasWarning:l,onDoubleClick:f})=>{const{inputTextError:v,inputTextWarning:d,inputTextDefault:p}=pe(),[m,b]=x.useObserver(pa),u=c.useRef(null),[y,g]=c.useState({width:200});return c.useEffect(()=>{if(u.current){g({width:u.current.offsetWidth||0});const $=u.current,C=()=>g({width:u.current.offsetWidth||0});return $.addEventListener("resizer",C),()=>$.removeEventListener("resizer",C)}},[]),w.jsxs("div",{className:"flex-1 flex flex-col",children:[w.jsxs("div",{ref:u,className:"flex px-0 items-center justify-between relative",children:[w.jsx("label",{htmlFor:r,onDoubleClick:f,className:"flex-1 overflow-hidden overflow-ellipsis inline-block whitespace-nowrap",style:{width:y.width-m,textDecoration:s?v:l?d:p},children:w.jsxs("div",{className:"flex items-center gap-2",children:[o,a!==""&&a!==void 0&&w.jsx(et,{text:a,children:w.jsx(Ze,{size:15})})]})}),w.jsx(ha,{oldWidth:m,onChange:b,onResizeEnd:$=>_t.setInputsWidth($)}),w.jsx("div",{style:{width:m?`${m-n}px`:"70%",minWidth:i,maxWidth:"90%"},children:e(r)})]}),t==null?void 0:t(`${o}_${r}`)]})},ri=({...e})=>{const{inputBorderError:t,inputBorderWarning:n,inputBorderDefault:r,inputTextError:o,inputTextWarning:a,inputTextDefault:i}=pe(),{onGetValueSuggestions:s}=qe(),l=x.useObserverValue(e.editValueDisabled),f=x.useObserverValue(e.valueHasWarning),v=x.useObserverValue(e.nameHasWarning),d=x.useObserverValue(e.valueHasError),p=x.useObserverValue(e.nameHasError),m=x.useObserverValue(e.information),[b,u]=x.useObserver(e.value),y=x.useObserverValue(e.name),g=x.useObserverValue(e.id),[$,C]=c.useState(s(e));return c.useEffect(()=>{C(s(e))},[e.propertyType.value,e.type.value,e.id.value,s]),w.jsx(he,{minWidth:60,id:g||"",name:y||"",information:m,nameHasError:p,nameHasWarning:v,children:O=>w.jsxs(w.Fragment,{children:[w.jsx("input",{onChange:E=>u(E.currentTarget.value),className:"w-full bg-background py-0.5 disabled:opacity-50",disabled:l,list:"prop_data_id_"+g,autoComplete:"off",value:b,id:O,style:{textDecoration:d?o:f?a:i,border:d?t:f?n:r}}),$&&w.jsx("datalist",{id:"prop_data_id_"+g,children:$.map((E,S)=>w.jsx("option",{value:E.value.value},S))})]})})};function io(e){const t=e+"CollectionProvider",[n,r]=ke(t),[o,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=m=>{const{scope:b,children:u}=m,y=c.useRef(null),g=c.useRef(new Map).current;return c.createElement(o,{scope:b,itemMap:g,collectionRef:y},u)},s=e+"CollectionSlot",l=c.forwardRef((m,b)=>{const{scope:u,children:y}=m,g=a(s,u),$=oe(b,g.collectionRef);return c.createElement(ot,{ref:$},y)}),f=e+"CollectionItemSlot",v="data-radix-collection-item",d=c.forwardRef((m,b)=>{const{scope:u,children:y,...g}=m,$=c.useRef(null),C=oe(b,$),O=a(f,u);return c.useEffect(()=>(O.itemMap.set($,{ref:$,...g}),()=>void O.itemMap.delete($))),c.createElement(ot,{[v]:"",ref:C},y)});function p(m){const b=a(e+"CollectionConsumer",m);return c.useCallback(()=>{const y=b.collectionRef.current;if(!y)return[];const g=Array.from(y.querySelectorAll(`[${v}]`));return Array.from(b.itemMap.values()).sort((O,E)=>g.indexOf(O.ref.current)-g.indexOf(E.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:i,Slot:l,ItemSlot:d},p,r]}const oi=c.createContext(void 0);function co(e){const t=c.useContext(oi);return e||t||"ltr"}let Qt=0;function ai(){c.useEffect(()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=n[0])!==null&&e!==void 0?e:dr()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:dr()),Qt++,()=>{Qt===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),Qt--}},[])}function dr(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}const en="focusScope.autoFocusOnMount",tn="focusScope.autoFocusOnUnmount",fr={bubbles:!1,cancelable:!0},si=c.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:a,...i}=e,[s,l]=c.useState(null),f=xe(o),v=xe(a),d=c.useRef(null),p=oe(t,u=>l(u)),m=c.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;c.useEffect(()=>{if(r){let u=function(C){if(m.paused||!s)return;const O=C.target;s.contains(O)?d.current=O:Re(d.current,{select:!0})},y=function(C){if(m.paused||!s)return;const O=C.relatedTarget;O!==null&&(s.contains(O)||Re(d.current,{select:!0}))},g=function(C){if(document.activeElement===document.body)for(const E of C)E.removedNodes.length>0&&Re(s)};document.addEventListener("focusin",u),document.addEventListener("focusout",y);const $=new MutationObserver(g);return s&&$.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",u),document.removeEventListener("focusout",y),$.disconnect()}}},[r,s,m.paused]),c.useEffect(()=>{if(s){mr.add(m);const u=document.activeElement;if(!s.contains(u)){const g=new CustomEvent(en,fr);s.addEventListener(en,f),s.dispatchEvent(g),g.defaultPrevented||(ii(fi(lo(s)),{select:!0}),document.activeElement===u&&Re(s))}return()=>{s.removeEventListener(en,f),setTimeout(()=>{const g=new CustomEvent(tn,fr);s.addEventListener(tn,v),s.dispatchEvent(g),g.defaultPrevented||Re(u??document.body,{select:!0}),s.removeEventListener(tn,v),mr.remove(m)},0)}}},[s,f,v,m]);const b=c.useCallback(u=>{if(!n&&!r||m.paused)return;const y=u.key==="Tab"&&!u.altKey&&!u.ctrlKey&&!u.metaKey,g=document.activeElement;if(y&&g){const $=u.currentTarget,[C,O]=ci($);C&&O?!u.shiftKey&&g===O?(u.preventDefault(),n&&Re(C,{select:!0})):u.shiftKey&&g===C&&(u.preventDefault(),n&&Re(O,{select:!0})):g===$&&u.preventDefault()}},[n,r,m.paused]);return c.createElement(ue.div,V({tabIndex:-1},i,{ref:p,onKeyDown:b}))});function ii(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Re(r,{select:t}),document.activeElement!==n)return}function ci(e){const t=lo(e),n=vr(t,e),r=vr(t.reverse(),e);return[n,r]}function lo(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function vr(e,t){for(const n of e)if(!li(n,{upTo:t}))return n}function li(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function ui(e){return e instanceof HTMLInputElement&&"select"in e}function Re(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&ui(e)&&t&&e.select()}}const mr=di();function di(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=pr(e,t),e.unshift(t)},remove(t){var n;e=pr(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function pr(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function fi(e){return e.filter(t=>t.tagName!=="A")}const nn="rovingFocusGroup.onEntryFocus",vi={bubbles:!1,cancelable:!0},Nn="RovingFocusGroup",[hn,uo,mi]=io(Nn),[pi,fo]=ke(Nn,[mi]),[hi,bi]=pi(Nn),gi=c.forwardRef((e,t)=>c.createElement(hn.Provider,{scope:e.__scopeRovingFocusGroup},c.createElement(hn.Slot,{scope:e.__scopeRovingFocusGroup},c.createElement(xi,V({},e,{ref:t}))))),xi=c.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:a,currentTabStopId:i,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:l,onEntryFocus:f,...v}=e,d=c.useRef(null),p=oe(t,d),m=co(a),[b=null,u]=Lt({prop:i,defaultProp:s,onChange:l}),[y,g]=c.useState(!1),$=xe(f),C=uo(n),O=c.useRef(!1),[E,S]=c.useState(0);return c.useEffect(()=>{const R=d.current;if(R)return R.addEventListener(nn,$),()=>R.removeEventListener(nn,$)},[$]),c.createElement(hi,{scope:n,orientation:r,dir:m,loop:o,currentTabStopId:b,onItemFocus:c.useCallback(R=>u(R),[u]),onItemShiftTab:c.useCallback(()=>g(!0),[]),onFocusableItemAdd:c.useCallback(()=>S(R=>R+1),[]),onFocusableItemRemove:c.useCallback(()=>S(R=>R-1),[])},c.createElement(ue.div,V({tabIndex:y||E===0?-1:0,"data-orientation":r},v,{ref:p,style:{outline:"none",...e.style},onMouseDown:B(e.onMouseDown,()=>{O.current=!0}),onFocus:B(e.onFocus,R=>{const D=!O.current;if(R.target===R.currentTarget&&D&&!y){const _=new CustomEvent(nn,vi);if(R.currentTarget.dispatchEvent(_),!_.defaultPrevented){const W=C().filter(M=>M.focusable),L=W.find(M=>M.active),k=W.find(M=>M.id===b),j=[L,k,...W].filter(Boolean).map(M=>M.ref.current);vo(j)}}O.current=!1}),onBlur:B(e.onBlur,()=>g(!1))})))}),yi="RovingFocusGroupItem",wi=c.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:a,...i}=e,s=Dt(),l=a||s,f=bi(yi,n),v=f.currentTabStopId===l,d=uo(n),{onFocusableItemAdd:p,onFocusableItemRemove:m}=f;return c.useEffect(()=>{if(r)return p(),()=>m()},[r,p,m]),c.createElement(hn.ItemSlot,{scope:n,id:l,focusable:r,active:o},c.createElement(ue.span,V({tabIndex:v?0:-1,"data-orientation":f.orientation},i,{ref:t,onMouseDown:B(e.onMouseDown,b=>{r?f.onItemFocus(l):b.preventDefault()}),onFocus:B(e.onFocus,()=>f.onItemFocus(l)),onKeyDown:B(e.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){f.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const u=Oi(b,f.orientation,f.dir);if(u!==void 0){b.preventDefault();let g=d().filter($=>$.focusable).map($=>$.ref.current);if(u==="last")g.reverse();else if(u==="prev"||u==="next"){u==="prev"&&g.reverse();const $=g.indexOf(b.currentTarget);g=f.loop?Ci(g,$+1):g.slice($+1)}setTimeout(()=>vo(g))}})})))}),$i={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Ei(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Oi(e,t,n){const r=Ei(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return $i[r]}function vo(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Ci(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const Si=gi,Ti=wi;var Ri=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},He=new WeakMap,xt=new WeakMap,yt={},rn=0,mo=function(e){return e&&(e.host||mo(e.parentNode))},Pi=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=mo(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},_i=function(e,t,n,r){var o=Pi(t,Array.isArray(e)?e:[e]);yt[n]||(yt[n]=new WeakMap);var a=yt[n],i=[],s=new Set,l=new Set(o),f=function(d){!d||s.has(d)||(s.add(d),f(d.parentNode))};o.forEach(f);var v=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(p){if(s.has(p))v(p);else try{var m=p.getAttribute(r),b=m!==null&&m!=="false",u=(He.get(p)||0)+1,y=(a.get(p)||0)+1;He.set(p,u),a.set(p,y),i.push(p),u===1&&b&&xt.set(p,!0),y===1&&p.setAttribute(n,"true"),b||p.setAttribute(r,"true")}catch(g){console.error("aria-hidden: cannot operate on ",p,g)}})};return v(t),s.clear(),rn++,function(){i.forEach(function(d){var p=He.get(d)-1,m=a.get(d)-1;He.set(d,p),a.set(d,m),p||(xt.has(d)||d.removeAttribute(r),xt.delete(d)),m||d.removeAttribute(n)}),rn--,rn||(He=new WeakMap,He=new WeakMap,xt=new WeakMap,yt={})}},Di=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||Ri(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),_i(r,o,n,"aria-hidden")):function(){return null}},ge=function(){return ge=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},ge.apply(this,arguments)};function po(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function Ii(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,a;r<o;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Ot="right-scroll-bar-position",Ct="width-before-scroll-bar",Ai="with-scroll-bars-hidden",Ni="--removed-body-scroll-bar-size";function on(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function ki(e,t){var n=c.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var ji=typeof window<"u"?A.useLayoutEffect:A.useEffect,hr=new WeakMap;function Mi(e,t){var n=ki(t||null,function(r){return e.forEach(function(o){return on(o,r)})});return ji(function(){var r=hr.get(n);if(r){var o=new Set(r),a=new Set(e),i=n.current;o.forEach(function(s){a.has(s)||on(s,null)}),a.forEach(function(s){o.has(s)||on(s,i)})}hr.set(n,e)},[e]),n}function Vi(e){return e}function Wi(e,t){t===void 0&&(t=Vi);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(a){var i=t(a,r);return n.push(i),function(){n=n.filter(function(s){return s!==i})}},assignSyncMedium:function(a){for(r=!0;n.length;){var i=n;n=[],i.forEach(a)}n={push:function(s){return a(s)},filter:function(){return n}}},assignMedium:function(a){r=!0;var i=[];if(n.length){var s=n;n=[],s.forEach(a),i=n}var l=function(){var v=i;i=[],v.forEach(a)},f=function(){return Promise.resolve().then(l)};f(),n={push:function(v){i.push(v),f()},filter:function(v){return i=i.filter(v),n}}}};return o}function Li(e){e===void 0&&(e={});var t=Wi(null);return t.options=ge({async:!0,ssr:!1},e),t}var ho=function(e){var t=e.sideCar,n=po(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return A.createElement(r,ge({},n))};ho.isSideCarExport=!0;function Hi(e,t){return e.useMedium(t),ho}var bo=Li(),an=function(){},Ft=A.forwardRef(function(e,t){var n=A.useRef(null),r=A.useState({onScrollCapture:an,onWheelCapture:an,onTouchMoveCapture:an}),o=r[0],a=r[1],i=e.forwardProps,s=e.children,l=e.className,f=e.removeScrollBar,v=e.enabled,d=e.shards,p=e.sideCar,m=e.noIsolation,b=e.inert,u=e.allowPinchZoom,y=e.as,g=y===void 0?"div":y,$=po(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),C=p,O=Mi([n,t]),E=ge(ge({},$),o);return A.createElement(A.Fragment,null,v&&A.createElement(C,{sideCar:bo,removeScrollBar:f,shards:d,noIsolation:m,inert:b,setCallbacks:a,allowPinchZoom:!!u,lockRef:n}),i?A.cloneElement(A.Children.only(s),ge(ge({},E),{ref:O})):A.createElement(g,ge({},E,{className:l,ref:O}),s))});Ft.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ft.classNames={fullWidth:Ct,zeroRight:Ot};var Fi=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function zi(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Fi();return t&&e.setAttribute("nonce",t),e}function Bi(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Ui(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Ki=function(){var e=0,t=null;return{add:function(n){e==0&&(t=zi())&&(Bi(t,n),Ui(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Gi=function(){var e=Ki();return function(t,n){A.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},go=function(){var e=Gi(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Yi={left:0,top:0,right:0,gap:0},sn=function(e){return parseInt(e||"",10)||0},qi=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[sn(n),sn(r),sn(o)]},Xi=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Yi;var t=qi(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Zi=go(),Ke="data-scroll-locked",Ji=function(e,t,n,r){var o=e.left,a=e.top,i=e.right,s=e.gap;return n===void 0&&(n="margin"),`
.`.concat(Ai,` {
overflow: hidden `).concat(r,`;
padding-right: `).concat(s,"px ").concat(r,`;
}
body[`).concat(Ke,`] {
overflow: hidden `).concat(r,`;
overscroll-behavior: contain;
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
padding-left: `.concat(o,`px;
padding-top: `).concat(a,`px;
padding-right: `).concat(i,`px;
margin-left:0;
margin-top:0;
margin-right: `).concat(s,"px ").concat(r,`;
`),n==="padding"&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),`
}
.`).concat(Ot,` {
right: `).concat(s,"px ").concat(r,`;
}
.`).concat(Ct,` {
margin-right: `).concat(s,"px ").concat(r,`;
}
.`).concat(Ot," .").concat(Ot,` {
right: 0 `).concat(r,`;
}
.`).concat(Ct," .").concat(Ct,` {
margin-right: 0 `).concat(r,`;
}
body[`).concat(Ke,`] {
`).concat(Ni,": ").concat(s,`px;
}
`)},br=function(){var e=parseInt(document.body.getAttribute(Ke)||"0",10);return isFinite(e)?e:0},Qi=function(){A.useEffect(function(){return document.body.setAttribute(Ke,(br()+1).toString()),function(){var e=br()-1;e<=0?document.body.removeAttribute(Ke):document.body.setAttribute(Ke,e.toString())}},[])},ec=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;Qi();var a=A.useMemo(function(){return Xi(o)},[o]);return A.createElement(Zi,{styles:Ji(a,!t,o,n?"":"!important")})},bn=!1;if(typeof window<"u")try{var wt=Object.defineProperty({},"passive",{get:function(){return bn=!0,!0}});window.addEventListener("test",wt,wt),window.removeEventListener("test",wt,wt)}catch{bn=!1}var Fe=bn?{passive:!1}:!1,tc=function(e){return e.tagName==="TEXTAREA"},xo=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!tc(e)&&n[t]==="visible")},nc=function(e){return xo(e,"overflowY")},rc=function(e){return xo(e,"overflowX")},gr=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=yo(e,n);if(r){var o=wo(e,n),a=o[1],i=o[2];if(a>i)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},oc=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},ac=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},yo=function(e,t){return e==="v"?nc(t):rc(t)},wo=function(e,t){return e==="v"?oc(t):ac(t)},sc=function(e,t){return e==="h"&&t==="rtl"?-1:1},ic=function(e,t,n,r,o){var a=sc(e,window.getComputedStyle(t).direction),i=a*r,s=n.target,l=t.contains(s),f=!1,v=i>0,d=0,p=0;do{var m=wo(e,s),b=m[0],u=m[1],y=m[2],g=u-y-a*b;(b||g)&&yo(e,s)&&(d+=g,p+=b),s=s.parentNode}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(v&&(o&&d===0||!o&&i>d)||!v&&(o&&p===0||!o&&-i>p))&&(f=!0),f},$t=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},xr=function(e){return[e.deltaX,e.deltaY]},yr=function(e){return e&&"current"in e?e.current:e},cc=function(e,t){return e[0]===t[0]&&e[1]===t[1]},lc=function(e){return`
.block-interactivity-`.concat(e,` {pointer-events: none;}
.allow-interactivity-`).concat(e,` {pointer-events: all;}
`)},uc=0,ze=[];function dc(e){var t=A.useRef([]),n=A.useRef([0,0]),r=A.useRef(),o=A.useState(uc++)[0],a=A.useState(function(){return go()})[0],i=A.useRef(e);A.useEffect(function(){i.current=e},[e]),A.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var u=Ii([e.lockRef.current],(e.shards||[]).map(yr),!0).filter(Boolean);return u.forEach(function(y){return y.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),u.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var s=A.useCallback(function(u,y){if("touches"in u&&u.touches.length===2)return!i.current.allowPinchZoom;var g=$t(u),$=n.current,C="deltaX"in u?u.deltaX:$[0]-g[0],O="deltaY"in u?u.deltaY:$[1]-g[1],E,S=u.target,R=Math.abs(C)>Math.abs(O)?"h":"v";if("touches"in u&&R==="h"&&S.type==="range")return!1;var D=gr(R,S);if(!D)return!0;if(D?E=R:(E=R==="v"?"h":"v",D=gr(R,S)),!D)return!1;if(!r.current&&"changedTouches"in u&&(C||O)&&(r.current=E),!E)return!0;var _=r.current||E;return ic(_,y,u,_==="h"?C:O,!0)},[]),l=A.useCallback(function(u){var y=u;if(!(!ze.length||ze[ze.length-1]!==a)){var g="deltaY"in y?xr(y):$t(y),$=t.current.filter(function(E){return E.name===y.type&&E.target===y.target&&cc(E.delta,g)})[0];if($&&$.should){y.cancelable&&y.preventDefault();return}if(!$){var C=(i.current.shards||[]).map(yr).filter(Boolean).filter(function(E){return E.contains(y.target)}),O=C.length>0?s(y,C[0]):!i.current.noIsolation;O&&y.cancelable&&y.preventDefault()}}},[]),f=A.useCallback(function(u,y,g,$){var C={name:u,delta:y,target:g,should:$};t.current.push(C),setTimeout(function(){t.current=t.current.filter(function(O){return O!==C})},1)},[]),v=A.useCallback(function(u){n.current=$t(u),r.current=void 0},[]),d=A.useCallback(function(u){f(u.type,xr(u),u.target,s(u,e.lockRef.current))},[]),p=A.useCallback(function(u){f(u.type,$t(u),u.target,s(u,e.lockRef.current))},[]);A.useEffect(function(){return ze.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:p}),document.addEventListener("wheel",l,Fe),document.addEventListener("touchmove",l,Fe),document.addEventListener("touchstart",v,Fe),function(){ze=ze.filter(function(u){return u!==a}),document.removeEventListener("wheel",l,Fe),document.removeEventListener("touchmove",l,Fe),document.removeEventListener("touchstart",v,Fe)}},[]);var m=e.removeScrollBar,b=e.inert;return A.createElement(A.Fragment,null,b?A.createElement(a,{styles:lc(o)}):null,m?A.createElement(ec,{gapMode:"margin"}):null)}const fc=Hi(bo,dc);var $o=A.forwardRef(function(e,t){return A.createElement(Ft,ge({},e,{ref:t,sideCar:fc}))});$o.classNames=Ft.classNames;const vc=$o,mc=["Enter"," "],pc=["ArrowDown","PageUp","Home"],Eo=["ArrowUp","PageDown","End"],hc=[...pc,...Eo],zt="Menu",[gn,bc,gc]=io(zt),[je,Oo]=ke(zt,[gc,Wt,fo]),kn=Wt(),Co=fo(),[xc,ft]=je(zt),[yc,jn]=je(zt),wc=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:a,modal:i=!0}=e,s=kn(t),[l,f]=c.useState(null),v=c.useRef(!1),d=xe(a),p=co(o);return c.useEffect(()=>{const m=()=>{v.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>v.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),c.createElement(to,s,c.createElement(xc,{scope:t,open:n,onOpenChange:d,content:l,onContentChange:f},c.createElement(yc,{scope:t,onClose:c.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:v,dir:p,modal:i},r)))},$c=c.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=kn(n);return c.createElement(no,V({},o,r,{ref:t}))}),So="MenuPortal",[Ec,Oc]=je(So,{forceMount:void 0}),Cc=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,a=ft(So,t);return c.createElement(Ec,{scope:t,forceMount:n},c.createElement(ut,{present:n||a.open},c.createElement(oo,{asChild:!0,container:o},r)))},Pe="MenuContent",[Sc,To]=je(Pe),Tc=c.forwardRef((e,t)=>{const n=Oc(Pe,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,a=ft(Pe,e.__scopeMenu),i=jn(Pe,e.__scopeMenu);return c.createElement(gn.Provider,{scope:e.__scopeMenu},c.createElement(ut,{present:r||a.open},c.createElement(gn.Slot,{scope:e.__scopeMenu},i.modal?c.createElement(Rc,V({},o,{ref:t})):c.createElement(Pc,V({},o,{ref:t})))))}),Rc=c.forwardRef((e,t)=>{const n=ft(Pe,e.__scopeMenu),r=c.useRef(null),o=oe(t,r);return c.useEffect(()=>{const a=r.current;if(a)return Di(a)},[]),c.createElement(Ro,V({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:B(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))}),Pc=c.forwardRef((e,t)=>{const n=ft(Pe,e.__scopeMenu);return c.createElement(Ro,V({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))}),Ro=c.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEntryFocus:l,onEscapeKeyDown:f,onPointerDownOutside:v,onFocusOutside:d,onInteractOutside:p,onDismiss:m,disableOutsideScroll:b,...u}=e,y=ft(Pe,n),g=jn(Pe,n),$=kn(n),C=Co(n),O=bc(n),[E,S]=c.useState(null),R=c.useRef(null),D=oe(t,R,y.onContentChange),_=c.useRef(0),W=c.useRef(""),L=c.useRef(0),k=c.useRef(null),K=c.useRef("right"),j=c.useRef(0),M=b?vc:c.Fragment,X=b?{as:ot,allowPinchZoom:!0}:void 0,F=I=>{var Y,J;const ae=W.current+I,se=O().filter(te=>!te.disabled),ie=document.activeElement,de=(Y=se.find(te=>te.ref.current===ie))===null||Y===void 0?void 0:Y.textValue,ne=se.map(te=>te.textValue),fe=Vc(ne,ae,de),we=(J=se.find(te=>te.textValue===fe))===null||J===void 0?void 0:J.ref.current;(function te($e){W.current=$e,window.clearTimeout(_.current),$e!==""&&(_.current=window.setTimeout(()=>te(""),1e3))})(ae),we&&setTimeout(()=>we.focus())};c.useEffect(()=>()=>window.clearTimeout(_.current),[]),ai();const Z=c.useCallback(I=>{var Y,J;return K.current===((Y=k.current)===null||Y===void 0?void 0:Y.side)&&Lc(I,(J=k.current)===null||J===void 0?void 0:J.area)},[]);return c.createElement(Sc,{scope:n,searchRef:W,onItemEnter:c.useCallback(I=>{Z(I)&&I.preventDefault()},[Z]),onItemLeave:c.useCallback(I=>{var Y;Z(I)||((Y=R.current)===null||Y===void 0||Y.focus(),S(null))},[Z]),onTriggerLeave:c.useCallback(I=>{Z(I)&&I.preventDefault()},[Z]),pointerGraceTimerRef:L,onPointerGraceIntentChange:c.useCallback(I=>{k.current=I},[])},c.createElement(M,X,c.createElement(si,{asChild:!0,trapped:o,onMountAutoFocus:B(a,I=>{var Y;I.preventDefault(),(Y=R.current)===null||Y===void 0||Y.focus()}),onUnmountAutoFocus:i},c.createElement(Mr,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:f,onPointerDownOutside:v,onFocusOutside:d,onInteractOutside:p,onDismiss:m},c.createElement(Si,V({asChild:!0},C,{dir:g.dir,orientation:"vertical",loop:r,currentTabStopId:E,onCurrentTabStopIdChange:S,onEntryFocus:B(l,I=>{g.isUsingKeyboardRef.current||I.preventDefault()})}),c.createElement(ro,V({role:"menu","aria-orientation":"vertical","data-state":kc(y.open),"data-radix-menu-content":"",dir:g.dir},$,u,{ref:D,style:{outline:"none",...u.style},onKeyDown:B(u.onKeyDown,I=>{const J=I.target.closest("[data-radix-menu-content]")===I.currentTarget,ae=I.ctrlKey||I.altKey||I.metaKey,se=I.key.length===1;J&&(I.key==="Tab"&&I.preventDefault(),!ae&&se&&F(I.key));const ie=R.current;if(I.target!==ie||!hc.includes(I.key))return;I.preventDefault();const ne=O().filter(fe=>!fe.disabled).map(fe=>fe.ref.current);Eo.includes(I.key)&&ne.reverse(),jc(ne)}),onBlur:B(e.onBlur,I=>{I.currentTarget.contains(I.target)||(window.clearTimeout(_.current),W.current="")}),onPointerMove:B(e.onPointerMove,yn(I=>{const Y=I.target,J=j.current!==I.clientX;if(I.currentTarget.contains(Y)&&J){const ae=I.clientX>j.current?"right":"left";K.current=ae,j.current=I.clientX}}))})))))))}),xn="MenuItem",wr="menu.itemSelect",_c=c.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,a=c.useRef(null),i=jn(xn,e.__scopeMenu),s=To(xn,e.__scopeMenu),l=oe(t,a),f=c.useRef(!1),v=()=>{const d=a.current;if(!n&&d){const p=new CustomEvent(wr,{bubbles:!0,cancelable:!0});d.addEventListener(wr,m=>r==null?void 0:r(m),{once:!0}),jr(d,p),p.defaultPrevented?f.current=!1:i.onClose()}};return c.createElement(Dc,V({},o,{ref:l,disabled:n,onClick:B(e.onClick,v),onPointerDown:d=>{var p;(p=e.onPointerDown)===null||p===void 0||p.call(e,d),f.current=!0},onPointerUp:B(e.onPointerUp,d=>{var p;f.current||(p=d.currentTarget)===null||p===void 0||p.click()}),onKeyDown:B(e.onKeyDown,d=>{const p=s.searchRef.current!=="";n||p&&d.key===" "||mc.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})}))}),Dc=c.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...a}=e,i=To(xn,n),s=Co(n),l=c.useRef(null),f=oe(t,l),[v,d]=c.useState(!1),[p,m]=c.useState("");return c.useEffect(()=>{const b=l.current;if(b){var u;m(((u=b.textContent)!==null&&u!==void 0?u:"").trim())}},[a.children]),c.createElement(gn.ItemSlot,{scope:n,disabled:r,textValue:o??p},c.createElement(Ti,V({asChild:!0},s,{focusable:!r}),c.createElement(ue.div,V({role:"menuitem","data-highlighted":v?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},a,{ref:f,onPointerMove:B(e.onPointerMove,yn(b=>{r?i.onItemLeave(b):(i.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus())})),onPointerLeave:B(e.onPointerLeave,yn(b=>i.onItemLeave(b))),onFocus:B(e.onFocus,()=>d(!0)),onBlur:B(e.onBlur,()=>d(!1))}))))}),Ic="MenuRadioGroup";je(Ic,{value:void 0,onValueChange:()=>{}});const Ac="MenuItemIndicator";je(Ac,{checked:!1});const Nc="MenuSub";je(Nc);function kc(e){return e?"open":"closed"}function jc(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Mc(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Vc(e,t,n){const o=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let i=Mc(e,Math.max(a,0));o.length===1&&(i=i.filter(f=>f!==n));const l=i.find(f=>f.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function Wc(e,t){const{x:n,y:r}=e;let o=!1;for(let a=0,i=t.length-1;a<t.length;i=a++){const s=t[a].x,l=t[a].y,f=t[i].x,v=t[i].y;l>r!=v>r&&n<(f-s)*(r-l)/(v-l)+s&&(o=!o)}return o}function Lc(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Wc(n,t)}function yn(e){return t=>t.pointerType==="mouse"?e(t):void 0}const Hc=wc,Fc=$c,zc=Cc,Bc=Tc,Uc=_c,Po="DropdownMenu",[Kc,eu]=ke(Po,[Oo]),vt=Oo(),[Gc,_o]=Kc(Po),Yc=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:a,onOpenChange:i,modal:s=!0}=e,l=vt(t),f=c.useRef(null),[v=!1,d]=Lt({prop:o,defaultProp:a,onChange:i});return c.createElement(Gc,{scope:t,triggerId:Dt(),triggerRef:f,contentId:Dt(),open:v,onOpenChange:d,onOpenToggle:c.useCallback(()=>d(p=>!p),[d]),modal:s},c.createElement(Hc,V({},l,{open:v,onOpenChange:d,dir:r,modal:s}),n))},qc="DropdownMenuTrigger",Xc=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,a=_o(qc,n),i=vt(n);return c.createElement(Fc,V({asChild:!0},i),c.createElement(ue.button,V({type:"button",id:a.triggerId,"aria-haspopup":"menu","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?"open":"closed","data-disabled":r?"":void 0,disabled:r},o,{ref:On(t,a.triggerRef),onPointerDown:B(e.onPointerDown,s=>{!r&&s.button===0&&s.ctrlKey===!1&&(a.onOpenToggle(),a.open||s.preventDefault())}),onKeyDown:B(e.onKeyDown,s=>{r||(["Enter"," "].includes(s.key)&&a.onOpenToggle(),s.key==="ArrowDown"&&a.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(s.key)&&s.preventDefault())})})))}),Zc=e=>{const{__scopeDropdownMenu:t,...n}=e,r=vt(t);return c.createElement(zc,V({},r,n))},Jc="DropdownMenuContent",Qc=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=_o(Jc,n),a=vt(n),i=c.useRef(!1);return c.createElement(Bc,V({id:o.contentId,"aria-labelledby":o.triggerId},a,r,{ref:t,onCloseAutoFocus:B(e.onCloseAutoFocus,s=>{var l;i.current||(l=o.triggerRef.current)===null||l===void 0||l.focus(),i.current=!1,s.preventDefault()}),onInteractOutside:B(e.onInteractOutside,s=>{const l=s.detail.originalEvent,f=l.button===0&&l.ctrlKey===!0,v=l.button===2||f;(!o.modal||v)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),el=c.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=vt(n);return c.createElement(Uc,V({},o,r,{ref:t}))}),tl=Yc,nl=Xc,rl=Zc,ol=Qc,al=el;function $r(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function wn(e,t){return wn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},wn(e,t)}function sl(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,wn(e,t)}var Er=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function il(e,t){return!!(e===t||Er(e)&&Er(t))}function cl(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!il(e[n],t[n]))return!1;return!0}function cn(e,t){t===void 0&&(t=cl);var n,r=[],o,a=!1;function i(){for(var s=[],l=0;l<arguments.length;l++)s[l]=arguments[l];return a&&n===this&&t(s,r)||(o=e.apply(this,s),a=!0,n=this,r=s),o}return i}var ll=typeof performance=="object"&&typeof performance.now=="function",Or=ll?function(){return performance.now()}:function(){return Date.now()};function Cr(e){cancelAnimationFrame(e.id)}function ul(e,t){var n=Or();function r(){Or()-n>=t?e.call(null):o.id=requestAnimationFrame(r)}var o={id:requestAnimationFrame(r)};return o}var ln=-1;function Sr(e){if(e===void 0&&(e=!1),ln===-1||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",document.body.appendChild(t),ln=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return ln}var Be=null;function Tr(e){if(e===void 0&&(e=!1),Be===null||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",n.direction="rtl";var r=document.createElement("div"),o=r.style;return o.width="100px",o.height="100px",t.appendChild(r),document.body.appendChild(t),t.scrollLeft>0?Be="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?Be="negative":Be="positive-ascending"),document.body.removeChild(t),Be}return Be}process.env.NODE_ENV;var dl=150,fl=function(t,n){return t},St=null,Tt=null;process.env.NODE_ENV!=="production"&&typeof window<"u"&&typeof window.WeakSet<"u"&&(St=new WeakSet,Tt=new WeakSet);function vl(e){var t,n=e.getItemOffset,r=e.getEstimatedTotalSize,o=e.getItemSize,a=e.getOffsetForIndexAndAlignment,i=e.getStartIndexForOffset,s=e.getStopIndexForStartIndex,l=e.initInstanceProps,f=e.shouldResetStyleCacheOnItemSizeChange,v=e.validateProps;return t=function(d){sl(p,d);function p(b){var u;return u=d.call(this,b)||this,u._instanceProps=l(u.props,$r(u)),u._outerRef=void 0,u._resetIsScrollingTimeoutId=null,u.state={instance:$r(u),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof u.props.initialScrollOffset=="number"?u.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},u._callOnItemsRendered=void 0,u._callOnItemsRendered=cn(function(y,g,$,C){return u.props.onItemsRendered({overscanStartIndex:y,overscanStopIndex:g,visibleStartIndex:$,visibleStopIndex:C})}),u._callOnScroll=void 0,u._callOnScroll=cn(function(y,g,$){return u.props.onScroll({scrollDirection:y,scrollOffset:g,scrollUpdateWasRequested:$})}),u._getItemStyle=void 0,u._getItemStyle=function(y){var g=u.props,$=g.direction,C=g.itemSize,O=g.layout,E=u._getItemStyleCache(f&&C,f&&O,f&&$),S;if(E.hasOwnProperty(y))S=E[y];else{var R=n(u.props,y,u._instanceProps),D=o(u.props,y,u._instanceProps),_=$==="horizontal"||O==="horizontal",W=$==="rtl",L=_?R:0;E[y]=S={position:"absolute",left:W?void 0:L,right:W?L:void 0,top:_?0:R,height:_?"100%":D,width:_?D:"100%"}}return S},u._getItemStyleCache=void 0,u._getItemStyleCache=cn(function(y,g,$){return{}}),u._onScrollHorizontal=function(y){var g=y.currentTarget,$=g.clientWidth,C=g.scrollLeft,O=g.scrollWidth;u.setState(function(E){if(E.scrollOffset===C)return null;var S=u.props.direction,R=C;if(S==="rtl")switch(Tr()){case"negative":R=-C;break;case"positive-descending":R=O-$-C;break}return R=Math.max(0,Math.min(R,O-$)),{isScrolling:!0,scrollDirection:E.scrollOffset<R?"forward":"backward",scrollOffset:R,scrollUpdateWasRequested:!1}},u._resetIsScrollingDebounced)},u._onScrollVertical=function(y){var g=y.currentTarget,$=g.clientHeight,C=g.scrollHeight,O=g.scrollTop;u.setState(function(E){if(E.scrollOffset===O)return null;var S=Math.max(0,Math.min(O,C-$));return{isScrolling:!0,scrollDirection:E.scrollOffset<S?"forward":"backward",scrollOffset:S,scrollUpdateWasRequested:!1}},u._resetIsScrollingDebounced)},u._outerRefSetter=function(y){var g=u.props.outerRef;u._outerRef=y,typeof g=="function"?g(y):g!=null&&typeof g=="object"&&g.hasOwnProperty("current")&&(g.current=y)},u._resetIsScrollingDebounced=function(){u._resetIsScrollingTimeoutId!==null&&Cr(u._resetIsScrollingTimeoutId),u._resetIsScrollingTimeoutId=ul(u._resetIsScrolling,dl)},u._resetIsScrolling=function(){u._resetIsScrollingTimeoutId=null,u.setState({isScrolling:!1},function(){u._getItemStyleCache(-1,null)})},u}p.getDerivedStateFromProps=function(u,y){return ml(u,y),v(u),null};var m=p.prototype;return m.scrollTo=function(u){u=Math.max(0,u),this.setState(function(y){return y.scrollOffset===u?null:{scrollDirection:y.scrollOffset<u?"forward":"backward",scrollOffset:u,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},m.scrollToItem=function(u,y){y===void 0&&(y="auto");var g=this.props,$=g.itemCount,C=g.layout,O=this.state.scrollOffset;u=Math.max(0,Math.min(u,$-1));var E=0;if(this._outerRef){var S=this._outerRef;C==="vertical"?E=S.scrollWidth>S.clientWidth?Sr():0:E=S.scrollHeight>S.clientHeight?Sr():0}this.scrollTo(a(this.props,u,y,O,this._instanceProps,E))},m.componentDidMount=function(){var u=this.props,y=u.direction,g=u.initialScrollOffset,$=u.layout;if(typeof g=="number"&&this._outerRef!=null){var C=this._outerRef;y==="horizontal"||$==="horizontal"?C.scrollLeft=g:C.scrollTop=g}this._callPropsCallbacks()},m.componentDidUpdate=function(){var u=this.props,y=u.direction,g=u.layout,$=this.state,C=$.scrollOffset,O=$.scrollUpdateWasRequested;if(O&&this._outerRef!=null){var E=this._outerRef;if(y==="horizontal"||g==="horizontal")if(y==="rtl")switch(Tr()){case"negative":E.scrollLeft=-C;break;case"positive-ascending":E.scrollLeft=C;break;default:var S=E.clientWidth,R=E.scrollWidth;E.scrollLeft=R-S-C;break}else E.scrollLeft=C;else E.scrollTop=C}this._callPropsCallbacks()},m.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&Cr(this._resetIsScrollingTimeoutId)},m.render=function(){var u=this.props,y=u.children,g=u.className,$=u.direction,C=u.height,O=u.innerRef,E=u.innerElementType,S=u.innerTagName,R=u.itemCount,D=u.itemData,_=u.itemKey,W=_===void 0?fl:_,L=u.layout,k=u.outerElementType,K=u.outerTagName,j=u.style,M=u.useIsScrolling,X=u.width,F=this.state.isScrolling,Z=$==="horizontal"||L==="horizontal",I=Z?this._onScrollHorizontal:this._onScrollVertical,Y=this._getRangeToRender(),J=Y[0],ae=Y[1],se=[];if(R>0)for(var ie=J;ie<=ae;ie++)se.push(c.createElement(y,{data:D,key:W(ie,D),index:ie,isScrolling:M?F:void 0,style:this._getItemStyle(ie)}));var de=r(this.props,this._instanceProps);return c.createElement(k||K||"div",{className:g,onScroll:I,ref:this._outerRefSetter,style:V({position:"relative",height:C,width:X,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:$},j)},c.createElement(E||S||"div",{children:se,ref:O,style:{height:Z?"100%":de,pointerEvents:F?"none":void 0,width:Z?de:"100%"}}))},m._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var u=this.props.itemCount;if(u>0){var y=this._getRangeToRender(),g=y[0],$=y[1],C=y[2],O=y[3];this._callOnItemsRendered(g,$,C,O)}}if(typeof this.props.onScroll=="function"){var E=this.state,S=E.scrollDirection,R=E.scrollOffset,D=E.scrollUpdateWasRequested;this._callOnScroll(S,R,D)}},m._getRangeToRender=function(){var u=this.props,y=u.itemCount,g=u.overscanCount,$=this.state,C=$.isScrolling,O=$.scrollDirection,E=$.scrollOffset;if(y===0)return[0,0,0,0];var S=i(this.props,E,this._instanceProps),R=s(this.props,S,E,this._instanceProps),D=!C||O==="backward"?Math.max(1,g):1,_=!C||O==="forward"?Math.max(1,g):1;return[Math.max(0,S-D),Math.max(0,Math.min(y-1,R+_)),S,R]},p}(c.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var ml=function(t,n){var r=t.children,o=t.direction,a=t.height,i=t.layout,s=t.innerTagName,l=t.outerTagName,f=t.width,v=n.instance;if(process.env.NODE_ENV!=="production"){(s!=null||l!=null)&&Tt&&!Tt.has(v)&&(Tt.add(v),console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead."));var d=o==="horizontal"||i==="horizontal";switch(o){case"horizontal":case"vertical":St&&!St.has(v)&&(St.add(v),console.warn('The direction prop should be either "ltr" (default) or "rtl". Please use the layout prop to specify "vertical" (default) or "horizontal" orientation.'));break;case"ltr":case"rtl":break;default:throw Error('An invalid "direction" prop has been specified. Value should be either "ltr" or "rtl". '+('"'+o+'" was specified.'))}switch(i){case"horizontal":case"vertical":break;default:throw Error('An invalid "layout" prop has been specified. Value should be either "horizontal" or "vertical". '+('"'+i+'" was specified.'))}if(r==null)throw Error('An invalid "children" prop has been specified. Value should be a React component. '+('"'+(r===null?"null":typeof r)+'" was specified.'));if(d&&typeof f!="number")throw Error('An invalid "width" prop has been specified. Horizontal lists must specify a number for width. '+('"'+(f===null?"null":typeof f)+'" was specified.'));if(!d&&typeof a!="number")throw Error('An invalid "height" prop has been specified. Vertical lists must specify a number for height. '+('"'+(a===null?"null":typeof a)+'" was specified.'))}},pl=vl({getItemOffset:function(t,n){var r=t.itemSize;return n*r},getItemSize:function(t,n){var r=t.itemSize;return r},getEstimatedTotalSize:function(t){var n=t.itemCount,r=t.itemSize;return r*n},getOffsetForIndexAndAlignment:function(t,n,r,o,a,i){var s=t.direction,l=t.height,f=t.itemCount,v=t.itemSize,d=t.layout,p=t.width,m=s==="horizontal"||d==="horizontal",b=m?p:l,u=Math.max(0,f*v-b),y=Math.min(u,n*v),g=Math.max(0,n*v-b+v+i);switch(r==="smart"&&(o>=g-b&&o<=y+b?r="auto":r="center"),r){case"start":return y;case"end":return g;case"center":{var $=Math.round(g+(y-g)/2);return $<Math.ceil(b/2)?0:$>u+Math.floor(b/2)?u:$}case"auto":default:return o>=g&&o<=y?o:o<g?g:y}},getStartIndexForOffset:function(t,n){var r=t.itemCount,o=t.itemSize;return Math.max(0,Math.min(r-1,Math.floor(n/o)))},getStopIndexForStartIndex:function(t,n,r){var o=t.direction,a=t.height,i=t.itemCount,s=t.itemSize,l=t.layout,f=t.width,v=o==="horizontal"||l==="horizontal",d=n*s,p=v?f:a,m=Math.ceil((p+r-d)/s);return Math.max(0,Math.min(i-1,n+m-1))},initInstanceProps:function(t){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(t){var n=t.itemSize;if(process.env.NODE_ENV!=="production"&&typeof n!="number")throw Error('An invalid "itemSize" prop has been specified. Value should be a number. '+('"'+(n===null?"null":typeof n)+'" was specified.'))}});const hl=({children:e,options:t=[],selectedValue:n,show:r=!1,onSelect:o,onClose:a})=>{const i=c.useRef(null),s=c.useRef(null),[l,f]=c.useState(""),v=c.useMemo(()=>t.filter(({label:d})=>d.value.toLowerCase().indexOf(l.toLowerCase())>-1),[t,l]);return c.useEffect(()=>{r&&setTimeout(()=>{var d;return(d=s.current)==null?void 0:d.focus()},0)},[r]),w.jsxs(tl,{open:r,onOpenChange:d=>d?{}:a==null?void 0:a(),children:[w.jsx(nl,{asChild:!0,children:e}),w.jsx(rl,{children:w.jsxs(ol,{align:"end",sideOffset:32,onMouseUp:d=>d.stopPropagation(),className:"z-20 h-60 w-60 p-1 flex flex-col gap-2 bg-paper shadow-xl rounded border",children:[w.jsx("input",{value:l,ref:s,placeholder:"Type to search...",onFocus:d=>d.target.select(),className:"rounded p-1 px-2 bg-background",onChange:d=>f(d.currentTarget.value),onKeyDown:d=>{var p;return d.key==="ArrowDown"?(p=i.current)==null?void 0:p.focus():d.stopPropagation()}}),w.jsxs("div",{className:"overflow-overlay overflow-track-transparent flex flex-col flex-1",children:[w.jsx(pl,{width:230,itemSize:34,itemData:v,itemCount:v.length,height:v.length===0?0:190,children:({style:d,data:p,index:m})=>w.jsx(al,{style:d,ref:m===0?i:void 0,onClick:()=>{o&&o(p[m]),a&&a()},className:`p-1 rounded cursor-pointer outline-none hover:bg-primary focus:bg-primary active:opacity-80 select-none ${n===p[m].value.value?"font-bold":""}`,children:p[m].label.value},p[m].label.value)}),v.length===0&&w.jsx("span",{className:"self-center justify-self-center opacity-80",children:"No options"})]})]})})]})},$n=({id:e,error:t,value:n,warning:r,disabled:o,autoFocus:a,placeholder:i,suggestions:s,disabledPicker:l,onBlur:f,onChange:v,onKeyDown:d,onPickerClick:p,onSelectSuggestion:m})=>{const b=c.useRef(null);c.useEffect(()=>{b.current&&a&&(b.current.focus(),b.current.select())},[a]);const[u,y]=c.useState(!1),[g,$]=c.useState(!1),[C,O]=c.useState(n),[E,S]=c.useState(n);c.useEffect(()=>{if(!s){S(n);return}const _=s==null?void 0:s.find(L=>L.value.value===n);S((_==null?void 0:_.label.value)||n);const W=[];return s.forEach(L=>{W.push(L.value.subscribe(k=>{k===n&&_&&S(_==null?void 0:_.label.value)})),W.push(L.label.subscribe(k=>{L.value.value===n&&_&&S(k)}))}),()=>W.forEach(L=>L.unsubscribe())},[s,n]),c.useEffect(()=>{g||O(E)},[E,g]);const R=c.useCallback(_=>{if(O(_.target.value),!s){v&&v(_,_.target.value);return}const W=_.target.value,L=s.find(k=>{const K=k.label.value===W,j=k.name.value===W,M=k.value.value===W;return K||j||M});L?m&&m(L):v&&v(_,W)},[s,v,m]),D=c.useCallback(_=>{$(!1),f==null||f(_)},[f]);return w.jsxs("div",{className:"flex w-full items-center relative",children:[w.jsx("input",{"data-error":t,"data-warning":r,"data-has-suggestions":(s||[]).length>0,id:e,ref:b,autoComplete:"off",onBlur:D,disabled:o,autoFocus:a,onKeyDown:d,onChange:R,placeholder:i,onFocus:()=>$(!0),...g?{value:C}:{value:E},className:"bg-background flex-1 p-1 py-0.5 data-[warning=true]:border data-[warning=true]:border-yellow-500 data-[error=true]:border data-[error=true]:border-red-500 data-[has-suggestions=true]:pr-6 disabled:opacity-50"}),!o&&(s||[]).length>0&&w.jsx(Nr,{size:24,onClick:()=>y(!0),className:"h-full rounded cursor-pointer open-suggestions text-text p-1 -ml-6 outline-none"}),w.jsx(hl,{options:s,show:u,selectedValue:String(n||""),onClose:()=>y(!1),onSelect:_=>!o&&m(_),children:w.jsx("span",{})}),!o&&!l&&w.jsx("input",{type:"button",tabIndex:-1,onClick:!o&&p,className:"h-5 cursor-pointer rounded-md ml-1 px-1.5 border bg-paper"})]})},Mn=({dividerPositionX:e=0,...t})=>{const{onPickerValueClick:n,onGetValueSuggestions:r,onGetValue:o}=qe(),[a,i]=x.useObserver(o?o(t):t.value),s=x.useObserverValue(t.valueInputPickerDisabled),l=x.useObserverValue(t.editValueDisabled),f=x.useObserverValue(t.valueHasWarning),v=x.useObserverValue(t.nameHasWarning),d=x.useObserverValue(t.valueHasError),p=x.useObserverValue(t.nameHasError),m=x.useObserverValue(t.information),b=x.useObserverValue(t.name),u=x.useObserverValue(t.id),[y,g]=c.useState(r(t));return c.useEffect(()=>{g(r(t))},[t.propertyType.value,t.type.value,t.id.value,r]),w.jsx(he,{minWidth:60,id:u||"",name:b||"",information:m,nameHasError:p,nameHasWarning:v,dividerPositionX:e,children:$=>w.jsx($n,{onSelectSuggestion:C=>i(C.value.value.toString()),onPickerClick:()=>n==null?void 0:n(t),onChange:C=>i(C.currentTarget.value),disabledPicker:s,disabled:l,suggestions:y,warning:f,error:d,value:a,id:$})})},bl=({...e})=>{const t=x.useObserverValue(e.valueHasWarning),n=x.useObserverValue(e.nameHasWarning),r=x.useObserverValue(e.valueHasError),o=x.useObserverValue(e.nameHasError),a=x.useObserverValue(e.information),i=x.useObserverValue(e.value),s=x.useObserverValue(e.name),l=x.useObserverValue(e.id);return w.jsxs("div",{className:`flex flex-col p-2 pt-1 gap-2 border rounded ${r||o?"border border-red-500":""} ${t||n?"border border-yellow-500":""}`,children:[w.jsx("div",{className:"flex justify-between items-center",children:w.jsxs("div",{className:"flex items-center",children:[w.jsx("span",{className:"text-sm font-light",children:s}),a!==""&&a!==void 0&&w.jsx(et,{text:a,children:w.jsx(Ze,{size:15})})]})}),w.jsxs("div",{id:l,className:"flex flex-col gap-1",children:[i.map(f=>w.jsx(Mn,{...f,editValueDisabled:e.editValueDisabled})),i.length===0&&w.jsx("span",{className:"font-light italic",children:"No options"})]})]})},gl=({...e})=>{const{inputBorderError:t,inputBorderWarning:n,inputBorderDefault:r,inputTextError:o,inputTextWarning:a,inputTextDefault:i}=pe(),s=x.useObserverValue(e.editValueDisabled),l=x.useObserverValue(e.valueHasWarning),f=x.useObserverValue(e.nameHasWarning),v=x.useObserverValue(e.valueHasError),d=x.useObserverValue(e.nameHasError),p=x.useObserverValue(e.information),[m,b]=x.useObserver(e.value),u=x.useObserverValue(e.name),y=x.useObserverValue(e.id);return w.jsx(he,{minWidth:60,id:y||"",name:u||"",information:p,nameHasError:d,nameHasWarning:f,onDoubleClick:()=>b(g=>!g),children:g=>w.jsxs("select",{onChange:$=>b($.currentTarget.value==="true"),className:"bg-background py-0.5",disabled:s,value:String(m),id:g,style:{textDecoration:v?o:l?a:i,border:v?t:l?n:r,width:"100%"},children:[w.jsx("option",{children:"Yes",value:"true"}),w.jsx("option",{children:"No",value:"false"})]})})},xl={justifyContent:"space-between",height:"min-content",alignItems:"center",position:"relative"},yl=({...e})=>{const{inputBorderError:t,inputBorderWarning:n,inputBorderDefault:r,inputTextError:o,inputTextWarning:a,inputTextDefault:i}=pe(),s=x.useObserverValue(e.editValueDisabled),l=x.useObserverValue(e.valueHasWarning),f=x.useObserverValue(e.valueHasError),[v,d]=x.useObserver(e.value),p=x.useObserverValue(e.id);return w.jsx("div",{style:xl,children:w.jsx("textarea",{onChange:m=>d(m.currentTarget.value),className:"w-full bg-background disabled:opacity-50",disabled:s,id:"prop_id_"+p,autoComplete:"off",value:v,style:{textDecoration:f?o:l?a:i,border:f?t:l?n:r,resize:"vertical",height:"100px"}})})},wl=({...e})=>{const{inputBorderError:t,inputBorderWarning:n,inputBorderDefault:r,inputTextError:o,inputTextWarning:a,inputTextDefault:i}=pe(),s=x.useObserverValue(e.editValueDisabled),l=x.useObserverValue(e.valueHasWarning),f=x.useObserverValue(e.nameHasWarning),v=x.useObserverValue(e.valueHasError),d=x.useObserverValue(e.nameHasError),p=x.useObserverValue(e.information),[m,b]=x.useObserver(e.value),u=x.useObserverValue(e.name),y=x.useObserverValue(e.id);return w.jsx(he,{minWidth:60,id:y||"",name:u||"",information:p,nameHasError:d,nameHasWarning:f,children:g=>w.jsx("input",{className:"w-full bg-background py-0.5 disabled:opacity-50",onChange:$=>b($.currentTarget.value),disabled:s,autoComplete:"off",value:m,id:g,style:{textDecoration:v?o:l?a:i,border:v?t:l?n:r}})})},$l=({...e})=>{const{inputBorderError:t,inputBorderWarning:n,inputBorderDefault:r,inputTextError:o,inputTextWarning:a,inputTextDefault:i}=pe(),s=x.useObserverValue(e.editValueDisabled),l=x.useObserverValue(e.valueHasWarning),f=x.useObserverValue(e.nameHasWarning),v=x.useObserverValue(e.valueHasError),d=x.useObserverValue(e.nameHasError),p=x.useObserverValue(e.information),[m,b]=x.useObserver(e.value),u=x.useObserverValue(e.name),y=x.useObserverValue(e.id);return w.jsx(he,{minWidth:60,id:y||"",name:u||"",information:p,nameHasError:d,nameHasWarning:f,children:g=>w.jsx("input",{onChange:$=>b(Number($.currentTarget.value)),className:"w-full bg-background py-0.5 disabled:opacity-50",disabled:s,autoComplete:"off",type:"number",value:m,id:g,style:{textDecoration:v?o:l?a:i,border:v?t:l?n:r}})})},El=({...e})=>{const{inputBorderError:t,inputBorderWarning:n,inputBorderDefault:r,inputTextError:o,inputTextWarning:a,inputTextDefault:i}=pe(),s=x.useObserverValue(e.editValueDisabled),l=x.useObserverValue(e.valueHasWarning),f=x.useObserverValue(e.nameHasWarning),v=x.useObserverValue(e.valueHasError),d=x.useObserverValue(e.nameHasError),p=x.useObserverValue(e.information),[m,b]=x.useObserver(e.value),u=x.useObserverValue(e.name),y=x.useObserverValue(e.id);return w.jsx(he,{minWidth:60,name:u||"",id:y||Pr.v4(),information:p,nameHasError:d,nameHasWarning:f,children:g=>w.jsx("input",{onChange:$=>b($.currentTarget.value),className:"bg-background p-1 disabled:opacity-50",disabled:s,autoComplete:"off",value:m,type:"color",id:g,style:{textDecoration:v?o:l?a:i,border:v?t:l?n:r,marginLeft:"auto"}})})},Do=({inputClassName:e="",...t})=>{const{onPickerValueClick:n,onPickerNameClick:r,onGetNameSuggestions:o,onGetValueSuggestions:a}=qe(),i=x.useObserverValue(t.valueInputPickerDisabled),s=x.useObserverValue(t.nameInputPickerDisabled),l=x.useObserverValue(t.editValueDisabled),f=x.useObserverValue(t.editNameDisabled),v=x.useObserverValue(t.valueHasWarning),d=x.useObserverValue(t.nameHasWarning),p=x.useObserverValue(t.valueHasError),m=x.useObserverValue(t.nameHasError),[b,u]=x.useObserver(t.value),[y,g]=x.useObserver(t.name),[$,C]=c.useState(o(t)),[O,E]=c.useState(a(t));return c.useEffect(()=>{C(o(t))},[t.propertyType.value,t.type.value,t.id.value,o]),c.useEffect(()=>{E(a(t))},[t.propertyType.value,t.type.value,t.id.value,a]),w.jsxs("div",{className:"flex flex-col gap-0.5 w-full",children:[w.jsx($n,{value:y,error:m,placeholder:"Property",warning:d,disabled:f,suggestions:$,id:"name_prop_id_"+t.id,disabledPicker:s,onChange:S=>g(S.currentTarget.value),onPickerClick:()=>r==null?void 0:r(t),onSelectSuggestion:S=>g(S.value.value.toString())},"name_prop_key_"+t.id),w.jsxs("label",{className:"flex items-center gap-2",children:[w.jsx("span",{children:"=",className:"cursor-pointer",onClick:()=>n==null?void 0:n(t)}),w.jsx($n,{value:b,placeholder:"Value",error:p,warning:v,suggestions:O,disabled:l,id:"value_prop_id_"+t.id,disabledPicker:i,onChange:S=>u(S.currentTarget.value),onPickerClick:()=>n==null?void 0:n(t),onSelectSuggestion:S=>u(S.value.value.toString())},"value_prop_key_"+t.id)]})]})},Ol=({...e})=>{const t=x.useObserverValue(e.valueHasWarning),n=x.useObserverValue(e.nameHasWarning),r=x.useObserverValue(e.valueHasError),o=x.useObserverValue(e.nameHasError),a=x.useObserverValue(e.information),[i,s]=x.useObserver(e.value),l=x.useObserverValue(e.name),f=x.useObserverValue(e.id),v=c.useCallback(()=>{s(p=>[...p,En({})])},[s]),d=c.useCallback(p=>{s(m=>(m.splice(p,1),[...m]))},[s]);return w.jsxs("div",{className:`flex flex-col p-2 pt-1 gap-2 border rounded ${r||o?"border border-red-500":""} ${t||n?"border border-yellow-500":""}`,children:[w.jsx("div",{className:"flex justify-between items-center",children:w.jsxs("div",{className:"flex items-center",children:[w.jsx("span",{className:"text-sm font-light pr-2",children:l}),a!==""&&a!==void 0&&w.jsx(et,{text:a,children:w.jsx(Ze,{size:15})})]})}),w.jsxs("div",{id:f,className:"flex flex-col gap-1",children:[i.map((p,m)=>w.jsxs(c.Fragment,{children:[w.jsxs("div",{className:"flex items-center",children:[w.jsx(Do,{...p,inputClassName:"bg-background",editValueDisabled:e.editValueDisabled}),w.jsx(ct,{onClick:()=>d(m),style:{minWidth:16,minHeight:16},className:"ml-1 cursor-pointer hover:text-red-400 active:opacity-80"})]}),m+1<i.length&&w.jsx("hr",{})]},p.id.value)),i.length===0&&w.jsx("span",{className:"font-light italic",children:"No options"})]}),w.jsx("button",{className:"text-sm text-secondary",onClick:v,children:"+ Add"})]})},Cl=({value:e,fileMaxSize:t,disabled:n,error:r,warning:o,typeOfFilesToAccept:a,onChange:i})=>{const s=c.useRef(null),l=c.useRef(null),f=c.useCallback(m=>{var $;const b=($=m.target.files)==null?void 0:$.item(0);if(!b||!b.name||t&&b.size>t)return;const u=b.name.lastIndexOf(".")||0,y=b.name.slice(u,b.name.length).toLowerCase();if(a&&!a.includes(y))return;const g=new FileReader;g.addEventListener("load",C=>{C.target&&i({name:b.name,size:b.size,type:b.type,lastModified:b.lastModified,content:C.target.result instanceof ArrayBuffer?Buffer.from(C.target.result).toString("base64"):C.target.result})}),g.readAsDataURL(b)},[t,a]),v=()=>{if(n)return;const m=document.createElement("input");m.type="file",m.onchange=f,a&&(m.accept=a.join(",")),m.click()},d=m=>{var b;m.code==="Enter"||m.code==="Space"?v():m.code==="Delete"?i(void 0):m.code==="ArrowRight"&&((b=l.current)==null||b.focus())},p=m=>{var b,u;m.stopPropagation(),m.preventDefault(),m.code==="Enter"||m.code==="Space"?((b=s.current)==null||b.focus(),i(void 0)):m.code==="ArrowLeft"&&((u=s.current)==null||u.focus())};return w.jsxs("div",{ref:s,"data-error":r,"data-warning":o,onClick:v,"data-disabled":n,tabIndex:n?-1:0,onKeyDown:d,className:"flex gap-2 bg-background p-1 rounded cursor-pointer focus:outline outline-primary ring-1 ring-transparent data-[warning=true]:ring-yellow-500 data-[error=true]:ring-red-500 data-[disabled=true]:opacity-50 data-[disabled=true]:focus:outline-none data-[disabled=true]:cursor-default",children:[e?w.jsxs("div",{className:"flex-1 flex gap-1",children:[w.jsx("img",{draggable:!1,src:e.content||"",height:24,width:24,alt:e.name,className:"object-contain"}),w.jsx("div",{"data-disabled":n,className:"flex-1 data-[disabled=true]:cursor-default data-[disabled=true]:select-text",children:e.name})]}):w.jsx("div",{className:"flex-1",children:"Select a file..."}),w.jsx("div",{ref:l,"data-show":!!e,"data-disabled":n,onKeyDown:p,tabIndex:e||n?-1:1,onClick:m=>{m.stopPropagation(),m.preventDefault(),i(void 0)},className:"cursor-pointer text-white self-start rounded-full hover:bg-primary focus:outline outline-primary data-[show=false]:hidden data-[disabled=true]:hidden",children:w.jsx(ct,{size:24,className:"p-1"})})]})},Sl=({...e})=>{const t=x.useObserverValue(e.typeOfFilesToAccept),n=x.useObserverValue(e.editValueDisabled),r=x.useObserverValue(e.valueHasWarning),o=x.useObserverValue(e.nameHasWarning),a=x.useObserverValue(e.valueHasError),i=x.useObserverValue(e.nameHasError),s=x.useObserverValue(e.fileMaxSize),l=x.useObserverValue(e.information),[f,v]=x.useObserver(e.value),d=x.useObserverValue(e.name),p=x.useObserverValue(e.id),m=c.useCallback(b=>{v(b)},[v]);return w.jsx(he,{minWidth:60,id:p||"",name:d||"",information:l,nameHasError:i,nameHasWarning:o,children:()=>w.jsx(Cl,{value:f,error:a,onChange:m,fileMaxSize:s,warning:r,disabled:n,typeOfFilesToAccept:t})})},Tl=({...e})=>{const t=x.useObserverValue(e.editValueDisabled),n=x.useObserverValue(e.valueHasWarning),r=x.useObserverValue(e.nameHasWarning),o=x.useObserverValue(e.valueHasError),a=x.useObserverValue(e.nameHasError),i=x.useObserverValue(e.information),[s,l]=x.useObserver(e.value),f=x.useObserverValue(e.name),v=x.useObserverValue(e.id),d=()=>{l(m=>[...m,{name:x.observe(""),value:x.observe("")}])},p=c.useCallback(m=>{l(b=>(b.splice(m,1),[...b]))},[l]);return w.jsxs("div",{className:`flex flex-col p-2 gap-2 bg-background rounded ${o||a?"border border-red-500":""} ${n||r?"border border-yellow-500":""}`,children:[w.jsx("div",{className:"flex justify-between items-center",children:w.jsxs("div",{className:"flex items-center",children:[w.jsx("span",{children:f}),i!==""&&i!==void 0&&w.jsx(et,{text:i,children:w.jsx(Ze,{size:15})})]})}),w.jsxs("div",{id:v,className:"flex flex-col gap-1",children:[s.map((m,b)=>w.jsx(Rl,{name:m.name,value:m.value,disabled:!!t,onDelete:()=>p(b)},m.value.id)),s.length===0&&w.jsx("span",{className:"font-light italic",children:"No options"})]}),w.jsx("button",{className:"text-sm text-primary",onClick:d,children:"+ Add"})]})},Rl=c.memo(({name:e,value:t,disabled:n,onDelete:r})=>{const[o,a]=x.useObserver(t),[i,s]=x.useObserver(e);return w.jsxs("div",{className:"flex gap-0.5",children:[w.jsx("input",{className:"w-full bg-paper p-1 rounded-r-none",onChange:l=>s(l.target.value),autoComplete:"off",disabled:n,placeholder:"Name",value:i}),w.jsx("input",{className:"w-full bg-paper p-1 rounded-l-none",onChange:l=>a(l.target.value),autoComplete:"off",placeholder:"Value",disabled:n,value:o}),w.jsx("button",{className:"p-1",onClick:r,children:w.jsx(ct,{})})]})}),Pl=({...e})=>{const t=x.useObserverValue(e.editValueDisabled),n=x.useObserverValue(e.valueHasWarning),r=x.useObserverValue(e.nameHasWarning),o=x.useObserverValue(e.valueHasError),a=x.useObserverValue(e.nameHasError),i=x.useObserverValue(e.information),[s,l]=x.useObserver(e.value),f=x.useObserverValue(e.name),v=x.useObserverValue(e.id),d=()=>{l(p=>[...p,""])};return w.jsxs("div",{className:`flex flex-col p-2 pt-1 gap-2 border rounded ${o||a?"border border-red-500":""} ${n||r?"border border-yellow-500":""}`,children:[w.jsxs("div",{className:"flex items-center gap-2",children:[w.jsx("span",{className:"text-sm font-light",children:f}),i!==""&&i!==void 0&&w.jsx(et,{text:i,children:w.jsx(Ze,{size:15})})]}),w.jsxs("div",{id:v,className:"flex flex-col gap-1",children:[s.map((p,m)=>w.jsxs("div",{className:"flex gap-0.5",children:[w.jsx("input",{className:"w-full bg-background p-1",disabled:t,autoComplete:"off",value:p,onChange:b=>{s[m]=b.target.value,l([...s])}}),w.jsx("button",{className:"p-1",disabled:t,onClick:()=>l([...s.filter((b,u)=>u!==m)]),children:w.jsx(ct,{})})]},m)),s.length===0&&w.jsx("span",{className:"font-light",children:"No options"}),w.jsx("button",{className:"text-sm text-secondary",onClick:d,children:"+ Add"})]})]})},_l=({...e})=>{const{inputBorderError:t,inputBorderWarning:n,inputBorderDefault:r,inputTextError:o,inputTextWarning:a,inputTextDefault:i}=pe(),s=x.useObserverValue(e.editValueDisabled),l=x.useObserverValue(e.valueHasWarning),f=x.useObserverValue(e.nameHasWarning),v=x.useObserverValue(e.valueHasError),d=x.useObserverValue(e.nameHasError),p=x.useObserverValue(e.information),[m,b]=x.useObserver(e.value),u=x.useObserverValue(e.name),y=x.useObserverValue(e.id);return w.jsx(he,{minWidth:60,id:y||"",name:u||"",information:p,nameHasError:d,nameHasWarning:f,children:g=>w.jsx("textarea",{onChange:$=>b($.currentTarget.value),className:"w-full bg-background disabled:opacity-50",disabled:s,autoComplete:"off",value:m,id:g,style:{textDecoration:v?o:l?a:i,border:v?t:l?n:r,resize:"vertical",height:"50px"}})})},Dl=({...e})=>{const{inputBorderError:t,inputBorderWarning:n,inputBorderDefault:r,inputTextError:o,inputTextWarning:a,inputTextDefault:i}=pe(),{onGetValueSuggestions:s}=qe(),l=x.useObserverValue(e.editValueDisabled),f=x.useObserverValue(e.valueHasWarning),v=x.useObserverValue(e.nameHasWarning),d=x.useObserverValue(e.valueHasError),p=x.useObserverValue(e.nameHasError),m=x.useObserverValue(e.information),[b,u]=x.useObserver(e.value),y=x.useObserverValue(e.name),g=x.useObserverValue(e.id),[$,C]=c.useState(s(e));return c.useEffect(()=>{C(s(e))},[e.propertyType.value,e.type.value,e.id.value,s]),w.jsx(he,{minWidth:60,id:g||"",name:y||"",information:m,nameHasError:p,nameHasWarning:v,children:O=>w.jsxs("select",{onChange:E=>u(E.currentTarget.value),className:"bg-background py-0.5",disabled:l,value:b,id:O,style:{textDecoration:d?o:f?a:i,border:d?t:f?n:r,width:"100%"},children:[w.jsx("option",{value:"",children:"Select"}),$==null?void 0:$.map((E,S)=>w.jsx(Il,{...E},S))]})})},Il=({...e})=>{const t=x.useObserverValue(e.description),n=x.useObserverValue(e.disabled),r=x.useObserverValue(e.label),o=x.useObserverValue(e.value);return w.jsx("option",{title:t,disabled:n,children:r,value:o})},Al={alignItems:"flex-start",flexDirection:"column",height:"min-content",position:"relative",display:"flex"},Nl=({...e})=>{const{inputBorderError:t,inputBorderWarning:n,inputBorderDefault:r,inputTextError:o,inputTextWarning:a,inputTextDefault:i}=pe(),{onGetValueSuggestions:s}=qe(),l=x.useObserverValue(e.editValueDisabled),f=x.useObserverValue(e.valueHasWarning),v=x.useObserverValue(e.valueHasError),[d,p]=x.useObserver(e.value),[m]=x.useObserver(e.name),b=x.useObserverValue(e.id),[u,y]=c.useState(s(e));c.useEffect(()=>{y(s(e))},[e.propertyType.value,e.type.value,e.id.value,s]);const g=c.useRef(null),$=c.useCallback(O=>{switch(O.code){case"Comma":p(E=>{const S=O.currentTarget.value.trim().replaceAll(",","");return S.length>0&&!E.includes(S)?[...E,S]:E}),O.currentTarget.value="";break;case"Space":p(E=>{const S=O.currentTarget.value.trim().replaceAll(" ","");return S.length>0&&!E.includes(S)?[...E,S]:E}),O.currentTarget.value="";break;case"Enter":p(E=>{const S=O.currentTarget.value.trim();return S.length>0&&!E.includes(S)?[...E,S]:E}),O.currentTarget.value="";break;case"NumpadEnter":p(E=>{const S=O.currentTarget.value.trim();return S.length>0&&!E.includes(S)?[...E,S]:E}),O.currentTarget.value="";break;case"Slash":p(E=>{const S=O.currentTarget.value.trim().replaceAll(";","");return S.length>0&&!E.includes(S)?[...E,S]:E}),O.currentTarget.value="";break}},[p]),C=c.useCallback(O=>{O.preventDefault();const E=O.clipboardData.getData("text").split(/,| |\n/g).map(S=>S.trim()).filter(S=>S.length>0);p(S=>[...S,...E.filter(R=>!S.includes(R))])},[p]);return w.jsxs("div",{style:Al,"data-disabled":l,className:"p-2 gap-2 bg-background rounded data-[disabled=true]:opacity-50",children:[w.jsx("label",{children:m}),w.jsxs("div",{className:"flex flex-wrap justify-start items-center gap-1",children:[d.map((O,E)=>w.jsxs("span",{className:"flex gap-1 items-center justify-between border px-2 py-0.5 bg-paper rounded-lg",children:[O,w.jsxs("div",{className:"flex gap-1",children:[w.jsx(va,{style:{padding:2,cursor:"pointer"},onClick:()=>{p(d.filter((S,R)=>R!==E)),g.current&&(g.current.value=O,g.current.focus(),g.current.select())}}),w.jsx(fa,{style:{padding:2,cursor:"pointer"},onClick:()=>p(d.filter((S,R)=>R!==E))})]})]},O)),w.jsx("input",{ref:g,autoComplete:"off",id:"prop_id_"+b,placeholder:"Add...",onPaste:C,onKeyDown:$,list:"prop_data_id_"+b,disabled:l,className:"w-full bg-paper px-2 mt-2",onKeyUp:O=>O.currentTarget.value=O.currentTarget.value.trim().replace(/;|,| |\./g,""),style:{textDecoration:v?o:f?a:i,border:v?t:f?n:r,height:26}}),u&&w.jsx("datalist",{id:"prop_data_id_"+b,children:u.map((O,E)=>w.jsx("option",{value:O.value.value},E))})]})]})},kl=({...e})=>{const t=x.useObserverValue(e.valueHasWarning),n=x.useObserverValue(e.nameHasWarning),r=x.useObserverValue(e.valueHasError),o=x.useObserverValue(e.nameHasError),a=x.useObserverValue(e.information),i=x.useObserverValue(e.name),s=x.useObserverValue(e.id);return w.jsxs("div",{className:`flex flex-col p-2 pt-1 gap-2 border rounded ${r||o?"border border-red-500":""} ${t||n?"border border-yellow-500":""}`,children:[w.jsx("div",{className:"flex justify-between items-center",children:w.jsxs("div",{className:"flex items-center",children:[w.jsx("span",{className:"text-sm font-light pr-2",children:i}),a!==""&&a!==void 0&&w.jsx(et,{text:a,children:w.jsx(Ze,{size:15})})]})}),w.jsx("div",{id:s,className:"flex flex-col gap-1",children:w.jsx(ko,{fields:e.value})})]})},jl=({...e})=>{const{inputTextError:t,inputTextWarning:n,inputTextDefault:r}=pe(),o=x.useObserverValue(e.valueHasWarning),a=x.useObserverValue(e.nameHasWarning),i=x.useObserverValue(e.valueHasError),s=x.useObserverValue(e.nameHasError),l=x.useObserverValue(e.information),f=x.useObserverValue(e.value),v=x.useObserverValue(e.name),d=x.useObserverValue(e.id);return w.jsx(he,{minWidth:60,id:d||"",name:v||"",nameHasError:s,information:l,nameHasWarning:a,children:p=>w.jsx("label",{style:{textDecoration:i?t:o?n:r,backgroundColor:"transparent",textOverflow:"ellipsis",display:"inline-block",whiteSpace:"nowrap",textAlign:"start",overflow:"hidden"},children:f,id:p})})};function Ml(e){const t=c.useRef({value:e,previous:e});return c.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}const Io="Switch",[Vl,tu]=ke(Io),[Wl,Ll]=Vl(Io),Hl=c.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:a,required:i,disabled:s,value:l="on",onCheckedChange:f,...v}=e,[d,p]=c.useState(null),m=oe(t,$=>p($)),b=c.useRef(!1),u=d?!!d.closest("form"):!0,[y=!1,g]=Lt({prop:o,defaultProp:a,onChange:f});return c.createElement(Wl,{scope:n,checked:y,disabled:s},c.createElement(ue.button,V({type:"button",role:"switch","aria-checked":y,"aria-required":i,"data-state":Ao(y),"data-disabled":s?"":void 0,disabled:s,value:l},v,{ref:m,onClick:B(e.onClick,$=>{g(C=>!C),u&&(b.current=$.isPropagationStopped(),b.current||$.stopPropagation())})})),u&&c.createElement(Bl,{control:d,bubbles:!b.current,name:r,value:l,checked:y,required:i,disabled:s,style:{transform:"translateX(-100%)"}}))}),Fl="SwitchThumb",zl=c.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=Ll(Fl,n);return c.createElement(ue.span,V({"data-state":Ao(o.checked),"data-disabled":o.disabled?"":void 0},r,{ref:t}))}),Bl=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,a=c.useRef(null),i=Ml(n),s=qr(t);return c.useEffect(()=>{const l=a.current,f=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(f,"checked").set;if(i!==n&&d){const p=new Event("click",{bubbles:r});d.call(l,n),l.dispatchEvent(p)}},[i,n,r]),c.createElement("input",V({type:"checkbox","aria-hidden":!0,defaultChecked:n},o,{tabIndex:-1,ref:a,style:{...e.style,...s,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function Ao(e){return e?"checked":"unchecked"}const Ul=Hl,Kl=zl,Gl=({id:e,checked:t=!1,autoFocus:n,onChange:r,onBlur:o,hasError:a=!1,disabled:i=!1,hasWarning:s})=>{const l=c.useRef(null);return c.useEffect(()=>{l.current&&n&&l.current.focus()},[n]),w.jsx(Ul,{id:e,ref:l,onBlur:o,checked:t,disabled:i,autoFocus:n,"data-error":a,"data-warning":s&&!a,onCheckedChange:()=>r(!t),className:"p-1 w-12 h-7 rounded-full bg-background cursor-pointer flex items-center justify-start hover:opacity-100 focus:ring-1 ring-primary disabled:opacity-50 disabled:cursor-default disabled:pointer-events-none data-[warning=true]:ring-yellow-500 data-[warning=true]:ring-1 data-[error=true]:ring-red-500 data-[error=true]:ring-1",children:w.jsx(Kl,{className:"w-[20px] h-[20px] bg-primary rounded-full transition-transform duration-100 translate-x-0 will-change-transform data-[state=unchecked]:bg-secondary data-[state=unchecked]:opacity-50 data-[state=checked]:translate-x-5"})})},Yl=({...e})=>{const t=x.useObserverValue(e.editValueDisabled),n=x.useObserverValue(e.valueHasWarning),r=x.useObserverValue(e.nameHasWarning),o=x.useObserverValue(e.valueHasError),a=x.useObserverValue(e.nameHasError),i=x.useObserverValue(e.information),[s,l]=x.useObserver(e.value),f=x.useObserverValue(e.name),v=x.useObserverValue(e.id);return w.jsx(he,{minWidth:60,id:v||"",name:f||"",information:i,nameHasError:a,nameHasWarning:r,children:d=>w.jsxs(w.Fragment,{children:[w.jsx("div",{className:"flex-1"}),w.jsx(Gl,{onChange:p=>l(p),hasWarning:n,disabled:t,hasError:o,checked:s,id:d})]})})},ql=({value:e})=>{const{root:t,fields:n}=x.useObserverValue(e),r=x.useObserverValue(n),o=x.useObserverValue(t);function a(){x.set(n,s=>[...s,En({value:x.observe(""),type:x.observe(q.expression),name:x.observe(`Param ${s.length}`)})])}function i(s=""){x.set(n,l=>[...l.filter(f=>f.id.value!==s).map((f,v)=>(x.set(f.name,`Param ${v}`),f))])}return w.jsxs("div",{className:"border rounded -m-0.5 pt-0.5 p-1",children:[w.jsx(No,{field:o}),w.jsx("div",{className:"pl-2",children:r.map(s=>w.jsxs("div",{className:"flex",children:[w.jsx(Mn,{...s,dividerPositionX:24}),w.jsx("button",{onClick:()=>i(s.id.value),className:"p-0 w-6 flex items-center justify-center",children:w.jsx(ct,{size:14})})]},s.id.value))}),w.jsx("button",{className:"text-sm text-secondary w-full",onClick:a,children:"+ Add"})]})},No=({field:e})=>{switch(x.useObserverValue(e.type)){case q.viewOnly:return w.jsx(jl,{...e});case q.string:return w.jsx(wl,{...e});case q.colorPicker:return w.jsx(El,{...e});case q.boolean:return w.jsx(Yl,{...e});case q.number:return w.jsx($l,{...e});case q.binary:return w.jsx(Sl,{...e});case q.bigString:return w.jsx(_l,{...e});case q.fullBigString:return w.jsx(yl,{...e});case q.selection:return w.jsx(Dl,{...e});case q.yesNoSelection:return w.jsx(gl,{...e});case q.expression:return w.jsx(Mn,{...e});case q.assign:return w.jsx(Do,{...e});case q.inputMultiTags:return w.jsx(Nl,{...e});case q.stringWithSuggestions:return w.jsx(ri,{...e});case q.optionList:return w.jsx(Tl,{...e});case q.stringList:return w.jsx(Pl,{...e});case q.multiAssign:return w.jsx(Ol,{...e});case q.multiExpression:return w.jsx(bl,{...e});case q.recursive:return w.jsx(kl,{...e});case q.fieldsTree:return w.jsx(ql,{...e});case q.hidden:return null;default:return null}},Rr=({properties:e,group:t})=>{const[n,r]=c.useState(t?_t.getGroupsInOpen(t):!0),[o,a]=c.useState([]);c.useEffect(()=>{a(()=>(e.sort((s,l)=>(s.order.value||0)-(l.order.value||0)),e))},[e]),c.useEffect(()=>{const s=[];return e.forEach(l=>{s.push(l.order.subscribe(()=>{a(()=>(e.sort((f,v)=>(f.order.value||0)-(v.order.value||0)),e))}))}),()=>s.forEach(l=>l.unsubscribe())},[e]);const i=c.useCallback(()=>{r(!n),t&&_t.setGroupsInOpen(t,!n)},[n,t]);return w.jsxs("div",{className:"flex flex-col",children:[t&&w.jsxs(w.Fragment,{children:[w.jsx("hr",{className:"mt-3"}),w.jsxs("div",{onClick:i,className:"flex py-3 px-0 justify-between cursor-pointer items-center",children:[t.toUpperCase(),n?w.jsx(da,{}):w.jsx(Nr,{})]})]}),n&&w.jsx("div",{"data-animate":!!t,className:"flex flex-col gap-1 data-[animate=true]:animate-fade-in",children:o.map(s=>w.jsx(No,{field:s},s.id.value))})]})},ko=({fields:e})=>{const t=x.useObserverValue(e),n=c.useMemo(()=>t.filter(o=>o.group.value===void 0),[t]),r=c.useMemo(()=>{const o=[];return t.forEach(a=>{a.group.value&&!o.some(i=>i===a.group.value)&&o.push(a.group.value)}),o},[t]);return w.jsxs("div",{className:"flex-1 flex-col w-full h-full",children:[w.jsx(Rr,{properties:n}),r.map(o=>w.jsx(Rr,{group:o,properties:t.filter(a=>a.group.value===o)},o)),t.length===0&&w.jsx("span",{className:"font-light italic",children:"Nothing here..."})]})},Xl=({properties:e,configs:t,...n})=>w.jsx(ra,{configs:t,...n,children:w.jsx(ko,{fields:e})});exports.PropertiesEditor=Xl;exports.TypeOfValues=q;exports.newEmptyProperty=En;exports.newEmptySuggestion=ma;
//# sourceMappingURL=index.cjs.js.map