@orderly.network/ui-scaffold 2.0.0 → 2.0.1-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,17 +1,17 @@
1
+ import { installExtension, ExtensionPositionEnum, tv, Flex, Text, Tooltip, Button, DropdownMenuRoot, DropdownMenuTrigger, DropdownMenuPortal, DropdownMenuContent, DropdownMenuGroup, EVMAvatar, Divider, DropdownMenuItem, cn as cn$1, modal, Select, Box, Dialog, DialogContent, DialogHeader, DialogTitle, DialogBody, Grid, Popover, EyeIcon, EyeCloseIcon, ChevronDownIcon, PopoverRoot, PopoverAnchor, PopoverContent, toast, ExtensionSlot, Logo } from '@orderly.network/ui';
1
2
  import { AccountStatusEnum, MEDIA_TABLET } from '@orderly.network/types';
2
- import { tv, Flex, Text, Tooltip, cn, Button, modal, Select, Box, Divider, Dialog, DialogContent, DialogHeader, DialogTitle, DialogBody, Grid, DropdownMenuRoot, DropdownMenuTrigger, DropdownMenuPortal, DropdownMenuContent, DropdownMenuGroup, EVMAvatar, DropdownMenuItem, Popover, EyeIcon, EyeCloseIcon, Logo, toast, ChevronDownIcon, PopoverRoot, PopoverAnchor, PopoverContent } from '@orderly.network/ui';
3
3
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
4
- import { WsNetworkStatus, useMediaQuery, useLocalStorage, useChains, OrderlyContext, useWalletConnector, useAccount, useCollateral, usePositionStream, useMarginRatio, useLeverage, useConfig, useWsStatus, useMaintenanceStatus } from '@orderly.network/hooks';
4
+ import { useWalletConnector, useAccount, useChains, WsNetworkStatus, useMediaQuery, useLocalStorage, OrderlyContext, useCollateral, usePositionStream, useMarginRatio, useLeverage, useConfig, useWsStatus, useMaintenanceStatus } from '@orderly.network/hooks';
5
5
  import { WalletConnectorModalId } from '@orderly.network/ui-connector';
6
- import fe, { createContext, memo, useContext, useMemo, useCallback, useState, useEffect, useRef, cloneElement } from 'react';
7
- import { useAppContext } from '@orderly.network/react-app';
6
+ import pe, { createContext, memo, useContext, useCallback, useMemo, useState, useRef, useEffect, isValidElement, cloneElement } from 'react';
7
+ import { useAppContext, useAppConfig } from '@orderly.network/react-app';
8
8
  import { ChainSelectorId } from '@orderly.network/ui-chain-selector';
9
9
  import { format } from 'date-fns';
10
10
  import { UTCDateMini } from '@date-fns/utc';
11
11
  import { getTimestamp } from '@orderly.network/utils';
12
12
 
