@gearbox-protocol/ui-kit 3.14.0-next.1 → 3.14.0-next.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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),f=require("class-variance-authority"),X=require("react"),$=require("../currency-button/currency-button.cjs"),E=require("@fortawesome/free-solid-svg-icons"),G=require("../icons/fa-icon.cjs"),m=require("../../hooks/use-media-query.cjs"),c=require("../../test-ids/smart-number-input.cjs"),H=require("../../utils/bn-to-input-view.cjs");require("@gearbox-protocol/sdk");const J=require("../../utils/parse-input-to-bn.cjs"),p=require("../../utils/cn.cjs");require("sonner");require("@gearbox-protocol/sdk/common-utils");require("luxon");require("../../utils/z-index.cjs");const K=require("./balance-indicator.cjs");function U(s){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const a in s)if(a!=="default"){const r=Object.getOwnPropertyDescriptor(s,a);Object.defineProperty(t,a,r.get?r:{enumerable:!0,get:()=>s[a]})}}return t.default=s,Object.freeze(t)}const I=U(X),W=f.cva("relative w-full text-foreground bg-gray-20 border border-gray-30 transition-[background-color] duration-100 ease-linear [&:hover]:bg-gray-30 [&:hover]:border-gray-40 data-[active=true]:bg-gray-30 data-[active=true]:outline data-[active=true]:outline-2 data-[active=true]:outline-primary data-[active=true]:outline-offset-[-2px] data-[disabled=true]:cursor-not-allowed",{variants:{size:{sm:"px-3 py-[7px] h-[60px] rounded-[8px]",md:"pl-4 pr-3 py-[10px] h-[82px] rounded-lg"}},defaultVariants:{size:"md"}}),Y=f.cva("font-medium text-foreground",{variants:{size:{sm:"text-xs",md:"text-sm"}},defaultVariants:{size:"md"}}),Z=f.cva("w-full p-0 bg-transparent border-none outline-none text-foreground placeholder:text-secondary-foreground focus:outline-none",{variants:{size:{sm:"text-[18px]! leading-[21px]!",md:"text-[28px]! leading-[33px]!"}},defaultVariants:{size:"md"}}),N=I.forwardRef(({amount:s,token:t,label:a="Amount",maxAmount:r,maxAmountLimit:l,maxButtonLabel:j,chainId:w,network:q,maxButton:z=!0,disabled:n=!1,active:_=!1,size:V="md",onSetAmount:o,onShowSelectDialog:b,onRemove:x,onFocus:B,onBlur:T},C)=>{const g=t?.decimals??18,M=u=>{const d=u.target.value,[y,v]=J.parseInputToBN(d,g);y===null||v===null||o&&o(y,v)},k=()=>{if(o){const u=r&&l&&r>l?l:r||0n,d=H.bnToInputView(u,g);o(u,d)}},[S,h]=I.useState(!1),O=()=>{h(!0),B?.()},F=()=>{h(!1),T?.()},i=V??"md",L=m.useIsMobile(),D=m.useIsTablet(),P=m.useIsDesktop(),R=L?20:D?30:P?22:30,Q=!!(t||b);return e.jsxs("div",{ref:C,className:W({size:i}),"data-testid":c.smartNumberInputTestIds.root,"data-active":S,"data-disabled":n,children:[x&&e.jsx("div",{className:"absolute top-0 right-0 flex h-5 w-5 translate-x-1/2 -translate-y-1/2 items-center justify-center","data-testid":c.smartNumberInputTestIds.close,children:e.jsx("button",{type:"button",onClick:x,className:"flex h-5 w-5 items-center justify-center rounded-full bg-muted hover:bg-muted/80 text-muted-foreground",children:e.jsx(G.FaIcon,{icon:E.faXmark,className:"size-3"})})}),e.jsxs("div",{className:"mb-2 flex justify-between text-sm leading-[120%]",children:[e.jsx("span",{className:p.cn(Y({size:i}),"grow shrink-0 basis-0"),"data-testid":c.smartNumberInputTestIds.label,children:a}),r!==void 0&&t&&e.jsx(K.BalanceIndicator,{title:j,token:t,maxAmount:r,size:i,disabled:n,maxButton:z,onMaxButtonClick:k})]}),e.jsxs("div",{className:p.cn("flex w-full max-w-full shrink-0 basis-full items-center"),children:[e.jsx("div",{className:"mr-3 grow shrink-0 basis-0",children:e.jsx("input",{type:"text",inputMode:"decimal",autoComplete:"off",autoCorrect:"off",spellCheck:"false",pattern:"^[0-9]*[.,]?[0-9]*$",placeholder:"0",value:s,onChange:M,onFocus:O,onBlur:F,disabled:n||!o,className:p.cn(Z({size:i}),n&&"cursor-not-allowed"),"data-testid":c.smartNumberInputTestIds.input,minLength:1,maxLength:79,title:"Amount"})}),Q?e.jsx($.CurrencyButton,{active:_,size:i,disabled:n,token:t,showSelectDialog:b,chainId:w,network:q,maxLength:R,children:t?.symbol??"Select token"}):null]})]})});N.displayName="SmartNumberInput";exports.SmartNumberInput=N;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),y=require("class-variance-authority"),U=require("react"),W=require("../currency-button/currency-button.cjs"),Y=require("@fortawesome/free-solid-svg-icons"),Z=require("../icons/fa-icon.cjs"),b=require("../../hooks/use-media-query.cjs"),f=require("../../test-ids/smart-number-input.cjs"),A=require("../../utils/bn-to-input-view.cjs");require("@gearbox-protocol/sdk");const ee=require("../../utils/parse-input-to-bn.cjs"),v=require("../../utils/cn.cjs");require("sonner");require("@gearbox-protocol/sdk/common-utils");require("luxon");require("../../utils/z-index.cjs");const te=require("./balance-indicator.cjs");function se(r){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const o in r)if(o!=="default"){const n=Object.getOwnPropertyDescriptor(r,o);Object.defineProperty(s,o,n.get?n:{enumerable:!0,get:()=>r[o]})}}return s.default=r,Object.freeze(s)}const c=se(U),ne=y.cva("relative w-full text-foreground bg-gray-20 border border-gray-30 transition-[background-color] duration-100 ease-linear [&:hover]:bg-gray-30 [&:hover]:border-gray-40 data-[active=true]:bg-gray-30 data-[active=true]:outline data-[active=true]:outline-2 data-[active=true]:outline-primary data-[active=true]:outline-offset-[-2px] data-[disabled=true]:cursor-not-allowed",{variants:{size:{sm:"px-3 py-[7px] h-[60px] rounded-[8px]",md:"pl-4 pr-3 py-[10px] h-[82px] rounded-lg"}},defaultVariants:{size:"md"}}),re=y.cva("font-medium text-foreground",{variants:{size:{sm:"text-xs",md:"text-sm"}},defaultVariants:{size:"md"}}),ae=y.cva("w-full p-0 bg-transparent border-none outline-none text-foreground placeholder:text-secondary-foreground focus:outline-none",{variants:{size:{sm:"text-[18px]! leading-[21px]!",md:"text-[28px]! leading-[33px]!"}},defaultVariants:{size:"md"}}),k=c.forwardRef(({amount:r,token:s,label:o="Amount",maxAmount:n,maxAmountLimit:p,maxButtonLabel:M,chainId:_,network:C,maxButton:T=!0,disabled:i=!1,active:B=!1,size:V="md",symbolMaxLength:S,tokenOptions:x,onSetAmount:l,onShowSelectDialog:I,onRemove:N,onFocus:L,onBlur:O},F)=>{const j=s?.decimals??18,R=t=>{const a=t.target.value,[q,z]=ee.parseInputToBN(a,j);q===null||z===null||l&&l(q,z)},D=()=>{if(l){const t=n&&p&&n>p?p:n||0n,a=A.bnToInputView(t,j);l(t,a)}},[E,w]=c.useState(!1),P=()=>{w(!0),L?.()},Q=()=>{w(!1),O?.()},u=V??"md",X=b.useIsMobile(),$=b.useIsTablet(),G=b.useIsDesktop(),H=S??(X?20:$?30:G?22:30),[d,g]=c.useState(!1),h=c.useRef(null);c.useEffect(()=>{if(!d)return;const t=a=>{h.current&&!h.current.contains(a.target)&&g(!1)};return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[d]);const m=!!(x&&x.length>0),J=!i&&m?()=>g(t=>!t):I,K=!!(s||I||m);return e.jsxs("div",{ref:F,className:ne({size:u}),"data-testid":f.smartNumberInputTestIds.root,"data-active":E,"data-disabled":i,children:[N&&e.jsx("div",{className:"absolute top-0 right-0 flex h-5 w-5 translate-x-1/2 -translate-y-1/2 items-center justify-center","data-testid":f.smartNumberInputTestIds.close,children:e.jsx("button",{type:"button",onClick:N,className:"flex h-5 w-5 items-center justify-center rounded-full bg-muted hover:bg-muted/80 text-muted-foreground",children:e.jsx(Z.FaIcon,{icon:Y.faXmark,className:"size-3"})})}),e.jsxs("div",{className:"mb-2 flex justify-between text-sm leading-[120%]",children:[e.jsx("span",{className:v.cn(re({size:u}),"grow shrink-0 basis-0"),"data-testid":f.smartNumberInputTestIds.label,children:o}),n!==void 0&&s&&e.jsx(te.BalanceIndicator,{title:M,token:s,maxAmount:n,size:u,disabled:i,maxButton:T,onMaxButtonClick:D})]}),e.jsxs("div",{className:v.cn("flex w-full max-w-full shrink-0 basis-full items-center"),children:[e.jsx("div",{className:"mr-3 grow shrink-0 basis-0",children:e.jsx("input",{type:"text",inputMode:"decimal",autoComplete:"off",autoCorrect:"off",spellCheck:"false",pattern:"^[0-9]*[.,]?[0-9]*$",placeholder:"0",value:r,onChange:R,onFocus:P,onBlur:Q,disabled:i||!l,className:v.cn(ae({size:u}),i&&"cursor-not-allowed"),"data-testid":f.smartNumberInputTestIds.input,minLength:1,maxLength:79,title:"Amount"})}),K?e.jsxs("div",{ref:h,className:"relative shrink-0",children:[e.jsx(W.CurrencyButton,{active:m?d:B,size:u,disabled:i,token:s,showSelectDialog:J,chainId:_,network:C,maxLength:H,children:s?.symbol??"Select token"}),m&&d&&e.jsx("div",{className:"absolute right-0 top-full z-20 mt-1 min-w-[140px] overflow-hidden rounded-lg border border-gray-30 bg-gray-20 shadow-lg",children:x?.map((t,a)=>e.jsxs("button",{type:"button",onClick:()=>{t.onSelect(),g(!1)},className:"flex w-full items-center gap-2 px-3 py-2 text-sm text-foreground hover:bg-gray-30 text-left",children:[t.icon?e.jsx("span",{className:"inline-flex shrink-0 items-center",children:t.icon}):null,e.jsx("span",{className:"truncate",children:t.label})]},a))})]}):null]})]})});k.displayName="SmartNumberInput";exports.SmartNumberInput=k;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),x=require("react"),re=require("sonner"),ne=require("../../hooks/use-media-query.cjs");require("@gearbox-protocol/sdk");const oe=require("../../utils/cn.cjs");require("@gearbox-protocol/sdk/common-utils");require("luxon");require("../../utils/z-index.cjs");const ie=require("../buttons/range-buttons/range-buttons.cjs"),j=require("../graph/graph.cjs"),se=require("../graph/graph-view.cjs"),le=require("./graph-dropdown.cjs"),ce=({size:e=16})=>o.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-label":"Expand fullscreen",children:[o.jsx("title",{children:"Expand fullscreen"}),o.jsx("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"})]}),ue=({size:e=16})=>o.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-label":"Exit fullscreen",children:[o.jsx("title",{children:"Exit fullscreen"}),o.jsx("path",{d:"M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3"})]}),q="ui-kit:tradingview-series-colors:";function E(e){if(typeof window>"u"||!window.localStorage)return new Map;try{const t=window.localStorage.getItem(q+e);if(!t)return new Map;const c=JSON.parse(t);return c==null||typeof c!="object"?new Map:new Map(Object.entries(c).filter(([,r])=>typeof r=="number"&&r>=0&&r<j.DEFAULT_SERIES_COLORS.length))}catch{return new Map}}function ae(e,t){if(!(typeof window>"u"||!window.localStorage))try{window.localStorage.setItem(q+e,JSON.stringify(Object.fromEntries(t)))}catch{}}function O(e,t){if(t.size===0)return;const c=E(e);for(const[r,b]of t)c.set(r,b);ae(e,c)}function de({data:e,yMeasureUnit:t,height:c=306,defaultGraph:r,onGraphSelected:b,graphs:m,isMultipleSelect:N,range:T,rangeList:M,setRange:V,onGraphExpanded:y,isGraphExpanded:F,onUnselectSeries:B,graphsWithNoData:D,loadingGraphs:z,noDataMessage:I="No data available for this graph",currentValueDecimals:W,containerClassName:H,useSharedPriceScale:J,showCurrentValue:$,yScaleMin:Q,yScaleMinMultiple:X,seriesColorPersistenceKey:u,...Y}){const v=x.useMemo(()=>Array.isArray(e)?e:e?[e]:[],[e]),R=x.useMemo(()=>Array.isArray(e)&&e.length>1,[e]),C=ne.useIsMobile(),Z=x.useCallback((w,p)=>{re.toast.error(I)},[I]),U=x.useMemo(()=>{if(t)return Array.isArray(t)?t[0]:t},[t]),P=(!C&&y||M.length>0||b&&m&&r)&&o.jsxs("div",{className:"z-10 w-full flex flex-row flex-wrap sm:flex-nowrap items-center gap-2",children:[o.jsx("div",{children:b&&m&&r&&o.jsx(le.GraphDropdown,{onSelected:b,items:m,defaultItem:r,multiple:N,graphsWithNoData:D,loadingGraphs:z,onNoDataSelected:Z})}),o.jsxs("div",{className:"flex flex-row flex-nowrap justify-start sm:justify-end items-center flex-1",children:[o.jsx(ie.RangeButtons,{range:T,rangeList:M,setRange:V}),!C&&y&&o.jsx("button",{type:"button",className:"px-2.5 py-1.5 flex min-w-[44px] min-h-[26px] justify-center items-center text-xs leading-[14px] font-medium text-center rounded-md border cursor-pointer transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring bg-muted border-muted text-muted-foreground hover:border-secondary ml-1.5",onClick:y,children:F?o.jsx(ue,{size:16}):o.jsx(ce,{size:16})})]})]}),s=x.useRef(new Map),f=x.useRef(0),k=x.useRef(!1);if(m&&m.length>0&&!k.current){k.current=!0;const w=u?E(u):new Map,p=String(m[0].value);s.current.set(p,0),f.current=1;for(let n=1;n<m.length;n++){const a=String(m[n].value);if(s.current.has(a))continue;const h=w.get(a)??n;s.current.set(a,h),f.current=Math.max(f.current,h+1)}u&&O(u,s.current)}const K=x.useMemo(()=>{const w=Array.isArray(t)?t:void 0;if(u){const n=E(u);for(const[a,g]of n)s.current.has(a)||(s.current.set(a,g),f.current=Math.max(f.current,g+1))}const p=v.map((n,a)=>{const g=n?.title||`Series ${a+1}`,h=r!=null?Array.isArray(r)?r[0]?.value??r[0]:typeof r=="object"&&"value"in r?r.value:r:null,A=v.length===1?h!=null?String(h):"single":n?.id||g;if(!s.current.has(A)){const i=new Set(Array.from(s.current.values()));let l=f.current;for(let d=0;d<j.DEFAULT_SERIES_COLORS.length;d++){const S=(f.current+d)%j.DEFAULT_SERIES_COLORS.length;if(!i.has(S)){l=S;break}}s.current.set(A,l),f.current=l+1}const ee=s.current.get(A)??0,_=j.getSeriesColorPalette(ee),te=[...n?.data||[]].sort((i,l)=>{const d=typeof i.time=="number"?i.time:Number(i.time),S=typeof l.time=="number"?l.time:Number(l.time);return d-S}).reduce((i,l)=>{const d=l.time;return i.length===0||i[i.length-1].time!==d?i.push({time:d,value:l.value}):i[i.length-1]={time:d,value:l.value},i},[]),L=n?.lineColor??n?.color??void 0;return{data:te,label:g,yMeasureUnit:w?.[a]??(Array.isArray(t)?void 0:t),...L!=null?{lineColor:L,...n?.topColor!=null&&{topColor:n.topColor},...n?.bottomColor!=null&&{bottomColor:n.bottomColor}}:{color:_.line,topColor:_.top,bottomColor:_.bottom}}});return u&&s.current.size>0&&O(u,s.current),p},[v,r,t,u]),G=R&&v.length>0?v.some(w=>!w):!e;return o.jsx("div",{style:{width:"100%",height:c?`${c}px`:void 0},className:"w-full",children:o.jsx(se.GraphViewWithData,{series:K,loading:G,toolbar:P,size:c?"full":"default",containerClassName:oe.cn("h-full",H),showLegend:R,onUnselectSeries:B,yMeasureUnit:U,currentValueDecimals:W,useSharedPriceScale:J,showCurrentValue:$,yScaleMin:Q,yScaleMinMultiple:X,...Y})})}exports.TradingView=de;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),x=require("react"),re=require("sonner"),ne=require("../../hooks/use-media-query.cjs");require("@gearbox-protocol/sdk");const oe=require("../../utils/cn.cjs");require("@gearbox-protocol/sdk/common-utils");require("luxon");require("../../utils/z-index.cjs");const ie=require("../buttons/range-buttons/range-buttons.cjs"),j=require("../graph/graph.cjs"),se=require("../graph/graph-view.cjs"),le=require("./graph-dropdown.cjs"),ce=({size:e=16})=>o.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-label":"Expand fullscreen",children:[o.jsx("title",{children:"Expand fullscreen"}),o.jsx("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"})]}),ue=({size:e=16})=>o.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-label":"Exit fullscreen",children:[o.jsx("title",{children:"Exit fullscreen"}),o.jsx("path",{d:"M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3"})]}),N="ui-kit:tradingview-series-colors:";function M(e){if(typeof window>"u"||!window.localStorage)return new Map;try{const t=window.localStorage.getItem(N+e);if(!t)return new Map;const c=JSON.parse(t);return c==null||typeof c!="object"?new Map:new Map(Object.entries(c).filter(([,r])=>typeof r=="number"&&r>=0&&r<j.DEFAULT_SERIES_COLORS.length))}catch{return new Map}}function ae(e,t){if(!(typeof window>"u"||!window.localStorage))try{window.localStorage.setItem(N+e,JSON.stringify(Object.fromEntries(t)))}catch{}}function q(e,t){if(t.size===0)return;const c=M(e);for(const[r,b]of t)c.set(r,b);ae(e,c)}function de({data:e,yMeasureUnit:t,height:c=306,defaultGraph:r,onGraphSelected:b,graphs:m,isMultipleSelect:T,range:V,rangeList:I,setRange:F,onGraphExpanded:y,isGraphExpanded:z,onUnselectSeries:B,graphsWithNoData:D,loadingGraphs:A,noDataMessage:R="No data available for this graph",currentValueDecimals:W,containerClassName:H,useSharedPriceScale:J,showCurrentValue:$,yScaleMin:Q,yScaleMinMultiple:X,seriesColorPersistenceKey:u,...Y}){const v=x.useMemo(()=>Array.isArray(e)?e:e?[e]:[],[e]),C=x.useMemo(()=>Array.isArray(e)&&e.length>1,[e]),k=ne.useIsMobile(),Z=x.useCallback((w,S)=>{re.toast.error(R)},[R]),U=x.useMemo(()=>{if(t)return Array.isArray(t)?t[0]:t},[t]),P=(!k&&y||I.length>0||b&&m&&r)&&o.jsxs("div",{className:"z-10 w-full flex flex-row flex-wrap sm:flex-nowrap items-center gap-2",children:[o.jsx("div",{children:b&&m&&r&&o.jsx(le.GraphDropdown,{onSelected:b,items:m,defaultItem:r,multiple:T,graphsWithNoData:D,loadingGraphs:A,onNoDataSelected:Z})}),o.jsxs("div",{className:"flex flex-row flex-nowrap justify-start sm:justify-end items-center flex-1",children:[o.jsx(ie.RangeButtons,{range:V,rangeList:I,setRange:F}),!k&&y&&o.jsx("button",{type:"button",className:"px-2.5 py-1.5 flex min-w-[44px] min-h-[26px] justify-center items-center text-xs leading-[14px] font-medium text-center rounded-md border cursor-pointer transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring bg-muted border-muted text-muted-foreground hover:border-secondary ml-1.5",onClick:y,children:z?o.jsx(ue,{size:16}):o.jsx(ce,{size:16})})]})]}),s=x.useRef(new Map),f=x.useRef(0),L=x.useRef(!1);if(m&&m.length>0&&!L.current){L.current=!0;const w=u?M(u):new Map,S=String(m[0].value);s.current.set(S,0),f.current=1;for(let n=1;n<m.length;n++){const a=String(m[n].value);if(s.current.has(a))continue;const h=w.get(a)??n;s.current.set(a,h),f.current=Math.max(f.current,h+1)}u&&q(u,s.current)}const K=x.useMemo(()=>{const w=Array.isArray(t)?t:void 0;if(u){const n=M(u);for(const[a,g]of n)s.current.has(a)||(s.current.set(a,g),f.current=Math.max(f.current,g+1))}const S=v.map((n,a)=>{const g=n?.title||`Series ${a+1}`,h=r!=null?Array.isArray(r)?r[0]?.value??r[0]:typeof r=="object"&&"value"in r?r.value:r:null,_=v.length===1?h!=null?String(h):"single":n?.id||g;if(!s.current.has(_)){const i=new Set(Array.from(s.current.values()));let l=f.current;for(let d=0;d<j.DEFAULT_SERIES_COLORS.length;d++){const p=(f.current+d)%j.DEFAULT_SERIES_COLORS.length;if(!i.has(p)){l=p;break}}s.current.set(_,l),f.current=l+1}const ee=s.current.get(_)??0,E=j.getSeriesColorPalette(ee),te=[...n?.data||[]].sort((i,l)=>{const d=typeof i.time=="number"?i.time:Number(i.time),p=typeof l.time=="number"?l.time:Number(l.time);return d-p}).reduce((i,l)=>{const d=l.time;return i.length===0||i[i.length-1].time!==d?i.push({time:d,value:l.value}):i[i.length-1]={time:d,value:l.value},i},[]),O=n?.lineColor??n?.color??void 0;return{data:te,label:g,yMeasureUnit:w?.[a]??(Array.isArray(t)?void 0:t),...O!=null?{lineColor:O,...n?.topColor!=null&&{topColor:n.topColor},...n?.bottomColor!=null&&{bottomColor:n.bottomColor}}:{color:E.line,topColor:E.top,bottomColor:E.bottom}}});return u&&s.current.size>0&&q(u,s.current),S},[v,r,t,u]),G=A!==void 0?A.size>0:C&&v.length>0?v.some(w=>!w):!e;return o.jsx("div",{style:{width:"100%",height:c?`${c}px`:void 0},className:"w-full",children:o.jsx(se.GraphViewWithData,{series:K,loading:G,toolbar:P,size:c?"full":"default",containerClassName:oe.cn("h-full",H),showLegend:C,onUnselectSeries:B,yMeasureUnit:U,currentValueDecimals:W,useSharedPriceScale:J,showCurrentValue:$,yScaleMin:Q,yScaleMinMultiple:X,...Y})})}exports.TradingView=de;
@@ -1,21 +1,21 @@
1
- import { jsxs as c, jsx as e } from "react/jsx-runtime";
2
- import { cva as m } from "class-variance-authority";
3
- import * as v from "react";
4
- import { CurrencyButton as G } from "../currency-button/currency-button.js";
5
- import { faXmark as H } from "@fortawesome/free-solid-svg-icons";
6
- import { FaIcon as J } from "../icons/fa-icon.js";
7
- import { useIsMobile as K, useIsTablet as O, useIsDesktop as P } from "../../hooks/use-media-query.js";
8
- import { smartNumberInputTestIds as n } from "../../test-ids/smart-number-input.js";
9
- import { bnToInputView as Q } from "../../utils/bn-to-input-view.js";
1
+ import { jsxs as i, jsx as t } from "react/jsx-runtime";
2
+ import { cva as b } from "class-variance-authority";
3
+ import * as c from "react";
4
+ import { CurrencyButton as U } from "../currency-button/currency-button.js";
5
+ import { faXmark as W } from "@fortawesome/free-solid-svg-icons";
6
+ import { FaIcon as Y } from "../icons/fa-icon.js";
7
+ import { useIsMobile as Z, useIsTablet as _, useIsDesktop as A } from "../../hooks/use-media-query.js";
8
+ import { smartNumberInputTestIds as m } from "../../test-ids/smart-number-input.js";
9
+ import { bnToInputView as ee } from "../../utils/bn-to-input-view.js";
10
10
  import "@gearbox-protocol/sdk";
