@gearbox-protocol/permissionless-ui 1.26.6 → 1.26.7

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 T=require("lightweight-charts"),D=require("luxon"),u=require("../../utils/format-number.cjs"),{MIN_DISPLAY_THRESHOLD:g,MAX_EXPONENTIAL_THRESHOLD:b}=u.FORMAT_CONSTANTS,O=(t,e,a="full")=>{if(u.isBelowDisplayThreshold(t))return e?`<${g}${e}`:`<${g}`;if(t===0)return e?`0${e}`:"0";const n=u.formatNumberWithSuffix(t,{maxExponentialThreshold:b,minimumFractionDigits:0,maximumFractionDigits:a==="short"?1:0,format:a,adaptiveDecimals:a==="short"});return e?`${n}${e}`:n},X=2,y=(t,e)=>{if(u.isBelowDisplayThreshold(t))return e?`<${g}${e}`:`<${g}`;if(t===0)return e?`0${e}`:"0";const a=u.toSignificantDigits(t,X);return e?`${a}${e}`:a},w=4,V=t=>{if(u.isBelowDisplayThreshold(t))return`<${g}`;if(t===0)return"0";const e=Math.round(t),a=Math.abs(t-e);return a>0&&a<.01?t.toFixed(12).replace(/0+$/,"").replace(/\.$/,""):u.toSignificantDigits(t,w)},G=(t,e)=>{if(u.isBelowDisplayThreshold(t))return e?`<${g} ${e}`:`<${g}`;if(t===0)return e?`0 ${e}`:"0";const a=Number.isInteger(t),n=Math.abs(t),m=a&&n>=1e3,s=Math.round(t),o=Math.abs(t-s);if(o>0&&o<.01&&!m){const $=t.toFixed(12).replace(/0+$/,"").replace(/\.$/,"");return e?`${$} ${e}`:$}const F=u.formatNumberWithSuffix(t,{maxExponentialThreshold:b,minimumFractionDigits:a?0:2,maximumFractionDigits:m?1:a?0:2,format:m?"short":"full",adaptiveDecimals:m});return e?`${F} ${e}`:F},N={"%":y,$:O,token:G,none:V},P=t=>N[t]||N.token;function U(t,e,a=4){if(t===0)return e?`0 ${e}`:"0";const n=t.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:a});return e?`${n} ${e}`:n}function C(t,e,a){const n=a?.yScaleMin;let m=t.length>0?Math.min(...t):0,s=t.length>0?Math.max(...t):0,o=[];const d=()=>{const r=s-m,i=(m+s)/2;let f=1,c="";i>=1e9?(f=1e9,c="B"):i>=1e6?(f=1e6,c="M"):i>=1e3&&(f=1e3,c="K");const x=r/10/f;let h=1;if(x>0){const k=Math.floor(Math.log10(x));h=Math.max(1,-k),h=Math.min(h,4)}return{scale:f,suffix:c,decimals:h}},F=(r,i,f)=>{const c=i>1?r/i:r,l=Math.abs(c)>=1?1:4;return i>1?`${(r/i).toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:l,useGrouping:!1})}${f}`:r.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:l,useGrouping:!1})},$=.02,L=r=>{if(n!==void 0&&r<n)return"";if(r===0)return"0";const{scale:i,suffix:f,decimals:c}=d(),l=s-m,S=l>0?o.filter(M=>Math.abs(M)>=l*$):o,h=(l>0?l/10:0)*.05,k=Math.abs(r)*1e-10||1e-10;if(S.some(M=>Math.abs(M-r)<k))return F(r,i,f);if(S.length>0&&h>0){const M=S.reduce((p,E)=>Math.abs(E-r)<Math.abs(p-r)?E:p);if(Math.abs(r-M)<h)return F(M,i,f)}const R=i>1?r/i:r,A=Math.abs(R)>=1?Math.min(1,c):c;return i>1?`${(r/i).toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:A,useGrouping:!1})}${f}`:r.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:A,useGrouping:!1})};return{formatter:r=>L(r),tickmarksFormatter:r=>{const i=new Set;return r.map(f=>{const c=L(f);return!c||i.has(c)?"":(i.add(c),c)})},updateVisibleRange:r=>{r.length>0&&(m=Math.min(...r),s=Math.max(...r))},updateLastValues:r=>{o=[...r]}}}const H=t=>D.DateTime.fromSeconds(Number(t)).toFormat("dd/LL/yyyy HH:mm"),Y=t=>D.DateTime.fromSeconds(Number(t)).toFormat("HH:mm"),B=(t,e)=>y(Number(t),e),_={time:H,"%":B};function W(t){const e=new Map;return(a,n,m)=>{const s=D.DateTime.fromSeconds(Number(a));let o;if(t===0)o=s.toFormat("HH:mm");else switch(n){case T.TickMarkType.Year:o=s.toFormat("yyyy");break;case T.TickMarkType.Month:o=s.toFormat("MMM yy");break;case T.TickMarkType.DayOfMonth:o=t>365?s.toFormat("dd MMM yy"):s.toFormat("dd MMM");break;case T.TickMarkType.Time:case T.TickMarkType.TimeWithSeconds:o=s.toFormat("HH:mm");break;default:o=s.toFormat("dd MMM")}let d=e.get(n);return d||(d=new Set,e.set(n,d)),d.has(o)?" ":(d.add(o),o)}}const I=(t,e)=>{if(t==="time"&&e&&e.length>0){const n=D.DateTime.fromSeconds(Number(e[0].time)),m=D.DateTime.fromSeconds(Number(e[e.length-1].time)),s=n.hasSame(m,"day"),o=s?0:Math.ceil(m.diff(n,"days").days);return{timeFormatter:s?Y:H,tickMarkFormatter:W(o)}}const a=_[t]||_.time;return{timeFormatter:a,tickMarkFormatter:n=>a(n,void 0)}},q=(t,e)=>I(t,e).timeFormatter;exports.createAdaptiveYAxisFormatter=C;exports.formatExactValue=U;exports.getXFormatter=q;exports.getXFormatters=I;exports.getYFormatter=P;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("lightweight-charts"),D=require("luxon"),u=require("../../utils/format-number.cjs"),{MIN_DISPLAY_THRESHOLD:g,MAX_EXPONENTIAL_THRESHOLD:b}=u.FORMAT_CONSTANTS,O=(t,e,a="full")=>{if(u.isBelowDisplayThreshold(t))return e?`<${g}${e}`:`<${g}`;if(t===0)return e?`0${e}`:"0";const n=u.formatNumberWithSuffix(t,{maxExponentialThreshold:b,minimumFractionDigits:0,maximumFractionDigits:a==="short"?1:0,format:a,adaptiveDecimals:a==="short"});return e?`${n}${e}`:n},X=2,H=(t,e)=>{if(u.isBelowDisplayThreshold(t))return e?`<${g}${e}`:`<${g}`;if(t===0)return e?`0${e}`:"0";const a=u.toSignificantDigits(t,X);return e?`${a}${e}`:a},w=4,V=t=>{if(u.isBelowDisplayThreshold(t))return`<${g}`;if(t===0)return"0";const e=Math.round(t),a=Math.abs(t-e);return a>0&&a<.01?t.toFixed(12).replace(/0+$/,"").replace(/\.$/,""):u.toSignificantDigits(t,w)},G=(t,e)=>{if(u.isBelowDisplayThreshold(t))return e?`<${g} ${e}`:`<${g}`;if(t===0)return e?`0 ${e}`:"0";const a=Number.isInteger(t),n=Math.abs(t),c=a&&n>=1e3,s=Math.round(t),o=Math.abs(t-s);if(o>0&&o<.01&&!c){const $=t.toFixed(12).replace(/0+$/,"").replace(/\.$/,"");return e?`${$} ${e}`:$}const F=u.formatNumberWithSuffix(t,{maxExponentialThreshold:b,minimumFractionDigits:a?0:2,maximumFractionDigits:c?1:a?0:2,format:c?"short":"full",adaptiveDecimals:c});return e?`${F} ${e}`:F},N={"%":H,$:O,token:G,none:V},P=t=>N[t]||N.token;function U(t,e,a=4){if(t===0)return e?`0 ${e}`:"0";const n=e&&Math.abs(t)>=1e3?0:a,c=t.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:n});return e?`${c} ${e}`:c}function C(t,e,a){const n=a?.yScaleMin;let c=t.length>0?Math.min(...t):0,s=t.length>0?Math.max(...t):0,o=[];const d=()=>{const r=s-c,i=(c+s)/2;let f=1,m="";i>=1e9?(f=1e9,m="B"):i>=1e6?(f=1e6,m="M"):i>=1e3&&(f=1e3,m="K");const x=r/10/f;let l=1;if(x>0){const k=Math.floor(Math.log10(x));l=Math.max(1,-k),l=Math.min(l,4)}return{scale:f,suffix:m,decimals:l}},F=(r,i,f)=>{const m=i>1?r/i:r,h=Math.abs(m)>=1?1:4;return i>1?`${(r/i).toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:h,useGrouping:!1})}${f}`:r.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:h,useGrouping:!1})},$=.02,L=r=>{if(n!==void 0&&r<n)return"";if(r===0)return"0";const{scale:i,suffix:f,decimals:m}=d(),h=s-c,S=h>0?o.filter(M=>Math.abs(M)>=h*$):o,l=(h>0?h/10:0)*.05,k=Math.abs(r)*1e-10||1e-10;if(S.some(M=>Math.abs(M-r)<k))return F(r,i,f);if(S.length>0&&l>0){const M=S.reduce((p,E)=>Math.abs(E-r)<Math.abs(p-r)?E:p);if(Math.abs(r-M)<l)return F(M,i,f)}const R=i>1?r/i:r,A=Math.abs(R)>=1?Math.min(1,m):m;return i>1?`${(r/i).toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:A,useGrouping:!1})}${f}`:r.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:A,useGrouping:!1})};return{formatter:r=>L(r),tickmarksFormatter:r=>{const i=new Set;return r.map(f=>{const m=L(f);return!m||i.has(m)?"":(i.add(m),m)})},updateVisibleRange:r=>{r.length>0&&(c=Math.min(...r),s=Math.max(...r))},updateLastValues:r=>{o=[...r]}}}const I=t=>D.DateTime.fromSeconds(Number(t)).toFormat("dd/LL/yyyy HH:mm"),Y=t=>D.DateTime.fromSeconds(Number(t)).toFormat("HH:mm"),B=(t,e)=>H(Number(t),e),_={time:I,"%":B};function W(t){const e=new Map;return(a,n,c)=>{const s=D.DateTime.fromSeconds(Number(a));let o;if(t===0)o=s.toFormat("HH:mm");else switch(n){case T.TickMarkType.Year:o=s.toFormat("yyyy");break;case T.TickMarkType.Month:o=s.toFormat("MMM yy");break;case T.TickMarkType.DayOfMonth:o=t>365?s.toFormat("dd MMM yy"):s.toFormat("dd MMM");break;case T.TickMarkType.Time:case T.TickMarkType.TimeWithSeconds:o=s.toFormat("HH:mm");break;default:o=s.toFormat("dd MMM")}let d=e.get(n);return d||(d=new Set,e.set(n,d)),d.has(o)?" ":(d.add(o),o)}}const y=(t,e)=>{if(t==="time"&&e&&e.length>0){const n=D.DateTime.fromSeconds(Number(e[0].time)),c=D.DateTime.fromSeconds(Number(e[e.length-1].time)),s=n.hasSame(c,"day"),o=s?0:Math.ceil(c.diff(n,"days").days);return{timeFormatter:s?Y:I,tickMarkFormatter:W(o)}}const a=_[t]||_.time;return{timeFormatter:a,tickMarkFormatter:n=>a(n,void 0)}},q=(t,e)=>y(t,e).timeFormatter;exports.createAdaptiveYAxisFormatter=C;exports.formatExactValue=U;exports.getXFormatter=q;exports.getXFormatters=y;exports.getYFormatter=P;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),m=require("@gearbox-protocol/sdk"),p=require("react"),b=require("../../token-symbol/token-symbol.cjs"),s=require("../../typed-intl/index.cjs"),j=require("../../../hooks/use-media-query.cjs"),o=require("../../../utils/cn.cjs");function y({tokensList:r,graphParams:l,data:a,prices:n,editedPrices:c}){const{fixedBalances:i}=l,u=p.useMemo(()=>m.AssetUtils.constructAssetRecord(i),[i]),x=j.useIsMobile();return!a||!a.length?e.jsx("div",{className:"w-full flex items-center justify-center py-8 text-sm text-muted-foreground",children:e.jsx(s.FormattedMessageTyped,{messageId:"components.creditSessionDetailedLiquidation.table.noData",defaultMessage:"No data"})}):e.jsxs("div",{className:"w-full",children:[e.jsxs("div",{className:o.cn("grid w-full px-3 sm:px-4 gap-1 sm:gap-2 items-center","h-7 sm:h-8 md:h-[30px]","relative after:absolute after:bottom-0 after:left-2 sm:after:left-3 after:right-2 sm:after:right-3 after:h-px after:border-b after:border-border"),style:{gridTemplateColumns:"1fr 1fr 1fr"},children:[e.jsx("div",{className:"text-left text-xs sm:text-sm font-medium text-muted-foreground truncate",children:e.jsx(s.FormattedMessageTyped,{messageId:"components.creditSessionDetailedLiquidation.table.asset"})}),e.jsx("div",{className:"text-right text-xs sm:text-sm font-medium text-muted-foreground truncate",children:e.jsx(s.FormattedMessageTyped,{messageId:"components.creditSessionDetailedLiquidation.table.currentPrice"})}),e.jsx("div",{className:"text-right text-xs sm:text-sm font-medium text-muted-foreground truncate",children:e.jsx(s.FormattedMessageTyped,{messageId:"components.creditSessionDetailedLiquidation.table.modelPrice"})})]}),a.map((t,f,g)=>{const h=g.length-1===f;return e.jsxs("div",{className:o.cn("grid w-full px-3 sm:px-4 gap-1 sm:gap-2 items-center relative","h-12 sm:h-14 md:h-[51px]",!h&&"after:absolute after:bottom-0 after:left-2 sm:after:left-3 after:right-2 sm:after:right-3 after:h-px after:border-b after:border-border"),style:{gridTemplateColumns:"1fr 1fr 1fr"},children:[e.jsx("div",{className:"text-left min-w-0",children:e.jsx(b.TokenSymbol,{size:x?18:24,token:r[t.token],showSymbol:!0,maxLength:6,className:"gap-1.5 sm:gap-2"})}),e.jsxs("div",{className:"text-right text-xs sm:text-sm md:text-base truncate",children:["$",d(n[t.token])]}),e.jsx("div",{className:"text-right min-w-0",children:u[t.token]?e.jsx("span",{className:"text-xs sm:text-sm text-muted-foreground truncate",children:e.jsx(s.FormattedMessageTyped,{messageId:"components.creditSessionDetailedLiquidation.table.seeGraph"})}):e.jsxs("span",{className:"text-xs sm:text-sm md:text-base text-muted-foreground truncate",children:["$",d(c[t.token]||n[t.token])]})})]},t.token)})]})}function d(r){return(Number(r||0n)/Number(m.PRICE_DECIMALS)).toFixed(2)}exports.LiquidationModellingAssetsTable=y;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),m=require("@gearbox-protocol/sdk"),p=require("react"),b=require("../../token-symbol/token-symbol.cjs"),s=require("../../typed-intl/index.cjs"),j=require("../../../hooks/use-media-query.cjs"),o=require("../../../utils/cn.cjs");function y({tokensList:r,graphParams:l,data:a,prices:n,editedPrices:c}){const{fixedBalances:i}=l,u=p.useMemo(()=>m.AssetUtils.constructAssetRecord(i),[i]),x=j.useIsMobile();return!a||!a.length?e.jsx("div",{className:"w-full flex items-center justify-center py-8 text-sm text-muted-foreground",children:e.jsx(s.FormattedMessageTyped,{messageId:"components.creditSessionDetailedLiquidation.table.noData",defaultMessage:"No data"})}):e.jsxs("div",{className:"w-full",children:[e.jsxs("div",{className:o.cn("grid w-full px-3 sm:px-4 gap-1 sm:gap-2 items-center","h-7 sm:h-8 md:h-[30px]","relative after:absolute after:bottom-0 after:left-2 sm:after:left-3 after:right-2 sm:after:right-3 after:h-px after:border-b after:border-border"),style:{gridTemplateColumns:"1fr 1fr 1fr"},children:[e.jsx("div",{className:"text-left text-xs sm:text-sm font-medium text-muted-foreground truncate",children:e.jsx(s.FormattedMessageTyped,{messageId:"components.creditSessionDetailedLiquidation.table.asset"})}),e.jsx("div",{className:"text-right text-xs sm:text-sm font-medium text-muted-foreground truncate",children:e.jsx(s.FormattedMessageTyped,{messageId:"components.creditSessionDetailedLiquidation.table.currentPrice"})}),e.jsx("div",{className:"text-right text-xs sm:text-sm font-medium text-muted-foreground truncate",children:e.jsx(s.FormattedMessageTyped,{messageId:"components.creditSessionDetailedLiquidation.table.modelPrice"})})]}),a.map((t,f,g)=>{const h=g.length-1===f;return e.jsxs("div",{className:o.cn("grid w-full px-3 sm:px-4 gap-1 sm:gap-2 items-center relative","h-12 sm:h-14 md:h-[51px]",!h&&"after:absolute after:bottom-0 after:left-2 sm:after:left-3 after:right-2 sm:after:right-3 after:h-px after:border-b after:border-border"),style:{gridTemplateColumns:"1fr 1fr 1fr"},children:[e.jsx("div",{className:"text-left min-w-0",children:e.jsx(b.TokenSymbol,{size:x?18:24,token:r[t.token],showSymbol:!0,maxLength:12,className:"gap-1.5 sm:gap-2"})}),e.jsxs("div",{className:"text-right text-xs sm:text-sm md:text-base truncate",children:["$",d(n[t.token])]}),e.jsx("div",{className:"text-right min-w-0",children:u[t.token]?e.jsx("span",{className:"text-xs sm:text-sm text-muted-foreground truncate",children:e.jsx(s.FormattedMessageTyped,{messageId:"components.creditSessionDetailedLiquidation.table.seeGraph"})}):e.jsxs("span",{className:"text-xs sm:text-sm md:text-base text-muted-foreground truncate",children:["$",d(c[t.token]||n[t.token])]})})]},t.token)})]})}function d(r){return(Number(r||0n)/Number(m.PRICE_DECIMALS)).toFixed(2)}exports.LiquidationModellingAssetsTable=y;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),x=require("react"),te=require("sonner"),re=require("../../hooks/use-media-query.cjs");require("@gearbox-protocol/sdk");const oe=require("../../utils/cn.cjs");require("luxon");require("../../utils/z-index.cjs");const ne=require("../buttons/range-buttons/range-buttons.cjs"),j=require("../graph/graph.cjs"),ie=require("../graph/graph-view.cjs"),se=require("./graph-dropdown.cjs"),le=({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"})]}),k="permissionless-ui:tradingview-series-colors:";function A(e){if(typeof window>"u"||!window.localStorage)return new Map;try{const t=window.localStorage.getItem(k+e);if(!t)return new Map;const l=JSON.parse(t);return l==null||typeof l!="object"?new Map:new Map(Object.entries(l).filter(([,u])=>typeof u=="number"&&u>=0&&u<j.DEFAULT_SERIES_COLORS.length))}catch{return new Map}}function ce(e,t){if(!(typeof window>"u"||!window.localStorage))try{window.localStorage.setItem(k+e,JSON.stringify(Object.fromEntries(t)))}catch{}}function O(e,t){if(t.size===0)return;const l=A(e);for(const[u,g]of t)l.set(u,g);ce(e,l)}function ae({data:e,yMeasureUnit:t,height:l=306,defaultGraph:u,onGraphSelected:g,graphs:f,isMultipleSelect:q,range:N,rangeList:E,setRange:T,onGraphExpanded:y,isGraphExpanded:V,onUnselectSeries:B,graphsWithNoData:F,loadingGraphs:z,noDataMessage:M="No data available for this graph",currentValueDecimals:D,containerClassName:W,useSharedPriceScale:H,showCurrentValue:J,yScaleMin:$,yScaleMinMultiple:Q,seriesColorPersistenceKey:c,...X}){const b=x.useMemo(()=>Array.isArray(e)?e:e?[e]:[],[e]),I=x.useMemo(()=>Array.isArray(e)&&e.length>1,[e]),R=re.useIsMobile(),Y=x.useCallback((w,v)=>{te.toast.error(M)},[M]),Z=x.useMemo(()=>{if(t)return Array.isArray(t)?t[0]:t},[t]),U=(!R&&y||E.length>0||g&&f&&u)&&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:g&&f&&u&&o.jsx(se.GraphDropdown,{onSelected:g,items:f,defaultItem:u,multiple:q,graphsWithNoData:F,loadingGraphs:z,onNoDataSelected:Y})}),o.jsxs("div",{className:"flex flex-row flex-nowrap justify-start sm:justify-end items-center flex-1",children:[o.jsx(ne.RangeButtons,{range:N,rangeList:E,setRange:T}),!R&&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:V?o.jsx(ue,{size:16}):o.jsx(le,{size:16})})]})]}),i=x.useRef(new Map),m=x.useRef(0),C=x.useRef(!1);if(f&&f.length>0&&!C.current){C.current=!0;const w=c?A(c):new Map,v=String(f[0].value);i.current.set(v,0),m.current=1;for(let r=1;r<f.length;r++){const a=String(f[r].value);if(i.current.has(a))continue;const p=w.get(a)??r;i.current.set(a,p),m.current=Math.max(m.current,p+1)}c&&O(c,i.current)}const G=x.useMemo(()=>{const w=Array.isArray(t)?t:void 0;if(c){const r=A(c);for(const[a,h]of r)i.current.has(a)||(i.current.set(a,h),m.current=Math.max(m.current,h+1))}const v=b.map((r,a)=>{const h=r?.title||`Series ${a+1}`,p=r?.id||h;if(!i.current.has(p)){const n=new Set(Array.from(i.current.values()));let s=m.current;for(let d=0;d<j.DEFAULT_SERIES_COLORS.length;d++){const S=(m.current+d)%j.DEFAULT_SERIES_COLORS.length;if(!n.has(S)){s=S;break}}i.current.set(p,s),m.current=s+1}const K=i.current.get(p)??0,_=j.getSeriesColorPalette(K),ee=[...r?.data||[]].sort((n,s)=>{const d=typeof n.time=="number"?n.time:Number(n.time),S=typeof s.time=="number"?s.time:Number(s.time);return d-S}).reduce((n,s)=>{const d=s.time;return n.length===0||n[n.length-1].time!==d?n.push({time:d,value:s.value}):n[n.length-1]={time:d,value:s.value},n},[]),L=r?.lineColor??r?.color??void 0;return{data:ee,label:h,yMeasureUnit:w?.[a]??(Array.isArray(t)?void 0:t),...L!=null?{lineColor:L,...r?.topColor!=null&&{topColor:r.topColor},...r?.bottomColor!=null&&{bottomColor:r.bottomColor}}:{color:_.line,topColor:_.top,bottomColor:_.bottom}}});return c&&i.current.size>0&&O(c,i.current),v},[b,t,c]),P=I&&b.length>0?b.some(w=>!w):!e;return o.jsx("div",{style:{width:"100%",height:l?`${l}px`:void 0},className:"w-full",children:o.jsx(ie.GraphViewWithData,{series:G,loading:P,toolbar:U,size:l?"full":"default",containerClassName:oe.cn("h-full",W),showLegend:I,onUnselectSeries:B,yMeasureUnit:Z,currentValueDecimals:D,useSharedPriceScale:H,showCurrentValue:J,yScaleMin:$,yScaleMinMultiple:Q,...X})})}exports.TradingView=ae;
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("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="permissionless-ui: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 k(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),L=x.useRef(!1);if(m&&m.length>0&&!L.current){L.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&&k(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},[]),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:_.line,topColor:_.top,bottomColor:_.bottom}}});return u&&s.current.size>0&&k(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;
@@ -55,11 +55,11 @@ const { MIN_DISPLAY_THRESHOLD: g, MAX_EXPONENTIAL_THRESHOLD: R } = U, V = (t, e,
55
55
  function et(t, e, n = 4) {
56
56
  if (t === 0)
57
57
  return e ? `0 ${e}` : "0";
58
- const a = t.toLocaleString("en-US", {
58
+ const a = e && Math.abs(t) >= 1e3 ? 0 : n, c = t.toLocaleString("en-US", {
59
59
  minimumFractionDigits: 0,
60
- maximumFractionDigits: n
60
+ maximumFractionDigits: a
61
61
  });
62
- return e ? `${a} ${e}` : a;
62
+ return e ? `${c} ${e}` : c;
63
63
  }
64
64
  function rt(t, e, n) {
65
65
  const a = n?.yScaleMin;
@@ -56,7 +56,7 @@ function q({
56
56
  size: u ? 18 : 24,
57
57
  token: a[t.token],
58
58
  showSymbol: !0,
59
- maxLength: 6,
59
+ maxLength: 12,
60
60
  className: "gap-1.5 sm:gap-2"
61
61
  }
62
62
  ) }),
@@ -1,16 +1,16 @@
1
- import { jsxs as y, jsx as i } from "react/jsx-runtime";
2
- import { useMemo as S, useCallback as oe, useRef as C } from "react";
3
- import { toast as ne } from "sonner";
4
- import { useIsMobile as ie } from "../../hooks/use-media-query.js";
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";
3
+ import { toast as ie } from "sonner";
4
+ import { useIsMobile as le } from "../../hooks/use-media-query.js";
5
5
  import "@gearbox-protocol/sdk";
6
- import { cn as le } from "../../utils/cn.js";
6
+ import { cn as se } from "../../utils/cn.js";
7
7
  import "luxon";
8
8
  import "../../utils/z-index.js";
9
- import { RangeButtons as se } from "../buttons/range-buttons/range-buttons.js";
10
- import { DEFAULT_SERIES_COLORS as M, getSeriesColorPalette as ce } from "../graph/graph.js";
11
- import { GraphViewWithData as ue } from "../graph/graph-view.js";
12
- import { GraphDropdown as me } from "./graph-dropdown.js";
13
- const ae = ({ size: e = 16 }) => /* @__PURE__ */ y(
9
+ import { RangeButtons as ce } from "../buttons/range-buttons/range-buttons.js";
10
+ import { DEFAULT_SERIES_COLORS as E, getSeriesColorPalette as ue } from "../graph/graph.js";
11
+ import { GraphViewWithData as me } from "../graph/graph-view.js";
12
+ import { GraphDropdown as fe } from "./graph-dropdown.js";
13
+ const de = ({ size: e = 16 }) => /* @__PURE__ */ S(
14
14
  "svg",
15
15
  {
16
16
  width: e,
@@ -23,11 +23,11 @@ const ae = ({ size: e = 16 }) => /* @__PURE__ */ y(
23
23
  strokeLinejoin: "round",
24
24
  "aria-label": "Expand fullscreen",
25
25
  children: [
26
- /* @__PURE__ */ i("title", { children: "Expand fullscreen" }),
27
- /* @__PURE__ */ i("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" })
26
+ /* @__PURE__ */ l("title", { children: "Expand fullscreen" }),
27
+ /* @__PURE__ */ l("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" })
28
28
  ]
29
29
  }
30
- ), de = ({ size: e = 16 }) => /* @__PURE__ */ y(
30
+ ), ae = ({ size: e = 16 }) => /* @__PURE__ */ S(
31
31
  "svg",
32
32
  {
33
33
  width: e,
@@ -40,158 +40,158 @@ const ae = ({ size: e = 16 }) => /* @__PURE__ */ y(
40
40
  strokeLinejoin: "round",
41
41
  "aria-label": "Exit fullscreen",
42
42
  children: [
43
- /* @__PURE__ */ i("title", { children: "Exit fullscreen" }),
44
- /* @__PURE__ */ i("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" })
43
+ /* @__PURE__ */ l("title", { children: "Exit fullscreen" }),
44
+ /* @__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" })
45
45
  ]
46
46
  }
47
- ), z = "permissionless-ui:tradingview-series-colors:";
48
- function E(e) {
47
+ ), F = "permissionless-ui:tradingview-series-colors:";
48
+ function j(e) {
49
49
  if (typeof window > "u" || !window.localStorage)
50
50
  return /* @__PURE__ */ new Map();
51
51
  try {
52
- const t = window.localStorage.getItem(z + e);
52
+ const t = window.localStorage.getItem(F + e);
53
53
  if (!t) return /* @__PURE__ */ new Map();
54
- const s = JSON.parse(t);
55
- return s == null || typeof s != "object" ? /* @__PURE__ */ new Map() : new Map(
56
- Object.entries(s).filter(
57
- ([, c]) => typeof c == "number" && c >= 0 && c < M.length
54
+ const c = JSON.parse(t);
55
+ return c == null || typeof c != "object" ? /* @__PURE__ */ new Map() : new Map(
56
+ Object.entries(c).filter(
57
+ ([, o]) => typeof o == "number" && o >= 0 && o < E.length
58
58
  )
59
59
  );
60
60
  } catch {
61
61
  return /* @__PURE__ */ new Map();
62
62
  }
63
63
  }
64
- function fe(e, t) {
64
+ function we(e, t) {
65
65
  if (!(typeof window > "u" || !window.localStorage))
66
66
  try {
67
67
  window.localStorage.setItem(
68
- z + e,
68
+ F + e,
69
69
  JSON.stringify(Object.fromEntries(t))
70
70
  );
71
71
  } catch {
72
72
  }
73
73
  }
74
- function _(e, t) {
74
+ function z(e, t) {
75
75
  if (t.size === 0) return;
76
- const s = E(e);
77
- for (const [c, h] of t)
78
- s.set(c, h);
79
- fe(e, s);
76
+ const c = j(e);
77
+ for (const [o, p] of t)
78
+ c.set(o, p);
79
+ we(e, c);
80
80
  }
81
81
  function Ne({
82
82
  data: e,
83
83
  yMeasureUnit: t,
84
- height: s = 306,
85
- defaultGraph: c,
86
- onGraphSelected: h,
84
+ height: c = 306,
85
+ defaultGraph: o,
86
+ onGraphSelected: p,
87
87
  graphs: d,
88
88
  isMultipleSelect: V,
89
89
  range: B,
90
90
  rangeList: k,
91
- setRange: F,
91
+ setRange: T,
92
92
  onGraphExpanded: A,
93
- isGraphExpanded: T,
93
+ isGraphExpanded: D,
94
94
  onUnselectSeries: W,
95
- graphsWithNoData: D,
96
- loadingGraphs: H,
95
+ graphsWithNoData: H,
96
+ loadingGraphs: J,
97
97
  noDataMessage: N = "No data available for this graph",
98
- currentValueDecimals: J,
99
- containerClassName: $,
100
- useSharedPriceScale: X,
101
- showCurrentValue: q,
102
- yScaleMin: Q,
103
- yScaleMinMultiple: Y,
98
+ currentValueDecimals: $,
99
+ containerClassName: X,
100
+ useSharedPriceScale: q,
101
+ showCurrentValue: Q,
102
+ yScaleMin: Y,
103
+ yScaleMinMultiple: Z,
104
104
  seriesColorPersistenceKey: u,
105
- ...Z
105
+ ...U
106
106
  }) {
107
- const b = S(() => Array.isArray(e) ? e : e ? [e] : [], [e]), j = S(() => Array.isArray(e) && e.length > 1, [e]), R = ie(), G = oe(
108
- (p, v) => {
109
- ne.error(N);
107
+ const v = y(() => Array.isArray(e) ? e : e ? [e] : [], [e]), R = y(() => Array.isArray(e) && e.length > 1, [e]), L = le(), K = ne(
108
+ (w, g) => {
109
+ ie.error(N);
110
110
  },
111
111
  [N]
112
- ), U = S(() => {
112
+ ), P = y(() => {
113
113
  if (t)
114
114
  return Array.isArray(t) ? t[0] : t;
115
- }, [t]), P = (!R && A || k.length > 0 || h && d && c) && /* @__PURE__ */ y("div", { className: "z-10 w-full flex flex-row flex-wrap sm:flex-nowrap items-center gap-2", children: [
116
- /* @__PURE__ */ i("div", { children: h && d && c && /* @__PURE__ */ i(
117
- me,
115
+ }, [t]), G = (!L && A || k.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: [
116
+ /* @__PURE__ */ l("div", { children: p && d && o && /* @__PURE__ */ l(
117
+ fe,
118
118
  {
119
- onSelected: h,
119
+ onSelected: p,
120
120
  items: d,
121
- defaultItem: c,
121
+ defaultItem: o,
122
122
  multiple: V,
123
- graphsWithNoData: D,
124
- loadingGraphs: H,
125
- onNoDataSelected: G
123
+ graphsWithNoData: H,
124
+ loadingGraphs: J,
125
+ onNoDataSelected: K
126
126
  }
127
127
  ) }),
128
- /* @__PURE__ */ y("div", { className: "flex flex-row flex-nowrap justify-start sm:justify-end items-center flex-1", children: [
129
- /* @__PURE__ */ i(se, { range: B, rangeList: k, setRange: F }),
130
- !R && A && /* @__PURE__ */ i(
128
+ /* @__PURE__ */ S("div", { className: "flex flex-row flex-nowrap justify-start sm:justify-end items-center flex-1", children: [
129
+ /* @__PURE__ */ l(ce, { range: B, rangeList: k, setRange: T }),
130
+ !L && A && /* @__PURE__ */ l(
131
131
  "button",
132
132
  {
133
133
  type: "button",
134
134
  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",
135
135
  onClick: A,
136
- children: T ? /* @__PURE__ */ i(de, { size: 16 }) : /* @__PURE__ */ i(ae, { size: 16 })
136
+ children: D ? /* @__PURE__ */ l(ae, { size: 16 }) : /* @__PURE__ */ l(de, { size: 16 })
137
137
  }
138
138
  )
139
139
  ] })
140
- ] }), n = C(/* @__PURE__ */ new Map()), f = C(0), L = C(!1);
141
- if (d && d.length > 0 && !L.current) {
142
- L.current = !0;
143
- const p = u ? E(u) : /* @__PURE__ */ new Map(), v = String(d[0].value);
144
- n.current.set(v, 0), f.current = 1;
140
+ ] }), i = M(/* @__PURE__ */ new Map()), a = M(0), O = M(!1);
141
+ if (d && d.length > 0 && !O.current) {
142
+ O.current = !0;
143
+ const w = u ? j(u) : /* @__PURE__ */ new Map(), g = String(d[0].value);
144
+ i.current.set(g, 0), a.current = 1;
145
145
  for (let r = 1; r < d.length; r++) {
146
146
  const m = String(d[r].value);
147
- if (n.current.has(m)) continue;
148
- const x = p.get(m) ?? r;
149
- n.current.set(m, x), f.current = Math.max(f.current, x + 1);
147
+ if (i.current.has(m)) continue;
148
+ const b = w.get(m) ?? r;
149
+ i.current.set(m, b), a.current = Math.max(a.current, b + 1);
150
150
  }
151
- u && _(
151
+ u && z(
152
152
  u,
153
- n.current
153
+ i.current
154
154
  );
155
155
  }
156
- const K = S(() => {
157
- const p = Array.isArray(t) ? t : void 0;
156
+ const ee = y(() => {
157
+ const w = Array.isArray(t) ? t : void 0;
158
158
  if (u) {
159
- const r = E(u);
160
- for (const [m, w] of r)
161
- n.current.has(m) || (n.current.set(m, w), f.current = Math.max(
162
- f.current,
163
- w + 1
159
+ const r = j(u);
160
+ for (const [m, x] of r)
161
+ i.current.has(m) || (i.current.set(m, x), a.current = Math.max(
162
+ a.current,
163
+ x + 1
164
164
  ));
165
165
  }
166
- const v = b.map((r, m) => {
167
- const w = r?.title || `Series ${m + 1}`, x = r?.id || w;
168
- if (!n.current.has(x)) {
169
- const o = new Set(
170
- Array.from(n.current.values())
166
+ const g = v.map((r, m) => {
167
+ 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;
168
+ if (!i.current.has(I)) {
169
+ const n = new Set(
170
+ Array.from(i.current.values())
171
171
  );
172
- let l = f.current;
173
- for (let a = 0; a < M.length; a++) {
174
- const g = (f.current + a) % M.length;
175
- if (!o.has(g)) {
176
- l = g;
172
+ let s = a.current;
173
+ for (let f = 0; f < E.length; f++) {
174
+ const h = (a.current + f) % E.length;
175
+ if (!n.has(h)) {
176
+ s = h;
177
177
  break;
178
178
  }
179
179
  }
180
- n.current.set(x, l), f.current = l + 1;
180
+ i.current.set(I, s), a.current = s + 1;
181
181
  }
182
- const te = n.current.get(x) ?? 0, I = ce(te), re = [...r?.data || []].sort((o, l) => {
183
- const a = typeof o.time == "number" ? o.time : Number(o.time), g = typeof l.time == "number" ? l.time : Number(l.time);
184
- return a - g;
185
- }).reduce((o, l) => {
186
- const a = l.time;
187
- return o.length === 0 || o[o.length - 1].time !== a ? o.push({ time: a, value: l.value }) : o[o.length - 1] = { time: a, value: l.value }, o;
188
- }, []), O = r?.lineColor ?? r?.color ?? void 0;
182
+ const oe = i.current.get(I) ?? 0, C = ue(oe), re = [...r?.data || []].sort((n, s) => {
183
+ const f = typeof n.time == "number" ? n.time : Number(n.time), h = typeof s.time == "number" ? s.time : Number(s.time);
184
+ return f - h;
185
+ }).reduce((n, s) => {
186
+ const f = s.time;
187
+ 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;
188
+ }, []), _ = r?.lineColor ?? r?.color ?? void 0;
189
189
  return {
190
190
  data: re,
191
- label: w,
192
- yMeasureUnit: p?.[m] ?? (Array.isArray(t) ? void 0 : t),
193
- ...O != null ? {
194
- lineColor: O,
191
+ label: x,
192
+ yMeasureUnit: w?.[m] ?? (Array.isArray(t) ? void 0 : t),
193
+ ..._ != null ? {
194
+ lineColor: _,
195
195
  ...r?.topColor != null && {
196
196
  topColor: r.topColor
197
197
  },
@@ -199,42 +199,42 @@ function Ne({
199
199
  bottomColor: r.bottomColor
200
200
  }
201
201
  } : {
202
- color: I.line,
203
- topColor: I.top,
204
- bottomColor: I.bottom
202
+ color: C.line,
203
+ topColor: C.top,
204
+ bottomColor: C.bottom
205
205
  }
206
206
  };
207
207
  });
208
- return u && n.current.size > 0 && _(
208
+ return u && i.current.size > 0 && z(
209
209
  u,
210
- n.current
211
- ), v;
212
- }, [b, t, u]), ee = j && b.length > 0 ? b.some((p) => !p) : !e;
213
- return /* @__PURE__ */ i(
210
+ i.current
211
+ ), g;
212
+ }, [v, o, t, u]), te = R && v.length > 0 ? v.some((w) => !w) : !e;
213
+ return /* @__PURE__ */ l(
214
214
  "div",
215
215
  {
216
216
  style: {
217
217
  width: "100%",
218
- height: s ? `${s}px` : void 0
218
+ height: c ? `${c}px` : void 0
219
219
  },
220
220
  className: "w-full",
221
- children: /* @__PURE__ */ i(
222
- ue,
221
+ children: /* @__PURE__ */ l(
222
+ me,
223
223
  {
224
- series: K,
225
- loading: ee,
226
- toolbar: P,
227
- size: s ? "full" : "default",
228
- containerClassName: le("h-full", $),
229
- showLegend: j,
224
+ series: ee,
225
+ loading: te,
226
+ toolbar: G,
227
+ size: c ? "full" : "default",
228
+ containerClassName: se("h-full", X),
229
+ showLegend: R,
230
230
  onUnselectSeries: W,
231
- yMeasureUnit: U,
232
- currentValueDecimals: J,
233
- useSharedPriceScale: X,
234
- showCurrentValue: q,
235
- yScaleMin: Q,
236
- yScaleMinMultiple: Y,
237
- ...Z
231
+ yMeasureUnit: P,
232
+ currentValueDecimals: $,
233
+ useSharedPriceScale: q,
234
+ showCurrentValue: Q,
235
+ yScaleMin: Y,
236
+ yScaleMinMultiple: Z,
237
+ ...U
238
238
  }
239
239
  )
240
240
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/permissionless-ui",
3
- "version": "1.26.6",
3
+ "version": "1.26.7",
4
4
  "description": "Internal UI components",
5
5
  "license": "MIT",
6
6
  "main": "./dist/cjs/index.js",