@shijiu/jsview 2.1.448-test.0 → 2.1.476-test.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dom/bin/jsview-dom-native.min.js +1 -1
- package/package.json +1 -1
- package/patches/node_modules/@originjs/vite-plugin-federation/1.3.4/@originjs+vite-plugin-federation+1.3.4.patch +50 -6
- package/patches/node_modules/vite/dist/node/jsview-vite-extension.js +1 -1
- package/tools/jsview-common.mjs +32 -1
- package/tools/jsview-logger.js +12 -0
- package/tools/jsview-run-tool.mjs +27 -30
- package/tools/jsview-vue-devtools.mjs +97 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* eslint-disable */ class e{static CreateAudioPlayer(e){return new Audio(e)}static CreateVideoPlayer(){const t=new Video;return t.jsvOnCssStyleChanged=e.OnCssStyleChanged.bind(t),t.jsvFinalize=e.JsvFinalize.bind(t),t}static OnCssStyleChanged(e,t){this.jsvSetStyles(t.left,t.top,t.width,t.height,t.objectFit,t.visibility)}static JsvFinalize(){console.log("NativePlatformMediaBridge.JsvFinalize()");const e=this;e.pause(),e.unload?.(),e.releaseResource&&(e.releaseResource(),e.onPlatformDestroy())}}window.JsvCode.NativePlatformMediaBridge||(window.JsvCode.NativePlatformMediaBridge=e);class t{constructor(e,t){this.prevented=!1,this.target=t,this.timeStamp=Date.now(),this.type=e}preventDefault(){this.prevented=!0}jsvIsPrevented(){return this.prevented}}class s extends t{constructor(e){super(e)}}class i extends t{constructor(e,t){super(e),this.options=t}initCustomEvent(e,t,s,i){this.type=e}get detail(){return this.options?.detail}}class n extends t{constructor(e){super(e)}}n.JsvType={Focus:"focus",Blur:"blur"},void 0===window.Forge?(window.Forge={},console.log("Define forge browser")):console.log("Define using JsView forge engine-js");var o,r,a,l,h,c,d,u,v,m,f,p,g,w,y,T=window.Forge;class N{constructor(e,t){if(this.href="",this.origin="",this.protocol="",this.host="",this.hostname="",this.port="",this.pathname="",this.search="",this.hash="",!e)return;if(!0===e.startsWith("url")){let t=e.indexOf("(")+1,s=e.lastIndexOf(")");if("undefined"===(e=e.substring(t,s).trim())||"null"===e||0===e.length)return}if(!0===e.startsWith("data:")||!0===e.startsWith("jsvtexturestore:"))return void(this.href=e);let s=e.indexOf("://");if(!(s<0||s>10)||e.startsWith("./")||e.startsWith("/")||(e="./"+e),!0===e.startsWith("/"))e=document.location.origin+e;else if(!0===e.startsWith("./")&&void 0!==window.JsView&&void 0!==window.JsView.Dom.JsSubPath){if(void 0===window.JsView.Dom.MainPath||"undefined"===window.JsView.Dom.MainPathRef||window.JsView.Dom.MainPathRef!==document.location.href){window.JsView.Dom.JsSubPath.startsWith("/")||(window.JsView.Dom.JsSubPath="/"+window.JsView.Dom.JsSubPath),window.JsView.Dom.JsSubPath.endsWith("/")||(window.JsView.Dom.JsSubPath=window.JsView.Dom.JsSubPath+"/"),window.JsView.Dom.MainPathRef=document.location.href;let e=document.location.pathname.lastIndexOf(window.JsView.Dom.JsSubPath);window.JsView.Dom.MainPath=document.location.origin+document.location.pathname.substring(0,e)}e=window.JsView.Dom.MainPath+e.substring(1)}if(this.href=e,!t)return;let i=this.href,n=i.indexOf("#");n>0&&(this.hash=i.substring(n),i=i.substring(0,n));let o=i.indexOf("?");o>1&&(this.search=i.substring(o),i=i.substring(0,o));let r=i,a=r.indexOf("://");this.protocol=a>0?r.substring(0,a+1):"";let l=a>1?r.substring(a+3):"";a=l.indexOf("/"),this.host=a>0?l.substring(0,a):"",this.pathname=a>=1?l.substring(a):"","file:"==this.protocol&&(this.host="",this.pathname=l),this.origin=this.protocol+"//"+this.host,a=this.host.indexOf(":"),this.hostname=a>0?this.host.substring(0,a):this.host,this.port=a>1?this.host.substring(a+1):""}replace(e){this.href=e}}class D{static EnableEventListener(e){const t=window.JsvCode.Dom.PlatformBridge.JsViewId;window.JsvCode.Dom.PlatformBridge.SetOnEventListener(t,e)}static CreateElement(e,t){D.PushLazyTask(D.LazyTaskType.CreateElement,e,t)}static BindElementToRootView(e){D.PushLazyTask(D.LazyTaskType.BindElementToRootView,e)}static InsertElementChild(e,t,s){D.PushLazyTask(D.LazyTaskType.InsertElementChild,e,t,s)}static RemoveElementChild(e,t){D.PushLazyTask(D.LazyTaskType.RemoveElementChild,e,t)}static MoveElementChild(e,t,s,i){D.PushLazyTask(D.LazyTaskType.MoveElementChild,e,t,s,i)}static ReOrderElementChild(e,t,s){D.PushLazyTask(D.LazyTaskType.ReOrderElementChild,e,t,s)}static AddElementEventListener(e,t,s){D.PushLazyTask(D.LazyTaskType.AddElementEventListener,e,t,s)}static RemoveElementEventListener(e,t,s){D.PushLazyTask(D.LazyTaskType.RemoveElementEventListener,e,t,s)}static SetElementText(e,t){D.PushLazyTask(D.LazyTaskType.SetElementText,e,t)}static SetElementAttribute(e,t,s){D.PushLazyTask(D.LazyTaskType.SetElementAttribute,e,t,s),D.LazyTaskSyncedListenerMap.has(e)&&D.CachedSyncListenIdSet.add(e)}static GetElementBoundingClientStyles(e,t){return D.RunSyncTask(D.LazyTaskType.GetElementBoundingClientStyles,e,t)}static SetForgeViewInnerProps(e,t,s){let i=0;(t=t.substr(12)).startsWith("mask-")&&(i=1,t=t.substr(5)),D.PushLazyTask(D.LazyTaskType.SetForgeViewInnerProps,e,t,i,""+s)}static DeclareStyleSheets(e){D.PushLazyTask(D.LazyTaskType.DeclareStyleSheets,-1,e)}static UndeclareStyleSheets(e){D.PushLazyTask(D.LazyTaskType.UndeclareStyleSheets,-1,e)}static SetStyleProperty(e,t,s){D.PushLazyTask(D.LazyTaskType.SetStyleProperty,e,t,s),D.LazyTaskSyncedListenerMap.has(e)&&D.CachedSyncListenIdSet.add(e)}static GetStyleProperties(e,t){return D.RunSyncTask(D.LazyTaskType.GetStyleProperties,e,t)}static AppendLazyTaskSyncedListener(e,t){D.LazyTaskSyncedListenerMap.set(e,t)}static RemoveLazyTaskSyncedListener(e){D.LazyTaskSyncedListenerMap.delete(e)}static RequestSwapAllCachedTasks(){if(0==D.CachedLazyTaskList.length)return;const e=JSON.stringify(D.CachedLazyTaskList);D.CachedLazyTaskList=[];const t=window.JsvCode.Dom.PlatformBridge.JsViewId;window.JsvCode.Dom.PlatformBridge.RunLazyTaskList(t,e);for(const e of D.CachedSyncListenIdSet){const t=D.LazyTaskSyncedListenerMap.get(e);t?.()}D.CachedSyncListenIdSet.clear()}static GetElementAttribute(e,t){return D.RunSyncTask(D.LazyTaskType.GetElementAttribute,e,t)}static InsertKeyFrame(e,t){D.PushLazyTask(D.LazyTaskType.InsertKeyFrameDefine,-1,e,t)}static RemoveKeyFrame(e){D.PushLazyTask(D.LazyTaskType.RemoveKeyFrameDefine,-1,e)}static GetRelativePosition(e,t){const s=D.RunSyncTask(D.LazyTaskType.GetRelativePosition,e,t);return JSON.parse(s)}static RunSyncTask(e,t,...s){D.RequestSwapAllCachedTasks();const i=window.JsvCode.Dom.PlatformBridge.JsViewId;return window.JsvCode.Dom.PlatformBridge.RunSyncTask(i,e,t,...s)}static PushLazyTask(e,t,...s){D.CachedLazyTaskList.push([e,t,...s]),T.sRenderBridge?.RequestSwap()}}D.CachedLazyTaskList=new Array,D.CachedSyncListenIdSet=new Set,D.LazyTaskSyncedListenerMap=new Map,D.LazyTaskType={CreateElement:10,BindElementToRootView:11,InsertElementChild:12,RemoveElementChild:13,AddElementEventListener:14,RemoveElementEventListener:15,SetElementText:16,SetElementAttribute:17,GetElementBoundingClientStyles:18,GetElementAttribute:19,MoveElementChild:20,GetRelativePosition:21,ReOrderElementChild:22,DeclareStyleSheets:30,SetStyleProperty:31,GetStyleProperties:32,UndeclareStyleSheets:39,SetForgeViewInnerProps:40,InsertKeyFrameDefine:41,RemoveKeyFrameDefine:42};class E{}E.Dom=D,E.Media=class{static CreateAudioPlayer(){return window.JsvCode.Media.PlatformBridge.CreateAudioPlayer()}static CreateVideoPlayer(){return window.JsvCode.Media.PlatformBridge.CreateVideoPlayer()}};class x{static GenerateId(){const e=this.UniqueId++;if(e>=this.MaxUniqueId)throw new Error("JsvUniqueId.GenerateId() Failed to create unique id. id is overflow.");return e}}x.UniqueId=0,x.MaxUniqueId=Math.pow(2,31)-1;class S{constructor(e){this.childNodes=[],this.nodeType=e,this.ownerDocument=window.document,this.parentNode=null,this.jsvEventListenerMap=null,this.jsvChildChangedCallback=null}jsvFinalize(){}appendChild(e){this.childNodes.push(e),e.parentNode=this,this.jsvChildChangedCallback?.()}removeChild(e){let t=this.childNodes.indexOf(e);if(t<0)throw new DOMException("Failed to remove node, child node is not found. node=",e);this.childNodes.splice(t,1),e.parentNode=null,this.jsvChildChangedCallback?.()}insertBefore(e,t){this.insertBeforeInner(e,t)}get previousSibling(){const e=this.parentNode?.childNodes;let t=e?.indexOf(this);if(void 0===t||t<0)throw new DOMException("Failed to call Node.previousSibling(), this node not found. this=",this);return e[t-1]}get nextSibling(){const e=this.parentNode?.childNodes;let t=e?.indexOf(this);if(void 0===t||t<0)throw new DOMException("Failed to call Node.nextSibling(), this node not found. this=",this);return e[t+1]}addEventListener(e,t,s){this.jsvEventListenerMap||(this.jsvEventListenerMap=new Map);let i=this.jsvEventListenerMap?.get(e);i||(i=new Set,this.jsvEventListenerMap?.set(e,i)),i.add(t)}removeEventListener(e,t,s){let i=this.jsvEventListenerMap?.get(e);i&&(i.delete(t),i.size<=0&&this.jsvEventListenerMap?.delete(e),0==this.jsvEventListenerMap?.size&&(this.jsvEventListenerMap=null))}dispatchEvent(e){if(!this.jsvEventListenerMap)return void console.warn("Node.dispatchEvent() Ignore to dispatch event: "+e.type+". No event added.");let t=this.jsvEventListenerMap?.get(e.type);if(t){e.target||(e.target=document.activeElement);for(let s of t)if(s?.(e),e.jsvIsPrevented())break}else console.warn("Node.dispatchEvent() Ignore to dispatch event: "+e.type+". No listener added.")}jsvObserveChildChanged(e){this.jsvChildChangedCallback=e}jsvMoveChildReOrder(e,t){{let t=this.childNodes.indexOf(e);if(t<0)throw new DOMException("Failed to call jsvMoveChildReOrder, node not found. node=",e);this.childNodes.splice(t,1)}{let s=this.childNodes.length;if(t&&(s=this.childNodes.indexOf(t),s<0))throw new DOMException("Failed to call move node, before node not found. beforeNode=",t);this.childNodes.splice(s,0,e)}this.jsvChildChangedCallback?.()}jsvMoveChildToNewParent(e,t,s){let i=this.childNodes.indexOf(e);if(i<0)throw new DOMException("Failed to call jsvMoveChildToNewParent, node not found. node=",e);this.childNodes.splice(i,1),e.parentNode=null,this.jsvChildChangedCallback?.(),t.insertBeforeInner(e,s)}jsvGetEventListenerSet(e){const t=this.jsvEventListenerMap?.get(e);return t}insertBeforeInner(e,t){let s=this.childNodes.length;if(void 0===t)throw new DOMException("TypeError: Failed to execute 'insertBefore' on 'Node': 2 arguments required, but only 1 present.");if(null!==t&&(s=this.childNodes.indexOf(t)),s<0)throw new DOMException("Failed to call insert node, before node not found. beforeNode=",t);this.childNodes.splice(s,0,e),e.parentNode=this,this.jsvChildChangedCallback?.()}}function C(e,t,s){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:s?"".concat(s," ",t):t})}S.ELEMENT_NODE=1,S.TEXT_NODE=3,S.COMMENT_NODE=8,S.DOCUMENT_NODE=9,S.NOLAYOUT_NODE=10;class I{static HasGetterMethod(e){switch(e){case I.Layout.Height:case I.Layout.Left:case I.Layout.Top:case I.Layout.Width:case I.Effect.ObjectFit:return!0;default:return!1}}static ToConst(e){return e==I.Layout.Height?I.Layout.Height:e==I.Layout.Left?I.Layout.Left:e==I.Layout.Top?I.Layout.Top:e==I.Layout.Width?I.Layout.Width:e==I.Flex.FlexDirection?I.Flex.FlexDirection:e==I.Flex.FlexWrap?I.Flex.FlexWrap:e==I.Flex.JustifyContent?I.Flex.JustifyContent:e==I.Flex.AlignItems?I.Flex.AlignItems:e==I.Flex.AlignContent?I.Flex.AlignContent:e==I.Flex.AlignSelf?I.Flex.AlignSelf:e==I.Flex.FlexGrow?I.Flex.FlexGrow:e==I.Background.BackgroundColor?I.Background.BackgroundColor:e==I.Background.BackgroundImage?I.Background.BackgroundImage:e==I.Background.BorderRadius?I.Background.BorderRadius:e==I.Effect.BackfaceVisibility?I.Effect.BackfaceVisibility:e==I.Effect.BorderImage?I.Effect.BorderImage:e==I.Effect.BorderImageWidth?I.Effect.BorderImageWidth:e==I.Effect.BorderImageOutset?I.Effect.BorderImageOutset:e==I.Effect.Display?I.Effect.Display:e==I.Effect.ObjectFit?I.Effect.ObjectFit:e==I.Effect.Opacity?I.Effect.Opacity:e==I.Effect.Overflow?I.Effect.Overflow:e==I.Effect.Perspective?I.Effect.Perspective:e==I.Effect.PerspectiveOrigin?I.Effect.PerspectiveOrigin:e==I.Effect.Transform?I.Effect.Transform:e==I.Effect.TransformOrigin?I.Effect.TransformOrigin:e==I.Effect.TransformStyle?I.Effect.TransformStyle:e==I.Effect.Visibility?I.Effect.Visibility:e==I.Effect.ZIndex?I.Effect.ZIndex:e==I.Text.Color?I.Text.Color:e==I.Text.FontFamily?I.Text.FontFamily:e==I.Text.FontSize?I.Text.FontSize:e==I.Text.FontStyle?I.Text.FontStyle:e==I.Text.FontWeight?I.Text.FontWeight:e==I.Text.LineHeight?I.Text.LineHeight:e==I.Text.TextAlign?I.Text.TextAlign:e==I.Text.TextOverflow?I.Text.TextOverflow:e==I.Text.TextShadow?I.Text.TextShadow:e==I.Text.WebkitTextStroke?I.Text.WebkitTextStroke:e==I.Text.WhiteSpace?I.Text.WhiteSpace:e==I.Text.WordWrap?I.Text.WordWrap:e==I.Text.Direction?I.Text.Direction:e==I.Text.JsvTextEmoji?I.Text.JsvTextEmoji:e==I.Text.JsvTextLatex?I.Text.JsvTextLatex:e==I.Text.JsvTextAlignMinWidth?I.Text.JsvTextAlignMinWidth:e==I.Text.JsvTextVerticalAlign?I.Text.JsvTextVerticalAlign:e==I.Text.JsvTextLineAlign?I.Text.JsvTextLineAlign:e==I.Text.JsvTextInnerDirection?I.Text.JsvTextInnerDirection:e==I.Motion.Animation?I.Motion.Animation:e==I.Motion.Transition?I.Motion.Transition:e==I.Motion.AnimationFillMode?I.Motion.AnimationFillMode:null}constructor(){throw new Error("new StyleName() is forbidden.")}}I.Layout=(C(o=class{constructor(){throw new Error("new StyleName.Layout() is forbidden.")}},"Layout"),o.Height="height",o.Left="left",o.Top="top",o.Width="width",o),I.Flex=(C(r=class{constructor(){throw new Error("new StyleName.Flex() is forbidden.")}},"Flex"),r.FlexDirection="flexDirection",r.FlexWrap="flexWrap",r.JustifyContent="justifyContent",r.AlignItems="alignItems",r.AlignContent="alignContent",r.AlignSelf="alignSelf",r.FlexGrow="flexGrow",r),I.Background=(C(a=class{constructor(){throw new Error("new StyleName.Background() is forbidden.")}},"Background"),a.BackgroundColor="backgroundColor",a.BackgroundImage="backgroundImage",a.BorderRadius="borderRadius",a),I.Effect=(C(l=class{constructor(){throw new Error("new StyleName.Effect() is forbidden.")}},"Effect"),l.BackfaceVisibility="backfaceVisibility",l.BorderImage="borderImage",l.BorderImageWidth="borderImageWidth",l.BorderImageOutset="borderImageOutset",l.Display="display",l.ObjectFit="objectFit",l.Opacity="opacity",l.Overflow="overflow",l.Perspective="perspective",l.PerspectiveOrigin="perspectiveOrigin",l.Transform="transform",l.TransformOrigin="transformOrigin",l.TransformStyle="transformStyle",l.Visibility="visibility",l.ZIndex="zIndex",l),I.Text=(C(h=class{constructor(){throw new Error("new StyleName.Text() is forbidden.")}},"Text"),h.Color="color",h.FontFamily="fontFamily",h.FontSize="fontSize",h.FontStyle="fontStyle",h.FontWeight="fontWeight",h.LineHeight="lineHeight",h.TextAlign="textAlign",h.TextOverflow="textOverflow",h.TextShadow="textShadow",h.WebkitTextStroke="WebkitTextStroke",h.WhiteSpace="whiteSpace",h.WordWrap="wordWrap",h.Direction="direction",h.JsvTextEmoji="JsvTextEmoji",h.JsvTextLatex="JsvTextLatex",h.JsvTextAlignMinWidth="JsvTextAlignMinWidth",h.JsvTextVerticalAlign="JsvTextVerticalAlign",h.JsvTextLineAlign="JsvTextLineAlign",h.JsvTextInnerDirection="JsvTextInnerDirection",h),I.Motion=(C(c=class{constructor(){throw new Error("new StyleName.Motion() is forbidden.")}},"Motion"),c.Animation="animation",c.Transition="transition",c.AnimationFillMode="animationFillMode",c);class b{constructor(e){let t=-1,s=null;null==e?t=b.DataType.Null:Number(e)===e&&e%1==0?t=b.DataType.Int32:Number(e)===e&&e%1!=0?t=b.DataType.Float:"string"==typeof e||e instanceof String?t=b.DataType.String:e instanceof b.AnimationImpl?t=b.DataType.Animation:e instanceof b.CornerImpl?t=b.DataType.Corner:e instanceof b.RectImpl?t=b.DataType.Rect:e instanceof b.TextShadowImpl?t=b.DataType.TextShadow:e instanceof b.WebkitTextStrokeImpl?t=b.DataType.WebkitTextStroke:e instanceof b.TransitionImpl?t=b.DataType.Transition:e instanceof b.BorderImageImpl&&(t=b.DataType.BorderImage),e!=b.InvalidInt32&&e!=b.InvalidFloat&&e!=b.InvalidPointer?s=e:(t=b.DataType.Null,s=null),this.data=new b.DataInfo,this.data.index=t,this.data.value=s}toString(){let e=null;switch(this.data.index){case b.DataType.Null:return"";case b.DataType.Int32:case b.DataType.Float:return String(this.get());case b.DataType.String:e=this.get();break;case b.DataType.Animation:case b.DataType.Corner:case b.DataType.Rect:case b.DataType.TextShadow:case b.DataType.WebkitTextStroke:case b.DataType.Transition:case b.DataType.BorderImage:case b.DataType.BackgroundImage:e=this.get().rawValue;break;default:console.error("Failed to do StyleValue.toString()")}return e??""}is(e){return this.data.index==e}get(){return this.data.value}reset(e){this.data.value=e.data.value,this.data.index=e.data.index}equals(e){return this.data.value===e.data.value&&this.data.index===e.data.index}}b.Base=class{constructor(e){this.rawValue=e}},b.AnimationImpl=class extends b.Base{constructor(e){super(e),this.name="",this.duration=0,this.timingFunction=null,this.delay=0,this.iterationCount=0,this.direction=!1}},b.CornerImpl=class extends b.Base{constructor(e){super(e),this.topLeft=0,this.topRight=0,this.bottomRight=0,this.bottomLeft=0}},b.RectImpl=class extends b.Base{constructor(e){super(e),this.top=0,this.right=0,this.left=0,this.bottom=0}},b.TextShadowImpl=class extends b.Base{constructor(e){super(e),this.hShadow=0,this.vShadow=0,this.blur=0,this.color=void 0}},b.WebkitTextStrokeImpl=class extends b.Base{constructor(e){super(e),this.length=0,this.color=void 0}},b.TransitionImpl=class extends b.Base{constructor(e){super(e),this.animationMap=new Map}},b.BorderImageImpl=class extends b.Base{constructor(e){super(e),this.source="",this.slice=null}},b.BackgroundImageImpl=(C(d=class extends b.Base{constructor(e){super(e),this.type=0,this.urlPath=""}},"BackgroundImageImpl"),d.eType={UNKNOWN:0,LINEAR_GRADIENT:1,URL_PATH:2},d.LinearGradient=class{constructor(){this.fromX=0,this.fromY=0,this.toX=0,this.toY=0,this.stops=[]}},d),b.DataType=(C(u=class{},"DataType"),u.Null=0,u.Int32=1,u.Float=2,u.String=3,u.Animation=4,u.Corner=5,u.Rect=6,u.TextShadow=7,u.WebkitTextStroke=8,u.Transition=9,u.BorderImage=10,u.BackgroundImage=11,u),b.InvalidInt32=Number.MIN_VALUE,b.InvalidFloat=Number.NaN,b.InvalidPointer=null,b.DataInfo=class{constructor(){this.value=null,this.index=-1}},C(v=class{},"Text"),v.Color="#000000",v.FontFamily="黑体",v.FontSize=10,v.FontStyle="normal",v.FontWeight="normal",v.LineHeight=0,v.TextAlign="start",v.TextOverflow="clip",v.TextShadow=null,v.WebkitTextStroke=null,v.WhiteSpace="normal",v.WordWrap="normal",v.Direction="ltr",v.JsvTextEmoji=0,v.JsvTextLatex=0,v.JsvTextAlignMinWidth=0,v.JsvTextVerticalAlign="top",v.JsvTextLineAlign="middle",v.JsvTextInnerDirection="unset",C(m=class{constructor(){this.height=b.InvalidInt32,this.left=b.InvalidInt32,this.top=b.InvalidInt32,this.width=b.InvalidInt32}},"Layout"),m.Name="layout",C(f=class{constructor(){this.flexDirection=b.InvalidInt32,this.flexWrap=b.InvalidInt32,this.justifyContent=b.InvalidInt32,this.alignItems=b.InvalidInt32,this.alignContent=b.InvalidInt32,this.alignSelf=b.InvalidInt32,this.flexGrow=b.InvalidFloat}},"Flex"),f.Name="flex",C(p=class{constructor(){this.backgroundColor=b.InvalidPointer,this.backgroundImage=b.InvalidPointer,this.borderRadius=b.InvalidPointer}},"Background"),p.Name="background",C(g=class{constructor(){this.backfaceVisibility=b.InvalidPointer,this.borderImage=b.InvalidPointer,this.borderImageWidth=b.InvalidPointer,this.borderImageOutset=b.InvalidPointer,this.display=b.InvalidPointer,this.objectFit=b.InvalidPointer,this.opacity=b.InvalidFloat,this.overflow=b.InvalidPointer,this.perspective=b.InvalidInt32,this.perspectiveOrigin=b.InvalidPointer,this.transform=b.InvalidPointer,this.transformOrigin=b.InvalidPointer,this.transformStyle=b.InvalidPointer,this.visibility=b.InvalidPointer,this.zIndex=b.InvalidInt32}},"Effect"),g.Name="effect",C(w=class{constructor(){this.color=b.InvalidPointer,this.fontFamily=b.InvalidPointer,this.fontSize=b.InvalidInt32,this.fontStyle=b.InvalidPointer,this.fontWeight=b.InvalidPointer,this.lineHeight=b.InvalidInt32,this.textAlign=b.InvalidPointer,this.textOverflow=b.InvalidPointer,this.textShadow=b.InvalidPointer,this.webkitTextStroke=b.InvalidPointer,this.whiteSpace=b.InvalidPointer,this.wordWrap=b.InvalidPointer,this.direction=b.InvalidPointer,this.jsvTextEmoji=b.InvalidInt32,this.jsvTextLatex=b.InvalidInt32,this.jsvTextAlignMinWidth=b.InvalidInt32,this.jsvTextVerticalAlign=b.InvalidPointer,this.jsvTextLineAlign=b.InvalidPointer,this.jsvTextInnerDirection=b.InvalidPointer}},"Text"),w.Name="text",C(y=class{constructor(){this.animation=b.InvalidPointer,this.transition=b.InvalidPointer,this.animationFillMode="none"}},"Motion"),y.Name="motion";class F{static JsvDeclarePrototype(){for(let e in I){let t=I[e];for(let e in t){let s=t[e];if("string"!=typeof s)continue;const i={set:function(e){this.setProperty(s,e)},get:function(){return this.getPropertyValue(s)}};Object.defineProperty(F.prototype,s,i)}}}constructor(e){this.cachedProps={},this.nativeId=e}setProperty(e,t){if(window.JsvCode.Dom.CheckStyleFormat?.(e,t),e==I.Background.BackgroundImage&&"string"==typeof t)if(0==t.indexOf("linear-gradient")){const e=t.match(/\(/g)?.length,s=t.match(/\)/g)?.length;e!=s&&(console.error(`StyleError: illegal linear-gradient value '${t}'`),t="")}else{t=new N(t).href}else if(e==I.Effect.BorderImage&&"string"==typeof t){const e=t.split(" ");e.length>0&&(e[0]=new N(e[0]).href),t=e.join(" ")}else e==I.Effect.Display&&(this.cachedProps[e]=t);E.Dom.SetStyleProperty(this.nativeId,e,t)}getPropertyValue(e){if(e==I.Effect.Display)return this.cachedProps[e];throw console.error("StyleDeclaration.getPropertyValue() propName="+e),new Error("Get style value is unimplemented because it's low performance.")}jsvGetProperties(...e){const t=JSON.stringify(e),s=E.Dom.GetStyleProperties(this.nativeId,t);return JSON.parse(s)}}class P extends t{constructor(e){super(e)}}class L extends S{static JsvEnableEventListener(){E.Dom.EnableEventListener((function(e,t,...s){let i=L.JsvEventListenerMap.get(e);const n=i?.get(t);n?.(t,...s)}))}constructor(e){super(S.ELEMENT_NODE),this.jsvNativeId=-1,this.jsvAttrStore={},this.jsvClientSizeStore={},this.tagName=e,this.tagName!=L.JsvTagName.Audio&&this.tagName!=L.JsvTagName.Div&&this.tagName!=L.JsvTagName.Image&&this.tagName!=L.JsvTagName.Video&&this.tagName!=L.JsvTagName.JsvFDiv||(this.jsvNativeId=x.GenerateId(),this.style=new F(this.jsvNativeId),E.Dom.CreateElement(this.jsvNativeId,e))}appendChild(e){e.parentNode?this.moveChildNode(e,null):(super.appendChild(e),this.jsvInsertChild(e,null))}removeChild(e){super.removeChild(e),this.jsvRemoveChild(e),e instanceof L&&e.jsvNativeId>0&&E.Dom.RemoveElementChild(this.jsvNativeId,e.jsvNativeId)}insertBefore(e,t){e.parentNode?e.parentNode==this?(this.jsvMoveChildReOrder(e,t),this.jsvReOrderChildNode(e,t)):this.moveChildNode(e,t):(super.insertBefore(e,t),this.jsvInsertChild(e,t))}addEventListener(e,t,s){const i=this.jsvGetEventListenerSet(e);i?.has(t)?console.warn("Element.addEventListener() Faild to add listener, func is exists"):(s=this.jsvCheckEventOptions(s),this.jsvNativeId&&(this.jsvAddListener(this.jsvNativeId,e),E.Dom.AddElementEventListener(this.jsvNativeId,e,s)),super.addEventListener(e,t,s))}removeEventListener(e,t,s){const i=this.jsvGetEventListenerSet(e);0!=!!i?.has(t)&&(s=this.jsvCheckEventOptions(s),super.removeEventListener(e,t,s),this.jsvNativeId&&(this.jsvRemoveListener(this.jsvNativeId,e),E.Dom.RemoveElementEventListener(this.jsvNativeId,e,s)))}get childElementCount(){return this.childNodes.length}get firstElementChild(){return this.childNodes.length>0?this.childNodes?.[0]:null}get lastElementChild(){const e=this.childNodes.length;return e>0?this.childNodes[e-1]:null}set className(e){this.setAttribute("class",e)}get clientWidth(){return this.jsvClientSizeStore.clientWidth||(this.jsvClientSizeStore.clientWidth=E.Dom.GetElementAttribute(this.jsvNativeId,"clientWidth")),this.jsvClientSizeStore.clientWidth}get clientHeight(){return this.jsvClientSizeStore.clientHeight||(this.jsvClientSizeStore.clientHeight=E.Dom.GetElementAttribute(this.jsvNativeId,"clientHeight")),this.jsvClientSizeStore.clientHeight}setAttribute(e,t){e&&(this.jsvAttrStore[e]=t,this.jsvNativeId&&(e.startsWith("data-jsv-vw-")?E.Dom.SetForgeViewInnerProps(this.jsvNativeId,e,t):"class"===e||e.startsWith("data-v-")||e.startsWith("data-jsv")||e.startsWith("dataJsv")?E.Dom.SetElementAttribute(this.jsvNativeId,e,t):"id"===e&&E.Dom.SetForgeViewInnerProps(this.jsvNativeId,"data-jsv-vw-id",t)))}removeAttribute(e){delete this.jsvAttrStore[e],("class"==e||e.startsWith("data-v-")||"src"==e)&&this.jsvNativeId&&E.Dom.SetElementAttribute(this.jsvNativeId,e,null)}getAttribute(e){return this.jsvAttrStore[e]}hasAttribute(e){return!!this.jsvAttrStore[e]}focus(){document.activeElement&&document.activeElement.onfocus();let e=document.activeElement;if(document.activeElement=this,e){let t=new n(n.JsvType.Blur);t.target=e,document.dispatchEvent(t)}let t=new n(n.JsvType.Focus);document.dispatchEvent(t)}jsvGetBoundingClientRect(){const e="jsv-getbound",t=x.GenerateId();return new Promise(((s,i)=>{const n=o=>{const r=o.jsvParams?.[1];if(r!=t)return;o.preventDefault(),this.removeEventListener(e,n);const a=JSON.parse(o.jsvParams?.[0]??"{}");0===a.status?s(a.data):i(a.error)};this.addEventListener(e,n,{jsvtoken:t})}))}jsvSetOnLazyTaskSyncedListener(e){E.Dom.AppendLazyTaskSyncedListener(this.jsvNativeId,e)}jsvOnEvent(e,...n){let o;e.startsWith("animation")?(o=new s(e),o.animationName=n[0]):e.startsWith("transition")?(o=new P(e),o.propertyName=n[0]):e.startsWith("jsv")?(o=new i(e),o.options={detail:n[0]},o.jsvParams=n):"click"==e&&(o=new t(e),o.target=this),o&&(o.target=this,this.dispatchEvent(o))}jsvGetProxyView(e){return e?(this.maskViewProxy||(this.maskViewProxy=T.NewDomProxyView(this.jsvNativeId,!0)),this.maskViewProxy):(this.mainViewProxy||(this.mainViewProxy=T.NewDomProxyView(this.jsvNativeId,!1)),this.mainViewProxy)}jsvGetProxyTexture(e){return this.mainViewTextureProxy||(this.mainViewTextureProxy=e.GetDomProxyTexture(this.jsvNativeId)),this.mainViewTextureProxy}jsvGetRelativePosition(e){return E.Dom.GetRelativePosition(this.jsvNativeId,e.jsvNativeId)}jsvAddListener(e,t){let s=L.JsvEventListenerMap.get(e);s||(s=new Map,L.JsvEventListenerMap.set(e,s));this.jsvGetEventListenerSet(t)||s.set(t,this.jsvOnEvent.bind(this))}jsvRemoveListener(e,t){let s=L.JsvEventListenerMap.get(e);if(!s)return;this.jsvGetEventListenerSet(t)||s.delete(t)}moveChildNode(e,t){console.log("Do move child node");let s=e.parentNode;s.jsvMoveChildToNewParent(e,this,t),this.jsvMoveChildNode(s,e,t)}jsvMoveChildNode(e,t,s){t.jsvNativeId&&(s=L.JsvFindBackwardForgeView(s),E.Dom.MoveElementChild(this.jsvNativeId,e.jsvNativeId,t.jsvNativeId,s?.jsvNativeId))}jsvReOrderChildNode(e,t){e.jsvNativeId&&(t=L.JsvFindBackwardForgeView(t),E.Dom.ReOrderElementChild(this.jsvNativeId,e.jsvNativeId,t?.jsvNativeId))}jsvInsertChild(e,t){e.parentNode=this,e.nodeType===S.TEXT_NODE?this.textContent=e.nodeValue:e instanceof L&&e.jsvNativeId>0&&(t=L.JsvFindBackwardForgeView(t),E.Dom.InsertElementChild(this.jsvNativeId,e.jsvNativeId,t?.jsvNativeId))}jsvRemoveChild(e){if(e instanceof L!=0){for(const t of e.childNodes)e.jsvRemoveChild(t);e.jsvFinalize(),E.Dom.RemoveLazyTaskSyncedListener(e.jsvNativeId),L.JsvEventListenerMap.delete(e.jsvNativeId)}}jsvCheckEventOptions(e){if(null==e)return null;if("object"!=typeof e||e instanceof Array)return console.warn("Event options is invalid for ",e),null;const t=["capture","once","passive","signal"];for(const[s,i]of Object.entries(e))0==t.includes(s)&&0==s.startsWith("jsv")&&(console.warn("Event options name is invalid: ",s),delete e[s]),"boolean"==typeof i?e[s]=+e[s]:"number"!=typeof i&&(console.warn("Event options value is invalid: ",i),delete e[s]);return e}static JsvFindBackwardForgeView(e){let t=e;for(;t&&!(t instanceof L);)t=t.nextSibling;return t}}L.JsvTagName={Anchor:"A",Audio:"AUDIO",Div:"DIV",Head:"HEAD",Image:"IMG",IFrame:"IFRAME",Link:"LINK",Script:"SCRIPT",Style:"STYLE",Svg:"SVG",Video:"VIDEO",JsvAudioTrack:"JSV-AUDIOTRACK",JsvFDiv:"FDIV"},L.JsvEventListenerMap=new Map;class k extends L{constructor(){super(L.JsvTagName.Anchor),this.href="",this.protocol="",this.host="",this.search="",this.hash="",this.hostname="",this.port="",this.pathname="",console.warn("Warnig: <a> is fake in JsView system")}jsvGetTagName(){return L.JsvTagName.Anchor}}class R extends S{constructor(e){super(S.COMMENT_NODE),this.textContent=e}}class M extends L{constructor(){super(L.JsvTagName.Div),this.textContentStore=null}get textContent(){return this.textContentStore}set textContent(e){this.textContentStore=e,this.jsvClientSizeStore={},E.Dom.SetElementText(this.jsvNativeId,e)}}const j="FocusDebug",_="__AppRoot__";let O=!1,J=!1;function B(e,t){let s=function(e){let t="";if(e){let s=e,i=s.RouterDelegate?.ref?.NameSpace;for(i=i==_?"":i,t=`[${i?i+", ":""}${s.BranchName}]`,s=s.GetParentPage();s;)i=s.RouterDelegate?.ref?.NameSpace,i=i==_?"":i,t=`[${i?i+", ":""}${s.BranchName}]->`+t,s=s.GetParentPage()}return t}(e);if(t.stack){let e=t.stack.split("\n");e.length>=3&&(t.stack=e.slice(2,6))}let i="";for(let e of t.stack)i+=e+"\n";delete t.stack,console.log(j,`focusChange(${t?.from}):${t?.askName}\n:focusStack:${s}\n:trace:${i}:`,t)}class A{constructor(e,t){this._DefaultFocusNameSpace=null,this._DefaultFocusNameSpace=null,this.RouterDelegate={ref:null},e||(this.RouterDelegate.ref=new V(!1,t))}enableFocusTrace(e){O=!0,J=e}getNameSpace(){let e=this.RouterDelegate.ref.NameSpace;return e==_?"":e}wrapWithNameSpace(e){let t=new A(!0);return t._DefaultFocusNameSpace=e,t.RouterDelegate=this.RouterDelegate,t}getNodeByName(e){return this.RouterDelegate.ref.getNodeByName(e)}focusByNameBeforeMount(e,t,s){if("string"==typeof e)return e.includes(".")&&(e=e.split(".")),this.RouterDelegate.ref.focusBeforeMount(e,t,s);console.error(`setFocus name=${e} is invalid`)}setFocus(e,t){this._DefaultFocusNameSpace&&this._DefaultFocusNameSpace.length>0&&(e=`${this._DefaultFocusNameSpace}.${e}`);let s=null;O&&(s={askName:e,deepToChild:t,from:"setFocus",stack:J?new Error("simulate-stack").stack:null});return this.focusByNameBeforeMount(e,t,s)}printAllFocusable(){this.RouterDelegate.ref.printAllFocusRecursive(this._DefaultFocusNameSpace,"")}getCurrentFocusStack(){const e=[];if(this.RouterDelegate.ref){let t=this.RouterDelegate.ref.getCurrentFocusNode();for(;t&&t instanceof W;){let s=t.RouterDelegate?.ref?.NameSpace;e.push({nameSpace:s==_||s==t.BranchName?"":s,name:t.BranchName}),t=t.GetParentPage()}}else console.error("getCurrentFocusStack failed: router delegate is null.");return e}getLastFocus(){if(W.sLastFocus){let e=W.sLastFocus;for(;e._LatestFocusChild;)e=e._LatestFocusChild;return e.BranchName}return null}getCurrentFocus(){if(this.RouterDelegate.ref){const e=this.RouterDelegate.ref.getCurrentFocusNode();if(e)return e.BranchName}return null}getDeactivedPageFocus(){return this.RouterDelegate.ref?this.RouterDelegate.ref.getDeactivePageFocusName():null}returnFocusToParent(){const e=this.RouterDelegate.ref.getCurrentFocusNode();e?e.ReturnFocusToParent():console.warn("returnFocusToParent: current focus node is null.")}}class V{constructor(e,t){this._ChildMap={},this._FocusNameBeforeMount=null,this._BeforeMountStack=null,this._FocusNodeName=null,this._IsTemp=!!e,this.NameSpace=t}getDeactivePageFocusName(){return this._FocusNodeName}getCurrentFocusNode(){if(null==this._FocusNodeName)return null;let e=this._ChildMap[this._FocusNodeName];if(!e)return console.error("Erorr: node not mounted name="+this._FocusNodeName),null;if(e.RouterDelegate.ref!=this){let t=e.RouterDelegate.ref.getCurrentFocusNode();return null==t?e:t}return e}getNodeByName(e,t){let s=e.split(".");return this._FindRouterSearchBase(s,t)._GetNodeFromPathArray(s,e)}printAllFocusRecursive(e,t){let s=this.NameSpace==_?"":this.NameSpace,i=t+(t&&t.length>0?".":"")+s;for(let t in this._ChildMap){let s=this._ChildMap[t];if(!e||0==e.length||i.indexOf(e)>=0){let e=i===_?t:i+"."+t;console.log(e,s)}s.RouterDelegate.ref!=this&&s.RouterDelegate.ref.printAllFocusRecursive(e,i)}}_FindRouterSearchBase(e,t){if(0==e[0].length){let t,s;for(let e in this._ChildMap){t=this._ChildMap[e];break}do{s=t,t=t.GetParentPage()}while(null!=t);return e.splice(0,1),s.RouterDelegate.ref}return t&&t.AsHub&&t.GetParentPage()?t.GetParentPage().RouterDelegate.ref:this}_GetNodeFromPathArray(e,t){let s=0,i=this;for(;s<e.length-1;){let n=!1;for(let t in i._ChildMap){let o=i._ChildMap[t].RouterDelegate.ref;if(o!=i&&o.NameSpace==e[s]){i=o,s++,n=!0;break}}if(!n)return void console.error(`Error: no found subpath fname=${t}`)}let n=e[s];return i._ChildMap.hasOwnProperty(n)?i._ChildMap[n]:void console.error(`Error: no found fname=${t}`)}add(e,t){if(e.indexOf(".")>=0)console.error("ERROR: FDiv name can not contains '.'");else if(this._ChildMap.hasOwnProperty(e)&&this._ChildMap[e]!==t)console.error(`ERROR: FDiv router branch name duplicated:[${e}]`);else if(this._ChildMap[e]=t,this._FocusNameBeforeMount)if("string"==typeof this._FocusNameBeforeMount)this._FocusNameBeforeMount==e&&t.RouterDelegate.ref.focusBeforeMount(this._FocusNameBeforeMount,!1,this._BeforeMountStack);else{this._FocusNameBeforeMount[0]==e&&t.RouterDelegate.ref.focusBeforeMount(this._FocusNameBeforeMount.slice(1),!1,this._BeforeMountStack)}}remove(e,t,s,i){let n=this._ChildMap[e];n&&n==t&&(delete this._ChildMap[e],n.OnRemoveFromTree()),this._FocusNodeName==e&&s&&(i||(this._FocusNodeName=s))}rename(e,t){if(!this._ChildMap.hasOwnProperty(e))return void console.error(`ERROR: alter name failed ${e}->${t}`);let s=this._ChildMap[e];delete this._ChildMap[e],this.add(t,s),this._FocusNodeName==e&&(this._FocusNodeName=t)}clearChildFocus(){this._FocusNodeName=null,this._FocusNameBeforeMount=null}hasPendingFocusRequest(){return!this._FocusNameBeforeMount}focusBeforeMount(e,t,s){O&&!s&&console.error(j,`Error: found debug info missing from ${new Error("simulate-stack").stack}`);let i=!1;if("string"==typeof e){if(!e.includes(".")){i=!0;let n=this._ChildMap[e];if(this._FocusNodeName=e,n){this._FocusNameBeforeMount=null,this._BeforeMountStack=s,n.Focus(!t);let e=n.GetFocusChild();for(;e;){let t=e.GetFocusChild();if(!t){this._FocusNodeName=e.BranchName;break}e=t}return O&&B(e??n,s),n.RouterDelegate.ref!=this&&n.RouterDelegate.ref.clearChildFocus(),!0}return this._FocusNameBeforeMount=e,this._BeforeMountStack=s,!1}console.error("error: name contain .")}else if("object"==typeof e&&Array.isArray(e)&&e.length>0){if(i=!0,1==e.length)return this.focusBeforeMount(e[0],t,s);{let i=e[0],n=this._ChildMap[i];return this._FocusNodeName=i,n?n.RouterDelegate.ref.focusBeforeMount(e.slice(1),t,s):(this._FocusNameBeforeMount=e,this._BeforeMountStack=s,!1)}}return i||console.error("illegal name param",e),!1}focus(e,t,s){let i=this.focusBeforeMount(e,t,s);return i||console.log("No found branch:"+e),i}forEach(e){for(let t in this._ChildMap)e(this._ChildMap[t],t,this._ChildMap)}printNodes(){console.log(this._ChildMap)}}class W extends T.PageBase{constructor(e){super(e),this._OnKeyDown=null,this._OnKeyUp=null,this._OnFocus=null,this._OnBlur=null,this._DispatchKeyDown=null,this._DispatchKeyUp=null,this._OnCustomEvent=null,this._DKeyDownProxy=void 0,this._DKeyUpProxy=void 0,this._Mounted=!1,this._MountWaitingList=null,this.AsHub=!1,this.InterfaceHub=null,this._TmpRouter=null,this._AutoShow=null,this.BranchName=e,this.RouterDelegate={ref:null},this._TmpRouter=null,this._OriginDispatchKeyDown=this._OriginDispatchKeyDown.bind(this),this._OriginDispatchKeyUp=this._OriginDispatchKeyUp.bind(this),this._AutoShow=!1}async waitMounted(){if(this._Mounted)return;let e=this;return new Promise(((t,s)=>{e._MountWaitingList||(e._MountWaitingList=[]),e._MountWaitingList.push(t)}))}updateMountState(){this._Mounted=!0;let e=this.SubPages;for(let t in e)e[t].updateMountState();if(this._MountWaitingList&&this._MountWaitingList.length>0){for(const e of this._MountWaitingList)e();this._MountWaitingList=null}}getHub(){return this.InterfaceHub||(this.InterfaceHub=new A(!0),this.InterfaceHub.RouterDelegate=this.RouterDelegate),this.InterfaceHub}setHub(e){this.RouterDelegate.ref?console.error("Error: hub is already setted."):(this.RouterDelegate.ref=e.RouterDelegate.ref,this.AsHub=!0)}_UseParentRouter(e){this.RouterDelegate=e,this.InterfaceHub&&(this.InterfaceHub.RouterDelegate=e)}routerAdd(e,t){t.RouterDelegate.ref||t._UseParentRouter(this.RouterDelegate),this.RouterDelegate.ref||(this.RouterDelegate.ref=new V(!0)),this.RouterDelegate.ref.add(e,t)}routerRenameChild(e,t){this.RouterDelegate.ref.rename(e,t)}routerUnbind(e,t){let s;this.AsHub?this.GetParentPage()&&(s=this.GetParentPage().RouterDelegate.ref):s=this.RouterDelegate.ref,s&&s.remove(this.BranchName,this,e,t),this.RouterDelegate={ref:null}}setBranchName(e){if(e===this.BranchName)return;let t=this.BranchName;this.BranchName=e,this.PageName=e,this._ParentPage&&this._ParentPage.routerRenameChild(t,e)}static safeCallback(e){return e&&e instanceof Function?function(...t){try{return e(...t)}catch(t){console.error("FocusNode: callback error",e.name,t)}}:null}setOnKeyDown(e){this._OnKeyDown=W.safeCallback(e)}setOnKeyUp(e){this._OnKeyUp=W.safeCallback(e)}setOnFocus(e){this._OnFocus=W.safeCallback(e)}setOnBlur(e){this._OnBlur=W.safeCallback(e)}setDispatchKeyUp(e){this._DispatchKeyUp=W.safeCallback(e)}setDispatchKeyDown(e){this._DispatchKeyDown=W.safeCallback(e)}setOnCustomEvent(e){this._OnCustomEvent=W.safeCallback(e)}setDispatchKeyProxy(e,t){this._DKeyDownProxy=W.safeCallback(e),this._DKeyUpProxy=W.safeCallback(t)}requestFocus(e){let t=null;O&&(t={askName:this.BranchName,deepToChild:e,from:"requestFocus",stack:J?new Error("simulate-stack").stack:null}),this.requestFocusInner(e,t)}ReturnFocusToParent(){if(this.IsFocus()){let e=this.GetParentPage();if(e){const t=e.BranchName;let s=null;O&&(s={askName:t,deepToChild:!1,from:"returnFocusToParent",stack:J?new Error("simulate-stack").stack:null}),e.RouterDelegate.ref.focus(t,!1,s)}}else super.ReturnFocusToParent()}requestFocusInner(e,t){let s=this.RouterDelegate.ref;return this.AsHub&&this.GetParentPage()&&(s=this.GetParentPage().RouterDelegate.ref),s?s.focus(this.BranchName,e,t):(console.error("error: lost router"),!1)}OnKeyDown(e){return!!this._OnKeyDown&&this._OnKeyDown(e)}OnKeyUp(e){return!!this._OnKeyUp&&this._OnKeyUp(e)}OnCustomEvent(e){return!!this._OnCustomEvent&&this._OnCustomEvent(e)}bubbleCustomEvent(e){this.BubbleCustomEvent(e)}dispatchKeyDown(e){return this.DispatchKeyDown(e)}DispatchKeyDown(e){return this._DKeyDownProxy?this._DKeyDownProxy(e,this._OriginDispatchKeyDown):this._OriginDispatchKeyDown(e)}_OriginDispatchKeyDown(e){let t=!1;return this._DispatchKeyDown&&(t=this._DispatchKeyDown(e)),!!t||super.DispatchKeyDown(e)}dispatchKeyUp(e){return this.DispatchKeyUp(e)}DispatchKeyUp(e){return this.__DKeyUpProxy?this.__DKeyUpProxy(e,this._OriginDispatchKeyUp):this._OriginDispatchKeyUp(e)}_OriginDispatchKeyUp(e){let t=!1;return this._DispatchKeyUp&&(t=this._DispatchKeyUp(e)),!!t||super.DispatchKeyUp(e)}attachToActivity(e,t){this.AttachToActivity(e,t)}AttachToActivity(e,t){super.SetParent(e,t)}setParent(e){this.SetParent(e)}SetParent(e){if(null!=e&&(super.SetParent(e,null),this._ParentPage._Mounted&&(this.updateMountState(),z()),e instanceof W)){if(this.RouterDelegate.ref&&this.RouterDelegate.ref._IsTemp){let t=this.RouterDelegate.ref;this.RouterDelegate.ref=null,t.forEach(((t,s)=>{e.routerAdd(s,t)}))}e.routerAdd(this.BranchName,this)}}focus(e){this.Focus(e)}Focus(e){if(!this._Mounted)return W.sFocusMemos.push({obj:this,bcf:e}),void console.log("page base tree not build, cache focus");super.Focus(e)}OnFocus(){this._OnFocus&&this._OnFocus()}OnBlur(){W.sLastFocus=this,this._OnBlur&&this._OnBlur()}onUnMount(e){W.sLastFocus==this&&(W.sLastFocus=null);let t=this.IsFocus();if(O&&t){let t=this.GetParentPage();if(t){let s=null;s={askName:t.BranchName,deepToChild:!1,from:e?"deactive":"unmount",stack:J?new Error("simulate-stack").stack:null},B(t,s)}}let s=this.GetParentPage();s&&s.RemoveSubPage(this),this.ClearSubPages(),this.routerUnbind(s?.BranchName,e),this._Mounted=!1}getFullName(){let e=this,t=[this.RouterDelegate.ref.NameSpace];this.AsHub||t.push(this.BranchName);let s=this.RouterDelegate.ref;do{if(e=e.GetParentPage(),t[0]==_)break;e&&e.RouterDelegate.ref!=s&&(s=e.RouterDelegate.ref,t.unshift(s.NameSpace))}while(e);return t[0]==_?t.shift():console.error("ERROR: missing app root"),t.join(".")}getNodeByName(e){return this.RouterDelegate.ref.getNodeByName(e,this)}}W.sFocusMemos=[],W.sLastFocus=null,W.sRootPageNode=null;let z=()=>{let e=W.sFocusMemos.length;if(e>0){let t=W.sFocusMemos;W.sFocusMemos=[];for(let s=0;s<e;s++)t[s].obj.Focus(t[s].bcf)}},G={};class K{constructor(e,t,s){this._Element=s,G.hasOwnProperty(e)&&console.error(`Warn: FDivRoot duplicate name=${e}`),G[e]=this,this._DoInit(t)}_DoInit(e){let t=this._Element.FocusNodeRef;this._Element.setAttribute("new-namespace","__AppRoot__"),e&&t.setDispatchKeyProxy(e.keyDown,e.keyUp),window.JsView?t.attachToActivity(window.JsvCode.ForgeHandles.RootActivity,window.JsvCode.ForgeHandles.RootView):(window.addEventListener("keydown",(e=>{var s=document.activeElement?.tagName;s&&"input"===s.toLowerCase()||(t.dispatchKeyDown(e),e.preventDefault&&e.preventDefault())})),window.addEventListener("keyup",(e=>{var s=document.activeElement?.tagName;s&&"input"===s.toLowerCase()||(t.dispatchKeyUp(e),e.preventDefault&&e.preventDefault())})))}getElement(){return this._Element}getHub(){return this._Element.jsvGetHub()}onMounted(){this._Element.FocusNodeRef.updateMountState(),z()}}class U extends L{constructor(){super(L.JsvTagName.Image)}setAttribute(e,t){if("src"===e){t=new N(t).href,this.jsvClientSizeStore={}}super.setAttribute(e,t),this.jsvNativeId&&"src"===e&&E.Dom.SetElementAttribute(this.jsvNativeId,e,t)}jsvOnEvent(e,...s){let i;super.jsvOnEvent(e,...s),"load"==e&&(i=new t(e),i.target=this),i&&this.dispatchEvent(i)}}class H extends L{constructor(){super(L.JsvTagName.Link)}setAttribute(e,t){this[e]=t}jsvLoadResource(){let e=!1,t=null;if(null!=this.href){var s=new N(this.href);console.log("Ignore to load link from url="+s.href),e=!0}else console.warn("Failed to load link, href is not exists."),t="NoSrc";this.jsvOnLoadResult(e,t)}jsvOnLoadResult(e,s){if(console.log("Load link result: isSuccess:"+e+", errCode:"+s),e){if(this.onload){let e=new t("load");this.onload(e)}}else this.onerror&&this.onerror({type:"jsvErr_"+s,target:this})}}class $ extends L{constructor(){super(L.JsvTagName.Script)}setAttribute(e,t){this[e]=t}jsvLoadResource(){if(null!=this.src){var e=new N(this.src);console.log("Load script with url="+e.href);var t=this;window.JsView.runJsWithUrl(e.href,!1,((e,s)=>{t.jsvOnLoadResult(e,s)}))}}jsvOnLoadResult(e,s){if(console.log("Load script result: isSuccess:"+e+", errCode:"+s),e){if(this.onload){let e=new t("load");this.onload(e)}}else this.onerror&&this.onerror({type:"jsvErr_"+s,target:this})}}class q extends L{constructor(){super(L.JsvTagName.Style),this.jsvAttrStore={left:0,top:0,width:0,height:0}}}class X extends L{constructor(){super(L.JsvTagName.Svg)}}class Y extends S{constructor(e){super(S.TEXT_NODE),this.textContent=e}get nodeValue(){return this.textContent}set nodeValue(e){this.textContent=e,this.parentNode&&(this.parentNode.textContent=this.textContent)}}let Z=1;class Q extends L{constructor(){super(L.JsvTagName.JsvFDiv),this.FocusNodeRef=new W("unnamed-"+Z++),this.hubRef=void 0}setAttribute(e,t){if(e)if("fname"===e)t&&this.FocusNodeRef.setBranchName(t);else if("new-namespace"===e&&""!==t&&!this.hubRef){let e=new A(!1,t);this.hubRef=e,this.FocusNodeRef.setHub(e),this.FocusNodeRef.setBranchName(t)}}removeAttribute(e){}jsvGetHub(){return this.hubRef}}class ee extends S{constructor(){super(S.DOCUMENT_NODE),this.location=window.location,this.rootElement=new M,this.rootElement.ownerDocument=this,this.rootElement.id="root",E.Dom.BindElementToRootView(this.rootElement.jsvNativeId),this.activeElement=this.rootElement,this.head=null}createComment(e){return new R(e)}createElement(e){switch(e=e.toUpperCase()){case L.JsvTagName.Anchor:return new k;case L.JsvTagName.Div:return new M;case L.JsvTagName.Image:return new U;case L.JsvTagName.Link:return new H;case L.JsvTagName.Script:return new $;case L.JsvTagName.Style:return new q;case L.JsvTagName.Svg:return new X;case L.JsvTagName.JsvFDiv:return new Q;case L.JsvTagName.IFrame:console.error("Unsupported element: "+e+". Your vue compilation may may have failed, please check it first.")}if("TEMPLATE"==e)return{};throw new TypeError("Unimplemented element: "+e)}createEvent(e){return"CUSTOMEVENT"===(e=e.toUpperCase())?new i(e):new t(e)}createTextNode(e){return new Y(e)}getElementById(e){if("root"===e||"app"===e)return this.rootElement;throw new DOMException("Failed to get element by id, id="+e+" is UNIMPLEMENTED.")}getElementsByTagName(e){if((e=e.toUpperCase())===L.JsvTagName.Head)return[this.head];if(e===L.JsvTagName.Link||e===L.JsvTagName.Script||e===L.JsvTagName.Style)return[];throw new DOMException("Failed to get element by name, name="+e+" is UNIMPLEMENTED.")}querySelector(e){if("root"===e||"#app"===e)return this.rootElement;if("head"===e)return this.head;if("base"===e)return null;if("title"===e)return null;if(e.startsWith("style[")&&e.endsWith("]"))return null;throw new DOMException("Failed to query selector, selectors="+e+" is UNIMPLEMENTED.")}querySelectorAll(e){return[]}jsvInitFDivRoot(e,t,s){if(!s){let e=document.createElement("fdiv");this.rootElement.appendChild(e),this.rootElement=e,s=this.rootElement}return new K(e,t,s)}}class te extends L{constructor(){super(L.JsvTagName.Head)}appendChild(e){super.appendChild(e),(e instanceof H||e instanceof $)&&e.jsvLoadResource()}removeChild(e){super.removeChild(e)}}class se{constructor(){this.ready=!1,this.callbacks=[]}listenToReady(e){this.ready?e?.():this.callbacks.push(e)}dataReady(){this.ready=!0;for(let e of this.callbacks)e?.()}}class ie extends se{constructor(){super(),this.TextureManager=null,this.RootActivity=null,this.RootView=null}setHandles(e,t,s){this.TextureManager=e,this.RootActivity=s,this.RootView=t,this.dataReady()}}let ne="@keyframes";class oe{constructor(e){this._AnchorTag=e,this._NamesCache=new Set}insertRule(e){let t=this.getName(e);this._NamesCache.has(t)&&console.warn(`Warn: keyframe replace of name ${t}`),this._NamesCache.add(t),E.Dom.InsertKeyFrame(t,e)}hasRule(e){return this._NamesCache.has(e)}removeRule(e){this._NamesCache.has(e)?(this._NamesCache.delete(e),E.Dom.RemoveKeyFrame(e)):console.error(`Error: keyFrame(${e}) is not exist.`)}removeMultiRules(e){for(let t of e)this.removeRule(t)}getName(e){let t=e.indexOf(ne)+10,s=e.indexOf("{");return e.substring(t,s).trim()}}let re=null;function ae(e){return re||(re={global:new oe("global")}),re.global}class le{static EnsureGlobalEnv(e,t){const s=window.navigator?.userAgent?.toLowerCase();window.jsvInAndroidWebView=s?.indexOf("android")>=0,le.EnsureGlobalJsvCode(e,t),L.JsvEnableEventListener(),F.JsvDeclarePrototype()}static EnsureGlobalJsvCode(e,t){window.JsvCode.Dom||(window.JsvCode.Dom={}),window.JsvCode.Media||(window.JsvCode.Media={}),window.JsvCode.Dom.PlatformBridge||(window.JsvCode.Dom.PlatformBridge=e),window.JsvCode.Media.PlatformBridge||(window.JsvCode.Media.PlatformBridge=t),window.JsvCode.Dom.DeclareStyleSheets||(window.JsvCode.Dom.DeclareStyleSheets=E.Dom.DeclareStyleSheets),window.JsvCode.Dom.UndeclareStyleSheets||(window.JsvCode.Dom.UndeclareStyleSheets=E.Dom.UndeclareStyleSheets),window.JsvCode.Dom.getKeyFrameGroup||(window.JsvCode.Dom.getKeyFrameGroup=ae),window.JsvCode.ForgeHandles||(window.JsvCode.ForgeHandles=new ie)}}class he{static SetLevel(e){switch(he.E=he.W=he.I=he.D=function(){},e){case he.Level.Verbose:he.V=console.debug.bind(console);case he.Level.Debug:he.D=console.debug.bind(console);case he.Level.Info:he.I=console.info.bind(console)}}}he.E=console.error.bind(console),he.W=console.warn.bind(console),he.I=console.info.bind(console),he.D=function(){},he.V=function(){},he.Level={Error:0,Warning:1,Info:2,Debug:3,Verbose:4};class ce{constructor(e){this.callback=e}observe(e,t){if(!(e instanceof S))throw Error("TypeError: Failed to execute 'observe' on 'MutationObserver': parameter 1 is not of type JsView's 'Node'");for(const e of Object.keys(t))"childList"==e||console.warn("JsView: only childList config is supported! ignore "+e);t.childList&&e.jsvObserveChildChanged((()=>{this.callback?.()}))}disconnect(){this.callback=void 0}}class de extends ee{constructor(){super(),this.head=new te}set cookie(e){window.__JsvCookies.setCookie(e)}get cookie(){return window.__JsvCookies.getCookie()}}class ue{static DeclareGlobal(){ue.DeclareDocument(),ue.DeclareOthers(),ue.DeclareAddition()}static DeclareDocument(){window.document=new de}static DeclareOthers(){window.MutationObserver=ce,window.Element=L,window.SVGElement=X;let e=new N(window.JsView.getAppUrl(),!0);window.location.applyUrlInfo?window.location.applyUrlInfo(e):window.location=e,window.history={},window.navigator={userAgent:"jsview-runtime"}}static DeclareAddition(){window.JsView.Dom={Render:null,Extension:null,UrlRef:N}}}class ve{constructor(e){this.activity=new T.ReactActivity("NativeForgeActivity",e,null,null),this.init()}init(){console.log("create NativeForgeActivity.");let e=new T.LayoutView;window.JsvCode.ForgeHandles.setHandles(this.activity.GetTextureManager(),e,this.activity);let t=null;T.DesignMap&&(t=T.DesignMap());let s=t?t.width:1280,i=Math.floor(9*s/16);this.activity.SetContentView(e,{x:0,y:0,width:s,height:i}),T.sRenderBridge.AddWillSwapListener("forgeSwap",(()=>{E.Dom.RequestSwapAllCachedTasks()})),window.JsView.Dom.Render()}}class me{constructor(e){this.activityManager=e;let t=new ve(e);e.RegisterActivity(t.activity),e.StartActivity(new T.Intent("NativeForgeActivity"))}}window.jsvIsBrowserDebug=!1;const fe=window.JsvCode.NativePlatformDomBridge,pe=window.JsvCode.NativePlatformMediaBridge;function ge(){le.EnsureGlobalEnv(fe,pe),ue.DeclareGlobal(),he.I("Using JsView Native Environment.")}export{ge as InitEnv,me as NativeForgeApp};
|
|
1
|
+
/* eslint-disable */ class e{static CreateAudioPlayer(e){return new Audio(e)}static CreateVideoPlayer(){const t=new Video;return t.jsvOnCssStyleChanged=e.OnCssStyleChanged.bind(t),t.jsvFinalize=e.JsvFinalize.bind(t),t}static OnCssStyleChanged(e,t){this.jsvSetStyles(t.left,t.top,t.width,t.height,t.objectFit,t.visibility)}static JsvFinalize(){console.log("NativePlatformMediaBridge.JsvFinalize()");const e=this;e.pause(),e.unload?.(),e.releaseResource&&(e.releaseResource(),e.onPlatformDestroy())}}window.JsvCode.NativePlatformMediaBridge||(window.JsvCode.NativePlatformMediaBridge=e);class t{constructor(e,t){this.prevented=!1,this.target=t,this.timeStamp=Date.now(),this.type=e}preventDefault(){this.prevented=!0}jsvIsPrevented(){return this.prevented}}class s extends t{constructor(e){super(e)}}class i extends t{constructor(e,t){super(e),this.options=t}initCustomEvent(e,t,s,i){this.type=e}get detail(){return this.options?.detail}}class n extends t{constructor(e){super(e)}}n.JsvType={Focus:"focus",Blur:"blur"},void 0===window.Forge?(window.Forge={},console.log("Define forge browser")):console.log("Define using JsView forge engine-js");var o,r,a,l,h,c,d,u,v,m,f,p,g,w,y,T=window.Forge;class N{constructor(e,t){if(this.href="",this.origin="",this.protocol="",this.host="",this.hostname="",this.port="",this.pathname="",this.search="",this.hash="",!e)return;if(!0===e.startsWith("url")){let t=e.indexOf("(")+1,s=e.lastIndexOf(")");if("undefined"===(e=e.substring(t,s).trim())||"null"===e||0===e.length)return}if(!0===e.startsWith("data:")||!0===e.startsWith("jsvtexturestore:"))return void(this.href=e);let s=e.indexOf("://");if(!(s<0||s>10)||e.startsWith("./")||e.startsWith("/")||(e="./"+e),!0===e.startsWith("/"))e=document.location.origin+e;else if(!0===e.startsWith("./")&&void 0!==window.JsView&&void 0!==window.JsView.Dom.JsSubPath){if(void 0===window.JsView.Dom.MainPath||"undefined"===window.JsView.Dom.MainPathRef||window.JsView.Dom.MainPathRef!==document.location.href){window.JsView.Dom.JsSubPath.startsWith("/")||(window.JsView.Dom.JsSubPath="/"+window.JsView.Dom.JsSubPath),window.JsView.Dom.JsSubPath.endsWith("/")||(window.JsView.Dom.JsSubPath=window.JsView.Dom.JsSubPath+"/"),window.JsView.Dom.MainPathRef=document.location.href;let e=document.location.pathname.lastIndexOf(window.JsView.Dom.JsSubPath);window.JsView.Dom.MainPath=document.location.origin+document.location.pathname.substring(0,e)}e=window.JsView.Dom.MainPath+e.substring(1)}if(this.href=e,!t)return;let i=this.href,n=i.indexOf("#");n>0&&(this.hash=i.substring(n),i=i.substring(0,n));let o=i.indexOf("?");o>1&&(this.search=i.substring(o),i=i.substring(0,o));let r=i,a=r.indexOf("://");this.protocol=a>0?r.substring(0,a+1):"";let l=a>1?r.substring(a+3):"";a=l.indexOf("/"),this.host=a>0?l.substring(0,a):"",this.pathname=a>=1?l.substring(a):"","file:"==this.protocol&&(this.host="",this.pathname=l),this.origin=this.protocol+"//"+this.host,a=this.host.indexOf(":"),this.hostname=a>0?this.host.substring(0,a):this.host,this.port=a>1?this.host.substring(a+1):""}replace(e){this.href=e}}class D{static EnableEventListener(e){const t=window.JsvCode.Dom.PlatformBridge.JsViewId;window.JsvCode.Dom.PlatformBridge.SetOnEventListener(t,e)}static CreateElement(e,t){D.PushLazyTask(D.LazyTaskType.CreateElement,e,t)}static BindElementToRootView(e){D.PushLazyTask(D.LazyTaskType.BindElementToRootView,e)}static InsertElementChild(e,t,s){D.PushLazyTask(D.LazyTaskType.InsertElementChild,e,t,s)}static RemoveElementChild(e,t){D.PushLazyTask(D.LazyTaskType.RemoveElementChild,e,t)}static MoveElementChild(e,t,s,i){D.PushLazyTask(D.LazyTaskType.MoveElementChild,e,t,s,i)}static ReOrderElementChild(e,t,s){D.PushLazyTask(D.LazyTaskType.ReOrderElementChild,e,t,s)}static AddElementEventListener(e,t,s){D.PushLazyTask(D.LazyTaskType.AddElementEventListener,e,t,s)}static RemoveElementEventListener(e,t,s){D.PushLazyTask(D.LazyTaskType.RemoveElementEventListener,e,t,s)}static SetElementText(e,t){D.PushLazyTask(D.LazyTaskType.SetElementText,e,t)}static SetElementAttribute(e,t,s){D.PushLazyTask(D.LazyTaskType.SetElementAttribute,e,t,s),D.LazyTaskSyncedListenerMap.has(e)&&D.CachedSyncListenIdSet.add(e)}static GetElementBoundingClientStyles(e,t){return D.RunSyncTask(D.LazyTaskType.GetElementBoundingClientStyles,e,t)}static SetForgeViewInnerProps(e,t,s){let i=0;(t=t.substr(12)).startsWith("mask-")&&(i=1,t=t.substr(5)),D.PushLazyTask(D.LazyTaskType.SetForgeViewInnerProps,e,t,i,""+s)}static DeclareStyleSheets(e){D.PushLazyTask(D.LazyTaskType.DeclareStyleSheets,-1,e)}static UndeclareStyleSheets(e){D.PushLazyTask(D.LazyTaskType.UndeclareStyleSheets,-1,e)}static SetStyleProperty(e,t,s){D.PushLazyTask(D.LazyTaskType.SetStyleProperty,e,t,s),D.LazyTaskSyncedListenerMap.has(e)&&D.CachedSyncListenIdSet.add(e)}static GetStyleProperties(e,t){return D.RunSyncTask(D.LazyTaskType.GetStyleProperties,e,t)}static AppendLazyTaskSyncedListener(e,t){D.LazyTaskSyncedListenerMap.set(e,t)}static RemoveLazyTaskSyncedListener(e){D.LazyTaskSyncedListenerMap.delete(e)}static RequestSwapAllCachedTasks(){if(0==D.CachedLazyTaskList.length)return;const e=JSON.stringify(D.CachedLazyTaskList);D.CachedLazyTaskList=[];const t=window.JsvCode.Dom.PlatformBridge.JsViewId;window.JsvCode.Dom.PlatformBridge.RunLazyTaskList(t,e);for(const e of D.CachedSyncListenIdSet){const t=D.LazyTaskSyncedListenerMap.get(e);t?.()}D.CachedSyncListenIdSet.clear()}static GetElementAttribute(e,t){return D.RunSyncTask(D.LazyTaskType.GetElementAttribute,e,t)}static InsertKeyFrame(e,t){D.PushLazyTask(D.LazyTaskType.InsertKeyFrameDefine,-1,e,t)}static RemoveKeyFrame(e){D.PushLazyTask(D.LazyTaskType.RemoveKeyFrameDefine,-1,e)}static GetRelativePosition(e,t){const s=D.RunSyncTask(D.LazyTaskType.GetRelativePosition,e,t);return JSON.parse(s)}static RunSyncTask(e,t,...s){D.RequestSwapAllCachedTasks();const i=window.JsvCode.Dom.PlatformBridge.JsViewId;return window.JsvCode.Dom.PlatformBridge.RunSyncTask(i,e,t,...s)}static PushLazyTask(e,t,...s){D.CachedLazyTaskList.push([e,t,...s]),T.sRenderBridge?.RequestSwap()}}D.CachedLazyTaskList=new Array,D.CachedSyncListenIdSet=new Set,D.LazyTaskSyncedListenerMap=new Map,D.LazyTaskType={CreateElement:10,BindElementToRootView:11,InsertElementChild:12,RemoveElementChild:13,AddElementEventListener:14,RemoveElementEventListener:15,SetElementText:16,SetElementAttribute:17,GetElementBoundingClientStyles:18,GetElementAttribute:19,MoveElementChild:20,GetRelativePosition:21,ReOrderElementChild:22,DeclareStyleSheets:30,SetStyleProperty:31,GetStyleProperties:32,UndeclareStyleSheets:39,SetForgeViewInnerProps:40,InsertKeyFrameDefine:41,RemoveKeyFrameDefine:42};class E{}E.Dom=D,E.Media=class{static CreateAudioPlayer(){return window.JsvCode.Media.PlatformBridge.CreateAudioPlayer()}static CreateVideoPlayer(){return window.JsvCode.Media.PlatformBridge.CreateVideoPlayer()}};class x{static GenerateId(){const e=this.UniqueId++;if(e>=this.MaxUniqueId)throw new Error("JsvUniqueId.GenerateId() Failed to create unique id. id is overflow.");return e}}x.UniqueId=0,x.MaxUniqueId=Math.pow(2,31)-1;class S{constructor(e){this.childNodes=[],this.nodeType=e,this.ownerDocument=window.document,this.parentNode=null,this.jsvEventListenerMap=null,this.jsvChildChangedCallback=null}jsvFinalize(){}appendChild(e){this.childNodes.push(e),e.parentNode=this,this.jsvChildChangedCallback?.()}removeChild(e){let t=this.childNodes.indexOf(e);if(t<0)throw new DOMException("Failed to remove node, child node is not found. node=",e);this.childNodes.splice(t,1),e.parentNode=null,this.jsvChildChangedCallback?.()}insertBefore(e,t){this.insertBeforeInner(e,t)}get previousSibling(){const e=this.parentNode?.childNodes;let t=e?.indexOf(this);if(void 0===t||t<0)throw new DOMException("Failed to call Node.previousSibling(), this node not found. this=",this);return e[t-1]}get nextSibling(){const e=this.parentNode?.childNodes;let t=e?.indexOf(this);if(void 0===t||t<0)throw new DOMException("Failed to call Node.nextSibling(), this node not found. this=",this);return e[t+1]}addEventListener(e,t,s){this.jsvEventListenerMap||(this.jsvEventListenerMap=new Map);let i=this.jsvEventListenerMap?.get(e);i||(i=new Set,this.jsvEventListenerMap?.set(e,i)),i.add(t)}removeEventListener(e,t,s){let i=this.jsvEventListenerMap?.get(e);i&&(i.delete(t),i.size<=0&&this.jsvEventListenerMap?.delete(e),0==this.jsvEventListenerMap?.size&&(this.jsvEventListenerMap=null))}dispatchEvent(e){if(!this.jsvEventListenerMap)return void console.warn("Node.dispatchEvent() Ignore to dispatch event: "+e.type+". No event added.");let t=this.jsvEventListenerMap?.get(e.type);if(t){e.target||(e.target=document.activeElement);for(let s of t)if(s?.(e),e.jsvIsPrevented())break}else console.warn("Node.dispatchEvent() Ignore to dispatch event: "+e.type+". No listener added.")}jsvObserveChildChanged(e){this.jsvChildChangedCallback=e}jsvMoveChildReOrder(e,t){{let t=this.childNodes.indexOf(e);if(t<0)throw new DOMException("Failed to call jsvMoveChildReOrder, node not found. node=",e);this.childNodes.splice(t,1)}{let s=this.childNodes.length;if(t&&(s=this.childNodes.indexOf(t),s<0))throw new DOMException("Failed to call move node, before node not found. beforeNode=",t);this.childNodes.splice(s,0,e)}this.jsvChildChangedCallback?.()}jsvMoveChildToNewParent(e,t,s){let i=this.childNodes.indexOf(e);if(i<0)throw new DOMException("Failed to call jsvMoveChildToNewParent, node not found. node=",e);this.childNodes.splice(i,1),e.parentNode=null,this.jsvChildChangedCallback?.(),t.insertBeforeInner(e,s)}jsvGetEventListenerSet(e){const t=this.jsvEventListenerMap?.get(e);return t}insertBeforeInner(e,t){let s=this.childNodes.length;if(void 0===t)throw new DOMException("TypeError: Failed to execute 'insertBefore' on 'Node': 2 arguments required, but only 1 present.");if(null!==t&&(s=this.childNodes.indexOf(t)),s<0)throw new DOMException("Failed to call insert node, before node not found. beforeNode=",t);this.childNodes.splice(s,0,e),e.parentNode=this,this.jsvChildChangedCallback?.()}}function C(e,t,s){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:s?"".concat(s," ",t):t})}S.ELEMENT_NODE=1,S.TEXT_NODE=3,S.COMMENT_NODE=8,S.DOCUMENT_NODE=9,S.NOLAYOUT_NODE=10;class I{static HasGetterMethod(e){switch(e){case I.Layout.Height:case I.Layout.Left:case I.Layout.Top:case I.Layout.Width:case I.Effect.ObjectFit:return!0;default:return!1}}static ToConst(e){return e==I.Layout.Height?I.Layout.Height:e==I.Layout.Left?I.Layout.Left:e==I.Layout.Top?I.Layout.Top:e==I.Layout.Width?I.Layout.Width:e==I.Flex.FlexDirection?I.Flex.FlexDirection:e==I.Flex.FlexWrap?I.Flex.FlexWrap:e==I.Flex.JustifyContent?I.Flex.JustifyContent:e==I.Flex.AlignItems?I.Flex.AlignItems:e==I.Flex.AlignContent?I.Flex.AlignContent:e==I.Flex.AlignSelf?I.Flex.AlignSelf:e==I.Flex.FlexGrow?I.Flex.FlexGrow:e==I.Background.BackgroundColor?I.Background.BackgroundColor:e==I.Background.BackgroundImage?I.Background.BackgroundImage:e==I.Background.BorderRadius?I.Background.BorderRadius:e==I.Effect.BackfaceVisibility?I.Effect.BackfaceVisibility:e==I.Effect.BorderImage?I.Effect.BorderImage:e==I.Effect.BorderImageWidth?I.Effect.BorderImageWidth:e==I.Effect.BorderImageOutset?I.Effect.BorderImageOutset:e==I.Effect.Display?I.Effect.Display:e==I.Effect.ObjectFit?I.Effect.ObjectFit:e==I.Effect.Opacity?I.Effect.Opacity:e==I.Effect.Overflow?I.Effect.Overflow:e==I.Effect.Perspective?I.Effect.Perspective:e==I.Effect.PerspectiveOrigin?I.Effect.PerspectiveOrigin:e==I.Effect.Transform?I.Effect.Transform:e==I.Effect.TransformOrigin?I.Effect.TransformOrigin:e==I.Effect.TransformStyle?I.Effect.TransformStyle:e==I.Effect.Visibility?I.Effect.Visibility:e==I.Effect.ZIndex?I.Effect.ZIndex:e==I.Text.Color?I.Text.Color:e==I.Text.FontFamily?I.Text.FontFamily:e==I.Text.FontSize?I.Text.FontSize:e==I.Text.FontStyle?I.Text.FontStyle:e==I.Text.FontWeight?I.Text.FontWeight:e==I.Text.LineHeight?I.Text.LineHeight:e==I.Text.TextAlign?I.Text.TextAlign:e==I.Text.TextOverflow?I.Text.TextOverflow:e==I.Text.TextShadow?I.Text.TextShadow:e==I.Text.WebkitTextStroke?I.Text.WebkitTextStroke:e==I.Text.WhiteSpace?I.Text.WhiteSpace:e==I.Text.WordWrap?I.Text.WordWrap:e==I.Text.Direction?I.Text.Direction:e==I.Text.JsvTextEmoji?I.Text.JsvTextEmoji:e==I.Text.JsvTextLatex?I.Text.JsvTextLatex:e==I.Text.JsvTextAlignMinWidth?I.Text.JsvTextAlignMinWidth:e==I.Text.JsvTextVerticalAlign?I.Text.JsvTextVerticalAlign:e==I.Text.JsvTextLineAlign?I.Text.JsvTextLineAlign:e==I.Text.JsvTextInnerDirection?I.Text.JsvTextInnerDirection:e==I.Motion.Animation?I.Motion.Animation:e==I.Motion.Transition?I.Motion.Transition:e==I.Motion.AnimationFillMode?I.Motion.AnimationFillMode:null}constructor(){throw new Error("new StyleName() is forbidden.")}}I.Layout=(C(o=class{constructor(){throw new Error("new StyleName.Layout() is forbidden.")}},"Layout"),o.Height="height",o.Left="left",o.Top="top",o.Width="width",o),I.Flex=(C(r=class{constructor(){throw new Error("new StyleName.Flex() is forbidden.")}},"Flex"),r.FlexDirection="flexDirection",r.FlexWrap="flexWrap",r.JustifyContent="justifyContent",r.AlignItems="alignItems",r.AlignContent="alignContent",r.AlignSelf="alignSelf",r.FlexGrow="flexGrow",r),I.Background=(C(a=class{constructor(){throw new Error("new StyleName.Background() is forbidden.")}},"Background"),a.BackgroundColor="backgroundColor",a.BackgroundImage="backgroundImage",a.BorderRadius="borderRadius",a),I.Effect=(C(l=class{constructor(){throw new Error("new StyleName.Effect() is forbidden.")}},"Effect"),l.BackfaceVisibility="backfaceVisibility",l.BorderImage="borderImage",l.BorderImageWidth="borderImageWidth",l.BorderImageOutset="borderImageOutset",l.Display="display",l.ObjectFit="objectFit",l.Opacity="opacity",l.Overflow="overflow",l.Perspective="perspective",l.PerspectiveOrigin="perspectiveOrigin",l.Transform="transform",l.TransformOrigin="transformOrigin",l.TransformStyle="transformStyle",l.Visibility="visibility",l.ZIndex="zIndex",l),I.Text=(C(h=class{constructor(){throw new Error("new StyleName.Text() is forbidden.")}},"Text"),h.Color="color",h.FontFamily="fontFamily",h.FontSize="fontSize",h.FontStyle="fontStyle",h.FontWeight="fontWeight",h.LineHeight="lineHeight",h.TextAlign="textAlign",h.TextOverflow="textOverflow",h.TextShadow="textShadow",h.WebkitTextStroke="WebkitTextStroke",h.WhiteSpace="whiteSpace",h.WordWrap="wordWrap",h.Direction="direction",h.JsvTextEmoji="JsvTextEmoji",h.JsvTextLatex="JsvTextLatex",h.JsvTextAlignMinWidth="JsvTextAlignMinWidth",h.JsvTextVerticalAlign="JsvTextVerticalAlign",h.JsvTextLineAlign="JsvTextLineAlign",h.JsvTextInnerDirection="JsvTextInnerDirection",h),I.Motion=(C(c=class{constructor(){throw new Error("new StyleName.Motion() is forbidden.")}},"Motion"),c.Animation="animation",c.Transition="transition",c.AnimationFillMode="animationFillMode",c);class b{constructor(e){let t=-1,s=null;null==e?t=b.DataType.Null:Number(e)===e&&e%1==0?t=b.DataType.Int32:Number(e)===e&&e%1!=0?t=b.DataType.Float:"string"==typeof e||e instanceof String?t=b.DataType.String:e instanceof b.AnimationImpl?t=b.DataType.Animation:e instanceof b.CornerImpl?t=b.DataType.Corner:e instanceof b.RectImpl?t=b.DataType.Rect:e instanceof b.TextShadowImpl?t=b.DataType.TextShadow:e instanceof b.WebkitTextStrokeImpl?t=b.DataType.WebkitTextStroke:e instanceof b.TransitionImpl?t=b.DataType.Transition:e instanceof b.BorderImageImpl&&(t=b.DataType.BorderImage),e!=b.InvalidInt32&&e!=b.InvalidFloat&&e!=b.InvalidPointer?s=e:(t=b.DataType.Null,s=null),this.data=new b.DataInfo,this.data.index=t,this.data.value=s}toString(){let e=null;switch(this.data.index){case b.DataType.Null:return"";case b.DataType.Int32:case b.DataType.Float:return String(this.get());case b.DataType.String:e=this.get();break;case b.DataType.Animation:case b.DataType.Corner:case b.DataType.Rect:case b.DataType.TextShadow:case b.DataType.WebkitTextStroke:case b.DataType.Transition:case b.DataType.BorderImage:case b.DataType.BackgroundImage:e=this.get().rawValue;break;default:console.error("Failed to do StyleValue.toString()")}return e??""}is(e){return this.data.index==e}get(){return this.data.value}reset(e){this.data.value=e.data.value,this.data.index=e.data.index}equals(e){return this.data.value===e.data.value&&this.data.index===e.data.index}}b.Base=class{constructor(e){this.rawValue=e}},b.AnimationImpl=class extends b.Base{constructor(e){super(e),this.name="",this.duration=0,this.timingFunction=null,this.delay=0,this.iterationCount=0,this.direction=!1}},b.CornerImpl=class extends b.Base{constructor(e){super(e),this.topLeft=0,this.topRight=0,this.bottomRight=0,this.bottomLeft=0}},b.RectImpl=class extends b.Base{constructor(e){super(e),this.top=0,this.right=0,this.left=0,this.bottom=0}},b.TextShadowImpl=class extends b.Base{constructor(e){super(e),this.hShadow=0,this.vShadow=0,this.blur=0,this.color=void 0}},b.WebkitTextStrokeImpl=class extends b.Base{constructor(e){super(e),this.length=0,this.color=void 0}},b.TransitionImpl=class extends b.Base{constructor(e){super(e),this.animationMap=new Map}},b.BorderImageImpl=class extends b.Base{constructor(e){super(e),this.source="",this.slice=null}},b.BackgroundImageImpl=(C(d=class extends b.Base{constructor(e){super(e),this.type=0,this.urlPath=""}},"BackgroundImageImpl"),d.eType={UNKNOWN:0,LINEAR_GRADIENT:1,URL_PATH:2},d.LinearGradient=class{constructor(){this.fromX=0,this.fromY=0,this.toX=0,this.toY=0,this.stops=[]}},d),b.DataType=(C(u=class{},"DataType"),u.Null=0,u.Int32=1,u.Float=2,u.String=3,u.Animation=4,u.Corner=5,u.Rect=6,u.TextShadow=7,u.WebkitTextStroke=8,u.Transition=9,u.BorderImage=10,u.BackgroundImage=11,u),b.InvalidInt32=Number.MIN_VALUE,b.InvalidFloat=Number.NaN,b.InvalidPointer=null,b.DataInfo=class{constructor(){this.value=null,this.index=-1}},C(v=class{},"Text"),v.Color="#000000",v.FontFamily="黑体",v.FontSize=10,v.FontStyle="normal",v.FontWeight="normal",v.LineHeight=0,v.TextAlign="start",v.TextOverflow="clip",v.TextShadow=null,v.WebkitTextStroke=null,v.WhiteSpace="normal",v.WordWrap="normal",v.Direction="ltr",v.JsvTextEmoji=0,v.JsvTextLatex=0,v.JsvTextAlignMinWidth=0,v.JsvTextVerticalAlign="top",v.JsvTextLineAlign="middle",v.JsvTextInnerDirection="unset",C(m=class{constructor(){this.height=b.InvalidInt32,this.left=b.InvalidInt32,this.top=b.InvalidInt32,this.width=b.InvalidInt32}},"Layout"),m.Name="layout",C(f=class{constructor(){this.flexDirection=b.InvalidInt32,this.flexWrap=b.InvalidInt32,this.justifyContent=b.InvalidInt32,this.alignItems=b.InvalidInt32,this.alignContent=b.InvalidInt32,this.alignSelf=b.InvalidInt32,this.flexGrow=b.InvalidFloat}},"Flex"),f.Name="flex",C(p=class{constructor(){this.backgroundColor=b.InvalidPointer,this.backgroundImage=b.InvalidPointer,this.borderRadius=b.InvalidPointer}},"Background"),p.Name="background",C(g=class{constructor(){this.backfaceVisibility=b.InvalidPointer,this.borderImage=b.InvalidPointer,this.borderImageWidth=b.InvalidPointer,this.borderImageOutset=b.InvalidPointer,this.display=b.InvalidPointer,this.objectFit=b.InvalidPointer,this.opacity=b.InvalidFloat,this.overflow=b.InvalidPointer,this.perspective=b.InvalidInt32,this.perspectiveOrigin=b.InvalidPointer,this.transform=b.InvalidPointer,this.transformOrigin=b.InvalidPointer,this.transformStyle=b.InvalidPointer,this.visibility=b.InvalidPointer,this.zIndex=b.InvalidInt32}},"Effect"),g.Name="effect",C(w=class{constructor(){this.color=b.InvalidPointer,this.fontFamily=b.InvalidPointer,this.fontSize=b.InvalidInt32,this.fontStyle=b.InvalidPointer,this.fontWeight=b.InvalidPointer,this.lineHeight=b.InvalidInt32,this.textAlign=b.InvalidPointer,this.textOverflow=b.InvalidPointer,this.textShadow=b.InvalidPointer,this.webkitTextStroke=b.InvalidPointer,this.whiteSpace=b.InvalidPointer,this.wordWrap=b.InvalidPointer,this.direction=b.InvalidPointer,this.jsvTextEmoji=b.InvalidInt32,this.jsvTextLatex=b.InvalidInt32,this.jsvTextAlignMinWidth=b.InvalidInt32,this.jsvTextVerticalAlign=b.InvalidPointer,this.jsvTextLineAlign=b.InvalidPointer,this.jsvTextInnerDirection=b.InvalidPointer}},"Text"),w.Name="text",C(y=class{constructor(){this.animation=b.InvalidPointer,this.transition=b.InvalidPointer,this.animationFillMode="none"}},"Motion"),y.Name="motion";class F{static JsvDeclarePrototype(){for(let e in I){let t=I[e];for(let e in t){let s=t[e];if("string"!=typeof s)continue;const i={set:function(e){this.setProperty(s,e)},get:function(){return this.getPropertyValue(s)}};Object.defineProperty(F.prototype,s,i)}}}constructor(e){this.cachedProps={},this.nativeId=e}setProperty(e,t){if(window.JsvCode.Dom.CheckStyleFormat?.(e,t),e==I.Background.BackgroundImage&&"string"==typeof t)if(0==t.indexOf("linear-gradient")){const e=t.match(/\(/g)?.length,s=t.match(/\)/g)?.length;e!=s&&(console.error(`StyleError: illegal linear-gradient value '${t}'`),t="")}else{t=new N(t).href}else if(e==I.Effect.BorderImage&&"string"==typeof t){const e=t.split(" ");e.length>0&&(e[0]=new N(e[0]).href),t=e.join(" ")}else e==I.Effect.Display&&(this.cachedProps[e]=t);E.Dom.SetStyleProperty(this.nativeId,e,t)}getPropertyValue(e){if(e==I.Effect.Display)return this.cachedProps[e];throw console.error("StyleDeclaration.getPropertyValue() propName="+e),new Error("Get style value is unimplemented because it's low performance.")}jsvGetProperties(...e){const t=JSON.stringify(e),s=E.Dom.GetStyleProperties(this.nativeId,t);return JSON.parse(s)}}class P extends t{constructor(e){super(e)}}class L extends S{static JsvEnableEventListener(){E.Dom.EnableEventListener((function(e,t,...s){let i=L.JsvEventListenerMap.get(e);const n=i?.get(t);n?.(t,...s)}))}constructor(e){super(S.ELEMENT_NODE),this.jsvNativeId=-1,this.jsvAttrStore={},this.jsvClientSizeStore={},this.tagName=e,this.tagName!=L.JsvTagName.Audio&&this.tagName!=L.JsvTagName.Div&&this.tagName!=L.JsvTagName.Image&&this.tagName!=L.JsvTagName.Video&&this.tagName!=L.JsvTagName.JsvFDiv||(this.jsvNativeId=x.GenerateId(),this.style=new F(this.jsvNativeId),E.Dom.CreateElement(this.jsvNativeId,e))}appendChild(e){e.parentNode?this.moveChildNode(e,null):(super.appendChild(e),this.jsvInsertChild(e,null))}removeChild(e){super.removeChild(e),this.jsvRemoveChild(e),e instanceof L&&e.jsvNativeId>0&&E.Dom.RemoveElementChild(this.jsvNativeId,e.jsvNativeId)}insertBefore(e,t){e.parentNode?e.parentNode==this?(this.jsvMoveChildReOrder(e,t),this.jsvReOrderChildNode(e,t)):this.moveChildNode(e,t):(super.insertBefore(e,t),this.jsvInsertChild(e,t))}addEventListener(e,t,s){const i=this.jsvGetEventListenerSet(e);i?.has(t)?console.warn("Element.addEventListener() Faild to add listener, func is exists"):(s=this.jsvCheckEventOptions(s),this.jsvNativeId&&(this.jsvAddListener(this.jsvNativeId,e),E.Dom.AddElementEventListener(this.jsvNativeId,e,s)),super.addEventListener(e,t,s))}removeEventListener(e,t,s){const i=this.jsvGetEventListenerSet(e);0!=!!i?.has(t)&&(s=this.jsvCheckEventOptions(s),super.removeEventListener(e,t,s),this.jsvNativeId&&(this.jsvRemoveListener(this.jsvNativeId,e),E.Dom.RemoveElementEventListener(this.jsvNativeId,e,s)))}get childElementCount(){return this.childNodes.length}get firstElementChild(){return this.childNodes.length>0?this.childNodes?.[0]:null}get lastElementChild(){const e=this.childNodes.length;return e>0?this.childNodes[e-1]:null}set className(e){this.setAttribute("class",e)}get clientWidth(){return this.jsvClientSizeStore.clientWidth||(this.jsvClientSizeStore.clientWidth=E.Dom.GetElementAttribute(this.jsvNativeId,"clientWidth")),this.jsvClientSizeStore.clientWidth}get clientHeight(){return this.jsvClientSizeStore.clientHeight||(this.jsvClientSizeStore.clientHeight=E.Dom.GetElementAttribute(this.jsvNativeId,"clientHeight")),this.jsvClientSizeStore.clientHeight}setAttribute(e,t){e&&(this.jsvAttrStore[e]=t,this.jsvNativeId&&(e.startsWith("data-jsv-vw-")?E.Dom.SetForgeViewInnerProps(this.jsvNativeId,e,t):"class"===e||e.startsWith("data-v-")||e.startsWith("data-jsv")||e.startsWith("dataJsv")?E.Dom.SetElementAttribute(this.jsvNativeId,e,t):"id"===e&&E.Dom.SetForgeViewInnerProps(this.jsvNativeId,"data-jsv-vw-id",t)))}removeAttribute(e){delete this.jsvAttrStore[e],("class"==e||e.startsWith("data-v-")||"src"==e)&&this.jsvNativeId&&E.Dom.SetElementAttribute(this.jsvNativeId,e,null)}getAttribute(e){return this.jsvAttrStore[e]}hasAttribute(e){return!!this.jsvAttrStore[e]}focus(){document.activeElement&&document.activeElement.onfocus();let e=document.activeElement;if(document.activeElement=this,e){let t=new n(n.JsvType.Blur);t.target=e,document.dispatchEvent(t)}let t=new n(n.JsvType.Focus);document.dispatchEvent(t)}jsvGetBoundingClientRect(){const e="jsv-getbound",t=x.GenerateId();return new Promise(((s,i)=>{const n=o=>{const r=o.jsvParams?.[1];if(r!=t)return;o.preventDefault(),this.removeEventListener(e,n);const a=JSON.parse(o.jsvParams?.[0]??"{}");0===a.status?s(a.data):i(a.error)};this.addEventListener(e,n,{jsvtoken:t})}))}jsvSetOnLazyTaskSyncedListener(e){E.Dom.AppendLazyTaskSyncedListener(this.jsvNativeId,e)}jsvOnEvent(e,...n){let o;e.startsWith("animation")?(o=new s(e),o.animationName=n[0]):e.startsWith("transition")?(o=new P(e),o.propertyName=n[0]):e.startsWith("jsv")?(o=new i(e),o.options={detail:n[0]},o.jsvParams=n):"click"==e&&(o=new t(e),o.target=this),o&&(o.target=this,this.dispatchEvent(o))}jsvGetProxyView(e){return e?(this.maskViewProxy||(this.maskViewProxy=T.NewDomProxyView(this.jsvNativeId,!0)),this.maskViewProxy):(this.mainViewProxy||(this.mainViewProxy=T.NewDomProxyView(this.jsvNativeId,!1)),this.mainViewProxy)}jsvGetProxyTexture(e){return this.mainViewTextureProxy||(this.mainViewTextureProxy=e.GetDomProxyTexture(this.jsvNativeId)),this.mainViewTextureProxy}jsvGetRelativePosition(e){return E.Dom.GetRelativePosition(this.jsvNativeId,e.jsvNativeId)}jsvAddListener(e,t){let s=L.JsvEventListenerMap.get(e);s||(s=new Map,L.JsvEventListenerMap.set(e,s));this.jsvGetEventListenerSet(t)||s.set(t,this.jsvOnEvent.bind(this))}jsvRemoveListener(e,t){let s=L.JsvEventListenerMap.get(e);if(!s)return;this.jsvGetEventListenerSet(t)||s.delete(t)}moveChildNode(e,t){console.log("Do move child node");let s=e.parentNode;s.jsvMoveChildToNewParent(e,this,t),this.jsvMoveChildNode(s,e,t)}jsvMoveChildNode(e,t,s){t.jsvNativeId&&(s=L.JsvFindBackwardForgeView(s),E.Dom.MoveElementChild(this.jsvNativeId,e.jsvNativeId,t.jsvNativeId,s?.jsvNativeId))}jsvReOrderChildNode(e,t){e.jsvNativeId&&(t=L.JsvFindBackwardForgeView(t),E.Dom.ReOrderElementChild(this.jsvNativeId,e.jsvNativeId,t?.jsvNativeId))}jsvInsertChild(e,t){e.parentNode=this,e.nodeType===S.TEXT_NODE?this.textContent=e.nodeValue:e instanceof L&&e.jsvNativeId>0&&(t=L.JsvFindBackwardForgeView(t),E.Dom.InsertElementChild(this.jsvNativeId,e.jsvNativeId,t?.jsvNativeId))}jsvRemoveChild(e){if(e instanceof L!=0){for(const t of e.childNodes)e.jsvRemoveChild(t);e.jsvFinalize(),E.Dom.RemoveLazyTaskSyncedListener(e.jsvNativeId),L.JsvEventListenerMap.delete(e.jsvNativeId)}}jsvCheckEventOptions(e){if(null==e)return null;if("object"!=typeof e||e instanceof Array)return console.warn("Event options is invalid for ",e),null;const t=["capture","once","passive","signal"];for(const[s,i]of Object.entries(e))0==t.includes(s)&&0==s.startsWith("jsv")&&(console.warn("Event options name is invalid: ",s),delete e[s]),"boolean"==typeof i?e[s]=+e[s]:"number"!=typeof i&&(console.warn("Event options value is invalid: ",i),delete e[s]);return e}static JsvFindBackwardForgeView(e){let t=e;for(;t&&!(t instanceof L);)t=t.nextSibling;return t}}L.JsvTagName={Anchor:"A",Audio:"AUDIO",Div:"DIV",Head:"HEAD",Image:"IMG",IFrame:"IFRAME",Link:"LINK",Script:"SCRIPT",Style:"STYLE",Svg:"SVG",Video:"VIDEO",JsvAudioTrack:"JSV-AUDIOTRACK",JsvFDiv:"FDIV"},L.JsvEventListenerMap=new Map;class k extends L{constructor(){super(L.JsvTagName.Anchor),this.href="",this.protocol="",this.host="",this.search="",this.hash="",this.hostname="",this.port="",this.pathname="",console.warn("Warnig: <a> is fake in JsView system")}jsvGetTagName(){return L.JsvTagName.Anchor}}class R extends S{constructor(e){super(S.COMMENT_NODE),this.textContent=e}}class M extends L{constructor(){super(L.JsvTagName.Div),this.textContentStore=null}get textContent(){return this.textContentStore}set textContent(e){this.textContentStore=e,this.jsvClientSizeStore={},E.Dom.SetElementText(this.jsvNativeId,e)}}const j="FocusDebug",_="__AppRoot__";let O=!1,J=!1;function B(e,t){let s=function(e){let t="";if(e){let s=e,i=s.RouterDelegate?.ref?.NameSpace;for(i=i==_?"":i,t=`[${i?i+", ":""}${s.BranchName}]`,s=s.GetParentPage();s;)i=s.RouterDelegate?.ref?.NameSpace,i=i==_?"":i,t=`[${i?i+", ":""}${s.BranchName}]->`+t,s=s.GetParentPage()}return t}(e);if(t.stack){let e=t.stack.split("\n");e.length>=3&&(t.stack=e.slice(2,6))}let i="";for(let e of t.stack)i+=e+"\n";delete t.stack,console.log(j,`focusChange(${t?.from}):${t?.askName}\n:focusStack:${s}\n:trace:${i}:`,t)}class A{constructor(e,t){this._DefaultFocusNameSpace=null,this._DefaultFocusNameSpace=null,this.RouterDelegate={ref:null},e||(this.RouterDelegate.ref=new V(!1,t))}enableFocusTrace(e){O=!0,J=e}getNameSpace(){let e=this.RouterDelegate.ref.NameSpace;return e==_?"":e}wrapWithNameSpace(e){let t=new A(!0);return t._DefaultFocusNameSpace=e,t.RouterDelegate=this.RouterDelegate,t}getNodeByName(e){return this.RouterDelegate.ref.getNodeByName(e)}focusByNameBeforeMount(e,t,s){if("string"==typeof e)return e.includes(".")&&(e=e.split(".")),this.RouterDelegate.ref.focusBeforeMount(e,t,s);console.error(`setFocus name=${e} is invalid`)}setFocus(e,t){this._DefaultFocusNameSpace&&this._DefaultFocusNameSpace.length>0&&(e=`${this._DefaultFocusNameSpace}.${e}`);let s=null;O&&(s={askName:e,deepToChild:t,from:"setFocus",stack:J?new Error("simulate-stack").stack:null});return this.focusByNameBeforeMount(e,t,s)}printAllFocusable(){this.RouterDelegate.ref.printAllFocusRecursive(this._DefaultFocusNameSpace,"")}getCurrentFocusStack(){const e=[];if(this.RouterDelegate.ref){let t=this.RouterDelegate.ref.getCurrentFocusNode();for(;t&&t instanceof W;){let s=t.RouterDelegate?.ref?.NameSpace;e.push({nameSpace:s==_||s==t.BranchName?"":s,name:t.BranchName}),t=t.GetParentPage()}}else console.error("getCurrentFocusStack failed: router delegate is null.");return e}getLastFocus(){if(W.sLastFocus){let e=W.sLastFocus;for(;e._LatestFocusChild;)e=e._LatestFocusChild;return e.BranchName}return null}getCurrentFocus(){if(this.RouterDelegate.ref){const e=this.RouterDelegate.ref.getCurrentFocusNode();if(e)return e.BranchName}return null}getDeactivedPageFocus(){return this.RouterDelegate.ref?this.RouterDelegate.ref.getDeactivePageFocusName():null}returnFocusToParent(){const e=this.RouterDelegate.ref.getCurrentFocusNode();e?e.ReturnFocusToParent():console.warn("returnFocusToParent: current focus node is null.")}}class V{constructor(e,t){this._ChildMap={},this._FocusNameBeforeMount=null,this._BeforeMountStack=null,this._FocusNodeName=null,this._IsTemp=!!e,this.NameSpace=t}getDeactivePageFocusName(){return this._FocusNodeName}getCurrentFocusNode(){if(null==this._FocusNodeName)return null;let e=this._ChildMap[this._FocusNodeName];if(!e)return console.error("Erorr: node not mounted name="+this._FocusNodeName),null;if(e.RouterDelegate.ref!=this){let t=e.RouterDelegate.ref.getCurrentFocusNode();return null==t?e:t}return e}getNodeByName(e,t){let s=e.split(".");return this._FindRouterSearchBase(s,t)._GetNodeFromPathArray(s,e)}printAllFocusRecursive(e,t){let s=this.NameSpace==_?"":this.NameSpace,i=t+(t&&t.length>0?".":"")+s;for(let t in this._ChildMap){let s=this._ChildMap[t];if(!e||0==e.length||i.indexOf(e)>=0){let e=i===_?t:i+"."+t;console.log(e,s)}s.RouterDelegate.ref!=this&&s.RouterDelegate.ref.printAllFocusRecursive(e,i)}}_FindRouterSearchBase(e,t){if(0==e[0].length){let t,s;for(let e in this._ChildMap){t=this._ChildMap[e];break}do{s=t,t=t.GetParentPage()}while(null!=t);return e.splice(0,1),s.RouterDelegate.ref}return t&&t.AsHub&&t.GetParentPage()?t.GetParentPage().RouterDelegate.ref:this}_GetNodeFromPathArray(e,t){let s=0,i=this;for(;s<e.length-1;){let n=!1;for(let t in i._ChildMap){let o=i._ChildMap[t].RouterDelegate.ref;if(o!=i&&o.NameSpace==e[s]){i=o,s++,n=!0;break}}if(!n)return void console.error(`Error: no found subpath fname=${t}`)}let n=e[s];return i._ChildMap.hasOwnProperty(n)?i._ChildMap[n]:void console.error(`Error: no found fname=${t}`)}add(e,t){if(e.indexOf(".")>=0)console.error("ERROR: FDiv name can not contains '.'");else if(this._ChildMap.hasOwnProperty(e)&&this._ChildMap[e]!==t)console.error(`ERROR: FDiv router branch name duplicated:[${e}]`);else if(this._ChildMap[e]=t,this._FocusNameBeforeMount)if("string"==typeof this._FocusNameBeforeMount)this._FocusNameBeforeMount==e&&t.RouterDelegate.ref.focusBeforeMount(this._FocusNameBeforeMount,!1,this._BeforeMountStack);else{this._FocusNameBeforeMount[0]==e&&t.RouterDelegate.ref.focusBeforeMount(this._FocusNameBeforeMount.slice(1),!1,this._BeforeMountStack)}}remove(e,t,s,i){let n=this._ChildMap[e];n&&n==t&&(delete this._ChildMap[e],n.OnRemoveFromTree()),this._FocusNodeName==e&&s&&(i||(this._FocusNodeName=s))}rename(e,t){if(!this._ChildMap.hasOwnProperty(e))return void console.error(`ERROR: alter name failed ${e}->${t}`);let s=this._ChildMap[e];delete this._ChildMap[e],this.add(t,s),this._FocusNodeName==e&&(this._FocusNodeName=t)}clearChildFocus(){this._FocusNodeName=null,this._FocusNameBeforeMount=null}hasPendingFocusRequest(){return!this._FocusNameBeforeMount}focusBeforeMount(e,t,s){O&&!s&&console.error(j,`Error: found debug info missing from ${new Error("simulate-stack").stack}`);let i=!1;if("string"==typeof e){if(!e.includes(".")){i=!0;let n=this._ChildMap[e];if(this._FocusNodeName=e,n){this._FocusNameBeforeMount=null,this._BeforeMountStack=s,n.Focus(!t);let e=n.GetFocusChild();for(;e;){let t=e.GetFocusChild();if(!t){this._FocusNodeName=e.BranchName;break}e=t}return O&&B(e??n,s),n.RouterDelegate.ref!=this&&n.RouterDelegate.ref.clearChildFocus(),!0}return this._FocusNameBeforeMount=e,this._BeforeMountStack=s,!1}console.error("error: name contain .")}else if("object"==typeof e&&Array.isArray(e)&&e.length>0){if(i=!0,1==e.length)return this.focusBeforeMount(e[0],t,s);{let i=e[0],n=this._ChildMap[i];return this._FocusNodeName=i,n?n.RouterDelegate.ref.focusBeforeMount(e.slice(1),t,s):(this._FocusNameBeforeMount=e,this._BeforeMountStack=s,!1)}}return i||console.error("illegal name param",e),!1}focus(e,t,s){let i=this.focusBeforeMount(e,t,s);return i||console.log("No found branch:"+e),i}forEach(e){for(let t in this._ChildMap)e(this._ChildMap[t],t,this._ChildMap)}printNodes(){console.log(this._ChildMap)}}class W extends T.PageBase{constructor(e){super(e),this._OnKeyDown=null,this._OnKeyUp=null,this._OnFocus=null,this._OnBlur=null,this._DispatchKeyDown=null,this._DispatchKeyUp=null,this._OnCustomEvent=null,this._DKeyDownProxy=void 0,this._DKeyUpProxy=void 0,this._Mounted=!1,this._MountWaitingList=null,this.AsHub=!1,this.InterfaceHub=null,this._TmpRouter=null,this._AutoShow=null,this.BranchName=e,this.RouterDelegate={ref:null},this._TmpRouter=null,this._OriginDispatchKeyDown=this._OriginDispatchKeyDown.bind(this),this._OriginDispatchKeyUp=this._OriginDispatchKeyUp.bind(this),this._AutoShow=!1}async waitMounted(){if(this._Mounted)return;let e=this;return new Promise(((t,s)=>{e._MountWaitingList||(e._MountWaitingList=[]),e._MountWaitingList.push(t)}))}updateMountState(){this._Mounted=!0;let e=this.SubPages;for(let t in e)e[t].updateMountState();if(this._MountWaitingList&&this._MountWaitingList.length>0){for(const e of this._MountWaitingList)e();this._MountWaitingList=null}}getHub(){return this.InterfaceHub||(this.InterfaceHub=new A(!0),this.InterfaceHub.RouterDelegate=this.RouterDelegate),this.InterfaceHub}setHub(e){this.RouterDelegate.ref?console.error("Error: hub is already setted."):(this.RouterDelegate.ref=e.RouterDelegate.ref,this.AsHub=!0)}_UseParentRouter(e){this.RouterDelegate=e,this.InterfaceHub&&(this.InterfaceHub.RouterDelegate=e)}routerAdd(e,t){t.RouterDelegate.ref||t._UseParentRouter(this.RouterDelegate),this.RouterDelegate.ref||(this.RouterDelegate.ref=new V(!0)),this.RouterDelegate.ref.add(e,t)}routerRenameChild(e,t){this.RouterDelegate.ref.rename(e,t)}routerUnbind(e,t){let s;this.AsHub?this.GetParentPage()&&(s=this.GetParentPage().RouterDelegate.ref):s=this.RouterDelegate.ref,s&&s.remove(this.BranchName,this,e,t),this.RouterDelegate={ref:null}}setBranchName(e){if(e===this.BranchName)return;let t=this.BranchName;this.BranchName=e,this.PageName=e,this._ParentPage&&this._ParentPage.routerRenameChild(t,e)}static safeCallback(e){return e&&e instanceof Function?function(...t){try{return e(...t)}catch(t){console.error("FocusNode: callback error",e.name,t)}}:null}setOnKeyDown(e){this._OnKeyDown=W.safeCallback(e)}setOnKeyUp(e){this._OnKeyUp=W.safeCallback(e)}setOnFocus(e){this._OnFocus=W.safeCallback(e)}setOnBlur(e){this._OnBlur=W.safeCallback(e)}setDispatchKeyUp(e){this._DispatchKeyUp=W.safeCallback(e)}setDispatchKeyDown(e){this._DispatchKeyDown=W.safeCallback(e)}setOnCustomEvent(e){this._OnCustomEvent=W.safeCallback(e)}setDispatchKeyProxy(e,t){this._DKeyDownProxy=W.safeCallback(e),this._DKeyUpProxy=W.safeCallback(t)}requestFocus(e){let t=null;O&&(t={askName:this.BranchName,deepToChild:e,from:"requestFocus",stack:J?new Error("simulate-stack").stack:null}),this.requestFocusInner(e,t)}ReturnFocusToParent(){if(this.IsFocus()){let e=this.GetParentPage();if(e){const t=e.BranchName;let s=null;O&&(s={askName:t,deepToChild:!1,from:"returnFocusToParent",stack:J?new Error("simulate-stack").stack:null}),e.RouterDelegate.ref.focus(t,!1,s)}}else super.ReturnFocusToParent()}requestFocusInner(e,t){let s=this.RouterDelegate.ref;return this.AsHub&&this.GetParentPage()&&(s=this.GetParentPage().RouterDelegate.ref),s?s.focus(this.BranchName,e,t):(console.error("error: lost router"),!1)}OnKeyDown(e){return!!this._OnKeyDown&&this._OnKeyDown(e)}OnKeyUp(e){return!!this._OnKeyUp&&this._OnKeyUp(e)}OnCustomEvent(e){return!!this._OnCustomEvent&&this._OnCustomEvent(e)}bubbleCustomEvent(e){this.BubbleCustomEvent(e)}dispatchKeyDown(e){return this.DispatchKeyDown(e)}DispatchKeyDown(e){return this._DKeyDownProxy?this._DKeyDownProxy(e,this._OriginDispatchKeyDown):this._OriginDispatchKeyDown(e)}_OriginDispatchKeyDown(e){let t=!1;return this._DispatchKeyDown&&(t=this._DispatchKeyDown(e)),!!t||super.DispatchKeyDown(e)}dispatchKeyUp(e){return this.DispatchKeyUp(e)}DispatchKeyUp(e){return this.__DKeyUpProxy?this.__DKeyUpProxy(e,this._OriginDispatchKeyUp):this._OriginDispatchKeyUp(e)}_OriginDispatchKeyUp(e){let t=!1;return this._DispatchKeyUp&&(t=this._DispatchKeyUp(e)),!!t||super.DispatchKeyUp(e)}attachToActivity(e,t){this.AttachToActivity(e,t)}AttachToActivity(e,t){super.SetParent(e,t)}setParent(e){this.SetParent(e)}SetParent(e){if(null!=e&&(super.SetParent(e,null),this._ParentPage._Mounted&&(this.updateMountState(),z()),e instanceof W)){if(this.RouterDelegate.ref&&this.RouterDelegate.ref._IsTemp){let t=this.RouterDelegate.ref;this.RouterDelegate.ref=null,t.forEach(((t,s)=>{e.routerAdd(s,t)}))}e.routerAdd(this.BranchName,this)}}focus(e){this.Focus(e)}Focus(e){if(!this._Mounted)return W.sFocusMemos.push({obj:this,bcf:e}),void console.log("page base tree not build, cache focus");super.Focus(e)}OnFocus(){this._OnFocus&&this._OnFocus()}OnBlur(){W.sLastFocus=this,this._OnBlur&&this._OnBlur()}onUnMount(e){W.sLastFocus==this&&(W.sLastFocus=null);let t=this.IsFocus();if(O&&t){let t=this.GetParentPage();if(t){let s=null;s={askName:t.BranchName,deepToChild:!1,from:e?"deactive":"unmount",stack:J?new Error("simulate-stack").stack:null},B(t,s)}}let s=this.GetParentPage();s&&s.RemoveSubPage(this),this.ClearSubPages(),this.routerUnbind(s?.BranchName,e),this._Mounted=!1}getFullName(){let e=this,t=[this.RouterDelegate.ref.NameSpace];this.AsHub||t.push(this.BranchName);let s=this.RouterDelegate.ref;do{if(e=e.GetParentPage(),t[0]==_)break;e&&e.RouterDelegate.ref!=s&&(s=e.RouterDelegate.ref,t.unshift(s.NameSpace))}while(e);return t[0]==_?t.shift():console.error("ERROR: missing app root"),t.join(".")}getNodeByName(e){return this.RouterDelegate.ref.getNodeByName(e,this)}}W.sFocusMemos=[],W.sLastFocus=null,W.sRootPageNode=null;let z=()=>{let e=W.sFocusMemos.length;if(e>0){let t=W.sFocusMemos;W.sFocusMemos=[];for(let s=0;s<e;s++)t[s].obj.Focus(t[s].bcf)}},G={};class K{constructor(e,t,s){this._Element=s,G.hasOwnProperty(e)&&console.error(`Warn: FDivRoot duplicate name=${e}`),G[e]=this,this._DoInit(t)}_DoInit(e){let t=this._Element.FocusNodeRef;this._Element.setAttribute("new-namespace","__AppRoot__"),e&&t.setDispatchKeyProxy(e.keyDown,e.keyUp),window.JsView?t.attachToActivity(window.JsvCode.ForgeHandles.RootActivity,window.JsvCode.ForgeHandles.RootView):(window.addEventListener("keydown",(e=>{var s=document.activeElement?.tagName;s&&"input"===s.toLowerCase()||(t.dispatchKeyDown(e),e.preventDefault&&e.preventDefault())})),window.addEventListener("keyup",(e=>{var s=document.activeElement?.tagName;s&&"input"===s.toLowerCase()||(t.dispatchKeyUp(e),e.preventDefault&&e.preventDefault())})))}getElement(){return this._Element}getHub(){return this._Element.jsvGetHub()}onMounted(){this._Element.FocusNodeRef.updateMountState(),z()}}class U extends L{constructor(){super(L.JsvTagName.Image)}setAttribute(e,t){if("src"===e){t=new N(t).href,this.jsvClientSizeStore={}}super.setAttribute(e,t),this.jsvNativeId&&"src"===e&&E.Dom.SetElementAttribute(this.jsvNativeId,e,t)}jsvOnEvent(e,...s){let i;super.jsvOnEvent(e,...s),"load"==e&&(i=new t(e),i.target=this),i&&this.dispatchEvent(i)}}class H extends L{constructor(){super(L.JsvTagName.Link)}setAttribute(e,t){this[e]=t}jsvLoadResource(){let e=!1,t=null;if(null!=this.href){var s=new N(this.href);console.log("Ignore to load link from url="+s.href),e=!0}else console.warn("Failed to load link, href is not exists."),t="NoSrc";this.jsvOnLoadResult(e,t)}jsvOnLoadResult(e,s){if(console.log("Load link result: isSuccess:"+e+", errCode:"+s),e){if(this.onload){let e=new t("load");this.onload(e)}}else this.onerror&&this.onerror({type:"jsvErr_"+s,target:this})}}class $ extends L{constructor(){super(L.JsvTagName.Script)}setAttribute(e,t){this[e]=t}jsvLoadResource(){if(null!=this.src){var e=new N(this.src);console.log("Load script with url="+e.href);var t=this;window.JsView.runJsWithUrl(e.href,!1,((e,s)=>{t.jsvOnLoadResult(e,s)}))}}jsvOnLoadResult(e,s){if(console.log("Load script result: isSuccess:"+e+", errCode:"+s),e){if(this.onload){let e=new t("load");this.onload(e)}}else this.onerror&&this.onerror({type:"jsvErr_"+s,target:this})}}class q extends L{constructor(){super(L.JsvTagName.Style),this.jsvAttrStore={left:0,top:0,width:0,height:0}}}class X extends L{constructor(){super(L.JsvTagName.Svg)}}class Y extends S{constructor(e){super(S.TEXT_NODE),this.textContent=e}get nodeValue(){return this.textContent}set nodeValue(e){this.textContent=e,this.parentNode&&(this.parentNode.textContent=this.textContent)}}let Z=1;class Q extends L{constructor(){super(L.JsvTagName.JsvFDiv),this.FocusNodeRef=new W("unnamed-"+Z++),this.hubRef=void 0}setAttribute(e,t){if(e)if("fname"===e)t&&this.FocusNodeRef.setBranchName(t);else if("new-namespace"===e&&""!==t&&!this.hubRef){let e=new A(!1,t);this.hubRef=e,this.FocusNodeRef.setHub(e),this.FocusNodeRef.setBranchName(t)}}removeAttribute(e){}jsvGetHub(){return this.hubRef}}class ee extends S{constructor(){super(S.DOCUMENT_NODE),this.location=window.location,this.rootElement=new M,this.rootElement.ownerDocument=this,this.rootElement.id="root",E.Dom.BindElementToRootView(this.rootElement.jsvNativeId),this.activeElement=this.rootElement,this.head=null}createComment(e){return new R(e)}createElement(e){switch(e=e.toUpperCase()){case L.JsvTagName.Anchor:return new k;case L.JsvTagName.Div:return new M;case L.JsvTagName.Image:return new U;case L.JsvTagName.Link:return new H;case L.JsvTagName.Script:return new $;case L.JsvTagName.Style:return new q;case L.JsvTagName.Svg:return new X;case L.JsvTagName.JsvFDiv:return new Q;case L.JsvTagName.IFrame:console.error("Unsupported element: "+e+". Your vue compilation may may have failed, please check it first.")}if("TEMPLATE"==e)return{};throw new TypeError("Unimplemented element: "+e)}createEvent(e){return"CUSTOMEVENT"===(e=e.toUpperCase())?new i(e):new t(e)}createTextNode(e){return new Y(e)}getElementById(e){if("root"===e||"app"===e)return this.rootElement;throw new DOMException("Failed to get element by id, id="+e+" is UNIMPLEMENTED.")}getElementsByTagName(e){if((e=e.toUpperCase())===L.JsvTagName.Head)return[this.head];if(e===L.JsvTagName.Link||e===L.JsvTagName.Script||e===L.JsvTagName.Style)return[];throw new DOMException("Failed to get element by name, name="+e+" is UNIMPLEMENTED.")}querySelector(e){if("root"===e||"#app"===e)return this.rootElement;if("head"===e)return this.head;if("base"===e)return null;if("title"===e)return null;if(e.startsWith("style[")&&e.endsWith("]"))return null;throw new DOMException("Failed to query selector, selectors="+e+" is UNIMPLEMENTED.")}querySelectorAll(e){return[]}jsvInitFDivRoot(e,t,s){if(!s){let e=document.createElement("fdiv");this.rootElement.appendChild(e),this.rootElement=e,s=this.rootElement}return new K(e,t,s)}}class te extends L{constructor(){super(L.JsvTagName.Head)}appendChild(e){super.appendChild(e),(e instanceof H||e instanceof $)&&e.jsvLoadResource()}removeChild(e){super.removeChild(e)}}class se{constructor(){this.ready=!1,this.callbacks=[]}listenToReady(e){this.ready?e?.():this.callbacks.push(e)}dataReady(){this.ready=!0;for(let e of this.callbacks)e?.()}}class ie extends se{constructor(){super(),this.TextureManager=null,this.RootActivity=null,this.RootView=null}setHandles(e,t,s){this.TextureManager=e,this.RootActivity=s,this.RootView=t,this.dataReady()}}let ne="@keyframes";class oe{constructor(e){this._AnchorTag=e,this._NamesCache=new Set}insertRule(e){let t=this.getName(e);this._NamesCache.has(t)&&console.warn(`Warn: keyframe replace of name ${t}`),this._NamesCache.add(t),E.Dom.InsertKeyFrame(t,e)}hasRule(e){return this._NamesCache.has(e)}removeRule(e){this._NamesCache.has(e)?(this._NamesCache.delete(e),E.Dom.RemoveKeyFrame(e)):console.error(`Error: keyFrame(${e}) is not exist.`)}removeMultiRules(e){for(let t of e)this.removeRule(t)}getName(e){let t=e.indexOf(ne)+10,s=e.indexOf("{");return e.substring(t,s).trim()}}let re=null;function ae(e){return re||(re={global:new oe("global")}),re.global}class le{static EnsureGlobalEnv(e,t){const s=window.navigator?.userAgent?.toLowerCase();window.jsvInAndroidWebView=s?.indexOf("android")>=0,le.EnsureGlobalJsvCode(e,t),L.JsvEnableEventListener(),F.JsvDeclarePrototype()}static EnsureGlobalJsvCode(e,t){window.JsvCode.Dom||(window.JsvCode.Dom={}),window.JsvCode.Media||(window.JsvCode.Media={}),window.JsvCode.Dom.PlatformBridge||(window.JsvCode.Dom.PlatformBridge=e),window.JsvCode.Media.PlatformBridge||(window.JsvCode.Media.PlatformBridge=t),window.JsvCode.Dom.DeclareStyleSheets||(window.JsvCode.Dom.DeclareStyleSheets=E.Dom.DeclareStyleSheets),window.JsvCode.Dom.UndeclareStyleSheets||(window.JsvCode.Dom.UndeclareStyleSheets=E.Dom.UndeclareStyleSheets),window.JsvCode.Dom.getKeyFrameGroup||(window.JsvCode.Dom.getKeyFrameGroup=ae),window.JsvCode.ForgeHandles||(window.JsvCode.ForgeHandles=new ie)}}class he{static SetLevel(e){switch(he.E=he.W=he.I=he.D=function(){},e){case he.Level.Verbose:he.V=console.debug.bind(console);case he.Level.Debug:he.D=console.debug.bind(console);case he.Level.Info:he.I=console.info.bind(console)}}}he.E=console.error.bind(console),he.W=console.warn.bind(console),he.I=console.info.bind(console),he.D=function(){},he.V=function(){},he.Level={Error:0,Warning:1,Info:2,Debug:3,Verbose:4};class ce{constructor(e){this.callback=e}observe(e,t){if(!(e instanceof S))throw Error("TypeError: Failed to execute 'observe' on 'MutationObserver': parameter 1 is not of type JsView's 'Node'");for(const e of Object.keys(t))"childList"==e||console.warn("JsView: only childList config is supported! ignore "+e);t.childList&&e.jsvObserveChildChanged((()=>{this.callback?.()}))}disconnect(){this.callback=void 0}}class de extends ee{constructor(){super(),this.head=new te}set cookie(e){window.__JsvCookies.setCookie(e)}get cookie(){return window.__JsvCookies.getCookie()}}class ue{static DeclareGlobal(){ue.DeclareDocument(),ue.DeclareOthers(),ue.DeclareAddition()}static DeclareDocument(){window.document=new de}static DeclareOthers(){window.MutationObserver=ce,window.Element=L,window.SVGElement=X;let e=new N(window.JsView.getAppUrl(),!0);window.location.applyUrlInfo?window.location.applyUrlInfo(e):window.location=e,window.history={},window.navigator={userAgent:"jsview-runtime",platform:"jsview"}}static DeclareAddition(){window.JsView.Dom={Render:null,Extension:null,UrlRef:N}}}class ve{constructor(e){this.activity=new T.ReactActivity("NativeForgeActivity",e,null,null),this.init()}init(){console.log("create NativeForgeActivity.");let e=new T.LayoutView;window.JsvCode.ForgeHandles.setHandles(this.activity.GetTextureManager(),e,this.activity);let t=null;T.DesignMap&&(t=T.DesignMap());let s=t?t.width:1280,i=Math.floor(9*s/16);this.activity.SetContentView(e,{x:0,y:0,width:s,height:i}),T.sRenderBridge.AddWillSwapListener("forgeSwap",(()=>{E.Dom.RequestSwapAllCachedTasks()})),window.JsView.Dom.Render()}}class me{constructor(e){this.activityManager=e;let t=new ve(e);e.RegisterActivity(t.activity),e.StartActivity(new T.Intent("NativeForgeActivity"))}}window.jsvIsBrowserDebug=!1;const fe=window.JsvCode.NativePlatformDomBridge,pe=window.JsvCode.NativePlatformMediaBridge;function ge(){le.EnsureGlobalEnv(fe,pe),ue.DeclareGlobal(),he.I("Using JsView Native Environment.")}export{ge as InitEnv,me as NativeForgeApp};
|
|
2
2
|
|
package/package.json
CHANGED
|
@@ -1,8 +1,30 @@
|
|
|
1
1
|
diff --git a/node_modules/@originjs/vite-plugin-federation/dist/index.js b/node_modules/@originjs/vite-plugin-federation/dist/index.js
|
|
2
|
-
index 980b8e3..
|
|
2
|
+
index 980b8e3..534e796 100644
|
|
3
3
|
--- a/node_modules/@originjs/vite-plugin-federation/dist/index.js
|
|
4
4
|
+++ b/node_modules/@originjs/vite-plugin-federation/dist/index.js
|
|
5
|
-
@@ -
|
|
5
|
+
@@ -301,11 +301,20 @@ function createRemotesMap(remotes) {
|
|
6
|
+
return `'${external}'`;
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
+// JsView Modified >>>
|
|
10
|
+
+// return `const remotesMap = {
|
|
11
|
+
+// ${remotes.map(
|
|
12
|
+
+// (remote) => `'${remote.id}':{url:${createUrl(remote)},format:'${remote.config.format}',from:'${remote.config.from}'}`
|
|
13
|
+
+// ).join(",\n ")}
|
|
14
|
+
+// };`;
|
|
15
|
+
return `const remotesMap = {
|
|
16
|
+
${remotes.map(
|
|
17
|
+
(remote) => `'${remote.id}':{url:${createUrl(remote)},format:'${remote.config.format}',from:'${remote.config.from}'}`
|
|
18
|
+
).join(",\n ")}
|
|
19
|
+
-};`;
|
|
20
|
+
+};;
|
|
21
|
+
+window.JsvCode.Federation = { remotesMap };
|
|
22
|
+
+`;
|
|
23
|
+
+// JsView Modified <<<
|
|
24
|
+
}
|
|
25
|
+
function getFileExtname(url) {
|
|
26
|
+
const fileNameAndParamArr = normalizePath(url).split("/");
|
|
27
|
+
@@ -970,8 +979,11 @@ function prodExposePlugin(options) {
|
|
6
28
|
const filepathMap = /* @__PURE__ */ new Map();
|
|
7
29
|
const getFilename = (name) => path.parse(path.parse(name).name).name;
|
|
8
30
|
const cssBundlesMap = Object.keys(bundle).filter((name) => path.extname(name) === ".css").reduce((res, name) => {
|
|
@@ -16,7 +38,7 @@ index 980b8e3..48baae5 100644
|
|
|
16
38
|
return res;
|
|
17
39
|
}, /* @__PURE__ */ new Map());
|
|
18
40
|
remoteEntryChunk.code = remoteEntryChunk.code.replace(
|
|
19
|
-
@@ -1481,6 +
|
|
41
|
+
@@ -1481,6 +1493,16 @@ function federation(options) {
|
|
20
42
|
}
|
|
21
43
|
builderInfo.builder = "vite";
|
|
22
44
|
builderInfo.assetsDir = ((_b = config == null ? void 0 : config.build) == null ? void 0 : _b.assetsDir) ?? "assets";
|
|
@@ -34,10 +56,32 @@ index 980b8e3..48baae5 100644
|
|
|
34
56
|
configureServer(server) {
|
|
35
57
|
var _a;
|
|
36
58
|
diff --git a/node_modules/@originjs/vite-plugin-federation/dist/index.mjs b/node_modules/@originjs/vite-plugin-federation/dist/index.mjs
|
|
37
|
-
index 57bae8f..
|
|
59
|
+
index 57bae8f..3b3c2c1 100644
|
|
38
60
|
--- a/node_modules/@originjs/vite-plugin-federation/dist/index.mjs
|
|
39
61
|
+++ b/node_modules/@originjs/vite-plugin-federation/dist/index.mjs
|
|
40
|
-
@@ -
|
|
62
|
+
@@ -284,11 +284,20 @@ function createRemotesMap(remotes) {
|
|
63
|
+
return `'${external}'`;
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
+// JsView Modified >>>
|
|
67
|
+
+// return `const remotesMap = {
|
|
68
|
+
+// ${remotes.map(
|
|
69
|
+
+// (remote) => `'${remote.id}':{url:${createUrl(remote)},format:'${remote.config.format}',from:'${remote.config.from}'}`
|
|
70
|
+
+// ).join(",\n ")}
|
|
71
|
+
+// };`;
|
|
72
|
+
return `const remotesMap = {
|
|
73
|
+
${remotes.map(
|
|
74
|
+
(remote) => `'${remote.id}':{url:${createUrl(remote)},format:'${remote.config.format}',from:'${remote.config.from}'}`
|
|
75
|
+
).join(",\n ")}
|
|
76
|
+
-};`;
|
|
77
|
+
+};;
|
|
78
|
+
+window.JsvCode.Federation = { remotesMap };
|
|
79
|
+
+`;
|
|
80
|
+
+// JsView Modified <<<
|
|
81
|
+
}
|
|
82
|
+
function getFileExtname(url) {
|
|
83
|
+
const fileNameAndParamArr = normalizePath(url).split("/");
|
|
84
|
+
@@ -953,8 +962,11 @@ function prodExposePlugin(options) {
|
|
41
85
|
const filepathMap = /* @__PURE__ */ new Map();
|
|
42
86
|
const getFilename = (name) => parse(parse(name).name).name;
|
|
43
87
|
const cssBundlesMap = Object.keys(bundle).filter((name) => extname(name) === ".css").reduce((res, name) => {
|
|
@@ -51,7 +95,7 @@ index 57bae8f..9320e8d 100644
|
|
|
51
95
|
return res;
|
|
52
96
|
}, /* @__PURE__ */ new Map());
|
|
53
97
|
remoteEntryChunk.code = remoteEntryChunk.code.replace(
|
|
54
|
-
@@ -1464,6 +
|
|
98
|
+
@@ -1464,6 +1476,16 @@ function federation(options) {
|
|
55
99
|
}
|
|
56
100
|
builderInfo.builder = "vite";
|
|
57
101
|
builderInfo.assetsDir = ((_b = config == null ? void 0 : config.build) == null ? void 0 : _b.assetsDir) ?? "assets";
|
package/tools/jsview-common.mjs
CHANGED
|
@@ -350,6 +350,18 @@ function execCommand(cmdline, withOutput)
|
|
|
350
350
|
}
|
|
351
351
|
}
|
|
352
352
|
|
|
353
|
+
function execCommandAsync(cmdline)
|
|
354
|
+
{
|
|
355
|
+
Logger.Info('Run [' + cmdline + ']... ');
|
|
356
|
+
const child = childProcess.exec(cmdline);
|
|
357
|
+
child.stdout.on('data', (data) => {
|
|
358
|
+
console.log(data);
|
|
359
|
+
});
|
|
360
|
+
child.stderr.on('data', (data) => {
|
|
361
|
+
Logger.ErrorAndExit(data)
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
|
|
353
365
|
function checkNodeVersion(minMajorVersion = 16)
|
|
354
366
|
{
|
|
355
367
|
const versions = process.version.replace('v', '').split('.');
|
|
@@ -466,6 +478,23 @@ function getNpmRegistry()
|
|
|
466
478
|
return 'https://nexus.cluster.qcast.cn/repository/npm-public';
|
|
467
479
|
}
|
|
468
480
|
|
|
481
|
+
function getNetworkIpv4Addresses() {
|
|
482
|
+
const addresses = [];
|
|
483
|
+
const interfaces = os.networkInterfaces();
|
|
484
|
+
for (const devName in interfaces) {
|
|
485
|
+
const iface = interfaces[devName];
|
|
486
|
+
|
|
487
|
+
for (var idx = 0; idx < iface.length; idx++) {
|
|
488
|
+
var alias = iface[idx];
|
|
489
|
+
if (alias.family === 'IPv4' && alias.address !== '127.0.0.1' && !alias.internal) {
|
|
490
|
+
addresses.push(alias.address);
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
return addresses;
|
|
496
|
+
}
|
|
497
|
+
|
|
469
498
|
export {
|
|
470
499
|
askAndAnswer,
|
|
471
500
|
checkNodeVersion,
|
|
@@ -473,8 +502,10 @@ export {
|
|
|
473
502
|
cpSync,
|
|
474
503
|
downloadFileAsync,
|
|
475
504
|
execCommand,
|
|
476
|
-
|
|
505
|
+
execCommandAsync,
|
|
506
|
+
getNetworkIpv4Addresses,
|
|
477
507
|
getNpmRegistry,
|
|
508
|
+
getOptions,
|
|
478
509
|
isSymlinkSync,
|
|
479
510
|
loadPackageObject,
|
|
480
511
|
makeZip,
|
package/tools/jsview-logger.js
CHANGED
|
@@ -13,6 +13,10 @@ class Logger {
|
|
|
13
13
|
process.exit(1);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
static ErrorAndExitNoSilent(...args) {
|
|
17
|
+
Logger.ErrorNoException(...args);
|
|
18
|
+
process.exit(0);
|
|
19
|
+
}
|
|
16
20
|
|
|
17
21
|
static ErrorAndThrow(...args) {
|
|
18
22
|
Logger.Error(...args);
|
|
@@ -49,6 +53,14 @@ class Logger {
|
|
|
49
53
|
console.warn(Logger.Yellow(Logger.Bold('JsView Warning:')), ...args);
|
|
50
54
|
}
|
|
51
55
|
|
|
56
|
+
static Tip(...args) {
|
|
57
|
+
const size = args?.length ?? 0;
|
|
58
|
+
for(let idx = 0; idx < size; idx++) {
|
|
59
|
+
args[idx] = Logger.Blue(Logger.Bold(args[idx]));
|
|
60
|
+
}
|
|
61
|
+
console.info(...args);
|
|
62
|
+
}
|
|
63
|
+
|
|
52
64
|
static Info(...args) {
|
|
53
65
|
console.info(Logger.Green('JsView Info:'), ...args);
|
|
54
66
|
}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import {
|
|
5
5
|
askAndAnswer,
|
|
6
6
|
checkNodeVersion,
|
|
7
|
+
getNetworkIpv4Addresses,
|
|
7
8
|
getOptions,
|
|
8
9
|
parseArguments,
|
|
9
10
|
Logger,
|
|
@@ -27,6 +28,7 @@ async function getExtraOptions(argv)
|
|
|
27
28
|
commandCount += (argv.buildMinmap ? 1 : 0);
|
|
28
29
|
commandCount += (argv.buildZip ? 1 : 0);
|
|
29
30
|
commandCount += (argv.moduleFederation ? 1 : 0);
|
|
31
|
+
commandCount += (argv.vueDevtools ? 1 : 0);
|
|
30
32
|
if(commandCount == 0) {
|
|
31
33
|
if(argv.help || argv.h) {
|
|
32
34
|
printArgumentsUsages(requiredUsages, optionalUsages);
|
|
@@ -34,48 +36,34 @@ async function getExtraOptions(argv)
|
|
|
34
36
|
}
|
|
35
37
|
|
|
36
38
|
const commandPrompt = [
|
|
37
|
-
'
|
|
38
|
-
'
|
|
39
|
-
'
|
|
40
|
-
'
|
|
41
|
-
'
|
|
42
|
-
'
|
|
39
|
+
'runonAndroid',
|
|
40
|
+
'configApp',
|
|
41
|
+
'genKeypair',
|
|
42
|
+
'buildMinmap',
|
|
43
|
+
'buildZip',
|
|
44
|
+
'vueDevtools',
|
|
45
|
+
'moduleFederation',
|
|
43
46
|
];
|
|
44
47
|
|
|
45
48
|
Logger.Info();
|
|
46
49
|
Logger.Info('Please choice a command:');
|
|
47
|
-
for(
|
|
48
|
-
Logger.Info(
|
|
50
|
+
for(let idx = 0; idx < commandPrompt.length; idx++) {
|
|
51
|
+
Logger.Info(idx, ': ' + commandPrompt[idx].replace(/[A-Z]/g, match => `-${match.toLowerCase()}`));
|
|
49
52
|
}
|
|
50
|
-
const answer = askAndAnswer(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
break;
|
|
55
|
-
case '2':
|
|
56
|
-
options.configApp = true;
|
|
57
|
-
break;
|
|
58
|
-
case '3':
|
|
59
|
-
options.genKeypair = true;
|
|
60
|
-
break;
|
|
61
|
-
case '4':
|
|
62
|
-
options.buildMinmap = true;
|
|
63
|
-
break;
|
|
64
|
-
case '5':
|
|
65
|
-
options.buildZip = true;
|
|
66
|
-
break;
|
|
67
|
-
case '6':
|
|
68
|
-
options.moduleFederation = true;
|
|
69
|
-
break;
|
|
70
|
-
default:
|
|
71
|
-
Logger.ErrorAndExitNoException("Unknown input: " + answer);
|
|
53
|
+
const answer = askAndAnswer(`Command Index (0~${commandPrompt.length-1}): `);
|
|
54
|
+
const command = commandPrompt[answer];
|
|
55
|
+
if(!command) {
|
|
56
|
+
Logger.ErrorAndExitNoException("Bad index: " + answer);
|
|
72
57
|
}
|
|
58
|
+
Logger.Info('command:', command);
|
|
59
|
+
options[command] = true
|
|
73
60
|
} else if(commandCount == 1) {
|
|
74
61
|
options.runonAndroid = argv.runonAndroid;
|
|
75
62
|
options.configApp = argv.configApp;
|
|
76
63
|
options.genKeypair = argv.genKeypair;
|
|
77
64
|
options.buildMinmap = argv.buildMinmap;
|
|
78
65
|
options.buildZip = argv.buildZip;
|
|
66
|
+
options.vueDevtools = argv.vueDevtools;
|
|
79
67
|
options.moduleFederation = argv.moduleFederation;
|
|
80
68
|
} else if(commandCount > 1) {
|
|
81
69
|
Logger.ErrorAndExitNoException("Only one command can be executed.");
|
|
@@ -117,6 +105,14 @@ function doCommand(options) {
|
|
|
117
105
|
}
|
|
118
106
|
|
|
119
107
|
command = 'node node_modules/@shijiu/jsview/tools/jsview-build-zip.mjs --password=' + password;
|
|
108
|
+
} else if(options.vueDevtools) {
|
|
109
|
+
var defaultPort = 8098;
|
|
110
|
+
const port = (typeof(options.vueDevtools) === 'string' ? options.vueDevtools : defaultPort);
|
|
111
|
+
if(port !== options.vueDevtools) {
|
|
112
|
+
Logger.Warn('Vue Devtools server port is not set, use default value: ' + defaultPort);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
command = 'node node_modules/@shijiu/jsview/tools/jsview-vue-devtools.mjs --port=' + port;
|
|
120
116
|
} else if(options.moduleFederation) {
|
|
121
117
|
var argumentsLine = options.argumentsLine.replace(/ --framework.*? /, ' ');
|
|
122
118
|
argumentsLine = argumentsLine.replace(' -f ', ' ').replace(' --module-federation ', ' ');
|
|
@@ -145,6 +141,7 @@ const optionalUsages = {
|
|
|
145
141
|
'-g | --gen-keypair': 'Generate sign keypair.',
|
|
146
142
|
'-m | --build-minmap': 'Build target with filter map, like: -m or --build-minmap=[filter].',
|
|
147
143
|
'-z | --build-zip': 'Build target to offline zip package, like: -z or --build-zip=[password].',
|
|
144
|
+
'-d | --vue-devtools': 'Start vue dev server and vue-devtools standalone, like: -d or --vue-devtools=[port].',
|
|
148
145
|
'-f | --module-federation': 'Make project to module federation, use --module-federation --help for details.',
|
|
149
146
|
};
|
|
150
147
|
const argv = parseArguments(requiredUsages, optionalUsages, true, true, true);
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
import fs from 'node:fs';
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
import {
|
|
7
|
+
askAndAnswer,
|
|
8
|
+
checkNodeVersion,
|
|
9
|
+
execCommand,
|
|
10
|
+
getNetworkIpv4Addresses,
|
|
11
|
+
getOptions,
|
|
12
|
+
parseArguments,
|
|
13
|
+
Logger,
|
|
14
|
+
} from './jsview-common.mjs';
|
|
15
|
+
|
|
16
|
+
function getDefaultPort() {
|
|
17
|
+
return 8098;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
async function getExtraOptions(argv)
|
|
21
|
+
{
|
|
22
|
+
const options = getOptions(argv.framework);
|
|
23
|
+
|
|
24
|
+
options.hostIp = 'your-pc-ip';
|
|
25
|
+
const addresses = getNetworkIpv4Addresses();
|
|
26
|
+
if(addresses.length > 0) {
|
|
27
|
+
options.hostIp = addresses[0];
|
|
28
|
+
}
|
|
29
|
+
options.hostPort = argv.port ?? getDefaultPort();
|
|
30
|
+
|
|
31
|
+
if(process.platform == 'win32' && options.hostPort != getDefaultPort()) {
|
|
32
|
+
Logger.ErrorAndExit("Windows can't support to set custom port to Vue DevTools standalone application. please use default value.")
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return options;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
async function runVueDevtoolsStandalone(options)
|
|
39
|
+
{
|
|
40
|
+
const vuedtFilePath = options.modulesDir + '/.bin/vue-devtools';
|
|
41
|
+
|
|
42
|
+
var exportPrefix = 'export';
|
|
43
|
+
if(process.platform == 'win32') {
|
|
44
|
+
exportPrefix = 'set'
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (fs.existsSync(vuedtFilePath) == false
|
|
48
|
+
|| fs.existsSync(options.modulesDir + '/electron') == false) {
|
|
49
|
+
Logger.ErrorNoException('Vue DevTools standalone application is not found.')
|
|
50
|
+
Logger.Info(' Do you want to install it thought "@vue/vue-devtools@6.5.1"?');
|
|
51
|
+
const answer = askAndAnswer('(y/N) ');
|
|
52
|
+
if (answer.substring(0, 1) != 'y' && answer.substring(0, 3) != 'yes') {
|
|
53
|
+
Logger.ErrorAndExitNoSilent('User cancelled.')
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const exportElectronMirror = exportPrefix + ' ELECTRON_MIRROR=http://cdn.release.qcast.cn/RN_devtools/electron-env/'
|
|
57
|
+
let cmdline = exportElectronMirror + ' && npm install --package-lock-only --save-exact --save-dev electron@21.4.4 @vue/devtools@6.5.1'
|
|
58
|
+
execCommand(cmdline);
|
|
59
|
+
cmdline = exportElectronMirror + ' && npm ci'
|
|
60
|
+
execCommand(cmdline);
|
|
61
|
+
|
|
62
|
+
console.log()
|
|
63
|
+
console.log()
|
|
64
|
+
Logger.Tip(" *** NOTICE ***:")
|
|
65
|
+
Logger.Tip(" Don't forget to add the following code at the beginning of your source entry ['main.ts' or 'main.tsx']:")
|
|
66
|
+
console.log(" if (process.env.NODE_ENV === 'development') {")
|
|
67
|
+
console.log(" window.requestAnimationFrame = (callback) => setTimeout(callback, 0)")
|
|
68
|
+
console.log(" const devtools = await import('@vue/devtools')")
|
|
69
|
+
console.log(" devtools.connect('" + options.hostIp + "', " + options.hostPort + ")")
|
|
70
|
+
console.log(" console.warn('@vue/devtools has been ready.')")
|
|
71
|
+
console.log(" }")
|
|
72
|
+
console.log()
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
var cmdline = /* 不要添加 `node `,windows cmd执行出错 */ path.relative(options.projectDir, vuedtFilePath)
|
|
76
|
+
if(process.platform != 'win32') { // 在Window系统上设置port 会导致WebSocket连接失败。
|
|
77
|
+
cmdline = (exportPrefix + ' PORT=' + options.hostPort + ' && ' + cmdline);
|
|
78
|
+
}
|
|
79
|
+
execCommand(cmdline);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
async function main(argv)
|
|
83
|
+
{
|
|
84
|
+
checkNodeVersion();
|
|
85
|
+
|
|
86
|
+
const options = await getExtraOptions(argv);
|
|
87
|
+
|
|
88
|
+
runVueDevtoolsStandalone(options);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const requiredUsages = {
|
|
92
|
+
};
|
|
93
|
+
const optionalUsages = {
|
|
94
|
+
'--port': 'Set vue devtools standalone server port. default is: ' + getDefaultPort(),
|
|
95
|
+
};
|
|
96
|
+
const argv = parseArguments(requiredUsages, optionalUsages, false);
|
|
97
|
+
main(argv)
|