@ttmg/cli 0.3.2-beta.1 → 0.3.2-beta.12
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/CHANGELOG.md +16 -0
- package/dist/index.js +8404 -1071
- package/dist/index.js.map +1 -1
- package/dist/package.json +8 -3
- package/dist/public/assets/index-B7gDE9jg.js +1 -0
- package/dist/public/assets/index-BB5kLk47.css +1 -0
- package/dist/public/assets/index-BGB_3rmy.js +23 -0
- package/dist/public/assets/index-BGB_3rmy.js.br +0 -0
- package/dist/public/assets/index-BGxy8aq-.js +1 -0
- package/dist/public/assets/index-BGxy8aq-.js.br +0 -0
- package/dist/public/assets/index-BPf4cmgA.css +1 -0
- package/dist/public/assets/index-Be7GH3NR.js +1 -0
- package/dist/public/assets/index-Bf6aJOeV.css +1 -0
- package/dist/public/assets/index-BkiB8M4Y.css +1 -0
- package/dist/public/assets/index-BkiB8M4Y.css.br +0 -0
- package/dist/public/assets/index-Bq6YxKLX.css +1 -0
- package/dist/public/assets/index-BwbPFgZF.css +1 -0
- package/dist/public/assets/index-C-hKdJe4.js +1 -0
- package/dist/public/assets/index-C250u6X0.css +1 -0
- package/dist/public/assets/index-C250u6X0.css.br +0 -0
- package/dist/public/assets/index-C8f539tK.css +1 -0
- package/dist/public/assets/index-CZeMe3yb.js +1 -0
- package/dist/public/assets/index-CZeMe3yb.js.br +0 -0
- package/dist/public/assets/index-DCvzzS3c.js +1 -0
- package/dist/public/assets/index-DCvzzS3c.js.br +0 -0
- package/dist/public/assets/index-DPSts5Re.css +1 -0
- package/dist/public/assets/index-DPSts5Re.css.br +0 -0
- package/dist/public/assets/index-DTYGiGBE.js +1 -0
- package/dist/public/assets/index-DXFg6tGR.css +1 -0
- package/dist/public/assets/index-DZh72DCT.js +1 -0
- package/dist/public/assets/index-NjsKimh-.js +1 -0
- package/dist/public/assets/index-dPxUjVAV.js +1 -0
- package/dist/public/assets/index-sz2rmYug.js +1 -0
- package/dist/public/assets/index-yh4tKekV.css +1 -0
- package/dist/public/index.html +2 -2
- package/dist/scripts/build.js +23 -0
- package/dist/scripts/resetLocalState.js +48 -0
- package/dist/scripts/setup.js +30 -0
- package/dist/scripts/test-protocol.js +29 -0
- package/dist/scripts/test-regression.js +94 -0
- package/dist/scripts/test-regression.ts +93 -0
- package/dist/scripts/worker.js +62 -12
- package/package.json +8 -3
- package/dist/public/assets/index-9wLHKdTg.css +0 -1
- package/dist/public/assets/index-9wLHKdTg.css.br +0 -0
- package/dist/public/assets/index-B_lMekya.js +0 -67
- package/dist/public/assets/index-B_lMekya.js.br +0 -0
- package/dist/public/assets/index-Cuov3ysP.js +0 -67
- package/dist/public/assets/index-Cuov3ysP.js.br +0 -0
- package/dist/public/assets/index-D51pZ7N1.css +0 -1
- package/dist/public/assets/index-D51pZ7N1.css.br +0 -0
- package/dist/public/assets/index-D5if59dO.js +0 -67
- package/dist/public/assets/index-D5if59dO.js.br +0 -0
- package/dist/public/assets/index-D7VJivFN.js +0 -67
- package/dist/public/assets/index-D7VJivFN.js.br +0 -0
- package/dist/public/assets/index-D9N96fJ2.js +0 -67
- package/dist/public/assets/index-D9N96fJ2.js.br +0 -0
- package/dist/public/assets/index-DER-DYLd.css +0 -1
- package/dist/public/assets/index-DER-DYLd.css.br +0 -0
- package/dist/public/assets/index-YhxvkywD.js +0 -67
- package/dist/public/assets/index-YhxvkywD.js.br +0 -0
- package/dist/public/assets/index-sCifET6h.css +0 -1
- package/dist/public/assets/index-sCifET6h.css.br +0 -0
- /package/dist/{template → openDataContext/template}/open_context.html.hbs +0 -0
- /package/dist/{template → openDataContext/template}/open_context_sdk.js.hbs +0 -0
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.check-result-group{margin-bottom:18px}.check-result-title{display:flex;align-items:center;font-weight:500;margin-bottom:8px}.check-result-item{display:flex;align-items:center;padding:8px}.show-more-text-btn{position:absolute;left:0;bottom:0;right:0;display:block;padding:24px;border:none;border-radius:2px;cursor:pointer;font-size:14px;text-align:center;text-decoration:none;transition:all .3s ease;background-image:linear-gradient(to top,#fff,#ffffffb3);-webkit-backdrop-filter:blur(10px);box-shadow:0 0 #0003}.check-code-banner-section{padding:12px 24px}.check-code-banner-section-title{font-size:16px;font-weight:500;line-height:24px;color:#222}.check-code-banner-section-desc{padding-bottom:8px;padding-left:12px;padding-top:8px}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{G as ge,r as b,B as Te,a as oe,l as z,H as V,J as ye,R as a,b as le,K as Oe,M as _e,c as K,O as Ae,Q as be,P as o,t as S,U as De,V as ie,W as ae,A as Pe,m as re,X as ce,L as je,s as He,j as u,Y as ee,u as Me,w as Le,Z as Re,d as Ve,i as W,D as ke}from"./index-BGB_3rmy.js";import{D as se}from"./index-Be7GH3NR.js";function $e(p){return b.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},p),b.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 4.5a7.5 7.5 0 1 1-7.07 10 1.5 1.5 0 0 0-2.83 1 10.5 10.5 0 1 0 1.27-9.48l-.43-1.45a1.5 1.5 0 1 0-2.88.86l1.5 5c.23.74.98 1.2 1.73 1.04l5-1a1.5 1.5 0 0 0-.58-2.94l-2.01.4A7.5 7.5 0 0 1 12 4.5Zm1.5 3a1.5 1.5 0 0 0-3 0V12c0 .4.16.78.44 1.06l3 3a1.5 1.5 0 0 0 2.12-2.12l-2.56-2.56V7.5Z",fill:"currentColor"}))}const Fe=ge($e,"history");function Ge(p){return b.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},p),b.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5 2h14a3 3 0 0 1 3 3v14a3 3 0 0 1-3 3H5a3 3 0 0 1-3-3V5a3 3 0 0 1 3-3Zm1 2a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1V5a1 1 0 0 0-1-1H6Z",fill:"currentColor"}))}const Ze=ge(Ge,"sidebar"),de="horizontal",pe="vertical",x={PREFIX:`${Te}-navigation`},h={MODE:[pe,de],MODE_VERTICAL:pe,MODE_HORIZONTAL:de,ICON_POS_LEFT:"left",ICON_POS_RIGHT:"right",TOGGLE_ICON_LEFT:"left",TOGGLE_ICON_RIGHT:"right"},$={DEFAULT_SUBNAV_MAX_HEIGHT:999,DEFAULT_TOOLTIP_SHOW_DELAY:0,DEFAULT_TOOLTIP_HIDE_DELAY:100,DEFAULT_SUBNAV_OPEN_DELAY:0,DEFAULT_SUBNAV_CLOSE_DELAY:100},ue={open:"chevron_up",closed:"chevron_down"};let Be=class ne{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};(t==null||typeof t!="object")&&(t={text:t,itemKey:t,maxHeight:$.DEFAULT_SUBNAV_MAX_HEIGHT,link:null,items:null,icon:"",indent:!1});for(const e of Object.keys(t))this[e]=t[e];t.items&&Array.isArray(t.items)&&t.items.length?(this.items=t.items.map(e=>new ne(e)),"toggleIcon"in t?this.toggleIcon=ne.isValidToggleIcon(t.toggleIcon)?Object.assign({},t.toggleIcon):Object.assign({},ue):this.toggleIcon=Object.assign({},ue)):this.items=null}static isValidToggleIcon(t){return!!(t&&typeof t=="object"&&typeof t.open=="string"&&t.open.length&&typeof t.closed=="string"&&t.closed.length)}};class F extends oe{constructor(t){super(Object.assign({},t))}static getZeroParentKeys(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const e=[];for(var s=arguments.length,n=new Array(s>1?s-1:0),i=1;i<s;i++)n[i-1]=arguments[i];if(n.length){for(const l of n)if(Array.isArray(t[l])&&t[l].length){const r=t[l][0];V(r)||e.push(r)}}return e}static buildItemKeysMap(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"itemKey";var i;if(Array.isArray(t)&&t.length)for(const l of t)if(Array.isArray(l))F.buildItemKeysMap(l,e,[...s],n);else{let r;if(l&&typeof l=="object"&&(r=l[n]||l.props&&l.props[n]),r){e[r]=[...s];const c=(i=l.props)===null||i===void 0?void 0:i.children;if(Array.isArray(l.items)&&l.items.length)F.buildItemKeysMap(l.items,e,[...s,r],n);else if(c){const d=Array.isArray(c)?c:[c];F.buildItemKeysMap(d,e,[...s,r],n)}}}return e}init(t){const{defaultSelectedKeys:e,selectedKeys:s}=this.getProps();let n=s||e||[];const{itemKeysMap:i,willOpenKeys:l,formattedItems:r}=this.getCalcState(),c=this.selectLevelZeroParentKeys(i,n);if(n=n.concat(c),t==="constructor")return{selectedKeys:n,itemKeysMap:i,openKeys:l,items:r};this._adapter.updateSelectedKeys(n,!1),this._adapter.setItemKeysMap(i),this._adapter.updateOpenKeys(l),this._adapter.updateItems(r),this._adapter.setItemsChanged(!0)}getCalcState(){const{itemKeysMap:t,formattedItems:e}=this.getFormattedItems(),s=this.getWillOpenKeys(t);return{itemKeysMap:t,willOpenKeys:s,formattedItems:e}}getFormattedItems(){const{items:t,children:e}=this.getProps(),s=this.formatItems(t),n=Array.isArray(t)&&t.length?s:e;return{itemKeysMap:F.buildItemKeysMap(n),formattedItems:s}}getWillOpenKeys(t){const{defaultOpenKeys:e,openKeys:s,defaultSelectedKeys:n,selectedKeys:i,mode:l}=this.getProps(),{openKeys:r=[]}=this.getStates();let c=s||e||[];if(!(Array.isArray(e)||Array.isArray(s))&&l===h.MODE_VERTICAL&&(Array.isArray(n)||Array.isArray(i))){const d=Array.isArray(i)?i:n;c=r.concat(this.getShouldOpenKeys(t,d)),c=Array.from(new Set(c))}return[...c]}getShouldOpenKeys(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const s=new Set;return Array.isArray(e)&&e.length&&e.forEach(n=>{if(n){const i=z(t,n);Array.isArray(i)&&i.forEach(l=>s.add(l))}}),[...s]}destroy(){}selectLevelZeroParentKeys(t,e){const s=V(t)?this.getState("itemKeysMap"):t,n=[];if(e.length){for(const i of e)if(Array.isArray(s[i])&&s[i].length){const l=s[i][0];V(l)||n.push(l)}}return n.length?n:[]}formatItems(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];const e=[];for(const s of t)e.push(new Be(s));return e}handleSelect(t){this._adapter.notifySelect(t)}judgeIfOpen(t,e){let s=!1;const n=Array.isArray(t)?t:t&&[t];if(n&&Array.isArray(e)&&e.length){for(const i of e)if(s=n.includes(i.itemKey)||this.judgeIfOpen(n,i.items),s)break}return s}handleCollapseChange(){const t=!this.getState("isCollapsed");this._isControlledComponent("isCollapsed")||this._adapter.setIsCollapsed(t),this._adapter.notifyCollapseChange(t)}handleItemsChange(t){this._adapter.setItemsChanged(t)}}const he=function(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];const e=new Set(t);for(var s=arguments.length,n=new Array(s>1?s-1:0),i=1;i<s;i++)n[i-1]=arguments[i];return n.forEach(l=>l&&e.add(l)),Array.from(e)},me=function(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];const e=new Set(t);for(var s=arguments.length,n=new Array(s>1?s-1:0),i=1;i<s;i++)n[i-1]=arguments[i];return n.forEach(l=>l&&e.delete(l)),Array.from(e)};class Ue extends oe{constructor(t){super(Object.assign({},t))}init(){this._timer=null}destroy(){this.clearDelayTimer()}clearDelayTimer(){this._timer&&(clearTimeout(this._timer),this._timer=null)}isValidKey(t){return t!=null&&(typeof t=="number"||typeof t=="string")}handleDropdownVisibleChange(t){const e=this.getProp("itemKey"),s=this._adapter.getOpenKeysIsControlled(),n=this._adapter.getCanUpdateOpenKeys(),i=this._adapter.getOpenKeys(),l=t?he(i,e):me(i,e);this.clearDelayTimer(),s||n&&this._adapter.updateOpen(t),this._adapter.notifyGlobalOpenChange({itemKey:e,openKeys:l,isOpen:t})}handleClick(t,e){const{itemKey:s,disabled:n}=this.getProps();if(n)return;const i=e&&e.contains(t.target);let l=!!this._adapter.getIsOpen();i?l=!l:l=!1;const r=l?he(this._adapter.getOpenKeys(),s):me(this._adapter.getOpenKeys(),s),c={itemKey:s,openKeys:r,isOpen:l,domEvent:t},d=this._adapter.getOpenKeysIsControlled(),m=this._adapter.getCanUpdateOpenKeys();!d&&m&&this._adapter.updateOpen(l),this._adapter.notifyGlobalOpenChange(c),this._adapter.notifyGlobalOnClick(c)}handleKeyPress(t,e){ye(t)&&this.handleClick(t,e)}}class Xe extends oe{constructor(t){super(Object.assign({},t))}init(){this._timer=null,this._mounted=!0}destroy(){this._mounted=!1}isValidKey(t){return t!=null&&(typeof t=="string"||typeof t=="number")}handleClick(t){const{isSubNav:e,itemKey:s,text:n,disabled:i}=this.getProps();if(i)return;!e&&this.isValidKey(s)&&!this._adapter.getSelectedKeysIsControlled()&&!this._adapter.getSelected()&&this._adapter.updateSelected(!0);const l=[s];if(!e){if(!this._adapter.getSelected()){const r=[this._adapter.cloneDeep(this.getProps())];this._adapter.notifyGlobalOnSelect({itemKey:s,selectedKeys:l,selectedItems:r,domEvent:t})}this._adapter.notifyGlobalOnClick({itemKey:s,text:n,domEvent:t})}this._adapter.notifyClick({itemKey:s,text:n,domEvent:t})}handleKeyPress(t){if(ye(t)){const{link:e,linkOptions:s}=this.getProps(),n=z(s,"target","_self");this.handleClick(t),typeof e=="string"&&(n==="_blank"?window.open(e):window.location.href=e)}}}const G=a.createContext({isCollapsed:!1,selectedKeys:[],openKeys:[]}),y=`${x.PREFIX}-item`;class Z extends le{constructor(t){super(t),this.setItemRef=e=>{this.props.forwardRef&&this.props.forwardRef(e)},this.wrapTooltip=e=>{const{text:s,tooltipHideDelay:n,tooltipShowDelay:i}=this.props,l=n??this.context.tooltipHideDelay,r=i??this.context.tooltipShowDelay;return a.createElement(Oe,{content:s,wrapWhenSpecial:!1,position:"right",trigger:"hover",mouseEnterDelay:r,mouseLeaveDelay:l},e)},this.handleClick=e=>this.foundation.handleClick(e),this.handleKeyPress=e=>this.foundation.handleKeyPress(e),this.state={tooltipShow:!1},this.foundation=new Xe(this.adapter)}_invokeContextFunc(t){if(t&&this.context&&typeof this.context[t]=="function"){for(var e=arguments.length,s=new Array(e>1?e-1:0),n=1;n<e;n++)s[n-1]=arguments[n];return this.context[t](...s)}return null}get adapter(){var t=this;return Object.assign(Object.assign({},super.adapter),{cloneDeep:_e,updateTooltipShow:e=>this.setState({tooltipShow:e}),updateSelected:e=>this._invokeContextFunc("updateSelectedKeys",[this.props.itemKey]),updateGlobalSelectedKeys:e=>this._invokeContextFunc("updateSelectedKeys",[...e]),getSelectedKeys:()=>this.context&&this.context.selectedKeys,getSelectedKeysIsControlled:()=>this.context&&this.context.selectedKeysIsControlled,notifyGlobalOnSelect:function(){for(var e=arguments.length,s=new Array(e),n=0;n<e;n++)s[n]=arguments[n];return t._invokeContextFunc("onSelect",...s)},notifyGlobalOnClick:function(){for(var e=arguments.length,s=new Array(e),n=0;n<e;n++)s[n]=arguments[n];return t._invokeContextFunc("onClick",...s)},notifyClick:function(){return t.props.onClick(...arguments)},notifyMouseEnter:function(){return t.props.onMouseEnter(...arguments)},notifyMouseLeave:function(){return t.props.onMouseLeave(...arguments)},getIsCollapsed:()=>this.props.isCollapsed||!!(this.context&&this.context.isCollapsed)||!1,getSelected:()=>!!(this.context&&this.context.selectedKeys&&this.context.selectedKeys.includes(this.props.itemKey)),getIsOpen:()=>!!(this.context&&this.context.openKeys&&this.context.openKeys.includes(this.props.itemKey))})}renderIcon(t,e){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;if(this.props.isSubNav||!t&&this.context.mode===h.MODE_HORIZONTAL)return null;let i="large";e===h.ICON_POS_RIGHT&&(i="default");const l=K(`${y}-icon`,{[`${y}-icon-toggle-${this.context.toggleIconPosition}`]:s,[`${y}-icon-info`]:!s});return a.createElement("i",{className:l,key:n},Ae(t)?a.cloneElement(t,{size:t.props.size||i}):t)}render(){var t;const{text:e,icon:s,toggleIcon:n,className:i,isSubNav:l,style:r,indent:c,onMouseEnter:d,onMouseLeave:m,link:C,linkOptions:w,disabled:I,level:g=0,tabIndex:L}=this.props,{mode:O,isInSubNav:f,prefixCls:v,limitIndent:B}=this.context,N=this.adapter.getIsCollapsed(),D=this.adapter.getSelected();let E=null;const q=(t=this.props)===null||t===void 0?void 0:t.children;if(!V(q))E=q;else{let j=null;if(O===h.MODE_VERTICAL&&!B&&!N){const T=s&&!c?g:g-1;j=be(T,U=>this.renderIcon(null,h.ICON_POS_RIGHT,!1,U))}E=a.createElement(a.Fragment,null,j,this.context.toggleIconPosition===h.TOGGLE_ICON_LEFT&&this.renderIcon(n,h.ICON_POS_RIGHT,!0,"key-toggle-pos-right"),s||c||f?this.renderIcon(s,h.ICON_POS_LEFT,!1,"key-position-left"):null,V(e)?"":a.createElement("span",{className:`${x.PREFIX}-item-text`},e),this.context.toggleIconPosition===h.TOGGLE_ICON_RIGHT&&this.renderIcon(n,h.ICON_POS_RIGHT,!0,"key-toggle-pos-right"))}typeof C=="string"&&(E=a.createElement("a",Object.assign({className:`${v}-item-link`,href:C,tabIndex:-1},w),E));let P="";if(f&&(N||O===h.MODE_HORIZONTAL)){const j=K({[y]:!0,[`${y}-sub`]:l,[`${y}-selected`]:D,[`${y}-collapsed`]:N,[`${y}-disabled`]:I});P=a.createElement(se.Item,{selected:D,active:D,forwardRef:this.setItemRef,className:j,onClick:this.handleClick,onMouseEnter:d,onMouseLeave:m,disabled:I,onKeyDown:this.handleKeyPress},E)}else{const j=K(`${i||`${y}-normal`}`,{[y]:!0,[`${y}-sub`]:l,[`${y}-selected`]:D&&!l,[`${y}-collapsed`]:N,[`${y}-disabled`]:I,[`${y}-has-link`]:typeof C=="string"}),T={"aria-disabled":I};if(l){const U=this.adapter.getIsOpen();T["aria-expanded"]=U}P=a.createElement("li",Object.assign({role:l?null:"menuitem",tabIndex:l?-1:L},T,{style:r,ref:this.setItemRef,className:j,onClick:this.handleClick,onMouseEnter:d,onMouseLeave:m,onKeyPress:this.handleKeyPress},this.getDataAttr(this.props)),E)}return(N&&!f&&!l||N&&l&&I)&&(P=this.wrapTooltip(P)),typeof this.context.renderWrapper=="function"?this.context.renderWrapper({itemElement:P,isSubNav:l,isInSubNav:f,props:this.props}):P}}Z.contextType=G;Z.propTypes={text:o.oneOfType([o.string,o.node]),itemKey:o.oneOfType([o.string,o.number]),onClick:o.func,onMouseEnter:o.func,onMouseLeave:o.func,icon:o.oneOfType([o.node]),className:o.string,toggleIcon:o.string,style:o.object,forwardRef:o.func,indent:o.oneOfType([o.bool,o.number]),isCollapsed:o.bool,isSubNav:o.bool,link:o.string,linkOptions:o.object,disabled:o.bool,tabIndex:o.number};Z.defaultProps={isSubNav:!1,indent:!1,forwardRef:S,isCollapsed:!1,onClick:S,onMouseEnter:S,onMouseLeave:S,disabled:!1,tabIndex:0};class Y extends le{constructor(t){super(t),this.setItemRef=e=>{e&&e.current?this.itemRef=e:this.itemRef={current:e}},this.setTitleRef=e=>{e&&e.current?this.titleRef=e:this.titleRef={current:e}},this.handleClick=e=>{this.foundation.handleClick(e&&e.nativeEvent,this.titleRef&&this.titleRef.current)},this.handleKeyPress=e=>{this.foundation.handleKeyPress(e&&e.nativeEvent,this.titleRef&&this.titleRef.current)},this.handleDropdownVisible=e=>this.foundation.handleDropdownVisibleChange(e),this.state={isHovered:!1},this.adapter.setCache("firstMounted",!0),this.titleRef=a.createRef(),this.itemRef=a.createRef(),this.foundation=new Ue(this.adapter)}_invokeContextFunc(t){if(t&&this.context&&typeof this.context[t]=="function"){for(var e=arguments.length,s=new Array(e>1?e-1:0),n=1;n<e;n++)s[n-1]=arguments[n];return this.context[t](...s)}return null}get adapter(){var t=this;return Object.assign(Object.assign({},super.adapter),{updateIsHovered:e=>this.setState({isHovered:e}),getOpenKeys:()=>this.context&&this.context.openKeys,getOpenKeysIsControlled:()=>this.context&&this.context.openKeysIsControlled,getCanUpdateOpenKeys:()=>this.context&&this.context.canUpdateOpenKeys,updateOpen:e=>this._invokeContextFunc(e?"addOpenKeys":"removeOpenKeys",this.props.itemKey),notifyGlobalOpenChange:function(){for(var e=arguments.length,s=new Array(e),n=0;n<e;n++)s[n]=arguments[n];return t._invokeContextFunc("onOpenChange",...s)},notifyGlobalOnSelect:function(){for(var e=arguments.length,s=new Array(e),n=0;n<e;n++)s[n]=arguments[n];return t._invokeContextFunc("onSelect",...s)},notifyGlobalOnClick:function(){for(var e=arguments.length,s=new Array(e),n=0;n<e;n++)s[n]=arguments[n];return t._invokeContextFunc("onClick",...s)},getIsSelected:e=>!!(!V(e)&&z(this.context,"selectedKeys",[]).includes(String(e))),getIsOpen:()=>{const{itemKey:e}=this.props;return!!(this.context&&this.context.openKeys&&this.context.openKeys.includes(this.props.itemKey))}})}renderIcon(t,e,s){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;const{prefixCls:l}=this.context;let r="large";e===h.ICON_POS_RIGHT&&(r="default");const c=K(`${l}-item-icon`,{[`${l}-item-icon-toggle-${this.context.toggleIconPosition}`]:n,[`${l}-item-icon-info`]:!n}),d=this.adapter.getIsOpen(),m=a.isValidElement(t)?s?a.createElement(De,{animationState:d?"enter":"leave",startClassName:`${x.PREFIX}-icon-rotate-${d?"180":"0"}`},C=>{let{animationClassName:w}=C;return a.cloneElement(t,{size:r,className:w})}):a.cloneElement(t,{size:r}):null;return a.createElement("i",{key:i,className:c},m)}renderTitleDiv(){const{text:t,icon:e,itemKey:s,indent:n,disabled:i,level:l,expandIcon:r}=this.props,{mode:c,isInSubNav:d,isCollapsed:m,prefixCls:C,subNavMotion:w,limitIndent:I}=this.context,g=this.adapter.getIsOpen(),L=K(`${C}-sub-title`,{[`${C}-sub-title-selected`]:this.adapter.getIsSelected(s),[`${C}-sub-title-disabled`]:i});let O=!1,f="";m?d?f=a.createElement(ie,null):f=null:c===h.MODE_HORIZONTAL?d?f=a.createElement(ie,{"aria-hidden":!0}):f=r||a.createElement(ae,{"aria-hidden":!0}):(w&&(O=!0),f=r||a.createElement(ae,{"aria-hidden":!0}));let v=null;if(c===h.MODE_VERTICAL&&!I&&!m){const D=e&&!n?l:l-1;v=be(D,E=>this.renderIcon(null,h.ICON_POS_RIGHT,!1,!1,E))}const B=!m&&d&&c===h.MODE_HORIZONTAL||m&&d;return a.createElement("div",{role:"menuitem",tabIndex:B?-1:0,ref:this.setTitleRef,className:L,onClick:this.handleClick,onKeyPress:this.handleKeyPress,"aria-expanded":g?"true":"false"},a.createElement("div",{className:`${C}-item-inner`},v,this.context.toggleIconPosition===h.TOGGLE_ICON_LEFT&&this.renderIcon(f,h.ICON_POS_RIGHT,O,!0,"key-toggle-position-left"),e||n||d&&c!==h.MODE_HORIZONTAL?this.renderIcon(e,h.ICON_POS_LEFT,!1,!1,"key-inSubNav-position-left"):null,a.createElement("span",{className:`${C}-item-text`},t),this.context.toggleIconPosition===h.TOGGLE_ICON_RIGHT&&this.renderIcon(f,h.ICON_POS_RIGHT,O,!0,"key-toggle-position-right")))}renderSubUl(){const{children:t,maxHeight:e}=this.props,{isCollapsed:s,mode:n,subNavMotion:i,prefixCls:l}=this.context,r=this.adapter.getIsOpen(),c=n===h.MODE_HORIZONTAL,d=K(`${l}-sub`,{[`${l}-sub-open`]:r,[`${l}-sub-popover`]:s||c});return c?null:i?a.createElement(Pe,{motion:i,isOpen:r,keepDOM:!1,fade:!0},s?null:a.createElement("ul",{className:d},t)):r&&!s?a.createElement("ul",{className:d},t):null}wrapDropdown(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";const{children:s,dropdownStyle:n,disabled:i,subDropdownProps:l,dropdownProps:r}=this.props,{mode:c,isInSubNav:d,isCollapsed:m,subNavCloseDelay:C,subNavOpenDelay:w,prefixCls:I,getPopupContainer:g}=this.context,L=this.adapter.getIsOpen(),O=this.adapter.getOpenKeysIsControlled(),f=K({[`${I}-popover`]:m}),v={trigger:"hover",style:n};return O&&(v.trigger="custom",v.visible=L),g&&(v.getPopupContainer=g),(m||c===h.MODE_HORIZONTAL)&&(e=i?e:a.createElement(se,Object.assign({className:f,render:a.createElement(se.Menu,null,s),position:c===h.MODE_HORIZONTAL&&!d?"bottomLeft":"rightTop",mouseEnterDelay:w,mouseLeaveDelay:C,onVisibleChange:this.handleDropdownVisible},r||l,v),e)),e}render(){const{itemKey:t,style:e,onMouseEnter:s,onMouseLeave:n,disabled:i,text:l}=this.props,{mode:r,isCollapsed:c,prefixCls:d}=this.context;let m=this.renderTitleDiv();const C=this.renderSubUl();return(c||r===h.MODE_HORIZONTAL)&&(m=this.wrapDropdown(m)),a.createElement(Z,{style:e,isSubNav:!0,itemKey:t,forwardRef:this.setItemRef,isCollapsed:c,className:`${d}-sub-wrap`,onMouseEnter:s,onMouseLeave:n,disabled:i,text:l},a.createElement(G.Provider,{value:Object.assign(Object.assign({},this.context),{isInSubNav:!0})},m,C))}}Y.contextType=G;Y.propTypes={itemKey:o.oneOfType([o.string,o.number]),text:o.oneOfType([o.string,o.node]),isOpen:o.bool,isCollapsed:o.bool,indent:o.oneOfType([o.bool,o.number]),children:o.node,style:o.object,icon:o.node,maxHeight:o.number,onMouseEnter:o.func,onMouseLeave:o.func,disabled:o.bool,level:o.number};Y.defaultProps={level:0,indent:!1,isCollapsed:!1,isOpen:!1,maxHeight:$.DEFAULT_SUBNAV_MAX_HEIGHT,disabled:!1};function We(p){let{prefixCls:t,locale:e,collapseText:s,isCollapsed:n,onClick:i=S}=p;const l=()=>{typeof i=="function"&&i(!n)},r={icon:a.createElement(Ze,null),type:"tertiary",theme:"borderless",onClick:l};let c=n?e?.expandText:e?.collapseText;return typeof s=="function"&&(c=s(n)),a.createElement("div",{className:`${t}-collapse-btn`},n?a.createElement(Oe,{content:c,position:"right"},a.createElement(re,Object.assign({},r))):a.createElement(re,Object.assign({},r),c))}class H extends b.PureComponent{constructor(){super(...arguments),this.renderCollapseButton=()=>{const{collapseButton:t,collapseText:e}=this.props;if(a.isValidElement(t))return t;const{onCollapseChange:s,prefixCls:n,locale:i,isCollapsed:l}=this.context;return a.createElement(We,{prefixCls:n,isCollapsed:l,locale:i,onClick:s,collapseText:e})}}render(){const{style:t,className:e,collapseButton:s,onClick:n}=this.props;let{children:i}=this.props;const{isCollapsed:l,mode:r}=this.context;!a.isValidElement(i)&&s&&r!==h.MODE_HORIZONTAL&&(i=this.renderCollapseButton());const c=K(e,`${x.PREFIX}-footer`,{[`${x.PREFIX}-footer-collapsed`]:l});return a.createElement("div",{className:c,style:t,onClick:n},i)}}H.contextType=G;H.propTypes={children:o.node,style:o.object,className:o.string,collapseButton:o.oneOfType([o.node,o.bool]),collapseText:o.func,onClick:o.func};H.defaultProps={collapseButton:!1,onClick:S};H.elementType="NavFooter";class M extends b.PureComponent{renderLogo(t){return a.isValidElement(t)?t:null}render(){const{children:t,style:e,className:s,logo:n,text:i,link:l,linkOptions:r,prefixCls:c}=this.props,{isCollapsed:d}=this.context,m=K(s,`${x.PREFIX}-header`,{[`${x.PREFIX}-header-collapsed`]:d});let C=a.createElement(a.Fragment,null,n?a.createElement("i",{className:`${x.PREFIX}-header-logo`},this.renderLogo(n)):null,!V(i)&&!d?a.createElement("span",{className:`${x.PREFIX}-header-text`},i):null,t);return typeof l=="string"&&(C=a.createElement("a",Object.assign({className:`${c}-header-link`,href:l},r),C)),a.createElement("div",{className:m,style:e},C)}}M.contextType=G;M.propTypes={prefixCls:o.string,logo:o.oneOfType([o.string,o.object,o.node]),text:o.oneOfType([o.string,o.node]),children:o.node,style:o.object,className:o.string,link:o.string,linkOptions:o.object};M.defaultProps={prefixCls:x.PREFIX};M.elementType="NavHeader";var ze=function(p,t){var e={};for(var s in p)Object.prototype.hasOwnProperty.call(p,s)&&t.indexOf(s)<0&&(e[s]=p[s]);if(p!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,s=Object.getOwnPropertySymbols(p);n<s.length;n++)t.indexOf(s[n])<0&&Object.prototype.propertyIsEnumerable.call(p,s[n])&&(e[s[n]]=p[s[n]]);return e};function Ce(p,t){return function(){const s=new Set(p.state[t]);for(var n=arguments.length,i=new Array(n),l=0;l<n;l++)i[l]=arguments[l];i.forEach(r=>r&&s.add(r)),p.setState({[t]:Array.from(s)})}}function fe(p,t){return function(){const s=new Set(p.state[t]);for(var n=arguments.length,i=new Array(n),l=0;l<n;l++)i[l]=arguments[l];i.forEach(r=>r&&s.delete(r)),p.setState({[t]:Array.from(s)})}}const{hasOwnProperty:Ye}=Object.prototype;class A extends le{constructor(t){super(t),this.onCollapseChange=()=>{this.foundation.handleCollapseChange()},this.foundation=new F(this.adapter),this.itemsChanged=!0;const{isCollapsed:e,defaultIsCollapsed:s,items:n,children:i}=t,l={isCollapsed:!!(this.isControlled("isCollapsed")?e:s),openKeys:[],items:[],itemKeysMap:{},selectedKeys:[]};if(this.state=Object.assign({},l),n&&n.length||i){const r=this.foundation.init("constructor");this.state=Object.assign(Object.assign({},l),r)}}static getDerivedStateFromProps(t,e){const s={};return Ye.call(t,"isCollapsed")&&t.isCollapsed!==e.isCollapsed&&(s.isCollapsed=t.isCollapsed),s}componentDidMount(){}componentDidUpdate(t){if(t.items!==this.props.items||t.children!==this.props.children)this.foundation.init();else{if(this.foundation.handleItemsChange(!1),this.props.selectedKeys&&!ce(t.selectedKeys,this.props.selectedKeys)){this.adapter.updateSelectedKeys(this.props.selectedKeys);const e=this.foundation.getWillOpenKeys(this.state.itemKeysMap);this.adapter.updateOpenKeys(e)}this.props.openKeys&&!ce(t.openKeys,this.props.openKeys)&&this.adapter.updateOpenKeys(this.props.openKeys)}}get adapter(){var t=this;return Object.assign(Object.assign({},super.adapter),{notifySelect:function(){return t.props.onSelect(...arguments)},notifyOpenChange:function(){return t.props.onOpenChange(...arguments)},setIsCollapsed:e=>this.setState({isCollapsed:e}),notifyCollapseChange:function(){return t.props.onCollapseChange(...arguments)},updateItems:e=>this.setState({items:[...e]}),setItemKeysMap:e=>this.setState({itemKeysMap:Object.assign({},e)}),addSelectedKeys:Ce(this,"selectedKeys"),removeSelectedKeys:fe(this,"selectedKeys"),updateSelectedKeys:function(e){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=e;if(s){const i=t.foundation.selectLevelZeroParentKeys(null,e);n=Array.from(new Set(e.concat(i)))}t.setState({selectedKeys:n})},updateOpenKeys:e=>this.setState({openKeys:[...e]}),addOpenKeys:Ce(this,"openKeys"),removeOpenKeys:fe(this,"openKeys"),setItemsChanged:e=>{this.itemsChanged=e}})}renderItems(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const{expandIcon:s,subDropdownProps:n}=this.props;return a.createElement(a.Fragment,null,t.map((l,r)=>Array.isArray(l.items)&&l.items.length?a.createElement(Y,Object.assign({key:l.itemKey||String(e)+r},l,{level:e,expandIcon:s,subDropdownProps:n}),this.renderItems(l.items,e+1)):a.createElement(Z,Object.assign({key:l.itemKey||String(e)+r},l,{level:e}))))}render(){const t=this.props,{children:e,mode:s,onOpenChange:n,onSelect:i,onClick:l,style:r,className:c,subNavCloseDelay:d,subNavOpenDelay:m,subNavMotion:C,tooltipShowDelay:w,tooltipHideDelay:I,prefixCls:g,bodyStyle:L,footer:O,header:f,toggleIconPosition:v,limitIndent:B,renderWrapper:N,getPopupContainer:D}=t,E=ze(t,["children","mode","onOpenChange","onSelect","onClick","style","className","subNavCloseDelay","subNavOpenDelay","subNavMotion","tooltipShowDelay","tooltipHideDelay","prefixCls","bodyStyle","footer","header","toggleIconPosition","limitIndent","renderWrapper","getPopupContainer"]),{selectedKeys:q,openKeys:P,items:j,isCollapsed:T}=this.state,{updateOpenKeys:U,addOpenKeys:Ie,removeOpenKeys:ve,updateSelectedKeys:Ke,addSelectedKeys:xe,removeSelectedKeys:Ee}=this.adapter,Se=Object.assign({},r);let _=b.Children.toArray(e);const Q=[],J=[];if(a.isValidElement(O)?Q.push(a.createElement(H,{key:0},O)):O&&typeof O=="object"&&Q.push(a.createElement(H,Object.assign({key:0},O))),a.isValidElement(f)?J.push(a.createElement(M,{key:0},f)):f&&typeof f=="object"&&J.push(a.createElement(M,Object.assign({key:0},f))),Array.isArray(_)&&_.length){_=[..._];let X=_.length;for(let R=0;R<X;R++){const k=_[R];k.type===H||z(k,"type.elementType")==="NavFooter"?(Q.push(k),_.splice(R,1),R--,X--):(k.type===M||z(k,"type.elementType")==="NavHeader")&&(J.push(k),_.splice(R,1),R--,X--)}}const we=K(g,c,{[`${g}-collapsed`]:T,[`${g}-horizontal`]:s==="horizontal",[`${g}-vertical`]:s==="vertical"}),Ne=K(`${g}-header-list-outer`,{[`${g}-header-list-outer-collapsed`]:T});return this.itemsChanged&&this.adapter.setCache("itemElems",this.renderItems(j)),a.createElement(je,{componentName:"Navigation"},X=>a.createElement(G.Provider,{value:{subNavCloseDelay:d,subNavOpenDelay:m,subNavMotion:C,tooltipShowDelay:w,tooltipHideDelay:I,openKeys:P,openKeysIsControlled:this.isControlled("openKeys")&&s==="vertical"&&!T,canUpdateOpenKeys:!0,selectedKeys:q,selectedKeysIsControlled:this.isControlled("selectedKeys"),isCollapsed:T,onCollapseChange:this.onCollapseChange,mode:s,onSelect:i,onOpenChange:n,updateOpenKeys:U,addOpenKeys:Ie,removeOpenKeys:ve,updateSelectedKeys:Ke,addSelectedKeys:xe,removeSelectedKeys:Ee,onClick:l,locale:X,prefixCls:g,toggleIconPosition:v,limitIndent:B,renderWrapper:N,getPopupContainer:D}},a.createElement("div",Object.assign({className:we,style:Se},this.getDataAttr(E)),a.createElement("div",{className:`${g}-inner`},a.createElement("div",{className:Ne},J,a.createElement("div",{style:L,className:`${g}-list-wrapper`},a.createElement("ul",{role:"menu","aria-orientation":s,className:`${g}-list`},this.adapter.getCache("itemElems"),_))),Q))))}}A.Sub=Y;A.Item=Z;A.Header=M;A.Footer=H;A.propTypes={collapseIcon:o.node,defaultOpenKeys:o.arrayOf(o.oneOfType([o.string,o.number])),openKeys:o.arrayOf(o.oneOfType([o.string,o.number])),defaultSelectedKeys:o.arrayOf(o.oneOfType([o.string,o.number])),expandIcon:o.node,selectedKeys:o.arrayOf(o.oneOfType([o.string,o.number])),mode:o.oneOf([...h.MODE]),onSelect:o.func,onClick:o.func,onOpenChange:o.func,items:o.array,isCollapsed:o.bool,defaultIsCollapsed:o.bool,onCollapseChange:o.func,multiple:o.bool,onDeselect:o.func,subNavMotion:o.oneOfType([o.bool,o.object,o.func]),subNavCloseDelay:o.number,subNavOpenDelay:o.number,tooltipShowDelay:o.number,tooltipHideDelay:o.number,children:o.node,style:o.object,bodyStyle:o.object,className:o.string,toggleIconPosition:o.string,prefixCls:o.string,header:o.oneOfType([o.node,o.object]),footer:o.oneOfType([o.node,o.object]),limitIndent:o.bool,getPopupContainer:o.func};A.__SemiComponentName__="Navigation";A.defaultProps=He(A.__SemiComponentName__,{subNavCloseDelay:$.DEFAULT_SUBNAV_CLOSE_DELAY,subNavOpenDelay:$.DEFAULT_SUBNAV_OPEN_DELAY,tooltipHideDelay:$.DEFAULT_TOOLTIP_HIDE_DELAY,tooltipShowDelay:$.DEFAULT_TOOLTIP_SHOW_DELAY,onCollapseChange:S,onSelect:S,onClick:S,onOpenChange:S,toggleIconPosition:"right",limitIndent:!0,prefixCls:x.PREFIX,subNavMotion:!0,mode:h.MODE_VERTICAL});function qe(){return u.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:u.jsx("path",{d:"M8.48092 0.748384C8.16727 0.653859 7.83272 0.653859 7.51907 0.748384C7.30423 0.813133 7.13028 0.92386 6.97716 1.04125C6.83512 1.15015 6.67675 1.2924 6.50211 1.44927L2.21784 5.29713C2.00105 5.49145 1.80997 5.66273 1.66845 5.87532C1.54419 6.062 1.4522 6.26826 1.39635 6.48545C1.33275 6.73279 1.333 6.9894 1.33329 7.28054L1.33333 12.4241C1.33331 12.6835 1.3333 12.9169 1.34917 13.1111C1.36616 13.3191 1.40462 13.5401 1.51499 13.7567C1.67477 14.0703 1.92974 14.3253 2.24335 14.485C2.45995 14.5954 2.68093 14.6339 2.88891 14.6509C3.08312 14.6667 3.31653 14.6667 3.57591 14.6667H12.4241C12.6835 14.6667 12.9169 14.6667 13.1111 14.6509C13.3191 14.6339 13.54 14.5954 13.7566 14.485C14.0703 14.3253 14.3252 14.0703 14.485 13.7567C14.5954 13.5401 14.6338 13.3191 14.6508 13.1111C14.6667 12.9169 14.6667 12.6835 14.6667 12.4241L14.6667 7.28053C14.667 6.9894 14.6672 6.73279 14.6036 6.48545C14.5478 6.26826 14.4558 6.062 14.3315 5.87532C14.19 5.66273 13.9989 5.49145 13.7822 5.29713L9.49788 1.44927C9.32325 1.2924 9.16488 1.15015 9.02284 1.04125C8.86971 0.923861 8.69577 0.813133 8.48092 0.748384ZM7.90381 2.025C7.96654 2.0061 8.03345 2.0061 8.09618 2.025C8.09682 2.02519 8.10364 2.0272 8.11997 2.0364C8.13837 2.04678 8.16717 2.06534 8.21161 2.0994C8.30743 2.17287 8.42696 2.27959 8.62365 2.45625L12.8467 6.24917C13.1328 6.50615 13.1858 6.56032 13.2216 6.61414C13.263 6.67637 13.2937 6.74512 13.3123 6.81752C13.3284 6.88014 13.3333 6.95575 13.3333 7.34034V12.4C13.3333 12.6911 13.3328 12.8692 13.3219 13.0025C13.3168 13.0646 13.3105 13.1022 13.3051 13.125C13.3025 13.1359 13.3004 13.1426 13.2991 13.1462C13.2979 13.1496 13.2971 13.1511 13.297 13.1514C13.265 13.2141 13.214 13.2651 13.1513 13.297C13.1511 13.2972 13.1496 13.2979 13.1461 13.2991C13.1425 13.3004 13.1359 13.3026 13.125 13.3051C13.1022 13.3105 13.0646 13.3169 13.0025 13.322C12.8692 13.3328 12.691 13.3334 12.4 13.3334H8.66667V8.50008C8.66667 8.31599 8.51743 8.16675 8.33333 8.16675H7.66667C7.48257 8.16675 7.33333 8.31599 7.33333 8.50008V13.3334H3.6C3.30897 13.3334 3.13079 13.3328 2.99749 13.322C2.93539 13.3169 2.89781 13.3105 2.875 13.3051C2.86414 13.3026 2.85747 13.3004 2.85386 13.2991C2.85039 13.2979 2.84894 13.2972 2.84867 13.297C2.78595 13.2651 2.73495 13.2141 2.70299 13.1514C2.70291 13.1512 2.70256 13.1505 2.70199 13.1491C2.70168 13.1483 2.70131 13.1474 2.70088 13.1462C2.69959 13.1426 2.69745 13.1359 2.69489 13.125C2.68952 13.1022 2.68315 13.0646 2.67807 13.0025C2.66718 12.8692 2.66666 12.6911 2.66666 12.4V7.34034C2.66666 6.95575 2.67157 6.88014 2.68767 6.81752C2.70629 6.74512 2.73695 6.67637 2.77837 6.61414C2.8142 6.56032 2.86717 6.50615 3.1533 6.24917L7.37634 2.45625C7.57304 2.27959 7.69256 2.17287 7.78839 2.0994C7.83282 2.06534 7.86162 2.04678 7.88003 2.0364C7.89635 2.0272 7.90317 2.02519 7.90381 2.025Z",fill:"black",fillOpacity:"0.65"})})}const Qe=()=>u.jsx(ee,{svg:u.jsx(qe,{})});function Je(){return u.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[u.jsx("path",{d:"M5.33333 7.66675C5.14924 7.66675 5 7.51751 5 7.33341V6.66675C5 6.48265 5.14924 6.33341 5.33333 6.33341H10.6667C10.8508 6.33341 11 6.48265 11 6.66675V7.33341C11 7.51751 10.8508 7.66675 10.6667 7.66675H5.33333Z",fill:"black",fillOpacity:"0.65"}),u.jsx("path",{d:"M5.33333 10.6667C5.14924 10.6667 5 10.5175 5 10.3334V9.66675C5 9.48265 5.14924 9.33341 5.33333 9.33341H8.33333C8.51743 9.33341 8.66667 9.48265 8.66667 9.66675V10.3334C8.66667 10.5175 8.51743 10.6667 8.33333 10.6667H5.33333Z",fill:"black",fillOpacity:"0.65"}),u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.33333 0.666748C5.14924 0.666748 5 0.815986 5 1.00008V2.00013C4.01165 2.0009 3.49359 2.01346 3.09202 2.21807C2.71569 2.40982 2.40973 2.71578 2.21799 3.0921C2 3.51992 2 4.07998 2 5.20008V12.1334C2 13.2535 2 13.8136 2.21799 14.2414C2.40973 14.6177 2.71569 14.9237 3.09202 15.1154C3.51984 15.3334 4.0799 15.3334 5.2 15.3334H10.8C11.9201 15.3334 12.4802 15.3334 12.908 15.1154C13.2843 14.9237 13.5903 14.6177 13.782 14.2414C14 13.8136 14 13.2535 14 12.1334V5.20008C14 4.07998 14 3.51992 13.782 3.0921C13.5903 2.71578 13.2843 2.40982 12.908 2.21807C12.5064 2.01346 11.9883 2.0009 11 2.00013V1.00008C11 0.815986 10.8508 0.666748 10.6667 0.666748H10C9.81591 0.666748 9.66667 0.815986 9.66667 1.00008V2.00008H6.33333V1.00008C6.33333 0.815986 6.1841 0.666748 6 0.666748H5.33333ZM3.99498 3.35623C4.22961 3.33707 4.53372 3.33396 5 3.33349V4.00008C5 4.18418 5.14924 4.33341 5.33333 4.33341H6C6.1841 4.33341 6.33333 4.18418 6.33333 4.00008V3.33341H9.66667V4.00008C9.66667 4.18418 9.81591 4.33341 10 4.33341H10.6667C10.8508 4.33341 11 4.18418 11 4.00008V3.33349C11.4663 3.33396 11.7704 3.33707 12.005 3.35623C12.1292 3.36638 12.2044 3.37913 12.25 3.38988C12.2717 3.39499 12.2851 3.39927 12.2923 3.40185C12.2992 3.40432 12.3027 3.40608 12.3027 3.40608C12.4281 3.46999 12.5301 3.57198 12.594 3.69742C12.594 3.69742 12.5958 3.70087 12.5982 3.7078C12.6008 3.71502 12.6051 3.72837 12.6102 3.75008C12.621 3.79572 12.6337 3.87086 12.6438 3.99506C12.6656 4.26168 12.6667 4.61803 12.6667 5.20008V12.1334C12.6667 12.7155 12.6656 13.0718 12.6438 13.3384C12.6337 13.4626 12.621 13.5378 12.6102 13.5834C12.6051 13.6051 12.6008 13.6185 12.5982 13.6257C12.5969 13.6295 12.5958 13.632 12.5951 13.6337C12.5945 13.6351 12.594 13.6361 12.594 13.6361C12.5301 13.7615 12.4281 13.8635 12.3027 13.9274C12.3027 13.9274 12.2992 13.9292 12.2923 13.9316C12.2851 13.9342 12.2717 13.9385 12.25 13.9436C12.2044 13.9544 12.1292 13.9671 12.005 13.9773C11.7384 13.999 11.3821 14.0001 10.8 14.0001H5.2C4.61795 14.0001 4.26159 13.999 3.99498 13.9773C3.87078 13.9671 3.79563 13.9544 3.75 13.9436C3.72829 13.9385 3.71494 13.9342 3.70772 13.9316C3.70078 13.9292 3.69734 13.9274 3.69734 13.9274C3.5719 13.8635 3.46991 13.7615 3.406 13.6361C3.406 13.6361 3.40424 13.6326 3.40177 13.6257C3.39919 13.6185 3.39491 13.6051 3.38979 13.5834C3.37905 13.5378 3.3663 13.4626 3.35615 13.3384C3.33437 13.0718 3.33333 12.7155 3.33333 12.1334V5.20008C3.33333 4.61803 3.33437 4.26168 3.35615 3.99506C3.3663 3.87086 3.37905 3.79572 3.38979 3.75008C3.39491 3.72837 3.39919 3.71502 3.40177 3.7078C3.40424 3.70087 3.406 3.69742 3.406 3.69742C3.46991 3.57198 3.5719 3.46999 3.69734 3.40608C3.69734 3.40608 3.70078 3.40432 3.70772 3.40185C3.71494 3.39927 3.72829 3.39499 3.75 3.38988C3.79563 3.37913 3.87078 3.36638 3.99498 3.35623Z",fill:"black",fillOpacity:"0.65"})]})}const et=()=>u.jsx(ee,{svg:u.jsx(Je,{})});function tt(){return u.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6 7.16667C7.33518 7.16667 8.45466 6.24312 8.75446 5H14.6667C14.8508 5 15 4.85076 15 4.66667V4C15 3.81591 14.8508 3.66667 14.6667 3.66667H8.75446C8.45466 2.42355 7.33518 1.5 6 1.5C4.66482 1.5 3.54534 2.42355 3.24554 3.66667H1.33333C1.14924 3.66667 1 3.81591 1 4V4.66667C1 4.85076 1.14924 5 1.33333 5H3.24554C3.54534 6.24312 4.66482 7.16667 6 7.16667ZM7.5 4.33333C7.5 5.16176 6.82843 5.83333 6 5.83333C5.17157 5.83333 4.5 5.16176 4.5 4.33333C4.5 3.50491 5.17157 2.83333 6 2.83333C6.82843 2.83333 7.5 3.50491 7.5 4.33333Z",fill:"black",fillOpacity:"0.65"}),u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10 14.5C11.3352 14.5 12.4547 13.5765 12.7545 12.3333H14.6667C14.8508 12.3333 15 12.1841 15 12V11.3333C15 11.1492 14.8508 11 14.6667 11H12.7545C12.4547 9.75688 11.3352 8.83333 10 8.83333C8.66482 8.83333 7.54534 9.75688 7.24554 11H1.33333C1.14924 11 1 11.1492 1 11.3333V12C1 12.1841 1.14924 12.3333 1.33333 12.3333H7.24554C7.54534 13.5765 8.66482 14.5 10 14.5ZM11.5 11.6667C11.5 12.4951 10.8284 13.1667 10 13.1667C9.17157 13.1667 8.5 12.4951 8.5 11.6667C8.5 10.8382 9.17157 10.1667 10 10.1667C10.8284 10.1667 11.5 10.8382 11.5 11.6667Z",fill:"black",fillOpacity:"0.65"})]})}const st=()=>u.jsx(ee,{svg:u.jsx(tt,{})});function nt(){return u.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[u.jsx("path",{d:"M5.66666 2.66659C5.85076 2.66659 6 2.51735 6 2.33325V1.66659C6 1.48249 5.85076 1.33325 5.66666 1.33325H5.59999C4.10652 1.33325 3.35979 1.33325 2.78935 1.6239C2.28759 1.87956 1.87964 2.28751 1.62398 2.78928C1.33333 3.35971 1.33333 4.10645 1.33333 5.59992V5.66658C1.33333 5.85068 1.48257 5.99992 1.66666 5.99992H2.33333C2.51742 5.99992 2.66666 5.85068 2.66666 5.66658V5.59992C2.66666 4.83118 2.6677 4.33482 2.69856 3.95703C2.72816 3.59482 2.7784 3.46052 2.81199 3.3946C2.93982 3.14372 3.14379 2.93974 3.39467 2.81191C3.4606 2.77832 3.59489 2.72808 3.95711 2.69849C4.33489 2.66762 4.83126 2.66659 5.59999 2.66659H5.66666Z",fill:"black",fillOpacity:"0.65"}),u.jsx("path",{d:"M14.6667 5.66658C14.6667 5.85068 14.5174 5.99992 14.3333 5.99992H13.6667C13.4826 5.99992 13.3333 5.85068 13.3333 5.66658V5.59992C13.3333 4.83118 13.3323 4.33482 13.3014 3.95703C13.2718 3.59482 13.2216 3.46052 13.188 3.3946C13.0602 3.14372 12.8562 2.93974 12.6053 2.81191C12.5394 2.77832 12.4051 2.72808 12.0429 2.69849C11.6651 2.66762 11.1687 2.66659 10.4 2.66659H10.3333C10.1492 2.66659 10 2.51735 10 2.33325V1.66659C10 1.48249 10.1492 1.33325 10.3333 1.33325H10.4C11.8935 1.33325 12.6402 1.33325 13.2106 1.6239C13.7124 1.87956 14.1203 2.28751 14.376 2.78928C14.6667 3.35971 14.6667 4.10645 14.6667 5.59992V5.66658Z",fill:"black",fillOpacity:"0.65"}),u.jsx("path",{d:"M1.66666 9.99992C1.48257 9.99992 1.33333 10.1492 1.33333 10.3333V10.3999C1.33333 11.8934 1.33333 12.6401 1.62398 13.2106C1.87964 13.7123 2.28759 14.1203 2.78935 14.3759C3.35979 14.6666 4.10652 14.6666 5.59999 14.6666H5.66666C5.85076 14.6666 6 14.5173 6 14.3333V13.6666C6 13.4825 5.85076 13.3333 5.66666 13.3333H5.59999C4.83126 13.3333 4.33489 13.3322 3.95711 13.3013C3.59489 13.2718 3.4606 13.2215 3.39467 13.1879C3.14379 13.0601 2.93982 12.8561 2.81199 12.6052C2.7784 12.5393 2.72816 12.405 2.69856 12.0428C2.6677 11.665 2.66666 11.1687 2.66666 10.3999V10.3333C2.66666 10.1492 2.51742 9.99992 2.33333 9.99992H1.66666Z",fill:"black",fillOpacity:"0.65"}),u.jsx("path",{d:"M10.3333 13.3333C10.1492 13.3333 10 13.4825 10 13.6666V14.3333C10 14.5173 10.1492 14.6666 10.3333 14.6666H10.4C11.8935 14.6666 12.6402 14.6666 13.2106 14.3759C13.7124 14.1203 14.1203 13.7123 14.376 13.2106C14.6667 12.6401 14.6667 11.8934 14.6667 10.3999V10.3333C14.6667 10.1492 14.5174 9.99992 14.3333 9.99992H13.6667C13.4826 9.99992 13.3333 10.1492 13.3333 10.3333V10.3999C13.3333 11.1687 13.3323 11.665 13.3014 12.0428C13.2718 12.405 13.2216 12.5393 13.188 12.6052C13.0602 12.8561 12.8562 13.0601 12.6053 13.1879C12.5394 13.2215 12.4051 13.2718 12.0429 13.3013C11.6651 13.3322 11.1687 13.3333 10.4 13.3333H10.3333Z",fill:"black",fillOpacity:"0.65"}),u.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.17159 10.1144C8.64463 10.4634 8.01272 10.6667 7.33333 10.6667C5.49238 10.6667 3.99999 9.17428 3.99999 7.33333C3.99999 5.49238 5.49238 4 7.33333 4C9.17428 4 10.6667 5.49238 10.6667 7.33333C10.6667 8.01272 10.4634 8.64464 10.1144 9.17159L11.7357 10.7929C11.8659 10.9231 11.8659 11.1341 11.7357 11.2643L11.2643 11.7357C11.1341 11.8659 10.9231 11.8659 10.7929 11.7357L9.17159 10.1144ZM9.33333 7.33333C9.33333 8.4379 8.4379 9.33333 7.33333 9.33333C6.22876 9.33333 5.33333 8.4379 5.33333 7.33333C5.33333 6.22876 6.22876 5.33333 7.33333 5.33333C8.4379 5.33333 9.33333 6.22876 9.33333 7.33333Z",fill:"black",fillOpacity:"0.65"})]})}const ot=()=>u.jsx(ee,{svg:u.jsx(nt,{})}),te=[{text:W("scanQRCode2Debug"),itemKey:"scan_qrcode",icon:u.jsx(Qe,{}),path:"/"},{itemKey:"launch_mode",text:W("launchMode"),icon:u.jsx(st,{}),path:"/launch_mode"},{itemKey:"precheck_code",text:W("codePreCheck"),icon:u.jsx(ot,{}),path:"/precheck_code"},{itemKey:"project_info",text:W("projectInfo"),icon:u.jsx(et,{}),path:"/project_detail"},{itemKey:"changelog",text:W("changelog"),icon:u.jsx(Fe,{size:"default",style:{fontWeight:"300",color:"#666"}}),path:"/changelog"}],at=()=>{const{state:{devToolVersion:p}}=Me(),t=Le(),[e,s]=b.useState("scan_qrcode"),[n,i]=b.useState(!1);b.useEffect(()=>{i(Re(p))},[p]);const l=b.useMemo(()=>te.map(c=>c.itemKey==="changelog"?{...c,text:u.jsxs("span",{className:"sidebar-changelog-label",children:[c.text,n&&u.jsx(Ve,{className:"sidebar-changelog-new-tag",color:"red",shape:"circle",size:"small",type:"solid",children:"NEW"})]})}:c),[n]),r=c=>{const d=te.find(m=>m.itemKey===c.itemKey);d&&(d.itemKey==="changelog"&&p&&(ke(p),i(!1)),t(d.path),s(d.itemKey))};return b.useEffect(()=>{const c=window.location.pathname,d=te.find(m=>m.path===c);s(d?d.itemKey:"")},[t]),u.jsx(A,{limitIndent:!1,bodyStyle:{height:"100vh",paddingLeft:"12px",width:"100%"},items:l,selectedKeys:[e],onSelect:r})};export{at as Sidebar};
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{G as re,r as f,B as q,c as P,R as b,v as Y,y as J,ag as ee,P as u,V as ne,ah as le,g as A,ai as ie,f as N,aj as z,i as c,j as s,m as j,h as $,F as H,ak as T,d as oe,u as ce,al as de,K as ue,ad as pe}from"./index-BGB_3rmy.js";function me(t){return f.createElement("svg",Object.assign({viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",focusable:!1,"aria-hidden":!0},t),f.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 4c0-1.1.9-2 2-2h5a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V4Zm0 11c0-1.1.9-2 2-2h5a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-5ZM15 2a2 2 0 0 0-2 2v5c0 1.1.9 2 2 2h5a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2h-5Zm1 12.5a1.5 1.5 0 0 1 3 0V16h1.5a1.5 1.5 0 0 1 0 3H19v1.5a1.5 1.5 0 0 1-3 0V19h-1.5a1.5 1.5 0 0 1 0-3H16v-1.5Z",fill:"currentColor"}))}const fe=re(me,"customize"),W={PREFIX:`${q}-steps`,ITEM:`${q}-steps-item`};var F;(function(t){t.small="large",t.default="extra-large"})(F||(F={}));const M=t=>{const{prefixCls:e,className:r,size:a,title:n,description:l,status:m,style:d,active:i,done:o,icon:g,stepNumber:x,onClick:w,onChange:h,onKeyDown:C}=t,S=()=>{let _,E;if("icon"in t)b.isValidElement(g)&&(_=g);else if("status"in t)switch(m){case"error":_=b.createElement(ee,{size:F[a]});break;case"wait":_=b.createElement("span",{className:`${e}-number-icon`},x);break;case"process":_=b.createElement("span",{className:`${e}-number-icon`},x),E=!0;break;case"finish":_=b.createElement(J,{size:F[a]});break;case"warning":_=b.createElement(Y,{size:F[a]});break;default:_=null;break}const ae=P({[`${e}-icon`]:!0,[`${e}-custom-icon`]:"icon"in t,[`${e}-icon-process`]:E});return _?b.createElement("span",{className:ae},_):null},v=P(e,`${e}-${m}`,{[`${e}-active`]:i,[`${e}-done`]:o,[`${e}-hover`]:h||t.onClick,[`${e}-clickable`]:h||w,[`${e}-${m}-hover`]:h||t.onClick},r),p=_=>{w?.(_),h?.()},k=_=>{_.key==="Enter"&&(C?.(_),h?.())};return b.createElement("div",{role:t.role,"aria-label":t["aria-label"],tabIndex:0,"aria-current":"step",className:v,style:d,onClick:_=>p(_),onKeyDown:k},b.createElement("div",{className:`${e}-container`},b.createElement("div",{className:`${e}-left`},S()),b.createElement("div",{className:`${e}-content`},b.createElement("div",{className:`${e}-title`},b.createElement("div",{className:`${e}-title-text`},n)),l&&b.createElement("div",{className:`${e}-description`},l))))};M.propTypes={prefixCls:u.string,description:u.node,icon:u.node,status:u.oneOf(["wait","process","finish","error","warning"]),title:u.node,className:u.string,style:u.object,onClick:u.func,active:u.bool,done:u.bool};M.defaultProps={prefixCls:W.ITEM,active:!1,done:!1,status:"wait",className:""};const B=t=>{const{prefixCls:e,className:r,title:a,description:n,status:l,style:m,onClick:d,icon:i,onChange:o,stepNumber:g,onKeyDown:x}=t,w=()=>{let S,v;if("icon"in t)S=i;else if("status"in t)switch(l){case"error":S=b.createElement(ee,{size:"extra-large"});break;case"wait":S=g;break;case"process":S=g,v=!0;break;case"finish":S=b.createElement(J,{size:"extra-large"});break;case"warning":S=b.createElement(Y,{size:"extra-large"});break;default:S=null;break}const p=P({[`${e}-left`]:!0,[`${e}-icon`]:"icon"in t,[`${e}-plain`]:!("icon"in t),[`${e}-icon-process`]:v,[`${e}-hover`]:o||d});return S?b.createElement("div",{className:p},S):null},h=S=>{d?.(S),o?.()},C=S=>{S.key==="Enter"&&(x?.(S),o?.())};return b.createElement("div",{role:t.role,"aria-label":t["aria-label"],"aria-current":"step",tabIndex:0,className:P({[e]:!0,[`${e}-${l}`]:!!l,[`${e}-${l}-hover`]:!!l&&(o||d),[`${e}-${l}-active`]:!!l&&(o||d),[`${e}-clickable`]:o||d},r),style:m,onClick:S=>{h(S)},onKeyDown:C},w(),b.createElement("div",{className:`${e}-content`},b.createElement("div",{className:`${e}-title`,title:typeof a=="string"?a:null},b.createElement("span",{className:`${e}-title-text`},a)),b.createElement("div",{className:`${e}-description`,title:typeof n=="string"?n:null},n)))};B.propTypes={prefixCls:u.string,description:u.node,icon:u.node,status:u.oneOf(["wait","process","finish","error","warning"]),title:u.node,className:u.string,style:u.object,onClick:u.func};B.defaultProps={prefixCls:W.ITEM,status:"wait",className:""};const G=t=>{const{prefixCls:e,className:r,title:a,style:n,active:l,index:m,total:d,onClick:i,onKeyDown:o,onChange:g}=t,x=P(e,{[`${e}-active`]:l},r),w=C=>{i?.(C),g?.()},h=C=>{C.key==="Enter"&&(o?.(C),g?.())};return b.createElement("div",{role:t.role,"aria-label":t["aria-label"],"aria-current":"step",tabIndex:0,className:x,style:n,onClick:C=>w(C),onKeyDown:h},b.createElement("div",{className:`${e}-container`},b.createElement("div",{className:`${e}-content`},b.createElement("div",{className:`${e}-title`},a)),m!==d-1&&b.createElement("div",{className:`${e}-icon`},b.createElement(ne,{size:"small"}))))};G.propTypes={prefixCls:u.string,title:u.node,className:u.string,style:u.object,onClick:u.func,active:u.bool};G.defaultProps={prefixCls:W.ITEM,active:!1,className:""};const te=b.createContext(null),we=t=>{const{type:e}=f.useContext(te);return(()=>{switch(e){case"fill":return b.createElement(B,Object.assign({},t));case"basic":return b.createElement(M,Object.assign({},t));case"nav":return b.createElement(G,Object.assign({},t));default:return null}})()};var he=function(t,e){var r={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&e.indexOf(a)<0&&(r[a]=t[a]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,a=Object.getOwnPropertySymbols(t);n<a.length;n++)e.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(t,a[n])&&(r[a[n]]=t[a[n]]);return r};const V=t=>{const{current:e,status:r,children:a,prefixCls:n,initial:l,direction:m,className:d,style:i,onChange:o}=t,g=he(t,["current","status","children","prefixCls","initial","direction","className","style","onChange"]),x=f.useMemo(()=>{const h=f.Children.toArray(a).filter(v=>f.isValidElement(v)),C=m==="vertical"?null:{width:`${100/h.length}%`};return f.Children.map(h,(v,p)=>{if(!v)return null;const k=l+p,_=Object.assign({stepNumber:`${k+1}`,direction:m},v.props);return r==="error"&&p===e-1&&(_.className=`${n}-next-error`),v.props.status||(k===e?_.status=r:k<e?_.status="finish":_.status="wait"),_.onChange=o?()=>{p!==e&&o(p+l)}:void 0,b.createElement(le,{style:C},f.cloneElement(v,Object.assign({},_)))})},[a,l,n,m,r,e,o]),w=P(d,{[n]:!0,[`${n}-${m}`]:!0});return b.createElement("div",Object.assign({className:w,style:i,"aria-label":t["aria-label"]},A(g)),b.createElement(ie,{type:"flex",justify:"start"},x))};V.propTypes={prefixCls:u.string,className:u.string,style:u.object,current:u.number,initial:u.number,direction:u.oneOf(["horizontal","vertical"]),status:u.oneOf(["wait","process","finish","error","warning"])};V.defaultProps={prefixCls:W.PREFIX,current:0,direction:"horizontal",initial:0,status:"process"};var ge=function(t,e){var r={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&e.indexOf(a)<0&&(r[a]=t[a]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,a=Object.getOwnPropertySymbols(t);n<a.length;n++)e.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(t,a[n])&&(r[a[n]]=t[a[n]]);return r};const U=t=>{const{size:e,current:r,status:a,children:n,prefixCls:l,initial:m,direction:d,className:i,style:o,hasLine:g,onChange:x}=t,w=ge(t,["size","current","status","children","prefixCls","initial","direction","className","style","hasLine","onChange"]),h=f.useMemo(()=>{const S=f.Children.toArray(n).filter(p=>f.isValidElement(p));return f.Children.map(S,(p,k)=>{if(!p)return null;const _=m+k,E=Object.assign({stepNumber:`${_+1}`,size:e},p.props);return a==="error"&&k===r-1&&(E.className=`${l}-next-error`),p.props.status||(_===r?E.status=a:_<r?E.status="finish":E.status="wait"),E.active=_===r,E.done=_<r,E.onChange=x?()=>{k!==r&&x(k+m)}:void 0,f.cloneElement(p,Object.assign({},E))})},[n,m,l,d,a,r,e,x]),C=P(i,{[`${l}-basic`]:!0,[`${l}-${d}`]:!0,[`${l}-${e}`]:e!=="default",[`${l}-hasline`]:g});return b.createElement("div",Object.assign({"aria-label":t["aria-label"],className:C,style:o},A(w)),h)};U.propTypes={prefixCls:u.string,className:u.string,style:u.object,current:u.number,initial:u.number,direction:u.oneOf(["horizontal","vertical"]),status:u.oneOf(["wait","process","finish","error","warning"]),hasLine:u.bool};U.defaultProps={prefixCls:W.PREFIX,current:0,direction:"horizontal",size:"",initial:0,hasLine:!0,status:"process"};var xe=function(t,e){var r={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&e.indexOf(a)<0&&(r[a]=t[a]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,a=Object.getOwnPropertySymbols(t);n<a.length;n++)e.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(t,a[n])&&(r[a[n]]=t[a[n]]);return r};const L=t=>{const{size:e,current:r,initial:a,children:n,prefixCls:l,className:m,style:d,onChange:i}=t,o=xe(t,["size","current","initial","children","prefixCls","className","style","onChange"]),g=f.useMemo(()=>{const w=f.Children.toArray(n).filter(S=>f.isValidElement(S)),h=w.length;return f.Children.map(w,(S,v)=>{if(!S)return null;const p=Object.assign({index:v,total:h},S.props);return p.active=v===r,p.onChange=i?()=>{v!==r&&i(v+a)}:void 0,f.cloneElement(S,Object.assign({},p))})},[n,l,r,e,a,i]),x=P(m,{[`${l}-nav`]:!0,[`${l}-${e}`]:e!=="default"});return b.createElement("div",Object.assign({"aria-label":t["aria-label"],className:x,style:d},A(o)),g)};L.propTypes={prefixCls:u.string,className:u.string,style:u.object,current:u.number,initial:u.number,size:u.oneOf(["small","default"])};L.defaultProps={prefixCls:W.PREFIX,current:0,direction:"horizontal",size:"default",initial:0,status:"process"};var be=function(t,e){var r={};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&e.indexOf(a)<0&&(r[a]=t[a]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,a=Object.getOwnPropertySymbols(t);n<a.length;n++)e.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(t,a[n])&&(r[a[n]]=t[a[n]]);return r};class R extends f.Component{renderComponent(){const e=this.props,{type:r}=e,a=be(e,["type"]);switch(r){case"fill":return b.createElement(V,Object.assign({},a));case"basic":return b.createElement(U,Object.assign({},a));case"nav":return b.createElement(L,Object.assign({},a));default:return null}}render(){const{type:e}=this.props;return b.createElement(te.Provider,{value:{type:e}},this.renderComponent())}}R.Step=we;R.propTypes={onChange:u.func,type:u.oneOf(["fill","basic","nav"]),size:u.oneOf(["small","default"])};R.defaultProps={type:"fill",size:"default"};const O={Idle:0,WasmPreparing:1,WasmPrepared:2,WasmSplitIssued:3,WasmSplitting:4,WasmSplitDone:5,WasmReadyToPrepare:6,WasmSplitPreparing:7,WasmPreparedSuccess:8,WasmCollecting:9,WasmUploadFail:-1,WasmDownloadFail:-2,WasmFileNotExist:-3,WasmSplitFail:-4,WasmSplitUpdateDBFail:-5,WasmSplitPrepareFail:-6,WasmPrepareFailed:-1};function Se({codeMd5:t,clientKey:e}){return N({url:"/game/wasm-split-config",method:"GET",data:{codeMd5:t,clientKey:e}})}function ve(t){const{codePath:e,codeMd5:r,clientKey:a,desc:n}=t;return N({url:"/game/wasm-prepare",method:"POST",data:{codePath:e,clientKey:a,codeMd5:r,desc:n}})}function _e({codeMd5:t,clientKey:e}){return N({url:"/game/wasm-prepare-result",method:"POST",data:{codeMd5:t,clientKey:e}})}function Ce(t,e){const r=e?.intervalMs,a=e?.maxAttempts,n=e?.signal||new AbortController().signal;let l=0;return new Promise((m,d)=>{if(n?.aborted){d(new DOMException("Polling aborted","AbortError"));return}const i=()=>{clearTimeout(o),d(new DOMException("Polling aborted","AbortError"))};n?.addEventListener("abort",i,{once:!0});let o;const g=async()=>{l+=1;try{const x=await _e(t),{status:w}=x.data;if(w===O.WasmPreparedSuccess||w===O.WasmSplitDone){m(x);return}if(w<0){m(x);return}if(l>=a){d(new Error(`Polling timeout after ${a} attempts`));return}o=window.setTimeout(g,r)}catch(x){if(l>=a){d(x);return}o=window.setTimeout(g,r)}};g()})}function je({codeMd5:t,clientKey:e,codePath:r}){return N({url:"/game/wasm-prepare-download",method:"POST",data:{codeMd5:t,clientKey:e,codePath:r}})}function ye(t){const{codeMd5:e,clientKey:r}=t;return N({url:"/game/wasm-split",method:"POST",data:{codeMd5:e,clientKey:r}})}function ke({codeMd5:t,clientKey:e}){return N({url:"/game/wasm-split-result",method:"POST",data:{codeMd5:t,clientKey:e}})}function Ne(t,e){const r=e?.intervalMs,a=e?.maxAttempts,n=e?.signal||new AbortController().signal;let l=0;return new Promise((m,d)=>{if(n?.aborted){d(new DOMException("Polling aborted","AbortError"));return}const i=()=>{clearTimeout(o),d(new DOMException("Polling aborted","AbortError"))};n?.addEventListener("abort",i,{once:!0});let o;const g=async()=>{l+=1;try{const x=await ke(t),{status:w}=x.data;if(w!==O.WasmSplitDone){if(l>=a){d(new Error(`Polling timeout after ${a} attempts`));return}o=window.setTimeout(g,r);return}m(x)}catch(x){if(l>=a){d(x);return}o=window.setTimeout(g,r)}};g()})}function Ee({codeMd5:t,clientKey:e}){return N({url:"/game/wasm-split-download-result",method:"POST",data:{clientKey:e,codeMd5:t}})}function Pe(t){return N({url:"/game/wasm-split-download",method:"POST",data:t})}function se(t){const{codeMd5:e,clientKey:r,codePath:a}=t;return N({url:"/game/wasm-split-reset",method:"POST",data:{codeMd5:e,clientKey:r,codePath:a}})}function Oe({codeMd5:t,clientKey:e}){return N({url:"/game/wasm-taskinfo",method:"GET",data:{codeMd5:t,clientKey:e}})}function $e({codeMd5:t,clientKey:e}){return N({url:"/game/wasm-set-collect",method:"POST",data:{codeMd5:t,clientKey:e}})}function X(t){return N({url:"/game/wasm-collect-funcids",method:"GET",data:t})}function Re(t){return N({url:"/game/wasm-collect-info",method:"GET",data:t})}const D={container:"wasm-prepare-downloading-content",process:"wasm-prepare-downloading-text",success:"wasm-prepare-downloading-success",error:"wasm-prepare-downloading-error"},Te=({kind:t,children:e})=>{const r={process:D.process,success:D.success,error:D.error};return s.jsx("div",{className:r[t],children:e})},Z={star_fetch_prepared_wasm_url:{kind:"process",text:"fetchDownloadUrl",showSpin:!0},fetch_prepared_wasm_url_done:{kind:"success",text:"fetchDownloadUrlSuccess",showSpin:!0},fetch_prepared_wasm_url_failed:{kind:"error",text:"fetchDownloadUrlFailed",appendError:!0},start_download_prepared_wasm:{kind:"process",text:"downloadPreparedWasmCode",showSpin:!0},download_prepared_wasm_done:{kind:"success",text:"downloadPreparedWasmCodeSuccess",showSpin:!0},download_prepared_wasm_failed:{kind:"error",text:"downloadPreparedWasmCodeFailed",appendError:!0,showRetry:!0},start_compress_prepared_wasm:{kind:"process",text:"compressPreparedWasmCode",showSpin:!0},compress_prepared_wasm_done:{kind:"success",text:"compressPreparedWasmCodeSuccess",showSpin:!0},start_write_compress_prepared_wasm:{kind:"process",text:"writeCompressPreparedWasmCode",showSpin:!0},start_update_wasm_split_config:{kind:"process",text:"updateWasmSplitConfig",showSpin:!0},update_wasm_split_config_done:{kind:"success",text:"updateWasmSplitConfigSuccess"},update_wasm_split_config_failed:{kind:"error",text:"updateWasmSplitConfigFailed",appendError:!0},default:{kind:"process",text:"processing",showSpin:!0}},We=({onCancel:t,onRetry:e,onHide:r})=>{const[a,n]=f.useState(""),[l,m]=f.useState("");f.useEffect(()=>{const g=x=>{n(x.status),m(x.errorMsg||"")};return z.on("unitySplitStatus",g),()=>{z.off("unitySplitStatus",g)}},[]);const d=f.useMemo(()=>Z[a]??Z.default,[a]),i=s.jsx($,{size:"large",color:"primary"}),o=typeof d.text=="string"?c(d.text)??d.text:"";return s.jsxs("div",{className:D.container,children:[d.showSpin&&i,!!o&&s.jsx(Te,{kind:d.kind,children:o}),d.appendError&&!!l&&s.jsx("div",{className:D.error,children:l}),d.showRetry&&s.jsx(j,{onClick:e,children:c("retryDownload")}),s.jsx(j,{style:{marginTop:12},type:"tertiary",onClick:r,children:c("backgroundRun")})]})},Fe=({onSubmit:t,onCancel:e,onChange:r})=>s.jsxs(H,{style:{width:"100%",transform:"translateY(-20px)"},onChange:r,onSubmit:t,children:[s.jsx(H.TextArea,{rules:[{required:!0,message:c("inputSplitDesc")}],label:c("splitDesc"),placeholder:c("inputSplitDesc"),field:"desc"}),s.jsxs("div",{className:"wasm-prepare-form-button-container",children:[s.jsx(j,{type:"tertiary",htmlType:"submit",style:{marginRight:12},children:c("startPrepare")}),s.jsx(j,{type:"tertiary",onClick:e,children:c("cancel")})]})]}),y={init:"init",start:"start",processing:O.WasmPreparing,processingReady:O.WasmReadyToPrepare,success:O.WasmPreparedSuccess,failed:O.WasmPrepareFailed,splitDone:O.WasmSplitDone,downloading:"downloading",downloadFailed:"downloadFailed"},K=new AbortController,De=({codePath:t,codeMd5:e,clientKey:r,onCancel:a,onNext:n,onHide:l})=>{const[m,d]=f.useState(""),[i,o]=f.useState({code:0,data:{status:y.init}}),g=f.useMemo(()=>i?.data?.status,[i?.data?.status]),x=()=>{K.abort(),a(),se({codeMd5:e,clientKey:r,codePath:t}).then(p=>{p.code===0&&o({...i,data:{...i?.data,status:y.init}})})},w=()=>{o({code:0,data:{status:y.start}}),ve({codePath:t,codeMd5:e,clientKey:r,desc:m}).then(p=>{p.code===0||p?.error?.code===10024||p?.error?.code===10028?(o({...p,data:{...p?.data,status:y.processing}}),h()):o({...i,error:p?.error||{code:-1,message:"Internal server error, please try again later..."},data:{...i?.data,status:y.failed}})})},h=()=>{Ce({codeMd5:e,clientKey:r},{intervalMs:500,maxAttempts:100,signal:K.signal}).then(p=>{p.code===0?o(p):o({...i,data:{...i?.data}})})},C=()=>{o({...i,data:{...i?.data,status:"downloading"}}),je({codePath:t,codeMd5:e,clientKey:r}).then(p=>{p.code===0?(o({...i,data:{...i?.data,status:y.success}}),n()):o({...i,data:{...i?.data,status:y.downloadFailed}})})},S=p=>{d(p?.values?.desc)};let v=null;switch(g){case y.init:v=s.jsx(Fe,{onSubmit:w,onCancel:a,onChange:S});break;case y.start:v=s.jsxs("div",{className:"wasm-prepare-processing-content",children:[s.jsx($,{size:"large",color:"primary"}),s.jsx("div",{className:"wasm-prepare-processing-text",children:c("startingPrepare")}),s.jsx("div",{className:"wasm-prepare-processing-cancel",children:s.jsxs(T,{children:[s.jsx(j,{type:"danger",onClick:a,children:c("cancelPrepare")}),s.jsx(j,{onClick:()=>l(),children:c("backgroundRun")})]})})]});break;case y.processing:case y.processingReady:v=s.jsxs("div",{className:"wasm-prepare-processing-content",children:[s.jsx($,{size:"large",color:"primary"}),s.jsx("div",{className:"wasm-prepare-processing-text",children:c("preparingSplit")}),s.jsx("div",{className:"wasm-prepare-processing-warning",children:c("warningDuringPreparing")}),s.jsx("div",{className:"wasm-prepare-processing-cancel",children:s.jsxs(T,{children:[s.jsx(j,{type:"tertiary",onClick:()=>{x()},children:c("cancelPrepare")}),s.jsx(j,{type:"tertiary",onClick:()=>l(),children:c("backgroundRun")})]})})]});break;case y.success:case y.splitDone:v=s.jsxs("div",{className:"wasm-prepare-success-content",children:[s.jsx("div",{className:"wasm-prepare-success-text",children:c("preparingSplitSuccess")}),s.jsx("div",{className:"wasm-prepare-success-download",children:s.jsx(j,{type:"tertiary",onClick:()=>{C()},children:c("downloadPreparedWasmCode")})})]});break;case y.downloading:v=s.jsx(We,{onHide:l});break;case y.downloadFailed:const p=i?.error?.message||"Unknown error";v=s.jsxs("div",{className:"wasm-prepare-downloadfailed-content",children:[s.jsx("div",{className:"wasm-prepare-downloadfailed-text",children:c("downloadFailed")}),s.jsx("div",{className:"wasm-prepare-downloadfailed-warning",children:p}),s.jsx(j,{onClick:C,children:c("retryDownload")})]});break;case y.failed:const k=i?.error?.message||"Unknown error";v=s.jsxs("div",{className:"wasm-prepare-failed-content",children:[s.jsx("div",{className:"wasm-prepare-failed-text",children:c("preparingSplitFailed")}),i?.data?.status===y.failed&&s.jsx("div",{className:"wasm-prepare-failed-warning",children:k}),s.jsx(j,{type:"tertiary",style:{marginTop:12},onClick:w,children:c("retryPrepare")})]});break;default:v=null}return s.jsx("div",{className:"wasm-prepare-content-container",children:v})},Ie=({data:t})=>{const e={...t||{}},r=[{label:"Client key",value:"app_id"},{label:c("wasmSize"),value:"wasm_size",render:a=>`${(a/1024/1024).toFixed(2)} MB`},{label:c("totalFuncCount"),value:"total_wasm_func_count",render:a=>a>=1e3?`${(a/1e3).toFixed(2)} K`:`${a}`},{label:c("collectedFuncCount"),value:"collected_func_count",render:a=>a>=1e3?`${(a/1e3).toFixed(2)} K`:`${a}`},{label:"Wasm md5",value:"wasm_md5"}];return s.jsx("div",{className:"wasm-collect-status",children:r.map(a=>s.jsxs("div",{className:"wasm-collect-status-item",children:[s.jsx(oe,{size:"small",className:"wasm-collect-status-item-label",children:a.label}),s.jsx("span",{className:"wasm-collect-status-item-value",children:a.render?.(e[a.value])||e[a.value]})]},a.value))})},ze=({onNext:t,codeMd5:e,clientKey:r,onHide:a})=>{const{state:{devSchema:n}}=ce(),[l,m]=f.useState("willCollect"),[d,i]=f.useState(),[o,g]=f.useState(),[x,w]=f.useState(0),h=f.useRef(null),C=f.useMemo(()=>!o||!o?.total_wasm_func_count?!1:(x||0)/(o?.total_wasm_func_count||0)>=.08,[o,x]);f.useEffect(()=>{if(l!=="collecting"){h.current&&(window.clearInterval(h.current),h.current=null);return}if(!h.current)return X({codeMd5:e,clientKey:r}).then(p=>{w(p.data?.collected_func_count||0)}).catch(console.error),h.current=window.setInterval(()=>{X({codeMd5:e,clientKey:r}).then(p=>{w(p.data?.collected_func_count||0)}).catch(p=>{console.error(p)})},2e3),()=>{h.current&&(window.clearInterval(h.current),h.current=null)}},[l,e,r]);const S=async()=>{if(l!=="collecting")try{m("startCollect");const p=await $e({codeMd5:e,clientKey:r});m("collecting"),Oe({codeMd5:e,clientKey:r}).then(k=>{i(k.data)}).catch(console.error),Re({codeMd5:e,clientKey:r}).then(k=>{g(k.data||{})}).catch(console.error)}catch(p){console.error(p)}},v=()=>{h.current&&(window.clearInterval(h.current),h.current=null),m("willCollect"),t()};return s.jsxs("div",{className:"wasm-collect-content-container",children:[d&&s.jsx(Ie,{data:{...d||{},total_wasm_func_count:o?.total_wasm_func_count,collected_func_count:x}}),s.jsx("div",{className:"collect-qrcode-container",children:s.jsx(de,{value:n})}),s.jsx("div",{className:"collect-qrcode-desc",children:c("collectDesc")}),s.jsxs("div",{className:"collect-qrcode-button-container",children:[l!=="collecting"&&s.jsx(j,{loading:l==="startCollect",onClick:S,children:c("startCollect")}),l==="collecting"&&s.jsxs(T,{children:[C?s.jsx(j,{type:"tertiary",onClick:v,children:c("startSplit")}):s.jsx(ue,{content:c("cannotSplitTip"),children:s.jsx(j,{type:"tertiary",disabled:!0,children:c("startSplit")})}),s.jsx(j,{type:"tertiary",onClick:a,children:c("backgroundRun")})]})]})]})},Ae=({onCancel:t,onHide:e})=>{const[r,a]=f.useState(""),[n,l]=f.useState("");f.useEffect(()=>{const o=g=>{a(g.status),l(g.errorMsg||"")};return z.on("unitySplitStatus",o),()=>{z.off("unitySplitStatus",o)}},[]);let m=null;const d="wasm-split-downloading-content",i="wasm-split-downloading-text";switch(r){case"start_download_android_main_wasm":case"download_android_main_wasm_done":case"start_compress_android_main_wasm":case"compress_android_main_wasm_done":case"start_download_android_sub_wasm_code":case"download_android_sub_wasm_code_done":case"start_compress_android_sub_wasm_code":case"compress_android_sub_wasm_code_done":case"start_download_ios_main_wasm":case"download_ios_main_wasm_done":case"start_compress_ios_main_wasm":case"compress_ios_main_wasm_done":case"start_download_ios_range_json":case"download_ios_range_json_done":case"start_download_ios_js_data_br":case"download_ios_js_data_br_done":case"start_compress_ios_sub_wasm_code":case"compress_ios_sub_wasm_code_done":case"start_write_splited_wasm_br":case"write_splited_wasm_done":case"start_update_wasm_split_config":case"update_wasm_split_config_done":m=s.jsxs("div",{className:d,children:[s.jsx($,{size:"large",color:"primary"}),s.jsx("div",{className:i,children:c(r)}),s.jsxs(T,{children:[s.jsx(j,{type:"danger",onClick:t,children:c("cancelSplit")}),s.jsx(j,{onClick:e,children:c("backgroundRun")})]})]});break;default:m=s.jsxs("div",{className:d,children:[s.jsx($,{size:"large",color:"primary"}),s.jsx("div",{className:i,children:c("processing")})]})}return m},Q=new AbortController,Me=({onCancel:t,onHide:e,codeMd5:r,clientKey:a})=>{const[n,l]=f.useState("spliting"),[m,d]=f.useState(),i=()=>{Q.abort(),t()},o=()=>{l("downloadingSplitResult"),Pe(m?.result).then(h=>{h.code===0?l("downloadSuccess"):l("downloadFailed")}).catch(()=>{l("downloadFailed")})},g=()=>{l("spliting"),ye({codeMd5:r,clientKey:a}).then(h=>{h.code===0&&Ne({codeMd5:r,clientKey:a},{intervalMs:1e3,maxAttempts:1e3,signal:Q.signal}).then(C=>{l("splitSuccess"),x()})}).catch(()=>{l("splitFailed")})},x=()=>{l("startGetSplitResult"),Ee({clientKey:a,codeMd5:r}).then(h=>{h.code===0?(d(h.data),l("getSplitResultSuccess")):l("getSplitResultFailed")})};f.useEffect(()=>{g()},[]);let w=null;switch(n){case"spliting":w=s.jsxs("div",{className:"wasm-split-processing",children:[s.jsx($,{size:"large",color:"primary"}),s.jsx("div",{className:"wasm-split-processing-content",children:c("splittingDesc")}),s.jsx("div",{className:"wasm-split-processing-cancel",children:s.jsxs(T,{children:[s.jsx(j,{onClick:()=>i(),type:"danger",children:c("cancelSplit")}),s.jsx(j,{onClick:()=>e(),children:c("backgroundRun")})]})})]});break;case"splitSuccess":w=s.jsx("div",{className:"wasm-split-success",children:s.jsx("div",{className:"wasm-split-success-content",children:c("getSplitResult")})});break;case"startGetSplitResult":w=s.jsxs("div",{className:"wasm-split-processing",children:[s.jsx($,{}),s.jsx("div",{className:"wasm-split-processing-content",children:c("getSplitResult")})]});break;case"getSplitResultFailed":w=s.jsxs("div",{className:"wasm-split-failed",children:[s.jsx("div",{className:"wasm-split-failed-content",children:c("getSplitResultFailed")}),s.jsx("div",{className:"wasm-split-failed-retry",children:s.jsx(j,{type:"primary",onClick:()=>x(),children:c("retryGetSplitResult")})})]});break;case"getSplitResultSuccess":w=s.jsxs("div",{className:"wasm-split-success",children:[s.jsx("div",{className:"wasm-split-success-content",children:c("splitSuccess")}),s.jsx("div",{className:"wasm-split-success-download",children:s.jsx(j,{type:"primary",onClick:()=>o(),children:c("downloadSplitResult")})})]});break;case"getDownloadResultFailed":w=s.jsxs("div",{className:"wasm-split-failed",children:[s.jsx("div",{className:"wasm-split-failed-content",children:c("getSplitResultFailed")}),s.jsx("div",{className:"wasm-split-failed-retry",children:s.jsx(j,{type:"primary",onClick:()=>x(),children:c("retryGetSplitResult")})})]});break;case"downloadingSplitResult":w=s.jsx(Ae,{onCancel:i,onHide:e});break;case"downloadSuccess":w=s.jsxs("div",{className:"wasm-split-success",children:[s.jsx("div",{className:"wasm-split-success-content",children:c("downloadSplitResultSuccess")}),s.jsx("div",{className:"wasm-split-success-tip",children:c("downloadSplitResultTip")})]});break;default:w=null}return s.jsx("div",{className:"wasm-split-content-container",children:w})},I={prepare:{number:0,title:c("splitPrepare")},collect:{number:1,title:c("splitCollect")},split:{number:2,title:c("splitCode")},rollback:{number:3,title:c("rollback")}},Be=({stage:t})=>s.jsxs(R,{type:"basic",current:I[t].number,style:{marginTop:24},children:[s.jsx(R.Step,{title:I.prepare.title}),s.jsx(R.Step,{title:I.collect.title}),s.jsx(R.Step,{title:I.split.title})]}),Ge=({onCancel:t,errorType:e,onHide:r})=>s.jsxs("div",{className:"wasm-code-split-error",children:[e==="noWasmCode"&&s.jsxs("div",{className:"wasm-code-split-error-container",children:[s.jsx("div",{className:"wasm-code-split-error-title",children:c("noWasmCode")}),s.jsx("div",{className:"wasm-code-split-error-desc",children:c("noWasmCodeDesc")})]}),e==="hasSplited"&&s.jsxs("div",{className:"wasm-code-split-error-container",children:[s.jsx("div",{className:"wasm-code-split-error-title",children:c("hasSplitedTitle")}),s.jsx("div",{className:"wasm-code-split-error-desc",children:c("hasSplitedDesc")}),s.jsxs(T,{children:[s.jsx(j,{onClick:t,children:c("cancelSplit")}),s.jsx(j,{onClick:r,children:c("backgroundRun")})]})]}),e==="noSplitConfig"&&s.jsxs("div",{className:"wasm-code-split-error-container",children:[s.jsx("div",{className:"wasm-code-split-error-title",children:c("noSplitConfigTitle")}),s.jsx("div",{className:"wasm-code-split-error-desc",children:c("noSplitConfigDesc")})]})]}),Ve=()=>s.jsxs("div",{className:"split-loading",children:[s.jsx($,{size:"large",color:"primary"}),s.jsx("div",{className:"split-loading-text",children:"正在初始化分包环境"})]}),Ue=({codeMd5:t,clientKey:e,codePath:r,onHide:a,onReset:n})=>{const[l,m]=f.useState("rollbacking"),d=()=>{m("rollbacking"),se({codeMd5:t,clientKey:e,codePath:r}).then(g=>{g.code===0?(m("rollbackSuccess"),n()):m("rollbackFailed")})};f.useEffect(()=>{d()},[]);let i="",o=null;switch(l){case"rollbacking":i="回滚中...",o=s.jsx(j,{onClick:()=>{m("rollbackFailed")},children:"后台进行"});break;case"rollbackSuccess":i="回滚成功",o=s.jsx(j,{onClick:()=>{a()},children:"关闭"});break;case"rollbackFailed":i="回滚失败",o=s.jsx(j,{onClick:()=>{d()},children:"重试"});break}return s.jsx(s.Fragment,{children:s.jsxs("div",{className:"wasm-split-rollback-container",children:[s.jsx("div",{className:"wasm-split-rollback-text",children:i}),o]})})};function Le({enableWasmCollect:t,enableWasmSplit:e}){return typeof t=="boolean"&&(typeof e=="string"||e===!1)?t:!1}function qe({enableWasmSplit:t,hasWasmCode:e}){return t===!0?{errorType:"hasSplited",hasError:!0}:e?{hasError:!1}:{errorType:"noWasmCode",hasError:!0}}const Xe=({codePath:t,clientKey:e,codeMd5:r})=>{const[a,n]=f.useState(!1),[l,m]=f.useState(""),[d,i]=f.useState("loading"),[o,g]=f.useState(null),x=()=>{n(!0),(!o||d==="error")&&(i("loading"),Se({codeMd5:r,clientKey:e}).then(C=>{if(C.code===0){const{errorType:S,hasError:v}=qe({enableWasmSplit:C.data.enableWasmSplit,hasWasmCode:!!t});m(S),v?(m(S),i("error")):Le(C.data)?i("collect"):i("prepare"),g(C.data)}else i("error")}))},w=()=>{n(!1)},h=()=>{i("rollback")};return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:P("wasm-code-split",{}),onClick:x,children:[s.jsx(fe,{size:"default"}),s.jsx("span",{className:"wasm-code-split-text",children:c("wasmSplit")})]}),s.jsxs(pe,{centered:!0,keepDOM:!0,maskClosable:!1,visible:a,footer:null,style:{width:"90%"},onCancel:()=>n(!1),onOk:()=>n(!1),title:c("wasmSplit"),children:[d==="loading"&&s.jsx(Ve,{}),d==="error"&&s.jsx(Ge,{errorType:l,onCancel:h,onHide:w}),d!=="error"&&d!=="loading"&&s.jsx(Be,{stage:d}),d==="prepare"&&s.jsx(De,{codeMd5:r,codePath:t,clientKey:e,onCancel:()=>{n(!1)},onNext:()=>{i("collect")},onHide:w}),d==="collect"&&s.jsx(ze,{codeMd5:r,clientKey:e,onCancel:()=>{n(!1),i("prepare")},onHide:w,onNext:()=>{i("split")}}),d==="split"&&s.jsx(Me,{codeMd5:r,clientKey:e,onCancel:h,onHide:w}),d==="rollback"&&s.jsx(Ue,{codeMd5:r,clientKey:e,codePath:t,onHide:w,onReset:()=>{i("prepare")}})]})]})};export{Xe as WasmCodeSplit};
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.semi-steps .semi-col{flex:1}.semi-steps-vertical .semi-row-flex{flex-direction:column}.semi-steps .semi-steps-item{box-sizing:border-box;display:flex;height:72px;position:relative;overflow:hidden;margin-right:16px;border:1px solid transparent;border-radius:var(--semi-border-radius-medium);padding:12px 16px;transition:color var(--semi-transition_duration-none) var(--semi-transition_function-easeIn) var(--semi-transition_delay-none);transform:scale(var(--semi-transform_scale-small));transition:background-color var(--semi-transition_duration-none) var(--semi-transition_function-easeIn) var(--semi-transition_delay-none)}.semi-steps .semi-steps-item .semi-steps-item-title{position:relative;font-size:18px;line-height:24px;font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif;font-weight:600;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--semi-color-text-0);transition:color var(--semi-transition_duration-none) var(--semi-transition_function-easeIn) var(--semi-transition_delay-none)}.semi-steps .semi-steps-item .semi-steps-item-description{font-size:14px;line-height:20px;font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif;color:var(--semi-color-text-2);width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.semi-steps .semi-steps-item-process{background-color:var(--semi-color-primary-light-default)}.semi-steps .semi-steps-item-process .semi-steps-item-left:not(.semi-steps-item-icon){background:var(--semi-color-primary)}.semi-steps .semi-steps-item-process .semi-steps-item-title,.semi-steps .semi-steps-item-process .semi-steps-item-icon{color:var(--semi-color-primary)}.semi-steps .semi-steps-item-wait .semi-steps-item-left:not(.semi-steps-item-icon){background:var(--semi-color-text-2)}.semi-steps .semi-steps-item-wait .semi-steps-item-icon{color:var(--semi-color-text-2)}.semi-steps .semi-steps-item-finish .semi-icon,.semi-steps .semi-steps-item-finish .semi-steps-item-title{color:var(--semi-color-success)}.semi-steps .semi-steps-item-finish-hover:hover{background-color:var(--semi-color-fill-0)}.semi-steps .semi-steps-item-finish-hover:hover .semi-icon,.semi-steps .semi-steps-item-finish-hover:hover .semi-steps-item-title{color:var(--semi-color-success-hover)}.semi-steps .semi-steps-item-finish-active:active{background-color:var(--semi-color-fill-1)}.semi-steps .semi-steps-item-finish-active:active .semi-icon,.semi-steps .semi-steps-item-finish-active:active .semi-steps-item-title{color:var(--semi-color-success-active)}.semi-steps .semi-steps-item-error .semi-icon,.semi-steps .semi-steps-item-error .semi-steps-item-title{color:var(--semi-color-danger)}.semi-steps .semi-steps-item-error-hover:hover{background:var(--semi-color-fill-0)}.semi-steps .semi-steps-item-error-hover:hover .semi-icon,.semi-steps .semi-steps-item-error-hover:hover .semi-steps-item-title{color:var(--semi-color-danger-hover)}.semi-steps .semi-steps-item-error-active:active{background-color:var(--semi-color-fill-1)}.semi-steps .semi-steps-item-error-active:active .semi-icon,.semi-steps .semi-steps-item-error-active:active .semi-steps-item-title{color:var(--semi-color-danger-active)}.semi-steps .semi-steps-item-warning .semi-steps-item-title,.semi-steps .semi-steps-item-warning .semi-icon{color:var(--semi-color-warning)}.semi-steps .semi-steps-item-warning-hover:hover{background:var(--semi-color-fill-0)}.semi-steps .semi-steps-item-warning-hover:hover .semi-steps-item-title,.semi-steps .semi-steps-item-warning-hover:hover .semi-icon{color:var(--semi-color-warning-hover)}.semi-steps .semi-steps-item-warning-active:active{background-color:var(--semi-color-fill-1)}.semi-steps .semi-steps-item-warning-active:active .semi-steps-item-title,.semi-steps .semi-steps-item-warning-active:active .semi-icon{color:var(--semi-color-warning-active)}.semi-steps .semi-steps-item-clickable{cursor:pointer}.semi-steps .semi-steps-item-left{width:24px;height:24px;line-height:32px;text-align:center;border-radius:32px;display:flex;align-items:center;justify-content:center;font-size:20px;line-height:28px;font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif;font-weight:600;flex-grow:0}.semi-steps .semi-steps-item-left.semi-steps-item-plain{color:rgba(var(--semi-white),1)}.semi-steps .semi-steps-item-left-process{background:var(--semi-color-primary-light-default)}.semi-steps .semi-steps-item-content{margin-left:16px;flex:1;overflow:hidden}.semi-steps-basic.semi-steps-horizontal{display:flex;flex-flow:row nowrap}.semi-steps-basic.semi-steps-horizontal.semi-steps-hasline .semi-steps-item-title:after{content:"";position:absolute;top:50%;left:100%;display:block;width:9999px;height:1px;background:var(--semi-color-fill-2)}.semi-steps-basic.semi-steps-horizontal .semi-steps-item{padding-left:16px}.semi-steps-basic.semi-steps-horizontal .semi-steps-item:first-child{padding-left:0}.semi-steps-basic.semi-steps-horizontal .semi-steps-item:last-child{flex:none}.semi-steps-basic.semi-steps-horizontal .semi-steps-item:last-child .semi-steps-item-title{max-width:100%;padding-right:0}.semi-steps-basic.semi-steps-horizontal .semi-steps-item:last-child .semi-steps-item-title:after{display:none}.semi-steps-basic.semi-steps-horizontal .semi-steps-item-done .semi-steps-item-container .semi-steps-item-title:after{background:var(--semi-color-primary)}.semi-steps-basic.semi-steps-horizontal .semi-steps-item .semi-steps-item-content{flex:1}.semi-steps-basic.semi-steps-horizontal .semi-steps-item .semi-steps-item-description{font-size:12px;line-height:16px;font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif;color:var(--semi-color-text-2);width:100%;max-width:268px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.semi-steps-basic.semi-steps-horizontal .semi-steps-item .semi-steps-item-title{max-width:80%}.semi-steps-basic.semi-steps-horizontal .semi-steps-item .semi-steps-item-title .semi-steps-item-title-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;transition:color var(--semi-transition_duration-none) var(--semi-transition_function-easeIn) var(--semi-transition_delay-none)}.semi-steps-basic.semi-steps-vertical{display:flex;flex-flow:column nowrap}.semi-steps-basic.semi-steps-vertical .semi-steps-item-icon{box-sizing:content-box}.semi-steps-basic.semi-steps-vertical.semi-steps-small .semi-steps-item .semi-steps-item-content{min-height:40px}.semi-steps-basic.semi-steps-vertical.semi-steps-hasline .semi-steps-item-icon:after{content:"";position:absolute;top:100%;left:50%;display:block;width:1px;height:9999px;background:var(--semi-color-fill-2)}.semi-steps-basic.semi-steps-vertical .semi-steps-item{padding-top:9px}.semi-steps-basic.semi-steps-vertical .semi-steps-item:first-child{padding-top:0}.semi-steps-basic.semi-steps-vertical .semi-steps-item:last-child .semi-steps-item-icon:after{display:none}.semi-steps-basic.semi-steps-vertical .semi-steps-item-done .semi-steps-item-icon:after{background:var(--semi-color-primary)}.semi-steps-basic.semi-steps-vertical .semi-steps-item .semi-steps-item-content{min-height:42px;padding-bottom:22px}.semi-steps-basic.semi-steps-vertical .semi-steps-item .semi-steps-item-icon{display:inline-flex;position:relative;padding-bottom:9px}.semi-steps-basic.semi-steps-vertical .semi-steps-item .semi-steps-item-description{font-size:12px;line-height:16px;font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif;color:var(--semi-color-text-2);width:100%}.semi-steps-basic.semi-steps-vertical .semi-steps-item .semi-steps-item-title{max-width:100%}.semi-steps-basic.semi-steps-vertical .semi-steps-item .semi-steps-item-title .semi-steps-item-title-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.semi-steps-basic .semi-steps-item{box-sizing:border-box;position:relative;display:inline-block;vertical-align:top;overflow:hidden;flex:1;transition:color var(--semi-transition_duration-none) var(--semi-transition_function-easeIn) var(--semi-transition_delay-none),background-color var(--semi-transition_duration-none) var(--semi-transition_function-easeIn) var(--semi-transition_delay-none);transform:scale(var(--semi-transform_scale-small))}.semi-steps-basic .semi-steps-item-clickable{cursor:pointer}.semi-steps-basic .semi-steps-item-hover:hover .semi-steps-item-title,.semi-steps-basic .semi-steps-item-hover:hover .semi-steps-item-description{color:var(--semi-color-focus-border)}.semi-steps-basic .semi-steps-item .semi-steps-item-container{display:flex;align-items:flex-start}.semi-steps-basic .semi-steps-item .semi-steps-item-left{display:flex;justify-content:center;align-items:center;margin-right:8px}.semi-steps-basic .semi-steps-item .semi-steps-item-left .semi-steps-item-icon{display:flex;height:24px;align-items:center}.semi-steps-basic .semi-steps-item .semi-steps-item-left .semi-steps-item-number-icon{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;font-size:16px;line-height:22px;font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif;font-weight:600;background:var(--semi-color-primary);border-radius:var(--semi-border-radius-circle);color:var(--semi-color-white);transition:color var(--semi-transition_duration-none) var(--semi-transition_function-easeIn) var(--semi-transition_delay-none)}.semi-steps-basic .semi-steps-item .semi-steps-item-title{position:relative;display:inline-block;font-size:16px;line-height:22px;font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif;line-height:24px;font-weight:600;color:var(--semi-color-text-0);vertical-align:top;padding-right:16px;margin-bottom:4px;transition:color var(--semi-transition_duration-none) var(--semi-transition_function-easeIn) var(--semi-transition_delay-none)}.semi-steps-basic .semi-steps-item-finish .semi-steps-item-left .semi-steps-item-icon{color:var(--semi-color-primary)}.semi-steps-basic .semi-steps-item-finish .semi-steps-item-left .semi-steps-item-icon .semi-steps-item-number-icon{color:var(--semi-color-white)}.semi-steps-basic .semi-steps-item-wait .semi-steps-item-title,.semi-steps-basic .semi-steps-item-wait .semi-steps-item-left .semi-steps-item-icon{color:var(--semi-color-text-2)}.semi-steps-basic .semi-steps-item-wait .semi-steps-item-left .semi-steps-item-icon .semi-steps-item-number-icon{background:var(--semi-color-fill-0);color:var(--semi-color-text-2)}.semi-steps-basic .semi-steps-item-wait-hover:hover .semi-steps-item-left .semi-steps-item-icon .semi-steps-item-number-icon{background:var(--semi-color-secondary-light-default);color:var(--semi-color-focus-border)}.semi-steps-basic .semi-steps-item-process .semi-steps-item-left .semi-steps-item-icon{color:var(--semi-color-primary)}.semi-steps-basic .semi-steps-item-process .semi-steps-item-left .semi-steps-item-icon .semi-steps-item-number-icon{color:var(--semi-color-white)}.semi-steps-basic .semi-steps-item-error .semi-steps-item-left .semi-steps-item-icon{color:var(--semi-color-danger)}.semi-steps-basic .semi-steps-item-error .semi-steps-item-left .semi-steps-item-icon .semi-steps-item-number-icon{color:var(--semi-color-primary)}.semi-steps-basic .semi-steps-item-warning .semi-steps-item-left .semi-steps-item-icon{color:var(--semi-color-warning)}.semi-steps-basic .semi-steps-item-warning .semi-steps-item-left .semi-steps-item-icon .semi-steps-item-number-icon{color:var(--semi-color-white)}.semi-steps-basic.semi-steps-small .semi-steps-item .semi-steps-item-title{font-size:14px;line-height:20px;font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif}.semi-steps-basic.semi-steps-small .semi-steps-item .semi-steps-item-left .semi-steps-item-icon{height:20px}.semi-steps-basic.semi-steps-small .semi-steps-item .semi-steps-item-left .semi-steps-item-icon .semi-steps-item-number-icon{font-size:12px;line-height:16px;font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif;width:20px;height:20px}.semi-steps-nav{display:inline-flex;flex-flow:row nowrap}.semi-steps-nav .semi-steps-item{box-sizing:border-box}.semi-steps-nav .semi-steps-item:last-child{flex:none}.semi-steps-nav .semi-steps-item:last-child .semi-steps-item-content{width:auto}.semi-steps-nav .semi-steps-item .semi-steps-item-container{display:flex;align-items:center;color:var(--semi-color-text-2)}.semi-steps-nav .semi-steps-item .semi-steps-item-container .semi-steps-item-icon{display:inline-flex;flex:1;justify-content:center;color:var(--semi-grey-3);min-width:60px}.semi-steps-nav .semi-steps-item .semi-steps-item-content{flex:1;display:inline-block}.semi-steps-nav .semi-steps-item .semi-steps-item-title{font-size:16px;line-height:22px;font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif;max-width:17em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:400}.semi-steps-nav .semi-steps-item-active .semi-steps-item-title{color:var(--semi-color-text-0);font-weight:600}.semi-steps-nav.semi-steps-small .semi-steps-item .semi-steps-item-title{font-size:14px;line-height:20px;font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif}.semi-rtl .semi-steps,.semi-portal-rtl .semi-steps{direction:rtl}.semi-rtl .semi-steps-item,.semi-portal-rtl .semi-steps-item{margin-right:auto;margin-left:16px}.semi-rtl .semi-steps-item-content,.semi-portal-rtl .semi-steps-item-content{margin-left:auto;margin-right:16px}.semi-rtl .semi-steps-basic,.semi-portal-rtl .semi-steps-basic{direction:rtl}.semi-rtl .semi-steps-basic.semi-steps-horizontal .semi-steps-item .semi-steps-item-title,.semi-portal-rtl .semi-steps-basic.semi-steps-horizontal .semi-steps-item .semi-steps-item-title{padding-left:16px}.semi-rtl .semi-steps-basic.semi-steps-horizontal .semi-steps-item .semi-steps-item-title:after,.semi-portal-rtl .semi-steps-basic.semi-steps-horizontal .semi-steps-item .semi-steps-item-title:after{right:100%}.semi-rtl .semi-steps-basic.semi-steps-vertical .semi-steps-item,.semi-portal-rtl .semi-steps-basic.semi-steps-vertical .semi-steps-item{margin:0}.semi-rtl .semi-steps-nav,.semi-portal-rtl .semi-steps-nav{direction:rtl}.wasm-prepare-downloading-content{display:flex;flex-direction:column;align-items:center;justify-content:center}.wasm-prepare-downloading-text{font-size:14px;font-weight:400;margin-top:12px}.wasm-prepare-downloading-error{font-size:14px;font-weight:400;margin-top:12px;color:red}.wasm-prepare-downloading-success{font-size:14px;font-weight:400;margin-top:12px;color:green}.wasm-prepare-form-button-container{display:flex;align-items:center;margin-top:12px}.wasm-prepare-content-container{display:flex;flex-direction:column;justify-content:center;align-items:center;padding:24px;min-height:200px;position:relative}.wasm-prepare-init-content{position:absolute;top:0;display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%}.wasm-prepare-processing-content{display:flex;flex-direction:column;align-items:center;justify-content:center}.wasm-prepare-init-text,.wasm-prepare-processing-text{font-size:14px;font-weight:400;margin-top:12px;margin-bottom:12px}.wasm-prepare-processing-warning{font-size:14px;color:orange;margin-bottom:12px}.wasm-prepare-failed-error{margin-top:12px;display:flex;flex-direction:column;align-items:center;color:orange;font-weight:600;margin-bottom:12px}.wasm-prepare-success-content{display:flex;flex-direction:column;align-items:center}.wasm-prepare-success-download{margin-top:12px}.wasm-prepare-success-text{font-size:16px;color:green;font-weight:600}.wasm-prepare-downloadfailed-content{display:flex;flex-direction:column;align-items:center}.wasm-prepare-downloadfailed-text{font-size:14px;font-weight:400;margin-bottom:12px;color:#ff4d4f}.wasm-prepare-failed-warning{font-size:14px;color:orange;margin-top:12px}.wasm-prepare-failed-content{display:flex;flex-direction:column;align-items:center;justify-content:center}.wasm-collect-status{display:flex;width:80%;align-items:center;flex-direction:row;flex-wrap:wrap;margin-bottom:24px}.wasm-collect-status-item{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;margin-right:12px;margin-bottom:12px}.wasm-collect-status-item-label{font-size:14px;font-weight:600;padding-right:8px;flex-shrink:0;background-color:#ffffff1a}.wasm-collect-status-item-value{font-size:14px;flex-shrink:0;color:gray}.collect-qrcode-container{display:flex;flex-direction:column;align-items:center}.collect-qrcode-title{margin-bottom:12px}.collect-qrcode-desc{width:60%;margin-top:12px;text-align:center;font-size:13px;font-weight:400}.collect-qrcode-button-container{margin-top:12px}.wasm-collect-content-container{min-height:300px;width:100%;display:flex;padding:24px;align-items:center;flex-direction:column;justify-content:center}.wasm-split-content-container{min-height:300px;display:flex;align-items:center;flex-direction:column;justify-content:center;padding:24px 0}.wasm-split-processing{display:flex;flex-direction:column;align-items:center;justify-content:center}.wasm-split-processing-content{font-size:14px;font-weight:400;margin-top:12px}.wasm-split-processing-cancel{margin-top:12px}.wasm-split-success{display:flex;justify-content:center;align-items:center;flex-direction:column;font-size:14px;font-weight:400}.wasm-split-success-content{margin-top:12px;font-size:16px;font-weight:600;color:green;margin-bottom:12px}.wasm-split-success-tip{font-size:14px;padding:0 32px;font-weight:400}.wasm-split-success-download-retry,.wasm-split-success-download-retry-button{margin-top:12px}.wasm-split-status{display:flex;width:100%;align-items:center;flex-direction:row;flex-wrap:wrap;margin-bottom:24px}.wasm-split-status-item{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;margin-right:12px;margin-bottom:12px}.wasm-split-status-item-label{font-size:14px;font-weight:600;padding-right:8px;flex-shrink:0;background-color:#ffffff1a}.wasm-split-status-item-value{font-size:14px;flex-shrink:0;color:gray}.wasm-split-downloading-content{display:flex;flex-direction:column;align-items:center}.wasm-split-downloading-text{font-size:14px;font-weight:400;margin-top:12px;margin-bottom:12px}.debug-wrapper{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center}.wasm-code-split-error{min-height:300px;display:flex;justify-content:center;align-items:center;flex-direction:column}.wasm-code-split-error-container{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center}.wasm-code-split-error-title{font-size:14px;font-weight:600;margin-bottom:12px}.wasm-code-split-error-container button{margin-left:12px}.wasm-code-split-error-desc{font-size:14px;font-weight:400;color:#606266;margin-bottom:12px}.split-loading{min-height:300px;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:24px 0}.split-loading-text{font-size:14px;font-weight:400;margin-top:12px}.wasm-split-rollback-container{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:300px}.wasm-split-rollback-text{font-size:14px;font-weight:400;margin-bottom:12px}.wasm-code-split{font-weight:400;display:flex;align-items:center}.wasm-code-split:hover{cursor:pointer;color:#1765ff}.wasm-code-split-disabled{font-size:20px;color:#c0c4cc}.wasm-code-split-disabled:hover{color:#c0c4cc}.wasm-code-split-text{font-size:14px;padding-left:4px}.wasm-modal-content-base{min-height:300px;display:flex;padding-bottom:24px;flex-direction:column}
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as n,j as s,p as o,af as t,i}from"./index-BGB_3rmy.js";const r="/api/passport/web/email/login",a={aid:"2471",account_sdk_source:"web",sdk_version:"2.1.1"};r+""+new URLSearchParams(a);const c=()=>{const{state:{user:e}}=n();return e?.email?s.jsx(o,{position:"bottom",content:s.jsx("div",{className:"login-user-popover",children:e.email}),children:s.jsx(t,{color:"amber",style:{flexShrink:0},alt:e?.email,size:"small",children:e?.email?.split("@")[0][0]})}):s.jsx(o,{position:"bottom",trigger:"hover",content:s.jsx("div",{className:"not-login-status-popover",children:i("notLoginTip")}),children:s.jsx(t,{color:"grey",style:{flexShrink:0},size:"small",children:i("notLogin")})})};export{c as LoginStatus};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.semi-popconfirm{box-sizing:border-box;max-width:400px}.semi-popconfirm-inner{display:flex;flex-direction:column;padding:24px 24px 24px 20px;position:relative}.semi-popconfirm-header{display:flex;justify-content:flex-start}.semi-popconfirm-header-title{font-size:16px;line-height:22px;font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif;font-weight:600;margin-bottom:8px;color:var(--semi-color-text-0)}.semi-popconfirm-header-icon{width:24px;height:24px;margin-right:12px}.semi-popconfirm-header .semi-icon-alert_triangle{color:var(--semi-color-warning)}.semi-popconfirm-header-body{display:inline-flex;flex-grow:1;flex-direction:column}.semi-popconfirm-body{color:var(--semi-color-text-2)}.semi-popconfirm-body-withIcon{margin-left:36px}.semi-popconfirm-body>p{margin:0;padding:0}.semi-popconfirm-footer{margin-top:25px;display:flex;justify-content:flex-end}.semi-popconfirm-footer>.semi-button:first-child:not(:last-child){margin-right:8px}.semi-popconfirm-popover{border-radius:var(--semi-border-radius-medium)}.semi-popover-with-arrow .semi-popconfirm-inner{padding:12px 12px 12px 8px}.semi-popconfirm-rtl{direction:rtl}.semi-popconfirm-rtl .semi-popconfirm-inner{padding:24px 20px 24px 24px}.semi-popconfirm-rtl .semi-popconfirm-header{margin-right:0}.semi-popconfirm-rtl .semi-popconfirm-header-icon{margin-right:0;margin-left:12px}.semi-popconfirm-rtl .semi-popconfirm-footer{justify-content:flex-end}.semi-popconfirm-rtl .semi-popconfirm-footer>.semi-button:first-child:not(:last-child){margin-right:0;margin-left:8px}.semi-popover-with-arrow.semi-popconfirm-rtl{direction:rtl}.semi-popover-with-arrow.semi-popconfirm-rtl .semi-popconfirm-inner{padding:12px 8px 12px 12px}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as s,j as e,S as b,C as k,T as g}from"./index-BGB_3rmy.js";const m=c=>{const{open:C,onClose:u}=c,[t,n]=s.useState(!0),[o,l]=s.useState(!1),[d,i]=s.useState(!1),[x,E]=s.useState(!1),r=[{label:"是否开启域名校验",description:"开启后,客户端将校验所有请求的域名是否合法,建议开发环境关闭以便调试。",checked:t,onChange:n},{label:"是否开启 IAA Mock",description:"启用后,广告相关接口将返回模拟数据,方便开发和测试广告逻辑。",checked:o,onChange:l},{label:"是否开启 IAP Mock",description:"启用后,内购相关流程将使用模拟支付,避免真实扣费。",checked:d,onChange:i}];return e.jsx("div",{children:e.jsx(b,{vertical:!0,align:"start",spacing:"loose",children:r.map((a,h)=>e.jsxs("div",{children:[e.jsx(k,{checked:a.checked,onChange:p=>a.onChange(p.target.checked),children:a.label}),e.jsx(g.Text,{type:"tertiary",style:{display:"block",marginTop:4},children:a.description})]},h))})})};export{m as DebugSetting};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{B as I,a as q,k as R,l as k,b as D,c as T,R as r,m as x,I as A,n as U,L as z,o as M,p as X,q as Q,P as s,s as Z,t as j,v as G,i as o,w as H,u as J,r as v,N as w,j as m,e as K,F as P,x as W}from"./index-BGB_3rmy.js";const B={PREFIX:`${I}-popconfirm`,POPOVER:`${I}-popconfirm-popover`},Y={DEFAULT_Z_INDEX:1030};class ee extends q{init(){}destroy(){}handleCancel(e){const t=this._adapter.notifyCancel(e);R(t)?(this._adapter.updateCancelLoading(!0),t.then(n=>{this.handleVisibleChange(!1),this._adapter.updateCancelLoading(!1)},n=>{this._adapter.updateCancelLoading(!1)})):this.handleVisibleChange(!1)}handleConfirm(e){const t=this._adapter.notifyConfirm(e);R(t)?(this._adapter.updateConfirmLoading(!0),t.then(n=>{this._adapter.updateConfirmLoading(!1),this.handleVisibleChange(!1)},n=>{this._adapter.updateConfirmLoading(!1)})):this.handleVisibleChange(!1)}handleClickOutSide(e){this._adapter.notifyClickOutSide(e)}handleVisibleChange(e){this._isControlledComponent("visible")||this._adapter.setVisible(e),e?this.handleFocusOperateButton():this._adapter.focusPrevFocusElement(),this._adapter.notifyVisibleChange(e)}handleFocusOperateButton(){const{cancelButtonProps:e,okButtonProps:t}=this._adapter.getProps();k(e,"autoFocus")&&!k(e,"disabled")?this._adapter.focusCancelButton():k(t,"autoFocus")&&!k(t,"disabled")&&this._adapter.focusOkButton()}}var te=function(u,e){var t={};for(var n in u)Object.prototype.hasOwnProperty.call(u,n)&&e.indexOf(n)<0&&(t[n]=u[n]);if(u!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(u);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(u,n[i])&&(t[n[i]]=u[n[i]]);return t};class O extends D{constructor(e){super(e),this.handleCancel=t=>this.foundation.handleCancel(t&&t.nativeEvent),this.handleConfirm=t=>this.foundation.handleConfirm(t&&t.nativeEvent),this.handleVisibleChange=t=>this.foundation.handleVisibleChange(t),this.handleClickOutSide=t=>this.foundation.handleClickOutSide(t),this.stopImmediatePropagation=t=>t&&t.nativeEvent&&t.nativeEvent.stopImmediatePropagation(),this.renderConfirmPopCard=t=>{let{initialFocusRef:n}=t;const{content:i,title:g,className:p,style:f,cancelType:b,icon:h,prefixCls:l,showCloseIcon:y}=this.props,{direction:_}=this.context,S=T(l,p,{[`${l}-rtl`]:_==="rtl"}),E=g!==null&&typeof g<"u",F=!(i===null||typeof i>"u"),V=r.isValidElement(h),N=T({[`${l}-body`]:!0,[`${l}-body-withIcon`]:V});return r.createElement("div",{className:S,onClick:this.stopImmediatePropagation,style:f},r.createElement("div",{className:`${l}-inner`},r.createElement("div",{className:`${l}-header`},V?r.createElement("i",{className:`${l}-header-icon`,"x-semi-prop":"icon"},h):null,r.createElement("div",{className:`${l}-header-body`},E?r.createElement("div",{className:`${l}-header-title`,"x-semi-prop":"title"},g):null),y?r.createElement(x,{className:`${l}-btn-close`,icon:r.createElement(A,null),size:"small",theme:"borderless",type:b,onClick:this.handleCancel}):null),F?r.createElement("div",{className:N,"x-semi-prop":"content"},U(i)?i({initialFocusRef:n}):i):null,r.createElement("div",{className:`${l}-footer`,ref:this.footerRef},this.renderControls())))},this.state={cancelLoading:!1,confirmLoading:!1,visible:e.defaultVisible||!1},this.foundation=new ee(this.adapter),this.footerRef=r.createRef(),this.popoverRef=r.createRef()}static getDerivedStateFromProps(e,t){const n={},{hasOwnProperty:i}=Object.prototype;return i.call(e,"visible")&&(n.visible=e.visible),n}get adapter(){return Object.assign(Object.assign({},super.adapter),{setVisible:e=>this.setState({visible:e}),updateConfirmLoading:e=>this.setState({confirmLoading:e}),updateCancelLoading:e=>this.setState({cancelLoading:e}),notifyConfirm:e=>this.props.onConfirm(e),notifyCancel:e=>this.props.onCancel(e),notifyVisibleChange:e=>this.props.onVisibleChange(e),notifyClickOutSide:e=>this.props.onClickOutSide(e),focusCancelButton:()=>{var e,t;const n=(t=(e=this.footerRef)===null||e===void 0?void 0:e.current)===null||t===void 0?void 0:t.querySelector("[data-type=cancel]");n?.focus({preventScroll:!0})},focusOkButton:()=>{var e,t;const n=(t=(e=this.footerRef)===null||e===void 0?void 0:e.current)===null||t===void 0?void 0:t.querySelector("[data-type=ok]");n?.focus({preventScroll:!0})},focusPrevFocusElement:()=>{var e;(e=this.popoverRef.current)===null||e===void 0||e.focusTrigger()}})}renderControls(){const{okText:e,cancelText:t,okType:n,cancelType:i,cancelButtonProps:g,okButtonProps:p}=this.props,{cancelLoading:f,confirmLoading:b}=this.state;return r.createElement(z,{componentName:"Popconfirm"},(h,l)=>r.createElement(r.Fragment,null,r.createElement(x,Object.assign({"data-type":"cancel",type:i,onClick:this.handleCancel,loading:f},M(g,"autoFocus")),t||k(h,"cancel")),r.createElement(x,Object.assign({"data-type":"ok",type:n,theme:"solid",onClick:this.handleConfirm,loading:b},M(p,"autoFocus")),e||k(h,"confirm"))))}render(){const{direction:e}=this.context,t=e==="rtl"?"bottomRight":"bottomLeft",n=this.props,{className:i,prefixCls:g,disabled:p,children:f,style:b,position:h=t}=n,l=te(n,["className","prefixCls","disabled","children","style","position"]);if(p)return f;const{visible:y}=this.state,_={onVisibleChange:this.handleVisibleChange,className:B.POPOVER,onClickOutSide:this.handleClickOutSide};return this.isControlled("visible")&&(_.trigger="custom"),r.createElement(X,Object.assign({ref:this.popoverRef},l,{content:S=>{let{initialFocusRef:E}=S;return this.renderConfirmPopCard({initialFocusRef:E})},visible:y,position:h},_),f)}}O.contextType=Q;O.propTypes={motion:s.oneOfType([s.bool,s.func,s.object]),disabled:s.bool,content:s.oneOfType([s.node,s.func]),title:s.any,prefixCls:s.string,className:s.string,style:s.object,icon:s.node,okText:s.string,okType:s.string,cancelText:s.string,cancelType:s.string,onCancel:s.func,onConfirm:s.func,onClickOutSide:s.func,onVisibleChange:s.func,visible:s.bool,defaultVisible:s.bool,okButtonProps:s.object,cancelButtonProps:s.object,stopPropagation:s.oneOfType([s.bool,s.string]),showCloseIcon:s.bool,zIndex:s.number,trigger:s.string,position:s.string};O.__SemiComponentName__="Popconfirm";O.defaultProps=Z(O.__SemiComponentName__,{stopPropagation:!0,trigger:"click",onVisibleChange:j,disabled:!1,icon:r.createElement(G,{size:"extra-large"}),okType:"primary",cancelType:"tertiary",prefixCls:B.PREFIX,zIndex:Y.DEFAULT_Z_INDEX,showCloseIcon:!0,onCancel:j,onConfirm:j,onClickOutSide:j});const ne=[{label:o("scene_scan_qrcode"),value:"scan_qrcode"},{label:o("scene_search"),value:"search"},{label:o("scene_anchor"),value:"anchor"},{label:o("scene_center"),value:"center"},{label:o("scene_ad"),value:"ads"},{label:o("scene_shortcut"),value:"desktop_shortcut"},{label:o("scene_sharing"),value:"dm_sharing"},{label:o("scene_link"),value:"minis_link"}],se=()=>{const u=H(),{state:{launchOptions:e,selectedLaunchOption:t,packages:n},setLaunchOptions:i,setSelectedLaunchOption:g}=J(),p=v.useRef(null),f=t||w,[b,h]=v.useState(f),[l,y]=v.useState(f.id),_=n.map(a=>{if(a.type==="main")return{label:o("gameMainPackage"),value:a.name};if(a.type==="independent")return{label:`${o("independentPackage")}: ${a.name}`,value:a.name}}).filter(Boolean),S=v.useCallback(a=>{const c={...b,...a};c.pkgType==="main"&&c.independentPkg!==void 0&&(c.independentPkg=void 0,p.current&&p.current.setValues({independentPkg:void 0})),h(c)},[b]),E=v.useCallback(()=>{if(!p.current)return;const a=p.current.getValues();a.pkgType==="main"&&(a.independentPkg=void 0);const c=e.findIndex(C=>C.name===a.name&&C.id!=="created"&&C.id!=="normal");let d;c!==-1?(d=[...e],d[c]=a):(a.id=Date.now().toString(),d=[...e.slice(0,-1),a,...e.slice(-1)]),i(d),h(a),g(a),u("/")},[e,u,i,g]),F=v.useCallback(a=>{const c=e.find(d=>d.id===a);if(c){y(a);const d={...c};a==="created"?d.name="":a==="normal"&&(d.name=o("normalLaunchMode")),h(d),p.current?.setValues(d)}},[e]),V=v.useCallback(()=>{const a=l;if(["normal","created"].includes(a))return;const c=e.filter(L=>L.id!==a);i(c);const d=c.find(L=>L.id==="normal")||c.find(L=>L.id==="created")||c[0]||w,C={...d,...d.id==="created"?{name:""}:{},...d.id==="normal"?{name:o("normalLaunchMode")}:{}};g(C),y(C.id),h(C),p.current?.setValues(C)},[e,l,i,g]),N=v.useCallback(()=>{h(f),p.current?.setValues(f),u("/")},[f,u]),$=e.find(a=>a.id===l);return m.jsxs("div",{children:[m.jsx(K,{style:{marginBottom:32},fullMode:!1,icon:null,closeIcon:null,description:o("launchModeDesc"),type:"info"}),m.jsxs(P,{initValues:b,onValueChange:S,getFormApi:a=>p.current=a,style:{padding:20,border:"1px solid #eee",borderRadius:8},onSubmit:E,children:[m.jsx(P.Select,{placeholder:o("selectLaunchMode"),rules:[{required:!0,message:o("selectLaunchMode")}],field:"id",label:o("selectLaunchMode"),optionList:e.map(a=>({label:a.name,value:a.id})),onChange:F,style:{width:"100%"},value:l}),m.jsx(P.Input,{required:!0,placeholder:o("launchModeName"),field:"name",label:o("launchModeName"),rules:[{required:!0,message:o("notEmpty")}],style:{width:"100%"},trigger:"blur"}),m.jsx(P.Select,{field:"pkgName",label:o("selectLaunchPkg"),placeholder:o("selectLaunchPkg"),rules:[{required:!0,message:o("notEmpty")}],optionList:_,style:{width:"100%"}}),m.jsx(P.Select,{field:"scene",label:o("selectScene"),rules:[{required:!0,message:o("notEmpty")}],placeholder:o("selectScene"),optionList:ne,style:{width:"100%"},filter:!0}),m.jsx(P.Input,{field:"queries",label:o("launchQueries"),placeholder:o("launchQueriesDesc"),trigger:"blur",rules:[{validator:(a,c)=>{const{isValid:d,message:C}=W(c);return d?Promise.resolve():Promise.reject(C)}}],style:{width:"100%"}}),m.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",alignItems:"center",marginTop:20},children:[["created","normal"].includes(l)?m.jsx(x,{style:{marginRight:12},onClick:N,children:o("cancel")}):m.jsx(O,{title:o("deleteLaunchModeConfirm",{name:$?.name??""}),onConfirm:V,position:"bottomRight",children:m.jsx(x,{type:"danger",style:{marginRight:12},children:o("delete")})}),m.jsx(x,{htmlType:"submit",type:"primary",children:o("saveAndUse")})]})]})]})};export{se as LaunchMode};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as U,r as l,j as e,p as b,ac as m,i as a,c as k,ad as y,h as D,T as x,F as h,f as F,ae as A}from"./index-BGB_3rmy.js";const M=()=>{const{state:{user:r}}=U(),[f,i]=l.useState(!1),[g,o]=l.useState(!1),[j,c]=l.useState(""),[d,n]=l.useState(""),p=l.useRef(null),u=()=>{o(!1),n(""),c("")},v=()=>{i(!1),u(),p.current?.formApi?.reset?.()},C=()=>{r?.email&&i(!0)},N=s=>{const t=s;if(t?.code===0)A.success({title:a("uploadPlatformSuccess"),content:e.jsxs(e.Fragment,{children:[e.jsx("div",{children:a("uploadPlatformDesc")}),e.jsx("div",{style:{marginTop:12,display:"flex",justifyContent:"flex-end"},children:e.jsx(x.Text,{link:!0,onClick:()=>{window.open(t?.data?.detail,"_blank")},children:a("viewOnPlatform")})})]}),duration:10}),i(!1),u();else{const P=t?.error?.StatusMessage||t?.detail||a("uploadPlatformFailed");n(P),o(!1)}},S=s=>{const t=s?.error?.StatusMessage||s?.response?.detail||s?.message||a("uploadPlatformFailed");n(t),o(!1)},T=()=>{o(!0),F({method:"POST",url:"/game/upload",headers:{"ttmg-game-desc":encodeURIComponent(j||"--")}}).then(s=>{N(s)}).catch(s=>{S(s)})};return e.jsxs(e.Fragment,{children:[e.jsx(b,{content:()=>r?.email?null:e.jsx("div",{className:"uploader-login-tip",children:a("loginToUpload")}),children:e.jsxs("div",{className:k("resource-uploader",{"resource-uploader-disabled":!r?.email}),onClick:C,children:[e.jsx(m,{size:"default"}),e.jsx("div",{className:"uploader-text",children:a("upload")})]})}),e.jsx(y,{footer:null,visible:f,onCancel:v,title:a("uploadToPlatform"),children:e.jsxs("div",{className:"uploader-modal-content",children:[g&&e.jsx("div",{className:"upload-loading-container",children:e.jsx("div",{className:"loading-spin",children:e.jsx(D,{size:"large"})})}),d&&e.jsx(x.Text,{style:{color:"red",marginBottom:12,marginTop:12},children:d}),e.jsxs(h,{ref:p,onChange:({values:s})=>{c(s?.gameDescription||"--"),n("")},children:[e.jsx(h.TextArea,{label:a("gameAssetDescription"),placeholder:a("gameAssetDescription"),field:"gameDescription"}),e.jsxs("div",{className:"uploader-button-container",onClick:T,children:[e.jsx(m,{className:"uploader-button-icon"}),e.jsx("div",{className:"uploader-button-text",children:a("uploadGamePackageTip")})]})]})]})})]})};export{M as GameUploader};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as c,r as l,D as d,j as e,i as a,d as i,E as r}from"./index-BGB_3rmy.js";const g=[{title:"0.3.2",target:{iOS:">=43.1",Android:">=43.1"},changes:{feature:[{desc:{"zh-CN":"增加对 unity 是否需要分包的检查,对于需要分包的 unity 项目,给出明确提示","en-US":"Add check for whether unity project needs subpackage, for unity projects that need subpackage, give clear prompt"},module:"new"},{desc:{"zh-CN":"支持通过 `ttmg setup` 配置 CLI 语言,调试环境会跟随语言设置展示文案,首次调试时会自动同步默认语言,后续 CLI 与 IDE 语言保持一致,减少反复切换","en-US":"Support configuring CLI language via `ttmg setup`; the debug workspace follows this language setting for message display, the default language is auto-synced on first debug, so CLI and IDE stay consistent afterwards without repeated switching"},module:"new"},{desc:{"zh-CN":"调试与预检支持多语言展示,关键提示与校验信息更易理解","en-US":"Debugging and precheck flows now support multilingual display, making key prompts and validation messages easier to understand"},module:"new"},{desc:{"zh-CN":"支持 Cocos 2.0 openDataContext 配置","en-US":"Support Cocos 2.0 openDataContext configuration"},module:"openDataContext"},{desc:{"zh-CN":"变更记录新增提醒功能,当有新版本发布时,会通过弹窗提醒开发者更新","en-US":"Change log now has a reminder function, when a new version is released, a popup will remind developers to update"},module:"new"}],optimize:[{desc:{"zh-CN":"ttmg login 支持 ttmg login --verbose 参数,打印更多登录信息","en-US":"ttmg login supports ttmg login --verbose parameter, print more login information"},module:"new"},{desc:{"zh-CN":"API 预检建议文案统一收敛,避免重复提示,阅读更清晰","en-US":"API precheck suggestion messages are now unified to avoid duplicated hints and improve readability"},module:"check"},{desc:{"zh-CN":"顶部区域透出项目预检错误与警告信息,便于开发者及时发现问题并修复","en-US":"Top area now displays project precheck error and warning information, making it easier for developers to find and fix problems"},module:"check"},{desc:{"zh-CN":"语言选择策略优化:优先使用 CLI 本地设置,未设置时自动回退浏览器语言","en-US":"Language selection is optimized: CLI local setting is preferred, and browser language is used as fallback when unset"},module:"check"},{desc:{"zh-CN":"启动校验增强:检查是否在小游戏根目录执行,对于分包配置 subPackages 给出明确报错,引导开发者修改为 subpackages","en-US":"Enhance entry validation: ensure running in project root and warn about subPackages typo; subpackages is required"},module:"check"}],bugfix:[{desc:{"zh-CN":"修复项目详情中展示的主包大小限制和代码预检不一致的情况","en-US":"Fix the issue that the main package size limit and code precheck are inconsistent in the project details"},module:"detail"},{desc:{"zh-CN":"修复 CLI npm package size 过大问题","en-US":"Fix the issue that the CLI npm package size is too large"},module:"detail"}]}},{title:"0.3.1",target:{iOS:">=43.1",Android:">=43.1"},changes:{feature:[{desc:{"zh-CN":"支持 unity 小游戏本地一些列调试功能,如 Wasm 分包、包大小校验、一键上传代码包至平台等","en-US":"Support unity debug features, such as Wasm split, package size check, one-click upload code package to platform, etc."},link:"https://bytedance.larkoffice.com/wiki/E5TAwQ1O1iylUXkoQFocfdL0ntG",module:"new"},{desc:{"zh-CN":"增加用户登录过期的异常提示,提醒开发者重新登录","en-US":"Add login expired exception prompt, prompt developers to re-login."},module:"login"}],optimize:[{desc:{"zh-CN":"优化上传代码包至平台功能,开发者只用添加描述后点击上传便可自动压缩当前目录下的代码包上传至开发者平台","en-US":"Optimize upload code package to platform function, developers only need to add a description and click upload to automatically compress the code package in the current directory to the developer platform."},module:"upload"},{desc:{"zh-CN":"优化 ttmg login 终端网络代理异常导致无法登录的报错引导,提示用户检查网络设置","en-US":"Optimize ttmg login terminal network proxy exception login prompt, prompt check network settings."},module:"login"}]}},{title:"0.3.0",target:{iOS:">=43.1",Android:">=43.1"},changes:{feature:[{desc:{"zh-CN":"支持了开发信息蒙层,打开后可以查看游戏 FPS、设备信息、调试开关等信息,便于查看游戏运行状态","en-US":"Support devInfo panel, which can show game FPS, device info, debug switch, etc."},link:"https://bytedance.larkoffice.com/wiki/PaK1wSu0eiPrxrkrqtrcR3VEnjf",module:"devOptions"},{desc:{"zh-CN":"支持删除历史启动模式,便于管理历史启动模式","en-US":"Support delete historical launch mode,keep consistent with client dev options"},module:"devOptions"},{desc:{"zh-CN":"调整调试设置模块名称为开发选项,和客户端内调开发者选项保持一致","en-US":"Rename debug setting module to dev options, keep consistent with client dev options"},module:"devOptions",link:"https://bytedance.larkoffice.com/wiki/PaK1wSu0eiPrxrkrqtrcR3VEnjf"},{desc:{"zh-CN":"调试设置新增定义 vConsole 和 开发信息浮层设置","en-US":"Add debug setting to define vConsole and dev overlay"},module:"devOptions"},{desc:{"zh-CN":"支持了变更日志,用户可以在调试环境下查看游戏的变更记录,部分新功能可通过更多信息查看使用","en-US":"Support change log, user can view game change log in IDE, some new features can be viewed in more info"},module:"new"}],optimize:[{desc:{"zh-CN":"支持了调试设置开关本地缓存,避免每次都需要重新设置","en-US":"Support debug setting cache, avoid setting debug mode every time"},module:"devOptions"}],bugfix:[{desc:{"zh-CN":"修复上传名称为中文的游戏时,平台展示乱码的问题","en-US":"Fix the issue that the platform shows garbled code when the game name is in Chinese"},module:"upload"},{desc:{"zh-CN":"修复启动模式模块,自定义query 参数无法持久化的问题","en-US":"Fix the issue that custom query parameters cannot be persisted in launch mode module"},module:"launchMode"},{desc:{"zh-CN":"修复扫描二维码模块,内容过多,纵向无法滚动问题","en-US":"Fix the issue that the content in scan QR code module is too long, and cannot be scrolled vertically"},module:"scanQrcode"}]}}],p=()=>{const{state:{devToolVersion:s}}=c(),o=r;return l.useEffect(()=>{s&&d(s)},[s]),e.jsx("div",{className:"change-log-container",children:g.map(n=>e.jsxs("div",{className:"change-log-item",children:[e.jsx("h2",{className:"change-log-title",children:n.title}),e.jsx("div",{className:"change-log-target",children:e.jsxs("div",{className:"change-log-target-title",children:[a("changelogTarget")," iOS ",n.target.iOS," | Android",n.target.Android]})}),n?.changes?.feature?.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"change-log-feature-title",children:e.jsx(i,{color:"green",size:"large",shape:"circle",type:"solid",children:a("changelogFeature")})}),e.jsx("ul",{className:"change-log-changes-feature",children:n.changes.feature.map(t=>e.jsxs("li",{className:"change-log-change",children:[t.desc[o]," ",t?.link?e.jsx("a",{style:{fontWeight:600,color:"orange"},href:t.link,target:"_blank",rel:"noopener noreferrer",children:a("changelogLink")}):null]},t.desc[o]))})]}),n?.changes?.optimize?.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"change-log-optimize-title",children:e.jsx(i,{color:"orange",size:"large",shape:"circle",type:"solid",children:a("changelogOptimize")})}),e.jsx("ul",{className:"change-log-changes-optimize",children:n.changes.optimize.map(t=>e.jsx("li",{className:"change-log-change",children:t.desc[o]},t.desc[o]))})]}),n?.changes?.bugfix?.length>0&&e.jsxs("div",{children:[e.jsx("div",{className:"change-log-bugfix-title",children:e.jsx(i,{color:"red",size:"large",shape:"circle",type:"solid",children:a("changelogBugfix")})}),e.jsx("ul",{className:"change-log-changes-bugfix",children:n.changes.bugfix.map(t=>e.jsx("li",{className:"change-log-change",children:t.desc[o]},t.desc[o]))})]})]},n.title))})};export{p as ChangeLog};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.semi-descriptions{line-height:20px}.semi-descriptions table,.semi-descriptions tr,.semi-descriptions th,.semi-descriptions td{margin:0;padding:0;border:0}.semi-descriptions th{padding-right:24px}.semi-descriptions .semi-descriptions-item{margin:0;padding-bottom:12px;text-align:left;vertical-align:top}.semi-descriptions-key{font-weight:400;font-size:14px;line-height:20px;font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif;min-height:14px;white-space:nowrap;color:var(--semi-color-text-2)}.semi-descriptions-value{font-weight:400;font-size:14px;line-height:20px;font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif;color:var(--semi-color-text-0)}.semi-descriptions-center .semi-descriptions-item-th{text-align:right}.semi-descriptions-center .semi-descriptions-item-td,.semi-descriptions-left .semi-descriptions-item-th,.semi-descriptions-left .semi-descriptions-item-td,.semi-descriptions-justify .semi-descriptions-item-th{text-align:left}.semi-descriptions-justify .semi-descriptions-item-td{text-align:right}.semi-descriptions-plain .semi-descriptions-key,.semi-descriptions-plain .semi-descriptions-value{display:inline-block}.semi-descriptions-plain .semi-descriptions-value{padding-left:8px}.semi-descriptions-plain .semi-descriptions-value .semi-tag{vertical-align:middle}.semi-descriptions-double tbody{display:flex;flex-wrap:wrap}.semi-descriptions-double tr{display:inline-flex;flex-direction:column}.semi-descriptions-double .semi-descriptions-item{padding:0;flex:1}.semi-descriptions-double .semi-descriptions-value{font-weight:600}.semi-descriptions-double-small .semi-descriptions-item{padding-right:48px}.semi-descriptions-double-small .semi-descriptions-key{line-height:16px;font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif;padding-bottom:0;font-size:12px}.semi-descriptions-double-small .semi-descriptions-value{line-height:22px;font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif;font-size:16px}.semi-descriptions-double-medium .semi-descriptions-item{padding-right:60px}.semi-descriptions-double-medium .semi-descriptions-key{padding-bottom:4px;font-size:14px}.semi-descriptions-double-medium .semi-descriptions-value{line-height:28px;font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif;font-size:20px}.semi-descriptions-double-large .semi-descriptions-item{padding-right:80px}.semi-descriptions-double-large .semi-descriptions-key{padding-bottom:4px;font-size:14px}.semi-descriptions-double-large .semi-descriptions-value{line-height:40px;font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif;font-size:28px}.semi-descriptions-horizontal table{table-layout:fixed}.semi-descriptions-horizontal table,.semi-descriptions-horizontal tbody{width:100%}.semi-descriptions-horizontal .semi-descriptions-item{flex:0}.semi-rtl .semi-descriptions,.semi-portal-rtl .semi-descriptions{direction:rtl}.semi-rtl .semi-descriptions th,.semi-portal-rtl .semi-descriptions th{direction:rtl;padding-right:0;padding-left:24px}.semi-rtl .semi-descriptions .semi-descriptions-item,.semi-portal-rtl .semi-descriptions .semi-descriptions-item{text-align:right}.semi-rtl .semi-descriptions-center .semi-descriptions-item-th,.semi-portal-rtl .semi-descriptions-center .semi-descriptions-item-th{text-align:left}.semi-rtl .semi-descriptions-center .semi-descriptions-item-td,.semi-portal-rtl .semi-descriptions-center .semi-descriptions-item-td{text-align:right}.semi-rtl .semi-descriptions-left .semi-descriptions-item-th,.semi-rtl .semi-descriptions-left .semi-descriptions-item-td,.semi-portal-rtl .semi-descriptions-left .semi-descriptions-item-th,.semi-portal-rtl .semi-descriptions-left .semi-descriptions-item-td{text-align:left}.semi-rtl .semi-descriptions-justify .semi-descriptions-item-th,.semi-portal-rtl .semi-descriptions-justify .semi-descriptions-item-th{text-align:right}.semi-rtl .semi-descriptions-justify .semi-descriptions-item-td,.semi-portal-rtl .semi-descriptions-justify .semi-descriptions-item-td{text-align:left}.semi-rtl .semi-descriptions-plain .semi-descriptions-key,.semi-rtl .semi-descriptions-plain .semi-descriptions-value,.semi-portal-rtl .semi-descriptions-plain .semi-descriptions-key,.semi-portal-rtl .semi-descriptions-plain .semi-descriptions-value{display:inline-block}.semi-rtl .semi-descriptions-plain .semi-descriptions-value,.semi-portal-rtl .semi-descriptions-plain .semi-descriptions-value{padding-left:0;padding-right:8px}.semi-rtl .semi-descriptions-plain .semi-descriptions-value .semi-tag,.semi-portal-rtl .semi-descriptions-plain .semi-descriptions-value .semi-tag{vertical-align:middle}.semi-rtl .semi-descriptions-double,.semi-portal-rtl .semi-descriptions-double{direction:rtl}.semi-rtl .semi-descriptions-double .semi-descriptions-item,.semi-portal-rtl .semi-descriptions-double .semi-descriptions-item{text-align:right}.semi-rtl .semi-descriptions-double-small .semi-descriptions-item,.semi-portal-rtl .semi-descriptions-double-small .semi-descriptions-item{padding-right:0;padding-left:48px}.semi-rtl .semi-descriptions-double-medium .semi-descriptions-item,.semi-portal-rtl .semi-descriptions-double-medium .semi-descriptions-item{padding-right:0;padding-left:60px}.semi-rtl .semi-descriptions-double-large .semi-descriptions-item,.semi-portal-rtl .semi-descriptions-double-large .semi-descriptions-item{padding-right:0;padding-left:80px}.error-display{width:100%;height:100%;display:flex;overflow:hidden;align-items:center;flex-direction:column;justify-content:center}.error-display-content{margin-top:12px;max-width:70%}.game-detail-loading-container{width:100%;height:100%;display:flex;overflow:hidden;align-items:center;flex-direction:column;justify-content:center}.game-detail-container{width:100%;height:100%;overflow-y:auto;overflow-x:hidden}.terms-privacy-item{display:flex;flex-direction:column;align-items:flex-start;gap:4px;width:100%}.terms-privacy-label{line-height:20px}.terms-privacy-value{line-height:20px;white-space:normal;word-break:break-all}.project-detail-warning{display:flex;align-items:flex-start;width:100%;padding:0;border-radius:0;background:transparent}.project-detail-warning-text{color:#d4380d;line-height:20px;white-space:normal;word-break:break-word}
|
package/dist/public/index.html
CHANGED
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
rel="stylesheet"
|
|
13
13
|
/>
|
|
14
14
|
<title>TikTok Mini Games DevTool</title>
|
|
15
|
-
<script type="module" crossorigin src="/assets/index-
|
|
16
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
15
|
+
<script type="module" crossorigin src="/assets/index-BGB_3rmy.js"></script>
|
|
16
|
+
<link rel="stylesheet" crossorigin href="/assets/index-C250u6X0.css">
|
|
17
17
|
</head>
|
|
18
18
|
<body>
|
|
19
19
|
<div id="root"></div>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const { execSync } = require('child_process');
|
|
2
|
+
const fs = require('fs');
|
|
3
|
+
const path = require('path');
|
|
4
|
+
|
|
5
|
+
const args = process.argv.slice(2);
|
|
6
|
+
const hasIde = args.includes('--ide');
|
|
7
|
+
const distDir = path.resolve(__dirname, '../dist');
|
|
8
|
+
|
|
9
|
+
if (fs.existsSync(distDir)) {
|
|
10
|
+
fs.rmSync(distDir, { recursive: true, force: true });
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
if (hasIde) {
|
|
14
|
+
execSync('pnpm -C ../ide run build', { stdio: 'inherit' });
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
execSync('rollup -c', { stdio: 'inherit' });
|
|
18
|
+
|
|
19
|
+
// Ensure the compiled CLI entry point has execution permissions
|
|
20
|
+
const entryFile = path.resolve(distDir, 'index.js');
|
|
21
|
+
if (fs.existsSync(entryFile)) {
|
|
22
|
+
fs.chmodSync(entryFile, 0o755);
|
|
23
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const os = require('os');
|
|
3
|
+
const path = require('path');
|
|
4
|
+
|
|
5
|
+
const args = process.argv.slice(2);
|
|
6
|
+
const isDryRun = args.includes('--dry-run');
|
|
7
|
+
|
|
8
|
+
const rcPath = process.env.TTMGRC_PATH || path.join(os.homedir(), '.ttmgrc');
|
|
9
|
+
const targets = [
|
|
10
|
+
{ path: rcPath, type: 'file', label: 'TTMG config (.ttmgrc)' },
|
|
11
|
+
{ path: path.join(os.homedir(), '__TTMG__'), type: 'dir', label: 'TTMG temp dir' },
|
|
12
|
+
{
|
|
13
|
+
path: path.join(os.homedir(), '.my-chrome-dev-profile'),
|
|
14
|
+
type: 'dir',
|
|
15
|
+
label: 'Chrome debug profile',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
path: path.resolve(__dirname, '../.ttmgrc.test'),
|
|
19
|
+
type: 'file',
|
|
20
|
+
label: 'TTMG test config (.ttmgrc.test)',
|
|
21
|
+
},
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
function removeTarget(target) {
|
|
25
|
+
if (!fs.existsSync(target.path)) {
|
|
26
|
+
console.log(`[skip] ${target.label}: ${target.path}`);
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (isDryRun) {
|
|
31
|
+
console.log(`[dry-run] remove ${target.label}: ${target.path}`);
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
fs.rmSync(target.path, { recursive: true, force: true });
|
|
36
|
+
console.log(`[done] removed ${target.label}: ${target.path}`);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
console.log('Resetting local TTMG state...');
|
|
40
|
+
if (isDryRun) {
|
|
41
|
+
console.log('Dry run mode enabled. No files will be removed.');
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
for (const target of targets) {
|
|
45
|
+
removeTarget(target);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
console.log(isDryRun ? 'Dry run completed.' : 'Local state reset completed.');
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const { execSync } = require('child_process');
|
|
2
|
+
const fs = require('fs');
|
|
3
|
+
const path = require('path');
|
|
4
|
+
|
|
5
|
+
const cliRoot = path.resolve(__dirname, '..');
|
|
6
|
+
const ideRoot = path.resolve(cliRoot, '../ide');
|
|
7
|
+
|
|
8
|
+
const args = process.argv.slice(2);
|
|
9
|
+
const clean = args.includes('--clean') || args.includes('--fresh');
|
|
10
|
+
|
|
11
|
+
const run = (command, cwd) => {
|
|
12
|
+
execSync(command, { stdio: 'inherit', cwd });
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const rm = p => {
|
|
16
|
+
if (!fs.existsSync(p)) return;
|
|
17
|
+
fs.rmSync(p, { recursive: true, force: true });
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
if (clean) {
|
|
21
|
+
rm(path.join(cliRoot, 'node_modules'));
|
|
22
|
+
rm(path.join(ideRoot, 'node_modules'));
|
|
23
|
+
rm(path.join(ideRoot, 'dist'));
|
|
24
|
+
rm(path.join(cliRoot, 'public'));
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
run('pnpm install', cliRoot);
|
|
28
|
+
run('pnpm install', ideRoot);
|
|
29
|
+
run('pnpm run build', ideRoot);
|
|
30
|
+
run('pnpm run build', cliRoot);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
|
|
2
|
+
const { HttpsProxyAgent } = require('https-proxy-agent');
|
|
3
|
+
const url = require('url');
|
|
4
|
+
|
|
5
|
+
console.log('--- Protocol Compatibility Test ---');
|
|
6
|
+
|
|
7
|
+
try {
|
|
8
|
+
// Test 1: SOCKS5 URI (Should technically fail with HttpsProxyAgent if it doesn't support socks under the hood,
|
|
9
|
+
// but HttpsProxyAgent v5 *might* only support http/https. Let's verify.)
|
|
10
|
+
// Actually, `https-proxy-agent` is specifically for HTTP CONNECT tunneling.
|
|
11
|
+
// If user passes `socks5://...`, does it throw or just fail at runtime?
|
|
12
|
+
const socksProxy = 'socks5://127.0.0.1:1080';
|
|
13
|
+
console.log(`Trying to create HttpsProxyAgent with: ${socksProxy}`);
|
|
14
|
+
|
|
15
|
+
// NOTE: HttpsProxyAgent v5 constructor parses the URL.
|
|
16
|
+
// If protocol is not supported, it might behavior unexpectedly.
|
|
17
|
+
const agent = new HttpsProxyAgent(socksProxy);
|
|
18
|
+
console.log('✅ Agent created successfully (Constructor did not throw).');
|
|
19
|
+
console.log(' Agent protocol:', agent.proxy.protocol);
|
|
20
|
+
|
|
21
|
+
if (agent.proxy.protocol !== 'http:' && agent.proxy.protocol !== 'https:') {
|
|
22
|
+
console.log('⚠️ Warning: Protocol is not http/https. Runtime connection might fail if library doesn\'t support it.');
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
} catch (err) {
|
|
26
|
+
console.log('❌ Constructor threw error for SOCKS5:', err.message);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
console.log('--- Test End ---');
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const os = require('os');
|
|
5
|
+
const { HttpsProxyAgent } = require('https-proxy-agent');
|
|
6
|
+
|
|
7
|
+
const MOCK_CONFIG_PATH = path.join(process.cwd(), '.ttmgrc_test_regression');
|
|
8
|
+
|
|
9
|
+
function getTTMGRC() {
|
|
10
|
+
if (!fs.existsSync(MOCK_CONFIG_PATH)) return null;
|
|
11
|
+
return JSON.parse(fs.readFileSync(MOCK_CONFIG_PATH, 'utf8'));
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function setTTMGRC(config) {
|
|
15
|
+
const origin = getTTMGRC() || {};
|
|
16
|
+
// Simulate CLI logic: merging new config into old
|
|
17
|
+
const merged = { ...origin, ...config };
|
|
18
|
+
// If config value is undefined, it won't remove key in JSON.stringify unless we manipulate it
|
|
19
|
+
// In `config.ts`: `setTTMGRC({ proxy: undefined })` -> JSON.stringify will OMIT the key if value is strictly undefined
|
|
20
|
+
fs.writeFileSync(MOCK_CONFIG_PATH, JSON.stringify(merged));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function getAxiosProxyConfig() {
|
|
24
|
+
const config = getTTMGRC();
|
|
25
|
+
const proxyUrl = config ? config.proxy : undefined;
|
|
26
|
+
if (proxyUrl) {
|
|
27
|
+
return {
|
|
28
|
+
httpsAgent: new HttpsProxyAgent(proxyUrl),
|
|
29
|
+
httpAgent: new HttpsProxyAgent(proxyUrl),
|
|
30
|
+
proxy: false,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
return {}; // Important: return empty object means "use axios defaults"
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
async function testRegression() {
|
|
37
|
+
console.log('--- Starting Regression Test (JS) ---');
|
|
38
|
+
|
|
39
|
+
if (fs.existsSync(MOCK_CONFIG_PATH)) fs.unlinkSync(MOCK_CONFIG_PATH);
|
|
40
|
+
|
|
41
|
+
// 1. Default (No Config)
|
|
42
|
+
console.log('Testing default state (no proxy config)...');
|
|
43
|
+
const defaultConfig = getAxiosProxyConfig();
|
|
44
|
+
if (Object.keys(defaultConfig).length === 0) {
|
|
45
|
+
console.log('✅ Default config is empty (Axios defaults apply).');
|
|
46
|
+
} else {
|
|
47
|
+
console.error('❌ Default config is NOT empty.');
|
|
48
|
+
console.log(defaultConfig);
|
|
49
|
+
process.exit(1);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// 2. Set Proxy
|
|
53
|
+
const testProxy = 'http://127.0.0.1:7890';
|
|
54
|
+
console.log(`Setting proxy to ${testProxy}...`);
|
|
55
|
+
setTTMGRC({ proxy: testProxy });
|
|
56
|
+
|
|
57
|
+
const activeConfig = getAxiosProxyConfig();
|
|
58
|
+
if (activeConfig.proxy === false) {
|
|
59
|
+
console.log('✅ Proxy configured correctly.');
|
|
60
|
+
} else {
|
|
61
|
+
console.error('❌ Proxy config failed.');
|
|
62
|
+
process.exit(1);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// 3. Delete Proxy
|
|
66
|
+
console.log('Deleting proxy config...');
|
|
67
|
+
setTTMGRC({ proxy: undefined });
|
|
68
|
+
|
|
69
|
+
// Verify file content
|
|
70
|
+
const fileContent = fs.readFileSync(MOCK_CONFIG_PATH, 'utf8');
|
|
71
|
+
if (!fileContent.includes('"proxy"')) {
|
|
72
|
+
console.log('✅ Proxy key removed from JSON file.');
|
|
73
|
+
} else {
|
|
74
|
+
console.log('⚠️ Proxy key still present in JSON (might be null or undefined value).');
|
|
75
|
+
console.log(' File content:', fileContent);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const revertedConfig = getAxiosProxyConfig();
|
|
79
|
+
if (Object.keys(revertedConfig).length === 0) {
|
|
80
|
+
console.log('✅ Reverted to default state successfully (Axios defaults apply).');
|
|
81
|
+
} else {
|
|
82
|
+
console.error('❌ Revert failed. Config still active:');
|
|
83
|
+
console.log(revertedConfig);
|
|
84
|
+
process.exit(1);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (fs.existsSync(MOCK_CONFIG_PATH)) fs.unlinkSync(MOCK_CONFIG_PATH);
|
|
88
|
+
console.log('--- Regression Test Passed ---');
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
testRegression().catch(err => {
|
|
92
|
+
console.error(err);
|
|
93
|
+
process.exit(1);
|
|
94
|
+
});
|