@opencompass-fe/oc-webkit-eval 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import o,{useContext as v,useState as c}from"react";import $ from"./evaluation-button.module.less.js";import y from"../create-evaluation/create-evaluation.js";import T from"../pre-create-evaluation/index.js";import{OcContext as U}from"../../../../../../providers/OcContext.js";import N from"../../../../hooks/useUrl.js";import{OcConfigContext as P}from"../../../../../../providers/OcConfigContext.js";const b=({onclick:u,children:e,style:C,text:f})=>{const{urls:t}=N(),{locales:i}=v(U),{config:d}=v(P),{locale:s}=d,[E,a]=c(!1),[r,O]=c(0),g=()=>{r===0&&(window.location.href=`${t==null?void 0:t.VITE_RANK_URL}/create/quick?lang=${s}`),r===1&&(window.location.href=`${t==null?void 0:t.VITE_RANK_URL}/create/ability?lang=${s}`),r===2&&(window.location.href=`${t==null?void 0:t.VITE_RANK_URL}/create/custom?lang=${s}`),a(!1)},k=()=>{a(!1)},_=l=>{O(l)},w=()=>{n(!0),a(!1)},[R,n]=c(!1),j=()=>{n(!1)},x=()=>{n(!1),a(!0)};return i?o.createElement(o.Fragment,null,f?o.createElement("div",{style:C,className:$.reviewButton,onClick:l=>{n(!0),u&&u(l)}},f):e&&o.cloneElement(e,{onClick:l=>{var p,m;n(!0),((p=e==null?void 0:e.props)==null?void 0:p.onclick)&&((m=e==null?void 0:e.props)==null||m.onclick(l))}}),o.createElement(T,{open:R,onCancel:j,title:i.createOnlineEvaluation,llmClick:x}),o.createElement(y,{goPrevStep:w,open:E,onOk:g,onCancel:k,title:i.createOnlineEvaluation,onTypeChange:_,type:r})):null};export{b as default};
1
+ import o,{useContext as d,useState as u}from"react";import N from"./evaluation-button.module.less.js";import T from"../create-evaluation/create-evaluation.js";import b from"../pre-create-evaluation/index.js";import{OcContext as h}from"../../../../../../providers/OcContext.js";import P from"../../../../hooks/useUrl.js";import{OcConfigContext as A}from"../../../../../../providers/OcConfigContext.js";import{buildRankUrl as f}from"../../../../../../helper/rankRoute.js";const I=({onclick:p,children:e,style:E,text:m})=>{const{urls:t}=P(),{locales:i}=d(h),{config:O}=d(A),{locale:s,isNew:c=!1}=O,[k,a]=u(!1),[r,g]=u(0),R=()=>{r===0&&(window.location.href=f(t==null?void 0:t.VITE_RANK_URL,"/create/quick",{isNew:c,lang:s})),r===1&&(window.location.href=f(t==null?void 0:t.VITE_RANK_URL,"/create/ability",{isNew:c,lang:s})),r===2&&(window.location.href=f(t==null?void 0:t.VITE_RANK_URL,"/create/custom",{isNew:c,lang:s})),a(!1)},w=()=>{a(!1)},_=l=>{g(l)},j=()=>{n(!0),a(!1)},[x,n]=u(!1),U=()=>{n(!1)},y=()=>{n(!1),a(!0)};return i?o.createElement(o.Fragment,null,m?o.createElement("div",{style:E,className:N.reviewButton,onClick:l=>{n(!0),p&&p(l)}},m):e&&o.cloneElement(e,{onClick:l=>{var v,C;n(!0),((v=e==null?void 0:e.props)==null?void 0:v.onclick)&&((C=e==null?void 0:e.props)==null||C.onclick(l))}}),o.createElement(b,{open:x,onCancel:U,title:i.createOnlineEvaluation,llmClick:y}),o.createElement(T,{goPrevStep:j,open:k,onOk:R,onCancel:w,title:i.createOnlineEvaluation,onTypeChange:_,type:r})):null};export{I as default};
@@ -1 +1 @@
1
- import r,{useContext as i,useMemo as c}from"react";import{Modal as p}from"antd";import n from"./index.module.less.js";import u from"../../../../../../assets/svg/llm-evaluation.svg.js";import d from"../../../../../../assets/svg/mm-evaluation.svg.js";import{OcContext as v}from"../../../../../../providers/OcContext.js";import f from"../../../../hooks/useUrl.js";import"../../../../../../providers/OcConfigContext.js";import"classnames";import"../../../../firstHeader.module.less.js";import"../../../../../../extraComponents/icon-font/index.js";import"../../../../secondHeader.js";import"react-router-dom";import"@ant-design/icons";import{evaluationTypeEnum as j}from"../../../../../../constants/enums.js";import"../../../../../../mobile/components/top-nav/top-nav.module.less.js";import"../../../../../top-nav/shared.js";import"../../../../../top-nav/top-nav.module.less.js";import"react-device-detect";import"../evaluation-button/evaluation-button.module.less.js";import"../create-evaluation/create-evaluation.js";import"../../../../../side-nav/side-nav.module.less.js";import"../../../../../footer/footer.module.less.js";import"../../../../../dropdown/dropdown.module.less.js";import"ahooks";import"../../../../../footer-expansion/footer-expansion.module.less.js";import"../../../../../md-render/index.js";import"../../../../../../helper/index.js";var E=Object.defineProperty,a=Object.getOwnPropertySymbols,_=Object.prototype.hasOwnProperty,g=Object.prototype.propertyIsEnumerable,m=(o,e,t)=>e in o?E(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,x=(o,e)=>{for(var t in e||(e={}))_.call(e,t)&&m(o,t,e[t]);if(a)for(var t of a(e))g.call(e,t)&&m(o,t,e[t]);return o};const C=o=>{const{locales:e}=i(v),{urls:t}=f(),l=c(()=>[{icon:u,name:e.llmEvaluation,click:()=>{o.llmClick()}},{icon:d,name:e.mmEvaluation,click:()=>{window.open(`${t.VITE_RANK_URL}/create/custom?type=${j.mm}`,"self")}}],[o]);return r.createElement(r.Fragment,null,r.createElement(p,x({centered:!0,className:n.modal,width:800,footer:[r.createElement("button",{key:"cancel",className:n.cancel,onClick:o.onCancel},e.cancel)]},o),r.createElement("div",{className:n.container},l.map(s=>r.createElement("div",{className:n.content,onClick:s.click},r.createElement("img",{src:s.icon}),r.createElement("span",null,s.name))))))};export{C as default};
1
+ import r,{useContext as l,useMemo as d}from"react";import{Modal as f}from"antd";import n from"./index.module.less.js";import v from"../../../../../../assets/svg/llm-evaluation.svg.js";import j from"../../../../../../assets/svg/mm-evaluation.svg.js";import{OcContext as g}from"../../../../../../providers/OcContext.js";import E from"../../../../hooks/useUrl.js";import{OcConfigContext as _}from"../../../../../../providers/OcConfigContext.js";import"classnames";import"../../../../firstHeader.module.less.js";import"../../../../../../extraComponents/icon-font/index.js";import"../../../../secondHeader.js";import"react-router-dom";import{buildRankUrl as x}from"../../../../../../helper/rankRoute.js";import"@ant-design/icons";import{evaluationTypeEnum as C}from"../../../../../../constants/enums.js";import"../../../../../../mobile/components/top-nav/top-nav.module.less.js";import"../../../../../top-nav/shared.js";import"../../../../../top-nav/top-nav.module.less.js";import"react-device-detect";import"../evaluation-button/evaluation-button.module.less.js";import"../create-evaluation/create-evaluation.js";import"../../../../../side-nav/side-nav.module.less.js";import"../../../../../footer/footer.module.less.js";import"../../../../../dropdown/dropdown.module.less.js";import"ahooks";import"../../../../../footer-expansion/footer-expansion.module.less.js";import"../../../../../md-render/index.js";import"../../../../../../helper/index.js";var O=Object.defineProperty,i=Object.getOwnPropertySymbols,w=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable,c=(t,e,o)=>e in t?O(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,h=(t,e)=>{for(var o in e||(e={}))w.call(e,o)&&c(t,o,e[o]);if(i)for(var o of i(e))y.call(e,o)&&c(t,o,e[o]);return t};const k=t=>{const{locales:e}=l(g),{urls:o}=E(),{config:p}=l(_),{locale:a,isNew:m=!1}=p,u=d(()=>[{icon:v,name:e.llmEvaluation,click:()=>{t.llmClick()}},{icon:j,name:e.mmEvaluation,click:()=>{window.open(x(o.VITE_RANK_URL,"/create/custom",{isNew:m,lang:a,searchParams:{type:C.mm}}),"self")}}],[t,o,a,m]);return r.createElement(r.Fragment,null,r.createElement(f,h({centered:!0,className:n.modal,width:800,footer:[r.createElement("button",{key:"cancel",className:n.cancel,onClick:t.onCancel},e.cancel)]},t),r.createElement("div",{className:n.container},u.map(s=>r.createElement("div",{className:n.content,onClick:s.click},r.createElement("img",{src:s.icon}),r.createElement("span",null,s.name))))))};export{k as default};
@@ -1 +1 @@
1
- import o,{useContext as j,useState as H,useEffect as T,useMemo as d}from"react";import{Dropdown as R,message as J}from"antd";import{goCommon as E,goOCHome as Q}from"../../google-log/home.js";import y from"classnames";import{OcContext as X}from"../../providers/OcContext.js";import{OcConfigContext as Z}from"../../providers/OcConfigContext.js";import ee from"./hooks/useUrl.js";import n from"./firstHeader.module.less.js";import te from"../../assets/svg/newLogo.svg.js";import ne from"../../assets/svg/newLogoEn.svg.js";import W from"../../extraComponents/icon-font/index.js";import oe from"../../assets/svg/blueNewLogo.svg.js";import le from"../../assets/svg/blueNewLogoEn.svg.js";import P from"./secondHeader.js";import{useLocation as re}from"react-router-dom";import"@ant-design/icons";import{webTypeEnum as i,langTypeEnum as L}from"../../constants/enums.js";import"../../mobile/components/top-nav/top-nav.module.less.js";import"../top-nav/shared.js";import"../top-nav/top-nav.module.less.js";import"react-device-detect";import"./components/create-online-evaluation/component/evaluation-button/evaluation-button.module.less.js";import"./components/create-online-evaluation/component/create-evaluation/create-evaluation.js";import"./components/create-online-evaluation/component/pre-create-evaluation/index.module.less.js";import"../side-nav/side-nav.module.less.js";import"../footer/footer.module.less.js";import"../dropdown/dropdown.module.less.js";import"ahooks";import"../footer-expansion/footer-expansion.module.less.js";import"../md-render/index.js";import"../../helper/index.js";var ie=Object.defineProperty,ae=Object.defineProperties,se=Object.getOwnPropertyDescriptors,V=Object.getOwnPropertySymbols,ce=Object.prototype.hasOwnProperty,ue=Object.prototype.propertyIsEnumerable,x=(s,t,c)=>t in s?ie(s,t,{enumerable:!0,configurable:!0,writable:!0,value:c}):s[t]=c,$=(s,t)=>{for(var c in t||(t={}))ce.call(t,c)&&x(s,c,t[c]);if(V)for(var c of V(t))ue.call(t,c)&&x(s,c,t[c]);return s},F=(s,t)=>ae(s,se(t)),me=(s,t,c)=>new Promise((v,a)=>{var k=m=>{try{e(c.next(m))}catch(_){a(_)}},u=m=>{try{e(c.throw(m))}catch(_){a(_)}},e=m=>m.done?v(m.value):Promise.resolve(m.value).then(k,u);e((c=c.apply(s,t)).next())});const de=64,ve=57;let z,I=0;const fe=s=>{const{locales:t}=j(X),{setConfig:c,config:v}=j(Z),{locale:a,setLocale:k}=v,{pathname:u}=re(),{urls:e}=ee(),{handleUnauth:m,logout:_,userInfo:B,jumpLogin:G,webType:l,isDefaultShowSecondMenu:U}=s,[b,C]=H(!1),[f,A]=H(!0);T(()=>{c(s)},[s]),T(()=>{U&&C(!0)},[U]);const M=d(()=>[{title:{"zh-CN":"\u5927\u6A21\u578B\u8BC4\u6D4B","en-US":"LLM"},key:"large-model",href:`${e==null?void 0:e.VITE_COMPASS_URL}large-model`,onClick:E,isActive:u.startsWith("/large-model")||u.startsWith("/arena")||u.startsWith("/doc")||u.startsWith("/rule")||u.startsWith("/policy")||window.location.href.startsWith(e==null?void 0:e.VITE_RANK_URL)||window.location.href.startsWith(e==null?void 0:e.VITE_HUB_URL)||window.location.href.startsWith(e==null?void 0:e.VITE_DOC_URL)||window.location.href.startsWith(e==null?void 0:e.VITE_SPECIAL_LIST_URL)||window.location.href.startsWith(e==null?void 0:e.VITE_DATA_URL)},{title:{"zh-CN":"\u79D1\u5B66\u667A\u80FD\u8BC4\u6D4B","en-US":"Scientific Intelligence"},key:"Intern-Discovery-Eval",href:`${e==null?void 0:e.VITE_COMPASS_URL}Intern-Discovery-Eval`,onClick:E,isActive:u.startsWith("/Intern-Discovery-Eval")},{title:{"zh-CN":"\u5177\u8EAB\u667A\u80FD\u8BC4\u6D4B","en-US":"Embodied Intelligence"},key:"Embodied-Intelligence",href:`${e==null?void 0:e.VITE_COMPASS_URL}embodied-intelligence`,onClick:E,isActive:u.startsWith("/embodied-intelligence")},{title:{"zh-CN":"\u5B89\u5168\u8BC4\u6D4B","en-US":"Safety"},key:"security-evaluation",href:`${e==null?void 0:e.VITE_COMPASS_URL}safety`,onClick:E,isActive:u.startsWith("/safety")},{title:{"zh-CN":"AI \u8BA1\u7B97\u7CFB\u7EDF\u8BC4\u6D4B","en-US":"AI Computing System"},key:"computing-system-evaluation",href:`${e==null?void 0:e.VITE_COMPASS_URL}computing-system`,onClick:E,isActive:u.startsWith("/computing-system")||u.startsWith("/evaluation-plan")},{title:{"zh-CN":"\u5782\u7C7B\u9886\u57DF\u8BC4\u6D4B","en-US":"Industry Verticals"},key:"Vertical-domain-evaluation",href:`${e==null?void 0:e.VITE_COMPASS_URL}ecosystem/finance`,onClick:E,isActive:u.startsWith("/ecosystem/finance")}],[e,u,window.location]),q=r=>me(void 0,[r],function*({key:S}){if(S==="logout")try{yield _()}catch(g){J.error("request error!")}finally{m(),window.location.reload()}}),p=d(()=>l!==i.miniWeb&&l!==i.lightMiniWeb,[l]),K=d(()=>[{label:o.createElement("div",null,t==null?void 0:t.finance," ",o.createElement(W,{type:"icon-GotoOutline"})),key:"https://cnfinbench.opencompass.org.cn/"},{label:o.createElement("div",null,t==null?void 0:t.medical," ",o.createElement(W,{type:"icon-GotoOutline"})),key:"https://medbench.opencompass.org.cn/home"}],[t,e]),O=d(()=>l===i.blueWeb||l===i.miniWeb||l===i.transparentWeb?a==="en-US"?ne:te:a==="en-US"?le:oe,[l,a]),Y=({key:r})=>{r.startsWith(e==null?void 0:e.VITE_COMPASS_URL)?location.href=r:window.open(r)},h=d(()=>!!(v.navMenuList&&v.navMenuList.length>1||!v.navMenuList),[v.navMenuList]),D=d(()=>[{key:"myEvaluation",label:o.createElement("a",{href:`${e==null?void 0:e.VITE_RANK_URL}/online-evaluation?lang=${a}`},t==null?void 0:t.myEvaluation)},{key:"myBenchmark",label:o.createElement("a",{href:`${e==null?void 0:e.VITE_HUB_URL}/benchmarks?lang=${a}`},t==null?void 0:t.myBenchmark)},{key:"myModel",label:o.createElement("a",{href:`${e==null?void 0:e.VITE_RANK_URL}/models?lang=${a}`},t==null?void 0:t.myModel)},{key:"collaboration",label:o.createElement("a",{className:n.collaboration,href:`${e==null?void 0:e.VITE_DATA_URL}/data-list?lang=${a}`},t==null?void 0:t.commitRecord)},{key:"user-center",label:o.createElement("a",{href:`${e==null?void 0:e.VITE_SSO_URL}/usercenter?lang=${a}`,target:"_blank",rel:"noreferrer"},t==null?void 0:t.userCenter)},{key:"logout",label:t==null?void 0:t.logout}],[t==null?void 0:t.myEvaluation,t==null?void 0:t.logout,t==null?void 0:t.userCenter,t==null?void 0:t.myBenchmark,a,e]),N=d(()=>o.createElement("header",{className:y(n.firstHeader,b&&h&&p&&n.animateHide,!b&&p&&n.animateShow,l===i.lightWeb&&n.lightHeader,l===i.lightMiniWeb&&n.lightHeader,l===i.miniWeb&&n.miniWeb,!f&&l===i.miniWeb&&n.blackMiniWeb,l===i.transparentWeb&&!f&&n.blueBackHeaderBox,l===i.lightWeb&&!f&&n.lightBackHeader,a==="en-US"&&n.enHeader)},o.createElement("a",{className:n.logo,href:`${e==null?void 0:e.VITE_COMPASS_URL}?lang=${a}`,onClick:r=>{r.preventDefault(),Q(a,"header",e==null?void 0:e.VITE_COMPASS_URL)}},o.createElement("img",{src:O,alt:"logo"})),o.createElement("div",{className:n.rightBox},M.map(r=>r.key==="Vertical-domain-evaluation"?o.createElement(R,{placement:"bottom",overlayClassName:n.whiteCustomDropdown,menu:{items:K,onClick:Y}},o.createElement("a",{key:r.key,className:y(n.firstMenuItem,r.isActive&&n.activeMenu),target:"_self",rel:"noreferrer"},r.title[a])):o.createElement("a",{key:r.key,className:y(n.firstMenuItem,r.isActive&&n.activeMenu),target:"_self",rel:"noreferrer",onClick:S=>{S.preventDefault(),r.onClick&&r.onClick(a,"header",r.href)}},r.title[a])),o.createElement("div",{onClick:()=>k(a===L.zh?L.en:L.zh),className:n.lang},o.createElement(W,{type:a!=="zh-CN"?"icon-zhongyingqiehuanyingTranslateE":"icon-zhongyingqiehuanzhongTranslateC"})),o.createElement("div",{className:n.userWrapper},B&&B.token?o.createElement(R,{overlayClassName:n.userInfoDropdown,menu:{items:D,onClick:q}},o.createElement("div",{className:n.avatar},o.createElement(W,{type:l===i.lightMiniWeb||l===i.lightWeb?"icon-a-Frame1321316814":"icon-a-Frame1321316813"}))):o.createElement("a",{className:y(n.loginBtn),onClick:()=>{let r=G();r&&(window.location.href=r)}},t==null?void 0:t.login)))),[b,l,p,O,t,f,M,D,h,e,B]),w=d(()=>h?de:ve,[h]);return T(()=>{console.log("scrollOffset",w);const r=S=>{let g=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop;window.clearTimeout(z),z=setTimeout(function(){g===0?(C(!1),A(!0)):(A(!1),g>I+w+5?(console.log("\u5411\u4E0B\u6EDA\u52A8"),g>=I&&C(!0)):g<I-w-5&&C(!1)),I=g},50)};return window.addEventListener("scroll",r),()=>{window.removeEventListener("scroll",r)}},[window.location.pathname,l,h,w]),o.createElement(o.Fragment,null,b&&p?h?o.createElement(P,F($({},s),{isTop:!1,isScrollDown:b})):o.createElement("div",{className:y(n.headerBox,n.onlyFirstHeaderBox,l===i.lightWeb&&n.lightHeadBox,l===i.lightMiniWeb&&n.lightMiniWeb,l===i.miniWeb&&n.miniWeb,l===i.transparentWeb&&n.transparentWeb)},N):o.createElement("div",{className:y(n.headerBox,!p&&n.onlyFirstHeaderBox,l===i.lightWeb&&n.lightHeadBox,l===i.lightMiniWeb&&n.lightMiniWeb,l===i.miniWeb&&n.miniWeb,l===i.transparentWeb&&n.transparentWeb,l===i.lightWeb&&!f&&n.lightBackHeadBox)},N,p&&o.createElement(P,F($({},s),{isTop:f,isScrollDown:!1}))))};export{fe as default};
1
+ import n,{useContext as R,useState as H,useEffect as T,useMemo as d}from"react";import{Dropdown as P,message as X}from"antd";import{goCommon as E,goOCHome as Z}from"../../google-log/home.js";import y from"classnames";import{OcContext as ee}from"../../providers/OcContext.js";import{OcConfigContext as te}from"../../providers/OcConfigContext.js";import oe from"./hooks/useUrl.js";import o from"./firstHeader.module.less.js";import ne from"../../assets/svg/newLogo.svg.js";import le from"../../assets/svg/newLogoEn.svg.js";import k from"../../extraComponents/icon-font/index.js";import re from"../../assets/svg/blueNewLogo.svg.js";import ie from"../../assets/svg/blueNewLogoEn.svg.js";import V from"./secondHeader.js";import{useLocation as ae}from"react-router-dom";import{buildRankUrl as x,buildHubUrl as se,buildDataUrl as ce}from"../../helper/rankRoute.js";import"@ant-design/icons";import{webTypeEnum as i,langTypeEnum as L}from"../../constants/enums.js";import"../../mobile/components/top-nav/top-nav.module.less.js";import"../top-nav/shared.js";import"../top-nav/top-nav.module.less.js";import"react-device-detect";import"./components/create-online-evaluation/component/evaluation-button/evaluation-button.module.less.js";import"./components/create-online-evaluation/component/create-evaluation/create-evaluation.js";import"./components/create-online-evaluation/component/pre-create-evaluation/index.module.less.js";import"../side-nav/side-nav.module.less.js";import"../footer/footer.module.less.js";import"../dropdown/dropdown.module.less.js";import"ahooks";import"../footer-expansion/footer-expansion.module.less.js";import"../md-render/index.js";import"../../helper/index.js";var ue=Object.defineProperty,me=Object.defineProperties,de=Object.getOwnPropertyDescriptors,F=Object.getOwnPropertySymbols,ve=Object.prototype.hasOwnProperty,fe=Object.prototype.propertyIsEnumerable,$=(s,e,c)=>e in s?ue(s,e,{enumerable:!0,configurable:!0,writable:!0,value:c}):s[e]=c,z=(s,e)=>{for(var c in e||(e={}))ve.call(e,c)&&$(s,c,e[c]);if(F)for(var c of F(e))fe.call(e,c)&&$(s,c,e[c]);return s},G=(s,e)=>me(s,de(e)),pe=(s,e,c)=>new Promise((v,a)=>{var B=m=>{try{t(c.next(m))}catch(b){a(b)}},u=m=>{try{t(c.throw(m))}catch(b){a(b)}},t=m=>m.done?v(m.value):Promise.resolve(m.value).then(B,u);t((c=c.apply(s,e)).next())});const he=64,ge=57;let q,I=0;const Ee=s=>{const{locales:e}=R(ee),{setConfig:c,config:v}=R(te),{locale:a,setLocale:B}=v,{pathname:u}=ae(),{urls:t}=oe(),{handleUnauth:m,logout:b,userInfo:U,jumpLogin:K,webType:l,isDefaultShowSecondMenu:M,isNew:_=!1}=s,[C,w]=H(!1),[f,A]=H(!0);T(()=>{c(s)},[s]),T(()=>{M&&w(!0)},[M]);const O=d(()=>[{title:{"zh-CN":"\u5927\u6A21\u578B\u8BC4\u6D4B","en-US":"LLM"},key:"large-model",href:`${t==null?void 0:t.VITE_COMPASS_URL}large-model`,onClick:E,isActive:u.startsWith("/large-model")||u.startsWith("/arena")||u.startsWith("/doc")||u.startsWith("/rule")||u.startsWith("/policy")||window.location.href.startsWith(t==null?void 0:t.VITE_RANK_URL)||window.location.href.startsWith(t==null?void 0:t.VITE_HUB_URL)||window.location.href.startsWith(t==null?void 0:t.VITE_DOC_URL)||window.location.href.startsWith(t==null?void 0:t.VITE_SPECIAL_LIST_URL)||window.location.href.startsWith(t==null?void 0:t.VITE_DATA_URL)},{title:{"zh-CN":"\u79D1\u5B66\u667A\u80FD\u8BC4\u6D4B","en-US":"Scientific Intelligence"},key:"Intern-Discovery-Eval",href:`${t==null?void 0:t.VITE_COMPASS_URL}Intern-Discovery-Eval`,onClick:E,isActive:u.startsWith("/Intern-Discovery-Eval")},{title:{"zh-CN":"\u5177\u8EAB\u667A\u80FD\u8BC4\u6D4B","en-US":"Embodied Intelligence"},key:"Embodied-Intelligence",href:`${t==null?void 0:t.VITE_COMPASS_URL}embodied-intelligence`,onClick:E,isActive:u.startsWith("/embodied-intelligence")},{title:{"zh-CN":"\u5B89\u5168\u8BC4\u6D4B","en-US":"Safety"},key:"security-evaluation",href:`${t==null?void 0:t.VITE_COMPASS_URL}safety`,onClick:E,isActive:u.startsWith("/safety")},{title:{"zh-CN":"AI \u8BA1\u7B97\u7CFB\u7EDF\u8BC4\u6D4B","en-US":"AI Computing System"},key:"computing-system-evaluation",href:`${t==null?void 0:t.VITE_COMPASS_URL}computing-system`,onClick:E,isActive:u.startsWith("/computing-system")||u.startsWith("/evaluation-plan")},{title:{"zh-CN":"\u5782\u7C7B\u9886\u57DF\u8BC4\u6D4B","en-US":"Industry Verticals"},key:"Vertical-domain-evaluation",href:`${t==null?void 0:t.VITE_COMPASS_URL}ecosystem/finance`,onClick:E,isActive:u.startsWith("/ecosystem/finance")}],[t,u,window.location]),Y=r=>pe(void 0,[r],function*({key:W}){if(W==="logout")try{yield b()}catch(g){X.error("request error!")}finally{m(),window.location.reload()}}),p=d(()=>l!==i.miniWeb&&l!==i.lightMiniWeb,[l]),J=d(()=>[{label:n.createElement("div",null,e==null?void 0:e.finance," ",n.createElement(k,{type:"icon-GotoOutline"})),key:"https://cnfinbench.opencompass.org.cn/"},{label:n.createElement("div",null,e==null?void 0:e.medical," ",n.createElement(k,{type:"icon-GotoOutline"})),key:"https://medbench.opencompass.org.cn/home"}],[e,t]),D=d(()=>l===i.blueWeb||l===i.miniWeb||l===i.transparentWeb?a==="en-US"?le:ne:a==="en-US"?ie:re,[l,a]),Q=({key:r})=>{r.startsWith(t==null?void 0:t.VITE_COMPASS_URL)?location.href=r:window.open(r)},h=d(()=>!!(v.navMenuList&&v.navMenuList.length>1||!v.navMenuList),[v.navMenuList]),N=d(()=>[{key:"myEvaluation",label:n.createElement("a",{href:x(t==null?void 0:t.VITE_RANK_URL,"/online-evaluation",{isNew:_,lang:a})},e==null?void 0:e.myEvaluation)},{key:"myBenchmark",label:n.createElement("a",{href:se(t==null?void 0:t.VITE_HUB_URL,"/benchmarks",{isNew:_,lang:a})},e==null?void 0:e.myBenchmark)},{key:"myModel",label:n.createElement("a",{href:x(t==null?void 0:t.VITE_RANK_URL,"/models",{isNew:_,lang:a})},e==null?void 0:e.myModel)},{key:"collaboration",label:n.createElement("a",{className:o.collaboration,href:ce(t==null?void 0:t.VITE_DATA_URL,"/data-list",{isNew:_,lang:a})},e==null?void 0:e.commitRecord)},{key:"user-center",label:n.createElement("a",{href:`${t==null?void 0:t.VITE_SSO_URL}/usercenter?lang=${a}`,target:"_blank",rel:"noreferrer"},e==null?void 0:e.userCenter)},{key:"logout",label:e==null?void 0:e.logout}],[e==null?void 0:e.myEvaluation,e==null?void 0:e.logout,e==null?void 0:e.userCenter,e==null?void 0:e.myBenchmark,e==null?void 0:e.myModel,a,t,_]),j=d(()=>n.createElement("header",{className:y(o.firstHeader,C&&h&&p&&o.animateHide,!C&&p&&o.animateShow,l===i.lightWeb&&o.lightHeader,l===i.lightMiniWeb&&o.lightHeader,l===i.miniWeb&&o.miniWeb,!f&&l===i.miniWeb&&o.blackMiniWeb,l===i.transparentWeb&&!f&&o.blueBackHeaderBox,l===i.lightWeb&&!f&&o.lightBackHeader,a==="en-US"&&o.enHeader)},n.createElement("a",{className:o.logo,href:`${t==null?void 0:t.VITE_COMPASS_URL}old-home?lang=${a}`,onClick:r=>{r.preventDefault(),Z(a,"header",`${t==null?void 0:t.VITE_COMPASS_URL}old-home`)}},n.createElement("img",{src:D,alt:"logo"})),n.createElement("div",{className:o.rightBox},O.map(r=>r.key==="Vertical-domain-evaluation"?n.createElement(P,{placement:"bottom",overlayClassName:o.whiteCustomDropdown,menu:{items:J,onClick:Q}},n.createElement("a",{key:r.key,className:y(o.firstMenuItem,r.isActive&&o.activeMenu),target:"_self",rel:"noreferrer"},r.title[a])):n.createElement("a",{key:r.key,className:y(o.firstMenuItem,r.isActive&&o.activeMenu),target:"_self",rel:"noreferrer",onClick:W=>{W.preventDefault(),r.onClick&&r.onClick(a,"header",r.href)}},r.title[a])),n.createElement("div",{onClick:()=>B(a===L.zh?L.en:L.zh),className:o.lang},n.createElement(k,{type:a!=="zh-CN"?"icon-zhongyingqiehuanyingTranslateE":"icon-zhongyingqiehuanzhongTranslateC"})),n.createElement("div",{className:o.userWrapper},U&&U.token?n.createElement(P,{overlayClassName:o.userInfoDropdown,menu:{items:N,onClick:Y}},n.createElement("div",{className:o.avatar},n.createElement(k,{type:l===i.lightMiniWeb||l===i.lightWeb?"icon-a-Frame1321316814":"icon-a-Frame1321316813"}))):n.createElement("a",{className:y(o.loginBtn),onClick:()=>{let r=K();r&&(window.location.href=r)}},e==null?void 0:e.login)))),[C,l,p,D,e,f,O,N,h,t,U]),S=d(()=>h?he:ge,[h]);return T(()=>{console.log("scrollOffset",S);const r=W=>{let g=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop;window.clearTimeout(q),q=setTimeout(function(){g===0?(w(!1),A(!0)):(A(!1),g>I+S+5?(console.log("\u5411\u4E0B\u6EDA\u52A8"),g>=I&&w(!0)):g<I-S-5&&w(!1)),I=g},50)};return window.addEventListener("scroll",r),()=>{window.removeEventListener("scroll",r)}},[window.location.pathname,l,h,S]),n.createElement(n.Fragment,null,C&&p?h?n.createElement(V,G(z({},s),{isTop:!1,isScrollDown:C})):n.createElement("div",{className:y(o.headerBox,o.onlyFirstHeaderBox,l===i.lightWeb&&o.lightHeadBox,l===i.lightMiniWeb&&o.lightMiniWeb,l===i.miniWeb&&o.miniWeb,l===i.transparentWeb&&o.transparentWeb)},j):n.createElement("div",{className:y(o.headerBox,!p&&o.onlyFirstHeaderBox,l===i.lightWeb&&o.lightHeadBox,l===i.lightMiniWeb&&o.lightMiniWeb,l===i.miniWeb&&o.miniWeb,l===i.transparentWeb&&o.transparentWeb,l===i.lightWeb&&!f&&o.lightBackHeadBox)},j,p&&n.createElement(V,G(z({},s),{isTop:f,isScrollDown:!1}))))};export{Ee as default};
@@ -1 +1 @@
1
- import n,{useContext as A,useState as I,useRef as B,useEffect as L,useMemo as g}from"react";import{Dropdown as D}from"antd";import V from"../../extraComponents/button/button.js";import{goCommon as W,goHub as x,goRank as M,goRules as O,goKit as H,goData as z,goOCHome as P,clickArena as K,goAnnualBenchmark as F,clickContributeBenchmarks as Y}from"../../google-log/home.js";import t from"./header.module.less.js";import G from"./components/create-online-evaluation/component/evaluation-button/evaluation-button.js";import"./components/create-online-evaluation/component/create-evaluation/create-evaluation.js";import"./components/create-online-evaluation/component/pre-create-evaluation/index.module.less.js";import{OcContext as Z}from"../../providers/OcContext.js";import q from"./hooks/useUrl.js";import{OcConfigContext as J}from"../../providers/OcConfigContext.js";import r from"classnames";import"./firstHeader.module.less.js";import Q from"../../assets/svg/newLogo.svg.js";import X from"../../assets/svg/newLogoEn.svg.js";import ee from"../../extraComponents/icon-font/index.js";import te from"../../assets/svg/blueNewLogo.svg.js";import ne from"../../assets/svg/blueNewLogoEn.svg.js";import{useLocation as oe}from"react-router-dom";import"@ant-design/icons";import{webTypeEnum as u}from"../../constants/enums.js";import"../../mobile/components/top-nav/top-nav.module.less.js";import"../top-nav/shared.js";import"../top-nav/top-nav.module.less.js";import"react-device-detect";import"../side-nav/side-nav.module.less.js";import"../footer/footer.module.less.js";import"../dropdown/dropdown.module.less.js";import{useSize as ae}from"ahooks";import"../footer-expansion/footer-expansion.module.less.js";import"../md-render/index.js";import"../../helper/index.js";import"./components/create-online-evaluation/component/sidebar/sidebar.module.less.js";import le from"../../assets/svg/left-wing.svg.js";import re from"../../assets/svg/right-wing.svg.js";import se from"../../assets/svg/arrow.svg.js";var f;(function(s){s.llm="large-model",s.aiComputingSystem="computing-system",s.embodiedIntelligence="embodied-intelligence",s.industryVerticals="ecosystem/finance",s.safety="safety",s.safetyRank="safety-rank",s.rankDetail="safety/rank",s.evaluationPlan="evaluation-plan"})(f||(f={}));const R="YearEvaluationNotion",ie=s=>{const{webType:i,navMenuList:h,isLLM:v,isTop:E,isScrollDown:c}=s,{locales:a}=A(Z),{config:U}=A(J),[m,p]=I(!1),[w,C]=I(!1),{urls:e}=q(),{pathname:_}=oe(),{locale:l}=U,k=B(),d=ae(k);L(()=>{if(l==="zh-CN"){p(!1);return}c?(d==null?void 0:d.width)<1665?p(!0):p(!1):(d==null?void 0:d.width)<1464?p(!0):p(!1)},[d==null?void 0:d.width,c,l]);const S=g(()=>Array.isArray(h)&&h.length>0?h:[{title:{zh:"\u9879\u76EE\u4ECB\u7ECD",en:"Introduction"},key:"largeModel",href:`${e==null?void 0:e.VITE_COMPASS_URL}${f.llm}`,onClick:W,isActive:_.startsWith(f.llm)},{title:{zh:"\u8BC4\u6D4B\u96C6\u793E\u533A",en:"CompassHub"},key:"CompassHub",href:e==null?void 0:e.VITE_HUB_URL,onClick:x,isActive:location.href.startsWith(e==null?void 0:e.VITE_HUB_URL)},{title:{zh:"\u8BC4\u6D4B\u699C\u5355",en:"CompassRank"},key:"CompassRank",href:e==null?void 0:e.VITE_RANK_URL,onClick:M,isActive:location.href.startsWith(e==null?void 0:e.VITE_RANK_URL)||location.href.startsWith(e==null?void 0:e.VITE_SPECIAL_LIST_URL)},{title:{zh:"\u699C\u5355\u89C4\u5219",en:"Rules"},key:"Rules",href:`${e==null?void 0:e.VITE_COMPASS_URL}`,onClick:O,isActive:location.href.startsWith(`${e==null?void 0:e.VITE_COMPASS_URL}rule`)},{title:{zh:"\u8BC4\u6D4B\u5DE5\u5177",en:"CompassKit"},key:"CompassKit",isExternal:!0,href:{zh:"https://github.com/open-compass/",en:"https://github.com/open-compass/"},onClick:H,isActive:!1},{title:{zh:"\u4F7F\u7528\u6307\u5357",en:"Docs"},key:"Docs",isExternal:!0,href:{zh:`${e==null?void 0:e.VITE_DOC_URL_ZH}`,en:`${e==null?void 0:e.VITE_DOC_URL}`},isActive:location.href.startsWith(e==null?void 0:e.VITE_DOC_URL)},{title:{zh:"\u6D66\u6C5F\u79D1\u5B66\u8BC4\u6D4B\u5171\u521B\u8BA1\u5212",en:"AI4S Program"},key:"collaboration",href:`${e==null?void 0:e.VITE_DATA_URL}`,onClick:z,isActive:location.href.startsWith(e==null?void 0:e.VITE_DATA_URL)}],[e,_,h,location.href]),N=g(()=>i===u.blueWeb||i===u.miniWeb||i===u.transparentWeb?l==="en-US"?X:Q:l==="en-US"?ne:te,[i,l]),T=o=>{window.open(o)},$=g(()=>[{key:"llm",label:n.createElement("a",{href:`${e==null?void 0:e.VITE_COMPASS_URL}arena?lang=${l}`},a==null?void 0:a.llmArena)},{key:"mm",label:n.createElement("a",{href:`${e==null?void 0:e.VITE_COMPASS_URL}arena/multimodal?lang=${l}`},a==null?void 0:a.mmArena)},{key:"tcm",label:n.createElement("a",{href:`${e==null?void 0:e.VITE_COMPASS_URL}arena/task?lang=${l}`},a==null?void 0:a.ArenaMode)}],[a==null?void 0:a.llmArena,a==null?void 0:a.mmArena,l,e]);return L(()=>{!v||!localStorage.getItem(`${R}`)&&location.href.startsWith(e==null?void 0:e.VITE_HUB_URL)&&(C(!1),localStorage.setItem(`${R}`,"1"))},[v,e]),n.createElement("header",{className:r(t.header,l==="en-US"&&c&&t.enHeader,t.secondMenu,l!=="en-US"&&c&&t.zhHeader,i!==u.lightWeb&&c&&t.topSecondMenu,i===u.lightWeb&&c&&t.topSecondMenuHub,i===u.lightWeb&&t.lightSecondMenu,i===u.transparentWeb&&!E&&!c&&t.blueBackSecondHeaderBox,i===u.lightWeb&&!E&&!c&&t.lightBackSecondMenu),ref:k},n.createElement("div",{className:t.headerLeft},c&&n.createElement("a",{className:t.logo,href:`${e==null?void 0:e.VITE_COMPASS_URL}?lang=${l}`,onClick:o=>{o.preventDefault(),P(l,"header",e==null?void 0:e.VITE_COMPASS_URL)}},n.createElement("img",{src:N,alt:"logo"})),n.createElement("div",{className:t.menus},S==null?void 0:S.map(o=>n.createElement("a",{key:o.key,className:r(t.menuItem,o.isActive&&t.activeMenuItem),style:{fontWeight:o.href===window.location.origin?600:400},target:o.isExternal?"_blank":"_self",href:`${o.href}${o.isExternal?"":`?lang=${l}`}`,rel:"noreferrer",onClick:j=>{var b,y;j.preventDefault(),o.isExternal?T(l==="zh-CN"?`${(b=o.href)==null?void 0:b.zh}`:`${(y=o.href)==null?void 0:y.en}`):o.onClick&&o.onClick(l,o.key,o.href)}},(o==null?void 0:o.customNode)&&(o==null?void 0:o.customNode),o.title[l==null?void 0:l.split("-")[0]],o.isExternal&&n.createElement(ee,{type:"icon-GotoOutline",style:{marginLeft:4,fontSize:"16px"}}))),v&&n.createElement(n.Fragment,null,n.createElement(D,{overlayClassName:t.arenaDropdown,placement:"bottom",menu:{items:$}},n.createElement("a",{className:r(t.menuItem,location.href.startsWith((e==null?void 0:e.VITE_COMPASS_URL)+"arena")&&t.activeMenuItem),href:`${e==null?void 0:e.VITE_COMPASS_URL}arena?lang=${l}`,onClick:o=>{o.preventDefault(),K(l,{key:"llm"},e==null?void 0:e.VITE_COMPASS_URL)}},n.createElement("div",{className:t.arenaWords},a==null?void 0:a.arena)))),v&&n.createElement("div",{onClick:()=>{F(l,"CompassHub",`${e==null?void 0:e.VITE_HUB_URL}/2025-annual-benchmark`)},className:r(t.yearEvaluation,m&&t.wrapYearEvaluation)},n.createElement("div",{className:t.innerBtn},n.createElement("img",{src:le,className:r(m?t.wrapLeftWing:t.leftWing,t.wing)}),n.createElement("img",{src:re,className:r(m?t.wrapRightWing:t.rightWing,t.wing)})),n.createElement("div",{className:r(m&&t.wrapStyle,t.innerYearEvaluation)},a==null?void 0:a.yearEvaluation),w&&n.createElement(n.Fragment,null,n.createElement("img",{src:se,className:r(m&&t.wrapArrow,t.arrow)}),n.createElement("div",{className:r(m&&t.wrapModalContainer,t.modalContainer)},n.createElement("span",{className:t.title},a==null?void 0:a.yearEvaluationTitle),n.createElement("div",{className:t.body},a==null?void 0:a.yearEvaluationDesc),n.createElement("div",{className:t.footer},n.createElement(V,{className:t.knownButton,type:"primary",onClick:o=>{o.stopPropagation(),C(!1)}},a==null?void 0:a.yearEvaluationKnown))))))),v&&n.createElement("div",{className:t.headerRight},n.createElement("a",{href:`${e==null?void 0:e.VITE_HUB_URL}/dataset-submit?lang=${l}`,className:r(t.addDatasetBtn,t.contributeBtn,m&&t.wrapBtn),onClick:o=>{o.preventDefault(),Y(l,e==null?void 0:e.VITE_HUB_URL)}},a==null?void 0:a.contributeBenchmarks),n.createElement(G,null,n.createElement("div",{className:r(m&&t.wrapBtn,t.addDatasetBtn)},a==null?void 0:a.onlineEvaluation))))};export{f as BigCompassModuleEnum,ie as default};
1
+ import n,{useContext as S,useState as L,useRef as $,useEffect as R,useMemo as I}from"react";import B from"../../extraComponents/button/button.js";import{goCommon as D,goHub as W,goRank as V,goRules as x,goKit as H,goData as M,goOCHome as O,clickArena as z,goAnnualBenchmark as P,clickContributeBenchmarks as K}from"../../google-log/home.js";import t from"./header.module.less.js";import F from"./components/create-online-evaluation/component/evaluation-button/evaluation-button.js";import"./components/create-online-evaluation/component/create-evaluation/create-evaluation.js";import"antd";import"./components/create-online-evaluation/component/pre-create-evaluation/index.module.less.js";import{OcContext as Y}from"../../providers/OcContext.js";import G from"./hooks/useUrl.js";import{OcConfigContext as Z}from"../../providers/OcConfigContext.js";import s from"classnames";import"./firstHeader.module.less.js";import q from"../../assets/svg/newLogo.svg.js";import J from"../../assets/svg/newLogoEn.svg.js";import Q from"../../extraComponents/icon-font/index.js";import X from"../../assets/svg/blueNewLogo.svg.js";import ee from"../../assets/svg/blueNewLogoEn.svg.js";import{useLocation as te}from"react-router-dom";import"@ant-design/icons";import{webTypeEnum as m}from"../../constants/enums.js";import"../../mobile/components/top-nav/top-nav.module.less.js";import"../top-nav/shared.js";import"../top-nav/top-nav.module.less.js";import"react-device-detect";import"../side-nav/side-nav.module.less.js";import"../footer/footer.module.less.js";import"../dropdown/dropdown.module.less.js";import{useSize as oe}from"ahooks";import"../footer-expansion/footer-expansion.module.less.js";import"../md-render/index.js";import"../../helper/index.js";import"./components/create-online-evaluation/component/sidebar/sidebar.module.less.js";import ne from"../../assets/svg/left-wing.svg.js";import ae from"../../assets/svg/right-wing.svg.js";import le from"../../assets/svg/arrow.svg.js";var f;(function(r){r.llm="large-model",r.aiComputingSystem="computing-system",r.embodiedIntelligence="embodied-intelligence",r.industryVerticals="ecosystem/finance",r.safety="safety",r.safetyRank="safety-rank",r.rankDetail="safety/rank",r.evaluationPlan="evaluation-plan"})(f||(f={}));const U="YearEvaluationNotion",se=r=>{const{webType:i,navMenuList:h,isLLM:v,isTop:g,isScrollDown:c}=r,{locales:l}=S(Y),{config:w}=S(Z),[u,p]=L(!1),[N,E]=L(!1),{urls:e}=G(),{pathname:C}=te(),{locale:a}=w,_=$(),d=oe(_);R(()=>{if(a==="zh-CN"){p(!1);return}c?(d==null?void 0:d.width)<1665?p(!0):p(!1):(d==null?void 0:d.width)<1464?p(!0):p(!1)},[d==null?void 0:d.width,c,a]);const k=I(()=>Array.isArray(h)&&h.length>0?h:[{title:{zh:"\u9879\u76EE\u4ECB\u7ECD",en:"Introduction"},key:"largeModel",href:`${e==null?void 0:e.VITE_COMPASS_URL}${f.llm}`,onClick:D,isActive:C.startsWith(f.llm)},{title:{zh:"\u8BC4\u6D4B\u96C6\u793E\u533A",en:"CompassHub"},key:"CompassHub",href:e==null?void 0:e.VITE_HUB_URL,onClick:W,isActive:location.href.startsWith(e==null?void 0:e.VITE_HUB_URL)},{title:{zh:"\u8BC4\u6D4B\u699C\u5355",en:"CompassRank"},key:"CompassRank",href:`${e==null?void 0:e.VITE_RANK_URL}/old-home`,onClick:V,isActive:location.href.startsWith(e==null?void 0:e.VITE_RANK_URL)||location.href.startsWith(e==null?void 0:e.VITE_SPECIAL_LIST_URL)},{title:{zh:"\u699C\u5355\u89C4\u5219",en:"Rules"},key:"Rules",href:`${e==null?void 0:e.VITE_COMPASS_URL}`,onClick:x,isActive:location.href.startsWith(`${e==null?void 0:e.VITE_COMPASS_URL}rule`)},{title:{zh:"\u8BC4\u6D4B\u5DE5\u5177",en:"CompassKit"},key:"CompassKit",isExternal:!0,href:{zh:"https://github.com/open-compass/",en:"https://github.com/open-compass/"},onClick:H,isActive:!1},{title:{zh:"\u4F7F\u7528\u6307\u5357",en:"Docs"},key:"Docs",isExternal:!0,href:{zh:`${e==null?void 0:e.VITE_DOC_URL_ZH}`,en:`${e==null?void 0:e.VITE_DOC_URL}`},isActive:location.href.startsWith(e==null?void 0:e.VITE_DOC_URL)},{title:{zh:"\u6D66\u6C5F\u79D1\u5B66\u8BC4\u6D4B\u5171\u521B\u8BA1\u5212",en:"AI4S Program"},key:"collaboration",href:`${e==null?void 0:e.VITE_DATA_URL}`,onClick:M,isActive:location.href.startsWith(e==null?void 0:e.VITE_DATA_URL)}],[e,C,h,location.href]),A=I(()=>i===m.blueWeb||i===m.miniWeb||i===m.transparentWeb?a==="en-US"?J:q:a==="en-US"?ee:X,[i,a]),T=o=>{window.open(o)};return R(()=>{!v||!localStorage.getItem(`${U}`)&&location.href.startsWith(e==null?void 0:e.VITE_HUB_URL)&&(E(!1),localStorage.setItem(`${U}`,"1"))},[v,e]),n.createElement("header",{className:s(t.header,a==="en-US"&&c&&t.enHeader,t.secondMenu,a!=="en-US"&&c&&t.zhHeader,i!==m.lightWeb&&c&&t.topSecondMenu,i===m.lightWeb&&c&&t.topSecondMenuHub,i===m.lightWeb&&t.lightSecondMenu,i===m.transparentWeb&&!g&&!c&&t.blueBackSecondHeaderBox,i===m.lightWeb&&!g&&!c&&t.lightBackSecondMenu),ref:_},n.createElement("div",{className:t.headerLeft},c&&n.createElement("a",{className:t.logo,href:`${e==null?void 0:e.VITE_COMPASS_URL}old-home?lang=${a}`,onClick:o=>{o.preventDefault(),O(a,"header",`${e==null?void 0:e.VITE_COMPASS_URL}old-home`)}},n.createElement("img",{src:A,alt:"logo"})),n.createElement("div",{className:t.menus},k==null?void 0:k.map(o=>n.createElement("a",{key:o.key,className:s(t.menuItem,o.isActive&&t.activeMenuItem),style:{fontWeight:o.href===window.location.origin?600:400},target:o.isExternal?"_blank":"_self",href:`${o.href}${o.isExternal?"":`?lang=${a}`}`,rel:"noreferrer",onClick:j=>{var b,y;j.preventDefault(),o.isExternal?T(a==="zh-CN"?`${(b=o.href)==null?void 0:b.zh}`:`${(y=o.href)==null?void 0:y.en}`):o.onClick&&o.onClick(a,o.key,o.href)}},(o==null?void 0:o.customNode)&&(o==null?void 0:o.customNode),o.title[a==null?void 0:a.split("-")[0]],o.isExternal&&n.createElement(Q,{type:"icon-GotoOutline",style:{marginLeft:4,fontSize:"16px"}}))),v&&n.createElement(n.Fragment,null,n.createElement("a",{className:s(t.menuItem,location.href.startsWith((e==null?void 0:e.VITE_COMPASS_URL)+"arena")&&t.activeMenuItem),href:`${e==null?void 0:e.VITE_COMPASS_URL}arena?lang=${a}`,onClick:o=>{o.preventDefault(),z(a,{key:"llm"},e==null?void 0:e.VITE_COMPASS_URL)}},n.createElement("div",{className:t.arenaWords},l==null?void 0:l.arena))),v&&n.createElement("div",{onClick:()=>{P(a,"CompassHub",`${e==null?void 0:e.VITE_HUB_URL}/2025-annual-benchmark`)},className:s(t.yearEvaluation,u&&t.wrapYearEvaluation)},n.createElement("div",{className:t.innerBtn},n.createElement("img",{src:ne,className:s(u?t.wrapLeftWing:t.leftWing,t.wing)}),n.createElement("img",{src:ae,className:s(u?t.wrapRightWing:t.rightWing,t.wing)})),n.createElement("div",{className:s(u&&t.wrapStyle,t.innerYearEvaluation)},l==null?void 0:l.yearEvaluation),N&&n.createElement(n.Fragment,null,n.createElement("img",{src:le,className:s(u&&t.wrapArrow,t.arrow)}),n.createElement("div",{className:s(u&&t.wrapModalContainer,t.modalContainer)},n.createElement("span",{className:t.title},l==null?void 0:l.yearEvaluationTitle),n.createElement("div",{className:t.body},l==null?void 0:l.yearEvaluationDesc),n.createElement("div",{className:t.footer},n.createElement(B,{className:t.knownButton,type:"primary",onClick:o=>{o.stopPropagation(),E(!1)}},l==null?void 0:l.yearEvaluationKnown))))))),v&&n.createElement("div",{className:t.headerRight},n.createElement("a",{href:`${e==null?void 0:e.VITE_HUB_URL}/dataset-submit?lang=${a}`,className:s(t.addDatasetBtn,t.contributeBtn,u&&t.wrapBtn),onClick:o=>{o.preventDefault(),K(a,e==null?void 0:e.VITE_HUB_URL)}},l==null?void 0:l.contributeBenchmarks),n.createElement(F,null,n.createElement("div",{className:s(u&&t.wrapBtn,t.addDatasetBtn)},l==null?void 0:l.onlineEvaluation))))};export{f as BigCompassModuleEnum,se as default};
@@ -1 +1 @@
1
- import n,{useContext as u,useEffect as E,useMemo as p}from"react";import{OcConfigContext as k}from"../../providers/OcConfigContext.js";import o from"./side-nav.module.less.js";import N from"../header/hooks/useUrl.js";import m from"classnames";import r from"../../extraComponents/icon-font/index.js";import{OcContext as f}from"../../providers/OcContext.js";const g=s=>{const{setConfig:d,config:v}=u(k),{locales:i}=u(f);E(()=>{d(s)},[s]);const{urls:e}=N(),{locale:t}=v,c=p(()=>[{title:i==null?void 0:i.onlineEvaluation,subMenus:[{icon:"icon-OC_MyEvaluation",title:{"en-US":"Evaluation","zh-CN":"\u6211\u7684\u8BC4\u6D4B"},key:"/online-evaluation",navigate:`${e==null?void 0:e.VITE_RANK_URL}/online-evaluation?lang=${t}`},{icon:"icon-OC_Benchmark",title:{"en-US":"Benchmark","zh-CN":"\u6211\u7684\u8BC4\u6D4B\u96C6"},key:"/benchmarks",navigate:`${e==null?void 0:e.VITE_HUB_URL}/benchmarks?lang=${t}`},{icon:"icon-moxingModel",title:{"en-US":"Model","zh-CN":"\u6211\u7684\u6A21\u578B"},key:"/models",navigate:`${e==null?void 0:e.VITE_RANK_URL}/models?lang=${t}`}]},{title:i==null?void 0:i.scienceCommit,subMenus:[{icon:"icon-tijiaojiluSubmission",title:{"en-US":"Submission Record","zh-CN":"\u63D0\u4EA4\u8BB0\u5F55"},key:"/data-list",navigate:`${e==null?void 0:e.VITE_DATA_URL}/data-list?lang=${t}`}]}],[t,e,i]),C=()=>window.open(`${e==null?void 0:e.VITE_RANK_URL}/feedback?lang=${t}`);return n.createElement("div",{className:o.menu},c==null?void 0:c.map(l=>n.createElement("div",{key:l==null?void 0:l.title,className:m(o.menuItem)},n.createElement("div",{className:o.title},l.title),l.subMenus.map(a=>n.createElement("div",{className:m(o.subMenu,window.location.pathname.includes(a.key)&&o.active),onClick:()=>window.location.replace(a.navigate)},n.createElement(r,{className:o.icon,type:a.icon}),n.createElement("span",{className:o.subMenuTitle},a.title[t]))))),n.createElement("div",{className:o.menuFooter,onClick:C},n.createElement(r,{type:"icon-FeedbackOutlined"}),n.createElement("span",null,t==="zh-CN"?"\u610F\u89C1\u53CD\u9988":"Feedback")))};export{g as default};
1
+ import n,{useContext as m,useEffect as E,useMemo as f}from"react";import{OcConfigContext as N}from"../../providers/OcConfigContext.js";import a from"./side-nav.module.less.js";import h from"../header/hooks/useUrl.js";import r from"classnames";import d from"../../extraComponents/icon-font/index.js";import{OcContext as R}from"../../providers/OcContext.js";import{getRankRoutePath as v,buildRankUrl as C,getHubRoutePath as b,buildHubUrl as U,getDataRoutePath as _,buildDataUrl as y}from"../../helper/rankRoute.js";const B=c=>{const{setConfig:k,config:p}=m(N),{locales:l}=m(R);E(()=>{k(c)},[c]);const{urls:e}=h(),{locale:o,isNew:t=!1}=p,u=f(()=>[{title:l==null?void 0:l.onlineEvaluation,subMenus:[{icon:"icon-OC_MyEvaluation",title:{"en-US":"Evaluation","zh-CN":"\u6211\u7684\u8BC4\u6D4B"},key:v("/online-evaluation",t),navigate:C(e==null?void 0:e.VITE_RANK_URL,"/online-evaluation",{isNew:t,lang:o})},{icon:"icon-OC_Benchmark",title:{"en-US":"Benchmark","zh-CN":"\u6211\u7684\u8BC4\u6D4B\u96C6"},key:b("/benchmarks",t),navigate:U(e==null?void 0:e.VITE_HUB_URL,"/benchmarks",{isNew:t,lang:o})},{icon:"icon-moxingModel",title:{"en-US":"Model","zh-CN":"\u6211\u7684\u6A21\u578B"},key:v("/models",t),navigate:C(e==null?void 0:e.VITE_RANK_URL,"/models",{isNew:t,lang:o})}]},{title:l==null?void 0:l.scienceCommit,subMenus:[{icon:"icon-tijiaojiluSubmission",title:{"en-US":"Submission Record","zh-CN":"\u63D0\u4EA4\u8BB0\u5F55"},key:_("/data-list",t),navigate:y(e==null?void 0:e.VITE_DATA_URL,"/data-list",{isNew:t,lang:o})}]}],[o,e,l,t]),g=()=>window.open(`${e==null?void 0:e.VITE_RANK_URL}/feedback?lang=${o}`);return n.createElement("div",{className:a.menu},u==null?void 0:u.map(i=>n.createElement("div",{key:i==null?void 0:i.title,className:r(a.menuItem)},n.createElement("div",{className:a.title},i.title),i.subMenus.map(s=>n.createElement("div",{className:r(a.subMenu,window.location.pathname.includes(s.key)&&a.active),onClick:()=>window.location.replace(s.navigate)},n.createElement(d,{className:a.icon,type:s.icon}),n.createElement("span",{className:a.subMenuTitle},s.title[o]))))),n.createElement("div",{className:a.menuFooter,onClick:g},n.createElement(d,{type:"icon-FeedbackOutlined"}),n.createElement("span",null,o==="zh-CN"?"\u610F\u89C1\u53CD\u9988":"Feedback")))};export{B as default};
@@ -1 +1 @@
1
- const t=(o,n,e)=>{window.gtag("event","go_OC",{event_source:n}),window.location.href=`${e}?lang=${o}`},a=(o,n,e)=>{window.gtag("go_rank",{event_source:n}),window.location.href=`${e}?lang=${o}`},g=(o,n,e)=>{window.gtag("go_hub",{event_source:n}),window.location.href=`${e}?lang=${o}`},i=(o,n,e)=>{window.gtag("go_hub",{event_source:n}),window.location.href=`${e}?lang=${o}`},c=(o,n,e)=>{window.gtag("go_kit",{event_source:n}),window.open(`${e}?lang=${o}`)},w=(o,n)=>{window.gtag("contribute_benchmarks",{event_source:"header"}),window.location.href=`${n}/dataset-submit?lang=${o}`},r=(o,n,e)=>{window.gtag("go_rules",{event_source:n}),window.location.href=`${e}rule?lang=${o}`},l=(o,n,e)=>{window.gtag("click_arena",{event_source:"rank-header"}),n==="mm"?window.location.href=`${e}arena/multimodal?lang=${o}`:window.location.href=`${e}arena?lang=${o}`},s=(o,n,e)=>{window.gtag("go_collaboration",{event_source:"collaboration"}),window.location.href=`${e}?lang=${o}`},d=(o,n,e)=>{window.gtag("go_collaboration",{event_source:n}),window.location.href=`${e}?lang=${o}`},$=(o,n,e)=>{window.gtag("goInternDiscoveryEvalKit",{event_source:n}),window.open(`${e}?lang=${o}`)};export{l as clickArena,w as clickContributeBenchmarks,i as goAnnualBenchmark,d as goCommon,s as goData,g as goHub,$ as goInternDiscoveryEvalKit,c as goKit,t as goOCHome,a as goRank,r as goRules};
1
+ const t=(o,n,e)=>{window.gtag("event","go_OC",{event_source:n}),window.location.href=`${e}?lang=${o}`},c=(o,n,e)=>{window.gtag("go_rank",{event_source:n});const a=e.replace(/\/$/,"").replace(/\/old-home$/,"");window.location.href=`${a}/old-home?lang=${o}`},g=(o,n,e)=>{window.gtag("go_hub",{event_source:n}),window.location.href=`${e}?lang=${o}`},i=(o,n,e)=>{window.gtag("go_hub",{event_source:n}),window.location.href=`${e}?lang=${o}`},r=(o,n,e)=>{window.gtag("go_kit",{event_source:n}),window.open(`${e}?lang=${o}`)},w=(o,n)=>{window.gtag("contribute_benchmarks",{event_source:"header"}),window.location.href=`${n}/dataset-submit?lang=${o}`},l=(o,n,e)=>{window.gtag("go_rules",{event_source:n}),window.location.href=`${e}rule?lang=${o}`},s=(o,n,e)=>{window.gtag("click_arena",{event_source:"rank-header"}),n==="mm"?window.location.href=`${e}arena/multimodal?lang=${o}`:window.location.href=`${e}arena?lang=${o}`},d=(o,n,e)=>{window.gtag("go_collaboration",{event_source:"collaboration"}),window.location.href=`${e}?lang=${o}`},$=(o,n,e)=>{window.gtag("go_collaboration",{event_source:n}),window.location.href=`${e}?lang=${o}`},u=(o,n,e)=>{window.gtag("goInternDiscoveryEvalKit",{event_source:n}),window.open(`${e}?lang=${o}`)};export{s as clickArena,w as clickContributeBenchmarks,i as goAnnualBenchmark,$ as goCommon,d as goData,g as goHub,u as goInternDiscoveryEvalKit,r as goKit,t as goOCHome,c as goRank,l as goRules};
@@ -0,0 +1 @@
1
+ const c=(e,t=!1)=>t?e:e.replace(/^\/evaluation-result/,"/old-evaluation-result").replace(/^\/online-evaluation/,"/old-online-evaluation").replace(/^\/models/,"/old-models").replace(/^\/create/,"/old-create"),i=(e,t=!1)=>t?e:e.replace(/^\/benchmarks/,"/old-benchmarks"),d=(e,t=!1)=>t?e:e.replace(/^\/data-list/,"/old-data-list"),l=(e,t,r,n)=>{const{isNew:f=!1,lang:o,searchParams:s}=n!=null?n:{},b=r(t,f),a=new URLSearchParams;o&&a.set("lang",o),s&&Object.entries(s).forEach(([m,g])=>{a.set(m,g)});const u=a.toString();return`${e}${b}${u?`?${u}`:""}`},h=(e,t,r)=>l(e,t,c,r),P=(e,t,r)=>l(e,t,i,r),R=(e,t,r)=>l(e,t,d,r);export{R as buildDataUrl,P as buildHubUrl,h as buildRankUrl,d as getDataRoutePath,i as getHubRoutePath,c as getRankRoutePath};
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- export{default as OcHeader}from"./components/header/index.js";export{default as OcTopNav}from"./components/top-nav/index.js";export{default as OcOnlineEvaluation}from"./components/online-evaluation/index.js";export{default as OcSideNav}from"./components/side-nav/index.js";export{default as OcFooter}from"./components/footer/index.js";export{default as OcDropdown}from"./components/dropdown/dropdown.js";export{goData,goHub,goInternDiscoveryEvalKit,goKit,goOCHome,goRank,goRules}from"./google-log/home.js";export{default as OcFooterExpansion}from"./components/footer-expansion/index.js";export{default as OcMdRender}from"./components/md-render/index.js";export{envTypeEnum,evaluationTypeEnum,langTypeEnum,topNavActiveKeyEnum,webTypeEnum}from"./constants/enums.js";export{TOP_NAV_LOCALE_STORAGE_KEY}from"./constants/storage.js";export{getMenuData}from"./helper/index.js";
1
+ export{default as OcHeader}from"./components/header/index.js";export{default as OcTopNav}from"./components/top-nav/index.js";export{default as OcOnlineEvaluation}from"./components/online-evaluation/index.js";export{default as OcSideNav}from"./components/side-nav/index.js";export{default as OcFooter}from"./components/footer/index.js";export{default as OcDropdown}from"./components/dropdown/dropdown.js";export{goData,goHub,goInternDiscoveryEvalKit,goKit,goOCHome,goRank,goRules}from"./google-log/home.js";export{default as OcFooterExpansion}from"./components/footer-expansion/index.js";export{default as OcMdRender}from"./components/md-render/index.js";export{envTypeEnum,evaluationTypeEnum,langTypeEnum,topNavActiveKeyEnum,webTypeEnum}from"./constants/enums.js";export{TOP_NAV_LOCALE_STORAGE_KEY}from"./constants/storage.js";export{getMenuData}from"./helper/index.js";export{buildDataUrl,buildHubUrl,buildRankUrl,getDataRoutePath,getHubRoutePath,getRankRoutePath}from"./helper/rankRoute.js";
@@ -0,0 +1,32 @@
1
+ /**
2
+ * 根据 isNew 返回 Rank 站点路由路径。
3
+ * isNew 为 true 时使用新路由;为 false 时使用 old- 前缀路由,默认 false。
4
+ */
5
+ declare const getRankRoutePath: (path: string, isNew?: boolean) => string;
6
+ /**
7
+ * 根据 isNew 返回 Hub 站点路由路径。
8
+ * isNew 为 true 时使用新路由;为 false 时使用 old- 前缀路由,默认 false。
9
+ */
10
+ declare const getHubRoutePath: (path: string, isNew?: boolean) => string;
11
+ /**
12
+ * 根据 isNew 返回 Data 站点路由路径。
13
+ * isNew 为 true 时使用新路由;为 false 时使用 old- 前缀路由,默认 false。
14
+ */
15
+ declare const getDataRoutePath: (path: string, isNew?: boolean) => string;
16
+ declare const buildRankUrl: (rankBaseUrl: string, path: string, options?: {
17
+ isNew?: boolean;
18
+ lang?: string;
19
+ searchParams?: Record<string, string>;
20
+ }) => string;
21
+ declare const buildHubUrl: (hubBaseUrl: string, path: string, options?: {
22
+ isNew?: boolean;
23
+ lang?: string;
24
+ searchParams?: Record<string, string>;
25
+ }) => string;
26
+ declare const buildDataUrl: (dataBaseUrl: string, path: string, options?: {
27
+ isNew?: boolean;
28
+ lang?: string;
29
+ searchParams?: Record<string, string>;
30
+ }) => string;
31
+
32
+ export { buildDataUrl, buildHubUrl, buildRankUrl, getDataRoutePath, getHubRoutePath, getRankRoutePath };
@@ -11,6 +11,7 @@ import { envTypeEnum, langTypeEnum, webTypeEnum, topNavActiveKeyEnum } from './c
11
11
  export { envTypeEnum, evaluationTypeEnum, langTypeEnum, topNavActiveKeyEnum, webTypeEnum } from './constants/enums.js';
12
12
  export { TOP_NAV_LOCALE_STORAGE_KEY } from './constants/storage.js';
13
13
  export { getMenuData } from './helper/index.js';
14
+ export { buildDataUrl, buildHubUrl, buildRankUrl, getDataRoutePath, getHubRoutePath, getRankRoutePath } from './helper/rankRoute.js';
14
15
 
15
16
  interface DefaultRespDTO<T> {
16
17
  msgCode: number;
@@ -79,17 +80,23 @@ interface HeaderProps {
79
80
  navMenuList?: SubMenu[];
80
81
  isLLM: boolean;
81
82
  isDefaultShowSecondMenu?: boolean;
83
+ /** true 使用新路由;false 使用 old- 前缀路由,默认 false */
84
+ isNew?: boolean;
82
85
  }
83
86
  interface OnlineEvaluationProps {
84
87
  envType: envTypeEnum;
85
88
  webType: webTypeEnum;
86
89
  locale: langTypeEnum;
87
90
  children?: React.ReactElement;
91
+ /** true 使用新路由;false 使用 old- 前缀路由,默认 false */
92
+ isNew?: boolean;
88
93
  }
89
94
  interface SideNavProps {
90
95
  locale: langTypeEnum;
91
96
  envType: envTypeEnum;
92
97
  children?: React.ReactElement;
98
+ /** true 使用新路由;false 使用 old- 前缀路由,默认 false */
99
+ isNew?: boolean;
93
100
  }
94
101
  type TopNavLinkTarget = '_self' | '_blank';
95
102
  interface DropdownItem {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opencompass-fe/oc-webkit-eval",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Provide some common components for oc",
5
5
  "repository": {
6
6
  "type": "git",
@@ -15,7 +15,7 @@
15
15
  "scripts": {
16
16
  "dev": "cross-env NODE_ENV=developemnt rollup -m -c rollup.config.js -w",
17
17
  "build": "rimraf dist && rimraf es && cross-env NODE_ENV=production rollup -c rollup.config.js",
18
- "publish": "npm run build && npm publish",
18
+
19
19
  "test": "tsc --project ./tsconfig.test.json && jest",
20
20
  "lint": "eslint 'src/**/*.{ts,tsx,js,jsx}' && npm run build:type",
21
21
  "lint:fix": "eslint src/**/*.{ts,tsx,js,jsx} --fix",