13
- var ae=e=>{let{accountState:t,onDisconnect:n,onOpenExplorer:o}=e;if(t.status<=AccountStatusEnum.NotConnected||t.validating)return jsx(Tooltip,{open:!0,content:"Please connect wallet before starting to trade",align:"end",className:"oui-bg-base-5",arrow:{className:"oui-fill-base-5"},children:jsx(Button,{"data-testid":"oui-testid-nav-bar-connectWallet-btn",size:"md",variant:"gradient",angle:45,className:"wallet-connect-button",loading:t.validating,disabled:t.validating,onClick:()=>{e.connect().then(a=>{}).catch(a=>{});},children:"Connect wallet"})});if(t.status<=AccountStatusEnum.NotSignedIn)return jsx(Tooltip,{open:!0,content:"Please sign in before starting to trade",align:"end",className:"oui-bg-base-5",arrow:{className:"oui-fill-base-5"},children:jsx(Button,{size:"md",onClick:()=>e.onCrateAccount(),children:"Sign in"})});if(t.status<=AccountStatusEnum.DisabledTrading)return jsx(Tooltip,{open:!0,className:"oui-bg-base-5",arrow:{className:"oui-fill-base-5"},content:"Please enable trading before starting to trade",align:"end",children:jsx(Button,{size:"md",onClick:()=>{e.onCreateOrderlyKey().then(a=>{}).catch(a=>{});},children:"Enable trading"})});if(t.status===AccountStatusEnum.EnableTrading)return jsx(yt,{address:t.address,onDisconnect:n,onOpenExplorer:o})},yt=e=>{let{address:t,onDisconnect:n}=e;return jsxs(DropdownMenuRoot,{children:[jsx(DropdownMenuTrigger,{asChild:!0,children:jsx(Button,{size:"md",variant:"gradient",angle:45,"data-testid":"oui-testid-nav-bar-address-btn",children:jsx(Text.formatted,{rule:"address",className:"oui-text-[rgba(0,0,0,.88)]",children:t})})}),jsx(DropdownMenuPortal,{children:jsxs(DropdownMenuContent,{size:"xl",align:"end",onCloseAutoFocus:o=>o.preventDefault(),style:{width:"280px"},className:"oui-py-5 oui-font-semibold",sideOffset:12,children:[jsx(DropdownMenuGroup,{children:jsxs(Flex,{px:4,children:[jsxs(Flex,{gap:2,className:"oui-flex-1",children:[jsx(EVMAvatar,{address:t,size:"md"}),jsx(Text.formatted,{rule:"address",size:"base",children:t})]}),jsxs(Flex,{gap:2,children:[jsx("button",{onClick:async()=>{await navigator.clipboard.writeText(t);},children:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",className:"oui-fill-[rgba(255,255,255,0.36)] hover:oui-fill-primary",children:jsx("path",{d:"M5.249 2.243a3 3 0 0 0-3 3v4.5a3 3 0 0 0 3 3 3 3 0 0 0 3 3h4.5a3 3 0 0 0 3-3v-4.5a3 3 0 0 0-3-3 3 3 0 0 0-3-3zm7.5 4.5a1.5 1.5 0 0 1 1.5 1.5v4.5a1.5 1.5 0 0 1-1.5 1.5h-4.5a1.5 1.5 0 0 1-1.5-1.5h3a3 3 0 0 0 3-3z"})})}),jsx("button",{onClick:()=>e.onOpenExplorer(),children:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",className:"oui-fill-[rgba(255,255,255,0.36)] hover:oui-fill-primary",children:jsx("path",{d:"M12.7432 15.7432C14.3999 15.7432 15.7432 14.3999 15.7432 12.7432V5.24316C15.7432 3.58641 14.3999 2.24316 12.7432 2.24316H5.24316C3.58641 2.24316 2.24316 3.58641 2.24316 5.24316V12.7432C2.24316 14.3999 3.58641 15.7432 5.24316 15.7432H12.7432ZM6.74316 11.9932C6.55116 11.9932 6.35092 11.9287 6.20392 11.7824C5.91142 11.4892 5.91142 10.9972 6.20392 10.7039L9.20392 7.70392L7.49316 5.99316H11.9932V10.4932L10.2824 8.78241L7.28241 11.7824C7.13616 11.9287 6.93516 11.9932 6.74316 11.9932Z"})})})]})]})}),jsx(Divider,{className:"oui-mx-4 oui-my-3",intensity:8}),jsx(DropdownMenuGroup,{children:jsx(DropdownMenuItem,{size:"xl",onSelect:o=>{o.preventDefault(),n();},"data-testid":"oui-testid-nav-bar-dropDownMenuItem-disconnect",children:jsxs(Flex,{gap:2,className:"oui-text-danger-light",children:[jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.97 14.03a.75.75 0 0 1 0-1.06l.262-.263C2.594 12.354 1.5 11.108 1.5 9.06c0-2.447 1.563-3.75 3.75-3.75H6a.75.75 0 0 1 0 1.5h-.75C3.837 6.81 3 7.508 3 9.06s.837 2.25 2.25 2.25h.38l1.188-1.188a.75.75 0 0 1-.068-.312v-.75c0-1.162.381-2.19 1.172-2.883.645-.565 1.512-.867 2.578-.867h1.13l1.34-1.34a.75.75 0 0 1 1.061 1.06l-9 9a.75.75 0 0 1-1.06 0m6.14-7.2L8.27 8.668c.065-.583.281-1.056.635-1.367.289-.253.684-.419 1.205-.473M7.825 12.8l3.414-3.415c-.126 2.12-1.496 3.297-3.414 3.415m7.705-6.58a.75.75 0 0 0-1.06 1.06c.508.509.53 1.202.53 1.72 0 .739-.014 1.203-.53 1.72-.165.164-.455.307-.825.405a3.8 3.8 0 0 1-.895.125H12a.75.75 0 0 0 0 1.5h.75c.31 0 .787-.045 1.28-.175.48-.127 1.065-.36 1.5-.795.97-.97.97-1.991.97-2.75v-.06c0-.51.002-1.778-.97-2.75",fill:"currentcolor"})}),jsx("span",{children:"Disconnect"})]})})})]})})]})};var O=createContext({}),I=()=>useContext(O);var Fe=()=>{let {disconnect:e,connectedChain:t}=useWalletConnector(),{account:n,state:o}=useAccount();I();let {connectWallet:s}=useAppContext(),[c,{findByChainId:d}]=useChains(),g=async()=>{modal.show(WalletConnectorModalId).then(l=>{},l=>{});},w=async()=>{modal.show(WalletConnectorModalId).then(l=>{},l=>{});},u=()=>{n.once("validate:end",l=>{l<AccountStatusEnum.EnableTrading?b({status:l}):toast.success("Wallet connected");}),modal.show(ChainSelectorId).then(l=>{l.wrongNetwork||(o.status<AccountStatusEnum.EnableTrading?b(o):toast.success("Wallet connected"));},l=>{});},f=async()=>{let l=await s();l&&(l.wrongNetwork?u():b(l));},b=l=>{l.validating||l.status<=AccountStatusEnum.Connected||(l.status<AccountStatusEnum.SignedIn&&g(),l.status<AccountStatusEnum.EnableTrading&&w());},p=useCallback(()=>{if(!t)return;let l=d(t.id,"network_infos");if(l){let{explorer_base_url:P}=l;P&&(P.endsWith("/")?window.open(`${P}address/${n.address}`):window.open(`${P}/address/${n.address}`));}},[o,t]);return {address:o.address,accountState:o,connect:f,onCrateAccount:g,onCreateOrderlyKey:w,onOpenExplorer:p,onDisconnect:async()=>{await e({label:o.connectWallet?.name}),await n.disconnect();}}};var H=()=>{let e=Fe();return jsx(ae,{...e})};var G=e=>{let{classNames:t,currentPath:n,item:o,onClick:a,...s}=e,c=useMemo(()=>e.currentPath?.[0]===e.item.href,[n]),d=useCallback(()=>{Array.isArray(e.item.children)||e.onClick?.([e.item]);},[e.item]),g=jsxs("button",{id:o.id,"data-testid":o.testid,...s,disabled:e.item.disabled,"data-actived":c,className:cn("oui-text-base-contrast-36 oui-text-sm oui-relative oui-group oui-rounded oui-px-3 oui-py-1 oui-h-[32px] hover:oui-bg-base-7",t?.navItem),onClick:d,children:[jsxs("span",{className:"oui-flex oui-items-center",children:[jsx(Ve,{isActive:c,item:e.item}),jsx(Text.gradient,{color:c?"brand":"inherit",angle:45,children:e.item.name}),Array.isArray(e.item.children)&&jsx("span",{className:"oui-ml-1 group-data-[open=true]:oui-rotate-180",children:c?jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("path",{d:"M2.913 4.515a.5.5 0 0 0-.328.202.51.51 0 0 0 .14.701L5.722 7.41a.51.51 0 0 0 .562 0l2.995-1.992a.51.51 0 0 0 .14-.7.51.51 0 0 0-.701-.14L6.002 6.382 3.287 4.577a.5.5 0 0 0-.374-.062",fill:"url(#mainNavDropDownIcon)"}),jsx("defs",{children:jsxs("linearGradient",{id:"mainNavDropDownIcon",x1:"9.502",y1:"5.994",x2:"2.502",y2:"5.994",gradientUnits:"userSpaceOnUse",children:[jsx("stop",{"stop-color":"#59B0FE"}),jsx("stop",{offset:"1","stop-color":"#26FEFE"})]})})]}):jsx(ChevronDownIcon,{size:12,color:"white"})})]}),jsx(Box,{invisible:!c,position:"absolute",bottom:0,left:"50%",height:"3px",r:"full",width:"60%",gradient:"brand",angle:45,className:"-oui-translate-x-1/2 "})]});return Array.isArray(e.item.children)?jsx(Ot,{items:e.item.children,className:t?.subMenu,current:e.currentPath?.[1],onItemClick:w=>{e.onClick?.([e.item,w]);},children:g}):g},Ot=e=>{let[t,n]=useState(!1),o=useRef(null),a=useCallback(()=>{o.current&&(clearTimeout(o.current),o.current=null);},[]),s=e.children.props.className;return jsxs(PopoverRoot,{open:t,children:[jsx(PopoverAnchor,{children:jsx("div",{className:"oui-group","data-open":t,onMouseEnter:()=>{n(!0);},onMouseLeave:()=>{o.current=setTimeout(()=>{n(!1);},150);},children:cloneElement(e.children,{className:cn(s,t&&"oui-bg-base-7")})})}),jsx(PopoverContent,{align:"start",onMouseEnter:a,onMouseLeave:()=>{n(!1),o.current&&clearTimeout(o.current);},className:cn("oui-p-1 oui-w-[260px] oui-border oui-border-line-6 oui-space-y-[2px]",e.className),children:e.items.map((c,d)=>jsx(Ht,{item:c,onClick:e.onItemClick,active:c.href===e.current},d))})]})},Ht=e=>{let{item:t}=e;return jsxs(Flex,{px:2,py:3,gapX:2,"data-active":e.active??!1,className:cn("hover:oui-bg-base-6 oui-cursor-pointer oui-text-base-contrast-80 oui-items-start oui-w-full oui-group data-[active=true]:oui-bg-base-5"),r:"md",onClick:()=>{e.onClick(t);},"data-testid":t.testid,children:[!!e.item.icon&&jsx("div",{className:"oui-translate-y-1 oui-relative oui-w-6 oui-h-6",children:jsx(Ve,{isActive:e.active??!1,item:e.item})}),jsxs("div",{className:"oui-flex-1",children:[jsx(Ut,{item:t,isActive:e.active}),typeof t.description<"u"&&jsx(Text,{size:"2xs",as:"div",intensity:36,children:t.description})]})]})},Ut=e=>{let{item:{name:t},isActive:n}=e;return jsxs(Flex,{itemAlign:"center",width:"100%",position:"relative",children:[jsxs("div",{className:"oui-flex-1 oui-flex",children:[jsx(Text.gradient,{color:n?"brand":"inherit",size:"xs",as:"div",intensity:80,weight:"semibold",children:t}),typeof e.item.tag<"u"&&jsx(Gt,{item:e.item})]}),e.item.target==="_blank"&&jsx($t,{})]})},Gt=e=>jsx("div",{className:"oui-px-2 oui-py-1 oui-ml-1 oui-rounded oui-inline-flex oui-bg-gradient-to-r oui-from-[rgb(var(--oui-gradient-brand-start)_/_0.12)] oui-to-[rgb(var(--oui-gradient-brand-end)_/_0.12)]",children:jsx(Text.gradient,{color:"brand",size:"3xs",children:e.item.tag})}),Ae="oui-flex oui-border oui-border-line oui-w-6 oui-h-6 oui-rounded-md oui-justify-center oui-items-center oui-absolute oui-left-0 oui-top-0",Ve=e=>{let{item:t,isActive:n}=e;return e.item.icon?typeof e.item.icon=="string"?jsx("span",{className:"oui-w-[20px] oui-h-[20px] oui-mr-1",children:jsx("img",{src:n&&e.item.activeIcon||e.item.icon,className:"oui-max-w-full oui-max-h-full"})}):jsxs(Fragment,{children:[jsx("div",{className:cn(Ae,"group-data-[active=true]:oui-invisible group-hover:oui-invisible"),children:e.item.icon}),jsx("div",{className:cn(Ae,"oui-invisible group-data-[active=true]:oui-visible group-hover:oui-visible"),children:e.item.activeIcon||e.item.icon})]}):null},$t=()=>jsxs(Fragment,{children:[jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"oui-absolute oui-right-0 oui-top-0 group-hover:oui-invisible",children:jsx("path",{d:"M14.159 17.492a3.333 3.333 0 0 0 3.333-3.333V5.826a3.333 3.333 0 0 0-3.333-3.334H5.826a3.333 3.333 0 0 0-3.334 3.334v8.333a3.333 3.333 0 0 0 3.334 3.333zm-6.667-4.166a.85.85 0 0 1-.599-.235.86.86 0 0 1 0-1.198l3.333-3.333-1.9-1.901h5v5l-1.901-1.9L8.09 13.09a.84.84 0 0 1-.599.235",fill:"#fff",fillOpacity:".2"})}),jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"oui-absolute oui-right-0 oui-top-0 oui-invisible group-hover:oui-visible",children:[jsx("path",{d:"M14.159 17.492a3.333 3.333 0 0 0 3.333-3.333V5.826a3.333 3.333 0 0 0-3.333-3.334H5.826a3.333 3.333 0 0 0-3.334 3.334v8.333a3.333 3.333 0 0 0 3.334 3.333zm-6.667-4.166a.85.85 0 0 1-.599-.235.86.86 0 0 1 0-1.198l3.333-3.333-1.9-1.901h5v5l-1.901-1.9L8.09 13.09a.84.84 0 0 1-.599.235",fill:"url(#outlineIcon)"}),jsx("defs",{children:jsxs("linearGradient",{id:"outlineIcon",x1:"17.492",y1:"9.992",x2:"2.492",y2:"9.992",gradientUnits:"userSpaceOnUse",children:[jsx("stop",{stopColor:"#59B0FE"}),jsx("stop",{offset:"1",stopColor:"#26FEFE"})]})})]})]});var ze=e=>{let{items:t,classNames:n}=e;return !Array.isArray(t)||t.length===0?null:jsx(Flex,{gap:2,className:n?.root,children:t?.map((o,a)=>jsx(G,{item:o,currentPath:e.current,onClick:e.onItemClick},a))})};var De=e=>{let{active:t,item:n,onClick:o}=e;return jsx(Button,{variant:t?"gradient":"text",color:"secondary",size:"sm",angle:45,className:cn(t?"oui-text-[rgba(0_,_0_,_0_,_0.88)]":"hover:oui-bg-base-7"),onClick:()=>{o?.(n);},children:n.name})};var se=e=>{let{items:t,onItemClick:n,current:o,className:a}=e,s=useMemo(()=>typeof o<"u"?o:t?.[0]?.href,[o,t]);return !Array.isArray(t)||t.length===0?null:jsx(Flex,{gap:0,border:!0,r:"md",className:cn("oui-p-[1px]",a),borderColor:12,children:t?.map((c,d)=>jsx(De,{item:c,onClick:n,active:s==c.href},d))})};var ue=e=>{let{type:t,...n}=e,o;switch(e.type){case"freeCollateral":o=jsx(to,{freeCollateral:e.freeCollateral,visible:e.visible,onToggleVisibility:e.onToggleVisibility});break;case"unrealPnL":o=jsx(io,{unrealPnL:e.unrealPnL,unrealized_pnl_ROI:e.unrealized_pnl_ROI,visible:e.visible,onToggleVisibility:e.onToggleVisibility});break;case"currentLeverage":o=jsx(oo,{currentLeverage:e.currentLeverage});break;case"maxLeverage":o=jsx(no,{maxLeverage:e.maxLeverage});break;case"totalValue":default:o=jsx(eo,{totalValue:e.totalValue,onToggleVisibility:e.onToggleVisibility,visible:e.visible});}return jsx(Popover,{content:jsx(ao,{totalValue:n.totalValue,freeCollateral:e.freeCollateral,maxLeverage:e.maxLeverage,currentLeverage:e.currentLeverage,unrealized_pnl_ROI:e.unrealized_pnl_ROI,unrealPnL:e.unrealPnL,type:e.type,onTypeChange:e.onTypeChange,visible:e.visible}),contentProps:{onOpenAutoFocus:a=>a.preventDefault(),sideOffset:12},arrow:!0,children:jsx("div",{className:"oui-cursor-pointer",children:o})})},eo=e=>{let{totalValue:t=0,visible:n=!0,onToggleVisibility:o}=e;return jsxs(Flex,{direction:"column",gap:0,className:"oui-text-2xs",itemAlign:"start",children:[jsxs(Flex,{gap:1,itemAlign:"center",children:[jsx(Text,{intensity:54,className:"oui-whitespace-nowrap",children:"Total Value"}),jsx("button",{onClick:()=>o?.(),children:n?jsx(EyeIcon,{size:12,className:"oui-text-primary-light",opacity:1}):jsx(EyeCloseIcon,{size:12,className:"oui-text-primary-light",opacity:1})}),jsx(Text,{intensity:54,children:"\u2248"})]}),jsx(Text.numeral,{visible:e.visible,unit:"USDC",unitClassName:"oui-text-base-contrast-20 oui-ml-1",as:"div",children:t??"-"})]})},to=e=>{let{freeCollateral:t,visible:n,onToggleVisibility:o}=e;return jsxs(Flex,{direction:"column",gap:0,className:"oui-text-2xs",itemAlign:"start",children:[jsxs(Flex,{gap:1,itemAlign:"center",children:[jsx(Text,{intensity:54,className:"oui-whitespace-nowrap",children:"Free collateral"}),jsx("button",{onClick:()=>o?.(),children:n?jsx(EyeIcon,{size:12,className:"oui-text-primary-light",opacity:1}):jsx(EyeCloseIcon,{size:12,className:"oui-text-primary-light",opacity:1})})]}),jsx(Text.numeral,{unit:"USDC",unitClassName:"oui-text-base-contrast-20 oui-ml-1",visible:n,as:"div",children:t??"-"})]})},oo=e=>{let{currentLeverage:t}=e;return jsxs(Flex,{direction:"column",gap:0,className:"oui-text-2xs",itemAlign:"start",children:[jsx(Box,{children:jsx(Text,{intensity:54,className:"oui-whitespace-nowrap",children:"Current leverage"})}),jsx(Text.numeral,{as:"div",unit:"x",children:t??0})]})},no=e=>jsxs(Flex,{direction:"column",gap:0,className:"oui-text-2xs",itemAlign:"start",children:[jsx(Box,{children:jsx(Text,{intensity:54,className:"oui-whitespace-nowrap",children:"Max leverage"})}),jsx(Text,{color:"primary",as:"div",children:`${e.maxLeverage??"--"}x`})]}),io=e=>{let{visible:t,onToggleVisibility:n}=e;return jsxs(Flex,{direction:"column",gap:0,className:"oui-text-2xs",itemAlign:"start",children:[jsxs(Flex,{gap:1,itemAlign:"center",children:[jsx(Text,{intensity:54,className:"oui-whitespace-nowrap",children:"Unreal. PnL"}),jsx("button",{onClick:()=>n?.(),children:t?jsx(EyeIcon,{size:12,className:"oui-text-primary-light",opacity:1}):jsx(EyeCloseIcon,{size:12,className:"oui-text-primary-light",opacity:1})})]}),jsx(Text.numeral,{as:"div",coloring:!0,showIdentifier:!0,weight:"semibold",visible:t,suffix:jsx(Text.numeral,{coloring:!0,prefix:"(",suffix:")",rule:"percentages",children:e.unrealized_pnl_ROI??"-"}),children:e.unrealPnL??"-"})]})},ao=e=>{let{totalValue:t}=e;return jsxs(Flex,{className:"oui-text-2xs oui-font-semibold",direction:"column",gapY:1,children:[jsxs(Flex,{justify:"between",width:"100%",children:[jsxs(Flex,{className:"oui-text-base-contrast-54",gapX:2,children:[jsx(E,{active:e.type==="totalValue",onClick:()=>e.onTypeChange("totalValue")}),jsx("span",{children:"Total Value"})]}),jsx(Text.numeral,{visible:e.visible,unit:"USDC",unitClassName:"oui-text-base-contrast-36 oui-ml-1",children:t??"-"})]}),jsxs(Flex,{justify:"between",width:"100%",children:[jsxs(Flex,{className:"oui-text-base-contrast-54",gapX:2,children:[jsx(E,{active:e.type==="freeCollateral",onClick:()=>e.onTypeChange("freeCollateral")}),jsx("span",{children:"Free collateral"})]}),jsx(Text.numeral,{unit:"USDC",visible:e.visible,unitClassName:"oui-text-base-contrast-36 oui-ml-1",children:e.freeCollateral??"-"})]}),jsxs(Flex,{justify:"between",width:"100%",children:[jsxs(Flex,{className:"oui-text-base-contrast-54",gapX:2,children:[jsx(E,{active:e.type==="unrealPnL",onClick:()=>e.onTypeChange("unrealPnL")}),jsx("span",{children:"Unreal. PnL"})]}),jsx(Text.numeral,{coloring:!0,showIdentifier:!0,visible:e.visible,suffix:jsx(Text.numeral,{coloring:!0,prefix:"(",visible:e.visible,suffix:")",rule:"percentages",children:e.unrealized_pnl_ROI??"-"}),children:e.unrealPnL??"-"})]}),jsxs(Flex,{justify:"between",width:"100%",children:[jsxs(Flex,{className:"oui-text-base-contrast-54",gapX:2,children:[jsx(E,{active:e.type==="currentLeverage",onClick:()=>e.onTypeChange("currentLeverage")}),jsx("span",{children:"Current leverage"})]}),jsx(Text.numeral,{unit:"x",children:e.currentLeverage??"-"})]}),jsxs(Flex,{justify:"between",width:"100%",children:[jsxs(Flex,{className:"oui-text-base-contrast-54",gapX:2,children:[jsx(E,{active:e.type==="maxLeverage",onClick:()=>e.onTypeChange("maxLeverage")}),jsx("span",{children:"Max leverage"})]}),jsx(Text,{color:"primary",children:`${e.maxLeverage??"-"}x`})]})]})},E=e=>jsx("button",{onClick:e.onClick,children:e.active?jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:jsx("path",{d:"M7.506.977a.56.56 0 0 0-.365.16C6.367 1.88 6.13 2.5 6.413 3.348c-.661.506-1.078.63-1.903.63-1.127 0-1.863.137-2.364.637v.016a1.187 1.187 0 0 0 0 1.686l1.4 1.411-2.385 2.385a.513.513 0 0 0-.015.717.514.514 0 0 0 .719 0l2.394-2.395 1.403 1.396a1.19 1.19 0 0 0 1.687 0h.016c.501-.5.64-1.142.64-2.358 0-.773.16-1.319.64-1.893.924.271 1.462.012 2.22-.746a.5.5 0 0 0 .14-.36c0-.175-.044-.445-.156-.78a4 4 0 0 0-.984-1.577 4 4 0 0 0-1.578-.984C7.95 1.02 7.682.977 7.506.977",fill:"currentcolor",className:"oui-text-primary-light"})}):jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:jsx("path",{d:"M7.506.977a.56.56 0 0 0-.365.16C6.367 1.88 6.13 2.5 6.413 3.348c-.661.506-1.078.63-1.903.63-1.127 0-1.863.137-2.364.637v.016a1.187 1.187 0 0 0 0 1.686l1.4 1.411-2.385 2.385a.513.513 0 0 0-.015.717.514.514 0 0 0 .719 0l2.394-2.395 1.403 1.396a1.19 1.19 0 0 0 1.687 0h.016c.501-.5.64-1.142.64-2.358 0-.773.16-1.319.64-1.893.924.271 1.462.012 2.22-.746a.5.5 0 0 0 .14-.36c0-.175-.044-.445-.156-.78a4 4 0 0 0-.984-1.577 4 4 0 0 0-1.578-.984C7.95 1.02 7.682.977 7.506.977m.193 1.027c.531.098 1.066.45 1.447.83.381.382.706.848.84 1.459-.477.458-.77.494-1.247.243a.5.5 0 0 0-.583.087c-.91.91-1.15 1.736-1.15 2.85 0 .97-.057 1.33-.36 1.655-.085.092-.203.078-.281 0L2.849 5.615a.18.18 0 0 1-.012-.255c.178-.217.576-.386 1.669-.386 1.306.001 2-.335 2.859-1.14a.5.5 0 0 0 .094-.578c-.257-.513-.217-.784.24-1.252",fill:"currentcolor"})})});var He=()=>{let[e,t]=useLocalStorage("accountSummaryType","totalValue"),{freeCollateral:n,totalValue:o}=useCollateral({dp:2}),{state:a}=useAccount(),[s,c]=useLocalStorage("orderly_assets_visible",!0),[{aggregated:d,totalUnrealizedROI:g}]=usePositionStream(),{wrongNetwork:w}=useAppContext(),{currentLeverage:u}=useMarginRatio(),[f]=useLeverage(),b=l=>{t(l);},p=w||a.status<AccountStatusEnum.EnableTrading;return {totalValue:p?null:o,freeCollateral:p?null:n,maxLeverage:p?null:f,currentLeverage:p?null:u,unrealPnL:p?null:d?.unrealPnL,unrealized_pnl_ROI:p?null:g,type:e,onTypeChange:b,visible:s,wrongNetwork:w,onToggleVisibility:()=>c(!s)}};var $=()=>{let e=He();return jsx(ue,{...e})};var X=e=>e.wrongNetwork&&e.isConnected?jsx(Tooltip,{open:!0,content:"Please switch to a supported network to continue.",className:"oui-bg-base-5",arrow:{className:"oui-fill-base-5"},children:jsx(Button,{color:"warning",size:"md",onClick:()=>{modal.show(ChainSelectorId,{networkId:e.networkId}).then(t=>{!t.wrongNetwork&&e.accountStatus<AccountStatusEnum.EnableTrading&&modal.show(WalletConnectorModalId).then(n=>{},n=>{});},t=>{});},children:"Wrong network"})}):jsx(Flex,{justify:"center",children:jsx(Select.chains,{chains:e.chains,size:"md",value:e.currentChainId,variant:"contained",onChange:e.onChange})});var Ge=()=>{let[e]=useChains(),{state:t}=useAccount(),{setChain:n,connectedChain:o}=useWalletConnector(),[a,s]=useState(),{wrongNetwork:c,onChainChanged:d}=useAppContext(),g=useConfig("networkId");useEffect(()=>{if(o)s(typeof o.id=="number"?o.id:parseInt(o.id));else {if(a)return;let u=g==="mainnet"?e.mainnet?.[0]?.network_infos:e.testnet?.[0]?.network_infos;if(!u)return;s(u.chain_id);}},[o,e,a,g]);let w=async u=>{if(o){if(!await n({chainId:u.id}))return;d?.(u.id,{isTestnet:u.isTestnet,isWalletConnected:!0});}else d?.(u.id,{isTestnet:u.isTestnet,isWalletConnected:!1});};return {chains:{mainnet:e.mainnet.map(u=>({name:u.network_infos.name,id:u.network_infos.chain_id,lowestFee:u.network_infos.bridgeless,isTestnet:!1})),testnet:e.testnet.map(u=>({name:u.network_infos.name,id:u.network_infos.chain_id,lowestFee:u.network_infos.bridgeless,isTestnet:!0}))},currentChainId:a,onChange:w,isConnected:!!o,wrongNetwork:c,accountStatus:t.status,networkId:g}};var K=()=>{let e=Ge();return jsx(X,{...e})};var me=(o=>(o.menuLeading="menuLeading",o.menuTailing="menuTailing",o.navTailing="navTailing",o))(me||{}),Ze=e=>{let{onItemClick:t,campaignPosition:n="navTailing"}=e,{routerAdapter:o}=I(),{connectedChain:a}=useWalletConnector(),{wrongNetwork:s}=useAppContext(),[c,d]=useState(()=>typeof e.initialMenu>"u"?[]:Array.isArray(e.initialMenu)?e.initialMenu:[e.initialMenu]),[g,w]=useState(()=>e?.initialProduct??e?.products?.[0].href??""),u=p=>l=>{let P=l[l.length-1];if(!P)return;P.target!=="_blank"&&d(l.map(pt=>pt.href));let ne=l[l.length-1],Ie={href:ne.href,name:ne.name,scope:p,target:ne.target};if(typeof t=="function"){t(Ie);return}o?.onRouteChange(Ie);},f=useMemo(()=>{let p={logo:{src:"https://testnet-dex-evm.woo.org/images/woofipro.svg",alt:"woofipro"},mainMenus:[],products:[],...e,campaignPosition:n};return e.campaigns&&(n==="menuTailing"?p.mainMenus=[...p.mainMenus,e.campaigns]:n==="menuLeading"?p.mainMenus=[e.campaigns,...p.mainMenus]:p.campaigns=e.campaigns),p},[e]),b={};return f.products&&f.products.length&&(b.products={items:f.products,current:g,onItemClick:p=>{let l={href:p.href,name:p.name,scope:"product"};if(typeof t=="function"){t(l);return}o?.onRouteChange(l);}}),f.mainMenus&&f.mainMenus.length&&(b.mainMenus={items:f.mainMenus,current:c,onItemClick:u("mainMenu")}),f.campaigns&&f.campaigns.children?.length&&(b.campaigns={item:f.campaigns,current:c,onItemClick:u("campaign")}),{...f,isConnected:!!a,wrongNetwork:s,...b}};var Ke=e=>jsxs(Fragment,{children:[jsx(G,{item:e.item,style:{"--oui-gradient-angle":"188deg","--oui-gradient-primary-stop-start":"26%","--oui-gradient-primary-stop-end":"80%"},onClick:e.onItemClick,classNames:{navItem:cn("oui-gradient-primary oui-text-white",e.className)}}),jsx(Divider,{direction:"vertical",className:"oui-h-8",intensity:8})]});var ge=e=>{let{className:t,logo:n,products:o,classNames:a,campaigns:s,campaignPosition:c}=e,d=useMemo(()=>typeof e.children>"u"?null:jsx(Flex,{grow:!0,children:e.children}),[e.children]);return jsxs(Flex,{as:"header",itemAlign:"center",height:"48px",justify:"between",px:3,className:`orderly-main-nav ${t} ${a?.root} oui-font-semibold`,children:[jsxs(Flex,{itemAlign:"center",gap:4,children:[jsx(Logo,{...n}),jsx(se,{...o,className:a?.products}),jsx(ze,{...e.mainMenus,classNames:a?.mainNav})]}),d,jsxs(Flex,{itemAlign:"center",gap:4,children:[c==="navTailing"&&s?jsx(Ke,{...s,className:a?.campaignButton}):null,jsx($,{}),jsx(K,{}),e.wrongNetwork&&e.isConnected?null:jsx(H,{})]})]})};ge.displayName="MainNav";var pe=e=>{let{children:t,...n}=e,o=Ze(n);return jsx(ge,{...o,children:t})};var Go=tv({slots:{button:["oui-h-10","oui-px-3","oui-rounded-md","oui-w-full","oui-text-left","oui-text-base","oui-text-base-contrast-36","oui-group","hover:oui-bg-base-8","oui-transition-colors","group-data-[state=closed]/bar:oui-w-[42px]","oui-overflow-hidden"],icon:[]},variants:{mode:{"icon-only":{button:"oui-w-10",icon:"w-6 h-6"},full:{button:"oui-full",icon:"w-6 h-6"}},active:{true:{button:"oui-bg-base-5 hover:oui-bg-base-5"}},open:{true:{button:""}}}}),$o=memo(e=>{let{item:t,mode:n,open:o,onClick:a,active:s,...c}=e,{button:d}=Go({mode:n,active:e.active,open:e.open}),g=jsx("button",{"data-actived":e.active,disabled:t.disabled,className:d(),onClick:()=>{e.onClick?.(t);},children:jsxs(Flex,{itemAlign:"center",gap:2,as:"span",children:[t.icon,e.open&&jsx(Text.gradient,{color:e.active?"brand":"inherit",angle:45,size:"base",className:"oui-animate-in oui-fade-in",children:t.name})]})});return e.open?jsx("li",{className:"oui-min-w-[120px]",children:g}):jsx("li",{children:jsx(Tooltip,{content:t.name,side:"right",align:"center",sideOffset:20,children:g})})}),Zo=e=>jsxs(Box,{py:6,children:[jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"oui-absolute oui-invisible oui-pointer-events-none",children:jsx("defs",{children:jsxs("linearGradient",{id:"side-menu-gradient",x1:"15.7432",y1:"8.94726",x2:"2.24316",y2:"8.94726",gradientUnits:"userSpaceOnUse",children:[jsx("stop",{stopColor:"#59B0FE"}),jsx("stop",{offset:"1",stopColor:"#26FEFE"})]})})}),jsx("ul",{className:"oui-space-y-4",children:e.menus.map((t,n)=>jsx($o,{item:t,open:e.open,active:t.href===e.current,onClick:e.onItemSelect},n))})]}),Xo=e=>{let{title:t}=e,n=typeof t=="string"?jsx(Text,{intensity:54,size:"xs",children:t}):t;return jsxs(Flex,{justify:e.open?"between":"center",itemAlign:"center",className:"oui-h-6",children:[e.open?n:null,jsx("button",{onClick:()=>{e.onToggle?.();},children:jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"group-data-[state=closed]/bar:oui-rotate-90",children:jsx("path",{d:"M5.82552 17.4922C3.98469 17.4922 2.49219 15.9997 2.49219 14.1589V5.82552C2.49219 3.98469 3.98469 2.49219 5.82552 2.49219H14.1589C15.9997 2.49219 17.4922 3.98469 17.4922 5.82552V14.1589C17.4922 15.9997 15.9997 17.4922 14.1589 17.4922H5.82552ZM12.4922 13.3255C12.7055 13.3255 12.928 13.2538 13.0913 13.0913C13.4163 12.7655 13.4163 12.2189 13.0913 11.893L9.75802 8.55969L11.6589 6.65885H6.65885V11.6589L8.55969 9.75802L11.893 13.0913C12.0555 13.2538 12.2789 13.3255 12.4922 13.3255Z",fill:"white",fillOpacity:"0.2"})})})]})},z=e=>{let{open:t=!0,items:n,current:o,onItemSelect:a}=e;return jsxs(Box,{"data-state":t?"opened":"closed",className:cn("oui-group/bar",e.className),style:e.style,children:[jsx(Xo,{open:t,title:e.title,onToggle:()=>{e.onOpenChange?.(!t);}}),jsx(Zo,{menus:n,current:o,onItemSelect:a,open:t})]})};z.displayName="SideBar";var Ye=e=>{let[t,n]=useState(e?.items?.[0].href||"/"),{expanded:o,setExpand:a}=I();return {items:[],current:t,open:o,onOpenChange:s=>{a?.(s);},onItemSelect:s=>{s.href&&n(s.href);},...e}};var J=e=>{let t=Ye(e);return jsx(z,{...t})};var Q=fe.forwardRef((e,t)=>{let{size:n=20,...o}=e;return jsx("svg",{width:n,height:n,viewBox:"0 0 20 20",ref:t,fill:"#fff",fillOpacity:".54",xmlns:"http://www.w3.org/2000/svg",...o,children:jsx("path",{d:"M4.108 9.464S9.645 7.13 11.565 6.31c.736-.328 3.233-1.38 3.233-1.38s1.152-.46 1.056.658c-.032.46-.288 2.069-.544 3.81-.384 2.463-.8 5.157-.8 5.157s-.064.755-.608.887c-.544.13-1.44-.46-1.6-.592-.129-.098-2.401-1.576-3.233-2.299-.224-.197-.48-.591.032-1.051a124 124 0 0 0 3.36-3.285c.384-.394.768-1.313-.832-.197-2.272 1.61-4.513 3.12-4.513 3.12s-.512.33-1.472.034-2.08-.69-2.08-.69-.768-.493.544-1.018"})})}),Y=fe.forwardRef((e,t)=>{let{size:n=20,...o}=e;return jsx("svg",{width:n,height:n,viewBox:"0 0 20 20",ref:t,fill:"#fff",fillOpacity:".54",...o,xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{d:"M14.956 5.522c1.604 2.374 2.396 5.053 2.1 8.136a.05.05 0 0 1-.02.033 11.7 11.7 0 0 1-3.55 1.805.045.045 0 0 1-.05-.017 9.6 9.6 0 0 1-.725-1.188.046.046 0 0 1 .024-.063 7 7 0 0 0 1.108-.531.046.046 0 0 0 .004-.076 6 6 0 0 1-.22-.174.04.04 0 0 0-.047-.006c-2.296 1.068-4.812 1.068-7.136 0a.04.04 0 0 0-.046.006 6 6 0 0 1-.22.174.046.046 0 0 0 .005.076c.353.204.721.384 1.107.531.025.01.037.039.025.063a8.5 8.5 0 0 1-.725 1.188.05.05 0 0 1-.05.017 11.7 11.7 0 0 1-3.546-1.805.05.05 0 0 1-.018-.033c-.248-2.667.257-5.368 2.097-8.137a.04.04 0 0 1 .02-.016 11.6 11.6 0 0 1 2.89-.903.05.05 0 0 1 .046.022c.125.224.269.51.366.744a10.7 10.7 0 0 1 3.246 0 8 8 0 0 1 .36-.744.044.044 0 0 1 .046-.022 11.7 11.7 0 0 1 2.89.903q.012.005.019.017m-6.018 5.07c.011-.788-.56-1.44-1.276-1.44-.71 0-1.276.647-1.276 1.44 0 .795.576 1.442 1.276 1.442.71 0 1.276-.647 1.276-1.441m4.718 0c.011-.788-.56-1.44-1.276-1.44-.71 0-1.276.647-1.276 1.44 0 .795.577 1.442 1.276 1.442.717 0 1.276-.647 1.276-1.441"})})}),j=fe.forwardRef((e,t)=>{let{size:n=20,...o}=e;return jsx("svg",{width:n,height:n,viewBox:"0 0 20 20",ref:t,fill:"#fff",fillOpacity:".54",xmlns:"http://www.w3.org/2000/svg",...o,children:jsx("path",{d:"m4.42 4.73 4.633 6.194-4.662 5.037H5.44l4.082-4.41 3.298 4.41h3.57l-4.893-6.543 4.34-4.689h-1.05l-3.759 4.062-3.037-4.062zm1.543.772h1.64l7.244 9.686h-1.64z"})})});j.displayName="CommuntiyXIcon";Q.displayName="CommuntiyTelegramIcon";Y.displayName="CommuntiyDiscordIcon";var he=fe.forwardRef((e,t)=>{let{opacity:n=.54,...o}=e;return jsxs("svg",{width:96,hanging:11,ref:t,viewBox:"0 0 96 11",xmlns:"http://www.w3.org/2000/svg",...o,children:[jsx("path",{d:"M10.757 8.635h1.862V6.164c0-1.485.874-1.904 1.69-1.904.148 0 .284.011.477.034V2.729a1.8 1.8 0 0 0-.454-.056c-.896 0-1.452.6-1.68 1.53h-.033V2.74h-1.862zm7.221.113c.874 0 1.475-.464 1.634-.907v.794h1.861V.7h-1.86v2.834c-.16-.442-.761-.907-1.635-.907-1.203 0-2.565.885-2.565 3.06 0 2.188 1.362 3.061 2.565 3.061m-.817-3.06c0-1.043.624-1.52 1.282-1.52.647 0 1.249.477 1.249 1.52s-.602 1.519-1.249 1.519c-.658 0-1.282-.476-1.282-1.52m8.538 3.061c1.453 0 2.508-.748 2.78-2.108h-1.634c-.102.385-.352.703-1.112.703-.726 0-1.18-.329-1.282-1.19h4.074c.023-.136.034-.25.034-.465 0-2.301-1.34-3.06-2.86-3.06-1.578 0-3.007.838-3.007 3.037 0 2.29 1.543 3.083 3.007 3.083m-1.237-3.672c.114-.68.5-1.043 1.192-1.043.85 0 1.112.533 1.146 1.043zm5.304 3.559h1.861V6.164c0-1.485.874-1.904 1.691-1.904.148 0 .284.011.477.034V2.729a1.8 1.8 0 0 0-.454-.056c-.897 0-1.453.6-1.68 1.53h-.034V2.74h-1.861zm5.117 0h1.861V.7h-1.861zm3.481.725v1.565c1.827.192 2.588-.42 3.382-2.358L44.13 2.74h-1.906L40.93 6.265 39.67 2.74h-1.895l2.145 5.293c.148.352.159.533.034.816-.102.227-.363.669-1.589.51m9.808-.724h1.895V3.897h.045l2.86 4.738h2.043V.7h-1.907v4.863h-.045L50.136.7h-1.963zm11.054.113c1.453 0 2.508-.748 2.78-2.108h-1.633c-.102.385-.352.703-1.113.703-.726 0-1.18-.329-1.282-1.19h4.074c.023-.136.034-.25.034-.465 0-2.301-1.339-3.06-2.86-3.06-1.577 0-3.007.838-3.007 3.037 0 2.29 1.543 3.083 3.007 3.083M57.99 5.076c.114-.68.5-1.043 1.192-1.043.851 0 1.112.533 1.146 1.043zm8.005 3.638c.352 0 .692-.045.976-.124V7.218c-.26.023-.363.023-.488.023-.601 0-.715-.329-.715-.737V4.18h1.158V2.74h-1.158V1.2h-1.86v1.54h-1.01v1.44h1.01v2.585c0 1.371.816 1.95 2.087 1.95m3.365-.08h2.1l.942-3.423.942 3.423h2.088l1.543-5.894h-1.759l-.919 4.103h-.045l-1.056-4.103h-1.6l-1.055 4.103h-.046l-.919-4.103h-1.748zm11.195.113c1.486 0 2.995-.895 2.995-3.06s-1.509-3.06-2.995-3.06c-1.499 0-2.997.895-2.997 3.06s1.498 3.06 2.996 3.06m-1.26-3.06c0-1.043.533-1.52 1.26-1.52.714 0 1.248.477 1.248 1.52s-.534 1.519-1.248 1.519c-.727 0-1.26-.476-1.26-1.52m5.461 2.948h1.86V6.164c0-1.485.875-1.904 1.692-1.904.147 0 .283.011.476.034V2.729a1.8 1.8 0 0 0-.454-.056c-.896 0-1.452.6-1.68 1.53h-.033V2.74h-1.861zm5.117 0h1.86v-1.7l.466-.5 1.76 2.2H96l-2.667-3.4 2.36-2.494h-2.03l-1.93 2.199V.7h-1.861z",fill:"#fff",fillOpacity:n}),jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.632 1.043c.046.037.02.11-.04.11H1.779c-.06 0-.087-.073-.04-.11A4.67 4.67 0 0 1 4.685 0a4.66 4.66 0 0 1 2.947 1.043M2.862 5.96a.18.18 0 0 0-.146-.078H.265a.084.084 0 0 0-.081.107 4.687 4.687 0 0 0 9.001 0 .084.084 0 0 0-.081-.107H6.653a.18.18 0 0 0-.146.078 2.22 2.22 0 0 1-1.823.948c-.753 0-1.42-.375-1.822-.948m3.471-2.77c.034.037.082.06.132.06H9.03c.058 0 .1-.057.08-.112a4.7 4.7 0 0 0-.79-1.412.17.17 0 0 0-.13-.061H1.18a.17.17 0 0 0-.13.061c-.34.417-.609.894-.79 1.412a.084.084 0 0 0 .08.111h2.564c.05 0 .098-.022.132-.06.407-.448.995-.73 1.648-.73a2.22 2.22 0 0 1 1.648.73M6.89 5.37a.066.066 0 0 1-.063-.084 2.23 2.23 0 0 0-.077-1.43.067.067 0 0 1 .06-.091h2.417c.03 0 .057.021.063.051a4.7 4.7 0 0 1 .038 1.5.064.064 0 0 1-.063.054zm-4.347-.084a.066.066 0 0 1-.063.084H.105a.064.064 0 0 1-.063-.055A4.7 4.7 0 0 1 .08 3.816a.064.064 0 0 1 .063-.051H2.56c.046 0 .078.048.06.091a2.22 2.22 0 0 0-.077 1.43",fill:"#fff",fillOpacity:n})]})});var ee=fe.forwardRef((e,t)=>{let{size:n=18,...o}=e;return jsx("svg",{width:n,height:n,viewBox:"0 0 18 18",ref:t,className:"oui-fill-success-light",xmlns:"http://www.w3.org/2000/svg",...o,children:jsx("path",{d:"M9.02092 2.92969C6.18562 2.92969 3.51037 4.13854 1.68502 6.18754C1.40947 6.49676 1.446 6.96671 1.75537 7.24218C2.0646 7.51743 2.53447 7.48143 2.81002 7.17183C4.35112 5.44196 6.6141 4.42969 9.02092 4.42969C11.4205 4.42969 13.6369 5.43123 15.185 7.17183C15.4603 7.48143 15.9301 7.51743 16.2397 7.24218C16.5492 6.96694 16.5853 6.49699 16.31 6.18754C14.4787 4.12856 11.8512 2.92969 9.02092 2.92969ZM9.02092 5.92969C7.04092 5.92969 5.20867 6.78461 3.93502 8.25019C3.6633 8.56294 3.6927 9.03318 4.00537 9.30468C4.31797 9.57618 4.7883 9.54693 5.06002 9.23418C6.05175 8.09343 7.47982 7.42968 9.02092 7.42968C10.5348 7.42968 11.9446 8.08144 12.935 9.18769C13.2113 9.49593 13.681 9.51093 13.9897 9.23418C14.2983 8.95818 14.3364 8.48793 14.06 8.17968C12.7879 6.75896 10.9659 5.92969 9.02092 5.92969ZM9.02092 8.92968C7.91917 8.92968 6.89242 9.40218 6.18502 10.2189C5.91375 10.5317 5.94225 11.0019 6.25537 11.2734C6.56835 11.5449 7.03875 11.5164 7.31002 11.2029C7.73542 10.7124 8.3589 10.4297 9.02092 10.4297C9.6684 10.4297 10.2604 10.7072 10.685 11.1797C10.962 11.4879 11.4552 11.5037 11.7631 11.2262C12.0712 10.9494 12.087 10.4799 11.81 10.1717C11.1037 9.38643 10.0983 8.92968 9.02092 8.92968ZM8.99752 11.9297C8.81609 11.9297 8.64374 12.0047 8.50537 12.1404C8.50537 12.1404 7.3935 13.2362 6.95842 13.6637C6.52342 14.0919 6.7968 14.9319 7.49752 14.9297H9.63037H10.4975C11.1864 14.9319 11.477 14.0739 11.0366 13.6404C10.5961 13.2069 9.51322 12.1404 9.51314 12.1404C9.37469 12.0047 9.17894 11.9297 8.99752 11.9297Z"})})});ee.displayName="SignalIcon";var ve=e=>{let{size:t=20,viewBox:n,...o}=e;return jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:`${t}px`,height:`${t}px`,fill:"none",viewBox:"0 0 20 20",...o,children:jsx("path",{d:"M10.012 1.66602C5.40954 1.66602 1.67871 5.39685 1.67871 9.99935C1.67871 14.6018 5.40954 18.3327 10.012 18.3327C14.6145 18.3327 18.3454 14.6018 18.3454 9.99935C18.3454 5.39685 14.6145 1.66602 10.012 1.66602ZM10.012 5.83268C10.472 5.83268 10.8454 6.20602 10.8454 6.66602V10.8327C10.8454 11.2927 10.472 11.666 10.012 11.666C9.55204 11.666 9.17871 11.2927 9.17871 10.8327V6.66602C9.17871 6.20602 9.55204 5.83268 10.012 5.83268ZM10.012 12.4993C10.472 12.4993 10.8454 12.8727 10.8454 13.3327C10.8454 13.7927 10.472 14.166 10.012 14.166C9.55204 14.166 9.17871 13.7927 9.17871 13.3327C9.17871 12.8727 9.55204 12.4993 10.012 12.4993Z",fill:"#FF7D00"})})};var xe=e=>{let{size:t=16,viewBox:n,...o}=e;return jsx("svg",{width:`${t}px`,height:`${t}px`,viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",...o,children:jsx("path",{d:"M3.32972 2.60449C3.15912 2.60449 2.98072 2.66183 2.85052 2.79183C2.59019 3.0525 2.59019 3.48982 2.85052 3.75049L7.03806 7.93782L2.85052 12.1252C2.59019 12.3858 2.59019 12.8232 2.85052 13.0838C3.11092 13.3438 3.54852 13.3438 3.80892 13.0838L7.99639 8.89649L12.1839 13.0838C12.4443 13.3438 12.8819 13.3438 13.1423 13.0838C13.4026 12.8232 13.4026 12.3858 13.1423 12.1252L8.95472 7.93782L13.1423 3.75049C13.4026 3.48982 13.4026 3.0525 13.1423 2.79183C13.0121 2.66183 12.8336 2.60449 12.6631 2.60449C12.4925 2.60449 12.3141 2.66183 12.1839 2.79183L7.99639 6.97916L3.80892 2.79183C3.67872 2.66183 3.50032 2.60449 3.32972 2.60449Z",fill:"currentColor"})})};var we=e=>{let t=useMemo(()=>{switch(e.wsStatus){case WsNetworkStatus.Connected:return "oui-fill-success-light oui-text-success-light";case WsNetworkStatus.Disconnected:return "oui-fill-danger-light oui-text-danger-light";case WsNetworkStatus.Unstable:return "oui-fill-warning-light oui-text-warning-light"}},[e.wsStatus]),n=o=>{window.open(o,"_blank");};return jsxs(Flex,{direction:"row",justify:"between",height:29,px:3,className:"oui-hidden lg:oui-flex oui-bg-base-9 oui-border-t-2 oui-border-line-6",children:[jsxs(Flex,{children:[jsxs(Flex,{direction:"row",itemAlign:"center",gap:1,className:t,children:[jsx(ee,{fillOpacity:1,fill:"currentColor"}),jsx(Text,{size:"2xs",children:"Operational"})]}),jsx(Divider,{direction:"vertical",className:"oui-h-[18px] oui-px-1 oui-ml-2 oui-border-line-12"}),jsxs(Flex,{gap:2,children:[jsx(Text,{intensity:54,size:"2xs",children:"Join our community"}),jsxs(Flex,{direction:"row",gap:1,children:[typeof e.config?.telegramUrl<"u"&&jsx(Q,{className:"oui-fill-white/[.54] hover:oui-fill-white/[.98] oui-cursor-pointer",fill:"currentColor",fillOpacity:1,onClick:o=>n(e.config?.telegramUrl)}),typeof e.config?.discordmUrl<"u"&&jsx(Y,{className:"oui-fill-white/[.54] hover:oui-fill-white/[.98] oui-cursor-pointer",fill:"currentColor",fillOpacity:1,onClick:o=>n(e.config?.discordmUrl)}),typeof e.config?.twitterUrl<"u"&&jsx(j,{className:"oui-fill-white/[.54] hover:oui-fill-white/[.98] oui-cursor-pointer",fill:"currentColor",fillOpacity:1,onClick:o=>n(e.config?.twitterUrl)})]})]})]}),jsxs(Flex,{direction:"row",gap:1,children:[jsx(Text,{intensity:54,size:"2xs",children:"Powered by"}),jsx(he,{})]})]})};var nt=()=>{let e=useWsStatus(),{footerConfig:t}=I();return {wsStatus:e,config:t}};var ye=()=>{let e=nt();return jsx(we,{...e})};var Ne=e=>{if(useMediaQuery(MEDIA_TABLET))return jsx(Fragment,{});let{showTips:n,showDialog:o,tipsContent:a,closeTips:s,dialogContent:c}=e;return o?jsx(Dialog,{open:!0,children:jsxs(DialogContent,{closable:!1,children:[jsx(DialogHeader,{children:jsx(DialogTitle,{children:"System upgrade in progress"})}),jsx(Divider,{}),jsx(DialogBody,{children:c})]})}):n?jsxs(Flex,{className:cn("oui-w-full oui-bg-warning/10 oui-text-warning oui-text-sm oui-relative oui-gap-1 oui-pl-4 oui-pr-[60px] oui-py-3","oui-min-h-[48px]","oui-justify-start oui-items-start","xl:oui-justify-center xl:oui-items-center xl:oui-px-4"),children:[jsx(ve,{size:20,className:"oui-flex-shrink-0 oui-w-5 oui-h-5 "}),jsx(Box,{className:"oui-font-semibold ",children:a}),jsx(xe,{size:16,className:"oui-absolute oui-right-4 oui-text-secondary/[0.36] hover:oui-text-secondary/80 oui-cursor-pointer -oui-translate-y-2/4 oui-top-2/4",onClick:s})]}):jsx(Fragment,{})};function ut(e){let t=format(new UTCDateMini(e),"MMM dd");return `${format(new UTCDateMini(e),"h:mm aa")} (UTC) on ${t}`}var xn=1e3*60*60*24,mt=()=>{let[e,t]=useState(!1),[n,o]=useState(!1),{startTime:a,endTime:s,status:c,brokerName:d}=useMaintenanceStatus(),g=useMemo(()=>a?ut(a):"-",[a]),w=useMemo(()=>s?ut(s):"-",[s]),u=()=>{window.localStorage.setItem(`Maintenance_${a}`,"1"),t(!1);};useEffect(()=>{if(c===2){t(!1),o(!0);return}o(!1),a&&a<getTimestamp()+xn&&(window.localStorage.getItem(`Maintenance_${a}`)||t(!0));},[a,c]);let f=`${d} will be temporarily unavailable for a scheduled upgrade from ${g} to ${w}.`,b=`Sorry, ${d} is temporarily unavailable due to a scheduled upgrade. The service is expected to be back by ${w}.`;return {tipsContent:f,showTips:e,closeTips:u,showDialog:n,dialogContent:b}};var Me=()=>{let e=mt();return jsx(Ne,{...e})};function dt(e,t){return typeof e=="string"&&(e=parseInt(e)),t.some(n=>n.network_infos.chain_id===e)}var Sn=e=>{let{classNames:t,footerConfig:n,routerAdapter:o}=e,[a,s]=useLocalStorage("orderly_scaffold_expanded",!0),[c]=useChains(),d=useMemo(()=>e.maxWidth||185,[]),{networkId:g}=useContext(OrderlyContext),w=b=>dt(b,g==="testnet"?c.testnet:c.mainnet),u=b=>{s(b);},f=e.footerHeight!==void 0?e.footerHeight:29;return jsx("div",{className:"oui-flex oui-flex-col oui-overflow-auto",style:{height:`calc(100vh - ${f}px)`},children:jsxs(O.Provider,{value:{routerAdapter:o,expanded:a,setExpand:u,checkChainSupport:w,footerConfig:n},children:[jsx(Box,{className:cn("oui-hidden xl:oui-block","oui-border-b oui-border-line-12",t?.topNavbar),children:e.topBar??jsx(pe,{...e.mainNavProps})}),jsx(Me,{}),e.leftSidebar===null?jsx(Box,{className:t?.content,children:e.children}):jsxs(Grid,{className:cn("oui-box-content oui-transition-all oui-flex xl:oui-grid","oui-flex-1",t?.body),style:{gridTemplateColumns:`${a?d+"px":"98px"} 1fr`},children:[jsx("div",{className:cn(t?.leftSidebar),children:typeof e.leftSidebar<"u"?e.leftSidebar:jsx(J,{...e.leftSideProps})}),jsx(Box,{width:"100%",className:t?.content,children:e.children})]}),jsx(Box,{className:cn("oui-fixed oui-bottom-0 oui-z-50","oui-w-full",t?.footer),children:e.footer||jsx(ye,{})})]})})};
13
+ var U=e=>{let{accountState:t,onDisconnect:n,onOpenExplorer:o}=e;if(t.status<=AccountStatusEnum.NotConnected||t.validating)return jsx(Button,{"data-testid":"oui-testid-nav-bar-connectWallet-btn",size:"md",variant:"gradient",angle:45,className:"wallet-connect-button",loading:t.validating,disabled:t.validating,onClick:()=>{e.connect().then(r=>{}).catch(r=>{});},children:"Connect wallet"});if(t.status<=AccountStatusEnum.NotSignedIn)return jsx(Button,{size:"md",onClick:()=>e.onCrateAccount(),children:"Sign in"});if(t.status<=AccountStatusEnum.DisabledTrading)return jsx(Button,{size:"md",onClick:()=>{e.onCreateOrderlyKey().then(r=>{}).catch(r=>{});},children:"Enable trading"});if(t.status===AccountStatusEnum.EnableTrading)return jsx(Ft,{address:t.address,onDisconnect:n,onOpenExplorer:o})},Ft=e=>{let{address:t,onDisconnect:n}=e;return jsxs(DropdownMenuRoot,{children:[jsx(DropdownMenuTrigger,{asChild:!0,children:jsx(Button,{size:"md",variant:"gradient",angle:45,"data-testid":"oui-testid-nav-bar-address-btn",children:jsx(Text.formatted,{rule:"address",className:"oui-text-[rgba(0,0,0,.88)]",children:t})})}),jsx(DropdownMenuPortal,{children:jsxs(DropdownMenuContent,{size:"xl",align:"end",onCloseAutoFocus:o=>o.preventDefault(),style:{width:"280px"},className:"oui-py-5 oui-font-semibold",sideOffset:12,children:[jsx(DropdownMenuGroup,{children:jsxs(Flex,{px:4,children:[jsxs(Flex,{gap:2,className:"oui-flex-1",children:[jsx(EVMAvatar,{address:t,size:"md"}),jsx(Text.formatted,{rule:"address",size:"base",children:t})]}),jsxs(Flex,{gap:2,children:[jsx("button",{onClick:async()=>{await navigator.clipboard.writeText(t);},children:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",className:"oui-fill-[rgba(255,255,255,0.36)] hover:oui-fill-primary-darken",children:jsx("path",{d:"M5.249 2.243a3 3 0 0 0-3 3v4.5a3 3 0 0 0 3 3 3 3 0 0 0 3 3h4.5a3 3 0 0 0 3-3v-4.5a3 3 0 0 0-3-3 3 3 0 0 0-3-3zm7.5 4.5a1.5 1.5 0 0 1 1.5 1.5v4.5a1.5 1.5 0 0 1-1.5 1.5h-4.5a1.5 1.5 0 0 1-1.5-1.5h3a3 3 0 0 0 3-3z"})})}),jsx("button",{onClick:()=>e.onOpenExplorer(),children:jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",className:"oui-fill-[rgba(255,255,255,0.36)] hover:oui-fill-primary-darken",children:jsx("path",{d:"M12.7432 15.7432C14.3999 15.7432 15.7432 14.3999 15.7432 12.7432V5.24316C15.7432 3.58641 14.3999 2.24316 12.7432 2.24316H5.24316C3.58641 2.24316 2.24316 3.58641 2.24316 5.24316V12.7432C2.24316 14.3999 3.58641 15.7432 5.24316 15.7432H12.7432ZM6.74316 11.9932C6.55116 11.9932 6.35092 11.9287 6.20392 11.7824C5.91142 11.4892 5.91142 10.9972 6.20392 10.7039L9.20392 7.70392L7.49316 5.99316H11.9932V10.4932L10.2824 8.78241L7.28241 11.7824C7.13616 11.9287 6.93516 11.9932 6.74316 11.9932Z"})})})]})]})}),jsx(Divider,{className:"oui-mx-4 oui-my-3",intensity:8}),jsx(DropdownMenuGroup,{children:jsx(DropdownMenuItem,{size:"xl",onSelect:o=>{o.preventDefault(),n();},"data-testid":"oui-testid-nav-bar-dropDownMenuItem-disconnect",children:jsxs(Flex,{gap:2,className:"oui-text-danger-light",children:[jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.97 14.03a.75.75 0 0 1 0-1.06l.262-.263C2.594 12.354 1.5 11.108 1.5 9.06c0-2.447 1.563-3.75 3.75-3.75H6a.75.75 0 0 1 0 1.5h-.75C3.837 6.81 3 7.508 3 9.06s.837 2.25 2.25 2.25h.38l1.188-1.188a.75.75 0 0 1-.068-.312v-.75c0-1.162.381-2.19 1.172-2.883.645-.565 1.512-.867 2.578-.867h1.13l1.34-1.34a.75.75 0 0 1 1.061 1.06l-9 9a.75.75 0 0 1-1.06 0m6.14-7.2L8.27 8.668c.065-.583.281-1.056.635-1.367.289-.253.684-.419 1.205-.473M7.825 12.8l3.414-3.415c-.126 2.12-1.496 3.297-3.414 3.415m7.705-6.58a.75.75 0 0 0-1.06 1.06c.508.509.53 1.202.53 1.72 0 .739-.014 1.203-.53 1.72-.165.164-.455.307-.825.405a3.8 3.8 0 0 1-.895.125H12a.75.75 0 0 0 0 1.5h.75c.31 0 .787-.045 1.28-.175.48-.127 1.065-.36 1.5-.795.97-.97.97-1.991.97-2.75v-.06c0-.51.002-1.778-.97-2.75",fill:"currentcolor"})}),jsx("span",{children:"Disconnect"})]})})})]})})]})};var Z=createContext({}),L=()=>useContext(Z);var ae=()=>{let {disconnect:e,connectedChain:t}=useWalletConnector(),{account:n,state:o}=useAccount();L();let {connectWallet:c}=useAppContext(),[a,{findByChainId:m}]=useChains(),g=async()=>{modal.show(WalletConnectorModalId).then(s=>{},s=>{});},b=async()=>{modal.show(WalletConnectorModalId).then(s=>{},s=>{});},u=()=>{n.once("validate:end",s=>{s<AccountStatusEnum.EnableTrading?y({status:s}):toast.success("Wallet connected");}),modal.show(ChainSelectorId).then(s=>{s.wrongNetwork||(o.status<AccountStatusEnum.EnableTrading?y(o):toast.success("Wallet connected"));},s=>{});},h=async()=>{let s=await c();s&&(s.wrongNetwork?u():y(s));},y=s=>{s.validating||s.status<=AccountStatusEnum.Connected||(s.status<AccountStatusEnum.SignedIn&&g(),s.status<AccountStatusEnum.EnableTrading&&b());},p=useCallback(()=>{if(!t)return;let s=m(t.id,"network_infos");if(s){let{explorer_base_url:S}=s;S&&(S.endsWith("/")?window.open(`${S}address/${n.address}`):window.open(`${S}/address/${n.address}`));}},[o,t]);return {address:o.address,accountState:o,connect:h,onCrateAccount:g,onCreateOrderlyKey:b,onOpenExplorer:p,onDisconnect:async()=>{await e({label:o.connectWallet?.name}),await n.disconnect();}}};var Be=()=>{let e=ae();return jsx(U,{...e})};installExtension({name:"account-menu",scope:["*"],positions:[ExtensionPositionEnum.AccountMenu],builder:ae,__isInternal:!0})(e=>jsx(U,{...e}));var Ee=()=>jsx(ExtensionSlot,{position:ExtensionPositionEnum.AccountMenu});var Re=e=>{let{active:t,item:n,onClick:o}=e;return jsx(Button,{variant:t?"gradient":"text",color:"secondary",size:"sm",angle:45,className:cn$1(t?"oui-text-[rgba(0_,_0_,_0_,_0.88)]":"hover:oui-bg-base-7"),onClick:()=>{o?.(n);},children:n.name})};var le=e=>{let{items:t,onItemClick:n,current:o,className:r}=e,c=useMemo(()=>typeof o<"u"?o:t?.[0]?.href,[o,t]);return !Array.isArray(t)||t.length===0?null:jsx(Flex,{gap:0,border:!0,r:"md",className:cn$1("oui-p-[1px]",r),borderColor:12,children:t?.map((a,m)=>jsx(Re,{item:a,onClick:n,active:c==a.href},m))})};var me=e=>{let{type:t,...n}=e,o;switch(e.type){case"freeCollateral":o=jsx(Qt,{freeCollateral:e.freeCollateral,visible:e.visible,onToggleVisibility:e.onToggleVisibility});break;case"unrealPnL":o=jsx(eo,{unrealPnL:e.unrealPnL,unrealized_pnl_ROI:e.unrealized_pnl_ROI,visible:e.visible,onToggleVisibility:e.onToggleVisibility});break;case"currentLeverage":o=jsx(Yt,{currentLeverage:e.currentLeverage});break;case"maxLeverage":o=jsx(jt,{maxLeverage:e.maxLeverage});break;case"totalValue":default:o=jsx(Jt,{totalValue:e.totalValue,onToggleVisibility:e.onToggleVisibility,visible:e.visible});}return jsx(Popover,{content:jsx(to,{totalValue:n.totalValue,freeCollateral:e.freeCollateral,maxLeverage:e.maxLeverage,currentLeverage:e.currentLeverage,unrealized_pnl_ROI:e.unrealized_pnl_ROI,unrealPnL:e.unrealPnL,type:e.type,onTypeChange:e.onTypeChange,visible:e.visible}),contentProps:{onOpenAutoFocus:r=>r.preventDefault(),sideOffset:12},arrow:!0,children:jsx("div",{className:"oui-cursor-pointer",children:o})})},Jt=e=>{let{totalValue:t=0,visible:n=!0,onToggleVisibility:o}=e;return jsxs(Flex,{direction:"column",gap:0,className:"oui-text-2xs",itemAlign:"start",children:[jsxs(Flex,{gap:1,itemAlign:"center",children:[jsx(Text,{intensity:54,className:"oui-whitespace-nowrap",children:"Total Value"}),jsx("button",{onClick:()=>o?.(),children:n?jsx(EyeIcon,{size:12,className:"oui-text-primary-light",opacity:1}):jsx(EyeCloseIcon,{size:12,className:"oui-text-primary-light",opacity:1})}),jsx(Text,{intensity:54,children:"\u2248"})]}),jsx(Text.numeral,{visible:e.visible,unit:"USDC",unitClassName:"oui-text-base-contrast-20 oui-ml-1",as:"div",children:t??"-"})]})},Qt=e=>{let{freeCollateral:t,visible:n,onToggleVisibility:o}=e;return jsxs(Flex,{direction:"column",gap:0,className:"oui-text-2xs",itemAlign:"start",children:[jsxs(Flex,{gap:1,itemAlign:"center",children:[jsx(Text,{intensity:54,className:"oui-whitespace-nowrap",children:"Free collateral"}),jsx("button",{onClick:()=>o?.(),children:n?jsx(EyeIcon,{size:12,className:"oui-text-primary-light",opacity:1}):jsx(EyeCloseIcon,{size:12,className:"oui-text-primary-light",opacity:1})})]}),jsx(Text.numeral,{unit:"USDC",unitClassName:"oui-text-base-contrast-20 oui-ml-1",visible:n,as:"div",children:t??"-"})]})},Yt=e=>{let{currentLeverage:t}=e;return jsxs(Flex,{direction:"column",gap:0,className:"oui-text-2xs",itemAlign:"start",children:[jsx(Box,{children:jsx(Text,{intensity:54,className:"oui-whitespace-nowrap",children:"Current leverage"})}),jsx(Text.numeral,{as:"div",unit:"x",children:t??0})]})},jt=e=>jsxs(Flex,{direction:"column",gap:0,className:"oui-text-2xs",itemAlign:"start",children:[jsx(Box,{children:jsx(Text,{intensity:54,className:"oui-whitespace-nowrap",children:"Max leverage"})}),jsx(Text,{color:"primary",as:"div",children:`${e.maxLeverage??"--"}x`})]}),eo=e=>{let{visible:t,onToggleVisibility:n}=e;return jsxs(Flex,{direction:"column",gap:0,className:"oui-text-2xs",itemAlign:"start",children:[jsxs(Flex,{gap:1,itemAlign:"center",children:[jsx(Text,{intensity:54,className:"oui-whitespace-nowrap",children:"Unreal. PnL"}),jsx("button",{onClick:()=>n?.(),children:t?jsx(EyeIcon,{size:12,className:"oui-text-primary-light",opacity:1}):jsx(EyeCloseIcon,{size:12,className:"oui-text-primary-light",opacity:1})})]}),jsx(Text.numeral,{as:"div",coloring:!0,showIdentifier:!0,weight:"semibold",visible:t,suffix:jsx(Text.numeral,{coloring:!0,prefix:"(",suffix:")",rule:"percentages",children:e.unrealized_pnl_ROI??"-"}),children:e.unrealPnL??"-"})]})},to=e=>{let{totalValue:t}=e;return jsxs(Flex,{className:"oui-text-2xs oui-font-semibold",direction:"column",gapY:1,children:[jsxs(Flex,{justify:"between",width:"100%",children:[jsxs(Flex,{className:"oui-text-base-contrast-54",gapX:2,children:[jsx(W,{active:e.type==="totalValue",onClick:()=>e.onTypeChange("totalValue")}),jsx("span",{children:"Total Value"})]}),jsx(Text.numeral,{visible:e.visible,unit:"USDC",unitClassName:"oui-text-base-contrast-36 oui-ml-1",children:t??"-"})]}),jsxs(Flex,{justify:"between",width:"100%",children:[jsxs(Flex,{className:"oui-text-base-contrast-54",gapX:2,children:[jsx(W,{active:e.type==="freeCollateral",onClick:()=>e.onTypeChange("freeCollateral")}),jsx("span",{children:"Free collateral"})]}),jsx(Text.numeral,{unit:"USDC",visible:e.visible,unitClassName:"oui-text-base-contrast-36 oui-ml-1",children:e.freeCollateral??"-"})]}),jsxs(Flex,{justify:"between",width:"100%",children:[jsxs(Flex,{className:"oui-text-base-contrast-54",gapX:2,children:[jsx(W,{active:e.type==="unrealPnL",onClick:()=>e.onTypeChange("unrealPnL")}),jsx("span",{children:"Unreal. PnL"})]}),jsx(Text.numeral,{coloring:!0,showIdentifier:!0,visible:e.visible,suffix:jsx(Text.numeral,{coloring:!0,prefix:"(",visible:e.visible,suffix:")",rule:"percentages",children:e.unrealized_pnl_ROI??"-"}),children:e.unrealPnL??"-"})]}),jsxs(Flex,{justify:"between",width:"100%",children:[jsxs(Flex,{className:"oui-text-base-contrast-54",gapX:2,children:[jsx(W,{active:e.type==="currentLeverage",onClick:()=>e.onTypeChange("currentLeverage")}),jsx("span",{children:"Current leverage"})]}),jsx(Text.numeral,{unit:"x",children:e.currentLeverage??"-"})]}),jsxs(Flex,{justify:"between",width:"100%",children:[jsxs(Flex,{className:"oui-text-base-contrast-54",gapX:2,children:[jsx(W,{active:e.type==="maxLeverage",onClick:()=>e.onTypeChange("maxLeverage")}),jsx("span",{children:"Max leverage"})]}),jsx(Text,{color:"primary",children:`${e.maxLeverage??"-"}x`})]})]})},W=e=>jsx("button",{onClick:e.onClick,children:e.active?jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:jsx("path",{d:"M7.506.977a.56.56 0 0 0-.365.16C6.367 1.88 6.13 2.5 6.413 3.348c-.661.506-1.078.63-1.903.63-1.127 0-1.863.137-2.364.637v.016a1.187 1.187 0 0 0 0 1.686l1.4 1.411-2.385 2.385a.513.513 0 0 0-.015.717.514.514 0 0 0 .719 0l2.394-2.395 1.403 1.396a1.19 1.19 0 0 0 1.687 0h.016c.501-.5.64-1.142.64-2.358 0-.773.16-1.319.64-1.893.924.271 1.462.012 2.22-.746a.5.5 0 0 0 .14-.36c0-.175-.044-.445-.156-.78a4 4 0 0 0-.984-1.577 4 4 0 0 0-1.578-.984C7.95 1.02 7.682.977 7.506.977",fill:"currentcolor",className:"oui-text-primary-light"})}):jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:jsx("path",{d:"M7.506.977a.56.56 0 0 0-.365.16C6.367 1.88 6.13 2.5 6.413 3.348c-.661.506-1.078.63-1.903.63-1.127 0-1.863.137-2.364.637v.016a1.187 1.187 0 0 0 0 1.686l1.4 1.411-2.385 2.385a.513.513 0 0 0-.015.717.514.514 0 0 0 .719 0l2.394-2.395 1.403 1.396a1.19 1.19 0 0 0 1.687 0h.016c.501-.5.64-1.142.64-2.358 0-.773.16-1.319.64-1.893.924.271 1.462.012 2.22-.746a.5.5 0 0 0 .14-.36c0-.175-.044-.445-.156-.78a4 4 0 0 0-.984-1.577 4 4 0 0 0-1.578-.984C7.95 1.02 7.682.977 7.506.977m.193 1.027c.531.098 1.066.45 1.447.83.381.382.706.848.84 1.459-.477.458-.77.494-1.247.243a.5.5 0 0 0-.583.087c-.91.91-1.15 1.736-1.15 2.85 0 .97-.057 1.33-.36 1.655-.085.092-.203.078-.281 0L2.849 5.615a.18.18 0 0 1-.012-.255c.178-.217.576-.386 1.669-.386 1.306.001 2-.335 2.859-1.14a.5.5 0 0 0 .094-.578c-.257-.513-.217-.784.24-1.252",fill:"currentcolor"})})});var ze=()=>{let[e,t]=useLocalStorage("accountSummaryType","totalValue"),{freeCollateral:n,totalValue:o}=useCollateral({dp:2}),{state:r}=useAccount(),[c,a]=useLocalStorage("orderly_assets_visible",!0),[{aggregated:m,totalUnrealizedROI:g}]=usePositionStream(),{wrongNetwork:b}=useAppContext(),{currentLeverage:u}=useMarginRatio(),[h]=useLeverage(),y=s=>{t(s);},p=b||r.status<AccountStatusEnum.EnableTrading;return {totalValue:p?null:o,freeCollateral:p?null:n,maxLeverage:p?null:h,currentLeverage:p?null:u,unrealPnL:p?null:m?.total_unreal_pnl,unrealized_pnl_ROI:p?null:g,type:e,onTypeChange:y,visible:c,wrongNetwork:b,onToggleVisibility:()=>a(!c)}};var $=()=>{let e=ze();return jsx(me,{...e})};var K=e=>e.wrongNetwork&&e.isConnected?jsx(Tooltip,{open:!0,content:"Please switch to a supported network to continue.",className:"oui-bg-base-5",arrow:{className:"oui-fill-base-5"},children:jsx(Button,{color:"warning",size:"md",onClick:()=>{modal.show(ChainSelectorId,{networkId:e.networkId}).then(t=>{!t.wrongNetwork&&e.accountStatus<AccountStatusEnum.EnableTrading&&modal.show(WalletConnectorModalId).then(n=>{},n=>{});},t=>{});},children:"Wrong network"})}):jsx(Flex,{justify:"center",children:jsx(Select.chains,{chains:e.chains,size:"md",value:e.currentChainId,variant:"contained",onChange:e.onChange})});var Oe=()=>{let[e]=useChains(),{state:t}=useAccount(),{setChain:n,connectedChain:o}=useWalletConnector(),{wrongNetwork:r,onChainChanged:c,currentChainId:a,setCurrentChainId:m}=useAppContext(),g=useConfig("networkId");useEffect(()=>{if(o)m(typeof o.id=="number"?o.id:parseInt(o.id));else {if(a)return;let u=g==="mainnet"?e.mainnet?.[0]?.network_infos:e.testnet?.[0]?.network_infos;if(!u)return;m(u.chain_id);}},[o,e,a,g]);let b=async u=>{if(m(u.id),o){if(!await n({chainId:u.id}))return;c?.(u.id,{isTestnet:u.isTestnet,isWalletConnected:!0});}else c?.(u.id,{isTestnet:u.isTestnet,isWalletConnected:!1});};return {chains:{mainnet:e.mainnet.map(u=>({name:u.network_infos.name,id:u.network_infos.chain_id,lowestFee:u.network_infos.bridgeless,isTestnet:!1})),testnet:e.testnet.map(u=>({name:u.network_infos.name,id:u.network_infos.chain_id,lowestFee:u.network_infos.bridgeless,isTestnet:!0}))},currentChainId:a,onChange:b,isConnected:!!o,wrongNetwork:r,accountStatus:t.status,networkId:g}};var q=()=>{let e=Oe();return jsx(K,{...e})};var de=(o=>(o.menuLeading="menuLeading",o.menuTailing="menuTailing",o.navTailing="navTailing",o))(de||{}),Ue=e=>{let{onItemClick:t,campaignPosition:n="navTailing"}=e,{routerAdapter:o}=L(),{connectedChain:r}=useWalletConnector(),{wrongNetwork:c}=useAppContext(),[a,m]=useState(()=>typeof e.initialMenu>"u"?[]:Array.isArray(e.initialMenu)?e.initialMenu:[e.initialMenu]),[g,b]=useState(()=>e?.initialProduct??e?.products?.[0].href??""),u=p=>s=>{let S=s[s.length-1];if(!S)return;S.target!=="_blank"&&m(s.map(Nt=>Nt.href));let P=s[s.length-1],Te={href:P.href,name:P.name,scope:p,target:P.target};if(typeof t=="function"){t(Te);return}o?.onRouteChange(Te);},h=useMemo(()=>{let p={logo:{},mainMenus:[],products:[],...e,campaignPosition:n};return e.campaigns&&(n==="menuTailing"?p.mainMenus=[...p.mainMenus,e.campaigns]:n==="menuLeading"?p.mainMenus=[e.campaigns,...p.mainMenus]:p.campaigns=e.campaigns),p},[e]),y={};return h.products&&h.products.length&&(y.products={items:h.products,current:g,onItemClick:p=>{let s={href:p.href,name:p.name,scope:"product"};if(typeof t=="function"){t(s);return}o?.onRouteChange(s);}}),h.mainMenus&&h.mainMenus.length&&(y.mainMenus={items:h.mainMenus,current:a,onItemClick:u("mainMenu")}),h.campaigns&&h.campaigns.children?.length&&(y.campaigns={item:h.campaigns,current:a,onItemClick:u("campaign")}),{...h,isConnected:!!r,wrongNetwork:c,...y}};var Q=e=>{let{classNames:t,currentPath:n,item:o,onClick:r,...c}=e,a=useMemo(()=>e.currentPath?.[0]===e.item.href,[n]),m=useCallback(()=>{Array.isArray(e.item.children)||e.onClick?.([e.item]);},[e.item]),g=jsxs("button",{id:o.id,"data-testid":o.testid,...c,disabled:e.item.disabled,"data-actived":a,className:cn$1("oui-text-base-contrast-36 oui-text-sm oui-relative oui-group oui-rounded oui-px-3 oui-py-1 oui-h-[32px] hover:oui-bg-base-7",t?.navItem),onClick:m,children:[jsxs("span",{className:"oui-flex oui-items-center",children:[jsx(Ke,{isActive:a,item:e.item}),jsx(Text.gradient,{color:a?"brand":"inherit",angle:45,children:e.item.name}),Array.isArray(e.item.children)&&jsx("span",{className:"oui-ml-1 group-data-[open=true]:oui-rotate-180",children:a?jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("path",{d:"M2.913 4.515a.5.5 0 0 0-.328.202.51.51 0 0 0 .14.701L5.722 7.41a.51.51 0 0 0 .562 0l2.995-1.992a.51.51 0 0 0 .14-.7.51.51 0 0 0-.701-.14L6.002 6.382 3.287 4.577a.5.5 0 0 0-.374-.062",fill:"url(#mainNavDropDownIcon)"}),jsx("defs",{children:jsxs("linearGradient",{id:"mainNavDropDownIcon",x1:"9.502",y1:"5.994",x2:"2.502",y2:"5.994",gradientUnits:"userSpaceOnUse",children:[jsx("stop",{stopColor:"#59B0FE"}),jsx("stop",{offset:"1",stopColor:"#26FEFE"})]})})]}):jsx(ChevronDownIcon,{size:12,color:"white"})})]}),jsx(Box,{invisible:!a,position:"absolute",bottom:0,left:"50%",height:"3px",r:"full",width:"60%",gradient:"brand",angle:45,className:"-oui-translate-x-1/2 "})]});return Array.isArray(e.item.children)?jsx(Ho,{items:e.item.children,className:t?.subMenu,current:e.currentPath?.[1],onItemClick:b=>{e.onClick?.([e.item,b]);},children:g}):g},Ho=e=>{let[t,n]=useState(!1),o=useRef(null),r=useCallback(()=>{o.current&&(clearTimeout(o.current),o.current=null);},[]),c=e.children.props.className;return jsxs(PopoverRoot,{open:t,children:[jsx(PopoverAnchor,{children:jsx("div",{className:"oui-group","data-open":t,onMouseEnter:()=>{n(!0);},onMouseLeave:()=>{o.current=setTimeout(()=>{n(!1);},150);},children:cloneElement(e.children,{className:cn$1(c,t&&"oui-bg-base-7")})})}),jsx(PopoverContent,{align:"start",onMouseEnter:r,onMouseLeave:()=>{n(!1),o.current&&clearTimeout(o.current);},className:cn$1("oui-p-1 oui-w-[260px] oui-border oui-border-line-6 oui-space-y-[2px]",e.className),children:e.items.map((a,m)=>jsx(Wo,{item:a,onClick:e.onItemClick,active:a.href===e.current},m))})]})},Wo=e=>{let{item:t}=e;return jsxs(Flex,{px:2,py:3,gapX:2,"data-active":e.active??!1,className:cn$1("hover:oui-bg-base-6 oui-cursor-pointer oui-text-base-contrast-80 oui-items-start oui-w-full oui-group data-[active=true]:oui-bg-base-5"),r:"md",onClick:()=>{e.onClick(t);},"data-testid":t.testid,children:[!!e.item.icon&&jsx("div",{className:"oui-translate-y-1 oui-relative oui-w-6 oui-h-6",children:jsx(Ke,{isActive:e.active??!1,item:e.item})}),jsxs("div",{className:"oui-flex-1",children:[jsx(Do,{item:t,isActive:e.active}),typeof t.description<"u"&&jsx(Text,{size:"2xs",as:"div",intensity:36,children:t.description})]})]})},Do=e=>{let{item:{name:t},isActive:n}=e;return jsxs(Flex,{itemAlign:"center",width:"100%",position:"relative",children:[jsxs("div",{className:"oui-flex-1 oui-flex",children:[jsx(Text.gradient,{color:n?"brand":"inherit",size:"xs",as:"div",intensity:80,weight:"semibold",children:t}),typeof e.item.tag<"u"&&jsx(zo,{item:e.item})]}),e.item.target==="_blank"&&jsx(_o,{})]})},zo=e=>jsx("div",{className:"oui-px-2 oui-py-1 oui-ml-1 oui-rounded oui-inline-flex oui-bg-gradient-to-r oui-from-[rgb(var(--oui-gradient-brand-start)_/_0.12)] oui-to-[rgb(var(--oui-gradient-brand-end)_/_0.12)]",children:jsx(Text.gradient,{color:"brand",size:"3xs",children:e.item.tag})}),Ze="oui-flex oui-border oui-border-line oui-w-6 oui-h-6 oui-rounded-md oui-justify-center oui-items-center oui-absolute oui-left-0 oui-top-0",Ke=e=>{let{item:t,isActive:n}=e;return e.item.icon?typeof e.item.icon=="string"?jsx("span",{className:"oui-w-[20px] oui-h-[20px] oui-mr-1",children:jsx("img",{src:n&&e.item.activeIcon||e.item.icon,className:"oui-max-w-full oui-max-h-full"})}):jsxs(Fragment,{children:[jsx("div",{className:cn$1(Ze,"group-data-[active=true]:oui-invisible group-hover:oui-invisible"),children:e.item.icon}),jsx("div",{className:cn$1(Ze,"oui-invisible group-data-[active=true]:oui-visible group-hover:oui-visible"),children:e.item.activeIcon||e.item.icon})]}):null},_o=()=>jsxs(Fragment,{children:[jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"oui-absolute oui-right-0 oui-top-0 group-hover:oui-invisible",children:jsx("path",{d:"M14.159 17.492a3.333 3.333 0 0 0 3.333-3.333V5.826a3.333 3.333 0 0 0-3.333-3.334H5.826a3.333 3.333 0 0 0-3.334 3.334v8.333a3.333 3.333 0 0 0 3.334 3.333zm-6.667-4.166a.85.85 0 0 1-.599-.235.86.86 0 0 1 0-1.198l3.333-3.333-1.9-1.901h5v5l-1.901-1.9L8.09 13.09a.84.84 0 0 1-.599.235",fill:"#fff",fillOpacity:".2"})}),jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"oui-absolute oui-right-0 oui-top-0 oui-invisible group-hover:oui-visible",children:[jsx("path",{d:"M14.159 17.492a3.333 3.333 0 0 0 3.333-3.333V5.826a3.333 3.333 0 0 0-3.333-3.334H5.826a3.333 3.333 0 0 0-3.334 3.334v8.333a3.333 3.333 0 0 0 3.334 3.333zm-6.667-4.166a.85.85 0 0 1-.599-.235.86.86 0 0 1 0-1.198l3.333-3.333-1.9-1.901h5v5l-1.901-1.9L8.09 13.09a.84.84 0 0 1-.599.235",fill:"url(#outlineIcon)"}),jsx("defs",{children:jsxs("linearGradient",{id:"outlineIcon",x1:"17.492",y1:"9.992",x2:"2.492",y2:"9.992",gradientUnits:"userSpaceOnUse",children:[jsx("stop",{stopColor:"#59B0FE"}),jsx("stop",{offset:"1",stopColor:"#26FEFE"})]})})]})]});var Qe=e=>jsxs(Fragment,{children:[jsx(Q,{item:e.item,style:{"--oui-gradient-angle":"188deg","--oui-gradient-primary-stop-start":"26%","--oui-gradient-primary-stop-end":"80%"},onClick:e.onItemClick,classNames:{navItem:cn$1("oui-gradient-primary oui-text-white",e.className)}}),jsx(Divider,{direction:"vertical",className:"oui-h-8",intensity:8})]});var Y=pe.forwardRef((e,t)=>{let{size:n=20,...o}=e;return jsx("svg",{width:n,height:n,viewBox:"0 0 20 20",ref:t,fill:"#fff",fillOpacity:".54",xmlns:"http://www.w3.org/2000/svg",...o,children:jsx("path",{d:"M4.108 9.464S9.645 7.13 11.565 6.31c.736-.328 3.233-1.38 3.233-1.38s1.152-.46 1.056.658c-.032.46-.288 2.069-.544 3.81-.384 2.463-.8 5.157-.8 5.157s-.064.755-.608.887c-.544.13-1.44-.46-1.6-.592-.129-.098-2.401-1.576-3.233-2.299-.224-.197-.48-.591.032-1.051a124 124 0 0 0 3.36-3.285c.384-.394.768-1.313-.832-.197-2.272 1.61-4.513 3.12-4.513 3.12s-.512.33-1.472.034-2.08-.69-2.08-.69-.768-.493.544-1.018"})})}),j=pe.forwardRef((e,t)=>{let{size:n=20,...o}=e;return jsx("svg",{width:n,height:n,viewBox:"0 0 20 20",ref:t,fill:"#fff",fillOpacity:".54",...o,xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{d:"M14.956 5.522c1.604 2.374 2.396 5.053 2.1 8.136a.05.05 0 0 1-.02.033 11.7 11.7 0 0 1-3.55 1.805.045.045 0 0 1-.05-.017 9.6 9.6 0 0 1-.725-1.188.046.046 0 0 1 .024-.063 7 7 0 0 0 1.108-.531.046.046 0 0 0 .004-.076 6 6 0 0 1-.22-.174.04.04 0 0 0-.047-.006c-2.296 1.068-4.812 1.068-7.136 0a.04.04 0 0 0-.046.006 6 6 0 0 1-.22.174.046.046 0 0 0 .005.076c.353.204.721.384 1.107.531.025.01.037.039.025.063a8.5 8.5 0 0 1-.725 1.188.05.05 0 0 1-.05.017 11.7 11.7 0 0 1-3.546-1.805.05.05 0 0 1-.018-.033c-.248-2.667.257-5.368 2.097-8.137a.04.04 0 0 1 .02-.016 11.6 11.6 0 0 1 2.89-.903.05.05 0 0 1 .046.022c.125.224.269.51.366.744a10.7 10.7 0 0 1 3.246 0 8 8 0 0 1 .36-.744.044.044 0 0 1 .046-.022 11.7 11.7 0 0 1 2.89.903q.012.005.019.017m-6.018 5.07c.011-.788-.56-1.44-1.276-1.44-.71 0-1.276.647-1.276 1.44 0 .795.576 1.442 1.276 1.442.71 0 1.276-.647 1.276-1.441m4.718 0c.011-.788-.56-1.44-1.276-1.44-.71 0-1.276.647-1.276 1.44 0 .795.577 1.442 1.276 1.442.717 0 1.276-.647 1.276-1.441"})})}),ee=pe.forwardRef((e,t)=>{let{size:n=20,...o}=e;return jsx("svg",{width:n,height:n,viewBox:"0 0 20 20",ref:t,fill:"#fff",fillOpacity:".54",xmlns:"http://www.w3.org/2000/svg",...o,children:jsx("path",{d:"m4.42 4.73 4.633 6.194-4.662 5.037H5.44l4.082-4.41 3.298 4.41h3.57l-4.893-6.543 4.34-4.689h-1.05l-3.759 4.062-3.037-4.062zm1.543.772h1.64l7.244 9.686h-1.64z"})})});ee.displayName="CommuntiyXIcon";Y.displayName="CommuntiyTelegramIcon";j.displayName="CommuntiyDiscordIcon";var ge=pe.forwardRef((e,t)=>{let{opacity:n=.54,...o}=e;return jsxs("svg",{width:96,hanging:11,ref:t,viewBox:"0 0 96 11",xmlns:"http://www.w3.org/2000/svg",...o,children:[jsx("path",{d:"M10.757 8.635h1.862V6.164c0-1.485.874-1.904 1.69-1.904.148 0 .284.011.477.034V2.729a1.8 1.8 0 0 0-.454-.056c-.896 0-1.452.6-1.68 1.53h-.033V2.74h-1.862zm7.221.113c.874 0 1.475-.464 1.634-.907v.794h1.861V.7h-1.86v2.834c-.16-.442-.761-.907-1.635-.907-1.203 0-2.565.885-2.565 3.06 0 2.188 1.362 3.061 2.565 3.061m-.817-3.06c0-1.043.624-1.52 1.282-1.52.647 0 1.249.477 1.249 1.52s-.602 1.519-1.249 1.519c-.658 0-1.282-.476-1.282-1.52m8.538 3.061c1.453 0 2.508-.748 2.78-2.108h-1.634c-.102.385-.352.703-1.112.703-.726 0-1.18-.329-1.282-1.19h4.074c.023-.136.034-.25.034-.465 0-2.301-1.34-3.06-2.86-3.06-1.578 0-3.007.838-3.007 3.037 0 2.29 1.543 3.083 3.007 3.083m-1.237-3.672c.114-.68.5-1.043 1.192-1.043.85 0 1.112.533 1.146 1.043zm5.304 3.559h1.861V6.164c0-1.485.874-1.904 1.691-1.904.148 0 .284.011.477.034V2.729a1.8 1.8 0 0 0-.454-.056c-.897 0-1.453.6-1.68 1.53h-.034V2.74h-1.861zm5.117 0h1.861V.7h-1.861zm3.481.725v1.565c1.827.192 2.588-.42 3.382-2.358L44.13 2.74h-1.906L40.93 6.265 39.67 2.74h-1.895l2.145 5.293c.148.352.159.533.034.816-.102.227-.363.669-1.589.51m9.808-.724h1.895V3.897h.045l2.86 4.738h2.043V.7h-1.907v4.863h-.045L50.136.7h-1.963zm11.054.113c1.453 0 2.508-.748 2.78-2.108h-1.633c-.102.385-.352.703-1.113.703-.726 0-1.18-.329-1.282-1.19h4.074c.023-.136.034-.25.034-.465 0-2.301-1.339-3.06-2.86-3.06-1.577 0-3.007.838-3.007 3.037 0 2.29 1.543 3.083 3.007 3.083M57.99 5.076c.114-.68.5-1.043 1.192-1.043.851 0 1.112.533 1.146 1.043zm8.005 3.638c.352 0 .692-.045.976-.124V7.218c-.26.023-.363.023-.488.023-.601 0-.715-.329-.715-.737V4.18h1.158V2.74h-1.158V1.2h-1.86v1.54h-1.01v1.44h1.01v2.585c0 1.371.816 1.95 2.087 1.95m3.365-.08h2.1l.942-3.423.942 3.423h2.088l1.543-5.894h-1.759l-.919 4.103h-.045l-1.056-4.103h-1.6l-1.055 4.103h-.046l-.919-4.103h-1.748zm11.195.113c1.486 0 2.995-.895 2.995-3.06s-1.509-3.06-2.995-3.06c-1.499 0-2.997.895-2.997 3.06s1.498 3.06 2.996 3.06m-1.26-3.06c0-1.043.533-1.52 1.26-1.52.714 0 1.248.477 1.248 1.52s-.534 1.519-1.248 1.519c-.727 0-1.26-.476-1.26-1.52m5.461 2.948h1.86V6.164c0-1.485.875-1.904 1.692-1.904.147 0 .283.011.476.034V2.729a1.8 1.8 0 0 0-.454-.056c-.896 0-1.452.6-1.68 1.53h-.033V2.74h-1.861zm5.117 0h1.86v-1.7l.466-.5 1.76 2.2H96l-2.667-3.4 2.36-2.494h-2.03l-1.93 2.199V.7h-1.861z",fill:"#fff",fillOpacity:n}),jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.632 1.043c.046.037.02.11-.04.11H1.779c-.06 0-.087-.073-.04-.11A4.67 4.67 0 0 1 4.685 0a4.66 4.66 0 0 1 2.947 1.043M2.862 5.96a.18.18 0 0 0-.146-.078H.265a.084.084 0 0 0-.081.107 4.687 4.687 0 0 0 9.001 0 .084.084 0 0 0-.081-.107H6.653a.18.18 0 0 0-.146.078 2.22 2.22 0 0 1-1.823.948c-.753 0-1.42-.375-1.822-.948m3.471-2.77c.034.037.082.06.132.06H9.03c.058 0 .1-.057.08-.112a4.7 4.7 0 0 0-.79-1.412.17.17 0 0 0-.13-.061H1.18a.17.17 0 0 0-.13.061c-.34.417-.609.894-.79 1.412a.084.084 0 0 0 .08.111h2.564c.05 0 .098-.022.132-.06.407-.448.995-.73 1.648-.73a2.22 2.22 0 0 1 1.648.73M6.89 5.37a.066.066 0 0 1-.063-.084 2.23 2.23 0 0 0-.077-1.43.067.067 0 0 1 .06-.091h2.417c.03 0 .057.021.063.051a4.7 4.7 0 0 1 .038 1.5.064.064 0 0 1-.063.054zm-4.347-.084a.066.066 0 0 1-.063.084H.105a.064.064 0 0 1-.063-.055A4.7 4.7 0 0 1 .08 3.816a.064.064 0 0 1 .063-.051H2.56c.046 0 .078.048.06.091a2.22 2.22 0 0 0-.077 1.43",fill:"#fff",fillOpacity:n})]})});var te=pe.forwardRef((e,t)=>{let{size:n=18,...o}=e;return jsx("svg",{width:n,height:n,viewBox:"0 0 18 18",ref:t,className:"oui-fill-success-light",xmlns:"http://www.w3.org/2000/svg",...o,children:jsx("path",{d:"M9.02092 2.92969C6.18562 2.92969 3.51037 4.13854 1.68502 6.18754C1.40947 6.49676 1.446 6.96671 1.75537 7.24218C2.0646 7.51743 2.53447 7.48143 2.81002 7.17183C4.35112 5.44196 6.6141 4.42969 9.02092 4.42969C11.4205 4.42969 13.6369 5.43123 15.185 7.17183C15.4603 7.48143 15.9301 7.51743 16.2397 7.24218C16.5492 6.96694 16.5853 6.49699 16.31 6.18754C14.4787 4.12856 11.8512 2.92969 9.02092 2.92969ZM9.02092 5.92969C7.04092 5.92969 5.20867 6.78461 3.93502 8.25019C3.6633 8.56294 3.6927 9.03318 4.00537 9.30468C4.31797 9.57618 4.7883 9.54693 5.06002 9.23418C6.05175 8.09343 7.47982 7.42968 9.02092 7.42968C10.5348 7.42968 11.9446 8.08144 12.935 9.18769C13.2113 9.49593 13.681 9.51093 13.9897 9.23418C14.2983 8.95818 14.3364 8.48793 14.06 8.17968C12.7879 6.75896 10.9659 5.92969 9.02092 5.92969ZM9.02092 8.92968C7.91917 8.92968 6.89242 9.40218 6.18502 10.2189C5.91375 10.5317 5.94225 11.0019 6.25537 11.2734C6.56835 11.5449 7.03875 11.5164 7.31002 11.2029C7.73542 10.7124 8.3589 10.4297 9.02092 10.4297C9.6684 10.4297 10.2604 10.7072 10.685 11.1797C10.962 11.4879 11.4552 11.5037 11.7631 11.2262C12.0712 10.9494 12.087 10.4799 11.81 10.1717C11.1037 9.38643 10.0983 8.92968 9.02092 8.92968ZM8.99752 11.9297C8.81609 11.9297 8.64374 12.0047 8.50537 12.1404C8.50537 12.1404 7.3935 13.2362 6.95842 13.6637C6.52342 14.0919 6.7968 14.9319 7.49752 14.9297H9.63037H10.4975C11.1864 14.9319 11.477 14.0739 11.0366 13.6404C10.5961 13.2069 9.51322 12.1404 9.51314 12.1404C9.37469 12.0047 9.17894 11.9297 8.99752 11.9297Z"})})});te.displayName="SignalIcon";var fe=e=>{let{size:t=20,viewBox:n,...o}=e;return jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:`${t}px`,height:`${t}px`,fill:"none",viewBox:"0 0 20 20",...o,children:jsx("path",{d:"M10.012 1.66602C5.40954 1.66602 1.67871 5.39685 1.67871 9.99935C1.67871 14.6018 5.40954 18.3327 10.012 18.3327C14.6145 18.3327 18.3454 14.6018 18.3454 9.99935C18.3454 5.39685 14.6145 1.66602 10.012 1.66602ZM10.012 5.83268C10.472 5.83268 10.8454 6.20602 10.8454 6.66602V10.8327C10.8454 11.2927 10.472 11.666 10.012 11.666C9.55204 11.666 9.17871 11.2927 9.17871 10.8327V6.66602C9.17871 6.20602 9.55204 5.83268 10.012 5.83268ZM10.012 12.4993C10.472 12.4993 10.8454 12.8727 10.8454 13.3327C10.8454 13.7927 10.472 14.166 10.012 14.166C9.55204 14.166 9.17871 13.7927 9.17871 13.3327C9.17871 12.8727 9.55204 12.4993 10.012 12.4993Z",fill:"#FF7D00"})})};var he=e=>{let{size:t=16,viewBox:n,...o}=e;return jsx("svg",{width:`${t}px`,height:`${t}px`,viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",...o,children:jsx("path",{d:"M3.32972 2.60449C3.15912 2.60449 2.98072 2.66183 2.85052 2.79183C2.59019 3.0525 2.59019 3.48982 2.85052 3.75049L7.03806 7.93782L2.85052 12.1252C2.59019 12.3858 2.59019 12.8232 2.85052 13.0838C3.11092 13.3438 3.54852 13.3438 3.80892 13.0838L7.99639 8.89649L12.1839 13.0838C12.4443 13.3438 12.8819 13.3438 13.1423 13.0838C13.4026 12.8232 13.4026 12.3858 13.1423 12.1252L8.95472 7.93782L13.1423 3.75049C13.4026 3.48982 13.4026 3.0525 13.1423 2.79183C13.0121 2.66183 12.8336 2.60449 12.6631 2.60449C12.4925 2.60449 12.3141 2.66183 12.1839 2.79183L7.99639 6.97916L3.80892 2.79183C3.67872 2.66183 3.50032 2.60449 3.32972 2.60449Z",fill:"currentColor"})})};var Ce=e=>jsxs("svg",{width:"200",height:"24",viewBox:"0 0 200 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[jsx("path",{d:"M22.2637 18.5152H26.1444V13.3629C26.1444 10.2669 27.9664 9.39239 29.6701 9.39239C29.9777 9.39239 30.2617 9.41602 30.6639 9.46329V6.20176C30.2853 6.10722 29.9777 6.08359 29.7174 6.08359C27.8481 6.08359 26.6886 7.3362 26.2153 9.27421H26.1444V6.22539H22.2637V18.5152Z",fill:"white"}),jsx("path",{d:"M37.3191 18.7516C39.1411 18.7516 40.3952 17.7826 40.7265 16.8608V18.5152H44.6072V1.97122H40.7265V7.87979C40.3952 6.95806 39.1411 5.98905 37.3191 5.98905C34.8108 5.98905 31.9713 7.83252 31.9713 12.3703C31.9713 16.9317 34.8108 18.7516 37.3191 18.7516ZM35.6153 12.3703C35.6153 10.196 36.9168 9.20331 38.2892 9.20331C39.638 9.20331 40.8921 10.196 40.8921 12.3703C40.8921 14.5447 39.638 15.5373 38.2892 15.5373C36.9168 15.5373 35.6153 14.5447 35.6153 12.3703Z",fill:"white"}),jsx("path",{d:"M53.418 18.7516C56.4468 18.7516 58.6475 17.1917 59.2154 14.3556H55.8079C55.595 15.1592 55.0744 15.8209 53.489 15.8209C51.9746 15.8209 51.0281 15.1355 50.8151 13.3393H59.31C59.3573 13.0557 59.381 12.8194 59.381 12.3703C59.381 7.57255 56.5888 5.98905 53.418 5.98905C50.1289 5.98905 47.1474 7.73799 47.1474 12.323C47.1474 17.0972 50.3655 18.7516 53.418 18.7516ZM50.8388 11.0941C51.0754 9.676 51.8799 8.9197 53.3234 8.9197C55.0981 8.9197 55.6423 10.0305 55.7133 11.0941H50.8388Z",fill:"white"}),jsx("path",{d:"M61.8978 18.5152H65.7784V13.3629C65.7784 10.2669 67.6005 9.39239 69.3042 9.39239C69.6118 9.39239 69.8957 9.41602 70.298 9.46329V6.20176C69.9194 6.10722 69.6118 6.08359 69.3515 6.08359C67.4821 6.08359 66.3227 7.3362 65.8494 9.27421H65.7784V6.22539H61.8978V18.5152Z",fill:"white"}),jsx("path",{d:"M72.5672 18.5152H76.4479V1.97122H72.5672V18.5152Z",fill:"white"}),jsx("path",{d:"M79.8261 20.0278V23.2893C83.6358 23.6911 85.2212 22.4149 86.8776 18.3734L91.8468 6.22539H87.8714L85.1739 13.5757L82.5473 6.22539H78.5957L83.0679 17.2626C83.3755 17.9953 83.3992 18.3734 83.1389 18.9643C82.9259 19.437 82.3817 20.3587 79.8261 20.0278Z",fill:"white"}),jsx("path",{d:"M100.278 18.5152H104.229V8.63609H104.324L110.287 18.5152H114.546V1.97122H110.571V12.1103H110.476L104.371 1.97122H100.278V18.5152Z",fill:"white"}),jsx("path",{d:"M123.327 18.7516C126.356 18.7516 128.557 17.1917 129.125 14.3556H125.717C125.504 15.1592 124.984 15.8209 123.398 15.8209C121.884 15.8209 120.937 15.1355 120.724 13.3393H129.219C129.267 13.0557 129.29 12.8194 129.29 12.3703C129.29 7.57255 126.498 5.98905 123.327 5.98905C120.038 5.98905 117.057 7.73799 117.057 12.323C117.057 17.0972 120.275 18.7516 123.327 18.7516ZM120.748 11.0941C120.985 9.676 121.789 8.9197 123.233 8.9197C125.007 8.9197 125.552 10.0305 125.623 11.0941H120.748Z",fill:"white"}),jsx("path",{d:"M137.439 18.6807C138.172 18.6807 138.882 18.5861 139.474 18.4207V15.5609C138.93 15.6082 138.717 15.6082 138.456 15.6082C137.202 15.6082 136.966 14.9228 136.966 14.072V9.22695H139.379V6.22539H136.966V3.01113H133.085V6.22539H130.979V9.22695H133.085V14.6156C133.085 17.4753 134.789 18.6807 137.439 18.6807Z",fill:"white"}),jsx("path",{d:"M144.456 18.5152H148.833L150.797 11.3777L152.761 18.5152H157.115L160.333 6.22539H156.666L154.749 14.781H154.654L152.454 6.22539H149.117L146.917 14.781H146.822L144.905 6.22539H141.261L144.456 18.5152Z",fill:"white"}),jsx("path",{d:"M167.796 18.7516C170.896 18.7516 174.043 16.8845 174.043 12.3703C174.043 7.85616 170.896 5.98905 167.796 5.98905C164.673 5.98905 161.549 7.85616 161.549 12.3703C161.549 16.8845 164.673 18.7516 167.796 18.7516ZM165.169 12.3703C165.169 10.196 166.282 9.20331 167.796 9.20331C169.287 9.20331 170.399 10.196 170.399 12.3703C170.399 14.5447 169.287 15.5373 167.796 15.5373C166.282 15.5373 165.169 14.5447 165.169 12.3703Z",fill:"white"}),jsx("path",{d:"M176.554 18.5152H180.434V13.3629C180.434 10.2669 182.256 9.39239 183.96 9.39239C184.268 9.39239 184.552 9.41602 184.954 9.46329V6.20176C184.575 6.10722 184.268 6.08359 184.007 6.08359C182.138 6.08359 180.979 7.3362 180.505 9.27421H180.434V6.22539H176.554V18.5152Z",fill:"white"}),jsx("path",{d:"M187.223 18.5152H191.104V14.9701L192.074 13.9302L195.742 18.5152H200.001L194.44 11.4249L199.362 6.22539H195.126L191.104 10.8104V1.97122H187.223V18.5152Z",fill:"white"}),jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.66235 0.640167L9.70838 0.640167C12.1367 0.64581 14.355 1.54403 16.052 3.02375C16.1722 3.1286 16.0961 3.32102 15.9365 3.32102L3.43427 3.32102C3.27465 3.32102 3.1985 3.1286 3.31874 3.02375C5.01571 1.54403 7.23406 0.645809 9.66235 0.640167Z",fill:"white"}),jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.9175 12.9472C5.84821 12.8485 5.73663 12.7865 5.61594 12.7865L0.606422 12.7865C0.461299 12.7865 0.355489 12.924 0.39667 13.063C1.58273 17.0661 5.29234 19.9869 9.68495 19.9869C14.0776 19.9869 17.7872 17.0661 18.9732 13.063C19.0144 12.924 18.9086 12.7865 18.7635 12.7865L13.754 12.7865C13.6333 12.7865 13.5218 12.8485 13.4525 12.9472C12.6208 14.1317 11.2434 14.9061 9.68499 14.9061C8.12654 14.9061 6.74917 14.1317 5.9175 12.9472Z",fill:"white"}),jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.3322 7.51577C13.4208 7.63078 13.5556 7.7029 13.7009 7.7029L18.7216 7.7029C18.868 7.7029 18.9741 7.56325 18.9304 7.42361C18.551 6.2113 17.9392 5.10154 17.147 4.14637C17.0811 4.06686 16.9826 4.02197 16.8792 4.02197L2.4903 4.02197C2.38694 4.02197 2.28845 4.06686 2.22251 4.14637C1.43037 5.10153 0.818541 6.2113 0.439134 7.42361C0.395431 7.56325 0.501494 7.7029 0.647976 7.7029L5.66868 7.7029C5.81394 7.7029 5.9488 7.63078 6.03735 7.51577C6.87801 6.42387 8.19911 5.72017 9.68478 5.72017C11.1704 5.72017 12.4916 6.42387 13.3322 7.51577Z",fill:"white"}),jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.1283 12.0868C14.0334 12.0868 13.969 11.9902 14.0018 11.9013C14.184 11.4069 14.2835 10.8724 14.2835 10.3148C14.2835 9.70687 14.1652 9.12653 13.9505 8.59547C13.9142 8.50592 13.9788 8.40582 14.0755 8.40582L19.0003 8.40582C19.1057 8.40582 19.1968 8.48012 19.2156 8.58377C19.3172 9.14546 19.3702 9.72401 19.3702 10.3149C19.3702 10.8567 19.3256 11.3881 19.2399 11.9057C19.2225 12.0108 19.1307 12.0868 19.0241 12.0868L14.1283 12.0868ZM5.36846 11.9013C5.40122 11.9902 5.33678 12.0868 5.24195 12.0868L0.346163 12.0868C0.239492 12.0868 0.147732 12.0108 0.130321 11.9057C0.0445957 11.3881 0 10.8567 0 10.3149C0 9.72401 0.0530502 9.14546 0.154653 8.58377C0.173403 8.48011 0.264481 8.40582 0.369941 8.40582L5.29476 8.40582C5.39146 8.40582 5.45599 8.50592 5.41977 8.59547C5.20498 9.12653 5.08673 9.70687 5.08673 10.3148C5.08673 10.8724 5.18623 11.4069 5.36846 11.9013Z",fill:"white"})]});var ot=e=>{let{appIcons:t}=useAppConfig();if(e.src)return jsx(Logo,{src:e.src,alt:e.alt});let{main:n}=t||{};return n?.img?jsx("img",{src:n?.img}):n?.component?n.component:jsx(Ce,{})};var it=e=>{let{items:t,classNames:n}=e;return !Array.isArray(t)||t.length===0?null:jsx(Flex,{gap:2,className:n?.root,children:t?.map((o,r)=>jsx(Q,{item:o,currentPath:e.current,onClick:e.onItemClick},r))})};installExtension({name:"default-main-nav-menus",scope:["*"],positions:[ExtensionPositionEnum.MainMenus],__isInternal:!0})(e=>jsx(it,{...e}));var at=e=>jsx(ExtensionSlot,{position:ExtensionPositionEnum.MainMenus,...e});var we=e=>{let{className:t,logo:n,products:o,classNames:r,campaigns:c,campaignPosition:a}=e,m=useMemo(()=>typeof e.children>"u"?null:jsx(Flex,{grow:!0,children:e.children}),[e.children]);return jsxs(Flex,{as:"header",itemAlign:"center",height:"48px",justify:"between",px:3,className:cn$1("oui-main-nav oui-font-semibold",t,r?.root),children:[jsxs(Flex,{itemAlign:"center",gap:4,children:[jsx(ot,{...n}),jsx(le,{...o,className:r?.products}),jsx(at,{...e.mainMenus,classNames:r?.mainNav})]}),m,jsxs(Flex,{itemAlign:"center",gap:4,children:[a==="navTailing"&&c?jsx(Qe,{...c,className:r?.campaignButton}):null,jsx($,{}),jsx(q,{}),e.wrongNetwork&&e.isConnected?null:jsx(Ee,{})]})]})};we.displayName="MainNav";var be=e=>{let{children:t,classNames:n,...o}=e,r=Ue(o);return jsx(we,{classNames:n,...r,children:t})};var cn=tv({slots:{button:["oui-h-10","oui-px-3","oui-rounded-md","oui-w-full","oui-text-left","oui-text-base","oui-text-base-contrast-36","oui-group","hover:oui-bg-base-8","oui-transition-colors","group-data-[state=closed]/bar:oui-w-[42px]","oui-overflow-hidden"],icon:[]},variants:{mode:{"icon-only":{button:"oui-w-10",icon:"w-6 h-6"},full:{button:"oui-full",icon:"w-6 h-6"}},active:{true:{button:"oui-bg-base-5 hover:oui-bg-base-5"}},open:{true:{button:""}}}}),mt=memo(e=>{let{item:t,mode:n,open:o,onClick:r,active:c,...a}=e,{button:m}=cn({mode:n,active:e.active,open:e.open}),g=jsx("button",{"data-actived":e.active,disabled:t.disabled,className:m(),onClick:()=>{e.onClick?.(t);},children:jsxs(Flex,{itemAlign:"center",gap:2,as:"span",children:[t.icon,e.open&&jsx(Text.gradient,{color:e.active?"brand":"inherit",angle:45,size:"base",className:"oui-animate-in oui-fade-in",children:t.name})]})});return e.open?jsx("li",{className:"oui-min-w-[120px]",children:g}):jsx("li",{children:jsx(Tooltip,{content:t.name,side:"right",align:"center",sideOffset:20,children:g})})});mt.displayName="LeftMenuItem";var un=e=>jsxs(Box,{py:6,children:[jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"oui-absolute oui-invisible oui-pointer-events-none",children:jsx("defs",{children:jsxs("linearGradient",{id:"side-menu-gradient",x1:"15.7432",y1:"8.94726",x2:"2.24316",y2:"8.94726",gradientUnits:"userSpaceOnUse",children:[jsx("stop",{stopColor:"#59B0FE"}),jsx("stop",{offset:"1",stopColor:"#26FEFE"})]})})}),jsx("ul",{className:"oui-space-y-4",children:e.menus?.map((t,n)=>jsx(mt,{item:t,open:e.open,active:t.href===e.current,onClick:e.onItemSelect},n))})]}),mn=e=>{let{title:t}=e,n=typeof t=="string"?jsx(Text,{intensity:54,size:"xs",children:t}):t,o={className:"oui-text-base-contrast-36 hover:oui-text-base-contrast-80 oui-cursor-pointer",onClick:e.onToggle};return jsxs(Flex,{justify:e.open?"between":"center",itemAlign:"center",className:"oui-h-6",children:[e.open?n:null,e.open?jsx(pn,{...o}):jsx(dn,{...o})]})},z=e=>{let{open:t=!0,items:n,current:o,onItemSelect:r}=e;return jsxs(Box,{"data-state":t?"opened":"closed",className:cn$1("oui-group/bar",e.className),style:e.style,children:[jsx(mn,{open:t,title:e.title,onToggle:()=>{e.onOpenChange?.(!t);}}),jsx(un,{menus:n,current:o,onItemSelect:r,open:t})]})};z.displayName="SideBar";var dn=e=>jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:jsx("path",{d:"M6.326 8.826a.84.84 0 0 0-.6.234L2.16 12.627v-2.135H.492v4.167c0 .46.373.833.834.833h4.166v-1.667H3.357l3.567-3.567a.857.857 0 0 0 0-1.198.84.84 0 0 0-.598-.234M10.502.492V2.16h2.135L9.07 5.726a.857.857 0 0 0 0 1.199.86.86 0 0 0 1.197 0l3.568-3.568v2.135h1.667V1.326a.834.834 0 0 0-.834-.834z"})}),pn=e=>jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:jsx("path",{d:"M14.668.492a.85.85 0 0 0-.599.234l-3.567 3.568V2.159H8.835v4.167c0 .46.373.833.833.833h4.167V5.492H11.7l3.569-3.567a.86.86 0 0 0 0-1.199.85.85 0 0 0-.6-.234m-12.5 8.334v1.666h2.135L.736 14.06a.86.86 0 0 0 0 1.198.86.86 0 0 0 1.198 0l3.568-3.567v2.134h1.666V9.66a.834.834 0 0 0-.833-.833z"})});var dt=e=>{let[t,n]=useState(e?.items?.[0].href||"/"),{expanded:o,setExpand:r}=L();return {items:[],current:t,open:o,onOpenChange:c=>{r?.(c);},onItemSelect:c=>{c.href&&n(c.href);},...e}};var ne=e=>{let t=dt(e);return jsx(z,{...t})};var Ne=e=>{let t=useMemo(()=>{switch(e.wsStatus){case WsNetworkStatus.Connected:return "oui-fill-success-light oui-text-success-light";case WsNetworkStatus.Disconnected:return "oui-fill-danger-light oui-text-danger-light";case WsNetworkStatus.Unstable:return "oui-fill-warning-light oui-text-warning-light"}},[e.wsStatus]),n=o=>{window.open(o,"_blank");};return jsxs(Flex,{direction:"row",justify:"between",height:28,px:3,width:"100%",children:[jsxs(Flex,{children:[jsxs(Flex,{direction:"row",itemAlign:"center",gap:1,className:t,children:[jsx(te,{fillOpacity:1,fill:"currentColor"}),jsx(Text,{size:"2xs",children:"Operational"})]}),jsx(Divider,{direction:"vertical",className:"oui-h-[18px] oui-px-1 oui-ml-2 oui-border-line-12"}),jsxs(Flex,{gap:2,children:[jsx(Text,{intensity:54,size:"2xs",children:"Join our community"}),jsxs(Flex,{direction:"row",gap:1,children:[typeof e.telegramUrl<"u"&&jsx(Y,{className:"oui-fill-white/[.54] hover:oui-fill-white/[.98] oui-cursor-pointer",fill:"currentColor",fillOpacity:1,onClick:o=>n(e.telegramUrl)}),typeof e.discordmUrl<"u"&&jsx(j,{className:"oui-fill-white/[.54] hover:oui-fill-white/[.98] oui-cursor-pointer",fill:"currentColor",fillOpacity:1,onClick:o=>n(e.discordmUrl)}),typeof e.twitterUrl<"u"&&jsx(ee,{className:"oui-fill-white/[.54] hover:oui-fill-white/[.98] oui-cursor-pointer",fill:"currentColor",fillOpacity:1,onClick:o=>n(e.twitterUrl)})]})]})]}),jsxs(Flex,{direction:"row",gap:1,children:[jsx(Text,{intensity:54,size:"2xs",children:"Powered by"}),jsx(ge,{})]})]})};var pt=()=>({wsStatus:useWsStatus()});var Ie=e=>{let t=pt();return jsx(Ne,{...t,...e})};var Se=e=>{if(useMediaQuery(MEDIA_TABLET))return jsx(Fragment,{});let{showTips:n,showDialog:o,tipsContent:r,closeTips:c,dialogContent:a}=e;return o?jsx(Dialog,{open:!0,children:jsxs(DialogContent,{closable:!1,onOpenAutoFocus:m=>m.preventDefault(),children:[jsx(DialogHeader,{children:jsx(DialogTitle,{children:"System upgrade in progress"})}),jsx(Divider,{}),jsx(DialogBody,{children:a})]})}):n?jsxs(Flex,{className:cn$1("oui-w-full oui-bg-warning-darken/10 oui-text-warning-darken oui-text-sm oui-relative oui-gap-1 oui-pl-4 oui-pr-[60px] oui-py-3","oui-min-h-[48px]","oui-justify-start oui-items-start","xl:oui-justify-center xl:oui-items-center xl:oui-px-4"),children:[jsx(fe,{size:20,className:"oui-flex-shrink-0 oui-w-5 oui-h-5 "}),jsx(Box,{className:"oui-font-semibold ",children:r}),jsx(he,{size:16,className:"oui-absolute oui-right-4 oui-text-secondary/[0.36] hover:oui-text-secondary/80 oui-cursor-pointer -oui-translate-y-2/4 oui-top-2/4",onClick:c})]}):jsx(Fragment,{})};function wt(e){let t=format(new UTCDateMini(e),"MMM dd");return `${format(new UTCDateMini(e),"h:mm aa")} (UTC) on ${t}`}var Bn=1e3*60*60*24,bt=()=>{let[e,t]=useState(!1),[n,o]=useState(!1),{startTime:r,endTime:c,status:a,brokerName:m}=useMaintenanceStatus(),g=useMemo(()=>r?wt(r):"-",[r]),b=useMemo(()=>c?wt(c):"-",[c]),u=()=>{window.localStorage.setItem(`Maintenance_${r}`,"1"),t(!1);};useEffect(()=>{if(a===2){t(!1),o(!0);return}o(!1),r&&r<getTimestamp()+Bn&&(window.localStorage.getItem(`Maintenance_${r}`)||t(!0));},[r,a]);let h=`${m} will be temporarily unavailable for a scheduled upgrade from ${g} to ${b}.`,y=`Sorry, ${m} is temporarily unavailable due to a scheduled upgrade. The service is expected to be back by ${b}.`;return {tipsContent:h,showTips:e,closeTips:u,showDialog:n,dialogContent:y}};var Pe=()=>{let e=bt();return jsx(Se,{...e})};function yt(e,t){return typeof e=="string"&&(e=parseInt(e)),t.some(n=>n.network_infos.chain_id===e)}var Zn=e=>{let{classNames:t,footerProps:n,routerAdapter:o}=e,[r,c]=useState(29),a=useRef(null),[m,g]=useLocalStorage("orderly_scaffold_expanded",!0),[b]=useChains(),{networkId:u}=useContext(OrderlyContext),h=P=>yt(P,u==="testnet"?b.testnet:b.mainnet),y=P=>{g(P);};useEffect(()=>{if(!a)return;let P=a.current?.getBoundingClientRect().height;c(P);},[a]);let p=e.leftSideProps?.maxWidth||185,s=e.leftSideProps?.minWidth||98,S=!!e.leftSidebar;return jsx("div",{className:cn$1("oui-scaffold-root oui-font-semibold","oui-text-base-contrast oui-bg-base-10","oui-flex oui-flex-col","oui-overflow-auto oui-custom-scrollbar",t?.root),style:{height:`calc(100vh - ${r}px)`},children:jsxs(Z.Provider,{value:{routerAdapter:o,expanded:m,setExpand:y,checkChainSupport:h},children:[jsx(Box,{className:cn$1("oui-scaffold-topNavbar oui-bg-base-9","oui-hidden xl:oui-block oui-min-w-[1440px]",t?.topNavbar),children:e.topBar??jsx(be,{...e.mainNavProps})}),jsx(Pe,{}),S?jsxs(Grid,{className:cn$1("oui-box-content oui-transition-all oui-flex xl:oui-grid","oui-flex-1",t?.body),style:{gridTemplateColumns:`${m?`${p}px`:`${s}px`} 1fr`},children:[jsx("div",{className:cn$1(t?.leftSidebar),children:isValidElement(e.leftSidebar)?e.leftSidebar:jsx(ne,{...e.leftSideProps})}),jsx(Box,{width:"100%",className:cn$1("oui-overflow-hidden",t?.content),children:e.children})]}):jsx(Box,{className:t?.content,children:e.children}),jsx(Box,{ref:a,className:cn$1("oui-scaffold-footer oui-w-full oui-bg-base-10","oui-fixed oui-bottom-0 oui-z-50","oui-hidden lg:oui-flex","oui-border-t-[1px] oui-border-line-12",t?.footer),children:e.footer||jsx(Ie,{...n})})]})})};
14
14
 
15
- export { H as AccountMenuWidget, $ as AccountSummaryWidget, me as CampaignPositionEnum, X as ChainMenu, K as ChainMenuWidget, O as ExpandableContext, we as FooterUI, ye as FooterWidget, pe as MainNavWidget, Ne as MaintenanceTipsUI, Me as MaintenanceTipsWidget, se as ProductsMenu, Sn as Scaffold, z as SideBar, J as SideNavbarWidget, I as useScaffoldContext };
15
+ export { Be as AccountMenuWidget, $ as AccountSummaryWidget, de as CampaignPositionEnum, K as ChainMenu, q as ChainMenuWidget, Z as ExpandableContext, Ne as Footer, Ie as FooterWidget, be as MainNavWidget, Se as MaintenanceTipsUI, Pe as MaintenanceTipsWidget, le as ProductsMenu, Zn as Scaffold, z as SideBar, ne as SideNavbarWidget, L as useScaffoldContext };
16
16
  //# sourceMappingURL=out.js.map
17
17
  //# sourceMappingURL=index.mjs.map