/**
* PHP helper template for compound parent alternate render targets.
*
* @remarks Consumed by `buildCompoundArtifacts()` for email, MJML,
* plain-text, and web render entries with block identity, namespace, text
* domain, storage, policy, CSS class, and title placeholders.
*/
export declare const COMPOUND_PERSISTENCE_RENDER_TARGETS_TEMPLATE = "apply_defaults( is_array( $attributes ) ? $attributes : array() );\n\t\t$validation = $validator->validate( $normalized );\n\t\t// Preserve the former implicit default only for legacy blocks that omit the key.\n\t\t// Explicitly stored empty keys remain invalid.\n\t\t$resource_key = array_key_exists( 'resourceKey', $normalized ) ? (string) $normalized['resourceKey'] : 'primary';\n\t\t$heading = isset( $normalized['heading'] ) ? (string) $normalized['heading'] : {{titlePhpLiteral}};\n\t\t$intro = isset( $normalized['intro'] ) ? (string) $normalized['intro'] : '';\n\t\t$button_label = isset( $normalized['buttonLabel'] ) ? (string) $normalized['buttonLabel'] : 'Persist Count';\n\t\t$show_count = ! empty( $normalized['showCount'] );\n\t\t$show_dividers = ! empty( $normalized['showDividers'] );\n\t\t$post_id = is_object( $block ) && isset( $block->context['postId'] )\n\t\t\t? (int) $block->context['postId']\n\t\t\t: (int) get_queried_object_id();\n\t\t$storage_mode = '{{dataStorageMode}}';\n\t\t$persistence_policy = '{{persistencePolicy}}';\n\n\t\t$notice_message = 'authenticated' === $persistence_policy\n\t\t\t? __( 'Sign in to persist this counter.', '{{textDomain}}' )\n\t\t\t: __( 'Public writes are temporarily unavailable.', '{{textDomain}}' );\n\n\t\tif ( empty( $validation['valid'] ) || '' === $resource_key ) {\n\t\t\treturn null;\n\t\t}\n\n\t\t{{phpPrefix}}_record_rendered_block_instance(\n\t\t\t(int) $post_id,\n\t\t\t'{{namespace}}/{{slugKebabCase}}',\n\t\t\t$resource_key\n\t\t);\n\n\t\t$web_context = array(\n\t\t\t'bootstrapReady' => false,\n\t\t\t'buttonLabel' => $button_label,\n\t\t\t'canWrite' => false,\n\t\t\t'client' => array(\n\t\t\t\t'writeExpiry' => 0,\n\t\t\t\t'writeNonce' => '',\n\t\t\t\t'writeToken' => '',\n\t\t\t),\n\t\t\t'count' => 0,\n\t\t\t'error' => '',\n\t\t\t'isBootstrapping' => false,\n\t\t\t'isLoading' => false,\n\t\t\t'isSaving' => false,\n\t\t\t'persistencePolicy' => $persistence_policy,\n\t\t\t'postId' => (int) $post_id,\n\t\t\t'resourceKey' => $resource_key,\n\t\t\t'showCount' => $show_count,\n\t\t\t'storage' => $storage_mode,\n\t\t);\n\n\t\t$allowed_inner_html = wp_kses_allowed_html( 'post' );\n\n\t\tforeach ( $allowed_inner_html as &$allowed_attributes ) {\n\t\t\tif ( ! is_array( $allowed_attributes ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$allowed_attributes['data-wp-bind--disabled'] = true;\n\t\t\t$allowed_attributes['data-wp-bind--hidden'] = true;\n\t\t\t$allowed_attributes['data-wp-bind--value'] = true;\n\t\t\t$allowed_attributes['data-wp-class'] = true;\n\t\t\t$allowed_attributes['data-wp-class--active'] = true;\n\t\t\t$allowed_attributes['data-wp-context'] = true;\n\t\t\t$allowed_attributes['data-wp-init'] = true;\n\t\t\t$allowed_attributes['data-wp-interactive'] = true;\n\t\t\t$allowed_attributes['data-wp-on--click'] = true;\n\t\t\t$allowed_attributes['data-wp-on--mouseenter'] = true;\n\t\t\t$allowed_attributes['data-wp-on--mouseleave'] = true;\n\t\t\t$allowed_attributes['data-wp-run--mounted'] = true;\n\t\t\t$allowed_attributes['data-wp-style--width'] = true;\n\t\t\t$allowed_attributes['data-wp-text'] = true;\n\t\t}\n\t\tunset( $allowed_attributes );\n\n\t\treturn array(\n\t\t\t'buttonLabel' => $button_label,\n\t\t\t'frontendClassName' => '{{cssClassName}}',\n\t\t\t'heading' => $heading,\n\t\t\t'intro' => $intro,\n\t\t\t'isVisible' => true,\n\t\t\t'normalized' => $normalized,\n\t\t\t'noticeMessage' => $notice_message,\n\t\t\t'postId' => (int) $post_id,\n\t\t\t'resourceKey' => $resource_key,\n\t\t\t'sanitizedContent' => wp_kses( $content, $allowed_inner_html ),\n\t\t\t'showCount' => $show_count,\n\t\t\t'showDividers' => $show_dividers,\n\t\t\t'title' => {{titleJson}},\n\t\t\t'webContext' => $web_context,\n\t\t);\n\t}\n}\n\nif ( ! function_exists( '{{phpPrefix}}_{{slugSnakeCase}}_render_target' ) ) {\n\tfunction {{phpPrefix}}_{{slugSnakeCase}}_render_target( string $target, $attributes, $content = '', $block = null ): string {\n\t\t$context = {{phpPrefix}}_{{slugSnakeCase}}_build_render_context( $attributes, $content, $block );\n\t\tif ( null === $context ) {\n\t\t\treturn '';\n\t\t}\n\n\t\t$target_context = apply_filters(\n\t\t\t'{{phpPrefix}}_{{slugSnakeCase}}_render_target_context',\n\t\t\t$context,\n\t\t\t$target,\n\t\t\t$attributes,\n\t\t\t$block\n\t\t);\n\n\t\t$markup = '';\n\t\tswitch ( $target ) {\n\t\t\tcase 'email':\n\t\t\t\t$parts = array(\n\t\t\t\t\t'
',\n\t\t\t\t\t'
' . esc_html( $target_context['heading'] ) . '
',\n\t\t\t\t);\n\t\t\t\tif ( '' !== $target_context['intro'] ) {\n\t\t\t\t\t$parts[] = '
' . esc_html( $target_context['intro'] ) . '
';\n\t\t\t\t}\n\t\t\t\tif ( ! empty( $target_context['showCount'] ) ) {\n\t\t\t\t\t$parts[] = '
' . esc_html__( 'Count', '{{textDomain}}' ) . ': ' . esc_html( (string) $target_context['webContext']['count'] ) . '
';\n\t\t\t\t}\n\t\t\t\t$parts[] = wp_kses_post( $target_context['sanitizedContent'] );\n\t\t\t\t$parts[] = '
' . esc_html( $target_context['noticeMessage'] ) . '
';\n\t\t\t\t$parts[] = '
';\n\t\t\t\t$markup = implode( '', $parts );\n\t\t\t\tbreak;\n\t\t\tcase 'mjml':\n\t\t\t\t$markup = '' . esc_html( $target_context['heading'] ) . '';\n\t\t\t\tif ( '' !== $target_context['intro'] ) {\n\t\t\t\t\t$markup .= '' . esc_html( $target_context['intro'] ) . '';\n\t\t\t\t}\n\t\t\t\tif ( ! empty( $target_context['showCount'] ) ) {\n\t\t\t\t\t$markup .= '' . esc_html__( 'Count', '{{textDomain}}' ) . ': ' . esc_html( (string) $target_context['webContext']['count'] ) . '';\n\t\t\t\t}\n\t\t\t\t$markup .= '' . esc_html( wp_strip_all_tags( $target_context['sanitizedContent'] ) ) . '';\n\t\t\t\t$markup .= '' . esc_html( $target_context['noticeMessage'] ) . '';\n\t\t\t\tbreak;\n\t\t\tcase 'plain-text':\n\t\t\t\t$markup = implode(\n\t\t\t\t\t\"\\n\",\n\t\t\t\t\tarray_filter(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t$target_context['heading'],\n\t\t\t\t\t\t\t$target_context['intro'],\n\t\t\t\t\t\t\twp_strip_all_tags( $target_context['sanitizedContent'] ),\n\t\t\t\t\t\t\t! empty( $target_context['showCount'] )\n\t\t\t\t\t\t\t\t? sprintf( '%s: %s', __( 'Count', '{{textDomain}}' ), (string) $target_context['webContext']['count'] )\n\t\t\t\t\t\t\t\t: null,\n\t\t\t\t\t\t\t$target_context['noticeMessage'],\n\t\t\t\t\t\t),\n\t\t\t\t\t\tstatic fn( $value ) => is_string( $value ) && '' !== $value\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\tcase 'web':\n\t\t\tdefault:\n\t\t\t\t$wrapper_attributes = get_block_wrapper_attributes(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'class' => '{{cssClassName}}',\n\t\t\t\t\t\t'data-show-dividers' => $target_context['showDividers'] ? 'true' : 'false',\n\t\t\t\t\t\t'data-wp-context' => wp_json_encode( $target_context['webContext'] ),\n\t\t\t\t\t\t'data-wp-init' => 'callbacks.init',\n\t\t\t\t\t\t'data-wp-interactive' => '{{slugKebabCase}}',\n\t\t\t\t\t\t'data-wp-run--mounted' => 'callbacks.mounted',\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\tob_start();\n\t\t\t\t?>\n>\n\t
\n\t\n\t\t
\n\t\n\t
\n\t\t\n\t
\n\t
\n\t\n\t\t
\n\t\t\t0\n\t\t\t\n\t\t
\n\t\n\t
\n\t\t\n\t
\n
\n\t\t\t\tapply_defaults( is_array( $attributes ) ? $attributes : array() );\n$validation = $validator->validate( $normalized );\n// Preserve the former implicit default only for legacy blocks that omit the key.\n// Explicitly stored empty keys remain invalid.\n$resource_key = array_key_exists( 'resourceKey', $normalized ) ? (string) $normalized['resourceKey'] : 'primary';\n$heading = isset( $normalized['heading'] ) ? (string) $normalized['heading'] : {{titlePhpLiteral}};\n$intro = isset( $normalized['intro'] ) ? (string) $normalized['intro'] : '';\n$button_label = isset( $normalized['buttonLabel'] ) ? (string) $normalized['buttonLabel'] : 'Persist Count';\n$show_count = ! empty( $normalized['showCount'] );\n$show_dividers = ! empty( $normalized['showDividers'] );\n$post_id = is_object( $block ) && isset( $block->context['postId'] )\n\t? (int) $block->context['postId']\n\t: (int) get_queried_object_id();\n$storage_mode = '{{dataStorageMode}}';\n$persistence_policy = '{{persistencePolicy}}';\n\n$notice_message = 'authenticated' === $persistence_policy\n\t? __( 'Sign in to persist this counter.', '{{textDomain}}' )\n\t: __( 'Public writes are temporarily unavailable.', '{{textDomain}}' );\n\nif ( empty( $validation['valid'] ) || '' === $resource_key ) {\n\treturn '';\n}\n\n{{phpPrefix}}_record_rendered_block_instance(\n\t(int) $post_id,\n\t'{{namespace}}/{{slugKebabCase}}',\n\t$resource_key\n);\n\n$context = array(\n\t'bootstrapReady' => false,\n\t'buttonLabel' => $button_label,\n\t'canWrite' => false,\n\t'client' => array(\n\t\t'writeExpiry' => 0,\n\t\t'writeNonce' => '',\n\t\t'writeToken' => '',\n\t),\n\t'count' => 0,\n\t'error' => '',\n\t'isBootstrapping' => false,\n\t'isLoading' => false,\n\t'isSaving' => false,\n\t'persistencePolicy' => $persistence_policy,\n\t'postId' => (int) $post_id,\n\t'resourceKey' => $resource_key,\n\t'showCount' => $show_count,\n\t'storage' => $storage_mode,\n);\n\n$allowed_inner_html = wp_kses_allowed_html( 'post' );\n\nforeach ( $allowed_inner_html as &$allowed_attributes ) {\n\tif ( ! is_array( $allowed_attributes ) ) {\n\t\tcontinue;\n\t}\n\n\t$allowed_attributes['data-wp-bind--disabled'] = true;\n\t$allowed_attributes['data-wp-bind--hidden'] = true;\n\t$allowed_attributes['data-wp-bind--value'] = true;\n\t$allowed_attributes['data-wp-class'] = true;\n\t$allowed_attributes['data-wp-class--active'] = true;\n\t$allowed_attributes['data-wp-context'] = true;\n\t$allowed_attributes['data-wp-init'] = true;\n\t$allowed_attributes['data-wp-interactive'] = true;\n\t$allowed_attributes['data-wp-on--click'] = true;\n\t$allowed_attributes['data-wp-on--mouseenter'] = true;\n\t$allowed_attributes['data-wp-on--mouseleave'] = true;\n\t$allowed_attributes['data-wp-run--mounted'] = true;\n\t$allowed_attributes['data-wp-style--width'] = true;\n\t$allowed_attributes['data-wp-text'] = true;\n}\nunset( $allowed_attributes );\n\n$sanitized_content = wp_kses( $content, $allowed_inner_html );\n\n$wrapper_attributes = get_block_wrapper_attributes(\n\tarray(\n\t\t'class' => '{{cssClassName}}',\n\t\t'data-show-dividers' => $show_dividers ? 'true' : 'false',\n\t\t'data-wp-context' => wp_json_encode( $context ),\n\t\t'data-wp-init' => 'callbacks.init',\n\t\t'data-wp-interactive' => '{{slugKebabCase}}',\n\t\t'data-wp-run--mounted' => 'callbacks.mounted',\n\t)\n);\n?>\n\n>\n\t
\n\t\n\t\t
\n\t\n\t
\n\t\t\n\t
\n\t
\n\t\n\t\t
\n\t\t\t0\n\t\t\t\n\t\t
\n\t\n\t
\n\t\t\n\t
\n
\n";