11
- import { parseInputToBN as U } from "../../utils/parse-input-to-bn.js";
12
- import { cn as u } from "../../utils/cn.js";
11
+ import { parseInputToBN as te } from "../../utils/parse-input-to-bn.js";
12
+ import { cn as x } from "../../utils/cn.js";
13
13
  import "sonner";
14
14
  import "@gearbox-protocol/sdk/common-utils";
15
15
  import "luxon";
16
16
  import "../../utils/z-index.js";
17
- import { BalanceIndicator as W } from "./balance-indicator.js";
18
- const Y = m(
17
+ import { BalanceIndicator as re } from "./balance-indicator.js";
18
+ const ae = b(
19
19
  "relative w-full text-foreground bg-gray-20 border border-gray-30 transition-[background-color] duration-100 ease-linear [&:hover]:bg-gray-30 [&:hover]:border-gray-40 data-[active=true]:bg-gray-30 data-[active=true]:outline data-[active=true]:outline-2 data-[active=true]:outline-primary data-[active=true]:outline-offset-[-2px] data-[disabled=true]:cursor-not-allowed",
20
20
  {
21
21
  variants: {
@@ -26,7 +26,7 @@ const Y = m(
26
26
  },
27
27
  defaultVariants: { size: "md" }
28
28
  }
29
- ), Z = m("font-medium text-foreground", {
29
+ ), ne = b("font-medium text-foreground", {
30
30
  variants: {
31
31
  size: {
32
32
  sm: "text-xs",
@@ -34,7 +34,7 @@ const Y = m(
34
34
  }
35
35
  },
36
36
  defaultVariants: { size: "md" }
37
- }), _ = m(
37
+ }), se = b(
38
38
  "w-full p-0 bg-transparent border-none outline-none text-foreground placeholder:text-secondary-foreground focus:outline-none",
39
39
  {
40
40
  variants: {
@@ -45,97 +45,107 @@ const Y = m(
45
45
  },
46
46
  defaultVariants: { size: "md" }
47
47
  }
48
- ), A = v.forwardRef(
48
+ ), oe = c.forwardRef(
49
49
  ({
50
- amount: y,
51
- token: t,
52
- label: w = "Amount",
53
- maxAmount: a,
54
- maxAmountLimit: l,
55
- maxButtonLabel: z,
56
- chainId: N,
57
- network: I,
58
- maxButton: C = !0,
59
- disabled: r = !1,
60
- active: V = !1,
61
- size: B = "md",
62
- onSetAmount: s,
63
- onShowSelectDialog: p,
64
- onRemove: f,
65
- onFocus: k,
66
- onBlur: M
67
- }, j) => {
68
- const h = t?.decimals ?? 18, F = (i) => {
69
- const d = i.target.value, [x, b] = U(d, h);
70
- x === null || b === null || s && s(x, b);
71
- }, L = () => {
72
- if (s) {
73
- const i = a && l && a > l ? l : a || 0n, d = Q(i, h);
74
- s(i, d);
50
+ amount: k,
51
+ token: a,
52
+ label: I = "Amount",
53
+ maxAmount: s,
54
+ maxAmountLimit: f,
55
+ maxButtonLabel: M,
56
+ chainId: V,
57
+ network: B,
58
+ maxButton: L = !0,
59
+ disabled: n = !1,
60
+ active: T = !1,
61
+ size: j = "md",
62
+ symbolMaxLength: F,
63
+ tokenOptions: p,
64
+ onSetAmount: o,
65
+ onShowSelectDialog: v,
66
+ onRemove: y,
67
+ onFocus: E,
68
+ onBlur: R
69
+ }, S) => {
70
+ const w = a?.decimals ?? 18, D = (e) => {
71
+ const r = e.target.value, [z, C] = te(r, w);
72
+ z === null || C === null || o && o(z, C);
73
+ }, O = () => {
74
+ if (o) {
75
+ const e = s && f && s > f ? f : s || 0n, r = ee(e, w);
76
+ o(e, r);
75
77
  }
76
- }, [T, g] = v.useState(!1), D = () => {
77
- g(!0), k?.();
78
- }, R = () => {
79
- g(!1), M?.();
80
- }, o = B ?? "md", S = K(), X = O(), $ = P(), q = S ? 20 : X ? 30 : $ ? 22 : 30, E = !!(t || p);
81
- return /* @__PURE__ */ c(
78
+ }, [X, N] = c.useState(!1), $ = () => {
79
+ N(!0), E?.();
80
+ }, q = () => {
81
+ N(!1), R?.();
82
+ }, l = j ?? "md", G = Z(), H = _(), J = A(), K = F ?? (G ? 20 : H ? 30 : J ? 22 : 30), [u, h] = c.useState(!1), g = c.useRef(null);
83
+ c.useEffect(() => {
84
+ if (!u) return;
85
+ const e = (r) => {
86
+ g.current && !g.current.contains(r.target) && h(!1);
87
+ };
88
+ return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
89
+ }, [u]);
90
+ const d = !!(p && p.length > 0), P = !n && d ? () => h((e) => !e) : v, Q = !!(a || v || d);
91
+ return /* @__PURE__ */ i(
82
92
  "div",
83
93
  {
84
- ref: j,
85
- className: Y({ size: o }),
86
- "data-testid": n.root,
87
- "data-active": T,
88
- "data-disabled": r,
94
+ ref: S,
95
+ className: ae({ size: l }),
96
+ "data-testid": m.root,
97
+ "data-active": X,
98
+ "data-disabled": n,
89
99
  children: [
90
- f && /* @__PURE__ */ e(
100
+ y && /* @__PURE__ */ t(
91
101
  "div",
92
102
  {
93
103
  className: "absolute top-0 right-0 flex h-5 w-5 translate-x-1/2 -translate-y-1/2 items-center justify-center",
94
- "data-testid": n.close,
95
- children: /* @__PURE__ */ e(
104
+ "data-testid": m.close,
105
+ children: /* @__PURE__ */ t(
96
106
  "button",
97
107
  {
98
108
  type: "button",
99
- onClick: f,
109
+ onClick: y,
100
110
  className: "flex h-5 w-5 items-center justify-center rounded-full bg-muted hover:bg-muted/80 text-muted-foreground",
101
- children: /* @__PURE__ */ e(J, { icon: H, className: "size-3" })
111
+ children: /* @__PURE__ */ t(Y, { icon: W, className: "size-3" })
102
112
  }
103
113
  )
104
114
  }
105
115
  ),
106
- /* @__PURE__ */ c("div", { className: "mb-2 flex justify-between text-sm leading-[120%]", children: [
107
- /* @__PURE__ */ e(
116
+ /* @__PURE__ */ i("div", { className: "mb-2 flex justify-between text-sm leading-[120%]", children: [
117
+ /* @__PURE__ */ t(
108
118
  "span",
109
119
  {
110
- className: u(
111
- Z({ size: o }),
120
+ className: x(
121
+ ne({ size: l }),
112
122
  "grow shrink-0 basis-0"
113
123
  ),
114
- "data-testid": n.label,
115
- children: w
124
+ "data-testid": m.label,
125
+ children: I
116
126
  }
117
127
  ),
118
- a !== void 0 && t && /* @__PURE__ */ e(
119
- W,
128
+ s !== void 0 && a && /* @__PURE__ */ t(
129
+ re,
120
130
  {
121
- title: z,
122
- token: t,
123
- maxAmount: a,
124
- size: o,
125
- disabled: r,
126
- maxButton: C,
127
- onMaxButtonClick: L
131
+ title: M,
132
+ token: a,
133
+ maxAmount: s,
134
+ size: l,
135
+ disabled: n,
136
+ maxButton: L,
137
+ onMaxButtonClick: O
128
138
  }
129
139
  )
130
140
  ] }),
131
- /* @__PURE__ */ c(
141
+ /* @__PURE__ */ i(
132
142
  "div",
133
143
  {
134
- className: u(
144
+ className: x(
135
145
  "flex w-full max-w-full shrink-0 basis-full items-center"
136
146
  ),
137
147
  children: [
138
- /* @__PURE__ */ e("div", { className: "mr-3 grow shrink-0 basis-0", children: /* @__PURE__ */ e(
148
+ /* @__PURE__ */ t("div", { className: "mr-3 grow shrink-0 basis-0", children: /* @__PURE__ */ t(
139
149
  "input",
140
150
  {
141
151
  type: "text",
@@ -145,35 +155,52 @@ const Y = m(
145
155
  spellCheck: "false",
146
156
  pattern: "^[0-9]*[.,]?[0-9]*$",
147
157
  placeholder: "0",
148
- value: y,
149
- onChange: F,
150
- onFocus: D,
151
- onBlur: R,
152
- disabled: r || !s,
153
- className: u(
154
- _({ size: o }),
155
- r && "cursor-not-allowed"
158
+ value: k,
159
+ onChange: D,
160
+ onFocus: $,
161
+ onBlur: q,
162
+ disabled: n || !o,
163
+ className: x(
164
+ se({ size: l }),
165
+ n && "cursor-not-allowed"
156
166
  ),
157
- "data-testid": n.input,
167
+ "data-testid": m.input,
158
168
  minLength: 1,
159
169
  maxLength: 79,
160
170
  title: "Amount"
161
171
  }
162
172
  ) }),
163
- E ? /* @__PURE__ */ e(
164
- G,
165
- {
166
- active: V,
167
- size: o,
168
- disabled: r,
169
- token: t,
170
- showSelectDialog: p,
171
- chainId: N,
172
- network: I,
173
- maxLength: q,
174
- children: t?.symbol ?? "Select token"
175
- }
176
- ) : null
173
+ Q ? /* @__PURE__ */ i("div", { ref: g, className: "relative shrink-0", children: [
174
+ /* @__PURE__ */ t(
175
+ U,
176
+ {
177
+ active: d ? u : T,
178
+ size: l,
179
+ disabled: n,
180
+ token: a,
181
+ showSelectDialog: P,
182
+ chainId: V,
183
+ network: B,
184
+ maxLength: K,
185
+ children: a?.symbol ?? "Select token"
186
+ }
187
+ ),
188
+ d && u && /* @__PURE__ */ t("div", { className: "absolute right-0 top-full z-20 mt-1 min-w-[140px] overflow-hidden rounded-lg border border-gray-30 bg-gray-20 shadow-lg", children: p?.map((e, r) => /* @__PURE__ */ i(
189
+ "button",
190
+ {
191
+ type: "button",
192
+ onClick: () => {
193
+ e.onSelect(), h(!1);
194
+ },
195
+ className: "flex w-full items-center gap-2 px-3 py-2 text-sm text-foreground hover:bg-gray-30 text-left",
196
+ children: [
197
+ e.icon ? /* @__PURE__ */ t("span", { className: "inline-flex shrink-0 items-center", children: e.icon }) : null,
198
+ /* @__PURE__ */ t("span", { className: "truncate", children: e.label })
199
+ ]
200
+ },
201
+ r
202
+ )) })
203
+ ] }) : null
177
204
  ]
178
205
  }
179
206
  )
@@ -182,7 +209,7 @@ const Y = m(
182
209
  );
183
210
  }
184
211
  );
185
- A.displayName = "SmartNumberInput";
212
+ oe.displayName = "SmartNumberInput";
186
213
  export {
187
- A as SmartNumberInput
214
+ oe as SmartNumberInput
188
215
  };
@@ -1,5 +1,5 @@
1
1
  import { jsxs as S, jsx as l } from "react/jsx-runtime";
2
- import { useMemo as y, useCallback as ne, useRef as M } from "react";
2
+ import { useMemo as y, useCallback as ne, useRef as E } from "react";
3
3
  import { toast as ie } from "sonner";
4
4
  import { useIsMobile as le } from "../../hooks/use-media-query.js";
5
5
  import "@gearbox-protocol/sdk";
@@ -8,7 +8,7 @@ import "@gearbox-protocol/sdk/common-utils";
8
8
  import "luxon";
9
9
  import "../../utils/z-index.js";
10
10
  import { RangeButtons as ce } from "../buttons/range-buttons/range-buttons.js";
11
- import { DEFAULT_SERIES_COLORS as E, getSeriesColorPalette as ue } from "../graph/graph.js";
11
+ import { DEFAULT_SERIES_COLORS as k, getSeriesColorPalette as ue } from "../graph/graph.js";
12
12
  import { GraphViewWithData as me } from "../graph/graph-view.js";
13
13
  import { GraphDropdown as fe } from "./graph-dropdown.js";
14
14
  const de = ({ size: e = 16 }) => /* @__PURE__ */ S(
@@ -45,17 +45,17 @@ const de = ({ size: e = 16 }) => /* @__PURE__ */ S(
45
45
  /* @__PURE__ */ l("path", { d: "M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3" })
46
46
  ]
47
47
  }
48
- ), F = "ui-kit:tradingview-series-colors:";
49
- function k(e) {
48
+ ), V = "ui-kit:tradingview-series-colors:";
49
+ function j(e) {
50
50
  if (typeof window > "u" || !window.localStorage)
51
51
  return /* @__PURE__ */ new Map();
52
52
  try {
53
- const t = window.localStorage.getItem(F + e);
53
+ const t = window.localStorage.getItem(V + e);
54
54
  if (!t) return /* @__PURE__ */ new Map();
55
55
  const c = JSON.parse(t);
56
56
  return c == null || typeof c != "object" ? /* @__PURE__ */ new Map() : new Map(
57
57
  Object.entries(c).filter(
58
- ([, o]) => typeof o == "number" && o >= 0 && o < E.length
58
+ ([, o]) => typeof o == "number" && o >= 0 && o < k.length
59
59
  )
60
60
  );
61
61
  } catch {
@@ -66,17 +66,17 @@ function we(e, t) {
66
66
  if (!(typeof window > "u" || !window.localStorage))
67
67
  try {
68
68
  window.localStorage.setItem(
69
- F + e,
69
+ V + e,
70
70
  JSON.stringify(Object.fromEntries(t))
71
71
  );
72
72
  } catch {
73
73
  }
74
74
  }
75
- function z(e, t) {
75
+ function F(e, t) {
76
76
  if (t.size === 0) return;
77
- const c = k(e);
78
- for (const [o, p] of t)
79
- c.set(o, p);
77
+ const c = j(e);
78
+ for (const [o, v] of t)
79
+ c.set(o, v);
80
80
  we(e, c);
81
81
  }
82
82
  function Re({
@@ -84,18 +84,18 @@ function Re({
84
84
  yMeasureUnit: t,
85
85
  height: c = 306,
86
86
  defaultGraph: o,
87
- onGraphSelected: p,
87
+ onGraphSelected: v,
88
88
  graphs: d,
89
- isMultipleSelect: V,
90
- range: B,
91
- rangeList: j,
92
- setRange: T,
89
+ isMultipleSelect: B,
90
+ range: T,
91
+ rangeList: N,
92
+ setRange: D,
93
93
  onGraphExpanded: A,
94
- isGraphExpanded: D,
95
- onUnselectSeries: W,
96
- graphsWithNoData: H,
97
- loadingGraphs: J,
98
- noDataMessage: N = "No data available for this graph",
94
+ isGraphExpanded: W,
95
+ onUnselectSeries: H,
96
+ graphsWithNoData: J,
97
+ loadingGraphs: I,
98
+ noDataMessage: R = "No data available for this graph",
99
99
  currentValueDecimals: $,
100
100
  containerClassName: X,
101
101
  useSharedPriceScale: q,
@@ -105,51 +105,51 @@ function Re({
105
105
  seriesColorPersistenceKey: u,
106
106
  ...U
107
107
  }) {
108
- const v = y(() => Array.isArray(e) ? e : e ? [e] : [], [e]), R = y(() => Array.isArray(e) && e.length > 1, [e]), L = le(), K = ne(
108
+ const b = y(() => Array.isArray(e) ? e : e ? [e] : [], [e]), L = y(() => Array.isArray(e) && e.length > 1, [e]), O = le(), K = ne(
109
109
  (w, g) => {
110
- ie.error(N);
110
+ ie.error(R);
111
111
  },
112
- [N]
112
+ [R]
113
113
  ), P = y(() => {
114
114
  if (t)
115
115
  return Array.isArray(t) ? t[0] : t;
116
- }, [t]), G = (!L && A || j.length > 0 || p && d && o) && /* @__PURE__ */ S("div", { className: "z-10 w-full flex flex-row flex-wrap sm:flex-nowrap items-center gap-2", children: [
117
- /* @__PURE__ */ l("div", { children: p && d && o && /* @__PURE__ */ l(
116
+ }, [t]), G = (!O && A || N.length > 0 || v && d && o) && /* @__PURE__ */ S("div", { className: "z-10 w-full flex flex-row flex-wrap sm:flex-nowrap items-center gap-2", children: [
117
+ /* @__PURE__ */ l("div", { children: v && d && o && /* @__PURE__ */ l(
118
118
  fe,
119
119
  {
120
- onSelected: p,
120
+ onSelected: v,
121
121
  items: d,
122
122
  defaultItem: o,
123
- multiple: V,
124
- graphsWithNoData: H,
125
- loadingGraphs: J,
123
+ multiple: B,
124
+ graphsWithNoData: J,
125
+ loadingGraphs: I,
126
126
  onNoDataSelected: K
127
127
  }
128
128
  ) }),
129
129
  /* @__PURE__ */ S("div", { className: "flex flex-row flex-nowrap justify-start sm:justify-end items-center flex-1", children: [
130
- /* @__PURE__ */ l(ce, { range: B, rangeList: j, setRange: T }),
131
- !L && A && /* @__PURE__ */ l(
130
+ /* @__PURE__ */ l(ce, { range: T, rangeList: N, setRange: D }),
131
+ !O && A && /* @__PURE__ */ l(
132
132
  "button",
133
133
  {
134
134
  type: "button",
135
135
  className: "px-2.5 py-1.5 flex min-w-[44px] min-h-[26px] justify-center items-center text-xs leading-[14px] font-medium text-center rounded-md border cursor-pointer transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring bg-muted border-muted text-muted-foreground hover:border-secondary ml-1.5",
136
136
  onClick: A,
137
- children: D ? /* @__PURE__ */ l(ae, { size: 16 }) : /* @__PURE__ */ l(de, { size: 16 })
137
+ children: W ? /* @__PURE__ */ l(ae, { size: 16 }) : /* @__PURE__ */ l(de, { size: 16 })
138
138
  }
139
139
  )
140
140
  ] })
141
- ] }), i = M(/* @__PURE__ */ new Map()), a = M(0), O = M(!1);
142
- if (d && d.length > 0 && !O.current) {
143
- O.current = !0;
144
- const w = u ? k(u) : /* @__PURE__ */ new Map(), g = String(d[0].value);
141
+ ] }), i = E(/* @__PURE__ */ new Map()), a = E(0), _ = E(!1);
142
+ if (d && d.length > 0 && !_.current) {
143
+ _.current = !0;
144
+ const w = u ? j(u) : /* @__PURE__ */ new Map(), g = String(d[0].value);
145
145
  i.current.set(g, 0), a.current = 1;
146
146
  for (let r = 1; r < d.length; r++) {
147
147
  const m = String(d[r].value);
148
148
  if (i.current.has(m)) continue;
149
- const b = w.get(m) ?? r;
150
- i.current.set(m, b), a.current = Math.max(a.current, b + 1);
149
+ const p = w.get(m) ?? r;
150
+ i.current.set(m, p), a.current = Math.max(a.current, p + 1);
151
151
  }
152
- u && z(
152
+ u && F(
153
153
  u,
154
154
  i.current
155
155
  );
@@ -157,42 +157,42 @@ function Re({
157
157
  const ee = y(() => {
158
158
  const w = Array.isArray(t) ? t : void 0;
159
159
  if (u) {
160
- const r = k(u);
160
+ const r = j(u);
161
161
  for (const [m, x] of r)
162
162
  i.current.has(m) || (i.current.set(m, x), a.current = Math.max(
163
163
  a.current,
164
164
  x + 1
165
165
  ));
166
166
  }
167
- const g = v.map((r, m) => {
168
- const x = r?.title || `Series ${m + 1}`, b = o != null ? Array.isArray(o) ? o[0]?.value ?? o[0] : typeof o == "object" && "value" in o ? o.value : o : null, I = v.length === 1 ? b != null ? String(b) : "single" : r?.id || x;
169
- if (!i.current.has(I)) {
167
+ const g = b.map((r, m) => {
168
+ const x = r?.title || `Series ${m + 1}`, p = o != null ? Array.isArray(o) ? o[0]?.value ?? o[0] : typeof o == "object" && "value" in o ? o.value : o : null, C = b.length === 1 ? p != null ? String(p) : "single" : r?.id || x;
169
+ if (!i.current.has(C)) {
170
170
  const n = new Set(
171
171
  Array.from(i.current.values())
172
172
  );
173
173
  let s = a.current;
174
- for (let f = 0; f < E.length; f++) {
175
- const h = (a.current + f) % E.length;
174
+ for (let f = 0; f < k.length; f++) {
175
+ const h = (a.current + f) % k.length;
176
176
  if (!n.has(h)) {
177
177
  s = h;
178
178
  break;
179
179
  }
180
180
  }
181
- i.current.set(I, s), a.current = s + 1;
181
+ i.current.set(C, s), a.current = s + 1;
182
182
  }
183
- const oe = i.current.get(I) ?? 0, C = ue(oe), re = [...r?.data || []].sort((n, s) => {
183
+ const oe = i.current.get(C) ?? 0, M = ue(oe), re = [...r?.data || []].sort((n, s) => {
184
184
  const f = typeof n.time == "number" ? n.time : Number(n.time), h = typeof s.time == "number" ? s.time : Number(s.time);
185
185
  return f - h;
186
186
  }).reduce((n, s) => {
187
187
  const f = s.time;
188
188
  return n.length === 0 || n[n.length - 1].time !== f ? n.push({ time: f, value: s.value }) : n[n.length - 1] = { time: f, value: s.value }, n;
189
- }, []), _ = r?.lineColor ?? r?.color ?? void 0;
189
+ }, []), z = r?.lineColor ?? r?.color ?? void 0;
190
190
  return {
191
191
  data: re,
192
192
  label: x,
193
193
  yMeasureUnit: w?.[m] ?? (Array.isArray(t) ? void 0 : t),
194
- ..._ != null ? {
195
- lineColor: _,
194
+ ...z != null ? {
195
+ lineColor: z,
196
196
  ...r?.topColor != null && {
197
197
  topColor: r.topColor
198
198
  },
@@ -200,17 +200,17 @@ function Re({
200
200
  bottomColor: r.bottomColor
201
201
  }
202
202
  } : {
203
- color: C.line,
204
- topColor: C.top,
205
- bottomColor: C.bottom
203
+ color: M.line,
204
+ topColor: M.top,
205
+ bottomColor: M.bottom
206
206
  }
207
207
  };
208
208
  });
209
- return u && i.current.size > 0 && z(
209
+ return u && i.current.size > 0 && F(
210
210
  u,
211
211
  i.current
212
212
  ), g;
213
- }, [v, o, t, u]), te = R && v.length > 0 ? v.some((w) => !w) : !e;
213
+ }, [b, o, t, u]), te = I !== void 0 ? I.size > 0 : L && b.length > 0 ? b.some((w) => !w) : !e;
214
214
  return /* @__PURE__ */ l(
215
215
  "div",
216
216
  {
@@ -227,8 +227,8 @@ function Re({
227
227
  toolbar: G,
228
228
  size: c ? "full" : "default",
229
229
  containerClassName: se("h-full", X),
230
- showLegend: R,
231
- onUnselectSeries: W,
230
+ showLegend: L,
231
+ onUnselectSeries: H,
232
232
  yMeasureUnit: P,
233
233
  currentValueDecimals: $,
234
234
  useSharedPriceScale: q,