===== view.generated.mbt =====
// Generated by selene-xaml@0.37.3. DO NOT EDIT.
// input user fixtures/brush.xaml sha256=55aab9c59de26d65860a4f2deb622000444c6083c94be58e6307fb75c31e611f
// input moon-info fixtures/model.mbti sha256=9156b8844535e520b65cd75ccbee0e30fbd579fdb011227309bc4d2a816854f0

///|
type BrushState = @model.BrushState

///|
pub(all) enum BrushViewAction {} derive(Eq, Debug)

///|
#warnings("-unused_value")
fn generated_rect_component(
  value : String,
  index : Int,
  path : String,
  image_region : Bool,
  corner_radius : Bool,
  non_negative : Bool,
) -> Double raise {
  @xaml_view.generated_view_rect_component(
    value,
    index,
    path,
    image_region,
    corner_radius~,
    non_negative~,
  )
}

///|
#warnings("-unused_value")
fn generated_image_drop_shadow(
  value : String,
  path : String,
) -> @xaml_view.ImageDropShadow? raise {
  @xaml_view.generated_view_image_drop_shadow(value, path)
}

///|
#warnings("-struct_never_constructed")
pub struct BrushView {}

///|
let generated_runtime : @xaml_view.GeneratedViewRuntime[
  BrushState,
  BrushViewAction,
] = @xaml_view.GeneratedViewRuntime::new(generated_handle_event)

///|
/// World-isolated typed actions emitted by this view.
pub let action_event_bus : @event.Events[
  @xaml_view.GeneratedViewAction[BrushViewAction],
] = generated_runtime.action_events()

///|
/// ViewModel components mounted by this View in the current World.
pub fn BrushView::view_models() -> Map[@entity.Entity, BrushState] {
  generated_runtime.view_models()
}

///|
#warnings("-unused_error_type")
fn generated_specs(state : BrushState) -> Array[@xaml_view.NodeSpec] raise {
  let nodes : Array[@xaml_view.NodeSpec] = []
  nodes.push({
    key: "node-root-view",
    parent: None,
    kind: @xaml_view.NodeKind::View,
    text: "",
    spans: [],
    source: "",
    path_geometry: None,
    active: true,
    enabled: true,
    focusable: false,
    tab_index: 0,
    focus_scope: false,
    auto_focus: false,
    navigation_up: "",
    navigation_down: "",
    navigation_left: "",
    navigation_right: "",
    automation_name: "",
    style: { ..@xaml_view.NodeStyle::default() },
    visual_state_groups: [],
  })
  nodes.push({
    key: "panel",
    parent: Some("node-root-view"),
    kind: @xaml_view.NodeKind::Flex,
    text: "",
    spans: [],
    source: "",
    path_geometry: None,
    active: true,
    enabled: true,
    focusable: false,
    tab_index: 0,
    focus_scope: false,
    auto_focus: false,
    navigation_up: "",
    navigation_down: "",
    navigation_left: "",
    navigation_right: "",
    automation_name: "",
    style: {
      ..@xaml_view.NodeStyle::default(),
      background: @xaml_view.Brush::LinearGradient({
        start_x: 0.25,
        start_y: 0,
        end_x: 0.75,
        end_y: 1,
        stops: [
          { offset: 0.2, color: "#4D2C20" },
          { offset: 0.5, color: "#815432" },
          { offset: 0.8, color: "#211411" },
        ],
      }),
      border_brush: "#E19D4C",
      border_thickness: { left: 7, top: 2, right: 2, bottom: 7 },
      corner_radius: {
        top_left: 30,
        top_right: 12,
        bottom_right: 30,
        bottom_left: 12,
      },
      box_shadow: [
        {
          x_offset: 0,
          y_offset: 8,
          blur_radius: 24,
          spread_radius: 2,
          color: "#070403AD",
        },
      ],
    },
    visual_state_groups: [
      {
        order: 0,
        name: "Presentation",
        current: "Focused",
        interaction: false,
        states: [
          {
            name: "Focused",
            setters: [
              {
                target: "panel",
                property: "BorderThickness",
                value: @xaml_view.VisualStateValue::ThicknessValue({
                  left: 8,
                  top: 3,
                  right: 4,
                  bottom: 5,
                }),
              },
              {
                target: "panel",
                property: "CornerRadius",
                value: @xaml_view.VisualStateValue::CornerRadiusValue({
                  top_left: 24,
                  top_right: 10,
                  bottom_right: 18,
                  bottom_left: 6,
                }),
              },
              {
                target: "panel",
                property: "BoxShadow",
                value: @xaml_view.VisualStateValue::BoxShadowValue([
                  {
                    x_offset: 0,
                    y_offset: 2,
                    blur_radius: 8,
                    spread_radius: 0,
                    color: "#00000080",
                  },
                  {
                    x_offset: 0,
                    y_offset: 0,
                    blur_radius: 0,
                    spread_radius: 1,
                    color: "#FFFFFF20",
                  },
                ]),
              },
            ],
          },
        ],
        transitions: [],
      },
    ],
  })
  nodes
}

///|
/// Mounts this view on an alive root entity in the current world.
/// Destroying the root ends the view lifetime.
pub fn BrushView::mount(
  entity : @entity.Entity,
  view_model : BrushState,
) -> Unit raise {
  let desired = generated_specs(view_model)
  generated_runtime.mount(entity, view_model, desired)
}

///|
/// Releases this View while leaving its caller-owned root entity alive.
pub fn BrushView::unmount(entity : @entity.Entity) -> Unit raise {
  generated_runtime.unmount(entity)
}

///|
/// Refreshes the complete presentation from the current ViewModel component.
pub fn BrushView::refresh(entity : @entity.Entity) -> Unit raise {
  let view_model = generated_runtime.view_model(entity)
  let desired = generated_specs(view_model)
  generated_runtime.refresh(entity, desired)
}

///|
/// Reconciles this mounted View with a new ViewModel.
pub fn BrushView::replace(
  entity : @entity.Entity,
  view_model : BrushState,
) -> Unit raise {
  let desired = generated_specs(view_model)
  generated_runtime.replace(entity, view_model, desired)
}

///|
#warnings("-unused_value")
fn generated_handle_event(
  view_model : BrushState,
  event : @xaml_view.UiEvent,
) -> BrushViewAction? {
  None
}

///|
/// Installs this View below a root generated View that owns the shared host.
pub fn component_plugin(app : @app.App) -> @app.App {
  generated_runtime.install_component(app, "selene_xaml_BrushView_events")
}

///|
/// Installs the shared host and this View package component tree.
pub fn plugin(app : @app.App) -> @app.App {
  app.add_plugin(@xaml_view.plugin).add_plugin(component_plugin)
}

