pict-section-flow 1.3.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +7 -2
- package/source/Pict-Section-Flow.js +20 -14
- package/source/providers/PictProvider-Flow-Background.js +303 -0
- package/source/providers/PictProvider-Flow-CSS.js +99 -7
- package/source/providers/PictProvider-Flow-ConnectorShapes.js +8 -0
- package/source/providers/PictProvider-Flow-Geometry.js +11 -421
- package/source/providers/PictProvider-Flow-Icons.js +20 -0
- package/source/providers/PictProvider-Flow-Layouts.js +107 -0
- package/source/services/PictService-Flow-ConnectionRenderer.js +77 -5
- package/source/services/PictService-Flow-CursorManager.js +113 -0
- package/source/services/PictService-Flow-InteractionManager.js +443 -61
- package/source/services/PictService-Flow-Layout.js +21 -16
- package/source/services/PictService-Flow-PathGenerator.js +30 -417
- package/source/services/PictService-Flow-RenderManager.js +9 -1
- package/source/services/PictService-Flow-ViewportManager.js +102 -0
- package/source/views/PictView-Flow-FloatingToolbar.js +57 -0
- package/source/views/PictView-Flow-Node.js +36 -0
- package/source/views/PictView-Flow-PropertiesPanel.js +27 -5
- package/source/views/PictView-Flow-Toolbar.js +148 -13
- package/source/views/PictView-Flow.js +628 -3
- package/.claude/launch.json +0 -11
- package/docs/.nojekyll +0 -0
- package/docs/Architecture.md +0 -163
- package/docs/Custom-Styling.md +0 -275
- package/docs/Data_Model.md +0 -149
- package/docs/Event_System.md +0 -156
- package/docs/Getting_Started.md +0 -237
- package/docs/Implementation_Reference.md +0 -528
- package/docs/Layout_Persistence.md +0 -117
- package/docs/README.md +0 -103
- package/docs/Theme_Integration.md +0 -150
- package/docs/_brand.json +0 -18
- package/docs/_cover.md +0 -17
- package/docs/_playground.json +0 -24
- package/docs/_sidebar.md +0 -57
- package/docs/_topbar.md +0 -8
- package/docs/_version.json +0 -7
- package/docs/api/PictFlowCard.md +0 -216
- package/docs/api/PictFlowCardPropertiesPanel.md +0 -235
- package/docs/api/addConnection.md +0 -101
- package/docs/api/addNode.md +0 -137
- package/docs/api/autoLayout.md +0 -77
- package/docs/api/getFlowData.md +0 -112
- package/docs/api/marshalToView.md +0 -95
- package/docs/api/openPanel.md +0 -128
- package/docs/api/registerHandler.md +0 -174
- package/docs/api/registerNodeType.md +0 -142
- package/docs/api/removeConnection.md +0 -57
- package/docs/api/removeNode.md +0 -80
- package/docs/api/saveLayout.md +0 -152
- package/docs/api/screenToSVGCoords.md +0 -68
- package/docs/api/selectNode.md +0 -116
- package/docs/api/setTheme.md +0 -168
- package/docs/api/setZoom.md +0 -97
- package/docs/api/toggleFullscreen.md +0 -68
- package/docs/card-help/EACH.md +0 -19
- package/docs/card-help/FREAD.md +0 -24
- package/docs/card-help/FWRITE.md +0 -24
- package/docs/card-help/GET.md +0 -22
- package/docs/card-help/ITE.md +0 -23
- package/docs/card-help/LOG.md +0 -23
- package/docs/card-help/NOTE.md +0 -17
- package/docs/card-help/PREV.md +0 -18
- package/docs/card-help/SET.md +0 -27
- package/docs/card-help/SPKL.md +0 -22
- package/docs/card-help/STAT.md +0 -23
- package/docs/card-help/SW.md +0 -25
- package/docs/diagrams/architecture-at-a-glance.excalidraw +0 -4270
- package/docs/diagrams/architecture-at-a-glance.mmd +0 -30
- package/docs/diagrams/architecture-at-a-glance.svg +0 -2
- package/docs/diagrams/data-flow.excalidraw +0 -1451
- package/docs/diagrams/data-flow.mmd +0 -17
- package/docs/diagrams/data-flow.svg +0 -2
- package/docs/diagrams/high-level-design.excalidraw +0 -5767
- package/docs/diagrams/high-level-design.mmd +0 -86
- package/docs/diagrams/high-level-design.svg +0 -2
- package/docs/diagrams/relationships.excalidraw +0 -3852
- package/docs/diagrams/relationships.mmd +0 -9
- package/docs/diagrams/relationships.svg +0 -2
- package/docs/diagrams/service-initialization-sequence.excalidraw +0 -1466
- package/docs/diagrams/service-initialization-sequence.mmd +0 -19
- package/docs/diagrams/service-initialization-sequence.svg +0 -2
- package/docs/diagrams/svg-layer-structure.excalidraw +0 -1060
- package/docs/diagrams/svg-layer-structure.mmd +0 -18
- package/docs/diagrams/svg-layer-structure.svg +0 -2
- package/docs/examples/README.md +0 -9
- package/docs/examples/simple_cards/README.md +0 -677
- package/docs/examples/simple_cards/css/flowexample.css +0 -65
- package/docs/examples/simple_cards/index.html +0 -32
- package/docs/examples/simple_cards/js/pict.min.js +0 -12
- package/docs/examples/simple_cards/pict-section-flow-example-simple-cards.compatible.min.js +0 -1
- package/docs/index.html +0 -38
- package/docs/playground/app.json +0 -6
- package/docs/playground/appdata.json +0 -85
- package/docs/playground/application.js +0 -23
- package/docs/playground/pict.json +0 -17
- package/docs/playground/runtime/pict-application.min.js +0 -2
- package/docs/playground/runtime/pict-section-flow.min.js +0 -2
- package/docs/playground/runtime/pict-section-modal.min.js +0 -2
- package/docs/playground/runtime/pict.min.js +0 -12
- package/docs/retold-catalog.json +0 -244
- package/docs/retold-keyword-index.json +0 -26028
- package/example_applications/simple_cards/css/flowexample.css +0 -65
- package/example_applications/simple_cards/html/index.html +0 -32
- package/example_applications/simple_cards/package.json +0 -52
- package/example_applications/simple_cards/source/Pict-Application-FlowExample-Configuration.json +0 -15
- package/example_applications/simple_cards/source/Pict-Application-FlowExample.js +0 -539
- package/example_applications/simple_cards/source/card-help-content.js +0 -16
- package/example_applications/simple_cards/source/cards/FlowCard-Comment.js +0 -38
- package/example_applications/simple_cards/source/cards/FlowCard-DataPreview.js +0 -44
- package/example_applications/simple_cards/source/cards/FlowCard-Each.js +0 -38
- package/example_applications/simple_cards/source/cards/FlowCard-FileRead.js +0 -56
- package/example_applications/simple_cards/source/cards/FlowCard-FileWrite.js +0 -50
- package/example_applications/simple_cards/source/cards/FlowCard-GetValue.js +0 -37
- package/example_applications/simple_cards/source/cards/FlowCard-IfThenElse.js +0 -49
- package/example_applications/simple_cards/source/cards/FlowCard-LogValues.js +0 -55
- package/example_applications/simple_cards/source/cards/FlowCard-SetValue.js +0 -97
- package/example_applications/simple_cards/source/cards/FlowCard-Sparkline.js +0 -100
- package/example_applications/simple_cards/source/cards/FlowCard-StatusMonitor.js +0 -46
- package/example_applications/simple_cards/source/cards/FlowCard-Switch.js +0 -39
- package/example_applications/simple_cards/source/providers/PictRouter-FlowExample-Configuration.json +0 -22
- package/example_applications/simple_cards/source/sample-flows.js +0 -410
- package/example_applications/simple_cards/source/views/PictView-FlowExample-About.js +0 -184
- package/example_applications/simple_cards/source/views/PictView-FlowExample-BottomBar.js +0 -77
- package/example_applications/simple_cards/source/views/PictView-FlowExample-Documentation.js +0 -325
- package/example_applications/simple_cards/source/views/PictView-FlowExample-FileWriteInfo.js +0 -59
- package/example_applications/simple_cards/source/views/PictView-FlowExample-Layout.js +0 -90
- package/example_applications/simple_cards/source/views/PictView-FlowExample-MainWorkspace.js +0 -453
- package/example_applications/simple_cards/source/views/PictView-FlowExample-TopBar.js +0 -95
- package/scripts/generate-card-help.js +0 -214
- package/source/providers/edges/Edge-Bezier.js +0 -41
- package/source/providers/edges/Edge-Orthogonal.js +0 -37
- package/source/providers/edges/Edge-OrthogonalSnap.js +0 -72
- package/source/providers/edges/Edge-Perimeter-Linear.js +0 -31
- package/source/providers/edges/Edge-Perimeter-Orthogonal.js +0 -39
- package/source/providers/edges/Edge-Perimeter.js +0 -48
- package/source/providers/edges/Edge-PerimeterMath.js +0 -92
- package/source/providers/edges/Edge-Straight.js +0 -24
- package/source/providers/layouts/Layout-Circular.js +0 -203
- package/source/providers/layouts/Layout-Coerce.js +0 -40
- package/source/providers/layouts/Layout-Columnar.js +0 -134
- package/source/providers/layouts/Layout-Custom.js +0 -27
- package/source/providers/layouts/Layout-ForcedFromCenter.js +0 -256
- package/source/providers/layouts/Layout-Grid.js +0 -134
- package/source/providers/layouts/Layout-Layered.js +0 -155
- package/source/providers/layouts/Layout-Rank.js +0 -141
- package/source/providers/layouts/Layout-Staggered.js +0 -131
- package/source/providers/layouts/Layout-Tabular.js +0 -94
- package/test/ConnectionHandleManager_tests.js +0 -717
- package/test/ConnectionRenderer_tests.js +0 -591
- package/test/DataManager_tests.js +0 -859
- package/test/Geometry_tests.js +0 -767
- package/test/InteractionManager_tests.js +0 -279
- package/test/Layout_tests.js +0 -1604
- package/test/NodeView_tests.js +0 -66
- package/test/PanelManager_tests.js +0 -172
- package/test/PathGenerator_tests.js +0 -978
- package/test/PortRenderer_tests.js +0 -376
- package/test/RenderManager_tests.js +0 -756
- package/test/Renderer_tests.js +0 -133
- package/test/SelectionManager_tests.js +0 -185
- package/test/StylePresets_tests.js +0 -153
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";function _defineProperty(t,e,o){return(e=_toPropertyKey(e))in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}function _toPropertyKey(t){var e=_toPrimitive(t,"string");return"symbol"==typeof e?e:e+""}function _toPrimitive(t,e){if("object"!=typeof t||!t)return t;var o=t[Symbol.toPrimitive];if(void 0!==o){var i=o.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).PictSectionFlow=t()}}(function(){return function t(e,o,i){function n(a,l){if(!o[a]){if(!e[a]){var s="function"==typeof require&&require;if(!l&&s)return s(a,!0);if(r)return r(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var d=o[a]={exports:{}};e[a][0].call(d.exports,function(t){return n(e[a][1][t]||t)},d,d.exports,t,e,o,i)}return o[a].exports}for(var r="function"==typeof require&&require,a=0;a<i.length;a++)n(i[a]);return n}({1:[function(t,e,o){e.exports=t("./views/PictView-Flow.js"),e.exports.PictViewFlowNode=t("./views/PictView-Flow-Node.js"),e.exports.PictViewFlowToolbar=t("./views/PictView-Flow-Toolbar.js"),e.exports.PictViewFlowFloatingToolbar=t("./views/PictView-Flow-FloatingToolbar.js"),e.exports.PictServiceFlowInteractionManager=t("./services/PictService-Flow-InteractionManager.js"),e.exports.PictServiceFlowConnectionRenderer=t("./services/PictService-Flow-ConnectionRenderer.js"),e.exports.PictServiceFlowTether=t("./services/PictService-Flow-Tether.js"),e.exports.PictServiceFlowLayout=t("./services/PictService-Flow-Layout.js"),e.exports.PictServiceFlowPathGenerator=t("./services/PictService-Flow-PathGenerator.js"),e.exports.PictServiceFlowViewportManager=t("./services/PictService-Flow-ViewportManager.js"),e.exports.PictServiceFlowSelectionManager=t("./services/PictService-Flow-SelectionManager.js"),e.exports.PictServiceFlowPanelManager=t("./services/PictService-Flow-PanelManager.js"),e.exports.PictServiceFlowDataManager=t("./services/PictService-Flow-DataManager.js"),e.exports.PictServiceFlowConnectionHandleManager=t("./services/PictService-Flow-ConnectionHandleManager.js"),e.exports.PictServiceFlowRenderManager=t("./services/PictService-Flow-RenderManager.js"),e.exports.PictServiceFlowPortRenderer=t("./services/PictService-Flow-PortRenderer.js"),e.exports.PictProviderFlowNodeTypes=t("./providers/PictProvider-Flow-NodeTypes.js"),e.exports.PictProviderFlowEventHandler=t("./providers/PictProvider-Flow-EventHandler.js"),e.exports.PictProviderFlowLayouts=t("./providers/PictProvider-Flow-Layouts.js"),e.exports.PictProviderFlowSVGHelpers=t("./providers/PictProvider-Flow-SVGHelpers.js"),e.exports.PictProviderFlowGeometry=t("./providers/PictProvider-Flow-Geometry.js"),e.exports.PictProviderFlowPanelChrome=t("./providers/PictProvider-Flow-PanelChrome.js"),e.exports.PictProviderFlowCSS=t("./providers/PictProvider-Flow-CSS.js"),e.exports.PictProviderFlowIcons=t("./providers/PictProvider-Flow-Icons.js"),e.exports.PictProviderFlowConnectorShapes=t("./providers/PictProvider-Flow-ConnectorShapes.js"),e.exports.LayoutAlgorithms={Custom:t("./providers/layouts/Layout-Custom.js"),Layered:t("./providers/layouts/Layout-Layered.js"),ForcedFromCenter:t("./providers/layouts/Layout-ForcedFromCenter.js"),Grid:t("./providers/layouts/Layout-Grid.js"),Circular:t("./providers/layouts/Layout-Circular.js"),Tabular:t("./providers/layouts/Layout-Tabular.js"),Columnar:t("./providers/layouts/Layout-Columnar.js")},e.exports.EdgeThemes={Bezier:t("./providers/edges/Edge-Bezier.js"),Orthogonal:t("./providers/edges/Edge-Orthogonal.js"),Straight:t("./providers/edges/Edge-Straight.js"),OrthogonalSnap:t("./providers/edges/Edge-OrthogonalSnap.js"),Perimeter:t("./providers/edges/Edge-Perimeter.js"),PerimeterLinear:t("./providers/edges/Edge-Perimeter-Linear.js"),PerimeterOrthogonal:t("./providers/edges/Edge-Perimeter-Orthogonal.js")},e.exports.PictFlowCard=t("./PictFlowCard.js"),e.exports.PictFlowCardPropertiesPanel=t("./PictFlowCardPropertiesPanel.js"),e.exports.FlowCardPropertiesPanelTemplate=t("./panels/FlowCardPropertiesPanel-Template.js"),e.exports.FlowCardPropertiesPanelMarkdown=t("./panels/FlowCardPropertiesPanel-Markdown.js"),e.exports.FlowCardPropertiesPanelForm=t("./panels/FlowCardPropertiesPanel-Form.js"),e.exports.FlowCardPropertiesPanelView=t("./panels/FlowCardPropertiesPanel-View.js"),e.exports.PictViewFlowPropertiesPanel=t("./views/PictView-Flow-PropertiesPanel.js")},{"./PictFlowCard.js":2,"./PictFlowCardPropertiesPanel.js":3,"./panels/FlowCardPropertiesPanel-Form.js":4,"./panels/FlowCardPropertiesPanel-Markdown.js":5,"./panels/FlowCardPropertiesPanel-Template.js":6,"./panels/FlowCardPropertiesPanel-View.js":7,"./providers/PictProvider-Flow-CSS.js":8,"./providers/PictProvider-Flow-ConnectorShapes.js":9,"./providers/PictProvider-Flow-EventHandler.js":10,"./providers/PictProvider-Flow-Geometry.js":11,"./providers/PictProvider-Flow-Icons.js":12,"./providers/PictProvider-Flow-Layouts.js":13,"./providers/PictProvider-Flow-NodeTypes.js":14,"./providers/PictProvider-Flow-PanelChrome.js":16,"./providers/PictProvider-Flow-SVGHelpers.js":17,"./providers/edges/Edge-Bezier.js":19,"./providers/edges/Edge-Orthogonal.js":20,"./providers/edges/Edge-OrthogonalSnap.js":21,"./providers/edges/Edge-Perimeter-Linear.js":22,"./providers/edges/Edge-Perimeter-Orthogonal.js":23,"./providers/edges/Edge-Perimeter.js":24,"./providers/edges/Edge-Straight.js":26,"./providers/layouts/Layout-Circular.js":27,"./providers/layouts/Layout-Columnar.js":29,"./providers/layouts/Layout-Custom.js":30,"./providers/layouts/Layout-ForcedFromCenter.js":31,"./providers/layouts/Layout-Grid.js":32,"./providers/layouts/Layout-Layered.js":33,"./providers/layouts/Layout-Tabular.js":34,"./services/PictService-Flow-ConnectionHandleManager.js":35,"./services/PictService-Flow-ConnectionRenderer.js":36,"./services/PictService-Flow-DataManager.js":37,"./services/PictService-Flow-InteractionManager.js":38,"./services/PictService-Flow-Layout.js":39,"./services/PictService-Flow-PanelManager.js":40,"./services/PictService-Flow-PathGenerator.js":41,"./services/PictService-Flow-PortRenderer.js":42,"./services/PictService-Flow-RenderManager.js":43,"./services/PictService-Flow-SelectionManager.js":44,"./services/PictService-Flow-Tether.js":45,"./services/PictService-Flow-ViewportManager.js":46,"./views/PictView-Flow-FloatingToolbar.js":47,"./views/PictView-Flow-Node.js":48,"./views/PictView-Flow-PropertiesPanel.js":49,"./views/PictView-Flow-Toolbar.js":50,"./views/PictView-Flow.js":51}],2:[function(t,e,o){const i=t("fable-serviceproviderbase");class n extends i{constructor(t,e,o){let i=Object.assign({},n.default_configuration,e);super(t,i,o),this.serviceType="PictFlowCard",this.cardTitle=i.Title?i.Title:"Card",this.cardName=!!i.Name&&i.Name,this.cardCode=i.Code?i.Code:"",this.cardDescription=!!i.Description&&i.Description,this.cardIcon=!!i.Icon&&i.Icon,this.cardPreviewImage=!!i.PreviewImage&&i.PreviewImage,this.cardDocumentation=!!i.Documentation&&i.Documentation,this.cardTooltip=!!i.Tooltip&&i.Tooltip,this.cardHelp=!!i.Help&&i.Help,this.cardEnabled="boolean"!=typeof i.Enabled||i.Enabled,this.cardTitleBarColor=i.TitleBarColor?i.TitleBarColor:"#2c3e50",this.cardBodyStyle=i.BodyStyle?i.BodyStyle:{},this.cardWidth="number"==typeof i.Width?i.Width:180,this.cardHeight="number"==typeof i.Height?i.Height:80,this.cardCategory=i.Category?i.Category:"General",this.cardInputs=Array.isArray(i.Inputs)?i.Inputs:[],this.cardOutputs=Array.isArray(i.Outputs)?i.Outputs:[],this.cardPropertiesPanel=i.PropertiesPanel&&"object"==typeof i.PropertiesPanel?i.PropertiesPanel:null,this.cardBodyContent=i.BodyContent&&"object"==typeof i.BodyContent?i.BodyContent:null,this.cardShowTypeLabel="boolean"!=typeof i.ShowTypeLabel||i.ShowTypeLabel,this.cardPortLabelsOnHover="boolean"==typeof i.PortLabelsOnHover&&i.PortLabelsOnHover,this.cardPortLabelsVertical="boolean"==typeof i.PortLabelsVertical&&i.PortLabelsVertical,this.cardPortLabelPadding="boolean"==typeof i.PortLabelPadding&&i.PortLabelPadding,this.cardPortLabelsOutside="boolean"==typeof i.PortLabelsOutside&&i.PortLabelsOutside,this.cardLabelsInFront="boolean"!=typeof i.LabelsInFront||i.LabelsInFront}getNodeTypeConfiguration(){let t=[];for(let e=0;e<this.cardInputs.length;e++){let o=this.cardInputs[e],i={Hash:null,Direction:"input",Side:o.Side||"left",Label:o.Name||"In ".concat(e+1),MinimumInputCount:"number"==typeof o.MinimumInputCount?o.MinimumInputCount:0,MaximumInputCount:"number"==typeof o.MaximumInputCount?o.MaximumInputCount:-1};o.PortType&&(i.PortType=o.PortType),o.DataType&&(i.DataType=o.DataType),t.push(i)}for(let e=0;e<this.cardOutputs.length;e++){let o=this.cardOutputs[e],i={Hash:null,Direction:"output",Side:o.Side||"right",Label:o.Name||"Out ".concat(e+1)};o.PortType&&(i.PortType=o.PortType),o.DataType&&(i.DataType=o.DataType),t.push(i)}0===t.length&&(t.push({Hash:null,Direction:"input",Side:"left",Label:"In"}),t.push({Hash:null,Direction:"output",Side:"right",Label:"Out"}));let e={Hash:this.cardCode,Label:this.cardTitle,DefaultWidth:this.cardWidth,DefaultHeight:this.cardHeight,DefaultPorts:t,TitleBarColor:this.cardTitleBarColor,BodyStyle:JSON.parse(JSON.stringify(this.cardBodyStyle)),CardMetadata:{Name:this.cardName,Code:this.cardCode,Description:this.cardDescription,Icon:this.cardIcon,PreviewImage:this.cardPreviewImage,Documentation:this.cardDocumentation,Tooltip:this.cardTooltip,Enabled:this.cardEnabled,Category:this.cardCategory,Help:this.cardHelp}};return e.ShowTypeLabel=this.cardShowTypeLabel,e.PortLabelsOnHover=this.cardPortLabelsOnHover,e.PortLabelsVertical=this.cardPortLabelsVertical,e.PortLabelPadding=this.cardPortLabelPadding,e.PortLabelsOutside=this.cardPortLabelsOutside,e.LabelsInFront=this.cardLabelsInFront,this.cardPropertiesPanel&&(e.PropertiesPanel=JSON.parse(JSON.stringify(this.cardPropertiesPanel))),this.cardBodyContent&&(e.BodyContent=JSON.parse(JSON.stringify(this.cardBodyContent)),"function"==typeof this.options.BodyContent.RenderCallback&&(e.BodyContent.RenderCallback=this.options.BodyContent.RenderCallback)),e}registerWithFlowView(t){if(!t||!t._NodeTypeProvider)return this.log.warn("PictFlowCard registerWithFlowView: no valid FlowView or NodeTypeProvider"),!1;let e=this.getNodeTypeConfiguration();return t._NodeTypeProvider.registerNodeType(e)}}e.exports=n,e.exports.default_configuration={Title:"Card",Name:!1,Code:"",Description:!1,Icon:!1,PreviewImage:!1,Documentation:!1,Tooltip:!1,Inputs:[],Outputs:[],Enabled:!0,TitleBarColor:"#2c3e50",BodyStyle:{},Width:180,Height:80,Category:"General",PropertiesPanel:null,BodyContent:null,ShowTypeLabel:!0,PortLabelsOnHover:!1,PortLabelsVertical:!1,PortLabelPadding:!1,PortLabelsOutside:!1,LabelsInFront:!0}},{"fable-serviceproviderbase":53}],3:[function(t,e,o){const i=t("fable-serviceproviderbase");class n extends i{constructor(t,e,o){let i=Object.assign({},n.default_configuration,e);super(t,i,o),this.serviceType="PictFlowCardPropertiesPanel",this.panelType=i.PanelType||"Base",this.panelTitle=i.Title||"Properties",this.panelWidth="number"==typeof i.Width?i.Width:300,this.panelHeight="number"==typeof i.Height?i.Height:200,this._FlowView=null,this._NodeData=null,this._ContentContainer=null,this._Configuration=i.Configuration||{}}render(t,e){this._ContentContainer=t,this._NodeData=e}marshalToPanel(t){this._NodeData=t}marshalFromPanel(t){}destroy(){this._ContentContainer=null,this._NodeData=null}}e.exports=n,e.exports.default_configuration={PanelType:"Base",Title:"Properties",Width:300,Height:200,Configuration:{}}},{"fable-serviceproviderbase":53}],4:[function(t,e,o){const i=t("../PictFlowCardPropertiesPanel.js");e.exports=class extends i{constructor(t,e,o){super(t,e,o),this.serviceType="PictFlowCardPropertiesPanel-Form",this._Metacontroller=null,this._InjectedSectionHash=null}render(t,e){if(super.render(t,e),!this._Configuration||!this._Configuration.Manifest)return void(t.innerHTML="<em>No form manifest configured</em>");let o="pict-flow-panel-form-".concat(e.Hash);t.innerHTML='<div id="'.concat(o,'"></div>'),this.fable.AppData.Record=e;try{if(!this._Metacontroller){let t=null;this.fable.servicesMap.hasOwnProperty("PictFormMetacontroller")?t="PictFormMetacontroller":this.fable.servicesMap.hasOwnProperty("PictViewFormMetacontroller")&&(t="PictViewFormMetacontroller"),t&&(this._Metacontroller=this.fable.instantiateServiceProviderWithoutRegistration(t,{ViewIdentifier:"FlowPanelForm-".concat(e.Hash),DefaultDestinationAddress:"#".concat(o),AutoRender:!1,AutoPopulateAfterRender:!0,AutoSolveBeforeRender:!1}))}if(this._Metacontroller&&"function"==typeof this._Metacontroller.injectManifestAndRender){let e="Pict-".concat(this._Metacontroller.UUID,"-FormContainer"),i=t.querySelector("#".concat(o));i&&(i.innerHTML='<div id="'.concat(e,'" class="pict-form"></div>'));let n=JSON.parse(JSON.stringify(this._Configuration.Manifest));this._InjectedSectionHash=n.Hash||null,this._Metacontroller.injectManifestAndRender(n)}else if(this._Metacontroller&&"function"==typeof this._Metacontroller.injectManifest){let e=JSON.parse(JSON.stringify(this._Configuration.Manifest)),i=this._Metacontroller.injectManifest(e);this._InjectedSectionHash=e.Hash||null;let n=t.querySelector("#".concat(o));if(n&&i.length>0){let t="";for(let e=0;e<i.length;e++){let o=i[e].options.DefaultDestinationAddress;o&&"#"===o.charAt(0)&&(o=o.substring(1)),t+='<div id="'.concat(o,'" class="pict-form-view"></div>')}n.innerHTML=t;for(let t=0;t<i.length;t++)i[t].render()}}else t.innerHTML="<em>pict-section-form is not available. Install it in your application to use Form panels.</em>"}catch(e){this.log.warn("FlowCardPropertiesPanel-Form render error: ".concat(e.message)),t.innerHTML="<em>Form render error: ".concat(e.message,"</em>")}}marshalFromPanel(t){this._Metacontroller&&"function"==typeof this._Metacontroller.marshalFromView&&this._Metacontroller.marshalFromView()}destroy(){this._Metacontroller=null,this._InjectedSectionHash=null,super.destroy()}},e.exports.default_configuration=Object.assign({},i.default_configuration,{PanelType:"Form",Configuration:{Manifest:null}})},{"../PictFlowCardPropertiesPanel.js":3}],5:[function(t,e,o){const i=t("../PictFlowCardPropertiesPanel.js");e.exports=class extends i{constructor(t,e,o){super(t,e,o),this.serviceType="PictFlowCardPropertiesPanel-Markdown",this._ContentProvider=null}render(t,e){super.render(t,e),this._renderMarkdown()}marshalToPanel(t){super.marshalToPanel(t),this._renderMarkdown()}_renderMarkdown(){if(!this._ContentContainer||!this._Configuration)return;let t="";if(this._Configuration.MarkdownAddress&&this._NodeData?t=this.fable.manifest.getValueByHash(this._NodeData,this._Configuration.MarkdownAddress)||"":this._Configuration.Markdown&&(t=this._Configuration.Markdown),t)try{if(this._ContentProvider||this.fable.servicesMap.hasOwnProperty("PictContentProvider")&&(this._ContentProvider=this.fable.instantiateServiceProviderWithoutRegistration("PictContentProvider",{})),this._ContentProvider&&"function"==typeof this._ContentProvider.parseMarkdown){let e=this._ContentProvider.parseMarkdown(t);this._ContentContainer.innerHTML=e,"function"==typeof this._ContentProvider.renderKaTeXEquations&&this._ContentProvider.renderKaTeXEquations(this._ContentContainer),"function"==typeof this._ContentProvider.renderMermaidDiagrams&&this._ContentProvider.renderMermaidDiagrams(this._ContentContainer)}else this._ContentContainer.innerHTML='<pre style="white-space: pre-wrap; font-family: inherit;">'.concat(this._escapeHTML(t),"</pre>")}catch(e){this.log.warn("FlowCardPropertiesPanel-Markdown render error: ".concat(e.message)),this._ContentContainer.innerHTML='<pre style="white-space: pre-wrap; font-family: inherit;">'.concat(this._escapeHTML(t),"</pre>")}else this._ContentContainer.innerHTML="<em>No content</em>"}_escapeHTML(t){let e=document.createElement("div");return e.textContent=t,e.innerHTML}destroy(){this._ContentProvider=null,super.destroy()}},e.exports.default_configuration=Object.assign({},i.default_configuration,{PanelType:"Markdown",Configuration:{Markdown:"",MarkdownAddress:""}})},{"../PictFlowCardPropertiesPanel.js":3}],6:[function(t,e,o){const i=t("../PictFlowCardPropertiesPanel.js");e.exports=class extends i{constructor(t,e,o){super(t,e,o),this.serviceType="PictFlowCardPropertiesPanel-Template",this._TemplatesRegistered=!1}render(t,e){if(super.render(t,e),this._Configuration&&this._Configuration.Templates){if(!this._TemplatesRegistered){let t=this._Configuration.Templates;for(let e=0;e<t.length;e++)t[e].Hash&&t[e].Template&&this.fable.TemplateProvider.addTemplate(t[e].Hash,t[e].Template);this._TemplatesRegistered=!0}this._renderTemplate()}}marshalToPanel(t){super.marshalToPanel(t),this._renderTemplate()}_renderTemplate(){if(!this._ContentContainer||!this._NodeData)return;let t=this._Configuration.TemplateHash;if(!t)return;let e=this._NodeData,o=this.fable.parseTemplateByHash(t,e,null,[e]);this._ContentContainer.innerHTML=o}},e.exports.default_configuration=Object.assign({},i.default_configuration,{PanelType:"Template",Configuration:{Templates:[],TemplateHash:""}})},{"../PictFlowCardPropertiesPanel.js":3}],7:[function(t,e,o){const i=t("../PictFlowCardPropertiesPanel.js");e.exports=class extends i{constructor(t,e,o){super(t,e,o),this.serviceType="PictFlowCardPropertiesPanel-View",this._OriginalDestination=null,this._ViewInstance=null}render(t,e){if(super.render(t,e),!this._Configuration||!this._Configuration.ViewHash)return void(t.innerHTML="<em>No ViewHash configured</em>");let o=this._Configuration.ViewHash,i="pict-flow-panel-view-".concat(e.Hash);t.innerHTML='<div id="'.concat(i,'"></div>');try{let e=this.pict||this.fable;e.views&&e.views[o]?(this._ViewInstance=e.views[o],this._OriginalDestination=this._ViewInstance.options.DefaultDestinationAddress,this._ViewInstance.options.DefaultDestinationAddress="#".concat(i),"function"==typeof this._ViewInstance.render&&this._ViewInstance.render()):t.innerHTML='<em>View "'.concat(o,'" not found</em>')}catch(e){this.log.warn("FlowCardPropertiesPanel-View render error: ".concat(e.message)),t.innerHTML="<em>View render error: ".concat(e.message,"</em>")}}marshalFromPanel(t){this._ViewInstance&&"function"==typeof this._ViewInstance.marshalFromView&&this._ViewInstance.marshalFromView()}destroy(){this._ViewInstance&&this._OriginalDestination&&(this._ViewInstance.options.DefaultDestinationAddress=this._OriginalDestination),this._ViewInstance=null,this._OriginalDestination=null,super.destroy()}},e.exports.default_configuration=Object.assign({},i.default_configuration,{PanelType:"View",Configuration:{ViewHash:""}})},{"../PictFlowCardPropertiesPanel.js":3}],8:[function(t,e,o){const i=t("fable-serviceproviderbase"),n={ProviderIdentifier:"PictProviderFlowCSS"};e.exports=class extends i{constructor(t,e,o){super(t,Object.assign({},n,e),o),this.serviceType="PictProviderFlowCSS",this._FlowView=e&&e.FlowView?e.FlowView:null}getContainerCSS(){return"\n\t\t.pict-flow-container {\n\t\t\t/* ── Design Tokens ─────────────────────────────────────\n\t\t\t Override these custom properties to theme the flow diagram.\n\t\t\t Node-type classes (.pict-flow-node-{type}) can scope-override\n\t\t\t any variable for per-type variation. */\n\n\t\t\t/* Text */\n\t\t\t--pf-text-primary: #2c3e50;\n\t\t\t--pf-text-heading: #1a252f;\n\t\t\t--pf-text-secondary: #7f8c8d;\n\t\t\t--pf-text-tertiary: #8e99a4;\n\t\t\t--pf-text-placeholder: #95a5a6;\n\n\t\t\t/* Node */\n\t\t\t--pf-node-body-fill: var(--theme-color-background-panel, #ffffff);\n\t\t\t--pf-node-body-stroke: #d0d4d8;\n\t\t\t--pf-node-body-stroke-hover: #b0b8c0;\n\t\t\t--pf-node-body-stroke-width: 1;\n\t\t\t--pf-node-body-radius: 8px;\n\t\t\t--pf-node-shadow: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.10));\n\t\t\t--pf-node-shadow-hover: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.15));\n\t\t\t--pf-node-shadow-selected: drop-shadow(0 2px 8px rgba(52, 152, 219, 0.25));\n\t\t\t--pf-node-shadow-dragging: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.20));\n\t\t\t--pf-node-title-fill: var(--theme-color-background-panel, #ffffff);\n\t\t\t--pf-node-title-size: 11.5px;\n\t\t\t--pf-node-title-weight: 600;\n\t\t\t--pf-node-title-bar-color: #2c3e50;\n\t\t\t--pf-node-type-label-fill: #a0a8b0;\n\t\t\t--pf-node-selected-stroke: #3498db;\n\n\t\t\t/* Node Variants */\n\t\t\t--pf-node-start-fill: #eafaf1;\n\t\t\t--pf-node-start-stroke: var(--theme-color-status-success, #27ae60);\n\t\t\t--pf-node-end-fill: #e8f8f5;\n\t\t\t--pf-node-end-stroke: #1abc9c;\n\t\t\t--pf-node-halt-fill: #fdedec;\n\t\t\t--pf-node-halt-stroke: var(--theme-color-status-error, #e74c3c);\n\t\t\t--pf-node-decision-fill: #fff9e6;\n\t\t\t--pf-node-decision-stroke: var(--theme-color-status-warning, #f39c12);\n\n\t\t\t/* Ports */\n\t\t\t--pf-port-input-fill: #3498db;\n\t\t\t--pf-port-output-fill: var(--theme-color-status-success, #2ecc71);\n\t\t\t--pf-port-stroke: var(--theme-color-background-panel, #ffffff);\n\t\t\t--pf-port-stroke-width: 2;\n\t\t\t--pf-port-label-bg: rgba(255, 253, 240, 0.5);\n\t\t\t--pf-port-label-text: #2c3e50;\n\n\t\t\t/* Port Type Colors */\n\t\t\t--pf-port-event-in-fill: #3498db;\n\t\t\t--pf-port-event-out-fill: var(--theme-color-status-success, #2ecc71);\n\t\t\t--pf-port-setting-fill: #e67e22;\n\t\t\t--pf-port-value-fill: #f1c40f;\n\t\t\t--pf-port-error-fill: var(--theme-color-status-error, #e74c3c);\n\n\t\t\t/* Connection Type Colors (match source port) */\n\t\t\t--pf-connection-event-in-stroke: #3498db;\n\t\t\t--pf-connection-event-out-stroke: var(--theme-color-status-success, #2ecc71);\n\t\t\t--pf-connection-setting-stroke: #e67e22;\n\t\t\t--pf-connection-value-stroke: #f1c40f;\n\t\t\t--pf-connection-error-stroke: var(--theme-color-status-error, #e74c3c);\n\n\t\t\t/* Connections */\n\t\t\t--pf-connection-stroke: #95a5a6;\n\t\t\t--pf-connection-stroke-hover: #7f8c8d;\n\t\t\t--pf-connection-selected-stroke: #3498db;\n\n\t\t\t/* Panels */\n\t\t\t--pf-panel-bg: #ffffff;\n\t\t\t--pf-panel-border: #d0d4d8;\n\t\t\t--pf-panel-radius: 8px;\n\t\t\t--pf-panel-shadow: 0 4px 12px rgba(0,0,0,0.10), 0 1px 3px rgba(0,0,0,0.06);\n\t\t\t--pf-panel-titlebar-bg: #f7f8fa;\n\t\t\t--pf-panel-titlebar-border: #e8eaed;\n\t\t\t--pf-panel-title-color: #2c3e50;\n\n\t\t\t/* Tabs */\n\t\t\t--pf-tab-text: #8e99a4;\n\t\t\t--pf-tab-text-hover: #5a6a7a;\n\t\t\t--pf-tab-active-border: var(--pf-node-selected-stroke);\n\t\t\t--pf-resize-handle-hover: #e0e3e6;\n\n\t\t\t/* Forms & Inputs */\n\t\t\t--pf-input-border: #d5d8dc;\n\t\t\t--pf-input-border-focus: #3498db;\n\t\t\t--pf-divider-light: #ecf0f1;\n\t\t\t--pf-divider-medium: #e8eaed;\n\n\t\t\t/* Buttons */\n\t\t\t--pf-button-border: #bdc3c7;\n\t\t\t--pf-button-hover-border: #95a5a6;\n\t\t\t--pf-button-hover-bg: #ecf0f1;\n\t\t\t--pf-button-active-bg: #d5dbdb;\n\t\t\t--pf-button-danger-text: #e74c3c;\n\t\t\t--pf-button-danger-hover-bg: #fdedec;\n\t\t\t--pf-button-close-color: #b0b8c0;\n\n\t\t\t/* Badges */\n\t\t\t--pf-badge-category-bg: #f0f2f4;\n\t\t\t--pf-badge-category-text: #6b7b8d;\n\t\t\t--pf-badge-code-bg: #eaf2f8;\n\t\t\t--pf-badge-code-text: #2980b9;\n\n\t\t\t/* Info Panel */\n\t\t\t--pf-port-item-bg: #f8f9fa;\n\n\t\t\t/* Toolbar */\n\t\t\t--pf-toolbar-bg: #ffffff;\n\t\t\t--pf-toolbar-border: var(--theme-color-border-default, #e0e0e0);\n\n\t\t\t/* Palette Cards */\n\t\t\t--pf-card-border: #d5d8dc;\n\t\t\t--pf-card-hover-bg: #eaf2f8;\n\t\t\t--pf-card-hover-shadow: 0 1px 3px rgba(52, 152, 219, 0.15);\n\n\t\t\t/* Canvas */\n\t\t\t--pf-canvas-bg: #fafafa;\n\t\t\t--pf-grid-stroke: var(--theme-color-border-light, #e8e8e8);\n\n\t\t\tposition: relative;\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\tmin-height: 400px;\n\t\t\toverflow: hidden;\n\t\t\tbackground-color: var(--pf-canvas-bg);\n\t\t\tborder: 1px solid var(--pf-toolbar-border);\n\t\t\tborder-radius: 4px;\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t}\n\t\t.pict-flow-svg-container {\n\t\t\tflex: 1;\n\t\t\tmin-height: 0;\n\t\t\tposition: relative;\n\t\t}\n\t\t.pict-flow-svg {\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\tcursor: grab;\n\t\t\tuser-select: none;\n\t\t\t-webkit-user-select: none;\n\t\t}\n\t\t.pict-flow-svg.panning {\n\t\t\tcursor: grabbing;\n\t\t}\n\t\t.pict-flow-svg.connecting {\n\t\t\tcursor: crosshair;\n\t\t}\n\t\t.pict-flow-grid-pattern line {\n\t\t\tstroke: var(--pf-grid-stroke);\n\t\t\tstroke-width: 0.5;\n\t\t}\n\t\t"}getNodeCSS(){return'\n\t\t.pict-flow-node {\n\t\t\tcursor: pointer;\n\t\t\tfilter: var(--pf-node-shadow);\n\t\t\ttransition: filter 0.2s;\n\t\t}\n\t\t.pict-flow-node:hover {\n\t\t\tfilter: var(--pf-node-shadow-hover);\n\t\t}\n\t\t.pict-flow-node:hover .pict-flow-node-body {\n\t\t\tstroke: var(--pf-node-body-stroke-hover);\n\t\t\tstroke-width: 1.5;\n\t\t}\n\t\t.pict-flow-node.selected {\n\t\t\tfilter: var(--pf-node-shadow-selected);\n\t\t}\n\t\t.pict-flow-node.selected .pict-flow-node-body {\n\t\t\tstroke: var(--pf-node-selected-stroke);\n\t\t\tstroke-width: 2;\n\t\t}\n\t\t.pict-flow-node.dragging {\n\t\t\topacity: 0.9;\n\t\t\tcursor: grabbing;\n\t\t\tfilter: var(--pf-node-shadow-dragging);\n\t\t}\n\t\t.pict-flow-node-body {\n\t\t\tfill: var(--pf-node-body-fill);\n\t\t\tstroke: var(--pf-node-body-stroke);\n\t\t\tstroke-width: var(--pf-node-body-stroke-width);\n\t\t\trx: var(--pf-node-body-radius);\n\t\t\try: var(--pf-node-body-radius);\n\t\t\ttransition: stroke 0.2s, stroke-width 0.2s;\n\t\t}\n\t\t.pict-flow-node-title-bar {\n\t\t\tfill: var(--pf-node-title-bar-color);\n\t\t\trx: var(--pf-node-body-radius);\n\t\t\try: var(--pf-node-body-radius);\n\t\t}\n\t\t.pict-flow-node-title-bar-bottom {\n\t\t\tfill: var(--pf-node-title-bar-color);\n\t\t}\n\t\t.pict-flow-node-title {\n\t\t\tfill: var(--pf-node-title-fill);\n\t\t\tfont-size: var(--pf-node-title-size);\n\t\t\tfont-weight: var(--pf-node-title-weight);\n\t\t\tfont-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;\n\t\t\tletter-spacing: 0.2px;\n\t\t\tpointer-events: none;\n\t\t}\n\t\t.pict-flow-node-type-label {\n\t\t\tfill: var(--pf-node-type-label-fill);\n\t\t\tfont-size: 9.5px;\n\t\t\tfont-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;\n\t\t\ttext-transform: uppercase;\n\t\t\tletter-spacing: 0.3px;\n\t\t\tpointer-events: none;\n\t\t\topacity: 0;\n\t\t\ttransition: opacity 0.2s;\n\t\t}\n\t\t.pict-flow-node:hover .pict-flow-node-type-label {\n\t\t\topacity: 1;\n\t\t}\n\t\t.pict-flow-node-card-code {\n\t\t\topacity: 0;\n\t\t\ttransition: opacity 0.2s;\n\t\t}\n\t\t.pict-flow-node:hover .pict-flow-node-card-code {\n\t\t\topacity: 1;\n\t\t}\n\t\t/* Title-bar icon: invert SVG paths to white for dark title bars */\n\t\t.pict-flow-node-title-icon {\n\t\t\tfilter: brightness(0) invert(1);\n\t\t}\n\t\t'}getBodyContentCSS(){return'\n\t\t.pict-flow-node-body-content {\n\t\t\tpointer-events: none;\n\t\t}\n\t\t.pict-flow-node-body-content-fo {\n\t\t\toverflow: hidden;\n\t\t}\n\t\t.pict-flow-node-body-content-html {\n\t\t\toverflow: hidden;\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\tbox-sizing: border-box;\n\t\t\tfont-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;\n\t\t\tfont-size: 11px;\n\t\t\tcolor: var(--pf-text-primary);\n\t\t\tpointer-events: auto;\n\t\t}\n\t\t.pict-flow-node-body-content-canvas {\n\t\t\tdisplay: block;\n\t\t\tpointer-events: auto;\n\t\t}\n\t\t'}getNodeVariantCSS(){return"\n\t\t.pict-flow-node-decision .pict-flow-node-body {\n\t\t\tfill: var(--pf-node-decision-fill);\n\t\t\tstroke: var(--pf-node-decision-stroke);\n\t\t\tstroke-width: 1.5;\n\t\t}\n\t\t.pict-flow-node-start .pict-flow-node-body {\n\t\t\tfill: var(--pf-node-start-fill);\n\t\t\tstroke: var(--pf-node-start-stroke);\n\t\t\tstroke-width: 1.5;\n\t\t}\n\t\t.pict-flow-node-end .pict-flow-node-body {\n\t\t\tfill: var(--pf-node-end-fill);\n\t\t\tstroke: var(--pf-node-end-stroke);\n\t\t\tstroke-width: 1.5;\n\t\t}\n\t\t.pict-flow-node-halt .pict-flow-node-body {\n\t\t\tfill: var(--pf-node-halt-fill);\n\t\t\tstroke: var(--pf-node-halt-stroke);\n\t\t\tstroke-width: 1.5;\n\t\t}\n\t\t"}getPortCSS(){return'\n\t\t.pict-flow-port {\n\t\t\tcursor: crosshair;\n\t\t\ttransition: r 0.15s, filter 0.15s;\n\t\t\tfilter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.12));\n\t\t}\n\t\t.pict-flow-port.input {\n\t\t\tfill: var(--pf-port-input-fill);\n\t\t\tstroke: var(--pf-port-stroke);\n\t\t\tstroke-width: var(--pf-port-stroke-width);\n\t\t}\n\t\t.pict-flow-port.output {\n\t\t\tfill: var(--pf-port-output-fill);\n\t\t\tstroke: var(--pf-port-stroke);\n\t\t\tstroke-width: var(--pf-port-stroke-width);\n\t\t}\n\t\t.pict-flow-port:hover {\n\t\t\tr: 7;\n\t\t\tfilter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.20));\n\t\t}\n\t\t/* Port type color overrides */\n\t\t.pict-flow-port.port-type-event-in {\n\t\t\tfill: var(--pf-port-event-in-fill);\n\t\t}\n\t\t.pict-flow-port.port-type-event-out {\n\t\t\tfill: var(--pf-port-event-out-fill);\n\t\t}\n\t\t.pict-flow-port.port-type-setting {\n\t\t\tfill: var(--pf-port-setting-fill);\n\t\t}\n\t\t.pict-flow-port.port-type-value {\n\t\t\tfill: var(--pf-port-value-fill);\n\t\t}\n\t\t.pict-flow-port.port-type-error {\n\t\t\tfill: var(--pf-port-error-fill);\n\t\t}\n\t\t.pict-flow-port-label {\n\t\t\tfont-size: 8px;\n\t\t\tfont-weight: 600;\n\t\t\tfont-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;\n\t\t\tpointer-events: none;\n\t\t}\n\t\t/* Port label badge background */\n\t\t.pict-flow-port-label-bg {\n\t\t\tpointer-events: none;\n\t\t}\n\t\t/* Port labels on hover: hidden by default, revealed on node hover */\n\t\t.pict-flow-node-port-labels-hover .pict-flow-port-label,\n\t\t.pict-flow-node-port-labels-hover .pict-flow-port-label-bg {\n\t\t\topacity: 0;\n\t\t\ttransition: opacity 0.2s;\n\t\t}\n\t\t.pict-flow-node-port-labels-hover:hover .pict-flow-port-label,\n\t\t.pict-flow-node-port-labels-hover:hover .pict-flow-port-label-bg {\n\t\t\topacity: 1;\n\t\t}\n\n\t\t/* Port-hint beziers — drawn from the badge to the actual dot\n\t\t when an edge theme has rerouted the connection. Hidden by\n\t\t default; PortRenderer / NodeView toggle data-active on hover. */\n\t\t.pict-flow-port-hint {\n\t\t\tfill: none;\n\t\t\tstroke: var(--pf-connection-stroke-hover, #3498db);\n\t\t\tstroke-width: 1.75;\n\t\t\tstroke-dasharray: 4 3;\n\t\t\tstroke-linecap: round;\n\t\t\topacity: 0;\n\t\t\tpointer-events: none;\n\t\t\ttransition: opacity 0.18s ease;\n\t\t}\n\t\t.pict-flow-port-hint[data-active="true"] {\n\t\t\topacity: 0.7;\n\t\t}\n\n\t\t/* ── Layout-algorithm popup: tightened layout + form styling ── */\n\t\t.pict-flow-popup-layout-algorithm-row {\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\tgap: 4px;\n\t\t\tpadding: 6px 10px 4px;\n\t\t}\n\t\t.pict-flow-popup-layout-algorithm-row > .pict-flow-popup-settings-label {\n\t\t\tfont-size: 10px;\n\t\t\tfont-weight: 700;\n\t\t\ttext-transform: uppercase;\n\t\t\tletter-spacing: 0.05em;\n\t\t\topacity: 0.7;\n\t\t\tmargin: 0;\n\t\t}\n\t\t.pict-flow-popup-layout-algorithm-controls {\n\t\t\tdisplay: flex;\n\t\t\talign-items: stretch;\n\t\t\tgap: 4px;\n\t\t}\n\t\t.pict-flow-popup-layout-algorithm-select {\n\t\t\tflex: 1 1 auto;\n\t\t\tmin-width: 0;\n\t\t}\n\t\t.pict-flow-popup-collapse-toggle {\n\t\t\tflex: 0 0 auto;\n\t\t\twidth: 28px;\n\t\t\tpadding: 0;\n\t\t\tborder: 1px solid var(--pf-button-border, #ccc);\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: var(--pf-toolbar-bg, #fff);\n\t\t\tcolor: var(--pf-text-secondary, #5a6470);\n\t\t\tcursor: pointer;\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\ttransition: background-color 0.15s, color 0.15s, border-color 0.15s;\n\t\t}\n\t\t.pict-flow-popup-collapse-toggle:hover {\n\t\t\tbackground-color: var(--pf-button-hover-bg, #eef);\n\t\t\tcolor: var(--pf-text-primary, #2c3e50);\n\t\t}\n\t\t/* "Open" state: pressed-in look so the user sees that the form\n\t\t below is being driven by this gear. */\n\t\t.pict-flow-popup-collapse-toggle[aria-expanded="true"] {\n\t\t\tbackground-color: var(--pf-button-active-bg, #d6e4f0);\n\t\t\tcolor: var(--pf-text-primary, #2c3e50);\n\t\t\tborder-color: var(--pf-button-hover-border, #3498db);\n\t\t}\n\t\t.pict-flow-popup-collapse-toggle svg {\n\t\t\tdisplay: block;\n\t\t}\n\t\t/* Subordinate description text — sits under a control (algorithm\n\t\t dropdown, edge-theme dropdown, etc.) and explains it. Indented\n\t\t from the section\'s left edge with a faint left rule so the\n\t\t visual hierarchy is unambiguous: SECTION LABEL > control >\n\t\t description. */\n\t\t.pict-flow-popup-control-description {\n\t\t\tfont-size: 11px;\n\t\t\tline-height: 1.4;\n\t\t\tcolor: var(--pf-text-secondary, #5a6470);\n\t\t\tpadding: 4px 12px 8px 28px;\n\t\t\tmargin-left: 14px;\n\t\t\tborder-left: 2px solid var(--pf-divider-light, #e6e6e6);\n\t\t}\n\n\t\t/* The form host. Acts as the collapsible container around the\n\t\t pict-section-form metacontroller\'s emitted markup. */\n\t\t.pict-flow-popup-layout-form-host {\n\t\t\tmargin: 0 10px 8px;\n\t\t\tpadding: 8px 10px;\n\t\t\tbackground: var(--pf-toolbar-bg, #fafafa);\n\t\t\tborder: 1px solid var(--pf-button-border, #e0e0e0);\n\t\t\tborder-radius: 6px;\n\t\t\toverflow: hidden;\n\t\t\tmax-height: 600px;\n\t\t\ttransition: max-height 0.22s ease, padding 0.22s ease,\n\t\t\t margin 0.22s ease, border-color 0.22s ease, opacity 0.18s ease;\n\t\t\topacity: 1;\n\t\t}\n\t\t.pict-flow-popup-layout-form-host[data-collapsed="true"] {\n\t\t\tmax-height: 0;\n\t\t\tpadding-top: 0;\n\t\t\tpadding-bottom: 0;\n\t\t\tmargin-top: 0;\n\t\t\tmargin-bottom: 0;\n\t\t\tborder-color: transparent;\n\t\t\topacity: 0;\n\t\t}\n\t\t.pict-flow-popup-layout-form-host > div { width: 100%; }\n\n\t\t/* Form contents — make the auto-rendered sections look professional.\n\t\t The section headings stay visible; the redundant per-section\n\t\t "Group: Defaults" h3 is suppressed. */\n\t\t.pict-flow-popup-layout-form .pict-form-view {\n\t\t\tdisplay: block;\n\t\t}\n\t\t.pict-flow-popup-layout-form .pict-form-section {\n\t\t\tmargin: 0;\n\t\t\tpadding: 0;\n\t\t}\n\t\t.pict-flow-popup-layout-form .pict-form-section h2 {\n\t\t\tfont-size: 10px;\n\t\t\tfont-weight: 700;\n\t\t\ttext-transform: uppercase;\n\t\t\tletter-spacing: 0.05em;\n\t\t\topacity: 0.6;\n\t\t\tmargin: 8px 0 4px;\n\t\t\tpadding: 0;\n\t\t\tborder-bottom: 1px solid var(--pf-button-border, #e6e6e6);\n\t\t\tpadding-bottom: 3px;\n\t\t}\n\t\t.pict-flow-popup-layout-form .pict-form-section:first-child h2,\n\t\t.pict-flow-popup-layout-form .pict-form-section h2:first-child {\n\t\t\tmargin-top: 0;\n\t\t}\n\t\t/* Group headings ("Group: Defaults") are noise — every algorithm\n\t\t has exactly one group right now. Hide them. */\n\t\t.pict-flow-popup-layout-form .pict-form-section h3 {\n\t\t\tdisplay: none;\n\t\t}\n\t\t/* Each row of inputs lives in a flat <div> as alternating\n\t\t <span>label</span><input> pairs. Lay them out in a balanced grid. */\n\t\t.pict-flow-popup-layout-form .pict-form-section > div > div {\n\t\t\tdisplay: flex;\n\t\t\tflex-wrap: wrap;\n\t\t\tgap: 4px 14px;\n\t\t\tmargin: 4px 0;\n\t\t\talign-items: center;\n\t\t}\n\t\t.pict-flow-popup-layout-form .pict-form-section span {\n\t\t\tfont-size: 12px;\n\t\t\tcolor: var(--pf-text-primary, #2c3e50);\n\t\t\tline-height: 1.4;\n\t\t\tmargin: 0;\n\t\t}\n\t\t.pict-flow-popup-layout-form input[type="number"],\n\t\t.pict-flow-popup-layout-form input[type="text"],\n\t\t.pict-flow-popup-layout-form select {\n\t\t\twidth: 88px;\n\t\t\tpadding: 2px 6px;\n\t\t\tborder: 1px solid var(--pf-button-border, #ccc);\n\t\t\tborder-radius: 3px;\n\t\t\tfont-size: 12px;\n\t\t\tline-height: 1.3;\n\t\t\tbackground: #fff;\n\t\t\tcolor: var(--pf-text-primary, #2c3e50);\n\t\t\tmargin-left: -8px; /* tighten gap between label and its input */\n\t\t}\n\t\t.pict-flow-popup-layout-form select {\n\t\t\twidth: auto;\n\t\t\tmin-width: 110px;\n\t\t}\n\t\t.pict-flow-popup-layout-form input[type="number"]:focus,\n\t\t.pict-flow-popup-layout-form input[type="text"]:focus,\n\t\t.pict-flow-popup-layout-form select:focus {\n\t\t\toutline: none;\n\t\t\tborder-color: var(--pf-button-hover-border, #3498db);\n\t\t\tbox-shadow: 0 0 0 2px rgba(52, 152, 219, 0.15);\n\t\t}\n\t\t.pict-flow-popup-layout-form input[type="checkbox"] {\n\t\t\tmargin: 0 4px 0 0;\n\t\t}\n\t\t'}getConnectionCSS(){return"\n\t\t.pict-flow-connection {\n\t\t\tfill: none;\n\t\t\tstroke: var(--pf-connection-stroke);\n\t\t\tstroke-width: 2;\n\t\t\tcursor: pointer;\n\t\t\ttransition: stroke 0.15s;\n\t\t}\n\t\t.pict-flow-connection:hover {\n\t\t\tstroke: var(--pf-connection-stroke-hover);\n\t\t\tstroke-width: 3;\n\t\t}\n\t\t.pict-flow-connection.selected {\n\t\t\tstroke: var(--pf-connection-selected-stroke);\n\t\t\tstroke-width: 3;\n\t\t}\n\t\t/* Connection type color overrides (based on source port type) */\n\t\t.pict-flow-connection.conn-type-event-in {\n\t\t\tstroke: var(--pf-connection-event-in-stroke);\n\t\t}\n\t\t.pict-flow-connection.conn-type-event-out {\n\t\t\tstroke: var(--pf-connection-event-out-stroke);\n\t\t}\n\t\t.pict-flow-connection.conn-type-setting {\n\t\t\tstroke: var(--pf-connection-setting-stroke);\n\t\t}\n\t\t.pict-flow-connection.conn-type-value {\n\t\t\tstroke: var(--pf-connection-value-stroke);\n\t\t}\n\t\t.pict-flow-connection.conn-type-error {\n\t\t\tstroke: var(--pf-connection-error-stroke);\n\t\t}\n\t\t.pict-flow-connection-hitarea {\n\t\t\tfill: none;\n\t\t\tstroke: transparent;\n\t\t\tstroke-width: 12;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.pict-flow-drag-connection {\n\t\t\tfill: none;\n\t\t\tstroke: var(--pf-node-selected-stroke);\n\t\t\tstroke-width: 2;\n\t\t\tstroke-dasharray: 6 3;\n\t\t\tpointer-events: none;\n\t\t}\n\t\t"}getHandleCSS(){return"\n\t\t.pict-flow-connection-handle {\n\t\t\tfill: var(--pf-panel-bg);\n\t\t\tstroke: var(--pf-node-selected-stroke);\n\t\t\tstroke-width: 2;\n\t\t\tcursor: grab;\n\t\t\ttransition: r 0.15s;\n\t\t\tfilter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));\n\t\t}\n\t\t.pict-flow-connection-handle:hover {\n\t\t\tr: 8;\n\t\t\tstroke-width: 2.5;\n\t\t}\n\t\t.pict-flow-connection-handle-midpoint {\n\t\t\tfill: var(--pf-panel-bg);\n\t\t\tstroke: var(--pf-port-setting-fill);\n\t\t\tstroke-width: 2;\n\t\t\tcursor: grab;\n\t\t\ttransition: r 0.15s;\n\t\t\tfilter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));\n\t\t}\n\t\t.pict-flow-connection-handle-midpoint:hover {\n\t\t\tr: 8;\n\t\t\tstroke-width: 2.5;\n\t\t}\n\t\t"}getTetherCSS(){return"\n\t\t.pict-flow-tether-line {\n\t\t\tfill: none;\n\t\t\tstroke: var(--pf-connection-stroke);\n\t\t\tstroke-width: 1.5;\n\t\t\tstroke-dasharray: 6 4;\n\t\t\tpointer-events: visibleStroke;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.pict-flow-tether-line.selected {\n\t\t\tstroke: var(--pf-node-selected-stroke);\n\t\t\tstroke-width: 2;\n\t\t}\n\t\t.pict-flow-tether-hitarea {\n\t\t\tfill: none;\n\t\t\tstroke: transparent;\n\t\t\tstroke-width: 10;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.pict-flow-tether-handle {\n\t\t\tfill: var(--pf-panel-bg);\n\t\t\tstroke: var(--pf-node-selected-stroke);\n\t\t\tstroke-width: 2;\n\t\t\tcursor: grab;\n\t\t\ttransition: r 0.15s;\n\t\t\tfilter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));\n\t\t}\n\t\t.pict-flow-tether-handle:hover {\n\t\t\tr: 8;\n\t\t\tstroke-width: 2.5;\n\t\t}\n\t\t.pict-flow-tether-handle-midpoint {\n\t\t\tfill: var(--pf-panel-bg);\n\t\t\tstroke: var(--pf-port-setting-fill);\n\t\t\tstroke-width: 2;\n\t\t\tcursor: grab;\n\t\t\ttransition: r 0.15s;\n\t\t\tfilter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));\n\t\t}\n\t\t.pict-flow-tether-handle-midpoint:hover {\n\t\t\tr: 8;\n\t\t\tstroke-width: 2.5;\n\t\t}\n\t\t"}getPanelCSS(){return'\n\t\t.pict-flow-node-panel-indicator {\n\t\t\tfill: var(--pf-node-selected-stroke);\n\t\t\tstroke: none;\n\t\t\topacity: 0.6;\n\t\t\tcursor: pointer;\n\t\t\ttransition: opacity 0.15s;\n\t\t}\n\t\t.pict-flow-node-panel-indicator:hover {\n\t\t\topacity: 1.0;\n\t\t}\n\t\t.pict-flow-panel-foreign-object {\n\t\t\toverflow: visible;\n\t\t}\n\t\t.pict-flow-panel {\n\t\t\tbackground: var(--pf-panel-bg);\n\t\t\tborder: 1px solid var(--pf-panel-border);\n\t\t\tborder-radius: var(--pf-panel-radius);\n\t\t\tbox-shadow: var(--pf-panel-shadow);\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\tfont-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;\n\t\t\tfont-size: 13px;\n\t\t\toverflow: hidden;\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\t\t.pict-flow-panel-titlebar {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: space-between;\n\t\t\tpadding: 8px 12px;\n\t\t\tbackground: var(--pf-panel-titlebar-bg);\n\t\t\tborder-bottom: 1px solid var(--pf-panel-titlebar-border);\n\t\t\tcursor: grab;\n\t\t\tuser-select: none;\n\t\t\t-webkit-user-select: none;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.pict-flow-panel-titlebar.dragging {\n\t\t\tcursor: grabbing;\n\t\t}\n\t\t.pict-flow-panel-title-text {\n\t\t\tfont-weight: 600;\n\t\t\tfont-size: 12px;\n\t\t\tcolor: var(--pf-panel-title-color);\n\t\t\twhite-space: nowrap;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\tletter-spacing: 0.1px;\n\t\t}\n\t\t.pict-flow-panel-close-btn {\n\t\t\tcursor: pointer;\n\t\t\tcolor: var(--pf-button-close-color);\n\t\t\tfont-size: 14px;\n\t\t\tline-height: 1;\n\t\t\tpadding: 4px;\n\t\t\tborder: none;\n\t\t\tbackground: none;\n\t\t\tborder-radius: 4px;\n\t\t\ttransition: background-color 0.15s, color 0.15s;\n\t\t}\n\t\t.pict-flow-panel-close-btn:hover {\n\t\t\tcolor: var(--pf-button-danger-text);\n\t\t\tbackground-color: rgba(231, 76, 60, 0.08);\n\t\t}\n\t\t.pict-flow-panel-content {\n\t\t\tflex: 1;\n\t\t\toverflow-y: auto;\n\t\t\tmin-height: 0;\n\t\t\tpadding: 0;\n\t\t}\n\t\t.pict-flow-panel-tab-pane {\n\t\t\tpadding: 10px 12px;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\t\t'}getInfoPanelCSS(){return'\n\t\t.pict-flow-info-panel {\n\t\t\tpadding: 2px 0;\n\t\t\tfont-size: 12px;\n\t\t\tline-height: 1.5;\n\t\t\tcolor: var(--pf-text-primary);\n\t\t}\n\t\t.pict-flow-info-panel-header {\n\t\t\tfont-size: 13px;\n\t\t\tfont-weight: 600;\n\t\t\tmargin-bottom: 6px;\n\t\t\tcolor: var(--pf-text-heading);\n\t\t}\n\t\t.pict-flow-info-panel-header.with-icon {\n\t\t\tfont-size: 14px;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 6px;\n\t\t}\n\t\t.pict-flow-info-panel-description {\n\t\t\tfont-size: 11px;\n\t\t\tcolor: var(--pf-text-secondary);\n\t\t\tmargin-bottom: 10px;\n\t\t\tline-height: 1.45;\n\t\t}\n\t\t.pict-flow-info-panel-badges {\n\t\t\tmargin-bottom: 10px;\n\t\t\tdisplay: flex;\n\t\t\tflex-wrap: wrap;\n\t\t\tgap: 4px;\n\t\t}\n\t\t.pict-flow-info-panel-badge {\n\t\t\tdisplay: inline-block;\n\t\t\tpadding: 2px 8px;\n\t\t\tborder-radius: 4px;\n\t\t\tfont-size: 10px;\n\t\t}\n\t\t.pict-flow-info-panel-badge.category {\n\t\t\tbackground: var(--pf-badge-category-bg);\n\t\t\tcolor: var(--pf-badge-category-text);\n\t\t}\n\t\t.pict-flow-info-panel-badge.code {\n\t\t\tbackground: var(--pf-badge-code-bg);\n\t\t\tcolor: var(--pf-badge-code-text);\n\t\t\tfont-family: "SF Mono", "Fira Code", monospace;\n\t\t}\n\t\t.pict-flow-info-panel-section {\n\t\t\tmargin-bottom: 8px;\n\t\t}\n\t\t.pict-flow-info-panel-section-title {\n\t\t\tfont-size: 10px;\n\t\t\tfont-weight: 600;\n\t\t\ttext-transform: uppercase;\n\t\t\tletter-spacing: 0.5px;\n\t\t\tcolor: var(--pf-text-tertiary);\n\t\t\tmargin-bottom: 4px;\n\t\t\tpadding-bottom: 2px;\n\t\t\tborder-bottom: 1px solid var(--pf-divider-light);\n\t\t}\n\t\t.pict-flow-info-panel-port {\n\t\t\tpadding: 3px 8px;\n\t\t\tbackground: var(--pf-port-item-bg);\n\t\t\tmargin-bottom: 3px;\n\t\t\tfont-size: 11px;\n\t\t\tborder-radius: 3px;\n\t\t}\n\t\t.pict-flow-info-panel-port.input {\n\t\t\tborder-left: 3px solid var(--pf-port-input-fill);\n\t\t}\n\t\t.pict-flow-info-panel-port.output {\n\t\t\tborder-left: 3px solid var(--pf-port-output-fill);\n\t\t}\n\t\t/* Info panel port type color overrides */\n\t\t.pict-flow-info-panel-port.port-type-event-in {\n\t\t\tborder-left-color: var(--pf-port-event-in-fill);\n\t\t}\n\t\t.pict-flow-info-panel-port.port-type-event-out {\n\t\t\tborder-left-color: var(--pf-port-event-out-fill);\n\t\t}\n\t\t.pict-flow-info-panel-port.port-type-setting {\n\t\t\tborder-left-color: var(--pf-port-setting-fill);\n\t\t}\n\t\t.pict-flow-info-panel-port.port-type-value {\n\t\t\tborder-left-color: var(--pf-port-value-fill);\n\t\t}\n\t\t.pict-flow-info-panel-port.port-type-error {\n\t\t\tborder-left-color: var(--pf-port-error-fill);\n\t\t}\n\t\t.pict-flow-info-panel-port-constraint {\n\t\t\tcolor: var(--pf-text-tertiary);\n\t\t\tfont-size: 10px;\n\t\t}\n\t\t/* Port summary section appended below form panels */\n\t\t.pict-flow-port-summary {\n\t\t\tmargin-top: 12px;\n\t\t\tpadding-top: 8px;\n\t\t\tborder-top: 1px solid var(--pf-divider-medium);\n\t\t}\n\t\t.pict-flow-info-panel-port.event {\n\t\t\tborder-left: 3px solid var(--pf-port-event-in-fill);\n\t\t}\n\t\t.pict-flow-info-panel-port.value {\n\t\t\tborder-left: 3px solid var(--pf-port-value-fill);\n\t\t}\n\t\t'}getNodePropsEditorCSS(){return'\n\t\t.pict-flow-node-props-fields {\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\tgap: 6px;\n\t\t}\n\t\t.pict-flow-node-props-field {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 8px;\n\t\t}\n\t\t.pict-flow-node-props-label {\n\t\t\tfont-size: 11px;\n\t\t\tcolor: var(--pf-text-secondary);\n\t\t\tmin-width: 72px;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.pict-flow-node-props-input {\n\t\t\tflex: 1;\n\t\t\tpadding: 3px 6px;\n\t\t\tborder: 1px solid var(--pf-input-border);\n\t\t\tborder-radius: 3px;\n\t\t\tfont-size: 11px;\n\t\t\toutline: none;\n\t\t\tbox-sizing: border-box;\n\t\t\tmin-width: 0;\n\t\t}\n\t\t.pict-flow-node-props-input:focus {\n\t\t\tborder-color: var(--pf-input-border-focus);\n\t\t}\n\t\t.pict-flow-node-props-color {\n\t\t\twidth: 28px;\n\t\t\theight: 24px;\n\t\t\tpadding: 1px;\n\t\t\tcursor: pointer;\n\t\t\tflex: 0 0 28px;\n\t\t}\n\n\t\t/* Suppress native number-input spinner buttons on every input\n\t\t inside a properties panel. Panels live inside <foreignObject>;\n\t\t browsers (Chromium / WebKit) render the up/down spinner chrome\n\t\t as native overlays that don\'t always respect SVG transforms or\n\t\t the parent tab pane\'s display:none — leaving stale spinner\n\t\t artifacts hanging around when the user switches tabs or pans\n\t\t the diagram. The user can still type numbers; they just don\'t\n\t\t get clickable spinners. (If we ever want spinners back, build\n\t\t them as real DOM elements next to the input, not native chrome.) */\n\t\t.pict-flow-panel input[type="number"] {\n\t\t\t-moz-appearance: textfield;\n\t\t\tappearance: textfield;\n\t\t}\n\t\t.pict-flow-panel input[type="number"]::-webkit-outer-spin-button,\n\t\t.pict-flow-panel input[type="number"]::-webkit-inner-spin-button {\n\t\t\t-webkit-appearance: none;\n\t\t\tappearance: none;\n\t\t\tmargin: 0;\n\t\t}\n\t\t'}getPanelTabsCSS(){return"\n\t\t.pict-flow-panel-resize-handle {\n\t\t\theight: 6px;\n\t\t\tcursor: ns-resize;\n\t\t\tbackground: transparent;\n\t\t\tflex-shrink: 0;\n\t\t\ttransition: background-color 0.15s;\n\t\t\tborder-top: 1px solid var(--pf-panel-titlebar-border);\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t}\n\t\t.pict-flow-panel-resize-handle::after {\n\t\t\tcontent: '';\n\t\t\twidth: 24px;\n\t\t\theight: 2px;\n\t\t\tborder-radius: 1px;\n\t\t\tbackground: var(--pf-resize-handle-hover);\n\t\t\ttransition: background-color 0.15s, width 0.15s;\n\t\t}\n\t\t.pict-flow-panel-resize-handle:hover::after {\n\t\t\tbackground: var(--pf-button-hover-border);\n\t\t\twidth: 32px;\n\t\t}\n\t\t.pict-flow-panel-tabbar {\n\t\t\tdisplay: flex;\n\t\t\tflex-shrink: 0;\n\t\t\tborder-top: 1px solid var(--pf-panel-titlebar-border);\n\t\t\tbackground: var(--pf-panel-titlebar-bg);\n\t\t}\n\t\t.pict-flow-panel-tab {\n\t\t\tflex: 1;\n\t\t\tpadding: 5px 8px;\n\t\t\tfont-size: 11px;\n\t\t\ttext-align: center;\n\t\t\tcursor: pointer;\n\t\t\tcolor: var(--pf-tab-text);\n\t\t\tborder-top: 2px solid transparent;\n\t\t\ttransition: color 0.15s, border-top-color 0.15s;\n\t\t\tuser-select: none;\n\t\t\t-webkit-user-select: none;\n\t\t}\n\t\t.pict-flow-panel-tab:hover {\n\t\t\tcolor: var(--pf-tab-text-hover);\n\t\t}\n\t\t.pict-flow-panel-tab.active {\n\t\t\tborder-top-color: var(--pf-node-selected-stroke);\n\t\t\tcolor: var(--pf-panel-title-color);\n\t\t\tfont-weight: 600;\n\t\t}\n\t\t.pict-flow-panel-help-content {\n\t\t\tfont-size: 12px;\n\t\t\tline-height: 1.5;\n\t\t\tcolor: var(--pf-text-primary);\n\t\t}\n\t\t.pict-flow-panel-help-content p {\n\t\t\tmargin: 0 0 8px 0;\n\t\t}\n\t\t"}getFullscreenCSS(){return"\n\t\t.pict-flow-fullscreen {\n\t\t\tposition: fixed;\n\t\t\ttop: 0;\n\t\t\tleft: 0;\n\t\t\twidth: 100vw;\n\t\t\theight: 100vh;\n\t\t\tz-index: 9999;\n\t\t\tborder-radius: 0;\n\t\t\tborder: none;\n\t\t\tmin-height: 100vh;\n\t\t}\n\t\t.pict-flow-fullscreen .pict-flow-svg {\n\t\t\tmin-height: calc(100vh - 50px);\n\t\t}\n\t\t"}getToolbarCSS(){return'\n\t\t.pict-flow-toolbar {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 0.5em;\n\t\t\tpadding: 0.5em 0.75em;\n\t\t\tbackground-color: var(--pf-toolbar-bg);\n\t\t\tborder-bottom: 1px solid var(--pf-toolbar-border);\n\t\t\tflex-wrap: wrap;\n\t\t}\n\t\t.pict-flow-toolbar-group {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 0.25em;\n\t\t\tpadding-right: 0.75em;\n\t\t\tborder-right: 1px solid var(--pf-toolbar-border);\n\t\t}\n\t\t.pict-flow-toolbar-group:last-child {\n\t\t\tborder-right: none;\n\t\t\tpadding-right: 0;\n\t\t}\n\t\t.pict-flow-toolbar-btn {\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tgap: 0.35em;\n\t\t\tpadding: 0.35em 0.65em;\n\t\t\tborder: 1px solid var(--pf-button-border);\n\t\t\tborder-radius: 4px;\n\t\t\tbackground-color: var(--pf-toolbar-bg);\n\t\t\tcolor: var(--pf-text-primary);\n\t\t\tfont-size: 0.85em;\n\t\t\tcursor: pointer;\n\t\t\ttransition: background-color 0.15s, border-color 0.15s;\n\t\t\tuser-select: none;\n\t\t\t-webkit-user-select: none;\n\t\t}\n\t\t.pict-flow-toolbar-btn:focus {\n\t\t\toutline: none;\n\t\t}\n\t\t.pict-flow-toolbar-btn:hover {\n\t\t\tbackground-color: var(--pf-button-hover-bg);\n\t\t\tborder-color: var(--pf-button-hover-border);\n\t\t}\n\t\t.pict-flow-toolbar-btn:active {\n\t\t\tbackground-color: var(--pf-button-active-bg);\n\t\t}\n\t\t.pict-flow-toolbar-btn-icon {\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tline-height: 1;\n\t\t}\n\t\t.pict-flow-toolbar-btn-icon svg {\n\t\t\tdisplay: block;\n\t\t}\n\t\t.pict-flow-toolbar-btn-text {\n\t\t\twhite-space: nowrap;\n\t\t}\n\t\t.pict-flow-toolbar-btn-chevron {\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tmargin-left: 0.15em;\n\t\t}\n\t\t/* Split button — visible as one connected unit; the two halves\n\t\t route to different actions. Used for "Auto" so clicking the\n\t\t icon/text applies the current layout while the chevron half\n\t\t opens the algorithm popup with a generous hit area. */\n\t\t.pict-flow-toolbar-btn-split {\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: stretch;\n\t\t}\n\t\t.pict-flow-toolbar-btn-split-main {\n\t\t\tborder-top-right-radius: 0;\n\t\t\tborder-bottom-right-radius: 0;\n\t\t\tborder-right: 1px solid var(--pf-button-border);\n\t\t\tmargin-right: -1px; /* collapse the seam between the two buttons */\n\t\t}\n\t\t.pict-flow-toolbar-btn-split-chevron {\n\t\t\tborder-top-left-radius: 0;\n\t\t\tborder-bottom-left-radius: 0;\n\t\t\tpadding-left: 0.55em;\n\t\t\tpadding-right: 0.55em;\n\t\t}\n\t\t.pict-flow-toolbar-btn-split-chevron .pict-flow-toolbar-btn-chevron {\n\t\t\tmargin: 0;\n\t\t}\n\t\t.pict-flow-toolbar-right {\n\t\t\tmargin-left: auto;\n\t\t\tborder-right: none;\n\t\t\tpadding-right: 0;\n\t\t}\n\t\t.pict-flow-toolbar-label {\n\t\t\tfont-size: 0.8em;\n\t\t\tcolor: var(--pf-text-secondary);\n\t\t\tmargin-right: 0.25em;\n\t\t}\n\t\t.pict-flow-toolbar-select {\n\t\t\tpadding: 0.3em 0.5em;\n\t\t\tborder: 1px solid var(--pf-button-border);\n\t\t\tborder-radius: 4px;\n\t\t\tfont-size: 0.85em;\n\t\t\tbackground-color: var(--pf-toolbar-bg);\n\t\t\tcolor: var(--pf-text-primary);\n\t\t}\n\t\t'}getPaletteCSS(){return"\n\t\t.pict-flow-palette-category {\n\t\t\tmargin-bottom: 0.5em;\n\t\t}\n\t\t.pict-flow-palette-category:last-child {\n\t\t\tmargin-bottom: 0;\n\t\t}\n\t\t.pict-flow-palette-category-label {\n\t\t\tfont-size: 0.7em;\n\t\t\tfont-weight: 700;\n\t\t\ttext-transform: uppercase;\n\t\t\tletter-spacing: 0.05em;\n\t\t\tcolor: var(--pf-text-placeholder);\n\t\t\tmargin-bottom: 0.35em;\n\t\t\tpadding-bottom: 0.2em;\n\t\t\tborder-bottom: 1px solid var(--pf-divider-light);\n\t\t}\n\t\t.pict-flow-palette-cards {\n\t\t\tdisplay: flex;\n\t\t\tflex-wrap: wrap;\n\t\t\tgap: 0.35em;\n\t\t}\n\t\t.pict-flow-palette-card {\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tgap: 0.35em;\n\t\t\tpadding: 0.35em 0.6em;\n\t\t\tborder: 1px solid var(--pf-card-border);\n\t\t\tborder-radius: 4px;\n\t\t\tbackground-color: var(--pf-panel-bg);\n\t\t\tfont-size: 0.8em;\n\t\t\tcursor: pointer;\n\t\t\ttransition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s;\n\t\t\tuser-select: none;\n\t\t\t-webkit-user-select: none;\n\t\t\tposition: relative;\n\t\t}\n\t\t.pict-flow-palette-card:hover {\n\t\t\tbackground-color: var(--pf-card-hover-bg);\n\t\t\tborder-color: var(--pf-node-selected-stroke);\n\t\t\tbox-shadow: var(--pf-card-hover-shadow);\n\t\t}\n\t\t.pict-flow-palette-card.disabled {\n\t\t\topacity: 0.45;\n\t\t\tpointer-events: none;\n\t\t\tcursor: default;\n\t\t}\n\t\t.pict-flow-palette-card-icon {\n\t\t\tfont-size: 1.1em;\n\t\t\tline-height: 1;\n\t\t}\n\t\t.pict-flow-palette-card-swatch {\n\t\t\twidth: 10px;\n\t\t\theight: 10px;\n\t\t\tborder-radius: 2px;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.pict-flow-palette-card-title {\n\t\t\tfont-weight: 500;\n\t\t\tcolor: var(--pf-text-primary);\n\t\t\twhite-space: nowrap;\n\t\t}\n\t\t.pict-flow-palette-card-code {\n\t\t\tfont-size: 0.8em;\n\t\t\tcolor: var(--pf-text-placeholder);\n\t\t\tfont-family: monospace;\n\t\t}\n\t\t.pict-flow-toolbar-select.layout-select {\n\t\t\tmin-width: 120px;\n\t\t\tmax-width: 200px;\n\t\t}\n\t\t"}getPopupCSS(){return'\n\t\t.pict-flow-toolbar-popup-anchor {\n\t\t\tposition: relative;\n\t\t}\n\t\t.pict-flow-toolbar-popup {\n\t\t\tposition: absolute;\n\t\t\tz-index: 1000;\n\t\t\tbackground: var(--pf-panel-bg);\n\t\t\tborder: 1px solid var(--pf-card-border);\n\t\t\tborder-radius: 6px;\n\t\t\tbox-shadow: 0 4px 16px rgba(0,0,0,0.12);\n\t\t\tmin-width: 240px;\n\t\t\tmax-height: 80vh;\n\t\t\toverflow-y: auto;\n\t\t\tpadding: 0.35em 0;\n\t\t\tfont-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;\n\t\t\tfont-size: 13px;\n\t\t}\n\t\t.pict-flow-popup-search-wrapper {\n\t\t\tposition: relative;\n\t\t\tpadding: 0.4em 0.5em;\n\t\t\tborder-bottom: 1px solid var(--pf-divider-light);\n\t\t}\n\t\t.pict-flow-popup-search-icon {\n\t\t\tposition: absolute;\n\t\t\tleft: 0.85em;\n\t\t\ttop: 50%;\n\t\t\ttransform: translateY(-50%);\n\t\t\tpointer-events: none;\n\t\t\tline-height: 1;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t}\n\t\t.pict-flow-popup-search {\n\t\t\twidth: 100%;\n\t\t\tpadding: 0.4em 0.5em 0.4em 2em;\n\t\t\tborder: 1px solid var(--pf-input-border);\n\t\t\tborder-radius: 4px;\n\t\t\tfont-size: 0.9em;\n\t\t\toutline: none;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\t\t.pict-flow-popup-search:focus {\n\t\t\tborder-color: var(--pf-input-border-focus);\n\t\t}\n\t\t.pict-flow-popup-list-item {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 0.5em;\n\t\t\tpadding: 0.45em 0.75em;\n\t\t\tcursor: pointer;\n\t\t\ttransition: background-color 0.1s;\n\t\t}\n\t\t.pict-flow-popup-list-item:hover {\n\t\t\tbackground-color: var(--pf-card-hover-bg);\n\t\t}\n\t\t.pict-flow-popup-list-item-icon {\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tflex-shrink: 0;\n\t\t\tline-height: 1;\n\t\t}\n\t\t.pict-flow-popup-list-item-label {\n\t\t\tflex: 1;\n\t\t\tcolor: var(--pf-text-primary);\n\t\t\tfont-weight: 500;\n\t\t}\n\t\t.pict-flow-popup-list-item-code {\n\t\t\tfont-size: 0.8em;\n\t\t\tcolor: var(--pf-text-placeholder);\n\t\t\tfont-family: monospace;\n\t\t\tbackground: var(--pf-badge-category-bg);\n\t\t\tpadding: 0.1em 0.4em;\n\t\t\tborder-radius: 3px;\n\t\t}\n\t\t.pict-flow-popup-divider {\n\t\t\theight: 1px;\n\t\t\tbackground: var(--pf-divider-light);\n\t\t\tmargin: 0.25em 0;\n\t\t}\n\t\t.pict-flow-popup-list-empty {\n\t\t\ttext-align: center;\n\t\t\tcolor: var(--pf-text-placeholder);\n\t\t\tpadding: 1.5em 0.75em;\n\t\t\tfont-size: 0.9em;\n\t\t}\n\t\t.pict-flow-popup-layout-save {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 0.5em;\n\t\t\tpadding: 0.45em 0.75em;\n\t\t\tcursor: pointer;\n\t\t\ttransition: background-color 0.1s;\n\t\t\tcolor: var(--pf-text-primary);\n\t\t\tfont-weight: 500;\n\t\t}\n\t\t.pict-flow-popup-layout-save:hover {\n\t\t\tbackground-color: var(--pf-card-hover-bg);\n\t\t}\n\t\t.pict-flow-popup-layout-save-icon {\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tflex-shrink: 0;\n\t\t\tline-height: 1;\n\t\t}\n\t\t.pict-flow-popup-layout-save-input-row {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 0.35em;\n\t\t\tpadding: 0.35em 0.5em;\n\t\t}\n\t\t.pict-flow-popup-layout-save-input {\n\t\t\tflex: 1;\n\t\t\tpadding: 0.35em 0.5em;\n\t\t\tborder: 1px solid var(--pf-input-border);\n\t\t\tborder-radius: 4px;\n\t\t\tfont-size: 0.9em;\n\t\t\toutline: none;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\t\t.pict-flow-popup-layout-save-input:focus {\n\t\t\tborder-color: var(--pf-input-border-focus);\n\t\t}\n\t\t.pict-flow-popup-layout-save-confirm {\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\twidth: 28px;\n\t\t\theight: 28px;\n\t\t\tborder: 1px solid var(--pf-input-border);\n\t\t\tborder-radius: 4px;\n\t\t\tbackground: var(--pf-panel-bg);\n\t\t\tcursor: pointer;\n\t\t\tflex-shrink: 0;\n\t\t\ttransition: background-color 0.15s, border-color 0.15s;\n\t\t\tline-height: 1;\n\t\t}\n\t\t.pict-flow-popup-layout-save-confirm:hover {\n\t\t\tbackground-color: var(--pf-card-hover-bg);\n\t\t\tborder-color: var(--pf-input-border-focus);\n\t\t}\n\t\t.pict-flow-popup-layout-row {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tpadding: 0.45em 0.75em;\n\t\t\tcursor: pointer;\n\t\t\ttransition: background-color 0.1s;\n\t\t}\n\t\t.pict-flow-popup-layout-row:hover {\n\t\t\tbackground-color: var(--pf-card-hover-bg);\n\t\t}\n\t\t.pict-flow-popup-layout-name {\n\t\t\tflex: 1;\n\t\t\tcolor: var(--pf-text-primary);\n\t\t}\n\t\t.pict-flow-popup-layout-delete {\n\t\t\tdisplay: none;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tborder: none;\n\t\t\tbackground: none;\n\t\t\tcolor: var(--pf-button-danger-text);\n\t\t\tcursor: pointer;\n\t\t\tpadding: 2px 4px;\n\t\t\tborder-radius: 3px;\n\t\t\tline-height: 1;\n\t\t}\n\t\t.pict-flow-popup-layout-row:hover .pict-flow-popup-layout-delete {\n\t\t\tdisplay: inline-flex;\n\t\t}\n\t\t.pict-flow-popup-layout-delete:hover {\n\t\t\tbackground-color: var(--pf-button-danger-hover-bg);\n\t\t}\n\t\t.pict-flow-popup-settings-section {\n\t\t\tpadding: 0.5em 0.75em;\n\t\t}\n\t\t.pict-flow-popup-settings-label {\n\t\t\tdisplay: block;\n\t\t\tfont-size: 0.8em;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: var(--pf-text-secondary);\n\t\t\ttext-transform: uppercase;\n\t\t\tletter-spacing: 0.05em;\n\t\t\tmargin-bottom: 0.35em;\n\t\t}\n\t\t.pict-flow-popup-settings-select {\n\t\t\twidth: 100%;\n\t\t\tpadding: 0.4em 0.5em;\n\t\t\tborder: 1px solid var(--pf-input-border);\n\t\t\tborder-radius: 4px;\n\t\t\tfont-size: 0.9em;\n\t\t\tbackground: var(--pf-panel-bg);\n\t\t\tcolor: var(--pf-text-primary);\n\t\t\tcursor: pointer;\n\t\t\toutline: none;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\t\t.pict-flow-popup-settings-select:focus {\n\t\t\tborder-color: var(--pf-input-border-focus);\n\t\t}\n\t\t.pict-flow-popup-settings-slider-row {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 0.5em;\n\t\t}\n\t\t.pict-flow-popup-settings-slider {\n\t\t\tflex: 1;\n\t\t\t-webkit-appearance: none;\n\t\t\tappearance: none;\n\t\t\theight: 4px;\n\t\t\tbackground: var(--pf-input-border);\n\t\t\tborder-radius: 2px;\n\t\t\toutline: none;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.pict-flow-popup-settings-slider::-webkit-slider-thumb {\n\t\t\t-webkit-appearance: none;\n\t\t\tappearance: none;\n\t\t\twidth: 14px;\n\t\t\theight: 14px;\n\t\t\tbackground: var(--pf-node-selected-stroke);\n\t\t\tborder-radius: 50%;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.pict-flow-popup-settings-slider::-moz-range-thumb {\n\t\t\twidth: 14px;\n\t\t\theight: 14px;\n\t\t\tbackground: var(--pf-node-selected-stroke);\n\t\t\tborder-radius: 50%;\n\t\t\tcursor: pointer;\n\t\t\tborder: none;\n\t\t}\n\t\t.pict-flow-popup-settings-slider-value {\n\t\t\tfont-size: 0.85em;\n\t\t\tcolor: var(--pf-text-secondary);\n\t\t\tmin-width: 2.5em;\n\t\t\ttext-align: right;\n\t\t}\n\t\t'}getCollapsedToolbarCSS(){return"\n\t\t.pict-flow-toolbar-collapsed {\n\t\t\tposition: absolute;\n\t\t\ttop: 8px;\n\t\t\tright: 8px;\n\t\t\tz-index: 100;\n\t\t\tdisplay: none;\n\t\t}\n\t\t.pict-flow-toolbar-collapsed.visible {\n\t\t\tdisplay: block;\n\t\t}\n\t\t.pict-flow-toolbar-expand-btn {\n\t\t\twidth: 36px;\n\t\t\theight: 36px;\n\t\t\tborder-radius: 6px;\n\t\t\tborder: 1px solid var(--pf-card-border);\n\t\t\tbackground-color: var(--pf-toolbar-bg);\n\t\t\tbox-shadow: 0 2px 6px rgba(0,0,0,0.1);\n\t\t\tcursor: pointer;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\ttransition: background-color 0.15s, box-shadow 0.15s;\n\t\t}\n\t\t.pict-flow-toolbar-expand-btn:hover {\n\t\t\tbackground-color: var(--pf-button-hover-bg);\n\t\t\tbox-shadow: 0 2px 8px rgba(0,0,0,0.15);\n\t\t}\n\t\t"}getFloatingToolbarCSS(){return"\n\t\t.pict-flow-floating-toolbar {\n\t\t\tposition: absolute;\n\t\t\tz-index: 100;\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\tgap: 2px;\n\t\t\tpadding: 4px;\n\t\t\tborder-radius: 8px;\n\t\t\tborder: 1px solid var(--pf-card-border);\n\t\t\tbackground-color: var(--pf-toolbar-bg);\n\t\t\tbox-shadow: 0 4px 16px rgba(0,0,0,0.12);\n\t\t\tpointer-events: auto;\n\t\t}\n\t\t.pict-flow-floating-grip {\n\t\t\tcursor: grab;\n\t\t\tpadding: 4px;\n\t\t\tborder-radius: 4px;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\ttransition: background-color 0.15s;\n\t\t}\n\t\t.pict-flow-floating-grip:hover {\n\t\t\tbackground-color: var(--pf-button-hover-bg);\n\t\t}\n\t\t.pict-flow-floating-grip:active {\n\t\t\tcursor: grabbing;\n\t\t}\n\t\t.pict-flow-floating-btn {\n\t\t\twidth: 32px;\n\t\t\theight: 32px;\n\t\t\tborder: none;\n\t\t\tborder-radius: 4px;\n\t\t\tbackground-color: transparent;\n\t\t\tcursor: pointer;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\ttransition: background-color 0.15s;\n\t\t}\n\t\t.pict-flow-floating-btn:focus {\n\t\t\toutline: none;\n\t\t}\n\t\t.pict-flow-floating-btn:hover {\n\t\t\tbackground-color: var(--pf-button-hover-bg);\n\t\t}\n\t\t.pict-flow-floating-separator {\n\t\t\theight: 1px;\n\t\t\tbackground-color: var(--pf-divider-light);\n\t\t\tmargin: 2px 4px;\n\t\t}\n\t\t/* Collapsed floating toolbar — grip-only draggable square */\n\t\t.pict-flow-floating-toolbar.collapsed .pict-flow-floating-btn,\n\t\t.pict-flow-floating-toolbar.collapsed .pict-flow-floating-separator {\n\t\t\tdisplay: none;\n\t\t}\n\t\t.pict-flow-floating-toolbar.collapsed {\n\t\t\tpadding: 0;\n\t\t\tborder-radius: 6px;\n\t\t}\n\t\t.pict-flow-floating-toolbar.collapsed .pict-flow-floating-grip {\n\t\t\twidth: 32px;\n\t\t\theight: 32px;\n\t\t\tpadding: 0;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t}\n\t\t.pict-flow-floating-toolbar.collapsed .pict-flow-floating-grip span {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tline-height: 1;\n\t\t}\n\t\t"}getIconCSS(){return"\n\t\t.pict-flow-icon-svg {\n\t\t\tpointer-events: none;\n\t\t}\n\t\t.pict-flow-palette-card-icon svg {\n\t\t\tdisplay: inline-block;\n\t\t\tvertical-align: middle;\n\t\t}\n\t\t.pict-flow-toolbar-btn-icon {\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tline-height: 1;\n\t\t}\n\t\t.pict-flow-toolbar-btn-icon svg {\n\t\t\tdisplay: block;\n\t\t\tvertical-align: middle;\n\t\t}\n\t\t.pict-flow-info-panel-header.with-icon svg {\n\t\t\tdisplay: inline-block;\n\t\t\tvertical-align: middle;\n\t\t\tmargin-right: 4px;\n\t\t}\n\t\t.pict-flow-panel-close-icon {\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tline-height: 1;\n\t\t}\n\t\t.pict-flow-panel-close-icon svg {\n\t\t\tdisplay: block;\n\t\t}\n\t\t.pict-flow-palette-toggle-arrow svg {\n\t\t\tdisplay: block;\n\t\t}\n\t\t"}getBracketNodeCSS(){return"\n\t\t/* Bracket outline path */\n\t\t.pict-flow-node-bracket {\n\t\t\tfill: none;\n\t\t\tstroke: var(--pf-node-body-stroke);\n\t\t\tstroke-width: 2;\n\t\t\tstroke-linecap: round;\n\t\t\tstroke-linejoin: round;\n\t\t}\n\t\t.pict-flow-node.selected .pict-flow-node-bracket {\n\t\t\tstroke: var(--pf-node-selected-stroke);\n\t\t\tstroke-width: 2;\n\t\t}\n\t\t.pict-flow-node:hover .pict-flow-node-bracket {\n\t\t\tstroke: var(--pf-node-body-stroke-hover);\n\t\t\tstroke-width: 1.5;\n\t\t}\n\n\t\t/* Bracket fill rects: no stroke, no rounded corners.\n\t\t Uses parent-qualified selectors to beat variant rules\n\t\t (e.g. .pict-flow-node-start .pict-flow-node-body). */\n\t\t.pict-flow-node .pict-flow-node-bracket-fill,\n\t\t.pict-flow-node .pict-flow-node-bracket-title-fill {\n\t\t\tstroke: none;\n\t\t\tstroke-width: 0;\n\t\t\trx: 0;\n\t\t\try: 0;\n\t\t}\n\t\t/* Beat hover rule: .pict-flow-node:hover .pict-flow-node-body */\n\t\t.pict-flow-node:hover .pict-flow-node-bracket-fill,\n\t\t.pict-flow-node:hover .pict-flow-node-bracket-title-fill {\n\t\t\tstroke: none;\n\t\t\tstroke-width: 0;\n\t\t}\n\t\t/* Beat selected rule: .pict-flow-node.selected .pict-flow-node-body */\n\t\t.pict-flow-node.selected .pict-flow-node-bracket-fill,\n\t\t.pict-flow-node.selected .pict-flow-node-bracket-title-fill {\n\t\t\tstroke: none;\n\t\t\tstroke-width: 0;\n\t\t}\n\t\t"}generateCSS(){let t=this.getContainerCSS()+this.getNodeCSS()+this.getBodyContentCSS()+this.getNodeVariantCSS()+this.getPortCSS()+this.getConnectionCSS()+this.getHandleCSS()+this.getTetherCSS()+this.getPanelCSS()+this.getInfoPanelCSS()+this.getNodePropsEditorCSS()+this.getPanelTabsCSS()+this.getBracketNodeCSS()+this.getFullscreenCSS()+this.getToolbarCSS()+this.getPaletteCSS()+this.getPopupCSS()+this.getCollapsedToolbarCSS()+this.getFloatingToolbarCSS()+this.getIconCSS();if(this._FlowView&&this._FlowView._ThemeProvider){let e=this._FlowView._ThemeProvider.getActiveTheme();if(e&&e.CSSVariables&&Object.keys(e.CSSVariables).length>0){let o=".pict-flow-container {\n";for(let t in e.CSSVariables)o+="\t"+t+": "+e.CSSVariables[t]+";\n";o+="}\n",t+=o}e&&e.AdditionalCSS&&(t+=e.AdditionalCSS)}return t}registerCSS(){this.fable&&this.fable.CSSMap?(this.fable.CSSMap.removeCSS("PictSectionFlow-CSS"),this.fable.CSSMap.addCSS("PictSectionFlow-CSS",this.generateCSS(),500,"PictProviderFlowCSS"),this.fable.CSSMap.injectCSS()):this.log.warn("PictProviderFlowCSS: CSSMap not available; CSS not registered.")}},e.exports.default_configuration=n},{"fable-serviceproviderbase":53}],9:[function(t,e,o){const i=t("fable-serviceproviderbase");e.exports=class extends i{constructor(t,e,o){super(t,e,o),this.serviceType="PictProviderFlowConnectorShapes",this._FlowView=e&&e.FlowView?e.FlowView:null,this._DefaultShapes={port:{ElementType:"circle",Attributes:{r:"5"},ClassName:"pict-flow-port"},"panel-indicator":{ElementType:"rect",Attributes:{rx:"2",ry:"2"},ClassName:"pict-flow-node-panel-indicator"},"connection-path":{ElementType:"path",Attributes:{},ClassName:"pict-flow-connection"},"connection-hitarea":{ElementType:"path",Attributes:{},ClassName:"pict-flow-connection-hitarea"},"connection-handle":{ElementType:"circle",Attributes:{r:"6"},ClassName:"pict-flow-connection-handle"},"connection-handle-midpoint":{ElementType:"circle",Attributes:{r:"6"},ClassName:"pict-flow-connection-handle-midpoint"},"drag-connection":{ElementType:"path",Attributes:{},ClassName:"pict-flow-drag-connection"},"tether-path":{ElementType:"path",Attributes:{},ClassName:"pict-flow-tether-line"},"tether-hitarea":{ElementType:"path",Attributes:{},ClassName:"pict-flow-tether-hitarea"},"tether-handle":{ElementType:"circle",Attributes:{r:"6"},ClassName:"pict-flow-tether-handle"},"tether-handle-midpoint":{ElementType:"circle",Attributes:{r:"6"},ClassName:"pict-flow-tether-handle-midpoint"},"arrowhead-connection":{MarkerWidth:"5",MarkerHeight:"7",RefX:"7.5",RefY:"3.5",Points:"0 0, 5 3.5, 0 7",Fill:"#95a5a6"},"arrowhead-connection-selected":{MarkerWidth:"5",MarkerHeight:"7",RefX:"7.5",RefY:"3.5",Points:"0 0, 5 3.5, 0 7",Fill:"#3498db"},"arrowhead-tether":{MarkerWidth:"4",MarkerHeight:"6",RefX:"6",RefY:"3",Points:"0 0, 4 3, 0 6",Fill:"#95a5a6"}},this._OriginalShapes=JSON.parse(JSON.stringify(this._DefaultShapes))}applyThemeOverrides(t){if(t&&"object"==typeof t)for(let e in t)this._DefaultShapes.hasOwnProperty(e)?Object.assign(this._DefaultShapes[e],t[e]):this._DefaultShapes[e]=t[e]}resetToDefaults(){this._DefaultShapes=JSON.parse(JSON.stringify(this._OriginalShapes))}getShapeConfig(t){return this._DefaultShapes.hasOwnProperty(t)?this._DefaultShapes[t]:null}setShapeConfig(t,e){this._DefaultShapes[t]=e}getShapeKeys(){return Object.keys(this._DefaultShapes)}createPortElement(t,e,o){let i=this._DefaultShapes.port,n=this._FlowView._SVGHelperProvider.createSVGElement(i.ElementType),r=i.ClassName+" "+t.Direction;t.PortType&&(r+=" port-type-"+t.PortType),n.setAttribute("class",r),n.setAttribute("cx",String(e.x)),n.setAttribute("cy",String(e.y));for(let t in i.Attributes)n.setAttribute(t,i.Attributes[t]);return n.setAttribute("data-port-hash",t.Hash),n.setAttribute("data-node-hash",o),n.setAttribute("data-port-direction",t.Direction),t.PortType&&n.setAttribute("data-port-type",t.PortType),n.setAttribute("data-element-type","port"),n}createPanelIndicatorElement(t,e,o,i,n){let r=this._DefaultShapes["panel-indicator"],a=this._FlowView._SVGHelperProvider.createSVGElement(r.ElementType);a.setAttribute("class",r.ClassName),a.setAttribute("x",String(e)),a.setAttribute("y",String(o)),a.setAttribute("width",String(i)),a.setAttribute("height",String(n));for(let t in r.Attributes)a.setAttribute(t,r.Attributes[t]);return a.setAttribute("data-node-hash",t),a.setAttribute("data-element-type","panel-indicator"),a}createConnectionPathElement(t,e,o,i){let n=this._DefaultShapes["connection-path"],r=this._FlowView._SVGHelperProvider.createSVGElement(n.ElementType);r.setAttribute("class",n.ClassName+(o?" selected":"")),r.setAttribute("d",t),r.setAttribute("data-connection-hash",e),r.setAttribute("data-element-type","connection");o?this._DefaultShapes["arrowhead-connection-selected"]:this._DefaultShapes["arrowhead-connection"];let a=o?"flow-arrowhead-selected-"+i:"flow-arrowhead-"+i;return r.setAttribute("marker-end","url(#"+a+")"),r}createConnectionHitAreaElement(t,e){let o=this._DefaultShapes["connection-hitarea"],i=this._FlowView._SVGHelperProvider.createSVGElement(o.ElementType);return i.setAttribute("class",o.ClassName),i.setAttribute("d",t),i.setAttribute("data-connection-hash",e),i.setAttribute("data-element-type","connection-hitarea"),i}createHandleElement(t,e,o,i,n){let r=this._DefaultShapes[n]||this._DefaultShapes["connection-handle"],a=this._FlowView._SVGHelperProvider.createSVGElement(r.ElementType);a.setAttribute("class",r.ClassName),a.setAttribute("cx",String(o)),a.setAttribute("cy",String(i));for(let t in r.Attributes)a.setAttribute(t,r.Attributes[t]);return a.setAttribute("data-handle-type",e),a}createFullHandle(t,e,o,i,n,r,a,l){let s=this.createHandleElement(e,o,i,n,r);return s.setAttribute("data-element-type",a),s.setAttribute(l,e),t.appendChild(s),s}createDragConnectionElement(t){let e=this._DefaultShapes["drag-connection"],o=this._FlowView._SVGHelperProvider.createSVGElement(e.ElementType);return o.setAttribute("class",e.ClassName),o.setAttribute("d",t),o}createTetherPathElement(t,e,o,i){let n=this._DefaultShapes["tether-path"],r=this._FlowView._SVGHelperProvider.createSVGElement(n.ElementType);return r.setAttribute("class",n.ClassName+(o?" selected":"")),r.setAttribute("d",t),r.setAttribute("marker-end","url(#flow-tether-arrowhead-"+i+")"),r.setAttribute("data-element-type","tether"),r.setAttribute("data-panel-hash",e),r}createTetherHitAreaElement(t,e){let o=this._DefaultShapes["tether-hitarea"],i=this._FlowView._SVGHelperProvider.createSVGElement(o.ElementType);return i.setAttribute("class",o.ClassName),i.setAttribute("d",t),i.setAttribute("data-element-type","tether-hitarea"),i.setAttribute("data-panel-hash",e),i}generateMarkerDefs(t){let e=this._DefaultShapes["arrowhead-connection"],o=this._DefaultShapes["arrowhead-connection-selected"],i=this._DefaultShapes["arrowhead-tether"],n="";n+='<marker id="flow-arrowhead-'+t+'" markerWidth="'+e.MarkerWidth+'" markerHeight="'+e.MarkerHeight+'" refX="'+e.RefX+'" refY="'+e.RefY+'" orient="auto" markerUnits="strokeWidth"><polygon points="'+e.Points+'" fill="'+e.Fill+'" /></marker>';let r={"event-in":"#3498db","event-out":"#2ecc71",setting:"#e67e22",value:"#f1c40f",error:"#e74c3c"};for(let o in r)n+='<marker id="flow-arrowhead-'+o+"-"+t+'" markerWidth="'+e.MarkerWidth+'" markerHeight="'+e.MarkerHeight+'" refX="'+e.RefX+'" refY="'+e.RefY+'" orient="auto" markerUnits="strokeWidth"><polygon points="'+e.Points+'" fill="'+r[o]+'" /></marker>';return n+='<marker id="flow-arrowhead-selected-'+t+'" markerWidth="'+o.MarkerWidth+'" markerHeight="'+o.MarkerHeight+'" refX="'+o.RefX+'" refY="'+o.RefY+'" orient="auto" markerUnits="strokeWidth"><polygon points="'+o.Points+'" fill="'+o.Fill+'" /></marker>',n+='<marker id="flow-tether-arrowhead-'+t+'" markerWidth="'+i.MarkerWidth+'" markerHeight="'+i.MarkerHeight+'" refX="'+i.RefX+'" refY="'+i.RefY+'" orient="auto" markerUnits="strokeWidth"><polygon points="'+i.Points+'" fill="'+i.Fill+'" /></marker>',n}}},{"fable-serviceproviderbase":53}],10:[function(t,e,o){const i=t("pict-provider"),n={ProviderIdentifier:"PictProviderFlowEventHandler"};e.exports=class extends i{constructor(t,e,o){super(t,Object.assign({},n,e),o),this.serviceType="PictProviderFlowEventHandler",this._FlowView=e&&e.FlowView?e.FlowView:null,this._Handlers={}}registerHandler(t,e,o){if("function"!=typeof e)return this.log.warn("PictProviderFlowEventHandler registerHandler: handler for '".concat(t,"' is not a function")),null;this._Handlers[t]||(this._Handlers[t]=[]);let i=o||"handler-".concat(this.fable.getUUID());return this._Handlers[t].push({Hash:i,Handler:e}),this.log.trace("PictProviderFlowEventHandler registered handler '".concat(i,"' for event '").concat(t,"'")),i}removeHandler(t,e){if(!this._Handlers[t])return!1;let o=this._Handlers[t].findIndex(t=>t.Hash===e);return o>=0&&(this._Handlers[t].splice(o,1),!0)}removeAllHandlers(t){t?this._Handlers[t]=[]:this._Handlers={}}fireEvent(t,e){if(this.log.trace("PictProviderFlowEventHandler firing event '".concat(t,"'")),this._Handlers[t]&&0!==this._Handlers[t].length)for(let o=0;o<this._Handlers[t].length;o++){let i=this._Handlers[t][o];try{i.Handler(e,this._FlowView)}catch(e){this.log.error("PictProviderFlowEventHandler error in handler '".concat(i.Hash,"' for event '").concat(t,"': ").concat(e.message))}}}hasHandlers(t){return!!(this._Handlers[t]&&this._Handlers[t].length>0)}getHandlerCount(t){return this._Handlers[t]?this._Handlers[t].length:0}},e.exports.default_configuration=n},{"pict-provider":55}],11:[function(t,e,o){const i=t("fable-serviceproviderbase");e.exports=class extends i{constructor(t,e,o){super(t,e,o),this.serviceType="PictProviderFlowGeometry"}getEdgeFromSide(t){switch(t){case"left-top":case"left":case"left-bottom":return"left";case"right-top":case"right":case"right-bottom":default:return"right";case"top-left":case"top":case"top-right":return"top";case"bottom-left":case"bottom":case"bottom-right":return"bottom"}}sideDirection(t){switch(this.getEdgeFromSide(t)){case"left":return{dx:-1,dy:0};case"right":default:return{dx:1,dy:0};case"top":return{dx:0,dy:-1};case"bottom":return{dx:0,dy:1}}}getEdgeCenter(t,e){switch(e){case"left":return{x:t.X,y:t.Y+t.Height/2};case"right":default:return{x:t.X+t.Width,y:t.Y+t.Height/2};case"top":return{x:t.X+t.Width/2,y:t.Y};case"bottom":return{x:t.X+t.Width/2,y:t.Y+t.Height}}}getPortLocalPosition(t,e,o,i,n,r,a){let l=this.getEdgeFromSide(t),s=a?this._computeAdaptiveZone(t,a):this._getZoneFromSide(t),c=this._getZoneFromSide(t),d="start";if(c.start>=.5?d="end":c.start>=.17&&(d="center"),"left"===l||"right"===l){let t="left"===l?0:i,a=n-r-16,c=r+a*s.start,h=16,p=a*(s.end-s.start)-h*(o+1);p<0&&(p=0);let u=0;return"end"===d?u=p:"center"===d&&(u=p/2),{x:t,y:c+u+h*(e+1)}}let h="top"===l?0:n,p=i*s.start,u=i*(s.end-s.start)-16*(o+1);u<0&&(u=0);let w=0;return"end"===d?w=u:"center"===d&&(w=u/2),{x:p+w+16*(e+1),y:h}}_getZoneFromSide(t){switch(t){case"left-top":case"right-top":case"top-left":case"bottom-left":return{start:0,end:.333};case"left":case"right":case"top":case"bottom":return{start:.333,end:.667};case"left-bottom":case"right-bottom":case"top-right":case"bottom-right":return{start:.667,end:1};default:return{start:0,end:1}}}_getZoneKeysForEdge(t){switch(t){case"left":return["left-top","left","left-bottom"];case"right":default:return["right-top","right","right-bottom"];case"top":return["top-left","top","top-right"];case"bottom":return["bottom-left","bottom","bottom-right"]}}_computeAdaptiveZone(t,e){let o=this.getEdgeFromSide(t),i=this._getZoneKeysForEdge(o),n=0,r={};for(let t=0;t<i.length;t++){let o=i[t],a=e[o]||0,l=a>0?16*(a+1):0;r[o]=l,n+=l}if(0===n)return this._getZoneFromSide(t);let a=0;for(let e=0;e<i.length;e++){let o=i[e],l=r[o]/n;if(o===t)return{start:a,end:a+l};a+=l}return this._getZoneFromSide(t)}buildPortCountsBySide(t){let e={};if(!t||!Array.isArray(t))return e;for(let o=0;o<t.length;o++){let i=t[o].Side||("input"===t[o].Direction?"left":"right");e[i]||(e[i]=0),e[i]++}return e}computeMinimumNodeHeight(t,e){if(!t||!Array.isArray(t)||0===t.length)return 0;let o=this.buildPortCountsBySide(t),i={};for(let t in o){let e=this.getEdgeFromSide(t);if("left"!==e&&"right"!==e)continue;let n=16*(o[t]+1);i[e]||(i[e]=0),i[e]+=n}let n=0;for(let t in i){let o=e+16+i[t];o>n&&(n=o)}return Math.ceil(n)}}},{"fable-serviceproviderbase":53}],12:[function(t,e,o){const i=t("fable-serviceproviderbase"),n={ProviderIdentifier:"PictProviderFlowIcons"},r={ITE:'<svg xmlns="http://www.w3.org/2000/svg" width="{FlowIconSize}" height="{FlowIconSize}" viewBox="0 0 24 24" fill="none" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="6" r="3" fill="#d5e8f7" stroke="#2c3e50" stroke-width="2"/><circle cx="6" cy="18" r="2.5" fill="#d5e8f7" stroke="#2c3e50" stroke-width="2"/><circle cx="18" cy="18" r="2.5" fill="#d5e8f7" stroke="#2c3e50" stroke-width="2"/><path d="M12 9v2M9.5 12.5L6 15.5M14.5 12.5L18 15.5" stroke="#2c3e50" stroke-width="2"/></svg>',SW:'<svg xmlns="http://www.w3.org/2000/svg" width="{FlowIconSize}" height="{FlowIconSize}" viewBox="0 0 24 24" fill="none" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="4" fill="#d5e8f7" stroke="#2c3e50" stroke-width="2"/><path d="M3 12h5M16 12h5M14.8 9.2l3.7-5.2M14.8 14.8l3.7 5.2" stroke="#2c3e50" stroke-width="2"/></svg>',EACH:'<svg xmlns="http://www.w3.org/2000/svg" width="{FlowIconSize}" height="{FlowIconSize}" viewBox="0 0 24 24" fill="none" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="7" height="7" rx="1.5" fill="#d5e8f7" stroke="#2c3e50" stroke-width="2"/><rect x="14" y="3" width="7" height="7" rx="1.5" fill="#d5e8f7" stroke="#2c3e50" stroke-width="2"/><rect x="3" y="14" width="7" height="7" rx="1.5" fill="#d5e8f7" stroke="#2c3e50" stroke-width="2"/><rect x="14" y="14" width="7" height="7" rx="1.5" fill="#d5e8f7" stroke="#2c3e50" stroke-width="2"/></svg>',FREAD:'<svg xmlns="http://www.w3.org/2000/svg" width="{FlowIconSize}" height="{FlowIconSize}" viewBox="0 0 24 24" fill="none" stroke-linecap="round" stroke-linejoin="round"><path d="M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9l-7-7z" fill="#d5e8f7" stroke="#2c3e50" stroke-width="2"/><path d="M13 2v7h7" stroke="#2c3e50" stroke-width="2"/><path d="M9 13h6M9 17h4" stroke="#2c3e50" stroke-width="2"/></svg>',FWRITE:'<svg xmlns="http://www.w3.org/2000/svg" width="{FlowIconSize}" height="{FlowIconSize}" viewBox="0 0 24 24" fill="none" stroke-linecap="round" stroke-linejoin="round"><path d="M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9l-7-7z" fill="#d5e8f7" stroke="#2c3e50" stroke-width="2"/><path d="M13 2v7h7" stroke="#2c3e50" stroke-width="2"/><path d="M12 13v5M9.5 15.5L12 13l2.5 2.5" stroke="#2c3e50" stroke-width="2"/></svg>',LOG:'<svg xmlns="http://www.w3.org/2000/svg" width="{FlowIconSize}" height="{FlowIconSize}" viewBox="0 0 24 24" fill="none" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="3" fill="#d5e8f7" stroke="#2c3e50" stroke-width="2"/><circle cx="7.5" cy="8" r="1" fill="#2c3e50"/><circle cx="7.5" cy="12" r="1" fill="#2c3e50"/><circle cx="7.5" cy="16" r="1" fill="#2c3e50"/><path d="M11 8h5.5M11 12h5.5M11 16h3.5" stroke="#2c3e50" stroke-width="2"/></svg>',GET:'<svg xmlns="http://www.w3.org/2000/svg" width="{FlowIconSize}" height="{FlowIconSize}" viewBox="0 0 24 24" fill="none" stroke-linecap="round" stroke-linejoin="round"><circle cx="10.5" cy="10.5" r="6.5" fill="#d5e8f7" stroke="#2c3e50" stroke-width="2"/><path d="M21 21l-5.15-5.15" stroke="#2c3e50" stroke-width="2"/></svg>',SET:'<svg xmlns="http://www.w3.org/2000/svg" width="{FlowIconSize}" height="{FlowIconSize}" viewBox="0 0 24 24" fill="none" stroke-linecap="round" stroke-linejoin="round"><path d="M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4.5 1.5L4 16Z" fill="#d5e8f7" stroke="#2c3e50" stroke-width="2"/><path d="M14 6l3 3" stroke="#2c3e50" stroke-width="2"/></svg>',fullscreen:'<svg xmlns="http://www.w3.org/2000/svg" width="{FlowIconSize}" height="{FlowIconSize}" viewBox="0 0 24 24" fill="none" stroke="#2c3e50" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 3h6v6"/><path d="M9 21H3v-6"/><path d="M21 3l-7 7"/><path d="M3 21l7-7"/></svg>',"exit-fullscreen":'<svg xmlns="http://www.w3.org/2000/svg" width="{FlowIconSize}" height="{FlowIconSize}" viewBox="0 0 24 24" fill="none" stroke="#2c3e50" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 14h6v6"/><path d="M20 10h-6V4"/><path d="M14 10l7-7"/><path d="M3 21l7-7"/></svg>',close:'<svg xmlns="http://www.w3.org/2000/svg" width="{FlowIconSize}" height="{FlowIconSize}" viewBox="0 0 24 24" fill="none" stroke="#2c3e50" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>',"chevron-down":'<svg xmlns="http://www.w3.org/2000/svg" width="{FlowIconSize}" height="{FlowIconSize}" viewBox="0 0 24 24" fill="none" stroke="#2c3e50" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg>',search:'<svg xmlns="http://www.w3.org/2000/svg" width="{FlowIconSize}" height="{FlowIconSize}" viewBox="0 0 24 24" fill="none" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="7" fill="#d5e8f7" stroke="#2c3e50" stroke-width="2"/><path d="M21 21l-4.35-4.35" stroke="#2c3e50" stroke-width="2"/></svg>',cards:'<svg xmlns="http://www.w3.org/2000/svg" width="{FlowIconSize}" height="{FlowIconSize}" viewBox="0 0 24 24" fill="none" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="7" width="16" height="12" rx="2" fill="#d5e8f7" stroke="#2c3e50" stroke-width="2"/><path d="M6 7V5a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-2" stroke="#2c3e50" stroke-width="2"/></svg>',layout:'<svg xmlns="http://www.w3.org/2000/svg" width="{FlowIconSize}" height="{FlowIconSize}" viewBox="0 0 24 24" fill="none" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="8" height="10" rx="1.5" fill="#d5e8f7" stroke="#2c3e50" stroke-width="2"/><rect x="13" y="3" width="8" height="6" rx="1.5" fill="#d5e8f7" stroke="#2c3e50" stroke-width="2"/><rect x="3" y="15" width="8" height="6" rx="1.5" fill="#d5e8f7" stroke="#2c3e50" stroke-width="2"/><rect x="13" y="11" width="8" height="10" rx="1.5" fill="#d5e8f7" stroke="#2c3e50" stroke-width="2"/></svg>',collapse:'<svg xmlns="http://www.w3.org/2000/svg" width="{FlowIconSize}" height="{FlowIconSize}" viewBox="0 0 24 24" fill="none" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="3" fill="#d5e8f7" stroke="#2c3e50" stroke-width="2"/><path d="M8 12h8" stroke="#2c3e50" stroke-width="2"/></svg>',expand:'<svg xmlns="http://www.w3.org/2000/svg" width="{FlowIconSize}" height="{FlowIconSize}" viewBox="0 0 24 24" fill="none" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="3" fill="#d5e8f7" stroke="#2c3e50" stroke-width="2"/><path d="M12 8v8M8 12h8" stroke="#2c3e50" stroke-width="2"/></svg>',grip:'<svg xmlns="http://www.w3.org/2000/svg" width="{FlowIconSize}" height="{FlowIconSize}" viewBox="0 0 24 24" fill="#2c3e50"><circle cx="9" cy="5" r="1.5"/><circle cx="15" cy="5" r="1.5"/><circle cx="9" cy="12" r="1.5"/><circle cx="15" cy="12" r="1.5"/><circle cx="9" cy="19" r="1.5"/><circle cx="15" cy="19" r="1.5"/></svg>',settings:'<svg xmlns="http://www.w3.org/2000/svg" width="{FlowIconSize}" height="{FlowIconSize}" viewBox="0 0 24 24" fill="none" stroke="#2c3e50" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="3" fill="#d5e8f7"/><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"/></svg>',plus:'<svg xmlns="http://www.w3.org/2000/svg" width="{FlowIconSize}" height="{FlowIconSize}" viewBox="0 0 24 24" fill="none" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="9" fill="#d5e8f7" stroke="#2c3e50" stroke-width="2"/><path d="M12 8v8M8 12h8" stroke="#2c3e50" stroke-width="2"/></svg>',trash:'<svg xmlns="http://www.w3.org/2000/svg" width="{FlowIconSize}" height="{FlowIconSize}" viewBox="0 0 24 24" fill="none" stroke-linecap="round" stroke-linejoin="round"><path d="M3 6h18" stroke="#2c3e50" stroke-width="2"/><path d="M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" stroke="#2c3e50" stroke-width="2"/><rect x="5" y="6" width="14" height="14" rx="2" fill="#d5e8f7" stroke="#2c3e50" stroke-width="2"/><path d="M10 11v6M14 11v6" stroke="#2c3e50" stroke-width="2"/></svg>',save:'<svg xmlns="http://www.w3.org/2000/svg" width="{FlowIconSize}" height="{FlowIconSize}" viewBox="0 0 24 24" fill="none" stroke-linecap="round" stroke-linejoin="round"><path d="M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z" fill="#d5e8f7" stroke="#2c3e50" stroke-width="2"/><path d="M17 21v-8H7v8" stroke="#2c3e50" stroke-width="2"/><path d="M7 3v5h8" stroke="#2c3e50" stroke-width="2"/></svg>',"auto-layout":'<svg xmlns="http://www.w3.org/2000/svg" width="{FlowIconSize}" height="{FlowIconSize}" viewBox="0 0 24 24" fill="none" stroke-linecap="round" stroke-linejoin="round"><rect x="8" y="2" width="8" height="6" rx="1.5" fill="#d5e8f7" stroke="#2c3e50" stroke-width="2"/><rect x="2" y="16" width="8" height="6" rx="1.5" fill="#d5e8f7" stroke="#2c3e50" stroke-width="2"/><rect x="14" y="16" width="8" height="6" rx="1.5" fill="#d5e8f7" stroke="#2c3e50" stroke-width="2"/><path d="M12 8v4M6 16v-4h12v4" stroke="#2c3e50" stroke-width="2"/></svg>',"zoom-in":'<svg xmlns="http://www.w3.org/2000/svg" width="{FlowIconSize}" height="{FlowIconSize}" viewBox="0 0 24 24" fill="none" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="7" fill="#d5e8f7" stroke="#2c3e50" stroke-width="2"/><path d="M21 21l-4.35-4.35" stroke="#2c3e50" stroke-width="2"/><path d="M11 8v6M8 11h6" stroke="#2c3e50" stroke-width="2"/></svg>',"zoom-out":'<svg xmlns="http://www.w3.org/2000/svg" width="{FlowIconSize}" height="{FlowIconSize}" viewBox="0 0 24 24" fill="none" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="7" fill="#d5e8f7" stroke="#2c3e50" stroke-width="2"/><path d="M21 21l-4.35-4.35" stroke="#2c3e50" stroke-width="2"/><path d="M8 11h6" stroke="#2c3e50" stroke-width="2"/></svg>',"zoom-fit":'<svg xmlns="http://www.w3.org/2000/svg" width="{FlowIconSize}" height="{FlowIconSize}" viewBox="0 0 24 24" fill="none" stroke="#2c3e50" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 7V3h4"/><path d="M17 3h4v4"/><path d="M21 17v4h-4"/><path d="M7 21H3v-4"/><rect x="7" y="7" width="10" height="10" rx="1.5" fill="#d5e8f7"/></svg>',dock:'<svg xmlns="http://www.w3.org/2000/svg" width="{FlowIconSize}" height="{FlowIconSize}" viewBox="0 0 24 24" fill="none" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="4" rx="1.5" fill="#d5e8f7" stroke="#2c3e50" stroke-width="2"/><path d="M12 20V11M8 14l4-4 4 4" stroke="#2c3e50" stroke-width="2"/></svg>',restore:'<svg xmlns="http://www.w3.org/2000/svg" width="{FlowIconSize}" height="{FlowIconSize}" viewBox="0 0 24 24" fill="none" stroke="#2c3e50" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 12a9 9 0 1 0 3-6.7L3 8"/><path d="M3 3v5h5"/></svg>',"delete-node":'<svg xmlns="http://www.w3.org/2000/svg" width="{FlowIconSize}" height="{FlowIconSize}" viewBox="0 0 24 24" fill="none" stroke-linecap="round" stroke-linejoin="round"><path d="M3 6h18" stroke="#2c3e50" stroke-width="2"/><path d="M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" stroke="#2c3e50" stroke-width="2"/><rect x="5" y="6" width="14" height="14" rx="2" fill="#d5e8f7" stroke="#2c3e50" stroke-width="2"/><path d="M10 11v6M14 11v6" stroke="#2c3e50" stroke-width="2"/></svg>',default:'<svg xmlns="http://www.w3.org/2000/svg" width="{FlowIconSize}" height="{FlowIconSize}" viewBox="0 0 24 24" fill="none" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="4" fill="#d5e8f7" stroke="#2c3e50" stroke-width="2"/><circle cx="12" cy="12" r="2.5" fill="#2c3e50"/></svg>'};e.exports=class extends i{constructor(t,e,o){if(super(t,Object.assign({},n,e),o),this.serviceType="PictProviderFlowIcons",this._FlowView=e&&e.FlowView?e.FlowView:null,this._Icons=JSON.parse(JSON.stringify(r)),e&&e.AdditionalIcons&&"object"==typeof e.AdditionalIcons){let t=Object.keys(e.AdditionalIcons);for(let o=0;o<t.length;o++)this._Icons[t[o]]=e.AdditionalIcons[t[o]]}}registerIconTemplates(){if(!this.fable||!this.fable.TemplateProvider)return void this.log.warn("PictProviderFlowIcons: TemplateProvider not available; icon templates not registered.");let t=Object.keys(this._Icons);for(let e=0;e<t.length;e++){let o="Flow-Icon-"+t[e];this.fable.TemplateProvider.getTemplate(o)||this.fable.TemplateProvider.addTemplate(o,this._Icons[t[e]])}}isEmojiIcon(t){if(!t||"string"!=typeof t)return!1;for(let e=0;e<t.length;e++)if(t.charCodeAt(e)>255)return!0;return!1}resolveIconKey(t){return t?t.Icon&&this._Icons.hasOwnProperty(t.Icon)||t.Icon&&!this.isEmojiIcon(t.Icon)?t.Icon:t.Code&&this._Icons.hasOwnProperty(t.Code)?t.Code:"default":"default"}getIconSVGMarkup(t,e){let o=e||16,i=t||"default";return(this._Icons[i]||this._Icons.default).replace(/\{FlowIconSize\}/g,String(o))}renderIconIntoSVGGroup(t,e,o,i,n){if(!e)return null;let r=(n||16)/24,a=t||"default",l=this._Icons[a]||this._Icons.default;l=l.replace(/\{FlowIconSize\}/g,"24");try{let t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.innerHTML=l;let n=t.querySelector("svg");if(!n)return null;let a=document.createElementNS("http://www.w3.org/2000/svg","g");for(a.setAttribute("transform","translate("+o+","+i+") scale("+r+")"),a.setAttribute("pointer-events","none"),a.setAttribute("class","pict-flow-icon-svg");n.childNodes.length>0;)a.appendChild(n.childNodes[0]);return e.appendChild(a),a}catch(t){return this.log.warn("PictProviderFlowIcons renderIconIntoSVGGroup error: "+t.message),null}}getIconKeys(){return Object.keys(this._Icons)}hasIcon(t){return this._Icons.hasOwnProperty(t)}registerIcon(t,e){return!(!t||!e)&&(this._Icons[t]=e,this.fable&&this.fable.TemplateProvider&&this.fable.TemplateProvider.addTemplate("Flow-Icon-"+t,e),!0)}},e.exports.default_configuration=n,e.exports.DefaultIcons=r},{"fable-serviceproviderbase":53}],13:[function(t,e,o){const i=t("pict-provider"),n={ProviderIdentifier:"PictProviderFlowLayouts"};e.exports=class extends i{constructor(t,e,o){super(t,Object.assign({},n,e),o),this.serviceType="PictProviderFlowLayouts",this._FlowView=e&&e.FlowView?e.FlowView:null,e&&void 0!==e.StorageKey?this._StorageKey=e.StorageKey:this._FlowView&&this._FlowView.options&&this._FlowView.options.ViewIdentifier?this._StorageKey="pict-flow-layouts-".concat(this._FlowView.options.ViewIdentifier):this._StorageKey="pict-flow-layouts"}storageWrite(t,e){if(!1===this._StorageKey)return e(null);try{return"undefined"!=typeof localStorage&&localStorage.setItem(this._StorageKey,JSON.stringify(t)),e(null)}catch(t){return this.log.warn("PictProviderFlowLayouts storageWrite error: ".concat(t.message)),e(t)}}storageRead(t){if(!1===this._StorageKey)return t(null,[]);try{if("undefined"!=typeof localStorage){let e=localStorage.getItem(this._StorageKey);if(e){let o=JSON.parse(e);if(Array.isArray(o))return t(null,o)}}return t(null,[])}catch(e){return this.log.warn("PictProviderFlowLayouts storageRead error: ".concat(e.message)),t(e,[])}}storageDelete(t){if(!1===this._StorageKey)return t(null);try{return"undefined"!=typeof localStorage&&localStorage.removeItem(this._StorageKey),t(null)}catch(e){return this.log.warn("PictProviderFlowLayouts storageDelete error: ".concat(e.message)),t(e)}}loadPersistedLayouts(){this.storageRead((t,e)=>{if(t||!Array.isArray(e)||0===e.length)return;if(!this._FlowView||!this._FlowView._FlowData)return;let o=this._FlowView._FlowData.SavedLayouts,i={};for(let t=0;t<o.length;t++)i[o[t].Hash]=!0;let n=0;for(let t=0;t<e.length;t++)i[e[t].Hash]||(o.push(e[t]),n++);n>0&&this.log.trace("PictProviderFlowLayouts loaded ".concat(n," persisted layout(s)"))})}saveLayout(t){if(!this._FlowView)return this.log.warn("PictProviderFlowLayouts saveLayout: no FlowView reference"),null;let e=this._FlowView._FlowData,o="layout-".concat(this.fable.getUUID()),i={},n={};for(let t=0;t<e.Nodes.length;t++){let o=e.Nodes[t];i[o.Hash]={X:o.X,Y:o.Y,Width:o.Width,Height:o.Height,Title:o.Title},o.Style&&Object.keys(o.Style).length>0&&(i[o.Hash].Style=JSON.parse(JSON.stringify(o.Style)))}for(let t=0;t<e.OpenPanels.length;t++){let o=e.OpenPanels[t];n[o.NodeHash]={X:o.X,Y:o.Y,Width:o.Width,Height:o.Height}}let r={Hash:o,Name:t||"Untitled Layout",CreatedAt:(new Date).toISOString(),NodePositions:i,PanelPositions:n,ViewState:{PanX:e.ViewState.PanX,PanY:e.ViewState.PanY,Zoom:e.ViewState.Zoom}};return e.SavedLayouts.push(r),this._FlowView.marshalFromView(),this.storageWrite(e.SavedLayouts,t=>{t&&this.log.warn("PictProviderFlowLayouts: failed to persist after save: ".concat(t.message))}),this._FlowView._EventHandlerProvider&&(this._FlowView._EventHandlerProvider.fireEvent("onLayoutSaved",r),this._FlowView._EventHandlerProvider.fireEvent("onFlowChanged",e)),this.log.trace("PictProviderFlowLayouts saved layout '".concat(r.Name,"' (").concat(r.Hash,")")),r}restoreLayout(t){if(!this._FlowView)return this.log.warn("PictProviderFlowLayouts restoreLayout: no FlowView reference"),!1;let e=this._FlowView._FlowData,o=e.SavedLayouts.find(e=>e.Hash===t);if(!o)return this.log.warn("PictProviderFlowLayouts restoreLayout: layout '".concat(t,"' not found")),!1;let i=[],n=[];for(let t=0;t<e.Nodes.length;t++){let r=e.Nodes[t],a=o.NodePositions[r.Hash];a?(r.X=a.X,r.Y=a.Y,"number"==typeof a.Width&&(r.Width=a.Width),"number"==typeof a.Height&&(r.Height=a.Height),"string"==typeof a.Title&&(r.Title=a.Title),a.Style&&"object"==typeof a.Style&&(r.Style=JSON.parse(JSON.stringify(a.Style))),i.push(r)):n.push(r)}if(o.PanelPositions)for(let t=0;t<e.OpenPanels.length;t++){let i=e.OpenPanels[t],n=o.PanelPositions[i.NodeHash];n&&(i.X=n.X,i.Y=n.Y,"number"==typeof n.Width&&(i.Width=n.Width),"number"==typeof n.Height&&(i.Height=n.Height))}return n.length>0&&this._FlowView._LayoutService&&this._FlowView._LayoutService.autoLayoutSubset(n,i,e.Connections),o.ViewState&&("number"==typeof o.ViewState.PanX&&(e.ViewState.PanX=o.ViewState.PanX),"number"==typeof o.ViewState.PanY&&(e.ViewState.PanY=o.ViewState.PanY),"number"==typeof o.ViewState.Zoom&&(e.ViewState.Zoom=o.ViewState.Zoom)),this._FlowView.renderFlow(),this._FlowView.marshalFromView(),this._FlowView._EventHandlerProvider&&(this._FlowView._EventHandlerProvider.fireEvent("onLayoutRestored",o),this._FlowView._EventHandlerProvider.fireEvent("onFlowChanged",e)),this.log.trace("PictProviderFlowLayouts restored layout '".concat(o.Name,"' (").concat(o.Hash,")")),!0}deleteLayout(t){if(!this._FlowView)return this.log.warn("PictProviderFlowLayouts deleteLayout: no FlowView reference"),!1;let e=this._FlowView._FlowData,o=e.SavedLayouts.findIndex(e=>e.Hash===t);if(o<0)return this.log.warn("PictProviderFlowLayouts deleteLayout: layout '".concat(t,"' not found")),!1;let i=e.SavedLayouts.splice(o,1)[0];return this._FlowView.marshalFromView(),this.storageWrite(e.SavedLayouts,t=>{t&&this.log.warn("PictProviderFlowLayouts: failed to persist after delete: ".concat(t.message))}),this._FlowView._EventHandlerProvider&&(this._FlowView._EventHandlerProvider.fireEvent("onLayoutDeleted",i),this._FlowView._EventHandlerProvider.fireEvent("onFlowChanged",e)),this.log.trace("PictProviderFlowLayouts deleted layout '".concat(i.Name,"' (").concat(i.Hash,")")),!0}getLayouts(){return this._FlowView?this._FlowView._FlowData.SavedLayouts:[]}getLayout(t){return this._FlowView&&this._FlowView._FlowData.SavedLayouts.find(e=>e.Hash===t)||null}},e.exports.default_configuration=n},{"pict-provider":55}],14:[function(t,e,o){const i=t("pict-provider"),n={default:{Hash:"default",Label:"Default",DefaultWidth:180,DefaultHeight:80,DefaultPorts:[{Hash:null,Direction:"input",Side:"left",Label:"In"},{Hash:null,Direction:"output",Side:"right",Label:"Out"}],TitleBarColor:"#2c3e50",BodyStyle:{}},start:{Hash:"start",Label:"Start",DefaultWidth:140,DefaultHeight:80,DefaultPorts:[{Hash:null,Direction:"output",Side:"right",Label:"Out"}],TitleBarColor:"#27ae60",BodyStyle:{fill:"#eafaf1",stroke:"#27ae60"}},end:{Hash:"end",Label:"End",DefaultWidth:140,DefaultHeight:80,DefaultPorts:[{Hash:null,Direction:"input",Side:"left",Label:"In"}],TitleBarColor:"#1abc9c",BodyStyle:{fill:"#e8f8f5",stroke:"#1abc9c"}},halt:{Hash:"halt",Label:"Halt",DefaultWidth:140,DefaultHeight:80,DefaultPorts:[{Hash:null,Direction:"input",Side:"left",Label:"In"}],TitleBarColor:"#e74c3c",BodyStyle:{fill:"#fdedec",stroke:"#e74c3c"}},decision:{Hash:"decision",Label:"Decision",DefaultWidth:200,DefaultHeight:100,DefaultPorts:[{Hash:null,Direction:"input",Side:"left",Label:"In"},{Hash:null,Direction:"output",Side:"right",Label:"Yes"},{Hash:null,Direction:"output",Side:"bottom",Label:"No"}],TitleBarColor:"#f39c12",BodyStyle:{fill:"#fff9e6",stroke:"#f39c12"}}},r={ProviderIdentifier:"PictProviderFlowNodeTypes"};e.exports=class extends i{constructor(t,e,o){if(super(t,Object.assign({},r,e),o),this.serviceType="PictProviderFlowNodeTypes",this._FlowView=e&&e.FlowView?e.FlowView:null,e&&!1===e.IncludeDefaultNodeTypes?this._NodeTypes={}:this._NodeTypes=JSON.parse(JSON.stringify(n)),e&&e.AdditionalNodeTypes&&"object"==typeof e.AdditionalNodeTypes){let t=Object.keys(e.AdditionalNodeTypes);for(let o=0;o<t.length;o++){let i=e.AdditionalNodeTypes[t[o]];this._NodeTypes[t[o]]=Object.assign({},this._NodeTypes[t[o]]||{},JSON.parse(JSON.stringify(i))),i.BodyContent&&"function"==typeof i.BodyContent.RenderCallback&&(this._NodeTypes[t[o]].BodyContent||(this._NodeTypes[t[o]].BodyContent={}),this._NodeTypes[t[o]].BodyContent.RenderCallback=i.BodyContent.RenderCallback)}}}getNodeType(t){return this._NodeTypes[t]||this._NodeTypes.default}registerNodeType(t){return t&&t.Hash?(this._NodeTypes[t.Hash]=Object.assign({},this._NodeTypes[t.Hash]||{},t),!0):(this.log.warn("PictProviderFlowNodeTypes registerNodeType: invalid config (missing Hash)"),!1)}removeNodeType(t){return"default"===t?(this.log.warn("PictProviderFlowNodeTypes: cannot remove the default node type"),!1):!!this._NodeTypes[t]&&(delete this._NodeTypes[t],!0)}getNodeTypes(){return JSON.parse(JSON.stringify(this._NodeTypes))}getNodeTypeList(){return Object.keys(this._NodeTypes)}getEnabledCards(){let t=[],e=Object.keys(this._NodeTypes);for(let o=0;o<e.length;o++){let i=this._NodeTypes[e[o]];i.CardMetadata&&!1!==i.CardMetadata.Enabled&&t.push(JSON.parse(JSON.stringify(i)))}return t}getCardsByCategory(){let t=this.getEnabledCards(),e={};for(let o=0;o<t.length;o++){let i=t[o].CardMetadata&&t[o].CardMetadata.Category?t[o].CardMetadata.Category:"General";e[i]||(e[i]=[]),e[i].push(t[o])}return e}isFlowCard(t){let e=this._NodeTypes[t];return!(!e||!e.CardMetadata)}},e.exports.default_configuration=r,e.exports.DefaultNodeTypes=n},{"pict-provider":55}],15:[function(t,e,o){const i=t("fable-serviceproviderbase"),n={ProviderIdentifier:"PictProviderFlowNoise"};e.exports=class extends i{constructor(t,e,o){super(t,Object.assign({},n,e),o),this.serviceType="PictProviderFlowNoise"}hashString(t){let e=5381;for(let o=0;o<t.length;o++)e=(e<<5)+e+t.charCodeAt(o),e&=e;return e>>>0}seededRandom(t){let e=0|t;return function(){e=e+1831565813|0;let t=Math.imul(e^e>>>15,1|e);return t=t+Math.imul(t^t>>>7,61|t)^t,((t^t>>>14)>>>0)/4294967296}}jitterPoint(t,e,o,i){return o<=0?{x:t,y:e}:{x:t+o*(i()-.5)*2,y:e+o*(i()-.5)*2}}generateBracketPath(t,e,o,i,n,r){let a=this.seededRandom(this.hashString(r||"default")),l=o||18,s=t,c=e,d=(t,e)=>this.jitterPoint(t,e,n,a),h=d(l,0),p=d(0,0),u=d(0,c),w=d(l,c),f=d(s-l,0),g=d(s,0),m=d(s,c),b=d(s-l,c),y="";return y+="M ".concat(h.x.toFixed(1)," ").concat(h.y.toFixed(1)),y+=" L ".concat(p.x.toFixed(1)," ").concat(p.y.toFixed(1)),y+=" L ".concat(u.x.toFixed(1)," ").concat(u.y.toFixed(1)),y+=" L ".concat(w.x.toFixed(1)," ").concat(w.y.toFixed(1)),y+=" M ".concat(f.x.toFixed(1)," ").concat(f.y.toFixed(1)),y+=" L ".concat(g.x.toFixed(1)," ").concat(g.y.toFixed(1)),y+=" L ".concat(m.x.toFixed(1)," ").concat(m.y.toFixed(1)),y+=" L ".concat(b.x.toFixed(1)," ").concat(b.y.toFixed(1)),y}jitterPath(t,e,o){if(e<=0||!t)return t;let i=this.seededRandom(this.hashString(o||"path")),n=t.match(/[MLCQZmlcqz]|[-+]?[0-9]*\.?[0-9]+/g);if(!n)return t;let r=[];for(let t=0;t<n.length;t++)/^[-+]?[0-9]*\.?[0-9]+$/.test(n[t])&&r.push(t);for(let t=0;t<r.length-1;t+=2){let o=r[t],a=r[t+1],l=e;0===t||t>=r.length-2?l=.15*e:(2===t||t>=r.length-4)&&(l=.5*e);let s=parseFloat(n[o]),c=parseFloat(n[a]),d=this.jitterPoint(s,c,l,i);n[o]=d.x.toFixed(1),n[a]=d.y.toFixed(1)}let a="";for(let t=0;t<n.length;t++)t>0&&/^[MLCQZmlcqz]$/.test(n[t])?a+=" "+n[t]:a+=t>0?" "+n[t]:n[t];return a}},e.exports.default_configuration=n},{"fable-serviceproviderbase":53}],16:[function(t,e,o){const i=t("fable-serviceproviderbase");e.exports=class extends i{constructor(t,e,o){super(t,e,o),this.serviceType="PictProviderFlowPanelChrome",this._FlowView=e&&e.FlowView?e.FlowView:null}createPanelForeignObject(t,e){let o=this._FlowView._SVGHelperProvider.createSVGElement("foreignObject");o.setAttribute("class","pict-flow-panel-foreign-object"),o.setAttribute("data-panel-hash",t.Hash),o.setAttribute("data-node-hash",t.NodeHash),o.setAttribute("x",String(t.X)),o.setAttribute("y",String(t.Y)),o.setAttribute("width",String(t.Width)),o.setAttribute("height",String(t.Height));let i=this._FlowView.pict||this._FlowView.fable,n=t.Title||"Properties",r=i.parseTemplateByHash("Flow-PanelChrome-Template",{Hash:t.Hash,Title:n});o.innerHTML=r;let a=o.querySelector(".pict-flow-panel-close-icon");a&&this._FlowView&&this._FlowView._IconProvider?a.innerHTML=this._FlowView._IconProvider.getIconSVGMarkup("close",12):a&&(a.textContent="✕");let l=o.querySelector(".pict-flow-panel-content");l&&(l.addEventListener("pointerdown",t=>{t.stopPropagation()}),l.addEventListener("wheel",t=>{t.stopPropagation()}));let s=o.querySelector(".pict-flow-panel-tabbar");return s&&(s.addEventListener("pointerdown",t=>{t.stopPropagation()}),s.addEventListener("wheel",t=>{t.stopPropagation()})),e.appendChild(o),o.querySelector('.pict-flow-panel-tab-pane[data-tab="properties"]')}}},{"fable-serviceproviderbase":53}],17:[function(t,e,o){const i=t("fable-serviceproviderbase");e.exports=class extends i{constructor(t,e,o){super(t,e,o),this.serviceType="PictProviderFlowSVGHelpers"}createSVGElement(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}}},{"fable-serviceproviderbase":53}],18:[function(t,e,o){const i=t("fable-serviceproviderbase"),n={ProviderIdentifier:"PictProviderFlowTheme"};e.exports=class extends i{constructor(t,e,o){super(t,Object.assign({},n,e),o),this.serviceType="PictProviderFlowTheme",this._FlowView=e&&e.FlowView?e.FlowView:null,this._ActiveThemeKey="default",this._NoiseLevel=0,this._Themes={},this._registerBuiltInThemes()}_registerBuiltInThemes(){this._Themes.default={Key:"default",Label:"Modern",CSSVariables:{},AdditionalCSS:"",NodeBodyMode:"rect",BracketConfig:null,ConnectionConfig:{StrokeDashArray:null,StrokeWidth:2,ArrowheadStyle:"triangle"},NoiseConfig:{Enabled:!1,DefaultLevel:0,MaxJitterPx:0,AffectsNodes:!1,AffectsConnections:!1},ShapeOverrides:{}},this._Themes.sketch={Key:"sketch",Label:"Sketch",CSSVariables:{"--pf-node-body-fill":"#fffef5","--pf-node-body-stroke":"#444444","--pf-node-body-stroke-width":"1.5","--pf-node-body-radius":"0px","--pf-node-shadow":"none","--pf-node-shadow-hover":"none","--pf-node-shadow-selected":"none","--pf-node-shadow-dragging":"none","--pf-node-title-fill":"#333333","--pf-node-title-size":"12px","--pf-node-title-weight":"400","--pf-node-title-bar-color":"#f0ece0","--pf-node-type-label-fill":"#888888","--pf-node-selected-stroke":"#2255aa","--pf-port-input-fill":"#5577bb","--pf-port-output-fill":"#55aa77","--pf-port-stroke":"#fffef5","--pf-connection-stroke":"#555555","--pf-connection-selected-stroke":"#2255aa","--pf-canvas-bg":"#fffef5","--pf-grid-stroke":"#e8e4d8","--pf-panel-bg":"#fffef5","--pf-panel-border":"#ccccaa","--pf-panel-radius":"0px","--pf-panel-shadow":"2px 2px 0px rgba(0,0,0,0.08)","--pf-panel-titlebar-bg":"#f0ece0","--pf-panel-titlebar-border":"#ccccaa","--pf-panel-title-color":"#333333"},AdditionalCSS:'\n\t\t\t\t.pict-flow-node-title,\n\t\t\t\t.pict-flow-node-type-label,\n\t\t\t\t.pict-flow-port-label,\n\t\t\t\t.pict-flow-node-card-code {\n\t\t\t\t\tfont-family: "Courier New", "Courier", monospace !important;\n\t\t\t\t}\n\t\t\t\t.pict-flow-panel-title-text,\n\t\t\t\t.pict-flow-panel-node-props-title,\n\t\t\t\t.pict-flow-info-panel {\n\t\t\t\t\tfont-family: "Courier New", "Courier", monospace !important;\n\t\t\t\t}\n\t\t\t\t.pict-flow-node-title-icon {\n\t\t\t\t\tfilter: brightness(0) !important;\n\t\t\t\t}\n\t\t\t',NodeBodyMode:"bracket",BracketConfig:{SerifLength:20,TitleSeparator:!0},ConnectionConfig:{StrokeDashArray:null,StrokeWidth:1.5,ArrowheadStyle:"triangle"},NoiseConfig:{Enabled:!0,DefaultLevel:.4,MaxJitterPx:4,AffectsNodes:!0,AffectsConnections:!0},ShapeOverrides:{"arrowhead-connection":{Fill:"#555555"},"arrowhead-connection-selected":{Fill:"#2255aa"}}},this._Themes.blueprint={Key:"blueprint",Label:"Blueprint",CSSVariables:{"--pf-node-body-fill":"rgba(255,255,255,0.05)","--pf-node-body-stroke":"#ffffff","--pf-node-body-stroke-width":"1","--pf-node-body-radius":"0px","--pf-node-shadow":"none","--pf-node-shadow-hover":"none","--pf-node-shadow-selected":"none","--pf-node-shadow-dragging":"none","--pf-node-title-fill":"#ffffff","--pf-node-title-size":"11px","--pf-node-title-weight":"400","--pf-node-title-bar-color":"rgba(255,255,255,0.1)","--pf-node-type-label-fill":"rgba(255,255,255,0.5)","--pf-node-selected-stroke":"#ffdd44","--pf-port-input-fill":"#88bbff","--pf-port-output-fill":"#88ffbb","--pf-port-stroke":"#1a3a6a","--pf-connection-stroke":"rgba(255,255,255,0.6)","--pf-connection-selected-stroke":"#ffdd44","--pf-canvas-bg":"#1a3a6a","--pf-grid-stroke":"rgba(255,255,255,0.08)","--pf-panel-bg":"#1a3a6a","--pf-panel-border":"rgba(255,255,255,0.3)","--pf-panel-radius":"0px","--pf-panel-shadow":"none","--pf-panel-titlebar-bg":"rgba(255,255,255,0.05)","--pf-panel-titlebar-border":"rgba(255,255,255,0.15)","--pf-panel-title-color":"#ffffff"},AdditionalCSS:'\n\t\t\t\t.pict-flow-node-title,\n\t\t\t\t.pict-flow-node-type-label,\n\t\t\t\t.pict-flow-port-label,\n\t\t\t\t.pict-flow-node-card-code {\n\t\t\t\t\tfont-family: "Courier New", monospace !important;\n\t\t\t\t\ttext-transform: uppercase;\n\t\t\t\t\tletter-spacing: 1px;\n\t\t\t\t}\n\t\t\t\t.pict-flow-container {\n\t\t\t\t\tborder-color: #0d2244;\n\t\t\t\t}\n\t\t\t\t.pict-flow-node-title-icon {\n\t\t\t\t\tfilter: brightness(0) invert(1) !important;\n\t\t\t\t}\n\t\t\t\t.pict-flow-toolbar {\n\t\t\t\t\tbackground-color: #142e54;\n\t\t\t\t\tborder-bottom-color: rgba(255,255,255,0.15);\n\t\t\t\t}\n\t\t\t\t.pict-flow-toolbar-btn {\n\t\t\t\t\tbackground-color: rgba(255,255,255,0.05);\n\t\t\t\t\tborder-color: rgba(255,255,255,0.2);\n\t\t\t\t\tcolor: var(--theme-color-background-panel, #ffffff);\n\t\t\t\t}\n\t\t\t\t.pict-flow-toolbar-btn:hover {\n\t\t\t\t\tbackground-color: rgba(255,255,255,0.1);\n\t\t\t\t}\n\t\t\t',NodeBodyMode:"bracket",BracketConfig:{SerifLength:18,TitleSeparator:!0},ConnectionConfig:{StrokeDashArray:"8 4",StrokeWidth:1,ArrowheadStyle:"triangle"},NoiseConfig:{Enabled:!1,DefaultLevel:0,MaxJitterPx:0,AffectsNodes:!1,AffectsConnections:!1},ShapeOverrides:{"arrowhead-connection":{Fill:"rgba(255,255,255,0.6)"},"arrowhead-connection-selected":{Fill:"#ffdd44"}}},this._Themes.mono={Key:"mono",Label:"Monochrome",CSSVariables:{"--pf-node-body-fill":"#ffffff","--pf-node-body-stroke":"#000000","--pf-node-body-stroke-width":"1","--pf-node-body-radius":"0px","--pf-node-shadow":"none","--pf-node-shadow-hover":"none","--pf-node-shadow-selected":"none","--pf-node-shadow-dragging":"none","--pf-node-title-fill":"#ffffff","--pf-node-title-size":"11px","--pf-node-title-weight":"600","--pf-node-title-bar-color":"#000000","--pf-node-type-label-fill":"#888888","--pf-node-selected-stroke":"#444444","--pf-port-input-fill":"#000000","--pf-port-output-fill":"#666666","--pf-port-stroke":"#ffffff","--pf-connection-stroke":"#000000","--pf-connection-selected-stroke":"#444444","--pf-canvas-bg":"#ffffff","--pf-grid-stroke":"#eeeeee","--pf-panel-bg":"#ffffff","--pf-panel-border":"#000000","--pf-panel-radius":"0px","--pf-panel-shadow":"none","--pf-panel-titlebar-bg":"#f0f0f0","--pf-panel-titlebar-border":"#000000","--pf-panel-title-color":"#000000"},AdditionalCSS:'\n\t\t\t\t.pict-flow-node-title {\n\t\t\t\t\tfont-family: "Helvetica Neue", Helvetica, Arial, sans-serif !important;\n\t\t\t\t}\n\t\t\t\t.pict-flow-node-title-icon {\n\t\t\t\t\tfilter: brightness(0) invert(1) !important;\n\t\t\t\t}\n\t\t\t',NodeBodyMode:"rect",BracketConfig:null,ConnectionConfig:{StrokeDashArray:null,StrokeWidth:1,ArrowheadStyle:"triangle"},NoiseConfig:{Enabled:!1,DefaultLevel:0,MaxJitterPx:0,AffectsNodes:!1,AffectsConnections:!1},ShapeOverrides:{"arrowhead-connection":{Fill:"#000000"},"arrowhead-connection-selected":{Fill:"#444444"}}},this._Themes["retro-80s"]={Key:"retro-80s",Label:"80s Retro",CSSVariables:{"--pf-node-body-fill":"#1a0a2e","--pf-node-body-stroke":"#ff00ff","--pf-node-body-stroke-width":"2","--pf-node-body-radius":"0px","--pf-node-shadow":"drop-shadow(0 0 8px rgba(255,0,255,0.4))","--pf-node-shadow-hover":"drop-shadow(0 0 12px rgba(255,0,255,0.6))","--pf-node-shadow-selected":"drop-shadow(0 0 16px rgba(0,255,255,0.5))","--pf-node-shadow-dragging":"drop-shadow(0 0 20px rgba(255,0,255,0.7))","--pf-node-title-fill":"#00ffff","--pf-node-title-size":"11px","--pf-node-title-weight":"700","--pf-node-title-bar-color":"#2a0a4e","--pf-node-type-label-fill":"#ff66ff","--pf-node-selected-stroke":"#00ffff","--pf-port-input-fill":"#ff00ff","--pf-port-output-fill":"#00ff66","--pf-port-stroke":"#1a0a2e","--pf-connection-stroke":"#ff00ff","--pf-connection-selected-stroke":"#00ffff","--pf-canvas-bg":"#0a0015","--pf-grid-stroke":"#1a0a2e","--pf-panel-bg":"#1a0a2e","--pf-panel-border":"#ff00ff","--pf-panel-radius":"0px","--pf-panel-shadow":"0 0 20px rgba(255,0,255,0.3)","--pf-panel-titlebar-bg":"#2a0a4e","--pf-panel-titlebar-border":"#ff00ff","--pf-panel-title-color":"#00ffff"},AdditionalCSS:'\n\t\t\t\t.pict-flow-node-title,\n\t\t\t\t.pict-flow-node-type-label,\n\t\t\t\t.pict-flow-port-label,\n\t\t\t\t.pict-flow-node-card-code {\n\t\t\t\t\tfont-family: "Courier New", monospace !important;\n\t\t\t\t\ttext-transform: uppercase;\n\t\t\t\t\tletter-spacing: 0.5px;\n\t\t\t\t}\n\t\t\t\t.pict-flow-connection {\n\t\t\t\t\tfilter: drop-shadow(0 0 3px rgba(255,0,255,0.4));\n\t\t\t\t}\n\t\t\t\t.pict-flow-node-title-icon {\n\t\t\t\t\tfilter: brightness(0) invert(1) hue-rotate(180deg) !important;\n\t\t\t\t}\n\t\t\t\t.pict-flow-toolbar {\n\t\t\t\t\tbackground-color: #1a0a2e;\n\t\t\t\t\tborder-bottom-color: #ff00ff;\n\t\t\t\t}\n\t\t\t\t.pict-flow-toolbar-btn {\n\t\t\t\t\tbackground-color: #1a0a2e;\n\t\t\t\t\tborder-color: #ff00ff;\n\t\t\t\t\tcolor: #00ffff;\n\t\t\t\t}\n\t\t\t\t.pict-flow-toolbar-btn:hover {\n\t\t\t\t\tbackground-color: #2a0a4e;\n\t\t\t\t}\n\t\t\t\t.pict-flow-container {\n\t\t\t\t\tborder-color: #ff00ff;\n\t\t\t\t}\n\t\t\t',NodeBodyMode:"rect",BracketConfig:null,ConnectionConfig:{StrokeDashArray:null,StrokeWidth:2,ArrowheadStyle:"triangle"},NoiseConfig:{Enabled:!1,DefaultLevel:0,MaxJitterPx:0,AffectsNodes:!1,AffectsConnections:!1},ShapeOverrides:{"arrowhead-connection":{Fill:"#ff00ff"},"arrowhead-connection-selected":{Fill:"#00ffff"}}},this._Themes["retro-90s"]={Key:"retro-90s",Label:"90s Retro",CSSVariables:{"--pf-node-body-fill":"#c0c0c0","--pf-node-body-stroke":"#808080","--pf-node-body-stroke-width":"1","--pf-node-body-radius":"0px","--pf-node-shadow":"drop-shadow(2px 2px 0px #404040)","--pf-node-shadow-hover":"drop-shadow(3px 3px 0px #404040)","--pf-node-shadow-selected":"drop-shadow(2px 2px 0px #008080)","--pf-node-shadow-dragging":"drop-shadow(4px 4px 0px #404040)","--pf-node-title-fill":"#ffffff","--pf-node-title-size":"11px","--pf-node-title-weight":"700","--pf-node-title-bar-color":"#000080","--pf-node-type-label-fill":"#606060","--pf-node-selected-stroke":"#008080","--pf-port-input-fill":"#000080","--pf-port-output-fill":"#008000","--pf-port-stroke":"#c0c0c0","--pf-connection-stroke":"#808080","--pf-connection-selected-stroke":"#008080","--pf-canvas-bg":"#008080","--pf-grid-stroke":"rgba(0,0,0,0.06)","--pf-panel-bg":"#c0c0c0","--pf-panel-border":"#808080","--pf-panel-radius":"0px","--pf-panel-shadow":"2px 2px 0px #404040","--pf-panel-titlebar-bg":"#000080","--pf-panel-titlebar-border":"#c0c0c0","--pf-panel-title-color":"#ffffff"},AdditionalCSS:'\n\t\t\t\t.pict-flow-node-title,\n\t\t\t\t.pict-flow-node-type-label,\n\t\t\t\t.pict-flow-port-label,\n\t\t\t\t.pict-flow-node-card-code {\n\t\t\t\t\tfont-family: "MS Sans Serif", "Arial", sans-serif !important;\n\t\t\t\t}\n\t\t\t\t.pict-flow-node-title-icon {\n\t\t\t\t\tfilter: brightness(0) invert(1) !important;\n\t\t\t\t}\n\t\t\t\t.pict-flow-toolbar {\n\t\t\t\t\tbackground-color: #c0c0c0;\n\t\t\t\t\tborder-bottom: 2px solid #808080;\n\t\t\t\t\tborder-top: 1px solid var(--theme-color-background-panel, #ffffff);\n\t\t\t\t}\n\t\t\t\t.pict-flow-toolbar-btn {\n\t\t\t\t\tbackground-color: #c0c0c0;\n\t\t\t\t\tborder: 2px outset #c0c0c0;\n\t\t\t\t\tborder-radius: 0;\n\t\t\t\t\tcolor: var(--theme-color-text-primary, #000000);\n\t\t\t\t}\n\t\t\t\t.pict-flow-toolbar-btn:hover {\n\t\t\t\t\tbackground-color: var(--theme-color-border-default, #d0d0d0);\n\t\t\t\t}\n\t\t\t\t.pict-flow-toolbar-btn:active {\n\t\t\t\t\tborder-style: inset;\n\t\t\t\t}\n\t\t\t\t.pict-flow-container {\n\t\t\t\t\tborder: 2px outset #c0c0c0;\n\t\t\t\t\tborder-radius: 0;\n\t\t\t\t}\n\t\t\t',NodeBodyMode:"rect",BracketConfig:null,ConnectionConfig:{StrokeDashArray:null,StrokeWidth:2,ArrowheadStyle:"triangle"},NoiseConfig:{Enabled:!1,DefaultLevel:0,MaxJitterPx:0,AffectsNodes:!1,AffectsConnections:!1},ShapeOverrides:{"arrowhead-connection":{Fill:"#808080"},"arrowhead-connection-selected":{Fill:"#008080"}}},this._Themes.whiteboard={Key:"whiteboard",Label:"Whiteboard",CSSVariables:{"--pf-node-body-fill":"transparent","--pf-node-body-stroke":"#555555","--pf-node-body-stroke-width":"2","--pf-node-body-radius":"0px","--pf-node-shadow":"none","--pf-node-shadow-hover":"none","--pf-node-shadow-selected":"none","--pf-node-shadow-dragging":"none","--pf-node-title-fill":"#333333","--pf-node-title-size":"12px","--pf-node-title-weight":"600","--pf-node-title-bar-color":"transparent","--pf-node-type-label-fill":"#999999","--pf-node-selected-stroke":"#2255aa","--pf-port-input-fill":"#5577bb","--pf-port-output-fill":"#55aa77","--pf-port-stroke":"#ffffff","--pf-connection-stroke":"#888888","--pf-connection-selected-stroke":"#2255aa","--pf-canvas-bg":"#ffffff","--pf-grid-stroke":"#f0f0f0","--pf-panel-bg":"#ffffff","--pf-panel-border":"#cccccc","--pf-panel-radius":"0px","--pf-panel-shadow":"2px 2px 0px rgba(0,0,0,0.06)","--pf-panel-titlebar-bg":"#f8f8f8","--pf-panel-titlebar-border":"#e0e0e0","--pf-panel-title-color":"#333333"},AdditionalCSS:'\n\t\t\t\t.pict-flow-node-title,\n\t\t\t\t.pict-flow-node-type-label,\n\t\t\t\t.pict-flow-port-label,\n\t\t\t\t.pict-flow-node-card-code {\n\t\t\t\t\tfont-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;\n\t\t\t\t}\n\t\t\t\t/* Node-type bracket colors — each type gets its own bracket color */\n\t\t\t\t.pict-flow-node-start .pict-flow-node-bracket { stroke: var(--theme-color-status-success, #27ae60); }\n\t\t\t\t.pict-flow-node-end .pict-flow-node-bracket { stroke: #1abc9c; }\n\t\t\t\t.pict-flow-node-halt .pict-flow-node-bracket { stroke: var(--theme-color-status-error, #e74c3c); }\n\t\t\t\t.pict-flow-node-decision .pict-flow-node-bracket { stroke: var(--theme-color-status-warning, #f39c12); }\n\t\t\t\t.pict-flow-node-default .pict-flow-node-bracket { stroke: #3498db; }\n\t\t\t\t.pict-flow-node-action .pict-flow-node-bracket { stroke: #2c3e50; }\n\t\t\t\t/* Override variant rules: no fills/strokes on body rects in whiteboard */\n\t\t\t\t.pict-flow-node-decision .pict-flow-node-body,\n\t\t\t\t.pict-flow-node-start .pict-flow-node-body,\n\t\t\t\t.pict-flow-node-end .pict-flow-node-body,\n\t\t\t\t.pict-flow-node-halt .pict-flow-node-body {\n\t\t\t\t\tfill: transparent;\n\t\t\t\t\tstroke: transparent;\n\t\t\t\t\tstroke-width: 0;\n\t\t\t\t}\n\t\t\t\t/* Title bar fills transparent too */\n\t\t\t\t.pict-flow-node .pict-flow-node-bracket-title-fill {\n\t\t\t\t\tfill: transparent !important;\n\t\t\t\t}\n\t\t\t\t.pict-flow-node-title-icon {\n\t\t\t\t\tfilter: none !important;\n\t\t\t\t}\n\t\t\t',NodeBodyMode:"bracket",BracketConfig:{SerifLength:22,TitleSeparator:!1},ConnectionConfig:{StrokeDashArray:null,StrokeWidth:1.5,ArrowheadStyle:"triangle"},NoiseConfig:{Enabled:!0,DefaultLevel:.3,MaxJitterPx:3,AffectsNodes:!0,AffectsConnections:!0},ShapeOverrides:{"arrowhead-connection":{Fill:"#888888"},"arrowhead-connection-selected":{Fill:"#2255aa"}}}}getActiveTheme(){return this._Themes[this._ActiveThemeKey]||this._Themes.default}getActiveThemeKey(){return this._ActiveThemeKey}setTheme(t){if(!this._Themes[t])return this.log.warn("PictProviderFlowTheme: theme '".concat(t,"' not found")),!1;this._ActiveThemeKey=t;let e=this._Themes[t];return e.NoiseConfig&&"number"==typeof e.NoiseConfig.DefaultLevel?this._NoiseLevel=e.NoiseConfig.DefaultLevel:this._NoiseLevel=0,this._FlowView&&this._FlowView._ConnectorShapesProvider&&(this._FlowView._ConnectorShapesProvider.resetToDefaults(),e.ShapeOverrides&&Object.keys(e.ShapeOverrides).length>0&&this._FlowView._ConnectorShapesProvider.applyThemeOverrides(e.ShapeOverrides)),this.log.trace("PictProviderFlowTheme: switched to '".concat(t,"'")),!0}getNoiseLevel(){return this._NoiseLevel}setNoiseLevel(t){this._NoiseLevel=Math.max(0,Math.min(1,t||0))}registerTheme(t,e){t&&e?(e.Key=t,this._Themes[t]=e):this.log.warn("PictProviderFlowTheme: registerTheme requires key and definition")}getThemeKeys(){return Object.keys(this._Themes)}processPathString(t,e){let o=this.getActiveTheme();if(!(o&&o.NoiseConfig&&o.NoiseConfig.Enabled&&o.NoiseConfig.AffectsConnections))return t;let i=this._NoiseLevel*(o.NoiseConfig.MaxJitterPx||3);return i<=0?t:this._FlowView&&this._FlowView._NoiseProvider?this._FlowView._NoiseProvider.jitterPath(t,i,e):t}getNodeNoiseAmplitude(){let t=this.getActiveTheme();return t&&t.NoiseConfig&&t.NoiseConfig.Enabled&&t.NoiseConfig.AffectsNodes?this._NoiseLevel*(t.NoiseConfig.MaxJitterPx||3):0}},e.exports.default_configuration=n},{"fable-serviceproviderbase":53}],19:[function(t,e,o){e.exports={Name:"Bezier",Label:"Bezier (smooth)",Description:"Smooth cubic curves with side-aware departures.",GeneratePath:function(t){let e=t.Helpers,o=t.Source,i=t.Target,n=t.Connection&&t.Connection.Data||{};if(n.HandleCustomized){let t=e.getBezierHandles(n);if(t.length>0)return e.generateMultiBezier(o,i,t)}return e.generateBezier(o,i)},DefaultParameters:{},ParameterSchema:{}}},{}],20:[function(t,e,o){e.exports={Name:"Orthogonal",Label:"Orthogonal (right-angle)",Description:"Right-angle routing — reads well for DAGs and grids.",GeneratePath:function(t){let e=t.Helpers,o=t.Source,i=t.Target,n=t.Connection&&t.Connection.Data||{},r=null;return n.HandleCustomized&&null!=n.OrthoCorner1X&&(r={corner1:{x:n.OrthoCorner1X,y:n.OrthoCorner1Y},corner2:{x:n.OrthoCorner2X,y:n.OrthoCorner2Y}}),e.generateOrthogonal(o,i,r,n.OrthoMidOffset||0)},DefaultParameters:{},ParameterSchema:{}}},{}],21:[function(t,e,o){const i=t("../layouts/Layout-Coerce.js");e.exports={Name:"OrthogonalSnap",Label:"Orthogonal (snap to grid)",Description:"Right-angle routing; snaps node positions to a grid for cleaner corner alignment. Demonstrates an edge theme that adjusts node placement.",GeneratePath:function(t){let e=t.Helpers,o=t.Source,i=t.Target,n=t.Connection&&t.Connection.Data||{},r=null;return n.HandleCustomized&&null!=n.OrthoCorner1X&&(r={corner1:{x:n.OrthoCorner1X,y:n.OrthoCorner1Y},corner2:{x:n.OrthoCorner2X,y:n.OrthoCorner2Y}}),e.generateOrthogonal(o,i,r,n.OrthoMidOffset||0)},AdjustLayout:function(t,e,o){let n=i.toFloat((o||{}).GridSize,20);if(!(n<=0))for(let e=0;e<t.length;e++){let o=t[e];"number"==typeof o.X&&"number"==typeof o.Y&&(o.X=Math.round(o.X/n)*n,o.Y=Math.round(o.Y/n)*n)}},DefaultParameters:{GridSize:20},ParameterSchema:{GridSize:{Type:"PreciseNumber",Label:"Grid size",Default:20,Min:1,Max:200}}}},{"../layouts/Layout-Coerce.js":28}],22:[function(t,e,o){const i=t("./Edge-PerimeterMath.js");e.exports={Name:"Perimeter-Linear",Label:"Perimeter (linear)",Description:"Each connection exits the node at the perimeter, then runs as a straight line to the other end.",GeneratePath:function(t){let e=t.Source,o=t.Target;return"M ".concat(e.x," ").concat(e.y," L ").concat(o.x," ").concat(o.y)},ResolveAttachment:function(t){return i.resolvePerimeterAttachment(t)},DefaultParameters:{},ParameterSchema:{}}},{"./Edge-PerimeterMath.js":25}],23:[function(t,e,o){const i=t("./Edge-PerimeterMath.js");e.exports={Name:"Perimeter-Orthogonal",Label:"Perimeter (orthogonal)",Description:"Each connection exits the node at the perimeter, then routes via right-angle segments to the other end.",GeneratePath:function(t){let e=t.Connection&&t.Connection.Data||{},o=null;return e.HandleCustomized&&null!=e.OrthoCorner1X&&(o={corner1:{x:e.OrthoCorner1X,y:e.OrthoCorner1Y},corner2:{x:e.OrthoCorner2X,y:e.OrthoCorner2Y}}),t.Helpers.generateOrthogonal(t.Source,t.Target,o,e.OrthoMidOffset||0)},ResolveAttachment:function(t){return i.resolvePerimeterAttachment(t)},DefaultParameters:{},ParameterSchema:{}}},{"./Edge-PerimeterMath.js":25}],24:[function(t,e,o){const i=t("./Edge-PerimeterMath.js");e.exports={Name:"Perimeter",Label:"Perimeter (bezier)",Description:"Each connection exits the node at the perimeter point closest to its target, with smooth bezier curves. Fixes star/hub topologies where many lines share one port.",GeneratePath:function(t){let e=t.Helpers,o=t.Connection&&t.Connection.Data||{};if(o.HandleCustomized){let i=e.getBezierHandles(o);if(i.length>0)return e.generateMultiBezier(t.Source,t.Target,i)}return e.generateBezier(t.Source,t.Target)},ResolveAttachment:function(t){return i.resolvePerimeterAttachment(t)},DefaultParameters:{},ParameterSchema:{}}},{"./Edge-PerimeterMath.js":25}],25:[function(t,e,o){e.exports={resolvePerimeterAttachment:function(t){let e=t.Node;if(!e||"number"!=typeof e.X||"number"!=typeof e.Y)return null;let o,i,n=e.Width||180,r=e.Height||80,a=e.X+n/2,l=e.Y+r/2;if(t.OtherNode&&"number"==typeof t.OtherNode.X){let e=t.OtherNode.Width||180,n=t.OtherNode.Height||80;o=t.OtherNode.X+e/2,i=t.OtherNode.Y+n/2}else{if(!t.OtherDefaultPosition)return null;o=t.OtherDefaultPosition.x,i=t.OtherDefaultPosition.y}let s=o-a,c=i-l;if(0===s&&0===c)return t.DefaultPosition||null;let d,h,p=n/2,u=r/2,w=s>0?p/s:s<0?-p/s:1/0,f=c>0?u/c:c<0?-u/c:1/0;return w<f?(d=w,h=s>0?"right":"left"):(d=f,h=c>0?"bottom":"top"),{x:a+d*s,y:l+d*c,side:h}}}},{}],26:[function(t,e,o){e.exports={Name:"Straight",Label:"Straight line",Description:"Plain straight line between ports.",GeneratePath:function(t){let e=t.Source,o=t.Target;return"M ".concat(e.x," ").concat(e.y," L ").concat(o.x," ").concat(o.y)},DefaultParameters:{},ParameterSchema:{}}},{}],27:[function(t,e,o){const i=t("./Layout-Coerce.js");e.exports={Name:"Circular",Label:"Circular",Description:"Concentric rings; uses connections for ring assignment when available.",DefaultEdgeTheme:"Perimeter",Apply:function(t,e,o){if(!t||0===t.length)return;let n=o||{},r=i.toFloat(n.Spacing,1),a=i.toFloat(n.CenterX,1e3),l=i.toFloat(n.CenterY,750),s=i.toFloat(n.RingSpacing,220)*r,c=i.toFloat(n.InnerRadius,0)*r,d=i.toFloat(n.StartAngle,-90),h="ccw"===n.Direction?"ccw":"cw",p=Array.isArray(e)?e:[],u={},w={},f={};for(let e=0;e<t.length;e++)f[t[e].Hash]=t[e],u[t[e].Hash]=0,w[t[e].Hash]=[];for(let t=0;t<p.length;t++){let e=p[t];u.hasOwnProperty(e.TargetNodeHash)&&u[e.TargetNodeHash]++,w.hasOwnProperty(e.SourceNodeHash)&&w[e.SourceNodeHash].push(e.TargetNodeHash)}let g=[];for(let e=0;e<t.length;e++)0===u[t[e].Hash]&&g.push(t[e].Hash);let m=[];if(0===p.length||0===g.length)m.push(t.map(t=>t.Hash));else{let e={},o=g.slice();for(;o.length>0;){let t=[],i=[];for(let n=0;n<o.length;n++){let r=o[n];if(e[r])continue;e[r]=!0,t.push(r);let a=w[r]||[];for(let t=0;t<a.length;t++)e[a[t]]||i.push(a[t])}t.length>0&&m.push(t),o=i}let i=[];for(let o=0;o<t.length;o++)e[t[o].Hash]||i.push(t[o].Hash);i.length>0&&m.push(i)}let b="cw"===h?1:-1,y=d*Math.PI/180;for(let t=0;t<m.length;t++){let e=m[t],o=c+t*s;if(1===e.length&&0===t&&0===c){let t=f[e[0]];t&&(t.X=a-(t.Width||180)/2,t.Y=l-(t.Height||80)/2);continue}let i=2*Math.PI/e.length;for(let t=0;t<e.length;t++){let n=f[e[t]];if(!n)continue;let r=y+b*t*i,s=n.Width||180,c=n.Height||80;n.X=a+Math.cos(r)*o-s/2,n.Y=l+Math.sin(r)*o-c/2}}},DefaultParameters:{Spacing:1,CenterX:1e3,CenterY:750,RingSpacing:220,InnerRadius:0,StartAngle:-90,Direction:"cw"},ParameterSchema:{Spacing:{Type:"PreciseNumber",Label:"Spacing (multiplier)",Default:1,Min:.1,Max:5},CenterX:{Type:"PreciseNumber",Label:"Center X",Default:1e3,Min:-1e4,Max:1e4},CenterY:{Type:"PreciseNumber",Label:"Center Y",Default:750,Min:-1e4,Max:1e4},RingSpacing:{Type:"PreciseNumber",Label:"Ring spacing",Default:220,Min:1,Max:5e3},InnerRadius:{Type:"PreciseNumber",Label:"Inner radius",Default:0,Min:0,Max:5e3},StartAngle:{Type:"PreciseNumber",Label:"Start angle (deg)",Default:-90,Min:-360,Max:360},Direction:{Type:"enum",Label:"Direction",Default:"cw",Options:["cw","ccw"]}},ParameterManifest:{Scope:"PictFlowLayout-Circular",Sections:[{Name:"Circular Parameters",Hash:"PFLCircularSection",Groups:[{Name:"Defaults",Hash:"PFLCircularGroup"}]}],Descriptors:{"PictFlowLayoutEditor.Parameters.Spacing":{Name:"Spacing (multiplier)",Hash:"Spacing",DataType:"PreciseNumber",Default:1,PictForm:{Section:"PFLCircularSection",Group:"PFLCircularGroup",Row:0,Width:12,Min:.1,Max:5}},"PictFlowLayoutEditor.Parameters.CenterX":{Name:"Center X",Hash:"CenterX",DataType:"PreciseNumber",Default:1e3,PictForm:{Section:"PFLCircularSection",Group:"PFLCircularGroup",Row:1,Width:6,Min:-1e4,Max:1e4}},"PictFlowLayoutEditor.Parameters.CenterY":{Name:"Center Y",Hash:"CenterY",DataType:"PreciseNumber",Default:750,PictForm:{Section:"PFLCircularSection",Group:"PFLCircularGroup",Row:1,Width:6,Min:-1e4,Max:1e4}},"PictFlowLayoutEditor.Parameters.RingSpacing":{Name:"Ring spacing",Hash:"RingSpacing",DataType:"PreciseNumber",Default:220,PictForm:{Section:"PFLCircularSection",Group:"PFLCircularGroup",Row:2,Width:6,Min:1,Max:5e3}},"PictFlowLayoutEditor.Parameters.InnerRadius":{Name:"Inner radius",Hash:"InnerRadius",DataType:"PreciseNumber",Default:0,PictForm:{Section:"PFLCircularSection",Group:"PFLCircularGroup",Row:2,Width:6,Min:0,Max:5e3}},"PictFlowLayoutEditor.Parameters.StartAngle":{Name:"Start angle (deg)",Hash:"StartAngle",DataType:"PreciseNumber",Default:-90,PictForm:{Section:"PFLCircularSection",Group:"PFLCircularGroup",Row:3,Width:6,Min:-360,Max:360}},"PictFlowLayoutEditor.Parameters.Direction":{Name:"Direction",Hash:"Direction",DataType:"String",Default:"cw",PictForm:{Section:"PFLCircularSection",Group:"PFLCircularGroup",Row:3,Width:6,InputType:"Option",SelectOptions:[{Value:"cw",Name:"Clockwise"},{Value:"ccw",Name:"Counter-clockwise"}]}}}}}},{"./Layout-Coerce.js":28}],28:[function(t,e,o){e.exports={toFloat:function(t,e){if("number"==typeof t&&!isNaN(t))return t;if("string"==typeof t&&""!==t){let e=parseFloat(t);if(!isNaN(e))return e}return e},toInt:function(t,e){if("number"==typeof t&&!isNaN(t))return Math.floor(t);if("string"==typeof t&&""!==t){let e=parseInt(t,10);if(!isNaN(e))return e}return e}}},{}],29:[function(t,e,o){const i=t("./Layout-Coerce.js");e.exports={Name:"Columnar",Label:"Columnar (N Columns)",Description:"Explicit N columns; flow row-first or column-first.",DefaultEdgeTheme:"Orthogonal",Apply:function(t,e,o){if(!t||0===t.length)return;let n=o||{},r=i.toFloat(n.Spacing,1),a=Math.max(1,i.toInt(n.Columns,3)),l=i.toFloat(n.ColumnSpacing,40)*r,s=i.toFloat(n.RowSpacing,40)*r,c=i.toFloat(n.StartX,100),d=i.toFloat(n.StartY,100),h="column"===n.FillOrder?"column":"row",p=n.OrderBy||"index",u=0,w=0;for(let e=0;e<t.length;e++)u=Math.max(u,t[e].Width||180),w=Math.max(w,t[e].Height||80);let f=u+l,g=w+s,m=t.slice();"hash"===p?m.sort((t,e)=>String(t.Hash).localeCompare(String(e.Hash))):"title"===p&&m.sort((t,e)=>String(t.Title||t.Hash).localeCompare(String(e.Title||e.Hash)));let b=Math.ceil(m.length/a);for(let t=0;t<m.length;t++){let e,o;"column"===h?(o=Math.floor(t/b),e=t%b):(e=Math.floor(t/a),o=t%a),m[t].X=c+o*f,m[t].Y=d+e*g}},DefaultParameters:{Spacing:1,Columns:3,ColumnSpacing:40,RowSpacing:40,StartX:100,StartY:100,FillOrder:"row",OrderBy:"index"},ParameterSchema:{Spacing:{Type:"PreciseNumber",Label:"Spacing (multiplier)",Default:1,Min:.1,Max:5},Columns:{Type:"Number",Label:"Columns",Default:3,Min:1,Max:50},ColumnSpacing:{Type:"PreciseNumber",Label:"Column spacing",Default:40,Min:0,Max:1e3},RowSpacing:{Type:"PreciseNumber",Label:"Row spacing",Default:40,Min:0,Max:1e3},StartX:{Type:"PreciseNumber",Label:"Start X",Default:100,Min:-1e4,Max:1e4},StartY:{Type:"PreciseNumber",Label:"Start Y",Default:100,Min:-1e4,Max:1e4},FillOrder:{Type:"enum",Label:"Fill order",Default:"row",Options:["row","column"]},OrderBy:{Type:"enum",Label:"Order by",Default:"index",Options:["index","hash","title"]}},ParameterManifest:{Scope:"PictFlowLayout-Columnar",Sections:[{Name:"Columnar Parameters",Hash:"PFLColumnarSection",Groups:[{Name:"Defaults",Hash:"PFLColumnarGroup"}]}],Descriptors:{"PictFlowLayoutEditor.Parameters.Spacing":{Name:"Spacing (multiplier)",Hash:"Spacing",DataType:"PreciseNumber",Default:1,PictForm:{Section:"PFLColumnarSection",Group:"PFLColumnarGroup",Row:0,Width:12,Min:.1,Max:5}},"PictFlowLayoutEditor.Parameters.Columns":{Name:"Columns",Hash:"Columns",DataType:"Number",Default:3,PictForm:{Section:"PFLColumnarSection",Group:"PFLColumnarGroup",Row:1,Width:6,Min:1,Max:50}},"PictFlowLayoutEditor.Parameters.FillOrder":{Name:"Fill order",Hash:"FillOrder",DataType:"String",Default:"row",PictForm:{Section:"PFLColumnarSection",Group:"PFLColumnarGroup",Row:1,Width:6,InputType:"Option",SelectOptions:[{Value:"row",Name:"Row-first"},{Value:"column",Name:"Column-first"}]}},"PictFlowLayoutEditor.Parameters.ColumnSpacing":{Name:"Column spacing",Hash:"ColumnSpacing",DataType:"PreciseNumber",Default:40,PictForm:{Section:"PFLColumnarSection",Group:"PFLColumnarGroup",Row:2,Width:6,Min:0,Max:1e3}},"PictFlowLayoutEditor.Parameters.RowSpacing":{Name:"Row spacing",Hash:"RowSpacing",DataType:"PreciseNumber",Default:40,PictForm:{Section:"PFLColumnarSection",Group:"PFLColumnarGroup",Row:2,Width:6,Min:0,Max:1e3}},"PictFlowLayoutEditor.Parameters.StartX":{Name:"Start X",Hash:"StartX",DataType:"PreciseNumber",Default:100,PictForm:{Section:"PFLColumnarSection",Group:"PFLColumnarGroup",Row:3,Width:6,Min:-1e4,Max:1e4}},"PictFlowLayoutEditor.Parameters.StartY":{Name:"Start Y",Hash:"StartY",DataType:"PreciseNumber",Default:100,PictForm:{Section:"PFLColumnarSection",Group:"PFLColumnarGroup",Row:3,Width:6,Min:-1e4,Max:1e4}},"PictFlowLayoutEditor.Parameters.OrderBy":{Name:"Order by",Hash:"OrderBy",DataType:"String",Default:"index",PictForm:{Section:"PFLColumnarSection",Group:"PFLColumnarGroup",Row:4,Width:12,InputType:"Option",SelectOptions:[{Value:"index",Name:"Index"},{Value:"hash",Name:"Hash"},{Value:"title",Name:"Title"}]}}}}}},{"./Layout-Coerce.js":28}],30:[function(t,e,o){e.exports={Name:"Custom",Label:"Custom (Hand-placed)",Description:"Preserve hand-placed positions. No automatic arrangement.",DefaultEdgeTheme:"Bezier",Apply:function(t,e,o){},DefaultParameters:{},ParameterSchema:{}}},{}],31:[function(t,e,o){const i=t("./Layout-Coerce.js");e.exports={Name:"ForcedFromCenter",Label:"Forced from Center",Description:"Spring + repulsion simulation pulling toward a center point.",DefaultEdgeTheme:"Bezier",Apply:function(t,e,o){if(!t||0===t.length)return;let n=o||{},r=i.toFloat(n.Spacing,1),a=i.toInt(n.Iterations,200),l=i.toFloat(n.CenterX,1e3),s=i.toFloat(n.CenterY,750),c=i.toFloat(n.SpringLength,200)*r,d=i.toFloat(n.SpringStiffness,.05),h=i.toFloat(n.Repulsion,8e3),p=i.toFloat(n.CenterAttraction,.01),u=i.toFloat(n.CoolingFactor,.95),w=i.toFloat(n.InitialTemperature,100),f=i.toInt(n.Seed,42),g=!!n.PreservePositions,m=i.toFloat(n.InitialSpread,400),b=Array.isArray(e)?e:[],y=function(t){let e=t>>>0;return function(){e=e+1831565813>>>0;let t=e;return t=Math.imul(t^t>>>15,1|t),t^=t+Math.imul(t^t>>>7,61|t),((t^t>>>14)>>>0)/4294967296}}(f>>>0);for(let e=0;e<t.length;e++){let o=t[e],i="number"==typeof o.X&&"number"==typeof o.Y;g&&i||(o.X=l+(y()-.5)*m,o.Y=s+(y()-.5)*m)}let v={};for(let e=0;e<t.length;e++)v[t[e].Hash]=t[e];let P=w;for(let e=0;e<a;e++){let e=new Array(t.length).fill(0),o=new Array(t.length).fill(0);for(let i=0;i<t.length;i++){let n=t[i];for(let r=i+1;r<t.length;r++){let a=t[r],l=n.X-a.X,s=n.Y-a.Y,c=l*l+s*s;c<1&&(c=1);let d=Math.sqrt(c),p=h/c,u=l/d*p,w=s/d*p;e[i]+=u,o[i]+=w,e[r]-=u,o[r]-=w}}for(let i=0;i<b.length;i++){let n=b[i],r=v[n.SourceNodeHash],a=v[n.TargetNodeHash];if(!r||!a)continue;let l=t.indexOf(r),s=t.indexOf(a);if(l<0||s<0)continue;let h=a.X-r.X,p=a.Y-r.Y,u=Math.sqrt(h*h+p*p);u<1e-4&&(u=1e-4);let w=d*(u-c),f=h/u*w,g=p/u*w;e[l]+=f,o[l]+=g,e[s]-=f,o[s]-=g}for(let i=0;i<t.length;i++){let n=t[i];e[i]+=(l-n.X)*p,o[i]+=(s-n.Y)*p}for(let i=0;i<t.length;i++){let n=t[i],r=e[i],a=o[i],l=Math.sqrt(r*r+a*a);l>P&&(r=r/l*P,a=a/l*P),n.X+=r,n.Y+=a}P*=u}for(let e=0;e<t.length;e++)t[e].X=Math.round(t[e].X),t[e].Y=Math.round(t[e].Y)},DefaultParameters:{Spacing:1,Iterations:200,CenterX:1e3,CenterY:750,SpringLength:200,SpringStiffness:.05,Repulsion:8e3,CenterAttraction:.01,CoolingFactor:.95,InitialTemperature:100,Seed:42,PreservePositions:!1,InitialSpread:400},ParameterSchema:{Spacing:{Type:"PreciseNumber",Label:"Spacing (multiplier)",Default:1,Min:.1,Max:5},Iterations:{Type:"Number",Label:"Iterations",Default:200,Min:1,Max:2e3},CenterX:{Type:"PreciseNumber",Label:"Center X",Default:1e3,Min:-1e4,Max:1e4},CenterY:{Type:"PreciseNumber",Label:"Center Y",Default:750,Min:-1e4,Max:1e4},SpringLength:{Type:"PreciseNumber",Label:"Spring length",Default:200,Min:1,Max:2e3},SpringStiffness:{Type:"PreciseNumber",Label:"Spring stiffness",Default:.05,Min:0,Max:1},Repulsion:{Type:"PreciseNumber",Label:"Repulsion",Default:8e3,Min:0,Max:1e5},CenterAttraction:{Type:"PreciseNumber",Label:"Center attraction",Default:.01,Min:0,Max:1},CoolingFactor:{Type:"PreciseNumber",Label:"Cooling factor",Default:.95,Min:.5,Max:1},InitialTemperature:{Type:"PreciseNumber",Label:"Initial temperature",Default:100,Min:1,Max:1e3},Seed:{Type:"Number",Label:"Random seed",Default:42,Min:0,Max:2147483647},PreservePositions:{Type:"boolean",Label:"Preserve positions",Default:!1},InitialSpread:{Type:"PreciseNumber",Label:"Initial spread",Default:400,Min:0,Max:5e3}},ParameterManifest:{Scope:"PictFlowLayout-ForcedFromCenter",Sections:[{Name:"Center",Hash:"PFLCenterSection",Groups:[{Name:"Defaults",Hash:"PFLCenterGroup"}]},{Name:"Forces",Hash:"PFLForcesSection",Groups:[{Name:"Defaults",Hash:"PFLForcesGroup"}]},{Name:"Simulation",Hash:"PFLSimSection",Groups:[{Name:"Defaults",Hash:"PFLSimGroup"}]},{Name:"Initialization",Hash:"PFLInitSection",Groups:[{Name:"Defaults",Hash:"PFLInitGroup"}]}],Descriptors:{"PictFlowLayoutEditor.Parameters.Spacing":{Name:"Spacing (multiplier)",Hash:"Spacing",DataType:"PreciseNumber",Default:1,PictForm:{Section:"PFLCenterSection",Group:"PFLCenterGroup",Row:0,Width:12,Min:.1,Max:5}},"PictFlowLayoutEditor.Parameters.CenterX":{Name:"Center X",Hash:"CenterX",DataType:"PreciseNumber",Default:1e3,PictForm:{Section:"PFLCenterSection",Group:"PFLCenterGroup",Row:1,Width:6,Min:-1e4,Max:1e4}},"PictFlowLayoutEditor.Parameters.CenterY":{Name:"Center Y",Hash:"CenterY",DataType:"PreciseNumber",Default:750,PictForm:{Section:"PFLCenterSection",Group:"PFLCenterGroup",Row:1,Width:6,Min:-1e4,Max:1e4}},"PictFlowLayoutEditor.Parameters.CenterAttraction":{Name:"Center attraction",Hash:"CenterAttraction",DataType:"PreciseNumber",Default:.01,PictForm:{Section:"PFLCenterSection",Group:"PFLCenterGroup",Row:2,Width:12,Min:0,Max:1}},"PictFlowLayoutEditor.Parameters.SpringLength":{Name:"Spring length",Hash:"SpringLength",DataType:"PreciseNumber",Default:200,PictForm:{Section:"PFLForcesSection",Group:"PFLForcesGroup",Row:1,Width:6,Min:1,Max:2e3}},"PictFlowLayoutEditor.Parameters.SpringStiffness":{Name:"Spring stiffness",Hash:"SpringStiffness",DataType:"PreciseNumber",Default:.05,PictForm:{Section:"PFLForcesSection",Group:"PFLForcesGroup",Row:1,Width:6,Min:0,Max:1}},"PictFlowLayoutEditor.Parameters.Repulsion":{Name:"Repulsion",Hash:"Repulsion",DataType:"PreciseNumber",Default:8e3,PictForm:{Section:"PFLForcesSection",Group:"PFLForcesGroup",Row:2,Width:12,Min:0,Max:1e5}},"PictFlowLayoutEditor.Parameters.Iterations":{Name:"Iterations",Hash:"Iterations",DataType:"Number",Default:200,PictForm:{Section:"PFLSimSection",Group:"PFLSimGroup",Row:1,Width:6,Min:1,Max:2e3}},"PictFlowLayoutEditor.Parameters.CoolingFactor":{Name:"Cooling factor",Hash:"CoolingFactor",DataType:"PreciseNumber",Default:.95,PictForm:{Section:"PFLSimSection",Group:"PFLSimGroup",Row:1,Width:6,Min:.5,Max:1}},"PictFlowLayoutEditor.Parameters.InitialTemperature":{Name:"Initial temperature",Hash:"InitialTemperature",DataType:"PreciseNumber",Default:100,PictForm:{Section:"PFLSimSection",Group:"PFLSimGroup",Row:2,Width:12,Min:1,Max:1e3}},"PictFlowLayoutEditor.Parameters.Seed":{Name:"Random seed",Hash:"Seed",DataType:"Number",Default:42,PictForm:{Section:"PFLInitSection",Group:"PFLInitGroup",Row:1,Width:6,Min:0,Max:2147483647}},"PictFlowLayoutEditor.Parameters.InitialSpread":{Name:"Initial spread",Hash:"InitialSpread",DataType:"PreciseNumber",Default:400,PictForm:{Section:"PFLInitSection",Group:"PFLInitGroup",Row:1,Width:6,Min:0,Max:5e3}},"PictFlowLayoutEditor.Parameters.PreservePositions":{Name:"Preserve existing positions",Hash:"PreservePositions",DataType:"Boolean",Default:!1,PictForm:{Section:"PFLInitSection",Group:"PFLInitGroup",Row:2,Width:12,InputType:"Boolean"}}}}}},{"./Layout-Coerce.js":28}],32:[function(t,e,o){const i=t("./Layout-Coerce.js");e.exports={Name:"Grid",Label:"Grid",Description:"Auto-arrange in a roughly-square grid.",DefaultEdgeTheme:"Orthogonal",Apply:function(t,e,o){if(!t||0===t.length)return;let n,r=o||{},a=i.toFloat(r.Spacing,1),l=r.Columns,s=r.CellWidth,c=r.CellHeight,d=i.toFloat(r.HorizontalMargin,40)*a,h=i.toFloat(r.VerticalMargin,40)*a,p=i.toFloat(r.StartX,100),u=i.toFloat(r.StartY,100),w=r.OrderBy||"index";n="auto"===l||null==l||""===l?Math.max(1,Math.ceil(Math.sqrt(t.length))):Math.max(1,i.toInt(l,Math.max(1,Math.ceil(Math.sqrt(t.length)))));let f=0,g=0;for(let e=0;e<t.length;e++)f=Math.max(f,t[e].Width||180),g=Math.max(g,t[e].Height||80);let m=null==s?f+d:i.toFloat(s,f+d),b=null==c?g+h:i.toFloat(c,g+h),y=t.slice();"hash"===w?y.sort((t,e)=>String(t.Hash).localeCompare(String(e.Hash))):"title"===w&&y.sort((t,e)=>String(t.Title||t.Hash).localeCompare(String(e.Title||e.Hash)));for(let t=0;t<y.length;t++){let e=Math.floor(t/n),o=t%n;y[t].X=p+o*m,y[t].Y=u+e*b}},DefaultParameters:{Spacing:1,Columns:"auto",HorizontalMargin:40,VerticalMargin:40,StartX:100,StartY:100,OrderBy:"index"},ParameterSchema:{Spacing:{Type:"PreciseNumber",Label:"Spacing (multiplier)",Default:1,Min:.1,Max:5},Columns:{Type:"string",Label:"Columns",Default:"auto",Description:'"auto" or an integer'},CellWidth:{Type:"PreciseNumber",Label:"Cell width",Description:"Defaults to largest node width + horizontal margin",Min:1,Max:5e3},CellHeight:{Type:"PreciseNumber",Label:"Cell height",Description:"Defaults to largest node height + vertical margin",Min:1,Max:5e3},HorizontalMargin:{Type:"PreciseNumber",Label:"Horizontal margin",Default:40,Min:0,Max:1e3},VerticalMargin:{Type:"PreciseNumber",Label:"Vertical margin",Default:40,Min:0,Max:1e3},StartX:{Type:"PreciseNumber",Label:"Start X",Default:100,Min:-1e4,Max:1e4},StartY:{Type:"PreciseNumber",Label:"Start Y",Default:100,Min:-1e4,Max:1e4},OrderBy:{Type:"enum",Label:"Order by",Default:"index",Options:["index","hash","title"]}},ParameterManifest:{Scope:"PictFlowLayout-Grid",Sections:[{Name:"Grid Parameters",Hash:"PFLGridSection",Groups:[{Name:"Defaults",Hash:"PFLGridGroup"}]}],Descriptors:{"PictFlowLayoutEditor.Parameters.Spacing":{Name:"Spacing (multiplier)",Hash:"Spacing",DataType:"PreciseNumber",Default:1,PictForm:{Section:"PFLGridSection",Group:"PFLGridGroup",Row:0,Width:12,Min:.1,Max:5}},"PictFlowLayoutEditor.Parameters.Columns":{Name:'Columns ("auto" or integer)',Hash:"Columns",DataType:"String",Default:"auto",PictForm:{Section:"PFLGridSection",Group:"PFLGridGroup",Row:1,Width:6}},"PictFlowLayoutEditor.Parameters.OrderBy":{Name:"Order by",Hash:"OrderBy",DataType:"String",Default:"index",PictForm:{Section:"PFLGridSection",Group:"PFLGridGroup",Row:1,Width:6,InputType:"Option",SelectOptions:[{Value:"index",Name:"Index"},{Value:"hash",Name:"Hash"},{Value:"title",Name:"Title"}]}},"PictFlowLayoutEditor.Parameters.CellWidth":{Name:"Cell width (auto = blank)",Hash:"CellWidth",DataType:"PreciseNumber",PictForm:{Section:"PFLGridSection",Group:"PFLGridGroup",Row:2,Width:6,Min:1,Max:5e3}},"PictFlowLayoutEditor.Parameters.CellHeight":{Name:"Cell height (auto = blank)",Hash:"CellHeight",DataType:"PreciseNumber",PictForm:{Section:"PFLGridSection",Group:"PFLGridGroup",Row:2,Width:6,Min:1,Max:5e3}},"PictFlowLayoutEditor.Parameters.HorizontalMargin":{Name:"Horizontal margin",Hash:"HorizontalMargin",DataType:"PreciseNumber",Default:40,PictForm:{Section:"PFLGridSection",Group:"PFLGridGroup",Row:3,Width:6,Min:0,Max:1e3}},"PictFlowLayoutEditor.Parameters.VerticalMargin":{Name:"Vertical margin",Hash:"VerticalMargin",DataType:"PreciseNumber",Default:40,PictForm:{Section:"PFLGridSection",Group:"PFLGridGroup",Row:3,Width:6,Min:0,Max:1e3}},"PictFlowLayoutEditor.Parameters.StartX":{Name:"Start X",Hash:"StartX",DataType:"PreciseNumber",Default:100,PictForm:{Section:"PFLGridSection",Group:"PFLGridGroup",Row:4,Width:6,Min:-1e4,Max:1e4}},"PictFlowLayoutEditor.Parameters.StartY":{Name:"Start Y",Hash:"StartY",DataType:"PreciseNumber",Default:100,PictForm:{Section:"PFLGridSection",Group:"PFLGridGroup",Row:4,Width:6,Min:-1e4,Max:1e4}}}}}},{"./Layout-Coerce.js":28}],33:[function(t,e,o){const i=t("./Layout-Coerce.js");e.exports={Name:"Layered",Label:"Layered (Topological)",Description:"Left-to-right layers based on connection topology.",DefaultEdgeTheme:"Orthogonal",Apply:function(t,e,o){if(!t||0===t.length)return;let n=o||{},r=i.toFloat(n.Spacing,1),a=i.toFloat(n.HorizontalSpacing,250)*r,l=i.toFloat(n.VerticalSpacing,120)*r,s=i.toFloat(n.StartX,100),c=i.toFloat(n.StartY,100),d=Array.isArray(e)?e:[],h={},p={},u={};for(let e=0;e<t.length;e++){let o=t[e];h[o.Hash]=o,p[o.Hash]=0,u[o.Hash]=[]}for(let t=0;t<d.length;t++){let e=d[t];p.hasOwnProperty(e.TargetNodeHash)&&p[e.TargetNodeHash]++,u.hasOwnProperty(e.SourceNodeHash)&&u[e.SourceNodeHash].push(e.TargetNodeHash)}let w=[],f=[],g={};for(let t in p)0===p[t]&&f.push(t);for(;f.length>0;){let t=[],e=[];for(let o=0;o<f.length;o++){let i=f[o];if(g[i])continue;g[i]=!0,t.push(i);let n=u[i]||[];for(let t=0;t<n.length;t++){let o=n[t];p[o]--,p[o]<=0&&!g[o]&&e.push(o)}}t.length>0&&w.push(t),f=e}let m=[];for(let e=0;e<t.length;e++)g[t[e].Hash]||m.push(t[e].Hash);m.length>0&&w.push(m);let b=s;for(let t=0;t<w.length;t++){let e=w[t],o=0,i=c;for(let t=0;t<e.length;t++){let n=h[e[t]];if(!n)continue;n.X=b,n.Y=i;let r=n.Width||180,a=n.Height||80;o=Math.max(o,r),i+=a+l}b+=o+a}},DefaultParameters:{Spacing:1,HorizontalSpacing:250,VerticalSpacing:120,StartX:100,StartY:100},ParameterSchema:{Spacing:{Type:"PreciseNumber",Label:"Spacing (multiplier)",Default:1,Min:.1,Max:5},HorizontalSpacing:{Type:"PreciseNumber",Label:"Horizontal spacing",Default:250,Min:0,Max:1e3},VerticalSpacing:{Type:"PreciseNumber",Label:"Vertical spacing",Default:120,Min:0,Max:1e3},StartX:{Type:"PreciseNumber",Label:"Start X",Default:100,Min:-1e4,Max:1e4},StartY:{Type:"PreciseNumber",Label:"Start Y",Default:100,Min:-1e4,Max:1e4}},ParameterManifest:{Scope:"PictFlowLayout-Layered",Sections:[{Name:"Layered Parameters",Hash:"PictFlowLayoutSection",Groups:[{Name:"Defaults",Hash:"PictFlowLayoutGroup"}]}],Descriptors:{"PictFlowLayoutEditor.Parameters.Spacing":{Name:"Spacing (multiplier)",Hash:"Spacing",DataType:"PreciseNumber",Default:1,PictForm:{Section:"PictFlowLayoutSection",Group:"PictFlowLayoutGroup",Row:0,Width:12,Min:.1,Max:5}},"PictFlowLayoutEditor.Parameters.HorizontalSpacing":{Name:"Horizontal spacing",Hash:"HorizontalSpacing",DataType:"PreciseNumber",Default:250,PictForm:{Section:"PictFlowLayoutSection",Group:"PictFlowLayoutGroup",Row:1,Width:6,Min:0,Max:1e3}},"PictFlowLayoutEditor.Parameters.VerticalSpacing":{Name:"Vertical spacing",Hash:"VerticalSpacing",DataType:"PreciseNumber",Default:120,PictForm:{Section:"PictFlowLayoutSection",Group:"PictFlowLayoutGroup",Row:1,Width:6,Min:0,Max:1e3}},"PictFlowLayoutEditor.Parameters.StartX":{Name:"Start X",Hash:"StartX",DataType:"PreciseNumber",Default:100,PictForm:{Section:"PictFlowLayoutSection",Group:"PictFlowLayoutGroup",Row:2,Width:6,Min:-1e4,Max:1e4}},"PictFlowLayoutEditor.Parameters.StartY":{Name:"Start Y",Hash:"StartY",DataType:"PreciseNumber",Default:100,PictForm:{Section:"PictFlowLayoutSection",Group:"PictFlowLayoutGroup",Row:2,Width:6,Min:-1e4,Max:1e4}}}}}},{"./Layout-Coerce.js":28}],34:[function(t,e,o){const i=t("./Layout-Coerce.js");e.exports={Name:"Tabular",Label:"Tabular (Top-to-Bottom)",Description:"Single column, top-to-bottom.",DefaultEdgeTheme:"Orthogonal",Apply:function(t,e,o){if(!t||0===t.length)return;let n=o||{},r=i.toFloat(n.Spacing,1),a=i.toFloat(n.StartX,100),l=i.toFloat(n.StartY,100),s=i.toFloat(n.VerticalSpacing,40)*r,c=n.RowHeight,d=n.OrderBy||"index",h=t.slice();"hash"===d?h.sort((t,e)=>String(t.Hash).localeCompare(String(e.Hash))):"title"===d&&h.sort((t,e)=>String(t.Title||t.Hash).localeCompare(String(e.Title||e.Hash)));let p=l;for(let t=0;t<h.length;t++){let e=h[t];e.X=a,e.Y=p,p+=(null==c?e.Height||80:i.toFloat(c,e.Height||80))+s}},DefaultParameters:{Spacing:1,StartX:100,StartY:100,VerticalSpacing:40,OrderBy:"index"},ParameterSchema:{Spacing:{Type:"PreciseNumber",Label:"Spacing (multiplier)",Default:1,Min:.1,Max:5},StartX:{Type:"PreciseNumber",Label:"Start X",Default:100,Min:-1e4,Max:1e4},StartY:{Type:"PreciseNumber",Label:"Start Y",Default:100,Min:-1e4,Max:1e4},VerticalSpacing:{Type:"PreciseNumber",Label:"Vertical spacing",Default:40,Min:0,Max:1e3},RowHeight:{Type:"PreciseNumber",Label:"Row height",Description:"Defaults to each node's own height",Min:1,Max:5e3},OrderBy:{Type:"enum",Label:"Order by",Default:"index",Options:["index","hash","title"]}},ParameterManifest:{Scope:"PictFlowLayout-Tabular",Sections:[{Name:"Tabular Parameters",Hash:"PFLTabularSection",Groups:[{Name:"Defaults",Hash:"PFLTabularGroup"}]}],Descriptors:{"PictFlowLayoutEditor.Parameters.Spacing":{Name:"Spacing (multiplier)",Hash:"Spacing",DataType:"PreciseNumber",Default:1,PictForm:{Section:"PFLTabularSection",Group:"PFLTabularGroup",Row:0,Width:12,Min:.1,Max:5}},"PictFlowLayoutEditor.Parameters.StartX":{Name:"Start X",Hash:"StartX",DataType:"PreciseNumber",Default:100,PictForm:{Section:"PFLTabularSection",Group:"PFLTabularGroup",Row:1,Width:6,Min:-1e4,Max:1e4}},"PictFlowLayoutEditor.Parameters.StartY":{Name:"Start Y",Hash:"StartY",DataType:"PreciseNumber",Default:100,PictForm:{Section:"PFLTabularSection",Group:"PFLTabularGroup",Row:1,Width:6,Min:-1e4,Max:1e4}},"PictFlowLayoutEditor.Parameters.VerticalSpacing":{Name:"Vertical spacing",Hash:"VerticalSpacing",DataType:"PreciseNumber",Default:40,PictForm:{Section:"PFLTabularSection",Group:"PFLTabularGroup",Row:2,Width:6,Min:0,Max:1e3}},"PictFlowLayoutEditor.Parameters.RowHeight":{Name:"Row height (auto = blank)",Hash:"RowHeight",DataType:"PreciseNumber",PictForm:{Section:"PFLTabularSection",Group:"PFLTabularGroup",Row:2,Width:6,Min:1,Max:5e3}},"PictFlowLayoutEditor.Parameters.OrderBy":{Name:"Order by",Hash:"OrderBy",DataType:"String",Default:"index",PictForm:{Section:"PFLTabularSection",Group:"PFLTabularGroup",Row:3,Width:12,InputType:"Option",SelectOptions:[{Value:"index",Name:"Index"},{Value:"hash",Name:"Hash"},{Value:"title",Name:"Title"}]}}}}}},{"./Layout-Coerce.js":28}],35:[function(t,e,o){const i=t("fable-serviceproviderbase");e.exports=class extends i{constructor(t,e,o){super(t,e,o),this.serviceType="PictServiceFlowConnectionHandleManager",this._FlowView=e&&e.FlowView?e.FlowView:null}updateConnectionHandle(t,e,o,i){if(!this._FlowView)return;let n=this._FlowView.getConnection(t);if(n){if(n.Data||(n.Data={}),n.Data.HandleCustomized=!0,e&&e.startsWith("bezier-handle-")){let r=parseInt(e.replace("bezier-handle-",""),10);return!isNaN(r)&&Array.isArray(n.Data.BezierHandles)&&r<n.Data.BezierHandles.length&&(n.Data.BezierHandles[r].x=o,n.Data.BezierHandles[r].y=i),void this._FlowView._renderSingleConnection(t)}switch(e){case"bezier-midpoint":Array.isArray(n.Data.BezierHandles)&&0!==n.Data.BezierHandles.length?(n.Data.BezierHandles[0].x=o,n.Data.BezierHandles[0].y=i):n.Data.BezierHandles=[{x:o,y:i}],n.Data.BezierHandleX=o,n.Data.BezierHandleY=i;break;case"ortho-corner1":n.Data.OrthoCorner1X=o,n.Data.OrthoCorner1Y=i;break;case"ortho-corner2":n.Data.OrthoCorner2X=o,n.Data.OrthoCorner2Y=i;break;case"ortho-midpoint":{let t=this._FlowView.getPortPosition(n.SourceNodeHash,n.SourcePortHash),e=this._FlowView.getPortPosition(n.TargetNodeHash,n.TargetPortHash);if(t&&e){let r=this._FlowView._ConnectionRenderer._computeDirectionalGeometry(t,e),a=r.startDir;if(Math.abs(a.dx)>Math.abs(a.dy)){let t=(r.departX+r.approachX)/2;n.Data.OrthoMidOffset=o-t}else{let t=(r.departY+r.approachY)/2;n.Data.OrthoMidOffset=i-t}}break}}this._FlowView._renderSingleConnection(t)}}addConnectionHandle(t,e,o){if(!this._FlowView)return;let i=this._FlowView.getConnection(t);if(!i)return;i.Data||(i.Data={}),Array.isArray(i.Data.BezierHandles)||(i.Data.BezierHandles=[],null!=i.Data.BezierHandleX&&null!=i.Data.BezierHandleY&&i.Data.BezierHandles.push({x:i.Data.BezierHandleX,y:i.Data.BezierHandleY})),i.Data.LineMode="bezier";let n=this._FlowView.getPortPosition(i.SourceNodeHash,i.SourcePortHash),r=this._FlowView.getPortPosition(i.TargetNodeHash,i.TargetPortHash),a=0;n&&r&&this._FlowView._ConnectionRenderer&&(a=this._FlowView._ConnectionRenderer.computeInsertionIndex(i.Data.BezierHandles,{x:e,y:o},n,r)),i.Data.BezierHandles.splice(a,0,{x:e,y:o}),i.Data.HandleCustomized=!0,this._FlowView.renderFlow(),this._FlowView.marshalFromView(),this._FlowView._EventHandlerProvider&&this._FlowView._EventHandlerProvider.fireEvent("onFlowChanged",this._FlowView._FlowData)}removeConnectionHandle(t,e){if(!this._FlowView)return;let o=this._FlowView.getConnection(t);o&&o.Data&&Array.isArray(o.Data.BezierHandles)&&(e<0||e>=o.Data.BezierHandles.length||(o.Data.BezierHandles.splice(e,1),0===o.Data.BezierHandles.length&&(o.Data.HandleCustomized=!1,o.Data.BezierHandleX=null,o.Data.BezierHandleY=null),this._FlowView.renderFlow(),this._FlowView.marshalFromView(),this._FlowView._EventHandlerProvider&&this._FlowView._EventHandlerProvider.fireEvent("onFlowChanged",this._FlowView._FlowData)))}resetHandlesForNode(t){if(this._FlowView){for(let e=0;e<this._FlowView._FlowData.Connections.length;e++){let o=this._FlowView._FlowData.Connections[e];o.SourceNodeHash!==t&&o.TargetNodeHash!==t||o.Data&&o.Data.HandleCustomized&&(o.Data.HandleCustomized=!1,o.Data.BezierHandles=[],o.Data.BezierHandleX=null,o.Data.BezierHandleY=null,o.Data.OrthoCorner1X=null,o.Data.OrthoCorner1Y=null,o.Data.OrthoCorner2X=null,o.Data.OrthoCorner2Y=null,o.Data.OrthoMidOffset=0)}this._FlowView._TetherService&&this._FlowView._TetherService.resetHandlesForNode(this._FlowView._FlowData.OpenPanels,t)}}resetHandlesForPanel(t){if(!this._FlowView)return;let e=this._FlowView._FlowData.OpenPanels.find(e=>e.Hash===t);e&&this._FlowView._TetherService&&this._FlowView._TetherService.resetHandlePositions(e)}}},{"fable-serviceproviderbase":53}],36:[function(t,e,o){const i=t("fable-serviceproviderbase"),n=t("../providers/edges/Edge-PerimeterMath.js"),r={"event-in":"#3498db","event-out":"#2ecc71",setting:"#e67e22",value:"#f1c40f",error:"#e74c3c"};e.exports=class extends i{constructor(t,e,o){super(t,e,o),this.serviceType="PictServiceFlowConnectionRenderer",this._FlowView=e&&e.FlowView?e.FlowView:null}renderConnection(t,e,o){if(!this._FlowView)return;let i=this._FlowView.getPortPosition(t.SourceNodeHash,t.SourcePortHash),n=this._FlowView.getPortPosition(t.TargetNodeHash,t.TargetPortHash),r=i,a=n,l=this._resolveAttachmentsViaEdgeTheme(t,i,n);l.source&&(i=l.source),l.target&&(n=l.target);let s=null,c=this._FlowView.getNode(t.SourceNodeHash);if(c&&c.Ports)for(let e=0;e<c.Ports.length;e++)if(c.Ports[e].Hash===t.SourcePortHash){s=c.Ports[e].PortType||null;break}if(!i||!n)return;let d=t.Data||{},h=this._generatePathViaEdgeTheme(t,i,n,d);this._FlowView._ThemeProvider&&(h=this._FlowView._ThemeProvider.processPathString(h,t.Hash));let p=null;if(this._FlowView._ThemeProvider){let t=this._FlowView._ThemeProvider.getActiveTheme();t&&t.ConnectionConfig&&t.ConnectionConfig.StrokeDashArray&&(p=t.ConnectionConfig.StrokeDashArray)}let u,w=this._FlowView.options.ViewIdentifier,f=s?" conn-type-"+s:"";u=o?"flow-arrowhead-selected-"+w:s?"flow-arrowhead-"+s+"-"+w:"flow-arrowhead-"+w;let g=this._FlowView._ConnectorShapesProvider;if(g){let i=g.createConnectionHitAreaElement(h,t.Hash);e.appendChild(i);let n=g.createConnectionPathElement(h,t.Hash,o,w);f&&n.setAttribute("class",(n.getAttribute("class")||"")+f),n.setAttribute("marker-end","url(#"+u+")"),p&&n.setAttribute("stroke-dasharray",p),e.appendChild(n)}else{let i=this._FlowView._SVGHelperProvider.createSVGElement("path");i.setAttribute("class","pict-flow-connection-hitarea"),i.setAttribute("d",h),i.setAttribute("data-connection-hash",t.Hash),i.setAttribute("data-element-type","connection-hitarea"),e.appendChild(i);let n=this._FlowView._SVGHelperProvider.createSVGElement("path");n.setAttribute("class","pict-flow-connection".concat(f," ").concat(o?"selected":"")),n.setAttribute("d",h),n.setAttribute("data-connection-hash",t.Hash),n.setAttribute("data-element-type","connection"),n.setAttribute("marker-end","url(#"+u+")"),p&&n.setAttribute("stroke-dasharray",p),e.appendChild(n)}let m=this._FlowView._EndpointsLayer||e;this._renderEndpointDots(t,m,i,n),this._FlowView._PortHintsLayer&&this._renderPortHints(t,this._FlowView._PortHintsLayer,r,i,a,n),o&&this._renderHandles(t,e,i,n)}_renderEndpointDots(t,e,o,i){let n=this._FlowView._ConnectorShapesProvider;if(!n)return;let r=this._FlowView.getNode(t.SourceNodeHash),a=this._FlowView.getNode(t.TargetNodeHash),l=this._findPort(r,t.SourcePortHash),s=this._findPort(a,t.TargetPortHash);if(l&&o){let i=n.createPortElement(l,o,t.SourceNodeHash);i.setAttribute("data-connection-hash",t.Hash),i.setAttribute("data-connection-end","source"),e.appendChild(i)}if(s&&i){let o=n.createPortElement(s,i,t.TargetNodeHash);o.setAttribute("data-connection-hash",t.Hash),o.setAttribute("data-connection-end","target"),e.appendChild(o)}}_renderPortHints(t,e,o,i,n,r){let a=function(t,e){return!(!t||!e)&&(Math.abs(t.x-e.x)>.5||Math.abs(t.y-e.y)>.5)},l=this._FlowView.getNode(t.SourceNodeHash),s=this._FlowView.getNode(t.TargetNodeHash),c=this._findPort(l,t.SourcePortHash),d=this._findPort(s,t.TargetPortHash);if(o&&a(o,i)){let n=this._chipEdgeAimingAt(c,o,i);e.appendChild(this._buildPortHintPath(n,i,t.SourceNodeHash,t.SourcePortHash,t.Hash,"source",this._hintColor(c,s)))}if(n&&a(n,r)){let o=this._chipEdgeAimingAt(d,n,r);e.appendChild(this._buildPortHintPath(o,r,t.TargetNodeHash,t.TargetPortHash,t.Hash,"target",this._hintColor(d,l)))}}_chipBoundsFor(t,e){if(!t||!e)return null;let o=e.side||t.Side||("input"===t.Direction?"left":"right"),i=t.Label||"";if(""===i)return null;let n,r,a=10+5*i.length+5+2;if(0===o.indexOf("left"))n=e.x+a/2+1,r=e.y;else if(0===o.indexOf("right"))n=e.x-a/2-1,r=e.y;else if(0===o.indexOf("top"))n=e.x,r=e.y+6+1;else{if(0!==o.indexOf("bottom"))return null;n=e.x,r=e.y-6-1}return{X:n-a/2,Y:r-6,Width:a,Height:12}}_chipEdgeAimingAt(t,e,o){let i=this._chipBoundsFor(t,e);if(!i)return e;let r=n.resolvePerimeterAttachment({Node:i,OtherDefaultPosition:o});return r||e}_resolveNodeIdentityColor(t){if(!t)return null;if(t.TitleBarColor)return t.TitleBarColor;if(t.BodyStyle&&t.BodyStyle.stroke)return t.BodyStyle.stroke;let e=this._FlowView?this._FlowView._NodeTypeProvider:null;if(e&&"function"==typeof e.getNodeType&&t.Type){let o=e.getNodeType(t.Type);if(o){if(o.TitleBarColor)return o.TitleBarColor;if(o.BodyStyle&&o.BodyStyle.stroke)return o.BodyStyle.stroke}}return null}_hintColor(t,e){let o=this._resolveNodeIdentityColor(e);return o||(t&&t.PortType&&r[t.PortType]?r[t.PortType]:t&&"input"===t.Direction?r["event-in"]:t&&"output"===t.Direction?r["event-out"]:"#95a5a6")}_buildPortHintPath(t,e,o,i,n,r,a){let l=this._FlowView._SVGHelperProvider.createSVGElement("path"),s=e.x-t.x,c=e.y-t.y,d=Math.sqrt(s*s+c*c),h=Math.min(60,.35*d),p=d>0?-c/d:0,u=d>0?s/d:0,w=t.x+.35*s+p*h*.3,f=t.y+.35*c+u*h*.3,g=t.x+.65*s+p*h*.3,m=t.y+.65*c+u*h*.3,b="M ".concat(t.x," ").concat(t.y," C ").concat(w," ").concat(f," ").concat(g," ").concat(m," ").concat(e.x," ").concat(e.y);return l.setAttribute("class","pict-flow-port-hint"),l.setAttribute("d",b),l.setAttribute("data-node-hash",o),l.setAttribute("data-port-hash",i),l.setAttribute("data-connection-hash",n),l.setAttribute("data-connection-end",r),a&&l.setAttribute("stroke",a),l}_computeDirectionalGeometry(t,e){return this._FlowView._PathGenerator.computeDirectionalGeometry(t,e)}_generateDirectionalPath(t,e){let o=this._computeDirectionalGeometry(t,e);return this._FlowView._PathGenerator.buildBezierPathString({x:t.x,y:t.y},{x:o.departX,y:o.departY},{x:o.cp1X,y:o.cp1Y},{x:o.cp2X,y:o.cp2Y},{x:o.approachX,y:o.approachY},{x:e.x,y:e.y})}_generatePathViaEdgeTheme(t,e,o,i){let n=this._FlowView?this._FlowView._LayoutService:null,r=n&&"function"==typeof n.resolveActiveEdgeTheme?n.resolveActiveEdgeTheme(t):null;if(!r||"function"!=typeof r.GeneratePath)return this._builtInPathFallback(e,o,i);let a={Source:e,Target:o,Connection:t,AllNodes:this._FlowView._FlowData?this._FlowView._FlowData.Nodes:[],AllConnections:this._FlowView._FlowData?this._FlowView._FlowData.Connections:[],FlowView:this._FlowView,Helpers:this._buildEdgeThemeHelpers(),Parameters:n.getMergedEdgeThemeParameters(r.Name,this._FlowView._FlowData&&this._FlowView._FlowData.EdgeThemeParameters||{})};try{let t=r.GeneratePath(a);return"string"!=typeof t||""===t?this._builtInPathFallback(e,o,i):t}catch(t){return this._FlowView.log.warn("PictServiceFlowConnectionRenderer edge theme '".concat(r.Name,"' threw: ").concat(t.message)),this._builtInPathFallback(e,o,i)}}_resolveAttachmentsViaEdgeTheme(t,e,o){let i={source:null,target:null},n=this._FlowView?this._FlowView._LayoutService:null,r=n&&"function"==typeof n.resolveActiveEdgeTheme?n.resolveActiveEdgeTheme(t):null;if(!r||"function"!=typeof r.ResolveAttachment)return i;let a=this._FlowView.getNode(t.SourceNodeHash),l=this._FlowView.getNode(t.TargetNodeHash),s=this._findPort(a,t.SourcePortHash),c=this._findPort(l,t.TargetPortHash),d=n.getMergedEdgeThemeParameters(r.Name,this._FlowView._FlowData&&this._FlowView._FlowData.EdgeThemeParameters||{}),h=null,p=null;try{h=r.ResolveAttachment({Node:a,Port:s,DefaultPosition:e,Connection:t,IsSource:!0,OtherNode:l,OtherPort:c,OtherDefaultPosition:o,AllNodes:this._FlowView._FlowData?this._FlowView._FlowData.Nodes:[],FlowView:this._FlowView,Parameters:d}),p=r.ResolveAttachment({Node:l,Port:c,DefaultPosition:o,Connection:t,IsSource:!1,OtherNode:a,OtherPort:s,OtherDefaultPosition:e,AllNodes:this._FlowView._FlowData?this._FlowView._FlowData.Nodes:[],FlowView:this._FlowView,Parameters:d})}catch(t){return this._FlowView.log.warn("PictServiceFlowConnectionRenderer edge theme '".concat(r.Name,"' ResolveAttachment threw: ").concat(t.message)),i}return{source:h||null,target:p||null}}_findPort(t,e){if(!t||!Array.isArray(t.Ports))return null;for(let o=0;o<t.Ports.length;o++)if(t.Ports[o].Hash===e)return t.Ports[o];return null}_buildEdgeThemeHelpers(){let t=this;return{generateBezier:function(e,o){return t._generateDirectionalPath(e,o)},generateMultiBezier:function(e,o,i){return t._generateMultiHandleBezierPath(e,o,i)},generateOrthogonal:function(e,o,i,n){return t._generateOrthogonalPath(e,o,i||null,n||0)},getBezierHandles:function(e){return t._getBezierHandles(e)}}}_builtInPathFallback(t,e,o){let i=o||{};if("orthogonal"===(i.LineMode||"bezier")){let o=null;return i.HandleCustomized&&null!=i.OrthoCorner1X&&(o={corner1:{x:i.OrthoCorner1X,y:i.OrthoCorner1Y},corner2:{x:i.OrthoCorner2X,y:i.OrthoCorner2Y}}),this._generateOrthogonalPath(t,e,o,i.OrthoMidOffset||0)}let n=this._getBezierHandles(i);return n.length>0?this._generateMultiHandleBezierPath(t,e,n):this._generateDirectionalPath(t,e)}_getBezierHandles(t){return t&&t.HandleCustomized?Array.isArray(t.BezierHandles)&&t.BezierHandles.length>0?t.BezierHandles:null!=t.BezierHandleX&&null!=t.BezierHandleY?[{x:t.BezierHandleX,y:t.BezierHandleY}]:[]:[]}_generateMultiHandleBezierPath(t,e,o){let i=this._computeDirectionalGeometry(t,e);return this._FlowView._PathGenerator.buildMultiBezierPathString({x:t.x,y:t.y},{x:i.departX,y:i.departY},o,{x:i.approachX,y:i.approachY},{x:e.x,y:e.y},i.startDir,i.endDir)}computeInsertionIndex(t,e,o,i){let n=this._computeDirectionalGeometry(o,i),r=[{x:n.departX,y:n.departY}];for(let e=0;e<t.length;e++)r.push(t[e]);r.push({x:n.approachX,y:n.approachY});let a=1/0,l=0;for(let t=0;t<r.length-1;t++){let o=this._distanceToSegment(e.x,e.y,r[t].x,r[t].y,r[t+1].x,r[t+1].y);o<a&&(a=o,l=t)}return l}_distanceToSegment(t,e,o,i,n,r){return this._FlowView._PathGenerator.distanceToSegment(t,e,o,i,n,r)}getAutoMidpoint(t,e){return this._FlowView._PathGenerator.getAutoMidpoint(t,e)}_generateOrthogonalPath(t,e,o,i){let n,r,a=this._FlowView._PathGenerator.computeDepartApproach(t,e,20);if(o&&o.corner1&&o.corner2)n=o.corner1,r=o.corner2;else{let t=this._FlowView._PathGenerator.computeAutoOrthogonalCorners(a.departX,a.departY,a.approachX,a.approachY,a.fromDir,a.toDir,i||0);n=t.corner1,r=t.corner2}return this._FlowView._PathGenerator.buildOrthogonalPathString({x:t.x,y:t.y},{x:a.departX,y:a.departY},n,r,{x:a.approachX,y:a.approachY},{x:e.x,y:e.y})}getOrthogonalGeometry(t,e,o){let i=this._FlowView._PathGenerator.computeDepartApproach(t,e,20);if(o&&o.HandleCustomized&&null!=o.OrthoCorner1X){let t={x:o.OrthoCorner1X,y:o.OrthoCorner1Y},e={x:o.OrthoCorner2X,y:o.OrthoCorner2Y};return{corner1:t,corner2:e,midpoint:{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}}return this._FlowView._PathGenerator.computeAutoOrthogonalCorners(i.departX,i.departY,i.approachX,i.approachY,i.fromDir,i.toDir,o&&o.OrthoMidOffset||0)}_renderHandles(t,e,o,i){let n=t.Data||{};if("orthogonal"===(n.LineMode||"bezier")){let r=this.getOrthogonalGeometry(o,i,n);this._createHandle(e,t.Hash,"ortho-corner1",r.corner1.x,r.corner1.y,"pict-flow-connection-handle"),this._createHandle(e,t.Hash,"ortho-midpoint",r.midpoint.x,r.midpoint.y,"pict-flow-connection-handle-midpoint"),this._createHandle(e,t.Hash,"ortho-corner2",r.corner2.x,r.corner2.y,"pict-flow-connection-handle")}else{let r=this._getBezierHandles(n);if(r.length>0)for(let o=0;o<r.length;o++)this._createHandle(e,t.Hash,"bezier-handle-"+o,r[o].x,r[o].y,"pict-flow-connection-handle");else{let n=this.getAutoMidpoint(o,i);this._createHandle(e,t.Hash,"bezier-midpoint",n.x,n.y,"pict-flow-connection-handle")}}}_createHandle(t,e,o,i,n,r){if(!this._FlowView._ConnectorShapesProvider)return;let a="pict-flow-connection-handle-midpoint"===r?"connection-handle-midpoint":"connection-handle";this._FlowView._ConnectorShapesProvider.createFullHandle(t,e,o,i,n,a,"connection-handle","data-connection-hash")}_generateBezierPath(t,e){let o={x:t.x,y:t.y,side:t.side||"right"},i={x:e.x,y:e.y,side:e.side||"left"};return this._generateDirectionalPath(o,i)}renderDragConnection(t,e,o,i,n,r){let a,l=this._generateDirectionalPath({x:t,y:e,side:r||"right"},{x:o,y:i,side:"left"}),s=this._FlowView._ConnectorShapesProvider;return s?a=s.createDragConnectionElement(l):(a=this._FlowView._SVGHelperProvider.createSVGElement("path"),a.setAttribute("class","pict-flow-drag-connection"),a.setAttribute("d",l)),n.appendChild(a),a}updateDragConnection(t,e,o,i,n,r){if(!t)return;let a=this._generateDirectionalPath({x:e,y:o,side:r||"right"},{x:i,y:n,side:"left"});t.setAttribute("d",a)}}},{"../providers/edges/Edge-PerimeterMath.js":25,"fable-serviceproviderbase":53}],37:[function(t,e,o){const i=t("fable-serviceproviderbase");e.exports=class extends i{constructor(t,e,o){super(t,e,o),this.serviceType="PictServiceFlowDataManager",this._FlowView=e&&e.FlowView?e.FlowView:null}marshalToView(){if(this._FlowView&&this._FlowView.options.FlowDataAddress){const t={Fable:this._FlowView.fable,Pict:this._FlowView.pict||this._FlowView.fable,AppData:this._FlowView.pict?this._FlowView.pict.AppData:this._FlowView.fable.AppData,Bundle:this._FlowView.Bundle,Options:this._FlowView.options};let e=this._FlowView.fable.manifest.getValueByHash(t,this._FlowView.options.FlowDataAddress);"object"==typeof e&&null!==e&&this.setFlowData(e)}}marshalFromView(){if(this._FlowView&&this._FlowView.options.FlowDataAddress){const t={Fable:this._FlowView.fable,Pict:this._FlowView.pict||this._FlowView.fable,AppData:this._FlowView.pict?this._FlowView.pict.AppData:this._FlowView.fable.AppData,Bundle:this._FlowView.Bundle,Options:this._FlowView.options};this._FlowView.fable.manifest.setValueByHash(t,this._FlowView.options.FlowDataAddress,JSON.parse(JSON.stringify(this._FlowView._FlowData)))}}getFlowData(){return this._FlowView?JSON.parse(JSON.stringify(this._FlowView._FlowData)):{}}setFlowData(t){if(!this._FlowView)return;if("object"!=typeof t||null===t)return void this._FlowView.log.warn("PictSectionFlow setFlowData received invalid data");let e=this._FlowView.options&&this._FlowView.options.DefaultLayoutAlgorithm||"Custom",o=this._FlowView.options&&this._FlowView.options.DefaultLayoutParameters||{},i=!(!this._FlowView.options||!this._FlowView.options.DefaultLayoutAutoApply),n=this._FlowView.options&&this._FlowView.options.DefaultEdgeTheme||null,r=this._FlowView.options&&this._FlowView.options.DefaultEdgeThemeParameters||{};this._FlowView._FlowData={Nodes:Array.isArray(t.Nodes)?t.Nodes:[],Connections:Array.isArray(t.Connections)?t.Connections:[],OpenPanels:Array.isArray(t.OpenPanels)?t.OpenPanels:[],SavedLayouts:Array.isArray(t.SavedLayouts)?t.SavedLayouts:[],ViewState:Object.assign({PanX:0,PanY:0,Zoom:1,SelectedNodeHash:null,SelectedConnectionHash:null,SelectedTetherHash:null},t.ViewState||{}),LayoutAlgorithm:"string"==typeof t.LayoutAlgorithm&&""!==t.LayoutAlgorithm?t.LayoutAlgorithm:e,LayoutParameters:t.LayoutParameters&&"object"==typeof t.LayoutParameters?JSON.parse(JSON.stringify(t.LayoutParameters)):JSON.parse(JSON.stringify(o)),LayoutAutoApply:"boolean"==typeof t.LayoutAutoApply?t.LayoutAutoApply:i,EdgeTheme:"string"==typeof t.EdgeTheme&&""!==t.EdgeTheme?t.EdgeTheme:n,EdgeThemeParameters:t.EdgeThemeParameters&&"object"==typeof t.EdgeThemeParameters?JSON.parse(JSON.stringify(t.EdgeThemeParameters)):JSON.parse(JSON.stringify(r))},this._FlowView._LayoutProvider&&this._FlowView._LayoutProvider.loadPersistedLayouts(),this._FlowView.initialRenderComplete&&this._FlowView.renderFlow()}addNode(t,e,o,i,n){if(!this._FlowView)return null;let r=t||this._FlowView.options.DefaultNodeType,a=this._FlowView._NodeTypeProvider.getNodeType(r),l={Hash:"node-".concat(this._FlowView.fable.getUUID()),Type:r,X:e||100,Y:o||100,Width:a&&a.DefaultWidth||this._FlowView.options.DefaultNodeWidth,Height:a&&a.DefaultHeight||this._FlowView.options.DefaultNodeHeight,Title:i||a&&a.Label||"New Node",Ports:a&&a.DefaultPorts?JSON.parse(JSON.stringify(a.DefaultPorts)):[{Hash:"port-in-".concat(this._FlowView.fable.getUUID()),Direction:"input",Side:"left",Label:"In"},{Hash:"port-out-".concat(this._FlowView.fable.getUUID()),Direction:"output",Side:"right",Label:"Out"}],Data:n||{}};for(let t=0;t<l.Ports.length;t++)l.Ports[t].Hash||(l.Ports[t].Hash="port-".concat(l.Ports[t].Direction,"-").concat(this._FlowView.fable.getUUID()));return this._FlowView._FlowData.Nodes.push(l),this._FlowView.renderFlow(),this.marshalFromView(),this._FlowView._EventHandlerProvider&&(this._FlowView._EventHandlerProvider.fireEvent("onNodeAdded",l),this._FlowView._EventHandlerProvider.fireEvent("onFlowChanged",this._FlowView._FlowData)),l}removeNode(t){if(!this._FlowView)return!1;let e=this._FlowView._FlowData.Nodes.findIndex(e=>e.Hash===t);if(e<0)return this._FlowView.log.warn("PictSectionFlow removeNode: node ".concat(t," not found")),!1;let o=this._FlowView._FlowData.Nodes.splice(e,1)[0];return this._FlowView._FlowData.Connections=this._FlowView._FlowData.Connections.filter(e=>e.SourceNodeHash!==t&&e.TargetNodeHash!==t),this._FlowView.closePanelForNode(t),this._FlowView._FlowData.ViewState.SelectedNodeHash===t&&(this._FlowView._FlowData.ViewState.SelectedNodeHash=null),this._FlowView.renderFlow(),this.marshalFromView(),this._FlowView._EventHandlerProvider&&(this._FlowView._EventHandlerProvider.fireEvent("onNodeRemoved",o),this._FlowView._EventHandlerProvider.fireEvent("onFlowChanged",this._FlowView._FlowData)),!0}addConnection(t,e,o,i,n){if(!this._FlowView)return!1;let r=this._FlowView._FlowData.Nodes.find(e=>e.Hash===t),a=this._FlowView._FlowData.Nodes.find(t=>t.Hash===o);if(!r||!a)return this._FlowView.log.warn("PictSectionFlow addConnection: source or target node not found"),!1;let l=r.Ports.find(t=>t.Hash===e),s=a.Ports.find(t=>t.Hash===i);if(!l||!s)return this._FlowView.log.warn("PictSectionFlow addConnection: source or target port not found"),!1;if(t===o)return this._FlowView.log.warn("PictSectionFlow addConnection: cannot connect a node to itself"),!1;if(this._FlowView._FlowData.Connections.find(n=>n.SourceNodeHash===t&&n.SourcePortHash===e&&n.TargetNodeHash===o&&n.TargetPortHash===i))return this._FlowView.log.warn("PictSectionFlow addConnection: duplicate connection"),!1;let c={Hash:"conn-".concat(this._FlowView.fable.getUUID()),SourceNodeHash:t,SourcePortHash:e,TargetNodeHash:o,TargetPortHash:i,Data:n||{}};return this._FlowView._FlowData.Connections.push(c),this._FlowView.renderFlow(),this.marshalFromView(),this._FlowView._EventHandlerProvider&&(this._FlowView._EventHandlerProvider.fireEvent("onConnectionCreated",c),this._FlowView._EventHandlerProvider.fireEvent("onFlowChanged",this._FlowView._FlowData)),c}removeConnection(t){if(!this._FlowView)return!1;let e=this._FlowView._FlowData.Connections.findIndex(e=>e.Hash===t);if(e<0)return this._FlowView.log.warn("PictSectionFlow removeConnection: connection ".concat(t," not found")),!1;let o=this._FlowView._FlowData.Connections.splice(e,1)[0];return this._FlowView._FlowData.ViewState.SelectedConnectionHash===t&&(this._FlowView._FlowData.ViewState.SelectedConnectionHash=null),this._FlowView.renderFlow(),this.marshalFromView(),this._FlowView._EventHandlerProvider&&(this._FlowView._EventHandlerProvider.fireEvent("onConnectionRemoved",o),this._FlowView._EventHandlerProvider.fireEvent("onFlowChanged",this._FlowView._FlowData)),!0}}},{"fable-serviceproviderbase":53}],38:[function(t,e,o){const i=t("fable-serviceproviderbase"),n={IDLE:"idle",DRAGGING_NODE:"dragging-node",DRAGGING_PANEL:"dragging-panel",DRAGGING_HANDLE:"dragging-handle",CONNECTING:"connecting",PANNING:"panning",RESIZING_PANEL:"resizing-panel"};e.exports=class extends i{constructor(t,e,o){super(t,e,o),this.serviceType="PictServiceFlowInteractionManager",this._FlowView=e&&e.FlowView?e.FlowView:null,this._SVGElement=null,this._ViewportElement=null,this._State=n.IDLE,this._DragNodeHash=null,this._DragStartX=0,this._DragStartY=0,this._DragNodeStartX=0,this._DragNodeStartY=0,this._DragPanelHash=null,this._DragPanelStartX=0,this._DragPanelStartY=0,this._DragPanelDataStartX=0,this._DragPanelDataStartY=0,this._DragHandleConnectionHash=null,this._DragHandlePanelHash=null,this._DragHandleType=null,this._DragHandleIsTether=!1,this._PanStartX=0,this._PanStartY=0,this._PanStartPanX=0,this._PanStartPanY=0,this._ConnectSourceNodeHash=null,this._ConnectSourcePortHash=null,this._ConnectDragLine=null,this._LastClickTime=0,this._LastClickNodeHash=null,this._DoubleClickThreshold=400,this._ResizePanelHash=null,this._ResizeStartY=0,this._ResizePanelStartHeight=0,this._LastConnectionClickTime=0,this._LastConnectionClickHash=null,this._LastTetherClickTime=0,this._LastTetherClickHash=null,this._LastHandleClickTime=0,this._LastHandleClickHash=null,this._LastHandleClickType=null,this._boundOnPointerDown=this._onPointerDown.bind(this),this._boundOnPointerMove=this._onPointerMove.bind(this),this._boundOnPointerUp=this._onPointerUp.bind(this),this._boundOnWheel=this._onWheel.bind(this),this._boundOnKeyDown=this._onKeyDown.bind(this)}initialize(t,e){this._SVGElement=t,this._ViewportElement=e,this._SVGElement&&(this._SVGElement.addEventListener("pointerdown",this._boundOnPointerDown),this._SVGElement.addEventListener("pointermove",this._boundOnPointerMove),this._SVGElement.addEventListener("pointerup",this._boundOnPointerUp),this._SVGElement.addEventListener("pointerleave",this._boundOnPointerUp),this._SVGElement.addEventListener("wheel",this._boundOnWheel,{passive:!1}),document.addEventListener("keydown",this._boundOnKeyDown),this._SVGElement.addEventListener("contextmenu",t=>{t.preventDefault();let e=t.target;switch(this._getElementType(e)){case"connection":case"connection-hitarea":this._addBezierHandle(e,t);break;case"connection-handle":this._removeBezierHandle(e);break;case"tether":case"tether-hitarea":this._addTetherBezierHandle(e,t);break;case"tether-handle":this._removeTetherBezierHandle(e)}}))}destroy(){this._SVGElement&&(this._SVGElement.removeEventListener("pointerdown",this._boundOnPointerDown),this._SVGElement.removeEventListener("pointermove",this._boundOnPointerMove),this._SVGElement.removeEventListener("pointerup",this._boundOnPointerUp),this._SVGElement.removeEventListener("pointerleave",this._boundOnPointerUp),this._SVGElement.removeEventListener("wheel",this._boundOnWheel)),document.removeEventListener("keydown",this._boundOnKeyDown)}_onPointerDown(t){if(!this._FlowView)return;let e=t.target,o=this._getElementType(e);if(!e.closest||!e.closest(".pict-flow-panel-content"))switch(0===t.button&&this._SVGElement.setPointerCapture(t.pointerId),o){case"port":this._startConnection(t,e);break;case"node":case"node-body":case"panel-indicator":{let o=this._getNodeHash(e),i=Date.now();o&&o===this._LastClickNodeHash&&i-this._LastClickTime<this._DoubleClickThreshold?(this._LastClickTime=0,this._LastClickNodeHash=null,this._FlowView.togglePanel(o)):(this._LastClickTime=i,this._LastClickNodeHash=o,this._startNodeDrag(t,e));break}case"panel-titlebar":this._startPanelDrag(t,e);break;case"panel-resize":this._startPanelResize(t,e);break;case"panel-close":{let t=this._getPanelHash(e);t&&this._FlowView.closePanel(t);break}case"connection-handle":{let o=this._getConnectionHash(e),i=e.getAttribute("data-handle-type"),n=Date.now();o===this._LastHandleClickHash&&i===this._LastHandleClickType&&n-this._LastHandleClickTime<this._DoubleClickThreshold?(this._toggleConnectionLineMode(o),this._LastHandleClickTime=0,this._LastHandleClickHash=null,this._LastHandleClickType=null):(this._LastHandleClickTime=n,this._LastHandleClickHash=o,this._LastHandleClickType=i,this._startHandleDrag(t,o,null,i,!1)),t.stopPropagation();break}case"tether":case"tether-hitarea":{let o=this._getPanelHash(e),i=Date.now();o&&o===this._LastTetherClickHash&&i-this._LastTetherClickTime<this._DoubleClickThreshold?(this._LastTetherClickTime=0,this._LastTetherClickHash=null,this._addTetherBezierHandle(e,t)):(this._LastTetherClickTime=i,this._LastTetherClickHash=o,this._selectTether(e));break}case"tether-handle":{let o=this._getPanelHash(e),i=e.getAttribute("data-handle-type"),n=Date.now();o===this._LastHandleClickHash&&i===this._LastHandleClickType&&n-this._LastHandleClickTime<this._DoubleClickThreshold?(this._toggleTetherLineMode(o),this._LastHandleClickTime=0,this._LastHandleClickHash=null,this._LastHandleClickType=null):(this._LastHandleClickTime=n,this._LastHandleClickHash=o,this._LastHandleClickType=i,this._startHandleDrag(t,null,o,i,!0)),t.stopPropagation();break}case"connection":case"connection-hitarea":{let o=this._getConnectionHash(e),i=Date.now();o&&o===this._LastConnectionClickHash&&i-this._LastConnectionClickTime<this._DoubleClickThreshold?(this._LastConnectionClickTime=0,this._LastConnectionClickHash=null,this._addBezierHandle(e,t)):(this._LastConnectionClickTime=i,this._LastConnectionClickHash=o,this._selectConnection(e));break}default:0===t.button&&this._FlowView.options.EnablePanning&&this._startPanning(t)}}_onPointerMove(t){if(this._FlowView)switch(this._State){case n.DRAGGING_NODE:this._onNodeDrag(t);break;case n.DRAGGING_PANEL:this._onPanelDrag(t);break;case n.DRAGGING_HANDLE:this._onHandleDrag(t);break;case n.CONNECTING:this._onConnectionDrag(t);break;case n.RESIZING_PANEL:this._onPanelResize(t);break;case n.PANNING:this._onPan(t)}}_onPointerUp(t){if(this._FlowView)switch(this._SVGElement.hasPointerCapture&&this._SVGElement.hasPointerCapture(t.pointerId)&&this._SVGElement.releasePointerCapture(t.pointerId),this._State){case n.DRAGGING_NODE:this._endNodeDrag(t);break;case n.DRAGGING_PANEL:this._endPanelDrag(t);break;case n.DRAGGING_HANDLE:this._endHandleDrag(t);break;case n.RESIZING_PANEL:this._endPanelResize(t);break;case n.CONNECTING:this._endConnection(t);break;case n.PANNING:this._endPanning(t)}}_onWheel(t){if(!this._FlowView||!this._FlowView.options.EnableZooming)return;t.preventDefault();let e=t.deltaY>0?-this._FlowView.options.ZoomStep:this._FlowView.options.ZoomStep,o=this._FlowView.viewState.Zoom+e,i=this._SVGElement.getBoundingClientRect(),n=t.clientX-i.left,r=t.clientY-i.top;this._FlowView.setZoom(o,n,r)}_onKeyDown(t){if(this._FlowView)if("Delete"===t.key||"Backspace"===t.key){if(t.target&&("INPUT"===t.target.tagName||"TEXTAREA"===t.target.tagName||"SELECT"===t.target.tagName))return;if(t.target&&t.target.closest&&t.target.closest(".pict-flow-panel"))return;this._FlowView.deleteSelected(),t.preventDefault()}else if("Escape"===t.key){if(this._State===n.CONNECTING&&this._cancelConnection(),this._FlowView._IsFullscreen){if(this._FlowView.exitFullscreen(),this._FlowView._ToolbarView){let t=this._FlowView.options.ViewIdentifier,e=this._FlowView.pict.ContentAssignment.getElement("#Flow-Toolbar-Fullscreen-".concat(t));e.length>0&&(e[0].innerHTML="⛶ Fullscreen")}return void t.preventDefault()}this._FlowView.deselectAll()}}_startNodeDrag(t,e){if(!this._FlowView.options.EnableNodeDragging)return;let o=this._getNodeHash(e);if(!o)return;this._FlowView.selectNode(o);let i=this._FlowView.getNode(o);if(!i)return;this._State=n.DRAGGING_NODE,this._DragNodeHash=o,this._DragStartX=t.clientX,this._DragStartY=t.clientY,this._DragNodeStartX=i.X,this._DragNodeStartY=i.Y,this._SVGElement.classList.add("panning");let r=this._FlowView._NodesLayer.querySelector('[data-node-hash="'.concat(o,'"]'));r&&r.classList.add("dragging")}_onNodeDrag(t){if(!this._DragNodeHash)return;let e=this._FlowView.viewState,o=(t.clientX-this._DragStartX)/e.Zoom,i=(t.clientY-this._DragStartY)/e.Zoom,n=this._DragNodeStartX+o,r=this._DragNodeStartY+i;this._FlowView.updateNodePosition(this._DragNodeHash,n,r)}_endNodeDrag(t){this._SVGElement.classList.remove("panning");let e=this._FlowView._NodesLayer.querySelector('[data-node-hash="'.concat(this._DragNodeHash,'"]'));e&&e.classList.remove("dragging"),this._FlowView.renderFlow(),this._FlowView.marshalFromView();let o=this._FlowView.getNode(this._DragNodeHash);o&&this._FlowView._EventHandlerProvider&&(this._FlowView._EventHandlerProvider.fireEvent("onNodeMoved",o),this._FlowView._EventHandlerProvider.fireEvent("onFlowChanged",this._FlowView.flowData)),this._State=n.IDLE,this._DragNodeHash=null}_startPanelDrag(t,e){let o=this._getPanelHash(e);if(!o)return;let i=this._FlowView._FlowData.OpenPanels.find(t=>t.Hash===o);i&&(this._State=n.DRAGGING_PANEL,this._DragPanelHash=o,this._DragPanelStartX=t.clientX,this._DragPanelStartY=t.clientY,this._DragPanelDataStartX=i.X,this._DragPanelDataStartY=i.Y,this._SVGElement.classList.add("panning"))}_onPanelDrag(t){if(!this._DragPanelHash)return;let e=this._FlowView.viewState,o=(t.clientX-this._DragPanelStartX)/e.Zoom,i=(t.clientY-this._DragPanelStartY)/e.Zoom,n=this._DragPanelDataStartX+o,r=this._DragPanelDataStartY+i;this._FlowView.updatePanelPosition(this._DragPanelHash,n,r)}_endPanelDrag(t){this._SVGElement.classList.remove("panning"),this._FlowView.marshalFromView();let e=this._FlowView._FlowData.OpenPanels.find(t=>t.Hash===this._DragPanelHash);e&&this._FlowView._EventHandlerProvider&&(this._FlowView._EventHandlerProvider.fireEvent("onPanelMoved",e),this._FlowView._EventHandlerProvider.fireEvent("onFlowChanged",this._FlowView.flowData)),this._State=n.IDLE,this._DragPanelHash=null}_startPanelResize(t,e){let o=this._getPanelHash(e);if(!o)return;let i=this._FlowView._FlowData.OpenPanels.find(t=>t.Hash===o);i&&(this._State=n.RESIZING_PANEL,this._ResizePanelHash=o,this._ResizeStartY=t.clientY,this._ResizePanelStartHeight=i.Height,this._SVGElement.classList.add("panning"))}_onPanelResize(t){if(!this._ResizePanelHash)return;let e=this._FlowView.viewState,o=(t.clientY-this._ResizeStartY)/e.Zoom,i=Math.max(120,this._ResizePanelStartHeight+o),n=this._FlowView._FlowData.OpenPanels.find(t=>t.Hash===this._ResizePanelHash);if(n&&(n.Height=i),this._FlowView._PanelsLayer){let t=this._FlowView._PanelsLayer.querySelector('[data-panel-hash="'+this._ResizePanelHash+'"]');t&&t.setAttribute("height",String(i))}}_endPanelResize(t){this._SVGElement.classList.remove("panning"),this._FlowView.renderFlow(),this._FlowView.marshalFromView(),this._FlowView._EventHandlerProvider&&this._FlowView._EventHandlerProvider.fireEvent("onFlowChanged",this._FlowView.flowData),this._State=n.IDLE,this._ResizePanelHash=null}_startHandleDrag(t,e,o,i,r){this._State=n.DRAGGING_HANDLE,this._DragHandleConnectionHash=e,this._DragHandlePanelHash=o,this._DragHandleType=i,this._DragHandleIsTether=r,this._DragStartX=t.clientX,this._DragStartY=t.clientY,this._SVGElement.classList.add("panning")}_onHandleDrag(t){let e=this._FlowView.screenToSVGCoords(t.clientX,t.clientY);this._DragHandleIsTether?this._FlowView.updateTetherHandle(this._DragHandlePanelHash,this._DragHandleType,e.x,e.y):this._FlowView.updateConnectionHandle(this._DragHandleConnectionHash,this._DragHandleType,e.x,e.y)}_endHandleDrag(t){if(this._SVGElement.classList.remove("panning"),this._FlowView.renderFlow(),this._FlowView.marshalFromView(),this._FlowView._EventHandlerProvider)if(this._FlowView._EventHandlerProvider.fireEvent("onFlowChanged",this._FlowView.flowData),this._DragHandleIsTether){let t=this._FlowView._FlowData.OpenPanels.find(t=>t.Hash===this._DragHandlePanelHash);t&&this._FlowView._EventHandlerProvider.fireEvent("onTetherHandleMoved",t)}else{let t=this._FlowView.getConnection(this._DragHandleConnectionHash);t&&this._FlowView._EventHandlerProvider.fireEvent("onConnectionHandleMoved",t)}this._State=n.IDLE,this._DragHandleConnectionHash=null,this._DragHandlePanelHash=null,this._DragHandleType=null,this._DragHandleIsTether=!1}_addBezierHandle(t,e){let o=this._getConnectionHash(t);if(!o)return;this._FlowView.selectConnection(o);let i=this._FlowView.screenToSVGCoords(e.clientX,e.clientY);this._FlowView.addConnectionHandle(o,i.x,i.y)}_removeBezierHandle(t){let e=this._getConnectionHash(t);if(!e)return;let o=t.getAttribute("data-handle-type");if(!o||!o.startsWith("bezier-handle-"))return;let i=parseInt(o.replace("bezier-handle-",""),10);isNaN(i)||this._FlowView.removeConnectionHandle(e,i)}_addTetherBezierHandle(t,e){let o=this._getPanelHash(t);if(!o)return;this._FlowView.selectTether(o);let i=this._FlowView.screenToSVGCoords(e.clientX,e.clientY);this._FlowView.addTetherHandle(o,i.x,i.y)}_removeTetherBezierHandle(t){let e=this._getPanelHash(t);if(!e)return;let o=t.getAttribute("data-handle-type");if(!o||!o.startsWith("bezier-handle-"))return;let i=parseInt(o.replace("bezier-handle-",""),10);isNaN(i)||this._FlowView.removeTetherHandle(e,i)}_toggleConnectionLineMode(t){let e=this._FlowView.getConnection(t);if(!e)return;e.Data||(e.Data={});let o=e.Data.LineMode||"bezier";e.Data.LineMode="bezier"===o?"orthogonal":"bezier",e.Data.HandleCustomized=!1,e.Data.BezierHandles=[],e.Data.BezierHandleX=null,e.Data.BezierHandleY=null,e.Data.OrthoCorner1X=null,e.Data.OrthoCorner1Y=null,e.Data.OrthoCorner2X=null,e.Data.OrthoCorner2Y=null,e.Data.OrthoMidOffset=0,this._FlowView.renderFlow(),this._FlowView.marshalFromView(),this._FlowView._EventHandlerProvider&&(this._FlowView._EventHandlerProvider.fireEvent("onConnectionModeChanged",e),this._FlowView._EventHandlerProvider.fireEvent("onFlowChanged",this._FlowView.flowData))}_toggleTetherLineMode(t){let e=this._FlowView._FlowData.OpenPanels.find(e=>e.Hash===t);e&&(this._FlowView._TetherService&&this._FlowView._TetherService.toggleLineMode(e),this._FlowView.renderFlow(),this._FlowView.marshalFromView(),this._FlowView._EventHandlerProvider&&(this._FlowView._EventHandlerProvider.fireEvent("onTetherModeChanged",e),this._FlowView._EventHandlerProvider.fireEvent("onFlowChanged",this._FlowView.flowData)))}_selectTether(t){let e=this._getPanelHash(t);e&&this._FlowView.selectTether(e)}_startConnection(t,e){if(!this._FlowView.options.EnableConnectionCreation)return;let o=e.getAttribute("data-node-hash"),i=e.getAttribute("data-port-hash"),r=e.getAttribute("data-port-direction");if(!o||!i)return;if("output"!==r)return;this._State=n.CONNECTING,this._ConnectSourceNodeHash=o,this._ConnectSourcePortHash=i,this._SVGElement.classList.add("connecting");let a=this._FlowView.getPortPosition(o,i);a&&(this._ConnectDragLine=document.createElementNS("http://www.w3.org/2000/svg","path"),this._ConnectDragLine.setAttribute("class","pict-flow-drag-connection"),this._ConnectDragLine.setAttribute("d","M ".concat(a.x," ").concat(a.y," L ").concat(a.x," ").concat(a.y)),this._FlowView._ViewportElement.appendChild(this._ConnectDragLine)),t.stopPropagation()}_onConnectionDrag(t){if(!this._ConnectDragLine)return;let e=this._FlowView.getPortPosition(this._ConnectSourceNodeHash,this._ConnectSourcePortHash);if(!e)return;let o=this._FlowView.screenToSVGCoords(t.clientX,t.clientY),i=.5*Math.abs(o.x-e.x),n="M ".concat(e.x," ").concat(e.y," C ").concat(e.x+i," ").concat(e.y,", ").concat(o.x-i," ").concat(o.y,", ").concat(o.x," ").concat(o.y);this._ConnectDragLine.setAttribute("d",n)}_endConnection(t){this._ConnectDragLine&&this._ConnectDragLine.parentNode&&this._ConnectDragLine.parentNode.removeChild(this._ConnectDragLine),this._ConnectDragLine=null,this._SVGElement.classList.remove("connecting");let e=document.elementFromPoint(t.clientX,t.clientY);if(e){let t=e.getAttribute("data-port-hash"),o=e.getAttribute("data-node-hash"),i=e.getAttribute("data-port-direction");t&&o&&"input"===i&&this._FlowView.addConnection(this._ConnectSourceNodeHash,this._ConnectSourcePortHash,o,t)}this._State=n.IDLE,this._ConnectSourceNodeHash=null,this._ConnectSourcePortHash=null}_cancelConnection(){this._ConnectDragLine&&this._ConnectDragLine.parentNode&&this._ConnectDragLine.parentNode.removeChild(this._ConnectDragLine),this._ConnectDragLine=null,this._SVGElement.classList.remove("connecting"),this._State=n.IDLE,this._ConnectSourceNodeHash=null,this._ConnectSourcePortHash=null}_startPanning(t){this._FlowView.deselectAll(),this._State=n.PANNING,this._PanStartX=t.clientX,this._PanStartY=t.clientY,this._PanStartPanX=this._FlowView.viewState.PanX,this._PanStartPanY=this._FlowView.viewState.PanY,this._SVGElement.classList.add("panning")}_onPan(t){let e=t.clientX-this._PanStartX,o=t.clientY-this._PanStartY;this._FlowView.viewState.PanX=this._PanStartPanX+e,this._FlowView.viewState.PanY=this._PanStartPanY+o,this._FlowView.updateViewportTransform()}_endPanning(t){this._SVGElement.classList.remove("panning"),this._State=n.IDLE}_selectConnection(t){let e=this._getConnectionHash(t);e&&this._FlowView.selectConnection(e)}_getElementType(t){if(!t)return"background";let e=t.getAttribute?t.getAttribute("data-element-type"):null;if(e)return e;let o=t.parentElement,i=0;for(;o&&i<5;){if(e=o.getAttribute?o.getAttribute("data-element-type"):null,e)return e;o=o.parentElement,i++}return"background"}_getNodeHash(t){if(!t)return null;let e=t.getAttribute?t.getAttribute("data-node-hash"):null;if(e)return e;let o=t.parentElement,i=0;for(;o&&i<5;){if(e=o.getAttribute?o.getAttribute("data-node-hash"):null,e)return e;o=o.parentElement,i++}return null}_getPanelHash(t){if(!t)return null;let e=t.getAttribute?t.getAttribute("data-panel-hash"):null;if(e)return e;let o=t.parentElement,i=0;for(;o&&i<5;){if(e=o.getAttribute?o.getAttribute("data-panel-hash"):null,e)return e;o=o.parentElement,i++}return null}_getConnectionHash(t){if(!t)return null;let e=t.getAttribute?t.getAttribute("data-connection-hash"):null;if(e)return e;let o=t.parentElement,i=0;for(;o&&i<5;){if(e=o.getAttribute?o.getAttribute("data-connection-hash"):null,e)return e;o=o.parentElement,i++}return null}},e.exports.INTERACTION_STATES=n},{"fable-serviceproviderbase":53}],39:[function(t,e,o){const i=t("fable-serviceproviderbase"),n=t("../providers/layouts/Layout-Custom.js"),r=t("../providers/layouts/Layout-Layered.js"),a=t("../providers/layouts/Layout-ForcedFromCenter.js"),l=t("../providers/layouts/Layout-Grid.js"),s=t("../providers/layouts/Layout-Circular.js"),c=t("../providers/layouts/Layout-Tabular.js"),d=t("../providers/layouts/Layout-Columnar.js"),h=t("../providers/edges/Edge-Bezier.js"),p=t("../providers/edges/Edge-Orthogonal.js"),u=t("../providers/edges/Edge-Straight.js"),w=t("../providers/edges/Edge-OrthogonalSnap.js"),f=t("../providers/edges/Edge-Perimeter.js"),g=t("../providers/edges/Edge-Perimeter-Linear.js"),m=t("../providers/edges/Edge-Perimeter-Orthogonal.js"),b=[n,r,a,l,s,c,d],y=[h,p,u,w,f,g,m],v="Layered";e.exports=class extends i{constructor(t,e,o){super(t,e,o),this.serviceType="PictServiceFlowLayout",this._FlowView=e&&e.FlowView?e.FlowView:null,this._HorizontalSpacing=250,this._VerticalSpacing=120,this._StartX=100,this._StartY=100,this._Algorithms={},this._EdgeThemes={};for(let t=0;t<b.length;t++)this.registerAlgorithm(b[t]);for(let t=0;t<y.length;t++)this.registerEdgeTheme(y[t])}registerAlgorithm(t){return t&&"object"==typeof t?"string"!=typeof t.Name||""===t.Name?(this.log.warn("PictServiceFlowLayout registerAlgorithm: descriptor.Name is required"),!1):"function"!=typeof t.Apply?(this.log.warn("PictServiceFlowLayout registerAlgorithm: descriptor.Apply for '".concat(t.Name,"' must be a function")),!1):(this._Algorithms[t.Name]=t,!0):(this.log.warn("PictServiceFlowLayout registerAlgorithm: descriptor must be an object"),!1)}getAlgorithm(t){return this._Algorithms[t]||null}getAlgorithmNames(){return Object.keys(this._Algorithms)}listAlgorithms(){let t=Object.keys(this._Algorithms),e=[];for(let o=0;o<t.length;o++)e.push(this._Algorithms[t[o]]);return e}getMergedParameters(t,e){let o=this.getAlgorithm(t);return o?Object.assign({},o.DefaultParameters||{},e||{}):Object.assign({},e||{})}registerEdgeTheme(t){return t&&"object"==typeof t?"string"!=typeof t.Name||""===t.Name?(this.log.warn("PictServiceFlowLayout registerEdgeTheme: descriptor.Name is required"),!1):"function"!=typeof t.GeneratePath?(this.log.warn("PictServiceFlowLayout registerEdgeTheme: descriptor.GeneratePath for '".concat(t.Name,"' must be a function")),!1):(this._EdgeThemes[t.Name]=t,!0):(this.log.warn("PictServiceFlowLayout registerEdgeTheme: descriptor must be an object"),!1)}getEdgeTheme(t){return this._EdgeThemes[t]||null}getEdgeThemeNames(){return Object.keys(this._EdgeThemes)}listEdgeThemes(){let t=Object.keys(this._EdgeThemes),e=[];for(let o=0;o<t.length;o++)e.push(this._EdgeThemes[t[o]]);return e}resolveActiveEdgeTheme(t){let e=t&&t.Data||{},o=this._FlowView,i=o?o._FlowData:null;if(e.EdgeTheme){let t=this.getEdgeTheme(e.EdgeTheme);if(t)return t}if("orthogonal"===e.LineMode&&!e.EdgeTheme){let t=this.getEdgeTheme("Orthogonal");if(t)return t}if(i&&i.EdgeTheme){let t=this.getEdgeTheme(i.EdgeTheme);if(t)return t}if(i&&i.LayoutAlgorithm){let t=this.getAlgorithm(i.LayoutAlgorithm);if(t&&t.DefaultEdgeTheme){let e=this.getEdgeTheme(t.DefaultEdgeTheme);if(e)return e}}return this.getEdgeTheme("Bezier")}getMergedEdgeThemeParameters(t,e){let o=this.getEdgeTheme(t);return o?Object.assign({},o.DefaultParameters||{},e||{}):Object.assign({},e||{})}applyLayout(t,e,o,i){let n=this.getAlgorithm(o);if(!n&&(this.log.warn("PictServiceFlowLayout applyLayout: unknown algorithm '".concat(o,"', falling back to '").concat(v,"'")),n=this.getAlgorithm(v),!n))return;let r=Object.assign({},n.DefaultParameters||{},i||{});n.Apply(t,e,r)}autoLayout(t,e,o,i){if(!t||0===t.length)return;let n="string"==typeof o&&""!==o?o:v;this.applyLayout(t,e,n,i)}snapToGrid(t,e){return!e||e<=0?t:Math.round(t/e)*e}autoLayoutSubset(t,e,o){if(!t||0===t.length)return;let i=this._StartX,n=this._StartY;if(e&&e.length>0){let t=-1/0;for(let o=0;o<e.length;o++){let i=e[o].X+(e[o].Width||180);i>t&&(t=i)}i=t+this._HorizontalSpacing}let r={};for(let e=0;e<t.length;e++)r[t[e].Hash]=!0;let a={},l={},s={};for(let e=0;e<t.length;e++){let o=t[e];a[o.Hash]=o,l[o.Hash]=0,s[o.Hash]=[]}for(let t=0;t<o.length;t++){let e=o[t],i=r[e.SourceNodeHash],n=r[e.TargetNodeHash];i&&n&&(l[e.TargetNodeHash]++,s[e.SourceNodeHash].push(e.TargetNodeHash))}let c=[],d=[],h={};for(let t in l)0===l[t]&&d.push(t);for(;d.length>0;){let t=[],e=[];for(let o=0;o<d.length;o++){let i=d[o];if(h[i])continue;h[i]=!0,t.push(i);let n=s[i]||[];for(let t=0;t<n.length;t++){let o=n[t];l[o]--,l[o]<=0&&!h[o]&&e.push(o)}}t.length>0&&c.push(t),d=e}let p=[];for(let e=0;e<t.length;e++)h[t[e].Hash]||p.push(t[e].Hash);p.length>0&&c.push(p);let u=i;for(let t=0;t<c.length;t++){let e=c[t],o=0,i=n;for(let t=0;t<e.length;t++){let n=a[e[t]];if(!n)continue;n.X=u,n.Y=i;let r=n.Width||180,l=n.Height||80;o=Math.max(o,r),i+=l+this._VerticalSpacing}u+=o+this._HorizontalSpacing}}centerNodes(t,e,o){if(!t||0===t.length)return;let i=1/0,n=1/0,r=-1/0,a=-1/0;for(let e=0;e<t.length;e++)i=Math.min(i,t[e].X),n=Math.min(n,t[e].Y),r=Math.max(r,t[e].X+(t[e].Width||180)),a=Math.max(a,t[e].Y+(t[e].Height||80));let l=e-(i+r)/2,s=o-(n+a)/2;for(let e=0;e<t.length;e++)t[e].X+=l,t[e].Y+=s}}},{"../providers/edges/Edge-Bezier.js":19,"../providers/edges/Edge-Orthogonal.js":20,"../providers/edges/Edge-OrthogonalSnap.js":21,"../providers/edges/Edge-Perimeter-Linear.js":22,"../providers/edges/Edge-Perimeter-Orthogonal.js":23,"../providers/edges/Edge-Perimeter.js":24,"../providers/edges/Edge-Straight.js":26,"../providers/layouts/Layout-Circular.js":27,"../providers/layouts/Layout-Columnar.js":29,"../providers/layouts/Layout-Custom.js":30,"../providers/layouts/Layout-ForcedFromCenter.js":31,"../providers/layouts/Layout-Grid.js":32,"../providers/layouts/Layout-Layered.js":33,"../providers/layouts/Layout-Tabular.js":34,"fable-serviceproviderbase":53}],40:[function(t,e,o){const i=t("fable-serviceproviderbase");e.exports=class extends i{constructor(t,e,o){super(t,e,o),this.serviceType="PictServiceFlowPanelManager",this._FlowView=e&&e.FlowView?e.FlowView:null}openPanel(t){let e=this._FlowView.getNode(t);if(!e)return!1;let o=this._FlowView._NodeTypeProvider.getNodeType(e.Type);if(!o)return!1;let i=this._FlowView._FlowData.OpenPanels.find(e=>e.NodeHash===t);if(i)return i;let n,r,a,l,s=o.PropertiesPanel,c="panel-".concat(this.fable.getUUID());s?(n=s.DefaultWidth||300,r=s.DefaultHeight||200,a=s.PanelType||"Base",l=s.Title||o.Label||"Properties"):(n=240,r=180,a="Info",l=o.Label||e.Title||"Node Info");let d={Hash:c,NodeHash:t,PanelType:a,Title:l,X:e.X+e.Width+30,Y:e.Y,Width:n,Height:r};return this._FlowView._FlowData.OpenPanels.push(d),this._FlowView.renderFlow(),this._FlowView.marshalFromView(),this._FlowView._EventHandlerProvider&&(this._FlowView._EventHandlerProvider.fireEvent("onPanelOpened",d),this._FlowView._EventHandlerProvider.fireEvent("onFlowChanged",this._FlowView._FlowData)),d}closePanel(t){let e=this._FlowView._FlowData.OpenPanels.findIndex(e=>e.Hash===t);if(e<0)return!1;let o=this._FlowView._FlowData.OpenPanels.splice(e,1)[0];return this._FlowView._PropertiesPanelView&&this._FlowView._PropertiesPanelView.destroyPanel(t),this._FlowView.renderFlow(),this._FlowView.marshalFromView(),this._FlowView._EventHandlerProvider&&(this._FlowView._EventHandlerProvider.fireEvent("onPanelClosed",o),this._FlowView._EventHandlerProvider.fireEvent("onFlowChanged",this._FlowView._FlowData)),!0}closePanelForNode(t){let e=this._FlowView._FlowData.OpenPanels.filter(e=>e.NodeHash===t);if(0===e.length)return!1;for(let t=0;t<e.length;t++){let o=this._FlowView._FlowData.OpenPanels.indexOf(e[t]);o>=0&&this._FlowView._FlowData.OpenPanels.splice(o,1),this._FlowView._PropertiesPanelView&&this._FlowView._PropertiesPanelView.destroyPanel(e[t].Hash)}return!0}togglePanel(t){let e=this._FlowView._FlowData.OpenPanels.find(e=>e.NodeHash===t);return e?(this.closePanel(e.Hash),!1):this.openPanel(t)}updatePanelPosition(t,e,o){let i=this._FlowView._FlowData.OpenPanels.find(e=>e.Hash===t);if(i){if(i.X=e,i.Y=o,this._FlowView._resetHandlesForPanel(t),this._FlowView._PanelsLayer){let i=this._FlowView._PanelsLayer.querySelector('[data-panel-hash="'.concat(t,'"]'));i&&(i.setAttribute("x",String(e)),i.setAttribute("y",String(o)))}this._FlowView._renderTethersForNode(i.NodeHash)}}}},{"fable-serviceproviderbase":53}],41:[function(t,e,o){const i=t("fable-serviceproviderbase");e.exports=class extends i{constructor(t,e,o){super(t,e,o),this.serviceType="PictServiceFlowPathGenerator",this._FlowView=e&&e.FlowView?e.FlowView:null}computeDepartApproach(t,e,o){let i=this._FlowView._GeometryProvider,n=i.sideDirection(t.side||"right"),r=i.sideDirection(e.side||"left");return{departX:t.x+n.dx*o,departY:t.y+n.dy*o,approachX:e.x+r.dx*o,approachY:e.y+r.dy*o,fromDir:n,toDir:r}}computeAutoOrthogonalCorners(t,e,o,i,n,r,a){let l,s,c,d=a||0,h=Math.abs(n.dx)>0,p=Math.abs(r.dx)>0;if(h&&p){let n=(t+o)/2+d;l={x:n,y:e},s={x:n,y:i},c={x:n,y:(e+i)/2}}else if(h||p)h&&!p?(l={x:o+d,y:e},s={x:o+d,y:i},c={x:o+d,y:(e+i)/2}):(l={x:t,y:i+d},s={x:o,y:i+d},c={x:(t+o)/2,y:i+d});else{let n=(e+i)/2+d;l={x:t,y:n},s={x:o,y:n},c={x:(t+o)/2,y:n}}return{corner1:l,corner2:s,midpoint:c}}evaluateCubicBezier(t,e,o,i,n){let r=1-n,a=r*r,l=a*r,s=n*n,c=s*n;return{x:l*t.x+3*a*n*e.x+3*r*s*o.x+c*i.x,y:l*t.y+3*a*n*e.y+3*r*s*o.y+c*i.y}}buildBezierPathString(t,e,o,i,n,r){return"M ".concat(t.x," ").concat(t.y," L ").concat(e.x," ").concat(e.y," C ").concat(o.x," ").concat(o.y,", ").concat(i.x," ").concat(i.y,", ").concat(n.x," ").concat(n.y," L ").concat(r.x," ").concat(r.y)}buildSplitBezierPathString(t,e,o,i,n,r,a,l,s){return"M ".concat(t.x," ").concat(t.y," L ").concat(e.x," ").concat(e.y," C ").concat(o.x," ").concat(o.y,", ").concat(i.x," ").concat(i.y,", ").concat(n.x," ").concat(n.y," C ").concat(r.x," ").concat(r.y,", ").concat(a.x," ").concat(a.y,", ").concat(l.x," ").concat(l.y," L ").concat(s.x," ").concat(s.y)}buildMultiBezierPathString(t,e,o,i,n,r,a){let l=[e];for(let t=0;t<o.length;t++)l.push(o[t]);l.push(i);let s="M ".concat(t.x," ").concat(t.y," L ").concat(e.x," ").concat(e.y);for(let t=0;t<l.length-1;t++){let e=l[t],o=l[t+1],i=o.x-e.x,n=o.y-e.y,c=Math.sqrt(i*i+n*n);c<1&&(c=1);let d,h,p,u,w=.35*c;if(0===t)d=r.dx,h=r.dy;else{let e=l[t-1],o=l[t+1];d=o.x-e.x,h=o.y-e.y;let i=Math.sqrt(d*d+h*h);i<1&&(i=1),d/=i,h/=i}if(t===l.length-2)p=-a.dx,u=-a.dy;else{let e=l[t],o=l[t+2];p=o.x-e.x,u=o.y-e.y;let i=Math.sqrt(p*p+u*u);i<1&&(i=1),p/=i,u/=i}let f=e.x+d*w,g=e.y+h*w,m=o.x-p*w,b=o.y-u*w;s+=" C ".concat(f," ").concat(g,", ").concat(m," ").concat(b,", ").concat(o.x," ").concat(o.y)}return s+=" L ".concat(n.x," ").concat(n.y),s}buildOrthogonalPathString(t,e,o,i,n,r){return"M ".concat(t.x," ").concat(t.y," L ").concat(e.x," ").concat(e.y," L ").concat(o.x," ").concat(o.y," L ").concat(i.x," ").concat(i.y," L ").concat(n.x," ").concat(n.y," L ").concat(r.x," ").concat(r.y)}computeDirectionalGeometry(t,e){let o,i=this._FlowView._GeometryProvider.sideDirection(t.side||"right"),n=this._FlowView._GeometryProvider.sideDirection(e.side||"left"),r=t.x+20*i.dx,a=t.y+20*i.dy,l=e.x+20*n.dx,s=e.y+20*n.dy,c=Math.abs(l-r),d=Math.abs(s-a),h=Math.sqrt(c*c+d*d),p=Math.max(Math.min(.4*h,180),30),u=0!==i.dx&&0!==n.dx||0!==i.dy&&0!==n.dy,w=!1;if(u&&(1===i.dx&&-1===n.dx&&e.x>=t.x||-1===i.dx&&1===n.dx&&e.x<=t.x||1===i.dy&&-1===n.dy&&e.y>=t.y||-1===i.dy&&1===n.dy&&e.y<=t.y)&&(w=!0),w){let t=0!==i.dx?c:d;o=Math.max(.35*t,30)}else o=u?Math.max(p,60):Math.max(.8*p,40);return{departX:r,departY:a,approachX:l,approachY:s,cp1X:r+i.dx*o,cp1Y:a+i.dy*o,cp2X:l+n.dx*o,cp2Y:s+n.dy*o,startDir:i,endDir:n}}distanceToSegment(t,e,o,i,n,r){let a=n-o,l=r-i,s=a*a+l*l;if(s<.001){let n=t-o,r=e-i;return Math.sqrt(n*n+r*r)}let c=((t-o)*a+(e-i)*l)/s;c<0&&(c=0),c>1&&(c=1);let d=t-(o+c*a),h=e-(i+c*l);return Math.sqrt(d*d+h*h)}getAutoMidpoint(t,e){let o=this.computeDirectionalGeometry(t,e);return this.evaluateCubicBezier({x:o.departX,y:o.departY},{x:o.cp1X,y:o.cp1Y},{x:o.cp2X,y:o.cp2Y},{x:o.approachX,y:o.approachY},.5)}getAutoMidpointSimple(t,e,o){let i=this.computeDepartApproach(t,e,o),n=Math.abs(i.approachX-i.departX),r=Math.abs(i.approachY-i.departY),a=.4*Math.max(n,r,40),l={x:i.departX,y:i.departY},s={x:i.departX+i.fromDir.dx*a,y:i.departY+i.fromDir.dy*a},c={x:i.approachX+i.toDir.dx*a,y:i.approachY+i.toDir.dy*a},d={x:i.approachX,y:i.approachY};return this.evaluateCubicBezier(l,s,c,d,.5)}}},{"fable-serviceproviderbase":53}],42:[function(t,e,o){const i=t("fable-serviceproviderbase");e.exports=class extends i{constructor(t,e,o){super(t,e,o),this.serviceType="PictServiceFlowPortRenderer",this._FlowView=e&&e.FlowView?e.FlowView:null}renderPorts(t,e,o,i,n,r){if(!this._FlowView)return;if(!t.Ports||!Array.isArray(t.Ports))return;n&&n.PortLabelsVertical,n&&n.PortLabelPadding,n&&n.PortLabelsOutside;let a=this._FlowView._GeometryProvider,l=this._collectConnectedPortHashes(t.Hash),s={};for(let e=0;e<t.Ports.length;e++){let o=t.Ports[e],i=o.Side||("input"===o.Direction?"left":"right");s[i]||(s[i]=[]),s[i].push(o)}let c={};for(let t in s)c[t]=s[t].length;for(let n in s){let d=s[n],h=a?a.getEdgeFromSide(n):n;for(let a=0;a<d.length;a++){let s=d[a],p=this.getPortLocalPosition(n,a,d.length,o,i,r,c),u=null;if(s.Label){let n,r,a,l,c,d,w,f,g,m,b={"event-in":"#3498db","event-out":"#2ecc71",setting:"#e67e22",value:"#f1c40f",error:"#e74c3c"},y=s.PortType&&b[s.PortType]||"#95a5a6",v=12,P=5,_=2,F=1,S=5,V=5*s.Label.length;"left"===h?(a=S+P+V+P+_,n=F,r=p.y-v/2,l=n+S+P,c="start",d=n+a-_,w=r,f=_,g=v,m="M "+n+" "+r+" L "+(n+a)+" "+r+" L "+(n+a)+" "+(r+v)+" L "+n+" "+(r+v)):"right"===h?(a=_+P+V+P+S,n=o-a-F,r=p.y-v/2,l=n+_+P,c="start",d=n,w=r,f=_,g=v,m="M "+(n+a)+" "+r+" L "+n+" "+r+" L "+n+" "+(r+v)+" L "+(n+a)+" "+(r+v)):"top"===h?(a=V+2*P,n=p.x-a/2,r=F,l=p.x,c="middle",d=n,w=r+v-_,f=a,g=_,m="M "+n+" "+r+" L "+n+" "+(r+v)+" L "+(n+a)+" "+(r+v)+" L "+(n+a)+" "+r):(a=V+2*P,n=p.x-a/2,r=i-v-F,l=p.x,c="middle",d=n,w=r,f=a,g=_,m="M "+n+" "+(r+v)+" L "+n+" "+r+" L "+(n+a)+" "+r+" L "+(n+a)+" "+(r+v));let C=this._FlowView._SVGHelperProvider.createSVGElement("g");C.setAttribute("class","pict-flow-port-badge"),C.setAttribute("data-port-hash",s.Hash),C.setAttribute("data-node-hash",t.Hash),this._wirePortHintHover(C,s.Hash,null);let T=this._FlowView._SVGHelperProvider.createSVGElement("rect");T.setAttribute("class","pict-flow-port-label-bg"),T.setAttribute("x",String(n)),T.setAttribute("y",String(r)),T.setAttribute("width",String(a)),T.setAttribute("height",String(v)),T.setAttribute("fill","var(--pf-port-label-bg, rgba(255, 253, 240, 0.5))"),C.appendChild(T);let x=this._FlowView._SVGHelperProvider.createSVGElement("path");x.setAttribute("class","pict-flow-port-label-bg"),x.setAttribute("d",m),x.setAttribute("fill","none"),x.setAttribute("stroke",y),x.setAttribute("stroke-width","0.75"),C.appendChild(x);let H=this._FlowView._SVGHelperProvider.createSVGElement("rect");H.setAttribute("class","pict-flow-port-label-bg"),H.setAttribute("x",String(d)),H.setAttribute("y",String(w)),H.setAttribute("width",String(f)),H.setAttribute("height",String(g)),H.setAttribute("fill",y),C.appendChild(H),e.appendChild(C),u=this._FlowView._SVGHelperProvider.createSVGElement("text"),u.setAttribute("class","pict-flow-port-label"),u.setAttribute("fill","var(--pf-port-label-text, #2c3e50)"),u.textContent=s.Label,u.setAttribute("x",String(l)),u.setAttribute("y",String(r+v/2)),u.setAttribute("text-anchor",c),u.setAttribute("dominant-baseline","central")}if(!l[s.Hash]){let o,i=this._FlowView._ConnectorShapesProvider;if(i)o=i.createPortElement(s,p,t.Hash);else{o=this._FlowView._SVGHelperProvider.createSVGElement("circle");let e="pict-flow-port ".concat(s.Direction);s.PortType&&(e+=" port-type-".concat(s.PortType)),o.setAttribute("class",e),o.setAttribute("cx",String(p.x)),o.setAttribute("cy",String(p.y)),o.setAttribute("r","5"),o.setAttribute("data-port-hash",s.Hash),o.setAttribute("data-node-hash",t.Hash),o.setAttribute("data-port-direction",s.Direction),s.PortType&&o.setAttribute("data-port-type",s.PortType),o.setAttribute("data-element-type","port")}e.appendChild(o)}u&&e.appendChild(u)}}}_wirePortHintHover(t,e,o){if(!t||"function"!=typeof t.addEventListener)return;let i=this._FlowView,n=e?'.pict-flow-port-hint[data-port-hash="'.concat(e,'"]'):'.pict-flow-port-hint[data-node-hash="'.concat(o,'"]');t.addEventListener("mouseenter",function(){let t=(i._SVGElement||document).querySelectorAll(n);for(let e=0;e<t.length;e++)t[e].setAttribute("data-active","true")}),t.addEventListener("mouseleave",function(){let t=(i._SVGElement||document).querySelectorAll(n);for(let e=0;e<t.length;e++)t[e].removeAttribute("data-active")})}_collectConnectedPortHashes(t){let e={};if(!this._FlowView||!this._FlowView._FlowData||!Array.isArray(this._FlowView._FlowData.Connections))return e;let o=this._FlowView._FlowData.Connections;for(let i=0;i<o.length;i++){let n=o[i];n.SourceNodeHash===t&&n.SourcePortHash&&(e[n.SourcePortHash]=!0),n.TargetNodeHash===t&&n.TargetPortHash&&(e[n.TargetPortHash]=!0)}return e}getPortLocalPosition(t,e,o,i,n,r,a){return this._FlowView._GeometryProvider.getPortLocalPosition(t,e,o,i,n,r,a)}}},{"fable-serviceproviderbase":53}],43:[function(t,e,o){const i=t("fable-serviceproviderbase");e.exports=class extends i{constructor(t,e,o){super(t,e,o),this.serviceType="PictServiceFlowRenderManager",this._FlowView=e&&e.FlowView?e.FlowView:null}renderFlow(){if(this._FlowView&&this._FlowView._NodesLayer&&this._FlowView._ConnectionsLayer){for(;this._FlowView._NodesLayer.firstChild;)this._FlowView._NodesLayer.removeChild(this._FlowView._NodesLayer.firstChild);for(;this._FlowView._ConnectionsLayer.firstChild;)this._FlowView._ConnectionsLayer.removeChild(this._FlowView._ConnectionsLayer.firstChild);if(this._FlowView._EndpointsLayer)for(;this._FlowView._EndpointsLayer.firstChild;)this._FlowView._EndpointsLayer.removeChild(this._FlowView._EndpointsLayer.firstChild);if(this._FlowView._PortHintsLayer)for(;this._FlowView._PortHintsLayer.firstChild;)this._FlowView._PortHintsLayer.removeChild(this._FlowView._PortHintsLayer.firstChild);for(let t=0;t<this._FlowView._FlowData.Connections.length;t++){let e=this._FlowView._FlowData.Connections[t],o=this._FlowView._FlowData.ViewState.SelectedConnectionHash===e.Hash;this._FlowView._ConnectionRenderer.renderConnection(e,this._FlowView._ConnectionsLayer,o)}for(let t=0;t<this._FlowView._FlowData.Nodes.length;t++){let e=this._FlowView._FlowData.Nodes[t],o=this._FlowView._FlowData.ViewState.SelectedNodeHash===e.Hash,i=this._FlowView._NodeTypeProvider.getNodeType(e.Type);if(i&&i.DefaultPorts&&e.Ports)for(let t=0;t<e.Ports.length;t++){let o=e.Ports[t];for(let t=0;t<i.DefaultPorts.length;t++){let e=i.DefaultPorts[t];if(e.Label===o.Label&&e.Direction===o.Direction){e.PortType&&(o.PortType=e.PortType),e.Side&&(o.Side=e.Side);break}}}this._FlowView._NodeView.renderNode(e,this._FlowView._NodesLayer,o,i)}this._FlowView._PropertiesPanelView&&this._FlowView._PanelsLayer&&this._FlowView._TethersLayer&&this._FlowView._PropertiesPanelView.renderPanels(this._FlowView._FlowData.OpenPanels,this._FlowView._PanelsLayer,this._FlowView._TethersLayer,this._FlowView._FlowData.ViewState.SelectedTetherHash),this._FlowView.updateViewportTransform()}}renderSingleConnection(t){if(!this._FlowView||!this._FlowView._ConnectionsLayer)return;this._removeConnectionElements(t);let e=this._FlowView.getConnection(t);if(!e)return;let o=this._FlowView._FlowData.ViewState.SelectedConnectionHash===t;this._FlowView._ConnectionRenderer.renderConnection(e,this._FlowView._ConnectionsLayer,o)}renderSingleTether(t){if(!this._FlowView||!this._FlowView._TethersLayer||!this._FlowView._TetherService)return;let e=this._FlowView._TethersLayer.querySelectorAll('[data-panel-hash="'.concat(t,'"]'));for(let t=0;t<e.length;t++)e[t].remove();let o=this._FlowView._FlowData.OpenPanels.find(e=>e.Hash===t);if(!o)return;let i=this._FlowView.getNode(o.NodeHash);if(!i)return;let n=this._FlowView._FlowData.ViewState.SelectedTetherHash===t;this._FlowView._TetherService.renderTether(o,i,this._FlowView._TethersLayer,n,this._FlowView.options.ViewIdentifier)}updateNodePosition(t,e,o){if(!this._FlowView)return;let i=this._FlowView.getNode(t);if(!i)return;this._FlowView.options.EnableGridSnap&&(e=this._FlowView._LayoutService.snapToGrid(e,this._FlowView.options.GridSnapSize),o=this._FlowView._LayoutService.snapToGrid(o,this._FlowView.options.GridSnapSize)),i.X=e,i.Y=o,this._FlowView._resetHandlesForNode(t);let n=this._FlowView._NodesLayer.querySelector('[data-node-hash="'.concat(t,'"]'));n&&n.setAttribute("transform","translate(".concat(e,", ").concat(o,")")),this.renderConnectionsForNode(t),this.renderTethersForNode(t)}renderConnectionsForNode(t){if(!this._FlowView||!this._FlowView._ConnectionsLayer)return;let e=this._FlowView._FlowData.Connections.filter(e=>e.SourceNodeHash===t||e.TargetNodeHash===t);for(let t=0;t<e.length;t++){let o=e[t],i=this._FlowView._FlowData.ViewState.SelectedConnectionHash===o.Hash;this._removeConnectionElements(o.Hash),this._FlowView._ConnectionRenderer.renderConnection(o,this._FlowView._ConnectionsLayer,i)}}_removeConnectionElements(t){let e=[this._FlowView._ConnectionsLayer,this._FlowView._EndpointsLayer,this._FlowView._PortHintsLayer];for(let o=0;o<e.length;o++){let i=e[o];if(!i)continue;let n=i.querySelectorAll('[data-connection-hash="'.concat(t,'"]'));for(let t=0;t<n.length;t++)n[t].remove()}}renderTethersForNode(t){if(!this._FlowView||!this._FlowView._TethersLayer||!this._FlowView._TetherService)return;let e=this._FlowView._FlowData.OpenPanels.filter(e=>e.NodeHash===t);if(0!==e.length)for(let t=0;t<e.length;t++){let o=this._FlowView._TethersLayer.querySelectorAll('[data-panel-hash="'.concat(e[t].Hash,'"]'));for(let t=0;t<o.length;t++)o[t].remove();let i=this._FlowView.getNode(e[t].NodeHash);if(!i)continue;let n=this._FlowView._FlowData.ViewState.SelectedTetherHash===e[t].Hash;this._FlowView._TetherService.renderTether(e[t],i,this._FlowView._TethersLayer,n,this._FlowView.options.ViewIdentifier)}}reinjectMarkerDefs(){if(!this._FlowView||!this._FlowView._ConnectorShapesProvider||!this._FlowView._SVGElement)return;let t=this._FlowView.options.ViewIdentifier,e=this._FlowView._SVGElement.querySelector("defs");if(!e)return;let o=e.querySelectorAll("marker");for(let t=0;t<o.length;t++)o[t].remove();let i=this._FlowView._ConnectorShapesProvider.generateMarkerDefs(t),n=document.createElementNS("http://www.w3.org/2000/svg","svg");for(n.innerHTML=i;n.firstChild;)e.appendChild(n.firstChild)}}},{"fable-serviceproviderbase":53}],44:[function(t,e,o){const i=t("fable-serviceproviderbase");e.exports=class extends i{constructor(t,e,o){super(t,e,o),this.serviceType="PictServiceFlowSelectionManager",this._FlowView=e&&e.FlowView?e.FlowView:null}selectNode(t){let e=this._FlowView._FlowData.ViewState.SelectedNodeHash;if(this._FlowView._FlowData.ViewState.SelectedNodeHash=t,this._FlowView._FlowData.ViewState.SelectedConnectionHash=null,this._FlowView._FlowData.ViewState.SelectedTetherHash=null,this._FlowView.renderFlow(),this._FlowView._EventHandlerProvider&&t!==e){let e=t?this._FlowView._FlowData.Nodes.find(e=>e.Hash===t):null;this._FlowView._EventHandlerProvider.fireEvent("onNodeSelected",e)}}selectConnection(t){let e=this._FlowView._FlowData.ViewState.SelectedConnectionHash;if(this._FlowView._FlowData.ViewState.SelectedConnectionHash=t,this._FlowView._FlowData.ViewState.SelectedNodeHash=null,this._FlowView._FlowData.ViewState.SelectedTetherHash=null,this._FlowView.renderFlow(),this._FlowView._EventHandlerProvider&&t!==e){let e=t?this._FlowView._FlowData.Connections.find(e=>e.Hash===t):null;this._FlowView._EventHandlerProvider.fireEvent("onConnectionSelected",e)}}selectTether(t){let e=this._FlowView._FlowData.ViewState.SelectedTetherHash;if(this._FlowView._FlowData.ViewState.SelectedTetherHash=t,this._FlowView._FlowData.ViewState.SelectedNodeHash=null,this._FlowView._FlowData.ViewState.SelectedConnectionHash=null,this._FlowView.renderFlow(),this._FlowView._EventHandlerProvider&&t!==e){let e=t?this._FlowView._FlowData.OpenPanels.find(e=>e.Hash===t):null;this._FlowView._EventHandlerProvider.fireEvent("onTetherSelected",e)}}deselectAll(){this._FlowView._FlowData.ViewState.SelectedNodeHash=null,this._FlowView._FlowData.ViewState.SelectedConnectionHash=null,this._FlowView._FlowData.ViewState.SelectedTetherHash=null,this._FlowView.renderFlow()}deleteSelected(){return this._FlowView._FlowData.ViewState.SelectedNodeHash?this._FlowView.removeNode(this._FlowView._FlowData.ViewState.SelectedNodeHash):!!this._FlowView._FlowData.ViewState.SelectedConnectionHash&&this._FlowView.removeConnection(this._FlowView._FlowData.ViewState.SelectedConnectionHash)}}},{"fable-serviceproviderbase":53}],45:[function(t,e,o){const i=t("fable-serviceproviderbase");e.exports=class extends i{constructor(t,e,o){super(t,e,o),this.serviceType="PictServiceFlowTether",this._FlowView=e&&e.FlowView?e.FlowView:null}getSmartAnchors(t,e){let o,i,n=e.X+e.Width/2,r=e.Y+e.Height/2,a=t.X+t.Width/2-n,l=t.Y+t.Height/2-r;Math.abs(a)>=Math.abs(l)?a>=0?(o="right",i="left"):(o="left",i="right"):l>=0?(o="bottom",i="top"):(o="top",i="bottom");let s=this._FlowView._GeometryProvider.getEdgeCenter(e,o),c=this._FlowView._GeometryProvider.getEdgeCenter(t,i);return{nodeAnchor:Object.assign(s,{side:o}),panelAnchor:Object.assign(c,{side:i})}}generateBezierPath(t,e,o,i){let n=this._FlowView._GeometryProvider.sideDirection(t.side),r=this._FlowView._GeometryProvider.sideDirection(e.side),a=t.x+20*n.dx,l=t.y+20*n.dy,s=e.x+20*r.dx,c=e.y+20*r.dy;if(null==o||null==i){let o=Math.abs(s-a),i=Math.abs(c-l),d=.4*Math.max(o,i,40),h=a+n.dx*d,p=l+n.dy*d,u=s+r.dx*d,w=c+r.dy*d;return this._FlowView._PathGenerator.buildBezierPathString({x:t.x,y:t.y},{x:a,y:l},{x:h,y:p},{x:u,y:w},{x:s,y:c},{x:e.x,y:e.y})}let d=a+30*n.dx,h=l+30*n.dy,p=s+30*r.dx,u=c+30*r.dy,w=s-a,f=c-l,g=Math.sqrt(w*w+f*f)||1;w/=g,f/=g;let m=o-25*w,b=i-25*f,y=o+25*w,v=i+25*f;return this._FlowView._PathGenerator.buildSplitBezierPathString({x:t.x,y:t.y},{x:a,y:l},{x:d,y:h},{x:m,y:b},{x:o,y:i},{x:y,y:v},{x:p,y:u},{x:s,y:c},{x:e.x,y:e.y})}generateOrthogonalPath(t,e,o,i){let n,r,a=this._FlowView._GeometryProvider.sideDirection(t.side),l=this._FlowView._GeometryProvider.sideDirection(e.side),s=t.x+20*a.dx,c=t.y+20*a.dy,d=e.x+20*l.dx,h=e.y+20*l.dy;if(o&&o.corner1&&o.corner2)n=o.corner1,r=o.corner2;else{let t=this._FlowView._PathGenerator.computeAutoOrthogonalCorners(s,c,d,h,a,l,i);n=t.corner1,r=t.corner2}return this._FlowView._PathGenerator.buildOrthogonalPathString({x:t.x,y:t.y},{x:s,y:c},{x:n.x,y:n.y},{x:r.x,y:r.y},{x:d,y:h},{x:e.x,y:e.y})}getAutoMidpoint(t,e){return this._FlowView._PathGenerator.getAutoMidpointSimple(t,e,20)}getOrthoGeometry(t,e,o){let i,n=this._FlowView._GeometryProvider.sideDirection(t.side),r=this._FlowView._GeometryProvider.sideDirection(e.side),a=t.x+20*n.dx,l=t.y+20*n.dy,s=e.x+20*r.dx,c=e.y+20*r.dy;o.TetherHandleCustomized&&null!=o.TetherOrthoCorner1X?(i=this._FlowView._PathGenerator.computeAutoOrthogonalCorners(a,l,s,c,n,r,o.TetherOrthoMidOffset||0),i.corner1={x:o.TetherOrthoCorner1X,y:o.TetherOrthoCorner1Y},i.corner2={x:o.TetherOrthoCorner2X,y:o.TetherOrthoCorner2Y}):i=this._FlowView._PathGenerator.computeAutoOrthogonalCorners(a,l,s,c,n,r,o.TetherOrthoMidOffset||0);let d={x:(i.corner1.x+i.corner2.x)/2,y:(i.corner1.y+i.corner2.y)/2};return{corner1:i.corner1,corner2:i.corner2,midpoint:d}}generatePath(t,e,o){if("orthogonal"===(t.TetherLineMode||"bezier")){let i=null;return t.TetherHandleCustomized&&null!=t.TetherOrthoCorner1X&&(i={corner1:{x:t.TetherOrthoCorner1X,y:t.TetherOrthoCorner1Y},corner2:{x:t.TetherOrthoCorner2X,y:t.TetherOrthoCorner2Y}}),this.generateOrthogonalPath(e,o,i,t.TetherOrthoMidOffset||0)}{let i=this._getTetherBezierHandles(t);if(i.length>0)return this.generateMultiBezierPath(e,o,i);let n=t.TetherHandleCustomized&&null!=t.TetherBezierHandleX?t.TetherBezierHandleX:null,r=t.TetherHandleCustomized&&null!=t.TetherBezierHandleY?t.TetherBezierHandleY:null;return this.generateBezierPath(e,o,n,r)}}_getTetherBezierHandles(t){return t&&t.TetherHandleCustomized?Array.isArray(t.TetherBezierHandles)&&t.TetherBezierHandles.length>0?t.TetherBezierHandles:null!=t.TetherBezierHandleX&&null!=t.TetherBezierHandleY?[{x:t.TetherBezierHandleX,y:t.TetherBezierHandleY}]:[]:[]}generateMultiBezierPath(t,e,o){let i=this._FlowView._GeometryProvider.sideDirection(t.side),n=this._FlowView._GeometryProvider.sideDirection(e.side),r={x:t.x+20*i.dx,y:t.y+20*i.dy},a={x:e.x+20*n.dx,y:e.y+20*n.dy};return this._FlowView._PathGenerator.buildMultiBezierPathString(t,r,t.side,a,e.side,e,o)}updateHandlePosition(t,e,o,i){if(t.TetherHandleCustomized=!0,e&&e.startsWith("bezier-handle-")){let n=parseInt(e.replace("bezier-handle-",""),10);return void(!isNaN(n)&&Array.isArray(t.TetherBezierHandles)&&n<t.TetherBezierHandles.length&&(t.TetherBezierHandles[n].x=o,t.TetherBezierHandles[n].y=i))}switch(e){case"bezier-midpoint":Array.isArray(t.TetherBezierHandles)&&0!==t.TetherBezierHandles.length?(t.TetherBezierHandles[0].x=o,t.TetherBezierHandles[0].y=i):t.TetherBezierHandles=[{x:o,y:i}],t.TetherBezierHandleX=o,t.TetherBezierHandleY=i;break;case"ortho-corner1":t.TetherOrthoCorner1X=o,t.TetherOrthoCorner1Y=i;break;case"ortho-corner2":t.TetherOrthoCorner2X=o,t.TetherOrthoCorner2Y=i;break;case"ortho-midpoint":t.TetherOrthoMidOffset=t.TetherOrthoMidOffset||0,t._TetherMidDragX=o,t._TetherMidDragY=i}}resetHandlePositions(t){t.TetherHandleCustomized&&(t.TetherHandleCustomized=!1,t.TetherBezierHandles=[],t.TetherBezierHandleX=null,t.TetherBezierHandleY=null,t.TetherOrthoCorner1X=null,t.TetherOrthoCorner1Y=null,t.TetherOrthoCorner2X=null,t.TetherOrthoCorner2Y=null,t.TetherOrthoMidOffset=0)}resetHandlesForNode(t,e){for(let o=0;o<t.length;o++){let i=t[o];i.NodeHash===e&&this.resetHandlePositions(i)}}addHandle(t,e,o,i,n){t.TetherLineMode="bezier",Array.isArray(t.TetherBezierHandles)||(t.TetherBezierHandles=[],null!=t.TetherBezierHandleX&&null!=t.TetherBezierHandleY&&t.TetherBezierHandles.push({x:t.TetherBezierHandleX,y:t.TetherBezierHandleY}));let r=0;this._FlowView._ConnectionRenderer&&i&&n&&(r=this._FlowView._ConnectionRenderer.computeInsertionIndex(t.TetherBezierHandles,{x:e,y:o},i,n)),t.TetherBezierHandles.splice(r,0,{x:e,y:o}),t.TetherHandleCustomized=!0}removeHandle(t,e){Array.isArray(t.TetherBezierHandles)&&(e<0||e>=t.TetherBezierHandles.length||(t.TetherBezierHandles.splice(e,1),0===t.TetherBezierHandles.length&&(t.TetherHandleCustomized=!1,t.TetherBezierHandleX=null,t.TetherBezierHandleY=null)))}toggleLineMode(t){let e=t.TetherLineMode||"bezier";return t.TetherLineMode="bezier"===e?"orthogonal":"bezier",t.TetherHandleCustomized=!1,t.TetherBezierHandles=[],t.TetherBezierHandleX=null,t.TetherBezierHandleY=null,t.TetherOrthoCorner1X=null,t.TetherOrthoCorner1Y=null,t.TetherOrthoCorner2X=null,t.TetherOrthoCorner2Y=null,t.TetherOrthoMidOffset=0,t.TetherLineMode}renderTether(t,e,o,i,n){if(!e)return;let r=this.getSmartAnchors(t,e),a=r.panelAnchor,l=r.nodeAnchor,s=this.generatePath(t,a,l),c=this._FlowView._ConnectorShapesProvider;if(c){let e=c.createTetherHitAreaElement(s,t.Hash);o.appendChild(e);let r=c.createTetherPathElement(s,t.Hash,i,n);o.appendChild(r)}else{let e=this._FlowView._SVGHelperProvider.createSVGElement("path");e.setAttribute("class","pict-flow-tether-hitarea"),e.setAttribute("d",s),e.setAttribute("data-element-type","tether-hitarea"),e.setAttribute("data-panel-hash",t.Hash),o.appendChild(e);let r=this._FlowView._SVGHelperProvider.createSVGElement("path");r.setAttribute("class","pict-flow-tether-line".concat(i?" selected":"")),r.setAttribute("d",s),r.setAttribute("marker-end","url(#flow-tether-arrowhead-".concat(n,")")),r.setAttribute("data-element-type","tether"),r.setAttribute("data-panel-hash",t.Hash),o.appendChild(r)}i&&this._renderHandles(t,o,a,l)}_renderHandles(t,e,o,i){if("orthogonal"===(t.TetherLineMode||"bezier")){let n=this.getOrthoGeometry(o,i,t);this._createHandle(e,t.Hash,"ortho-corner1",n.corner1.x,n.corner1.y,"pict-flow-tether-handle"),this._createHandle(e,t.Hash,"ortho-midpoint",n.midpoint.x,n.midpoint.y,"pict-flow-tether-handle-midpoint"),this._createHandle(e,t.Hash,"ortho-corner2",n.corner2.x,n.corner2.y,"pict-flow-tether-handle")}else{let n=this._getTetherBezierHandles(t);if(n.length>0)for(let o=0;o<n.length;o++)this._createHandle(e,t.Hash,"bezier-handle-"+o,n[o].x,n[o].y,"pict-flow-tether-handle");else{let n=this.getAutoMidpoint(o,i);this._createHandle(e,t.Hash,"bezier-midpoint",n.x,n.y,"pict-flow-tether-handle-midpoint")}}}_createHandle(t,e,o,i,n,r){if(!this._FlowView._ConnectorShapesProvider)return;let a="pict-flow-tether-handle-midpoint"===r?"tether-handle-midpoint":"tether-handle";this._FlowView._ConnectorShapesProvider.createFullHandle(t,e,o,i,n,a,"tether-handle","data-panel-hash")}}},{"fable-serviceproviderbase":53}],46:[function(t,e,o){const i=t("fable-serviceproviderbase");e.exports=class extends i{constructor(t,e,o){super(t,e,o),this.serviceType="PictServiceFlowViewportManager",this._FlowView=e&&e.FlowView?e.FlowView:null,this._IsFullscreen=!1}updateViewportTransform(){if(!this._FlowView._ViewportElement)return;let t=this._FlowView._FlowData.ViewState;this._FlowView._ViewportElement.setAttribute("transform","translate(".concat(t.PanX,", ").concat(t.PanY,") scale(").concat(t.Zoom,")"))}setZoom(t,e,o){let i=Math.max(this._FlowView.options.MinZoom,Math.min(this._FlowView.options.MaxZoom,t)),n=this._FlowView._FlowData.ViewState.Zoom;if("number"==typeof e&&"number"==typeof o){let t=this._FlowView._FlowData.ViewState;t.PanX=e-(e-t.PanX)*(i/n),t.PanY=o-(o-t.PanY)*(i/n)}this._FlowView._FlowData.ViewState.Zoom=i,this.updateViewportTransform()}zoomToFit(){if(0===this._FlowView._FlowData.Nodes.length)return;if(!this._FlowView._SVGElement)return;let t=1/0,e=1/0,o=-1/0,i=-1/0;for(let n=0;n<this._FlowView._FlowData.Nodes.length;n++){let r=this._FlowView._FlowData.Nodes[n];t=Math.min(t,r.X),e=Math.min(e,r.Y),o=Math.max(o,r.X+r.Width),i=Math.max(i,r.Y+r.Height)}let n=o-t+100,r=i-e+100,a=this._FlowView._SVGElement.getBoundingClientRect(),l=a.width/n,s=a.height/r,c=Math.min(l,s,1);c=Math.max(this._FlowView.options.MinZoom,Math.min(this._FlowView.options.MaxZoom,c));let d=(t+o)/2,h=(e+i)/2;this._FlowView._FlowData.ViewState.Zoom=c,this._FlowView._FlowData.ViewState.PanX=a.width/2-d*c,this._FlowView._FlowData.ViewState.PanY=a.height/2-h*c,this.updateViewportTransform()}screenToSVGCoords(t,e){if(!this._FlowView._SVGElement)return{x:t,y:e};let o=this._FlowView._SVGElement.createSVGPoint();o.x=t,o.y=e;let i=this._FlowView._SVGElement.getScreenCTM();if(i){let t=i.inverse(),e=o.matrixTransform(t),n=this._FlowView._FlowData.ViewState;return{x:(e.x-n.PanX)/n.Zoom,y:(e.y-n.PanY)/n.Zoom}}return{x:t,y:e}}toggleFullscreen(){let t=this._FlowView.options.ViewIdentifier,e=this._FlowView.pict.ContentAssignment.getElement("#Flow-Wrapper-".concat(t));if(e.length<1)return this._IsFullscreen;let o=e[0];return this._IsFullscreen=!this._IsFullscreen,this._IsFullscreen?o.classList.add("pict-flow-fullscreen"):o.classList.remove("pict-flow-fullscreen"),this._IsFullscreen}exitFullscreen(){if(!this._IsFullscreen)return;let t=this._FlowView.options.ViewIdentifier,e=this._FlowView.pict.ContentAssignment.getElement("#Flow-Wrapper-".concat(t));e.length>0&&e[0].classList.remove("pict-flow-fullscreen"),this._IsFullscreen=!1}}},{"fable-serviceproviderbase":53}],47:[function(t,e,o){const i=t("pict-view"),n={ViewIdentifier:"Flow-FloatingToolbar",DefaultRenderable:"Flow-FloatingToolbar-Content",DefaultDestinationAddress:"#Flow-FloatingToolbar-Container",AutoRender:!1,FlowViewIdentifier:"Pict-Flow",CSS:!1,Templates:[{Hash:"Flow-FloatingToolbar-Template",Template:'\n<div class="pict-flow-floating-toolbar" id="Flow-FloatingToolbar-{~D:Record.FlowViewIdentifier~}">\n\t<div class="pict-flow-floating-grip" id="Flow-FloatingGrip-{~D:Record.FlowViewIdentifier~}" title="Drag to move · Double-click to collapse">\n\t\t<span id="Flow-FloatingIcon-grip-{~D:Record.FlowViewIdentifier~}"></span>\n\t</div>\n\t<button class="pict-flow-floating-btn" data-flow-action="add-node" title="Add Node">\n\t\t<span id="Flow-FloatingIcon-plus-{~D:Record.FlowViewIdentifier~}"></span>\n\t</button>\n\t<button class="pict-flow-floating-btn" data-flow-action="cards-popup" title="Cards">\n\t\t<span id="Flow-FloatingIcon-cards-{~D:Record.FlowViewIdentifier~}"></span>\n\t</button>\n\t<button class="pict-flow-floating-btn" data-flow-action="delete-selected" title="Delete Selected">\n\t\t<span id="Flow-FloatingIcon-trash-{~D:Record.FlowViewIdentifier~}"></span>\n\t</button>\n\t<div class="pict-flow-floating-separator"></div>\n\t<button class="pict-flow-floating-btn" data-flow-action="zoom-in" title="Zoom In">\n\t\t<span id="Flow-FloatingIcon-zoom-in-{~D:Record.FlowViewIdentifier~}"></span>\n\t</button>\n\t<button class="pict-flow-floating-btn" data-flow-action="zoom-out" title="Zoom Out">\n\t\t<span id="Flow-FloatingIcon-zoom-out-{~D:Record.FlowViewIdentifier~}"></span>\n\t</button>\n\t<button class="pict-flow-floating-btn" data-flow-action="zoom-fit" title="Fit to View">\n\t\t<span id="Flow-FloatingIcon-zoom-fit-{~D:Record.FlowViewIdentifier~}"></span>\n\t</button>\n\t<div class="pict-flow-floating-separator"></div>\n\t<button class="pict-flow-floating-btn" data-flow-action="auto-layout" title="Auto Layout">\n\t\t<span id="Flow-FloatingIcon-auto-layout-{~D:Record.FlowViewIdentifier~}"></span>\n\t</button>\n\t<button class="pict-flow-floating-btn" data-flow-action="layout-popup" title="Layout">\n\t\t<span id="Flow-FloatingIcon-layout-{~D:Record.FlowViewIdentifier~}"></span>\n\t</button>\n\t<button class="pict-flow-floating-btn" data-flow-action="fullscreen" title="Toggle Fullscreen">\n\t\t<span id="Flow-FloatingIcon-fullscreen-{~D:Record.FlowViewIdentifier~}"></span>\n\t</button>\n\t<div class="pict-flow-floating-separator"></div>\n\t<button class="pict-flow-floating-btn" data-flow-action="dock-toolbar" title="Dock Toolbar">\n\t\t<span id="Flow-FloatingIcon-dock-{~D:Record.FlowViewIdentifier~}"></span>\n\t</button>\n</div>\n'}],Renderables:[{RenderableHash:"Flow-FloatingToolbar-Content",TemplateHash:"Flow-FloatingToolbar-Template",DestinationAddress:"#Flow-FloatingToolbar-Container",RenderMethod:"replace"}]};e.exports=class extends i{constructor(t,e,o){super(t,Object.assign({},JSON.parse(JSON.stringify(n)),e),o),this.serviceType="PictViewFlowFloatingToolbar",this._ToolbarView=null,this._FlowView=null,this._IsCollapsed=!1,this._IsDragging=!1,this._DragStartX=0,this._DragStartY=0,this._DragStartLeft=0,this._DragStartTop=0,this._BoundMouseMove=null,this._BoundMouseUp=null}render(t,e,o){return super.render(t,e,this.options)}onAfterRender(t,e,o,i){let n=this.options.FlowViewIdentifier,r=this.pict.ContentAssignment.getElement("#Flow-FloatingToolbar-".concat(n));r.length>0&&r[0].addEventListener("click",t=>{let e=t.target;if(!e)return;let o=e.closest("[data-flow-action]");if(!o)return;let i=o.getAttribute("data-flow-action");"dock-toolbar"!==i?this._ToolbarView&&this._ToolbarView._handleToolbarAction(i):this._ToolbarView&&this._ToolbarView._setToolbarMode("docked")});let a=this.pict.ContentAssignment.getElement("#Flow-FloatingGrip-".concat(n));if(a.length>0&&(a[0].addEventListener("mousedown",t=>{this._startDrag(t)}),a[0].addEventListener("dblclick",t=>{t.preventDefault(),t.stopPropagation(),this._toggleCollapse()})),this._populateIcons(),r.length>0){if(!1===this.options.EnableAddNode){let t=r[0].querySelector('[data-flow-action="add-node"]');t&&t.remove()}if(!1===this.options.EnableCardPalette){let t=r[0].querySelector('[data-flow-action="cards-popup"]');t&&t.remove()}}return super.onAfterRender(t,e,o,i)}_populateIcons(){let t=this._FlowView?this._FlowView._IconProvider:null;if(!t)return;let e=this.options.FlowViewIdentifier,o={grip:"grip",plus:"plus",trash:"trash","zoom-in":"zoom-in","zoom-out":"zoom-out","zoom-fit":"zoom-fit","auto-layout":"auto-layout",cards:"cards",layout:"layout",fullscreen:"fullscreen",dock:"dock"},i=Object.keys(o);for(let n=0;n<i.length;n++){let r="Flow-FloatingIcon-".concat(i[n],"-").concat(e),a=this.pict.ContentAssignment.getElement("#".concat(r));a.length>0&&(a[0].innerHTML=t.getIconSVGMarkup(o[i[n]],16))}}_toggleCollapse(){let t=this.options.FlowViewIdentifier,e=this.pict.ContentAssignment.getElement("#Flow-FloatingToolbar-".concat(t));e.length<1||(this._IsCollapsed=!this._IsCollapsed,this._IsCollapsed?e[0].classList.add("collapsed"):e[0].classList.remove("collapsed"))}_startDrag(t){t.preventDefault();let e=this.options.FlowViewIdentifier,o=this.pict.ContentAssignment.getElement("#Flow-FloatingToolbar-".concat(e));if(o.length<1)return;let i=o[0];this._IsDragging=!0,this._DragStartX=t.clientX,this._DragStartY=t.clientY,this._DragStartLeft=i.offsetLeft,this._DragStartTop=i.offsetTop,this._BoundMouseMove=t=>{this._onDragMove(t)},this._BoundMouseUp=()=>{this._onDragEnd()},document.addEventListener("mousemove",this._BoundMouseMove),document.addEventListener("mouseup",this._BoundMouseUp)}_onDragMove(t){if(!this._IsDragging)return;let e=this.options.FlowViewIdentifier,o=this.pict.ContentAssignment.getElement("#Flow-FloatingToolbar-".concat(e));if(o.length<1)return;let i=o[0],n=t.clientX-this._DragStartX,r=t.clientY-this._DragStartY,a=this._DragStartLeft+n,l=this._DragStartTop+r,s=i.parentElement;if(s){let t=s.clientWidth-i.offsetWidth,e=s.clientHeight-i.offsetHeight;a=Math.max(0,Math.min(a,t)),l=Math.max(0,Math.min(l,e))}i.style.left=a+"px",i.style.top=l+"px"}_onDragEnd(){if(this._IsDragging=!1,this._BoundMouseMove&&(document.removeEventListener("mousemove",this._BoundMouseMove),this._BoundMouseMove=null),this._BoundMouseUp&&(document.removeEventListener("mouseup",this._BoundMouseUp),this._BoundMouseUp=null),this._ToolbarView){let t=this.options.FlowViewIdentifier,e=this.pict.ContentAssignment.getElement("#Flow-FloatingToolbar-".concat(t));e.length>0&&(this._ToolbarView._FloatingPosition.X=e[0].offsetLeft,this._ToolbarView._FloatingPosition.Y=e[0].offsetTop)}}show(){let t=this.options.FlowViewIdentifier,e=this.pict.ContentAssignment.getElement("#Flow-FloatingToolbar-Container-".concat(t));e.length>0&&(e[0].style.display="block");let o=this.pict.ContentAssignment.getElement("#Flow-FloatingToolbar-".concat(t));o.length>0&&this._ToolbarView&&(o[0].style.left=this._ToolbarView._FloatingPosition.X+"px",o[0].style.top=this._ToolbarView._FloatingPosition.Y+"px"),this._IsCollapsed&&o.length>0&&(this._IsCollapsed=!1,o[0].classList.remove("collapsed"))}hide(){let t=this.options.FlowViewIdentifier,e=this.pict.ContentAssignment.getElement("#Flow-FloatingToolbar-Container-".concat(t));e.length>0&&(e[0].style.display="none")}},e.exports.default_configuration=n},{"pict-view":57}],48:[function(t,e,o){const i=t("pict-view"),n={ViewIdentifier:"Flow-NodeRenderer",AutoRender:!1,NodeTitleBarHeight:22};e.exports=class extends i{constructor(t,e,o){super(t,Object.assign({},JSON.parse(JSON.stringify(n)),e),o),this.serviceType="PictViewFlowNode",this._FlowView=null}renderNode(t,e,o,i){let n=this._FlowView._SVGHelperProvider.createSVGElement("g"),r="pict-flow-node ".concat(o?"selected":""," pict-flow-node-").concat(t.Type||"default");i&&(i.PortLabelsOnHover&&(r+=" pict-flow-node-port-labels-hover"),i.PortLabelsVertical&&(r+=" pict-flow-node-port-labels-vertical")),n.setAttribute("class",r),n.setAttribute("transform","translate(".concat(t.X,", ").concat(t.Y,")")),n.setAttribute("data-node-hash",t.Hash),n.setAttribute("data-element-type","node"),this._FlowView._PortRenderer&&"function"==typeof this._FlowView._PortRenderer._wirePortHintHover&&this._FlowView._PortRenderer._wirePortHintHover(n,null,t.Hash);let a=t.Width||180,l=t.Height||80,s=this.options.NodeTitleBarHeight,c=this._FlowView._GeometryProvider;if(c&&t.Ports&&t.Ports.length>0){let e=c.computeMinimumNodeHeight(t.Ports,s);e>l&&(l=e)}t.Width=a,t.Height=l;let d="rect";if(this._FlowView._ThemeProvider){let t=this._FlowView._ThemeProvider.getActiveTheme();t&&t.NodeBodyMode&&(d=t.NodeBodyMode)}"bracket"===d?this._renderBracketNodeBody(n,t,a,l,s,i):this._renderRectNodeBody(n,t,a,l,s,i);let h=!1,p=12;if(i&&i.CardMetadata){let t=i.CardMetadata,e=this._FlowView._IconProvider;(t.Icon||e)&&(h=!0)}let u=this._FlowView._SVGHelperProvider.createSVGElement("text");u.setAttribute("class","pict-flow-node-title"),h?(u.setAttribute("x",String(24)),u.setAttribute("text-anchor","start")):(u.setAttribute("x",String(a/2)),u.setAttribute("text-anchor","middle")),u.setAttribute("y",String(s/2+1)),u.setAttribute("dominant-baseline","central"),u.textContent=t.Title||"Untitled",n.appendChild(u);let w=!i||!1!==i.ShowTypeLabel,f=()=>{if(w&&i&&i.Label&&i.Label!==t.Title){let t=this._FlowView._SVGHelperProvider.createSVGElement("text");t.setAttribute("class","pict-flow-node-type-label"),t.setAttribute("x",String(a/2)),t.setAttribute("y",String(s+16)),t.setAttribute("text-anchor","middle"),t.setAttribute("dominant-baseline","central"),t.textContent=i.Label,n.appendChild(t)}if(i&&i.CardMetadata){let t=i.CardMetadata,e=this._FlowView._IconProvider,o=!1,r=8,c=(s-p)/2;if(t.Icon&&e&&!e.isEmojiIcon(t.Icon)){let i=e.resolveIconKey(t),a=e.renderIconIntoSVGGroup(i,n,r,c,p);a&&a.setAttribute("class",(a.getAttribute("class")||"")+" pict-flow-node-title-icon"),o=!0}else if(t.Icon&&e&&e.isEmojiIcon(t.Icon)){let e=this._FlowView._SVGHelperProvider.createSVGElement("text");e.setAttribute("class","pict-flow-node-card-icon pict-flow-node-title-icon-emoji"),e.setAttribute("font-size",String(p)),e.setAttribute("text-anchor","middle"),e.setAttribute("dominant-baseline","central"),e.setAttribute("pointer-events","none"),e.setAttribute("x",String(r+6)),e.setAttribute("y",String(s/2)),e.textContent=t.Icon,n.appendChild(e),o=!0}else if(t.Icon){let e=this._FlowView._SVGHelperProvider.createSVGElement("text");e.setAttribute("class","pict-flow-node-card-icon pict-flow-node-title-icon-emoji"),e.setAttribute("font-size",String(p)),e.setAttribute("text-anchor","middle"),e.setAttribute("dominant-baseline","central"),e.setAttribute("pointer-events","none"),e.setAttribute("x",String(r+6)),e.setAttribute("y",String(s/2)),e.textContent=t.Icon,n.appendChild(e),o=!0}if(!o&&e){let t=e.renderIconIntoSVGGroup("default",n,r,c,p);t&&t.setAttribute("class",(t.getAttribute("class")||"")+" pict-flow-node-title-icon")}let d=s+(l-s)/2;if(w&&t.Code){let e=this._FlowView._SVGHelperProvider.createSVGElement("text");e.setAttribute("class","pict-flow-node-card-code"),e.setAttribute("font-size","10"),e.setAttribute("font-family","monospace"),e.setAttribute("fill","#7f8c8d"),e.setAttribute("text-anchor","middle"),e.setAttribute("dominant-baseline","central"),e.setAttribute("pointer-events","none"),e.setAttribute("x",String(a/2)),e.setAttribute("y",String(d)),e.textContent=t.Code,n.appendChild(e)}if(t.Tooltip||t.Description){let e=this._FlowView._SVGHelperProvider.createSVGElement("title");e.textContent=t.Tooltip||t.Description,n.appendChild(e)}}};if(!i||!1!==i.LabelsInFront?(this._renderBodyContent(t,n,a,l,i),f(),this._renderPorts(t,n,a,l,i)):(f(),this._renderPorts(t,n,a,l,i),this._renderBodyContent(t,n,a,l,i)),i&&i.PropertiesPanel){let e,o=10,i=4,r=a-o-i,s=l-o-i,c=this._FlowView._ConnectorShapesProvider;c?e=c.createPanelIndicatorElement(t.Hash,r,s,o,o):(e=this._FlowView._SVGHelperProvider.createSVGElement("rect"),e.setAttribute("class","pict-flow-node-panel-indicator"),e.setAttribute("x",String(r)),e.setAttribute("y",String(s)),e.setAttribute("width",String(o)),e.setAttribute("height",String(o)),e.setAttribute("rx","2"),e.setAttribute("ry","2"),e.setAttribute("data-node-hash",t.Hash),e.setAttribute("data-element-type","panel-indicator"));let d=this._FlowView._SVGHelperProvider.createSVGElement("title");d.textContent="Double-click to open properties",e.appendChild(d),n.appendChild(e)}e.appendChild(n)}_renderPorts(t,e,o,i,n){this._FlowView._PortRenderer.renderPorts(t,e,o,i,n,this.options.NodeTitleBarHeight)}_renderBodyContent(t,e,o,i,n){if(!n||!n.BodyContent)return;let r=n.BodyContent,a=r.ContentType;if(!a)return;let l=this.options.NodeTitleBarHeight,s="number"==typeof r.Padding?r.Padding:2,c={x:s,y:l+s,width:o-2*s,height:i-l-2*s},d=this._FlowView.pict||this.pict;if(r.Templates&&Array.isArray(r.Templates)){this._registeredBodyTemplates||(this._registeredBodyTemplates=new Set);for(let t=0;t<r.Templates.length;t++){let e=r.Templates[t];e.Hash&&e.Template&&!this._registeredBodyTemplates.has(e.Hash)&&(d.TemplateProvider.addTemplate(e.Hash,e.Template,"PictViewFlowNode-BodyContent"),this._registeredBodyTemplates.add(e.Hash))}}switch(a){case"svg":this._renderBodyContentSVG(t,e,r,c,n,d);break;case"html":this._renderBodyContentHTML(t,e,r,c,n,d);break;case"canvas":this._renderBodyContentCanvas(t,e,r,c,n);break;default:this.log.warn("PictViewFlowNode _renderBodyContent: unknown ContentType ["+a+"]")}}_renderBodyContentSVG(t,e,o,i,n,r){let a=this._FlowView._SVGHelperProvider.createSVGElement("g");a.setAttribute("class","pict-flow-node-body-content"),a.setAttribute("transform","translate(".concat(i.x,", ").concat(i.y,")"));let l=this._resolveBodyTemplate(o,t,r);if(l){let t=document.createElementNS("http://www.w3.org/2000/svg","svg");for(t.innerHTML=l;t.firstChild;)a.appendChild(t.firstChild)}"function"==typeof o.RenderCallback&&o.RenderCallback(a,t,n,i),e.appendChild(a)}_renderBodyContentHTML(t,e,o,i,n,r){let a=this._FlowView._SVGHelperProvider.createSVGElement("foreignObject");a.setAttribute("class","pict-flow-node-body-content-fo"),a.setAttribute("x",String(i.x)),a.setAttribute("y",String(i.y)),a.setAttribute("width",String(i.width)),a.setAttribute("height",String(i.height));let l=document.createElement("div");l.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),l.setAttribute("class","pict-flow-node-body-content-html"),l.addEventListener("pointerdown",t=>{t.stopPropagation()}),l.addEventListener("wheel",t=>{t.stopPropagation()});let s=this._resolveBodyTemplate(o,t,r);s&&(l.innerHTML=s),"function"==typeof o.RenderCallback&&o.RenderCallback(l,t,n,i),a.appendChild(l),e.appendChild(a)}_renderBodyContentCanvas(t,e,o,i,n){let r=this._FlowView._SVGHelperProvider.createSVGElement("foreignObject");r.setAttribute("class","pict-flow-node-body-content-fo"),r.setAttribute("x",String(i.x)),r.setAttribute("y",String(i.y)),r.setAttribute("width",String(i.width)),r.setAttribute("height",String(i.height));let a=document.createElement("canvas");a.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),a.setAttribute("class","pict-flow-node-body-content-canvas"),a.width=Math.floor(i.width),a.height=Math.floor(i.height),a.style.width="100%",a.style.height="100%",a.addEventListener("pointerdown",t=>{t.stopPropagation()}),a.addEventListener("wheel",t=>{t.stopPropagation()}),"function"==typeof o.RenderCallback&&o.RenderCallback(a,t,n,i),r.appendChild(a),e.appendChild(r)}_resolveBodyTemplate(t,e,o){return t.TemplateHash?o.parseTemplateByHash(t.TemplateHash,e):t.Template?o.parseTemplate(t.Template,e,null,[e]):null}_renderRectNodeBody(t,e,o,i,n,r){let a=this._FlowView._SVGHelperProvider.createSVGElement("rect");if(a.setAttribute("class","pict-flow-node-body"),a.setAttribute("x","0"),a.setAttribute("y","0"),a.setAttribute("width",String(o)),a.setAttribute("height",String(i)),a.setAttribute("data-node-hash",e.Hash),a.setAttribute("data-element-type","node-body"),r&&r.BodyStyle)for(let t in r.BodyStyle)a.setAttribute(t,r.BodyStyle[t]);if(e.BodyStyle)for(let t in e.BodyStyle)a.setAttribute(t,e.BodyStyle[t]);if(e.Style){let t=[];e.Style.BodyFill&&t.push("fill:"+e.Style.BodyFill),e.Style.BodyStroke&&t.push("stroke:"+e.Style.BodyStroke),e.Style.BodyStrokeWidth&&t.push("stroke-width:"+e.Style.BodyStrokeWidth),t.length>0&&a.setAttribute("style",t.join(";"))}t.appendChild(a);let l=this._FlowView._SVGHelperProvider.createSVGElement("rect");l.setAttribute("class","pict-flow-node-title-bar"),l.setAttribute("x","0"),l.setAttribute("y","0"),l.setAttribute("width",String(o)),l.setAttribute("height",String(n)),l.setAttribute("data-node-hash",e.Hash),l.setAttribute("data-element-type","node-body"),r&&r.TitleBarColor&&l.setAttribute("fill",r.TitleBarColor),e.TitleBarColor&&l.setAttribute("fill",e.TitleBarColor),t.appendChild(l);let s=this._FlowView._SVGHelperProvider.createSVGElement("rect");s.setAttribute("class","pict-flow-node-title-bar-bottom"),s.setAttribute("x","0"),s.setAttribute("y",String(n-8)),s.setAttribute("width",String(o)),s.setAttribute("height","8"),s.setAttribute("data-node-hash",e.Hash),s.setAttribute("data-element-type","node-body"),r&&r.TitleBarColor&&s.setAttribute("fill",r.TitleBarColor),e.TitleBarColor&&s.setAttribute("fill",e.TitleBarColor),e.Style&&e.Style.TitleBarColor&&(l.setAttribute("style","fill:"+e.Style.TitleBarColor),s.setAttribute("style","fill:"+e.Style.TitleBarColor)),t.appendChild(s)}_renderBracketNodeBody(t,e,o,i,n,r){let a=this._FlowView._SVGHelperProvider.createSVGElement("rect");if(a.setAttribute("class","pict-flow-node-body pict-flow-node-bracket-fill"),a.setAttribute("x","0"),a.setAttribute("y","0"),a.setAttribute("width",String(o)),a.setAttribute("height",String(i)),a.setAttribute("data-node-hash",e.Hash),a.setAttribute("data-element-type","node-body"),e.Style){let t=[];e.Style.BodyFill&&t.push("fill:"+e.Style.BodyFill),t.length>0&&a.setAttribute("style",t.join(";"))}t.appendChild(a);let l=this._FlowView._SVGHelperProvider.createSVGElement("rect");l.setAttribute("class","pict-flow-node-title-bar pict-flow-node-bracket-title-fill"),l.setAttribute("x","0"),l.setAttribute("y","0"),l.setAttribute("width",String(o)),l.setAttribute("height",String(n)),l.setAttribute("data-node-hash",e.Hash),l.setAttribute("data-element-type","node-body"),r&&r.TitleBarColor&&l.setAttribute("style","fill:"+r.TitleBarColor),e.Style&&e.Style.TitleBarColor&&l.setAttribute("style","fill:"+e.Style.TitleBarColor),t.appendChild(l);let s={SerifLength:6,TitleSeparator:!0};if(this._FlowView._ThemeProvider){let t=this._FlowView._ThemeProvider.getActiveTheme();t&&t.BracketConfig&&(s=Object.assign(s,t.BracketConfig))}let c=0;this._FlowView._ThemeProvider&&(c=this._FlowView._ThemeProvider.getNodeNoiseAmplitude());let d="";this._FlowView._NoiseProvider&&(d=this._FlowView._NoiseProvider.generateBracketPath(o,i,s.SerifLength,s.TitleSeparator?n:0,c,e.Hash));let h=this._FlowView._SVGHelperProvider.createSVGElement("path");if(h.setAttribute("class","pict-flow-node-bracket"),h.setAttribute("d",d),h.setAttribute("data-node-hash",e.Hash),h.setAttribute("data-element-type","node-body"),e.Style){let t=[];e.Style.BodyStroke&&t.push("stroke:"+e.Style.BodyStroke),e.Style.BodyStrokeWidth&&t.push("stroke-width:"+e.Style.BodyStrokeWidth),t.length>0&&h.setAttribute("style",t.join(";"))}t.appendChild(h)}},e.exports.default_configuration=n},{"pict-view":57}],49:[function(t,e,o){const i=t("pict-view"),n={ViewIdentifier:"Flow-PropertiesPanel",AutoRender:!1,Templates:[{Hash:"Flow-InfoPanel-Wrapper",Template:'<div class="pict-flow-info-panel">{~D:Record.PanelContent~}</div>'},{Hash:"Flow-InfoPanel-Header-Icon",Template:'<div class="pict-flow-info-panel-header with-icon">{~D:Record.Icon~} {~D:Record.Label~}</div>'},{Hash:"Flow-InfoPanel-Header",Template:'<div class="pict-flow-info-panel-header">{~D:Record.Label~}</div>'},{Hash:"Flow-InfoPanel-Description",Template:'<div class="pict-flow-info-panel-description">{~D:Record.Description~}</div>'},{Hash:"Flow-InfoPanel-Badges",Template:'<div class="pict-flow-info-panel-badges">{~D:Record.BadgesContent~}</div>'},{Hash:"Flow-InfoPanel-Badge-Category",Template:'<span class="pict-flow-info-panel-badge category">{~D:Record.Category~}</span>'},{Hash:"Flow-InfoPanel-Badge-Code",Template:'<span class="pict-flow-info-panel-badge code">{~D:Record.Code~}</span>'},{Hash:"Flow-InfoPanel-Section-Inputs",Template:'<div class="pict-flow-info-panel-section"><div class="pict-flow-info-panel-section-title">Inputs</div>{~D:Record.PortsContent~}</div>'},{Hash:"Flow-InfoPanel-Section-Outputs",Template:'<div class="pict-flow-info-panel-section"><div class="pict-flow-info-panel-section-title">Outputs</div>{~D:Record.PortsContent~}</div>'},{Hash:"Flow-InfoPanel-Port-Input",Template:'<div class="pict-flow-info-panel-port input">{~D:Record.Label~}{~D:Record.Constraint~}</div>'},{Hash:"Flow-InfoPanel-Port-Output",Template:'<div class="pict-flow-info-panel-port output">{~D:Record.Label~}</div>'},{Hash:"Flow-InfoPanel-Port-Constraint",Template:' <span class="pict-flow-info-panel-port-constraint">{~D:Record.ConstraintText~}</span>'},{Hash:"Flow-InfoPanel-Section-Generic",Template:'<div class="pict-flow-info-panel-section"><div class="pict-flow-info-panel-section-title">{~D:Record.SectionTitle~}</div>{~D:Record.PortsContent~}</div>'},{Hash:"Flow-InfoPanel-Port-Event",Template:'<div class="pict-flow-info-panel-port event">{~D:Record.Label~}</div>'},{Hash:"Flow-InfoPanel-Port-Value",Template:'<div class="pict-flow-info-panel-port value">{~D:Record.Label~}{~D:Record.DataType~}</div>'},{Hash:"Flow-InfoPanel-Port-DataType",Template:' <span class="pict-flow-info-panel-port-constraint">{~D:Record.DataTypeText~}</span>'},{Hash:"Flow-NodeProps-Editor",Template:'<div class="pict-flow-node-props-fields"><div class="pict-flow-node-props-field"><label class="pict-flow-node-props-label">Title</label><input type="text" class="pict-flow-node-props-input" data-prop="Title" value="{~D:Record.Title~}" /></div><div class="pict-flow-node-props-field"><label class="pict-flow-node-props-label">Width</label><input type="number" class="pict-flow-node-props-input" data-prop="Width" value="{~D:Record.Width~}" min="60" step="10" /></div><div class="pict-flow-node-props-field"><label class="pict-flow-node-props-label">Height</label><input type="number" class="pict-flow-node-props-input" data-prop="Height" value="{~D:Record.Height~}" min="40" step="10" /></div><div class="pict-flow-node-props-field"><label class="pict-flow-node-props-label">Body Fill</label><input type="color" class="pict-flow-node-props-input pict-flow-node-props-color" data-prop="Style.BodyFill" value="{~D:Record.BodyFillValue~}" /></div><div class="pict-flow-node-props-field"><label class="pict-flow-node-props-label">Body Stroke</label><input type="color" class="pict-flow-node-props-input pict-flow-node-props-color" data-prop="Style.BodyStroke" value="{~D:Record.BodyStrokeValue~}" /></div><div class="pict-flow-node-props-field"><label class="pict-flow-node-props-label">Stroke Width</label><input type="number" class="pict-flow-node-props-input" data-prop="Style.BodyStrokeWidth" value="{~D:Record.BodyStrokeWidthValue~}" min="0" max="10" step="0.5" /></div><div class="pict-flow-node-props-field"><label class="pict-flow-node-props-label">Title Bar</label><input type="color" class="pict-flow-node-props-input pict-flow-node-props-color" data-prop="Style.TitleBarColor" value="{~D:Record.TitleBarColorValue~}" /></div></div>'}]};e.exports=class extends i{constructor(t,e,o){super(t,Object.assign({},JSON.parse(JSON.stringify(n)),e),o),this.serviceType="PictViewFlowPropertiesPanel",this._FlowView=null,this._PanelInstances={}}renderPanels(t,e,o,i){if(!e||!o)return;if(!this._FlowView)return;let n=Array.isArray(t)?t:[],r=new Set,a=e.querySelectorAll(".pict-flow-panel-foreign-object");for(let t=0;t<a.length;t++)r.add(a[t].getAttribute("data-panel-hash"));let l=new Set;for(let t=0;t<n.length;t++)l.add(n[t].Hash);for(let t=0;t<a.length;t++){let e=a[t].getAttribute("data-panel-hash");l.has(e)||(a[t].remove(),this._PanelInstances[e]&&(this._PanelInstances[e].destroy(),delete this._PanelInstances[e]))}for(let t=0;t<n.length;t++){let o=n[t];if(r.has(o.Hash)){let t=e.querySelector('[data-panel-hash="'.concat(o.Hash,'"]'));t&&(t.setAttribute("x",String(o.X)),t.setAttribute("y",String(o.Y)),t.setAttribute("width",String(o.Width)),t.setAttribute("height",String(o.Height)))}else this._createPanelForeignObject(o,e)}for(;o.firstChild;)o.removeChild(o.firstChild);for(let t=0;t<n.length;t++){let e=i===n[t].Hash;this._renderTether(n[t],o,e)}}_createPanelForeignObject(t,e){let o=this._FlowView._PanelChromeProvider;if(!o)return;let i=o.createPanelForeignObject(t,e);i&&this._renderPanelContent(t,i);let n=e.querySelector('[data-panel-hash="'.concat(t.Hash,'"]'));n&&(this._renderAppearanceTab(t,n),this._renderHelpTab(t,n),this._wireTabSwitching(n))}_renderPanelContent(t,e){let o=this._FlowView.getNode(t.NodeHash);if(!o)return;let i=this._FlowView._NodeTypeProvider.getNodeType(o.Type);if(!i)return;if(!i.PropertiesPanel)return void this._renderInfoPanelContent(e,o,i);let n=i.PropertiesPanel,r=n.PanelType||"Base",a="PictFlowCardPropertiesPanel-".concat(r),l=null;this._PanelInstances[t.Hash]?l=this._PanelInstances[t.Hash]:(this.fable.servicesMap.hasOwnProperty(a)?l=this.fable.instantiateServiceProviderWithoutRegistration(a,n):this.fable.servicesMap.hasOwnProperty("PictFlowCardPropertiesPanel")&&(l=this.fable.instantiateServiceProviderWithoutRegistration("PictFlowCardPropertiesPanel",n)),l&&(l._FlowView=this._FlowView,this._PanelInstances[t.Hash]=l)),l&&l.render(e,o),this._renderPortSummary(e,i)}_renderInfoPanelContent(t,e,o){let i=o.CardMetadata||{},n=o.DefaultPorts||[],r=n.filter(t=>"input"===t.Direction),a=n.filter(t=>"output"===t.Direction),l=o.Label||e.Type,s=[],c=this._FlowView._IconProvider;if(i.Icon&&c&&!c.isEmojiIcon(i.Icon)){let t=c.resolveIconKey(i),e=c.getIconSVGMarkup(t,18);s.push(this.pict.parseTemplateByHash("Flow-InfoPanel-Header-Icon",{Icon:e,Label:l}))}else if(i.Icon)s.push(this.pict.parseTemplateByHash("Flow-InfoPanel-Header-Icon",{Icon:i.Icon,Label:l}));else if(c){let t=c.getIconSVGMarkup("default",18);s.push(this.pict.parseTemplateByHash("Flow-InfoPanel-Header-Icon",{Icon:t,Label:l}))}else s.push(this.pict.parseTemplateByHash("Flow-InfoPanel-Header",{Label:l}));if(i.Description&&s.push(this.pict.parseTemplateByHash("Flow-InfoPanel-Description",{Description:i.Description})),i.Category||i.Code){let t="";i.Category&&(t+=this.pict.parseTemplateByHash("Flow-InfoPanel-Badge-Category",{Category:i.Category})),i.Code&&(t+=this.pict.parseTemplateByHash("Flow-InfoPanel-Badge-Code",{Code:i.Code})),s.push(this.pict.parseTemplateByHash("Flow-InfoPanel-Badges",{BadgesContent:t}))}if(r.length>0){let t="";for(let e=0;e<r.length;e++){let o=r[e],i=this._getPortConstraintHTML(o);t+=this.pict.parseTemplateByHash("Flow-InfoPanel-Port-Input",{Label:o.Label||"In",Constraint:i})}s.push(this.pict.parseTemplateByHash("Flow-InfoPanel-Section-Inputs",{PortsContent:t}))}if(a.length>0){let t="";for(let e=0;e<a.length;e++){let o=a[e];t+=this.pict.parseTemplateByHash("Flow-InfoPanel-Port-Output",{Label:o.Label||"Out"})}s.push(this.pict.parseTemplateByHash("Flow-InfoPanel-Section-Outputs",{PortsContent:t}))}t.innerHTML=this.pict.parseTemplateByHash("Flow-InfoPanel-Wrapper",{PanelContent:s.join("")})}_renderPortSummary(t,e){let o=e.DefaultPorts||[];if(0===o.length)return;let i=[],n=[],r=[];for(let t=0;t<o.length;t++){let e=o[t],a=e.PortType||"";"event-in"===a?i.push(e):"event-out"===a||"error"===a?n.push(e):"value"===a&&r.push(e)}if(0===i.length&&0===n.length&&0===r.length)return;let a=[];if(i.length>0){let t="";for(let e=0;e<i.length;e++)t+=this.pict.parseTemplateByHash("Flow-InfoPanel-Port-Event",{Label:i[e].Label||i[e].Name||"Event In"});a.push(this.pict.parseTemplateByHash("Flow-InfoPanel-Section-Generic",{SectionTitle:"Event Inputs",PortsContent:t}))}if(n.length>0){let t="";for(let e=0;e<n.length;e++){let o=n[e],i=o.Label||o.Name||"Event Out";"error"===o.PortType&&(i+=" ⚠"),t+=this.pict.parseTemplateByHash("Flow-InfoPanel-Port-Event",{Label:i})}a.push(this.pict.parseTemplateByHash("Flow-InfoPanel-Section-Generic",{SectionTitle:"Event Outputs",PortsContent:t}))}if(r.length>0){let t="";for(let e=0;e<r.length;e++){let o=r[e],i=o.Label||o.Name||"Output",n="";o.DataType&&(n=this.pict.parseTemplateByHash("Flow-InfoPanel-Port-DataType",{DataTypeText:o.DataType})),t+=this.pict.parseTemplateByHash("Flow-InfoPanel-Port-Value",{Label:i,DataType:n})}a.push(this.pict.parseTemplateByHash("Flow-InfoPanel-Section-Generic",{SectionTitle:"State Outputs",PortsContent:t}))}if(a.length>0){let e=document.createElement("div");e.className="pict-flow-info-panel pict-flow-port-summary",e.innerHTML=a.join(""),t.appendChild(e)}}_getPortConstraintHTML(t){let e="number"==typeof t.MinimumInputCount?t.MinimumInputCount:0,o="number"==typeof t.MaximumInputCount?t.MaximumInputCount:-1;if(e>0||o>0){let t="";return t=o<0?"(min ".concat(e,")"):e===o?"(exactly ".concat(e,")"):"(".concat(e,"–").concat(o,")"),this.pict.parseTemplateByHash("Flow-InfoPanel-Port-Constraint",{ConstraintText:t})}return""}_renderAppearanceTab(t,e){let o=this._FlowView.getNode(t.NodeHash);if(!o)return;let i=e.querySelector('.pict-flow-panel-tab-pane[data-tab="appearance"]');if(!i)return;let n=o.Style||{},r=this._FlowView._NodeTypeProvider.getNodeType(o.Type),a="#2c3e50",l="#ffffff",s="#d0d4d8";r&&(r.TitleBarColor&&(a=r.TitleBarColor),r.BodyStyle&&(r.BodyStyle.fill&&(l=r.BodyStyle.fill),r.BodyStyle.stroke&&(s=r.BodyStyle.stroke)));let c={Title:o.Title||"",Width:o.Width||180,Height:o.Height||80,BodyFillValue:n.BodyFill||l,BodyStrokeValue:n.BodyStroke||s,BodyStrokeWidthValue:n.BodyStrokeWidth||1,TitleBarColorValue:n.TitleBarColor||a};i.innerHTML=this.pict.parseTemplateByHash("Flow-NodeProps-Editor",c);let d=i.querySelectorAll(".pict-flow-node-props-input");for(let e=0;e<d.length;e++){let o=d[e],i=o.getAttribute("data-prop");o.addEventListener("input",e=>{e.stopPropagation(),this._applyNodePropChange(t.NodeHash,i,o.value,o.type)}),o.addEventListener("pointerdown",t=>{t.stopPropagation()})}}_renderHelpTab(t,e){let o=this._FlowView.getNode(t.NodeHash);if(!o)return;let i=this._FlowView._NodeTypeProvider.getNodeType(o.Type);if(!i)return;let n=i.CardMetadata&&i.CardMetadata.Help?i.CardMetadata.Help:null;if(!n)return;let r=e.querySelector('.pict-flow-panel-tab[data-tab-target="help"]');r&&(r.style.display="");let a=e.querySelector('.pict-flow-panel-tab-pane[data-tab="help"]');a&&(a.innerHTML='<div class="pict-flow-panel-help-content">'+n+"</div>")}_wireTabSwitching(t){let e=t.querySelectorAll(".pict-flow-panel-tab"),o=t.querySelectorAll(".pict-flow-panel-tab-pane");for(let i=0;i<e.length;i++)e[i].addEventListener("click",i=>{i.stopPropagation();let n=i.currentTarget.getAttribute("data-tab-target");for(let t=0;t<e.length;t++)e[t].classList.remove("active");for(let t=0;t<o.length;t++)o[t].classList.remove("active"),o[t].style.display="none";i.currentTarget.classList.add("active");let r=t.querySelector('.pict-flow-panel-tab-pane[data-tab="'+n+'"]');r&&(r.classList.add("active"),r.style.display="block")})}_applyNodePropChange(t,e,o,i){let n=this._FlowView.getNode(t);if(!n)return;let r=o;if("number"!==i||(r=parseFloat(o),!isNaN(r))){if("Title"===e)n.Title=r;else if("Width"===e)n.Width=r;else if("Height"===e)n.Height=r;else if(e.startsWith("Style.")){n.Style||(n.Style={});let t=e.substring(6);n.Style[t]=r}this._FlowView.renderFlow(),this._FlowView.marshalFromView(),this._FlowView._EventHandlerProvider&&this._FlowView._EventHandlerProvider.fireEvent("onFlowChanged",this._FlowView._FlowData)}}_renderTether(t,e,o){let i=this._FlowView._TetherService;if(!i)return;let n=this._FlowView.getNode(t.NodeHash);if(!n)return;let r=this._FlowView.options.ViewIdentifier;i.renderTether(t,n,e,o,r)}marshalAllFromPanels(){for(let t in this._PanelInstances){let e=this._PanelInstances[t];e&&e._NodeData&&e.marshalFromPanel(e._NodeData)}}destroyPanel(t){this._PanelInstances[t]&&(this._PanelInstances[t].destroy(),delete this._PanelInstances[t])}destroyAllPanels(){for(let t in this._PanelInstances)this._PanelInstances[t].destroy();this._PanelInstances={}}},e.exports.default_configuration=n},{"pict-view":57}],50:[function(t,e,o){const i=t("pict-view"),n={ViewIdentifier:"Flow-Toolbar",DefaultRenderable:"Flow-Toolbar-Content",DefaultDestinationAddress:"#Flow-Toolbar-Container",AutoRender:!1,FlowViewIdentifier:"Pict-Flow",EnablePalette:!0,EnableAddNode:!0,EnableCardPalette:!0,CSS:!1,Templates:[{Hash:"Flow-Toolbar-Template",Template:'\n<div class="pict-flow-toolbar" id="Flow-Toolbar-Bar-{~D:Record.FlowViewIdentifier~}">\n\t<div class="pict-flow-toolbar-group">\n\t\t<button class="pict-flow-toolbar-btn" data-flow-action="add-node" id="Flow-Toolbar-AddNode-{~D:Record.FlowViewIdentifier~}" title="Add Node">\n\t\t\t<span class="pict-flow-toolbar-btn-icon" id="Flow-Toolbar-Icon-plus-{~D:Record.FlowViewIdentifier~}"></span>\n\t\t\t<span class="pict-flow-toolbar-btn-text">Node</span>\n\t\t</button>\n\t\t<button class="pict-flow-toolbar-btn" data-flow-action="cards-popup" id="Flow-Toolbar-Cards-{~D:Record.FlowViewIdentifier~}" title="Card Palette">\n\t\t\t<span class="pict-flow-toolbar-btn-icon" id="Flow-Toolbar-Icon-cards-{~D:Record.FlowViewIdentifier~}"></span>\n\t\t\t<span class="pict-flow-toolbar-btn-text">Cards</span>\n\t\t\t<span class="pict-flow-toolbar-btn-chevron" id="Flow-Toolbar-CardsChevron-{~D:Record.FlowViewIdentifier~}"></span>\n\t\t</button>\n\t\t<button class="pict-flow-toolbar-btn" data-flow-action="delete-selected" title="Delete Node">\n\t\t\t<span class="pict-flow-toolbar-btn-icon" id="Flow-Toolbar-Icon-trash-{~D:Record.FlowViewIdentifier~}"></span>\n\t\t</button>\n\t</div>\n\t<div class="pict-flow-toolbar-group">\n\t\t<button class="pict-flow-toolbar-btn" data-flow-action="layout-popup" id="Flow-Toolbar-Layout-{~D:Record.FlowViewIdentifier~}" title="Manage saved layouts">\n\t\t\t<span class="pict-flow-toolbar-btn-icon" id="Flow-Toolbar-Icon-layout-{~D:Record.FlowViewIdentifier~}"></span>\n\t\t\t<span class="pict-flow-toolbar-btn-text">Layouts</span>\n\t\t\t<span class="pict-flow-toolbar-btn-chevron" id="Flow-Toolbar-LayoutChevron-{~D:Record.FlowViewIdentifier~}"></span>\n\t\t</button>\n\t\t<div class="pict-flow-toolbar-btn-split" id="Flow-Toolbar-Auto-{~D:Record.FlowViewIdentifier~}">\n\t\t\t<button class="pict-flow-toolbar-btn pict-flow-toolbar-btn-split-main" data-flow-action="apply-current-layout" title="Apply current layout algorithm">\n\t\t\t\t<span class="pict-flow-toolbar-btn-icon" id="Flow-Toolbar-Icon-auto-{~D:Record.FlowViewIdentifier~}"></span>\n\t\t\t\t<span class="pict-flow-toolbar-btn-text">Auto</span>\n\t\t\t</button>\n\t\t\t<button class="pict-flow-toolbar-btn pict-flow-toolbar-btn-split-chevron" data-flow-action="layout-algorithm-popup" title="Choose layout algorithm">\n\t\t\t\t<span class="pict-flow-toolbar-btn-chevron" id="Flow-Toolbar-AutoChevron-{~D:Record.FlowViewIdentifier~}"></span>\n\t\t\t</button>\n\t\t</div>\n\t</div>\n\t<div class="pict-flow-toolbar-group">\n\t\t<button class="pict-flow-toolbar-btn" data-flow-action="zoom-in" title="Zoom In">\n\t\t\t<span class="pict-flow-toolbar-btn-icon" id="Flow-Toolbar-Icon-zoom-in-{~D:Record.FlowViewIdentifier~}"></span>\n\t\t</button>\n\t\t<button class="pict-flow-toolbar-btn" data-flow-action="zoom-out" title="Zoom Out">\n\t\t\t<span class="pict-flow-toolbar-btn-icon" id="Flow-Toolbar-Icon-zoom-out-{~D:Record.FlowViewIdentifier~}"></span>\n\t\t</button>\n\t\t<button class="pict-flow-toolbar-btn" data-flow-action="zoom-fit" title="Fit to View">\n\t\t\t<span class="pict-flow-toolbar-btn-icon" id="Flow-Toolbar-Icon-zoom-fit-{~D:Record.FlowViewIdentifier~}"></span>\n\t\t</button>\n\t</div>\n\t<div class="pict-flow-toolbar-group pict-flow-toolbar-right">\n\t\t<button class="pict-flow-toolbar-btn" data-flow-action="settings-popup" id="Flow-Toolbar-Settings-{~D:Record.FlowViewIdentifier~}" title="Theme Settings">\n\t\t\t<span class="pict-flow-toolbar-btn-icon" id="Flow-Toolbar-Icon-settings-{~D:Record.FlowViewIdentifier~}"></span>\n\t\t</button>\n\t\t<button class="pict-flow-toolbar-btn" data-flow-action="fullscreen" id="Flow-Toolbar-Fullscreen-{~D:Record.FlowViewIdentifier~}" title="Toggle Fullscreen">\n\t\t\t<span class="pict-flow-toolbar-btn-icon" id="Flow-Toolbar-Fullscreen-Icon-{~D:Record.FlowViewIdentifier~}"></span>\n\t\t</button>\n\t\t<button class="pict-flow-toolbar-btn" data-flow-action="toggle-floating" title="Float">\n\t\t\t<span class="pict-flow-toolbar-btn-icon" id="Flow-Toolbar-Icon-grip-{~D:Record.FlowViewIdentifier~}"></span>\n\t\t</button>\n\t\t<button class="pict-flow-toolbar-btn" data-flow-action="collapse-toolbar" title="Collapse Toolbar">\n\t\t\t<span class="pict-flow-toolbar-btn-icon" id="Flow-Toolbar-Icon-collapse-{~D:Record.FlowViewIdentifier~}"></span>\n\t\t</button>\n\t</div>\n</div>\n<div class="pict-flow-toolbar-collapsed" id="Flow-Toolbar-Collapsed-{~D:Record.FlowViewIdentifier~}">\n\t<button class="pict-flow-toolbar-expand-btn" data-flow-action="expand-toolbar" title="Expand Toolbar" id="Flow-Toolbar-ExpandBtn-{~D:Record.FlowViewIdentifier~}">\n\t\t<span id="Flow-Toolbar-Icon-expand-{~D:Record.FlowViewIdentifier~}"></span>\n\t</button>\n</div>\n<div class="pict-flow-toolbar-popup-anchor" id="Flow-Toolbar-PopupAnchor-{~D:Record.FlowViewIdentifier~}">\n</div>\n'}],Renderables:[{RenderableHash:"Flow-Toolbar-Content",TemplateHash:"Flow-Toolbar-Template",DestinationAddress:"#Flow-Toolbar-Container",RenderMethod:"replace"}]};e.exports=class extends i{constructor(t,e,o){super(t,Object.assign({},JSON.parse(JSON.stringify(n)),e),o),this.serviceType="PictViewFlowToolbar",this._FlowView=null,this._ToolbarMode="docked",this._ActivePopup=null,this._FloatingPosition={X:80,Y:80},this._DocumentClickHandler=null,this._FloatingToolbarView=null,this._LayoutFormMetacontroller=null,this._LayoutFormHostID=null,this._LayoutFormExpanded=!0}render(t,e,o){return super.render(t,e,this.options)}onAfterRender(t,e,o,i){let n=this.options.FlowViewIdentifier,r=this.pict.ContentAssignment.getElement("#Flow-Toolbar-Bar-".concat(n));r.length>0&&r[0].addEventListener("click",t=>{let e=t.target;if(!e)return;let o=e.closest("[data-flow-action]");if(!o)return;let i=o.getAttribute("data-flow-action");this._handleToolbarAction(i)});let a=this.pict.ContentAssignment.getElement("#Flow-Toolbar-ExpandBtn-".concat(n));if(a.length>0&&a[0].addEventListener("click",()=>{this._setToolbarMode("docked")}),this._populateToolbarIcons(),!1===this.options.EnableAddNode){let t=this.pict.ContentAssignment.getElement("#Flow-Toolbar-AddNode-".concat(n));t.length>0&&t[0].remove()}if(!1===this.options.EnableCardPalette){let t=this.pict.ContentAssignment.getElement("#Flow-Toolbar-Cards-".concat(n));t.length>0&&t[0].remove()}if(!1===this.options.EnableLayoutMenu){let t=this.pict.ContentAssignment.getElement("#Flow-Toolbar-Auto-".concat(n));t.length>0&&t[0].remove()}return super.onAfterRender(t,e,o,i)}_populateToolbarIcons(){let t=this._FlowView?this._FlowView._IconProvider:null;if(!t)return;let e=this.options.FlowViewIdentifier,o={plus:"plus",trash:"trash","zoom-in":"zoom-in","zoom-out":"zoom-out","zoom-fit":"zoom-fit",auto:"auto-layout",cards:"cards",layout:"layout",settings:"settings",grip:"grip",collapse:"collapse",expand:"expand"},i=Object.keys(o);for(let n=0;n<i.length;n++){let r="Flow-Toolbar-Icon-".concat(i[n],"-").concat(e),a=this.pict.ContentAssignment.getElement("#".concat(r));a.length>0&&(a[0].innerHTML=t.getIconSVGMarkup(o[i[n]],14))}let n=this.pict.ContentAssignment.getElement("#Flow-Toolbar-Fullscreen-Icon-".concat(e));n.length>0&&(n[0].innerHTML=t.getIconSVGMarkup("fullscreen",14));let r=this.pict.ContentAssignment.getElement("#Flow-Toolbar-CardsChevron-".concat(e));r.length>0&&(r[0].innerHTML=t.getIconSVGMarkup("chevron-down",8));let a=this.pict.ContentAssignment.getElement("#Flow-Toolbar-LayoutChevron-".concat(e));a.length>0&&(a[0].innerHTML=t.getIconSVGMarkup("chevron-down",8));let l=this.pict.ContentAssignment.getElement("#Flow-Toolbar-AutoChevron-".concat(e));l.length>0&&(l[0].innerHTML=t.getIconSVGMarkup("chevron-down",8))}_openPopup(t){if(this._ActivePopup===t)return void this._closePopup();this._closePopup();let e=this.options.FlowViewIdentifier,o=this.pict.ContentAssignment.getElement("#Flow-Toolbar-PopupAnchor-".concat(e));if(o.length<1)return;let i=document.createElement("div");switch(i.className="pict-flow-toolbar-popup",i.setAttribute("id","Flow-Toolbar-Popup-".concat(e)),t){case"add-node":this._buildAddNodePopup(i);break;case"cards":this._buildCardsPopup(i);break;case"layout":this._buildLayoutPopup(i);break;case"layout-algorithm":this._buildLayoutAlgorithmPopup(i);break;case"settings":this._buildSettingsPopup(i)}if(o[0].appendChild(i),this._ActivePopup=t,this._positionPopup(i,t),setTimeout(()=>{this._DocumentClickHandler=e=>{if(!i.contains(e.target)){let o=e.target.closest("[data-flow-action]");if(o){let e=o.getAttribute("data-flow-action");if(e===t||e===t.replace("-popup","")+"-popup")return}this._closePopup()}},document.addEventListener("click",this._DocumentClickHandler,!0)},0),"add-node"===t){let t=i.querySelector(".pict-flow-popup-search");t&&setTimeout(()=>{t.focus()},50)}}_closePopup(){this._DocumentClickHandler&&(document.removeEventListener("click",this._DocumentClickHandler,!0),this._DocumentClickHandler=null);let t=this.options.FlowViewIdentifier,e=this.pict.ContentAssignment.getElement("#Flow-Toolbar-Popup-".concat(t));e.length>0&&e[0].parentNode.removeChild(e[0]),this._ActivePopup=null}_positionPopup(t,e){let o,i=this.options.FlowViewIdentifier;switch(e){case"add-node":o="#Flow-Toolbar-AddNode-".concat(i);break;case"cards":o="#Flow-Toolbar-Cards-".concat(i);break;case"layout":o="#Flow-Toolbar-Layout-".concat(i);break;case"layout-algorithm":o="#Flow-Toolbar-Auto-".concat(i);break;case"settings":o="#Flow-Toolbar-Settings-".concat(i);break;default:return}let n=this.pict.ContentAssignment.getElement(o);if(n.length<1)return;let r=this.pict.ContentAssignment.getElement("#Flow-Toolbar-PopupAnchor-".concat(i));if(r.length<1)return;let a=n[0].getBoundingClientRect(),l=r[0].getBoundingClientRect(),s=a.left-l.left;t.style.left=s+"px",t.style.top="0px"}_buildAddNodePopup(t){let e=document.createElement("div");e.className="pict-flow-popup-search-wrapper";let o=document.createElement("span");o.className="pict-flow-popup-search-icon";let i=this._FlowView?this._FlowView._IconProvider:null;i&&(o.innerHTML=i.getIconSVGMarkup("search",12)),e.appendChild(o);let n=document.createElement("input");n.className="pict-flow-popup-search",n.setAttribute("type","text"),n.setAttribute("placeholder","Search node types..."),e.appendChild(n),t.appendChild(e);let r=document.createElement("div");r.className="pict-flow-popup-node-list",t.appendChild(r),this._populateNodeList(r,""),n.addEventListener("input",()=>{this._populateNodeList(r,n.value)})}_populateNodeList(t,e){if(!this._FlowView||!this._FlowView._NodeTypeProvider)return;for(;t.firstChild;)t.removeChild(t.firstChild);let o=this._FlowView._NodeTypeProvider.getNodeTypes(),i=Object.keys(o),n=(e||"").toLowerCase().trim(),r=this._FlowView._IconProvider,a=0;for(let e=0;e<i.length;e++){let l=o[i[e]],s=l.CardMetadata||{};if(!1===s.Enabled)continue;if(n){let t=(l.Label||"").toLowerCase(),e=(s.Code||"").toLowerCase(),o=(s.Category||"").toLowerCase();if(t.indexOf(n)<0&&e.indexOf(n)<0&&o.indexOf(n)<0)continue}a++;let c=document.createElement("div");c.className="pict-flow-popup-list-item",c.setAttribute("data-node-type",i[e]);let d=document.createElement("span");if(d.className="pict-flow-popup-list-item-icon",r){let t=r.resolveIconKey(s);d.innerHTML=r.getIconSVGMarkup(t,16)}c.appendChild(d);let h=document.createElement("span");if(h.className="pict-flow-popup-list-item-label",h.textContent=l.Label,c.appendChild(h),s.Code){let t=document.createElement("span");t.className="pict-flow-popup-list-item-code",t.textContent=s.Code,c.appendChild(t)}c.addEventListener("click",()=>{this._addNodeAtCenter(i[e]),this._closePopup()}),t.appendChild(c)}if(0===a){let e=document.createElement("div");e.className="pict-flow-popup-list-empty",e.textContent="No matching node types",t.appendChild(e)}}_buildCardsPopup(t){let e=document.createElement("div");e.className="pict-flow-popup-search-wrapper";let o=document.createElement("span");o.className="pict-flow-popup-search-icon";let i=this._FlowView?this._FlowView._IconProvider:null;i&&(o.innerHTML=i.getIconSVGMarkup("search",12)),e.appendChild(o);let n=document.createElement("input");n.className="pict-flow-popup-search",n.setAttribute("type","text"),n.setAttribute("placeholder","Search cards..."),e.appendChild(n),t.appendChild(e);let r=document.createElement("div");r.className="pict-flow-popup-node-list",t.appendChild(r),this._renderPalette(r,""),n.addEventListener("input",()=>{this._renderPalette(r,n.value)}),setTimeout(()=>{n.focus()},50)}_renderPalette(t,e){if(!this._FlowView||!this._FlowView._NodeTypeProvider)return;for(;t.firstChild;)t.removeChild(t.firstChild);let o=this._FlowView._NodeTypeProvider.getCardsByCategory(),i=Object.keys(o),n=(e||"").toLowerCase().trim(),r=0;for(let e=0;e<i.length;e++){let a=i[e],l=o[a],s=[];for(let t=0;t<l.length;t++){let e=l[t],o=e.CardMetadata||{};if(n){let t=(e.Label||"").toLowerCase(),i=(o.Code||"").toLowerCase(),r=a.toLowerCase();if(t.indexOf(n)<0&&i.indexOf(n)<0&&r.indexOf(n)<0)continue}s.push(e)}if(0===s.length)continue;r+=s.length;let c=document.createElement("div");c.className="pict-flow-palette-category",c.style.padding="0.35em 0.5em";let d=document.createElement("div");d.className="pict-flow-palette-category-label",d.textContent=a,c.appendChild(d);let h=document.createElement("div");h.className="pict-flow-palette-cards";for(let t=0;t<s.length;t++){let e=s[t],o=e.CardMetadata||{},i=document.createElement("div");if(i.className="pict-flow-palette-card",!1===o.Enabled&&i.classList.add("disabled"),i.setAttribute("data-card-type",e.Hash),o.Tooltip?i.setAttribute("title",o.Tooltip):o.Description&&i.setAttribute("title",o.Description),o.Icon){let t=document.createElement("span");t.className="pict-flow-palette-card-icon";let e=this._FlowView._IconProvider;if(e&&!e.isEmojiIcon(o.Icon)){let i=e.resolveIconKey(o);t.innerHTML=e.getIconSVGMarkup(i,14)}else t.textContent=o.Icon;i.appendChild(t)}else if(this._FlowView._IconProvider){let t=document.createElement("span");t.className="pict-flow-palette-card-icon",t.innerHTML=this._FlowView._IconProvider.getIconSVGMarkup("default",14),i.appendChild(t)}else if(e.TitleBarColor){let t=document.createElement("span");t.className="pict-flow-palette-card-swatch",t.style.backgroundColor=e.TitleBarColor,i.appendChild(t)}let n=document.createElement("span");if(n.className="pict-flow-palette-card-title",n.textContent=e.Label,i.appendChild(n),o.Code){let t=document.createElement("span");t.className="pict-flow-palette-card-code",t.textContent=o.Code,i.appendChild(t)}i.addEventListener("click",()=>{this._addCardFromPalette(e.Hash),this._closePopup()}),h.appendChild(i)}c.appendChild(h),t.appendChild(c)}if(0===r){let e=document.createElement("div");e.className="pict-flow-popup-list-empty",e.textContent=n?"No matching cards":"No card types available",t.appendChild(e)}}_buildLayoutPopup(t){let e=this._FlowView?this._FlowView._IconProvider:null,o=document.createElement("div");o.className="pict-flow-popup-layout-save-section";let i=document.createElement("div");i.className="pict-flow-popup-layout-save-input-row",i.style.display="none";let n=document.createElement("input");n.className="pict-flow-popup-layout-save-input",n.setAttribute("type","text"),n.setAttribute("placeholder","Layout name..."),i.appendChild(n);let r=document.createElement("button");r.className="pict-flow-popup-layout-save-confirm",r.title="Save",e?r.innerHTML=e.getIconSVGMarkup("save",14):r.textContent="✓",i.appendChild(r);let a=document.createElement("div");a.className="pict-flow-popup-layout-save";let l=document.createElement("span");l.className="pict-flow-popup-layout-save-icon",e&&(l.innerHTML=e.getIconSVGMarkup("save",14)),a.appendChild(l);let s=document.createElement("span");s.textContent="Save Current Layout",a.appendChild(s),a.addEventListener("click",()=>{a.style.display="none",i.style.display="",n.value="",setTimeout(()=>{n.focus()},50)});let c=()=>{let e=n.value.trim();if(""!==e){for(this._FlowView._LayoutProvider.saveLayout(e);t.firstChild;)t.removeChild(t.firstChild);this._buildLayoutPopup(t)}};r.addEventListener("click",c),n.addEventListener("keydown",t=>{"Enter"===t.key?(t.preventDefault(),c()):"Escape"===t.key&&(i.style.display="none",a.style.display="")}),n.addEventListener("click",t=>{t.stopPropagation()}),o.appendChild(a),o.appendChild(i),t.appendChild(o);let d=document.createElement("div");if(d.className="pict-flow-popup-divider",t.appendChild(d),!this._FlowView||!this._FlowView._LayoutProvider){let e=document.createElement("div");return e.className="pict-flow-popup-list-empty",e.textContent="No saved layouts",void t.appendChild(e)}let h=this._FlowView._LayoutProvider.getLayouts();if(0===h.length){let e=document.createElement("div");return e.className="pict-flow-popup-list-empty",e.textContent="No saved layouts",void t.appendChild(e)}for(let o=0;o<h.length;o++){let i=h[o],n=document.createElement("div");n.className="pict-flow-popup-layout-row";let r=document.createElement("span");r.className="pict-flow-popup-layout-name",r.textContent=i.Name,n.appendChild(r);let a=document.createElement("button");a.className="pict-flow-popup-layout-delete",a.title="Delete layout",e?a.innerHTML=e.getIconSVGMarkup("trash",12):a.textContent="×",n.appendChild(a),n.addEventListener("click",t=>{t.target.closest(".pict-flow-popup-layout-delete")||(this._FlowView._LayoutProvider.restoreLayout(i.Hash),this._closePopup())}),a.addEventListener("click",e=>{for(e.stopPropagation(),this._FlowView._LayoutProvider.deleteLayout(i.Hash);t.firstChild;)t.removeChild(t.firstChild);this._buildLayoutPopup(t)}),t.appendChild(n)}}_buildLayoutAlgorithmPopup(t){if(!this._FlowView||!this._FlowView._LayoutService)return;let e=this._FlowView._LayoutService,o=this._FlowView.getLayoutAlgorithm(),i=e.getAlgorithm(o.Algorithm),n=document.createElement("div");n.className="pict-flow-popup-settings-section pict-flow-popup-layout-algorithm-row";let r=document.createElement("label");r.className="pict-flow-popup-settings-label",r.textContent="Algorithm",n.appendChild(r);let a=document.createElement("div");a.className="pict-flow-popup-layout-algorithm-controls";let l=document.createElement("select");l.className="pict-flow-popup-settings-select pict-flow-popup-layout-algorithm-select",l.setAttribute("data-layout-control","algorithm");let s=e.listAlgorithms();for(let t=0;t<s.length;t++){let e=document.createElement("option");e.value=s[t].Name,e.textContent=s[t].Label||s[t].Name,s[t].Name===o.Algorithm&&(e.selected=!0),l.appendChild(e)}l.addEventListener("change",()=>{let o=l.value,i=e.getAlgorithm(o),n=i&&i.DefaultParameters?JSON.parse(JSON.stringify(i.DefaultParameters)):{};for(this._FlowView.setLayoutAlgorithm(o,n);t.firstChild;)t.removeChild(t.firstChild);this._buildLayoutAlgorithmPopup(t)}),l.addEventListener("click",t=>{t.stopPropagation()}),a.appendChild(l);let c=!(!i||!(i.ParameterManifest&&i.ParameterManifest.Descriptors||i.ParameterSchema&&Object.keys(i.ParameterSchema).length>0)),d=null;if(c){d=document.createElement("button"),d.type="button",d.className="pict-flow-popup-collapse-toggle",d.title=this._LayoutFormExpanded?"Hide parameters":"Show parameters",d.setAttribute("aria-expanded",this._LayoutFormExpanded?"true":"false");let t=this._FlowView?this._FlowView._IconProvider:null;d.innerHTML=t?t.getIconSVGMarkup("settings",13):"⚙",a.appendChild(d)}if(n.appendChild(a),t.appendChild(n),i&&i.Description){let e=document.createElement("div");e.className="pict-flow-popup-control-description",e.textContent=i.Description,t.appendChild(e)}this._buildLayoutParameterFormSection(t,i,o),d&&d.addEventListener("click",t=>{t.stopPropagation(),this._LayoutFormExpanded=!this._LayoutFormExpanded,d.setAttribute("aria-expanded",this._LayoutFormExpanded?"true":"false"),d.title=this._LayoutFormExpanded?"Hide parameters":"Show parameters";let e=this._LayoutFormHostID?document.getElementById(this._LayoutFormHostID):null;e&&e.setAttribute("data-collapsed",this._LayoutFormExpanded?"false":"true")});let h=document.createElement("div");h.className="pict-flow-popup-divider",t.appendChild(h);let p=document.createElement("div");p.className="pict-flow-popup-settings-section";let u=document.createElement("label");u.className="pict-flow-popup-settings-label",u.textContent="Edge theme",p.appendChild(u);let w=document.createElement("select");w.className="pict-flow-popup-settings-select",w.setAttribute("data-layout-control","edge-theme");let f=this._FlowView.getEdgeTheme(),g=f.Theme,m=f.Override,b=document.createElement("option");b.value="__inherit__";let y=i&&i.DefaultEdgeTheme||"Bezier";b.textContent="Inherit from layout (".concat(y,")"),m||(b.selected=!0),w.appendChild(b);let v=e.listEdgeThemes();for(let t=0;t<v.length;t++){let e=document.createElement("option");e.value=v[t].Name,e.textContent=v[t].Label||v[t].Name,v[t].Name===m&&(e.selected=!0),w.appendChild(e)}if(w.addEventListener("change",()=>{let e=w.value;for("__inherit__"===e?this._FlowView.setEdgeTheme(null):this._FlowView.setEdgeTheme(e);t.firstChild;)t.removeChild(t.firstChild);this._buildLayoutAlgorithmPopup(t)}),w.addEventListener("click",t=>{t.stopPropagation()}),p.appendChild(w),t.appendChild(p),g){let o=e.getEdgeTheme(g);if(o&&o.Description){let e=document.createElement("div");e.className="pict-flow-popup-control-description",e.textContent=o.Description,t.appendChild(e)}}let P=document.createElement("div");P.className="pict-flow-popup-divider",t.appendChild(P);let _=document.createElement("div");_.className="pict-flow-popup-settings-section",_.style.display="flex",_.style.alignItems="center",_.style.gap="8px";let F=document.createElement("input");F.type="checkbox",F.id="Flow-Toolbar-AutoApply-".concat(this.options.FlowViewIdentifier),F.checked=!!o.AutoApply,F.addEventListener("change",()=>{this._FlowView.setLayoutAutoApply(F.checked)}),F.addEventListener("click",t=>{t.stopPropagation()});let S=document.createElement("label");S.className="pict-flow-popup-settings-label",S.setAttribute("for",F.id),S.textContent="Auto-apply on changes",S.style.cursor="pointer",_.appendChild(F),_.appendChild(S),t.appendChild(_);let V=document.createElement("div");V.className="pict-flow-popup-divider",t.appendChild(V);let C=document.createElement("div");C.className="pict-flow-popup-settings-section",C.style.padding="4px 8px";let T=document.createElement("button");T.className="pict-flow-popup-layout-save-confirm",T.textContent="Apply Now",T.style.width="100%",T.style.padding="6px","Custom"===o.Algorithm&&(T.disabled=!0,T.title="Custom does not auto-position nodes"),T.addEventListener("click",()=>{"Custom"!==o.Algorithm&&this._FlowView.applyCurrentLayout()}),C.appendChild(T),t.appendChild(C)}_buildLayoutParameterFormSection(t,e,o){if(!e)return;let i=!(!e.ParameterManifest||!e.ParameterManifest.Descriptors),n=this._resolveMetacontrollerServiceType();if(i&&n)return void this._mountLayoutParameterMetacontroller(t,e,o,n);let r=e.ParameterSchema?e.ParameterSchema:{},a=Object.keys(r);if(0===a.length)return;let l=document.createElement("div");l.className="pict-flow-popup-divider",t.appendChild(l);let s=document.createElement("div");s.className="pict-flow-popup-settings-label",s.style.fontWeight="bold",s.style.padding="4px 8px",s.textContent="Parameters",t.appendChild(s);for(let e=0;e<a.length;e++){let i=a[e],n=r[i],l=o.Parameters&&o.Parameters.hasOwnProperty(i)?o.Parameters[i]:n.Default,s=document.createElement("div");s.className="pict-flow-popup-settings-section",s.style.display="flex",s.style.alignItems="center",s.style.gap="8px";let c=document.createElement("label");c.className="pict-flow-popup-settings-label",c.textContent=n.Label||i,c.style.flex="1",s.appendChild(c);let d=this._buildLayoutParamInput(i,n,l);s.appendChild(d),t.appendChild(s)}}_evictLayoutFormViews(){if(!this.pict||!this.pict.views)return;let t=Object.keys(this.pict.views);for(let e=0;e<t.length;e++){let o=t[e];0===o.indexOf("PictSectionForm-")&&o.indexOf("PictFlowLayout")>0?delete this.pict.views[o]:0===o.indexOf("PictSectionForm-PFL")&&delete this.pict.views[o]}this._LayoutFormMetacontroller=null}_resolveMetacontrollerServiceType(){return this.fable&&this.fable.servicesMap?this.fable.servicesMap.hasOwnProperty("PictFormMetacontroller")?"PictFormMetacontroller":this.fable.servicesMap.hasOwnProperty("PictViewFormMetacontroller")?"PictViewFormMetacontroller":null:null}_mountLayoutParameterMetacontroller(t,e,o,i){let n=JSON.parse(JSON.stringify(e.ParameterManifest)),r=this.options.FlowViewIdentifier,a=document.createElement("div");a.className="pict-flow-popup-divider",t.appendChild(a);let l="Flow-Toolbar-LayoutForm-".concat(r);this._LayoutFormHostID=l;let s=document.createElement("div");s.id=l,s.className="pict-flow-popup-layout-form-host",s.setAttribute("data-collapsed",this._LayoutFormExpanded?"false":"true"),s.addEventListener("click",t=>{t.stopPropagation()}),t.appendChild(s);let c=o.Algorithm;this.pict.AppData[c]=this.pict.AppData[c]||{},this.pict.AppData[c].PictFlowLayoutEditor=this.pict.AppData[c].PictFlowLayoutEditor||{},this.pict.AppData[c].PictFlowLayoutEditor.Parameters=JSON.parse(JSON.stringify(o.Parameters||{})),this._evictLayoutFormViews();try{this._LayoutFormMetacontroller=this.fable.instantiateServiceProviderWithoutRegistration(i,{ViewIdentifier:"Flow-Toolbar-LayoutForm-MC-".concat(r,"-").concat(this.fable.getUUID()),DefaultDestinationAddress:"#".concat(l),AutoRender:!1,AutoPopulateAfterRender:!0,AutoSolveBeforeRender:!1})}catch(t){this.log.warn("Failed to instantiate ".concat(i,": ").concat(t.message)),this._LayoutFormMetacontroller=null}if(!this._LayoutFormMetacontroller)return void(s.innerHTML='<em style="padding:8px;display:block;opacity:0.7;">pict-section-form not available; parameter form skipped.</em>');let d="Pict-".concat(this._LayoutFormMetacontroller.UUID,"-FormContainer");s.innerHTML='<div id="'.concat(d,'" class="pict-form pict-flow-popup-layout-form"></div>');try{let t="function"==typeof this._LayoutFormMetacontroller.injectManifest?this._LayoutFormMetacontroller.injectManifest.bind(this._LayoutFormMetacontroller):null;if(!t)throw new Error("Metacontroller exposes neither injectManifest nor injectManifestAndRender");let e=t("function"==typeof this._LayoutFormMetacontroller.createDistinctManifest?this._LayoutFormMetacontroller.createDistinctManifest(n,o.Algorithm):n),i=s.querySelector("#".concat(d));if(i){let t="";for(let o=0;o<e.length;o++){let i=e[o].options.DefaultDestinationAddress;i&&"#"===i.charAt(0)&&(i=i.substring(1)),t+='<div id="'.concat(i,'" class="pict-form-view"></div>')}i.innerHTML=t}setTimeout(()=>{for(let t=0;t<e.length;t++)e[t].render(),"function"==typeof e[t].marshalToView&&e[t].marshalToView()},0)}catch(t){return this.log.warn("PictViewFlowToolbar: layout-form injection failed: ".concat(t.message)),void(s.innerHTML='<em style="padding:8px;display:block;opacity:0.7;">Form render error: '.concat(t.message,"</em>"))}let h=!1,p=()=>{h||(h=!0,Promise.resolve().then(()=>{h=!1;let t=((this.pict.AppData[c]||{}).PictFlowLayoutEditor||{}).Parameters||{},e=Object.assign({},this._FlowView.getLayoutAlgorithm().Parameters||{},t);this._FlowView.setLayoutAlgorithm(o.Algorithm,e)}))};s.addEventListener("change",p),s.addEventListener("input",p)}_buildLayoutParamInput(t,e,o){let i;if("boolean"===e.Type)i=document.createElement("input"),i.type="checkbox",i.checked=!!o,i.addEventListener("change",()=>{this._updateLayoutParameter(t,i.checked)});else if("enum"===e.Type&&Array.isArray(e.Options)){i=document.createElement("select"),i.className="pict-flow-popup-settings-select";for(let t=0;t<e.Options.length;t++){let n=document.createElement("option");n.value=e.Options[t],n.textContent=e.Options[t],e.Options[t]===o&&(n.selected=!0),i.appendChild(n)}i.addEventListener("change",()=>{this._updateLayoutParameter(t,i.value)})}else if("number"===e.Type||"Number"===e.Type||"PreciseNumber"===e.Type){i=document.createElement("input"),i.type="number",i.className="pict-flow-popup-settings-input";let n="PreciseNumber"===e.Type;"number"==typeof e.Min&&(i.min=String(e.Min)),"number"==typeof e.Max&&(i.max=String(e.Max)),i.step=n?"any":"1";let r=null==o?"":String(o);i.value=r,i.style.width="90px",i.addEventListener("change",()=>{let e=i.value;if(""!==e)if(n)this._updateLayoutParameter(t,e);else{let o=parseFloat(e);if(isNaN(o))return;this._updateLayoutParameter(t,o)}})}else i=document.createElement("input"),i.type="text",i.className="pict-flow-popup-settings-input",i.value=null==o?"":String(o),i.style.width="90px",i.addEventListener("change",()=>{this._updateLayoutParameter(t,i.value)});return i.addEventListener("click",t=>{t.stopPropagation()}),i}_updateLayoutParameter(t,e){if(!this._FlowView)return;let o=this._FlowView.getLayoutAlgorithm(),i=Object.assign({},o.Parameters||{});i[t]=e,this._FlowView.setLayoutAlgorithm(o.Algorithm,i)}_buildSettingsPopup(t){if(!this._FlowView||!this._FlowView._ThemeProvider)return;let e=this._FlowView._ThemeProvider,o=document.createElement("div");o.className="pict-flow-popup-settings-section";let i=document.createElement("label");i.className="pict-flow-popup-settings-label",i.textContent="Theme",o.appendChild(i);let n=document.createElement("select");n.className="pict-flow-popup-settings-select";let r=e.getThemeKeys(),a=e.getActiveThemeKey();for(let t=0;t<r.length;t++){let o=document.createElement("option");o.value=r[t];let i=e._Themes[r[t]];o.textContent=i.Label||r[t],r[t]===a&&(o.selected=!0),n.appendChild(o)}n.addEventListener("change",()=>{this._FlowView.setTheme(n.value),this._refreshNoiseSlider(t)}),n.addEventListener("click",t=>{t.stopPropagation()}),o.appendChild(n),t.appendChild(o);let l=document.createElement("div");l.className="pict-flow-popup-divider",t.appendChild(l);let s=document.createElement("div");s.className="pict-flow-popup-settings-section pict-flow-popup-settings-noise",s.setAttribute("data-settings-type","noise");let c=document.createElement("label");c.className="pict-flow-popup-settings-label",c.textContent="Noise",s.appendChild(c);let d=document.createElement("div");d.className="pict-flow-popup-settings-slider-row";let h=document.createElement("input");h.type="range",h.className="pict-flow-popup-settings-slider",h.min="0",h.max="100",h.value=String(Math.round(100*e.getNoiseLevel()));let p=document.createElement("span");p.className="pict-flow-popup-settings-slider-value",p.textContent=h.value+"%",h.addEventListener("input",()=>{let t=parseInt(h.value,10)/100;p.textContent=h.value+"%",this._FlowView.setNoiseLevel(t)}),h.addEventListener("click",t=>{t.stopPropagation()}),h.addEventListener("pointerdown",t=>{t.stopPropagation()}),d.appendChild(h),d.appendChild(p),s.appendChild(d),t.appendChild(s),this._refreshNoiseSlider(t)}_refreshNoiseSlider(t){let e=t.querySelector('[data-settings-type="noise"]');if(!e)return;let o=this._FlowView._ThemeProvider.getActiveTheme();if(o&&o.NoiseConfig&&o.NoiseConfig.Enabled){e.style.display="";let t=e.querySelector(".pict-flow-popup-settings-slider"),o=e.querySelector(".pict-flow-popup-settings-slider-value");if(t){let e=Math.round(100*this._FlowView._ThemeProvider.getNoiseLevel());t.value=String(e),o&&(o.textContent=e+"%")}}else e.style.display="none"}_setToolbarMode(t){this._closePopup();let e=this.options.FlowViewIdentifier,o=this.pict.ContentAssignment.getElement("#Flow-Toolbar-Bar-".concat(e)),i=this.pict.ContentAssignment.getElement("#Flow-Toolbar-Collapsed-".concat(e));switch(t){case"docked":o.length>0&&(o[0].style.display=""),i.length>0&&i[0].classList.remove("visible"),this._FloatingToolbarView&&this._FloatingToolbarView.hide();break;case"floating":o.length>0&&(o[0].style.display="none"),i.length>0&&i[0].classList.remove("visible"),this._showFloatingToolbar();break;case"collapsed":o.length>0&&(o[0].style.display="none"),i.length>0&&i[0].classList.add("visible"),this._FloatingToolbarView&&this._FloatingToolbarView.hide()}this._ToolbarMode=t}_showFloatingToolbar(){if(this._FlowView){if(!this._FloatingToolbarView){let t=this.options.FlowViewIdentifier;this._FloatingToolbarView=this.fable.instantiateServiceProviderWithoutRegistration("PictViewFlowFloatingToolbar",{FlowViewIdentifier:t,DefaultDestinationAddress:"#Flow-FloatingToolbar-Container-".concat(t),EnableAddNode:this.options.EnableAddNode,EnableCardPalette:this.options.EnableCardPalette}),this._FloatingToolbarView._ToolbarView=this,this._FloatingToolbarView._FlowView=this._FlowView,this._FloatingToolbarView.render()}this._FloatingToolbarView.show()}}_addNodeAtCenter(t){if(!this._FlowView)return;let e=this._FlowView.viewState,o=this._FlowView._SVGElement,i=o?o.clientWidth:600,n=o?o.clientHeight:400,r=(-e.PanX+i/2)/e.Zoom,a=(-e.PanY+n/2)/e.Zoom,l=this._FlowView.flowData.Nodes.length;r+=l%5*30,a+=l%5*30,this._FlowView.addNode(t,r,a)}_addCardFromPalette(t){if(!this._FlowView)return;let e=this._FlowView.viewState,o=(200-e.PanX)/e.Zoom,i=(200-e.PanY)/e.Zoom,n=this._FlowView.flowData.Nodes.length;o+=n%5*40,i+=n%5*40,this._FlowView.addNode(t,o,i)}_handleToolbarAction(t){if(!this._FlowView)return;let e=this.options.FlowViewIdentifier;switch(t){case"add-node":this._openPopup("add-node");break;case"delete-selected":this._FlowView.deleteSelected();break;case"zoom-in":this._FlowView.setZoom(this._FlowView.viewState.Zoom+this._FlowView.options.ZoomStep);break;case"zoom-out":this._FlowView.setZoom(this._FlowView.viewState.Zoom-this._FlowView.options.ZoomStep);break;case"zoom-fit":this._FlowView.zoomToFit();break;case"auto-layout":case"apply-current-layout":this._FlowView.autoLayout();break;case"cards-popup":this._openPopup("cards");break;case"layout-popup":this._openPopup("layout");break;case"layout-algorithm-popup":this._openPopup("layout-algorithm");break;case"apply-layout":this._FlowView.applyCurrentLayout();break;case"settings-popup":this._openPopup("settings");break;case"toggle-floating":"floating"===this._ToolbarMode?this._setToolbarMode("docked"):this._setToolbarMode("floating");break;case"collapse-toolbar":this._setToolbarMode("collapsed");break;case"expand-toolbar":this._setToolbarMode("docked");break;case"fullscreen":{let t=this._FlowView.toggleFullscreen(),o=this._FlowView._IconProvider,i=this.pict.ContentAssignment.getElement("#Flow-Toolbar-Fullscreen-Icon-".concat(e));i.length>0&&o&&(i[0].innerHTML=o.getIconSVGMarkup(t?"exit-fullscreen":"fullscreen",14));let n=this.pict.ContentAssignment.getElement("#Flow-Toolbar-Fullscreen-".concat(e));n.length>0&&n[0].setAttribute("title",t?"Exit Fullscreen":"Toggle Fullscreen")}break;default:this.log.warn("PictViewFlowToolbar: unknown action '".concat(t,"'"))}}},e.exports.default_configuration=n},{"pict-view":57}],51:[function(t,e,o){const i=t("pict-view"),n=t("../services/PictService-Flow-InteractionManager.js"),r=t("../services/PictService-Flow-ConnectionRenderer.js"),a=t("../services/PictService-Flow-Tether.js"),l=t("../services/PictService-Flow-Layout.js"),s=t("../services/PictService-Flow-PathGenerator.js"),c=t("../services/PictService-Flow-ViewportManager.js"),d=t("../services/PictService-Flow-SelectionManager.js"),h=t("../services/PictService-Flow-PanelManager.js"),p=t("../services/PictService-Flow-DataManager.js"),u=t("../services/PictService-Flow-ConnectionHandleManager.js"),w=t("../services/PictService-Flow-RenderManager.js"),f=t("../services/PictService-Flow-PortRenderer.js"),g=t("../providers/PictProvider-Flow-NodeTypes.js"),m=t("../providers/PictProvider-Flow-EventHandler.js"),b=t("../providers/PictProvider-Flow-Layouts.js"),y=t("../providers/PictProvider-Flow-SVGHelpers.js"),v=t("../providers/PictProvider-Flow-Geometry.js"),P=t("../providers/PictProvider-Flow-PanelChrome.js"),_=t("../providers/PictProvider-Flow-CSS.js"),F=t("../providers/PictProvider-Flow-Icons.js"),S=t("../providers/PictProvider-Flow-ConnectorShapes.js"),V=t("../providers/PictProvider-Flow-Theme.js"),C=t("../providers/PictProvider-Flow-Noise.js"),T=t("./PictView-Flow-Node.js"),x=t("./PictView-Flow-Toolbar.js"),H=t("./PictView-Flow-FloatingToolbar.js"),D=t("./PictView-Flow-PropertiesPanel.js"),L=t("../PictFlowCardPropertiesPanel.js"),A=t("../panels/FlowCardPropertiesPanel-Template.js"),N=t("../panels/FlowCardPropertiesPanel-Markdown.js"),k=t("../panels/FlowCardPropertiesPanel-Form.js"),I=t("../panels/FlowCardPropertiesPanel-View.js"),M={ViewIdentifier:"Pict-Flow",DefaultRenderable:"Flow-Container",DefaultDestinationAddress:"#Flow-Container",AutoRender:!1,FlowDataAddress:!1,TargetElementAddress:"#Flow-SVG-Container",EnableToolbar:!0,EnableAddNode:!0,EnableCardPalette:!0,IncludeDefaultNodeTypes:!0,EnablePanning:!0,EnableZooming:!0,EnableNodeDragging:!0,EnableConnectionCreation:!0,EnableGridSnap:!1,GridSnapSize:20,EnableLayoutMenu:!0,MinZoom:.1,MaxZoom:5,ZoomStep:.1,DefaultNodeType:"default",DefaultNodeWidth:180,DefaultNodeHeight:80,DefaultLayoutAlgorithm:"Custom",DefaultLayoutParameters:{},DefaultLayoutAutoApply:!1,DefaultEdgeTheme:null,DefaultEdgeThemeParameters:{},CSS:!1,Templates:[{Hash:"Flow-PanelChrome-Template",Template:'<div class="pict-flow-panel" xmlns="http://www.w3.org/1999/xhtml"><div class="pict-flow-panel-titlebar" data-element-type="panel-titlebar" data-panel-hash="{~D:Record.Hash~}"><span class="pict-flow-panel-title-text">{~D:Record.Title~}</span><span class="pict-flow-panel-close-btn" data-element-type="panel-close" data-panel-hash="{~D:Record.Hash~}"><span class="pict-flow-panel-close-icon"></span></span></div><div class="pict-flow-panel-content" data-panel-hash="{~D:Record.Hash~}"><div class="pict-flow-panel-tab-pane active" data-tab="properties" data-panel-hash="{~D:Record.Hash~}"></div><div class="pict-flow-panel-tab-pane" data-tab="help" data-panel-hash="{~D:Record.Hash~}" style="display:none;"></div><div class="pict-flow-panel-tab-pane" data-tab="appearance" data-panel-hash="{~D:Record.Hash~}" style="display:none;"></div></div><div class="pict-flow-panel-resize-handle" data-element-type="panel-resize" data-panel-hash="{~D:Record.Hash~}"></div><div class="pict-flow-panel-tabbar" data-panel-hash="{~D:Record.Hash~}"><div class="pict-flow-panel-tab active" data-tab-target="properties" data-panel-hash="{~D:Record.Hash~}">Properties</div><div class="pict-flow-panel-tab" data-tab-target="help" data-panel-hash="{~D:Record.Hash~}" style="display:none;">Help</div><div class="pict-flow-panel-tab" data-tab-target="appearance" data-panel-hash="{~D:Record.Hash~}">Appearance</div></div></div>'},{Hash:"Flow-Container-Template",Template:'\n<div class="pict-flow-container" id="Flow-Wrapper-{~D:Record.ViewIdentifier~}">\n\t<div id="Flow-Toolbar-{~D:Record.ViewIdentifier~}"></div>\n\t<div id="Flow-FloatingToolbar-Container-{~D:Record.ViewIdentifier~}" style="display:none;position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;z-index:100;"></div>\n\t<div class="pict-flow-svg-container" id="Flow-SVG-Container-{~D:Record.ViewIdentifier~}">\n\t\t<svg class="pict-flow-svg"\n\t\t\tid="Flow-SVG-{~D:Record.ViewIdentifier~}"\n\t\t\txmlns="http://www.w3.org/2000/svg">\n\t\t\t<defs>\n\t\t\t\t<pattern id="flow-grid-{~D:Record.ViewIdentifier~}"\n\t\t\t\t\twidth="20" height="20" patternUnits="userSpaceOnUse">\n\t\t\t\t\t<line x1="20" y1="0" x2="20" y2="20" class="pict-flow-grid-pattern" />\n\t\t\t\t\t<line x1="0" y1="20" x2="20" y2="20" class="pict-flow-grid-pattern" />\n\t\t\t\t</pattern>\n\t\t\t</defs>\n\t\t\t<rect width="10000" height="10000" x="-5000" y="-5000"\n\t\t\t\tfill="url(#flow-grid-{~D:Record.ViewIdentifier~})"\n\t\t\t\tclass="pict-flow-grid-background" />\n\t\t\t<g class="pict-flow-viewport" id="Flow-Viewport-{~D:Record.ViewIdentifier~}">\n\t\t\t\t<g class="pict-flow-connections-layer" id="Flow-Connections-{~D:Record.ViewIdentifier~}"></g>\n\t\t\t\t<g class="pict-flow-nodes-layer" id="Flow-Nodes-{~D:Record.ViewIdentifier~}"></g>\n\t\t\t\t<g class="pict-flow-endpoints-layer" id="Flow-Endpoints-{~D:Record.ViewIdentifier~}"></g>\n\t\t\t\t<g class="pict-flow-port-hints-layer" id="Flow-PortHints-{~D:Record.ViewIdentifier~}"></g>\n\t\t\t\t<g class="pict-flow-tethers-layer" id="Flow-Tethers-{~D:Record.ViewIdentifier~}"></g>\n\t\t\t\t<g class="pict-flow-panels-layer" id="Flow-Panels-{~D:Record.ViewIdentifier~}"></g>\n\t\t\t</g>\n\t\t</svg>\n\t</div>\n</div>\n'}],Renderables:[{RenderableHash:"Flow-Container",TemplateHash:"Flow-Container-Template",DestinationAddress:"#Flow-Container",RenderMethod:"replace"}]};e.exports=class extends i{constructor(t,e,o){super(t,Object.assign({},JSON.parse(JSON.stringify(M)),e),o),this.serviceType="PictSectionFlow",this._ServiceRegistry=[{ServiceType:"PictProviderFlowSVGHelpers",Library:y,Property:"_SVGHelperProvider",NoFlowView:!0},{ServiceType:"PictProviderFlowGeometry",Library:v,Property:"_GeometryProvider",NoFlowView:!0},{ServiceType:"PictProviderFlowNoise",Library:C,Property:"_NoiseProvider",NoFlowView:!0},{ServiceType:"PictProviderFlowTheme",Library:V,Property:"_ThemeProvider"},{ServiceType:"PictProviderFlowCSS",Library:_,Property:"_CSSProvider",PostInit:"registerCSS"},{ServiceType:"PictProviderFlowIcons",Library:F,Property:"_IconProvider",PostInit:"registerIconTemplates"},{ServiceType:"PictProviderFlowConnectorShapes",Library:S,Property:"_ConnectorShapesProvider"},{ServiceType:"PictProviderFlowPanelChrome",Library:P,Property:"_PanelChromeProvider"},{ServiceType:"PictProviderFlowNodeTypes",Library:g,Property:"_NodeTypeProvider",ExtraOptions:()=>({AdditionalNodeTypes:this.options.NodeTypes,IncludeDefaultNodeTypes:this.options.IncludeDefaultNodeTypes})},{ServiceType:"PictProviderFlowEventHandler",Library:m,Property:"_EventHandlerProvider"},{ServiceType:"PictProviderFlowLayouts",Library:b,Property:"_LayoutProvider",PostInit:"loadPersistedLayouts"},{ServiceType:"PictServiceFlowPathGenerator",Library:s,Property:"_PathGenerator"},{ServiceType:"PictServiceFlowDataManager",Library:p,Property:"_DataManager"},{ServiceType:"PictServiceFlowConnectionHandleManager",Library:u,Property:"_ConnectionHandleManager"},{ServiceType:"PictServiceFlowRenderManager",Library:w,Property:"_RenderManager"},{ServiceType:"PictServiceFlowPortRenderer",Library:f,Property:"_PortRenderer"},{ServiceType:"PictServiceFlowInteractionManager",Library:n,Property:"_InteractionManager"},{ServiceType:"PictServiceFlowConnectionRenderer",Library:r,Property:"_ConnectionRenderer"},{ServiceType:"PictServiceFlowTether",Library:a,Property:"_TetherService"},{ServiceType:"PictServiceFlowLayout",Library:l,Property:"_LayoutService"},{ServiceType:"PictServiceFlowViewportManager",Library:c,Property:"_ViewportManager"},{ServiceType:"PictServiceFlowSelectionManager",Library:d,Property:"_SelectionManager"},{ServiceType:"PictServiceFlowPanelManager",Library:h,Property:"_PanelManager"},{ServiceType:"PictViewFlowNode",Library:T,RegisterOnly:!0},{ServiceType:"PictViewFlowToolbar",Library:x,RegisterOnly:!0},{ServiceType:"PictViewFlowFloatingToolbar",Library:H,RegisterOnly:!0},{ServiceType:"PictViewFlowPropertiesPanel",Library:D,RegisterOnly:!0},{ServiceType:"PictFlowCardPropertiesPanel",Library:L,RegisterOnly:!0},{ServiceType:"PictFlowCardPropertiesPanel-Template",Library:A,RegisterOnly:!0},{ServiceType:"PictFlowCardPropertiesPanel-Markdown",Library:N,RegisterOnly:!0},{ServiceType:"PictFlowCardPropertiesPanel-Form",Library:k,RegisterOnly:!0},{ServiceType:"PictFlowCardPropertiesPanel-View",Library:I,RegisterOnly:!0}],this._registerServiceTypes(),this._FlowData={Nodes:[],Connections:[],OpenPanels:[],SavedLayouts:[],ViewState:{PanX:0,PanY:0,Zoom:1,SelectedNodeHash:null,SelectedConnectionHash:null,SelectedTetherHash:null},LayoutAlgorithm:this.options.DefaultLayoutAlgorithm||"Custom",LayoutParameters:JSON.parse(JSON.stringify(this.options.DefaultLayoutParameters||{})),LayoutAutoApply:!!this.options.DefaultLayoutAutoApply,EdgeTheme:this.options.DefaultEdgeTheme||null,EdgeThemeParameters:JSON.parse(JSON.stringify(this.options.DefaultEdgeThemeParameters||{}))},this._AutoApplyInProgress=!1,this._AutoApplyHandlerHashes=[],this._SVGElement=null,this._ViewportElement=null,this._NodesLayer=null,this._ConnectionsLayer=null,this._EndpointsLayer=null,this._PortHintsLayer=null,this._TethersLayer=null,this._PanelsLayer=null,this._DataManager=null,this._ConnectionHandleManager=null,this._RenderManager=null,this._PortRenderer=null,this._InteractionManager=null,this._ConnectionRenderer=null,this._TetherService=null,this._LayoutService=null,this._PathGenerator=null,this._ViewportManager=null,this._SelectionManager=null,this._PanelManager=null,this._CSSProvider=null,this._IconProvider=null,this._ConnectorShapesProvider=null,this._ThemeProvider=null,this._NoiseProvider=null,this._SVGHelperProvider=null,this._GeometryProvider=null,this._PanelChromeProvider=null,this._NodeTypeProvider=null,this._LayoutProvider=null,this._EventHandlerProvider=null,this._NodeView=null,this._ToolbarView=null,this._PropertiesPanelView=null,this.initialRenderComplete=!1}_registerServiceTypes(){for(let t=0;t<this._ServiceRegistry.length;t++){let e=this._ServiceRegistry[t];this.fable.servicesMap.hasOwnProperty(e.ServiceType)||this.fable.addServiceType(e.ServiceType,e.Library)}}_instantiateServices(){for(let t=0;t<this._ServiceRegistry.length;t++){let e=this._ServiceRegistry[t];if(e.RegisterOnly)continue;if(this[e.Property])continue;let o=e.NoFlowView?{}:{FlowView:this};"function"==typeof e.ExtraOptions&&Object.assign(o,e.ExtraOptions()),this[e.Property]=this.fable.instantiateServiceProviderWithoutRegistration(e.ServiceType,o),e.PostInit&&"function"==typeof this[e.Property][e.PostInit]&&this[e.Property][e.PostInit]()}}get flowData(){return this._FlowData}get viewState(){return this._FlowData.ViewState}get _IsFullscreen(){return!!this._ViewportManager&&this._ViewportManager._IsFullscreen}render(t,e){return super.render(t,e,this.options)}renderAsync(t,e,o,i,n){return"function"==typeof o||void 0===o?super.renderAsync(t,e,this.options,i,o||n):super.renderAsync(t,e,o,i,n)}onBeforeInitialize(){return super.onBeforeInitialize(),this._ThemeProvider=this.fable.instantiateServiceProviderWithoutRegistration("PictProviderFlowTheme",{FlowView:this}),this._NoiseProvider=this.fable.instantiateServiceProviderWithoutRegistration("PictProviderFlowNoise"),this.options.Theme&&this._ThemeProvider.setTheme(this.options.Theme),"number"==typeof this.options.NoiseLevel&&this._ThemeProvider.setNoiseLevel(this.options.NoiseLevel),this._instantiateServices(),super.onBeforeInitialize()}onAfterRender(t,e,o,i){return this.initialRenderComplete||(this.onAfterInitialRender(),this.initialRenderComplete=!0),super.onAfterRender(t,e,o,i)}onAfterInitialRender(){let t=this.options.ViewIdentifier,e=this.pict.ContentAssignment.getElement("#Flow-SVG-".concat(t));if(e.length<1)return this.log.error("PictSectionFlow could not find SVG element #Flow-SVG-".concat(t)),!1;this._SVGElement=e[0];let o=this.pict.ContentAssignment.getElement("#Flow-Viewport-".concat(t));o.length>0&&(this._ViewportElement=o[0]);let i=this.pict.ContentAssignment.getElement("#Flow-Nodes-".concat(t));i.length>0&&(this._NodesLayer=i[0]);let n=this.pict.ContentAssignment.getElement("#Flow-Connections-".concat(t));n.length>0&&(this._ConnectionsLayer=n[0]);let r=this.pict.ContentAssignment.getElement("#Flow-Endpoints-".concat(t));r.length>0&&(this._EndpointsLayer=r[0]);let a=this.pict.ContentAssignment.getElement("#Flow-PortHints-".concat(t));a.length>0&&(this._PortHintsLayer=a[0]);let l=this.pict.ContentAssignment.getElement("#Flow-Tethers-".concat(t));l.length>0&&(this._TethersLayer=l[0]);let s=this.pict.ContentAssignment.getElement("#Flow-Panels-".concat(t));if(s.length>0&&(this._PanelsLayer=s[0]),this._instantiateServices(),this._ConnectorShapesProvider&&this._SVGElement){let e=this._SVGElement.querySelector("defs");if(e){let o=this._ConnectorShapesProvider.generateMarkerDefs(t),i=document.createElementNS("http://www.w3.org/2000/svg","svg");for(i.innerHTML=o;i.firstChild;)e.appendChild(i.firstChild)}}this.options.EnableToolbar&&(this._ToolbarView=this.fable.instantiateServiceProviderWithoutRegistration("PictViewFlowToolbar",Object.assign({},x.default_configuration,{ViewIdentifier:"Flow-Toolbar-".concat(t),DefaultDestinationAddress:"#Flow-Toolbar-".concat(t),FlowViewIdentifier:t,EnableAddNode:this.options.EnableAddNode,EnableCardPalette:this.options.EnableCardPalette})),this._ToolbarView&&"function"==typeof this._ToolbarView.render&&(this._ToolbarView._FlowView=this,this._ToolbarView.render())),this._NodeView=this.fable.instantiateServiceProviderWithoutRegistration("PictViewFlowNode",Object.assign({},T.default_configuration,{ViewIdentifier:"Flow-NodeRenderer-".concat(t),AutoRender:!1})),this._NodeView._FlowView=this,this._PropertiesPanelView=this.fable.instantiateServiceProviderWithoutRegistration("PictViewFlowPropertiesPanel",Object.assign({},D.default_configuration,{ViewIdentifier:"Flow-PropertiesPanel-".concat(t),AutoRender:!1})),this._PropertiesPanelView._FlowView=this,this._InteractionManager.initialize(this._SVGElement,this._ViewportElement),this._subscribeAutoApplyHandlers(),this.options.FlowDataAddress&&this.marshalToView(),this.renderFlow()}marshalToView(){return this._DataManager.marshalToView()}marshalFromView(){return this._DataManager.marshalFromView()}getFlowData(){return this._DataManager.getFlowData()}setFlowData(t){return this._DataManager.setFlowData(t)}addNode(t,e,o,i,n){return this._DataManager.addNode(t,e,o,i,n)}removeNode(t){return this._DataManager.removeNode(t)}addConnection(t,e,o,i,n){return this._DataManager.addConnection(t,e,o,i,n)}removeConnection(t){return this._DataManager.removeConnection(t)}selectNode(t){return this._SelectionManager.selectNode(t)}selectConnection(t){return this._SelectionManager.selectConnection(t)}deselectAll(){return this._SelectionManager.deselectAll()}deleteSelected(){return this._SelectionManager.deleteSelected()}updateViewportTransform(){return this._ViewportManager.updateViewportTransform()}setZoom(t,e,o){return this._ViewportManager.setZoom(t,e,o)}zoomToFit(){return this._ViewportManager.zoomToFit()}autoLayout(t,e){if(!this._LayoutService)return;let o,i;if("string"==typeof t&&""!==t)o=t,i=e||{};else{let t=this._FlowData.LayoutAlgorithm;o="string"==typeof t&&""!==t&&"Custom"!==t?t:"Layered",i=o===this._FlowData.LayoutAlgorithm&&this._FlowData.LayoutParameters||{}}this._LayoutService.autoLayout(this._FlowData.Nodes,this._FlowData.Connections,o,i),this.renderFlow(),this.marshalFromView(),this._EventHandlerProvider&&this._EventHandlerProvider.fireEvent("onFlowChanged",this._FlowData)}applyCurrentLayout(){if(!this._LayoutService)return;let t=this._FlowData.LayoutAlgorithm||"Custom";this._AutoApplyInProgress=!0;try{"Custom"!==t&&this._LayoutService.applyLayout(this._FlowData.Nodes,this._FlowData.Connections,t,this._FlowData.LayoutParameters||{});let e=this._LayoutService.resolveActiveEdgeTheme({});if(e&&"function"==typeof e.AdjustLayout)try{let t=this._LayoutService.getMergedEdgeThemeParameters(e.Name,this._FlowData.EdgeThemeParameters||{});e.AdjustLayout(this._FlowData.Nodes,this._FlowData.Connections,t)}catch(t){this.log.warn("PictSectionFlow edge theme '".concat(e.Name,"' AdjustLayout threw: ").concat(t.message))}let o=!(!e||"function"!=typeof e.AdjustLayout);if(!("Custom"!==t)&&!o)return;this.renderFlow(),this.marshalFromView(),this._EventHandlerProvider&&this._EventHandlerProvider.fireEvent("onFlowChanged",this._FlowData)}finally{this._AutoApplyInProgress=!1}}setEdgeTheme(t,e){if(this._LayoutService&&(null==t||"string"==typeof t)){if(t){let o=this._LayoutService.getEdgeTheme(t);if(!o)return void this.log.warn("PictSectionFlow setEdgeTheme: unknown theme '".concat(t,"'"));this._FlowData.EdgeTheme=t,this._FlowData.EdgeThemeParameters=Object.assign({},o.DefaultParameters||{},e||{})}else this._FlowData.EdgeTheme=null,this._FlowData.EdgeThemeParameters=e?Object.assign({},e):{};this.applyCurrentLayout()}}getEdgeTheme(){let t=this._LayoutService?this._LayoutService.resolveActiveEdgeTheme({}):null;return{Theme:t?t.Name:null,Override:this._FlowData.EdgeTheme||null,Parameters:JSON.parse(JSON.stringify(this._FlowData.EdgeThemeParameters||{}))}}setLayoutAlgorithm(t,e,o){if(!this._LayoutService)return;if("string"!=typeof t||""===t)return;let i=this._LayoutService.getAlgorithm(t);i?(this._FlowData.LayoutAlgorithm=t,this._FlowData.LayoutParameters=Object.assign({},i.DefaultParameters||{},e||{}),"boolean"==typeof o&&(this._FlowData.LayoutAutoApply=o),this.applyCurrentLayout(),this.renderFlow()):this.log.warn("PictSectionFlow setLayoutAlgorithm: unknown algorithm '".concat(t,"'"))}setLayoutAutoApply(t){this._FlowData.LayoutAutoApply=!!t,this.marshalFromView()}getLayoutAlgorithm(){return{Algorithm:this._FlowData.LayoutAlgorithm||"Custom",Parameters:JSON.parse(JSON.stringify(this._FlowData.LayoutParameters||{})),AutoApply:!!this._FlowData.LayoutAutoApply}}_subscribeAutoApplyHandlers(){if(!this._EventHandlerProvider)return;if(this._AutoApplyHandlerHashes.length>0)return;let t=["onNodeAdded","onNodeRemoved","onConnectionCreated","onConnectionRemoved"];for(let e=0;e<t.length;e++){let o=this._EventHandlerProvider.registerHandler(t[e],()=>{this._AutoApplyInProgress||this._FlowData.LayoutAutoApply&&this._FlowData.LayoutAlgorithm&&"Custom"!==this._FlowData.LayoutAlgorithm&&this.applyCurrentLayout()});o&&this._AutoApplyHandlerHashes.push({Event:t[e],Hash:o})}}toggleFullscreen(){return this._ViewportManager.toggleFullscreen()}exitFullscreen(){return this._ViewportManager.exitFullscreen()}setTheme(t){if(!this._ThemeProvider)return void this.log.warn("PictSectionFlow setTheme: ThemeProvider not available");this._ThemeProvider.setTheme(t)&&(this._CSSProvider&&this._CSSProvider.registerCSS(),this._reinjectMarkerDefs(),this.initialRenderComplete&&this.renderFlow(),this._EventHandlerProvider&&this._EventHandlerProvider.fireEvent("onThemeChanged",t))}setNoiseLevel(t){this._ThemeProvider?(this._ThemeProvider.setNoiseLevel(t),this.initialRenderComplete&&this.renderFlow()):this.log.warn("PictSectionFlow setNoiseLevel: ThemeProvider not available")}getNoiseLevel(){return this._ThemeProvider?this._ThemeProvider.getNoiseLevel():0}getThemeKey(){return this._ThemeProvider?this._ThemeProvider.getActiveThemeKey():"default"}_reinjectMarkerDefs(){return this._RenderManager.reinjectMarkerDefs()}getNode(t){return this._FlowData.Nodes.find(e=>e.Hash===t)||null}getConnection(t){return this._FlowData.Connections.find(e=>e.Hash===t)||null}selectTether(t){return this._SelectionManager.selectTether(t)}updateConnectionHandle(t,e,o,i){return this._ConnectionHandleManager.updateConnectionHandle(t,e,o,i)}addConnectionHandle(t,e,o){return this._ConnectionHandleManager.addConnectionHandle(t,e,o)}removeConnectionHandle(t,e){return this._ConnectionHandleManager.removeConnectionHandle(t,e)}_resetHandlesForNode(t){return this._ConnectionHandleManager.resetHandlesForNode(t)}_resetHandlesForPanel(t){return this._ConnectionHandleManager.resetHandlesForPanel(t)}addTetherHandle(t,e,o){let i=this._FlowData.OpenPanels.find(e=>e.Hash===t);if(!i||!this._TetherService)return;let n=this.getNode(i.NodeHash);if(!n)return;let r=this._TetherService.getSmartAnchors(i,n);this._TetherService.addHandle(i,e,o,r.panelAnchor,r.nodeAnchor),this.renderFlow(),this.marshalFromView(),this._EventHandlerProvider&&this._EventHandlerProvider.fireEvent("onFlowChanged",this._FlowData)}removeTetherHandle(t,e){let o=this._FlowData.OpenPanels.find(e=>e.Hash===t);o&&this._TetherService&&(this._TetherService.removeHandle(o,e),this.renderFlow(),this.marshalFromView(),this._EventHandlerProvider&&this._EventHandlerProvider.fireEvent("onFlowChanged",this._FlowData))}updateTetherHandle(t,e,o,i){let n=this._FlowData.OpenPanels.find(e=>e.Hash===t);n&&(this._TetherService&&this._TetherService.updateHandlePosition(n,e,o,i),this._renderSingleTether(t))}getPortPosition(t,e){let o=this.getNode(t);if(!o)return null;let i=o.Ports.find(t=>t.Hash===e);if(!i)return null;let n=o.Ports.filter(t=>t.Side===i.Side),r=n.indexOf(i),a=n.length,l=this._NodeView&&this._NodeView.options.NodeTitleBarHeight||28,s=o.Height||80;if(this._GeometryProvider&&o.Ports&&o.Ports.length>0){let t=this._GeometryProvider.computeMinimumNodeHeight(o.Ports,l);t>s&&(s=t)}let c=this._GeometryProvider.buildPortCountsBySide(o.Ports),d=this._GeometryProvider.getPortLocalPosition(i.Side,r,a,o.Width,s,l,c);return{x:o.X+d.x,y:o.Y+d.y,side:i.Side||"right"}}screenToSVGCoords(t,e){return this._ViewportManager.screenToSVGCoords(t,e)}renderFlow(){return this._RenderManager.renderFlow()}_renderSingleConnection(t){return this._RenderManager.renderSingleConnection(t)}_renderSingleTether(t){return this._RenderManager.renderSingleTether(t)}updateNodePosition(t,e,o){return this._RenderManager.updateNodePosition(t,e,o)}_renderConnectionsForNode(t){return this._RenderManager.renderConnectionsForNode(t)}_renderTethersForNode(t){return this._RenderManager.renderTethersForNode(t)}openPanel(t){return this._PanelManager.openPanel(t)}closePanel(t){return this._PanelManager.closePanel(t)}closePanelForNode(t){return this._PanelManager.closePanelForNode(t)}togglePanel(t){return this._PanelManager.togglePanel(t)}updatePanelPosition(t,e,o){return this._PanelManager.updatePanelPosition(t,e,o)}},e.exports.default_configuration=M},{"../PictFlowCardPropertiesPanel.js":3,"../panels/FlowCardPropertiesPanel-Form.js":4,"../panels/FlowCardPropertiesPanel-Markdown.js":5,"../panels/FlowCardPropertiesPanel-Template.js":6,"../panels/FlowCardPropertiesPanel-View.js":7,"../providers/PictProvider-Flow-CSS.js":8,"../providers/PictProvider-Flow-ConnectorShapes.js":9,"../providers/PictProvider-Flow-EventHandler.js":10,"../providers/PictProvider-Flow-Geometry.js":11,"../providers/PictProvider-Flow-Icons.js":12,"../providers/PictProvider-Flow-Layouts.js":13,"../providers/PictProvider-Flow-NodeTypes.js":14,"../providers/PictProvider-Flow-Noise.js":15,"../providers/PictProvider-Flow-PanelChrome.js":16,"../providers/PictProvider-Flow-SVGHelpers.js":17,"../providers/PictProvider-Flow-Theme.js":18,"../services/PictService-Flow-ConnectionHandleManager.js":35,"../services/PictService-Flow-ConnectionRenderer.js":36,"../services/PictService-Flow-DataManager.js":37,"../services/PictService-Flow-InteractionManager.js":38,"../services/PictService-Flow-Layout.js":39,"../services/PictService-Flow-PanelManager.js":40,"../services/PictService-Flow-PathGenerator.js":41,"../services/PictService-Flow-PortRenderer.js":42,"../services/PictService-Flow-RenderManager.js":43,"../services/PictService-Flow-SelectionManager.js":44,"../services/PictService-Flow-Tether.js":45,"../services/PictService-Flow-ViewportManager.js":46,"./PictView-Flow-FloatingToolbar.js":47,"./PictView-Flow-Node.js":48,"./PictView-Flow-PropertiesPanel.js":49,"./PictView-Flow-Toolbar.js":50,"pict-view":57}],52:[function(t,e,o){e.exports={name:"fable-serviceproviderbase",version:"3.0.19",description:"Simple base classes for fable services.",main:"source/Fable-ServiceProviderBase.js",scripts:{start:"node source/Fable-ServiceProviderBase.js",test:"npx quack test",tests:"npx quack test -g",coverage:"npx quack coverage",build:"npx quack build",types:"tsc -p ./tsconfig.build.json",check:"tsc -p . --noEmit"},types:"types/source/Fable-ServiceProviderBase.d.ts",mocha:{diff:!0,extension:["js"],package:"./package.json",reporter:"spec",slow:"75",timeout:"5000",ui:"tdd","watch-files":["source/**/*.js","test/**/*.js"],"watch-ignore":["lib/vendor"]},repository:{type:"git",url:"https://github.com/fable-retold/fable-serviceproviderbase.git"},keywords:["entity","behavior"],author:"Steven Velozo <steven@velozo.com> (http://velozo.com/)",license:"MIT",bugs:{url:"https://github.com/fable-retold/fable-serviceproviderbase/issues"},homepage:"https://github.com/fable-retold/fable-serviceproviderbase",devDependencies:{"@types/mocha":"^10.0.10",fable:"^3.1.62",quackage:"^1.0.58",typescript:"^5.9.3"}}},{}],53:[function(t,e,o){const i=t("../package.json");class n{constructor(t,e,o){this.fable,this.UUID,this.options,this.services,this.servicesMap,"object"==typeof t&&t.isFable?this.connectFable(t):this.fable=!1,this._PackageFableServiceProvider=i,this.fable?(this.UUID=t.getUUID(),this.options="object"==typeof e?e:{}):(this.options="object"!=typeof t||t.isFable?"object"==typeof e?e:{}:t,this.UUID="CORE-SVC-".concat(Math.floor(89999*Math.random()+1e4))),this.serviceType="Unknown-".concat(this.UUID),this.Hash="string"==typeof o?o:this.fable||"string"!=typeof e?"".concat(this.UUID):e}connectFable(t){if("object"!=typeof t||!t.isFable){let e="Fable Service Provider Base: Cannot connect to Fable, invalid Fable object passed in. The pFable parameter was a [".concat(typeof t,"].}");return console.log(e),new Error(e)}return this.fable||(this.fable=t),this.log||(this.log=this.fable.Logging),this.services||(this.services=this.fable.services),this.servicesMap||(this.servicesMap=this.fable.servicesMap),!0}}_defineProperty(n,"isFableService",!0),e.exports=n,e.exports.CoreServiceProviderBase=n},{"../package.json":52}],54:[function(t,e,o){e.exports={name:"pict-provider",version:"1.0.12",description:"Pict Provider Base Class",main:"source/Pict-Provider.js",scripts:{start:"node source/Pict-Provider.js",test:"npx quack test",tests:"npx quack test -g",coverage:"npx quack coverage",build:"npx quack build","docker-dev-build":"docker build ./ -f Dockerfile_LUXURYCode -t pict-provider-image:local","docker-dev-run":'docker run -it -d --name pict-provider-dev -p 24125:8080 -p 30027:8086 -v "$PWD/.config:/home/coder/.config" -v "$PWD:/home/coder/pict-provider" -u "$(id -u):$(id -g)" -e "DOCKER_USER=$USER" pict-provider-image:local',"docker-dev-shell":"docker exec -it pict-provider-dev /bin/bash",lint:"eslint source/**",types:"tsc -p ."},types:"types/source/Pict-Provider.d.ts",repository:{type:"git",url:"git+https://github.com/fable-retold/pict-provider.git"},author:"steven velozo <steven@velozo.com>",license:"MIT",bugs:{url:"https://github.com/fable-retold/pict-provider/issues"},homepage:"https://github.com/fable-retold/pict-provider#readme",devDependencies:{"@eslint/js":"^9.39.1",eslint:"^9.39.1",pict:"^1.0.351",quackage:"^1.0.58",typescript:"^5.9.3"},dependencies:{"fable-serviceproviderbase":"^3.0.19"},mocha:{diff:!0,extension:["js"],package:"./package.json",reporter:"spec",slow:"75",timeout:"5000",ui:"tdd","watch-files":["source/**/*.js","test/**/*.js"],"watch-ignore":["lib/vendor"]}}},{}],55:[function(t,e,o){const i=t("fable-serviceproviderbase"),n=t("../package.json"),r={ProviderIdentifier:!1,AutoInitialize:!0,AutoInitializeOrdinal:0,AutoLoadDataWithApp:!0,AutoLoadDataOrdinal:0,AutoSolveWithApp:!0,AutoSolveOrdinal:0,Manifests:{},Templates:[]};e.exports=class extends i{constructor(t,e,o){super(t,Object.assign({},JSON.parse(JSON.stringify(r)),e),o),this.fable,this.pict,this.log,this.options,this.UUID,this.Hash,this.options.ProviderIdentifier||(this.options.ProviderIdentifier="AutoProviderID-".concat(this.fable.getUUID())),this.serviceType="PictProvider",this._Package=n,this.pict=this.fable,this.AppData=this.pict.AppData,this.Bundle=this.pict.Bundle,this.initializeTimestamp=!1,this.lastSolvedTimestamp=!1;for(let t=0;t<this.options.Templates.length;t++){let e=this.options.Templates[t];e.hasOwnProperty("Postfix")&&e.hasOwnProperty("Template")?(e.Source||(e.Source="PictProvider [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ProviderIdentifier," options object.")),this.pict.TemplateProvider.addDefaultTemplate(e.Prefix,e.Postfix,e.Template,e.Source)):this.log.error("PictProvider [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ProviderIdentifier," could not load Default Template ").concat(t," in the options array."),e)}}onBeforeInitialize(){return this.pict.LogNoisiness>3&&this.log.trace("PictProvider [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ProviderIdentifier," onBeforeInitialize:")),!0}onBeforeInitializeAsync(t){return this.onBeforeInitialize(),t()}onInitialize(){return this.pict.LogNoisiness>3&&this.log.trace("PictProvider [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ProviderIdentifier," onInitialize:")),!0}onInitializeAsync(t){return this.onInitialize(),t()}initialize(){return this.pict.LogControlFlow&&this.log.trace("PICT-ControlFlow PROVIDER [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ProviderIdentifier," initialize:")),this.initializeTimestamp?(this.log.warn("PictProvider [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ProviderIdentifier," initialize called but initialization is already completed. Aborting.")),!1):(this.onBeforeInitialize(),this.onInitialize(),this.onAfterInitialize(),this.initializeTimestamp=this.pict.log.getTimeStamp(),!0)}initializeAsync(t){if(this.pict.LogControlFlow&&this.log.trace("PICT-ControlFlow PROVIDER [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ProviderIdentifier," initializeAsync:")),this.initializeTimestamp)return this.log.warn("PictProvider [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ProviderIdentifier," async initialize called but initialization is already completed. Aborting.")),t();{let e=this.pict.instantiateServiceProviderWithoutRegistration("Anticipate");this.pict.LogNoisiness>0&&this.log.info("PictProvider [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ProviderIdentifier," beginning initialization...")),e.anticipate(this.onBeforeInitializeAsync.bind(this)),e.anticipate(this.onInitializeAsync.bind(this)),e.anticipate(this.onAfterInitializeAsync.bind(this)),e.wait(e=>(this.initializeTimestamp=this.pict.log.getTimeStamp(),e?this.log.error("PictProvider [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ProviderIdentifier," initialization failed: ").concat(e.message||e),{Stack:e.stack}):this.pict.LogNoisiness>0&&this.log.info("PictProvider [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ProviderIdentifier," initialization complete.")),t()))}}onAfterInitialize(){return this.pict.LogNoisiness>3&&this.log.trace("PictProvider [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ProviderIdentifier," onAfterInitialize:")),!0}onAfterInitializeAsync(t){return this.onAfterInitialize(),t()}onPreRender(){return this.pict.LogNoisiness>3&&this.log.trace("PictProvider [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ProviderIdentifier," onPreRender:")),!0}onPreRenderAsync(t){return this.onPreRender(),t()}render(){return this.onPreRender()}renderAsync(t){return this.onPreRender(),t()}onPreSolve(){return this.pict.LogNoisiness>3&&this.log.trace("PictProvider [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ProviderIdentifier," onPreSolve:")),!0}onPreSolveAsync(t){return this.onPreSolve(),t()}solve(){return this.onPreSolve()}solveAsync(t){return this.onPreSolve(),t()}onBeforeLoadDataAsync(t){return t()}onLoadDataAsync(t){return this.pict.LogNoisiness>3&&this.log.trace("PictProvider [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ProviderIdentifier," onLoadDataAsync:")),t()}onAfterLoadDataAsync(t){return t()}onBeforeSaveDataAsync(t){return t()}onSaveDataAsync(t){return this.pict.LogNoisiness>3&&this.log.trace("PictProvider [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ProviderIdentifier," onSaveDataAsync:")),t()}onAfterSaveDataAsync(t){return t()}}},{"../package.json":54,"fable-serviceproviderbase":53}],56:[function(t,e,o){e.exports={name:"pict-view",version:"1.0.68",description:"Pict View Base Class",main:"source/Pict-View.js",scripts:{test:"npx quack test",tests:"npx quack test -g",start:"node source/Pict-View.js",coverage:"npx quack coverage",build:"npx quack build","docker-dev-build":"docker build ./ -f Dockerfile_LUXURYCode -t pict-view-image:local","docker-dev-run":'docker run -it -d --name pict-view-dev -p 30001:8080 -p 38086:8086 -v "$PWD/.config:/home/coder/.config" -v "$PWD:/home/coder/pict-view" -u "$(id -u):$(id -g)" -e "DOCKER_USER=$USER" pict-view-image:local',"docker-dev-shell":"docker exec -it pict-view-dev /bin/bash",types:"tsc -p .",lint:"eslint source/**"},types:"types/source/Pict-View.d.ts",repository:{type:"git",url:"git+https://github.com/fable-retold/pict-view.git"},author:"steven velozo <steven@velozo.com>",license:"MIT",bugs:{url:"https://github.com/fable-retold/pict-view/issues"},homepage:"https://github.com/fable-retold/pict-view#readme",devDependencies:{"@eslint/js":"^9.39.1","browser-env":"^3.3.0",eslint:"^9.39.1",pict:"^1.0.363",quackage:"^1.0.65",typescript:"^5.9.3"},mocha:{diff:!0,extension:["js"],package:"./package.json",reporter:"spec",slow:"75",timeout:"5000",ui:"tdd","watch-files":["source/**/*.js","test/**/*.js"],"watch-ignore":["lib/vendor"]},dependencies:{fable:"^3.1.67","fable-serviceproviderbase":"^3.0.19"}}},{}],57:[function(t,e,o){const i=t("fable-serviceproviderbase"),n=t("../package.json"),r={DefaultRenderable:!1,DefaultDestinationAddress:!1,DefaultTemplateRecordAddress:!1,ViewIdentifier:!1,AutoInitialize:!0,AutoInitializeOrdinal:0,AutoRender:!0,AutoRenderOrdinal:0,AutoSolveWithApp:!0,AutoSolveOrdinal:0,CSSHash:!1,CSS:!1,CSSProvider:!1,CSSPriority:500,Templates:[],DefaultTemplates:[],Renderables:[],Manifests:{}};e.exports=class extends i{constructor(t,e,o){super(t,Object.assign({},JSON.parse(JSON.stringify(r)),e),o),this.fable,this.options,this.UUID,this.Hash,this.log;const i=this.Hash===this.UUID;this.UUID="V-".concat(this.UUID),i&&(this.Hash=this.UUID),this.options.ViewIdentifier||(this.options.ViewIdentifier="AutoViewID-".concat(this.fable.getUUID())),this.serviceType="PictView",this._Package=n,this.pict=this.fable,this.AppData=this.pict.AppData,this.Bundle=this.pict.Bundle,this.initializeTimestamp=!1,this.lastSolvedTimestamp=!1,this.lastRenderedTimestamp=!1,this.lastMarshalFromViewTimestamp=!1,this.lastMarshalToViewTimestamp=!1,this.pict.instantiateServiceProviderIfNotExists("TransactionTracking");for(let t=0;t<this.options.Templates.length;t++){let e=this.options.Templates[t];"Hash"in e&&"Template"in e?(e.Source||(e.Source="PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," options object.")),this.pict.TemplateProvider.addTemplate(e.Hash,e.Template,e.Source)):this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not load Template ").concat(t," in the options array."),e)}for(let t=0;t<this.options.DefaultTemplates.length;t++){let e=this.options.DefaultTemplates[t];"Postfix"in e&&"Template"in e?(e.Source||(e.Source="PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," options object.")),this.pict.TemplateProvider.addDefaultTemplate(e.Prefix,e.Postfix,e.Template,e.Source)):this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not load Default Template ").concat(t," in the options array."),e)}if(this.options.CSS){let t=this.options.CSSHash?this.options.CSSHash:"View-".concat(this.options.ViewIdentifier),e=this.options.CSSProvider?this.options.CSSProvider:t;this.pict.CSSMap.addCSS(t,this.options.CSS,e,this.options.CSSPriority)}this.renderables={};for(let t=0;t<this.options.Renderables.length;t++){let e=this.options.Renderables[t];this.addRenderable(e)}}addRenderable(t,e,o,i,n){let r;if("object"==typeof t)r=t;else{r={RenderableHash:t,TemplateHash:e,DefaultTemplateRecordAddress:o,ContentDestinationAddress:i,RenderMethod:"string"!=typeof n?n:"replace"}}"string"!=typeof r.RenderableHash||"string"!=typeof r.TemplateHash?this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not load Renderable; RenderableHash or TemplateHash are invalid."),r):(this.pict.LogNoisiness>0&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," adding renderable [").concat(r.RenderableHash,"] pointed to template ").concat(r.TemplateHash,".")),this.renderables[r.RenderableHash]=r)}onBeforeInitialize(){return this.pict.LogNoisiness>3&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onBeforeInitialize:")),!0}onBeforeInitializeAsync(t){return this.onBeforeInitialize(),t()}onInitialize(){return this.pict.LogNoisiness>3&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onInitialize:")),!0}onInitializeAsync(t){return this.onInitialize(),t()}initialize(){return this.pict.LogControlFlow&&this.log.trace("PICT-ControlFlow VIEW [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," initialize:")),this.initializeTimestamp?(this.log.warn("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," initialize called but initialization is already completed. Aborting.")),!1):(this.onBeforeInitialize(),this.onInitialize(),this.onAfterInitialize(),this.initializeTimestamp=this.pict.log.getTimeStamp(),!0)}initializeAsync(t){if(this.pict.LogControlFlow&&this.log.trace("PICT-ControlFlow VIEW [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," initializeAsync:")),this.initializeTimestamp)return this.log.warn("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," async initialize called but initialization is already completed. Aborting.")),t();{let e=this.pict.instantiateServiceProviderWithoutRegistration("Anticipate");this.pict.LogNoisiness>0&&this.log.info("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," beginning initialization...")),e.anticipate(this.onBeforeInitializeAsync.bind(this)),e.anticipate(this.onInitializeAsync.bind(this)),e.anticipate(this.onAfterInitializeAsync.bind(this)),e.wait(e=>(e&&this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," initialization failed: ").concat(e.message||e),{stack:e.stack}),this.initializeTimestamp=this.pict.log.getTimeStamp(),this.pict.LogNoisiness>0&&this.log.info("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," initialization complete.")),t()))}}onAfterInitialize(){return this.pict.LogNoisiness>3&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onAfterInitialize:")),!0}onAfterInitializeAsync(t){return this.onAfterInitialize(),t()}onBeforeRender(t){return this.pict.LogNoisiness>3&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onBeforeRender:")),!0}onBeforeRenderAsync(t,e){return this.onBeforeRender(e),t()}onBeforeProject(t){return this.pict.LogNoisiness>3&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onBeforeProject:")),!0}onBeforeProjectAsync(t,e){return this.onBeforeProject(e),t()}buildRenderOptions(t,e,o){let i={Valid:!0};return i.RenderableHash="string"==typeof t?t:"string"==typeof this.options.DefaultRenderable&&this.options.DefaultRenderable,i.RenderableHash||(this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not find a suitable RenderableHash ").concat(i.RenderableHash," (param ").concat(t,"because it is not a valid renderable.")),i.Valid=!1),i.Renderable=this.renderables[i.RenderableHash],i.Renderable||(this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render ").concat(i.RenderableHash," (param ").concat(t,") because it does not exist.")),i.Valid=!1),i.DestinationAddress="string"==typeof e?e:"string"==typeof i.Renderable.ContentDestinationAddress?i.Renderable.ContentDestinationAddress:"string"==typeof this.options.DefaultDestinationAddress&&this.options.DefaultDestinationAddress,i.DestinationAddress||(this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render ").concat(i.RenderableHash," (param ").concat(t,") because it does not have a valid destination address (param ").concat(e,").")),i.Valid=!1),"object"==typeof o?(i.RecordAddress="Passed in as object",i.Record=o):(i.RecordAddress="string"==typeof o?o:"string"==typeof i.Renderable.DefaultTemplateRecordAddress?i.Renderable.DefaultTemplateRecordAddress:"string"==typeof this.options.DefaultTemplateRecordAddress&&this.options.DefaultTemplateRecordAddress,i.Record="string"==typeof i.RecordAddress?this.pict.DataProvider.getDataByAddress(i.RecordAddress):void 0),i}assignRenderContent(t,e,o){return this.pict.ContentAssignment.projectContent(t.RenderMethod,e,o,t.TestAddress)}render(t,e,o,i){return this.renderWithScope(this,t,e,o,i)}renderWithScope(t,e,o,i,n){let r,a,l,s="string"==typeof e?e:"string"==typeof this.options.DefaultRenderable&&this.options.DefaultRenderable;return s?("__Virtual"==s?r={RenderableHash:"__Virtual",TemplateHash:this.renderables[this.options.DefaultRenderable].TemplateHash,ContentDestinationAddress:"string"==typeof o?o:"string"==typeof r.ContentDestinationAddress?r.ContentDestinationAddress:"string"==typeof this.options.DefaultDestinationAddress?this.options.DefaultDestinationAddress:null,RenderMethod:"virtual-assignment",TransactionHash:n&&n.TransactionHash,RootRenderableViewHash:n&&n.RootRenderableViewHash}:(r=Object.assign({},this.renderables[s]),r.ContentDestinationAddress="string"==typeof o?o:"string"==typeof r.ContentDestinationAddress?r.ContentDestinationAddress:"string"==typeof this.options.DefaultDestinationAddress?this.options.DefaultDestinationAddress:null),r.TransactionHash||(r.TransactionHash="ViewRender-V-".concat(this.options.ViewIdentifier,"-R-").concat(s,"-U-").concat(this.pict.getUUID()),r.RootRenderableViewHash=this.Hash,this.pict.TransactionTracking.registerTransaction(r.TransactionHash)),r?r.ContentDestinationAddress?("object"==typeof i?(l=i,a="Passed in as object"):(a="string"==typeof i?i:"string"==typeof r.DefaultTemplateRecordAddress?r.DefaultTemplateRecordAddress:"string"==typeof this.options.DefaultTemplateRecordAddress&&this.options.DefaultTemplateRecordAddress,l="string"==typeof a?this.pict.DataProvider.getDataByAddress(a):void 0),this.onBeforeRender(r),this.pict.LogControlFlow&&this.log.trace("PICT-ControlFlow VIEW [".concat(this.UUID,"]::[").concat(this.Hash,"] Renderable[").concat(s,"] Destination[").concat(r.ContentDestinationAddress,"] TemplateRecordAddress[").concat(a,"] render:")),this.pict.LogNoisiness>0&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," Beginning Render of Renderable[").concat(s,"] to Destination [").concat(r.ContentDestinationAddress,"]...")),r.Content=this.pict.parseTemplateByHash(r.TemplateHash,l,null,[this],t,{RootRenderable:"object"==typeof n?n:r}),this.pict.LogNoisiness>0&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," Assigning Renderable[").concat(s,"] content length ").concat(r.Content.length," to Destination [").concat(r.ContentDestinationAddress,"] using render method [").concat(r.RenderMethod,"].")),this.onBeforeProject(r),this.onProject(r),"virtual-assignment"!==r.RenderMethod&&(this.onAfterProject(r),this.onAfterRender(r)),!0):(this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render ").concat(s," (param ").concat(e,") because it does not have a valid destination address.")),!1):(this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render ").concat(s," (param ").concat(e,") because it does not exist.")),!1)):(this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render ").concat(s," (param ").concat(e,") because it is not a valid renderable.")),!1)}renderAsync(t,e,o,i,n){return this.renderWithScopeAsync(this,t,e,o,i,n)}renderWithScopeAsync(t,e,o,i,n,r){let a,l,s,c="string"==typeof e?e:"string"==typeof this.options.DefaultRenderable&&this.options.DefaultRenderable,d="function"==typeof r?r:"function"==typeof i?i:"function"==typeof o?o:"function"==typeof e?e:"function"==typeof n?n:null;if(d||(this.log.warn("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," renderAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.")),d=t=>{t&&this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," renderAsync Auto Callback Error: ").concat(t),t)}),!c)return this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not asynchronously render ").concat(c," (param ").concat(e,"because it is not a valid renderable.")),d(new Error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not asynchronously render ").concat(c," (param ").concat(e,"because it is not a valid renderable.")));if("__Virtual"==c?a={RenderableHash:"__Virtual",TemplateHash:this.renderables[this.options.DefaultRenderable].TemplateHash,ContentDestinationAddress:"string"==typeof o?o:"string"==typeof this.options.DefaultDestinationAddress?this.options.DefaultDestinationAddress:null,RenderMethod:"virtual-assignment",TransactionHash:n&&"function"!=typeof n&&n.TransactionHash,RootRenderableViewHash:n&&"function"!=typeof n&&n.RootRenderableViewHash}:(a=Object.assign({},this.renderables[c]),a.ContentDestinationAddress="string"==typeof o?o:"string"==typeof a.ContentDestinationAddress?a.ContentDestinationAddress:"string"==typeof this.options.DefaultDestinationAddress?this.options.DefaultDestinationAddress:null),a.TransactionHash||(a.TransactionHash="ViewRender-V-".concat(this.options.ViewIdentifier,"-R-").concat(c,"-U-").concat(this.pict.getUUID()),a.RootRenderableViewHash=this.Hash,this.pict.TransactionTracking.registerTransaction(a.TransactionHash)),!a)return this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render ").concat(c," (param ").concat(e,") because it does not exist.")),d(new Error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render ").concat(c," (param ").concat(e,") because it does not exist.")));if(!a.ContentDestinationAddress)return this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render ").concat(c," (param ").concat(e,") because it does not have a valid destination address.")),d(new Error("Could not render ".concat(c)));"object"==typeof i?(s=i,l="Passed in as object"):(l="string"==typeof i?i:"string"==typeof a.DefaultTemplateRecordAddress?a.DefaultTemplateRecordAddress:"string"==typeof this.options.DefaultTemplateRecordAddress&&this.options.DefaultTemplateRecordAddress,s="string"==typeof l?this.pict.DataProvider.getDataByAddress(l):void 0),this.pict.LogControlFlow&&this.log.trace("PICT-ControlFlow VIEW [".concat(this.UUID,"]::[").concat(this.Hash,"] Renderable[").concat(c,"] Destination[").concat(a.ContentDestinationAddress,"] TemplateRecordAddress[").concat(l,"] renderAsync:")),this.pict.LogNoisiness>2&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," Beginning Asynchronous Render (callback-style)..."));let h=this.fable.newAnticipate();h.anticipate(t=>{this.onBeforeRenderAsync(t,a)}),h.anticipate(o=>{this.pict.parseTemplateByHash(a.TemplateHash,s,(t,i)=>t?(this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render (asynchronously) ").concat(c," (param ").concat(e,") because it did not parse the template."),t),o(t)):(a.Content=i,o()),[this],t,{RootRenderable:"object"==typeof n?n:a})}),h.anticipate(t=>{this.onBeforeProjectAsync(t,a)}),h.anticipate(t=>{this.onProjectAsync(t,a)}),"virtual-assignment"!==a.RenderMethod&&(h.anticipate(t=>{this.onAfterProjectAsync(t,a)}),h.anticipate(t=>{this.onAfterRenderAsync(t,a)})),h.wait(d)}renderDefaultAsync(t){this.renderAsync(t)}basicRender(t,e,o){return this.basicRenderWithScope(this,t,e,o)}basicRenderWithScope(t,e,o,i){let n=this.buildRenderOptions(e,o,i);return n.Valid?(this.assignRenderContent(n.Renderable,n.DestinationAddress,this.pict.parseTemplateByHash(n.Renderable.TemplateHash,n.Record,null,[this],t,{RootRenderable:n.Renderable})),!0):(this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not perform a basic render of ").concat(n.RenderableHash," because it is not valid.")),!1)}basicRenderAsync(t,e,o,i){return this.basicRenderWithScopeAsync(this,t,e,o,i)}basicRenderWithScopeAsync(t,e,o,i,n){let r="function"==typeof n?n:"function"==typeof i?i:"function"==typeof o?o:"function"==typeof e?e:null;r||(this.log.warn("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," basicRenderAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.")),r=t=>{t&&this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," basicRenderAsync Auto Callback Error: ").concat(t),t)});const a=this.buildRenderOptions(e,o,i);if(!a.Valid){let t="PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not perform a basic render of ").concat(a.RenderableHash," because it is not valid.");return this.log.error(t),r(new Error(t))}this.pict.parseTemplateByHash(a.Renderable.TemplateHash,a.Record,(t,e)=>t?(this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," could not render (asynchronously) ").concat(a.RenderableHash," because it did not parse the template."),t),r(t)):(this.assignRenderContent(a.Renderable,a.DestinationAddress,e),r()),[this],t,{RootRenderable:a.Renderable})}onProject(t){this.pict.LogNoisiness>3&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onProject:")),"virtual-assignment"===t.RenderMethod&&this.pict.TransactionTracking.pushToTransactionQueue(t.TransactionHash,{ViewHash:this.Hash,Renderable:t},"Deferred-Post-Content-Assignment"),this.pict.LogNoisiness>0&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," Assigning Renderable[").concat(t.RenderableHash,"] content length ").concat(t.Content.length," to Destination [").concat(t.ContentDestinationAddress,"] using Async render method ").concat(t.RenderMethod,".")),this.pict.ContentAssignment.projectContent(t.RenderMethod,t.ContentDestinationAddress,t.Content,t.TestAddress),this.lastRenderedTimestamp=this.pict.log.getTimeStamp()}onProjectAsync(t,e){return this.onProject(e),t()}onAfterRender(t){if(this.pict.LogNoisiness>3&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onAfterRender:")),t&&t.RootRenderableViewHash===this.Hash){const e=this.pict.TransactionTracking.clearTransactionQueue(t.TransactionHash)||[];for(const o of e){const e=this.pict.views[o.Data.ViewHash];e?(e.onAfterProject(),e.onAfterRender(o.Data.Renderable)):this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onAfterRender: Could not find view for transaction hash ").concat(t.TransactionHash," and ViewHash ").concat(o.Data.ViewHash,"."))}this.pict.TransactionTracking.unregisterTransaction(t.TransactionHash)}return!0}onAfterRenderAsync(t,e){this.onAfterRender(e);const o=this.fable.newAnticipate(),i=e&&e.RootRenderableViewHash===this.Hash;if(i){const t=this.pict.TransactionTracking.clearTransactionQueue(e.TransactionHash)||[];for(const i of t){const t=this.pict.views[i.Data.ViewHash];t?(o.anticipate(t.onAfterProjectAsync.bind(t)),o.anticipate(e=>{t.onAfterRenderAsync(e,i.Data.Renderable)})):this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onAfterRenderAsync: Could not find view for transaction hash ").concat(e.TransactionHash," and ViewHash ").concat(i.Data.ViewHash,"."))}}return o.wait(o=>(i&&e&&e.TransactionHash&&this.pict.TransactionTracking.unregisterTransaction(e.TransactionHash),t(o)))}onAfterProject(t){return this.pict.LogNoisiness>3&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onAfterProject:")),!0}onAfterProjectAsync(t,e){return t()}onBeforeSolve(){return this.pict.LogNoisiness>3&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onBeforeSolve:")),!0}onBeforeSolveAsync(t){return this.onBeforeSolve(),t()}onSolve(){return this.pict.LogNoisiness>3&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onSolve:")),!0}onSolveAsync(t){return this.onSolve(),t()}solve(){return this.pict.LogNoisiness>2&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," executing solve() function...")),this.onBeforeSolve(),this.onSolve(),this.onAfterSolve(),this.lastSolvedTimestamp=this.pict.log.getTimeStamp(),!0}solveAsync(t){let e=this.pict.instantiateServiceProviderWithoutRegistration("Anticipate"),o="function"==typeof t?t:null;o||(this.log.warn("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," solveAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.")),o=t=>{t&&this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," solveAsync Auto Callback Error: ").concat(t),t)}),e.anticipate(this.onBeforeSolveAsync.bind(this)),e.anticipate(this.onSolveAsync.bind(this)),e.anticipate(this.onAfterSolveAsync.bind(this)),e.wait(t=>(this.pict.LogNoisiness>2&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," solveAsync() complete.")),this.lastSolvedTimestamp=this.pict.log.getTimeStamp(),o(t)))}onAfterSolve(){return this.pict.LogNoisiness>3&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onAfterSolve:")),!0}onAfterSolveAsync(t){return this.onAfterSolve(),t()}onBeforeMarshalFromView(){return this.pict.LogNoisiness>3&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onBeforeMarshalFromView:")),!0}onBeforeMarshalFromViewAsync(t){return this.onBeforeMarshalFromView(),t()}onMarshalFromView(){return this.pict.LogNoisiness>3&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onMarshalFromView:")),!0}onMarshalFromViewAsync(t){return this.onMarshalFromView(),t()}marshalFromView(){return this.pict.LogNoisiness>2&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," executing solve() function...")),this.onBeforeMarshalFromView(),this.onMarshalFromView(),this.onAfterMarshalFromView(),this.lastMarshalFromViewTimestamp=this.pict.log.getTimeStamp(),!0}marshalFromViewAsync(t){let e=this.pict.instantiateServiceProviderWithoutRegistration("Anticipate"),o="function"==typeof t?t:null;o||(this.log.warn("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," marshalFromViewAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.")),o=t=>{t&&this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," marshalFromViewAsync Auto Callback Error: ").concat(t),t)}),e.anticipate(this.onBeforeMarshalFromViewAsync.bind(this)),e.anticipate(this.onMarshalFromViewAsync.bind(this)),e.anticipate(this.onAfterMarshalFromViewAsync.bind(this)),e.wait(t=>(this.pict.LogNoisiness>2&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," marshalFromViewAsync() complete.")),this.lastMarshalFromViewTimestamp=this.pict.log.getTimeStamp(),o(t)))}onAfterMarshalFromView(){return this.pict.LogNoisiness>3&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onAfterMarshalFromView:")),!0}onAfterMarshalFromViewAsync(t){return this.onAfterMarshalFromView(),t()}onBeforeMarshalToView(){return this.pict.LogNoisiness>3&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onBeforeMarshalToView:")),!0}onBeforeMarshalToViewAsync(t){return this.onBeforeMarshalToView(),t()}onMarshalToView(){return this.pict.LogNoisiness>3&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onMarshalToView:")),!0}onMarshalToViewAsync(t){return this.onMarshalToView(),t()}marshalToView(){return this.pict.LogNoisiness>2&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," executing solve() function...")),this.onBeforeMarshalToView(),this.onMarshalToView(),this.onAfterMarshalToView(),this.lastMarshalToViewTimestamp=this.pict.log.getTimeStamp(),!0}marshalToViewAsync(t){let e=this.pict.instantiateServiceProviderWithoutRegistration("Anticipate"),o="function"==typeof t?t:null;o||(this.log.warn("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," marshalToViewAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.")),o=t=>{t&&this.log.error("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.Name," marshalToViewAsync Auto Callback Error: ").concat(t),t)}),e.anticipate(this.onBeforeMarshalToViewAsync.bind(this)),e.anticipate(this.onMarshalToViewAsync.bind(this)),e.anticipate(this.onAfterMarshalToViewAsync.bind(this)),e.wait(t=>(this.pict.LogNoisiness>2&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," marshalToViewAsync() complete.")),this.lastMarshalToViewTimestamp=this.pict.log.getTimeStamp(),o(t)))}onAfterMarshalToView(){return this.pict.LogNoisiness>3&&this.log.trace("PictView [".concat(this.UUID,"]::[").concat(this.Hash,"] ").concat(this.options.ViewIdentifier," onAfterMarshalToView:")),!0}onAfterMarshalToViewAsync(t){return this.onAfterMarshalToView(),t()}get isPictView(){return!0}}},{"../package.json":56,"fable-serviceproviderbase":53}]},{},[1])(1)});
|
|
2
|
-
//# sourceMappingURL=pict-section-flow.min.js.map
|