@next-bricks/visual-builder 1.7.3 → 1.7.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bricks.json +13 -13
- package/dist/chunks/5669.c0bcd8ec.js +2 -0
- package/dist/chunks/5669.c0bcd8ec.js.map +1 -0
- package/dist/chunks/7222.964f447f.js +3 -0
- package/dist/chunks/{7222.23911e6a.js.map → 7222.964f447f.js.map} +1 -1
- package/dist/chunks/7733.dd86deb1.js +2 -0
- package/dist/chunks/7733.dd86deb1.js.map +1 -0
- package/dist/chunks/8050.0d264d7c.js +2 -0
- package/dist/chunks/8050.0d264d7c.js.map +1 -0
- package/dist/chunks/875.ac8439b8.js +2 -0
- package/dist/chunks/875.ac8439b8.js.map +1 -0
- package/dist/chunks/9027.56cad5a3.js +2 -0
- package/dist/chunks/{9027.bdf6692f.js.map → 9027.56cad5a3.js.map} +1 -1
- package/dist/chunks/9636.ecf3c18b.js +3 -0
- package/dist/chunks/{9636.0a88cf0a.js.map → 9636.ecf3c18b.js.map} +1 -1
- package/dist/chunks/main.e09279cd.js +2 -0
- package/dist/chunks/main.e09279cd.js.map +1 -0
- package/dist/chunks/workbench-action-list.0b3ea2ad.js +2 -0
- package/dist/chunks/{workbench-action-list.68d0a5d2.js.map → workbench-action-list.0b3ea2ad.js.map} +1 -1
- package/dist/chunks/workbench-history-action.cfd701d2.js +3 -0
- package/dist/chunks/{workbench-history-action.a0c4e551.js.map → workbench-history-action.cfd701d2.js.map} +1 -1
- package/dist/index.a47867cb.js +2 -0
- package/dist/index.a47867cb.js.map +1 -0
- package/dist/manifest.json +67 -67
- package/dist/types.json +57 -57
- package/package.json +2 -2
- package/dist/chunks/1972.20f16f21.js +0 -2
- package/dist/chunks/1972.20f16f21.js.map +0 -1
- package/dist/chunks/3208.99775359.js +0 -2
- package/dist/chunks/3208.99775359.js.map +0 -1
- package/dist/chunks/7222.23911e6a.js +0 -3
- package/dist/chunks/7733.91bc54b9.js +0 -2
- package/dist/chunks/7733.91bc54b9.js.map +0 -1
- package/dist/chunks/9027.bdf6692f.js +0 -2
- package/dist/chunks/9591.a0e2892a.js +0 -2
- package/dist/chunks/9591.a0e2892a.js.map +0 -1
- package/dist/chunks/9636.0a88cf0a.js +0 -3
- package/dist/chunks/main.d3d199e8.js +0 -2
- package/dist/chunks/main.d3d199e8.js.map +0 -1
- package/dist/chunks/workbench-action-list.68d0a5d2.js +0 -2
- package/dist/chunks/workbench-history-action.a0c4e551.js +0 -3
- package/dist/index.1a5a2652.js +0 -2
- package/dist/index.1a5a2652.js.map +0 -1
- /package/dist/chunks/{7222.23911e6a.js.LICENSE.txt → 7222.964f447f.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{9636.0a88cf0a.js.LICENSE.txt → 9636.ecf3c18b.js.LICENSE.txt} +0 -0
- /package/dist/chunks/{workbench-history-action.a0c4e551.js.LICENSE.txt → workbench-history-action.cfd701d2.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_next_bricks_visual_builder=self.webpackChunk_next_bricks_visual_builder||[]).push([[9027],{6788:(e,t,n)=>{n.d(t,{b:()=>i});var r=n(8438),a=n(2153),o=n(6946);function i(e){var t=function(e){var t=new Set;return(0,a.h)(e,(e=>{switch(e.type){case"Resolvable":case"EventHandler":var n,r=null===(n=e.raw)||void 0===n?void 0:n.useProvider;r&&t.add(r)}})),t}((0,o.lN)(e)),n=[];for(var r of t)r.includes("@")&&n.push(r);return n}customElements.define("visual-builder.collect-used-contracts",(0,r.createProviderClass)(i))},9027:(e,t,n)=>{n.d(t,{A:()=>R});var r,a=n(6330),o=n(9740),i=n(4),s=n(1030),d=n(8317),l=n.n(d);function p(){return(p=(0,a.A)((function*(e,t){var n,r=yield l()(document.body,{logging:!1,scale:1,width:window.innerWidth,height:window.innerHeight,foreignObjectRendering:!0}),a=document.createElement("canvas");return function(e,t,n,r){var a=n/r,{width:o,height:i}=e,s=o/i,d=s>=a,l=d?n:r*s,p=d?n/s:r;t.width=l,t.height=p,t.getContext("2d").drawImage(e,0,0,o,i,0,0,l,p),t.toDataURL()}(r,a,e,t),yield(n=a,new Promise((function(e,t){n.toBlob((function(n){n?e(n):t()}))})))}))).apply(this,arguments)}function c(e){var t;e.preventDefault(),e.stopPropagation(),(t=y(e.composedPath())).length>0&&window.parent.postMessage({sender:"previewer",type:"select-brick",iidList:t},r)}function u(e){e.preventDefault(),e.stopPropagation()}var v=(0,s.throttle)((e=>{var t=y(e);t.length>0&&window.parent.postMessage({sender:"previewer",type:"hover-on-brick",iidList:t},r)}),100,{leading:!1});function h(e){e.preventDefault(),e.stopPropagation(),v(e.composedPath())}function w(e){e.preventDefault(),e.stopPropagation(),v(e.composedPath())}function m(e){e.preventDefault(),e.stopPropagation(),window.parent.postMessage({sender:"previewer",type:"hover-on-brick",iidList:[]},r)}function g(e){var t,n,a;e.preventDefault(),e.stopPropagation(),t=e.composedPath(),n={x:e.clientX,y:e.clientY},(a=y(t)).length>0&&window.parent.postMessage({sender:"previewer",type:"context-menu-on-brick",iidList:a,position:n},r)}function y(e){var t=[];for(var n of e)n instanceof HTMLElement&&"string"==typeof n.dataset.iid&&t.push(n.dataset.iid);return t}var f=n(6788);function b(e){var t=typeof e;switch(t){case"string":case"boolean":case"number":return{type:t,value:e};case"undefined":return{type:t}}return null===e?{type:"null"}:Array.isArray(e)?{type:"array",length:e.length}:{type:"object"}}var S=!1,E=i.getHistory,L=i.matchPath,k=i.__secret_internals,I=!1;try{var x,P=window.dll;if(P&&null!==(x=window.BRICK_NEXT_VERSIONS)&&void 0!==x&&null!==(x=x["brick-container"])&&void 0!==x&&x.startsWith("2.")){var{getHistory:C,developHelper:A}=P("tYg3"),{matchPath:T}=P("A+yw");E=C,L=T,k=(0,o.A)((0,o.A)({},A),{},{getContextValue(e,t){var{tplStateStoreId:n}=t;return A.getContextValue(e,{tplContextId:n})},getAllContextValues(e){var{tplStateStoreId:t}=e,n=A.getAllContextValues({tplContextId:t});return Object.fromEntries([...n].map((e=>{var[t,n]=e;return[t,n.value]})))}}),I=!0}}catch(e){console.error("Try to use v2 runtime APIs failed:",e)}var D=null,N=null;function R(e,t){return _.apply(this,arguments)}function _(){return _=(0,a.A)((function*(e,t){var n,d;if(!S){S=!0;var l,v,y,I,x=t=>{window.parent.postMessage((0,o.A)({sender:"previewer"},t),e)};x({type:"preview-started"}),r=e;var P,C=(e,t,n)=>{var r=M(t);x({type:"highlight-brick",highlightType:e,outlines:r,iid:t,alias:n})};t.templateId&&(P=t.settings);var A=()=>{k.updateTemplatePreviewSettings(t.appId,t.templateId,P),E().reload()},T=()=>{k.updateSnippetPreviewSettings(t.appId,JSON.parse(t.snippetData)),E().reload()},R=E();window.addEventListener("message",function(){var n=(0,a.A)((function*(n){var a,o,d,{data:b,origin:S}=n;if(S===e&&b&&"preview-container"===b.sender)if("builder"===b.forwardedFor)switch(b.type){case"hover-on-brick":l=b.iid,v=b.alias,C("hover",b.iid,b.alias);break;case"hover-on-main":C("hover","#main-mount-point","root");break;case"hover-on-context":d=b.highlightNodes.map((e=>M(e.iid,e.alias))).flat(),x({type:"highlight-context",outlines:d});break;case"select-brick":y=b.iid,I=b.alias,C("active",b.iid,b.alias);break;case"hover-on-iframe":(e=>{var t=document.elementFromPoint(e.x,e.y);if("BODY"===(null==t?void 0:t.tagName))window.parent.postMessage({sender:"previewer",type:"hover-on-main",isDirection:!0,position:{x:e.x,y:e.y}},r);else{var n=function(e){for(var t=[],n=e;n;)"string"==typeof n.dataset.iid&&t.push(n.dataset.iid),n=n.parentElement;return t}(t);window.parent.postMessage({sender:"previewer",type:"hover-on-brick",iidList:n,isDirection:!0,position:{x:e.x,y:e.y}},r)}})(b.position)}else switch(b.type){case"toggle-inspecting":b.enabled?(window.addEventListener("click",c,!0),window.addEventListener("mousedown",u,!0),window.addEventListener("mouseover",u,!0),window.addEventListener("mouseup",u,!0),window.addEventListener("pointerdown",h,!0),window.addEventListener("pointermove",w,!0),window.addEventListener("pointerup",u,!0),window.addEventListener("pointerleave",m,!0),window.addEventListener("contextmenu",g,!0)):(window.removeEventListener("click",c,!0),window.removeEventListener("mousedown",u,!0),window.removeEventListener("mouseover",u,!0),window.removeEventListener("mouseup",u,!0),window.removeEventListener("pointerdown",h,!0),window.removeEventListener("pointermove",w,!0),window.removeEventListener("pointerup",u,!0),window.removeEventListener("pointerleave",m,!0),window.removeEventListener("contextmenu",g,!0));break;case"refresh":if(null!==(a=b.options)&&void 0!==a&&a.updateStoryboardType){var L,D;"route"===b.options.updateStoryboardType?k.updateStoryboardByRoute(t.appId,b.storyboardPatch):"template"===b.options.updateStoryboardType?k.updateStoryboardByTemplate(t.appId,b.storyboardPatch,b.options.settings):"snippet"===b.options.updateStoryboardType&&k.updateStoryboardBySnippet(t.appId,b.storyboardPatch);var N=yield null===(L=(D=k).getAddedContracts)||void 0===L?void 0:L.call(D,b.storyboardPatch,{appId:t.appId,updateStoryboardType:b.options.updateStoryboardType,formId:t.formId,collectUsedContracts:f.b});(0,s.isEmpty)(N)?E().reload():x({type:"contract-update",data:{add:N}});break}k.updateStoryboard(t.appId,b.storyboardPatch),t.templateId?(P=b.settings,A()):null!==(o=b.options)&&void 0!==o&&o.snippetData?(t.snippetData=b.options.snippetData,T()):E().reload();break;case"reload":location.reload();break;case"back":R.goBack();break;case"forward":R.goForward();break;case"capture":(function(e,t){return p.apply(this,arguments)})(b.maxWidth,b.maxHeight).then((e=>{x({type:"capture-ok",screenshot:e})}),(()=>{x({type:"capture-failed"})}));break;case"inspect-data-value":((e,t)=>{try{var n,r,a,{dataType:o}=t;if("state"===o&&!(n=O()))return void x({type:"inspect-data-value-error",data:{error:{message:"tplStateStoreId not found, unable to preview STATE value"}}});if(e)a="inspect-single-data-value-success",r=k.getContextValue(e,{tplStateStoreId:n});else{a="inspect-all-data-values-success";var i=k.getAllContextValues({tplStateStoreId:n});r=Object.entries(i).map((e=>{var[t,n]=e;return{name:t,value:n}}))}x({type:a,data:{name:e,value:r}})}catch(e){x({type:"inspect-data-value-error",data:{message:e.message}})}})(b.name,b.option);break;case"update-preview-url":var _=b.previewUrl.startsWith(window.origin)?b.previewUrl.substring(window.origin.length):b.previewUrl,H=(0,i.getBasePath)(),B=_.startsWith(H)?_.substring(H.length-1):_;E().push(B);break;case"update-preview-route":t.routePath=b.routePath,t.routeExact=b.routeExact,V()}}));return function(e){return n.apply(this,arguments)}}()),window.addEventListener("scroll",(()=>{x({type:"scroll",scroll:{x:window.scrollX,y:window.scrollY}})}));var _,H,B=!0,q=e=>{x({type:"url-change",url:location.origin+R.createHref(e)}),_=e,V()};q(R.location),R.listen(q),t.templateId&&A(),t.snippetData&&T(),null===(n=(d=k).addRealTimeDataInspectHook)||void 0===n||n.call(d,(e=>{var{changeType:t,tplStateStoreId:n,detail:r}=e;x({type:"real-time-data-inspect-change",changeType:t,tplStateStoreId:n,detail:"update"===t?{name:r.name,annotation:b(r.value)}:{data:Object.fromEntries(Object.entries(r.data).map((e=>{var[t,n]=e;return[t,b(n)]})))}})})),window.addEventListener("route.render",(()=>{W(!0)})),j(),W(!0),new MutationObserver((0,s.throttle)((()=>{j(),W(),l&&C("hover",l,v),y&&C("active",y,I)}),100,{leading:!1})).observe(document.body,{subtree:!0,childList:!0})}function V(){if(t.routePath){var e=!!L(_.pathname,{path:t.routePath,exact:t.routeExact});if(x({type:"route-match-change",match:e}),t.templateId&&!B&&e){var n=document.querySelector("#main-mount-point"),r=new MutationObserver((()=>{1===n.childNodes.length&&"SPAN"===n.firstChild.tagName&&0===n.firstChild.childNodes.length&&(A(),r.disconnect())}));r.observe(n,{childList:!0})}if(t.snippetData&&!B&&e){var a=document.querySelector("#main-mount-point"),o=new MutationObserver((()=>{1===a.childNodes.length&&"SPAN"===a.firstChild.tagName&&0===a.firstChild.childNodes.length&&(T(),o.disconnect())}));o.observe(a,{childList:!0})}B=e}}function j(){var e,t,n,r=document.querySelector("eo-page-view"),a=null!==(e=null==r||null===(t=r.shadowRoot)||void 0===t?void 0:t.querySelector(".content"))&&void 0!==e?e:null;a!==D&&(null===(n=D)||void 0===n||n.removeEventListener("scroll",U),null==a||a.addEventListener("scroll",U),D=a,N=r)}function U(){x({type:"content-scroll",scroll:{x:this.scrollLeft,y:this.scrollTop}})}function W(e){var n,r,a=t.templateId?O():void 0;(H!==a||e)&&(H=a,null===(n=(r=k).setRealTimeDataInspectRoot)||void 0===n||n.call(r,{tplStateStoreId:a}))}})),_.apply(this,arguments)}function M(e,t){if(!e)return[];var n=e.includes("#"),r=function(e,t){var n=[];return function r(a){var o=a.querySelectorAll(t?e:'[data-iid="'.concat(e,'"]'));if(n.push(...o),!(a===document&&o.length>0))for(var i of a.querySelectorAll("*"))i.shadowRoot&&r(i.shadowRoot)}(document),n}(e,n),a=function(e,t){return e.map((e=>{var n,r=null===(n=N)||void 0===n?void 0:n.contains(e),{width:a,height:o,left:i,top:s}=e.getBoundingClientRect();return{width:a,height:o,left:i+window.scrollX+(r?D.scrollLeft:0),top:s+window.scrollY+(r?D.scrollTop:0),alias:t,hasContentScroll:r}}))}(r,t);return n?a.map((e=>(0,o.A)((0,o.A)({},e),{},{height:window.innerHeight-e.top}))):a}function O(){var e,t=document.querySelector("#main-mount-point");return null==t||null===(e=t.firstChild)||void 0===e?void 0:e.dataset[I?"tplContextId":"tplStateStoreId"]}}}]);
|
|
2
|
+
//# sourceMappingURL=9027.56cad5a3.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunks/9027.bdf6692f.js","mappings":"6LAgCO,SAASA,EAAqBC,GACnC,IAAMC,EArBR,SAAiBC,GACf,IAAMD,EAAa,IAAIE,IAgBvB,OAdAC,EAAAA,EAAAA,GAASF,GAAcG,IACrB,OAAQA,EAAKC,MACX,IAAK,aACL,IAAK,eAAgB,IAAAC,EACbC,EACI,QADOD,EACfF,EAAKI,WAAG,IAAAF,OAAA,EADUA,EAEjBC,YACCA,GACFP,EAAWS,IAAIF,GAGrB,IAGKP,CACT,CAGqBU,E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AAYb,EAAUvH,GACvC,OAAOsH,EACHrH,EAAS1B,KAAKvG,IAAI4F,EAAAA,EAAAA,IAAAA,EAAAA,EAAAA,GAAA,GACb5F,GAAI,IACPqB,OAAQF,OAAOG,YAActB,EAAKkQ,QAEpCjI,CACN,CAqDA,SAASyD,IAA6C,IAAA2E,EAC9CnC,EAAiBpN,SAASqN,cAAc,qBAE9C,OAAQD,SAA0B,QAAZmC,EAAdnC,EAAgBI,kBAAU,IAAA+B,OAAA,EAA3BA,EAA6C/L,QAClDa,EAAO,eAAiB,kBAE5B,C","sources":["webpack:///./src/data-providers/collect-used-contracts.ts","webpack:///./src/data-providers/preview/inspector.ts","webpack:///./src/data-providers/preview/capture.ts","webpack:///./src/data-providers/preview/resizeScreenshot.ts","webpack:///./src/data-providers/preview/realTimeDataInspect.ts","webpack:///./src/data-providers/preview/connect.ts"],"sourcesContent":["import { createProviderClass } from \"@next-core/utils/general\";\nimport {\n type StoryboardNode,\n parseStoryboard,\n traverse,\n} from \"@next-core/storyboard\";\nimport {\n Storyboard,\n UseProviderResolveConf,\n UseProviderEventHandler,\n} from \"@next-core/types\";\n\nfunction collect(nodeOrNodes: StoryboardNode | StoryboardNode[]): Set<string> {\n const collection = new Set<string>();\n\n traverse(nodeOrNodes, (node) => {\n switch (node.type) {\n case \"Resolvable\":\n case \"EventHandler\": {\n const useProvider = (\n node.raw as UseProviderResolveConf | UseProviderEventHandler\n )?.useProvider;\n if (useProvider) {\n collection.add(useProvider);\n }\n }\n }\n });\n\n return collection;\n}\n\nexport function collectUsedContracts(storyboard: Storyboard): string[] {\n const collection = collect(parseStoryboard(storyboard as any));\n\n const contracts = [];\n\n for (const item of collection) {\n if (item.includes(\"@\")) {\n contracts.push(item);\n }\n }\n\n return contracts;\n}\n\ncustomElements.define(\n \"visual-builder.collect-used-contracts\",\n createProviderClass(collectUsedContracts)\n);\n","// istanbul ignore file: working in progress\n// https://github.com/facebook/react/blob/cae635054e17a6f107a39d328649137b83f25972/packages/react-devtools-shared/src/backend/views/Highlighter/index.js\nimport { throttle } from \"lodash\";\nimport type {\n PreviewMessagePreviewerHoverOnBrick,\n PreviewMessagePreviewerSelectBrick,\n PreviewMessagePreviewerContextMenuOnBrick,\n} from \"./interfaces.js\";\n\nexport let previewProxyOrigin: string;\n\nexport function setPreviewFromOrigin(origin: string): void {\n previewProxyOrigin = origin;\n}\n\nexport function startInspecting(): void {\n registerListeners();\n}\n\nexport function stopInspecting(): void {\n unregisterListeners();\n}\n\nfunction registerListeners(): void {\n window.addEventListener(\"click\", onClick, true);\n window.addEventListener(\"mousedown\", onMouseEvent, true);\n window.addEventListener(\"mouseover\", onMouseEvent, true);\n window.addEventListener(\"mouseup\", onMouseEvent, true);\n window.addEventListener(\"pointerdown\", onPointerDown, true);\n window.addEventListener(\"pointermove\", onPointerMove, true);\n window.addEventListener(\"pointerup\", onMouseEvent, true);\n window.addEventListener(\"pointerleave\", onPointerLeave, true);\n window.addEventListener(\"contextmenu\", onContextMenu, true);\n}\n\nfunction unregisterListeners(): void {\n window.removeEventListener(\"click\", onClick, true);\n window.removeEventListener(\"mousedown\", onMouseEvent, true);\n window.removeEventListener(\"mouseover\", onMouseEvent, true);\n window.removeEventListener(\"mouseup\", onMouseEvent, true);\n window.removeEventListener(\"pointerdown\", onPointerDown, true);\n window.removeEventListener(\"pointermove\", onPointerMove, true);\n window.removeEventListener(\"pointerup\", onMouseEvent, true);\n window.removeEventListener(\"pointerleave\", onPointerLeave, true);\n window.removeEventListener(\"contextmenu\", onContextMenu, true);\n}\n\nfunction onClick(event: MouseEvent): void {\n event.preventDefault();\n event.stopPropagation();\n selectBrick(event.composedPath());\n}\n\nfunction onMouseEvent(event: MouseEvent): void {\n event.preventDefault();\n event.stopPropagation();\n}\n\nconst hoverOnBrick = throttle(\n (eventTargets: EventTarget[]) => {\n const iidList = getPossibleBrickTargets(eventTargets);\n\n if (iidList.length > 0) {\n window.parent.postMessage(\n {\n sender: \"previewer\",\n type: \"hover-on-brick\",\n iidList,\n } as PreviewMessagePreviewerHoverOnBrick,\n previewProxyOrigin\n );\n }\n },\n 100,\n { leading: false }\n);\n\nfunction onPointerDown(event: MouseEvent): void {\n event.preventDefault();\n event.stopPropagation();\n hoverOnBrick(event.composedPath());\n}\n\nfunction onPointerMove(event: MouseEvent): void {\n event.preventDefault();\n event.stopPropagation();\n hoverOnBrick(event.composedPath());\n}\n\nfunction onPointerLeave(event: MouseEvent): void {\n event.preventDefault();\n event.stopPropagation();\n window.parent.postMessage(\n {\n sender: \"previewer\",\n type: \"hover-on-brick\",\n iidList: [],\n } as PreviewMessagePreviewerHoverOnBrick,\n previewProxyOrigin\n );\n}\n\nfunction onContextMenu(event: MouseEvent): void {\n event.preventDefault();\n event.stopPropagation();\n contextMenuOnBrick(event.composedPath(), {\n x: event.clientX,\n y: event.clientY,\n });\n}\n\nfunction contextMenuOnBrick(\n eventTargets: EventTarget[],\n position: {\n x: number;\n y: number;\n }\n): void {\n const iidList = getPossibleBrickTargets(eventTargets);\n if (iidList.length > 0) {\n window.parent.postMessage(\n {\n sender: \"previewer\",\n type: \"context-menu-on-brick\",\n iidList,\n position,\n } as PreviewMessagePreviewerContextMenuOnBrick,\n previewProxyOrigin\n );\n }\n}\n\nfunction selectBrick(eventTargets: EventTarget[]): void {\n const iidList = getPossibleBrickTargets(eventTargets);\n if (iidList.length > 0) {\n window.parent.postMessage(\n {\n sender: \"previewer\",\n type: \"select-brick\",\n iidList,\n } as PreviewMessagePreviewerSelectBrick,\n previewProxyOrigin\n );\n }\n}\n\nexport function getPossibleBrickIidList(brick: HTMLElement): string[] {\n const iidList: string[] = [];\n // Traverse from bottom to up, to find bricks current hover on.\n let cursor: HTMLElement | null = brick;\n while (cursor) {\n if (typeof cursor.dataset.iid === \"string\") {\n iidList.push(cursor.dataset.iid);\n }\n cursor = cursor.parentElement;\n }\n return iidList;\n}\n\nexport function getPossibleBrickTargets(eventTargets: EventTarget[]) {\n const targets: string[] = [];\n for (const target of eventTargets) {\n if (\n target instanceof HTMLElement &&\n typeof target.dataset.iid === \"string\"\n ) {\n targets.push(target.dataset.iid);\n }\n }\n return targets;\n}\n","// istanbul ignore file: nothing logical except calling html2canvas.\nimport html2canvas from \"html2canvas\";\nimport { resizeScreenshot } from \"./resizeScreenshot.js\";\n\nfunction getCanvasBlob(canvas: HTMLCanvasElement): Promise<Blob> {\n return new Promise(function (resolve, reject) {\n canvas.toBlob(function (blob: Blob | null) {\n if (blob) {\n resolve(blob);\n } else {\n reject();\n }\n });\n });\n}\n\nexport async function capture(\n maxWidth: number,\n maxHeight: number\n): Promise<Blob> {\n const sourceCanvas = await html2canvas(document.body, {\n logging: false,\n scale: 1,\n width: window.innerWidth,\n height: window.innerHeight,\n foreignObjectRendering: true,\n });\n const targetCanvas = document.createElement(\"canvas\");\n resizeScreenshot(sourceCanvas, targetCanvas, maxWidth, maxHeight);\n const blob = await getCanvasBlob(targetCanvas);\n return blob;\n}\n","export function resizeScreenshot(\n canvas: HTMLCanvasElement,\n targetCanvas: HTMLCanvasElement,\n maxWidth: number,\n maxHeight: number\n): string {\n const targetRatio = maxWidth / maxHeight;\n const { width, height } = canvas;\n const ratio = width / height;\n const wider = ratio >= targetRatio;\n const finalWidth = wider ? maxWidth : maxHeight * ratio;\n const finalHeight = wider ? maxWidth / ratio : maxHeight;\n targetCanvas.width = finalWidth;\n targetCanvas.height = finalHeight;\n\n const ctx = targetCanvas.getContext(\"2d\")!;\n ctx.drawImage(canvas, 0, 0, width, height, 0, 0, finalWidth, finalHeight);\n return targetCanvas.toDataURL();\n}\n","export function getRealTimeDataAnnotation(value: unknown) {\n const type = typeof value;\n switch (type) {\n case \"string\":\n case \"boolean\":\n case \"number\":\n return {\n type,\n value,\n };\n case \"undefined\":\n return { type };\n }\n if (value === null) {\n return { type: \"null\" };\n }\n if (Array.isArray(value)) {\n return { type: \"array\", length: value.length };\n }\n return { type: \"object\" };\n}\n","import {\n getHistory as _getHistory,\n getBasePath,\n matchPath as _matchPath,\n __secret_internals as _internals,\n type NextLocation,\n} from \"@next-core/runtime\";\nimport type { BrickConf, CustomTemplate, RouteConf } from \"@next-core/types\";\nimport { isEmpty, throttle } from \"lodash\";\nimport type {\n BrickOutline,\n HighLightNode,\n Position,\n PreviewDataOption,\n PreviewMessageFromPreviewer,\n PreviewMessagePreviewContractUpdate,\n PreviewMessagePreviewDataValueError,\n PreviewMessagePreviewDataValueSuccess,\n PreviewMessagePreviewerCaptureFailed,\n PreviewMessagePreviewerCaptureOk,\n PreviewMessagePreviewerContentScroll,\n PreviewMessagePreviewerHighlightBrick,\n PreviewMessagePreviewerHighlightContext,\n PreviewMessagePreviewerHoverOnMain,\n PreviewMessagePreviewerRealTimeDataInspectChange,\n PreviewMessagePreviewerRouteMatchChange,\n PreviewMessagePreviewerScroll,\n PreviewMessagePreviewerUrlChange,\n PreviewMessageToPreviewer,\n PreviewSettings,\n PreviewStartOptions,\n} from \"./interfaces.js\";\nimport { capture } from \"./capture.js\";\nimport {\n previewProxyOrigin,\n getPossibleBrickIidList,\n setPreviewFromOrigin,\n startInspecting,\n stopInspecting,\n} from \"./inspector.js\";\nimport { collectUsedContracts } from \"../collect-used-contracts.js\";\nimport { getRealTimeDataAnnotation } from \"./realTimeDataInspect.js\";\n\nlet connected = false;\n\ninterface DLL {\n (moduleId: \"tYg3\"): {\n getHistory: typeof _getHistory;\n developHelper: typeof _internals;\n };\n (moduleId: \"A+yw\"): {\n matchPath: typeof _matchPath;\n };\n}\n\nlet getHistory = _getHistory;\nlet matchPath = _matchPath;\nlet __secret_internals = _internals;\nlet isV2 = false;\n\n// istanbul ignore next\n// Make v3 bricks compatible with Brick Next v2.\ntry {\n const dll = (window as unknown as { dll?: DLL }).dll;\n if (\n dll &&\n window.BRICK_NEXT_VERSIONS?.[\"brick-container\"]?.startsWith(\"2.\")\n ) {\n const { getHistory: getHistoryV2, developHelper: developHelperV2 } =\n dll(\"tYg3\");\n const { matchPath: matchPathV2 } = dll(\"A+yw\");\n getHistory = getHistoryV2;\n matchPath = matchPathV2;\n // The `__secret_internals` of v3 has pretty the same API as\n // `developHelper` of v2, especially those for preview usage.\n __secret_internals = {\n ...developHelperV2,\n getContextValue(name, { tplStateStoreId }) {\n return developHelperV2.getContextValue(name, {\n tplContextId: tplStateStoreId,\n } as any);\n },\n getAllContextValues({ tplStateStoreId }) {\n // V3 returns an object of key-value.\n // While v2 returns a map of ContextItem.\n const v2Map = developHelperV2.getAllContextValues({\n tplContextId: tplStateStoreId,\n } as any) as unknown as Map<string, { value: unknown }>;\n return Object.fromEntries(\n [...v2Map].map(([k, v]) => [k, (v as any).value])\n );\n },\n };\n isV2 = true;\n }\n} catch (e) {\n // eslint-disable-next-line no-console\n console.error(\"Try to use v2 runtime APIs failed:\", e);\n}\n\nlet contentScrollElement: Element | null = null;\nlet contentScrollHost: Element | null = null;\n\nexport default async function connect(\n previewFromOrigin: string,\n options: PreviewStartOptions\n) {\n if (connected) {\n return;\n }\n connected = true;\n\n const sendMessage = <T extends PreviewMessageFromPreviewer>(\n message: Omit<T, \"sender\">\n ): void => {\n window.parent.postMessage(\n {\n sender: \"previewer\",\n ...message,\n },\n previewFromOrigin\n );\n };\n\n sendMessage({ type: \"preview-started\" });\n setPreviewFromOrigin(previewFromOrigin);\n\n let hoverIid: string;\n let hoverAlias: string;\n let activeIid: string;\n let activeAlias: string;\n\n const handleHoverOnIframe = (pos: Position): void => {\n const element = document.elementFromPoint(pos.x, pos.y);\n if (element?.tagName === \"BODY\") {\n window.parent.postMessage(\n {\n sender: \"previewer\",\n type: \"hover-on-main\",\n isDirection: true,\n position: {\n x: pos.x,\n y: pos.y,\n },\n } as PreviewMessagePreviewerHoverOnMain,\n previewProxyOrigin\n );\n } else {\n const iidList = getPossibleBrickIidList(element as HTMLElement);\n window.parent.postMessage(\n {\n sender: \"previewer\",\n type: \"hover-on-brick\",\n iidList,\n isDirection: true,\n position: {\n x: pos.x,\n y: pos.y,\n },\n },\n previewProxyOrigin\n );\n }\n };\n\n const sendHighlightBrickOutlines = (\n type: \"hover\" | \"active\",\n iid: string,\n alias: string\n ): void => {\n const outlines = getBrickOutlines(iid);\n sendMessage<PreviewMessagePreviewerHighlightBrick>({\n type: \"highlight-brick\",\n highlightType: type,\n outlines,\n iid: iid,\n alias: alias,\n });\n };\n\n const sendHighlightBricksOutlines = (nodes: HighLightNode[]): void => {\n const outlines = nodes\n .map((node) => getBrickOutlines(node.iid, node.alias))\n .flat();\n sendMessage<PreviewMessagePreviewerHighlightContext>({\n type: \"highlight-context\",\n outlines,\n });\n };\n\n let lastTemplatePreviewSettings: PreviewSettings | undefined;\n if (options.templateId) {\n lastTemplatePreviewSettings = options.settings;\n }\n\n const updateTemplatePreviewSettings = (): void => {\n __secret_internals.updateTemplatePreviewSettings(\n options.appId,\n options.templateId!,\n lastTemplatePreviewSettings\n );\n getHistory().reload();\n };\n\n const updateSnippetPreviewSettings = (): void => {\n __secret_internals.updateSnippetPreviewSettings(\n options.appId,\n JSON.parse(options.snippetData)\n );\n getHistory().reload();\n };\n\n /* const updateFormPreviewSettings = (): void => {\n __secret_internals.updateFormPreviewSettings(\n options.appId,\n options.formId,\n options.formData\n );\n getHistory().reload();\n }; */\n\n const handlePreviewData = (name: string, option: PreviewDataOption): void => {\n try {\n const { dataType } = option;\n let tplStateStoreId;\n\n if (dataType === \"state\") {\n tplStateStoreId = getRootTplStateStoreId();\n\n if (!tplStateStoreId) {\n sendMessage<PreviewMessagePreviewDataValueError>({\n type: \"inspect-data-value-error\",\n data: {\n error: {\n message:\n \"tplStateStoreId not found, unable to preview STATE value\",\n },\n },\n });\n\n return;\n }\n }\n\n let value, type: PreviewMessagePreviewDataValueSuccess[\"type\"];\n if (name) {\n type = \"inspect-single-data-value-success\";\n value = __secret_internals.getContextValue(name, {\n tplStateStoreId,\n });\n } else {\n type = \"inspect-all-data-values-success\";\n const data = __secret_internals.getAllContextValues({\n tplStateStoreId,\n });\n value = Object.entries(data).map(([name, value]) => ({ name, value }));\n }\n\n sendMessage<PreviewMessagePreviewDataValueSuccess>({\n type,\n data: {\n name,\n value,\n },\n });\n\n // istanbul ignore next\n } catch (error) {\n sendMessage<PreviewMessagePreviewDataValueError>({\n type: \"inspect-data-value-error\",\n data: {\n message: (error as Error).message,\n },\n });\n }\n };\n\n const history = getHistory();\n\n window.addEventListener(\n \"message\",\n async ({ data, origin }: MessageEvent<PreviewMessageToPreviewer>) => {\n if (\n origin !== previewFromOrigin ||\n !data ||\n data.sender !== \"preview-container\"\n ) {\n return;\n }\n if (data.forwardedFor === \"builder\") {\n switch (data.type) {\n case \"hover-on-brick\":\n hoverIid = data.iid;\n hoverAlias = data.alias;\n sendHighlightBrickOutlines(\"hover\", data.iid, data.alias);\n break;\n case \"hover-on-main\":\n sendHighlightBrickOutlines(\"hover\", \"#main-mount-point\", \"root\");\n break;\n case \"hover-on-context\":\n sendHighlightBricksOutlines(data.highlightNodes);\n break;\n case \"select-brick\":\n activeIid = data.iid;\n activeAlias = data.alias;\n sendHighlightBrickOutlines(\"active\", data.iid, data.alias);\n break;\n case \"hover-on-iframe\":\n handleHoverOnIframe(data.position);\n break;\n }\n } else\n switch (data.type) {\n case \"toggle-inspecting\":\n data.enabled ? startInspecting() : stopInspecting();\n break;\n case \"refresh\":\n if (data.options?.updateStoryboardType) {\n if (data.options.updateStoryboardType === \"route\") {\n __secret_internals.updateStoryboardByRoute(\n options.appId,\n data.storyboardPatch as RouteConf\n );\n } else if (data.options.updateStoryboardType === \"template\") {\n __secret_internals.updateStoryboardByTemplate(\n options.appId,\n data.storyboardPatch as CustomTemplate,\n data.options.settings\n );\n } else if (data.options.updateStoryboardType === \"snippet\") {\n __secret_internals.updateStoryboardBySnippet(\n options.appId,\n data.storyboardPatch as {\n snippetId: string;\n bricks: BrickConf[];\n }\n );\n } /* else if (data.options.updateStoryboardType === \"form\") {\n __secret_internals.updateFormPreviewSettings(\n options.appId,\n options.formId,\n data.storyboardPatch as FormDataProperties\n );\n } */\n\n const newContracts = await (\n __secret_internals as any\n ).getAddedContracts?.(data.storyboardPatch, {\n appId: options.appId,\n updateStoryboardType: data.options.updateStoryboardType,\n formId: options.formId,\n collectUsedContracts,\n });\n\n if (!isEmpty(newContracts)) {\n sendMessage<PreviewMessagePreviewContractUpdate>({\n type: \"contract-update\",\n data: {\n add: newContracts,\n },\n });\n } else {\n getHistory().reload();\n }\n\n break;\n }\n __secret_internals.updateStoryboard(\n options.appId,\n data.storyboardPatch\n );\n if (options.templateId) {\n lastTemplatePreviewSettings = data.settings;\n updateTemplatePreviewSettings();\n } /* else if (options.formId || options.formData) {\n updateFormPreviewSettings();\n } */ else if (data.options?.snippetData) {\n options.snippetData = data.options.snippetData;\n updateSnippetPreviewSettings();\n } else {\n getHistory().reload();\n }\n break;\n case \"reload\":\n location.reload();\n break;\n case \"back\":\n history.goBack();\n break;\n case \"forward\":\n history.goForward();\n break;\n case \"capture\":\n capture(data.maxWidth, data.maxHeight).then(\n (screenshot) => {\n sendMessage<PreviewMessagePreviewerCaptureOk>({\n type: \"capture-ok\",\n screenshot,\n });\n },\n () => {\n sendMessage<PreviewMessagePreviewerCaptureFailed>({\n type: \"capture-failed\",\n });\n }\n );\n break;\n case \"inspect-data-value\":\n handlePreviewData(data.name, data.option);\n break;\n case \"update-preview-url\": {\n // Remove origin first.\n const url = data.previewUrl.startsWith(window.origin)\n ? data.previewUrl.substring(window.origin.length)\n : data.previewUrl;\n // Then remove base path.\n const basePath = getBasePath();\n const to = url.startsWith(basePath)\n ? url.substring(basePath.length - 1)\n : url;\n getHistory().push(to);\n break;\n }\n case \"update-preview-route\": {\n options.routePath = data.routePath;\n options.routeExact = data.routeExact;\n syncRouteMatch();\n break;\n }\n /* case \"excute-proxy-method\": {\n const [ref, method, args = []] = data.proxyMethodArgs;\n try {\n const result = document.body.querySelector(ref)[method](...args);\n window.parent.postMessage({\n sender: \"previewer\",\n type: \"excute-proxy-method-success\",\n data: { method: method, res: result },\n });\n } catch (err) {\n window.parent.postMessage({\n sender: \"previewer\",\n type: \"excute-proxy-method-error\",\n data: { method: method, res: err.message },\n });\n }\n break;\n } */\n }\n }\n );\n\n window.addEventListener(\"scroll\", () => {\n sendMessage<PreviewMessagePreviewerScroll>({\n type: \"scroll\",\n scroll: {\n x: window.scrollX,\n y: window.scrollY,\n },\n });\n });\n\n let previewPageMatch = true;\n let currentLocation: NextLocation;\n const sendLocationChange = (loc: NextLocation): void => {\n sendMessage<PreviewMessagePreviewerUrlChange>({\n type: \"url-change\",\n url: location.origin + history.createHref(loc),\n });\n currentLocation = loc;\n syncRouteMatch();\n };\n\n function syncRouteMatch() {\n if (options.routePath) {\n const match = !!matchPath(currentLocation.pathname, {\n path: options.routePath,\n exact: options.routeExact,\n });\n sendMessage<PreviewMessagePreviewerRouteMatchChange>({\n type: \"route-match-change\",\n match,\n });\n\n // Re-update template preview settings once match route again (typically after login).\n if (options.templateId && !previewPageMatch && match) {\n const mainMountPoint = document.querySelector(\"#main-mount-point\")!;\n const placeholderLoadObserver = new MutationObserver(() => {\n // We observe when the placeholder is appeared.\n if (\n mainMountPoint.childNodes.length === 1 &&\n (mainMountPoint.firstChild as HTMLElement).tagName === \"SPAN\" &&\n mainMountPoint.firstChild!.childNodes.length === 0\n ) {\n updateTemplatePreviewSettings();\n placeholderLoadObserver.disconnect();\n }\n });\n placeholderLoadObserver.observe(mainMountPoint, { childList: true });\n }\n /* if (options.formId && !previewPageMatch && match) {\n const mainMountPoint = document.querySelector(\"#main-mount-point\");\n const placeholderLoadObserver = new MutationObserver(() => {\n // We observe when the placeholder is appeared.\n if (\n mainMountPoint.childNodes.length === 1 &&\n (mainMountPoint.firstChild as HTMLElement).tagName === \"SPAN\" &&\n mainMountPoint.firstChild.childNodes.length === 0\n ) {\n updateFormPreviewSettings();\n placeholderLoadObserver.disconnect();\n }\n });\n placeholderLoadObserver.observe(mainMountPoint, { childList: true });\n } */\n if (options.snippetData && !previewPageMatch && match) {\n const mainMountPoint = document.querySelector(\"#main-mount-point\")!;\n const placeholderLoadObserver = new MutationObserver(() => {\n // We observe when the placeholder is appeared.\n if (\n mainMountPoint.childNodes.length === 1 &&\n (mainMountPoint.firstChild as HTMLElement).tagName === \"SPAN\" &&\n mainMountPoint.firstChild!.childNodes.length === 0\n ) {\n updateSnippetPreviewSettings();\n placeholderLoadObserver.disconnect();\n }\n });\n placeholderLoadObserver.observe(mainMountPoint, { childList: true });\n }\n previewPageMatch = match;\n }\n }\n\n sendLocationChange(history.location);\n\n history.listen(sendLocationChange);\n\n if (options.templateId) {\n updateTemplatePreviewSettings();\n }\n\n /* if (options.formId || options.formData) {\n updateFormPreviewSettings();\n } */\n\n if (options.snippetData) {\n updateSnippetPreviewSettings();\n }\n\n function setupContentScroll() {\n const host = document.querySelector(\"eo-page-view\");\n const element = host?.shadowRoot?.querySelector(\".content\") ?? null;\n if (element !== contentScrollElement) {\n contentScrollElement?.removeEventListener(\"scroll\", onContentScroll);\n element?.addEventListener(\"scroll\", onContentScroll);\n contentScrollElement = element;\n contentScrollHost = host;\n }\n }\n\n function onContentScroll(this: Element) {\n sendMessage<PreviewMessagePreviewerContentScroll>({\n type: \"content-scroll\",\n scroll: {\n x: this.scrollLeft,\n y: this.scrollTop,\n },\n });\n }\n\n __secret_internals.addRealTimeDataInspectHook?.(\n ({ changeType, tplStateStoreId, detail }) => {\n sendMessage<PreviewMessagePreviewerRealTimeDataInspectChange>({\n type: \"real-time-data-inspect-change\",\n changeType,\n tplStateStoreId,\n detail:\n changeType === \"update\"\n ? {\n name: detail.name,\n annotation: getRealTimeDataAnnotation(detail.value),\n }\n : {\n data: Object.fromEntries(\n Object.entries(detail.data).map(([k, v]) => [\n k,\n getRealTimeDataAnnotation(v),\n ])\n ),\n },\n });\n }\n );\n\n let memoizedRootTplStateStoreId: string | undefined;\n\n function setupRealTimeDataInspect(force?: boolean) {\n const tplStateStoreId = options.templateId\n ? getRootTplStateStoreId()\n : undefined;\n if (memoizedRootTplStateStoreId !== tplStateStoreId || force) {\n memoizedRootTplStateStoreId = tplStateStoreId;\n __secret_internals.setRealTimeDataInspectRoot?.({\n tplStateStoreId,\n });\n }\n }\n\n window.addEventListener(\"route.render\", () => {\n setupRealTimeDataInspect(true);\n });\n\n setupContentScroll();\n setupRealTimeDataInspect(true);\n\n const mutationCallback = (): void => {\n setupContentScroll();\n setupRealTimeDataInspect();\n if (hoverIid) {\n sendHighlightBrickOutlines(\"hover\", hoverIid, hoverAlias);\n }\n if (activeIid) {\n sendHighlightBrickOutlines(\"active\", activeIid, activeAlias);\n }\n };\n const mutationObserver = new MutationObserver(\n throttle(mutationCallback, 100, { leading: false })\n );\n mutationObserver.observe(document.body, { subtree: true, childList: true });\n}\n\nfunction getBrickOutlines(iid: string, alias?: string): BrickOutline[] {\n if (!iid) {\n return [];\n }\n const isRoot = iid.includes(\"#\");\n const elements = getElementsIncludingInShadowDOM(iid, isRoot);\n const outlines = getOutlines(elements, alias);\n return isRoot\n ? outlines.map((item) => ({\n ...item,\n height: window.innerHeight - item.top,\n }))\n : outlines;\n}\n\nfunction getElementsIncludingInShadowDOM(\n iid: string,\n isRoot: boolean\n): HTMLElement[] {\n const elements: HTMLElement[] = [];\n\n function walk(root: Document | ShadowRoot) {\n const candidates = root.querySelectorAll<HTMLElement>(\n isRoot ? iid : `[data-iid=\"${iid}\"]`\n );\n elements.push(...candidates);\n\n // If elements are found in the document, we should stop searching in shadow DOM.\n if (root === document && candidates.length > 0) {\n return;\n }\n\n // These useBrick in v3 bricks will be inside shadow DOM.\n for (const item of root.querySelectorAll(\"*\")) {\n if (item.shadowRoot) {\n walk(item.shadowRoot);\n }\n }\n }\n\n walk(document);\n\n return elements;\n}\n\nfunction getOutlines(elements: HTMLElement[], alias?: string): BrickOutline[] {\n return elements.map((element) => {\n const hasContentScroll = contentScrollHost?.contains(element);\n const { width, height, left, top } = element.getBoundingClientRect();\n return {\n width,\n height,\n left:\n left +\n window.scrollX +\n (hasContentScroll ? contentScrollElement.scrollLeft : 0),\n top:\n top +\n window.scrollY +\n (hasContentScroll ? contentScrollElement.scrollTop : 0),\n alias,\n hasContentScroll,\n };\n });\n}\n\nfunction getRootTplStateStoreId(): string | undefined {\n const mainMountPoint = document.querySelector(\"#main-mount-point\")!;\n\n return (mainMountPoint?.firstChild as HTMLElement)?.dataset[\n isV2 ? \"tplContextId\" : \"tplStateStoreId\"\n ];\n}\n"],"names":["collectUsedContracts","storyboard","collection","nodeOrNodes","Set","traverse","node","type","_node$raw","useProvider","raw","add","collect","parseStoryboard","contracts","item","includes","push","customElements","define","createProviderClass","previewProxyOrigin","_capture","_asyncToGenerator","maxWidth","maxHeight","canvas","sourceCanvas","html2canvas","document","body","logging","scale","width","window","innerWidth","height","innerHeight","foreignObjectRendering","targetCanvas","createElement","targetRatio","ratio","wider","finalWidth","finalHeight","getContext","drawImage","toDataURL","resizeScreenshot","Promise","resolve","reject","toBlob","blob","apply","arguments","onClick","event","iidList","preventDefault","stopPropagation","getPossibleBrickTargets","composedPath","length","parent","postMessage","sender","onMouseEvent","hoverOnBrick","throttle","eventTargets","leading","onPointerDown","onPointerMove","onPointerLeave","onContextMenu","position","x","clientX","y","clientY","targets","target","HTMLElement","dataset","iid","getRealTimeDataAnnotation","value","Array","isArray","connected","getHistory","_getHistory","matchPath","_matchPath","__secret_internals","_internals","isV2","_window$BRICK_NEXT_VE","dll","BRICK_NEXT_VERSIONS","startsWith","getHistoryV2","developHelper","developHelperV2","matchPathV2","_objectSpread","getContextValue","name","_ref","tplStateStoreId","tplContextId","getAllContextValues","_ref2","v2Map","Object","fromEntries","map","_ref3","k","v","e","console","error","contentScrollElement","contentScrollHost","connect","_x","_x2","_connect","previewFromOrigin","options","_secret_internals$ad","_secret_internals","hoverIid","hoverAlias","activeIid","activeAlias","sendMessage","message","lastTemplatePreviewSettings","sendHighlightBrickOutlines","alias","outlines","getBrickOutlines","highlightType","templateId","settings","updateTemplatePreviewSettings","appId","reload","updateSnippetPreviewSettings","JSON","parse","snippetData","history","addEventListener","_ref6","_ref5","_data$options","_data$options2","data","origin","forwardedFor","highlightNodes","flat","pos","element","elementFromPoint","tagName","isDirection","brick","cursor","parentElement","getPossibleBrickIidList","handleHoverOnIframe","enabled","removeEventListener","updateStoryboardType","_getAddedContracts","_ref7","updateStoryboardByRoute","storyboardPatch","updateStoryboardByTemplate","updateStoryboardBySnippet","newContracts","getAddedContracts","call","formId","isEmpty","updateStoryboard","location","goBack","goForward","capture","then","screenshot","handlePreviewData","option","dataType","getRootTplStateStoreId","entries","_ref4","url","previewUrl","substring","basePath","getBasePath","to","routePath","routeExact","syncRouteMatch","_x3","scroll","scrollX","scrollY","currentLocation","memoizedRootTplStateStoreId","previewPageMatch","sendLocationChange","loc","createHref","listen","addRealTimeDataInspectHook","_ref8","changeType","detail","annotation","_ref9","setupRealTimeDataInspect","setupContentScroll","MutationObserver","mutationCallback","observe","subtree","childList","match","pathname","path","exact","mainMountPoint","querySelector","placeholderLoadObserver","childNodes","firstChild","disconnect","_host$shadowRoot$quer","_host$shadowRoot","_contentScrollElement","host","shadowRoot","onContentScroll","this","scrollLeft","scrollTop","force","_secret_internals$se","_secret_internals2","undefined","setRealTimeDataInspectRoot","isRoot","elements","walk","root","candidates","querySelectorAll","concat","getElementsIncludingInShadowDOM","_contentScrollHost","hasContentScroll","contains","left","top","getBoundingClientRect","getOutlines","_mainMountPoint$first"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"chunks/9027.56cad5a3.js","mappings":"6LAgCO,SAASA,EAAqBC,GACnC,IAAMC,EArBR,SAAiBC,GACf,IAAMD,EAAa,IAAIE,IAgBvB,OAdAC,EAAAA,EAAAA,GAASF,GAAcG,IACrB,OAAQA,EAAKC,MACX,IAAK,aACL,IAAK,eAAgB,IAAAC,EACbC,EACI,QADOD,EACfF,EAAKI,WAAG,IAAAF,OAAA,EADUA,EAEjBC,YACCA,GACFP,EAAWS,IAAIF,GAGrB,IAGKP,CACT,CAGqBU,EAAQC,EAAAA,EAAAA,IAAgBZ,IAErCa,EAAY,GAElB,IAAK,IAAMC,KAAQb,EACba,EAAKC,SAAS,MAChBF,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A,GAAA,GACb5F,GAAI,IACPqB,OAAQF,OAAOG,YAActB,EAAKkQ,QAEpCjI,CACN,CAqDA,SAASyD,IAA6C,IAAA2E,EAC9CnC,EAAiBpN,SAASqN,cAAc,qBAE9C,OAAQD,SAA0B,QAAZmC,EAAdnC,EAAgBI,kBAAU,IAAA+B,OAAA,EAA3BA,EAA6C/L,QAClDa,EAAO,eAAiB,kBAE5B,C","sources":["webpack:///./src/data-providers/collect-used-contracts.ts","webpack:///./src/data-providers/preview/inspector.ts","webpack:///./src/data-providers/preview/capture.ts","webpack:///./src/data-providers/preview/resizeScreenshot.ts","webpack:///./src/data-providers/preview/realTimeDataInspect.ts","webpack:///./src/data-providers/preview/connect.ts"],"sourcesContent":["import { createProviderClass } from \"@next-core/utils/general\";\nimport {\n type StoryboardNode,\n parseStoryboard,\n traverse,\n} from \"@next-core/storyboard\";\nimport {\n Storyboard,\n UseProviderResolveConf,\n UseProviderEventHandler,\n} from \"@next-core/types\";\n\nfunction collect(nodeOrNodes: StoryboardNode | StoryboardNode[]): Set<string> {\n const collection = new Set<string>();\n\n traverse(nodeOrNodes, (node) => {\n switch (node.type) {\n case \"Resolvable\":\n case \"EventHandler\": {\n const useProvider = (\n node.raw as UseProviderResolveConf | UseProviderEventHandler\n )?.useProvider;\n if (useProvider) {\n collection.add(useProvider);\n }\n }\n }\n });\n\n return collection;\n}\n\nexport function collectUsedContracts(storyboard: Storyboard): string[] {\n const collection = collect(parseStoryboard(storyboard as any));\n\n const contracts = [];\n\n for (const item of collection) {\n if (item.includes(\"@\")) {\n contracts.push(item);\n }\n }\n\n return contracts;\n}\n\ncustomElements.define(\n \"visual-builder.collect-used-contracts\",\n createProviderClass(collectUsedContracts)\n);\n","// istanbul ignore file: working in progress\n// https://github.com/facebook/react/blob/cae635054e17a6f107a39d328649137b83f25972/packages/react-devtools-shared/src/backend/views/Highlighter/index.js\nimport { throttle } from \"lodash\";\nimport type {\n PreviewMessagePreviewerHoverOnBrick,\n PreviewMessagePreviewerSelectBrick,\n PreviewMessagePreviewerContextMenuOnBrick,\n} from \"./interfaces.js\";\n\nexport let previewProxyOrigin: string;\n\nexport function setPreviewFromOrigin(origin: string): void {\n previewProxyOrigin = origin;\n}\n\nexport function startInspecting(): void {\n registerListeners();\n}\n\nexport function stopInspecting(): void {\n unregisterListeners();\n}\n\nfunction registerListeners(): void {\n window.addEventListener(\"click\", onClick, true);\n window.addEventListener(\"mousedown\", onMouseEvent, true);\n window.addEventListener(\"mouseover\", onMouseEvent, true);\n window.addEventListener(\"mouseup\", onMouseEvent, true);\n window.addEventListener(\"pointerdown\", onPointerDown, true);\n window.addEventListener(\"pointermove\", onPointerMove, true);\n window.addEventListener(\"pointerup\", onMouseEvent, true);\n window.addEventListener(\"pointerleave\", onPointerLeave, true);\n window.addEventListener(\"contextmenu\", onContextMenu, true);\n}\n\nfunction unregisterListeners(): void {\n window.removeEventListener(\"click\", onClick, true);\n window.removeEventListener(\"mousedown\", onMouseEvent, true);\n window.removeEventListener(\"mouseover\", onMouseEvent, true);\n window.removeEventListener(\"mouseup\", onMouseEvent, true);\n window.removeEventListener(\"pointerdown\", onPointerDown, true);\n window.removeEventListener(\"pointermove\", onPointerMove, true);\n window.removeEventListener(\"pointerup\", onMouseEvent, true);\n window.removeEventListener(\"pointerleave\", onPointerLeave, true);\n window.removeEventListener(\"contextmenu\", onContextMenu, true);\n}\n\nfunction onClick(event: MouseEvent): void {\n event.preventDefault();\n event.stopPropagation();\n selectBrick(event.composedPath());\n}\n\nfunction onMouseEvent(event: MouseEvent): void {\n event.preventDefault();\n event.stopPropagation();\n}\n\nconst hoverOnBrick = throttle(\n (eventTargets: EventTarget[]) => {\n const iidList = getPossibleBrickTargets(eventTargets);\n\n if (iidList.length > 0) {\n window.parent.postMessage(\n {\n sender: \"previewer\",\n type: \"hover-on-brick\",\n iidList,\n } as PreviewMessagePreviewerHoverOnBrick,\n previewProxyOrigin\n );\n }\n },\n 100,\n { leading: false }\n);\n\nfunction onPointerDown(event: MouseEvent): void {\n event.preventDefault();\n event.stopPropagation();\n hoverOnBrick(event.composedPath());\n}\n\nfunction onPointerMove(event: MouseEvent): void {\n event.preventDefault();\n event.stopPropagation();\n hoverOnBrick(event.composedPath());\n}\n\nfunction onPointerLeave(event: MouseEvent): void {\n event.preventDefault();\n event.stopPropagation();\n window.parent.postMessage(\n {\n sender: \"previewer\",\n type: \"hover-on-brick\",\n iidList: [],\n } as PreviewMessagePreviewerHoverOnBrick,\n previewProxyOrigin\n );\n}\n\nfunction onContextMenu(event: MouseEvent): void {\n event.preventDefault();\n event.stopPropagation();\n contextMenuOnBrick(event.composedPath(), {\n x: event.clientX,\n y: event.clientY,\n });\n}\n\nfunction contextMenuOnBrick(\n eventTargets: EventTarget[],\n position: {\n x: number;\n y: number;\n }\n): void {\n const iidList = getPossibleBrickTargets(eventTargets);\n if (iidList.length > 0) {\n window.parent.postMessage(\n {\n sender: \"previewer\",\n type: \"context-menu-on-brick\",\n iidList,\n position,\n } as PreviewMessagePreviewerContextMenuOnBrick,\n previewProxyOrigin\n );\n }\n}\n\nfunction selectBrick(eventTargets: EventTarget[]): void {\n const iidList = getPossibleBrickTargets(eventTargets);\n if (iidList.length > 0) {\n window.parent.postMessage(\n {\n sender: \"previewer\",\n type: \"select-brick\",\n iidList,\n } as PreviewMessagePreviewerSelectBrick,\n previewProxyOrigin\n );\n }\n}\n\nexport function getPossibleBrickIidList(brick: HTMLElement): string[] {\n const iidList: string[] = [];\n // Traverse from bottom to up, to find bricks current hover on.\n let cursor: HTMLElement | null = brick;\n while (cursor) {\n if (typeof cursor.dataset.iid === \"string\") {\n iidList.push(cursor.dataset.iid);\n }\n cursor = cursor.parentElement;\n }\n return iidList;\n}\n\nexport function getPossibleBrickTargets(eventTargets: EventTarget[]) {\n const targets: string[] = [];\n for (const target of eventTargets) {\n if (\n target instanceof HTMLElement &&\n typeof target.dataset.iid === \"string\"\n ) {\n targets.push(target.dataset.iid);\n }\n }\n return targets;\n}\n","// istanbul ignore file: nothing logical except calling html2canvas.\nimport html2canvas from \"html2canvas\";\nimport { resizeScreenshot } from \"./resizeScreenshot.js\";\n\nfunction getCanvasBlob(canvas: HTMLCanvasElement): Promise<Blob> {\n return new Promise(function (resolve, reject) {\n canvas.toBlob(function (blob: Blob | null) {\n if (blob) {\n resolve(blob);\n } else {\n reject();\n }\n });\n });\n}\n\nexport async function capture(\n maxWidth: number,\n maxHeight: number\n): Promise<Blob> {\n const sourceCanvas = await html2canvas(document.body, {\n logging: false,\n scale: 1,\n width: window.innerWidth,\n height: window.innerHeight,\n foreignObjectRendering: true,\n });\n const targetCanvas = document.createElement(\"canvas\");\n resizeScreenshot(sourceCanvas, targetCanvas, maxWidth, maxHeight);\n const blob = await getCanvasBlob(targetCanvas);\n return blob;\n}\n","export function resizeScreenshot(\n canvas: HTMLCanvasElement,\n targetCanvas: HTMLCanvasElement,\n maxWidth: number,\n maxHeight: number\n): string {\n const targetRatio = maxWidth / maxHeight;\n const { width, height } = canvas;\n const ratio = width / height;\n const wider = ratio >= targetRatio;\n const finalWidth = wider ? maxWidth : maxHeight * ratio;\n const finalHeight = wider ? maxWidth / ratio : maxHeight;\n targetCanvas.width = finalWidth;\n targetCanvas.height = finalHeight;\n\n const ctx = targetCanvas.getContext(\"2d\")!;\n ctx.drawImage(canvas, 0, 0, width, height, 0, 0, finalWidth, finalHeight);\n return targetCanvas.toDataURL();\n}\n","export function getRealTimeDataAnnotation(value: unknown) {\n const type = typeof value;\n switch (type) {\n case \"string\":\n case \"boolean\":\n case \"number\":\n return {\n type,\n value,\n };\n case \"undefined\":\n return { type };\n }\n if (value === null) {\n return { type: \"null\" };\n }\n if (Array.isArray(value)) {\n return { type: \"array\", length: value.length };\n }\n return { type: \"object\" };\n}\n","import {\n getHistory as _getHistory,\n getBasePath,\n matchPath as _matchPath,\n __secret_internals as _internals,\n type NextLocation,\n} from \"@next-core/runtime\";\nimport type { BrickConf, CustomTemplate, RouteConf } from \"@next-core/types\";\nimport { isEmpty, throttle } from \"lodash\";\nimport type {\n BrickOutline,\n HighLightNode,\n Position,\n PreviewDataOption,\n PreviewMessageFromPreviewer,\n PreviewMessagePreviewContractUpdate,\n PreviewMessagePreviewDataValueError,\n PreviewMessagePreviewDataValueSuccess,\n PreviewMessagePreviewerCaptureFailed,\n PreviewMessagePreviewerCaptureOk,\n PreviewMessagePreviewerContentScroll,\n PreviewMessagePreviewerHighlightBrick,\n PreviewMessagePreviewerHighlightContext,\n PreviewMessagePreviewerHoverOnMain,\n PreviewMessagePreviewerRealTimeDataInspectChange,\n PreviewMessagePreviewerRouteMatchChange,\n PreviewMessagePreviewerScroll,\n PreviewMessagePreviewerUrlChange,\n PreviewMessageToPreviewer,\n PreviewSettings,\n PreviewStartOptions,\n} from \"./interfaces.js\";\nimport { capture } from \"./capture.js\";\nimport {\n previewProxyOrigin,\n getPossibleBrickIidList,\n setPreviewFromOrigin,\n startInspecting,\n stopInspecting,\n} from \"./inspector.js\";\nimport { collectUsedContracts } from \"../collect-used-contracts.js\";\nimport { getRealTimeDataAnnotation } from \"./realTimeDataInspect.js\";\n\nlet connected = false;\n\ninterface DLL {\n (moduleId: \"tYg3\"): {\n getHistory: typeof _getHistory;\n developHelper: typeof _internals;\n };\n (moduleId: \"A+yw\"): {\n matchPath: typeof _matchPath;\n };\n}\n\nlet getHistory = _getHistory;\nlet matchPath = _matchPath;\nlet __secret_internals = _internals;\nlet isV2 = false;\n\n// istanbul ignore next\n// Make v3 bricks compatible with Brick Next v2.\ntry {\n const dll = (window as unknown as { dll?: DLL }).dll;\n if (\n dll &&\n window.BRICK_NEXT_VERSIONS?.[\"brick-container\"]?.startsWith(\"2.\")\n ) {\n const { getHistory: getHistoryV2, developHelper: developHelperV2 } =\n dll(\"tYg3\");\n const { matchPath: matchPathV2 } = dll(\"A+yw\");\n getHistory = getHistoryV2;\n matchPath = matchPathV2;\n // The `__secret_internals` of v3 has pretty the same API as\n // `developHelper` of v2, especially those for preview usage.\n __secret_internals = {\n ...developHelperV2,\n getContextValue(name, { tplStateStoreId }) {\n return developHelperV2.getContextValue(name, {\n tplContextId: tplStateStoreId,\n } as any);\n },\n getAllContextValues({ tplStateStoreId }) {\n // V3 returns an object of key-value.\n // While v2 returns a map of ContextItem.\n const v2Map = developHelperV2.getAllContextValues({\n tplContextId: tplStateStoreId,\n } as any) as unknown as Map<string, { value: unknown }>;\n return Object.fromEntries(\n [...v2Map].map(([k, v]) => [k, (v as any).value])\n );\n },\n };\n isV2 = true;\n }\n} catch (e) {\n // eslint-disable-next-line no-console\n console.error(\"Try to use v2 runtime APIs failed:\", e);\n}\n\nlet contentScrollElement: Element | null = null;\nlet contentScrollHost: Element | null = null;\n\nexport default async function connect(\n previewFromOrigin: string,\n options: PreviewStartOptions\n) {\n if (connected) {\n return;\n }\n connected = true;\n\n const sendMessage = <T extends PreviewMessageFromPreviewer>(\n message: Omit<T, \"sender\">\n ): void => {\n window.parent.postMessage(\n {\n sender: \"previewer\",\n ...message,\n },\n previewFromOrigin\n );\n };\n\n sendMessage({ type: \"preview-started\" });\n setPreviewFromOrigin(previewFromOrigin);\n\n let hoverIid: string;\n let hoverAlias: string;\n let activeIid: string;\n let activeAlias: string;\n\n const handleHoverOnIframe = (pos: Position): void => {\n const element = document.elementFromPoint(pos.x, pos.y);\n if (element?.tagName === \"BODY\") {\n window.parent.postMessage(\n {\n sender: \"previewer\",\n type: \"hover-on-main\",\n isDirection: true,\n position: {\n x: pos.x,\n y: pos.y,\n },\n } as PreviewMessagePreviewerHoverOnMain,\n previewProxyOrigin\n );\n } else {\n const iidList = getPossibleBrickIidList(element as HTMLElement);\n window.parent.postMessage(\n {\n sender: \"previewer\",\n type: \"hover-on-brick\",\n iidList,\n isDirection: true,\n position: {\n x: pos.x,\n y: pos.y,\n },\n },\n previewProxyOrigin\n );\n }\n };\n\n const sendHighlightBrickOutlines = (\n type: \"hover\" | \"active\",\n iid: string,\n alias: string\n ): void => {\n const outlines = getBrickOutlines(iid);\n sendMessage<PreviewMessagePreviewerHighlightBrick>({\n type: \"highlight-brick\",\n highlightType: type,\n outlines,\n iid: iid,\n alias: alias,\n });\n };\n\n const sendHighlightBricksOutlines = (nodes: HighLightNode[]): void => {\n const outlines = nodes\n .map((node) => getBrickOutlines(node.iid, node.alias))\n .flat();\n sendMessage<PreviewMessagePreviewerHighlightContext>({\n type: \"highlight-context\",\n outlines,\n });\n };\n\n let lastTemplatePreviewSettings: PreviewSettings | undefined;\n if (options.templateId) {\n lastTemplatePreviewSettings = options.settings;\n }\n\n const updateTemplatePreviewSettings = (): void => {\n __secret_internals.updateTemplatePreviewSettings(\n options.appId,\n options.templateId!,\n lastTemplatePreviewSettings\n );\n getHistory().reload();\n };\n\n const updateSnippetPreviewSettings = (): void => {\n __secret_internals.updateSnippetPreviewSettings(\n options.appId,\n JSON.parse(options.snippetData)\n );\n getHistory().reload();\n };\n\n /* const updateFormPreviewSettings = (): void => {\n __secret_internals.updateFormPreviewSettings(\n options.appId,\n options.formId,\n options.formData\n );\n getHistory().reload();\n }; */\n\n const handlePreviewData = (name: string, option: PreviewDataOption): void => {\n try {\n const { dataType } = option;\n let tplStateStoreId;\n\n if (dataType === \"state\") {\n tplStateStoreId = getRootTplStateStoreId();\n\n if (!tplStateStoreId) {\n sendMessage<PreviewMessagePreviewDataValueError>({\n type: \"inspect-data-value-error\",\n data: {\n error: {\n message:\n \"tplStateStoreId not found, unable to preview STATE value\",\n },\n },\n });\n\n return;\n }\n }\n\n let value, type: PreviewMessagePreviewDataValueSuccess[\"type\"];\n if (name) {\n type = \"inspect-single-data-value-success\";\n value = __secret_internals.getContextValue(name, {\n tplStateStoreId,\n });\n } else {\n type = \"inspect-all-data-values-success\";\n const data = __secret_internals.getAllContextValues({\n tplStateStoreId,\n });\n value = Object.entries(data).map(([name, value]) => ({ name, value }));\n }\n\n sendMessage<PreviewMessagePreviewDataValueSuccess>({\n type,\n data: {\n name,\n value,\n },\n });\n\n // istanbul ignore next\n } catch (error) {\n sendMessage<PreviewMessagePreviewDataValueError>({\n type: \"inspect-data-value-error\",\n data: {\n message: (error as Error).message,\n },\n });\n }\n };\n\n const history = getHistory();\n\n window.addEventListener(\n \"message\",\n async ({ data, origin }: MessageEvent<PreviewMessageToPreviewer>) => {\n if (\n origin !== previewFromOrigin ||\n !data ||\n data.sender !== \"preview-container\"\n ) {\n return;\n }\n if (data.forwardedFor === \"builder\") {\n switch (data.type) {\n case \"hover-on-brick\":\n hoverIid = data.iid;\n hoverAlias = data.alias;\n sendHighlightBrickOutlines(\"hover\", data.iid, data.alias);\n break;\n case \"hover-on-main\":\n sendHighlightBrickOutlines(\"hover\", \"#main-mount-point\", \"root\");\n break;\n case \"hover-on-context\":\n sendHighlightBricksOutlines(data.highlightNodes);\n break;\n case \"select-brick\":\n activeIid = data.iid;\n activeAlias = data.alias;\n sendHighlightBrickOutlines(\"active\", data.iid, data.alias);\n break;\n case \"hover-on-iframe\":\n handleHoverOnIframe(data.position);\n break;\n }\n } else\n switch (data.type) {\n case \"toggle-inspecting\":\n data.enabled ? startInspecting() : stopInspecting();\n break;\n case \"refresh\":\n if (data.options?.updateStoryboardType) {\n if (data.options.updateStoryboardType === \"route\") {\n __secret_internals.updateStoryboardByRoute(\n options.appId,\n data.storyboardPatch as RouteConf\n );\n } else if (data.options.updateStoryboardType === \"template\") {\n __secret_internals.updateStoryboardByTemplate(\n options.appId,\n data.storyboardPatch as CustomTemplate,\n data.options.settings\n );\n } else if (data.options.updateStoryboardType === \"snippet\") {\n __secret_internals.updateStoryboardBySnippet(\n options.appId,\n data.storyboardPatch as {\n snippetId: string;\n bricks: BrickConf[];\n }\n );\n } /* else if (data.options.updateStoryboardType === \"form\") {\n __secret_internals.updateFormPreviewSettings(\n options.appId,\n options.formId,\n data.storyboardPatch as FormDataProperties\n );\n } */\n\n const newContracts = await (\n __secret_internals as any\n ).getAddedContracts?.(data.storyboardPatch, {\n appId: options.appId,\n updateStoryboardType: data.options.updateStoryboardType,\n formId: options.formId,\n collectUsedContracts,\n });\n\n if (!isEmpty(newContracts)) {\n sendMessage<PreviewMessagePreviewContractUpdate>({\n type: \"contract-update\",\n data: {\n add: newContracts,\n },\n });\n } else {\n getHistory().reload();\n }\n\n break;\n }\n __secret_internals.updateStoryboard(\n options.appId,\n data.storyboardPatch\n );\n if (options.templateId) {\n lastTemplatePreviewSettings = data.settings;\n updateTemplatePreviewSettings();\n } /* else if (options.formId || options.formData) {\n updateFormPreviewSettings();\n } */ else if (data.options?.snippetData) {\n options.snippetData = data.options.snippetData;\n updateSnippetPreviewSettings();\n } else {\n getHistory().reload();\n }\n break;\n case \"reload\":\n location.reload();\n break;\n case \"back\":\n history.goBack();\n break;\n case \"forward\":\n history.goForward();\n break;\n case \"capture\":\n capture(data.maxWidth, data.maxHeight).then(\n (screenshot) => {\n sendMessage<PreviewMessagePreviewerCaptureOk>({\n type: \"capture-ok\",\n screenshot,\n });\n },\n () => {\n sendMessage<PreviewMessagePreviewerCaptureFailed>({\n type: \"capture-failed\",\n });\n }\n );\n break;\n case \"inspect-data-value\":\n handlePreviewData(data.name, data.option);\n break;\n case \"update-preview-url\": {\n // Remove origin first.\n const url = data.previewUrl.startsWith(window.origin)\n ? data.previewUrl.substring(window.origin.length)\n : data.previewUrl;\n // Then remove base path.\n const basePath = getBasePath();\n const to = url.startsWith(basePath)\n ? url.substring(basePath.length - 1)\n : url;\n getHistory().push(to);\n break;\n }\n case \"update-preview-route\": {\n options.routePath = data.routePath;\n options.routeExact = data.routeExact;\n syncRouteMatch();\n break;\n }\n /* case \"excute-proxy-method\": {\n const [ref, method, args = []] = data.proxyMethodArgs;\n try {\n const result = document.body.querySelector(ref)[method](...args);\n window.parent.postMessage({\n sender: \"previewer\",\n type: \"excute-proxy-method-success\",\n data: { method: method, res: result },\n });\n } catch (err) {\n window.parent.postMessage({\n sender: \"previewer\",\n type: \"excute-proxy-method-error\",\n data: { method: method, res: err.message },\n });\n }\n break;\n } */\n }\n }\n );\n\n window.addEventListener(\"scroll\", () => {\n sendMessage<PreviewMessagePreviewerScroll>({\n type: \"scroll\",\n scroll: {\n x: window.scrollX,\n y: window.scrollY,\n },\n });\n });\n\n let previewPageMatch = true;\n let currentLocation: NextLocation;\n const sendLocationChange = (loc: NextLocation): void => {\n sendMessage<PreviewMessagePreviewerUrlChange>({\n type: \"url-change\",\n url: location.origin + history.createHref(loc),\n });\n currentLocation = loc;\n syncRouteMatch();\n };\n\n function syncRouteMatch() {\n if (options.routePath) {\n const match = !!matchPath(currentLocation.pathname, {\n path: options.routePath,\n exact: options.routeExact,\n });\n sendMessage<PreviewMessagePreviewerRouteMatchChange>({\n type: \"route-match-change\",\n match,\n });\n\n // Re-update template preview settings once match route again (typically after login).\n if (options.templateId && !previewPageMatch && match) {\n const mainMountPoint = document.querySelector(\"#main-mount-point\")!;\n const placeholderLoadObserver = new MutationObserver(() => {\n // We observe when the placeholder is appeared.\n if (\n mainMountPoint.childNodes.length === 1 &&\n (mainMountPoint.firstChild as HTMLElement).tagName === \"SPAN\" &&\n mainMountPoint.firstChild!.childNodes.length === 0\n ) {\n updateTemplatePreviewSettings();\n placeholderLoadObserver.disconnect();\n }\n });\n placeholderLoadObserver.observe(mainMountPoint, { childList: true });\n }\n /* if (options.formId && !previewPageMatch && match) {\n const mainMountPoint = document.querySelector(\"#main-mount-point\");\n const placeholderLoadObserver = new MutationObserver(() => {\n // We observe when the placeholder is appeared.\n if (\n mainMountPoint.childNodes.length === 1 &&\n (mainMountPoint.firstChild as HTMLElement).tagName === \"SPAN\" &&\n mainMountPoint.firstChild.childNodes.length === 0\n ) {\n updateFormPreviewSettings();\n placeholderLoadObserver.disconnect();\n }\n });\n placeholderLoadObserver.observe(mainMountPoint, { childList: true });\n } */\n if (options.snippetData && !previewPageMatch && match) {\n const mainMountPoint = document.querySelector(\"#main-mount-point\")!;\n const placeholderLoadObserver = new MutationObserver(() => {\n // We observe when the placeholder is appeared.\n if (\n mainMountPoint.childNodes.length === 1 &&\n (mainMountPoint.firstChild as HTMLElement).tagName === \"SPAN\" &&\n mainMountPoint.firstChild!.childNodes.length === 0\n ) {\n updateSnippetPreviewSettings();\n placeholderLoadObserver.disconnect();\n }\n });\n placeholderLoadObserver.observe(mainMountPoint, { childList: true });\n }\n previewPageMatch = match;\n }\n }\n\n sendLocationChange(history.location);\n\n history.listen(sendLocationChange);\n\n if (options.templateId) {\n updateTemplatePreviewSettings();\n }\n\n /* if (options.formId || options.formData) {\n updateFormPreviewSettings();\n } */\n\n if (options.snippetData) {\n updateSnippetPreviewSettings();\n }\n\n function setupContentScroll() {\n const host = document.querySelector(\"eo-page-view\");\n const element = host?.shadowRoot?.querySelector(\".content\") ?? null;\n if (element !== contentScrollElement) {\n contentScrollElement?.removeEventListener(\"scroll\", onContentScroll);\n element?.addEventListener(\"scroll\", onContentScroll);\n contentScrollElement = element;\n contentScrollHost = host;\n }\n }\n\n function onContentScroll(this: Element) {\n sendMessage<PreviewMessagePreviewerContentScroll>({\n type: \"content-scroll\",\n scroll: {\n x: this.scrollLeft,\n y: this.scrollTop,\n },\n });\n }\n\n __secret_internals.addRealTimeDataInspectHook?.(\n ({ changeType, tplStateStoreId, detail }) => {\n sendMessage<PreviewMessagePreviewerRealTimeDataInspectChange>({\n type: \"real-time-data-inspect-change\",\n changeType,\n tplStateStoreId,\n detail:\n changeType === \"update\"\n ? {\n name: detail.name,\n annotation: getRealTimeDataAnnotation(detail.value),\n }\n : {\n data: Object.fromEntries(\n Object.entries(detail.data).map(([k, v]) => [\n k,\n getRealTimeDataAnnotation(v),\n ])\n ),\n },\n });\n }\n );\n\n let memoizedRootTplStateStoreId: string | undefined;\n\n function setupRealTimeDataInspect(force?: boolean) {\n const tplStateStoreId = options.templateId\n ? getRootTplStateStoreId()\n : undefined;\n if (memoizedRootTplStateStoreId !== tplStateStoreId || force) {\n memoizedRootTplStateStoreId = tplStateStoreId;\n __secret_internals.setRealTimeDataInspectRoot?.({\n tplStateStoreId,\n });\n }\n }\n\n window.addEventListener(\"route.render\", () => {\n setupRealTimeDataInspect(true);\n });\n\n setupContentScroll();\n setupRealTimeDataInspect(true);\n\n const mutationCallback = (): void => {\n setupContentScroll();\n setupRealTimeDataInspect();\n if (hoverIid) {\n sendHighlightBrickOutlines(\"hover\", hoverIid, hoverAlias);\n }\n if (activeIid) {\n sendHighlightBrickOutlines(\"active\", activeIid, activeAlias);\n }\n };\n const mutationObserver = new MutationObserver(\n throttle(mutationCallback, 100, { leading: false })\n );\n mutationObserver.observe(document.body, { subtree: true, childList: true });\n}\n\nfunction getBrickOutlines(iid: string, alias?: string): BrickOutline[] {\n if (!iid) {\n return [];\n }\n const isRoot = iid.includes(\"#\");\n const elements = getElementsIncludingInShadowDOM(iid, isRoot);\n const outlines = getOutlines(elements, alias);\n return isRoot\n ? outlines.map((item) => ({\n ...item,\n height: window.innerHeight - item.top,\n }))\n : outlines;\n}\n\nfunction getElementsIncludingInShadowDOM(\n iid: string,\n isRoot: boolean\n): HTMLElement[] {\n const elements: HTMLElement[] = [];\n\n function walk(root: Document | ShadowRoot) {\n const candidates = root.querySelectorAll<HTMLElement>(\n isRoot ? iid : `[data-iid=\"${iid}\"]`\n );\n elements.push(...candidates);\n\n // If elements are found in the document, we should stop searching in shadow DOM.\n if (root === document && candidates.length > 0) {\n return;\n }\n\n // These useBrick in v3 bricks will be inside shadow DOM.\n for (const item of root.querySelectorAll(\"*\")) {\n if (item.shadowRoot) {\n walk(item.shadowRoot);\n }\n }\n }\n\n walk(document);\n\n return elements;\n}\n\nfunction getOutlines(elements: HTMLElement[], alias?: string): BrickOutline[] {\n return elements.map((element) => {\n const hasContentScroll = contentScrollHost?.contains(element);\n const { width, height, left, top } = element.getBoundingClientRect();\n return {\n width,\n height,\n left:\n left +\n window.scrollX +\n (hasContentScroll ? contentScrollElement.scrollLeft : 0),\n top:\n top +\n window.scrollY +\n (hasContentScroll ? contentScrollElement.scrollTop : 0),\n alias,\n hasContentScroll,\n };\n });\n}\n\nfunction getRootTplStateStoreId(): string | undefined {\n const mainMountPoint = document.querySelector(\"#main-mount-point\")!;\n\n return (mainMountPoint?.firstChild as HTMLElement)?.dataset[\n isV2 ? \"tplContextId\" : \"tplStateStoreId\"\n ];\n}\n"],"names":["collectUsedContracts","storyboard","collection","nodeOrNodes","Set","traverse","node","type","_node$raw","useProvider","raw","add","collect","parseStoryboard","contracts","item","includes","push","customElements","define","createProviderClass","previewProxyOrigin","_capture","_asyncToGenerator","maxWidth","maxHeight","canvas","sourceCanvas","html2canvas","document","body","logging","scale","width","window","innerWidth","height","innerHeight","foreignObjectRendering","targetCanvas","createElement","targetRatio","ratio","wider","finalWidth","finalHeight","getContext","drawImage","toDataURL","resizeScreenshot","Promise","resolve","reject","toBlob","blob","apply","arguments","onClick","event","iidList","preventDefault","stopPropagation","getPossibleBrickTargets","composedPath","length","parent","postMessage","sender","onMouseEvent","hoverOnBrick","throttle","eventTargets","leading","onPointerDown","onPointerMove","onPointerLeave","onContextMenu","position","x","clientX","y","clientY","targets","target","HTMLElement","dataset","iid","getRealTimeDataAnnotation","value","Array","isArray","connected","getHistory","_getHistory","matchPath","_matchPath","__secret_internals","_internals","isV2","_window$BRICK_NEXT_VE","dll","BRICK_NEXT_VERSIONS","startsWith","getHistoryV2","developHelper","developHelperV2","matchPathV2","_objectSpread","getContextValue","name","_ref","tplStateStoreId","tplContextId","getAllContextValues","_ref2","v2Map","Object","fromEntries","map","_ref3","k","v","e","console","error","contentScrollElement","contentScrollHost","connect","_x","_x2","_connect","previewFromOrigin","options","_secret_internals$ad","_secret_internals","hoverIid","hoverAlias","activeIid","activeAlias","sendMessage","message","lastTemplatePreviewSettings","sendHighlightBrickOutlines","alias","outlines","getBrickOutlines","highlightType","templateId","settings","updateTemplatePreviewSettings","appId","reload","updateSnippetPreviewSettings","JSON","parse","snippetData","history","addEventListener","_ref6","_ref5","_data$options","_data$options2","data","origin","forwardedFor","highlightNodes","flat","pos","element","elementFromPoint","tagName","isDirection","brick","cursor","parentElement","getPossibleBrickIidList","handleHoverOnIframe","enabled","removeEventListener","updateStoryboardType","_getAddedContracts","_ref7","updateStoryboardByRoute","storyboardPatch","updateStoryboardByTemplate","updateStoryboardBySnippet","newContracts","getAddedContracts","call","formId","isEmpty","updateStoryboard","location","goBack","goForward","capture","then","screenshot","handlePreviewData","option","dataType","getRootTplStateStoreId","entries","_ref4","url","previewUrl","substring","basePath","getBasePath","to","routePath","routeExact","syncRouteMatch","_x3","scroll","scrollX","scrollY","currentLocation","memoizedRootTplStateStoreId","previewPageMatch","sendLocationChange","loc","createHref","listen","addRealTimeDataInspectHook","_ref8","changeType","detail","annotation","_ref9","setupRealTimeDataInspect","setupContentScroll","MutationObserver","mutationCallback","observe","subtree","childList","match","pathname","path","exact","mainMountPoint","querySelector","placeholderLoadObserver","childNodes","firstChild","disconnect","_host$shadowRoot$quer","_host$shadowRoot","_contentScrollElement","host","shadowRoot","onContentScroll","this","scrollLeft","scrollTop","force","_secret_internals$se","_secret_internals2","undefined","setRealTimeDataInspectRoot","isRoot","elements","walk","root","candidates","querySelectorAll","concat","getElementsIncludingInShadowDOM","_contentScrollHost","hasContentScroll","contains","left","top","getBoundingClientRect","getOutlines","_mainMountPoint$first"],"sourceRoot":""}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! For license information please see 9636.ecf3c18b.js.LICENSE.txt */
|
|
2
|
+
"use strict";(self.webpackChunk_next_bricks_visual_builder=self.webpackChunk_next_bricks_visual_builder||[]).push([[9636],{9636:(e,t,n)=>{n.r(t);var r,a,i,o,s,c,l,u,d,h,p,f,m,b,v,g,E=n(4635),w=n(918),A=n(1369),y=n(8449),k=n(6902),N=n(8769),x=n.n(N),O=n(9929),L=n(9938),T=n(7180),I=n(9765),R=n(3373),C=n.n(R);function M(e,t,n){return n(D(e,t))}function _(e,t,n){return e.set(D(e,t),n),n}function S(e,t){return e.get(D(e,t))}function D(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var P,F=(0,L.wrapBrick)("eo-icon"),{defineElement:U,property:W,event:j}=(0,O.createDecorators)(),B=new WeakMap,z=new WeakMap,K=new WeakMap,G=new WeakMap,V=new WeakSet,Y=new WeakMap,H=new WeakMap,X=new WeakMap;class q extends L.ReactNextElement{constructor(){super(...arguments),(0,E.A)(this,V),(0,w.A)(this,B,a(this)),(0,w.A)(this,z,(i(this),o(this))),(0,w.A)(this,K,(s(this),c(this))),(0,w.A)(this,G,(l(this),u(this))),(0,w.A)(this,Y,(p(this),e=>{e!==this.active&&(this.active=e,M(V,this,d).emit(e))})),(0,w.A)(this,H,f(this)),(0,w.A)(this,X,(v(this),()=>{M(V,this,m).emit()}))}get titleLabel(){return S(B,this)}set titleLabel(e){_(B,this,e)}get active(){return S(z,this)}set active(e){_(z,this,e)}get badge(){return S(K,this)}set badge(e){_(K,this,e)}render(){return x().createElement(J,{titleLabel:this.titleLabel,active:this.active,badge:this.badge,onActiveChange:S(Y,this),onFirstActivated:S(X,this)})}}function J(e){var{titleLabel:t,active:n,badge:r,onActiveChange:a,onFirstActivated:i}=e,[o,s]=(0,N.useState)(n),[c,l]=(0,N.useState)(!1);(0,N.useEffect)((()=>{s(n)}),[n]),(0,N.useEffect)((()=>{null==a||a(o)}),[o,a]);var u=(0,N.useCallback)((()=>{s((e=>!e)),c||o||(l(!0),null==i||i())}),[c,o,i]),d=(0,N.useRef)(),[h,p]=(0,N.useState)(!1),f=(0,N.useMemo)((()=>{return e=()=>{p(d.current.scrollTop>0)},r=function(){for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];t&&n(),t=requestAnimationFrame((()=>{e(...a)}))},r.cancel=n=()=>cancelAnimationFrame(t),r;var e,t,n,r}),[]);return x().createElement("div",{className:C()("pane",{scrolled:h})},x().createElement("div",{className:"pane-header",tabIndex:0,onClick:u},x().createElement("div",{className:"pane-title"},x().createElement("span",{className:"title-icon"},o?x().createElement(F,{lib:"antd",theme:"outlined",icon:"down"}):x().createElement(F,{lib:"antd",theme:"outlined",icon:"right"})),x().createElement("div",{className:"title-label"},t),x().createElement("slot",{name:"title"})),x().createElement("slot",{name:"actions"}),r&&x().createElement("div",{className:"badge"},r),x().createElement("div",{className:"pane-scroll-shadow"})),x().createElement("div",{className:"pane-body custom-scrollbar-container",onScroll:f,ref:d},x().createElement("slot",null,x().createElement("div",{style:{padding:"10px 20px",color:"var(--text-color-secondary)"}},"No content"))))}g=q,({e:[a,i,o,s,c,l,u,d,h,p,f,m,b,v],c:[P,r]}=function(e,t,n,r,a,i){var o,s,c,l,u,d,h,p=Symbol.metadata||Symbol.for("Symbol.metadata"),f=Object.defineProperty,m=Object.create,b=[m(null),m(null)],v=t.length;function g(t,n,r){return function(a,i){n&&(i=a,a=e);for(var o=0;o<t.length;o++)i=t[o].apply(a,r?[i]:[]);return r?i:a}}function E(e,t,n,r){if("function"!=typeof e&&(r||void 0!==e))throw new TypeError(t+" must "+(n||"be")+" a function"+(r?"":" or undefined"));return e}function w(e,t,n,r,a,i,c,l,u,d,h){function p(e){if(!h(e))throw new TypeError("Attempted to access private element on non-instance")}var m=[].concat(t[0]),v=t[3],w=!c,A=1===a,k=3===a,N=4===a,x=2===a;function O(t,n,r){return function(a,i){return n&&(i=a,a=e),r&&r(a),L[t].call(a,i)}}if(!w){var L={},T=[],I=k?"get":N||A?"set":"value";if(u?(d||A?L={get:(0,y.A)((function(){return v(this)}),r,"get"),set:function(e){t[4](this,e)}}:L[I]=v,d||(0,y.A)(L[I],r,x?"":I)):d||(L=Object.getOwnPropertyDescriptor(e,r)),!d&&!u){if((s=b[+l][r])&&7!=(s^a))throw new Error("Decorating two elements with the same name ("+L[I].name+") is not supported yet");b[+l][r]=a<3?1:a}}for(var R=e,C=m.length-1;C>=0;C-=n?2:1){var M=m[C],_=n?m[C-1]:void 0,S={},D={kind:["field","accessor","method","getter","setter","class"][a],name:r,metadata:o,addInitializer:function(e,t){if(e.v)throw new Error("attempted to call addInitializer after decoration was finished");E(t,"An initializer","be",!0),i.push(t)}.bind(null,S)};if(w)s=M.call(_,R,D),S.v=1,E(s,"class decorators","return")&&(R=s);else if(D.static=l,D.private=u,s=D.access={has:u?h.bind():function(e){return r in e}},N||(s.get=u?x?function(e){return p(e),L.value}:O("get",0,p):function(e){return e[r]}),x||k||(s.set=u?O("set",0,p):function(e,t){e[r]=t}),R=M.call(_,A?{get:L.get,set:L.set}:L[I],D),S.v=1,A){if("object"==typeof R&&R)(s=E(R.get,"accessor.get"))&&(L.get=s),(s=E(R.set,"accessor.set"))&&(L.set=s),(s=E(R.init,"accessor.init"))&&T.unshift(s);else if(void 0!==R)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else E(R,(d?"field":"method")+" decorators","return")&&(d?T.unshift(R):L[I]=R)}return a<2&&c.push(g(T,l,1),g(i,l,0)),d||w||(u?A?c.splice(-1,0,O("get",l),O("set",l)):c.push(x?L[I]:E.call.bind(L[I])):f(e,r,L)),R}function N(e){return f(e,p,{configurable:!0,enumerable:!0,value:o})}return void 0!==i&&(o=i[p]),o=m(null==o?null:o),u=[],d=function(e){e&&u.push(g(e))},(h=function(t,r){for(var i=0;i<n.length;i++){var o=n[i],s=o[1],d=7&s;if((8&s)==t&&!d==r){var h=o[2],p=!!o[3],f=16&s;w(t?e:e.prototype,o,f,p?"#"+h:(0,A.A)(h),d,d<2?[]:t?l=l||[]:c=c||[],u,!!t,p,r,t&&p?function(t){return(0,k.A)(t)===e}:a)}}})(8,0),h(0,0),h(8,1),h(0,1),d(c),d(l),s=u,v||N(e),{e:s,get c(){var n=[];return v&&[N(e=w(e,[t],0,e.name,5,n)),g(n,1)]}}}(g,[U("visual-builder.workbench-pane",{styleTexts:[T.A,I.A]})],[[W(),1,"titleLabel"],[W({type:Boolean}),1,"active"],[W({type:Number}),1,"badge"],[j({type:"active.change"}),1,"activeChangeEvent",e=>S(G,e),(e,t)=>_(G,e,t)],[j({type:"active.firstActivated"}),1,"activeFirstActivatedEvent",e=>S(H,e),(e,t)=>_(H,e,t)]],0,(e=>X.has((0,k.A)(e))),L.ReactNextElement)),r();var $,Q,Z,ee,te=n(4586),ne=n(2150);function re(e,t){return e.get(ae(e,t))}function ae(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var ie,{defineElement:oe,property:se}=(0,O.createDecorators)(),ce=new WeakMap,le=new WeakMap,ue=new WeakMap,de=new WeakMap;class he extends L.ReactNextElement{constructor(){super(...arguments),(0,w.A)(this,ce,Q(this)),(0,w.A)(this,le,(Z(this),()=>{var e;return null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector("slot:not([name])")})),(0,w.A)(this,ue,(()=>{var e=re(le,this).call(this).assignedNodes();for(var t of e){var n;t.active?t.style.flex=String(null!==(n=t.activeFlex)&&void 0!==n?n:"1"):t.style.flex="initial"}})),(0,w.A)(this,de,(e=>{var t=e.target.assignedNodes();for(var n of t)n.addEventListener("active.change",re(ue,this))})),(0,te.A)(this,"refCallback",(()=>{re(ue,this).call(this);var e=re(le,this).call(this);null==e||e.addEventListener("slotchange",(e=>{re(de,this).call(this,e)}))}))}get titleLabel(){return re(ce,this)}set titleLabel(e){var t,n;n=e,(t=ce).set(ae(t,this),n)}render(){return x().createElement(pe,{titleLabel:this.titleLabel,refCallback:this.refCallback})}}function pe(e){var{titleLabel:t,refCallback:n}=e;return x().createElement("div",{className:"sidebar",ref:n},x().createElement("div",{className:"title-container"},x().createElement("div",{className:"title-label"},t),x().createElement("slot",{name:"titleToolbar"})),x().createElement("div",{className:"pane-container"},x().createElement("slot",null)))}ee=he,({e:[Q,Z],c:[ie,$]}=function(e,t,n,r,a,i){var o,s,c,l,u,d,h,p=Symbol.metadata||Symbol.for("Symbol.metadata"),f=Object.defineProperty,m=Object.create,b=[m(null),m(null)],v=t.length;function g(t,n,r){return function(a,i){n&&(i=a,a=e);for(var o=0;o<t.length;o++)i=t[o].apply(a,r?[i]:[]);return r?i:a}}function E(e,t,n,r){if("function"!=typeof e&&(r||void 0!==e))throw new TypeError(t+" must "+(n||"be")+" a function"+(r?"":" or undefined"));return e}function w(e,t,n,r,a,i,c,l,u,d,h){function p(e){if(!h(e))throw new TypeError("Attempted to access private element on non-instance")}var m=[].concat(t[0]),v=t[3],w=!c,A=1===a,k=3===a,N=4===a,x=2===a;function O(t,n,r){return function(a,i){return n&&(i=a,a=e),r&&r(a),L[t].call(a,i)}}if(!w){var L={},T=[],I=k?"get":N||A?"set":"value";if(u?(d||A?L={get:(0,y.A)((function(){return v(this)}),r,"get"),set:function(e){t[4](this,e)}}:L[I]=v,d||(0,y.A)(L[I],r,x?"":I)):d||(L=Object.getOwnPropertyDescriptor(e,r)),!d&&!u){if((s=b[+l][r])&&7!=(s^a))throw new Error("Decorating two elements with the same name ("+L[I].name+") is not supported yet");b[+l][r]=a<3?1:a}}for(var R=e,C=m.length-1;C>=0;C-=n?2:1){var M=m[C],_=n?m[C-1]:void 0,S={},D={kind:["field","accessor","method","getter","setter","class"][a],name:r,metadata:o,addInitializer:function(e,t){if(e.v)throw new Error("attempted to call addInitializer after decoration was finished");E(t,"An initializer","be",!0),i.push(t)}.bind(null,S)};if(w)s=M.call(_,R,D),S.v=1,E(s,"class decorators","return")&&(R=s);else if(D.static=l,D.private=u,s=D.access={has:u?h.bind():function(e){return r in e}},N||(s.get=u?x?function(e){return p(e),L.value}:O("get",0,p):function(e){return e[r]}),x||k||(s.set=u?O("set",0,p):function(e,t){e[r]=t}),R=M.call(_,A?{get:L.get,set:L.set}:L[I],D),S.v=1,A){if("object"==typeof R&&R)(s=E(R.get,"accessor.get"))&&(L.get=s),(s=E(R.set,"accessor.set"))&&(L.set=s),(s=E(R.init,"accessor.init"))&&T.unshift(s);else if(void 0!==R)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else E(R,(d?"field":"method")+" decorators","return")&&(d?T.unshift(R):L[I]=R)}return a<2&&c.push(g(T,l,1),g(i,l,0)),d||w||(u?A?c.splice(-1,0,O("get",l),O("set",l)):c.push(x?L[I]:E.call.bind(L[I])):f(e,r,L)),R}function N(e){return f(e,p,{configurable:!0,enumerable:!0,value:o})}return void 0!==i&&(o=i[p]),o=m(null==o?null:o),u=[],d=function(e){e&&u.push(g(e))},(h=function(t,r){for(var a=0;a<n.length;a++){var i=n[a],o=i[1],s=7&o;if((8&o)==t&&!s==r){var d=i[2],h=!!i[3],p=16&o;w(t?e:e.prototype,i,p,h?"#"+d:(0,A.A)(d),s,s<2?[]:t?l=l||[]:c=c||[],u,!!t,h,r,t&&h?function(t){return(0,k.A)(t)===e}:undefined)}}})(8,0),h(0,0),h(8,1),h(0,1),d(c),d(l),s=u,v||N(e),{e:s,get c(){var n=[];return v&&[N(e=w(e,[t],0,e.name,5,n)),g(n,1)]}}}(ee,[oe("visual-builder.workbench-sidebar",{styleTexts:[ne.A]})],[[se(),1,"titleLabel"]],0,0,L.ReactNextElement)),$();var fe,me,be,ve,ge,Ee,we,Ae,ye,ke,Ne,xe,Oe=n(5292);function Le(e,t,n){return e.set(Ie(e,t),n),n}function Te(e,t){return e.get(Ie(e,t))}function Ie(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var Re,{defineElement:Ce,property:Me}=(0,O.createDecorators)(),_e=(0,L.wrapBrick)("eo-link"),Se=(0,L.wrapBrick)("eo-icon"),De=new WeakMap,Pe=new WeakMap,Fe=new WeakMap,Ue=new WeakMap,We=new WeakMap;class je extends L.ReactNextElement{constructor(){super(...arguments),(0,w.A)(this,De,me(this)),(0,w.A)(this,Pe,(be(this),ve(this))),(0,w.A)(this,Fe,(ge(this),Ee(this))),(0,w.A)(this,Ue,(we(this),Ae(this))),(0,w.A)(this,We,(ye(this),ke(this))),Ne(this)}get icon(){return Te(De,this)}set icon(e){Le(De,this,e)}get to(){return Te(Pe,this)}set to(e){Le(Pe,this,e)}get active(){return Te(Fe,this)}set active(e){Le(Fe,this,e)}get href(){return Te(Ue,this)}set href(e){Le(Ue,this,e)}get target(){return Te(We,this)}set target(e){Le(We,this,e)}render(){return x().createElement(Be,{to:this.to,icon:this.icon,active:this.active,href:this.href,target:this.target})}}function Be(e){var{icon:t,to:n,active:r,href:a,target:i}=e;return x().createElement(_e,{className:C()("action",{active:r}),url:n,href:a,target:i},x().createElement(Se,t))}xe=je,({e:[me,be,ve,ge,Ee,we,Ae,ye,ke,Ne],c:[Re,fe]}=function(e,t,n,r,a,i){var o,s,c,l,u,d,h,p=Symbol.metadata||Symbol.for("Symbol.metadata"),f=Object.defineProperty,m=Object.create,b=[m(null),m(null)],v=t.length;function g(t,n,r){return function(a,i){n&&(i=a,a=e);for(var o=0;o<t.length;o++)i=t[o].apply(a,r?[i]:[]);return r?i:a}}function E(e,t,n,r){if("function"!=typeof e&&(r||void 0!==e))throw new TypeError(t+" must "+(n||"be")+" a function"+(r?"":" or undefined"));return e}function w(e,t,n,r,a,i,c,l,u,d,h){function p(e){if(!h(e))throw new TypeError("Attempted to access private element on non-instance")}var m=[].concat(t[0]),v=t[3],w=!c,A=1===a,k=3===a,N=4===a,x=2===a;function O(t,n,r){return function(a,i){return n&&(i=a,a=e),r&&r(a),L[t].call(a,i)}}if(!w){var L={},T=[],I=k?"get":N||A?"set":"value";if(u?(d||A?L={get:(0,y.A)((function(){return v(this)}),r,"get"),set:function(e){t[4](this,e)}}:L[I]=v,d||(0,y.A)(L[I],r,x?"":I)):d||(L=Object.getOwnPropertyDescriptor(e,r)),!d&&!u){if((s=b[+l][r])&&7!=(s^a))throw new Error("Decorating two elements with the same name ("+L[I].name+") is not supported yet");b[+l][r]=a<3?1:a}}for(var R=e,C=m.length-1;C>=0;C-=n?2:1){var M=m[C],_=n?m[C-1]:void 0,S={},D={kind:["field","accessor","method","getter","setter","class"][a],name:r,metadata:o,addInitializer:function(e,t){if(e.v)throw new Error("attempted to call addInitializer after decoration was finished");E(t,"An initializer","be",!0),i.push(t)}.bind(null,S)};if(w)s=M.call(_,R,D),S.v=1,E(s,"class decorators","return")&&(R=s);else if(D.static=l,D.private=u,s=D.access={has:u?h.bind():function(e){return r in e}},N||(s.get=u?x?function(e){return p(e),L.value}:O("get",0,p):function(e){return e[r]}),x||k||(s.set=u?O("set",0,p):function(e,t){e[r]=t}),R=M.call(_,A?{get:L.get,set:L.set}:L[I],D),S.v=1,A){if("object"==typeof R&&R)(s=E(R.get,"accessor.get"))&&(L.get=s),(s=E(R.set,"accessor.set"))&&(L.set=s),(s=E(R.init,"accessor.init"))&&T.unshift(s);else if(void 0!==R)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else E(R,(d?"field":"method")+" decorators","return")&&(d?T.unshift(R):L[I]=R)}return a<2&&c.push(g(T,l,1),g(i,l,0)),d||w||(u?A?c.splice(-1,0,O("get",l),O("set",l)):c.push(x?L[I]:E.call.bind(L[I])):f(e,r,L)),R}function N(e){return f(e,p,{configurable:!0,enumerable:!0,value:o})}return void 0!==i&&(o=i[p]),o=m(null==o?null:o),u=[],d=function(e){e&&u.push(g(e))},(h=function(t,r){for(var a=0;a<n.length;a++){var i=n[a],o=i[1],s=7&o;if((8&o)==t&&!s==r){var d=i[2],h=!!i[3],p=16&o;w(t?e:e.prototype,i,p,h?"#"+d:(0,A.A)(d),s,s<2?[]:t?l=l||[]:c=c||[],u,!!t,h,r,t&&h?function(t){return(0,k.A)(t)===e}:undefined)}}})(8,0),h(0,0),h(8,1),h(0,1),d(c),d(l),s=u,v||N(e),{e:s,get c(){var n=[];return v&&[N(e=w(e,[t],0,e.name,5,n)),g(n,1)]}}}(xe,[Ce("visual-builder.workbench-action",{styleTexts:[Oe.A]})],[[Me({attribute:!1}),1,"icon"],[Me(),1,"to"],[Me({type:Boolean}),1,"active"],[Me(),1,"href"],[Me(),1,"target"]],0,0,L.ReactNextElement)),fe();var ze=n(4),Ke=n(1201);function Ge(e,t,n,r){var a=[],i=[],o=[],s=0;return e.forEach((e=>{if(e.key=""===r?"".concat(s):"".concat(r,".").concat(s),function(e){return"group"===e.type}(e)||function(e,t){return Boolean("subMenu"===e.type||void 0)}(e)){var c=Ge(e.items,t,n,e.key);a.push(...c.selectedKeys),(c.selectedKeys.length||e.defaultExpanded)&&i.push(e.key),i.push(...c.openedKeys),o.push(...c.matchedKeys)}else if(function(e,t,n){if(!e.to)return!1;var r="object"==typeof e.to?e.to:(0,Ke.parsePath)(e.to),a=r.pathname.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),i=!!(0,ze.matchPath)(t,{path:a,exact:e.exact});if(i&&e.activeMatchSearch&&(i=Ve(n,r.search)),!i&&Array.isArray(e.activeIncludes))for(var o of e.activeIncludes){var s,c=void 0,l=o.includes("?");if(l&&(c=(0,Ke.parsePath)(o)),(i=!!(0,ze.matchPath)(t,{path:l?c.pathname:o,exact:!0}))&&null!==(s=c)&&void 0!==s&&s.search&&(i=Ve(n,c.search)),i)break}if(i&&Array.isArray(e.activeExcludes))for(var u of e.activeExcludes)if(!(i=!(0,ze.matchPath)(t,{path:u,exact:!0})))break;return i}(e,t,n)){a.push(String(e.key));for(var l=e.key.split("."),u=0;u<l.length;u++)o.push(l.slice(0,u+1).join("."))}s+=1})),a.length&&""!==r&&i.push(r),{selectedKeys:a,openedKeys:i,matchedKeys:o}}function Ve(e,t){var n=new URLSearchParams(e),r=new URLSearchParams(t);for(var[a,i]of r.entries()){var o;if((null!==(o=n.get(a))&&void 0!==o?o:"")!==i)return!1}return!0}var Ye,He,Xe,qe,Je,$e,Qe=n(3430);function Ze(e,t,n){return e.set(tt(e,t),n),n}function et(e,t){return e.get(tt(e,t))}function tt(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var nt,rt,at=(0,L.wrapBrick)("visual-builder.workbench-action"),{defineElement:it,property:ot}=(0,O.createDecorators)(),st=new WeakMap,ct=new WeakMap;class lt extends L.ReactNextElement{constructor(){super(...arguments),(0,w.A)(this,st,He(this)),(0,w.A)(this,ct,(Xe(this),qe(this))),Je(this)}get appId(){return et(st,this)}set appId(e){Ze(st,this,e)}get menu(){return et(ct,this)}set menu(e){Ze(ct,this,e)}render(){return x().createElement(dt,{appId:this.appId,menu:this.menu})}}$e=lt,({e:[He,Xe,qe,Je],c:[nt,Ye]}=function(e,t,n,r,a,i){var o,s,c,l,u,d,h,p=Symbol.metadata||Symbol.for("Symbol.metadata"),f=Object.defineProperty,m=Object.create,b=[m(null),m(null)],v=t.length;function g(t,n,r){return function(a,i){n&&(i=a,a=e);for(var o=0;o<t.length;o++)i=t[o].apply(a,r?[i]:[]);return r?i:a}}function E(e,t,n,r){if("function"!=typeof e&&(r||void 0!==e))throw new TypeError(t+" must "+(n||"be")+" a function"+(r?"":" or undefined"));return e}function w(e,t,n,r,a,i,c,l,u,d,h){function p(e){if(!h(e))throw new TypeError("Attempted to access private element on non-instance")}var m=[].concat(t[0]),v=t[3],w=!c,A=1===a,k=3===a,N=4===a,x=2===a;function O(t,n,r){return function(a,i){return n&&(i=a,a=e),r&&r(a),L[t].call(a,i)}}if(!w){var L={},T=[],I=k?"get":N||A?"set":"value";if(u?(d||A?L={get:(0,y.A)((function(){return v(this)}),r,"get"),set:function(e){t[4](this,e)}}:L[I]=v,d||(0,y.A)(L[I],r,x?"":I)):d||(L=Object.getOwnPropertyDescriptor(e,r)),!d&&!u){if((s=b[+l][r])&&7!=(s^a))throw new Error("Decorating two elements with the same name ("+L[I].name+") is not supported yet");b[+l][r]=a<3?1:a}}for(var R=e,C=m.length-1;C>=0;C-=n?2:1){var M=m[C],_=n?m[C-1]:void 0,S={},D={kind:["field","accessor","method","getter","setter","class"][a],name:r,metadata:o,addInitializer:function(e,t){if(e.v)throw new Error("attempted to call addInitializer after decoration was finished");E(t,"An initializer","be",!0),i.push(t)}.bind(null,S)};if(w)s=M.call(_,R,D),S.v=1,E(s,"class decorators","return")&&(R=s);else if(D.static=l,D.private=u,s=D.access={has:u?h.bind():function(e){return r in e}},N||(s.get=u?x?function(e){return p(e),L.value}:O("get",0,p):function(e){return e[r]}),x||k||(s.set=u?O("set",0,p):function(e,t){e[r]=t}),R=M.call(_,A?{get:L.get,set:L.set}:L[I],D),S.v=1,A){if("object"==typeof R&&R)(s=E(R.get,"accessor.get"))&&(L.get=s),(s=E(R.set,"accessor.set"))&&(L.set=s),(s=E(R.init,"accessor.init"))&&T.unshift(s);else if(void 0!==R)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else E(R,(d?"field":"method")+" decorators","return")&&(d?T.unshift(R):L[I]=R)}return a<2&&c.push(g(T,l,1),g(i,l,0)),d||w||(u?A?c.splice(-1,0,O("get",l),O("set",l)):c.push(x?L[I]:E.call.bind(L[I])):f(e,r,L)),R}function N(e){return f(e,p,{configurable:!0,enumerable:!0,value:o})}return void 0!==i&&(o=i[p]),o=m(null==o?null:o),u=[],d=function(e){e&&u.push(g(e))},(h=function(t,r){for(var a=0;a<n.length;a++){var i=n[a],o=i[1],s=7&o;if((8&o)==t&&!s==r){var d=i[2],h=!!i[3],p=16&o;w(t?e:e.prototype,i,p,h?"#"+d:(0,A.A)(d),s,s<2?[]:t?l=l||[]:c=c||[],u,!!t,h,r,t&&h?function(t){return(0,k.A)(t)===e}:undefined)}}})(8,0),h(0,0),h(8,1),h(0,1),d(c),d(l),s=u,v||N(e),{e:s,get c(){var n=[];return v&&[N(e=w(e,[t],0,e.name,5,n)),g(n,1)]}}}($e,[it("visual-builder.workbench-action-list",{styleTexts:[Qe.A]})],[[ot(),1,"appId"],[ot({attribute:!1}),1,"menu"]],0,0,L.ReactNextElement)),Ye();var ut=new Map;function dt(e){var t,{appId:n,menu:r}=e,a=(0,ze.getHistory)(),[i,o]=(0,N.useState)(),[s,c]=(0,N.useState)(a.location);return(0,N.useEffect)((()=>{var e=a.listen((e=>{c(e)}));return e}),[a]),(0,N.useEffect)((()=>{rt||(rt=n),rt!==n&&(ut.clear(),rt=n)}),[n]),(0,N.useEffect)((()=>{var e,{pathname:t,search:n}=s,{selectedKeys:a}=Ge(null!==(e=null==r?void 0:r.menuItems)&&void 0!==e?e:[],t,n,"");o(Number(a[0]))}),[r,s]),x().createElement("div",{className:"workBenchActionList"},null==r||null===(t=r.menuItems)||void 0===t?void 0:t.map(((e,t)=>{if((e=>"default"===e.type||!e.type)(e)){var n=e.to;return i!==t&&ut.has(t)&&(n=ut.get(t)),x().createElement(at,{key:t,icon:e.icon,to:n,href:e.href,target:e.target,active:i===t,onClick:()=>(e=>{e.href||ut.set(i,"".concat(s.pathname).concat(s.search))})(e)})}})).filter(Boolean))}var ht,pt,ft,mt,bt,vt,gt,Et,wt,At,yt,kt,Nt,xt,Ot,Lt,Tt,It,Rt,Ct,Mt,_t,St,Dt,Pt,Ft,Ut,Wt,jt,Bt,zt,Kt,Gt,Vt,Yt,Ht,Xt,qt,Jt,$t,Qt,Zt,en,tn,nn,rn,an,on,sn,cn,ln,un,dn,hn,pn,fn,mn,bn,vn=n(1030),gn=n(2559),En=n(7758),wn=n(9406),An=n(675),yn=n(7995),kn=n(6275);function Nn(e,t,n){return n(Ln(e,t))}function xn(e,t,n){return e.set(Ln(e,t),n),n}function On(e,t){return e.get(Ln(e,t))}function Ln(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}function Tn(e){return e.key}n(330);var In,{defineElement:Rn,property:Cn,event:Mn}=(0,O.createDecorators)(),_n=new WeakMap,Sn=new WeakMap,Dn=new WeakMap,Pn=new WeakMap,Fn=new WeakMap,Un=new WeakMap,Wn=new WeakMap,jn=new WeakMap,Bn=new WeakMap,zn=new WeakMap,Kn=new WeakMap,Gn=new WeakMap,Vn=new WeakMap,Yn=new WeakMap,Hn=new WeakMap,Xn=new WeakMap,qn=new WeakMap,Jn=new WeakMap,$n=new WeakMap,Qn=new WeakSet,Zn=new WeakMap,er=new WeakMap,tr=new WeakMap,nr=new WeakMap,rr=new WeakMap,ar=new WeakMap,ir=new WeakMap,or=new WeakMap,sr=new WeakMap;class cr extends L.ReactNextElement{constructor(){super(...arguments),(0,E.A)(this,Qn),(0,w.A)(this,_n,pt(this)),(0,w.A)(this,Sn,(ft(this),mt(this))),(0,w.A)(this,Dn,(bt(this),vt(this))),(0,w.A)(this,Pn,(gt(this),Et(this))),(0,w.A)(this,Fn,(wt(this),At(this))),(0,w.A)(this,Un,(yt(this),kt(this))),(0,w.A)(this,Wn,(Nt(this),xt(this))),(0,w.A)(this,jn,(Ot(this),Lt(this))),(0,w.A)(this,Bn,(Tt(this),It(this))),(0,w.A)(this,zn,(Rt(this),Ct(this))),(0,w.A)(this,Kn,(Mt(this),_t(this))),(0,w.A)(this,Gn,(St(this),Dt(this))),(0,w.A)(this,Vn,(Pt(this),Ft(this))),(0,w.A)(this,Yn,(Ut(this),Wt(this))),(0,w.A)(this,Hn,(jt(this),Bt(this))),(0,w.A)(this,Xn,(zt(this),Kt(this))),(0,w.A)(this,qn,(Gt(this),Vt(this))),(0,w.A)(this,Jn,(Yt(this),Ht(this))),(0,w.A)(this,$n,(Xt(this),qt(this))),(0,w.A)(this,Zn,(Qt(this),e=>{Nn(Qn,this,Jt).emit(e)})),(0,w.A)(this,er,Zt(this)),(0,w.A)(this,tr,(nn(this),e=>()=>{Nn(Qn,this,en).emit(e.data)})),(0,w.A)(this,nr,rn(this)),(0,w.A)(this,rr,(sn(this),e=>{Nn(Qn,this,an).emit(e)})),(0,w.A)(this,ar,cn(this)),(0,w.A)(this,ir,(dn(this),e=>t=>{t.preventDefault(),Nn(Qn,this,ln).emit({active:!0,node:null==e?void 0:e.data,x:t.clientX,y:t.clientY})})),(0,w.A)(this,or,hn(this)),(0,w.A)(this,sr,(mn(this),(e,t)=>{Nn(Qn,this,pn).emit({nodeId:e,collapsed:t})}))}get nodes(){return On(_n,this)}set nodes(e){xn(_n,this,e)}get actions(){return On(Sn,this)}set actions(e){xn(Sn,this,e)}get actionsHidden(){return On(Dn,this)}set actionsHidden(e){xn(Dn,this,e)}get placeholder(){return On(Pn,this)}set placeholder(e){xn(Pn,this,e)}get isTransformName(){return On(Fn,this)}set isTransformName(e){xn(Fn,this,e)}get searchPlaceholder(){return On(Un,this)}set searchPlaceholder(e){xn(Un,this,e)}get noSearch(){return On(Wn,this)}set noSearch(e){xn(Wn,this,e)}get activeKey(){return On(jn,this)}set activeKey(e){xn(jn,this,e)}get showMatchedNodeOnly(){return On(Bn,this)}set showMatchedNodeOnly(e){xn(Bn,this,e)}get matchNodeDataFields(){return On(zn,this)}set matchNodeDataFields(e){xn(zn,this,e)}get fixedActionsFor(){return On(Kn,this)}set fixedActionsFor(e){xn(Kn,this,e)}get collapsible(){return On(Gn,this)}set collapsible(e){xn(Gn,this,e)}get collapsedNodes(){return On(Vn,this)}set collapsedNodes(e){xn(Vn,this,e)}get allowDrag(){return On(Yn,this)}set allowDrag(e){xn(Yn,this,e)}get allowDragToRoot(){return On(Hn,this)}set allowDragToRoot(e){xn(Hn,this,e)}get allowDragToInside(){return On(Xn,this)}set allowDragToInside(e){xn(Xn,this,e)}get nodeKey(){return On(qn,this)}set nodeKey(e){xn(qn,this,e)}get skipNotify(){return On(Jn,this)}set skipNotify(e){xn(Jn,this,e)}render(){return x().createElement(gn.e.Provider,{value:{actions:this.actions,actionsHidden:this.actionsHidden,onActionClick:On(Zn,this)}},x().createElement(wn.N.Provider,{value:{activeKey:this.activeKey,basePaddingLeft:5,showMatchedNodeOnly:this.showMatchedNodeOnly,isTransformName:this.isTransformName,fixedActionsFor:this.fixedActionsFor,nodeKey:this.nodeKey,collapsible:this.collapsible,collapsedNodes:this.collapsedNodes,getCollapsedId:Tn,onNodeToggle:On(sr,this),skipNotify:this.skipNotify,clickFactory:On(tr,this),contextMenuFactory:On(ir,this),matchNode:(e,t)=>{var n;return(0,An.U)(e.name,t)||!(null===(n=this.matchNodeDataFields)||void 0===n||!n.length)&&(0,An.U)("*"===this.matchNodeDataFields?e.data:(0,vn.pick)(e.data,this.matchNodeDataFields),t)}}},x().createElement(En.cU,{nodes:this.nodes,placeholder:this.placeholder,searchPlaceholder:this.searchPlaceholder,noSearch:this.noSearch,dropEmit:On(rr,this),allowDrag:this.allowDrag,allowDragToInside:this.allowDragToInside,allowDragToRoot:this.allowDragToRoot})))}}bn=cr,({e:[pt,ft,mt,bt,vt,gt,Et,wt,At,yt,kt,Nt,xt,Ot,Lt,Tt,It,Rt,Ct,Mt,_t,St,Dt,Pt,Ft,Ut,Wt,jt,Bt,zt,Kt,Gt,Vt,Yt,Ht,Xt,qt,Jt,$t,Qt,Zt,en,tn,nn,rn,an,on,sn,cn,ln,un,dn,hn,pn,fn,mn],c:[In,ht]}=function(e,t,n,r,a,i){var o,s,c,l,u,d,h,p=Symbol.metadata||Symbol.for("Symbol.metadata"),f=Object.defineProperty,m=Object.create,b=[m(null),m(null)],v=t.length;function g(t,n,r){return function(a,i){n&&(i=a,a=e);for(var o=0;o<t.length;o++)i=t[o].apply(a,r?[i]:[]);return r?i:a}}function E(e,t,n,r){if("function"!=typeof e&&(r||void 0!==e))throw new TypeError(t+" must "+(n||"be")+" a function"+(r?"":" or undefined"));return e}function w(e,t,n,r,a,i,c,l,u,d,h){function p(e){if(!h(e))throw new TypeError("Attempted to access private element on non-instance")}var m=[].concat(t[0]),v=t[3],w=!c,A=1===a,k=3===a,N=4===a,x=2===a;function O(t,n,r){return function(a,i){return n&&(i=a,a=e),r&&r(a),L[t].call(a,i)}}if(!w){var L={},T=[],I=k?"get":N||A?"set":"value";if(u?(d||A?L={get:(0,y.A)((function(){return v(this)}),r,"get"),set:function(e){t[4](this,e)}}:L[I]=v,d||(0,y.A)(L[I],r,x?"":I)):d||(L=Object.getOwnPropertyDescriptor(e,r)),!d&&!u){if((s=b[+l][r])&&7!=(s^a))throw new Error("Decorating two elements with the same name ("+L[I].name+") is not supported yet");b[+l][r]=a<3?1:a}}for(var R=e,C=m.length-1;C>=0;C-=n?2:1){var M=m[C],_=n?m[C-1]:void 0,S={},D={kind:["field","accessor","method","getter","setter","class"][a],name:r,metadata:o,addInitializer:function(e,t){if(e.v)throw new Error("attempted to call addInitializer after decoration was finished");E(t,"An initializer","be",!0),i.push(t)}.bind(null,S)};if(w)s=M.call(_,R,D),S.v=1,E(s,"class decorators","return")&&(R=s);else if(D.static=l,D.private=u,s=D.access={has:u?h.bind():function(e){return r in e}},N||(s.get=u?x?function(e){return p(e),L.value}:O("get",0,p):function(e){return e[r]}),x||k||(s.set=u?O("set",0,p):function(e,t){e[r]=t}),R=M.call(_,A?{get:L.get,set:L.set}:L[I],D),S.v=1,A){if("object"==typeof R&&R)(s=E(R.get,"accessor.get"))&&(L.get=s),(s=E(R.set,"accessor.set"))&&(L.set=s),(s=E(R.init,"accessor.init"))&&T.unshift(s);else if(void 0!==R)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else E(R,(d?"field":"method")+" decorators","return")&&(d?T.unshift(R):L[I]=R)}return a<2&&c.push(g(T,l,1),g(i,l,0)),d||w||(u?A?c.splice(-1,0,O("get",l),O("set",l)):c.push(x?L[I]:E.call.bind(L[I])):f(e,r,L)),R}function N(e){return f(e,p,{configurable:!0,enumerable:!0,value:o})}return void 0!==i&&(o=i[p]),o=m(null==o?null:o),u=[],d=function(e){e&&u.push(g(e))},(h=function(t,r){for(var i=0;i<n.length;i++){var o=n[i],s=o[1],d=7&s;if((8&s)==t&&!d==r){var h=o[2],p=!!o[3],f=16&s;w(t?e:e.prototype,o,f,p?"#"+h:(0,A.A)(h),d,d<2?[]:t?l=l||[]:c=c||[],u,!!t,p,r,t&&p?function(t){return(0,k.A)(t)===e}:a)}}})(8,0),h(0,0),h(8,1),h(0,1),d(c),d(l),s=u,v||N(e),{e:s,get c(){var n=[];return v&&[N(e=w(e,[t],0,e.name,5,n)),g(n,1)]}}}(bn,[Rn("visual-builder.workbench-tree",{styleTexts:[yn.A,kn.A]})],[[Cn({attribute:!1}),1,"nodes"],[Cn({attribute:!1}),1,"actions"],[Cn({type:Boolean}),1,"actionsHidden"],[Cn(),1,"placeholder"],[Cn({type:Boolean}),1,"isTransformName"],[Cn(),1,"searchPlaceholder"],[Cn({type:Boolean}),1,"noSearch"],[Cn({attribute:!1}),1,"activeKey"],[Cn({type:Boolean}),1,"showMatchedNodeOnly"],[Cn({attribute:!1}),1,"matchNodeDataFields"],[Cn({attribute:!1}),1,"fixedActionsFor"],[Cn({type:Boolean}),1,"collapsible"],[Cn({attribute:!1}),1,"collapsedNodes"],[Cn({type:Boolean}),1,"allowDrag"],[Cn({type:Boolean}),1,"allowDragToRoot"],[Cn({type:Boolean}),1,"allowDragToInside"],[Cn({type:String}),1,"nodeKey"],[Cn({type:Boolean}),1,"skipNotify"],[Mn({type:"action.click"}),1,"actionClickEvent",e=>On($n,e),(e,t)=>xn($n,e,t)],[Mn({type:"node.click"}),1,"nodeClickEvent",e=>On(er,e),(e,t)=>xn(er,e,t)],[Mn({type:"node.drop"}),1,"nodeDropEvent",e=>On(nr,e),(e,t)=>xn(nr,e,t)],[Mn({type:"context.menu"}),1,"nodeContextMenuEvent",e=>On(ar,e),(e,t)=>xn(ar,e,t)],[Mn({type:"node.toggle"}),1,"nodeToggleEvent",e=>On(or,e),(e,t)=>xn(or,e,t)]],0,(e=>sr.has((0,k.A)(e))),L.ReactNextElement)),ht();var lr=n(8438),ur=n(9027);n(6788),customElements.define("visual-builder.inject-preview-agent",(0,lr.createProviderClass)((function(e,t){return(0,ur.A)(e,t)})));var dr,hr,pr,fr,mr,br,vr,gr,Er,wr,Ar,yr,kr,Nr,xr,Or,Lr,Tr,Ir=n(9740),Rr=n(155),Cr=n.n(Rr),Mr=n(1361),_r=n(5502),Sr=function(e){return e.LOAD_MORE="LOAD_MORE",e.LOADING="LOADING",e.NO_DATA="NO_DATA",e.NODE="NODE",e.ADD="ADD",e.EDIT="EDIT",e.DELETE="DELETE",e.IMPORT="IMPORT",e.CLONE="CLONE",e.APPEND_RELATION="APPEND_RELATION",e.UPDATE_RELATION="UPDATE_RELATION",e.REMOVE_RELATION="REMOVE_RELATION",e.ROLLBACK="ROLLBACK",e.ROLLBACK_ALL="ROLLBACK_ALL",e.ADD_FULL="ADD_FULL",e.EDIT_FULL="EDIT_FULL",e.DELETE_FULL="DELETE_FULL",e.IMPORT_FULL="IMPORT_FULL",e.CLONE_FULL="CLONE_FULL",e.APPEND_RELATION_FULL="APPEND_RELATION_FULL",e.UPDATE_RELATION_FULL="UPDATE_RELATION_FULL",e.REMOVE_RELATION_FULL="REMOVE_RELATION_FULL",e.ROLLBACK_FULL="ROLLBACK_FULL",e.ROLLBACK_ALL_FULL="ROLLBACK_ALL_FULL",e.PROJECT="PROJECT",e.USER="USER",e.PERMISSION="PERMISSION",e.BRICK="BRICK",e.ROUTE="ROUTE",e.TEMPLATE="TEMPLATE",e.SNIPPET="SNIPPET",e.I18N="I18N",e.IMAGE="IMAGE",e.FUNCTION="FUNCTION",e.MENU="MENU",e.MENU_ITEM="MENU_ITEM",e.WORKFLOW="WORKFLOW",e}({}),Dr="bricks/visual-builder/workbench-history-action",Pr=n(6330),Fr=n(5290),Ur=function(){var e=(0,Pr.A)((function*(e,t,n){return(yield Fr.http.get("api/gateway/next_builder.workspace.GetChangeHistory/api/v1/next-builder/workspace/".concat(e,"/changes"),(0,Ir.A)((0,Ir.A)({},n),{},{params:t}))).data}));return function(t,n,r){return e.apply(this,arguments)}}(),Wr=n(8799),jr={add:"".concat(Dr,":").concat(Sr.ADD),edit:"".concat(Dr,":").concat(Sr.EDIT),delete:"".concat(Dr,":").concat(Sr.DELETE),batch_delete:"".concat(Dr,":").concat(Sr.DELETE),import:"".concat(Dr,":").concat(Sr.IMPORT),clone:"".concat(Dr,":").concat(Sr.CLONE),append_relation:"".concat(Dr,":").concat(Sr.APPEND_RELATION),update_relation:"".concat(Dr,":").concat(Sr.UPDATE_RELATION),remove_relation:"".concat(Dr,":").concat(Sr.REMOVE_RELATION),rollback:"".concat(Dr,":").concat(Sr.ROLLBACK),rollback_all:"".concat(Dr,":").concat(Sr.ROLLBACK_ALL)},Br={add:"".concat(Dr,":").concat(Sr.ADD_FULL),edit:"".concat(Dr,":").concat(Sr.EDIT_FULL),delete:"".concat(Dr,":").concat(Sr.DELETE_FULL),batch_delete:"".concat(Dr,":").concat(Sr.DELETE_FULL),import:"".concat(Dr,":").concat(Sr.IMPORT_FULL),clone:"".concat(Dr,":").concat(Sr.CLONE_FULL),append_relation:"".concat(Dr,":").concat(Sr.APPEND_RELATION_FULL),update_relation:"".concat(Dr,":").concat(Sr.UPDATE_RELATION_FULL),remove_relation:"".concat(Dr,":").concat(Sr.REMOVE_RELATION_FULL),rollback:"".concat(Dr,":").concat(Sr.ROLLBACK_FULL),rollback_all:"".concat(Dr,":").concat(Sr.ROLLBACK_ALL_FULL)},zr={project:"".concat(Dr,":").concat(Sr.PROJECT),userGroup:"".concat(Dr,":").concat(Sr.USER),permission:"".concat(Dr,":").concat(Sr.PERMISSION),brick:"".concat(Dr,":").concat(Sr.BRICK),route:"".concat(Dr,":").concat(Sr.ROUTE),template:"".concat(Dr,":").concat(Sr.TEMPLATE),snippet:"".concat(Dr,":").concat(Sr.SNIPPET),i18n:"".concat(Dr,":").concat(Sr.I18N),image:"".concat(Dr,":").concat(Sr.IMAGE),function:"".concat(Dr,":").concat(Sr.FUNCTION),menu:"".concat(Dr,":").concat(Sr.MENU),menuItem:"".concat(Dr,":").concat(Sr.MENU_ITEM),workflow:"".concat(Dr,":").concat(Sr.WORKFLOW)},Kr={PROJECT_MICRO_APP:"".concat(Dr,":").concat(Sr.PROJECT),"MICRO_APP_USER_GROUP@EASYOPS":"".concat(Dr,":").concat(Sr.USER),MICRO_APP_RESOURCE_PERMISSION:"".concat(Dr,":").concat(Sr.PERMISSION),STORYBOARD_BRICK:"".concat(Dr,":").concat(Sr.BRICK),STORYBOARD_ROUTE:"".concat(Dr,":").concat(Sr.ROUTE),STORYBOARD_TEMPLATE:"".concat(Dr,":").concat(Sr.TEMPLATE),STORYBOARD_SNIPPET:"".concat(Dr,":").concat(Sr.SNIPPET),STORYBOARD_I18N:"".concat(Dr,":").concat(Sr.I18N),MICRO_APP_RESOURCE_IMAGE:"".concat(Dr,":").concat(Sr.IMAGE),STORYBOARD_FUNCTION:"".concat(Dr,":").concat(Sr.FUNCTION),MICRO_APP_RESOURCE_MENU:"".concat(Dr,":").concat(Sr.MENU),MICRO_APP_RESOURCE_MENU_ITEM:"".concat(Dr,":").concat(Sr.MENU_ITEM),"WORKFLOW_DEF@EASYOPS":"".concat(Dr,":").concat(Sr.WORKFLOW)};function Gr(e){var t,n,r,a,i,o,s,c,l,u,d,h,p,f,m,b,v,g="rollback"!==e.action||e.rollBackIdInfo?e.action:"rollback_all",E=Wr.i18n.t(null!==(t=zr[e.category])&&void 0!==t?t:e.category),w=Wr.i18n.t(null!==(n=jr[g])&&void 0!==n?n:g),A=Wr.i18n.t(null!==(r=Kr[null===(a=e.abstract)||void 0===a?void 0:a.leftObjectId])&&void 0!==r?r:null===(i=e.abstract)||void 0===i?void 0:i.leftObjectId),y=Wr.i18n.t(null!==(o=Kr[null===(s=e.abstract)||void 0===s?void 0:s.rightObjectId])&&void 0!==o?o:null===(c=e.abstract)||void 0===c?void 0:c.rightObjectId),k=Vr(null===(l=e.abstract)||void 0===l?void 0:l.nodes,null===(u=e.abstract)||void 0===u?void 0:u.nodesCount),N=Vr(null===(d=e.abstract)||void 0===d?void 0:d.leftNodes,null===(h=e.abstract)||void 0===h?void 0:h.leftNodesCount),x=Vr(null===(p=e.abstract)||void 0===p?void 0:p.rightNodes,null===(f=e.abstract)||void 0===f?void 0:f.rightNodesCount),O="rollback"===g?Gr(e.rollBackIdInfo).abstract:null;return{category:E,action:w,leftObjectId:A,rightObjectId:y,nodes:k,leftNodes:N,rightNodes:x,abstract:Wr.i18n.t(null!==(m=Br[g])&&void 0!==m?m:g,{category:E,nodes:k,leftNodes:N,rightNodes:x,nodeChanges:null===(b=e.abstract)||void 0===b||null===(b=b.nodeChanges)||void 0===b?void 0:b.join(", "),relationChanges:null===(v=e.abstract)||void 0===v||null===(v=v.relationChanges)||void 0===v?void 0:v.join(", "),leftObjectId:A,rightObjectId:y,rollbackAbstract:O}),rollbackAbstract:O}}function Vr(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:", ";return Wr.i18n.t("".concat(Dr,":").concat(Sr.NODE),{nodes:e.join(n),context:t>e.length?"ellipsis":void 0,count:t})}function Yr(e,t,n){return n(qr(e,t))}function Hr(e,t,n){return e.set(qr(e,t),n),n}function Xr(e,t){return e.get(qr(e,t))}function qr(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}(0,_r.initializeReactI18n)(Dr,{en:{LOAD_MORE:"Load more",LOADING:"Loading",NO_DATA:"No data",NODE:"{{ nodes }}",NODE_ellipsis:"{{ nodes }} etc., a total of {{ count }} items",ADD:"Add node",EDIT:"Edit node",DELETE:"Delete node",IMPORT:"Batch import node",CLONE:"Clone node",APPEND_RELATION:"Append Relation",UPDATE_RELATION:"Update Relation",REMOVE_RELATION:"Remove Relation",ROLLBACK:"Rollback",ROLLBACK_ALL:"Rollback all operations",ADD_FULL:"Add {{ category }} ({{ nodes }})",EDIT_FULL:"Edit {{ nodeChanges }} of {{ category }} ({{ nodes }})",DELETE_FULL:"Delete {{ category }} ({{ nodes }})",IMPORT_FULL:"Batch Import {{ category }} ({{ nodes }})",CLONE_FULL:"Clone {{ category }} ({{ nodes }})",APPEND_RELATION_FULL:"Append the relation between {{ leftObjectId }} ({{ leftNodes }}) and {{ rightObjectId }} ({{ rightNodes }})",UPDATE_RELATION_FULL:"Update the relation between {{ leftObjectId }} ({{ leftNodes }}) and {{ rightObjectId }} ({{ rightNodes }})",REMOVE_RELATION_FULL:"Remove the relation between {{ leftObjectId }} ({{ leftNodes }}) and {{ rightObjectId }} ({{ rightNodes }})",ROLLBACK_FULL:"Rollback to [{{ rollbackAbstract }}]",ROLLBACK_ALL_FULL:"Rollback all operations",PROJECT:"Project",USER:"User Group",PERMISSION:"Permission",BRICK:"Brick",ROUTE:"Route",TEMPLATE:"Template",SNIPPET:"Snippet",I18N:"I18N",IMAGE:"Image",FUNCTION:"Function",MENU:"Menu",MENU_ITEM:"Menu item",WORKFLOW:"Workflow"},zh:{LOAD_MORE:"加载更多",LOADING:"加载中",NO_DATA:"没有数据",NODE:"{{ nodes }}",NODE_ellipsis:"{{ nodes }}等共{{ count }}项",ADD:"新增节点",EDIT:"编辑节点",DELETE:"删除节点",IMPORT:"批量导入节点",CLONE:"克隆节点",APPEND_RELATION:"添加关系",UPDATE_RELATION:"更新关系",REMOVE_RELATION:"移除关系",ROLLBACK:"回滚",ROLLBACK_ALL:"回滚全部操作",ADD_FULL:"新增{{ category }}({{ nodes }})",EDIT_FULL:"编辑{{ category }}({{ nodes }})的 {{ nodeChanges }}",DELETE_FULL:"删除{{ category }}({{ nodes }})",IMPORT_FULL:"批量导入{{ category }}({{ nodes }})",CLONE_FULL:"克隆{{ category }}({{ nodes }})",APPEND_RELATION_FULL:"添加{{ leftObjectId }}({{ leftNodes }})和{{ rightObjectId }}({{ rightNodes }})的关系",UPDATE_RELATION_FULL:"更新{{ leftObjectId }}({{ leftNodes }})和{{ rightObjectId }}({{ rightNodes }})的关系",REMOVE_RELATION_FULL:"移除{{ leftObjectId }}({{ leftNodes }})和{{ rightObjectId }}({{ rightNodes }})的关系",ROLLBACK_FULL:"回滚到【{{ rollbackAbstract }}】",ROLLBACK_ALL_FULL:"回滚全部操作",PROJECT:"项目",USER:"用户组",PERMISSION:"权限点",BRICK:"构件",ROUTE:"路由",TEMPLATE:"模版",SNIPPET:"片段",I18N:"国际化",IMAGE:"图片",FUNCTION:"函数",MENU:"菜单",MENU_ITEM:"菜单项",WORKFLOW:"工作流"}});var Jr,{defineElement:$r,property:Qr,event:Zr}=(0,O.createDecorators)(),ea=(0,L.wrapBrick)("eo-button"),ta=(0,L.wrapBrick)("eo-link"),na=(0,L.wrapBrick)("eo-icon"),ra=(0,L.wrapBrick)("eo-easyops-avatar"),aa=(0,L.wrapBrick)("eo-popover",{onVisibleChange:"visible.change",beforeVisibleChange:"before.visible.change"}),ia=new WeakMap,oa=new WeakMap,sa=new WeakMap,ca=new WeakSet,la=new WeakMap,ua=new WeakMap,da=new WeakMap,ha=new WeakMap,pa=new WeakMap;class fa extends L.ReactNextElement{constructor(){super(...arguments),(0,E.A)(this,ca),(0,w.A)(this,ia,hr(this)),(0,w.A)(this,oa,(pr(this),fr(this))),(0,w.A)(this,sa,(mr(this),br(this))),(0,w.A)(this,la,(Er(this),e=>{Yr(ca,this,vr).emit(e)})),(0,w.A)(this,ua,wr(this)),(0,w.A)(this,da,(kr(this),e=>{Yr(ca,this,Ar).emit(e)})),(0,w.A)(this,ha,Nr(this)),(0,w.A)(this,pa,(Lr(this),()=>{Yr(ca,this,xr).emit()}))}get appId(){return Xr(ia,this)}set appId(e){Hr(ia,this,e)}get projectId(){return Xr(oa,this)}set projectId(e){Hr(oa,this,e)}render(){return x().createElement(ma,{appId:this.appId,projectId:this.projectId,onHistoryItemClick:Xr(la,this),onRollback:Xr(da,this),onRollbackAll:Xr(pa,this)})}}function ma(e){var{appId:t,onHistoryItemClick:n,onRollback:r,onRollbackAll:a}=e,{t:i}=(0,_r.useTranslation)(Dr),[o,s]=(0,N.useState)(!1),[c,l]=(0,N.useState)(!0),[u,d]=(0,N.useState)(!1),[h,p]=(0,N.useState)([]),f=(0,N.useRef)(""),m=e=>{s(!0),Ur(t,{ts:f.current,limit:20}).then((t=>{p((n=>{var r=t.list.map((e=>(0,Ir.A)((0,Ir.A)({},e),{},{translation:Gr(e)})));return e?r:n.concat(r)})),f.current=t.ts,d(t.list.length<20),l(t.list.length<20)})).catch((e=>{(0,ze.handleHttpError)(e)})).finally((()=>{s(!1)}))};return x().createElement(aa,{placement:"bottom",trigger:"click",arrow:!0,arrowColor:"var(--color-fill-bg-container-4)",beforeVisibleChange:e=>{e.detail&&(l(!0),d(!1),p([]),f.current="",m(!0))}},x().createElement(ea,{slot:"anchor",shape:"circle",className:"history-action",icon:{lib:"antd",icon:"history",theme:"outlined"}}),x().createElement("div",null,x().createElement("div",{className:"history-title"},"History"),x().createElement("div",{className:"history-list"},h.length?x().createElement(x().Fragment,null,h.map(((e,t)=>x().createElement(ba,{key:"".concat(e.uniqueKey,"-").concat(e.ts),data:e,enableRollback:0!==t&&"rollback"!==e.action,current:0===t,onHistoryItemClick:n,onRollback:r}))),!c&&x().createElement("span",{className:"load-more-container"},x().createElement(ta,{className:"load-more",disabled:o,onClick:()=>m()},i(Sr.LOAD_MORE))),u&&x().createElement("span",{className:"end-container"},"The End",x().createElement(na,{className:"rollback-all",lib:"antd",icon:"rollback",theme:"outlined",onClick:()=>a()}))):x().createElement("div",{className:"empty"},i(o?Sr.LOADING:Sr.NO_DATA))),x().createElement("slot",null)))}function ba(e){var{data:t,enableRollback:n,current:r,onHistoryItemClick:a,onRollback:i}=e,o=Cr()(Number(t.ts)/1e6),s=Cr().duration(o.diff(Cr()())),c=s.days()<=-1?o.format("YYYY-MM-DD HH:mm:ss"):s.humanize(!0,{ss:0,s:60,m:60,h:24});return x().createElement("div",{className:"item-container"},x().createElement("div",{className:"item-title"},x().createElement("div",{className:"title-left",onClick:()=>a((0,Ir.A)((0,Ir.A)({},t),{},{enableRollback:n}))},x().createElement("div",{className:"topic",title:t.translation.abstract},t.translation.abstract),r&&x().createElement("div",{className:"branch"},"(current)")),x().createElement("div",{className:"title-right"},n&&x().createElement(na,{className:"rollback",lib:"antd",icon:"rollback",theme:"outlined",onClick:()=>i(t)}))),x().createElement("div",{className:"item-info"},x().createElement(ra,{className:"avatar",nameOrInstanceId:t.user,size:"xs"}),x().createElement("div",{className:"time"},c),x().createElement("div",{className:"operator"},t.user)))}Tr=fa,({e:[hr,pr,fr,mr,br,vr,gr,Er,wr,Ar,yr,kr,Nr,xr,Or,Lr],c:[Jr,dr]}=function(e,t,n,r,a,i){var o,s,c,l,u,d,h,p=Symbol.metadata||Symbol.for("Symbol.metadata"),f=Object.defineProperty,m=Object.create,b=[m(null),m(null)],v=t.length;function g(t,n,r){return function(a,i){n&&(i=a,a=e);for(var o=0;o<t.length;o++)i=t[o].apply(a,r?[i]:[]);return r?i:a}}function E(e,t,n,r){if("function"!=typeof e&&(r||void 0!==e))throw new TypeError(t+" must "+(n||"be")+" a function"+(r?"":" or undefined"));return e}function w(e,t,n,r,a,i,c,l,u,d,h){function p(e){if(!h(e))throw new TypeError("Attempted to access private element on non-instance")}var m=[].concat(t[0]),v=t[3],w=!c,A=1===a,k=3===a,N=4===a,x=2===a;function O(t,n,r){return function(a,i){return n&&(i=a,a=e),r&&r(a),L[t].call(a,i)}}if(!w){var L={},T=[],I=k?"get":N||A?"set":"value";if(u?(d||A?L={get:(0,y.A)((function(){return v(this)}),r,"get"),set:function(e){t[4](this,e)}}:L[I]=v,d||(0,y.A)(L[I],r,x?"":I)):d||(L=Object.getOwnPropertyDescriptor(e,r)),!d&&!u){if((s=b[+l][r])&&7!=(s^a))throw new Error("Decorating two elements with the same name ("+L[I].name+") is not supported yet");b[+l][r]=a<3?1:a}}for(var R=e,C=m.length-1;C>=0;C-=n?2:1){var M=m[C],_=n?m[C-1]:void 0,S={},D={kind:["field","accessor","method","getter","setter","class"][a],name:r,metadata:o,addInitializer:function(e,t){if(e.v)throw new Error("attempted to call addInitializer after decoration was finished");E(t,"An initializer","be",!0),i.push(t)}.bind(null,S)};if(w)s=M.call(_,R,D),S.v=1,E(s,"class decorators","return")&&(R=s);else if(D.static=l,D.private=u,s=D.access={has:u?h.bind():function(e){return r in e}},N||(s.get=u?x?function(e){return p(e),L.value}:O("get",0,p):function(e){return e[r]}),x||k||(s.set=u?O("set",0,p):function(e,t){e[r]=t}),R=M.call(_,A?{get:L.get,set:L.set}:L[I],D),S.v=1,A){if("object"==typeof R&&R)(s=E(R.get,"accessor.get"))&&(L.get=s),(s=E(R.set,"accessor.set"))&&(L.set=s),(s=E(R.init,"accessor.init"))&&T.unshift(s);else if(void 0!==R)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else E(R,(d?"field":"method")+" decorators","return")&&(d?T.unshift(R):L[I]=R)}return a<2&&c.push(g(T,l,1),g(i,l,0)),d||w||(u?A?c.splice(-1,0,O("get",l),O("set",l)):c.push(x?L[I]:E.call.bind(L[I])):f(e,r,L)),R}function N(e){return f(e,p,{configurable:!0,enumerable:!0,value:o})}return void 0!==i&&(o=i[p]),o=m(null==o?null:o),u=[],d=function(e){e&&u.push(g(e))},(h=function(t,r){for(var i=0;i<n.length;i++){var o=n[i],s=o[1],d=7&s;if((8&s)==t&&!d==r){var h=o[2],p=!!o[3],f=16&s;w(t?e:e.prototype,o,f,p?"#"+h:(0,A.A)(h),d,d<2?[]:t?l=l||[]:c=c||[],u,!!t,p,r,t&&p?function(t){return(0,k.A)(t)===e}:a)}}})(8,0),h(0,0),h(8,1),h(0,1),d(c),d(l),s=u,v||N(e),{e:s,get c(){var n=[];return v&&[N(e=w(e,[t],0,e.name,5,n)),g(n,1)]}}}(Tr,[$r("visual-builder.workbench-history-action",{styleTexts:[Mr.A]})],[[Qr(),1,"appId"],[Qr(),1,"projectId"],[Zr({type:"history.item.click"}),1,"historyItemClickEvent",e=>Xr(sa,e),(e,t)=>Hr(sa,e,t)],[Zr({type:"rollback"}),1,"rollbackEvent",e=>Xr(ua,e),(e,t)=>Hr(ua,e,t)],[Zr({type:"rollback.all"}),1,"rollbackAllEvent",e=>Xr(ha,e),(e,t)=>Hr(ha,e,t)]],0,(e=>pa.has((0,k.A)(e))),L.ReactNextElement)),dr();var va,ga,Ea,wa,Aa,ya,ka,Na,xa,Oa,La,Ta,Ia,Ra,Ca,Ma,_a,Sa,Da,Pa,Fa,Ua,Wa,ja,Ba,za,Ka,Ga,Va,Ya,Ha,Xa,qa,Ja,$a,Qa,Za,ei,ti,ni,ri,ai,ii,oi,si,ci,li,ui,di,hi,pi,fi,mi,bi,vi=n(2381);function gi(e,t,n){return n(Ai(e,t))}function Ei(e,t,n){return e.set(Ai(e,t),n),n}function wi(e,t){return e.get(Ai(e,t))}function Ai(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var yi,{defineElement:ki,property:Ni,event:xi}=(0,O.createDecorators)(),Oi=(0,L.wrapBrick)("eo-icon"),Li=(0,L.wrapBrick)("eo-tooltip"),Ti=new Set,Ii=new WeakMap,Ri=new WeakMap,Ci=new WeakMap,Mi=new WeakMap,_i=new WeakMap,Si=new WeakMap,Di=new WeakMap,Pi=new WeakMap,Fi=new WeakMap,Ui=new WeakSet,Wi=new WeakMap,ji=new WeakMap,Bi=new WeakMap,zi=new WeakMap,Ki=new WeakMap,Gi=new WeakMap,Vi=new WeakMap,Yi=new WeakMap,Hi=new WeakMap,Xi=new WeakMap,qi=new WeakMap,Ji=new WeakMap,$i=new WeakMap,Qi=new WeakMap,Zi=new WeakMap,eo=new WeakMap,to=new WeakMap;class no extends L.ReactNextElement{constructor(){super(...arguments),(0,E.A)(this,Ui),(0,w.A)(this,Ii,ga(this)),(0,w.A)(this,Ri,(Ea(this),wa(this))),(0,w.A)(this,Ci,(Aa(this),ya(this))),(0,w.A)(this,Mi,(ka(this),Na(this))),(0,w.A)(this,_i,(xa(this),Oa(this))),(0,w.A)(this,Si,(La(this),Ta(this))),(0,w.A)(this,Di,(Ia(this),Ra(this))),(0,w.A)(this,Pi,(Ca(this),Ma(this))),(0,w.A)(this,Fi,(_a(this),Sa(this))),(0,w.A)(this,Wi,(Fa(this),e=>{gi(Ui,this,Da).emit(e)})),(0,w.A)(this,ji,Ua(this)),(0,w.A)(this,Bi,(Ba(this),e=>{gi(Ui,this,Wa).emit(e)})),(0,w.A)(this,zi,za(this)),(0,w.A)(this,Ki,(Va(this),()=>{gi(Ui,this,Ka).emit()})),(0,w.A)(this,Gi,Ya(this)),(0,w.A)(this,Vi,(qa(this),()=>{gi(Ui,this,Ha).emit()})),(0,w.A)(this,Yi,Ja(this)),(0,w.A)(this,Hi,(Za(this),e=>{gi(Ui,this,$a).emit(e)})),(0,w.A)(this,Xi,ei(this)),(0,w.A)(this,qi,(ri(this),()=>{gi(Ui,this,ti).emit()})),(0,w.A)(this,Ji,ai(this)),(0,w.A)(this,$i,(si(this),e=>{gi(Ui,this,ii).emit(e)})),(0,w.A)(this,Qi,ci(this)),(0,w.A)(this,Zi,(di(this),e=>{gi(Ui,this,li).emit(e)})),(0,w.A)(this,eo,hi(this)),(0,w.A)(this,to,(mi(this),e=>{gi(Ui,this,pi).emit(e)}))}get label(){return wi(Ii,this)}set label(e){Ei(Ii,this,e)}get type(){return wi(Ri,this)}set type(e){Ei(Ri,this,e)}get external(){return wi(Ci,this)}set external(e){Ei(Ci,this,e)}get subNodes(){return wi(Mi,this)}set subNodes(e){Ei(Mi,this,e)}get active(){return wi(_i,this)}set active(e){Ei(_i,this,e)}get notSynced(){return wi(Si,this)}set notSynced(e){Ei(Si,this,e)}get disableChildAppend(){return wi(Di,this)}set disableChildAppend(e){Ei(Di,this,e)}get autoFocusOnce(){return wi(Pi,this)}set autoFocusOnce(e){Ei(Pi,this,e)}render(){return x().createElement(ro,{label:this.label,type:this.type,external:this.external,subNodes:this.subNodes,autoFocusOnce:this.autoFocusOnce,onLabelEditingChange:wi(Wi,this),onLabelChange:wi(Bi,this),onNodeClick:wi(Ki,this),onNodeDoubleClick:wi(Vi,this),onNodeContextMenu:wi(Hi,this),onChildAppend:wi(qi,this),onExternalClick:wi($i,this),onSubNodeDoubleClick:wi(Zi,this),onSubNodeContextMenu:wi(to,this)})}}function ro(e){var t,{label:n,type:r,external:a,subNodes:i,autoFocusOnce:o,onLabelEditingChange:s,onLabelChange:c,onNodeClick:l,onNodeDoubleClick:u,onNodeContextMenu:d,onChildAppend:h,onExternalClick:p,onSubNodeDoubleClick:f,onSubNodeContextMenu:m}=e,b="board"===r?"board":"page",[v,g]=(0,N.useState)(n),[E,w]=(0,N.useState)(!1),A=(0,N.useRef)(!1),[y,k]=(0,N.useState)(!1),O=(0,N.useRef)(null);(0,N.useEffect)((()=>{g(n)}),[n]);var L=(0,N.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),w(!0)}),[]);(0,N.useEffect)((()=>{o&&!Ti.has(o)&&(Ti.add(o),setTimeout((()=>{w(!0)}),1))}),[o]),(0,N.useEffect)((()=>{var e,t;E&&(null===(e=O.current)||void 0===e||e.focus({preventScroll:!0}),null===(t=O.current)||void 0===t||t.select())}),[E]),(0,N.useEffect)((()=>{A.current?null==s||s(E):A.current=!0}),[E,s]);var T=(0,N.useCallback)((e=>{g(e.target.value)}),[]),I=(0,N.useCallback)((e=>{var t,n=e.key||e.keyCode||e.which;"Enter"!==n&&13!==n||null===(t=O.current)||void 0===t||t.blur()}),[]),R=(0,N.useCallback)((()=>{w(!1),k(!0)}),[]);(0,N.useEffect)((()=>{y&&(null==c||c(v),k(!1))}),[v,c,y]);var M=(0,N.useCallback)((e=>{e.stopPropagation(),null==h||h()}),[h]),_=(0,N.useCallback)((e=>{e.stopPropagation(),null==p||p(a)}),[a,p]),S=(0,N.useCallback)((e=>{e.stopPropagation()}),[]),D=38*Math.max(0,Math.floor((null!==(t=null==i?void 0:i.length)&&void 0!==t?t:0)-3));return x().createElement(x().Fragment,null,x().createElement("div",{className:C()("node",b,{"editing-label":E}),style:{height:"board"===b?70:130+D},onClick:l,onDoubleClick:u,onContextMenu:e=>{e.stopPropagation(),e.preventDefault(),null==d||d({clientX:e.clientX,clientY:e.clientY})}},x().createElement("input",{className:"label-input",value:v,ref:O,onChange:T,onKeyDown:I,onBlur:R,onDoubleClick:S,onContextMenu:S,onMouseDown:S}),x().createElement("div",{className:"label",onDoubleClick:L,onMouseDown:S},v),"board"===b?x().createElement("div",{className:"icon-container"},x().createElement(Oi,{lib:"antd",icon:"unordered-list"})):x().createElement("div",{className:"thumbnail-container",style:{height:98+D}},x().createElement("div",{className:"thumbnail-placeholder"},x().createElement(Oi,{lib:"antd",icon:"ellipsis"})),a&&x().createElement("div",{className:"external",onClick:_,onDoubleClick:S,onMouseDown:S},x().createElement(Oi,{lib:"antd",icon:"desktop"}),x().createElement("span",{className:"external-label"},a.label)),null!=i&&i.length?x().createElement("div",{className:"sub-nodes"},i.map((e=>x().createElement(ao,{key:e.id,subNode:e,onSubNodeDoubleClick:f,onSubNodeContextMenu:m})))):null)),x().createElement("div",{className:"add-button",role:"button",onClick:M,onMouseDown:S},x().createElement(Oi,{lib:"fa",icon:"plus"})))}function ao(e){var{subNode:t,onSubNodeDoubleClick:n,onSubNodeContextMenu:r}=e;return x().createElement(Li,{key:t.id,content:t.label},x().createElement("div",{className:"sub-node",onDoubleClick:e=>{e.stopPropagation(),null==n||n(t)},onContextMenu:e=>{e.stopPropagation(),e.preventDefault(),null==r||r({node:t,clientX:e.clientX,clientY:e.clientY})}},x().createElement("div",{className:"sub-node-skeleton-title"}),x().createElement("div",{className:"sub-node-skeleton-content"}),x().createElement("div",{className:"sub-node-skeleton-button"})))}bi=no,({e:[ga,Ea,wa,Aa,ya,ka,Na,xa,Oa,La,Ta,Ia,Ra,Ca,Ma,_a,Sa,Da,Pa,Fa,Ua,Wa,ja,Ba,za,Ka,Ga,Va,Ya,Ha,Xa,qa,Ja,$a,Qa,Za,ei,ti,ni,ri,ai,ii,oi,si,ci,li,ui,di,hi,pi,fi,mi],c:[yi,va]}=function(e,t,n,r,a,i){var o,s,c,l,u,d,h,p=Symbol.metadata||Symbol.for("Symbol.metadata"),f=Object.defineProperty,m=Object.create,b=[m(null),m(null)],v=t.length;function g(t,n,r){return function(a,i){n&&(i=a,a=e);for(var o=0;o<t.length;o++)i=t[o].apply(a,r?[i]:[]);return r?i:a}}function E(e,t,n,r){if("function"!=typeof e&&(r||void 0!==e))throw new TypeError(t+" must "+(n||"be")+" a function"+(r?"":" or undefined"));return e}function w(e,t,n,r,a,i,c,l,u,d,h){function p(e){if(!h(e))throw new TypeError("Attempted to access private element on non-instance")}var m=[].concat(t[0]),v=t[3],w=!c,A=1===a,k=3===a,N=4===a,x=2===a;function O(t,n,r){return function(a,i){return n&&(i=a,a=e),r&&r(a),L[t].call(a,i)}}if(!w){var L={},T=[],I=k?"get":N||A?"set":"value";if(u?(d||A?L={get:(0,y.A)((function(){return v(this)}),r,"get"),set:function(e){t[4](this,e)}}:L[I]=v,d||(0,y.A)(L[I],r,x?"":I)):d||(L=Object.getOwnPropertyDescriptor(e,r)),!d&&!u){if((s=b[+l][r])&&7!=(s^a))throw new Error("Decorating two elements with the same name ("+L[I].name+") is not supported yet");b[+l][r]=a<3?1:a}}for(var R=e,C=m.length-1;C>=0;C-=n?2:1){var M=m[C],_=n?m[C-1]:void 0,S={},D={kind:["field","accessor","method","getter","setter","class"][a],name:r,metadata:o,addInitializer:function(e,t){if(e.v)throw new Error("attempted to call addInitializer after decoration was finished");E(t,"An initializer","be",!0),i.push(t)}.bind(null,S)};if(w)s=M.call(_,R,D),S.v=1,E(s,"class decorators","return")&&(R=s);else if(D.static=l,D.private=u,s=D.access={has:u?h.bind():function(e){return r in e}},N||(s.get=u?x?function(e){return p(e),L.value}:O("get",0,p):function(e){return e[r]}),x||k||(s.set=u?O("set",0,p):function(e,t){e[r]=t}),R=M.call(_,A?{get:L.get,set:L.set}:L[I],D),S.v=1,A){if("object"==typeof R&&R)(s=E(R.get,"accessor.get"))&&(L.get=s),(s=E(R.set,"accessor.set"))&&(L.set=s),(s=E(R.init,"accessor.init"))&&T.unshift(s);else if(void 0!==R)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else E(R,(d?"field":"method")+" decorators","return")&&(d?T.unshift(R):L[I]=R)}return a<2&&c.push(g(T,l,1),g(i,l,0)),d||w||(u?A?c.splice(-1,0,O("get",l),O("set",l)):c.push(x?L[I]:E.call.bind(L[I])):f(e,r,L)),R}function N(e){return f(e,p,{configurable:!0,enumerable:!0,value:o})}return void 0!==i&&(o=i[p]),o=m(null==o?null:o),u=[],d=function(e){e&&u.push(g(e))},(h=function(t,r){for(var i=0;i<n.length;i++){var o=n[i],s=o[1],d=7&s;if((8&s)==t&&!d==r){var h=o[2],p=!!o[3],f=16&s;w(t?e:e.prototype,o,f,p?"#"+h:(0,A.A)(h),d,d<2?[]:t?l=l||[]:c=c||[],u,!!t,p,r,t&&p?function(t){return(0,k.A)(t)===e}:a)}}})(8,0),h(0,0),h(8,1),h(0,1),d(c),d(l),s=u,v||N(e),{e:s,get c(){var n=[];return v&&[N(e=w(e,[t],0,e.name,5,n)),g(n,1)]}}}(bi,[ki("visual-builder.page-arch-node",{styleTexts:[vi.A]})],[[Ni(),1,"label"],[Ni(),1,"type"],[Ni({attribute:!1}),1,"external"],[Ni({attribute:!1}),1,"subNodes"],[Ni({type:Boolean,render:!1}),1,"active"],[Ni({type:Boolean,render:!1}),1,"notSynced"],[Ni({type:Boolean,render:!1}),1,"disableChildAppend"],[Ni(),1,"autoFocusOnce"],[xi({type:"label.editing.change"}),1,"labelEditingChange",e=>wi(Fi,e),(e,t)=>Ei(Fi,e,t)],[xi({type:"label.change"}),1,"labelChange",e=>wi(ji,e),(e,t)=>Ei(ji,e,t)],[xi({type:"node.click"}),1,"nodeClick",e=>wi(zi,e),(e,t)=>Ei(zi,e,t)],[xi({type:"node.dblclick"}),1,"nodeDoubleClick",e=>wi(Gi,e),(e,t)=>Ei(Gi,e,t)],[xi({type:"node.contextmenu"}),1,"nodeContextMenu",e=>wi(Yi,e),(e,t)=>Ei(Yi,e,t)],[xi({type:"child.append"}),1,"childAppend",e=>wi(Xi,e),(e,t)=>Ei(Xi,e,t)],[xi({type:"external.click"}),1,"externalClick",e=>wi(Ji,e),(e,t)=>Ei(Ji,e,t)],[xi({type:"subNode.dblclick"}),1,"subNodeDoubleClick",e=>wi(Qi,e),(e,t)=>Ei(Qi,e,t)],[xi({type:"subNode.contextmenu"}),1,"subNodeContextMenu",e=>wi(eo,e),(e,t)=>Ei(eo,e,t)]],0,(e=>to.has((0,k.A)(e))),L.ReactNextElement)),va();var io,oo,so,co,lo,uo,ho,po,fo,mo,bo=n(4845),vo=n(6213);function go(e,t,n){return n(yo(e,t))}function Eo(e,t,n,r){return t(yo(e,n),r),r}function wo(e,t,n){return e.set(yo(e,t),n),n}function Ao(e,t){return e.get(yo(e,t))}function yo(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}var{method:ko,property:No}=(0,O.createDecorators)(),xo=new WeakMap,Oo=new WeakSet,Lo=new WeakMap,To=new WeakMap,Io=new WeakMap,Ro=new WeakMap,Co=new WeakMap,Mo=new WeakMap;class _o extends L.ReactNextElement{constructor(){super(...arguments),(0,E.A)(this,Oo),(0,w.A)(this,xo,(io(this),!1)),(0,w.A)(this,Lo,"normal"),(0,w.A)(this,To,!1),(0,w.A)(this,Io,oo(this)),(0,w.A)(this,Ro,(so(this),co(this))),(0,w.A)(this,Co,(lo(this),uo(this))),(0,w.A)(this,Mo,(ho(this),po(this))),fo(this)}get isFormItemElement(){return!0}set validateState(e){Eo(Oo,Fo,this,e),this._render()}get validateState(){return go(Oo,this,Po)}set notRender(e){this.hidden=e,Eo(Oo,Do,this,e),this._render()}get notRender(){return go(Oo,this,So)}get $bindFormItem(){return go(Oo,this,Uo)}set $bindFormItem(e){Eo(Oo,Wo,this,e),this._render()}get helpBrick(){return Ao(Io,this)}set helpBrick(e){wo(Io,this,e)}get labelBrick(){return Ao(Ro,this)}set labelBrick(e){wo(Ro,this,e)}get labelCol(){return Ao(Co,this)}set labelCol(e){wo(Co,this,e)}get wrapperCol(){return Ao(Mo,this)}set wrapperCol(e){wo(Mo,this,e)}setNotRender(e){this.notRender=e}getFormElement(){for(var e=this;(e=e.parentNode)&&e&&!e.isFormElement;);return e}}function So(e){return Ao(xo,e)}function Do(e,t){wo(xo,e,t)}function Po(e){return Ao(Lo,e)}function Fo(e,t){wo(Lo,e,t)}function Uo(e){return Ao(To,e)}function Wo(e,t){wo(To,e,t)}mo=_o,[oo,so,co,lo,uo,ho,po,fo,io]=function(e,t,n,r,a,i){var o,s,c,l,u,d,h,p=Symbol.metadata||Symbol.for("Symbol.metadata"),f=Object.defineProperty,m=Object.create,b=[m(null),m(null)],v=t.length;function g(t,n,r){return function(a,i){n&&(i=a,a=e);for(var o=0;o<t.length;o++)i=t[o].apply(a,r?[i]:[]);return r?i:a}}function E(e,t,n,r){if("function"!=typeof e&&(r||void 0!==e))throw new TypeError(t+" must "+(n||"be")+" a function"+(r?"":" or undefined"));return e}function w(e,t,n,r,a,i,c,l,u,d,h){function p(e){if(!h(e))throw new TypeError("Attempted to access private element on non-instance")}var m=[].concat(t[0]),v=t[3],w=!c,A=1===a,k=3===a,N=4===a,x=2===a;function O(t,n,r){return function(a,i){return n&&(i=a,a=e),r&&r(a),L[t].call(a,i)}}if(!w){var L={},T=[],I=k?"get":N||A?"set":"value";if(u?(d||A?L={get:(0,y.A)((function(){return v(this)}),r,"get"),set:function(e){t[4](this,e)}}:L[I]=v,d||(0,y.A)(L[I],r,x?"":I)):d||(L=Object.getOwnPropertyDescriptor(e,r)),!d&&!u){if((s=b[+l][r])&&7!=(s^a))throw new Error("Decorating two elements with the same name ("+L[I].name+") is not supported yet");b[+l][r]=a<3?1:a}}for(var R=e,C=m.length-1;C>=0;C-=n?2:1){var M=m[C],_=n?m[C-1]:void 0,S={},D={kind:["field","accessor","method","getter","setter","class"][a],name:r,metadata:o,addInitializer:function(e,t){if(e.v)throw new Error("attempted to call addInitializer after decoration was finished");E(t,"An initializer","be",!0),i.push(t)}.bind(null,S)};if(w)s=M.call(_,R,D),S.v=1,E(s,"class decorators","return")&&(R=s);else if(D.static=l,D.private=u,s=D.access={has:u?h.bind():function(e){return r in e}},N||(s.get=u?x?function(e){return p(e),L.value}:O("get",0,p):function(e){return e[r]}),x||k||(s.set=u?O("set",0,p):function(e,t){e[r]=t}),R=M.call(_,A?{get:L.get,set:L.set}:L[I],D),S.v=1,A){if("object"==typeof R&&R)(s=E(R.get,"accessor.get"))&&(L.get=s),(s=E(R.set,"accessor.set"))&&(L.set=s),(s=E(R.init,"accessor.init"))&&T.unshift(s);else if(void 0!==R)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else E(R,(d?"field":"method")+" decorators","return")&&(d?T.unshift(R):L[I]=R)}return a<2&&c.push(g(T,l,1),g(i,l,0)),d||w||(u?A?c.splice(-1,0,O("get",l),O("set",l)):c.push(x?L[I]:E.call.bind(L[I])):f(e,r,L)),R}function N(e){return f(e,p,{configurable:!0,enumerable:!0,value:o})}return void 0!==i&&(o=i[p]),o=m(null==o?null:o),u=[],d=function(e){e&&u.push(g(e))},(h=function(t,r){for(var a=0;a<n.length;a++){var i=n[a],o=i[1],s=7&o;if((8&o)==t&&!s==r){var d=i[2],h=!!i[3],p=16&o;w(t?e:e.prototype,i,p,h?"#"+d:(0,A.A)(d),s,s<2?[]:t?l=l||[]:c=c||[],u,!!t,h,r,t&&h?function(t){return(0,k.A)(t)===e}:undefined)}}})(8,0),h(0,0),h(8,1),h(0,1),d(c),d(l),s=u,v||N(e),{e:s,get c(){var n=[];return v&&[N(e=w(e,[t],0,e.name,5,n)),g(n,1)]}}}(mo,[],[[No({attribute:!1}),1,"helpBrick"],[No({attribute:!1}),1,"labelBrick"],[No({attribute:!1}),1,"labelCol"],[No({attribute:!1}),1,"wrapperCol"],[ko(),2,"setNotRender"],[ko(),2,"getFormElement"]],0,0,L.ReactNextElement).e;var jo=function(){var e=(0,Pr.A)((function*(e,t){return(yield Fr.http.post("api/gateway/next_builder.contract_center.SearchContract/api/v1/contract/search",e,t)).data}));return function(t,n){return e.apply(this,arguments)}}(),Bo=function(e){return e.CONTRACT_OPTIONS_TIPS_PREFIX="CONTRACT_OPTIONS_TIPS_PREFIX",e.CONTRACT_OPTIONS_TIPS_SUFFIX="CONTRACT_OPTIONS_TIPS_SUFFIX",e.CONTRACT_VALIDATE_MESSAGE="CONTRACT_VALIDATE_MESSAGE",e}({}),zo="bricks/visual-builder/contract-select",Ko={en:{CONTRACT_OPTIONS_TIPS_PREFIX:"Only the first",CONTRACT_OPTIONS_TIPS_SUFFIX:"items are displayed, please search for more results",CONTRACT_VALIDATE_MESSAGE:"Please fill in the correct contract name "},zh:{CONTRACT_OPTIONS_TIPS_PREFIX:"仅展示前",CONTRACT_OPTIONS_TIPS_SUFFIX:"项,更多结果请搜索",CONTRACT_VALIDATE_MESSAGE:"请填写正确的契约名称"}};(0,_r.initializeReactI18n)(zo,Ko);var Go,Vo,Yo,Ho,Xo,qo,Jo,$o,Qo,Zo,es,ts,ns,rs,as,is,os=(0,L.wrapBrick)("eo-icon"),ss=(0,L.wrapBrick)("eo-input",{onChange:"change"});function cs(e){var{itemsCount:t=20,onBlur:n}=e,[r,a]=(0,N.useState)(t),{t:i}=(0,_r.useTranslation)(zo),[o,s]=(0,N.useState)(!1);return x().createElement("div",{className:"options-tips",slot:e.slot},i(Bo.CONTRACT_OPTIONS_TIPS_PREFIX)," ",o?x().createElement(ss,{autoFocus:!0,inputStyle:{width:65},value:String(r),onBlur:()=>{s(!1),null==n||n(r)},onChange:e=>{a(Number(e.detail))}}):x().createElement("span",null,r," ",x().createElement(os,{icon:"edit",lib:"antd",onClick:()=>{s(!0)}}))," ",i(Bo.CONTRACT_OPTIONS_TIPS_SUFFIX))}function ls(e,t,n){return e.set(ds(e,t),n),n}function us(e,t){return e.get(ds(e,t))}function ds(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}(0,_r.initializeReactI18n)(zo,Ko);var hs,{defineElement:ps,property:fs,event:ms}=(0,O.createDecorators)(),bs=(0,L.wrapBrick)("eo-form-item"),vs=(0,L.wrapBrick)("eo-auto-complete",{onChange:"change"}),gs=new WeakMap,Es=new WeakMap,ws=new WeakMap,As=new WeakMap,ys=new WeakMap,ks=new WeakMap,Ns=new WeakSet;function xs(e){if("string"!=typeof e)return{name:"",version:""};var[t,n]=e.split(":");return{name:t,version:n}}function Os(e){return/.*@.*:\d+\.\d+\.\d+/.test(e)}function Ls(e){return(0,vn.isNil)(e)||Os(e)?"":Wr.i18n.t("".concat(zo,":").concat(Bo.CONTRACT_VALIDATE_MESSAGE))}function Ts(e){var{value:t,inputStyle:n,validateState:r,suffix:a,onChange:i}=e,[o,s]=(0,N.useState)(),[c,l]=(0,N.useState)(20),u=function(e){var{pageSize:t=20,q:n=""}=e,[r,a]=(0,N.useState)([]),[i,o]=(0,N.useState)(n),[s,c]=(0,N.useState)(t);return(0,N.useEffect)((()=>{o(n)}),[n]),(0,N.useEffect)((()=>{c(t)}),[t]),(0,N.useEffect)((()=>{(0,Pr.A)((function*(){try{var{list:e}=yield jo({page:1,pageSize:s,fullContractName:i},{interceptorParams:{ignoreLoadingBar:!0}});a(e)}catch(e){console.error(e),a([])}}))()}),[i,s]),r}({q:o,pageSize:c}),[d,h]=(0,N.useState)(xs(t)),[p,f]=(0,N.useState)([]);(0,N.useEffect)((()=>{h(xs(t))}),[t]);var m=(0,N.useMemo)((()=>(0,vn.debounce)((e=>{s(e)}),200)),[]);return x().createElement("div",{className:"contract-wrapper"},x().createElement(vs,{className:"contract-selector",options:null==u?void 0:u.map((e=>({value:e.fullContractName,label:e.fullContractName}))),value:d.name,inputStyle:n,validateState:r,onChange:e=>{var t=e.detail;if(Os(t))h(xs(t)),null==i||i(t);else{var n,r,a=null===(n=u.find((e=>e.fullContractName===t)))||void 0===n?void 0:n.version,o=null!==(r=null==a?void 0:a[0])&&void 0!==r?r:"";f(a),h({name:t,version:o}),null==i||i("".concat(t,":").concat(o))}m(t)}},x().createElement(cs,{onBlur:e=>l(e),slot:"options-toolbar"})),x().createElement(vs,{className:"version-selector",value:d.version,validateState:r,options:null==p?void 0:p.map((e=>({value:e,label:e}))),onChange:e=>{var t=e.detail;h({name:d.name,version:t}),null==i||i("".concat(d.name,":").concat(t))}}),null!=a&&a.useBrick?x().createElement(bo.ReactUseMultipleBricks,a):null)}is=class extends _o{constructor(){super(...arguments),(0,E.A)(this,Ns),(0,w.A)(this,gs,Vo(this)),(0,w.A)(this,Es,(Yo(this),Ho(this))),(0,w.A)(this,ws,(Xo(this),qo(this))),(0,w.A)(this,As,(Jo(this),$o(this))),(0,w.A)(this,ys,(Qo(this),Zo(this))),(0,w.A)(this,ks,(es(this),ts(this))),(0,te.A)(this,"handleChange",(as(this),e=>{var t,n;(t=Ns,this,n=ns,n(ds(t,this))).emit(e)}))}get name(){return us(gs,this)}set name(e){ls(gs,this,e)}get required(){return us(Es,this)}set required(e){ls(Es,this,e)}get label(){return us(ws,this)}set label(e){ls(ws,this,e)}get value(){return us(As,this)}set value(e){ls(As,this,e)}get suffix(){return us(ys,this)}set suffix(e){ls(ys,this,e)}render(){return x().createElement(bs,{curElement:this,formElement:this.getFormElement(),name:this.name,label:this.label,required:this.required,labelBrick:this.labelBrick,helpBrick:this.helpBrick,notRender:this.notRender,trigger:"handleChange",validator:Ls},x().createElement(Ts,{value:this.value,suffix:this.suffix,validateState:this.validateState,onChange:this.handleChange}))}},({e:[Vo,Yo,Ho,Xo,qo,Jo,$o,Qo,Zo,es,ts,ns,rs,as],c:[hs,Go]}=function(e,t,n,r,a,i){var o,s,c,l,u,d,h,p=Symbol.metadata||Symbol.for("Symbol.metadata"),f=Object.defineProperty,m=Object.create,b=[m(null),m(null)],v=t.length;function g(t,n,r){return function(a,i){n&&(i=a,a=e);for(var o=0;o<t.length;o++)i=t[o].apply(a,r?[i]:[]);return r?i:a}}function E(e,t,n,r){if("function"!=typeof e&&(r||void 0!==e))throw new TypeError(t+" must "+(n||"be")+" a function"+(r?"":" or undefined"));return e}function w(e,t,n,r,a,i,c,l,u,d,h){function p(e){if(!h(e))throw new TypeError("Attempted to access private element on non-instance")}var m=[].concat(t[0]),v=t[3],w=!c,A=1===a,k=3===a,N=4===a,x=2===a;function O(t,n,r){return function(a,i){return n&&(i=a,a=e),r&&r(a),L[t].call(a,i)}}if(!w){var L={},T=[],I=k?"get":N||A?"set":"value";if(u?(d||A?L={get:(0,y.A)((function(){return v(this)}),r,"get"),set:function(e){t[4](this,e)}}:L[I]=v,d||(0,y.A)(L[I],r,x?"":I)):d||(L=Object.getOwnPropertyDescriptor(e,r)),!d&&!u){if((s=b[+l][r])&&7!=(s^a))throw new Error("Decorating two elements with the same name ("+L[I].name+") is not supported yet");b[+l][r]=a<3?1:a}}for(var R=e,C=m.length-1;C>=0;C-=n?2:1){var M=m[C],_=n?m[C-1]:void 0,S={},D={kind:["field","accessor","method","getter","setter","class"][a],name:r,metadata:o,addInitializer:function(e,t){if(e.v)throw new Error("attempted to call addInitializer after decoration was finished");E(t,"An initializer","be",!0),i.push(t)}.bind(null,S)};if(w)s=M.call(_,R,D),S.v=1,E(s,"class decorators","return")&&(R=s);else if(D.static=l,D.private=u,s=D.access={has:u?h.bind():function(e){return r in e}},N||(s.get=u?x?function(e){return p(e),L.value}:O("get",0,p):function(e){return e[r]}),x||k||(s.set=u?O("set",0,p):function(e,t){e[r]=t}),R=M.call(_,A?{get:L.get,set:L.set}:L[I],D),S.v=1,A){if("object"==typeof R&&R)(s=E(R.get,"accessor.get"))&&(L.get=s),(s=E(R.set,"accessor.set"))&&(L.set=s),(s=E(R.init,"accessor.init"))&&T.unshift(s);else if(void 0!==R)throw new TypeError("accessor decorators must return an object with get, set, or init properties or undefined")}else E(R,(d?"field":"method")+" decorators","return")&&(d?T.unshift(R):L[I]=R)}return a<2&&c.push(g(T,l,1),g(i,l,0)),d||w||(u?A?c.splice(-1,0,O("get",l),O("set",l)):c.push(x?L[I]:E.call.bind(L[I])):f(e,r,L)),R}function N(e){return f(e,p,{configurable:!0,enumerable:!0,value:o})}return void 0!==i&&(o=i[p]),o=m(null==o?null:o),u=[],d=function(e){e&&u.push(g(e))},(h=function(t,r){for(var i=0;i<n.length;i++){var o=n[i],s=o[1],d=7&s;if((8&s)==t&&!d==r){var h=o[2],p=!!o[3],f=16&s;w(t?e:e.prototype,o,f,p?"#"+h:(0,A.A)(h),d,d<2?[]:t?l=l||[]:c=c||[],u,!!t,p,r,t&&p?function(t){return(0,k.A)(t)===e}:a)}}})(8,0),h(0,0),h(8,1),h(0,1),d(c),d(l),s=u,v||N(e),{e:s,get c(){var n=[];return v&&[N(e=w(e,[t],0,e.name,5,n)),g(n,1)]}}}(is,[ps("visual-builder.contract-select",{styleTexts:[vo.A]})],[[fs(),1,"name"],[fs({type:Boolean}),1,"required"],[fs(),1,"label"],[fs({attribute:!1}),1,"value"],[fs({attribute:!1}),1,"suffix"],[ms({type:"change"}),1,"changeEvent",e=>us(ks,e),(e,t)=>ls(ks,e,t)]],0,(e=>Ns.has((0,k.A)(e))),_o)),Go()},6213:(e,t,n)=>{n.d(t,{A:()=>s});var r=n(6758),a=n.n(r),i=n(935),o=n.n(i)()(a());o.push([e.id,":host{display:inline-block}:host([hidden]){display:none}.contract-wrapper{display:flex;gap:4px}.contract-selector{flex:1}.version-selector{width:100px}.options-tips{padding:0px 10px;font-weight:400;color:#999;white-space:nowrap;font-style:italic}",""]);const s=o.toString()},2381:(e,t,n)=>{n.d(t,{A:()=>s});var r=n(6758),a=n.n(r),i=n(935),o=n.n(i)()(a());o.push([e.id,":host{--local-node-outline-style:solid;display:block}:host([hidden]){display:none}:host([not-synced]){--local-node-outline-style:dashed}*{box-sizing:border-box}.node{width:168px;max-width:none;height:130px;position:relative;display:flex;flex-direction:column;justify-content:space-between;align-items:center;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}.node.board{height:70px;max-width:168px;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;padding-bottom:4px}.label,\n.label-input{width:100%;height:24px;padding:3px;border:none;line-height:18px;font-size:var(--sub-title-font-size-small);color:var(--color-header-text);font-weight:var(--font-weight-500);text-align:center;font-family:inherit;cursor:text;-webkit-user-select:text;-moz-user-select:text;user-select:text}.label{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.node.editing-label .label{height:0}.node:not(.editing-label) .label-input{display:none}.add-button,\n.icon-container,\n.thumbnail-container,\n.thumbnail-placeholder{display:flex;align-items:center;justify-content:center}.thumbnail-container{height:98px;outline:1px var(--local-node-outline-style) var(--palette-gray-4);opacity:1;border:4px solid transparent;border-radius:4px;width:100%;position:relative;flex-direction:column}.thumbnail-placeholder{color:var(--palette-gray-5);font-size:36px;flex:1}.icon-container{font-size:20px;background-color:var(--palette-teal-6);color:var(--palette-gray-4);width:36px;height:36px;border-radius:50%;outline-offset:4px}:host([active]) .thumbnail-container,\n:host([active]) .icon-container{outline:2px var(--local-node-outline-style) var(--palette-blue-3)}:host(:not([active])) .node:hover .thumbnail-container,\n:host(:not([active])) .node:hover .icon-container{outline:1px var(--local-node-outline-style) var(--palette-blue-3)}.add-button{position:absolute;bottom:-26px;left:calc(50% - 12px);width:24px;height:24px;background:var(--palette-gray-3);color:var(--palette-gray-6);border-radius:50%;cursor:pointer}:host([not-synced]) .add-button,\n:host([disable-child-append]) .add-button,\n:host(:not([active])) .add-button{display:none}.add-button:hover{background:var(--palette-blue-5);color:var(--palette-gray-2)}.external{position:absolute;top:4px;left:4px;padding:0 10px;display:flex;align-items:center;gap:6px;background:var(--palette-purple-4);font-size:12px;line-height:20px;height:22px;cursor:pointer;color:var(--palette-gray-1);border-radius:9999px;right:4px;max-width:-webkit-fit-content;max-width:-moz-fit-content;max-width:fit-content}.external-label{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.external:hover{background:var(--palette-purple-5)}.sub-nodes{display:grid;grid-template-columns:1fr 1fr 1fr;grid-gap:6px;gap:6px;width:100%}.sub-node{background-color:var(--palette-gray-2);border-radius:4px;padding:6px;display:flex;flex-direction:column;justify-content:space-between;height:32px}.sub-node-skeleton-title{width:18px;height:4px;border-radius:2px;align-self:flex-start;background-color:var(--palette-gray-4)}.sub-node-skeleton-content{width:100%;height:4px;border-radius:2px;background-color:var(--palette-gray-4)}.sub-node-skeleton-button{width:18px;height:4px;border-radius:2px;align-self:flex-end;background-color:var(--palette-blue-3)}.sub-node:hover{background-color:var(--palette-gray-3)}.sub-node:hover .sub-node-skeleton-title,\n.sub-node:hover .sub-node-skeleton-content{background-color:var(--palette-gray-5)}.sub-node:hover .sub-node-skeleton-button{background-color:var(--palette-blue-4)}",""]);const s=o.toString()},9765:(e,t,n)=>{n.d(t,{A:()=>s});var r=n(6758),a=n.n(r),i=n(935),o=n.n(i)()(a());o.push([e.id,".custom-scrollbar-container{scrollbar-width:thin;scrollbar-color:rgba(255,255,255,0.15) rgba(255,255,255,0.03)}.custom-scrollbar-container::-webkit-scrollbar{width:8px;height:8px;background-color:transparent;position:absolute}.custom-scrollbar-container::-webkit-scrollbar-thumb{background-color:rgba(255,255,255,0);border-radius:4px}.custom-scrollbar-container:hover::-webkit-scrollbar-track{background-color:rgba(255,255,255,0.03)}.custom-scrollbar-container:hover::-webkit-scrollbar-thumb{background-color:rgba(255,255,255,0.15)}",""]);const s=o.toString()},3430:(e,t,n)=>{n.d(t,{A:()=>s});var r=n(6758),a=n.n(r),i=n(935),o=n.n(i)()(a());o.push([e.id,'.workBenchActionList{display:flex;flex-direction:column;width:-webkit-min-content;width:-moz-min-content;width:min-content;height:100%;background-color:#4297ff}:host-context(html[data-theme="dark-v2"]) .workBenchActionList,\n:host-context([data-override-theme="dark-v2"]) .workBenchActionList{background-color:#323237}',""]);const s=o.toString()},5292:(e,t,n)=>{n.d(t,{A:()=>s});var r=n(6758),a=n.n(r),i=n(935),o=n.n(i)()(a());o.push([e.id,'.action::part(link){display:flex;justify-content:center;align-items:center;width:48px;height:48px;font-size:24px;color:rgba(255,255,255,0.4);position:relative;transition:none}.action.active::part(link)::before{content:"";position:absolute;top:0;bottom:0;left:0;width:2px;background-color:white}.action.active::part(link),\n.action::part(link):hover{color:white}',""]);const s=o.toString()},1361:(e,t,n)=>{n.d(t,{A:()=>s});var r=n(6758),a=n.n(r),i=n(935),o=n.n(i)()(a());o.push([e.id,":host{display:inline-block}:host([hidden]){display:none}eo-popover::part(popup){width:800px;max-width:60vw;padding:10px;background:var(--color-fill-bg-container-4);border-radius:var(--medius-border-radius);box-shadow:var(--feedback-container-shadow);z-index:1000}.history-title{font-size:var(--title-font-size);font-weight:var(--font-weight-500);color:var(--color-strong-text);margin-bottom:5px}.history-list{max-height:500px;overflow-y:auto}.item-container{padding:10px 0;display:flex;flex-direction:column;gap:5px}.empty{padding:5px 0 10px 0;font-size:14px;color:var(--text-color-secondary);text-align:center}.item-container:not(:last-of-type){border-bottom:1px solid var(--color-border-divider-line)}.item-title{display:flex;align-items:center;justify-content:space-between;gap:5px}.title-left,\n.title-right{display:flex;align-items:center}.title-left{cursor:pointer;overflow:hidden;gap:5px}.topic{font-size:14px;color:var(--text-color-title);font-weight:var(--font-weight-500);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.branch{font-size:14px;color:var(--text-color-secondary)}.rollback{margin-right:5px;font-size:14px;color:var(--text-color-secondary);cursor:pointer}.rollback:hover{color:var(--color-brand)}.item-info{display:flex;align-items:center;gap:5px}.time,\n.operator{font-size:14px;color:var(--text-color-secondary)}.load-more-container{display:block;text-align:center}.end-container{display:flex;align-items:center;justify-content:center;gap:10px;font-size:16px;color:var(--color-brand)}.rollback-all{cursor:pointer}",""]);const s=o.toString()},7180:(e,t,n)=>{n.d(t,{A:()=>s});var r=n(6758),a=n.n(r),i=n(935),o=n.n(i)()(a());o.push([e.id,':host{display:block;--pane-color:#595959}:host-context(html[data-theme="dark-v2"]),\n:host-context([data-override-theme="dark-v2"]){--pane-color:#ccc}:host([hidden]){display:none}*,\n*::before,\n*::after{box-sizing:border-box}.pane{display:flex;flex-direction:column;color:var(--pane-color);height:100%}.pane-header{display:flex;align-items:center;cursor:pointer;border-top:1px solid transparent;position:relative}.pane-header:focus{outline-width:1px;outline-style:solid;outline-offset:-1px;outline-color:#007fd4}:host(:not(:first-child)) .pane-header{border-top-color:rgba(204,204,204,0.2)}.pane-scroll-shadow{display:none;position:absolute;bottom:-3px;left:0;right:0;height:3px;box-shadow:#000000 0 6px 6px -6px inset;z-index:1}.scrolled .pane-scroll-shadow{display:block}.pane-title{display:flex;align-items:center;font-size:13px;line-height:24px;height:25px;min-width:0;flex:1}.title-icon{display:flex;justify-content:center;align-items:center;width:24px;padding-right:2px;line-height:1;flex-shrink:0}.title-label{text-transform:uppercase;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pane-body{flex-grow:1;min-height:0;display:none;overflow:hidden;overflow-y:auto;overflow-y:overlay}:host([active]) .pane-body{display:initial}:host(:not(:hover)) ::slotted([slot="actions"]){display:none}.badge{background-color:rgb(77,77,77);color:rgb(255,255,255);border-radius:11px;height:18px;padding:3px 6px;line-height:13px;margin:0 3px;font-size:12px}',""]);const s=o.toString()},2150:(e,t,n)=>{n.d(t,{A:()=>s});var r=n(6758),a=n.n(r),i=n(935),o=n.n(i)()(a());o.push([e.id,':host{--sidebar-background:#fff;--title-container-background:#fff;--title-container-color:#595959;display:block;outline-color:rgba(83,89,93,0.5);background-color:var(--sidebar-background);height:100%}:host-context(html[data-theme="dark-v2"]),\n:host-context([data-override-theme="dark-v2"]){--sidebar-background:#181818;--title-container-background:#181818;--title-container-color:rgb(187,187,187);background-color:var(--sidebar-background)}:host([hidden]){display:none}*,\n*::before,\n*::after{box-sizing:border-box}.sidebar{display:flex;flex-direction:column;height:100%}.title-container{display:flex;padding:0 8px 8px 8px;color:var(--title-container-color);background:var(--title-container-background)}.title-label{font-weight:300;line-height:44px;padding-left:12px;text-transform:uppercase;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pane-container{flex-grow:1;min-height:0;display:flex;flex-direction:column}::slotted([slot="panes"]){transition:flex 0.2s;min-height:25px}',""]);const s=o.toString()}}]);
|
|
3
|
+
//# sourceMappingURL=9636.ecf3c18b.js.map
|