backflow-ui-renderer 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.js +21 -12
- package/dist/renderer/components.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -120,7 +120,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
120
120
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function oct(e,t){if(e){if(typeof e=="string")return gC(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return gC(e,t)}}function gC(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function sct(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,s,a=[],l=!0,h=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){h=!0,i=u}finally{try{if(!l&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(h)throw i}}return a}}function act(e){if(Array.isArray(e))return e}function l0(){return l0=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},l0.apply(this,arguments)}var lct=function(t,n){var r;return y.isValidElement(t)?r=y.cloneElement(t,n):ne(t)?r=t(n):r=y.createElement("line",l0({},n,{className:"recharts-reference-line-line"})),r},cct=function(t,n,r,i,o,s,a,l,h){var u=o.x,f=o.y,m=o.width,g=o.height;if(r){var b=h.y,p=t.y.apply(b,{position:s});if(lo(h,"discard")&&!t.y.isInRange(p))return null;var x=[{x:u+m,y:p},{x:u,y:p}];return l==="left"?x.reverse():x}if(n){var _=h.x,S=t.x.apply(_,{position:s});if(lo(h,"discard")&&!t.x.isInRange(S))return null;var P=[{x:S,y:f+g},{x:S,y:f}];return a==="top"?P.reverse():P}if(i){var C=h.segment,w=C.map(function(E){return t.apply(E,{position:s})});return lo(h,"discard")&&Iat(w,function(E){return!t.isInRange(E)})?null:w}return null};function uct(e){var t=e.x,n=e.y,r=e.segment,i=e.xAxisId,o=e.yAxisId,s=e.shape,a=e.className,l=e.alwaysShow,h=Ult(),u=K$(i),f=X$(o),m=Glt();if(!h||!m)return null;Wi(l===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var g=Dw({x:u.scale,y:f.scale}),b=Yn(t),p=Yn(n),x=r&&r.length===2,_=cct(g,b,p,x,m,e.position,u.orientation,f.orientation,e);if(!_)return null;var S=rct(_,2),P=S[0],C=P.x,w=P.y,E=S[1],k=E.x,I=E.y,N=lo(e,"hidden")?"url(#".concat(h,")"):void 0,z=mC(mC({clipPath:N},Yt(e,!0)),{},{x1:C,y1:w,x2:k,y2:I});return y.createElement(xe,{className:pe("recharts-reference-line",a)},lct(s,z),er.renderCallByParent(e,wlt({x1:C,y1:w,x2:k,y2:I})))}var Vw=function(e){function t(){return Zlt(this,t),Jlt(this,t,arguments)}return ect(t,e),Xlt(t,[{key:"render",value:function(){return y.createElement(uct,this.props)}}])}(y.Component);Ww(Vw,"displayName","ReferenceLine");Ww(Vw,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function c0(){return c0=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},c0.apply(this,arguments)}function jc(e){"@babel/helpers - typeof";return jc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jc(e)}function yC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function vC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?yC(Object(n),!0).forEach(function(r){Sg(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function hct(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fct(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,eI(r.key),r)}}function dct(e,t,n){return t&&fct(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function pct(e,t,n){return t=cm(t),mct(e,tI()?Reflect.construct(t,n||[],cm(e).constructor):t.apply(e,n))}function mct(e,t){if(t&&(jc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return gct(e)}function gct(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function tI(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(tI=function(){return!!e})()}function cm(e){return cm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},cm(e)}function yct(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u0(e,t)}function u0(e,t){return u0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},u0(e,t)}function Sg(e,t,n){return t=eI(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eI(e){var t=vct(e,"string");return jc(t)=="symbol"?t:t+""}function vct(e,t){if(jc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(jc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var bct=function(t){var n=t.x,r=t.y,i=t.xAxis,o=t.yAxis,s=Dw({x:i.scale,y:o.scale}),a=s.apply({x:n,y:r},{bandAware:!0});return lo(t,"discard")&&!s.isInRange(a)?null:a},Pg=function(e){function t(){return hct(this,t),pct(this,t,arguments)}return yct(t,e),dct(t,[{key:"render",value:function(){var r=this.props,i=r.x,o=r.y,s=r.r,a=r.alwaysShow,l=r.clipPathId,h=Yn(i),u=Yn(o);if(Wi(a===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!h||!u)return null;var f=bct(this.props);if(!f)return null;var m=f.x,g=f.y,b=this.props,p=b.shape,x=b.className,_=lo(this.props,"hidden")?"url(#".concat(l,")"):void 0,S=vC(vC({clipPath:_},Yt(this.props,!0)),{},{cx:m,cy:g});return y.createElement(xe,{className:pe("recharts-reference-dot",x)},t.renderDot(p,S),er.renderCallByParent(this.props,{x:m-s,y:g-s,width:2*s,height:2*s}))}}])}(y.Component);Sg(Pg,"displayName","ReferenceDot");Sg(Pg,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});Sg(Pg,"renderDot",function(e,t){var n;return y.isValidElement(e)?n=y.cloneElement(e,t):ne(e)?n=e(t):n=y.createElement(mg,c0({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),n});function h0(){return h0=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},h0.apply(this,arguments)}function Bc(e){"@babel/helpers - typeof";return Bc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bc(e)}function bC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function xC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bC(Object(n),!0).forEach(function(r){Ag(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xct(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wct(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,rI(r.key),r)}}function _ct(e,t,n){return t&&wct(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Sct(e,t,n){return t=um(t),Pct(e,nI()?Reflect.construct(t,n||[],um(e).constructor):t.apply(e,n))}function Pct(e,t){if(t&&(Bc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Act(e)}function Act(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function nI(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(nI=function(){return!!e})()}function um(e){return um=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},um(e)}function Ect(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&f0(e,t)}function f0(e,t){return f0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},f0(e,t)}function Ag(e,t,n){return t=rI(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rI(e){var t=Cct(e,"string");return Bc(t)=="symbol"?t:t+""}function Cct(e,t){if(Bc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Bc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Tct=function(t,n,r,i,o){var s=o.x1,a=o.x2,l=o.y1,h=o.y2,u=o.xAxis,f=o.yAxis;if(!u||!f)return null;var m=Dw({x:u.scale,y:f.scale}),g={x:t?m.x.apply(s,{position:"start"}):m.x.rangeMin,y:r?m.y.apply(l,{position:"start"}):m.y.rangeMin},b={x:n?m.x.apply(a,{position:"end"}):m.x.rangeMax,y:i?m.y.apply(h,{position:"end"}):m.y.rangeMax};return lo(o,"discard")&&(!m.isInRange(g)||!m.isInRange(b))?null:W$(g,b)},Eg=function(e){function t(){return xct(this,t),Sct(this,t,arguments)}return Ect(t,e),_ct(t,[{key:"render",value:function(){var r=this.props,i=r.x1,o=r.x2,s=r.y1,a=r.y2,l=r.className,h=r.alwaysShow,u=r.clipPathId;Wi(h===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var f=Yn(i),m=Yn(o),g=Yn(s),b=Yn(a),p=this.props.shape;if(!f&&!m&&!g&&!b&&!p)return null;var x=Tct(f,m,g,b,this.props);if(!x&&!p)return null;var _=lo(this.props,"hidden")?"url(#".concat(u,")"):void 0;return y.createElement(xe,{className:pe("recharts-reference-area",l)},t.renderRect(p,xC(xC({clipPath:_},Yt(this.props,!0)),x)),er.renderCallByParent(this.props,x))}}])}(y.Component);Ag(Eg,"displayName","ReferenceArea");Ag(Eg,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});Ag(Eg,"renderRect",function(e,t){var n;return y.isValidElement(e)?n=y.cloneElement(e,t):ne(e)?n=e(t):n=y.createElement(Rw,h0({},t,{className:"recharts-reference-area-rect"})),n});function iI(e,t,n){if(t<1)return[];if(t===1&&n===void 0)return e;for(var r=[],i=0;i<e.length;i+=t)r.push(e[i]);return r}function Mct(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return Slt(r,n)}function Oct(e,t,n){var r=n==="width",i=e.x,o=e.y,s=e.width,a=e.height;return t===1?{start:r?i:o,end:r?i+s:o+a}:{start:r?i+s:o+a,end:r?i:o}}function hm(e,t,n,r,i){if(e*t<e*r||e*t>e*i)return!1;var o=n();return e*(t-e*o/2-r)>=0&&e*(t+e*o/2-i)<=0}function kct(e,t){return iI(e,t+1)}function $ct(e,t,n,r,i){for(var o=(r||[]).slice(),s=t.start,a=t.end,l=0,h=1,u=s,f=function(){var b=r==null?void 0:r[l];if(b===void 0)return{v:iI(r,h)};var p=l,x,_=function(){return x===void 0&&(x=n(b,p)),x},S=b.coordinate,P=l===0||hm(e,S,_,u,a);P||(l=0,u=s,h+=1),P&&(u=S+e*(_()/2+i),l+=h)},m;h<=o.length;)if(m=f(),m)return m.v;return[]}function ff(e){"@babel/helpers - typeof";return ff=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ff(e)}function wC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Pr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wC(Object(n),!0).forEach(function(r){Ict(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ict(e,t,n){return t=Nct(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nct(e){var t=Rct(e,"string");return ff(t)=="symbol"?t:t+""}function Rct(e,t){if(ff(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ff(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Lct(e,t,n,r,i){for(var o=(r||[]).slice(),s=o.length,a=t.start,l=t.end,h=function(m){var g=o[m],b,p=function(){return b===void 0&&(b=n(g,m)),b};if(m===s-1){var x=e*(g.coordinate+e*p()/2-l);o[m]=g=Pr(Pr({},g),{},{tickCoord:x>0?g.coordinate-x*e:g.coordinate})}else o[m]=g=Pr(Pr({},g),{},{tickCoord:g.coordinate});var _=hm(e,g.tickCoord,p,a,l);_&&(l=g.tickCoord-e*(p()/2+i),o[m]=Pr(Pr({},g),{},{isShow:!0}))},u=s-1;u>=0;u--)h(u);return o}function Dct(e,t,n,r,i,o){var s=(r||[]).slice(),a=s.length,l=t.start,h=t.end;if(o){var u=r[a-1],f=n(u,a-1),m=e*(u.coordinate+e*f/2-h);s[a-1]=u=Pr(Pr({},u),{},{tickCoord:m>0?u.coordinate-m*e:u.coordinate});var g=hm(e,u.tickCoord,function(){return f},l,h);g&&(h=u.tickCoord-e*(f/2+i),s[a-1]=Pr(Pr({},u),{},{isShow:!0}))}for(var b=o?a-1:a,p=function(S){var P=s[S],C,w=function(){return C===void 0&&(C=n(P,S)),C};if(S===0){var E=e*(P.coordinate-e*w()/2-l);s[S]=P=Pr(Pr({},P),{},{tickCoord:E<0?P.coordinate-E*e:P.coordinate})}else s[S]=P=Pr(Pr({},P),{},{tickCoord:P.coordinate});var k=hm(e,P.tickCoord,w,l,h);k&&(l=P.tickCoord+e*(w()/2+i),s[S]=Pr(Pr({},P),{},{isShow:!0}))},x=0;x<b;x++)p(x);return s}function Uw(e,t,n){var r=e.tick,i=e.ticks,o=e.viewBox,s=e.minTickGap,a=e.orientation,l=e.interval,h=e.tickFormatter,u=e.unit,f=e.angle;if(!i||!i.length||!r)return[];if(At(l)||Zs.isSsr)return kct(i,typeof l=="number"&&At(l)?l:0);var m=[],g=a==="top"||a==="bottom"?"width":"height",b=u&&g==="width"?dh(u,{fontSize:t,letterSpacing:n}):{width:0,height:0},p=function(P,C){var w=ne(h)?h(P.value,C):P.value;return g==="width"?Mct(dh(w,{fontSize:t,letterSpacing:n}),b,f):dh(w,{fontSize:t,letterSpacing:n})[g]},x=i.length>=2?kr(i[1].coordinate-i[0].coordinate):1,_=Oct(o,x,g);return l==="equidistantPreserveStart"?$ct(x,_,p,i,s):(l==="preserveStart"||l==="preserveStartEnd"?m=Dct(x,_,p,i,s,l==="preserveStartEnd"):m=Lct(x,_,p,i,s),m.filter(function(S){return S.isShow}))}var jct=["viewBox"],Bct=["viewBox"],zct=["ticks"];function zc(e){"@babel/helpers - typeof";return zc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zc(e)}function Ql(){return Ql=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},Ql.apply(this,arguments)}function _C(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Hn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_C(Object(n),!0).forEach(function(r){Hw(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_C(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function lv(e,t){if(e==null)return{};var n=Fct(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Fct(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Wct(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function SC(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,sI(r.key),r)}}function Vct(e,t,n){return t&&SC(e.prototype,t),n&&SC(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Uct(e,t,n){return t=fm(t),Hct(e,oI()?Reflect.construct(t,n||[],fm(e).constructor):t.apply(e,n))}function Hct(e,t){if(t&&(zc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return qct(e)}function qct(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function oI(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(oI=function(){return!!e})()}function fm(e){return fm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},fm(e)}function Gct(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&d0(e,t)}function d0(e,t){return d0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},d0(e,t)}function Hw(e,t,n){return t=sI(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sI(e){var t=Yct(e,"string");return zc(t)=="symbol"?t:t+""}function Yct(e,t){if(zc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(zc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var pu=function(e){function t(n){var r;return Wct(this,t),r=Uct(this,t,[n]),r.state={fontSize:"",letterSpacing:""},r}return Gct(t,e),Vct(t,[{key:"shouldComponentUpdate",value:function(r,i){var o=r.viewBox,s=lv(r,jct),a=this.props,l=a.viewBox,h=lv(a,Bct);return!oc(o,l)||!oc(s,h)||!oc(i,this.state)}},{key:"componentDidMount",value:function(){var r=this.layerReference;if(r){var i=r.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];i&&this.setState({fontSize:window.getComputedStyle(i).fontSize,letterSpacing:window.getComputedStyle(i).letterSpacing})}}},{key:"getTickLineCoord",value:function(r){var i=this.props,o=i.x,s=i.y,a=i.width,l=i.height,h=i.orientation,u=i.tickSize,f=i.mirror,m=i.tickMargin,g,b,p,x,_,S,P=f?-1:1,C=r.tickSize||u,w=At(r.tickCoord)?r.tickCoord:r.coordinate;switch(h){case"top":g=b=r.coordinate,x=s+ +!f*l,p=x-P*C,S=p-P*m,_=w;break;case"left":p=x=r.coordinate,b=o+ +!f*a,g=b-P*C,_=g-P*m,S=w;break;case"right":p=x=r.coordinate,b=o+ +f*a,g=b+P*C,_=g+P*m,S=w;break;default:g=b=r.coordinate,x=s+ +f*l,p=x+P*C,S=p+P*m,_=w;break}return{line:{x1:g,y1:p,x2:b,y2:x},tick:{x:_,y:S}}}},{key:"getTickTextAnchor",value:function(){var r=this.props,i=r.orientation,o=r.mirror,s;switch(i){case"left":s=o?"start":"end";break;case"right":s=o?"end":"start";break;default:s="middle";break}return s}},{key:"getTickVerticalAnchor",value:function(){var r=this.props,i=r.orientation,o=r.mirror,s="end";switch(i){case"left":case"right":s="middle";break;case"top":s=o?"start":"end";break;default:s=o?"end":"start";break}return s}},{key:"renderAxisLine",value:function(){var r=this.props,i=r.x,o=r.y,s=r.width,a=r.height,l=r.orientation,h=r.mirror,u=r.axisLine,f=Hn(Hn(Hn({},Yt(this.props,!1)),Yt(u,!1)),{},{fill:"none"});if(l==="top"||l==="bottom"){var m=+(l==="top"&&!h||l==="bottom"&&h);f=Hn(Hn({},f),{},{x1:i,y1:o+m*a,x2:i+s,y2:o+m*a})}else{var g=+(l==="left"&&!h||l==="right"&&h);f=Hn(Hn({},f),{},{x1:i+g*s,y1:o,x2:i+g*s,y2:o+a})}return y.createElement("line",Ql({},f,{className:pe("recharts-cartesian-axis-line",ii(u,"className"))}))}},{key:"renderTicks",value:function(r,i,o){var s=this,a=this.props,l=a.tickLine,h=a.stroke,u=a.tick,f=a.tickFormatter,m=a.unit,g=Uw(Hn(Hn({},this.props),{},{ticks:r}),i,o),b=this.getTickTextAnchor(),p=this.getTickVerticalAnchor(),x=Yt(this.props,!1),_=Yt(u,!1),S=Hn(Hn({},x),{},{fill:"none"},Yt(l,!1)),P=g.map(function(C,w){var E=s.getTickLineCoord(C),k=E.line,I=E.tick,N=Hn(Hn(Hn(Hn({textAnchor:b,verticalAnchor:p},x),{},{stroke:"none",fill:h},_),I),{},{index:w,payload:C,visibleTicksCount:g.length,tickFormatter:f});return y.createElement(xe,Ql({className:"recharts-cartesian-axis-tick",key:"tick-".concat(C.value,"-").concat(C.coordinate,"-").concat(C.tickCoord)},Vs(s.props,C,w)),l&&y.createElement("line",Ql({},S,k,{className:pe("recharts-cartesian-axis-tick-line",ii(l,"className"))})),u&&t.renderTickItem(u,N,"".concat(ne(f)?f(C.value,w):C.value).concat(m||"")))});return y.createElement("g",{className:"recharts-cartesian-axis-ticks"},P)}},{key:"render",value:function(){var r=this,i=this.props,o=i.axisLine,s=i.width,a=i.height,l=i.ticksGenerator,h=i.className,u=i.hide;if(u)return null;var f=this.props,m=f.ticks,g=lv(f,zct),b=m;return ne(l)&&(b=m&&m.length>0?l(this.props):l(g)),s<=0||a<=0||!b||!b.length?null:y.createElement(xe,{className:pe("recharts-cartesian-axis",h),ref:function(x){r.layerReference=x}},o&&this.renderAxisLine(),this.renderTicks(b,this.state.fontSize,this.state.letterSpacing),er.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,i,o){var s,a=pe(i.className,"recharts-cartesian-axis-tick-value");return y.isValidElement(r)?s=y.cloneElement(r,Hn(Hn({},i),{},{className:a})):ne(r)?s=r(Hn(Hn({},i),{},{className:a})):s=y.createElement(rl,Ql({},i,{className:"recharts-cartesian-axis-tick-value"}),o),s}}])}(y.Component);Hw(pu,"displayName","CartesianAxis");Hw(pu,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var Zct=["x1","y1","x2","y2","key"],Kct=["offset"];function sl(e){"@babel/helpers - typeof";return sl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sl(e)}function PC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ar(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?PC(Object(n),!0).forEach(function(r){Xct(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Xct(e,t,n){return t=Jct(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Jct(e){var t=Qct(e,"string");return sl(t)=="symbol"?t:t+""}function Qct(e,t){if(sl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(sl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Va(){return Va=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},Va.apply(this,arguments)}function AC(e,t){if(e==null)return{};var n=tut(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function tut(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var eut=function(t){var n=t.fill;if(!n||n==="none")return null;var r=t.fillOpacity,i=t.x,o=t.y,s=t.width,a=t.height,l=t.ry;return y.createElement("rect",{x:i,y:o,ry:l,width:s,height:a,stroke:"none",fill:n,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function aI(e,t){var n;if(y.isValidElement(e))n=y.cloneElement(e,t);else if(ne(e))n=e(t);else{var r=t.x1,i=t.y1,o=t.x2,s=t.y2,a=t.key,l=AC(t,Zct),h=Yt(l,!1);h.offset;var u=AC(h,Kct);n=y.createElement("line",Va({},u,{x1:r,y1:i,x2:o,y2:s,fill:"none",key:a}))}return n}function nut(e){var t=e.x,n=e.width,r=e.horizontal,i=r===void 0?!0:r,o=e.horizontalPoints;if(!i||!o||!o.length)return null;var s=o.map(function(a,l){var h=Ar(Ar({},e),{},{x1:t,y1:a,x2:t+n,y2:a,key:"line-".concat(l),index:l});return aI(i,h)});return y.createElement("g",{className:"recharts-cartesian-grid-horizontal"},s)}function rut(e){var t=e.y,n=e.height,r=e.vertical,i=r===void 0?!0:r,o=e.verticalPoints;if(!i||!o||!o.length)return null;var s=o.map(function(a,l){var h=Ar(Ar({},e),{},{x1:a,y1:t,x2:a,y2:t+n,key:"line-".concat(l),index:l});return aI(i,h)});return y.createElement("g",{className:"recharts-cartesian-grid-vertical"},s)}function iut(e){var t=e.horizontalFill,n=e.fillOpacity,r=e.x,i=e.y,o=e.width,s=e.height,a=e.horizontalPoints,l=e.horizontal,h=l===void 0?!0:l;if(!h||!t||!t.length)return null;var u=a.map(function(m){return Math.round(m+i-i)}).sort(function(m,g){return m-g});i!==u[0]&&u.unshift(0);var f=u.map(function(m,g){var b=!u[g+1],p=b?i+s-m:u[g+1]-m;if(p<=0)return null;var x=g%t.length;return y.createElement("rect",{key:"react-".concat(g),y:m,x:r,height:p,width:o,stroke:"none",fill:t[x],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return y.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function out(e){var t=e.vertical,n=t===void 0?!0:t,r=e.verticalFill,i=e.fillOpacity,o=e.x,s=e.y,a=e.width,l=e.height,h=e.verticalPoints;if(!n||!r||!r.length)return null;var u=h.map(function(m){return Math.round(m+o-o)}).sort(function(m,g){return m-g});o!==u[0]&&u.unshift(0);var f=u.map(function(m,g){var b=!u[g+1],p=b?o+a-m:u[g+1]-m;if(p<=0)return null;var x=g%r.length;return y.createElement("rect",{key:"react-".concat(g),x:m,y:s,width:p,height:l,stroke:"none",fill:r[x],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return y.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var sut=function(t,n){var r=t.xAxis,i=t.width,o=t.height,s=t.offset;return o$(Uw(Ar(Ar(Ar({},pu.defaultProps),r),{},{ticks:No(r,!0),viewBox:{x:0,y:0,width:i,height:o}})),s.left,s.left+s.width,n)},aut=function(t,n){var r=t.yAxis,i=t.width,o=t.height,s=t.offset;return o$(Uw(Ar(Ar(Ar({},pu.defaultProps),r),{},{ticks:No(r,!0),viewBox:{x:0,y:0,width:i,height:o}})),s.top,s.top+s.height,n)},jl={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function Cg(e){var t,n,r,i,o,s,a=zw(),l=Fw(),h=Ylt(),u=Ar(Ar({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:jl.stroke,fill:(n=e.fill)!==null&&n!==void 0?n:jl.fill,horizontal:(r=e.horizontal)!==null&&r!==void 0?r:jl.horizontal,horizontalFill:(i=e.horizontalFill)!==null&&i!==void 0?i:jl.horizontalFill,vertical:(o=e.vertical)!==null&&o!==void 0?o:jl.vertical,verticalFill:(s=e.verticalFill)!==null&&s!==void 0?s:jl.verticalFill,x:At(e.x)?e.x:h.left,y:At(e.y)?e.y:h.top,width:At(e.width)?e.width:h.width,height:At(e.height)?e.height:h.height}),f=u.x,m=u.y,g=u.width,b=u.height,p=u.syncWithTicks,x=u.horizontalValues,_=u.verticalValues,S=Hlt(),P=qlt();if(!At(g)||g<=0||!At(b)||b<=0||!At(f)||f!==+f||!At(m)||m!==+m)return null;var C=u.verticalCoordinatesGenerator||sut,w=u.horizontalCoordinatesGenerator||aut,E=u.horizontalPoints,k=u.verticalPoints;if((!E||!E.length)&&ne(w)){var I=x&&x.length,N=w({yAxis:P?Ar(Ar({},P),{},{ticks:I?x:P.ticks}):void 0,width:a,height:l,offset:h},I?!0:p);Wi(Array.isArray(N),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(sl(N),"]")),Array.isArray(N)&&(E=N)}if((!k||!k.length)&&ne(C)){var z=_&&_.length,R=C({xAxis:S?Ar(Ar({},S),{},{ticks:z?_:S.ticks}):void 0,width:a,height:l,offset:h},z?!0:p);Wi(Array.isArray(R),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(sl(R),"]")),Array.isArray(R)&&(k=R)}return y.createElement("g",{className:"recharts-cartesian-grid"},y.createElement(eut,{fill:u.fill,fillOpacity:u.fillOpacity,x:u.x,y:u.y,width:u.width,height:u.height,ry:u.ry}),y.createElement(nut,Va({},u,{offset:h,horizontalPoints:E,xAxis:S,yAxis:P})),y.createElement(rut,Va({},u,{offset:h,verticalPoints:k,xAxis:S,yAxis:P})),y.createElement(iut,Va({},u,{horizontalPoints:E})),y.createElement(out,Va({},u,{verticalPoints:k})))}Cg.displayName="CartesianGrid";var lut=["layout","type","stroke","connectNulls","isRange","ref"],cut=["key"],lI;function Fc(e){"@babel/helpers - typeof";return Fc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fc(e)}function cI(e,t){if(e==null)return{};var n=uut(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function uut(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Ua(){return Ua=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},Ua.apply(this,arguments)}function EC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Cs(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?EC(Object(n),!0).forEach(function(r){no(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):EC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function hut(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function CC(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,hI(r.key),r)}}function fut(e,t,n){return t&&CC(e.prototype,t),n&&CC(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function dut(e,t,n){return t=dm(t),put(e,uI()?Reflect.construct(t,n||[],dm(e).constructor):t.apply(e,n))}function put(e,t){if(t&&(Fc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return mut(e)}function mut(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function uI(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(uI=function(){return!!e})()}function dm(e){return dm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},dm(e)}function gut(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&p0(e,t)}function p0(e,t){return p0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},p0(e,t)}function no(e,t,n){return t=hI(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hI(e){var t=yut(e,"string");return Fc(t)=="symbol"?t:t+""}function yut(e,t){if(Fc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Fc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Qs=function(e){function t(){var n;hut(this,t);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=dut(this,t,[].concat(i)),no(n,"state",{isAnimationFinished:!0}),no(n,"id",fl("recharts-area-")),no(n,"handleAnimationEnd",function(){var s=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),ne(s)&&s()}),no(n,"handleAnimationStart",function(){var s=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),ne(s)&&s()}),n}return gut(t,e),fut(t,[{key:"renderDots",value:function(r,i,o){var s=this.props.isAnimationActive,a=this.state.isAnimationFinished;if(s&&!a)return null;var l=this.props,h=l.dot,u=l.points,f=l.dataKey,m=Yt(this.props,!1),g=Yt(h,!0),b=u.map(function(x,_){var S=Cs(Cs(Cs({key:"dot-".concat(_),r:3},m),g),{},{index:_,cx:x.x,cy:x.y,dataKey:f,value:x.value,payload:x.payload,points:u});return t.renderDotItem(h,S)}),p={clipPath:r?"url(#clipPath-".concat(i?"":"dots-").concat(o,")"):null};return y.createElement(xe,Ua({className:"recharts-area-dots"},p),b)}},{key:"renderHorizontalRect",value:function(r){var i=this.props,o=i.baseLine,s=i.points,a=i.strokeWidth,l=s[0].x,h=s[s.length-1].x,u=r*Math.abs(l-h),f=Is(s.map(function(m){return m.y||0}));return At(o)&&typeof o=="number"?f=Math.max(o,f):o&&Array.isArray(o)&&o.length&&(f=Math.max(Is(o.map(function(m){return m.y||0})),f)),At(f)?y.createElement("rect",{x:l<h?l:l-u,y:0,width:u,height:Math.floor(f+(a?parseInt("".concat(a),10):1))}):null}},{key:"renderVerticalRect",value:function(r){var i=this.props,o=i.baseLine,s=i.points,a=i.strokeWidth,l=s[0].y,h=s[s.length-1].y,u=r*Math.abs(l-h),f=Is(s.map(function(m){return m.x||0}));return At(o)&&typeof o=="number"?f=Math.max(o,f):o&&Array.isArray(o)&&o.length&&(f=Math.max(Is(o.map(function(m){return m.x||0})),f)),At(f)?y.createElement("rect",{x:0,y:l<h?l:l-u,width:f+(a?parseInt("".concat(a),10):1),height:Math.floor(u)}):null}},{key:"renderClipRect",value:function(r){var i=this.props.layout;return i==="vertical"?this.renderVerticalRect(r):this.renderHorizontalRect(r)}},{key:"renderAreaStatically",value:function(r,i,o,s){var a=this.props,l=a.layout,h=a.type,u=a.stroke,f=a.connectNulls,m=a.isRange;a.ref;var g=cI(a,lut);return y.createElement(xe,{clipPath:o?"url(#clipPath-".concat(s,")"):null},y.createElement(Ka,Ua({},Yt(g,!0),{points:r,connectNulls:f,type:h,baseLine:i,layout:l,stroke:"none",className:"recharts-area-area"})),u!=="none"&&y.createElement(Ka,Ua({},Yt(this.props,!1),{className:"recharts-area-curve",layout:l,type:h,connectNulls:f,fill:"none",points:r})),u!=="none"&&m&&y.createElement(Ka,Ua({},Yt(this.props,!1),{className:"recharts-area-curve",layout:l,type:h,connectNulls:f,fill:"none",points:i})))}},{key:"renderAreaWithAnimation",value:function(r,i){var o=this,s=this.props,a=s.points,l=s.baseLine,h=s.isAnimationActive,u=s.animationBegin,f=s.animationDuration,m=s.animationEasing,g=s.animationId,b=this.state,p=b.prevPoints,x=b.prevBaseLine;return y.createElement(Vi,{begin:u,duration:f,isActive:h,easing:m,from:{t:0},to:{t:1},key:"area-".concat(g),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(_){var S=_.t;if(p){var P=p.length/a.length,C=a.map(function(I,N){var z=Math.floor(N*P);if(p[z]){var R=p[z],D=tr(R.x,I.x),V=tr(R.y,I.y);return Cs(Cs({},I),{},{x:D(S),y:V(S)})}return I}),w;if(At(l)&&typeof l=="number"){var E=tr(x,l);w=E(S)}else if(re(l)||au(l)){var k=tr(x,0);w=k(S)}else w=l.map(function(I,N){var z=Math.floor(N*P);if(x[z]){var R=x[z],D=tr(R.x,I.x),V=tr(R.y,I.y);return Cs(Cs({},I),{},{x:D(S),y:V(S)})}return I});return o.renderAreaStatically(C,w,r,i)}return y.createElement(xe,null,y.createElement("defs",null,y.createElement("clipPath",{id:"animationClipPath-".concat(i)},o.renderClipRect(S))),y.createElement(xe,{clipPath:"url(#animationClipPath-".concat(i,")")},o.renderAreaStatically(a,l,r,i)))})}},{key:"renderArea",value:function(r,i){var o=this.props,s=o.points,a=o.baseLine,l=o.isAnimationActive,h=this.state,u=h.prevPoints,f=h.prevBaseLine,m=h.totalLength;return l&&s&&s.length&&(!u&&m>0||!il(u,s)||!il(f,a))?this.renderAreaWithAnimation(r,i):this.renderAreaStatically(s,a,r,i)}},{key:"render",value:function(){var r,i=this.props,o=i.hide,s=i.dot,a=i.points,l=i.className,h=i.top,u=i.left,f=i.xAxis,m=i.yAxis,g=i.width,b=i.height,p=i.isAnimationActive,x=i.id;if(o||!a||!a.length)return null;var _=this.state.isAnimationFinished,S=a.length===1,P=pe("recharts-area",l),C=f&&f.allowDataOverflow,w=m&&m.allowDataOverflow,E=C||w,k=re(x)?this.id:x,I=(r=Yt(s,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},N=I.r,z=N===void 0?3:N,R=I.strokeWidth,D=R===void 0?2:R,V=$6(s)?s:{},F=V.clipDot,W=F===void 0?!0:F,Z=z*2+D;return y.createElement(xe,{className:P},C||w?y.createElement("defs",null,y.createElement("clipPath",{id:"clipPath-".concat(k)},y.createElement("rect",{x:C?u:u-g/2,y:w?h:h-b/2,width:C?g:g*2,height:w?b:b*2})),!W&&y.createElement("clipPath",{id:"clipPath-dots-".concat(k)},y.createElement("rect",{x:u-Z/2,y:h-Z/2,width:g+Z,height:b+Z}))):null,S?null:this.renderArea(E,k),(s||S)&&this.renderDots(E,W,k),(!p||_)&&ao.renderCallByParent(this.props,a))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,curBaseLine:r.baseLine,prevPoints:i.curPoints,prevBaseLine:i.curBaseLine}:r.points!==i.curPoints||r.baseLine!==i.curBaseLine?{curPoints:r.points,curBaseLine:r.baseLine}:null}}])}(y.PureComponent);lI=Qs;no(Qs,"displayName","Area");no(Qs,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!Zs.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});no(Qs,"getBaseValue",function(e,t,n,r){var i=e.layout,o=e.baseValue,s=t.props.baseValue,a=s??o;if(At(a)&&typeof a=="number")return a;var l=i==="horizontal"?r:n,h=l.scale.domain();if(l.type==="number"){var u=Math.max(h[0],h[1]),f=Math.min(h[0],h[1]);return a==="dataMin"?f:a==="dataMax"||u<0?u:Math.max(Math.min(h[0],h[1]),0)}return a==="dataMin"?h[0]:a==="dataMax"?h[1]:h[0]});no(Qs,"getComposedData",function(e){var t=e.props,n=e.item,r=e.xAxis,i=e.yAxis,o=e.xAxisTicks,s=e.yAxisTicks,a=e.bandSize,l=e.dataKey,h=e.stackedData,u=e.dataStartIndex,f=e.displayedData,m=e.offset,g=t.layout,b=h&&h.length,p=lI.getBaseValue(t,n,r,i),x=g==="horizontal",_=!1,S=f.map(function(C,w){var E;b?E=h[u+w]:(E=_n(C,l),Array.isArray(E)?_=!0:E=[p,E]);var k=E[1]==null||b&&_n(C,l)==null;return x?{x:zp({axis:r,ticks:o,bandSize:a,entry:C,index:w}),y:k?null:i.scale(E[1]),value:E,payload:C}:{x:k?null:r.scale(E[1]),y:zp({axis:i,ticks:s,bandSize:a,entry:C,index:w}),value:E,payload:C}}),P;return b||_?P=S.map(function(C){var w=Array.isArray(C.value)?C.value[0]:null;return x?{x:C.x,y:w!=null&&C.y!=null?i.scale(w):null}:{x:w!=null?r.scale(w):null,y:C.y}}):P=x?i.scale(p):r.scale(p),Cs({points:S,baseLine:P,layout:g,isRange:_},m)});no(Qs,"renderDotItem",function(e,t){var n;if(y.isValidElement(e))n=y.cloneElement(e,t);else if(ne(e))n=e(t);else{var r=pe("recharts-area-dot",typeof e!="boolean"?e.className:""),i=t.key,o=cI(t,cut);n=y.createElement(mg,Ua({},o,{key:i,className:r}))}return n});function Wc(e){"@babel/helpers - typeof";return Wc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wc(e)}function vut(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function but(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,pI(r.key),r)}}function xut(e,t,n){return t&&but(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function wut(e,t,n){return t=pm(t),_ut(e,fI()?Reflect.construct(t,n||[],pm(e).constructor):t.apply(e,n))}function _ut(e,t){if(t&&(Wc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Sut(e)}function Sut(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function fI(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(fI=function(){return!!e})()}function pm(e){return pm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},pm(e)}function Put(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&m0(e,t)}function m0(e,t){return m0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},m0(e,t)}function dI(e,t,n){return t=pI(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pI(e){var t=Aut(e,"string");return Wc(t)=="symbol"?t:t+""}function Aut(e,t){if(Wc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Wc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var $f=function(e){function t(){return vut(this,t),wut(this,t,arguments)}return Put(t,e),xut(t,[{key:"render",value:function(){return null}}])}(Nr.Component);dI($f,"displayName","ZAxis");dI($f,"defaultProps",{zAxisId:0,range:[64,64],scale:"auto",type:"number"});var Eut=["option","isActive"];function bh(){return bh=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},bh.apply(this,arguments)}function Cut(e,t){if(e==null)return{};var n=Tut(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Tut(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Mut(e){var t=e.option,n=e.isActive,r=Cut(e,Eut);return typeof t=="string"?Nr.createElement(tm,bh({option:Nr.createElement(tg,bh({type:t},r)),isActive:n,shapeType:"symbols"},r)):Nr.createElement(tm,bh({option:t,isActive:n,shapeType:"symbols"},r))}function Vc(e){"@babel/helpers - typeof";return Vc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vc(e)}function xh(){return xh=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},xh.apply(this,arguments)}function TC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function xi(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?TC(Object(n),!0).forEach(function(r){Rs(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Out(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function MC(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,gI(r.key),r)}}function kut(e,t,n){return t&&MC(e.prototype,t),n&&MC(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function $ut(e,t,n){return t=mm(t),Iut(e,mI()?Reflect.construct(t,n||[],mm(e).constructor):t.apply(e,n))}function Iut(e,t){if(t&&(Vc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Nut(e)}function Nut(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function mI(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(mI=function(){return!!e})()}function mm(e){return mm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},mm(e)}function Rut(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&g0(e,t)}function g0(e,t){return g0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},g0(e,t)}function Rs(e,t,n){return t=gI(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gI(e){var t=Lut(e,"string");return Vc(t)=="symbol"?t:t+""}function Lut(e,t){if(Vc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Vc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var If=function(e){function t(){var n;Out(this,t);for(var r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];return n=$ut(this,t,[].concat(i)),Rs(n,"state",{isAnimationFinished:!1}),Rs(n,"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0})}),Rs(n,"handleAnimationStart",function(){n.setState({isAnimationFinished:!1})}),Rs(n,"id",fl("recharts-scatter-")),n}return Rut(t,e),kut(t,[{key:"renderSymbolsStatically",value:function(r){var i=this,o=this.props,s=o.shape,a=o.activeShape,l=o.activeIndex,h=Yt(this.props,!1);return r.map(function(u,f){var m=l===f,g=m?a:s,b=xi(xi({},h),u);return y.createElement(xe,xh({className:"recharts-scatter-symbol",key:"symbol-".concat(u==null?void 0:u.cx,"-").concat(u==null?void 0:u.cy,"-").concat(u==null?void 0:u.size,"-").concat(f)},Vs(i.props,u,f),{role:"img"}),y.createElement(Mut,xh({option:g,isActive:m,key:"symbol-".concat(f)},b)))})}},{key:"renderSymbolsWithAnimation",value:function(){var r=this,i=this.props,o=i.points,s=i.isAnimationActive,a=i.animationBegin,l=i.animationDuration,h=i.animationEasing,u=i.animationId,f=this.state.prevPoints;return y.createElement(Vi,{begin:a,duration:l,isActive:s,easing:h,from:{t:0},to:{t:1},key:"pie-".concat(u),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(m){var g=m.t,b=o.map(function(p,x){var _=f&&f[x];if(_){var S=tr(_.cx,p.cx),P=tr(_.cy,p.cy),C=tr(_.size,p.size);return xi(xi({},p),{},{cx:S(g),cy:P(g),size:C(g)})}var w=tr(0,p.size);return xi(xi({},p),{},{size:w(g)})});return y.createElement(xe,null,r.renderSymbolsStatically(b))})}},{key:"renderSymbols",value:function(){var r=this.props,i=r.points,o=r.isAnimationActive,s=this.state.prevPoints;return o&&i&&i.length&&(!s||!il(s,i))?this.renderSymbolsWithAnimation():this.renderSymbolsStatically(i)}},{key:"renderErrorBar",value:function(){var r=this.props.isAnimationActive;if(r&&!this.state.isAnimationFinished)return null;var i=this.props,o=i.points,s=i.xAxis,a=i.yAxis,l=i.children,h=Wr(l,kf);return h?h.map(function(u,f){var m=u.props,g=m.direction,b=m.dataKey;return y.cloneElement(u,{key:"".concat(g,"-").concat(b,"-").concat(o[f]),data:o,xAxis:s,yAxis:a,layout:g==="x"?"vertical":"horizontal",dataPointFormatter:function(x,_){return{x:x.cx,y:x.cy,value:g==="x"?+x.node.x:+x.node.y,errorVal:_n(x,_)}}})}):null}},{key:"renderLine",value:function(){var r=this.props,i=r.points,o=r.line,s=r.lineType,a=r.lineJointType,l=Yt(this.props,!1),h=Yt(o,!1),u,f;if(s==="joint")u=i.map(function(P){return{x:P.cx,y:P.cy}});else if(s==="fitting"){var m=_6(i),g=m.xmin,b=m.xmax,p=m.a,x=m.b,_=function(C){return p*C+x};u=[{x:g,y:_(g)},{x:b,y:_(b)}]}var S=xi(xi(xi({},l),{},{fill:"none",stroke:l&&l.fill},h),{},{points:u});return y.isValidElement(o)?f=y.cloneElement(o,S):ne(o)?f=o(S):f=y.createElement(Ka,xh({},S,{type:a})),y.createElement(xe,{className:"recharts-scatter-line",key:"recharts-scatter-line"},f)}},{key:"render",value:function(){var r=this.props,i=r.hide,o=r.points,s=r.line,a=r.className,l=r.xAxis,h=r.yAxis,u=r.left,f=r.top,m=r.width,g=r.height,b=r.id,p=r.isAnimationActive;if(i||!o||!o.length)return null;var x=this.state.isAnimationFinished,_=pe("recharts-scatter",a),S=l&&l.allowDataOverflow,P=h&&h.allowDataOverflow,C=S||P,w=re(b)?this.id:b;return y.createElement(xe,{className:_,clipPath:C?"url(#clipPath-".concat(w,")"):null},S||P?y.createElement("defs",null,y.createElement("clipPath",{id:"clipPath-".concat(w)},y.createElement("rect",{x:S?u:u-m/2,y:P?f:f-g/2,width:S?m:m*2,height:P?g:g*2}))):null,s&&this.renderLine(),this.renderErrorBar(),y.createElement(xe,{key:"recharts-scatter-symbols"},this.renderSymbols()),(!p||x)&&ao.renderCallByParent(this.props,o))}}],[{key:"getDerivedStateFromProps",value:function(r,i){return r.animationId!==i.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,prevPoints:i.curPoints}:r.points!==i.curPoints?{curPoints:r.points}:null}}])}(y.PureComponent);Rs(If,"displayName","Scatter");Rs(If,"defaultProps",{xAxisId:0,yAxisId:0,zAxisId:0,legendType:"circle",lineType:"joint",lineJointType:"linear",data:[],shape:"circle",hide:!1,isAnimationActive:!Zs.isSsr,animationBegin:0,animationDuration:400,animationEasing:"linear"});Rs(If,"getComposedData",function(e){var t=e.xAxis,n=e.yAxis,r=e.zAxis,i=e.item,o=e.displayedData,s=e.xAxisTicks,a=e.yAxisTicks,l=e.offset,h=i.props.tooltipType,u=Wr(i.props.children,Ef),f=re(t.dataKey)?i.props.dataKey:t.dataKey,m=re(n.dataKey)?i.props.dataKey:n.dataKey,g=r&&r.dataKey,b=r?r.range:$f.defaultProps.range,p=b&&b[0],x=t.scale.bandwidth?t.scale.bandwidth():0,_=n.scale.bandwidth?n.scale.bandwidth():0,S=o.map(function(P,C){var w=_n(P,f),E=_n(P,m),k=!re(g)&&_n(P,g)||"-",I=[{name:re(t.dataKey)?i.props.name:t.name||t.dataKey,unit:t.unit||"",value:w,payload:P,dataKey:f,type:h},{name:re(n.dataKey)?i.props.name:n.name||n.dataKey,unit:n.unit||"",value:E,payload:P,dataKey:m,type:h}];k!=="-"&&I.push({name:r.name||r.dataKey,unit:r.unit||"",value:k,payload:P,dataKey:g,type:h});var N=zp({axis:t,ticks:s,bandSize:x,entry:P,index:C,dataKey:f}),z=zp({axis:n,ticks:a,bandSize:_,entry:P,index:C,dataKey:m}),R=k!=="-"?r.scale(k):p,D=Math.sqrt(Math.max(R,0)/Math.PI);return xi(xi({},P),{},{cx:N,cy:z,x:N-D,y:z-D,xAxis:t,yAxis:n,zAxis:r,width:2*D,height:2*D,size:R,node:{x:w,y:E,z:k},tooltipPayload:I,tooltipPosition:{x:N,y:z},payload:P},u&&u[C]&&u[C].props)});return xi({points:S},l)});function Uc(e){"@babel/helpers - typeof";return Uc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Uc(e)}function Dut(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function jut(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,bI(r.key),r)}}function But(e,t,n){return t&&jut(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function zut(e,t,n){return t=gm(t),Fut(e,yI()?Reflect.construct(t,n||[],gm(e).constructor):t.apply(e,n))}function Fut(e,t){if(t&&(Uc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Wut(e)}function Wut(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function yI(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(yI=function(){return!!e})()}function gm(e){return gm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},gm(e)}function Vut(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&y0(e,t)}function y0(e,t){return y0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},y0(e,t)}function vI(e,t,n){return t=bI(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bI(e){var t=Uut(e,"string");return Uc(t)=="symbol"?t:t+""}function Uut(e,t){if(Uc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Uc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function v0(){return v0=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},v0.apply(this,arguments)}function Hut(e){var t=e.xAxisId,n=zw(),r=Fw(),i=K$(t);return i==null?null:Nr.createElement(pu,v0({},i,{className:pe("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(s){return No(s,!0)}}))}var ta=function(e){function t(){return Dut(this,t),zut(this,t,arguments)}return Vut(t,e),But(t,[{key:"render",value:function(){return Nr.createElement(Hut,this.props)}}])}(Nr.Component);vI(ta,"displayName","XAxis");vI(ta,"defaultProps",{allowDecimals:!0,hide:!1,orientation:"bottom",width:0,height:30,mirror:!1,xAxisId:0,tickCount:5,type:"category",padding:{left:0,right:0},allowDataOverflow:!1,scale:"auto",reversed:!1,allowDuplicatedCategory:!0});function Hc(e){"@babel/helpers - typeof";return Hc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hc(e)}function qut(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Gut(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,_I(r.key),r)}}function Yut(e,t,n){return t&&Gut(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Zut(e,t,n){return t=ym(t),Kut(e,xI()?Reflect.construct(t,n||[],ym(e).constructor):t.apply(e,n))}function Kut(e,t){if(t&&(Hc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Xut(e)}function Xut(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function xI(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(xI=function(){return!!e})()}function ym(e){return ym=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ym(e)}function Jut(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&b0(e,t)}function b0(e,t){return b0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},b0(e,t)}function wI(e,t,n){return t=_I(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _I(e){var t=Qut(e,"string");return Hc(t)=="symbol"?t:t+""}function Qut(e,t){if(Hc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Hc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function x0(){return x0=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},x0.apply(this,arguments)}var tht=function(t){var n=t.yAxisId,r=zw(),i=Fw(),o=X$(n);return o==null?null:Nr.createElement(pu,x0({},o,{className:pe("recharts-".concat(o.axisType," ").concat(o.axisType),o.className),viewBox:{x:0,y:0,width:r,height:i},ticksGenerator:function(a){return No(a,!0)}}))},ea=function(e){function t(){return qut(this,t),Zut(this,t,arguments)}return Jut(t,e),Yut(t,[{key:"render",value:function(){return Nr.createElement(tht,this.props)}}])}(Nr.Component);wI(ea,"displayName","YAxis");wI(ea,"defaultProps",{allowDuplicatedCategory:!0,allowDecimals:!0,hide:!1,orientation:"left",width:60,height:0,mirror:!1,yAxisId:0,tickCount:5,type:"number",padding:{top:0,bottom:0},allowDataOverflow:!1,scale:"auto",reversed:!1});function OC(e){return iht(e)||rht(e)||nht(e)||eht()}function eht(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
121
121
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nht(e,t){if(e){if(typeof e=="string")return w0(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return w0(e,t)}}function rht(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function iht(e){if(Array.isArray(e))return w0(e)}function w0(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var _0=function(t,n,r,i,o){var s=Wr(t,Vw),a=Wr(t,Pg),l=[].concat(OC(s),OC(a)),h=Wr(t,Eg),u="".concat(i,"Id"),f=i[0],m=n;if(l.length&&(m=l.reduce(function(p,x){if(x.props[u]===r&&lo(x.props,"extendDomain")&&At(x.props[f])){var _=x.props[f];return[Math.min(p[0],_),Math.max(p[1],_)]}return p},m)),h.length){var g="".concat(f,"1"),b="".concat(f,"2");m=h.reduce(function(p,x){if(x.props[u]===r&&lo(x.props,"extendDomain")&&At(x.props[g])&&At(x.props[b])){var _=x.props[g],S=x.props[b];return[Math.min(p[0],_,S),Math.max(p[1],_,S)]}return p},m)}return o&&o.length&&(m=o.reduce(function(p,x){return At(x)?[Math.min(p[0],x),Math.max(p[1],x)]:p},m)),m},SI={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(l,h,u){this.fn=l,this.context=h,this.once=u||!1}function o(l,h,u,f,m){if(typeof u!="function")throw new TypeError("The listener must be a function");var g=new i(u,f||l,m),b=n?n+h:h;return l._events[b]?l._events[b].fn?l._events[b]=[l._events[b],g]:l._events[b].push(g):(l._events[b]=g,l._eventsCount++),l}function s(l,h){--l._eventsCount===0?l._events=new r:delete l._events[h]}function a(){this._events=new r,this._eventsCount=0}a.prototype.eventNames=function(){var h=[],u,f;if(this._eventsCount===0)return h;for(f in u=this._events)t.call(u,f)&&h.push(n?f.slice(1):f);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(u)):h},a.prototype.listeners=function(h){var u=n?n+h:h,f=this._events[u];if(!f)return[];if(f.fn)return[f.fn];for(var m=0,g=f.length,b=new Array(g);m<g;m++)b[m]=f[m].fn;return b},a.prototype.listenerCount=function(h){var u=n?n+h:h,f=this._events[u];return f?f.fn?1:f.length:0},a.prototype.emit=function(h,u,f,m,g,b){var p=n?n+h:h;if(!this._events[p])return!1;var x=this._events[p],_=arguments.length,S,P;if(x.fn){switch(x.once&&this.removeListener(h,x.fn,void 0,!0),_){case 1:return x.fn.call(x.context),!0;case 2:return x.fn.call(x.context,u),!0;case 3:return x.fn.call(x.context,u,f),!0;case 4:return x.fn.call(x.context,u,f,m),!0;case 5:return x.fn.call(x.context,u,f,m,g),!0;case 6:return x.fn.call(x.context,u,f,m,g,b),!0}for(P=1,S=new Array(_-1);P<_;P++)S[P-1]=arguments[P];x.fn.apply(x.context,S)}else{var C=x.length,w;for(P=0;P<C;P++)switch(x[P].once&&this.removeListener(h,x[P].fn,void 0,!0),_){case 1:x[P].fn.call(x[P].context);break;case 2:x[P].fn.call(x[P].context,u);break;case 3:x[P].fn.call(x[P].context,u,f);break;case 4:x[P].fn.call(x[P].context,u,f,m);break;default:if(!S)for(w=1,S=new Array(_-1);w<_;w++)S[w-1]=arguments[w];x[P].fn.apply(x[P].context,S)}}return!0},a.prototype.on=function(h,u,f){return o(this,h,u,f,!1)},a.prototype.once=function(h,u,f){return o(this,h,u,f,!0)},a.prototype.removeListener=function(h,u,f,m){var g=n?n+h:h;if(!this._events[g])return this;if(!u)return s(this,g),this;var b=this._events[g];if(b.fn)b.fn===u&&(!m||b.once)&&(!f||b.context===f)&&s(this,g);else{for(var p=0,x=[],_=b.length;p<_;p++)(b[p].fn!==u||m&&!b[p].once||f&&b[p].context!==f)&&x.push(b[p]);x.length?this._events[g]=x.length===1?x[0]:x:s(this,g)}return this},a.prototype.removeAllListeners=function(h){var u;return h?(u=n?n+h:h,this._events[u]&&s(this,u)):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,e.exports=a})(SI);var oht=SI.exports;const sht=qe(oht);var cv=new sht,uv="recharts.syncMouseEvents";function df(e){"@babel/helpers - typeof";return df=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},df(e)}function aht(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function lht(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,PI(r.key),r)}}function cht(e,t,n){return t&&lht(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function hv(e,t,n){return t=PI(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function PI(e){var t=uht(e,"string");return df(t)=="symbol"?t:t+""}function uht(e,t){if(df(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(df(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var hht=function(){function e(){aht(this,e),hv(this,"activeIndex",0),hv(this,"coordinateList",[]),hv(this,"layout","horizontal")}return cht(e,[{key:"setDetails",value:function(n){var r,i=n.coordinateList,o=i===void 0?null:i,s=n.container,a=s===void 0?null:s,l=n.layout,h=l===void 0?null:l,u=n.offset,f=u===void 0?null:u,m=n.mouseHandlerCallback,g=m===void 0?null:m;this.coordinateList=(r=o??this.coordinateList)!==null&&r!==void 0?r:[],this.container=a??this.container,this.layout=h??this.layout,this.offset=f??this.offset,this.mouseHandlerCallback=g??this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(n){if(this.coordinateList.length!==0)switch(n.key){case"ArrowRight":{if(this.layout!=="horizontal")return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break}case"ArrowLeft":{if(this.layout!=="horizontal")return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse();break}}}},{key:"setIndex",value:function(n){this.activeIndex=n}},{key:"spoofMouse",value:function(){var n,r;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var i=this.container.getBoundingClientRect(),o=i.x,s=i.y,a=i.height,l=this.coordinateList[this.activeIndex].coordinate,h=((n=window)===null||n===void 0?void 0:n.scrollX)||0,u=((r=window)===null||r===void 0?void 0:r.scrollY)||0,f=o+l+h,m=s+this.offset.top+a/2+u;this.mouseHandlerCallback({pageX:f,pageY:m})}}}])}();function fht(e,t,n){if(n==="number"&&t===!0&&Array.isArray(e)){var r=e==null?void 0:e[0],i=e==null?void 0:e[1];if(r&&i&&At(r)&&At(i))return!0}return!1}function dht(e,t,n,r){var i=r/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-i:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-i,width:e==="horizontal"?r:n.width-1,height:e==="horizontal"?n.height-1:r}}function AI(e){var t=e.cx,n=e.cy,r=e.radius,i=e.startAngle,o=e.endAngle,s=on(t,n,r,i),a=on(t,n,r,o);return{points:[s,a],cx:t,cy:n,radius:r,startAngle:i,endAngle:o}}function pht(e,t,n){var r,i,o,s;if(e==="horizontal")r=t.x,o=r,i=n.top,s=n.top+n.height;else if(e==="vertical")i=t.y,s=i,r=n.left,o=n.left+n.width;else if(t.cx!=null&&t.cy!=null)if(e==="centric"){var a=t.cx,l=t.cy,h=t.innerRadius,u=t.outerRadius,f=t.angle,m=on(a,l,h,f),g=on(a,l,u,f);r=m.x,i=m.y,o=g.x,s=g.y}else return AI(t);return[{x:r,y:i},{x:o,y:s}]}function pf(e){"@babel/helpers - typeof";return pf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pf(e)}function kC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Bd(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kC(Object(n),!0).forEach(function(r){mht(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mht(e,t,n){return t=ght(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ght(e){var t=yht(e,"string");return pf(t)=="symbol"?t:t+""}function yht(e,t){if(pf(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(pf(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function vht(e){var t,n,r=e.element,i=e.tooltipEventType,o=e.isActive,s=e.activeCoordinate,a=e.activePayload,l=e.offset,h=e.activeTooltipIndex,u=e.tooltipAxisBandSize,f=e.layout,m=e.chartName,g=(t=r.props.cursor)!==null&&t!==void 0?t:(n=r.type.defaultProps)===null||n===void 0?void 0:n.cursor;if(!r||!g||!o||!s||m!=="ScatterChart"&&i!=="axis")return null;var b,p=Ka;if(m==="ScatterChart")b=s,p=wot;else if(m==="BarChart")b=dht(f,s,l,u),p=Rw;else if(f==="radial"){var x=AI(s),_=x.cx,S=x.cy,P=x.radius,C=x.startAngle,w=x.endAngle;b={cx:_,cy:S,startAngle:C,endAngle:w,innerRadius:P,outerRadius:P},p=g$}else b={points:pht(f,s,l)},p=Ka;var E=Bd(Bd(Bd(Bd({stroke:"#ccc",pointerEvents:"none"},l),b),Yt(g,!1)),{},{payload:a,payloadIndex:h,className:pe("recharts-tooltip-cursor",g.className)});return y.isValidElement(g)?y.cloneElement(g,E):y.createElement(p,E)}var bht=["item"],xht=["children","className","width","height","style","compact","title","desc"];function qc(e){"@babel/helpers - typeof";return qc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qc(e)}function tc(){return tc=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},tc.apply(this,arguments)}function $C(e,t){return Sht(e)||_ht(e,t)||CI(e,t)||wht()}function wht(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
122
122
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _ht(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,s,a=[],l=!0,h=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){h=!0,i=u}finally{try{if(!l&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(h)throw i}}return a}}function Sht(e){if(Array.isArray(e))return e}function IC(e,t){if(e==null)return{};var n=Pht(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Pht(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Aht(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Eht(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,TI(r.key),r)}}function Cht(e,t,n){return t&&Eht(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Tht(e,t,n){return t=vm(t),Mht(e,EI()?Reflect.construct(t,n||[],vm(e).constructor):t.apply(e,n))}function Mht(e,t){if(t&&(qc(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Oht(e)}function Oht(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function EI(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(EI=function(){return!!e})()}function vm(e){return vm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},vm(e)}function kht(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&S0(e,t)}function S0(e,t){return S0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},S0(e,t)}function Gc(e){return Nht(e)||Iht(e)||CI(e)||$ht()}function $ht(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
123
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function CI(e,t){if(e){if(typeof e=="string")return P0(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return P0(e,t)}}function Iht(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Nht(e){if(Array.isArray(e))return P0(e)}function P0(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function NC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function mt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?NC(Object(n),!0).forEach(function(r){te(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function te(e,t,n){return t=TI(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function TI(e){var t=Rht(e,"string");return qc(t)=="symbol"?t:t+""}function Rht(e,t){if(qc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(qc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Lht={xAxis:["bottom","top"],yAxis:["left","right"]},Dht={width:"100%",height:"100%"},MI={x:0,y:0};function zd(e){return e}var jht=function(t,n){return n==="horizontal"?t.x:n==="vertical"?t.y:n==="centric"?t.angle:t.radius},Bht=function(t,n,r,i){var o=n.find(function(u){return u&&u.index===r});if(o){if(t==="horizontal")return{x:o.coordinate,y:i.y};if(t==="vertical")return{x:i.x,y:o.coordinate};if(t==="centric"){var s=o.coordinate,a=i.radius;return mt(mt(mt({},i),on(i.cx,i.cy,a,s)),{},{angle:s,radius:a})}var l=o.coordinate,h=i.angle;return mt(mt(mt({},i),on(i.cx,i.cy,l,h)),{},{angle:h,radius:l})}return MI},Tg=function(t,n){var r=n.graphicalItems,i=n.dataStartIndex,o=n.dataEndIndex,s=(r??[]).reduce(function(a,l){var h=l.props.data;return h&&h.length?[].concat(Gc(a),Gc(h)):a},[]);return s.length>0?s:t&&t.length&&At(i)&&At(o)?t.slice(i,o+1):[]};function OI(e){return e==="number"?[0,"auto"]:void 0}var A0=function(t,n,r,i){var o=t.graphicalItems,s=t.tooltipAxis,a=Tg(n,t);return r<0||!o||!o.length||r>=a.length?null:o.reduce(function(l,h){var u,f=(u=h.props.data)!==null&&u!==void 0?u:n;f&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=r&&(f=f.slice(t.dataStartIndex,t.dataEndIndex+1));var m;if(s.dataKey&&!s.allowDuplicatedCategory){var g=f===void 0?a:f;m=hp(g,s.dataKey,i)}else m=f&&f[r]||a[r];return m?[].concat(Gc(l),[u$(h,m)]):l},[])},RC=function(t,n,r,i){var o=i||{x:t.chartX,y:t.chartY},s=jht(o,r),a=t.orderedTooltipTicks,l=t.tooltipAxis,h=t.tooltipTicks,u=Let(s,a,h,l);if(u>=0&&h){var f=h[u]&&h[u].value,m=A0(t,n,u,f),g=Bht(r,a,u,o);return{activeTooltipIndex:u,activeLabel:f,activePayload:m,activeCoordinate:g}}return null},zht=function(t,n){var r=n.axes,i=n.graphicalItems,o=n.axisType,s=n.axisIdKey,a=n.stackGroups,l=n.dataStartIndex,h=n.dataEndIndex,u=t.layout,f=t.children,m=t.stackOffset,g=i$(u,o);return r.reduce(function(b,p){var x,_=p.type.defaultProps!==void 0?mt(mt({},p.type.defaultProps),p.props):p.props,S=_.type,P=_.dataKey,C=_.allowDataOverflow,w=_.allowDuplicatedCategory,E=_.scale,k=_.ticks,I=_.includeHidden,N=_[s];if(b[N])return b;var z=Tg(t.data,{graphicalItems:i.filter(function(lt){var ht,yt=s in lt.props?lt.props[s]:(ht=lt.type.defaultProps)===null||ht===void 0?void 0:ht[s];return yt===N}),dataStartIndex:l,dataEndIndex:h}),R=z.length,D,V,F;fht(_.domain,C,S)&&(D=Db(_.domain,null,C),g&&(S==="number"||E!=="auto")&&(F=mh(z,P,"category")));var W=OI(S);if(!D||D.length===0){var Z,q=(Z=_.domain)!==null&&Z!==void 0?Z:W;if(P){if(D=mh(z,P,S),S==="category"&&g){var tt=w6(D);w&&tt?(V=D,D=nm(0,R)):w||(D=KA(q,D,p).reduce(function(lt,ht){return lt.indexOf(ht)>=0?lt:[].concat(Gc(lt),[ht])},[]))}else if(S==="category")w?D=D.filter(function(lt){return lt!==""&&!re(lt)}):D=KA(q,D,p).reduce(function(lt,ht){return lt.indexOf(ht)>=0||ht===""||re(ht)?lt:[].concat(Gc(lt),[ht])},[]);else if(S==="number"){var at=Fet(z,i.filter(function(lt){var ht,yt,vt=s in lt.props?lt.props[s]:(ht=lt.type.defaultProps)===null||ht===void 0?void 0:ht[s],wt="hide"in lt.props?lt.props.hide:(yt=lt.type.defaultProps)===null||yt===void 0?void 0:yt.hide;return vt===N&&(I||!wt)}),P,o,u);at&&(D=at)}g&&(S==="number"||E!=="auto")&&(F=mh(z,P,"category"))}else g?D=nm(0,R):a&&a[N]&&a[N].hasStack&&S==="number"?D=m==="expand"?[0,1]:c$(a[N].stackGroups,l,h):D=r$(z,i.filter(function(lt){var ht=s in lt.props?lt.props[s]:lt.type.defaultProps[s],yt="hide"in lt.props?lt.props.hide:lt.type.defaultProps.hide;return ht===N&&(I||!yt)}),S,u,!0);if(S==="number")D=_0(f,D,N,o,k),q&&(D=Db(q,D,C));else if(S==="category"&&q){var H=q,K=D.every(function(lt){return H.indexOf(lt)>=0});K&&(D=H)}}return mt(mt({},b),{},te({},N,mt(mt({},_),{},{axisType:o,domain:D,categoricalDomain:F,duplicateDomain:V,originalDomain:(x=_.domain)!==null&&x!==void 0?x:W,isCategorical:g,layout:u})))},{})},Fht=function(t,n){var r=n.graphicalItems,i=n.Axis,o=n.axisType,s=n.axisIdKey,a=n.stackGroups,l=n.dataStartIndex,h=n.dataEndIndex,u=t.layout,f=t.children,m=Tg(t.data,{graphicalItems:r,dataStartIndex:l,dataEndIndex:h}),g=m.length,b=i$(u,o),p=-1;return r.reduce(function(x,_){var S=_.type.defaultProps!==void 0?mt(mt({},_.type.defaultProps),_.props):_.props,P=S[s],C=OI("number");if(!x[P]){p++;var w;return b?w=nm(0,g):a&&a[P]&&a[P].hasStack?(w=c$(a[P].stackGroups,l,h),w=_0(f,w,P,o)):(w=Db(C,r$(m,r.filter(function(E){var k,I,N=s in E.props?E.props[s]:(k=E.type.defaultProps)===null||k===void 0?void 0:k[s],z="hide"in E.props?E.props.hide:(I=E.type.defaultProps)===null||I===void 0?void 0:I.hide;return N===P&&!z}),"number",u),i.defaultProps.allowDataOverflow),w=_0(f,w,P,o)),mt(mt({},x),{},te({},P,mt(mt({axisType:o},i.defaultProps),{},{hide:!0,orientation:ii(Lht,"".concat(o,".").concat(p%2),null),domain:w,originalDomain:C,isCategorical:b,layout:u})))}return x},{})},Wht=function(t,n){var r=n.axisType,i=r===void 0?"xAxis":r,o=n.AxisComp,s=n.graphicalItems,a=n.stackGroups,l=n.dataStartIndex,h=n.dataEndIndex,u=t.children,f="".concat(i,"Id"),m=Wr(u,o),g={};return m&&m.length?g=zht(t,{axes:m,graphicalItems:s,axisType:i,axisIdKey:f,stackGroups:a,dataStartIndex:l,dataEndIndex:h}):s&&s.length&&(g=Fht(t,{Axis:o,graphicalItems:s,axisType:i,axisIdKey:f,stackGroups:a,dataStartIndex:l,dataEndIndex:h})),g},Vht=function(t){var n=Ms(t),r=No(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:aw(r,function(i){return i.coordinate}),tooltipAxis:n,tooltipAxisBandSize:Fp(n,r)}},LC=function(t){var n=t.children,r=t.defaultShowTooltip,i=ti(n,Nc),o=0,s=0;return t.data&&t.data.length!==0&&(s=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(o=i.props.startIndex),i.props.endIndex>=0&&(s=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:o,dataEndIndex:s,activeTooltipIndex:-1,isTooltipActive:!!r}},Uht=function(t){return!t||!t.length?!1:t.some(function(n){var r=Lo(n&&n.type);return r&&r.indexOf("Bar")>=0})},DC=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},Hht=function(t,n){var r=t.props,i=t.graphicalItems,o=t.xAxisMap,s=o===void 0?{}:o,a=t.yAxisMap,l=a===void 0?{}:a,h=r.width,u=r.height,f=r.children,m=r.margin||{},g=ti(f,Nc),b=ti(f,Ga),p=Object.keys(l).reduce(function(w,E){var k=l[E],I=k.orientation;return!k.mirror&&!k.hide?mt(mt({},w),{},te({},I,w[I]+k.width)):w},{left:m.left||0,right:m.right||0}),x=Object.keys(s).reduce(function(w,E){var k=s[E],I=k.orientation;return!k.mirror&&!k.hide?mt(mt({},w),{},te({},I,ii(w,"".concat(I))+k.height)):w},{top:m.top||0,bottom:m.bottom||0}),_=mt(mt({},x),p),S=_.bottom;g&&(_.bottom+=g.props.height||Nc.defaultProps.height),b&&n&&(_=Bet(_,i,r,n));var P=h-_.left-_.right,C=u-_.top-_.bottom;return mt(mt({brushBottom:S},_),{},{width:Math.max(P,0),height:Math.max(C,0)})},qht=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},Mg=function(t){var n=t.chartName,r=t.GraphicalChild,i=t.defaultTooltipEventType,o=i===void 0?"axis":i,s=t.validateTooltipEventTypes,a=s===void 0?["axis"]:s,l=t.axisComponents,h=t.legendContent,u=t.formatAxisMap,f=t.defaultProps,m=function(_,S){var P=S.graphicalItems,C=S.stackGroups,w=S.offset,E=S.updateId,k=S.dataStartIndex,I=S.dataEndIndex,N=_.barSize,z=_.layout,R=_.barGap,D=_.barCategoryGap,V=_.maxBarSize,F=DC(z),W=F.numericAxisName,Z=F.cateAxisName,q=Uht(P),tt=[];return P.forEach(function(at,H){var K=Tg(_.data,{graphicalItems:[at],dataStartIndex:k,dataEndIndex:I}),lt=at.type.defaultProps!==void 0?mt(mt({},at.type.defaultProps),at.props):at.props,ht=lt.dataKey,yt=lt.maxBarSize,vt=lt["".concat(W,"Id")],wt=lt["".concat(Z,"Id")],Nt={},Rt=l.reduce(function(ke,Sn){var Mn,vn,qr=S["".concat(Sn.axisType,"Map")],rr=lt["".concat(Sn.axisType,"Id")];qr&&qr[rr]||Sn.axisType==="zAxis"||(process.env.NODE_ENV!=="production"?zr(!1,"Specifying a(n) ".concat(Sn.axisType,"Id requires a corresponding ").concat(Sn.axisType,"Id on the targeted graphical component ").concat((Mn=at==null||(vn=at.type)===null||vn===void 0?void 0:vn.displayName)!==null&&Mn!==void 0?Mn:"")):zr());var Ge=qr[rr];return mt(mt({},ke),{},te(te({},Sn.axisType,Ge),"".concat(Sn.axisType,"Ticks"),No(Ge)))},Nt),pt=Rt[Z],xt=Rt["".concat(Z,"Ticks")],bt=C&&C[vt]&&C[vt].hasStack&&Ket(at,C[vt].stackGroups),Q=Lo(at.type).indexOf("Bar")>=0,kt=Fp(pt,xt),ft=[],Xt=q&&Det({barSize:N,stackGroups:C,totalSize:qht(Rt,Z)});if(Q){var we,_e,dn=re(yt)?V:yt,fe=(we=(_e=Fp(pt,xt,!0))!==null&&_e!==void 0?_e:dn)!==null&&we!==void 0?we:0;ft=jet({barGap:R,barCategoryGap:D,bandSize:fe!==kt?fe:kt,sizeList:Xt[wt],maxBarSize:dn}),fe!==kt&&(ft=ft.map(function(ke){return mt(mt({},ke),{},{position:mt(mt({},ke.position),{},{offset:ke.position.offset-fe/2})})}))}var pn=at&&at.type&&at.type.getComposedData;pn&&tt.push({props:mt(mt({},pn(mt(mt({},Rt),{},{displayedData:K,props:_,dataKey:ht,item:at,bandSize:kt,barPosition:ft,offset:w,stackedData:bt,layout:z,dataStartIndex:k,dataEndIndex:I}))),{},te(te(te({key:at.key||"item-".concat(H)},W,Rt[W]),Z,Rt[Z]),"animationId",E)),childIndex:R6(at,_.children),item:at})}),tt},g=function(_,S){var P=_.props,C=_.dataStartIndex,w=_.dataEndIndex,E=_.updateId;if(!US({props:P}))return null;var k=P.children,I=P.layout,N=P.stackOffset,z=P.data,R=P.reverseStackOrder,D=DC(I),V=D.numericAxisName,F=D.cateAxisName,W=Wr(k,r),Z=Yet(z,W,"".concat(V,"Id"),"".concat(F,"Id"),N,R),q=l.reduce(function(lt,ht){var yt="".concat(ht.axisType,"Map");return mt(mt({},lt),{},te({},yt,Wht(P,mt(mt({},ht),{},{graphicalItems:W,stackGroups:ht.axisType===V&&Z,dataStartIndex:C,dataEndIndex:w}))))},{}),tt=Hht(mt(mt({},q),{},{props:P,graphicalItems:W}),S==null?void 0:S.legendBBox);Object.keys(q).forEach(function(lt){q[lt]=u(P,q[lt],tt,lt.replace("Map",""),n)});var at=q["".concat(F,"Map")],H=Vht(at),K=m(P,mt(mt({},q),{},{dataStartIndex:C,dataEndIndex:w,updateId:E,graphicalItems:W,stackGroups:Z,offset:tt}));return mt(mt({formattedGraphicalItems:K,graphicalItems:W,offset:tt,stackGroups:Z},H),q)},b=function(x){function _(S){var P,C,w;return Aht(this,_),w=Tht(this,_,[S]),te(w,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),te(w,"accessibilityManager",new hht),te(w,"handleLegendBBoxUpdate",function(E){if(E){var k=w.state,I=k.dataStartIndex,N=k.dataEndIndex,z=k.updateId;w.setState(mt({legendBBox:E},g({props:w.props,dataStartIndex:I,dataEndIndex:N,updateId:z},mt(mt({},w.state),{},{legendBBox:E}))))}}),te(w,"handleReceiveSyncEvent",function(E,k,I){if(w.props.syncId===E){if(I===w.eventEmitterSymbol&&typeof w.props.syncMethod!="function")return;w.applySyncEvent(k)}}),te(w,"handleBrushChange",function(E){var k=E.startIndex,I=E.endIndex;if(k!==w.state.dataStartIndex||I!==w.state.dataEndIndex){var N=w.state.updateId;w.setState(function(){return mt({dataStartIndex:k,dataEndIndex:I},g({props:w.props,dataStartIndex:k,dataEndIndex:I,updateId:N},w.state))}),w.triggerSyncEvent({dataStartIndex:k,dataEndIndex:I})}}),te(w,"handleMouseEnter",function(E){var k=w.getMouseInfo(E);if(k){var I=mt(mt({},k),{},{isTooltipActive:!0});w.setState(I),w.triggerSyncEvent(I);var N=w.props.onMouseEnter;ne(N)&&N(I,E)}}),te(w,"triggeredAfterMouseMove",function(E){var k=w.getMouseInfo(E),I=k?mt(mt({},k),{},{isTooltipActive:!0}):{isTooltipActive:!1};w.setState(I),w.triggerSyncEvent(I);var N=w.props.onMouseMove;ne(N)&&N(I,E)}),te(w,"handleItemMouseEnter",function(E){w.setState(function(){return{isTooltipActive:!0,activeItem:E,activePayload:E.tooltipPayload,activeCoordinate:E.tooltipPosition||{x:E.cx,y:E.cy}}})}),te(w,"handleItemMouseLeave",function(){w.setState(function(){return{isTooltipActive:!1}})}),te(w,"handleMouseMove",function(E){E.persist(),w.throttleTriggeredAfterMouseMove(E)}),te(w,"handleMouseLeave",function(E){w.throttleTriggeredAfterMouseMove.cancel();var k={isTooltipActive:!1};w.setState(k),w.triggerSyncEvent(k);var I=w.props.onMouseLeave;ne(I)&&I(k,E)}),te(w,"handleOuterEvent",function(E){var k=N6(E),I=ii(w.props,"".concat(k));if(k&&ne(I)){var N,z;/.*touch.*/i.test(k)?z=w.getMouseInfo(E.changedTouches[0]):z=w.getMouseInfo(E),I((N=z)!==null&&N!==void 0?N:{},E)}}),te(w,"handleClick",function(E){var k=w.getMouseInfo(E);if(k){var I=mt(mt({},k),{},{isTooltipActive:!0});w.setState(I),w.triggerSyncEvent(I);var N=w.props.onClick;ne(N)&&N(I,E)}}),te(w,"handleMouseDown",function(E){var k=w.props.onMouseDown;if(ne(k)){var I=w.getMouseInfo(E);k(I,E)}}),te(w,"handleMouseUp",function(E){var k=w.props.onMouseUp;if(ne(k)){var I=w.getMouseInfo(E);k(I,E)}}),te(w,"handleTouchMove",function(E){E.changedTouches!=null&&E.changedTouches.length>0&&w.throttleTriggeredAfterMouseMove(E.changedTouches[0])}),te(w,"handleTouchStart",function(E){E.changedTouches!=null&&E.changedTouches.length>0&&w.handleMouseDown(E.changedTouches[0])}),te(w,"handleTouchEnd",function(E){E.changedTouches!=null&&E.changedTouches.length>0&&w.handleMouseUp(E.changedTouches[0])}),te(w,"handleDoubleClick",function(E){var k=w.props.onDoubleClick;if(ne(k)){var I=w.getMouseInfo(E);k(I,E)}}),te(w,"handleContextMenu",function(E){var k=w.props.onContextMenu;if(ne(k)){var I=w.getMouseInfo(E);k(I,E)}}),te(w,"triggerSyncEvent",function(E){w.props.syncId!==void 0&&cv.emit(uv,w.props.syncId,E,w.eventEmitterSymbol)}),te(w,"applySyncEvent",function(E){var k=w.props,I=k.layout,N=k.syncMethod,z=w.state.updateId,R=E.dataStartIndex,D=E.dataEndIndex;if(E.dataStartIndex!==void 0||E.dataEndIndex!==void 0)w.setState(mt({dataStartIndex:R,dataEndIndex:D},g({props:w.props,dataStartIndex:R,dataEndIndex:D,updateId:z},w.state)));else if(E.activeTooltipIndex!==void 0){var V=E.chartX,F=E.chartY,W=E.activeTooltipIndex,Z=w.state,q=Z.offset,tt=Z.tooltipTicks;if(!q)return;if(typeof N=="function")W=N(tt,E);else if(N==="value"){W=-1;for(var at=0;at<tt.length;at++)if(tt[at].value===E.activeLabel){W=at;break}}var H=mt(mt({},q),{},{x:q.left,y:q.top}),K=Math.min(V,H.x+H.width),lt=Math.min(F,H.y+H.height),ht=tt[W]&&tt[W].value,yt=A0(w.state,w.props.data,W),vt=tt[W]?{x:I==="horizontal"?tt[W].coordinate:K,y:I==="horizontal"?lt:tt[W].coordinate}:MI;w.setState(mt(mt({},E),{},{activeLabel:ht,activeCoordinate:vt,activePayload:yt,activeTooltipIndex:W}))}else w.setState(E)}),te(w,"renderCursor",function(E){var k,I=w.state,N=I.isTooltipActive,z=I.activeCoordinate,R=I.activePayload,D=I.offset,V=I.activeTooltipIndex,F=I.tooltipAxisBandSize,W=w.getTooltipEventType(),Z=(k=E.props.active)!==null&&k!==void 0?k:N,q=w.props.layout,tt=E.key||"_recharts-cursor";return y.createElement(vht,{key:tt,activeCoordinate:z,activePayload:R,activeTooltipIndex:V,chartName:n,element:E,isActive:Z,layout:q,offset:D,tooltipAxisBandSize:F,tooltipEventType:W})}),te(w,"renderPolarAxis",function(E,k,I){var N=ii(E,"type.axisType"),z=ii(w.state,"".concat(N,"Map")),R=E.type.defaultProps,D=R!==void 0?mt(mt({},R),E.props):E.props,V=z&&z[D["".concat(N,"Id")]];return y.cloneElement(E,mt(mt({},V),{},{className:pe(N,V.className),key:E.key||"".concat(k,"-").concat(I),ticks:No(V,!0)}))}),te(w,"renderPolarGrid",function(E){var k=E.props,I=k.radialLines,N=k.polarAngles,z=k.polarRadius,R=w.state,D=R.radiusAxisMap,V=R.angleAxisMap,F=Ms(D),W=Ms(V),Z=W.cx,q=W.cy,tt=W.innerRadius,at=W.outerRadius;return y.cloneElement(E,{polarAngles:Array.isArray(N)?N:No(W,!0).map(function(H){return H.coordinate}),polarRadius:Array.isArray(z)?z:No(F,!0).map(function(H){return H.coordinate}),cx:Z,cy:q,innerRadius:tt,outerRadius:at,key:E.key||"polar-grid",radialLines:I})}),te(w,"renderLegend",function(){var E=w.state.formattedGraphicalItems,k=w.props,I=k.children,N=k.width,z=k.height,R=w.props.margin||{},D=N-(R.left||0)-(R.right||0),V=e$({children:I,formattedGraphicalItems:E,legendWidth:D,legendContent:h});if(!V)return null;var F=V.item,W=IC(V,bht);return y.cloneElement(F,mt(mt({},W),{},{chartWidth:N,chartHeight:z,margin:R,onBBoxUpdate:w.handleLegendBBoxUpdate}))}),te(w,"renderTooltip",function(){var E,k=w.props,I=k.children,N=k.accessibilityLayer,z=ti(I,ei);if(!z)return null;var R=w.state,D=R.isTooltipActive,V=R.activeCoordinate,F=R.activePayload,W=R.activeLabel,Z=R.offset,q=(E=z.props.active)!==null&&E!==void 0?E:D;return y.cloneElement(z,{viewBox:mt(mt({},Z),{},{x:Z.left,y:Z.top}),active:q,label:W,payload:q?F:[],coordinate:V,accessibilityLayer:N})}),te(w,"renderBrush",function(E){var k=w.props,I=k.margin,N=k.data,z=w.state,R=z.offset,D=z.dataStartIndex,V=z.dataEndIndex,F=z.updateId;return y.cloneElement(E,{key:E.key||"_recharts-brush",onChange:Nd(w.handleBrushChange,E.props.onChange),data:N,x:At(E.props.x)?E.props.x:R.left,y:At(E.props.y)?E.props.y:R.top+R.height+R.brushBottom-(I.bottom||0),width:At(E.props.width)?E.props.width:R.width,startIndex:D,endIndex:V,updateId:"brush-".concat(F)})}),te(w,"renderReferenceElement",function(E,k,I){if(!E)return null;var N=w,z=N.clipPathId,R=w.state,D=R.xAxisMap,V=R.yAxisMap,F=R.offset,W=E.type.defaultProps||{},Z=E.props,q=Z.xAxisId,tt=q===void 0?W.xAxisId:q,at=Z.yAxisId,H=at===void 0?W.yAxisId:at;return y.cloneElement(E,{key:E.key||"".concat(k,"-").concat(I),xAxis:D[tt],yAxis:V[H],viewBox:{x:F.left,y:F.top,width:F.width,height:F.height},clipPathId:z})}),te(w,"renderActivePoints",function(E){var k=E.item,I=E.activePoint,N=E.basePoint,z=E.childIndex,R=E.isRange,D=[],V=k.props.key,F=k.item.type.defaultProps!==void 0?mt(mt({},k.item.type.defaultProps),k.item.props):k.item.props,W=F.activeDot,Z=F.dataKey,q=mt(mt({index:z,dataKey:Z,cx:I.x,cy:I.y,r:4,fill:Iw(k.item),strokeWidth:2,stroke:"#fff",payload:I.payload,value:I.value},Yt(W,!1)),fp(W));return D.push(_.renderActiveDot(W,q,"".concat(V,"-activePoint-").concat(z))),N?D.push(_.renderActiveDot(W,mt(mt({},q),{},{cx:N.x,cy:N.y}),"".concat(V,"-basePoint-").concat(z))):R&&D.push(null),D}),te(w,"renderGraphicChild",function(E,k,I){var N=w.filterFormatItem(E,k,I);if(!N)return null;var z=w.getTooltipEventType(),R=w.state,D=R.isTooltipActive,V=R.tooltipAxis,F=R.activeTooltipIndex,W=R.activeLabel,Z=w.props.children,q=ti(Z,ei),tt=N.props,at=tt.points,H=tt.isRange,K=tt.baseLine,lt=N.item.type.defaultProps!==void 0?mt(mt({},N.item.type.defaultProps),N.item.props):N.item.props,ht=lt.activeDot,yt=lt.hide,vt=lt.activeBar,wt=lt.activeShape,Nt=!!(!yt&&D&&q&&(ht||vt||wt)),Rt={};z!=="axis"&&q&&q.props.trigger==="click"?Rt={onClick:Nd(w.handleItemMouseEnter,E.props.onClick)}:z!=="axis"&&(Rt={onMouseLeave:Nd(w.handleItemMouseLeave,E.props.onMouseLeave),onMouseEnter:Nd(w.handleItemMouseEnter,E.props.onMouseEnter)});var pt=y.cloneElement(E,mt(mt({},N.props),Rt));function xt(Sn){return typeof V.dataKey=="function"?V.dataKey(Sn.payload):null}if(Nt)if(F>=0){var bt,Q;if(V.dataKey&&!V.allowDuplicatedCategory){var kt=typeof V.dataKey=="function"?xt:"payload.".concat(V.dataKey.toString());bt=hp(at,kt,W),Q=H&&K&&hp(K,kt,W)}else bt=at==null?void 0:at[F],Q=H&&K&&K[F];if(wt||vt){var ft=E.props.activeIndex!==void 0?E.props.activeIndex:F;return[y.cloneElement(E,mt(mt(mt({},N.props),Rt),{},{activeIndex:ft})),null,null]}if(!re(bt))return[pt].concat(Gc(w.renderActivePoints({item:N,activePoint:bt,basePoint:Q,childIndex:F,isRange:H})))}else{var Xt,we=(Xt=w.getItemByXY(w.state.activeCoordinate))!==null&&Xt!==void 0?Xt:{graphicalItem:pt},_e=we.graphicalItem,dn=_e.item,fe=dn===void 0?E:dn,pn=_e.childIndex,ke=mt(mt(mt({},N.props),Rt),{},{activeIndex:pn});return[y.cloneElement(fe,ke),null,null]}return H?[pt,null,null]:[pt,null]}),te(w,"renderCustomized",function(E,k,I){return y.cloneElement(E,mt(mt({key:"recharts-customized-".concat(I)},w.props),w.state))}),te(w,"renderMap",{CartesianGrid:{handler:zd,once:!0},ReferenceArea:{handler:w.renderReferenceElement},ReferenceLine:{handler:zd},ReferenceDot:{handler:w.renderReferenceElement},XAxis:{handler:zd},YAxis:{handler:zd},Brush:{handler:w.renderBrush,once:!0},Bar:{handler:w.renderGraphicChild},Line:{handler:w.renderGraphicChild},Area:{handler:w.renderGraphicChild},Radar:{handler:w.renderGraphicChild},RadialBar:{handler:w.renderGraphicChild},Scatter:{handler:w.renderGraphicChild},Pie:{handler:w.renderGraphicChild},Funnel:{handler:w.renderGraphicChild},Tooltip:{handler:w.renderCursor,once:!0},PolarGrid:{handler:w.renderPolarGrid,once:!0},PolarAngleAxis:{handler:w.renderPolarAxis},PolarRadiusAxis:{handler:w.renderPolarAxis},Customized:{handler:w.renderCustomized}}),w.clipPathId="".concat((P=S.id)!==null&&P!==void 0?P:fl("recharts"),"-clip"),w.throttleTriggeredAfterMouseMove=e2(w.triggeredAfterMouseMove,(C=S.throttleDelay)!==null&&C!==void 0?C:1e3/60),w.state={},w}return kht(_,x),Cht(_,[{key:"componentDidMount",value:function(){var P,C;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(P=this.props.margin.left)!==null&&P!==void 0?P:0,top:(C=this.props.margin.top)!==null&&C!==void 0?C:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var P=this.props,C=P.children,w=P.data,E=P.height,k=P.layout,I=ti(C,ei);if(I){var N=I.props.defaultIndex;if(!(typeof N!="number"||N<0||N>this.state.tooltipTicks.length-1)){var z=this.state.tooltipTicks[N]&&this.state.tooltipTicks[N].value,R=A0(this.state,w,N,z),D=this.state.tooltipTicks[N].coordinate,V=(this.state.offset.top+E)/2,F=k==="horizontal",W=F?{x:D,y:V}:{y:D,x:V},Z=this.state.formattedGraphicalItems.find(function(tt){var at=tt.item;return at.type.name==="Scatter"});Z&&(W=mt(mt({},W),Z.props.points[N].tooltipPosition),R=Z.props.points[N].tooltipPayload);var q={activeTooltipIndex:N,isTooltipActive:!0,activeLabel:z,activePayload:R,activeCoordinate:W};this.setState(q),this.renderCursor(I),this.accessibilityManager.setIndex(N)}}}},{key:"getSnapshotBeforeUpdate",value:function(P,C){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==C.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==P.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==P.margin){var w,E;this.accessibilityManager.setDetails({offset:{left:(w=this.props.margin.left)!==null&&w!==void 0?w:0,top:(E=this.props.margin.top)!==null&&E!==void 0?E:0}})}return null}},{key:"componentDidUpdate",value:function(P){Jv([ti(P.children,ei)],[ti(this.props.children,ei)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var P=ti(this.props.children,ei);if(P&&typeof P.props.shared=="boolean"){var C=P.props.shared?"axis":"item";return a.indexOf(C)>=0?C:o}return o}},{key:"getMouseInfo",value:function(P){if(!this.container)return null;var C=this.container,w=C.getBoundingClientRect(),E=lX(w),k={chartX:Math.round(P.pageX-E.left),chartY:Math.round(P.pageY-E.top)},I=w.width/C.offsetWidth||1,N=this.inRange(k.chartX,k.chartY,I);if(!N)return null;var z=this.state,R=z.xAxisMap,D=z.yAxisMap,V=this.getTooltipEventType(),F=RC(this.state,this.props.data,this.props.layout,N);if(V!=="axis"&&R&&D){var W=Ms(R).scale,Z=Ms(D).scale,q=W&&W.invert?W.invert(k.chartX):null,tt=Z&&Z.invert?Z.invert(k.chartY):null;return mt(mt({},k),{},{xValue:q,yValue:tt},F)}return F?mt(mt({},k),F):null}},{key:"inRange",value:function(P,C){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,E=this.props.layout,k=P/w,I=C/w;if(E==="horizontal"||E==="vertical"){var N=this.state.offset,z=k>=N.left&&k<=N.left+N.width&&I>=N.top&&I<=N.top+N.height;return z?{x:k,y:I}:null}var R=this.state,D=R.angleAxisMap,V=R.radiusAxisMap;if(D&&V){var F=Ms(D);return QA({x:k,y:I},F)}return null}},{key:"parseEventsOfWrapper",value:function(){var P=this.props.children,C=this.getTooltipEventType(),w=ti(P,ei),E={};w&&C==="axis"&&(w.props.trigger==="click"?E={onClick:this.handleClick}:E={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var k=fp(this.props,this.handleOuterEvent);return mt(mt({},k),E)}},{key:"addListener",value:function(){cv.on(uv,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){cv.removeListener(uv,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(P,C,w){for(var E=this.state.formattedGraphicalItems,k=0,I=E.length;k<I;k++){var N=E[k];if(N.item===P||N.props.key===P.key||C===Lo(N.item.type)&&w===N.childIndex)return N}return null}},{key:"renderClipPath",value:function(){var P=this.clipPathId,C=this.state.offset,w=C.left,E=C.top,k=C.height,I=C.width;return y.createElement("defs",null,y.createElement("clipPath",{id:P},y.createElement("rect",{x:w,y:E,height:k,width:I})))}},{key:"getXScales",value:function(){var P=this.state.xAxisMap;return P?Object.entries(P).reduce(function(C,w){var E=$C(w,2),k=E[0],I=E[1];return mt(mt({},C),{},te({},k,I.scale))},{}):null}},{key:"getYScales",value:function(){var P=this.state.yAxisMap;return P?Object.entries(P).reduce(function(C,w){var E=$C(w,2),k=E[0],I=E[1];return mt(mt({},C),{},te({},k,I.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(P){var C;return(C=this.state.xAxisMap)===null||C===void 0||(C=C[P])===null||C===void 0?void 0:C.scale}},{key:"getYScaleByAxisId",value:function(P){var C;return(C=this.state.yAxisMap)===null||C===void 0||(C=C[P])===null||C===void 0?void 0:C.scale}},{key:"getItemByXY",value:function(P){var C=this.state,w=C.formattedGraphicalItems,E=C.activeItem;if(w&&w.length)for(var k=0,I=w.length;k<I;k++){var N=w[k],z=N.props,R=N.item,D=R.type.defaultProps!==void 0?mt(mt({},R.type.defaultProps),R.props):R.props,V=Lo(R.type);if(V==="Bar"){var F=(z.data||[]).find(function(tt){return eot(P,tt)});if(F)return{graphicalItem:N,payload:F}}else if(V==="RadialBar"){var W=(z.data||[]).find(function(tt){return QA(P,tt)});if(W)return{graphicalItem:N,payload:W}}else if(xg(N,E)||wg(N,E)||cf(N,E)){var Z=Vst({graphicalItem:N,activeTooltipItem:E,itemData:D.data}),q=D.activeIndex===void 0?Z:D.activeIndex;return{graphicalItem:mt(mt({},N),{},{childIndex:q}),payload:cf(N,E)?D.data[Z]:N.props.data[Z]}}}return null}},{key:"render",value:function(){var P=this;if(!US(this))return null;var C=this.props,w=C.children,E=C.className,k=C.width,I=C.height,N=C.style,z=C.compact,R=C.title,D=C.desc,V=IC(C,xht),F=Yt(V,!1);if(z)return y.createElement(dC,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},y.createElement(tb,tc({},F,{width:k,height:I,title:R,desc:D}),this.renderClipPath(),qS(w,this.renderMap)));if(this.props.accessibilityLayer){var W,Z;F.tabIndex=(W=this.props.tabIndex)!==null&&W!==void 0?W:0,F.role=(Z=this.props.role)!==null&&Z!==void 0?Z:"application",F.onKeyDown=function(tt){P.accessibilityManager.keyboardEvent(tt)},F.onFocus=function(){P.accessibilityManager.focus()}}var q=this.parseEventsOfWrapper();return y.createElement(dC,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},y.createElement("div",tc({className:pe("recharts-wrapper",E),style:mt({position:"relative",cursor:"default",width:k,height:I},N)},q,{ref:function(at){P.container=at}}),y.createElement(tb,tc({},F,{width:k,height:I,title:R,desc:D,style:Dht}),this.renderClipPath(),qS(w,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(y.Component);te(b,"displayName",n),te(b,"defaultProps",mt({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},f)),te(b,"getDerivedStateFromProps",function(x,_){var S=x.dataKey,P=x.data,C=x.children,w=x.width,E=x.height,k=x.layout,I=x.stackOffset,N=x.margin,z=_.dataStartIndex,R=_.dataEndIndex;if(_.updateId===void 0){var D=LC(x);return mt(mt(mt({},D),{},{updateId:0},g(mt(mt({props:x},D),{},{updateId:0}),_)),{},{prevDataKey:S,prevData:P,prevWidth:w,prevHeight:E,prevLayout:k,prevStackOffset:I,prevMargin:N,prevChildren:C})}if(S!==_.prevDataKey||P!==_.prevData||w!==_.prevWidth||E!==_.prevHeight||k!==_.prevLayout||I!==_.prevStackOffset||!oc(N,_.prevMargin)){var V=LC(x),F={chartX:_.chartX,chartY:_.chartY,isTooltipActive:_.isTooltipActive},W=mt(mt({},RC(_,P,k)),{},{updateId:_.updateId+1}),Z=mt(mt(mt({},V),F),W);return mt(mt(mt({},Z),g(mt({props:x},Z),_)),{},{prevDataKey:S,prevData:P,prevWidth:w,prevHeight:E,prevLayout:k,prevStackOffset:I,prevMargin:N,prevChildren:C})}if(!Jv(C,_.prevChildren)){var q,tt,at,H,K=ti(C,Nc),lt=K&&(q=(tt=K.props)===null||tt===void 0?void 0:tt.startIndex)!==null&&q!==void 0?q:z,ht=K&&(at=(H=K.props)===null||H===void 0?void 0:H.endIndex)!==null&&at!==void 0?at:R,yt=lt!==z||ht!==R,vt=!re(P),wt=vt&&!yt?_.updateId:_.updateId+1;return mt(mt({updateId:wt},g(mt(mt({props:x},_),{},{updateId:wt,dataStartIndex:lt,dataEndIndex:ht}),_)),{},{prevChildren:C,dataStartIndex:lt,dataEndIndex:ht})}return null}),te(b,"renderActiveDot",function(x,_,S){var P;return y.isValidElement(x)?P=y.cloneElement(x,_):ne(x)?P=x(_):P=y.createElement(mg,_),y.createElement(xe,{className:"recharts-active-dot",key:S},P)});var p=y.forwardRef(function(_,S){return y.createElement(b,tc({},_,{ref:S}))});return p.displayName=b.displayName,p},Ght=Mg({chartName:"BarChart",GraphicalChild:gl,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:ta},{axisType:"yAxis",AxisComp:ea}],formatAxisMap:Lw}),Yht=Mg({chartName:"PieChart",GraphicalChild:Yo,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:bg},{axisType:"radiusAxis",AxisComp:yg}],formatAxisMap:snt,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}}),Zht=Mg({chartName:"ScatterChart",GraphicalChild:If,defaultTooltipEventType:"item",validateTooltipEventTypes:["item"],axisComponents:[{axisType:"xAxis",AxisComp:ta},{axisType:"yAxis",AxisComp:ea},{axisType:"zAxis",AxisComp:$f}],formatAxisMap:Lw}),Kht=Mg({chartName:"AreaChart",GraphicalChild:Qs,axisComponents:[{axisType:"xAxis",AxisComp:ta},{axisType:"yAxis",AxisComp:ea}],formatAxisMap:Lw});function kI(e){const{channel:t,enabled:n,apiBaseUrl:r,getAuthToken:i,createWebSocket:o,parseClassName:s,brandColor:a="#8b5cf6",style:l={},preview:h,previewForm:u,instanceKey:f,onResolved:m}=e,[g,b]=y.useState(h?{approvalId:"preview",form:u||{title:"Which account should I use?",description:"The signup page offers multiple providers — pick one and give me the promo code if you have it.",sections:[{title:"Sign-in provider",fields:[{type:"radio",key:"provider",label:"Provider",options:["Google","GitHub","Email"]},{type:"checkbox",key:"scopes",label:"Optional scopes",options:["Read profile","Send email"]}]},{title:"Details",fields:[{type:"text",key:"promo",label:"Promo code",placeholder:"e.g. LAUNCH20"}]}]}}:null),[p,x]=y.useState({}),[_,S]=y.useState(!1),[P,C]=y.useState(!1),[w,E]=y.useState(null);y.useEffect(()=>{const R=g==null?void 0:g.expiresAt;if(!R){E(null);return}const D=()=>{const F=Math.max(0,Math.floor((new Date(R).getTime()-Date.now())/1e3));E(F),F<=0&&b(null)};D();const V=setInterval(D,1e3);return()=>clearInterval(V)},[g]);const k=R=>r&&/^(https?:)?\/\//i.test(r)?new URL(R,r).toString():`/api${R}`;y.useEffect(()=>{if(!n||!t)return;let R=!1,D=null;const V=()=>{R||(D=o(t),Cm(D)&&(D.addEventListener("open",async()=>{try{const W=await fetch(k("/agent/tools/approvals"),{headers:{Authorization:`Bearer ${(i==null?void 0:i())||localStorage.getItem("token")||""}`}});if(!W.ok||R)return;const{approvals:Z}=await W.json(),q=(Z||[]).find(at=>{var H;return at.status==="pending"&&((H=at.toolInput)==null?void 0:H.sections)});q&&(!q.expiresAt||new Date(q.expiresAt).getTime()>Date.now())&&(x({}),b({approvalId:q.id,form:q.toolInput,expiresAt:q.expiresAt}))}catch{}}),D.onmessage=F=>{var Z,q;let W=F==null?void 0:F.data;if(typeof W=="string")try{W=JSON.parse(W)}catch{return}(W==null?void 0:W.type)==="step_paused"&&((Z=W.pauseMetadata)!=null&&Z.form)&&((q=W.pauseMetadata)!=null&&q.approvalId)&&(x({}),b({approvalId:W.pauseMetadata.approvalId,form:W.pauseMetadata.form,expiresAt:W.pauseMetadata.expiresAt}))},D.onclose=()=>{R||setTimeout(V,3e3)},D.onerror=()=>{var F;(F=D==null?void 0:D.close)==null||F.call(D)}))};return V(),()=>{var F;R=!0,(F=D==null?void 0:D.close)==null||F.call(D)}},[n,t,f]);const I=async R=>{if(!g||_)return;const D=g.approvalId;if(D==="preview"){b(null),m==null||m(R,D);return}S(!0);const V=`/agent/tools/approvals/${encodeURIComponent(D)}/${R?"approve":"deny"}`;try{await fetch(k(V),{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${(i==null?void 0:i())||localStorage.getItem("token")||""}`},body:R?JSON.stringify({formValues:p,dontAskAgain:P}):"{}"})}catch{}S(!1),b(null),m==null||m(R,D)},N=R=>{const D=p[R.key],V=F=>x(W=>({...W,[R.key]:F}));if(R.type==="radio"||R.type==="checkbox"){const F=R.type==="checkbox",W=F?Array.isArray(D)?D:[]:[D].filter(Boolean);return y.createElement("div",{key:R.key,style:{display:"flex",flexWrap:"wrap",gap:8}},(R.options||[]).map(Z=>y.createElement("button",{key:Z,type:"button",onClick:()=>V(F?W.includes(Z)?W.filter(q=>q!==Z):[...W,Z]:Z),style:{padding:"6px 12px",borderRadius:999,fontSize:12,border:"none",cursor:"pointer",fontWeight:W.includes(Z)?600:500,backgroundColor:W.includes(Z)?"#ffffff":"rgba(255,255,255,0.1)",color:W.includes(Z)?"#000000":"#ffffff"}},Z)))}return y.createElement("input",{key:R.key,type:R.secure===!0?"password":"text",placeholder:R.placeholder||"",value:D||"",onChange:F=>V(F.target.value),style:{width:"100%",padding:"8px 12px",borderRadius:8,border:"none",outline:"none",fontSize:14,backgroundColor:"rgba(255,255,255,0.1)",color:"#ffffff"}})},z=l.variant==="drawer";return g?al.createPortal(y.createElement("div",{key:"approval",onClick:R=>R.stopPropagation(),className:l.className?s==null?void 0:s(l.className):void 0,style:{position:"fixed",inset:0,zIndex:1100,display:"flex",alignItems:z?"stretch":"center",justifyContent:z?"flex-end":"center",backgroundColor:"rgba(0,0,0,0.7)",padding:z?0:16}},y.createElement("div",{style:{position:"relative",overflow:"hidden",borderRadius:z?0:17,padding:1,width:"100%",maxWidth:z?"24rem":"40rem",maxHeight:"100%",display:"flex",backgroundColor:"rgba(255,255,255,0.08)"}},y.createElement("div",{style:{position:"absolute",inset:"-150%",background:`conic-gradient(from 0deg, transparent 0%, ${a}99 14%, transparent 30%)`,animation:"bf-spin 6s linear infinite"}}),y.createElement("div",{className:l.panelClassName?s==null?void 0:s(l.panelClassName):void 0,style:{position:"relative",zIndex:1,width:"100%",maxHeight:"100%",overflowY:"auto",borderRadius:z?0:16,backgroundColor:"#12121a",color:"#f8fafc",padding:20,display:"flex",flexDirection:"column",gap:16,...l.style||{}}},w!=null?y.createElement("span",{style:{position:"absolute",top:12,right:16,fontSize:12,fontVariantNumeric:"tabular-nums",color:w<=15?"#f87171":"rgba(255,255,255,0.5)"}},`${Math.floor(w/60)}:${String(w%60).padStart(2,"0")}`):null,y.createElement("p",{style:{fontSize:20,fontWeight:600,color:"#ffffff"}},g.form.title||"Input needed"),g.form.description?y.createElement("p",{style:{fontSize:16,color:"rgba(255,255,255,0.6)"}},g.form.description):null,...(g.form.sections||[]).map((R,D)=>y.createElement("div",{key:R.title||D,style:{display:"flex",flexDirection:"column",gap:8}},R.title?y.createElement("p",{style:{fontSize:11,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em",color:"rgba(255,255,255,0.5)"}},R.title):null,...(R.fields||[]).map(V=>y.createElement("label",{key:V.key,style:{display:"flex",flexDirection:"column",gap:6}},y.createElement("span",{style:{fontSize:14,color:"rgba(255,255,255,0.8)"}},V.label||V.key),N(V))))),y.createElement("label",{style:{display:"flex",alignItems:"center",gap:8,fontSize:13,color:"rgba(255,255,255,0.6)",cursor:"pointer"}},y.createElement("input",{type:"checkbox",checked:P,onChange:R=>C(R.target.checked),style:{accentColor:a}}),"Don't ask again this session"),y.createElement("div",{style:{display:"flex",flexDirection:"row",justifyContent:"flex-end",gap:8,paddingTop:4}},y.createElement("button",{type:"button",disabled:_,onClick:()=>void I(!1),style:{padding:"8px 16px",borderRadius:999,fontSize:14,fontWeight:500,border:"none",cursor:"pointer",backgroundColor:"rgba(255,255,255,0.1)",color:"#ffffff",opacity:_?.4:1}},"Cancel"),y.createElement("button",{type:"button",disabled:_,onClick:()=>void I(!0),style:{padding:"8px 16px",borderRadius:999,fontSize:14,fontWeight:600,border:"none",cursor:"pointer",backgroundColor:"#ffffff",color:"#000000",opacity:_?.4:1}},"Submit"))))),document.body):null}const Xht=(e,t,n)=>Math.min(n,Math.max(t,e));function Jht(e){const t=e.map(o=>{const s=o.size??o.width,a=typeof s=="number"?s:/%\s*$/.test(String(s??""))?parseFloat(s):NaN;return Number.isFinite(a)?a:NaN}),n=t.filter(o=>!Number.isNaN(o)),r=Math.max(0,100-n.reduce((o,s)=>o+s,0)),i=Math.max(1,t.length-n.length);return t.map(o=>Number.isNaN(o)?r/i:o)}const Qht=y.forwardRef(function({api:t,config:n,componentKey:r},i){const o=Array.isArray(n.panes)?n.panes:[],s=n.orientation==="vertical",[a,l]=y.useState(()=>Jht(o)),[h,u]=y.useState(!1),f=y.useRef(null),m=(S,P)=>{var E,k;const C=Number(((E=o[S])==null?void 0:E.minSize)??10),w=Number(((k=o[S+1])==null?void 0:k.minSize)??10);l(I=>{const N=I[S]+I[S+1],z=Xht(P,C,N-w);return I.map((R,D)=>D===S?z:D===S+1?N-z:R)})},g=S=>P=>{const C=f.current;if(!C||P.button!==0)return;P.preventDefault();const w=C.ownerDocument,E=C.getBoundingClientRect(),k=s?E.height:E.width,I=s?P.clientY:P.clientX,N=a[S];u(!0);const z=D=>{const V=((s?D.clientY:D.clientX)-I)/k*100;m(S,N+V)},R=()=>{w.removeEventListener("pointermove",z),w.removeEventListener("pointerup",R),w.removeEventListener("pointercancel",R),u(!1)};w.addEventListener("pointermove",z),w.addEventListener("pointerup",R),w.addEventListener("pointercancel",R)},b=S=>P=>{const C=s?"ArrowUp":"ArrowLeft",w=s?"ArrowDown":"ArrowRight";P.key!==C&&P.key!==w||(P.preventDefault(),m(S,a[S]+(P.key===w?2:-2)))},p={display:"flex",flexDirection:s?"column":"row",alignItems:"stretch",...n.className?t.parseClassName(n.className):{width:"100%",flex:1,minHeight:0}},x=[];o.forEach((S,P)=>{x.push(U("div",{key:`${r}-split-${P}`,style:{flex:`${a[P]} 1 0px`,minWidth:0,minHeight:0,display:"flex",flexDirection:"column",overflow:"hidden",pointerEvents:h?"none":void 0}},S.component?t.renderComponent(S.component,P,`${r}-split`):null)),P!==o.length-1&&x.push(U("div",{key:`${r}-split-handle-${P}`,role:"separator",tabIndex:0,"aria-orientation":s?"horizontal":"vertical","aria-valuenow":Math.round(a[P]),"aria-label":"Resize",onPointerDown:g(P),onKeyDown:b(P),style:{flex:"0 0 auto",[s?"height":"width"]:8,cursor:s?"row-resize":"col-resize",touchAction:"none",userSelect:"none",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1}},U("div",{style:{[s?"height":"width"]:1,[s?"width":"height"]:"100%",background:t.cfg.colors.border}})))});const _=t.getCommonProps(r,p,n);return U("div",{key:r,..._,ref:S=>{f.current=S,typeof i=="function"?i(S):i&&(i.current=S)}},...x)}),tft=()=>{try{if(typeof window<"u")return window.localStorage.getItem("backflow_dev_diagnostics")==="1"}catch{}return!1},bm=(...e)=>{tft()&&console.warn(...e)};function eft(e,t,n){var s,a;const r=t.expression?((s=e.evaluateExpression)==null?void 0:s.call(e,t.expression,t.expressionUrl,n,t.expressionKey))??e.interpolateText(t.expression):e.interpolateText(t.text||"");if(t.className){const l=((a=e.parseClassNameResponsive)==null?void 0:a.call(e,t.className,n))??e.parseClassName(t.className);if(e.renderMode!=="css-driven"){const u=Cx(t.className);if(u.size>0){const m=Qt(u,e.containerWidth,"1rem");l.fontSize=m}const f=eu(t.className);f.size>0&&(l.display=Qt(f,e.containerWidth,"block"))}const h=e.getCommonProps(n,l,t);return U("p",{key:n,className:t.className,...h},r)}const i={};t.fontSize!==void 0&&(i.fontSize=`${t.fontSize}px`),t.fontWeight!==void 0&&(i.fontWeight=t.fontWeight),t.color!==void 0&&(i.color=t.color),t.textAlign!==void 0&&(i.textAlign=t.textAlign);const o=e.getCommonProps(n,i,t);return U("p",{key:n,...o},r)}function nft(e){return e.replace(/<script[\s\S]*?<\/script>/gi,"").replace(/<iframe[\s\S]*?<\/iframe>/gi,"").replace(/\son\w+\s*=\s*("[^"]*"|'[^']*'|[^\s>]+)/gi,"")}function rft(e,t,n){const r=String(e.apiUrl||"").replace(/\/$/,""),i=e.interpolateText(t.text||t.html||"").replace(/(src|href)=("|')\/(?!\/)/g,r?`$1=$2${r}/`:"$1=$2/"),o=e.getCommonProps(n,{color:e.cfg.colors.text},t);return U("div",{key:n,className:t.className,...o,dangerouslySetInnerHTML:{__html:nft(i)}})}function ift(e,t,n){var l;const r=e.interpolateText(t.href||""),i=()=>{t.onClick?e.handleButtonClick(t.onClick,{onSuccess:t.onSuccess,onError:t.onError},{optimistic:t.optimistic,feedback:t.feedback}):r&&(r.startsWith("http")||e.previewMode?window.open(r,"_blank","noopener,noreferrer"):window.location.href=r)},o=()=>{var h;if(!e.interactionDisabled){if((h=t.confirmation)!=null&&h.enabled){(e.setOverlayModal||e.setActiveModal)({id:"__confirm",definition:{title:t.confirmation.title||"Confirm Action",size:"sm",components:[{type:"text",text:t.confirmation.message||"Are you sure you want to proceed?",color:e.cfg.colorMode==="light"?"rgba(0,0,0,0.65)":"rgba(255,255,255,0.6)",fontSize:14}],actions:[{label:"Cancel",variant:"ghost",dismiss:!0},{label:"Confirm",variant:"primary",dismiss:!0}]},legacyOnConfirm:()=>{i()}});return}i()}};if(t.className){const h=((l=e.parseClassNameResponsive)==null?void 0:l.call(e,t.className,n))??e.parseClassName(t.className);if(e.renderMode!=="css-driven"){const f=eu(t.className);f.size>0&&(h.display=Qt(f,e.containerWidth,"inline"));const m=Cx(t.className);if(m.size>0){const g=Qt(m,e.containerWidth,"1rem");h.fontSize=g}}t.icon&&(h.display="inline-flex",h.alignItems="center",h.gap=6);const u=e.getCommonProps(n,h,t);return U("a",{key:n,className:t.className,...u,onClick:e.interactionDisabled?void 0:o,href:e.interactionDisabled?void 0:r&&!t.onClick?r:void 0,target:r.startsWith("http")?"_blank":void 0,rel:r.startsWith("http")?"noopener noreferrer":void 0},t.icon?e.renderIcon(t.icon,16):null,e.interpolateText(t.text||t.label||""))}const s={cursor:"pointer",textDecoration:"none",transition:"all 0.2s",display:"inline-flex",alignItems:"center",gap:6},a=e.getCommonProps(n,s,t);return U("a",{key:n,...a,onClick:e.interactionDisabled?void 0:o,href:e.interactionDisabled?void 0:r&&!t.onClick?r:void 0,target:r.startsWith("http")?"_blank":void 0,rel:r.startsWith("http")?"noopener noreferrer":void 0},t.icon?e.renderIcon(t.icon,16):null,e.interpolateText(t.text||t.label||""))}function oft(e,t,n){var b,p,x,_,S;let r=!1;if(t.activeWhen){if(t.activeWhen===e.currentSceneId)r=!0;else if(typeof t.activeWhen=="string"){const P=t.activeWhen.split("=",2);P.length===2&&(r=String(((b=e.sceneData)==null?void 0:b[P[0]])??"")===P[1])}}const i=r?{onClick:t.activeOnClick||t.onClick,onSuccess:t.activeOnSuccess||t.onSuccess,onError:t.activeOnError||t.onError,icon:t.activeIcon||t.icon,text:t.activeText||t.text,label:t.activeText||t.label}:{onClick:t.onClick,onSuccess:t.onSuccess,onError:t.onError,icon:t.icon,text:t.text,label:t.label},o=t.disabled?((p=e.evaluateCondition)==null?void 0:p.call(e,t.disabled))??!1:!1,s=P=>{var k;const C=()=>e.handleButtonClick(i.onClick||"",{onSuccess:i.onSuccess,onError:i.onError},{optimistic:t.optimistic,feedback:t.feedback,payload:t.payload,refetchScope:t.refetchScope,mergeResponse:t.mergeResponse,anchorElement:P==null?void 0:P.currentTarget,openUrl:t.openUrl}),w=t.sceneLoader===!1,E=t.pageLoader===!1?C():e.withLoading?e.withLoading(n,C):C();w&&((k=e.sceneLoaderOptOut)==null||k.add(n)),E.catch(I=>{var z,R;const N=((z=t.onError)==null?void 0:z.message)||(I==null?void 0:I.message)||"An error occurred";(R=e.showToast)==null||R.call(e,N,"error")}).finally(()=>{var I;w&&((I=e.sceneLoaderOptOut)==null||I.delete(n))})},a=P=>{var C;if((C=t.confirmation)!=null&&C.enabled){(e.setOverlayModal||e.setActiveModal)({id:"__confirm",definition:{title:t.confirmation.title||"Confirm Action",size:"sm",components:[{type:"text",text:t.confirmation.message||"Are you sure you want to proceed?",color:e.cfg.colorMode==="light"?"rgba(0,0,0,0.65)":"rgba(255,255,255,0.6)",fontSize:16}],actions:[{label:t.confirmation.cancelLabel||"Cancel",variant:"ghost",dismiss:!0},{label:t.confirmation.confirmLabel||"Confirm",variant:"primary",dismiss:!0,confirm:!0}]},legacyOnConfirm:()=>{s(P)}});return}s(P)},l=(x=e.buttonLoading)==null?void 0:x[n];if(t.className){let P=((_=e.parseClassNameResponsive)==null?void 0:_.call(e,t.className,n))??e.parseClassName(t.className);if(e.renderMode!=="css-driven"){const R=eu(t.className);R.size>0&&(P.display=Qt(R,e.containerWidth,"inline-flex"));const D=Cx(t.className);D.size>0&&(P.fontSize=Qt(D,e.containerWidth,"1rem"))}let C=t.className;if(r&&t.activeClass){const R=((S=e.parseClassNameResponsive)==null?void 0:S.call(e,t.activeClass,n))??e.parseClassName(t.activeClass);P={...P,...R},C=`${t.className} ${t.activeClass}`}const w={display:"inline-flex",alignItems:"center",justifyContent:P.textAlign==="left"?"flex-start":P.textAlign==="right"?"flex-end":"center",gap:"6px",...P,...t.color&&{color:t.color},...t.background&&{background:t.background},...t.borderRadius!==void 0&&{borderRadius:typeof t.borderRadius=="number"?`${t.borderRadius}px`:t.borderRadius},...t.borderColor&&{borderColor:t.borderColor},...l&&{opacity:.6,pointerEvents:"none"}},E={},k=(t.className||"").split(/\s+/).filter(Boolean);for(const R of k)if(R.startsWith("hover:")){const D=R.replace("hover:","");if(D.startsWith("bg-")||D.startsWith("text-")||D.startsWith("border-")){const V=e.parseClassName(D);Object.assign(E,V)}}const I=e.getCommonProps(n,w,t),N=[];i.icon&&!l&&N.push(U("span",{key:"icon",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,...i.text?{marginRight:"6px"}:{}}},e.renderIcon(i.icon,t.iconSize||16))),l&&N.unshift(U("div",{key:"spinner",className:"bf-btn-spinner",style:{width:"14px",height:"14px",border:"2px solid currentColor",borderTopColor:"transparent",borderRadius:"50%",flexShrink:0}})),Array.isArray(t.children)&&t.children.length>0?t.children.forEach((R,D)=>{N.push(e.renderComponent(R,D,n))}):N.push(i.label||i.text||(i.icon?"":"Button"));const z={};return Object.keys(E).length>0&&(z.onMouseEnter=R=>{E.backgroundColor&&(R.currentTarget.style.backgroundColor=E.backgroundColor),E.color&&(R.currentTarget.style.color=E.color),E.borderColor&&(R.currentTarget.style.borderColor=E.borderColor)},z.onMouseLeave=R=>{E.backgroundColor&&(R.currentTarget.style.backgroundColor=w.backgroundColor||""),E.color&&(R.currentTarget.style.color=w.color||""),E.borderColor&&(R.currentTarget.style.borderColor=w.borderColor||"")}),U("button",{key:n,className:C,"aria-label":t.ariaLabel?e.interpolateText(t.ariaLabel):void 0,title:e.interpolateText(t.tooltip||t.ariaLabel||i.label||i.text||"Button"),...I,...z,onClick:e.interactionDisabled?void 0:a,disabled:l||o||void 0},...N)}const h=e.cfg.colors.primary,u=e.cfg.colors.accent,f={display:"inline-flex",alignItems:"center",gap:"6px",padding:"0.75rem 1.5rem",borderRadius:"0.75rem",fontWeight:600,transition:e.cfg.effects.transition,color:e.cfg.colorMode==="light"?"#ffffff":e.cfg.colors.text,background:r?e.cfg.colors.primary:`linear-gradient(to right, ${h}, ${u})`,boxShadow:r?"none":`0 10px 15px -3px ${h}40`,...l&&{opacity:.6,pointerEvents:"none"}},m=e.getCommonProps(n,f,t),g=[];return l&&g.push(U("div",{key:"spinner",className:"bf-btn-spinner",style:{width:"14px",height:"14px",border:"2px solid currentColor",borderTopColor:"transparent",borderRadius:"50%",flexShrink:0}})),i.icon&&!l&&g.push(U("span",{key:"icon",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,marginRight:"6px"}},e.renderIcon(i.icon,t.iconSize||16))),g.push(i.label||i.text||(i.icon?"":"Button")),U("button",{key:n,"aria-label":t.ariaLabel?e.interpolateText(t.ariaLabel):void 0,title:e.interpolateText(t.tooltip||t.ariaLabel||i.label||i.text||"Button"),...t.scrollActiveIntoView&&r?{ref:P=>{!P||P.dataset.bfScrolled==="1"||(P.dataset.bfScrolled="1",P.scrollIntoView({inline:"center",block:"nearest",behavior:"smooth"}))}}:{},...m,onClick:e.interactionDisabled?void 0:a,disabled:l||o||void 0},...g)}function sft({api:e,c:t,componentKey:n}){var u;const r=e.interpolateText(t.src||""),i=y.useRef(null),[o,s]=y.useState(0),a=typeof t.parallax=="number"?t.parallax:typeof t.parallaxStrength=="number"?t.parallaxStrength:32,l=t.height||t.h||260,h=t.className?((u=e.parseClassNameResponsive)==null?void 0:u.call(e,t.className,n))??e.parseClassName(t.className):{};return y.useEffect(()=>{const f=i.current;if(!f)return;const m=()=>{const g=f.getBoundingClientRect(),b=window.innerHeight||800,p=Math.min(1,Math.max(0,(b-g.top)/(b+g.height)));s((.5-p)*2*a)};return window.addEventListener("scroll",m,{capture:!0,passive:!0}),window.addEventListener("resize",m),m(),()=>{window.removeEventListener("scroll",m,{capture:!0}),window.removeEventListener("resize",m)}},[a]),t.skipEmpty&&(!r||r==="placeholder")?null:y.createElement("div",{ref:i,key:n,className:t.className,"data-component-key":n,style:{position:"relative",overflow:"hidden",...h,height:h.height||l}},y.createElement("img",{src:r,alt:t.alt||"",style:{position:"absolute",left:0,top:"-15%",width:"100%",height:"130%",objectFit:"cover",transform:`translateY(${o}px)`,willChange:"transform"},onError:()=>e.setImageErrors(f=>({...f,[n]:!0}))}))}function aft(e,t,n){var h;if(t.parallax)return y.createElement(sft,{api:e,c:t,componentKey:n});const r=e.interpolateText(t.src||""),i=!r||r==="placeholder",o=e.imageErrors[`${n}::${r}`];if(t.skipEmpty&&i)return null;const s=()=>{var m;const u=t.className?{...((m=e.parseClassNameResponsive)==null?void 0:m.call(e,t.className,n))??e.parseClassName(t.className),border:`1px dashed ${e.cfg.colors.borderSubtle}`,display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden"}:{border:`1px dashed ${e.cfg.colors.borderSubtle}`,display:"flex",alignItems:"center",justifyContent:"center",padding:10,height:"200px",borderRadius:"0.75rem"},f=e.getCommonProps(n,u,t);return U("div",{key:n,...f},t.className?null:U("span",{style:{color:e.cfg.colors.textPlaceholder,fontSize:"0.875rem"}},"Image"))};if(i||o)return s();if(t.className){const u=((h=e.parseClassNameResponsive)==null?void 0:h.call(e,t.className,n))??e.parseClassName(t.className),f=e.getCommonProps(n,u,t),m={key:`${n}-${r}`,src:r,alt:t.alt||"",className:t.className,...f,onError:()=>e.setImageErrors(g=>({...g,[`${n}::${r}`]:!0}))};return t.onClick&&!e.interactionDisabled&&(m.onClick=()=>e.handleButtonClick(t.onClick)),U("img",m)}const a={width:t.w||t.width||"100%",height:t.h||t.height||"auto",objectFit:"cover",borderRadius:"0.75rem"};t.onClick&&(a.cursor="pointer");const l={key:`${n}-${r}`,src:r,alt:t.alt||"",...e.getCommonProps(n,a,t),onError:()=>e.setImageErrors(u=>({...u,[`${n}::${r}`]:!0}))};return t.onClick&&!e.interactionDisabled&&(l.onClick=()=>e.handleButtonClick(t.onClick)),U("img",l)}function lft(e,t,n){var o;if(t.className){const s=((o=e.parseClassNameResponsive)==null?void 0:o.call(e,t.className,n))??e.parseClassName(t.className),a=e.getCommonProps(n,s,t);return U("input",{key:n,className:t.className,...a,name:t.name,placeholder:t.placeholder,type:t.inputType||"text",...t.step!==void 0?{step:t.step}:{},...t.min!==void 0?{min:t.min}:{},...t.max!==void 0?{max:t.max}:{},...t.inputMode?{inputMode:t.inputMode}:{},value:e.sceneData[t.name||""]??"",style:{...(a==null?void 0:a.style)||{},colorScheme:e.cfg.colorMode==="light"?"light":"dark"},onClick:t.openPickerOnClick?l=>{var h,u;return(u=(h=l.currentTarget).showPicker)==null?void 0:u.call(h)}:void 0,onChange:l=>e.setSceneData(h=>({...h,[t.name||""]:l.target.value})),onKeyDown:t.onKeyDown?l=>{if(l.key==="Enter"){if(l.preventDefault(),t.payload&&typeof t.payload=="object"&&!Object.values(t.payload).some(u=>typeof u=="string"?String(e.interpolateText(u)??"").trim()!=="":!0))return;e.handleButtonClick(t.onKeyDown,void 0,{payload:t.payload})}}:void 0})}const r={width:"100%",padding:"8px 8px",borderRadius:e.cfg.components.inputRadius||void 0,backgroundColor:e.cfg.colors.surface,color:e.cfg.colors.text,border:`1px solid ${e.cfg.colorMode==="light"?e.cfg.colors.border:"transparent"}`,outline:"none",transition:e.cfg.effects.transition},i=e.getCommonProps(n,r,t);if(t.label){const s=e.getCommonProps(n,{width:"100%"},t);return U("div",{key:n,...s},U("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,color:e.cfg.colors.textSecondary,marginBottom:"0.75rem"}},t.label),U("input",{...i,name:t.name,placeholder:t.placeholder,type:t.inputType||"text",...t.step!==void 0?{step:t.step}:{},...t.min!==void 0?{min:t.min}:{},...t.max!==void 0?{max:t.max}:{},...t.inputMode?{inputMode:t.inputMode}:{},value:e.sceneData[t.name||""]??"",onChange:a=>e.setSceneData(l=>({...l,[t.name||""]:a.target.value}))}))}return U("input",{key:n,...i,name:t.name,placeholder:t.placeholder,type:t.inputType||"text",...t.step!==void 0?{step:t.step}:{},...t.min!==void 0?{min:t.min}:{},...t.max!==void 0?{max:t.max}:{},...t.inputMode?{inputMode:t.inputMode}:{},value:e.sceneData[t.name||""]??"",onChange:s=>e.setSceneData(a=>({...a,[t.name||""]:s.target.value}))})}function cft(e,t,n){const r=t.value?e.interpolateText(String(t.value)):e.sceneData[t.name||""]??"";return U("input",{key:n,type:"hidden",name:t.name,value:r})}function uft(e,t,n){var l;const r={backgroundColor:e.cfg.colors.surface,color:e.cfg.colors.text},i=e.cfg.colorMode==="light"?"light":"dark",o=()=>{var h;return[t.placeholder&&U("option",{key:"__placeholder",value:"",style:r},t.placeholder),...((h=t.options)==null?void 0:h.map(u=>U("option",{key:u.value,value:u.value,style:r},u.label)))||[]]};if(t.className){const h={...((l=e.parseClassNameResponsive)==null?void 0:l.call(e,t.className,n))??e.parseClassName(t.className),colorScheme:i},u=e.getCommonProps(n,h,t);return U("select",{key:n,className:t.className,...u,name:t.name,value:e.sceneData[t.name||""]??"",onChange:f=>e.setSceneData(m=>({...m,[t.name||""]:f.target.value}))},...o())}const s={width:"100%",padding:"8px 8px",borderRadius:e.cfg.components.inputRadius||void 0,backgroundColor:e.cfg.colors.surface,color:e.cfg.colors.text,border:`1px solid ${e.cfg.colorMode==="light"?e.cfg.colors.border:"transparent"}`,outline:"none",transition:e.cfg.effects.transition,cursor:"pointer",appearance:"none",colorScheme:i},a=e.getCommonProps(n,s,t);if(t.label){const h=e.getCommonProps(n,{width:"100%"},t);return U("div",{key:n,...h},U("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,color:e.cfg.colors.textSecondary,marginBottom:"0.75rem"}},t.label),U("select",{...a,name:t.name,value:e.sceneData[t.name||""]??"",onChange:u=>e.setSceneData(f=>({...f,[t.name||""]:u.target.value}))},...o()))}return U("select",{key:n,...a,name:t.name,value:e.sceneData[t.name||""]??"",onChange:h=>e.setSceneData(u=>({...u,[t.name||""]:h.target.value}))},...o())}function hft(e,t,n){var f;const r=e.cfg.colors,i=e.sceneData[t.name||""]===!0||e.sceneData[t.name||""]==="true",o="flex flex-row items-center gap-3 cursor-pointer select-none",s=t.className?`${o} ${t.className}`:`${o} text-white`,a=e.parseClassName(s),h={...e.parseClassName("w-5 h-5 rounded shrink-0"),appearance:"none",WebkitAppearance:"none",width:20,height:20,borderRadius:6,border:`1.5px solid ${i?r.primary:r.border}`,backgroundColor:i?r.primary:"transparent",backgroundImage:i?`url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'><path d='M20 6 9 17l-5-5'/></svg>")`:"none",backgroundRepeat:"no-repeat",backgroundPosition:"center",backgroundSize:"13px 13px",boxSizing:"border-box",flexShrink:0,cursor:"pointer",transition:"background-color 120ms ease, border-color 120ms ease"},u=e.getCommonProps(n,a,t);return U("label",{key:n,className:s,...u},U("input",{type:"checkbox",className:"shrink-0",style:h,checked:i,"aria-label":t.ariaLabel||t.label,disabled:e.interactionDisabled||(t.disabled?((f=e.evaluateCondition)==null?void 0:f.call(e,t.disabled))??!0:!1),onChange:m=>{var p;const g=m.target.checked,b=async()=>{try{t.onChange&&await e.handleButtonClick(t.onChange),e.setSceneData(x=>({...x,[t.name||""]:g}))}catch(x){e.showToast(x instanceof Error?x.message:"Setting could not be saved","error")}};if(g&&((p=t.confirmation)!=null&&p.enabled)){(e.setOverlayModal||e.setActiveModal)({id:"__confirm",definition:{title:t.confirmation.title||"Confirm",size:"sm",components:[{type:"text",text:t.confirmation.message}],actions:[{label:"Cancel",variant:"ghost",dismiss:!0},{label:"Confirm",variant:"primary",dismiss:!0}]},legacyOnConfirm:()=>{b()}});return}b()}}),U("span",{},t.label||""))}function fft(e,t,n){const r={green:{bg:"#065f4620",color:"#22c55e",border:"#22c55e40"},blue:{bg:"#1e40af20",color:"#3b82f6",border:"#3b82f640"},red:{bg:"#7f1d1d20",color:"#ef4444",border:"#ef444440"},yellow:{bg:"#71370220",color:"#eab308",border:"#eab30840"},purple:{bg:"#581c8720",color:"#a855f7",border:"#a855f740"},orange:{bg:"#7c2d1220",color:"#f97316",border:"#f9731640"},gray:{bg:"#37415120",color:"#9ca3af",border:"#9ca3af40"},cyan:{bg:"#0e727020",color:"#06b6d4",border:"#06b6d440"},pink:{bg:"#83184420",color:"#ec4899",border:"#ec489940"}};let o=t.colorScheme||"gray";if(t.colorBy&&typeof t.colorBy=="object"){const u=(e.interpolateText(t.text||t.label||"")||"").trim().toLowerCase();t.colorBy[u]&&(o=t.colorBy[u])}const s=r[o]||r.gray,a=t.variant||"subtle";let l={display:"inline-flex",alignItems:"center",padding:"2px 8px",borderRadius:"4px",fontSize:"11px",fontWeight:600,letterSpacing:"0.025em",textTransform:"uppercase",whiteSpace:"nowrap"};a==="solid"?(l.backgroundColor=s.color,l.color="#fff"):a==="outline"?(l.backgroundColor="transparent",l.color=s.color,l.border=`1px solid ${s.border||s.color}`):(l.backgroundColor=s.bg,l.color=s.color,t.bordered&&(l.border=`1px solid ${s.border||s.color}`)),t.pill&&(l.borderRadius="9999px"),t.className&&(l={...l,...e.parseClassName(t.className)});const h=e.getCommonProps(n,l,t);return U("span",{key:n,...h},e.interpolateText(t.text||t.label||""))}function dft(e,t,n){const r={display:"inline-flex",alignItems:"center",gap:"4px",padding:"4px 10px",borderRadius:"9999px",fontSize:"12px",fontWeight:500,backgroundColor:t.bg||e.cfg.colors.surfaceHover,color:t.color||e.cfg.colors.textSecondary,...t.className?e.parseClassName(t.className):{}},i=e.getCommonProps(n,r,t);return U("span",{key:n,...i},e.interpolateText(t.text||t.label||""))}function pft(e,t,n){const i={sm:32,md:40,lg:48,xl:64}[t.size||"md"]||40,o=i*.4;if(t.src){const h={width:`${i}px`,height:`${i}px`,borderRadius:"50%",objectFit:"cover",...t.className?e.parseClassName(t.className):{}},u=e.getCommonProps(n,h,t);return U("img",{key:n,src:t.src,alt:t.alt||t.label||"",...u})}const s=t.initials||(t.label||t.text||"").split(" ").map(h=>h[0]).join("").slice(0,2).toUpperCase()||"?",a={width:`${i}px`,height:`${i}px`,borderRadius:"50%",backgroundColor:t.bg||e.cfg.colors.primary,color:t.color||e.cfg.colors.text,display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${o}px`,fontWeight:600,flexShrink:0,...t.className?e.parseClassName(t.className):{}},l=e.getCommonProps(n,a,t);return U("div",{key:n,...l},s)}function mft(e,t,n){const r=t.progressValue??t.value??0,i=t.progressMax??100,o=(g,b)=>{if(typeof g=="string")return Number(e.interpolateText(g))||b;const p=Number(g);return Number.isFinite(p)?p:b},s=o(r,0),a=o(i,100),l=Math.min(100,Math.max(0,s/a*100)),u=s>a?e.cfg.colors.danger:t.color||e.cfg.colors.primary,f={width:"100%",display:"flex",flexDirection:"column",gap:"4px",...t.className?e.parseClassName(t.className):{}},m=e.getCommonProps(n,f,t);return U("div",{key:n,...m},(t.progressLabel||t.label)&&y.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:e.cfg.colors.textMuted}},U("span",null,e.interpolateText(t.progressLabel||t.label||"")),U("span",null,`${s}/${a}`)),y.createElement("div",{style:{width:"100%",height:"8px",backgroundColor:e.cfg.colors.surfaceHover,borderRadius:"4px",overflow:"hidden"}},U("div",{style:{width:`${Math.min(l,100)}%`,height:"100%",backgroundColor:u,borderRadius:"4px",transition:"width 0.3s ease"}})))}function gft(e,t,n){const r={position:"relative",width:"100%",...t.className?e.parseClassName(t.className):{}},i=e.getCommonProps(n,r,t);return U("div",{key:n,...i},U("span",{style:{position:"absolute",left:"14px",top:"50%",transform:"translateY(-50%)",color:e.cfg.colors.primary,fontSize:"14px",pointerEvents:"none",display:"flex",alignItems:"center"}},e.renderIcon("search",16)),U("input",{type:"text",name:t.name||"search",className:t.inputClassName,placeholder:t.placeholder||"Search...",value:e.sceneData[t.name||"search"]??"",onChange:o=>{e.setSceneData(s=>({...s,[t.name||"search"]:o.target.value}))},onKeyDown:t.onKeyDown?o=>{o.key==="Enter"&&(o.preventDefault(),e.handleButtonClick(e.interpolateText(t.onKeyDown),{onSuccess:t.onSuccess,onError:t.onError},{payload:t.payload,refetchScope:t.refetchScope}))}:void 0,style:{width:"100%",padding:"12px 16px 12px 40px",borderRadius:"9999px",backgroundColor:e.cfg.colorMode==="dark"?"#1f2937":"#ffffff",color:e.cfg.colorMode==="dark"?"#ffffff":e.cfg.colors.text,border:`1px solid ${e.cfg.colorMode==="dark"?"transparent":"#e5e5e5"}`,outline:"none",fontSize:e.cfg.typography.baseFontSize,transition:e.cfg.effects.transition,...t.inputClassName?e.parseClassName(t.inputClassName):{},...t.inputStyle||{}}}))}function yft(e,t,n){const r=Array.isArray(t.breadcrumbItems)?t.breadcrumbItems:[],i={display:"flex",alignItems:"center",gap:"4px",fontSize:"14px",...t.className?e.parseClassName(t.className):{}},o=e.getCommonProps(n,i,t);return U("nav",{key:n,...o,"aria-label":"Breadcrumb"},r.map((s,a)=>{const l=a===r.length-1,h=e.interpolateText(s.label);return y.createElement(y.Fragment,{key:`${n}-bc-${a}`},y.createElement(l?"span":"a",{style:{color:l?e.cfg.colors.textSecondary:e.cfg.colors.textMuted,fontWeight:l?600:400,cursor:l?"default":"pointer",textDecoration:"none",transition:e.cfg.effects.transition},...!l&&s.href?{href:s.href}:{},...!l&&s.onClick?{onClick:()=>e.handleButtonClick(s.onClick,{})}:{}},h),!l&&U("span",{style:{color:e.cfg.colors.border,margin:"0 2px"}},"/"))}))}function vft(e,t,n){const r=Array.isArray(t.items)?t.items:[],[i,o]=y.useState(0),s=t.autoplay!==!1&&r.length>1,a=t.interval||4e3,l=t.effect==="fade"?"fade":"slide";y.useEffect(()=>{if(!s||r.length<2)return;const S=setInterval(()=>o(P=>(P+1)%r.length),a);return()=>clearInterval(S)},[s,a,r.length]);const h=S=>o((S%r.length+r.length)%r.length),u=t.showArrows!==!1&&r.length>1,f=t.showDots!==!1&&r.length>1,m={position:"relative",overflow:"hidden",...t.className?e.parseClassName(t.className):{}};t.aspectRatio&&(m.aspectRatio=t.aspectRatio),!t.aspectRatio&&!t.height&&(m.height="320px");const g=e.getCommonProps(n,m,t),b=S=>typeof S=="string"?{type:"text",text:S}:S&&S.image?{type:"image",src:S.image,alt:S.alt||"",title:S.title}:S,p=r.map((S,P)=>{const C=e.renderComponent({...b(S),key:void 0},P,`${n}-slide`),w={width:"100%",height:"100%",overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center"};return l==="fade"?(w.position="absolute",w.inset="0",w.opacity=P===i?1:0,w.transition="opacity .5s ease",w.pointerEvents=P===i?"auto":"none"):w.flexShrink=0,U("div",{key:`${n}-item-${P}`,style:w},C)}),x=l==="fade"?{position:"relative",width:"100%",height:"100%"}:{display:"flex",height:"100%",transition:"transform .5s ease",transform:`translateX(-${i*100}%)`},_={position:"absolute",top:"50%",transform:"translateY(-50%)",zIndex:2,width:"36px",height:"36px",borderRadius:"50%",border:"none",background:"rgba(0,0,0,0.45)",color:"#fff",fontSize:"18px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"};return U("div",{key:n,...g},U("div",{style:x},p),u&&U("div",{style:{..._,left:"8px"}},U("button",{style:{background:"transparent",border:"none",color:"inherit",fontSize:"18px",cursor:"pointer"},onClick:()=>h(i-1),"aria-label":"Previous slide"},"<")),u&&U("div",{style:{..._,right:"8px"}},U("button",{style:{background:"transparent",border:"none",color:"inherit",fontSize:"18px",cursor:"pointer"},onClick:()=>h(i+1),"aria-label":"Next slide"},">")),f&&U("div",{style:{position:"absolute",bottom:"10px",left:"50%",transform:"translateX(-50%)",display:"flex",gap:"6px",zIndex:2}},r.map((S,P)=>U("button",{key:`${n}-dot-${P}`,"aria-label":`Slide ${P+1}`,onClick:()=>h(P),style:{width:"10px",height:"10px",borderRadius:"50%",border:"none",cursor:"pointer",padding:0,background:P===i?"rgba(255,255,255,0.95)":"rgba(255,255,255,0.4)",transition:"background .3s ease"}}))))}function bft(e,t,n){const r=Array.isArray(t.items)?t.items:[],i=t.speed||20,o={overflow:"hidden",width:"100%",...t.className?e.parseClassName(t.className):{}},s=e.getCommonProps(n,o,t),a=l=>U("div",{key:l,style:{display:"inline-flex",alignItems:"center",gap:t.gap||"24px",paddingRight:t.gap||"24px",animation:`bf-marquee ${i}s linear infinite`,willChange:"transform",flexShrink:0}},r.map((h,u)=>{const f=typeof h=="string"?{type:"text",text:h}:h&&h.image?{type:"image",src:h.image,alt:h.alt||"",height:t.itemHeight||"48px"}:h;return e.renderComponent(f,u,`${l}-${n}-marq`)}));return U("div",{key:n,...s},U("div",{style:{display:"flex",width:"max-content"}},a("a"),a("b")))}function xft(e,t,n){const r=y.useRef(null),i=y.useRef(null),o=y.useRef(null),[s,a]=y.useState("idle"),[l,h]=y.useState(""),[u,f]=y.useState(!1),m=t.fieldName||"capture",g=t.captureMode==="qr",b=e.apiUrl||window.location.origin,p=t.uploadPath||"/api/files/upload",x=()=>{var z;(z=i.current)==null||z.getTracks().forEach(R=>R.stop()),i.current=null},_=async z=>{var F,W,Z;const R=new FormData;R.append("file",z,`${m}-${Date.now()}.jpg`);const D=await fetch(new URL(p,b).toString(),{method:"POST",headers:{Authorization:`Bearer ${localStorage.getItem("token")||""}`},body:R});if(!D.ok)throw new Error("Upload failed");const V=await D.json();return((F=V==null?void 0:V.file)==null?void 0:F.url)||((W=V==null?void 0:V.file)==null?void 0:W.publicUrl)||((Z=V==null?void 0:V.file)==null?void 0:Z.path)||(V==null?void 0:V.url)||(V==null?void 0:V.path)||""},S=async(z,R)=>{var D,V;if(s!=="done"){x();try{f(!0);const F=R||await _(z);e.setSceneData(W=>({...W,[m]:F})),h(F),a("done"),(D=e.showToast)==null||D.call(e,t.successMessage||(R?"Scanned!":"Captured & uploaded"),"success")}catch{a("error"),(V=e.showToast)==null||V.call(e,"Capture failed","error")}finally{f(!1)}}},P=()=>{var D;const z=r.current;if(!z||!z.videoWidth)return;const R=document.createElement("canvas");R.width=z.videoWidth,R.height=z.videoHeight,(D=R.getContext("2d"))==null||D.drawImage(z,0,0),R.toBlob(V=>V&&S(V),"image/jpeg",t.quality||.85)},C=async()=>{var z,R;try{const D=await navigator.mediaDevices.getUserMedia({video:{facingMode:t.facingMode||"user",...t.aspectRatio?{aspectRatio:Number(t.aspectRatio)}:{}},audio:!1});if(i.current=D,r.current&&(r.current.srcObject=D,await r.current.play().catch(()=>{})),a("running"),g){const F=window.BarcodeDetector;if(!F){a("error"),(z=e.showToast)==null||z.call(e,"QR scanning not supported in this browser","error");return}const W=new F;o.current=window.setInterval(async()=>{const Z=r.current;if(!(!Z||!Z.videoWidth||s==="done"))try{const q=await W.detect(Z);q!=null&&q.length&&S(new Blob,q[0].rawValue)}catch{}},400)}}catch{a("error"),(R=e.showToast)==null||R.call(e,"Camera access denied","error")}};y.useEffect(()=>(C(),()=>{o.current&&window.clearInterval(o.current),x()}),[]);const w={display:"flex",flexDirection:"column",alignItems:"center",gap:"12px",width:"100%",...t.className?e.parseClassName(t.className):{}},E=e.getCommonProps(n,w,t),k=U("video",{key:"cam-video",ref:r,autoPlay:!0,playsInline:!0,muted:!0,style:{width:"100%",maxWidth:t.maxWidth||"480px",borderRadius:"12px",aspectRatio:t.aspectRatio||"4 / 3",objectFit:"cover",background:"#0f172a",display:g||s!=="done"?void 0:"none"}}),I=l?U("img",{key:"cam-result",src:l,alt:"captured",style:{width:"100%",maxWidth:t.maxWidth||"480px",borderRadius:"12px",aspectRatio:t.aspectRatio||"4 / 3",objectFit:"cover",background:"#0f172a"}}):null,N=U("div",{key:"cam-actions",style:{display:"flex",gap:"10px",flexWrap:"wrap",justifyContent:"center"}},s!=="done"?U("button",{key:"cam-capture",onClick:P,disabled:u||s!=="running",style:{padding:"10px 22px",borderRadius:"9999px",border:"none",cursor:u?"wait":"pointer",background:"#3B82F6",color:"#fff",fontWeight:600}},u?"Uploading...":g?t.captureLabel||"Scan QR":t.captureLabel||"Capture"):U("button",{key:"cam-retake",onClick:()=>{h(""),a("idle"),C()},style:{padding:"10px 22px",borderRadius:"9999px",border:"1px solid #94a3b8",cursor:"pointer",background:"transparent"}},"Retake"));return U("div",{key:n,...E},k,I,t.captureLabel===!1?null:N,s==="error"?U("p",{key:"cam-err",style:{color:"#EF4444",fontSize:"13px"}},"Camera unavailable — check permissions"):null)}function wft(e,t,n){var i;if(t.className){const o=((i=e.parseClassNameResponsive)==null?void 0:i.call(e,t.className,n))??e.parseClassName(t.className),s=e.getCommonProps(n,o,t);return U("div",{key:n,className:t.className,...s})}const r=e.getCommonProps(n,{height:t.h||t.height||"24px"},t);return U("div",{key:n,...r})}function _ft(e,t,n){const r=t.className||"border-gray-700 my-4",i=e.parseClassName(r),o=e.getCommonProps(n,i,t);return U("hr",{key:n,className:r,...o})}function Sft(e,t,n){var u;const r=t.loaderVariant||"spinner",i=t.rows||3,o=t.className?((u=e.parseClassNameResponsive)==null?void 0:u.call(e,t.className,n))??e.parseClassName(t.className):{};t.rawStyle&&Object.assign(o,t.rawStyle);const s=e.getCommonProps(n,o,t),a=`${e.scopeId}-${n}`,l=e.renderMode==="css-driven"?{"data-bf-r":a}:{};if(r==="skeleton"){const f=[];for(let m=0;m<i;m++){const g=t.width||(m===i-1?"60%":"100%");f.push(U("div",{key:m,className:"bf-loader-skeleton",style:{height:t.height||"16px",width:g,borderRadius:"6px",marginBottom:m<i-1?"12px":"0"}}))}return U("div",{key:n,className:t.className,style:o,...s,...l},...f)}if(r==="shimmer"){const f=[];for(let m=0;m<i;m++){const g=t.width||(m===i-1?"60%":"100%");f.push(U("div",{key:m,className:"bf-loader-shimmer",style:{height:t.height||"16px",width:g,borderRadius:"6px",marginBottom:m<i-1?"12px":"0"}}))}return U("div",{key:n,className:t.className,style:o,...s,...l},...f)}if(r==="dots"){const f=t.color||"currentColor";return U("div",{key:n,className:t.className,style:{display:"flex",alignItems:"center",gap:"6px",...o},...s,...l},[0,1,2].map(m=>U("div",{key:m,className:"bf-loader-dot",style:{width:t.size||"8px",height:t.size||"8px",borderRadius:"50%",backgroundColor:f,animationDelay:`${m*.16}s`}})))}if(r==="pulse")return U("div",{key:n,className:t.className,style:{display:"flex",alignItems:"center",justifyContent:"center",...o},...s,...l},U("div",{className:"bf-loader-pulse",style:{width:t.size||"32px",height:t.size||"32px",borderRadius:"50%",border:`3px solid ${t.color||"currentColor"}`}}));if(r==="progress")return U("div",{key:n,className:t.className,style:{width:"100%",...o},...s,...l},U("div",{style:{height:t.height||"4px",width:"100%",backgroundColor:"rgba(128,128,128,0.2)",borderRadius:"4px",overflow:"hidden"}},U("div",{className:"bf-loader-progress-bar",style:{height:"100%",width:"30%",backgroundColor:t.color||"currentColor",borderRadius:"4px"}})));const h=t.size||"24px";return U("div",{key:n,className:t.className,style:{display:"flex",alignItems:"center",justifyContent:"center",...o},...s,...l},U("div",{className:"bf-loader-spinner",style:{width:h,height:h,border:`3px solid ${t.color?t.color+"33":"rgba(128,128,128,0.2)"}`,borderTopColor:t.color||"currentColor",borderRadius:"50%"}}))}function Pft(e,t,n){const r=t.rows||4;if(t.className){const s=e.parseClassName(t.className),a=e.getCommonProps(n,s,t);return U("textarea",{key:n,className:t.className,...a,name:t.name,placeholder:t.placeholder,rows:r})}const i={width:"100%",padding:"0.75rem 1rem",borderRadius:e.cfg.components.inputRadius,backgroundColor:e.cfg.colors.surface,color:e.cfg.colors.text,border:`1px solid ${e.cfg.colorMode==="light"?e.cfg.colors.border:"transparent"}`,outline:"none",transition:e.cfg.effects.transition,resize:"vertical",fontFamily:"inherit"},o=e.getCommonProps(n,i,t);if(t.label){const s=e.getCommonProps(n,{width:"100%"},t);return U("div",{key:n,...s},U("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,color:e.cfg.colors.textSecondary,marginBottom:"0.75rem"}},t.label),U("textarea",{...o,name:t.name,placeholder:t.placeholder,rows:r}))}return U("textarea",{key:n,...o,name:t.name,placeholder:t.placeholder,rows:r})}function Aft(e,t,n){const r=t.icon||t.name||"",i=t.size||24,o=e.renderIcon(r,i),s=t.tooltip?e.interpolateText(t.tooltip):void 0;if(t.className){const a=e.parseClassName(t.className),l=e.getCommonProps(n,a,t);return U("span",{key:n,className:t.className,title:s,...l},o)}return s?U("span",{key:n,title:s},o):y.cloneElement(o,{key:n})}function Eft(e,t,n){const r=t.metricSize||"md",i=r==="sm"?"1.25rem":r==="lg"?"2.5rem":"1.75rem",o=r==="sm"?"0.75rem":r==="lg"?"1rem":"0.875rem",s=t.color||e.cfg.colors.primary,a=t.trend==="up"?"↑":t.trend==="down"?"↓":"",l=t.trendColor||(t.trend==="up"?e.cfg.colors.success:t.trend==="down"?e.cfg.colors.danger:e.cfg.colors.textMuted),h={display:"flex",flexDirection:"column",gap:"2px",padding:t.padding!==void 0?`${t.padding}px`:"0.75rem",backgroundColor:e.cfg.colors.surface,borderRadius:e.cfg.layout.borderRadiusLg,border:`1px solid ${e.cfg.colors.borderSubtle}`,...t.className?e.parseClassName(t.className):{}},u=e.getCommonProps(n,h,t);return U("div",{key:n,...u},t.label&&U("span",{style:{fontSize:o,color:e.cfg.colors.textSecondary,fontWeight:500}},e.interpolateText(t.label)),y.createElement("div",{style:{display:"flex",alignItems:"baseline",gap:"6px",marginTop:"4px"}},t.prefix&&U("span",{style:{fontSize:i,fontWeight:700,color:s}},t.prefix),U("span",{style:{fontSize:i,fontWeight:700,color:e.cfg.colors.text}},typeof t.value=="number"?t.value.toLocaleString():e.interpolateText(String(t.value??""))),t.suffix&&U("span",{style:{fontSize:i,fontWeight:700,color:s}},t.suffix),t.delta&&U("span",{style:{fontSize:"0.75rem",fontWeight:600,color:l,marginLeft:"4px"}},`${a} ${t.delta}`)))}function Cft(e,t,n){const r=t.values??t.data??t.points;let i=[];if(Array.isArray(r))i=r.map(Number);else if(typeof r=="string"&&r.trim()){const f=r.trim();if(f.startsWith("["))try{i=JSON.parse(f).map(Number)}catch{}else i=f.split(",").map(m=>Number(String(m).trim()))}if(i=i.filter(f=>Number.isFinite(f)),i.length===0)return null;const o=t.labels??t.label;let s=[];Array.isArray(o)?s=o.map(f=>String(f)):typeof o=="string"&&o.trim()&&(s=o.split(",").map(f=>f.trim()));const a=Number(t.height)||28,l=t.color||e.cfg.colors.primary,h=Math.max(...i)||1,u=t.className||"";if(t.variant==="hbars"){const f=Number(t.barHeight)||12,m=Number(t.gap)||7,g=Math.max(1,Number(t.columns)||1);return U("div",{key:n,className:u,style:{display:g>1?"grid":"flex",flexDirection:g>1?void 0:"column",gridTemplateColumns:g>1?`repeat(${g}, minmax(0, 1fr))`:void 0,gap:m,width:"100%",...u?e.parseClassName(u):{}}},...i.map((b,p)=>U("div",{key:p,style:{display:"flex",alignItems:"center",gap:"8px",width:"100%"}},U("span",{style:{flex:"0 0 auto",minWidth:(Number(t.labelWidth)||84)+"px",fontSize:"11px",color:e.cfg.colors.textMuted,textTransform:"capitalize"}},s[p]||""),U("div",{style:{flex:"1 1 auto",height:f,background:e.cfg.colors.surfaceHover||e.cfg.colors.borderSubtle||"rgba(0,0,0,0.06)",borderRadius:"6px",overflow:"hidden"}},U("div",{style:{width:Math.max(2,Math.round(b/h*100))+"%",height:"100%",background:l,borderRadius:"6px"}})),U("span",{style:{flex:"0 0 auto",minWidth:"36px",textAlign:"right",fontSize:"11px",fontWeight:600,color:e.cfg.colors.text}},String(b)))))}if(t.variant==="line"){const m=i.map((g,b)=>{const p=i.length>1?b/(i.length-1)*100:0,x=a-g/h*a;return`${p.toFixed(2)},${x.toFixed(2)}`}).join(" ");return U("svg",{key:n,viewBox:`0 0 100 ${a}`,preserveAspectRatio:"none",className:u,style:{width:"100%",height:a,display:"block",...u?e.parseClassName(u):{}}},U("polyline",{points:m,fill:"none",stroke:l,strokeWidth:2,vectorEffect:"non-scaling-stroke",strokeLinejoin:"round",strokeLinecap:"round"}))}return U("div",{key:n,className:u,style:{display:"flex",alignItems:"flex-end",gap:"2px",height:a,width:"100%",...u?e.parseClassName(u):{}}},...i.map((f,m)=>U("div",{key:m,style:{flex:"1 1 0",minWidth:"2px",maxWidth:Number(t.maxBarWidth)||18,height:Math.max(2,Math.round(f/h*a)),background:l,borderRadius:"2px",opacity:t.dimZero&&f===0?.25:1}})))}function $I(e,t,n){var r,i,o,s;if(Array.isArray(t.chartData))return t.chartData;if(typeof t.chartData=="string"){const a=t.chartData.trim().match(/^\{\{\s*([\w.]+)\s*\}\}$/);if(a){const l=(r=e.resolveReferencePath)==null?void 0:r.call(e,a[1]);if(Array.isArray(l))return l}}if(Array.isArray(t.data))return t.data;if(t.dataSource){const a=(t.key!=null?(i=e.listData)==null?void 0:i[String(t.key)]:void 0)??((o=e.listData)==null?void 0:o[n])??((s=e.listData)==null?void 0:s[String(t.dataSource)]);if(Array.isArray(a))return a;if(a&&Array.isArray(a.data))return a.data}return[]}function Tft(e,t,n){const r=$I(e,t,n);if(!Array.isArray(r)||r.length===0)return null;const i=Number(t.height)||200,o=t.barColor||e.cfg.colors.primary,s=t.horizontal===!0,a={width:"100%",padding:t.padding!==void 0?`${t.padding}px`:"0.75rem",backgroundColor:e.cfg.colors.surface,borderRadius:e.cfg.layout.borderRadiusLg,border:`1px solid ${e.cfg.colors.borderSubtle}`,...t.className?e.parseClassName(t.className):{}},l=s?{type:"number",axisLine:!1,tickLine:!1}:{dataKey:"label",axisLine:!1,tickLine:!1,tick:{fill:e.cfg.colors.textMuted,fontSize:12}},h=s?{dataKey:"label",type:"category",axisLine:!1,tickLine:!1,width:88,tick:{fill:e.cfg.colors.textMuted,fontSize:12}}:{axisLine:!1,tickLine:!1,width:36},u=y.createElement(ig,{width:"100%",height:i},y.createElement(Ght,{data:r,layout:s?"vertical":"horizontal"},y.createElement(Cg,{vertical:!s,stroke:e.cfg.colors.borderSubtle,strokeDasharray:"3 3"}),y.createElement(ta,l),y.createElement(ea,h),y.createElement(ei,{cursor:{fill:t.cursorColor||e.cfg.colors.surfaceHover,fillOpacity:t.cursorOpacity??.5},content:y.createElement(II,{prefix:t.tooltipPrefix,labelText:t.tooltipLabel,lineColor:o,backgroundColor:e.cfg.colors.surface,textColor:e.cfg.colors.text,borderColor:e.cfg.colors.borderSubtle})}),y.createElement(gl,{dataKey:"value",fill:o,radius:s?[0,4,4,0]:[4,4,0,0],isAnimationActive:t.chartAnimation!==!1,animationDuration:Number(t.animationDuration)||750})));return U("div",{key:n,style:e.getCommonProps(n,a,t)},t.title&&U("div",{style:{marginBottom:"0.75rem"}},t.title),u)}function jC(e,t,n,r=!1){const i=$I(e,t,n);if(!Array.isArray(i)||i.length===0)return null;const o=Number(t.height)||240,s=Array.isArray(t.colors)&&t.colors.length?t.colors:[e.cfg.colors.primary,e.cfg.colors.accent,"#317150","#d95020","#638173"],a={width:"100%",padding:t.padding!==void 0?`${t.padding}px`:"0.75rem",backgroundColor:e.cfg.colors.surface,borderRadius:e.cfg.layout.borderRadiusLg,border:`1px solid ${e.cfg.colors.borderSubtle}`,...t.className?e.parseClassName(t.className):{}};return U("div",{key:n,style:e.getCommonProps(n,a,t)},t.title&&U("div",{style:{marginBottom:"0.75rem"}},t.title),y.createElement(ig,{width:"100%",height:o},y.createElement(Yht,null,y.createElement(ei,{contentStyle:{borderRadius:6,border:`1px solid ${e.cfg.colors.borderSubtle}`}}),t.showLegend!==!1&&y.createElement(Ga,{iconType:"circle",wrapperStyle:{fontSize:12}}),y.createElement(Yo,{data:i,dataKey:"value",nameKey:"label",cx:"50%",cy:"50%",innerRadius:r?"55%":0,outerRadius:"80%",paddingAngle:2,isAnimationActive:t.chartAnimation!==!1,animationDuration:Number(t.animationDuration)||750},...i.map((l,h)=>y.createElement(Ef,{key:`${l.label||h}-${h}`,fill:l.color||s[h%s.length]}))))))}function Mft(e,t,n){const r=t.chartData||t.data||[];if(!Array.isArray(r)||r.length===0)return null;const i=Number(t.height)||260,o=t.xKey||"x",s=t.yKey||"y",a=t.zKey||"size",l={width:"100%",padding:t.padding!==void 0?`${t.padding}px`:"0.75rem",backgroundColor:e.cfg.colors.surface,borderRadius:e.cfg.layout.borderRadiusLg,border:`1px solid ${e.cfg.colors.borderSubtle}`,...t.className?e.parseClassName(t.className):{}};return U("div",{key:n,style:e.getCommonProps(n,l,t)},t.title&&U("div",{style:{marginBottom:"0.75rem"}},t.title),y.createElement(ig,{width:"100%",height:i},y.createElement(Zht,{margin:{top:16,right:12,bottom:8,left:0}},y.createElement(Cg,{stroke:e.cfg.colors.borderSubtle,strokeDasharray:"3 3"}),y.createElement(ta,{dataKey:o,type:"number",axisLine:!1,tickLine:!1}),y.createElement(ea,{dataKey:s,type:"number",axisLine:!1,tickLine:!1}),y.createElement($f,{dataKey:a,range:t.zRange||[50,360]}),y.createElement(ei,{contentStyle:{borderRadius:6,border:`1px solid ${e.cfg.colors.borderSubtle}`}}),y.createElement(If,{data:r,fill:t.color||e.cfg.colors.primary,isAnimationActive:t.chartAnimation!==!1,animationDuration:Number(t.animationDuration)||750}))))}function II({active:e,payload:t,label:n,prefix:r,labelText:i,lineColor:o,backgroundColor:s,textColor:a,borderColor:l}){var u;const h=Number((u=t==null?void 0:t[0])==null?void 0:u.value);return!e||!Number.isFinite(h)?null:y.createElement("div",{style:{padding:10,border:`1px solid ${l}`,borderRadius:6,backgroundColor:s,boxShadow:"0 8px 24px rgba(0, 0, 0, 0.16)",color:a}},y.createElement("p",{style:{margin:0,fontSize:14}},n),y.createElement("p",{style:{margin:"8px 0 0",color:o,fontSize:14}},`${i||"Indicative price / kg"}: ${r||""}${h.toLocaleString()}`))}function Oft({api:e,c:t,data:n,height:r,lineColor:i,fillColor:o,filled:s}){return y.createElement(ig,{width:"100%",height:r},y.createElement(Kht,{data:n,margin:{top:16,right:8,left:0,bottom:0}},t.showGrid!==!1&&y.createElement(Cg,{vertical:!1,stroke:"#dce4dc",strokeDasharray:"3 3"}),y.createElement(ta,{dataKey:"label",axisLine:!1,tickLine:!1,height:30,tick:{fill:"#638173",fontSize:12}}),y.createElement(ea,{axisLine:!1,tickLine:!1,width:40,tickCount:5,domain:[0,"auto"],tick:{fill:"#638173",fontSize:12},tickFormatter:a=>`${t.tooltipPrefix||""}${Number(a/1e3).toFixed(1).replace(".0","")}k`}),y.createElement(ei,{cursor:{stroke:"#638173",strokeDasharray:"3 3"},content:y.createElement(II,{prefix:t.tooltipPrefix,labelText:t.tooltipLabel,lineColor:i,backgroundColor:e.cfg.colors.surface,textColor:e.cfg.colors.text,borderColor:e.cfg.colors.borderSubtle})}),y.createElement(Qs,{type:"monotone",dataKey:"value",stroke:i,fill:s?o:"transparent",strokeWidth:3,dot:!1,activeDot:{r:6,fill:i,stroke:e.cfg.colors.surface,strokeWidth:3},isAnimationActive:t.chartAnimation!==!1,animationDuration:Number(t.animationDuration)||750})))}function fv(e,t,n,r=!1,i=!1){const o=Array.isArray(t.chartData)?t.chartData:[];if(o.length===0)return null;const s=o.flatMap(x=>i?[x.low,x.high]:[x.value]).map(Number).filter(Number.isFinite);if(s.length===0)return null;const a=Math.min(...s),h=Math.max(...s)-a||1,u=Number(t.height)||220,f=x=>u-(x-a)/h*u,m=t.lineColor||e.cfg.colors.accent,g=t.fillColor||`${m}33`,b={width:"100%",padding:"0.75rem",backgroundColor:e.cfg.colors.surface,borderRadius:e.cfg.layout.borderRadiusLg,border:`1px solid ${e.cfg.colors.borderSubtle}`,...t.className?e.parseClassName(t.className):{}},p=i?o.map((x,_)=>{const S=Number(x.open),P=Number(x.close),C=Number(x.high),w=Number(x.low),E=P>=S;return U("div",{key:_,style:{flex:1,height:"100%",position:"relative"}},U("div",{style:{position:"absolute",left:"50%",top:`${f(C)}px`,height:`${Math.max(1,f(w)-f(C))}px`,borderLeft:`1px solid ${E?"#22c55e":"#ef4444"}`}}),U("div",{style:{position:"absolute",left:"25%",right:"25%",top:`${f(Math.max(S,P))}px`,height:`${Math.max(3,Math.abs(f(P)-f(S)))}px`,background:E?"#22c55e":"#ef4444",borderRadius:"2px"}}))}):y.createElement(Oft,{api:e,c:t,data:o,height:u,lineColor:m,fillColor:g,filled:r});return U("div",{key:n,style:e.getCommonProps(n,b,t)},t.title&&U("div",{style:{color:e.cfg.colors.textSecondary,fontWeight:600,marginBottom:"0.75rem"}},t.title),U("div",{style:{display:"flex",alignItems:"stretch",gap:i?"4px":void 0,height:u}},p),i&&U("div",{style:{display:"flex",justifyContent:"space-between",color:e.cfg.colors.textMuted,fontSize:"0.7rem",marginTop:"4px"}},...o.map((x,_)=>U("span",{key:_},x.label||""))))}function kft(e,t,n){const r=Array.isArray(t.chartData)?t.chartData[0]||{}:{},i=t.ticker||r.ticker||r.symbol||"EUR/USD",o=t.bid??r.bid??r.price,s=t.ask??r.ask,a=t.change??r.change,l=Number(a),h=Number.isFinite(l)&&l>=0,u=e.getCommonProps(n,{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"1rem",width:"100%",padding:"0.9rem 1rem",backgroundColor:e.cfg.colors.surface,border:`1px solid ${e.cfg.colors.borderSubtle}`,borderRadius:e.cfg.layout.borderRadiusLg,...t.className?e.parseClassName(t.className):{}},t);return U("div",{key:n,...u},U("div",{},U("div",{style:{color:e.cfg.colors.text,fontWeight:700}},i),t.label&&U("div",{style:{color:e.cfg.colors.textMuted,fontSize:"0.75rem"}},t.label)),U("div",{style:{display:"flex",gap:"1rem",alignItems:"baseline",fontVariantNumeric:"tabular-nums"}},o!=null&&U("span",{style:{color:e.cfg.colors.text,fontWeight:700}},String(o)),s!=null&&U("span",{style:{color:e.cfg.colors.textSecondary}},String(s)),a!=null&&U("span",{style:{color:h?"#22c55e":"#ef4444",fontSize:"0.8rem",fontWeight:600}},`${h?"+":""}${a}`)))}function $ft({api:e,c:t,componentKey:n}){var x,_,S,P;const r=y.useRef(null),i=y.useRef(null),o=y.useRef(null),[s,a]=y.useState(null),l=y.useRef(null),[h,u]=y.useState(()=>Array.isArray(t.chartData)?t.chartData:[]);y.useEffect(()=>{Array.isArray(t.chartData)&&u(t.chartData)},[t.chartData]);const f=e.interpolateText(((x=t.realtime)==null?void 0:x.channel)||""),m=e.interpolateText(((_=t.timeRange)==null?void 0:_.from)||""),g=e.interpolateText(((S=t.timeRange)==null?void 0:S.to)||""),b=Array.isArray(t.timeframes)?t.timeframes:[];y.useEffect(()=>{var k,I;const C=e.sdk;if(!(((k=t.realtime)==null?void 0:k.mode)==="ws"&&e.isAuthenticated&&f&&((I=C==null?void 0:C.client)==null?void 0:I.createWebSocket)))return;const E=C.client.createWebSocket(f);return E.onmessage=N=>{var z;try{const R=typeof N.data=="string"?JSON.parse(N.data):N.data,D=(R==null?void 0:R.tick)||((z=R==null?void 0:R.data)==null?void 0:z.tick)||(R==null?void 0:R.data)||R,V=Number((D==null?void 0:D.quote)??(D==null?void 0:D.price)??(D==null?void 0:D.close));if(!Number.isFinite(V))return;const F=Number((D==null?void 0:D.epoch)??(D==null?void 0:D.timestamp)??Date.now()/1e3),W=Math.floor(F/60)*60;u(Z=>{const q=Z[Z.length-1];if((q==null?void 0:q.time)===W)return[...Z.slice(0,-1),{...q,high:Math.max(Number(q.high),V),low:Math.min(Number(q.low),V),close:V}];const tt=Number((q==null?void 0:q.close)??V);return[...Z.slice(-99),{time:W,open:tt,high:V,low:V,close:V}]})}catch{}},()=>{var N;return(N=E.close)==null?void 0:N.call(E)}},[e.isAuthenticated,(P=t.realtime)==null?void 0:P.mode,f]);const p=y.useMemo(()=>h.map((C,w)=>{const E=C.time||C.timestamp;return{time:typeof E=="string"&&E.includes("T")?Math.floor(new Date(E).getTime()/1e3):E||`2024-01-${String(w+1).padStart(2,"0")}`,...t.chartType==="candlestick"?{open:Number(C.open),high:Number(C.high),low:Number(C.low),close:Number(C.close)}:{value:Number(C.value??C.close)}}}),[t.chartType,h]);return l.current=p[p.length-1],y.useEffect(()=>{const C=r.current;if(!C)return;const w=LF(C,{autoSize:!0,height:Number(t.height)||280,layout:{background:{color:"transparent"},textColor:e.cfg.colors.textSecondary},grid:{vertLines:{color:e.cfg.colors.borderSubtle},horzLines:{color:e.cfg.colors.borderSubtle}},rightPriceScale:{borderColor:e.cfg.colors.borderSubtle},timeScale:{borderColor:e.cfg.colors.borderSubtle,timeVisible:!0}}),E=t.chartType||"candlestick",k=E==="line"?w.addSeries(VF,{color:t.lineColor||e.cfg.colors.accent}):E==="area"?w.addSeries(XF,{lineColor:t.lineColor||e.cfg.colors.accent,topColor:t.fillColor||`${e.cfg.colors.accent}66`,bottomColor:"transparent"}):w.addSeries(e3,{upColor:"#22c55e",downColor:"#ef4444",borderVisible:!1,wickUpColor:"#22c55e",wickDownColor:"#ef4444"});return o.current=w,i.current=k,()=>{i.current=null,o.current=null,w.remove()}},[e.cfg.colors.accent,e.cfg.colors.borderSubtle,e.cfg.colors.textSecondary,t.chartType,t.height,t.lineColor,t.fillColor]),y.useEffect(()=>{var C,w;!i.current||p.length===0||(i.current.setData(p),m&&g?(C=o.current)==null||C.timeScale().setVisibleRange({from:m,to:g}):(w=o.current)!=null&&w.timeScale().getVisibleLogicalRange()||o.current.timeScale().fitContent())},[p,m,g]),y.useEffect(()=>{if(!s||!o.current||!l.current)return;const C={"1H":3600,"4H":14400,"1D":86400,"1W":604800}[s],w=Number(l.current.time);C&&Number.isFinite(w)&&o.current.timeScale().setVisibleRange({from:w-C,to:w})},[s]),U("div",{key:n,style:{width:"100%",padding:"0.75rem",backgroundColor:e.cfg.colors.surface,borderRadius:e.cfg.layout.borderRadiusLg,border:`1px solid ${e.cfg.colors.borderSubtle}`,...t.className?e.parseClassName(t.className):{}}},b.length>0&&U("div",{style:{display:"flex",gap:"0.35rem",marginBottom:"0.5rem"}},...b.map(C=>U("button",{key:C,type:"button",onClick:()=>a(C),style:{padding:"0.3rem 0.6rem",border:`1px solid ${e.cfg.colors.borderSubtle}`,borderRadius:4,color:e.cfg.colors.text,background:s===C?e.cfg.colors.surfaceHover:"transparent",cursor:"pointer"}},C))),U("div",{ref:r,style:{width:"100%",height:Number(t.height)||280}}))}function Ift(e,t,n){return y.createElement($ft,{api:e,c:t,componentKey:n})}function Nft(e,t,n){const r=t.json||t.data||t.diagram||{},i=e.getCommonProps(n,{display:"flex",flexDirection:"column",minHeight:"300px"},t);return U("div",{key:n,className:t.className,...i},y.createElement("pre",{style:{fontSize:"12px",whiteSpace:"pre-wrap",margin:0}},typeof r=="string"?r:JSON.stringify(r,null,2)))}function Rft({api:e,c:t,componentKey:n}){const r=t.data||t.json||t.diagram||{},{_config:i,...o}=r||{},s=Object.keys(o).length?o:r,{nodes:a,edges:l}=y.useMemo(()=>t_.createFlowDiagram(s),[s]),[h,u]=y.useState("LR"),f=e.cfg.fullscreen===!0,m=t.height||(f?"100%":320),g=e.getCommonProps(n,{width:"100%",height:m,...f?{minHeight:0}:{}},t);return U("div",{key:n,className:t.className,...g},y.createElement(t_.FlowDiagram,{nodes:a,edges:l,config:{direction:h,layout:(i==null?void 0:i.layout)||"dagre",colorMode:(i==null?void 0:i.colorMode)||(e.cfg.colorMode==="dark"?"dark":"light"),backgroundPattern:(i==null?void 0:i.backgroundPattern)||"dot"},callbacks:{onDirectionChange:b=>u(b)},showBottomBar:(i==null?void 0:i.showBottomBar)||!1,style:{width:"100%",height:"100%"}}))}function Lft(e,t,n){return y.createElement(Rft,{api:e,c:t,componentKey:n})}function Dft(e,t,n){var r;if(t.className){const i=((r=e.parseClassNameResponsive)==null?void 0:r.call(e,t.className,n))??e.parseClassName(t.className);i.display==null&&(i.display="flex"),i.flexDirection==null&&(i.flexDirection=/(^|\s)flex(\s|$)/.test(t.className||"")||t.layout==="row"?"row":"column");const o=e.getCommonProps(n,i,t);return y.createElement("div",{key:n,className:t.className,...o},(Array.isArray(t.children)?t.children:[]).map((s,a)=>e.renderComponent(s,a,n)))}return null}const jft=y.memo(({api:e,field:t,fieldName:n,value:r,onChange:i})=>{y.useEffect(()=>{r!==void 0&&r!==""&&i&&i(r)},[]);const o=y.useRef(null),[s,a]=y.useState(!1),l=y.useRef(null),h=y.useRef(null),[u,f]=y.useState(!1),[m,g]=y.useState(""),[b,p]=y.useState(!1),x=t.html!==!1,_=S=>x?S:S.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/\n/g,"<br>");return y.useEffect(()=>{o.current&&!o.current.innerHTML&&(o.current.innerHTML=_(r))},[]),y.useEffect(()=>{o.current&&document.activeElement!==o.current&&o.current.innerHTML!==r&&(o.current.innerHTML=_(r))},[r]),y.createElement("div",{style:{width:"100%",marginBottom:"1rem"}},t.label?U("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,color:e.cfg.colors.textSecondary,marginBottom:"0.75rem"}},t.label):null,y.createElement("div",{style:{border:`1px solid ${s?e.cfg.colors.primary:e.cfg.colors.border}`,borderRadius:e.cfg.components.inputRadius,overflow:"hidden",transition:"border-color 0.2s",position:"relative"}},y.createElement("div",{style:{display:"flex",gap:"4px",padding:"6px 8px",borderBottom:`1px solid ${e.cfg.colors.border}`,backgroundColor:e.cfg.colors.surface}},...[{cmd:"bold",label:"B"},{cmd:"italic",label:"I"},{cmd:"underline",label:"U"}].map(S=>U("button",{key:S.cmd,type:"button",onMouseDown:P=>{var C;P.preventDefault(),document.execCommand(S.cmd,!1),(C=o.current)==null||C.focus()},style:{padding:"2px 8px",borderRadius:"4px",border:"1px solid transparent",cursor:"pointer",backgroundColor:"transparent",color:e.cfg.colors.text,fontWeight:600,fontSize:"13px"},onMouseEnter:P=>P.target.style.borderColor=e.cfg.colors.border,onMouseLeave:P=>P.target.style.borderColor="transparent"},S.label)),U("span",{key:"spacer",style:{flex:1}}),U("button",{key:"list-btn",type:"button",onMouseDown:S=>{var P;S.preventDefault(),document.execCommand("insertUnorderedList",!1),(P=o.current)==null||P.focus()},style:{padding:"2px 8px",borderRadius:"4px",border:"1px solid transparent",cursor:"pointer",backgroundColor:"transparent",color:e.cfg.colors.text,fontSize:"13px"},onMouseEnter:S=>S.target.style.borderColor=e.cfg.colors.border,onMouseLeave:S=>S.target.style.borderColor="transparent"},"☰"),U("span",{key:"divider",style:{width:"1px",height:"16px",backgroundColor:e.cfg.colors.border,margin:"0 4px",alignSelf:"center"}}),U("button",{key:"img-btn",type:"button",onMouseDown:S=>{var P;S.preventDefault(),(P=l.current)==null||P.click()},style:{padding:"2px 6px",borderRadius:"4px",border:"1px solid transparent",cursor:"pointer",backgroundColor:"transparent",color:e.cfg.colors.text,fontSize:"13px",display:"inline-flex",alignItems:"center",justifyContent:"center"},onMouseEnter:S=>S.target.style.borderColor=e.cfg.colors.border,onMouseLeave:S=>S.target.style.borderColor="transparent"},e.renderIcon("image",14)),U("button",{key:"att-btn",type:"button",onMouseDown:S=>{var P;S.preventDefault(),(P=h.current)==null||P.click()},style:{padding:"2px 6px",borderRadius:"4px",border:"1px solid transparent",cursor:"pointer",backgroundColor:"transparent",color:e.cfg.colors.text,fontSize:"13px",display:"inline-flex",alignItems:"center",justifyContent:"center"},onMouseEnter:S=>S.target.style.borderColor=e.cfg.colors.border,onMouseLeave:S=>S.target.style.borderColor="transparent"},e.renderIcon("paperclip",14)),U("button",{key:"ai-btn",type:"button",onMouseDown:S=>{S.preventDefault(),f(!u)},style:{padding:"2px 6px",borderRadius:"4px",border:"1px solid transparent",cursor:"pointer",backgroundColor:u?e.cfg.colors.border:"transparent",color:e.cfg.colors.text,fontSize:"13px",display:"inline-flex",alignItems:"center",justifyContent:"center"},onMouseEnter:S=>S.target.style.borderColor=e.cfg.colors.border,onMouseLeave:S=>S.target.style.borderColor="transparent"},e.renderIcon("sparkles",14))),U("div",{ref:o,contentEditable:!0,suppressContentEditableWarning:!0,onInput:S=>i(S.currentTarget.innerHTML),onFocus:()=>a(!0),onBlur:()=>a(!1),style:{minHeight:(t.rows||10)*20+"px",padding:"0.75rem 1rem",backgroundColor:e.cfg.colors.surface,color:e.cfg.colors.text,outline:"none",fontSize:"0.875rem",lineHeight:"1.6"}}),t.expandAction?y.createElement("button",{type:"button",key:"expand",style:{position:"absolute",bottom:"6px",left:"6px",background:"rgba(0,0,0,0.55)",border:`1px solid ${e.cfg.colorMode==="light"?e.cfg.colors.border:"transparent"}`,borderRadius:"4px",cursor:"pointer",color:e.cfg.colors.textMuted,padding:"3px 5px",display:"flex",alignItems:"center",justifyContent:"center",opacity:.5,transition:"opacity 0.2s",zIndex:1},onMouseEnter:S=>{S.currentTarget.style.opacity="0.85"},onMouseLeave:S=>{S.currentTarget.style.opacity="0.5"},onClick:S=>{S.preventDefault(),S.stopPropagation(),e.handleButtonClick(t.expandAction,{})}},e.renderIcon("maximize-2",13)):null,U("input",{key:"img-input",ref:l,type:"file",accept:"image/*",style:{display:"none"},onChange:async S=>{var C,w,E,k,I,N;const P=(C=S.target.files)==null?void 0:C[0];if(P){try{const z=(w=e.showToast)==null?void 0:w.call(e,"Uploading image (0%)…","success",0),R=e.uploadFile?await e.uploadFile(P,t.upload,D=>{var V;return(V=z==null?void 0:z.update)==null?void 0:V.call(z,`Uploading image (${D}%)`)}):"";if((E=z==null?void 0:z.dismiss)==null||E.call(z),!R)throw Error();(k=o.current)==null||k.focus(),document.execCommand("insertImage",!1,R),i(((I=o.current)==null?void 0:I.innerHTML)||"")}catch{(N=e.showToast)==null||N.call(e,"Failed to upload image","error")}S.target.value=""}}}),U("input",{key:"att-input",ref:h,type:"file",multiple:!0,style:{display:"none"},onChange:async S=>{var k,I,N,z,R;const P=Array.from(S.target.files||[]);S.target.value="";const C=[];let w=0;const E=(k=e.showToast)==null?void 0:k.call(e,`Uploading 0/${P.length}…`,"success",0);for(const D of P){try{const V=e.uploadFile?await e.uploadFile(D,t.upload,F=>{var W;return(W=E==null?void 0:E.update)==null?void 0:W.call(E,`Uploading ${D.name} (${F}%)`)}):"";if(!V)throw Error();C.push(`<a href="${V}">${D.name}</a>`)}catch{(I=e.showToast)==null||I.call(e,`Failed to upload ${D.name}`,"error")}w++,(N=E==null?void 0:E.update)==null||N.call(E,`Uploading ${w}/${P.length}…`)}if((z=E==null?void 0:E.dismiss)==null||z.call(E),C.length>0&&o.current){o.current.focus();const D=window.getSelection();if(D){D.removeAllRanges();const V=document.createRange();V.selectNodeContents(o.current),V.collapse(!1),D.addRange(V)}document.execCommand("insertHTML",!1,`<br><br>${C.join(", ")}`),i(((R=o.current)==null?void 0:R.innerHTML)||"")}}}),u?U("div",{key:"ai-popup",style:{position:"absolute",bottom:"100%",left:"8px",right:"8px",backgroundColor:e.cfg.colors.surfaceHover,border:`1px solid ${e.cfg.colors.borderSubtle}`,borderRadius:"8px",padding:"12px",zIndex:10,boxShadow:"0 -4px 24px rgba(0,0,0,0.4)"}},U("textarea",{value:m,onChange:S=>g(S.target.value),placeholder:"Ask AI to draft a reply...",rows:3,style:{width:"100%",padding:"8px 12px",borderRadius:"4px",border:`1px solid ${e.cfg.colors.borderSubtle}`,backgroundColor:e.cfg.colors.surface,color:e.cfg.colors.text,fontSize:"13px",outline:"none",fontFamily:"inherit",resize:"none",boxSizing:"border-box"}}),U("div",{style:{display:"flex",gap:"8px",justifyContent:"flex-end",marginTop:"8px"}},U("button",{type:"button",onClick:()=>{f(!1),g("")},style:{padding:"6px 14px",borderRadius:"6px",border:`1px solid ${e.cfg.colors.borderSubtle}`,cursor:"pointer",backgroundColor:"transparent",color:e.cfg.colors.textMuted,fontSize:"12px",fontFamily:"inherit"}},"Cancel"),U("button",{type:"button",disabled:b||!m.trim(),onClick:async()=>{var S,P,C,w;if(!(!m.trim()||b)){p(!0);try{const E=((S=o.current)==null?void 0:S.innerHTML)||"",k=await fetch("/api/tenant/email/ai/complete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:m,context:E})});if(!k.ok)throw Error();const I=await k.json(),N=I.response||I.text||I.content||"";(P=o.current)==null||P.focus(),document.execCommand("insertText",!1,N),i(((C=o.current)==null?void 0:C.innerHTML)||""),f(!1),g("")}catch{(w=e.showToast)==null||w.call(e,"AI request failed","error")}p(!1)}},style:{padding:"6px 14px",borderRadius:"6px",border:"none",cursor:b||!m.trim()?"not-allowed":"pointer",backgroundColor:b||!m.trim()?e.cfg.colors.surfaceHover:e.cfg.colors.background,color:b||!m.trim()?e.cfg.colors.textSecondary:e.cfg.colors.text,fontSize:"12px",fontWeight:600,fontFamily:"inherit"}},b?"Thinking...":"Generate"))):null))}),Bft=y.memo(({api:e,c:t,componentKey:n})=>{const[r,i]=y.useState(!1),o=y.useRef(null),[s,a]=y.useState([]),l=t.name?`bf_persist_${t.name}`:null;y.useEffect(()=>{t.dataSource&&(async()=>{var f;try{const m=e.interpolateText(t.dataSource),g=(f=e.selectDynamicOptions)==null?void 0:f[m];if(g&&g.length>0){a(g);return}Ls[m]||(Ls[m]=(async()=>{var p;try{const x=await fetch(m,{headers:{Authorization:`Bearer ${localStorage.getItem("token")||""}`}});if(!x.ok)return[];const _=await x.json(),S=t.dataField||"configs",P=t.optionLabel||"label",C=t.optionValue||"value",w=_[S]||_.data||_,E=Array.isArray(w)?w.map(k=>({label:k[P]||k.name||k.label,value:k[C]||k.id||k.name||k.label})):[];return(p=e.setSelectDynamicOptions)==null||p.call(e,k=>({...k,[m]:E})),E}catch{return delete Ls[m],[]}})());const b=await Ls[m];b.length>0&&a(b)}catch{}})()},[t.dataSource]),y.useEffect(()=>{if(l&&t.name&&!e.sceneData[t.name]){const m=localStorage.getItem(l);m&&e.setSceneData(g=>({...g,[t.name]:m}))}},[l,t.name,e.sceneData[t.name]]),y.useEffect(()=>{if(!r)return;const f=g=>{o.current&&!o.current.contains(g.target)&&i(!1)},m=setTimeout(()=>{document.addEventListener("mousedown",f)},0);return()=>{clearTimeout(m),document.removeEventListener("mousedown",f)}},[r]);const h=t.variant==="selector",u=Array.isArray(t.items)?t.items:s;if(h){const f=t.name&&(e.sceneData[t.name||""]||l&&localStorage.getItem(l))||"",m=f||t.placeholder||"Select...";return U("div",{ref:o,style:{position:"relative",display:"inline-flex"}},y.createElement("button",{type:"button",style:{display:"inline-flex",alignItems:"center",gap:"6px",background:"none",border:"none",cursor:"pointer",fontFamily:"inherit",fontSize:t.fontSize||"1rem",fontWeight:t.fontWeight||600,color:t.color||e.cfg.colors.text,padding:"2px 0",outline:"none",lineHeight:"1.5"},onClick:g=>{g.preventDefault(),i(!r)}},U("span",{key:"text"},m),U("span",{key:"caret",style:{display:"flex",alignItems:"center",opacity:.6,marginLeft:"2px"}},e.renderIcon("chevron-down",14))),r?y.createElement("div",{style:{position:"absolute",top:"100%",left:"0",marginTop:"4px",backgroundColor:e.cfg.colors.surfaceHover,border:`1px solid ${e.cfg.colors.borderSubtle}`,borderRadius:"8px",boxShadow:"0 8px 24px rgba(0,0,0,0.4)",zIndex:9999,overflow:"hidden",minWidth:"200px"}},...u.map((g,b)=>y.createElement("button",{key:b,type:"button",style:{display:"flex",alignItems:"center",gap:"8px",width:"100%",padding:"10px 16px",backgroundColor:"transparent",color:e.cfg.colors.text,border:"none",cursor:"pointer",fontSize:"14px",textAlign:"left",fontFamily:"inherit",transition:"background-color 0.15s ease",outline:"none",whiteSpace:"nowrap"},onMouseEnter:p=>{p.currentTarget.style.backgroundColor=e.cfg.colors.borderSubtle},onMouseLeave:p=>{p.currentTarget.style.backgroundColor="transparent"},onClick:p=>{p.preventDefault(),p.stopPropagation(),i(!1),t.name&&g.value!==f&&e.setSceneData(x=>({...x,[t.name]:g.value}))}},g.label||""))):null)}return y.createElement("div",{ref:o,style:{position:"relative",display:"flex",width:"100%"}},(()=>{var g;const f=!!((g=e.buttonLoading)!=null&&g[n]),m=[];return f?m.push(U("span",{key:"spinner",className:"bf-btn-spinner",style:{width:"14px",height:"14px",border:"2px solid currentColor",borderTopColor:"transparent",borderRadius:"50%",flexShrink:0}})):t.icon&&m.push(U("span",{key:"icon",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,marginRight:"6px"}},e.renderIcon(t.icon,t.iconSize||16))),m.push(U("span",{key:"text",style:{lineHeight:"1"}},t.text||"Button")),y.createElement("button",{type:"button",style:{flex:1,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"8px",padding:"0.75rem 1.5rem",backgroundColor:e.cfg.colorMode==="light"?e.cfg.colors.primary:"transparent",color:e.cfg.colorMode==="light"?"#ffffff":e.cfg.colors.textSecondary,border:`1px solid ${e.cfg.colorMode==="light"?e.cfg.colors.border:"transparent"}`,cursor:"pointer",fontSize:"0.875rem",fontWeight:600,fontFamily:"inherit",lineHeight:"1.25rem",transition:"all 0.15s ease",outline:"none"},onMouseEnter:b=>{b.currentTarget.style.backgroundColor=e.cfg.colors.border,b.currentTarget.style.color=e.cfg.colorMode==="light"?"#111827":e.cfg.colors.text},onMouseLeave:b=>{b.currentTarget.style.backgroundColor=e.cfg.colorMode==="light"?e.cfg.colors.primary:"transparent",b.currentTarget.style.color=e.cfg.colorMode==="light"?"#ffffff":e.cfg.colors.textSecondary},onClick:b=>{if(b.preventDefault(),u.length>0&&u[0].onClick){const p=()=>e.handleButtonClick(u[0].onClick,{onSuccess:u[0].onSuccess,onError:u[0].onError},{feedback:u[0].feedback,optimistic:u[0].optimistic,payload:u[0].payload});(e.withLoading?e.withLoading(n,p):p()).catch(()=>{})}}},...m)})(),u.length>0?y.createElement("button",{type:"button",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",padding:"0.75rem 0.5rem",backgroundColor:"transparent",color:e.cfg.colors.textSecondary,border:`1px solid ${e.cfg.colorMode==="light"?e.cfg.colors.border:"transparent"}`,borderLeft:`1px solid ${e.cfg.colors.border}`,cursor:"pointer",fontFamily:"inherit",transition:"all 0.15s ease",outline:"none"},onMouseEnter:f=>{f.currentTarget.style.backgroundColor=e.cfg.colors.border,f.currentTarget.style.color=e.cfg.colors.text},onMouseLeave:f=>{f.currentTarget.style.backgroundColor="transparent",f.currentTarget.style.color=e.cfg.colors.textSecondary},onClick:f=>{f.preventDefault(),f.stopPropagation(),i(!r)}},e.renderIcon("chevron-down",16)):null,r?y.createElement("div",{style:{position:"absolute",bottom:"100%",left:"0",right:"0",marginBottom:"4px",backgroundColor:e.cfg.colors.surfaceHover,border:`1px solid ${e.cfg.colors.borderSubtle}`,borderRadius:"8px",boxShadow:"0 -8px 24px rgba(0,0,0,0.4)",zIndex:9999,overflow:"hidden"}},...u.map((f,m)=>{var x;const g=`${n}-item-${m}`,b=!!((x=e.buttonLoading)!=null&&x[g]),p=[];return b?p.push(U("span",{key:"spinner",className:"bf-btn-spinner",style:{width:"12px",height:"12px",border:"2px solid currentColor",borderTopColor:"transparent",borderRadius:"50%",flexShrink:0}})):f.icon&&p.push(U("span",{key:"icon",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,marginRight:"8px"}},e.renderIcon(f.icon,14))),p.push(f.label||""),y.createElement("button",{key:m,type:"button",style:{display:"flex",alignItems:"center",gap:"8px",width:"100%",padding:"10px 16px",backgroundColor:"transparent",color:e.cfg.colors.text,border:"none",cursor:"pointer",fontSize:"14px",textAlign:"left",fontFamily:"inherit",transition:"background-color 0.15s ease",outline:"none"},onMouseEnter:_=>{_.currentTarget.style.backgroundColor=e.cfg.colors.borderSubtle},onMouseLeave:_=>{_.currentTarget.style.backgroundColor="transparent"},onClick:_=>{if(_.preventDefault(),_.stopPropagation(),!f.onClick)return;const S=f.loading==="self"?g:n;f.loading==="self"?i(!0):i(!1);const P=()=>e.handleButtonClick(f.onClick,{onSuccess:f.onSuccess,onError:f.onError},{feedback:f.feedback,optimistic:f.optimistic,payload:f.payload});(e.withLoading?e.withLoading(S,P):P()).finally(()=>{f.loading==="self"&&i(!1)}).catch(()=>{})}},...p)})):null)});function zft(e,t,n){return y.createElement(Bft,{key:n,api:e,c:t,componentKey:n})}function Fft(e,t,n){var l,h;const r=t.widgetId;if(!r)return null;const o=(e.widgets||[]).find(u=>u.id===r);if(!o||!Array.isArray(o.components))return bm(`[renderer] widget "${r}" not found`),null;if(e.widgetStack&&e.widgetStack.includes(r))return bm(`[renderer] circular widget reference "${r}"`),null;(l=e.widgetStack)==null||l.push(r);const s=t.props||{},a=E0(o.components,s).map((u,f)=>e.renderComponent(u,f,`${n}-${r}`));return(h=e.widgetStack)==null||h.pop(),y.createElement(y.Fragment,null,...a)}function E0(e,t){if(!t||Object.keys(t).length===0)return e;if(Array.isArray(e))return e.map(n=>E0(n,t));if(e&&typeof e=="object"){const n={};for(const[r,i]of Object.entries(e))typeof i=="string"&&i.includes("{{")?n[r]=i.replace(/\{\{\s*(?:props\.)?([\w.]+)(?:\|(\w+))?\s*(?:\|\|\s*(.+?))?\s*\}\}/g,(o,s,a,l)=>{let h=t;for(const m of s.split("."))h=h==null?void 0:h[m];if(h==null)return l!==void 0?l.replace(/^["']|["']$/g,""):o;if(a==="names"||a==="join")return Array.isArray(h)?h.map(m=>m&&typeof m=="object"?m.name??m.title:m).filter(Boolean).join(", "):String(h);if(a==="money"||a==="currency"){const m=Number(h);return Number.isFinite(m)?m.toLocaleString("en-NG",{minimumFractionDigits:2,maximumFractionDigits:2}):String(h??"")}const u=h&&typeof h=="object"&&"_seconds"in h?h._seconds*1e3:h&&typeof h=="object"&&"seconds"in h?h.seconds*1e3:h,f=a?new Date(u):null;if(a&&Number.isNaN(f==null?void 0:f.getTime()))return"";if(a==="datetime")return f.toLocaleString();if(a==="timeago"){const m=Math.floor((Date.now()-f.getTime())/6e4);if(m<1)return"just now";if(m<60)return`${m}m ago`;const g=Math.floor(m/60);return g<24?`${g}h ago`:`${Math.floor(g/24)}d ago`}return typeof h=="object"?JSON.stringify(h):String(h)}):n[r]=E0(i,t);return e.condition&&(n.__conditionBase=t),n}return e}const NI=y.memo(({api:e,c:t,componentKey:n})=>{var D;const[r,i]=y.useState(!1),[o,s]=y.useState(""),a=y.useRef(null),l=y.useRef(null),[h,u]=y.useState(null),f=t.dataSource?String(t.dataSource):"",m=!f||/^\{\{\s*\[/.test(f.trim())?f:String(e.interpolateText(t.dataSource));y.useEffect(()=>{if(!m||!e.fetchListData)return;const V=Number(t.pageSize)||Number(t.limit)||5;e.fetchListData(m,n,0,V,void 0,void 0,void 0,void 0,void 0,t.responseKey||t.dataField).catch(()=>{})},[m,n,t.pageSize,t.limit]);const g=m?((D=e.listData)==null?void 0:D[n])||[]:null,b=y.useMemo(()=>{if(g){const F=t.optionLabel||"name",W=t.optionValue||"id",Z=(q,tt)=>tt.split(".").reduce((at,H)=>at==null?void 0:at[H],q);return g.map(q=>{if(typeof q=="string")return{label:q.replace(/^tenant_/i,"").replace(/_/g," ").replace(/\b\w/g,K=>K.toUpperCase()),value:q};const tt=Z(q,F),at=tt!=null&&tt!==""?tt:(q==null?void 0:q.name)??(q==null?void 0:q.title)??(q==null?void 0:q.label)??(q==null?void 0:q.email)??Z(q,W)??"";return{label:String(at),value:String(Z(q,W)??(q==null?void 0:q.id)??(q==null?void 0:q.value)??"")}})}return(Array.isArray(t.options)?t.options:[]).map(F=>typeof F=="string"?{label:F,value:F}:{label:F.label??F.value,value:F.value??F.label})},[t.options,g,t.optionLabel,t.optionValue]),p=t.multiple===!0||t.multiple==="true",x=e.sceneData[t.name||""],_=t.defaultFirst===!0||t.defaultFirst==="true";y.useEffect(()=>{if(!_||p)return;const V=t.name||"";if(!V)return;const F=e.sceneData[V];(F==null||F==="")&&b.length&&e.setSceneData(W=>({...W,[V]:b[0].value}))},[_,p,t.name,b.length]),y.useEffect(()=>{const V=t.name||"";if(!V||p||b.length===0)return;const F=e.sceneData[V];F==null||F===""||b.some(W=>W.value===String(F))||e.setSceneData(W=>({...W,[V]:_?b[0].value:""}))},[b,t.name,_,p]);const S=p?Array.isArray(x)?x.map(V=>String(V)):String(x??"").split(",").map(V=>V.trim()).filter(Boolean):[],P=e.sceneData[t.name||""]??"",C=b.find(V=>V.value===P),w=V=>p?S.includes(V):V===P,E=p?S.length?S.map(V=>{var F;return((F=b.find(W=>W.value===V))==null?void 0:F.label)||V}).join(", "):t.placeholder||"Select...":C?C.label:P||t.placeholder||"Select...",k=t.className?e.parseClassName(t.className):{},I=y.useMemo(()=>{if(!o)return b;const V=o.toLowerCase();return b.filter(F=>F.label.toLowerCase().includes(V))},[b,o]),N=t.custom&&o&&!b.find(V=>V.value===o||V.label===o);y.useEffect(()=>{if(!r){s(""),u(null);return}const V=()=>{const F=a.current;if(!F)return;const W=F.getBoundingClientRect(),Z=window.innerHeight||0,q=8,tt=Z-W.bottom-q,at=W.top-q,H=tt<200&&at>tt;u({left:W.left,width:W.width,...H?{bottom:Math.round(Z-W.top+4)}:{top:Math.round(W.bottom+4)},maxHeight:Math.max(120,Math.min(260,H?at:tt))})};return V(),window.addEventListener("resize",V),window.addEventListener("scroll",V,!0),()=>{window.removeEventListener("resize",V),window.removeEventListener("scroll",V,!0)}},[r]),y.useEffect(()=>{if(!r){s("");return}const V=F=>{var Z,q;const W=F.target;(Z=a.current)!=null&&Z.contains(W)||(q=l.current)!=null&&q.contains(W)||i(!1)};return setTimeout(()=>document.addEventListener("mousedown",V),0),()=>document.removeEventListener("mousedown",V)},[r]);const z=V=>{e.setSceneData(F=>({...F,[t.name||""]:V})),i(!1)},R=V=>{if(!p){z(V);return}const F=S.includes(V)?S.filter(W=>W!==V):[...S,V];e.setSceneData(W=>({...W,[t.name||""]:F.join(", ")}))};return U("div",{key:n,ref:a,style:{position:"relative",width:"100%",...k}},t.label&&U("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,color:e.cfg.colors.textSecondary,marginBottom:"0.75rem"}},t.label),U("button",{style:{width:"100%",minWidth:0,display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",borderRadius:e.cfg.components.inputRadius||"0.75rem",border:"1px solid",borderColor:e.cfg.colorMode==="light"?e.cfg.colors.border:"#374151",background:e.cfg.colors.surface,color:e.cfg.colors.text,cursor:"pointer",fontSize:"14px",textAlign:"left",gap:"8px",...t.triggerClassName?e.parseClassName(t.triggerClassName):{}},onClick:()=>i(!r)},U("span",{style:{minWidth:0,flex:"1 1 auto",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},E),U("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{flexShrink:0}},U("path",{d:"m6 9 6 6 6-6"}))),r&&h&&al.createPortal(U("div",{ref:l,style:{position:"fixed",left:h.left,width:h.width,...h.top!==void 0?{top:h.top}:{bottom:h.bottom},zIndex:1e5,borderRadius:"16px",border:"1px solid",borderColor:e.cfg.colorMode==="dark"?"#374151":e.cfg.colors.border,background:e.cfg.colorMode==="dark"?"#1f2937":"#ffffff",overflow:"hidden",maxHeight:h.maxHeight,display:"flex",flexDirection:"column"}},t.searchable!==!1&&U("input",{style:{width:"100%",padding:"8px",border:"none",borderBottom:"1px solid",borderColor:e.cfg.colors.borderSubtle,background:"transparent",color:e.cfg.colors.text,outline:"none",fontSize:"13px"},placeholder:"Search...",value:o,onChange:V=>{s(V.target.value),V.stopPropagation()},onClick:V=>V.stopPropagation()}),U("div",{style:{overflow:"auto",flex:1}},I.map(V=>U("button",{key:V.value,style:{width:"100%",display:"block",textAlign:"left",padding:"8px",border:"none",background:w(V.value)?"rgba(149,57,5,0.12)":"transparent",color:w(V.value)?e.cfg.colors.primary:e.cfg.colors.text,cursor:"pointer",fontSize:"14px"},onMouseEnter:F=>{F.currentTarget.style.background=e.cfg.colors.surfaceHover},onMouseLeave:F=>{F.currentTarget.style.background=w(V.value)?"rgba(149,57,5,0.12)":"transparent"},onClick:()=>R(V.value)},(w(V.value)?"✓ ":"")+V.label)),N&&U("button",{style:{width:"100%",display:"block",textAlign:"left",padding:"8px",border:"none",borderTop:"1px solid",borderColor:e.cfg.colors.borderSubtle,background:"transparent",color:e.cfg.colors.primary,cursor:"pointer",fontSize:"13px",fontStyle:"italic"},onClick:()=>R(o)},`+ Add "${o}"`))),document.body))});function Wft(e,t,n){return y.createElement(NI,{api:e,c:t,componentKey:n})}const Ls={},Vft=y.memo(({api:e,field:t,fieldName:n,fieldKey:r,fieldStyle:i,fieldWrapperStyle:o})=>{const[s,a]=y.useState([]);y.useEffect(()=>{t.dataSource&&(async()=>{var u;try{const f=e.interpolateText(t.dataSource),m=(u=e.selectDynamicOptions)==null?void 0:u[f];if(m&&m.length>0){a(m);return}Ls[f]||(Ls[f]=(async()=>{var b;try{const p=await fetch(f,{headers:{Authorization:`Bearer ${localStorage.getItem("token")||""}`}});if(!p.ok)return[];const x=await p.json(),_=t.dataField||"configs",S=t.optionLabel||"label",P=t.optionValue||"value",C=x[_]||x.data||x,w=Array.isArray(C)?C.map(E=>({label:E[S]||E.name||E.label,value:E[P]||E.id||E.name||E.label})):[];return(b=e.setSelectDynamicOptions)==null||b.call(e,E=>({...E,[f]:w})),w}catch{return delete Ls[f],[]}})());const g=await Ls[f];g.length>0&&a(g)}catch{}})()},[t.dataSource]);const l=s.length>0?s:Array.isArray(t.options)?t.options:[],h=t.placeholder||t.label||"Select...";return y.createElement("div",{key:r,style:o||{width:"100%"}},t.label?U("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,color:e.cfg.colors.textSecondary,marginBottom:"0.75rem"}},t.label):null,U("select",{name:n,value:e.sceneData[n]??"",required:t.required,className:t.className,style:{...i,fontSize:"0.875rem"},size:"md",onChange:u=>e.setSceneData(f=>({...f,[n]:u.target.value}))},U("option",{key:"__placeholder",value:"",disabled:!0,hidden:!0},h),l.map((u,f)=>U("option",{key:f,value:typeof u=="string"?u:u.value},typeof u=="string"?u:u.label))))});function Uft(e,t,n){var l;const r=t.className||"",i=((l=e.parseClassNameResponsive)==null?void 0:l.call(e,r,n))??e.parseClassName(r),o=e.getCommonProps(n,i,t),s=Array.isArray(t.fields)?t.fields:[],a=t.submitButton;return t.collection&&e.fetchEntitySchema?y.createElement(Hft,{api:e,c:t,componentKey:n,formClassName:r,parsedStyle:i,formProps:o,fields:s,submitBtn:a}):RI(e,t,n,r,i,o,s,a)}function Hft({api:e,c:t,componentKey:n,formClassName:r,parsedStyle:i,formProps:o,fields:s,submitBtn:a}){const[l,h]=y.useState(s),[u,f]=y.useState(!0);return y.useEffect(()=>{if(!e.fetchEntitySchema){f(!1);return}e.fetchEntitySchema(t.collection).then(m=>{if(!Array.isArray(m==null?void 0:m.fields)){f(!1);return}const g=new Map(m.fields.map(p=>[p.name,p])),b=s.map(p=>{var _;const x=g.get(p.name||((_=p.label)==null?void 0:_.toLowerCase()));return x?{...p,required:p.required??x.required,validation:p.validation??(x.validation?{...x.validation}:void 0),placeholder:p.placeholder??x.placeholder}:p});h(b),f(!1)}).catch(()=>f(!1))},[t.collection]),u?U("div",{key:n,style:{padding:"1rem",textAlign:"center",color:e.cfg.colors.textMuted,fontSize:"0.8rem"}},"Loading fields..."):RI(e,t,n,r,i,o,l,a)}const qft=y.memo(function({name:t,value:n,onChange:r,placeholder:i,required:o,inputType:s,label:a,fieldStyle:l,onKeyDown:h,openPickerOnClick:u}){y.useEffect(()=>{n!==void 0&&n!==""&&r&&r(n)},[]);const f=y.useRef(r);f.current=r;const m=y.useRef(l);m.current=l;const g=y.useCallback(p=>{f.current(p.target.value)},[]),b=y.createElement("input",{name:t,placeholder:i,required:o,type:s||"text",value:n??"",onChange:g,onClick:u?p=>{var x,_;return(_=(x=p.currentTarget).showPicker)==null?void 0:_.call(x)}:void 0,onKeyDown:h?p=>{p.key==="Enter"&&h()}:void 0,style:m.current});return a?y.createElement("div",{style:{width:"100%",marginBottom:"1rem"}},y.createElement("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,color:l.color,marginBottom:"0.75rem"}},a),b):b}),Gft=y.memo(function({api:t,field:n,fieldName:r,label:i,fieldStyle:o}){const s=y.useRef(null),[a,l]=y.useState(!1),h=t.sceneData[r]||"",u=t.sceneData[r+"_name"]||"",f=/^data:image\//i.test(h)||/\.(png|jpe?g|gif|webp|svg|avif)(\?|#|$)/i.test(h)||/\/[^/]+\/image(\?|#|$)/i.test(h),m=async g=>{var p,x,_,S;const b=(p=g.target.files)==null?void 0:p[0];if(g.target.value="",!!b){l(!0);try{const P=(x=t.showToast)==null?void 0:x.call(t,"Uploading…","success",0),C=t.uploadFile?await t.uploadFile(b,n.upload,w=>{var E;return(E=P==null?void 0:P.update)==null?void 0:E.call(P,`Uploading ${b.name} (${w}%)`)}):"";if((_=P==null?void 0:P.dismiss)==null||_.call(P),!C)throw new Error;t.setSceneData(w=>({...w,[r]:C,[r+"_name"]:b.name})),n.refetchScope&&t.refetchScope&&t.refetchScope(n.refetchScope)}catch{(S=t.showToast)==null||S.call(t,"Upload failed","error")}finally{l(!1)}}};return y.createElement("div",{style:{width:"100%"}},i&&U("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,color:t.cfg.colors.textSecondary,marginBottom:"0.75rem"}},i),h?y.createElement("div",{style:{...o,display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px"}},U("div",{style:{display:"flex",alignItems:"center",gap:"10px",minWidth:0}},f?U("img",{src:h,alt:"",style:{width:"40px",height:"40px",objectFit:"cover",borderRadius:"8px",flexShrink:0}}):U("span",{style:{display:"flex",alignItems:"center",flexShrink:0}},t.renderIcon("paperclip",16)),U("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},u||"Uploaded file")),U("button",{type:"button","aria-label":"Remove",title:"Remove",style:{background:"none",border:"none",cursor:"pointer",color:t.cfg.colors.danger,display:"flex",alignItems:"center",flexShrink:0,padding:"4px"},onClick:()=>t.setSceneData(g=>{const b={...g};return delete b[r],delete b[r+"_name"],b})},t.renderIcon("trash-2",16))):y.createElement("button",{type:"button",onClick:()=>{var g;return(g=s.current)==null?void 0:g.click()},style:{...o,display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",cursor:"pointer",color:t.cfg.colors.textMuted,fontSize:"14px"}},a?"Uploading…":"⬆ Upload file"),U("input",{key:"file-input",ref:s,type:"file",accept:n.accept||".pdf,.docx,.txt,.md,.csv,.json",style:{display:"none"},onChange:m}))}),Yft=y.memo(function({api:t,c:n,componentKey:r}){const i=n.name||"image",o=t.sceneData[i]||"",[s,a]=y.useState(!1),l=y.useRef(null),h=y.useRef(null),[u,f]=y.useState(""),[m,g]=y.useState(null),b=`${r}-images`,p=n.dataSource||"/admin/assets?entityType=media";y.useEffect(()=>{!s||!t.fetchListData||t.fetchListData(p,b,0,Number(n.pageSize)||100).catch(()=>{})},[s,p,b]),y.useEffect(()=>{if(!s){g(null),f("");return}const N=()=>{const z=l.current;if(!z)return;const R=z.getBoundingClientRect(),D=window.innerHeight||0,V=D-R.bottom-8,F=R.top-8,W=V<300&&F>V;g({left:R.left,width:R.width,...W?{bottom:Math.round(D-R.top+6)}:{top:Math.round(R.bottom+6)}})};return N(),window.addEventListener("resize",N),window.addEventListener("scroll",N,!0),()=>{window.removeEventListener("resize",N),window.removeEventListener("scroll",N,!0)}},[s]),y.useEffect(()=>{if(!s)return;const N=R=>{var V,F;const D=R.target;(V=l.current)!=null&&V.contains(D)||(F=h.current)!=null&&F.contains(D)||a(!1)},z=setTimeout(()=>document.addEventListener("mousedown",N),0);return()=>{clearTimeout(z),document.removeEventListener("mousedown",N)}},[s]);const x=N=>{if(!N)return"";if(typeof N=="object")return N.url||N.asset_url||"";const z=String(N);if(/^https?:\/\//i.test(z)||z.startsWith("/"))return z;const R=S.find(D=>String((D==null?void 0:D.asset_id)||(D==null?void 0:D.id))===z||String(D==null?void 0:D.id)===z);return R&&(R.url||R.asset_url)||""},_=N=>x(N),S=t.listData&&t.listData[b]||[],P=u.trim().toLowerCase(),C=P?S.filter(N=>String((N==null?void 0:N.label)||(N==null?void 0:N.path)||(N==null?void 0:N.id)||"").toLowerCase().includes(P)):S,w=N=>{const z=N.asset_id||N.id;t.setSceneData(R=>({...R,[i]:z,[`${i}_label`]:N.label||""})),a(!1)},E=()=>t.setSceneData(N=>{const z={...N};return delete z[i],delete z[`${i}_label`],z}),k=x(o),I={width:"40px",height:"40px",aspectRatio:"1 / 1",objectFit:"cover",borderRadius:"8px",flexShrink:0,display:"block"};return U("div",{key:r,ref:l,style:{position:"relative",width:"100%",display:"flex",alignItems:"center",gap:"8px"}},U("button",{type:"button","aria-label":t.interpolateText(n.ariaLabel||n.placeholder||"Select image"),onClick:()=>a(!s),style:{flex:"1 1 auto",minWidth:0,display:"flex",alignItems:"center",gap:"10px",padding:"10px 12px",borderRadius:"12px",border:"1px solid",borderColor:t.cfg.colorMode==="dark"?"#374151":t.cfg.colors.border,background:t.cfg.colorMode==="dark"?"#1f2937":"#ffffff",color:t.cfg.colors.text,cursor:"pointer",fontSize:"14px"}},k?U("img",{src:k,alt:"",style:I}):null,U("span",{style:{flex:"1 1 auto",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",textAlign:"left"}},o?t.sceneData[`${i}_label`]||"Selected image":n.placeholder||"Select image…"),t.renderIcon("chevron-down",14)),o?U("button",{type:"button","aria-label":"Remove",title:"Remove",onClick:E,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"40px",height:"40px",flexShrink:0,borderRadius:"12px",border:"none",background:"transparent",color:t.cfg.colors.danger,cursor:"pointer"}},t.renderIcon("trash-2",16)):null,s&&m?al.createPortal(U("div",{ref:h,style:{position:"fixed",left:m.left,width:m.width,...m.top!==void 0?{top:m.top}:{bottom:m.bottom},zIndex:1e5,borderRadius:"16px",border:"1px solid",borderColor:t.cfg.colorMode==="dark"?"#374151":t.cfg.colors.border,background:t.cfg.colorMode==="dark"?"#1f2937":"#ffffff",maxHeight:"320px",display:"flex",flexDirection:"column",overflow:"hidden"}},U("input",{placeholder:"Search images...",value:u,onChange:N=>f(N.target.value),onClick:N=>N.stopPropagation(),style:{width:"100%",padding:"8px",border:"none",borderBottom:"1px solid",borderColor:t.cfg.colors.borderSubtle,background:"transparent",color:t.cfg.colors.text,outline:"none",fontSize:"13px"}}),U("div",{style:{overflow:"auto",padding:"8px",display:"flex",flexWrap:"wrap",gap:"8px",alignContent:"flex-start"}},C.length?C.map(N=>U("div",{key:N.id,role:"button",tabIndex:0,title:N.label||N.id,onClick:()=>w(N),style:{width:"112px",height:"112px",flex:"0 0 auto",padding:0,border:String(N.id)===String(o)?`2px solid ${t.cfg.colors.primary}`:"1px solid transparent",background:"transparent",borderRadius:"12px",cursor:"pointer",overflow:"hidden"}},U("img",{src:_(N),alt:N.label||"",style:{width:"100%",height:"100%",objectFit:"cover",display:"block",background:t.cfg.colorMode==="dark"?"#374151":"#f5f5f5"}}))):U("div",{style:{gridColumn:"1 / -1",padding:"12px",color:t.cfg.colors.textMuted,fontSize:"13px"}},"No images found"))),document.body):null)}),Zft=y.memo(function({api:t,c:n,componentKey:r}){const i=y.useRef(null),o=y.useRef(null),[s,a]=y.useState(!1),l=n.className?t.parseClassName(n.className):{},h=n.camera===!0||n.camera==="true"||!!n.capture,u=s?n.uploadingText||"Uploading…":t.interpolateText(n.text||n.label||"Upload"),f=async(p,x=!1)=>{var _,S,P,C,w;if(p.length!==0){a(!0);try{const E=[],k={...n.upload||{},...n.embed?{embed:!0}:{},...n.embeddingEntity?{entity:n.embeddingEntity}:{},...n.resultKey?{resultKey:n.resultKey}:{}};for(const F of p){const W=await((_=t.uploadFile)==null?void 0:_.call(t,F,k,void 0));W&&E.push(W)}if(E.length===0)throw new Error("upload failed");const I=n.dataKey||n.name||"uploadedAsset",N=(S=t.sceneData)==null?void 0:S[I],z=Array.isArray(N)?N:N?[N]:[],R=n.multiple?x?[...z,...E]:E:E[E.length-1],D=p.map(F=>F.name).join(", "),V=(P=t.sceneData)==null?void 0:P[I+"_name"];t.setSceneData(F=>({...F,[I]:R,[I+"_name"]:x&&V?`${V}, ${D}`:D})),n.refetchScope&&typeof t.refetchScope=="function"&&t.refetchScope(n.refetchScope),(C=t.showToast)==null||C.call(t,n.successMessage||(n.multiple?`${E.length} uploaded`:"Uploaded"),"success")}catch{(w=t.showToast)==null||w.call(t,n.errorMessage||"Upload failed","error")}finally{a(!1)}}},m=async p=>{const x=p.target.files?Array.from(p.target.files):[];p.target.value="",await f(x,!1)},g=async p=>{const x=p.target.files?Array.from(p.target.files):[];p.target.value="",await f(x,!0)},b={...n.wrapperStyle||{}};return h?(b.display="flex",b.alignItems="center",b.gap=8):b.display||(b.display="inline-flex"),U("div",{key:r,style:b},y.createElement("button",{type:"button",className:n.className,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"8px",cursor:s?"wait":"pointer",border:"none",fontFamily:"inherit",...l,...h?{flex:"1 1 auto",minWidth:0,width:"auto"}:{}},disabled:s||t.interactionDisabled||void 0,"aria-label":t.interpolateText(n.ariaLabel||u),onClick:()=>{var p;return(p=i.current)==null?void 0:p.click()}},n.icon?t.renderIcon(n.icon,n.iconSize||16):null,U("span",null,u)),h?y.createElement("button",{key:"camera-button",type:"button",className:n.cameraClassName||"inline-flex items-center justify-center w-11 h-11 rounded-xl border border-[#d8d2be] bg-white text-[#1b2a1f] hover:bg-[#f2efe6] dark:border-[#374151] dark:bg-[#1f2937] dark:text-[#f3f4f6] dark:hover:bg-[#374151] shrink-0",style:{cursor:s?"wait":"pointer",flexShrink:0},disabled:s||t.interactionDisabled||void 0,"aria-label":t.interpolateText(n.cameraLabel||"Take photo"),onClick:()=>{var p;return(p=o.current)==null?void 0:p.click()}},t.renderIcon(n.cameraIcon||"camera",n.cameraIconSize||18)):null,y.createElement("input",{key:"upload-input",ref:i,type:"file",accept:n.accept||"image/*",multiple:!!n.multiple,style:{display:"none"},onChange:m}),h?y.createElement("input",{key:"camera-input",ref:o,type:"file",accept:"image/*",capture:n.capture==="user"?"user":"environment",style:{display:"none"},onChange:g}):null)}),Kft=y.memo(function({name:t,value:n,onChange:r,placeholder:i,required:o,options:s,label:a,fieldStyle:l}){y.useEffect(()=>{n!==void 0&&n!==""&&r&&r(n)},[]);const h=y.useRef(r);h.current=r;const u=y.useRef(l);u.current=l;const f=y.useCallback(g=>{h.current(g.target.value)},[]),m=y.createElement("select",{name:t,required:o,value:n??"",onChange:f,style:{...u.current,cursor:"pointer",appearance:"none"}},i?y.createElement("option",{key:"__placeholder",value:""},i):null,...s.map((g,b)=>y.createElement("option",{key:b,value:typeof g=="string"?g:g.value},typeof g=="string"?g:g.label)));return a?y.createElement("div",{style:{width:"100%",marginBottom:"1rem"}},y.createElement("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,marginBottom:"0.75rem"}},a),m):m}),Xft=y.memo(function({name:t,value:n,onChange:r,placeholder:i,required:o,rows:s,label:a,fieldStyle:l}){y.useEffect(()=>{n!==void 0&&n!==""&&r&&r(n)},[]);const h=y.useRef(r);h.current=r;const u=y.useRef(l);u.current=l;const f=y.useCallback(g=>{h.current(g.target.value)},[]),m=y.createElement("textarea",{name:t,placeholder:i,required:o,rows:s||4,value:n??"",onChange:f,style:{...u.current,resize:"vertical",fontFamily:"inherit"}});return a?y.createElement("div",{style:{width:"100%",marginBottom:"1rem"}},y.createElement("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,marginBottom:"0.75rem"}},a),m):m}),Jft=y.memo(function({api:t,field:n,fieldName:r}){const i=Array.isArray(n.fields)?n.fields:[],o=p=>{let x=[];if(Array.isArray(p))x=p;else if(typeof p=="string"&&p)try{const _=JSON.parse(p);x=Array.isArray(_)?_:_&&Array.isArray(_.rules)?_.rules:[]}catch{}else p&&typeof p=="object"&&(x=Array.isArray(p.rules)?p.rules:[]);return x.map(_=>{if(!_||typeof _!="object")return null;const S={};let P=!1;for(const C of i)_[C.name]!==void 0&&(S[C.name]=_[C.name],P=!0);if(!P&&i.some(C=>C.name==="metric"))if(_.metric!==void 0||_.op!==void 0||_.value!==void 0)S.metric=_.metric==null?"":String(_.metric),S.op=_.op==null||_.op===""?"gte":String(_.op),S.value=_.value==null?"":_.value,P=!0;else{const C=/^min_(.+)$/.exec(String(_.type||""));C&&(S.metric=C[1],S.op="gte",S.value=_.value==null?"":_.value,P=!0)}return P?S:null}).filter(Boolean)},[s,a]=y.useState(()=>o(t.sceneData[r])),l=t.sceneData[r];y.useEffect(()=>{a(o(l))},[l]);const h=p=>{a(p),t.setSceneData(x=>({...x,[r]:JSON.stringify(p)}))},u=i.filter(p=>p.type==="select"&&p.dataSource),f=u.map(p=>`${r}:${p.dataSource}`).join("|");y.useEffect(()=>{t.fetchListData&&u.forEach(p=>{t.fetchListData(t.interpolateText(String(p.dataSource)),`${r}-ds-${p.name}`,0,Number(p.limit)||300).catch(()=>{})})},[f,r]);const m=p=>{if(!p.dataSource)return Array.isArray(p.options)?p.options:[];const x=t.listData&&t.listData[`${r}-ds-${p.name}`]||[],_=p.optionLabel||"name",S=p.optionValue||"name",P=(C,w)=>String(w).split(".").reduce((E,k)=>E==null?E:E[k],C);return x.map(C=>({label:String(P(C,_)??C.name??C.id??""),value:String(P(C,S)??C.name??C.id??"")}))},g=()=>{const p={};return i.forEach(x=>{p[x.name]=x.default!==void 0?x.default:""}),p},b={flex:1,minWidth:0,padding:"8px 10px",borderRadius:"10px",border:`1px solid ${t.cfg.colors.border}`,background:t.cfg.colors.surface,color:t.cfg.colors.text,outline:"none",fontSize:"14px",colorScheme:t.cfg.colorMode==="light"?"light":"dark"};return U("div",{style:{width:"100%",marginBottom:"1rem"}},n.label?U("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,color:t.cfg.colors.textSecondary,marginBottom:"0.5rem"}},n.label):null,...s.map((p,x)=>U("div",{key:`${r}-row-${x}`,style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"8px",marginBottom:"8px"}},...i.map(_=>{const S=`${r}-${x}-${_.name}`;return _.type==="select"?y.createElement("select",{key:S,value:p[_.name]??"",onChange:P=>h(s.map((C,w)=>w===x?{...C,[_.name]:P.target.value}:C)),style:{...b,flex:_.flex||1}},y.createElement("option",{value:"",key:"__blank"},_.placeholder||_.label||"Select…"),...m(_).map((P,C)=>y.createElement("option",{value:P.value??P.label,key:C},P.label??P.value))):y.createElement("input",{key:S,type:_.type==="number"?"number":"text",value:p[_.name]??"",placeholder:_.placeholder||_.label||"",min:_.min,step:_.step,onChange:P=>h(s.map((C,w)=>w===x?{...C,[_.name]:P.target.value}:C)),style:{...b,flex:_.flex||1}})}),U("button",{key:`${r}-rm-${x}`,type:"button","aria-label":"Remove",title:"Remove",onClick:()=>h(s.filter((_,S)=>S!==x)),style:{flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",width:36,height:36,borderRadius:10,border:"none",cursor:"pointer",background:"transparent",color:t.cfg.colors.danger}},t.renderIcon("trash-2",16)))),U("button",{type:"button",onClick:()=>h([...s,g()]),style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"8px 12px",borderRadius:10,border:`1px dashed ${t.cfg.colors.borderSubtle}`,background:"transparent",color:t.cfg.colors.textSecondary,cursor:"pointer",fontSize:"14px",fontWeight:500}},t.renderIcon("plus",16),n.addLabel||"Add"))});function RI(e,t,n,r,i,o,s,a){var g,b;const l=[],h=Math.max(1,Math.floor(Number(t.columns)||1)),u=typeof window>"u"?1/0:window.innerWidth,m=Math.min(e.containerWidth||1/0,u)<640?1:h;if(s.forEach((p,x)=>{var k,I;const _=`${n}-field-${x}`,S=p.name||((k=p.label)==null?void 0:k.toLowerCase())||"",P=p.className?((I=e.parseClassNameResponsive)==null?void 0:I.call(e,p.className,_))??e.parseClassName(p.className):{},C={width:"100%",padding:"8px 8px",borderRadius:e.cfg.components.inputRadius||void 0,backgroundColor:p.borderless?p.backgroundColor||"transparent":e.cfg.colors.surface,color:p.textColor||e.cfg.colors.text,colorScheme:e.cfg.colorMode==="light"?"light":"dark",border:p.borderless?"none":`1px solid ${e.cfg.colors.border}`,outline:"none",transition:e.cfg.effects.transition,...P},w={width:"100%",marginBottom:"1rem"},E=N=>N.value?e.interpolateText(String(N.value)):"";if(p.type==="richtext")l.push(y.createElement(jft,{key:_,api:e,field:p,fieldName:S,value:e.sceneData[S]??E(p),onChange:N=>e.setSceneData(z=>({...z,[S]:N}))}));else if(p.type==="textarea"){const N=p.rows||4;l.push(y.createElement(Xft,{key:_,name:S,value:e.sceneData[S]??E(p),onChange:z=>e.setSceneData(R=>({...R,[S]:z})),placeholder:p.placeholder||p.label,required:p.required,rows:N,label:p.label,fieldStyle:C}))}else if(p.type==="select")if(p.dataSource)l.push(y.createElement(Vft,{key:_,api:e,field:p,fieldName:S,fieldKey:_,fieldStyle:C,fieldWrapperStyle:w}));else{const N=Array.isArray(p.options)?p.options:[];l.push(y.createElement(Kft,{key:_,name:S,value:e.sceneData[S]??E(p),onChange:z=>e.setSceneData(R=>({...R,[S]:z})),placeholder:p.placeholder||p.label||"Select...",required:p.required,options:N,label:p.label,fieldStyle:C}))}else if(p.type==="advanced-select")l.push(y.createElement("div",{key:`${_}-wrap`,style:w},y.createElement(NI,{key:_,api:e,c:{...p,name:S,options:p.options},componentKey:_})));else if(p.type==="file")l.push(y.createElement("div",{key:`${_}-wrap`,style:w},y.createElement(Gft,{key:_,api:e,field:p,fieldName:S,label:p.label,fieldStyle:C})));else if(p.type==="repeater")l.push(y.createElement(Jft,{key:_,api:e,field:p,fieldName:S}));else if(p.tags)l.push(y.createElement(Qft,{key:_,api:e,field:p,value:e.sceneData[S]??E(p),onChange:N=>e.setSceneData(z=>({...z,[S]:N}))}));else{const N=p.type==="email"?"email":p.type==="password"?"password":p.type==="number"?"number":p.type==="date"?"date":p.type==="datetime-local"?"datetime-local":"text";l.push(y.createElement(qft,{key:_,name:S,value:e.sceneData[S]??E(p),onChange:z=>e.setSceneData(R=>({...R,[S]:z})),placeholder:p.placeholder||p.label,required:p.required,inputType:N,label:p.label,fieldStyle:C,openPickerOnClick:p.openPickerOnClick,onKeyDown:p.onKeyDown?()=>e.handleButtonClick(p.onKeyDown):void 0}))}}),h>1){const p=l.splice(0);l.push(...p.map((x,_)=>{var P;const S=Math.min(m,Math.max(1,Number((P=s[_])==null?void 0:P.fieldSpan)||1));return U("div",{key:`${n}-field-grid-${_}`,style:{gridColumn:`span ${S} / span ${S}`,minWidth:0}},x)}))}if(a){const p={padding:"0.75rem 1.5rem",borderRadius:e.cfg.components.inputRadius,cursor:"pointer",fontWeight:600,width:t.secondaryButton?"auto":"100%",marginTop:t.secondaryButton?0:"1rem",...h>1?{gridColumn:"1 / -1",marginTop:0}:{}},x=a.className?((g=e.parseClassNameResponsive)==null?void 0:g.call(e,a.className,`${n}-submit`))??e.parseClassName(a.className):{},_=!!a.className&&/(^|\s)bg-[^\s]+/.test(a.className),S=!!a.className&&/(^|\s)text-[^\s]+/.test(a.className),P={...p,...x,...!_&&{backgroundColor:e.cfg.colors.primary},...!S&&{color:"#fff",border:"none"}},C=`${n}-submit`,w=!!((b=e.buttonLoading)!=null&&b[C]),E=()=>{var V,F,W,Z,q;const R=[],D=e.sceneData||{};for(const tt of s){const at=tt.name||((V=tt.label)==null?void 0:V.toLowerCase()),H=D[at],K=tt.label||at;if(tt.required&&(H==null||String(H).trim()==="")){R.push(`${K} is required`);continue}H==null||String(H).trim()===""||((F=tt.validation)!=null&&F.pattern&&!new RegExp(tt.validation.pattern).test(String(H))&&R.push(`${K} is invalid`),((W=tt.validation)==null?void 0:W.min)!==void 0&&Number(H)<Number(tt.validation.min)&&R.push(`${K} must be at least ${tt.validation.min}`),((Z=tt.validation)==null?void 0:Z.max)!==void 0&&Number(H)>Number(tt.validation.max)&&R.push(`${K} must be at most ${tt.validation.max}`),((q=tt.validation)==null?void 0:q.minLength)!==void 0&&String(H).length<Number(tt.validation.minLength)&&R.push(`${K} must be at least ${tt.validation.minLength} characters`))}return R},k=()=>{var F,W;const R=E();if(R.length){(F=e.showToast)==null||F.call(e,R,"error");return}const D=()=>a.onClick?e.handleButtonClick(a.onClick,{onSuccess:a.onSuccess,onError:a.onError},{optimistic:a.optimistic,feedback:a.feedback,payload:a.payload}):Promise.resolve(),V=e.withLoading?e.withLoading(C,D):D();(W=V==null?void 0:V.catch)==null||W.call(V,()=>{})},I=a.onClick?()=>k():void 0,N=[];w?N.push(U("span",{key:"spinner",className:"bf-btn-spinner",style:{display:"inline-flex",width:"14px",height:"14px",marginRight:"6px",border:"2px solid currentColor",borderTopColor:"transparent",borderRadius:"50%",flexShrink:0}})):a.icon&&N.push(U("span",{key:"icon",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,marginRight:"6px"}},e.renderIcon(a.icon,a.iconSize||16))),N.push(U("span",{key:"text"},a.text||"Submit"));const z=U("button",{key:C,type:a.type||"submit",className:a.className,...e.getCommonProps(C,P,a),disabled:w||void 0,onClick:I},...N);l.push(t.secondaryButton?U("div",{key:`${n}-actions`,style:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:"12px",gridColumn:"1 / -1",borderTop:`1px solid ${e.cfg.colors.borderSubtle}`,paddingTop:"16px",marginTop:"8px"}},e.renderComponent({...t.secondaryButton,type:"button"},0,`${n}-actions`),z):z)}return U("form",{key:n,className:r,...o,style:{...o.style||{},...h>1?{display:"grid",gridTemplateColumns:`repeat(${m}, minmax(0, 1fr))`,columnGap:"1rem",rowGap:"1.25rem"}:{}},onSubmit:p=>p.preventDefault()},...l)}const Qft=y.memo(({api:e,field:t,value:n,onChange:r})=>{y.useEffect(()=>{n!==void 0&&n!==""&&r&&r(n)},[]);const i=y.useRef(null),o=(n||"").split(",").filter(Boolean).map(g=>g.trim()),[s,a]=y.useState(""),[l,h]=y.useState(!1),u=g=>{const b=g.target.value;if(b.includes(",")||b.includes(";")){const p=b.split(/[,;]+/).map(x=>x.trim()).filter(Boolean);if(p.length>0){const x=[...new Set([...o,...p])].join(", ");r(x)}a("")}else a(b)},f=g=>{if(g.key==="Enter"||g.key===","||g.key===";"){g.preventDefault();const b=s.trim();b&&(r([...new Set([...o,b])].join(", ")),a(""))}else g.key==="Backspace"&&!s&&o.length>0&&r(o.slice(0,-1).join(", "))},m=()=>{const g=s.trim();g&&(r([...new Set([...o,g])].join(", ")),a(""))};return U("div",{key:"tags",style:{width:"100%",marginBottom:"1rem"}},t.label?U("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,color:e.cfg.colors.textSecondary,marginBottom:"0.75rem"}},t.label):null,U("div",{style:{display:"flex",flexWrap:"wrap",gap:"4px",padding:"0.5rem 0.75rem",borderRadius:e.cfg.components.inputRadius||"8px",backgroundColor:e.cfg.colors.surface,border:`1px solid ${l?e.cfg.colors.primary:e.cfg.colors.border}`,cursor:"text",outline:"none",transition:"border-color 0.2s"},onClick:()=>{var g;return(g=i.current)==null?void 0:g.focus()}},...o.map((g,b)=>U("span",{key:b,style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"2px 8px",borderRadius:"4px",backgroundColor:e.cfg.colors.background,border:`1px solid ${e.cfg.colors.borderSubtle}`,color:e.cfg.colors.text,fontSize:"13px",lineHeight:"1.4"}},U("span",null,g),U("button",{type:"button",onMouseDown:p=>{p.preventDefault(),p.stopPropagation(),r(o.filter((x,_)=>_!==b).join(", "))},style:{background:"none",border:"none",cursor:"pointer",color:e.cfg.colors.textMuted,padding:"0",fontSize:"14px",lineHeight:"1",display:"flex",alignItems:"center",fontFamily:"inherit"}},"×"))),U("input",{ref:i,type:"text",value:s,onChange:u,onKeyDown:f,onFocus:()=>h(!0),onBlur:()=>{h(!1),m()},placeholder:t.placeholder||(o.length>0?"":"Add email..."),style:{flex:1,minWidth:"100px",border:"none",outline:"none",backgroundColor:"transparent",color:e.cfg.colors.text,fontSize:"14px",fontFamily:"inherit",padding:"2px 0"}})))});function tdt(e,t,n){let r=e.interpolateText(t.text||t.content||"");if(!r)return null;!r.includes(`
|
|
123
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function CI(e,t){if(e){if(typeof e=="string")return P0(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return P0(e,t)}}function Iht(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Nht(e){if(Array.isArray(e))return P0(e)}function P0(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function NC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function mt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?NC(Object(n),!0).forEach(function(r){te(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):NC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function te(e,t,n){return t=TI(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function TI(e){var t=Rht(e,"string");return qc(t)=="symbol"?t:t+""}function Rht(e,t){if(qc(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(qc(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Lht={xAxis:["bottom","top"],yAxis:["left","right"]},Dht={width:"100%",height:"100%"},MI={x:0,y:0};function zd(e){return e}var jht=function(t,n){return n==="horizontal"?t.x:n==="vertical"?t.y:n==="centric"?t.angle:t.radius},Bht=function(t,n,r,i){var o=n.find(function(u){return u&&u.index===r});if(o){if(t==="horizontal")return{x:o.coordinate,y:i.y};if(t==="vertical")return{x:i.x,y:o.coordinate};if(t==="centric"){var s=o.coordinate,a=i.radius;return mt(mt(mt({},i),on(i.cx,i.cy,a,s)),{},{angle:s,radius:a})}var l=o.coordinate,h=i.angle;return mt(mt(mt({},i),on(i.cx,i.cy,l,h)),{},{angle:h,radius:l})}return MI},Tg=function(t,n){var r=n.graphicalItems,i=n.dataStartIndex,o=n.dataEndIndex,s=(r??[]).reduce(function(a,l){var h=l.props.data;return h&&h.length?[].concat(Gc(a),Gc(h)):a},[]);return s.length>0?s:t&&t.length&&At(i)&&At(o)?t.slice(i,o+1):[]};function OI(e){return e==="number"?[0,"auto"]:void 0}var A0=function(t,n,r,i){var o=t.graphicalItems,s=t.tooltipAxis,a=Tg(n,t);return r<0||!o||!o.length||r>=a.length?null:o.reduce(function(l,h){var u,f=(u=h.props.data)!==null&&u!==void 0?u:n;f&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=r&&(f=f.slice(t.dataStartIndex,t.dataEndIndex+1));var m;if(s.dataKey&&!s.allowDuplicatedCategory){var g=f===void 0?a:f;m=hp(g,s.dataKey,i)}else m=f&&f[r]||a[r];return m?[].concat(Gc(l),[u$(h,m)]):l},[])},RC=function(t,n,r,i){var o=i||{x:t.chartX,y:t.chartY},s=jht(o,r),a=t.orderedTooltipTicks,l=t.tooltipAxis,h=t.tooltipTicks,u=Let(s,a,h,l);if(u>=0&&h){var f=h[u]&&h[u].value,m=A0(t,n,u,f),g=Bht(r,a,u,o);return{activeTooltipIndex:u,activeLabel:f,activePayload:m,activeCoordinate:g}}return null},zht=function(t,n){var r=n.axes,i=n.graphicalItems,o=n.axisType,s=n.axisIdKey,a=n.stackGroups,l=n.dataStartIndex,h=n.dataEndIndex,u=t.layout,f=t.children,m=t.stackOffset,g=i$(u,o);return r.reduce(function(b,p){var x,_=p.type.defaultProps!==void 0?mt(mt({},p.type.defaultProps),p.props):p.props,S=_.type,P=_.dataKey,C=_.allowDataOverflow,w=_.allowDuplicatedCategory,E=_.scale,k=_.ticks,I=_.includeHidden,N=_[s];if(b[N])return b;var z=Tg(t.data,{graphicalItems:i.filter(function(lt){var ht,yt=s in lt.props?lt.props[s]:(ht=lt.type.defaultProps)===null||ht===void 0?void 0:ht[s];return yt===N}),dataStartIndex:l,dataEndIndex:h}),R=z.length,D,V,F;fht(_.domain,C,S)&&(D=Db(_.domain,null,C),g&&(S==="number"||E!=="auto")&&(F=mh(z,P,"category")));var W=OI(S);if(!D||D.length===0){var Z,q=(Z=_.domain)!==null&&Z!==void 0?Z:W;if(P){if(D=mh(z,P,S),S==="category"&&g){var tt=w6(D);w&&tt?(V=D,D=nm(0,R)):w||(D=KA(q,D,p).reduce(function(lt,ht){return lt.indexOf(ht)>=0?lt:[].concat(Gc(lt),[ht])},[]))}else if(S==="category")w?D=D.filter(function(lt){return lt!==""&&!re(lt)}):D=KA(q,D,p).reduce(function(lt,ht){return lt.indexOf(ht)>=0||ht===""||re(ht)?lt:[].concat(Gc(lt),[ht])},[]);else if(S==="number"){var at=Fet(z,i.filter(function(lt){var ht,yt,vt=s in lt.props?lt.props[s]:(ht=lt.type.defaultProps)===null||ht===void 0?void 0:ht[s],wt="hide"in lt.props?lt.props.hide:(yt=lt.type.defaultProps)===null||yt===void 0?void 0:yt.hide;return vt===N&&(I||!wt)}),P,o,u);at&&(D=at)}g&&(S==="number"||E!=="auto")&&(F=mh(z,P,"category"))}else g?D=nm(0,R):a&&a[N]&&a[N].hasStack&&S==="number"?D=m==="expand"?[0,1]:c$(a[N].stackGroups,l,h):D=r$(z,i.filter(function(lt){var ht=s in lt.props?lt.props[s]:lt.type.defaultProps[s],yt="hide"in lt.props?lt.props.hide:lt.type.defaultProps.hide;return ht===N&&(I||!yt)}),S,u,!0);if(S==="number")D=_0(f,D,N,o,k),q&&(D=Db(q,D,C));else if(S==="category"&&q){var H=q,K=D.every(function(lt){return H.indexOf(lt)>=0});K&&(D=H)}}return mt(mt({},b),{},te({},N,mt(mt({},_),{},{axisType:o,domain:D,categoricalDomain:F,duplicateDomain:V,originalDomain:(x=_.domain)!==null&&x!==void 0?x:W,isCategorical:g,layout:u})))},{})},Fht=function(t,n){var r=n.graphicalItems,i=n.Axis,o=n.axisType,s=n.axisIdKey,a=n.stackGroups,l=n.dataStartIndex,h=n.dataEndIndex,u=t.layout,f=t.children,m=Tg(t.data,{graphicalItems:r,dataStartIndex:l,dataEndIndex:h}),g=m.length,b=i$(u,o),p=-1;return r.reduce(function(x,_){var S=_.type.defaultProps!==void 0?mt(mt({},_.type.defaultProps),_.props):_.props,P=S[s],C=OI("number");if(!x[P]){p++;var w;return b?w=nm(0,g):a&&a[P]&&a[P].hasStack?(w=c$(a[P].stackGroups,l,h),w=_0(f,w,P,o)):(w=Db(C,r$(m,r.filter(function(E){var k,I,N=s in E.props?E.props[s]:(k=E.type.defaultProps)===null||k===void 0?void 0:k[s],z="hide"in E.props?E.props.hide:(I=E.type.defaultProps)===null||I===void 0?void 0:I.hide;return N===P&&!z}),"number",u),i.defaultProps.allowDataOverflow),w=_0(f,w,P,o)),mt(mt({},x),{},te({},P,mt(mt({axisType:o},i.defaultProps),{},{hide:!0,orientation:ii(Lht,"".concat(o,".").concat(p%2),null),domain:w,originalDomain:C,isCategorical:b,layout:u})))}return x},{})},Wht=function(t,n){var r=n.axisType,i=r===void 0?"xAxis":r,o=n.AxisComp,s=n.graphicalItems,a=n.stackGroups,l=n.dataStartIndex,h=n.dataEndIndex,u=t.children,f="".concat(i,"Id"),m=Wr(u,o),g={};return m&&m.length?g=zht(t,{axes:m,graphicalItems:s,axisType:i,axisIdKey:f,stackGroups:a,dataStartIndex:l,dataEndIndex:h}):s&&s.length&&(g=Fht(t,{Axis:o,graphicalItems:s,axisType:i,axisIdKey:f,stackGroups:a,dataStartIndex:l,dataEndIndex:h})),g},Vht=function(t){var n=Ms(t),r=No(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:aw(r,function(i){return i.coordinate}),tooltipAxis:n,tooltipAxisBandSize:Fp(n,r)}},LC=function(t){var n=t.children,r=t.defaultShowTooltip,i=ti(n,Nc),o=0,s=0;return t.data&&t.data.length!==0&&(s=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(o=i.props.startIndex),i.props.endIndex>=0&&(s=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:o,dataEndIndex:s,activeTooltipIndex:-1,isTooltipActive:!!r}},Uht=function(t){return!t||!t.length?!1:t.some(function(n){var r=Lo(n&&n.type);return r&&r.indexOf("Bar")>=0})},DC=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},Hht=function(t,n){var r=t.props,i=t.graphicalItems,o=t.xAxisMap,s=o===void 0?{}:o,a=t.yAxisMap,l=a===void 0?{}:a,h=r.width,u=r.height,f=r.children,m=r.margin||{},g=ti(f,Nc),b=ti(f,Ga),p=Object.keys(l).reduce(function(w,E){var k=l[E],I=k.orientation;return!k.mirror&&!k.hide?mt(mt({},w),{},te({},I,w[I]+k.width)):w},{left:m.left||0,right:m.right||0}),x=Object.keys(s).reduce(function(w,E){var k=s[E],I=k.orientation;return!k.mirror&&!k.hide?mt(mt({},w),{},te({},I,ii(w,"".concat(I))+k.height)):w},{top:m.top||0,bottom:m.bottom||0}),_=mt(mt({},x),p),S=_.bottom;g&&(_.bottom+=g.props.height||Nc.defaultProps.height),b&&n&&(_=Bet(_,i,r,n));var P=h-_.left-_.right,C=u-_.top-_.bottom;return mt(mt({brushBottom:S},_),{},{width:Math.max(P,0),height:Math.max(C,0)})},qht=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},Mg=function(t){var n=t.chartName,r=t.GraphicalChild,i=t.defaultTooltipEventType,o=i===void 0?"axis":i,s=t.validateTooltipEventTypes,a=s===void 0?["axis"]:s,l=t.axisComponents,h=t.legendContent,u=t.formatAxisMap,f=t.defaultProps,m=function(_,S){var P=S.graphicalItems,C=S.stackGroups,w=S.offset,E=S.updateId,k=S.dataStartIndex,I=S.dataEndIndex,N=_.barSize,z=_.layout,R=_.barGap,D=_.barCategoryGap,V=_.maxBarSize,F=DC(z),W=F.numericAxisName,Z=F.cateAxisName,q=Uht(P),tt=[];return P.forEach(function(at,H){var K=Tg(_.data,{graphicalItems:[at],dataStartIndex:k,dataEndIndex:I}),lt=at.type.defaultProps!==void 0?mt(mt({},at.type.defaultProps),at.props):at.props,ht=lt.dataKey,yt=lt.maxBarSize,vt=lt["".concat(W,"Id")],wt=lt["".concat(Z,"Id")],Nt={},Rt=l.reduce(function(ke,Sn){var Mn,vn,qr=S["".concat(Sn.axisType,"Map")],rr=lt["".concat(Sn.axisType,"Id")];qr&&qr[rr]||Sn.axisType==="zAxis"||(process.env.NODE_ENV!=="production"?zr(!1,"Specifying a(n) ".concat(Sn.axisType,"Id requires a corresponding ").concat(Sn.axisType,"Id on the targeted graphical component ").concat((Mn=at==null||(vn=at.type)===null||vn===void 0?void 0:vn.displayName)!==null&&Mn!==void 0?Mn:"")):zr());var Ge=qr[rr];return mt(mt({},ke),{},te(te({},Sn.axisType,Ge),"".concat(Sn.axisType,"Ticks"),No(Ge)))},Nt),pt=Rt[Z],xt=Rt["".concat(Z,"Ticks")],bt=C&&C[vt]&&C[vt].hasStack&&Ket(at,C[vt].stackGroups),Q=Lo(at.type).indexOf("Bar")>=0,kt=Fp(pt,xt),ft=[],Xt=q&&Det({barSize:N,stackGroups:C,totalSize:qht(Rt,Z)});if(Q){var we,_e,dn=re(yt)?V:yt,fe=(we=(_e=Fp(pt,xt,!0))!==null&&_e!==void 0?_e:dn)!==null&&we!==void 0?we:0;ft=jet({barGap:R,barCategoryGap:D,bandSize:fe!==kt?fe:kt,sizeList:Xt[wt],maxBarSize:dn}),fe!==kt&&(ft=ft.map(function(ke){return mt(mt({},ke),{},{position:mt(mt({},ke.position),{},{offset:ke.position.offset-fe/2})})}))}var pn=at&&at.type&&at.type.getComposedData;pn&&tt.push({props:mt(mt({},pn(mt(mt({},Rt),{},{displayedData:K,props:_,dataKey:ht,item:at,bandSize:kt,barPosition:ft,offset:w,stackedData:bt,layout:z,dataStartIndex:k,dataEndIndex:I}))),{},te(te(te({key:at.key||"item-".concat(H)},W,Rt[W]),Z,Rt[Z]),"animationId",E)),childIndex:R6(at,_.children),item:at})}),tt},g=function(_,S){var P=_.props,C=_.dataStartIndex,w=_.dataEndIndex,E=_.updateId;if(!US({props:P}))return null;var k=P.children,I=P.layout,N=P.stackOffset,z=P.data,R=P.reverseStackOrder,D=DC(I),V=D.numericAxisName,F=D.cateAxisName,W=Wr(k,r),Z=Yet(z,W,"".concat(V,"Id"),"".concat(F,"Id"),N,R),q=l.reduce(function(lt,ht){var yt="".concat(ht.axisType,"Map");return mt(mt({},lt),{},te({},yt,Wht(P,mt(mt({},ht),{},{graphicalItems:W,stackGroups:ht.axisType===V&&Z,dataStartIndex:C,dataEndIndex:w}))))},{}),tt=Hht(mt(mt({},q),{},{props:P,graphicalItems:W}),S==null?void 0:S.legendBBox);Object.keys(q).forEach(function(lt){q[lt]=u(P,q[lt],tt,lt.replace("Map",""),n)});var at=q["".concat(F,"Map")],H=Vht(at),K=m(P,mt(mt({},q),{},{dataStartIndex:C,dataEndIndex:w,updateId:E,graphicalItems:W,stackGroups:Z,offset:tt}));return mt(mt({formattedGraphicalItems:K,graphicalItems:W,offset:tt,stackGroups:Z},H),q)},b=function(x){function _(S){var P,C,w;return Aht(this,_),w=Tht(this,_,[S]),te(w,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),te(w,"accessibilityManager",new hht),te(w,"handleLegendBBoxUpdate",function(E){if(E){var k=w.state,I=k.dataStartIndex,N=k.dataEndIndex,z=k.updateId;w.setState(mt({legendBBox:E},g({props:w.props,dataStartIndex:I,dataEndIndex:N,updateId:z},mt(mt({},w.state),{},{legendBBox:E}))))}}),te(w,"handleReceiveSyncEvent",function(E,k,I){if(w.props.syncId===E){if(I===w.eventEmitterSymbol&&typeof w.props.syncMethod!="function")return;w.applySyncEvent(k)}}),te(w,"handleBrushChange",function(E){var k=E.startIndex,I=E.endIndex;if(k!==w.state.dataStartIndex||I!==w.state.dataEndIndex){var N=w.state.updateId;w.setState(function(){return mt({dataStartIndex:k,dataEndIndex:I},g({props:w.props,dataStartIndex:k,dataEndIndex:I,updateId:N},w.state))}),w.triggerSyncEvent({dataStartIndex:k,dataEndIndex:I})}}),te(w,"handleMouseEnter",function(E){var k=w.getMouseInfo(E);if(k){var I=mt(mt({},k),{},{isTooltipActive:!0});w.setState(I),w.triggerSyncEvent(I);var N=w.props.onMouseEnter;ne(N)&&N(I,E)}}),te(w,"triggeredAfterMouseMove",function(E){var k=w.getMouseInfo(E),I=k?mt(mt({},k),{},{isTooltipActive:!0}):{isTooltipActive:!1};w.setState(I),w.triggerSyncEvent(I);var N=w.props.onMouseMove;ne(N)&&N(I,E)}),te(w,"handleItemMouseEnter",function(E){w.setState(function(){return{isTooltipActive:!0,activeItem:E,activePayload:E.tooltipPayload,activeCoordinate:E.tooltipPosition||{x:E.cx,y:E.cy}}})}),te(w,"handleItemMouseLeave",function(){w.setState(function(){return{isTooltipActive:!1}})}),te(w,"handleMouseMove",function(E){E.persist(),w.throttleTriggeredAfterMouseMove(E)}),te(w,"handleMouseLeave",function(E){w.throttleTriggeredAfterMouseMove.cancel();var k={isTooltipActive:!1};w.setState(k),w.triggerSyncEvent(k);var I=w.props.onMouseLeave;ne(I)&&I(k,E)}),te(w,"handleOuterEvent",function(E){var k=N6(E),I=ii(w.props,"".concat(k));if(k&&ne(I)){var N,z;/.*touch.*/i.test(k)?z=w.getMouseInfo(E.changedTouches[0]):z=w.getMouseInfo(E),I((N=z)!==null&&N!==void 0?N:{},E)}}),te(w,"handleClick",function(E){var k=w.getMouseInfo(E);if(k){var I=mt(mt({},k),{},{isTooltipActive:!0});w.setState(I),w.triggerSyncEvent(I);var N=w.props.onClick;ne(N)&&N(I,E)}}),te(w,"handleMouseDown",function(E){var k=w.props.onMouseDown;if(ne(k)){var I=w.getMouseInfo(E);k(I,E)}}),te(w,"handleMouseUp",function(E){var k=w.props.onMouseUp;if(ne(k)){var I=w.getMouseInfo(E);k(I,E)}}),te(w,"handleTouchMove",function(E){E.changedTouches!=null&&E.changedTouches.length>0&&w.throttleTriggeredAfterMouseMove(E.changedTouches[0])}),te(w,"handleTouchStart",function(E){E.changedTouches!=null&&E.changedTouches.length>0&&w.handleMouseDown(E.changedTouches[0])}),te(w,"handleTouchEnd",function(E){E.changedTouches!=null&&E.changedTouches.length>0&&w.handleMouseUp(E.changedTouches[0])}),te(w,"handleDoubleClick",function(E){var k=w.props.onDoubleClick;if(ne(k)){var I=w.getMouseInfo(E);k(I,E)}}),te(w,"handleContextMenu",function(E){var k=w.props.onContextMenu;if(ne(k)){var I=w.getMouseInfo(E);k(I,E)}}),te(w,"triggerSyncEvent",function(E){w.props.syncId!==void 0&&cv.emit(uv,w.props.syncId,E,w.eventEmitterSymbol)}),te(w,"applySyncEvent",function(E){var k=w.props,I=k.layout,N=k.syncMethod,z=w.state.updateId,R=E.dataStartIndex,D=E.dataEndIndex;if(E.dataStartIndex!==void 0||E.dataEndIndex!==void 0)w.setState(mt({dataStartIndex:R,dataEndIndex:D},g({props:w.props,dataStartIndex:R,dataEndIndex:D,updateId:z},w.state)));else if(E.activeTooltipIndex!==void 0){var V=E.chartX,F=E.chartY,W=E.activeTooltipIndex,Z=w.state,q=Z.offset,tt=Z.tooltipTicks;if(!q)return;if(typeof N=="function")W=N(tt,E);else if(N==="value"){W=-1;for(var at=0;at<tt.length;at++)if(tt[at].value===E.activeLabel){W=at;break}}var H=mt(mt({},q),{},{x:q.left,y:q.top}),K=Math.min(V,H.x+H.width),lt=Math.min(F,H.y+H.height),ht=tt[W]&&tt[W].value,yt=A0(w.state,w.props.data,W),vt=tt[W]?{x:I==="horizontal"?tt[W].coordinate:K,y:I==="horizontal"?lt:tt[W].coordinate}:MI;w.setState(mt(mt({},E),{},{activeLabel:ht,activeCoordinate:vt,activePayload:yt,activeTooltipIndex:W}))}else w.setState(E)}),te(w,"renderCursor",function(E){var k,I=w.state,N=I.isTooltipActive,z=I.activeCoordinate,R=I.activePayload,D=I.offset,V=I.activeTooltipIndex,F=I.tooltipAxisBandSize,W=w.getTooltipEventType(),Z=(k=E.props.active)!==null&&k!==void 0?k:N,q=w.props.layout,tt=E.key||"_recharts-cursor";return y.createElement(vht,{key:tt,activeCoordinate:z,activePayload:R,activeTooltipIndex:V,chartName:n,element:E,isActive:Z,layout:q,offset:D,tooltipAxisBandSize:F,tooltipEventType:W})}),te(w,"renderPolarAxis",function(E,k,I){var N=ii(E,"type.axisType"),z=ii(w.state,"".concat(N,"Map")),R=E.type.defaultProps,D=R!==void 0?mt(mt({},R),E.props):E.props,V=z&&z[D["".concat(N,"Id")]];return y.cloneElement(E,mt(mt({},V),{},{className:pe(N,V.className),key:E.key||"".concat(k,"-").concat(I),ticks:No(V,!0)}))}),te(w,"renderPolarGrid",function(E){var k=E.props,I=k.radialLines,N=k.polarAngles,z=k.polarRadius,R=w.state,D=R.radiusAxisMap,V=R.angleAxisMap,F=Ms(D),W=Ms(V),Z=W.cx,q=W.cy,tt=W.innerRadius,at=W.outerRadius;return y.cloneElement(E,{polarAngles:Array.isArray(N)?N:No(W,!0).map(function(H){return H.coordinate}),polarRadius:Array.isArray(z)?z:No(F,!0).map(function(H){return H.coordinate}),cx:Z,cy:q,innerRadius:tt,outerRadius:at,key:E.key||"polar-grid",radialLines:I})}),te(w,"renderLegend",function(){var E=w.state.formattedGraphicalItems,k=w.props,I=k.children,N=k.width,z=k.height,R=w.props.margin||{},D=N-(R.left||0)-(R.right||0),V=e$({children:I,formattedGraphicalItems:E,legendWidth:D,legendContent:h});if(!V)return null;var F=V.item,W=IC(V,bht);return y.cloneElement(F,mt(mt({},W),{},{chartWidth:N,chartHeight:z,margin:R,onBBoxUpdate:w.handleLegendBBoxUpdate}))}),te(w,"renderTooltip",function(){var E,k=w.props,I=k.children,N=k.accessibilityLayer,z=ti(I,ei);if(!z)return null;var R=w.state,D=R.isTooltipActive,V=R.activeCoordinate,F=R.activePayload,W=R.activeLabel,Z=R.offset,q=(E=z.props.active)!==null&&E!==void 0?E:D;return y.cloneElement(z,{viewBox:mt(mt({},Z),{},{x:Z.left,y:Z.top}),active:q,label:W,payload:q?F:[],coordinate:V,accessibilityLayer:N})}),te(w,"renderBrush",function(E){var k=w.props,I=k.margin,N=k.data,z=w.state,R=z.offset,D=z.dataStartIndex,V=z.dataEndIndex,F=z.updateId;return y.cloneElement(E,{key:E.key||"_recharts-brush",onChange:Nd(w.handleBrushChange,E.props.onChange),data:N,x:At(E.props.x)?E.props.x:R.left,y:At(E.props.y)?E.props.y:R.top+R.height+R.brushBottom-(I.bottom||0),width:At(E.props.width)?E.props.width:R.width,startIndex:D,endIndex:V,updateId:"brush-".concat(F)})}),te(w,"renderReferenceElement",function(E,k,I){if(!E)return null;var N=w,z=N.clipPathId,R=w.state,D=R.xAxisMap,V=R.yAxisMap,F=R.offset,W=E.type.defaultProps||{},Z=E.props,q=Z.xAxisId,tt=q===void 0?W.xAxisId:q,at=Z.yAxisId,H=at===void 0?W.yAxisId:at;return y.cloneElement(E,{key:E.key||"".concat(k,"-").concat(I),xAxis:D[tt],yAxis:V[H],viewBox:{x:F.left,y:F.top,width:F.width,height:F.height},clipPathId:z})}),te(w,"renderActivePoints",function(E){var k=E.item,I=E.activePoint,N=E.basePoint,z=E.childIndex,R=E.isRange,D=[],V=k.props.key,F=k.item.type.defaultProps!==void 0?mt(mt({},k.item.type.defaultProps),k.item.props):k.item.props,W=F.activeDot,Z=F.dataKey,q=mt(mt({index:z,dataKey:Z,cx:I.x,cy:I.y,r:4,fill:Iw(k.item),strokeWidth:2,stroke:"#fff",payload:I.payload,value:I.value},Yt(W,!1)),fp(W));return D.push(_.renderActiveDot(W,q,"".concat(V,"-activePoint-").concat(z))),N?D.push(_.renderActiveDot(W,mt(mt({},q),{},{cx:N.x,cy:N.y}),"".concat(V,"-basePoint-").concat(z))):R&&D.push(null),D}),te(w,"renderGraphicChild",function(E,k,I){var N=w.filterFormatItem(E,k,I);if(!N)return null;var z=w.getTooltipEventType(),R=w.state,D=R.isTooltipActive,V=R.tooltipAxis,F=R.activeTooltipIndex,W=R.activeLabel,Z=w.props.children,q=ti(Z,ei),tt=N.props,at=tt.points,H=tt.isRange,K=tt.baseLine,lt=N.item.type.defaultProps!==void 0?mt(mt({},N.item.type.defaultProps),N.item.props):N.item.props,ht=lt.activeDot,yt=lt.hide,vt=lt.activeBar,wt=lt.activeShape,Nt=!!(!yt&&D&&q&&(ht||vt||wt)),Rt={};z!=="axis"&&q&&q.props.trigger==="click"?Rt={onClick:Nd(w.handleItemMouseEnter,E.props.onClick)}:z!=="axis"&&(Rt={onMouseLeave:Nd(w.handleItemMouseLeave,E.props.onMouseLeave),onMouseEnter:Nd(w.handleItemMouseEnter,E.props.onMouseEnter)});var pt=y.cloneElement(E,mt(mt({},N.props),Rt));function xt(Sn){return typeof V.dataKey=="function"?V.dataKey(Sn.payload):null}if(Nt)if(F>=0){var bt,Q;if(V.dataKey&&!V.allowDuplicatedCategory){var kt=typeof V.dataKey=="function"?xt:"payload.".concat(V.dataKey.toString());bt=hp(at,kt,W),Q=H&&K&&hp(K,kt,W)}else bt=at==null?void 0:at[F],Q=H&&K&&K[F];if(wt||vt){var ft=E.props.activeIndex!==void 0?E.props.activeIndex:F;return[y.cloneElement(E,mt(mt(mt({},N.props),Rt),{},{activeIndex:ft})),null,null]}if(!re(bt))return[pt].concat(Gc(w.renderActivePoints({item:N,activePoint:bt,basePoint:Q,childIndex:F,isRange:H})))}else{var Xt,we=(Xt=w.getItemByXY(w.state.activeCoordinate))!==null&&Xt!==void 0?Xt:{graphicalItem:pt},_e=we.graphicalItem,dn=_e.item,fe=dn===void 0?E:dn,pn=_e.childIndex,ke=mt(mt(mt({},N.props),Rt),{},{activeIndex:pn});return[y.cloneElement(fe,ke),null,null]}return H?[pt,null,null]:[pt,null]}),te(w,"renderCustomized",function(E,k,I){return y.cloneElement(E,mt(mt({key:"recharts-customized-".concat(I)},w.props),w.state))}),te(w,"renderMap",{CartesianGrid:{handler:zd,once:!0},ReferenceArea:{handler:w.renderReferenceElement},ReferenceLine:{handler:zd},ReferenceDot:{handler:w.renderReferenceElement},XAxis:{handler:zd},YAxis:{handler:zd},Brush:{handler:w.renderBrush,once:!0},Bar:{handler:w.renderGraphicChild},Line:{handler:w.renderGraphicChild},Area:{handler:w.renderGraphicChild},Radar:{handler:w.renderGraphicChild},RadialBar:{handler:w.renderGraphicChild},Scatter:{handler:w.renderGraphicChild},Pie:{handler:w.renderGraphicChild},Funnel:{handler:w.renderGraphicChild},Tooltip:{handler:w.renderCursor,once:!0},PolarGrid:{handler:w.renderPolarGrid,once:!0},PolarAngleAxis:{handler:w.renderPolarAxis},PolarRadiusAxis:{handler:w.renderPolarAxis},Customized:{handler:w.renderCustomized}}),w.clipPathId="".concat((P=S.id)!==null&&P!==void 0?P:fl("recharts"),"-clip"),w.throttleTriggeredAfterMouseMove=e2(w.triggeredAfterMouseMove,(C=S.throttleDelay)!==null&&C!==void 0?C:1e3/60),w.state={},w}return kht(_,x),Cht(_,[{key:"componentDidMount",value:function(){var P,C;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(P=this.props.margin.left)!==null&&P!==void 0?P:0,top:(C=this.props.margin.top)!==null&&C!==void 0?C:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var P=this.props,C=P.children,w=P.data,E=P.height,k=P.layout,I=ti(C,ei);if(I){var N=I.props.defaultIndex;if(!(typeof N!="number"||N<0||N>this.state.tooltipTicks.length-1)){var z=this.state.tooltipTicks[N]&&this.state.tooltipTicks[N].value,R=A0(this.state,w,N,z),D=this.state.tooltipTicks[N].coordinate,V=(this.state.offset.top+E)/2,F=k==="horizontal",W=F?{x:D,y:V}:{y:D,x:V},Z=this.state.formattedGraphicalItems.find(function(tt){var at=tt.item;return at.type.name==="Scatter"});Z&&(W=mt(mt({},W),Z.props.points[N].tooltipPosition),R=Z.props.points[N].tooltipPayload);var q={activeTooltipIndex:N,isTooltipActive:!0,activeLabel:z,activePayload:R,activeCoordinate:W};this.setState(q),this.renderCursor(I),this.accessibilityManager.setIndex(N)}}}},{key:"getSnapshotBeforeUpdate",value:function(P,C){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==C.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==P.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==P.margin){var w,E;this.accessibilityManager.setDetails({offset:{left:(w=this.props.margin.left)!==null&&w!==void 0?w:0,top:(E=this.props.margin.top)!==null&&E!==void 0?E:0}})}return null}},{key:"componentDidUpdate",value:function(P){Jv([ti(P.children,ei)],[ti(this.props.children,ei)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var P=ti(this.props.children,ei);if(P&&typeof P.props.shared=="boolean"){var C=P.props.shared?"axis":"item";return a.indexOf(C)>=0?C:o}return o}},{key:"getMouseInfo",value:function(P){if(!this.container)return null;var C=this.container,w=C.getBoundingClientRect(),E=lX(w),k={chartX:Math.round(P.pageX-E.left),chartY:Math.round(P.pageY-E.top)},I=w.width/C.offsetWidth||1,N=this.inRange(k.chartX,k.chartY,I);if(!N)return null;var z=this.state,R=z.xAxisMap,D=z.yAxisMap,V=this.getTooltipEventType(),F=RC(this.state,this.props.data,this.props.layout,N);if(V!=="axis"&&R&&D){var W=Ms(R).scale,Z=Ms(D).scale,q=W&&W.invert?W.invert(k.chartX):null,tt=Z&&Z.invert?Z.invert(k.chartY):null;return mt(mt({},k),{},{xValue:q,yValue:tt},F)}return F?mt(mt({},k),F):null}},{key:"inRange",value:function(P,C){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,E=this.props.layout,k=P/w,I=C/w;if(E==="horizontal"||E==="vertical"){var N=this.state.offset,z=k>=N.left&&k<=N.left+N.width&&I>=N.top&&I<=N.top+N.height;return z?{x:k,y:I}:null}var R=this.state,D=R.angleAxisMap,V=R.radiusAxisMap;if(D&&V){var F=Ms(D);return QA({x:k,y:I},F)}return null}},{key:"parseEventsOfWrapper",value:function(){var P=this.props.children,C=this.getTooltipEventType(),w=ti(P,ei),E={};w&&C==="axis"&&(w.props.trigger==="click"?E={onClick:this.handleClick}:E={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var k=fp(this.props,this.handleOuterEvent);return mt(mt({},k),E)}},{key:"addListener",value:function(){cv.on(uv,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){cv.removeListener(uv,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(P,C,w){for(var E=this.state.formattedGraphicalItems,k=0,I=E.length;k<I;k++){var N=E[k];if(N.item===P||N.props.key===P.key||C===Lo(N.item.type)&&w===N.childIndex)return N}return null}},{key:"renderClipPath",value:function(){var P=this.clipPathId,C=this.state.offset,w=C.left,E=C.top,k=C.height,I=C.width;return y.createElement("defs",null,y.createElement("clipPath",{id:P},y.createElement("rect",{x:w,y:E,height:k,width:I})))}},{key:"getXScales",value:function(){var P=this.state.xAxisMap;return P?Object.entries(P).reduce(function(C,w){var E=$C(w,2),k=E[0],I=E[1];return mt(mt({},C),{},te({},k,I.scale))},{}):null}},{key:"getYScales",value:function(){var P=this.state.yAxisMap;return P?Object.entries(P).reduce(function(C,w){var E=$C(w,2),k=E[0],I=E[1];return mt(mt({},C),{},te({},k,I.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(P){var C;return(C=this.state.xAxisMap)===null||C===void 0||(C=C[P])===null||C===void 0?void 0:C.scale}},{key:"getYScaleByAxisId",value:function(P){var C;return(C=this.state.yAxisMap)===null||C===void 0||(C=C[P])===null||C===void 0?void 0:C.scale}},{key:"getItemByXY",value:function(P){var C=this.state,w=C.formattedGraphicalItems,E=C.activeItem;if(w&&w.length)for(var k=0,I=w.length;k<I;k++){var N=w[k],z=N.props,R=N.item,D=R.type.defaultProps!==void 0?mt(mt({},R.type.defaultProps),R.props):R.props,V=Lo(R.type);if(V==="Bar"){var F=(z.data||[]).find(function(tt){return eot(P,tt)});if(F)return{graphicalItem:N,payload:F}}else if(V==="RadialBar"){var W=(z.data||[]).find(function(tt){return QA(P,tt)});if(W)return{graphicalItem:N,payload:W}}else if(xg(N,E)||wg(N,E)||cf(N,E)){var Z=Vst({graphicalItem:N,activeTooltipItem:E,itemData:D.data}),q=D.activeIndex===void 0?Z:D.activeIndex;return{graphicalItem:mt(mt({},N),{},{childIndex:q}),payload:cf(N,E)?D.data[Z]:N.props.data[Z]}}}return null}},{key:"render",value:function(){var P=this;if(!US(this))return null;var C=this.props,w=C.children,E=C.className,k=C.width,I=C.height,N=C.style,z=C.compact,R=C.title,D=C.desc,V=IC(C,xht),F=Yt(V,!1);if(z)return y.createElement(dC,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},y.createElement(tb,tc({},F,{width:k,height:I,title:R,desc:D}),this.renderClipPath(),qS(w,this.renderMap)));if(this.props.accessibilityLayer){var W,Z;F.tabIndex=(W=this.props.tabIndex)!==null&&W!==void 0?W:0,F.role=(Z=this.props.role)!==null&&Z!==void 0?Z:"application",F.onKeyDown=function(tt){P.accessibilityManager.keyboardEvent(tt)},F.onFocus=function(){P.accessibilityManager.focus()}}var q=this.parseEventsOfWrapper();return y.createElement(dC,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},y.createElement("div",tc({className:pe("recharts-wrapper",E),style:mt({position:"relative",cursor:"default",width:k,height:I},N)},q,{ref:function(at){P.container=at}}),y.createElement(tb,tc({},F,{width:k,height:I,title:R,desc:D,style:Dht}),this.renderClipPath(),qS(w,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(y.Component);te(b,"displayName",n),te(b,"defaultProps",mt({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},f)),te(b,"getDerivedStateFromProps",function(x,_){var S=x.dataKey,P=x.data,C=x.children,w=x.width,E=x.height,k=x.layout,I=x.stackOffset,N=x.margin,z=_.dataStartIndex,R=_.dataEndIndex;if(_.updateId===void 0){var D=LC(x);return mt(mt(mt({},D),{},{updateId:0},g(mt(mt({props:x},D),{},{updateId:0}),_)),{},{prevDataKey:S,prevData:P,prevWidth:w,prevHeight:E,prevLayout:k,prevStackOffset:I,prevMargin:N,prevChildren:C})}if(S!==_.prevDataKey||P!==_.prevData||w!==_.prevWidth||E!==_.prevHeight||k!==_.prevLayout||I!==_.prevStackOffset||!oc(N,_.prevMargin)){var V=LC(x),F={chartX:_.chartX,chartY:_.chartY,isTooltipActive:_.isTooltipActive},W=mt(mt({},RC(_,P,k)),{},{updateId:_.updateId+1}),Z=mt(mt(mt({},V),F),W);return mt(mt(mt({},Z),g(mt({props:x},Z),_)),{},{prevDataKey:S,prevData:P,prevWidth:w,prevHeight:E,prevLayout:k,prevStackOffset:I,prevMargin:N,prevChildren:C})}if(!Jv(C,_.prevChildren)){var q,tt,at,H,K=ti(C,Nc),lt=K&&(q=(tt=K.props)===null||tt===void 0?void 0:tt.startIndex)!==null&&q!==void 0?q:z,ht=K&&(at=(H=K.props)===null||H===void 0?void 0:H.endIndex)!==null&&at!==void 0?at:R,yt=lt!==z||ht!==R,vt=!re(P),wt=vt&&!yt?_.updateId:_.updateId+1;return mt(mt({updateId:wt},g(mt(mt({props:x},_),{},{updateId:wt,dataStartIndex:lt,dataEndIndex:ht}),_)),{},{prevChildren:C,dataStartIndex:lt,dataEndIndex:ht})}return null}),te(b,"renderActiveDot",function(x,_,S){var P;return y.isValidElement(x)?P=y.cloneElement(x,_):ne(x)?P=x(_):P=y.createElement(mg,_),y.createElement(xe,{className:"recharts-active-dot",key:S},P)});var p=y.forwardRef(function(_,S){return y.createElement(b,tc({},_,{ref:S}))});return p.displayName=b.displayName,p},Ght=Mg({chartName:"BarChart",GraphicalChild:gl,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:ta},{axisType:"yAxis",AxisComp:ea}],formatAxisMap:Lw}),Yht=Mg({chartName:"PieChart",GraphicalChild:Yo,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:bg},{axisType:"radiusAxis",AxisComp:yg}],formatAxisMap:snt,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}}),Zht=Mg({chartName:"ScatterChart",GraphicalChild:If,defaultTooltipEventType:"item",validateTooltipEventTypes:["item"],axisComponents:[{axisType:"xAxis",AxisComp:ta},{axisType:"yAxis",AxisComp:ea},{axisType:"zAxis",AxisComp:$f}],formatAxisMap:Lw}),Kht=Mg({chartName:"AreaChart",GraphicalChild:Qs,axisComponents:[{axisType:"xAxis",AxisComp:ta},{axisType:"yAxis",AxisComp:ea}],formatAxisMap:Lw});function kI(e){const{channel:t,enabled:n,apiBaseUrl:r,getAuthToken:i,createWebSocket:o,parseClassName:s,brandColor:a="#8b5cf6",style:l={},preview:h,previewForm:u,instanceKey:f,onResolved:m}=e,[g,b]=y.useState(h?{approvalId:"preview",form:u||{title:"Which account should I use?",description:"The signup page offers multiple providers — pick one and give me the promo code if you have it.",sections:[{title:"Sign-in provider",fields:[{type:"radio",key:"provider",label:"Provider",options:["Google","GitHub","Email"]},{type:"checkbox",key:"scopes",label:"Optional scopes",options:["Read profile","Send email"]}]},{title:"Details",fields:[{type:"text",key:"promo",label:"Promo code",placeholder:"e.g. LAUNCH20"}]}]}}:null),[p,x]=y.useState({}),[_,S]=y.useState(!1),[P,C]=y.useState(!1),[w,E]=y.useState(null);y.useEffect(()=>{const R=g==null?void 0:g.expiresAt;if(!R){E(null);return}const D=()=>{const F=Math.max(0,Math.floor((new Date(R).getTime()-Date.now())/1e3));E(F),F<=0&&b(null)};D();const V=setInterval(D,1e3);return()=>clearInterval(V)},[g]);const k=R=>r&&/^(https?:)?\/\//i.test(r)?new URL(R,r).toString():`/api${R}`;y.useEffect(()=>{if(!n||!t)return;let R=!1,D=null;const V=()=>{R||(D=o(t),Cm(D)&&(D.addEventListener("open",async()=>{try{const W=await fetch(k("/agent/tools/approvals"),{headers:{Authorization:`Bearer ${(i==null?void 0:i())||localStorage.getItem("token")||""}`}});if(!W.ok||R)return;const{approvals:Z}=await W.json(),q=(Z||[]).find(at=>{var H;return at.status==="pending"&&((H=at.toolInput)==null?void 0:H.sections)});q&&(!q.expiresAt||new Date(q.expiresAt).getTime()>Date.now())&&(x({}),b({approvalId:q.id,form:q.toolInput,expiresAt:q.expiresAt}))}catch{}}),D.onmessage=F=>{var Z,q;let W=F==null?void 0:F.data;if(typeof W=="string")try{W=JSON.parse(W)}catch{return}(W==null?void 0:W.type)==="step_paused"&&((Z=W.pauseMetadata)!=null&&Z.form)&&((q=W.pauseMetadata)!=null&&q.approvalId)&&(x({}),b({approvalId:W.pauseMetadata.approvalId,form:W.pauseMetadata.form,expiresAt:W.pauseMetadata.expiresAt}))},D.onclose=()=>{R||setTimeout(V,3e3)},D.onerror=()=>{var F;(F=D==null?void 0:D.close)==null||F.call(D)}))};return V(),()=>{var F;R=!0,(F=D==null?void 0:D.close)==null||F.call(D)}},[n,t,f]);const I=async R=>{if(!g||_)return;const D=g.approvalId;if(D==="preview"){b(null),m==null||m(R,D);return}S(!0);const V=`/agent/tools/approvals/${encodeURIComponent(D)}/${R?"approve":"deny"}`;try{await fetch(k(V),{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${(i==null?void 0:i())||localStorage.getItem("token")||""}`},body:R?JSON.stringify({formValues:p,dontAskAgain:P}):"{}"})}catch{}S(!1),b(null),m==null||m(R,D)},N=R=>{const D=p[R.key],V=F=>x(W=>({...W,[R.key]:F}));if(R.type==="radio"||R.type==="checkbox"){const F=R.type==="checkbox",W=F?Array.isArray(D)?D:[]:[D].filter(Boolean);return y.createElement("div",{key:R.key,style:{display:"flex",flexWrap:"wrap",gap:8}},(R.options||[]).map(Z=>y.createElement("button",{key:Z,type:"button",onClick:()=>V(F?W.includes(Z)?W.filter(q=>q!==Z):[...W,Z]:Z),style:{padding:"6px 12px",borderRadius:999,fontSize:12,border:"none",cursor:"pointer",fontWeight:W.includes(Z)?600:500,backgroundColor:W.includes(Z)?"#ffffff":"rgba(255,255,255,0.1)",color:W.includes(Z)?"#000000":"#ffffff"}},Z)))}return y.createElement("input",{key:R.key,type:R.secure===!0?"password":"text",placeholder:R.placeholder||"",value:D||"",onChange:F=>V(F.target.value),style:{width:"100%",padding:"8px 12px",borderRadius:8,border:"none",outline:"none",fontSize:14,backgroundColor:"rgba(255,255,255,0.1)",color:"#ffffff"}})},z=l.variant==="drawer";return g?al.createPortal(y.createElement("div",{key:"approval",onClick:R=>R.stopPropagation(),className:l.className?s==null?void 0:s(l.className):void 0,style:{position:"fixed",inset:0,zIndex:1100,display:"flex",alignItems:z?"stretch":"center",justifyContent:z?"flex-end":"center",backgroundColor:"rgba(0,0,0,0.7)",padding:z?0:16}},y.createElement("div",{style:{position:"relative",overflow:"hidden",borderRadius:z?0:17,padding:1,width:"100%",maxWidth:z?"24rem":"40rem",maxHeight:"100%",display:"flex",backgroundColor:"rgba(255,255,255,0.08)"}},y.createElement("div",{style:{position:"absolute",inset:"-150%",background:`conic-gradient(from 0deg, transparent 0%, ${a}99 14%, transparent 30%)`,animation:"bf-spin 6s linear infinite"}}),y.createElement("div",{className:l.panelClassName?s==null?void 0:s(l.panelClassName):void 0,style:{position:"relative",zIndex:1,width:"100%",maxHeight:"100%",overflowY:"auto",borderRadius:z?0:16,backgroundColor:"#12121a",color:"#f8fafc",padding:20,display:"flex",flexDirection:"column",gap:16,...l.style||{}}},w!=null?y.createElement("span",{style:{position:"absolute",top:12,right:16,fontSize:12,fontVariantNumeric:"tabular-nums",color:w<=15?"#f87171":"rgba(255,255,255,0.5)"}},`${Math.floor(w/60)}:${String(w%60).padStart(2,"0")}`):null,y.createElement("p",{style:{fontSize:20,fontWeight:600,color:"#ffffff"}},g.form.title||"Input needed"),g.form.description?y.createElement("p",{style:{fontSize:16,color:"rgba(255,255,255,0.6)"}},g.form.description):null,...(g.form.sections||[]).map((R,D)=>y.createElement("div",{key:R.title||D,style:{display:"flex",flexDirection:"column",gap:8}},R.title?y.createElement("p",{style:{fontSize:11,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em",color:"rgba(255,255,255,0.5)"}},R.title):null,...(R.fields||[]).map(V=>y.createElement("label",{key:V.key,style:{display:"flex",flexDirection:"column",gap:6}},y.createElement("span",{style:{fontSize:14,color:"rgba(255,255,255,0.8)"}},V.label||V.key),N(V))))),y.createElement("label",{style:{display:"flex",alignItems:"center",gap:8,fontSize:13,color:"rgba(255,255,255,0.6)",cursor:"pointer"}},y.createElement("input",{type:"checkbox",checked:P,onChange:R=>C(R.target.checked),style:{accentColor:a}}),"Don't ask again this session"),y.createElement("div",{style:{display:"flex",flexDirection:"row",justifyContent:"flex-end",gap:8,paddingTop:4}},y.createElement("button",{type:"button",disabled:_,onClick:()=>void I(!1),style:{padding:"8px 16px",borderRadius:999,fontSize:14,fontWeight:500,border:"none",cursor:"pointer",backgroundColor:"rgba(255,255,255,0.1)",color:"#ffffff",opacity:_?.4:1}},"Cancel"),y.createElement("button",{type:"button",disabled:_,onClick:()=>void I(!0),style:{padding:"8px 16px",borderRadius:999,fontSize:14,fontWeight:600,border:"none",cursor:"pointer",backgroundColor:"#ffffff",color:"#000000",opacity:_?.4:1}},"Submit"))))),document.body):null}const Xht=(e,t,n)=>Math.min(n,Math.max(t,e));function Jht(e){const t=e.map(o=>{const s=o.size??o.width,a=typeof s=="number"?s:/%\s*$/.test(String(s??""))?parseFloat(s):NaN;return Number.isFinite(a)?a:NaN}),n=t.filter(o=>!Number.isNaN(o)),r=Math.max(0,100-n.reduce((o,s)=>o+s,0)),i=Math.max(1,t.length-n.length);return t.map(o=>Number.isNaN(o)?r/i:o)}const Qht=y.forwardRef(function({api:t,config:n,componentKey:r},i){const o=Array.isArray(n.panes)?n.panes:[],s=n.orientation==="vertical",[a,l]=y.useState(()=>Jht(o)),[h,u]=y.useState(!1),f=y.useRef(null),m=(S,P)=>{var E,k;const C=Number(((E=o[S])==null?void 0:E.minSize)??10),w=Number(((k=o[S+1])==null?void 0:k.minSize)??10);l(I=>{const N=I[S]+I[S+1],z=Xht(P,C,N-w);return I.map((R,D)=>D===S?z:D===S+1?N-z:R)})},g=S=>P=>{const C=f.current;if(!C||P.button!==0)return;P.preventDefault();const w=C.ownerDocument,E=C.getBoundingClientRect(),k=s?E.height:E.width,I=s?P.clientY:P.clientX,N=a[S];u(!0);const z=D=>{const V=((s?D.clientY:D.clientX)-I)/k*100;m(S,N+V)},R=()=>{w.removeEventListener("pointermove",z),w.removeEventListener("pointerup",R),w.removeEventListener("pointercancel",R),u(!1)};w.addEventListener("pointermove",z),w.addEventListener("pointerup",R),w.addEventListener("pointercancel",R)},b=S=>P=>{const C=s?"ArrowUp":"ArrowLeft",w=s?"ArrowDown":"ArrowRight";P.key!==C&&P.key!==w||(P.preventDefault(),m(S,a[S]+(P.key===w?2:-2)))},p={display:"flex",flexDirection:s?"column":"row",alignItems:"stretch",...n.className?t.parseClassName(n.className):{width:"100%",flex:1,minHeight:0}},x=[];o.forEach((S,P)=>{x.push(U("div",{key:`${r}-split-${P}`,style:{flex:`${a[P]} 1 0px`,minWidth:0,minHeight:0,display:"flex",flexDirection:"column",overflow:"hidden",pointerEvents:h?"none":void 0}},S.component?t.renderComponent(S.component,P,`${r}-split`):null)),P!==o.length-1&&x.push(U("div",{key:`${r}-split-handle-${P}`,role:"separator",tabIndex:0,"aria-orientation":s?"horizontal":"vertical","aria-valuenow":Math.round(a[P]),"aria-label":"Resize",onPointerDown:g(P),onKeyDown:b(P),style:{flex:"0 0 auto",[s?"height":"width"]:8,cursor:s?"row-resize":"col-resize",touchAction:"none",userSelect:"none",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1}},U("div",{style:{[s?"height":"width"]:1,[s?"width":"height"]:"100%",background:t.cfg.colors.border}})))});const _=t.getCommonProps(r,p,n);return U("div",{key:r,..._,ref:S=>{f.current=S,typeof i=="function"?i(S):i&&(i.current=S)}},...x)}),tft=()=>{try{if(typeof window<"u")return window.localStorage.getItem("backflow_dev_diagnostics")==="1"}catch{}return!1},bm=(...e)=>{tft()&&console.warn(...e)};function eft(e,t,n){var s,a;const r=t.expression?((s=e.evaluateExpression)==null?void 0:s.call(e,t.expression,t.expressionUrl,n,t.expressionKey))??e.interpolateText(t.expression):e.interpolateText(t.text||"");if(t.className){const l=((a=e.parseClassNameResponsive)==null?void 0:a.call(e,t.className,n))??e.parseClassName(t.className);if(e.renderMode!=="css-driven"){const u=Cx(t.className);if(u.size>0){const m=Qt(u,e.containerWidth,"1rem");l.fontSize=m}const f=eu(t.className);f.size>0&&(l.display=Qt(f,e.containerWidth,"block"))}const h=e.getCommonProps(n,l,t);return U("p",{key:n,className:t.className,...h},r)}const i={};t.fontSize!==void 0&&(i.fontSize=`${t.fontSize}px`),t.fontWeight!==void 0&&(i.fontWeight=t.fontWeight),t.color!==void 0&&(i.color=t.color),t.textAlign!==void 0&&(i.textAlign=t.textAlign);const o=e.getCommonProps(n,i,t);return U("p",{key:n,...o},r)}function nft(e){return e.replace(/<script[\s\S]*?<\/script>/gi,"").replace(/<iframe[\s\S]*?<\/iframe>/gi,"").replace(/\son\w+\s*=\s*("[^"]*"|'[^']*'|[^\s>]+)/gi,"")}function rft(e,t,n){const r=String(e.apiUrl||"").replace(/\/$/,""),i=e.interpolateText(t.text||t.html||"").replace(/(src|href)=("|')\/(?!\/)/g,r?`$1=$2${r}/`:"$1=$2/"),o=e.getCommonProps(n,{color:e.cfg.colors.text},t);return U("div",{key:n,className:t.className,...o,dangerouslySetInnerHTML:{__html:nft(i)}})}function ift(e,t,n){var l;const r=e.interpolateText(t.href||""),i=()=>{t.onClick?e.handleButtonClick(t.onClick,{onSuccess:t.onSuccess,onError:t.onError},{optimistic:t.optimistic,feedback:t.feedback}):r&&(r.startsWith("http")||e.previewMode?window.open(r,"_blank","noopener,noreferrer"):window.location.href=r)},o=()=>{var h;if(!e.interactionDisabled){if((h=t.confirmation)!=null&&h.enabled){(e.setOverlayModal||e.setActiveModal)({id:"__confirm",definition:{title:t.confirmation.title||"Confirm Action",size:"sm",components:[{type:"text",text:t.confirmation.message||"Are you sure you want to proceed?",color:e.cfg.colorMode==="light"?"rgba(0,0,0,0.65)":"rgba(255,255,255,0.6)",fontSize:14}],actions:[{label:"Cancel",variant:"ghost",dismiss:!0},{label:"Confirm",variant:"primary",dismiss:!0}]},legacyOnConfirm:()=>{i()}});return}i()}};if(t.className){const h=((l=e.parseClassNameResponsive)==null?void 0:l.call(e,t.className,n))??e.parseClassName(t.className);if(e.renderMode!=="css-driven"){const f=eu(t.className);f.size>0&&(h.display=Qt(f,e.containerWidth,"inline"));const m=Cx(t.className);if(m.size>0){const g=Qt(m,e.containerWidth,"1rem");h.fontSize=g}}t.icon&&(h.display="inline-flex",h.alignItems="center",h.gap=6);const u=e.getCommonProps(n,h,t);return U("a",{key:n,className:t.className,...u,onClick:e.interactionDisabled?void 0:o,href:e.interactionDisabled?void 0:r&&!t.onClick?r:void 0,target:r.startsWith("http")?"_blank":void 0,rel:r.startsWith("http")?"noopener noreferrer":void 0},t.icon?e.renderIcon(t.icon,16):null,e.interpolateText(t.text||t.label||""))}const s={cursor:"pointer",textDecoration:"none",transition:"all 0.2s",display:"inline-flex",alignItems:"center",gap:6},a=e.getCommonProps(n,s,t);return U("a",{key:n,...a,onClick:e.interactionDisabled?void 0:o,href:e.interactionDisabled?void 0:r&&!t.onClick?r:void 0,target:r.startsWith("http")?"_blank":void 0,rel:r.startsWith("http")?"noopener noreferrer":void 0},t.icon?e.renderIcon(t.icon,16):null,e.interpolateText(t.text||t.label||""))}function oft(e,t,n){var b,p,x,_,S;let r=!1;if(t.activeWhen){if(t.activeWhen===e.currentSceneId)r=!0;else if(typeof t.activeWhen=="string"){const P=t.activeWhen.split("=",2);P.length===2&&(r=String(((b=e.sceneData)==null?void 0:b[P[0]])??"")===P[1])}}const i=r?{onClick:t.activeOnClick||t.onClick,onSuccess:t.activeOnSuccess||t.onSuccess,onError:t.activeOnError||t.onError,icon:t.activeIcon||t.icon,text:t.activeText||t.text,label:t.activeText||t.label}:{onClick:t.onClick,onSuccess:t.onSuccess,onError:t.onError,icon:t.icon,text:t.text,label:t.label},o=t.disabled?((p=e.evaluateCondition)==null?void 0:p.call(e,t.disabled))??!1:!1,s=P=>{var k;const C=()=>e.handleButtonClick(i.onClick||"",{onSuccess:i.onSuccess,onError:i.onError},{optimistic:t.optimistic,feedback:t.feedback,payload:t.payload,refetchScope:t.refetchScope,mergeResponse:t.mergeResponse,anchorElement:P==null?void 0:P.currentTarget,openUrl:t.openUrl}),w=t.sceneLoader===!1,E=t.pageLoader===!1?C():e.withLoading?e.withLoading(n,C):C();w&&((k=e.sceneLoaderOptOut)==null||k.add(n)),E.catch(I=>{var z,R;const N=((z=t.onError)==null?void 0:z.message)||(I==null?void 0:I.message)||"An error occurred";(R=e.showToast)==null||R.call(e,N,"error")}).finally(()=>{var I;w&&((I=e.sceneLoaderOptOut)==null||I.delete(n))})},a=P=>{var C;if((C=t.confirmation)!=null&&C.enabled){(e.setOverlayModal||e.setActiveModal)({id:"__confirm",definition:{title:t.confirmation.title||"Confirm Action",size:"sm",components:[{type:"text",text:t.confirmation.message||"Are you sure you want to proceed?",color:e.cfg.colorMode==="light"?"rgba(0,0,0,0.65)":"rgba(255,255,255,0.6)",fontSize:16}],actions:[{label:t.confirmation.cancelLabel||"Cancel",variant:"ghost",dismiss:!0},{label:t.confirmation.confirmLabel||"Confirm",variant:"primary",dismiss:!0,confirm:!0}]},legacyOnConfirm:()=>{s(P)}});return}s(P)},l=(x=e.buttonLoading)==null?void 0:x[n];if(t.className){let P=((_=e.parseClassNameResponsive)==null?void 0:_.call(e,t.className,n))??e.parseClassName(t.className);if(e.renderMode!=="css-driven"){const R=eu(t.className);R.size>0&&(P.display=Qt(R,e.containerWidth,"inline-flex"));const D=Cx(t.className);D.size>0&&(P.fontSize=Qt(D,e.containerWidth,"1rem"))}let C=t.className;if(r&&t.activeClass){const R=((S=e.parseClassNameResponsive)==null?void 0:S.call(e,t.activeClass,n))??e.parseClassName(t.activeClass);P={...P,...R},C=`${t.className} ${t.activeClass}`}const w={display:"inline-flex",alignItems:"center",justifyContent:P.textAlign==="left"?"flex-start":P.textAlign==="right"?"flex-end":"center",gap:"6px",...P,...t.color&&{color:t.color},...t.background&&{background:t.background},...t.borderRadius!==void 0&&{borderRadius:typeof t.borderRadius=="number"?`${t.borderRadius}px`:t.borderRadius},...t.borderColor&&{borderColor:t.borderColor},...l&&{opacity:.6,pointerEvents:"none"}},E={},k=(t.className||"").split(/\s+/).filter(Boolean);for(const R of k)if(R.startsWith("hover:")){const D=R.replace("hover:","");if(D.startsWith("bg-")||D.startsWith("text-")||D.startsWith("border-")){const V=e.parseClassName(D);Object.assign(E,V)}}const I=e.getCommonProps(n,w,t),N=[];i.icon&&!l&&N.push(U("span",{key:"icon",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,...i.text?{marginRight:"6px"}:{}}},e.renderIcon(i.icon,t.iconSize||16))),l&&N.unshift(U("div",{key:"spinner",className:"bf-btn-spinner",style:{width:"14px",height:"14px",border:"2px solid currentColor",borderTopColor:"transparent",borderRadius:"50%",flexShrink:0}})),Array.isArray(t.children)&&t.children.length>0?t.children.forEach((R,D)=>{N.push(e.renderComponent(R,D,n))}):N.push(i.label||i.text||(i.icon?"":"Button"));const z={};return Object.keys(E).length>0&&(z.onMouseEnter=R=>{E.backgroundColor&&(R.currentTarget.style.backgroundColor=E.backgroundColor),E.color&&(R.currentTarget.style.color=E.color),E.borderColor&&(R.currentTarget.style.borderColor=E.borderColor)},z.onMouseLeave=R=>{E.backgroundColor&&(R.currentTarget.style.backgroundColor=w.backgroundColor||""),E.color&&(R.currentTarget.style.color=w.color||""),E.borderColor&&(R.currentTarget.style.borderColor=w.borderColor||"")}),U("button",{key:n,className:C,"aria-label":t.ariaLabel?e.interpolateText(t.ariaLabel):void 0,title:e.interpolateText(t.tooltip||t.ariaLabel||i.label||i.text||"Button"),...I,...z,onClick:e.interactionDisabled?void 0:a,disabled:l||o||void 0},...N)}const h=e.cfg.colors.primary,u=e.cfg.colors.accent,f={display:"inline-flex",alignItems:"center",gap:"6px",padding:"0.75rem 1.5rem",borderRadius:"0.75rem",fontWeight:600,transition:e.cfg.effects.transition,color:e.cfg.colorMode==="light"?"#ffffff":e.cfg.colors.text,background:r?e.cfg.colors.primary:`linear-gradient(to right, ${h}, ${u})`,boxShadow:r?"none":`0 10px 15px -3px ${h}40`,...l&&{opacity:.6,pointerEvents:"none"}},m=e.getCommonProps(n,f,t),g=[];return l&&g.push(U("div",{key:"spinner",className:"bf-btn-spinner",style:{width:"14px",height:"14px",border:"2px solid currentColor",borderTopColor:"transparent",borderRadius:"50%",flexShrink:0}})),i.icon&&!l&&g.push(U("span",{key:"icon",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,marginRight:"6px"}},e.renderIcon(i.icon,t.iconSize||16))),g.push(i.label||i.text||(i.icon?"":"Button")),U("button",{key:n,"aria-label":t.ariaLabel?e.interpolateText(t.ariaLabel):void 0,title:e.interpolateText(t.tooltip||t.ariaLabel||i.label||i.text||"Button"),...t.scrollActiveIntoView&&r?{ref:P=>{!P||P.dataset.bfScrolled==="1"||(P.dataset.bfScrolled="1",P.scrollIntoView({inline:"center",block:"nearest",behavior:"smooth"}))}}:{},...m,onClick:e.interactionDisabled?void 0:a,disabled:l||o||void 0},...g)}function sft({api:e,c:t,componentKey:n}){var u;const r=e.interpolateText(t.src||""),i=y.useRef(null),[o,s]=y.useState(0),a=typeof t.parallax=="number"?t.parallax:typeof t.parallaxStrength=="number"?t.parallaxStrength:32,l=t.height||t.h||260,h=t.className?((u=e.parseClassNameResponsive)==null?void 0:u.call(e,t.className,n))??e.parseClassName(t.className):{};return y.useEffect(()=>{const f=i.current;if(!f)return;const m=()=>{const g=f.getBoundingClientRect(),b=window.innerHeight||800,p=Math.min(1,Math.max(0,(b-g.top)/(b+g.height)));s((.5-p)*2*a)};return window.addEventListener("scroll",m,{capture:!0,passive:!0}),window.addEventListener("resize",m),m(),()=>{window.removeEventListener("scroll",m,{capture:!0}),window.removeEventListener("resize",m)}},[a]),t.skipEmpty&&(!r||r==="placeholder")?null:y.createElement("div",{ref:i,key:n,className:t.className,"data-component-key":n,style:{position:"relative",overflow:"hidden",...h,height:h.height||l}},y.createElement("img",{src:r,alt:t.alt||"",style:{position:"absolute",left:0,top:"-15%",width:"100%",height:"130%",objectFit:"cover",transform:`translateY(${o}px)`,willChange:"transform"},onError:()=>e.setImageErrors(f=>({...f,[n]:!0}))}))}function aft(e,t,n){var h;if(t.parallax)return y.createElement(sft,{api:e,c:t,componentKey:n});const r=e.interpolateText(t.src||""),i=!r||r==="placeholder",o=e.imageErrors[`${n}::${r}`];if(t.skipEmpty&&i)return null;const s=()=>{var m;const u=t.className?{...((m=e.parseClassNameResponsive)==null?void 0:m.call(e,t.className,n))??e.parseClassName(t.className),border:`1px dashed ${e.cfg.colors.borderSubtle}`,display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden"}:{border:`1px dashed ${e.cfg.colors.borderSubtle}`,display:"flex",alignItems:"center",justifyContent:"center",padding:10,height:"200px",borderRadius:"0.75rem"},f=e.getCommonProps(n,u,t);return U("div",{key:n,...f},t.className?null:U("span",{style:{color:e.cfg.colors.textPlaceholder,fontSize:"0.875rem"}},"Image"))};if(i||o)return s();if(t.className){const u=((h=e.parseClassNameResponsive)==null?void 0:h.call(e,t.className,n))??e.parseClassName(t.className),f=e.getCommonProps(n,u,t),m={key:`${n}-${r}`,src:r,alt:t.alt||"",className:t.className,...f,onError:()=>e.setImageErrors(g=>({...g,[`${n}::${r}`]:!0}))};return t.onClick&&!e.interactionDisabled&&(m.onClick=()=>e.handleButtonClick(t.onClick)),U("img",m)}const a={width:t.w||t.width||"100%",height:t.h||t.height||"auto",objectFit:"cover",borderRadius:"0.75rem"};t.onClick&&(a.cursor="pointer");const l={key:`${n}-${r}`,src:r,alt:t.alt||"",...e.getCommonProps(n,a,t),onError:()=>e.setImageErrors(u=>({...u,[`${n}::${r}`]:!0}))};return t.onClick&&!e.interactionDisabled&&(l.onClick=()=>e.handleButtonClick(t.onClick)),U("img",l)}function lft(e,t,n){var o;if(t.className){const s=((o=e.parseClassNameResponsive)==null?void 0:o.call(e,t.className,n))??e.parseClassName(t.className),a=e.getCommonProps(n,s,t);return U("input",{key:n,className:t.className,...a,name:t.name,placeholder:t.placeholder,type:t.inputType||"text",...t.step!==void 0?{step:t.step}:{},...t.min!==void 0?{min:t.min}:{},...t.max!==void 0?{max:t.max}:{},...t.inputMode?{inputMode:t.inputMode}:{},value:e.sceneData[t.name||""]??"",style:{...(a==null?void 0:a.style)||{},colorScheme:e.cfg.colorMode==="light"?"light":"dark"},onClick:t.openPickerOnClick?l=>{var h,u;return(u=(h=l.currentTarget).showPicker)==null?void 0:u.call(h)}:void 0,onChange:l=>e.setSceneData(h=>({...h,[t.name||""]:l.target.value})),onKeyDown:t.onKeyDown?l=>{if(l.key==="Enter"){if(l.preventDefault(),t.payload&&typeof t.payload=="object"&&!Object.values(t.payload).some(u=>typeof u=="string"?String(e.interpolateText(u)??"").trim()!=="":!0))return;e.handleButtonClick(t.onKeyDown,void 0,{payload:t.payload})}}:void 0})}const r={width:"100%",padding:"8px 8px",borderRadius:e.cfg.components.inputRadius||void 0,backgroundColor:e.cfg.colors.surface,color:e.cfg.colors.text,border:`1px solid ${e.cfg.colorMode==="light"?e.cfg.colors.border:"transparent"}`,outline:"none",transition:e.cfg.effects.transition},i=e.getCommonProps(n,r,t);if(t.label){const s=e.getCommonProps(n,{width:"100%"},t);return U("div",{key:n,...s},U("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,color:e.cfg.colors.textSecondary,marginBottom:"0.75rem"}},t.label),U("input",{...i,name:t.name,placeholder:t.placeholder,type:t.inputType||"text",...t.step!==void 0?{step:t.step}:{},...t.min!==void 0?{min:t.min}:{},...t.max!==void 0?{max:t.max}:{},...t.inputMode?{inputMode:t.inputMode}:{},value:e.sceneData[t.name||""]??"",onChange:a=>e.setSceneData(l=>({...l,[t.name||""]:a.target.value}))}))}return U("input",{key:n,...i,name:t.name,placeholder:t.placeholder,type:t.inputType||"text",...t.step!==void 0?{step:t.step}:{},...t.min!==void 0?{min:t.min}:{},...t.max!==void 0?{max:t.max}:{},...t.inputMode?{inputMode:t.inputMode}:{},value:e.sceneData[t.name||""]??"",onChange:s=>e.setSceneData(a=>({...a,[t.name||""]:s.target.value}))})}function cft(e,t,n){const r=t.value?e.interpolateText(String(t.value)):e.sceneData[t.name||""]??"";return U("input",{key:n,type:"hidden",name:t.name,value:r})}function uft(e,t,n){var l;const r={backgroundColor:e.cfg.colors.surface,color:e.cfg.colors.text},i=e.cfg.colorMode==="light"?"light":"dark",o=()=>{var h;return[t.placeholder&&U("option",{key:"__placeholder",value:"",style:r},t.placeholder),...((h=t.options)==null?void 0:h.map(u=>U("option",{key:u.value,value:u.value,style:r},u.label)))||[]]};if(t.className){const h={...((l=e.parseClassNameResponsive)==null?void 0:l.call(e,t.className,n))??e.parseClassName(t.className),colorScheme:i},u=e.getCommonProps(n,h,t);return U("select",{key:n,className:t.className,...u,name:t.name,value:e.sceneData[t.name||""]??"",onChange:f=>e.setSceneData(m=>({...m,[t.name||""]:f.target.value}))},...o())}const s={width:"100%",padding:"8px 8px",borderRadius:e.cfg.components.inputRadius||void 0,backgroundColor:e.cfg.colors.surface,color:e.cfg.colors.text,border:`1px solid ${e.cfg.colorMode==="light"?e.cfg.colors.border:"transparent"}`,outline:"none",transition:e.cfg.effects.transition,cursor:"pointer",appearance:"none",colorScheme:i},a=e.getCommonProps(n,s,t);if(t.label){const h=e.getCommonProps(n,{width:"100%"},t);return U("div",{key:n,...h},U("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,color:e.cfg.colors.textSecondary,marginBottom:"0.75rem"}},t.label),U("select",{...a,name:t.name,value:e.sceneData[t.name||""]??"",onChange:u=>e.setSceneData(f=>({...f,[t.name||""]:u.target.value}))},...o()))}return U("select",{key:n,...a,name:t.name,value:e.sceneData[t.name||""]??"",onChange:h=>e.setSceneData(u=>({...u,[t.name||""]:h.target.value}))},...o())}function hft(e,t,n){var f;const r=e.cfg.colors,i=e.sceneData[t.name||""]===!0||e.sceneData[t.name||""]==="true",o="flex flex-row items-center gap-3 cursor-pointer select-none",s=t.className?`${o} ${t.className}`:`${o} text-white`,a=e.parseClassName(s),h={...e.parseClassName("w-5 h-5 rounded shrink-0"),appearance:"none",WebkitAppearance:"none",width:20,height:20,borderRadius:6,border:`1.5px solid ${i?r.primary:r.border}`,backgroundColor:i?r.primary:"transparent",backgroundImage:i?`url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'><path d='M20 6 9 17l-5-5'/></svg>")`:"none",backgroundRepeat:"no-repeat",backgroundPosition:"center",backgroundSize:"13px 13px",boxSizing:"border-box",flexShrink:0,cursor:"pointer",transition:"background-color 120ms ease, border-color 120ms ease"},u=e.getCommonProps(n,a,t);return U("label",{key:n,className:s,...u},U("input",{type:"checkbox",className:"shrink-0",style:h,checked:i,"aria-label":t.ariaLabel||t.label,disabled:e.interactionDisabled||(t.disabled?((f=e.evaluateCondition)==null?void 0:f.call(e,t.disabled))??!0:!1),onChange:m=>{var p;const g=m.target.checked,b=async()=>{try{t.onChange&&await e.handleButtonClick(t.onChange),e.setSceneData(x=>({...x,[t.name||""]:g}))}catch(x){e.showToast(x instanceof Error?x.message:"Setting could not be saved","error")}};if(g&&((p=t.confirmation)!=null&&p.enabled)){(e.setOverlayModal||e.setActiveModal)({id:"__confirm",definition:{title:t.confirmation.title||"Confirm",size:"sm",components:[{type:"text",text:t.confirmation.message}],actions:[{label:"Cancel",variant:"ghost",dismiss:!0},{label:"Confirm",variant:"primary",dismiss:!0}]},legacyOnConfirm:()=>{b()}});return}b()}}),U("span",{},t.label||""))}function fft(e,t,n){const r={green:{bg:"#065f4620",color:"#22c55e",border:"#22c55e40"},blue:{bg:"#1e40af20",color:"#3b82f6",border:"#3b82f640"},red:{bg:"#7f1d1d20",color:"#ef4444",border:"#ef444440"},yellow:{bg:"#71370220",color:"#eab308",border:"#eab30840"},purple:{bg:"#581c8720",color:"#a855f7",border:"#a855f740"},orange:{bg:"#7c2d1220",color:"#f97316",border:"#f9731640"},gray:{bg:"#37415120",color:"#9ca3af",border:"#9ca3af40"},cyan:{bg:"#0e727020",color:"#06b6d4",border:"#06b6d440"},pink:{bg:"#83184420",color:"#ec4899",border:"#ec489940"}};let o=t.colorScheme||"gray";if(t.colorBy&&typeof t.colorBy=="object"){const u=(e.interpolateText(t.text||t.label||"")||"").trim().toLowerCase();t.colorBy[u]&&(o=t.colorBy[u])}const s=r[o]||r.gray,a=t.variant||"subtle";let l={display:"inline-flex",alignItems:"center",padding:"2px 8px",borderRadius:"4px",fontSize:"11px",fontWeight:600,letterSpacing:"0.025em",textTransform:"uppercase",whiteSpace:"nowrap"};a==="solid"?(l.backgroundColor=s.color,l.color="#fff"):a==="outline"?(l.backgroundColor="transparent",l.color=s.color,l.border=`1px solid ${s.border||s.color}`):(l.backgroundColor=s.bg,l.color=s.color,t.bordered&&(l.border=`1px solid ${s.border||s.color}`)),t.pill&&(l.borderRadius="9999px"),t.className&&(l={...l,...e.parseClassName(t.className)});const h=e.getCommonProps(n,l,t);return U("span",{key:n,...h},e.interpolateText(t.text||t.label||""))}function dft(e,t,n){const r={display:"inline-flex",alignItems:"center",gap:"4px",padding:"4px 10px",borderRadius:"9999px",fontSize:"12px",fontWeight:500,backgroundColor:t.bg||e.cfg.colors.surfaceHover,color:t.color||e.cfg.colors.textSecondary,...t.className?e.parseClassName(t.className):{}},i=e.getCommonProps(n,r,t);return U("span",{key:n,...i},e.interpolateText(t.text||t.label||""))}function pft(e,t,n){const i={sm:32,md:40,lg:48,xl:64}[t.size||"md"]||40,o=i*.4;if(t.src){const h={width:`${i}px`,height:`${i}px`,borderRadius:"50%",objectFit:"cover",...t.className?e.parseClassName(t.className):{}},u=e.getCommonProps(n,h,t);return U("img",{key:n,src:t.src,alt:t.alt||t.label||"",...u})}const s=t.initials||(t.label||t.text||"").split(" ").map(h=>h[0]).join("").slice(0,2).toUpperCase()||"?",a={width:`${i}px`,height:`${i}px`,borderRadius:"50%",backgroundColor:t.bg||e.cfg.colors.primary,color:t.color||e.cfg.colors.text,display:"flex",alignItems:"center",justifyContent:"center",fontSize:`${o}px`,fontWeight:600,flexShrink:0,...t.className?e.parseClassName(t.className):{}},l=e.getCommonProps(n,a,t);return U("div",{key:n,...l},s)}function mft(e,t,n){const r=t.progressValue??t.value??0,i=t.progressMax??100,o=(g,b)=>{if(typeof g=="string")return Number(e.interpolateText(g))||b;const p=Number(g);return Number.isFinite(p)?p:b},s=o(r,0),a=o(i,100),l=Math.min(100,Math.max(0,s/a*100)),u=s>a?e.cfg.colors.danger:t.color||e.cfg.colors.primary,f={width:"100%",display:"flex",flexDirection:"column",gap:"4px",...t.className?e.parseClassName(t.className):{}},m=e.getCommonProps(n,f,t);return U("div",{key:n,...m},(t.progressLabel||t.label)&&y.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:e.cfg.colors.textMuted}},U("span",null,e.interpolateText(t.progressLabel||t.label||"")),U("span",null,`${s}/${a}`)),y.createElement("div",{style:{width:"100%",height:"8px",backgroundColor:e.cfg.colors.surfaceHover,borderRadius:"4px",overflow:"hidden"}},U("div",{style:{width:`${Math.min(l,100)}%`,height:"100%",backgroundColor:u,borderRadius:"4px",transition:"width 0.3s ease"}})))}function gft(e,t,n){const r={position:"relative",width:"100%",...t.className?e.parseClassName(t.className):{}},i=e.getCommonProps(n,r,t);return U("div",{key:n,...i},U("span",{style:{position:"absolute",left:"14px",top:"50%",transform:"translateY(-50%)",color:e.cfg.colors.primary,fontSize:"14px",pointerEvents:"none",display:"flex",alignItems:"center"}},e.renderIcon("search",16)),U("input",{type:"text",name:t.name||"search",className:t.inputClassName,placeholder:t.placeholder||"Search...",value:e.sceneData[t.name||"search"]??"",onChange:o=>{e.setSceneData(s=>({...s,[t.name||"search"]:o.target.value}))},onKeyDown:t.onKeyDown?o=>{o.key==="Enter"&&(o.preventDefault(),e.handleButtonClick(e.interpolateText(t.onKeyDown),{onSuccess:t.onSuccess,onError:t.onError},{payload:t.payload,refetchScope:t.refetchScope}))}:void 0,style:{width:"100%",padding:"12px 16px 12px 40px",borderRadius:"9999px",backgroundColor:e.cfg.colorMode==="dark"?"#1f2937":"#ffffff",color:e.cfg.colorMode==="dark"?"#ffffff":e.cfg.colors.text,border:`1px solid ${e.cfg.colorMode==="dark"?"transparent":"#e5e5e5"}`,outline:"none",fontSize:e.cfg.typography.baseFontSize,transition:e.cfg.effects.transition,...t.inputClassName?e.parseClassName(t.inputClassName):{},...t.inputStyle||{}}}))}function yft(e,t,n){const r=Array.isArray(t.breadcrumbItems)?t.breadcrumbItems:[],i={display:"flex",alignItems:"center",gap:"4px",fontSize:"14px",...t.className?e.parseClassName(t.className):{}},o=e.getCommonProps(n,i,t);return U("nav",{key:n,...o,"aria-label":"Breadcrumb"},r.map((s,a)=>{const l=a===r.length-1,h=e.interpolateText(s.label);return y.createElement(y.Fragment,{key:`${n}-bc-${a}`},y.createElement(l?"span":"a",{style:{color:l?e.cfg.colors.textSecondary:e.cfg.colors.textMuted,fontWeight:l?600:400,cursor:l?"default":"pointer",textDecoration:"none",transition:e.cfg.effects.transition},...!l&&s.href?{href:s.href}:{},...!l&&s.onClick?{onClick:()=>e.handleButtonClick(s.onClick,{})}:{}},h),!l&&U("span",{style:{color:e.cfg.colors.border,margin:"0 2px"}},"/"))}))}function vft(e,t,n){const r=Array.isArray(t.items)?t.items:[],[i,o]=y.useState(0),s=t.autoplay!==!1&&r.length>1,a=t.interval||4e3,l=t.effect==="fade"?"fade":"slide";y.useEffect(()=>{if(!s||r.length<2)return;const S=setInterval(()=>o(P=>(P+1)%r.length),a);return()=>clearInterval(S)},[s,a,r.length]);const h=S=>o((S%r.length+r.length)%r.length),u=t.showArrows!==!1&&r.length>1,f=t.showDots!==!1&&r.length>1,m={position:"relative",overflow:"hidden",...t.className?e.parseClassName(t.className):{}};t.aspectRatio&&(m.aspectRatio=t.aspectRatio),!t.aspectRatio&&!t.height&&(m.height="320px");const g=e.getCommonProps(n,m,t),b=S=>typeof S=="string"?{type:"text",text:S}:S&&S.image?{type:"image",src:S.image,alt:S.alt||"",title:S.title}:S,p=r.map((S,P)=>{const C=e.renderComponent({...b(S),key:void 0},P,`${n}-slide`),w={width:"100%",height:"100%",overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center"};return l==="fade"?(w.position="absolute",w.inset="0",w.opacity=P===i?1:0,w.transition="opacity .5s ease",w.pointerEvents=P===i?"auto":"none"):w.flexShrink=0,U("div",{key:`${n}-item-${P}`,style:w},C)}),x=l==="fade"?{position:"relative",width:"100%",height:"100%"}:{display:"flex",height:"100%",transition:"transform .5s ease",transform:`translateX(-${i*100}%)`},_={position:"absolute",top:"50%",transform:"translateY(-50%)",zIndex:2,width:"36px",height:"36px",borderRadius:"50%",border:"none",background:"rgba(0,0,0,0.45)",color:"#fff",fontSize:"18px",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"};return U("div",{key:n,...g},U("div",{style:x},p),u&&U("div",{style:{..._,left:"8px"}},U("button",{style:{background:"transparent",border:"none",color:"inherit",fontSize:"18px",cursor:"pointer"},onClick:()=>h(i-1),"aria-label":"Previous slide"},"<")),u&&U("div",{style:{..._,right:"8px"}},U("button",{style:{background:"transparent",border:"none",color:"inherit",fontSize:"18px",cursor:"pointer"},onClick:()=>h(i+1),"aria-label":"Next slide"},">")),f&&U("div",{style:{position:"absolute",bottom:"10px",left:"50%",transform:"translateX(-50%)",display:"flex",gap:"6px",zIndex:2}},r.map((S,P)=>U("button",{key:`${n}-dot-${P}`,"aria-label":`Slide ${P+1}`,onClick:()=>h(P),style:{width:"10px",height:"10px",borderRadius:"50%",border:"none",cursor:"pointer",padding:0,background:P===i?"rgba(255,255,255,0.95)":"rgba(255,255,255,0.4)",transition:"background .3s ease"}}))))}function bft(e,t,n){const r=Array.isArray(t.items)?t.items:[],i=t.speed||20,o={overflow:"hidden",width:"100%",...t.className?e.parseClassName(t.className):{}},s=e.getCommonProps(n,o,t),a=l=>U("div",{key:l,style:{display:"inline-flex",alignItems:"center",gap:t.gap||"24px",paddingRight:t.gap||"24px",animation:`bf-marquee ${i}s linear infinite`,willChange:"transform",flexShrink:0}},r.map((h,u)=>{const f=typeof h=="string"?{type:"text",text:h}:h&&h.image?{type:"image",src:h.image,alt:h.alt||"",height:t.itemHeight||"48px"}:h;return e.renderComponent(f,u,`${l}-${n}-marq`)}));return U("div",{key:n,...s},U("div",{style:{display:"flex",width:"max-content"}},a("a"),a("b")))}function xft(e,t,n){const r=y.useRef(null),i=y.useRef(null),o=y.useRef(null),[s,a]=y.useState("idle"),[l,h]=y.useState(""),[u,f]=y.useState(!1),m=t.fieldName||"capture",g=t.captureMode==="qr",b=e.apiUrl||window.location.origin,p=t.uploadPath||"/api/files/upload",x=()=>{var z;(z=i.current)==null||z.getTracks().forEach(R=>R.stop()),i.current=null},_=async z=>{var F,W,Z;const R=new FormData;R.append("file",z,`${m}-${Date.now()}.jpg`);const D=await fetch(new URL(p,b).toString(),{method:"POST",headers:{Authorization:`Bearer ${localStorage.getItem("token")||""}`},body:R});if(!D.ok)throw new Error("Upload failed");const V=await D.json();return((F=V==null?void 0:V.file)==null?void 0:F.url)||((W=V==null?void 0:V.file)==null?void 0:W.publicUrl)||((Z=V==null?void 0:V.file)==null?void 0:Z.path)||(V==null?void 0:V.url)||(V==null?void 0:V.path)||""},S=async(z,R)=>{var D,V;if(s!=="done"){x();try{f(!0);const F=R||await _(z);e.setSceneData(W=>({...W,[m]:F})),h(F),a("done"),(D=e.showToast)==null||D.call(e,t.successMessage||(R?"Scanned!":"Captured & uploaded"),"success")}catch{a("error"),(V=e.showToast)==null||V.call(e,"Capture failed","error")}finally{f(!1)}}},P=()=>{var D;const z=r.current;if(!z||!z.videoWidth)return;const R=document.createElement("canvas");R.width=z.videoWidth,R.height=z.videoHeight,(D=R.getContext("2d"))==null||D.drawImage(z,0,0),R.toBlob(V=>V&&S(V),"image/jpeg",t.quality||.85)},C=async()=>{var z,R;try{const D=await navigator.mediaDevices.getUserMedia({video:{facingMode:t.facingMode||"user",...t.aspectRatio?{aspectRatio:Number(t.aspectRatio)}:{}},audio:!1});if(i.current=D,r.current&&(r.current.srcObject=D,await r.current.play().catch(()=>{})),a("running"),g){const F=window.BarcodeDetector;if(!F){a("error"),(z=e.showToast)==null||z.call(e,"QR scanning not supported in this browser","error");return}const W=new F;o.current=window.setInterval(async()=>{const Z=r.current;if(!(!Z||!Z.videoWidth||s==="done"))try{const q=await W.detect(Z);q!=null&&q.length&&S(new Blob,q[0].rawValue)}catch{}},400)}}catch{a("error"),(R=e.showToast)==null||R.call(e,"Camera access denied","error")}};y.useEffect(()=>(C(),()=>{o.current&&window.clearInterval(o.current),x()}),[]);const w={display:"flex",flexDirection:"column",alignItems:"center",gap:"12px",width:"100%",...t.className?e.parseClassName(t.className):{}},E=e.getCommonProps(n,w,t),k=U("video",{key:"cam-video",ref:r,autoPlay:!0,playsInline:!0,muted:!0,style:{width:"100%",maxWidth:t.maxWidth||"480px",borderRadius:"12px",aspectRatio:t.aspectRatio||"4 / 3",objectFit:"cover",background:"#0f172a",display:g||s!=="done"?void 0:"none"}}),I=l?U("img",{key:"cam-result",src:l,alt:"captured",style:{width:"100%",maxWidth:t.maxWidth||"480px",borderRadius:"12px",aspectRatio:t.aspectRatio||"4 / 3",objectFit:"cover",background:"#0f172a"}}):null,N=U("div",{key:"cam-actions",style:{display:"flex",gap:"10px",flexWrap:"wrap",justifyContent:"center"}},s!=="done"?U("button",{key:"cam-capture",onClick:P,disabled:u||s!=="running",style:{padding:"10px 22px",borderRadius:"9999px",border:"none",cursor:u?"wait":"pointer",background:"#3B82F6",color:"#fff",fontWeight:600}},u?"Uploading...":g?t.captureLabel||"Scan QR":t.captureLabel||"Capture"):U("button",{key:"cam-retake",onClick:()=>{h(""),a("idle"),C()},style:{padding:"10px 22px",borderRadius:"9999px",border:"1px solid #94a3b8",cursor:"pointer",background:"transparent"}},"Retake"));return U("div",{key:n,...E},k,I,t.captureLabel===!1?null:N,s==="error"?U("p",{key:"cam-err",style:{color:"#EF4444",fontSize:"13px"}},"Camera unavailable — check permissions"):null)}function wft(e,t,n){var i;if(t.className){const o=((i=e.parseClassNameResponsive)==null?void 0:i.call(e,t.className,n))??e.parseClassName(t.className),s=e.getCommonProps(n,o,t);return U("div",{key:n,className:t.className,...s})}const r=e.getCommonProps(n,{height:t.h||t.height||"24px"},t);return U("div",{key:n,...r})}function _ft(e,t,n){const r=t.className||"border-gray-700 my-4",i=e.parseClassName(r),o=e.getCommonProps(n,i,t);return U("hr",{key:n,className:r,...o})}function Sft(e,t,n){var u;const r=t.loaderVariant||"spinner",i=t.rows||3,o=t.className?((u=e.parseClassNameResponsive)==null?void 0:u.call(e,t.className,n))??e.parseClassName(t.className):{};t.rawStyle&&Object.assign(o,t.rawStyle);const s=e.getCommonProps(n,o,t),a=`${e.scopeId}-${n}`,l=e.renderMode==="css-driven"?{"data-bf-r":a}:{};if(r==="skeleton"){const f=[];for(let m=0;m<i;m++){const g=t.width||(m===i-1?"60%":"100%");f.push(U("div",{key:m,className:"bf-loader-skeleton",style:{height:t.height||"16px",width:g,borderRadius:"6px",marginBottom:m<i-1?"12px":"0"}}))}return U("div",{key:n,className:t.className,style:o,...s,...l},...f)}if(r==="shimmer"){const f=[];for(let m=0;m<i;m++){const g=t.width||(m===i-1?"60%":"100%");f.push(U("div",{key:m,className:"bf-loader-shimmer",style:{height:t.height||"16px",width:g,borderRadius:"6px",marginBottom:m<i-1?"12px":"0"}}))}return U("div",{key:n,className:t.className,style:o,...s,...l},...f)}if(r==="dots"){const f=t.color||"currentColor";return U("div",{key:n,className:t.className,style:{display:"flex",alignItems:"center",gap:"6px",...o},...s,...l},[0,1,2].map(m=>U("div",{key:m,className:"bf-loader-dot",style:{width:t.size||"8px",height:t.size||"8px",borderRadius:"50%",backgroundColor:f,animationDelay:`${m*.16}s`}})))}if(r==="pulse")return U("div",{key:n,className:t.className,style:{display:"flex",alignItems:"center",justifyContent:"center",...o},...s,...l},U("div",{className:"bf-loader-pulse",style:{width:t.size||"32px",height:t.size||"32px",borderRadius:"50%",border:`3px solid ${t.color||"currentColor"}`}}));if(r==="progress")return U("div",{key:n,className:t.className,style:{width:"100%",...o},...s,...l},U("div",{style:{height:t.height||"4px",width:"100%",backgroundColor:"rgba(128,128,128,0.2)",borderRadius:"4px",overflow:"hidden"}},U("div",{className:"bf-loader-progress-bar",style:{height:"100%",width:"30%",backgroundColor:t.color||"currentColor",borderRadius:"4px"}})));const h=t.size||"24px";return U("div",{key:n,className:t.className,style:{display:"flex",alignItems:"center",justifyContent:"center",...o},...s,...l},U("div",{className:"bf-loader-spinner",style:{width:h,height:h,border:`3px solid ${t.color?t.color+"33":"rgba(128,128,128,0.2)"}`,borderTopColor:t.color||"currentColor",borderRadius:"50%"}}))}function Pft(e,t,n){const r=t.rows||4,i=t.name||"",o=i?e.sceneData[i]??"":void 0,s=i?h=>e.setSceneData(u=>({...u,[i]:h.target.value})):void 0;if(t.className){const h=e.parseClassName(t.className),u=e.getCommonProps(n,h,t);return U("textarea",{key:n,className:t.className,...u,name:t.name,placeholder:t.placeholder,rows:r,value:o,onChange:s})}const a={width:"100%",padding:"0.75rem 1rem",borderRadius:e.cfg.components.inputRadius,backgroundColor:e.cfg.colors.surface,color:e.cfg.colors.text,border:`1px solid ${e.cfg.colorMode==="light"?e.cfg.colors.border:"transparent"}`,outline:"none",transition:e.cfg.effects.transition,resize:"vertical",fontFamily:"inherit"},l=e.getCommonProps(n,a,t);if(t.label){const h=e.getCommonProps(n,{width:"100%"},t);return U("div",{key:n,...h},U("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,color:e.cfg.colors.textSecondary,marginBottom:"0.75rem"}},t.label),U("textarea",{...l,name:t.name,placeholder:t.placeholder,rows:r,value:o,onChange:s}))}return U("textarea",{key:n,...l,name:t.name,placeholder:t.placeholder,rows:r,value:o,onChange:s})}function Aft(e,t,n){const r=t.icon||t.name||"",i=t.size||24,o=e.renderIcon(r,i),s=t.tooltip?e.interpolateText(t.tooltip):void 0;if(t.className){const a=e.parseClassName(t.className),l=e.getCommonProps(n,a,t);return U("span",{key:n,className:t.className,title:s,...l},o)}return s?U("span",{key:n,title:s},o):y.cloneElement(o,{key:n})}function Eft(e,t,n){const r=t.metricSize||"md",i=r==="sm"?"1.25rem":r==="lg"?"2.5rem":"1.75rem",o=r==="sm"?"0.75rem":r==="lg"?"1rem":"0.875rem",s=t.color||e.cfg.colors.primary,a=t.trend==="up"?"↑":t.trend==="down"?"↓":"",l=t.trendColor||(t.trend==="up"?e.cfg.colors.success:t.trend==="down"?e.cfg.colors.danger:e.cfg.colors.textMuted),h={display:"flex",flexDirection:"column",gap:"2px",padding:t.padding!==void 0?`${t.padding}px`:"0.75rem",backgroundColor:e.cfg.colors.surface,borderRadius:e.cfg.layout.borderRadiusLg,border:`1px solid ${e.cfg.colors.borderSubtle}`,...t.className?e.parseClassName(t.className):{}},u=e.getCommonProps(n,h,t);return U("div",{key:n,...u},t.label&&U("span",{style:{fontSize:o,color:e.cfg.colors.textSecondary,fontWeight:500}},e.interpolateText(t.label)),y.createElement("div",{style:{display:"flex",alignItems:"baseline",gap:"6px",marginTop:"4px"}},t.prefix&&U("span",{style:{fontSize:i,fontWeight:700,color:s}},t.prefix),U("span",{style:{fontSize:i,fontWeight:700,color:e.cfg.colors.text}},typeof t.value=="number"?t.value.toLocaleString():e.interpolateText(String(t.value??""))),t.suffix&&U("span",{style:{fontSize:i,fontWeight:700,color:s}},t.suffix),t.delta&&U("span",{style:{fontSize:"0.75rem",fontWeight:600,color:l,marginLeft:"4px"}},`${a} ${t.delta}`)))}function Cft(e,t,n){const r=t.values??t.data??t.points;let i=[];if(Array.isArray(r))i=r.map(Number);else if(typeof r=="string"&&r.trim()){const f=r.trim();if(f.startsWith("["))try{i=JSON.parse(f).map(Number)}catch{}else i=f.split(",").map(m=>Number(String(m).trim()))}if(i=i.filter(f=>Number.isFinite(f)),i.length===0)return null;const o=t.labels??t.label;let s=[];Array.isArray(o)?s=o.map(f=>String(f)):typeof o=="string"&&o.trim()&&(s=o.split(",").map(f=>f.trim()));const a=Number(t.height)||28,l=t.color||e.cfg.colors.primary,h=Math.max(...i)||1,u=t.className||"";if(t.variant==="hbars"){const f=Number(t.barHeight)||12,m=Number(t.gap)||7,g=Math.max(1,Number(t.columns)||1);return U("div",{key:n,className:u,style:{display:g>1?"grid":"flex",flexDirection:g>1?void 0:"column",gridTemplateColumns:g>1?`repeat(${g}, minmax(0, 1fr))`:void 0,gap:m,width:"100%",...u?e.parseClassName(u):{}}},...i.map((b,p)=>U("div",{key:p,style:{display:"flex",alignItems:"center",gap:"8px",width:"100%"}},U("span",{style:{flex:"0 0 auto",minWidth:(Number(t.labelWidth)||84)+"px",fontSize:"11px",color:e.cfg.colors.textMuted,textTransform:"capitalize"}},s[p]||""),U("div",{style:{flex:"1 1 auto",height:f,background:e.cfg.colors.surfaceHover||e.cfg.colors.borderSubtle||"rgba(0,0,0,0.06)",borderRadius:"6px",overflow:"hidden"}},U("div",{style:{width:Math.max(2,Math.round(b/h*100))+"%",height:"100%",background:l,borderRadius:"6px"}})),U("span",{style:{flex:"0 0 auto",minWidth:"36px",textAlign:"right",fontSize:"11px",fontWeight:600,color:e.cfg.colors.text}},String(b)))))}if(t.variant==="line"){const m=i.map((g,b)=>{const p=i.length>1?b/(i.length-1)*100:0,x=a-g/h*a;return`${p.toFixed(2)},${x.toFixed(2)}`}).join(" ");return U("svg",{key:n,viewBox:`0 0 100 ${a}`,preserveAspectRatio:"none",className:u,style:{width:"100%",height:a,display:"block",...u?e.parseClassName(u):{}}},U("polyline",{points:m,fill:"none",stroke:l,strokeWidth:2,vectorEffect:"non-scaling-stroke",strokeLinejoin:"round",strokeLinecap:"round"}))}return U("div",{key:n,className:u,style:{display:"flex",alignItems:"flex-end",gap:"2px",height:a,width:"100%",...u?e.parseClassName(u):{}}},...i.map((f,m)=>U("div",{key:m,style:{flex:"1 1 0",minWidth:"2px",maxWidth:Number(t.maxBarWidth)||18,height:Math.max(2,Math.round(f/h*a)),background:l,borderRadius:"2px",opacity:t.dimZero&&f===0?.25:1}})))}function $I(e,t,n){var r,i,o,s;if(Array.isArray(t.chartData))return t.chartData;if(typeof t.chartData=="string"){const a=t.chartData.trim().match(/^\{\{\s*([\w.]+)\s*\}\}$/);if(a){const l=(r=e.resolveReferencePath)==null?void 0:r.call(e,a[1]);if(Array.isArray(l))return l}}if(Array.isArray(t.data))return t.data;if(t.dataSource){const a=(t.key!=null?(i=e.listData)==null?void 0:i[String(t.key)]:void 0)??((o=e.listData)==null?void 0:o[n])??((s=e.listData)==null?void 0:s[String(t.dataSource)]);if(Array.isArray(a))return a;if(a&&Array.isArray(a.data))return a.data}return[]}function Tft(e,t,n){const r=$I(e,t,n);if(!Array.isArray(r)||r.length===0)return null;const i=Number(t.height)||200,o=t.barColor||e.cfg.colors.primary,s=t.horizontal===!0,a={width:"100%",padding:t.padding!==void 0?`${t.padding}px`:"0.75rem",backgroundColor:e.cfg.colors.surface,borderRadius:e.cfg.layout.borderRadiusLg,border:`1px solid ${e.cfg.colors.borderSubtle}`,...t.className?e.parseClassName(t.className):{}},l=s?{type:"number",axisLine:!1,tickLine:!1}:{dataKey:"label",axisLine:!1,tickLine:!1,tick:{fill:e.cfg.colors.textMuted,fontSize:12}},h=s?{dataKey:"label",type:"category",axisLine:!1,tickLine:!1,width:88,tick:{fill:e.cfg.colors.textMuted,fontSize:12}}:{axisLine:!1,tickLine:!1,width:36},u=y.createElement(ig,{width:"100%",height:i},y.createElement(Ght,{data:r,layout:s?"vertical":"horizontal"},y.createElement(Cg,{vertical:!s,stroke:e.cfg.colors.borderSubtle,strokeDasharray:"3 3"}),y.createElement(ta,l),y.createElement(ea,h),y.createElement(ei,{cursor:{fill:t.cursorColor||e.cfg.colors.surfaceHover,fillOpacity:t.cursorOpacity??.5},content:y.createElement(II,{prefix:t.tooltipPrefix,labelText:t.tooltipLabel,lineColor:o,backgroundColor:e.cfg.colors.surface,textColor:e.cfg.colors.text,borderColor:e.cfg.colors.borderSubtle})}),y.createElement(gl,{dataKey:"value",fill:o,radius:s?[0,4,4,0]:[4,4,0,0],isAnimationActive:t.chartAnimation!==!1,animationDuration:Number(t.animationDuration)||750})));return U("div",{key:n,style:e.getCommonProps(n,a,t)},t.title&&U("div",{style:{marginBottom:"0.75rem"}},t.title),u)}function jC(e,t,n,r=!1){const i=$I(e,t,n);if(!Array.isArray(i)||i.length===0)return null;const o=Number(t.height)||240,s=Array.isArray(t.colors)&&t.colors.length?t.colors:[e.cfg.colors.primary,e.cfg.colors.accent,"#317150","#d95020","#638173"],a={width:"100%",padding:t.padding!==void 0?`${t.padding}px`:"0.75rem",backgroundColor:e.cfg.colors.surface,borderRadius:e.cfg.layout.borderRadiusLg,border:`1px solid ${e.cfg.colors.borderSubtle}`,...t.className?e.parseClassName(t.className):{}};return U("div",{key:n,style:e.getCommonProps(n,a,t)},t.title&&U("div",{style:{marginBottom:"0.75rem"}},t.title),y.createElement(ig,{width:"100%",height:o},y.createElement(Yht,null,y.createElement(ei,{contentStyle:{borderRadius:6,border:`1px solid ${e.cfg.colors.borderSubtle}`}}),t.showLegend!==!1&&y.createElement(Ga,{iconType:"circle",wrapperStyle:{fontSize:12}}),y.createElement(Yo,{data:i,dataKey:"value",nameKey:"label",cx:"50%",cy:"50%",innerRadius:r?"55%":0,outerRadius:"80%",paddingAngle:2,isAnimationActive:t.chartAnimation!==!1,animationDuration:Number(t.animationDuration)||750},...i.map((l,h)=>y.createElement(Ef,{key:`${l.label||h}-${h}`,fill:l.color||s[h%s.length]}))))))}function Mft(e,t,n){const r=t.chartData||t.data||[];if(!Array.isArray(r)||r.length===0)return null;const i=Number(t.height)||260,o=t.xKey||"x",s=t.yKey||"y",a=t.zKey||"size",l={width:"100%",padding:t.padding!==void 0?`${t.padding}px`:"0.75rem",backgroundColor:e.cfg.colors.surface,borderRadius:e.cfg.layout.borderRadiusLg,border:`1px solid ${e.cfg.colors.borderSubtle}`,...t.className?e.parseClassName(t.className):{}};return U("div",{key:n,style:e.getCommonProps(n,l,t)},t.title&&U("div",{style:{marginBottom:"0.75rem"}},t.title),y.createElement(ig,{width:"100%",height:i},y.createElement(Zht,{margin:{top:16,right:12,bottom:8,left:0}},y.createElement(Cg,{stroke:e.cfg.colors.borderSubtle,strokeDasharray:"3 3"}),y.createElement(ta,{dataKey:o,type:"number",axisLine:!1,tickLine:!1}),y.createElement(ea,{dataKey:s,type:"number",axisLine:!1,tickLine:!1}),y.createElement($f,{dataKey:a,range:t.zRange||[50,360]}),y.createElement(ei,{contentStyle:{borderRadius:6,border:`1px solid ${e.cfg.colors.borderSubtle}`}}),y.createElement(If,{data:r,fill:t.color||e.cfg.colors.primary,isAnimationActive:t.chartAnimation!==!1,animationDuration:Number(t.animationDuration)||750}))))}function II({active:e,payload:t,label:n,prefix:r,labelText:i,lineColor:o,backgroundColor:s,textColor:a,borderColor:l}){var u;const h=Number((u=t==null?void 0:t[0])==null?void 0:u.value);return!e||!Number.isFinite(h)?null:y.createElement("div",{style:{padding:10,border:`1px solid ${l}`,borderRadius:6,backgroundColor:s,boxShadow:"0 8px 24px rgba(0, 0, 0, 0.16)",color:a}},y.createElement("p",{style:{margin:0,fontSize:14}},n),y.createElement("p",{style:{margin:"8px 0 0",color:o,fontSize:14}},`${i||"Indicative price / kg"}: ${r||""}${h.toLocaleString()}`))}function Oft({api:e,c:t,data:n,height:r,lineColor:i,fillColor:o,filled:s}){return y.createElement(ig,{width:"100%",height:r},y.createElement(Kht,{data:n,margin:{top:16,right:8,left:0,bottom:0}},t.showGrid!==!1&&y.createElement(Cg,{vertical:!1,stroke:"#dce4dc",strokeDasharray:"3 3"}),y.createElement(ta,{dataKey:"label",axisLine:!1,tickLine:!1,height:30,tick:{fill:"#638173",fontSize:12}}),y.createElement(ea,{axisLine:!1,tickLine:!1,width:40,tickCount:5,domain:[0,"auto"],tick:{fill:"#638173",fontSize:12},tickFormatter:a=>`${t.tooltipPrefix||""}${Number(a/1e3).toFixed(1).replace(".0","")}k`}),y.createElement(ei,{cursor:{stroke:"#638173",strokeDasharray:"3 3"},content:y.createElement(II,{prefix:t.tooltipPrefix,labelText:t.tooltipLabel,lineColor:i,backgroundColor:e.cfg.colors.surface,textColor:e.cfg.colors.text,borderColor:e.cfg.colors.borderSubtle})}),y.createElement(Qs,{type:"monotone",dataKey:"value",stroke:i,fill:s?o:"transparent",strokeWidth:3,dot:!1,activeDot:{r:6,fill:i,stroke:e.cfg.colors.surface,strokeWidth:3},isAnimationActive:t.chartAnimation!==!1,animationDuration:Number(t.animationDuration)||750})))}function fv(e,t,n,r=!1,i=!1){const o=Array.isArray(t.chartData)?t.chartData:[];if(o.length===0)return null;const s=o.flatMap(x=>i?[x.low,x.high]:[x.value]).map(Number).filter(Number.isFinite);if(s.length===0)return null;const a=Math.min(...s),h=Math.max(...s)-a||1,u=Number(t.height)||220,f=x=>u-(x-a)/h*u,m=t.lineColor||e.cfg.colors.accent,g=t.fillColor||`${m}33`,b={width:"100%",padding:"0.75rem",backgroundColor:e.cfg.colors.surface,borderRadius:e.cfg.layout.borderRadiusLg,border:`1px solid ${e.cfg.colors.borderSubtle}`,...t.className?e.parseClassName(t.className):{}},p=i?o.map((x,_)=>{const S=Number(x.open),P=Number(x.close),C=Number(x.high),w=Number(x.low),E=P>=S;return U("div",{key:_,style:{flex:1,height:"100%",position:"relative"}},U("div",{style:{position:"absolute",left:"50%",top:`${f(C)}px`,height:`${Math.max(1,f(w)-f(C))}px`,borderLeft:`1px solid ${E?"#22c55e":"#ef4444"}`}}),U("div",{style:{position:"absolute",left:"25%",right:"25%",top:`${f(Math.max(S,P))}px`,height:`${Math.max(3,Math.abs(f(P)-f(S)))}px`,background:E?"#22c55e":"#ef4444",borderRadius:"2px"}}))}):y.createElement(Oft,{api:e,c:t,data:o,height:u,lineColor:m,fillColor:g,filled:r});return U("div",{key:n,style:e.getCommonProps(n,b,t)},t.title&&U("div",{style:{color:e.cfg.colors.textSecondary,fontWeight:600,marginBottom:"0.75rem"}},t.title),U("div",{style:{display:"flex",alignItems:"stretch",gap:i?"4px":void 0,height:u}},p),i&&U("div",{style:{display:"flex",justifyContent:"space-between",color:e.cfg.colors.textMuted,fontSize:"0.7rem",marginTop:"4px"}},...o.map((x,_)=>U("span",{key:_},x.label||""))))}function kft(e,t,n){const r=Array.isArray(t.chartData)?t.chartData[0]||{}:{},i=t.ticker||r.ticker||r.symbol||"EUR/USD",o=t.bid??r.bid??r.price,s=t.ask??r.ask,a=t.change??r.change,l=Number(a),h=Number.isFinite(l)&&l>=0,u=e.getCommonProps(n,{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"1rem",width:"100%",padding:"0.9rem 1rem",backgroundColor:e.cfg.colors.surface,border:`1px solid ${e.cfg.colors.borderSubtle}`,borderRadius:e.cfg.layout.borderRadiusLg,...t.className?e.parseClassName(t.className):{}},t);return U("div",{key:n,...u},U("div",{},U("div",{style:{color:e.cfg.colors.text,fontWeight:700}},i),t.label&&U("div",{style:{color:e.cfg.colors.textMuted,fontSize:"0.75rem"}},t.label)),U("div",{style:{display:"flex",gap:"1rem",alignItems:"baseline",fontVariantNumeric:"tabular-nums"}},o!=null&&U("span",{style:{color:e.cfg.colors.text,fontWeight:700}},String(o)),s!=null&&U("span",{style:{color:e.cfg.colors.textSecondary}},String(s)),a!=null&&U("span",{style:{color:h?"#22c55e":"#ef4444",fontSize:"0.8rem",fontWeight:600}},`${h?"+":""}${a}`)))}function $ft({api:e,c:t,componentKey:n}){var x,_,S,P;const r=y.useRef(null),i=y.useRef(null),o=y.useRef(null),[s,a]=y.useState(null),l=y.useRef(null),[h,u]=y.useState(()=>Array.isArray(t.chartData)?t.chartData:[]);y.useEffect(()=>{Array.isArray(t.chartData)&&u(t.chartData)},[t.chartData]);const f=e.interpolateText(((x=t.realtime)==null?void 0:x.channel)||""),m=e.interpolateText(((_=t.timeRange)==null?void 0:_.from)||""),g=e.interpolateText(((S=t.timeRange)==null?void 0:S.to)||""),b=Array.isArray(t.timeframes)?t.timeframes:[];y.useEffect(()=>{var k,I;const C=e.sdk;if(!(((k=t.realtime)==null?void 0:k.mode)==="ws"&&e.isAuthenticated&&f&&((I=C==null?void 0:C.client)==null?void 0:I.createWebSocket)))return;const E=C.client.createWebSocket(f);return E.onmessage=N=>{var z;try{const R=typeof N.data=="string"?JSON.parse(N.data):N.data,D=(R==null?void 0:R.tick)||((z=R==null?void 0:R.data)==null?void 0:z.tick)||(R==null?void 0:R.data)||R,V=Number((D==null?void 0:D.quote)??(D==null?void 0:D.price)??(D==null?void 0:D.close));if(!Number.isFinite(V))return;const F=Number((D==null?void 0:D.epoch)??(D==null?void 0:D.timestamp)??Date.now()/1e3),W=Math.floor(F/60)*60;u(Z=>{const q=Z[Z.length-1];if((q==null?void 0:q.time)===W)return[...Z.slice(0,-1),{...q,high:Math.max(Number(q.high),V),low:Math.min(Number(q.low),V),close:V}];const tt=Number((q==null?void 0:q.close)??V);return[...Z.slice(-99),{time:W,open:tt,high:V,low:V,close:V}]})}catch{}},()=>{var N;return(N=E.close)==null?void 0:N.call(E)}},[e.isAuthenticated,(P=t.realtime)==null?void 0:P.mode,f]);const p=y.useMemo(()=>h.map((C,w)=>{const E=C.time||C.timestamp;return{time:typeof E=="string"&&E.includes("T")?Math.floor(new Date(E).getTime()/1e3):E||`2024-01-${String(w+1).padStart(2,"0")}`,...t.chartType==="candlestick"?{open:Number(C.open),high:Number(C.high),low:Number(C.low),close:Number(C.close)}:{value:Number(C.value??C.close)}}}),[t.chartType,h]);return l.current=p[p.length-1],y.useEffect(()=>{const C=r.current;if(!C)return;const w=LF(C,{autoSize:!0,height:Number(t.height)||280,layout:{background:{color:"transparent"},textColor:e.cfg.colors.textSecondary},grid:{vertLines:{color:e.cfg.colors.borderSubtle},horzLines:{color:e.cfg.colors.borderSubtle}},rightPriceScale:{borderColor:e.cfg.colors.borderSubtle},timeScale:{borderColor:e.cfg.colors.borderSubtle,timeVisible:!0}}),E=t.chartType||"candlestick",k=E==="line"?w.addSeries(VF,{color:t.lineColor||e.cfg.colors.accent}):E==="area"?w.addSeries(XF,{lineColor:t.lineColor||e.cfg.colors.accent,topColor:t.fillColor||`${e.cfg.colors.accent}66`,bottomColor:"transparent"}):w.addSeries(e3,{upColor:"#22c55e",downColor:"#ef4444",borderVisible:!1,wickUpColor:"#22c55e",wickDownColor:"#ef4444"});return o.current=w,i.current=k,()=>{i.current=null,o.current=null,w.remove()}},[e.cfg.colors.accent,e.cfg.colors.borderSubtle,e.cfg.colors.textSecondary,t.chartType,t.height,t.lineColor,t.fillColor]),y.useEffect(()=>{var C,w;!i.current||p.length===0||(i.current.setData(p),m&&g?(C=o.current)==null||C.timeScale().setVisibleRange({from:m,to:g}):(w=o.current)!=null&&w.timeScale().getVisibleLogicalRange()||o.current.timeScale().fitContent())},[p,m,g]),y.useEffect(()=>{if(!s||!o.current||!l.current)return;const C={"1H":3600,"4H":14400,"1D":86400,"1W":604800}[s],w=Number(l.current.time);C&&Number.isFinite(w)&&o.current.timeScale().setVisibleRange({from:w-C,to:w})},[s]),U("div",{key:n,style:{width:"100%",padding:"0.75rem",backgroundColor:e.cfg.colors.surface,borderRadius:e.cfg.layout.borderRadiusLg,border:`1px solid ${e.cfg.colors.borderSubtle}`,...t.className?e.parseClassName(t.className):{}}},b.length>0&&U("div",{style:{display:"flex",gap:"0.35rem",marginBottom:"0.5rem"}},...b.map(C=>U("button",{key:C,type:"button",onClick:()=>a(C),style:{padding:"0.3rem 0.6rem",border:`1px solid ${e.cfg.colors.borderSubtle}`,borderRadius:4,color:e.cfg.colors.text,background:s===C?e.cfg.colors.surfaceHover:"transparent",cursor:"pointer"}},C))),U("div",{ref:r,style:{width:"100%",height:Number(t.height)||280}}))}function Ift(e,t,n){return y.createElement($ft,{api:e,c:t,componentKey:n})}function Nft(e,t,n){const r=t.json||t.data||t.diagram||{},i=e.getCommonProps(n,{display:"flex",flexDirection:"column",minHeight:"300px"},t);return U("div",{key:n,className:t.className,...i},y.createElement("pre",{style:{fontSize:"12px",whiteSpace:"pre-wrap",margin:0}},typeof r=="string"?r:JSON.stringify(r,null,2)))}function Rft({api:e,c:t,componentKey:n}){const r=t.data||t.json||t.diagram||{},{_config:i,...o}=r||{},s=Object.keys(o).length?o:r,{nodes:a,edges:l}=y.useMemo(()=>t_.createFlowDiagram(s),[s]),[h,u]=y.useState("LR"),f=e.cfg.fullscreen===!0,m=t.height||(f?"100%":320),g=e.getCommonProps(n,{width:"100%",height:m,...f?{minHeight:0}:{}},t);return U("div",{key:n,className:t.className,...g},y.createElement(t_.FlowDiagram,{nodes:a,edges:l,config:{direction:h,layout:(i==null?void 0:i.layout)||"dagre",colorMode:(i==null?void 0:i.colorMode)||(e.cfg.colorMode==="dark"?"dark":"light"),backgroundPattern:(i==null?void 0:i.backgroundPattern)||"dot"},callbacks:{onDirectionChange:b=>u(b)},showBottomBar:(i==null?void 0:i.showBottomBar)||!1,style:{width:"100%",height:"100%"}}))}function Lft(e,t,n){return y.createElement(Rft,{api:e,c:t,componentKey:n})}function Dft(e,t,n){var r;if(t.className){const i=((r=e.parseClassNameResponsive)==null?void 0:r.call(e,t.className,n))??e.parseClassName(t.className);i.display==null&&(i.display="flex"),i.flexDirection==null&&(i.flexDirection=/(^|\s)flex(\s|$)/.test(t.className||"")||t.layout==="row"?"row":"column");const o=e.getCommonProps(n,i,t);return y.createElement("div",{key:n,className:t.className,...o},(Array.isArray(t.children)?t.children:[]).map((s,a)=>e.renderComponent(s,a,n)))}return null}const jft=y.memo(({api:e,field:t,fieldName:n,value:r,onChange:i})=>{y.useEffect(()=>{r!==void 0&&r!==""&&i&&i(r)},[]);const o=y.useRef(null),[s,a]=y.useState(!1),l=y.useRef(null),h=y.useRef(null),[u,f]=y.useState(!1),[m,g]=y.useState(""),[b,p]=y.useState(!1),x=t.html!==!1,_=S=>x?S:S.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/\n/g,"<br>");return y.useEffect(()=>{o.current&&!o.current.innerHTML&&(o.current.innerHTML=_(r))},[]),y.useEffect(()=>{o.current&&document.activeElement!==o.current&&o.current.innerHTML!==r&&(o.current.innerHTML=_(r))},[r]),y.createElement("div",{style:{width:"100%",marginBottom:"1rem"}},t.label?U("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,color:e.cfg.colors.textSecondary,marginBottom:"0.75rem"}},t.label):null,y.createElement("div",{style:{border:`1px solid ${s?e.cfg.colors.primary:e.cfg.colors.border}`,borderRadius:e.cfg.components.inputRadius,overflow:"hidden",transition:"border-color 0.2s",position:"relative"}},y.createElement("div",{style:{display:"flex",gap:"4px",padding:"6px 8px",borderBottom:`1px solid ${e.cfg.colors.border}`,backgroundColor:e.cfg.colors.surface}},...[{cmd:"bold",label:"B"},{cmd:"italic",label:"I"},{cmd:"underline",label:"U"}].map(S=>U("button",{key:S.cmd,type:"button",onMouseDown:P=>{var C;P.preventDefault(),document.execCommand(S.cmd,!1),(C=o.current)==null||C.focus()},style:{padding:"2px 8px",borderRadius:"4px",border:"1px solid transparent",cursor:"pointer",backgroundColor:"transparent",color:e.cfg.colors.text,fontWeight:600,fontSize:"13px"},onMouseEnter:P=>P.target.style.borderColor=e.cfg.colors.border,onMouseLeave:P=>P.target.style.borderColor="transparent"},S.label)),U("span",{key:"spacer",style:{flex:1}}),U("button",{key:"list-btn",type:"button",onMouseDown:S=>{var P;S.preventDefault(),document.execCommand("insertUnorderedList",!1),(P=o.current)==null||P.focus()},style:{padding:"2px 8px",borderRadius:"4px",border:"1px solid transparent",cursor:"pointer",backgroundColor:"transparent",color:e.cfg.colors.text,fontSize:"13px"},onMouseEnter:S=>S.target.style.borderColor=e.cfg.colors.border,onMouseLeave:S=>S.target.style.borderColor="transparent"},"☰"),U("span",{key:"divider",style:{width:"1px",height:"16px",backgroundColor:e.cfg.colors.border,margin:"0 4px",alignSelf:"center"}}),U("button",{key:"img-btn",type:"button",onMouseDown:S=>{var P;S.preventDefault(),(P=l.current)==null||P.click()},style:{padding:"2px 6px",borderRadius:"4px",border:"1px solid transparent",cursor:"pointer",backgroundColor:"transparent",color:e.cfg.colors.text,fontSize:"13px",display:"inline-flex",alignItems:"center",justifyContent:"center"},onMouseEnter:S=>S.target.style.borderColor=e.cfg.colors.border,onMouseLeave:S=>S.target.style.borderColor="transparent"},e.renderIcon("image",14)),U("button",{key:"att-btn",type:"button",onMouseDown:S=>{var P;S.preventDefault(),(P=h.current)==null||P.click()},style:{padding:"2px 6px",borderRadius:"4px",border:"1px solid transparent",cursor:"pointer",backgroundColor:"transparent",color:e.cfg.colors.text,fontSize:"13px",display:"inline-flex",alignItems:"center",justifyContent:"center"},onMouseEnter:S=>S.target.style.borderColor=e.cfg.colors.border,onMouseLeave:S=>S.target.style.borderColor="transparent"},e.renderIcon("paperclip",14)),U("button",{key:"ai-btn",type:"button",onMouseDown:S=>{S.preventDefault(),f(!u)},style:{padding:"2px 6px",borderRadius:"4px",border:"1px solid transparent",cursor:"pointer",backgroundColor:u?e.cfg.colors.border:"transparent",color:e.cfg.colors.text,fontSize:"13px",display:"inline-flex",alignItems:"center",justifyContent:"center"},onMouseEnter:S=>S.target.style.borderColor=e.cfg.colors.border,onMouseLeave:S=>S.target.style.borderColor="transparent"},e.renderIcon("sparkles",14))),U("div",{ref:o,contentEditable:!0,suppressContentEditableWarning:!0,onInput:S=>i(S.currentTarget.innerHTML),onFocus:()=>a(!0),onBlur:()=>a(!1),style:{minHeight:(t.rows||10)*20+"px",padding:"0.75rem 1rem",backgroundColor:e.cfg.colors.surface,color:e.cfg.colors.text,outline:"none",fontSize:"0.875rem",lineHeight:"1.6"}}),t.expandAction?y.createElement("button",{type:"button",key:"expand",style:{position:"absolute",bottom:"6px",left:"6px",background:"rgba(0,0,0,0.55)",border:`1px solid ${e.cfg.colorMode==="light"?e.cfg.colors.border:"transparent"}`,borderRadius:"4px",cursor:"pointer",color:e.cfg.colors.textMuted,padding:"3px 5px",display:"flex",alignItems:"center",justifyContent:"center",opacity:.5,transition:"opacity 0.2s",zIndex:1},onMouseEnter:S=>{S.currentTarget.style.opacity="0.85"},onMouseLeave:S=>{S.currentTarget.style.opacity="0.5"},onClick:S=>{S.preventDefault(),S.stopPropagation(),e.handleButtonClick(t.expandAction,{})}},e.renderIcon("maximize-2",13)):null,U("input",{key:"img-input",ref:l,type:"file",accept:"image/*",style:{display:"none"},onChange:async S=>{var C,w,E,k,I,N;const P=(C=S.target.files)==null?void 0:C[0];if(P){try{const z=(w=e.showToast)==null?void 0:w.call(e,"Uploading image (0%)…","success",0),R=e.uploadFile?await e.uploadFile(P,t.upload,D=>{var V;return(V=z==null?void 0:z.update)==null?void 0:V.call(z,`Uploading image (${D}%)`)}):"";if((E=z==null?void 0:z.dismiss)==null||E.call(z),!R)throw Error();(k=o.current)==null||k.focus(),document.execCommand("insertImage",!1,R),i(((I=o.current)==null?void 0:I.innerHTML)||"")}catch{(N=e.showToast)==null||N.call(e,"Failed to upload image","error")}S.target.value=""}}}),U("input",{key:"att-input",ref:h,type:"file",multiple:!0,style:{display:"none"},onChange:async S=>{var k,I,N,z,R;const P=Array.from(S.target.files||[]);S.target.value="";const C=[];let w=0;const E=(k=e.showToast)==null?void 0:k.call(e,`Uploading 0/${P.length}…`,"success",0);for(const D of P){try{const V=e.uploadFile?await e.uploadFile(D,t.upload,F=>{var W;return(W=E==null?void 0:E.update)==null?void 0:W.call(E,`Uploading ${D.name} (${F}%)`)}):"";if(!V)throw Error();C.push(`<a href="${V}">${D.name}</a>`)}catch{(I=e.showToast)==null||I.call(e,`Failed to upload ${D.name}`,"error")}w++,(N=E==null?void 0:E.update)==null||N.call(E,`Uploading ${w}/${P.length}…`)}if((z=E==null?void 0:E.dismiss)==null||z.call(E),C.length>0&&o.current){o.current.focus();const D=window.getSelection();if(D){D.removeAllRanges();const V=document.createRange();V.selectNodeContents(o.current),V.collapse(!1),D.addRange(V)}document.execCommand("insertHTML",!1,`<br><br>${C.join(", ")}`),i(((R=o.current)==null?void 0:R.innerHTML)||"")}}}),u?U("div",{key:"ai-popup",style:{position:"absolute",bottom:"100%",left:"8px",right:"8px",backgroundColor:e.cfg.colors.surfaceHover,border:`1px solid ${e.cfg.colors.borderSubtle}`,borderRadius:"8px",padding:"12px",zIndex:10,boxShadow:"0 -4px 24px rgba(0,0,0,0.4)"}},U("textarea",{value:m,onChange:S=>g(S.target.value),placeholder:"Ask AI to draft a reply...",rows:3,style:{width:"100%",padding:"8px 12px",borderRadius:"4px",border:`1px solid ${e.cfg.colors.borderSubtle}`,backgroundColor:e.cfg.colors.surface,color:e.cfg.colors.text,fontSize:"13px",outline:"none",fontFamily:"inherit",resize:"none",boxSizing:"border-box"}}),U("div",{style:{display:"flex",gap:"8px",justifyContent:"flex-end",marginTop:"8px"}},U("button",{type:"button",onClick:()=>{f(!1),g("")},style:{padding:"6px 14px",borderRadius:"6px",border:`1px solid ${e.cfg.colors.borderSubtle}`,cursor:"pointer",backgroundColor:"transparent",color:e.cfg.colors.textMuted,fontSize:"12px",fontFamily:"inherit"}},"Cancel"),U("button",{type:"button",disabled:b||!m.trim(),onClick:async()=>{var S,P,C,w;if(!(!m.trim()||b)){p(!0);try{const E=((S=o.current)==null?void 0:S.innerHTML)||"",k=await fetch("/api/tenant/email/ai/complete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:m,context:E})});if(!k.ok)throw Error();const I=await k.json(),N=I.response||I.text||I.content||"";(P=o.current)==null||P.focus(),document.execCommand("insertText",!1,N),i(((C=o.current)==null?void 0:C.innerHTML)||""),f(!1),g("")}catch{(w=e.showToast)==null||w.call(e,"AI request failed","error")}p(!1)}},style:{padding:"6px 14px",borderRadius:"6px",border:"none",cursor:b||!m.trim()?"not-allowed":"pointer",backgroundColor:b||!m.trim()?e.cfg.colors.surfaceHover:e.cfg.colors.background,color:b||!m.trim()?e.cfg.colors.textSecondary:e.cfg.colors.text,fontSize:"12px",fontWeight:600,fontFamily:"inherit"}},b?"Thinking...":"Generate"))):null))}),Bft=y.memo(({api:e,c:t,componentKey:n})=>{const[r,i]=y.useState(!1),o=y.useRef(null),[s,a]=y.useState([]),l=t.name?`bf_persist_${t.name}`:null;y.useEffect(()=>{t.dataSource&&(async()=>{var f;try{const m=e.interpolateText(t.dataSource),g=(f=e.selectDynamicOptions)==null?void 0:f[m];if(g&&g.length>0){a(g);return}Ls[m]||(Ls[m]=(async()=>{var p;try{const x=await fetch(m,{headers:{Authorization:`Bearer ${localStorage.getItem("token")||""}`}});if(!x.ok)return[];const _=await x.json(),S=t.dataField||"configs",P=t.optionLabel||"label",C=t.optionValue||"value",w=_[S]||_.data||_,E=Array.isArray(w)?w.map(k=>({label:k[P]||k.name||k.label,value:k[C]||k.id||k.name||k.label})):[];return(p=e.setSelectDynamicOptions)==null||p.call(e,k=>({...k,[m]:E})),E}catch{return delete Ls[m],[]}})());const b=await Ls[m];b.length>0&&a(b)}catch{}})()},[t.dataSource]),y.useEffect(()=>{if(l&&t.name&&!e.sceneData[t.name]){const m=localStorage.getItem(l);m&&e.setSceneData(g=>({...g,[t.name]:m}))}},[l,t.name,e.sceneData[t.name]]),y.useEffect(()=>{if(!r)return;const f=g=>{o.current&&!o.current.contains(g.target)&&i(!1)},m=setTimeout(()=>{document.addEventListener("mousedown",f)},0);return()=>{clearTimeout(m),document.removeEventListener("mousedown",f)}},[r]);const h=t.variant==="selector",u=Array.isArray(t.items)?t.items:s;if(h){const f=t.name&&(e.sceneData[t.name||""]||l&&localStorage.getItem(l))||"",m=f||t.placeholder||"Select...";return U("div",{ref:o,style:{position:"relative",display:"inline-flex"}},y.createElement("button",{type:"button",style:{display:"inline-flex",alignItems:"center",gap:"6px",background:"none",border:"none",cursor:"pointer",fontFamily:"inherit",fontSize:t.fontSize||"1rem",fontWeight:t.fontWeight||600,color:t.color||e.cfg.colors.text,padding:"2px 0",outline:"none",lineHeight:"1.5"},onClick:g=>{g.preventDefault(),i(!r)}},U("span",{key:"text"},m),U("span",{key:"caret",style:{display:"flex",alignItems:"center",opacity:.6,marginLeft:"2px"}},e.renderIcon("chevron-down",14))),r?y.createElement("div",{style:{position:"absolute",top:"100%",left:"0",marginTop:"4px",backgroundColor:e.cfg.colors.surfaceHover,border:`1px solid ${e.cfg.colors.borderSubtle}`,borderRadius:"8px",boxShadow:"0 8px 24px rgba(0,0,0,0.4)",zIndex:9999,overflow:"hidden",minWidth:"200px"}},...u.map((g,b)=>y.createElement("button",{key:b,type:"button",style:{display:"flex",alignItems:"center",gap:"8px",width:"100%",padding:"10px 16px",backgroundColor:"transparent",color:e.cfg.colors.text,border:"none",cursor:"pointer",fontSize:"14px",textAlign:"left",fontFamily:"inherit",transition:"background-color 0.15s ease",outline:"none",whiteSpace:"nowrap"},onMouseEnter:p=>{p.currentTarget.style.backgroundColor=e.cfg.colors.borderSubtle},onMouseLeave:p=>{p.currentTarget.style.backgroundColor="transparent"},onClick:p=>{p.preventDefault(),p.stopPropagation(),i(!1),t.name&&g.value!==f&&e.setSceneData(x=>({...x,[t.name]:g.value}))}},g.label||""))):null)}return y.createElement("div",{ref:o,style:{position:"relative",display:"flex",width:"100%"}},(()=>{var g;const f=!!((g=e.buttonLoading)!=null&&g[n]),m=[];return f?m.push(U("span",{key:"spinner",className:"bf-btn-spinner",style:{width:"14px",height:"14px",border:"2px solid currentColor",borderTopColor:"transparent",borderRadius:"50%",flexShrink:0}})):t.icon&&m.push(U("span",{key:"icon",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,marginRight:"6px"}},e.renderIcon(t.icon,t.iconSize||16))),m.push(U("span",{key:"text",style:{lineHeight:"1"}},t.text||"Button")),y.createElement("button",{type:"button",style:{flex:1,display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"8px",padding:"0.75rem 1.5rem",backgroundColor:e.cfg.colorMode==="light"?e.cfg.colors.primary:"transparent",color:e.cfg.colorMode==="light"?"#ffffff":e.cfg.colors.textSecondary,border:`1px solid ${e.cfg.colorMode==="light"?e.cfg.colors.border:"transparent"}`,cursor:"pointer",fontSize:"0.875rem",fontWeight:600,fontFamily:"inherit",lineHeight:"1.25rem",transition:"all 0.15s ease",outline:"none"},onMouseEnter:b=>{b.currentTarget.style.backgroundColor=e.cfg.colors.border,b.currentTarget.style.color=e.cfg.colorMode==="light"?"#111827":e.cfg.colors.text},onMouseLeave:b=>{b.currentTarget.style.backgroundColor=e.cfg.colorMode==="light"?e.cfg.colors.primary:"transparent",b.currentTarget.style.color=e.cfg.colorMode==="light"?"#ffffff":e.cfg.colors.textSecondary},onClick:b=>{if(b.preventDefault(),u.length>0&&u[0].onClick){const p=()=>e.handleButtonClick(u[0].onClick,{onSuccess:u[0].onSuccess,onError:u[0].onError},{feedback:u[0].feedback,optimistic:u[0].optimistic,payload:u[0].payload});(e.withLoading?e.withLoading(n,p):p()).catch(()=>{})}}},...m)})(),u.length>0?y.createElement("button",{type:"button",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",padding:"0.75rem 0.5rem",backgroundColor:"transparent",color:e.cfg.colors.textSecondary,border:`1px solid ${e.cfg.colorMode==="light"?e.cfg.colors.border:"transparent"}`,borderLeft:`1px solid ${e.cfg.colors.border}`,cursor:"pointer",fontFamily:"inherit",transition:"all 0.15s ease",outline:"none"},onMouseEnter:f=>{f.currentTarget.style.backgroundColor=e.cfg.colors.border,f.currentTarget.style.color=e.cfg.colors.text},onMouseLeave:f=>{f.currentTarget.style.backgroundColor="transparent",f.currentTarget.style.color=e.cfg.colors.textSecondary},onClick:f=>{f.preventDefault(),f.stopPropagation(),i(!r)}},e.renderIcon("chevron-down",16)):null,r?y.createElement("div",{style:{position:"absolute",bottom:"100%",left:"0",right:"0",marginBottom:"4px",backgroundColor:e.cfg.colors.surfaceHover,border:`1px solid ${e.cfg.colors.borderSubtle}`,borderRadius:"8px",boxShadow:"0 -8px 24px rgba(0,0,0,0.4)",zIndex:9999,overflow:"hidden"}},...u.map((f,m)=>{var x;const g=`${n}-item-${m}`,b=!!((x=e.buttonLoading)!=null&&x[g]),p=[];return b?p.push(U("span",{key:"spinner",className:"bf-btn-spinner",style:{width:"12px",height:"12px",border:"2px solid currentColor",borderTopColor:"transparent",borderRadius:"50%",flexShrink:0}})):f.icon&&p.push(U("span",{key:"icon",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,marginRight:"8px"}},e.renderIcon(f.icon,14))),p.push(f.label||""),y.createElement("button",{key:m,type:"button",style:{display:"flex",alignItems:"center",gap:"8px",width:"100%",padding:"10px 16px",backgroundColor:"transparent",color:e.cfg.colors.text,border:"none",cursor:"pointer",fontSize:"14px",textAlign:"left",fontFamily:"inherit",transition:"background-color 0.15s ease",outline:"none"},onMouseEnter:_=>{_.currentTarget.style.backgroundColor=e.cfg.colors.borderSubtle},onMouseLeave:_=>{_.currentTarget.style.backgroundColor="transparent"},onClick:_=>{if(_.preventDefault(),_.stopPropagation(),!f.onClick)return;const S=f.loading==="self"?g:n;f.loading==="self"?i(!0):i(!1);const P=()=>e.handleButtonClick(f.onClick,{onSuccess:f.onSuccess,onError:f.onError},{feedback:f.feedback,optimistic:f.optimistic,payload:f.payload});(e.withLoading?e.withLoading(S,P):P()).finally(()=>{f.loading==="self"&&i(!1)}).catch(()=>{})}},...p)})):null)});function zft(e,t,n){return y.createElement(Bft,{key:n,api:e,c:t,componentKey:n})}function Fft(e,t,n){var l,h;const r=t.widgetId;if(!r)return null;const o=(e.widgets||[]).find(u=>u.id===r);if(!o||!Array.isArray(o.components))return bm(`[renderer] widget "${r}" not found`),null;if(e.widgetStack&&e.widgetStack.includes(r))return bm(`[renderer] circular widget reference "${r}"`),null;(l=e.widgetStack)==null||l.push(r);const s=t.props||{},a=E0(o.components,s).map((u,f)=>e.renderComponent(u,f,`${n}-${r}`));return(h=e.widgetStack)==null||h.pop(),y.createElement(y.Fragment,null,...a)}function E0(e,t){if(!t||Object.keys(t).length===0)return e;if(Array.isArray(e))return e.map(n=>E0(n,t));if(e&&typeof e=="object"){const n={};for(const[r,i]of Object.entries(e))typeof i=="string"&&i.includes("{{")?n[r]=i.replace(/\{\{\s*(?:props\.)?([\w.]+)(?:\|(\w+))?\s*(?:\|\|\s*(.+?))?\s*\}\}/g,(o,s,a,l)=>{let h=t;for(const m of s.split("."))h=h==null?void 0:h[m];if(h==null)return l!==void 0?l.replace(/^["']|["']$/g,""):o;if(a==="names"||a==="join")return Array.isArray(h)?h.map(m=>m&&typeof m=="object"?m.name??m.title:m).filter(Boolean).join(", "):String(h);if(a==="money"||a==="currency"){const m=Number(h);return Number.isFinite(m)?m.toLocaleString("en-NG",{minimumFractionDigits:2,maximumFractionDigits:2}):String(h??"")}const u=h&&typeof h=="object"&&"_seconds"in h?h._seconds*1e3:h&&typeof h=="object"&&"seconds"in h?h.seconds*1e3:h,f=a?new Date(u):null;if(a&&Number.isNaN(f==null?void 0:f.getTime()))return"";if(a==="datetime")return f.toLocaleString();if(a==="timeago"){const m=Math.floor((Date.now()-f.getTime())/6e4);if(m<1)return"just now";if(m<60)return`${m}m ago`;const g=Math.floor(m/60);return g<24?`${g}h ago`:`${Math.floor(g/24)}d ago`}return typeof h=="object"?JSON.stringify(h):String(h)}):n[r]=E0(i,t);return e.condition&&(n.__conditionBase=t),n}return e}const NI=y.memo(({api:e,c:t,componentKey:n})=>{var D;const[r,i]=y.useState(!1),[o,s]=y.useState(""),a=y.useRef(null),l=y.useRef(null),[h,u]=y.useState(null),f=t.dataSource?String(t.dataSource):"",m=!f||/^\{\{\s*\[/.test(f.trim())?f:String(e.interpolateText(t.dataSource));y.useEffect(()=>{if(!m||!e.fetchListData)return;const V=Number(t.pageSize)||Number(t.limit)||5;e.fetchListData(m,n,0,V,void 0,void 0,void 0,void 0,void 0,t.responseKey||t.dataField).catch(()=>{})},[m,n,t.pageSize,t.limit]);const g=m?((D=e.listData)==null?void 0:D[n])||[]:null,b=y.useMemo(()=>{if(g){const F=t.optionLabel||"name",W=t.optionValue||"id",Z=(q,tt)=>tt.split(".").reduce((at,H)=>at==null?void 0:at[H],q);return g.map(q=>{if(typeof q=="string")return{label:q.replace(/^tenant_/i,"").replace(/_/g," ").replace(/\b\w/g,K=>K.toUpperCase()),value:q};const tt=Z(q,F),at=tt!=null&&tt!==""?tt:(q==null?void 0:q.name)??(q==null?void 0:q.title)??(q==null?void 0:q.label)??(q==null?void 0:q.email)??Z(q,W)??"";return{label:String(at),value:String(Z(q,W)??(q==null?void 0:q.id)??(q==null?void 0:q.value)??"")}})}return(Array.isArray(t.options)?t.options:[]).map(F=>typeof F=="string"?{label:F,value:F}:{label:F.label??F.value,value:F.value??F.label})},[t.options,g,t.optionLabel,t.optionValue]),p=t.multiple===!0||t.multiple==="true",x=e.sceneData[t.name||""],_=t.defaultFirst===!0||t.defaultFirst==="true";y.useEffect(()=>{if(!_||p)return;const V=t.name||"";if(!V)return;const F=e.sceneData[V];(F==null||F==="")&&b.length&&e.setSceneData(W=>({...W,[V]:b[0].value}))},[_,p,t.name,b.length]),y.useEffect(()=>{const V=t.name||"";if(!V||p||b.length===0)return;const F=e.sceneData[V];F==null||F===""||b.some(W=>W.value===String(F))||e.setSceneData(W=>({...W,[V]:_?b[0].value:""}))},[b,t.name,_,p]);const S=p?Array.isArray(x)?x.map(V=>String(V)):String(x??"").split(",").map(V=>V.trim()).filter(Boolean):[],P=e.sceneData[t.name||""]??"",C=b.find(V=>V.value===P),w=V=>p?S.includes(V):V===P,E=p?S.length?S.map(V=>{var F;return((F=b.find(W=>W.value===V))==null?void 0:F.label)||V}).join(", "):t.placeholder||"Select...":C?C.label:P||t.placeholder||"Select...",k=t.className?e.parseClassName(t.className):{},I=y.useMemo(()=>{if(!o)return b;const V=o.toLowerCase();return b.filter(F=>F.label.toLowerCase().includes(V))},[b,o]),N=t.custom&&o&&!b.find(V=>V.value===o||V.label===o);y.useEffect(()=>{if(!r){s(""),u(null);return}const V=()=>{const F=a.current;if(!F)return;const W=F.getBoundingClientRect(),Z=window.innerHeight||0,q=8,tt=Z-W.bottom-q,at=W.top-q,H=tt<200&&at>tt;u({left:W.left,width:W.width,...H?{bottom:Math.round(Z-W.top+4)}:{top:Math.round(W.bottom+4)},maxHeight:Math.max(120,Math.min(260,H?at:tt))})};return V(),window.addEventListener("resize",V),window.addEventListener("scroll",V,!0),()=>{window.removeEventListener("resize",V),window.removeEventListener("scroll",V,!0)}},[r]),y.useEffect(()=>{if(!r){s("");return}const V=F=>{var Z,q;const W=F.target;(Z=a.current)!=null&&Z.contains(W)||(q=l.current)!=null&&q.contains(W)||i(!1)};return setTimeout(()=>document.addEventListener("mousedown",V),0),()=>document.removeEventListener("mousedown",V)},[r]);const z=V=>{e.setSceneData(F=>({...F,[t.name||""]:V})),i(!1)},R=V=>{if(!p){z(V);return}const F=S.includes(V)?S.filter(W=>W!==V):[...S,V];e.setSceneData(W=>({...W,[t.name||""]:F.join(", ")}))};return U("div",{key:n,ref:a,style:{position:"relative",width:"100%",...k}},t.label&&U("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,color:e.cfg.colors.textSecondary,marginBottom:"0.75rem"}},t.label),U("button",{style:{width:"100%",minWidth:0,display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",borderRadius:e.cfg.components.inputRadius||"0.75rem",border:"1px solid",borderColor:e.cfg.colorMode==="light"?e.cfg.colors.border:"#374151",background:e.cfg.colors.surface,color:e.cfg.colors.text,cursor:"pointer",fontSize:"14px",textAlign:"left",gap:"8px",...t.triggerClassName?e.parseClassName(t.triggerClassName):{}},onClick:()=>i(!r)},U("span",{style:{minWidth:0,flex:"1 1 auto",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},E),U("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",style:{flexShrink:0}},U("path",{d:"m6 9 6 6 6-6"}))),r&&h&&al.createPortal(U("div",{ref:l,style:{position:"fixed",left:h.left,width:h.width,...h.top!==void 0?{top:h.top}:{bottom:h.bottom},zIndex:1e5,borderRadius:"16px",border:"1px solid",borderColor:e.cfg.colorMode==="dark"?"#374151":e.cfg.colors.border,background:e.cfg.colorMode==="dark"?"#1f2937":"#ffffff",overflow:"hidden",maxHeight:h.maxHeight,display:"flex",flexDirection:"column"}},t.searchable!==!1&&U("input",{style:{width:"100%",padding:"8px",border:"none",borderBottom:"1px solid",borderColor:e.cfg.colors.borderSubtle,background:"transparent",color:e.cfg.colors.text,outline:"none",fontSize:"13px"},placeholder:"Search...",value:o,onChange:V=>{s(V.target.value),V.stopPropagation()},onClick:V=>V.stopPropagation()}),U("div",{style:{overflow:"auto",flex:1}},I.map(V=>U("button",{key:V.value,style:{width:"100%",display:"block",textAlign:"left",padding:"8px",border:"none",background:w(V.value)?"rgba(149,57,5,0.12)":"transparent",color:w(V.value)?e.cfg.colors.primary:e.cfg.colors.text,cursor:"pointer",fontSize:"14px"},onMouseEnter:F=>{F.currentTarget.style.background=e.cfg.colors.surfaceHover},onMouseLeave:F=>{F.currentTarget.style.background=w(V.value)?"rgba(149,57,5,0.12)":"transparent"},onClick:()=>R(V.value)},(w(V.value)?"✓ ":"")+V.label)),N&&U("button",{style:{width:"100%",display:"block",textAlign:"left",padding:"8px",border:"none",borderTop:"1px solid",borderColor:e.cfg.colors.borderSubtle,background:"transparent",color:e.cfg.colors.primary,cursor:"pointer",fontSize:"13px",fontStyle:"italic"},onClick:()=>R(o)},`+ Add "${o}"`))),document.body))});function Wft(e,t,n){return y.createElement(NI,{api:e,c:t,componentKey:n})}const Ls={},Vft=y.memo(({api:e,field:t,fieldName:n,fieldKey:r,fieldStyle:i,fieldWrapperStyle:o})=>{const[s,a]=y.useState([]);y.useEffect(()=>{t.dataSource&&(async()=>{var u;try{const f=e.interpolateText(t.dataSource),m=(u=e.selectDynamicOptions)==null?void 0:u[f];if(m&&m.length>0){a(m);return}Ls[f]||(Ls[f]=(async()=>{var b;try{const p=await fetch(f,{headers:{Authorization:`Bearer ${localStorage.getItem("token")||""}`}});if(!p.ok)return[];const x=await p.json(),_=t.dataField||"configs",S=t.optionLabel||"label",P=t.optionValue||"value",C=x[_]||x.data||x,w=Array.isArray(C)?C.map(E=>({label:E[S]||E.name||E.label,value:E[P]||E.id||E.name||E.label})):[];return(b=e.setSelectDynamicOptions)==null||b.call(e,E=>({...E,[f]:w})),w}catch{return delete Ls[f],[]}})());const g=await Ls[f];g.length>0&&a(g)}catch{}})()},[t.dataSource]);const l=s.length>0?s:Array.isArray(t.options)?t.options:[],h=t.placeholder||t.label||"Select...";return y.createElement("div",{key:r,style:o||{width:"100%"}},t.label?U("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,color:e.cfg.colors.textSecondary,marginBottom:"0.75rem"}},t.label):null,U("select",{name:n,value:e.sceneData[n]??"",required:t.required,className:t.className,style:{...i,fontSize:"0.875rem"},size:"md",onChange:u=>e.setSceneData(f=>({...f,[n]:u.target.value}))},U("option",{key:"__placeholder",value:"",disabled:!0,hidden:!0},h),l.map((u,f)=>U("option",{key:f,value:typeof u=="string"?u:u.value},typeof u=="string"?u:u.label))))});function Uft(e,t,n){var l;const r=t.className||"",i=((l=e.parseClassNameResponsive)==null?void 0:l.call(e,r,n))??e.parseClassName(r),o=e.getCommonProps(n,i,t),s=Array.isArray(t.fields)?t.fields:[],a=t.submitButton;return t.collection&&e.fetchEntitySchema?y.createElement(Hft,{api:e,c:t,componentKey:n,formClassName:r,parsedStyle:i,formProps:o,fields:s,submitBtn:a}):RI(e,t,n,r,i,o,s,a)}function Hft({api:e,c:t,componentKey:n,formClassName:r,parsedStyle:i,formProps:o,fields:s,submitBtn:a}){const[l,h]=y.useState(s),[u,f]=y.useState(!0);return y.useEffect(()=>{if(!e.fetchEntitySchema){f(!1);return}e.fetchEntitySchema(t.collection).then(m=>{if(!Array.isArray(m==null?void 0:m.fields)){f(!1);return}const g=new Map(m.fields.map(p=>[p.name,p])),b=s.map(p=>{var _;const x=g.get(p.name||((_=p.label)==null?void 0:_.toLowerCase()));return x?{...p,required:p.required??x.required,validation:p.validation??(x.validation?{...x.validation}:void 0),placeholder:p.placeholder??x.placeholder}:p});h(b),f(!1)}).catch(()=>f(!1))},[t.collection]),u?U("div",{key:n,style:{padding:"1rem",textAlign:"center",color:e.cfg.colors.textMuted,fontSize:"0.8rem"}},"Loading fields..."):RI(e,t,n,r,i,o,l,a)}const qft=y.memo(function({name:t,value:n,onChange:r,placeholder:i,required:o,inputType:s,label:a,fieldStyle:l,onKeyDown:h,openPickerOnClick:u}){y.useEffect(()=>{n!==void 0&&n!==""&&r&&r(n)},[]);const f=y.useRef(r);f.current=r;const m=y.useRef(l);m.current=l;const g=y.useCallback(p=>{f.current(p.target.value)},[]),b=y.createElement("input",{name:t,placeholder:i,required:o,type:s||"text",value:n??"",onChange:g,onClick:u?p=>{var x,_;return(_=(x=p.currentTarget).showPicker)==null?void 0:_.call(x)}:void 0,onKeyDown:h?p=>{p.key==="Enter"&&h()}:void 0,style:m.current});return a?y.createElement("div",{style:{width:"100%",marginBottom:"1rem"}},y.createElement("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,color:l.color,marginBottom:"0.75rem"}},a),b):b}),Gft=y.memo(function({api:t,field:n,fieldName:r,label:i,fieldStyle:o}){const s=y.useRef(null),[a,l]=y.useState(!1),h=t.sceneData[r]||"",u=t.sceneData[r+"_name"]||"",f=/^data:image\//i.test(h)||/\.(png|jpe?g|gif|webp|svg|avif)(\?|#|$)/i.test(h)||/\/[^/]+\/image(\?|#|$)/i.test(h),m=async g=>{var p,x,_,S;const b=(p=g.target.files)==null?void 0:p[0];if(g.target.value="",!!b){l(!0);try{const P=(x=t.showToast)==null?void 0:x.call(t,"Uploading…","success",0),C=t.uploadFile?await t.uploadFile(b,n.upload,w=>{var E;return(E=P==null?void 0:P.update)==null?void 0:E.call(P,`Uploading ${b.name} (${w}%)`)}):"";if((_=P==null?void 0:P.dismiss)==null||_.call(P),!C)throw new Error;t.setSceneData(w=>({...w,[r]:C,[r+"_name"]:b.name})),n.refetchScope&&t.refetchScope&&t.refetchScope(n.refetchScope)}catch{(S=t.showToast)==null||S.call(t,"Upload failed","error")}finally{l(!1)}}};return y.createElement("div",{style:{width:"100%"}},i&&U("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,color:t.cfg.colors.textSecondary,marginBottom:"0.75rem"}},i),h?y.createElement("div",{style:{...o,display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px"}},U("div",{style:{display:"flex",alignItems:"center",gap:"10px",minWidth:0}},f?U("img",{src:h,alt:"",style:{width:"40px",height:"40px",objectFit:"cover",borderRadius:"8px",flexShrink:0}}):U("span",{style:{display:"flex",alignItems:"center",flexShrink:0}},t.renderIcon("paperclip",16)),U("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},u||"Uploaded file")),U("button",{type:"button","aria-label":"Remove",title:"Remove",style:{background:"none",border:"none",cursor:"pointer",color:t.cfg.colors.danger,display:"flex",alignItems:"center",flexShrink:0,padding:"4px"},onClick:()=>t.setSceneData(g=>{const b={...g};return delete b[r],delete b[r+"_name"],b})},t.renderIcon("trash-2",16))):y.createElement("button",{type:"button",onClick:()=>{var g;return(g=s.current)==null?void 0:g.click()},style:{...o,display:"flex",alignItems:"center",justifyContent:"center",gap:"8px",cursor:"pointer",color:t.cfg.colors.textMuted,fontSize:"14px"}},a?"Uploading…":"⬆ Upload file"),U("input",{key:"file-input",ref:s,type:"file",accept:n.accept||".pdf,.docx,.txt,.md,.csv,.json",style:{display:"none"},onChange:m}))}),Yft=y.memo(function({api:t,c:n,componentKey:r}){const i=n.name||"image",o=t.sceneData[i]||"",[s,a]=y.useState(!1),l=y.useRef(null),h=y.useRef(null),[u,f]=y.useState(""),[m,g]=y.useState(null),b=`${r}-images`,p=n.dataSource||"/admin/assets?entityType=media";y.useEffect(()=>{!s||!t.fetchListData||t.fetchListData(p,b,0,Number(n.pageSize)||100).catch(()=>{})},[s,p,b]),y.useEffect(()=>{if(!s){g(null),f("");return}const N=()=>{const z=l.current;if(!z)return;const R=z.getBoundingClientRect(),D=window.innerHeight||0,V=D-R.bottom-8,F=R.top-8,W=V<300&&F>V;g({left:R.left,width:R.width,...W?{bottom:Math.round(D-R.top+6)}:{top:Math.round(R.bottom+6)}})};return N(),window.addEventListener("resize",N),window.addEventListener("scroll",N,!0),()=>{window.removeEventListener("resize",N),window.removeEventListener("scroll",N,!0)}},[s]),y.useEffect(()=>{if(!s)return;const N=R=>{var V,F;const D=R.target;(V=l.current)!=null&&V.contains(D)||(F=h.current)!=null&&F.contains(D)||a(!1)},z=setTimeout(()=>document.addEventListener("mousedown",N),0);return()=>{clearTimeout(z),document.removeEventListener("mousedown",N)}},[s]);const x=N=>{if(!N)return"";if(typeof N=="object")return N.url||N.asset_url||"";const z=String(N);if(/^https?:\/\//i.test(z)||z.startsWith("/"))return z;const R=S.find(D=>String((D==null?void 0:D.asset_id)||(D==null?void 0:D.id))===z||String(D==null?void 0:D.id)===z);return R&&(R.url||R.asset_url)||""},_=N=>x(N),S=t.listData&&t.listData[b]||[],P=u.trim().toLowerCase(),C=P?S.filter(N=>String((N==null?void 0:N.label)||(N==null?void 0:N.path)||(N==null?void 0:N.id)||"").toLowerCase().includes(P)):S,w=N=>{const z=N.asset_id||N.id;t.setSceneData(R=>({...R,[i]:z,[`${i}_label`]:N.label||""})),a(!1)},E=()=>t.setSceneData(N=>{const z={...N};return delete z[i],delete z[`${i}_label`],z}),k=x(o),I={width:"40px",height:"40px",aspectRatio:"1 / 1",objectFit:"cover",borderRadius:"8px",flexShrink:0,display:"block"};return U("div",{key:r,ref:l,style:{position:"relative",width:"100%",display:"flex",alignItems:"center",gap:"8px"}},U("button",{type:"button","aria-label":t.interpolateText(n.ariaLabel||n.placeholder||"Select image"),onClick:()=>a(!s),style:{flex:"1 1 auto",minWidth:0,display:"flex",alignItems:"center",gap:"10px",padding:"10px 12px",borderRadius:"12px",border:"1px solid",borderColor:t.cfg.colorMode==="dark"?"#374151":t.cfg.colors.border,background:t.cfg.colorMode==="dark"?"#1f2937":"#ffffff",color:t.cfg.colors.text,cursor:"pointer",fontSize:"14px"}},k?U("img",{src:k,alt:"",style:I}):null,U("span",{style:{flex:"1 1 auto",minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",textAlign:"left"}},o?t.sceneData[`${i}_label`]||"Selected image":n.placeholder||"Select image…"),t.renderIcon("chevron-down",14)),o?U("button",{type:"button","aria-label":"Remove",title:"Remove",onClick:E,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"40px",height:"40px",flexShrink:0,borderRadius:"12px",border:"none",background:"transparent",color:t.cfg.colors.danger,cursor:"pointer"}},t.renderIcon("trash-2",16)):null,s&&m?al.createPortal(U("div",{ref:h,style:{position:"fixed",left:m.left,width:m.width,...m.top!==void 0?{top:m.top}:{bottom:m.bottom},zIndex:1e5,borderRadius:"16px",border:"1px solid",borderColor:t.cfg.colorMode==="dark"?"#374151":t.cfg.colors.border,background:t.cfg.colorMode==="dark"?"#1f2937":"#ffffff",maxHeight:"320px",display:"flex",flexDirection:"column",overflow:"hidden"}},U("input",{placeholder:"Search images...",value:u,onChange:N=>f(N.target.value),onClick:N=>N.stopPropagation(),style:{width:"100%",padding:"8px",border:"none",borderBottom:"1px solid",borderColor:t.cfg.colors.borderSubtle,background:"transparent",color:t.cfg.colors.text,outline:"none",fontSize:"13px"}}),U("div",{style:{overflow:"auto",padding:"8px",display:"flex",flexWrap:"wrap",gap:"8px",alignContent:"flex-start"}},C.length?C.map(N=>U("div",{key:N.id,role:"button",tabIndex:0,title:N.label||N.id,onClick:()=>w(N),style:{width:"112px",height:"112px",flex:"0 0 auto",padding:0,border:String(N.id)===String(o)?`2px solid ${t.cfg.colors.primary}`:"1px solid transparent",background:"transparent",borderRadius:"12px",cursor:"pointer",overflow:"hidden"}},U("img",{src:_(N),alt:N.label||"",style:{width:"100%",height:"100%",objectFit:"cover",display:"block",background:t.cfg.colorMode==="dark"?"#374151":"#f5f5f5"}}))):U("div",{style:{gridColumn:"1 / -1",padding:"12px",color:t.cfg.colors.textMuted,fontSize:"13px"}},"No images found"))),document.body):null)}),Zft=y.memo(function({api:t,c:n,componentKey:r}){const i=y.useRef(null),o=y.useRef(null),[s,a]=y.useState(!1),l=n.className?t.parseClassName(n.className):{},h=n.camera===!0||n.camera==="true"||!!n.capture,u=s?n.uploadingText||"Uploading…":t.interpolateText(n.text||n.label||"Upload"),f=async(p,x=!1)=>{var _,S,P,C,w;if(p.length!==0){a(!0);try{const E=[],k={...n.upload||{},...n.embed?{embed:!0}:{},...n.embeddingEntity?{entity:n.embeddingEntity}:{},...n.resultKey?{resultKey:n.resultKey}:{}};for(const F of p){const W=await((_=t.uploadFile)==null?void 0:_.call(t,F,k,void 0));W&&E.push(W)}if(E.length===0)throw new Error("upload failed");const I=n.dataKey||n.name||"uploadedAsset",N=(S=t.sceneData)==null?void 0:S[I],z=Array.isArray(N)?N:N?[N]:[],R=n.multiple?x?[...z,...E]:E:E[E.length-1],D=p.map(F=>F.name).join(", "),V=(P=t.sceneData)==null?void 0:P[I+"_name"];t.setSceneData(F=>({...F,[I]:R,[I+"_name"]:x&&V?`${V}, ${D}`:D})),n.refetchScope&&typeof t.refetchScope=="function"&&t.refetchScope(n.refetchScope),(C=t.showToast)==null||C.call(t,n.successMessage||(n.multiple?`${E.length} uploaded`:"Uploaded"),"success")}catch{(w=t.showToast)==null||w.call(t,n.errorMessage||"Upload failed","error")}finally{a(!1)}}},m=async p=>{const x=p.target.files?Array.from(p.target.files):[];p.target.value="",await f(x,!1)},g=async p=>{const x=p.target.files?Array.from(p.target.files):[];p.target.value="",await f(x,!0)},b={...n.wrapperStyle||{}};return h?(b.display="flex",b.alignItems="center",b.gap=8):b.display||(b.display="inline-flex"),U("div",{key:r,style:b},y.createElement("button",{type:"button",className:n.className,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"8px",cursor:s?"wait":"pointer",border:"none",fontFamily:"inherit",...l,...h?{flex:"1 1 auto",minWidth:0,width:"auto"}:{}},disabled:s||t.interactionDisabled||void 0,"aria-label":t.interpolateText(n.ariaLabel||u),onClick:()=>{var p;return(p=i.current)==null?void 0:p.click()}},n.icon?t.renderIcon(n.icon,n.iconSize||16):null,U("span",null,u)),h?y.createElement("button",{key:"camera-button",type:"button",className:n.cameraClassName||"inline-flex items-center justify-center w-11 h-11 rounded-xl border border-[#d8d2be] bg-white text-[#1b2a1f] hover:bg-[#f2efe6] dark:border-[#374151] dark:bg-[#1f2937] dark:text-[#f3f4f6] dark:hover:bg-[#374151] shrink-0",style:{cursor:s?"wait":"pointer",flexShrink:0},disabled:s||t.interactionDisabled||void 0,"aria-label":t.interpolateText(n.cameraLabel||"Take photo"),onClick:()=>{var p;return(p=o.current)==null?void 0:p.click()}},t.renderIcon(n.cameraIcon||"camera",n.cameraIconSize||18)):null,y.createElement("input",{key:"upload-input",ref:i,type:"file",accept:n.accept||"image/*",multiple:!!n.multiple,style:{display:"none"},onChange:m}),h?y.createElement("input",{key:"camera-input",ref:o,type:"file",accept:"image/*",capture:n.capture==="user"?"user":"environment",style:{display:"none"},onChange:g}):null)}),Kft=y.memo(function({name:t,value:n,onChange:r,placeholder:i,required:o,options:s,label:a,fieldStyle:l}){y.useEffect(()=>{n!==void 0&&n!==""&&r&&r(n)},[]);const h=y.useRef(r);h.current=r;const u=y.useRef(l);u.current=l;const f=y.useCallback(g=>{h.current(g.target.value)},[]),m=y.createElement("select",{name:t,required:o,value:n??"",onChange:f,style:{...u.current,cursor:"pointer",appearance:"none"}},i?y.createElement("option",{key:"__placeholder",value:""},i):null,...s.map((g,b)=>y.createElement("option",{key:b,value:typeof g=="string"?g:g.value},typeof g=="string"?g:g.label)));return a?y.createElement("div",{style:{width:"100%",marginBottom:"1rem"}},y.createElement("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,marginBottom:"0.75rem"}},a),m):m}),Xft=y.memo(function({name:t,value:n,onChange:r,placeholder:i,required:o,rows:s,label:a,fieldStyle:l}){y.useEffect(()=>{n!==void 0&&n!==""&&r&&r(n)},[]);const h=y.useRef(r);h.current=r;const u=y.useRef(l);u.current=l;const f=y.useCallback(g=>{h.current(g.target.value)},[]),m=y.createElement("textarea",{name:t,placeholder:i,required:o,rows:s||4,value:n??"",onChange:f,style:{...u.current,resize:"vertical",fontFamily:"inherit"}});return a?y.createElement("div",{style:{width:"100%",marginBottom:"1rem"}},y.createElement("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,marginBottom:"0.75rem"}},a),m):m}),Jft=y.memo(function({api:t,field:n,fieldName:r}){const i=Array.isArray(n.fields)?n.fields:[],o=p=>{let x=[];if(Array.isArray(p))x=p;else if(typeof p=="string"&&p)try{const _=JSON.parse(p);x=Array.isArray(_)?_:_&&Array.isArray(_.rules)?_.rules:[]}catch{}else p&&typeof p=="object"&&(x=Array.isArray(p.rules)?p.rules:[]);return x.map(_=>{if(!_||typeof _!="object")return null;const S={};let P=!1;for(const C of i)_[C.name]!==void 0&&(S[C.name]=_[C.name],P=!0);if(!P&&i.some(C=>C.name==="metric"))if(_.metric!==void 0||_.op!==void 0||_.value!==void 0)S.metric=_.metric==null?"":String(_.metric),S.op=_.op==null||_.op===""?"gte":String(_.op),S.value=_.value==null?"":_.value,P=!0;else{const C=/^min_(.+)$/.exec(String(_.type||""));C&&(S.metric=C[1],S.op="gte",S.value=_.value==null?"":_.value,P=!0)}return P?S:null}).filter(Boolean)},[s,a]=y.useState(()=>o(t.sceneData[r])),l=t.sceneData[r];y.useEffect(()=>{a(o(l))},[l]);const h=p=>{a(p),t.setSceneData(x=>({...x,[r]:JSON.stringify(p)}))},u=i.filter(p=>p.type==="select"&&p.dataSource),f=u.map(p=>`${r}:${p.dataSource}`).join("|");y.useEffect(()=>{t.fetchListData&&u.forEach(p=>{t.fetchListData(t.interpolateText(String(p.dataSource)),`${r}-ds-${p.name}`,0,Number(p.limit)||300).catch(()=>{})})},[f,r]);const m=p=>{if(!p.dataSource)return Array.isArray(p.options)?p.options:[];const x=t.listData&&t.listData[`${r}-ds-${p.name}`]||[],_=p.optionLabel||"name",S=p.optionValue||"name",P=(C,w)=>String(w).split(".").reduce((E,k)=>E==null?E:E[k],C);return x.map(C=>({label:String(P(C,_)??C.name??C.id??""),value:String(P(C,S)??C.name??C.id??"")}))},g=()=>{const p={};return i.forEach(x=>{p[x.name]=x.default!==void 0?x.default:""}),p},b={flex:1,minWidth:0,padding:"8px 10px",borderRadius:"10px",border:`1px solid ${t.cfg.colors.border}`,background:t.cfg.colors.surface,color:t.cfg.colors.text,outline:"none",fontSize:"14px",colorScheme:t.cfg.colorMode==="light"?"light":"dark"};return U("div",{style:{width:"100%",marginBottom:"1rem"}},n.label?U("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,color:t.cfg.colors.textSecondary,marginBottom:"0.5rem"}},n.label):null,...s.map((p,x)=>U("div",{key:`${r}-row-${x}`,style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"8px",marginBottom:"8px"}},...i.map(_=>{const S=`${r}-${x}-${_.name}`;return _.type==="select"?y.createElement("select",{key:S,value:p[_.name]??"",onChange:P=>h(s.map((C,w)=>w===x?{...C,[_.name]:P.target.value}:C)),style:{...b,flex:_.flex||1}},y.createElement("option",{value:"",key:"__blank"},_.placeholder||_.label||"Select…"),...m(_).map((P,C)=>y.createElement("option",{value:P.value??P.label,key:C},P.label??P.value))):y.createElement("input",{key:S,type:_.type==="number"?"number":"text",value:p[_.name]??"",placeholder:_.placeholder||_.label||"",min:_.min,step:_.step,onChange:P=>h(s.map((C,w)=>w===x?{...C,[_.name]:P.target.value}:C)),style:{...b,flex:_.flex||1}})}),U("button",{key:`${r}-rm-${x}`,type:"button","aria-label":"Remove",title:"Remove",onClick:()=>h(s.filter((_,S)=>S!==x)),style:{flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",width:36,height:36,borderRadius:10,border:"none",cursor:"pointer",background:"transparent",color:t.cfg.colors.danger}},t.renderIcon("trash-2",16)))),U("button",{type:"button",onClick:()=>h([...s,g()]),style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"8px 12px",borderRadius:10,border:`1px dashed ${t.cfg.colors.borderSubtle}`,background:"transparent",color:t.cfg.colors.textSecondary,cursor:"pointer",fontSize:"14px",fontWeight:500}},t.renderIcon("plus",16),n.addLabel||"Add"))});function RI(e,t,n,r,i,o,s,a){var g,b;const l=[],h=Math.max(1,Math.floor(Number(t.columns)||1)),u=typeof window>"u"?1/0:window.innerWidth,m=Math.min(e.containerWidth||1/0,u)<640?1:h;if(s.forEach((p,x)=>{var k,I;const _=`${n}-field-${x}`,S=p.name||((k=p.label)==null?void 0:k.toLowerCase())||"",P=p.className?((I=e.parseClassNameResponsive)==null?void 0:I.call(e,p.className,_))??e.parseClassName(p.className):{},C={width:"100%",padding:"8px 8px",borderRadius:e.cfg.components.inputRadius||void 0,backgroundColor:p.borderless?p.backgroundColor||"transparent":e.cfg.colors.surface,color:p.textColor||e.cfg.colors.text,colorScheme:e.cfg.colorMode==="light"?"light":"dark",border:p.borderless?"none":`1px solid ${e.cfg.colors.border}`,outline:"none",transition:e.cfg.effects.transition,...P},w={width:"100%",marginBottom:"1rem"},E=N=>N.value?e.interpolateText(String(N.value)):"";if(p.type==="richtext")l.push(y.createElement(jft,{key:_,api:e,field:p,fieldName:S,value:e.sceneData[S]??E(p),onChange:N=>e.setSceneData(z=>({...z,[S]:N}))}));else if(p.type==="textarea"){const N=p.rows||4;l.push(y.createElement(Xft,{key:_,name:S,value:e.sceneData[S]??E(p),onChange:z=>e.setSceneData(R=>({...R,[S]:z})),placeholder:p.placeholder||p.label,required:p.required,rows:N,label:p.label,fieldStyle:C}))}else if(p.type==="select")if(p.dataSource)l.push(y.createElement(Vft,{key:_,api:e,field:p,fieldName:S,fieldKey:_,fieldStyle:C,fieldWrapperStyle:w}));else{const N=Array.isArray(p.options)?p.options:[];l.push(y.createElement(Kft,{key:_,name:S,value:e.sceneData[S]??E(p),onChange:z=>e.setSceneData(R=>({...R,[S]:z})),placeholder:p.placeholder||p.label||"Select...",required:p.required,options:N,label:p.label,fieldStyle:C}))}else if(p.type==="advanced-select")l.push(y.createElement("div",{key:`${_}-wrap`,style:w},y.createElement(NI,{key:_,api:e,c:{...p,name:S,options:p.options},componentKey:_})));else if(p.type==="file")l.push(y.createElement("div",{key:`${_}-wrap`,style:w},y.createElement(Gft,{key:_,api:e,field:p,fieldName:S,label:p.label,fieldStyle:C})));else if(p.type==="repeater")l.push(y.createElement(Jft,{key:_,api:e,field:p,fieldName:S}));else if(p.tags)l.push(y.createElement(Qft,{key:_,api:e,field:p,value:e.sceneData[S]??E(p),onChange:N=>e.setSceneData(z=>({...z,[S]:N}))}));else{const N=p.type==="email"?"email":p.type==="password"?"password":p.type==="number"?"number":p.type==="date"?"date":p.type==="datetime-local"?"datetime-local":"text";l.push(y.createElement(qft,{key:_,name:S,value:e.sceneData[S]??E(p),onChange:z=>e.setSceneData(R=>({...R,[S]:z})),placeholder:p.placeholder||p.label,required:p.required,inputType:N,label:p.label,fieldStyle:C,openPickerOnClick:p.openPickerOnClick,onKeyDown:p.onKeyDown?()=>e.handleButtonClick(p.onKeyDown):void 0}))}}),h>1){const p=l.splice(0);l.push(...p.map((x,_)=>{var P;const S=Math.min(m,Math.max(1,Number((P=s[_])==null?void 0:P.fieldSpan)||1));return U("div",{key:`${n}-field-grid-${_}`,style:{gridColumn:`span ${S} / span ${S}`,minWidth:0}},x)}))}if(a){const p={padding:"0.75rem 1.5rem",borderRadius:e.cfg.components.inputRadius,cursor:"pointer",fontWeight:600,width:t.secondaryButton?"auto":"100%",marginTop:t.secondaryButton?0:"1rem",...h>1?{gridColumn:"1 / -1",marginTop:0}:{}},x=a.className?((g=e.parseClassNameResponsive)==null?void 0:g.call(e,a.className,`${n}-submit`))??e.parseClassName(a.className):{},_=!!a.className&&/(^|\s)bg-[^\s]+/.test(a.className),S=!!a.className&&/(^|\s)text-[^\s]+/.test(a.className),P={...p,...x,...!_&&{backgroundColor:e.cfg.colors.primary},...!S&&{color:"#fff",border:"none"}},C=`${n}-submit`,w=!!((b=e.buttonLoading)!=null&&b[C]),E=()=>{var V,F,W,Z,q;const R=[],D=e.sceneData||{};for(const tt of s){const at=tt.name||((V=tt.label)==null?void 0:V.toLowerCase()),H=D[at],K=tt.label||at;if(tt.required&&(H==null||String(H).trim()==="")){R.push(`${K} is required`);continue}H==null||String(H).trim()===""||((F=tt.validation)!=null&&F.pattern&&!new RegExp(tt.validation.pattern).test(String(H))&&R.push(`${K} is invalid`),((W=tt.validation)==null?void 0:W.min)!==void 0&&Number(H)<Number(tt.validation.min)&&R.push(`${K} must be at least ${tt.validation.min}`),((Z=tt.validation)==null?void 0:Z.max)!==void 0&&Number(H)>Number(tt.validation.max)&&R.push(`${K} must be at most ${tt.validation.max}`),((q=tt.validation)==null?void 0:q.minLength)!==void 0&&String(H).length<Number(tt.validation.minLength)&&R.push(`${K} must be at least ${tt.validation.minLength} characters`))}return R},k=()=>{var F,W;const R=E();if(R.length){(F=e.showToast)==null||F.call(e,R,"error");return}const D=()=>a.onClick?e.handleButtonClick(a.onClick,{onSuccess:a.onSuccess,onError:a.onError},{optimistic:a.optimistic,feedback:a.feedback,payload:a.payload}):Promise.resolve(),V=e.withLoading?e.withLoading(C,D):D();(W=V==null?void 0:V.catch)==null||W.call(V,()=>{})},I=a.onClick?()=>k():void 0,N=[];w?N.push(U("span",{key:"spinner",className:"bf-btn-spinner",style:{display:"inline-flex",width:"14px",height:"14px",marginRight:"6px",border:"2px solid currentColor",borderTopColor:"transparent",borderRadius:"50%",flexShrink:0}})):a.icon&&N.push(U("span",{key:"icon",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,marginRight:"6px"}},e.renderIcon(a.icon,a.iconSize||16))),N.push(U("span",{key:"text"},a.text||"Submit"));const z=U("button",{key:C,type:a.type||"submit",className:a.className,...e.getCommonProps(C,P,a),disabled:w||void 0,onClick:I},...N);l.push(t.secondaryButton?U("div",{key:`${n}-actions`,style:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:"12px",gridColumn:"1 / -1",borderTop:`1px solid ${e.cfg.colors.borderSubtle}`,paddingTop:"16px",marginTop:"8px"}},e.renderComponent({...t.secondaryButton,type:"button"},0,`${n}-actions`),z):z)}return U("form",{key:n,className:r,...o,style:{...o.style||{},...h>1?{display:"grid",gridTemplateColumns:`repeat(${m}, minmax(0, 1fr))`,columnGap:"1rem",rowGap:"1.25rem"}:{}},onSubmit:p=>p.preventDefault()},...l)}const Qft=y.memo(({api:e,field:t,value:n,onChange:r})=>{y.useEffect(()=>{n!==void 0&&n!==""&&r&&r(n)},[]);const i=y.useRef(null),o=(n||"").split(",").filter(Boolean).map(g=>g.trim()),[s,a]=y.useState(""),[l,h]=y.useState(!1),u=g=>{const b=g.target.value;if(b.includes(",")||b.includes(";")){const p=b.split(/[,;]+/).map(x=>x.trim()).filter(Boolean);if(p.length>0){const x=[...new Set([...o,...p])].join(", ");r(x)}a("")}else a(b)},f=g=>{if(g.key==="Enter"||g.key===","||g.key===";"){g.preventDefault();const b=s.trim();b&&(r([...new Set([...o,b])].join(", ")),a(""))}else g.key==="Backspace"&&!s&&o.length>0&&r(o.slice(0,-1).join(", "))},m=()=>{const g=s.trim();g&&(r([...new Set([...o,g])].join(", ")),a(""))};return U("div",{key:"tags",style:{width:"100%",marginBottom:"1rem"}},t.label?U("label",{style:{display:"block",fontSize:"0.875rem",fontWeight:500,color:e.cfg.colors.textSecondary,marginBottom:"0.75rem"}},t.label):null,U("div",{style:{display:"flex",flexWrap:"wrap",gap:"4px",padding:"0.5rem 0.75rem",borderRadius:e.cfg.components.inputRadius||"8px",backgroundColor:e.cfg.colors.surface,border:`1px solid ${l?e.cfg.colors.primary:e.cfg.colors.border}`,cursor:"text",outline:"none",transition:"border-color 0.2s"},onClick:()=>{var g;return(g=i.current)==null?void 0:g.focus()}},...o.map((g,b)=>U("span",{key:b,style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"2px 8px",borderRadius:"4px",backgroundColor:e.cfg.colors.background,border:`1px solid ${e.cfg.colors.borderSubtle}`,color:e.cfg.colors.text,fontSize:"13px",lineHeight:"1.4"}},U("span",null,g),U("button",{type:"button",onMouseDown:p=>{p.preventDefault(),p.stopPropagation(),r(o.filter((x,_)=>_!==b).join(", "))},style:{background:"none",border:"none",cursor:"pointer",color:e.cfg.colors.textMuted,padding:"0",fontSize:"14px",lineHeight:"1",display:"flex",alignItems:"center",fontFamily:"inherit"}},"×"))),U("input",{ref:i,type:"text",value:s,onChange:u,onKeyDown:f,onFocus:()=>h(!0),onBlur:()=>{h(!1),m()},placeholder:t.placeholder||(o.length>0?"":"Add email..."),style:{flex:1,minWidth:"100px",border:"none",outline:"none",backgroundColor:"transparent",color:e.cfg.colors.text,fontSize:"14px",fontFamily:"inherit",padding:"2px 0"}})))});function tdt(e,t,n){let r=e.interpolateText(t.text||t.content||"");if(!r)return null;!r.includes(`
|
|
124
124
|
`)&&r.includes("\\n")&&(r=r.replace(/\\n/g,`
|
|
125
125
|
`)),r=r.replace(/\(\s*image:\s*([^)]+?)\s*\)/gi,(x,_)=>`
|
|
126
126
|
|
package/dist/index.js
CHANGED
|
@@ -38556,19 +38556,24 @@ function Kdt(e, t, n) {
|
|
|
38556
38556
|
);
|
|
38557
38557
|
}
|
|
38558
38558
|
function Xdt(e, t, n) {
|
|
38559
|
-
const r = t.rows || 4
|
|
38559
|
+
const r = t.rows || 4, i = t.name || "", o = i ? e.sceneData[i] ?? "" : void 0, s = i ? (h) => e.setSceneData((u) => ({
|
|
38560
|
+
...u,
|
|
38561
|
+
[i]: h.target.value
|
|
38562
|
+
})) : void 0;
|
|
38560
38563
|
if (t.className) {
|
|
38561
|
-
const
|
|
38564
|
+
const h = e.parseClassName(t.className), u = e.getCommonProps(n, h, t);
|
|
38562
38565
|
return U("textarea", {
|
|
38563
38566
|
key: n,
|
|
38564
38567
|
className: t.className,
|
|
38565
|
-
...
|
|
38568
|
+
...u,
|
|
38566
38569
|
name: t.name,
|
|
38567
38570
|
placeholder: t.placeholder,
|
|
38568
|
-
rows: r
|
|
38571
|
+
rows: r,
|
|
38572
|
+
value: o,
|
|
38573
|
+
onChange: s
|
|
38569
38574
|
});
|
|
38570
38575
|
}
|
|
38571
|
-
const
|
|
38576
|
+
const a = {
|
|
38572
38577
|
width: "100%",
|
|
38573
38578
|
padding: "0.75rem 1rem",
|
|
38574
38579
|
borderRadius: e.cfg.components.inputRadius,
|
|
@@ -38579,12 +38584,12 @@ function Xdt(e, t, n) {
|
|
|
38579
38584
|
transition: e.cfg.effects.transition,
|
|
38580
38585
|
resize: "vertical",
|
|
38581
38586
|
fontFamily: "inherit"
|
|
38582
|
-
},
|
|
38587
|
+
}, l = e.getCommonProps(n, a, t);
|
|
38583
38588
|
if (t.label) {
|
|
38584
|
-
const
|
|
38589
|
+
const h = e.getCommonProps(n, { width: "100%" }, t);
|
|
38585
38590
|
return U(
|
|
38586
38591
|
"div",
|
|
38587
|
-
{ key: n, ...
|
|
38592
|
+
{ key: n, ...h },
|
|
38588
38593
|
U(
|
|
38589
38594
|
"label",
|
|
38590
38595
|
{
|
|
@@ -38599,19 +38604,23 @@ function Xdt(e, t, n) {
|
|
|
38599
38604
|
t.label
|
|
38600
38605
|
),
|
|
38601
38606
|
U("textarea", {
|
|
38602
|
-
...
|
|
38607
|
+
...l,
|
|
38603
38608
|
name: t.name,
|
|
38604
38609
|
placeholder: t.placeholder,
|
|
38605
|
-
rows: r
|
|
38610
|
+
rows: r,
|
|
38611
|
+
value: o,
|
|
38612
|
+
onChange: s
|
|
38606
38613
|
})
|
|
38607
38614
|
);
|
|
38608
38615
|
}
|
|
38609
38616
|
return U("textarea", {
|
|
38610
38617
|
key: n,
|
|
38611
|
-
...
|
|
38618
|
+
...l,
|
|
38612
38619
|
name: t.name,
|
|
38613
38620
|
placeholder: t.placeholder,
|
|
38614
|
-
rows: r
|
|
38621
|
+
rows: r,
|
|
38622
|
+
value: o,
|
|
38623
|
+
onChange: s
|
|
38615
38624
|
});
|
|
38616
38625
|
}
|
|
38617
38626
|
function Jdt(e, t, n) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../src/renderer/components.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,MAAM,OAAO,CAAC;AA4B1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAI9C,OAAO,EAAE,KAAK,SAAS,EAAE,CAAC;AAsB1B,iBAAS,UAAU,CACjB,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,CAiDjB;AASD,iBAAS,UAAU,CACjB,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,CAgBjB;AAED,iBAAS,UAAU,CACjB,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,CAqIjB;AAED,iBAAS,YAAY,CACnB,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,CA2WjB;AAqFD,iBAAS,WAAW,CAClB,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,CAwGjB;AAED,iBAAS,WAAW,CAClB,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,CAqHjB;AAED,iBAAS,YAAY,CACnB,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,CAUjB;AAED,iBAAS,YAAY,CACnB,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,CAiHjB;AAED,iBAAS,cAAc,CACrB,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,CA2FjB;AAED,iBAAS,WAAW,CAClB,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,CAsEjB;AAED,iBAAS,SAAS,CAChB,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,CAmBjB;AAED,iBAAS,YAAY,CACnB,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,CAoDjB;AAED,iBAAS,cAAc,CACrB,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,CAqEjB;AAED,iBAAS,YAAY,CACnB,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,CA2EjB;AAED,iBAAS,gBAAgB,CACvB,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,CAuDjB;AAED,iBAAS,YAAY,CACnB,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,CA4KjB;AAED,iBAAS,aAAa,CACpB,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,CAiDjB;AAED,iBAAS,YAAY,CACnB,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,CA6OjB;AAED,iBAAS,YAAY,CACnB,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,CAkBjB;AAED,iBAAS,aAAa,CACpB,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,CASjB;AAED,iBAAS,YAAY,CACnB,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,CAiMjB;AAED,iBAAS,cAAc,CACrB,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,
|
|
1
|
+
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../src/renderer/components.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,MAAM,OAAO,CAAC;AA4B1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAI9C,OAAO,EAAE,KAAK,SAAS,EAAE,CAAC;AAsB1B,iBAAS,UAAU,CACjB,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,CAiDjB;AASD,iBAAS,UAAU,CACjB,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,CAgBjB;AAED,iBAAS,UAAU,CACjB,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,CAqIjB;AAED,iBAAS,YAAY,CACnB,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,CA2WjB;AAqFD,iBAAS,WAAW,CAClB,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,CAwGjB;AAED,iBAAS,WAAW,CAClB,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,CAqHjB;AAED,iBAAS,YAAY,CACnB,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,CAUjB;AAED,iBAAS,YAAY,CACnB,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,CAiHjB;AAED,iBAAS,cAAc,CACrB,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,CA2FjB;AAED,iBAAS,WAAW,CAClB,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,CAsEjB;AAED,iBAAS,SAAS,CAChB,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,CAmBjB;AAED,iBAAS,YAAY,CACnB,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,CAoDjB;AAED,iBAAS,cAAc,CACrB,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,CAqEjB;AAED,iBAAS,YAAY,CACnB,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,CA2EjB;AAED,iBAAS,gBAAgB,CACvB,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,CAuDjB;AAED,iBAAS,YAAY,CACnB,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,CA4KjB;AAED,iBAAS,aAAa,CACpB,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,CAiDjB;AAED,iBAAS,YAAY,CACnB,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,CA6OjB;AAED,iBAAS,YAAY,CACnB,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,CAkBjB;AAED,iBAAS,aAAa,CACpB,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,CASjB;AAED,iBAAS,YAAY,CACnB,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,CAiMjB;AAED,iBAAS,cAAc,CACrB,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,CA8EjB;AAED,iBAAS,UAAU,CACjB,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,CAwBjB;AAED,iBAAS,mBAAmB,CAC1B,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,CA8FjB;AAED,iBAAS,eAAe,CACtB,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,CA6KjB;AA2BD,iBAAS,cAAc,CACrB,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,CA0EjB;AAED,iBAAS,cAAc,CACrB,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,EACpB,KAAK,UAAQ,GACZ,KAAK,CAAC,SAAS,CAmEjB;AAED,iBAAS,kBAAkB,CACzB,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,CA4DjB;AAwHD,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,EACpB,MAAM,UAAQ,EACd,OAAO,UAAQ,GACd,KAAK,CAAC,SAAS,CA6GjB;AAED,wBAAgB,cAAc,CAC5B,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,CA8EjB;AAoOD,iBAAS,iBAAiB,CACxB,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,CAEjB;AAED,iBAAS,iBAAiB,CACxB,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,CAkBjB;AA2DD,iBAAS,UAAU,CACjB,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,CAEjB;AAED,iBAAS,aAAa,CACpB,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,CAuBjB;AA2gCD,iBAAS,oBAAoB,CAC3B,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,CAOjB;AAED,iBAAS,YAAY,CACnB,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,CAoBjB;AAkfD,iBAAS,oBAAoB,CAC3B,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,CAEjB;AAmID,iBAAS,UAAU,CACjB,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,CAkCjB;AAsVD,QAAA,MAAM,WAAW;SAKV,SAAS;OACX,GAAG;kBACQ,MAAM;EA4TpB,CAAC;AAEH,QAAA,MAAM,YAAY;SAKX,SAAS;OACX,GAAG;kBACQ,MAAM;EA4JpB,CAAC;AAk9BH,iBAAS,cAAc,CACrB,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,CA6TjB;AAID,wBAAgB,eAAe,CAC7B,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,CAsDjB;AAED,wBAAgB,WAAW,CACzB,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,CAmDjB;AAED,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,SAAS,EACd,CAAC,EAAE,GAAG,EACN,YAAY,EAAE,MAAM,GACnB,KAAK,CAAC,SAAS,CAiCjB;AAwID,iBAAS,oBAAoB,CAAC,GAAG,EAAE,SAAS,EAAE,CAAC,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM;SA5HnE,SAAS;OACX,GAAG;kBACQ,MAAM;GAiIrB;AA2DD,iBAAS,eAAe,CAAC,GAAG,EAAE,SAAS,EAAE,CAAC,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM;SAhD9D,SAAS;OACX,GAAG;kBACQ,MAAM;GAqDrB;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE;IACvC,GAAG,EAAE,SAAS,CAAC;IACf,MAAM,EAAE,GAAG,CAAC;CACb,GAAG,KAAK,CAAC,SAAS,CA4HlB;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE;IACvC,GAAG,EAAE,SAAS,CAAC;IACf,MAAM,EAAE,GAAG,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GAAG,KAAK,CAAC,SAAS,CAsElB;AAKD,QAAA,MAAM,MAAM;SAKL,SAAS;OACX,GAAG;kBACQ,MAAM;EA8CpB,CAAC;AAEH,OAAO,EACL,MAAM,EACN,oBAAoB,EACpB,YAAY,EACZ,WAAW,EACX,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,aAAa,EACb,aAAa,EACb,oBAAoB,EACpB,UAAU,EACV,iBAAiB,EACjB,UAAU,EACV,YAAY,EACZ,UAAU,EACV,UAAU,EACV,WAAW,EACX,YAAY,EACZ,WAAW,EACX,WAAW,EACX,UAAU,EACV,YAAY,EACZ,cAAc,EACd,eAAe,EACf,oBAAoB,EACpB,aAAa,EACb,mBAAmB,EACnB,cAAc,EACd,cAAc,EACd,kBAAkB,EAClB,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,UAAU,EACV,cAAc,EACd,iBAAiB,EACjB,YAAY,GACb,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "backflow-ui-renderer",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Standalone React workflow renderer for Backflow.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -65,4 +65,4 @@
|
|
|
65
65
|
"vite": "^5.0.12",
|
|
66
66
|
"vite-plugin-dts": "^4.0.0"
|
|
67
67
|
}
|
|
68
|
-
}
|
|
68
|
+
}
|