begin
wwv_flow_imp_shared.create_menu(
 p_id=>wwv_flow_imp.id(20505359259036158)
,p_name=>'Breadcrumb'
);
wwv_flow_imp_shared.create_menu_option(
 p_id=>wwv_flow_imp.id(20505608929036160)
,p_short_name=>'Migrate JSON Tables'
,p_link=>'f?p=&APP_ID.:1:&SESSION.::&DEBUG.:::'
,p_page_id=>1
);
wwv_flow_imp_shared.create_menu_option(
 p_id=>wwv_flow_imp.id(21125797394707069)
,p_short_name=>'Create View for Example JSON'
,p_link=>'f?p=&APP_ID.:2:&SESSION.::&DEBUG.:::'
,p_page_id=>2
);
wwv_flow_imp_shared.create_menu_option(
 p_id=>wwv_flow_imp.id(22127389378303457)
,p_short_name=>'Browse & Edit'
,p_link=>'f?p=&APP_ID.:3:&SESSION.::&DEBUG.:::'
,p_page_id=>3
);
wwv_flow_imp_shared.create_menu_option(
 p_id=>wwv_flow_imp.id(22128681619334276)
,p_short_name=>'Generate Business API'
,p_link=>'f?p=&APP_ID.:4:&SESSION.::&DEBUG.:::'
,p_page_id=>4
);
wwv_flow_imp_shared.create_menu_option(
 p_id=>wwv_flow_imp.id(22140808038416418)
,p_short_name=>'About'
,p_link=>'f?p=&APP_ID.:5:&APP_SESSION.::&DEBUG.:::'
,p_page_id=>5
);
wwv_flow_imp_shared.create_menu_option(
 p_id=>wwv_flow_imp.id(22143634230445663)
,p_short_name=>'Show Related Tables'
,p_link=>'f?p=&APP_ID.:6:&APP_SESSION.::&DEBUG.:::'
,p_page_id=>6
);
wwv_flow_imp_shared.create_menu_option(
 p_id=>wwv_flow_imp.id(22561904393285789)
,p_short_name=>'Experiment with SQL'
,p_link=>'f?p=&APP_ID.:7:&APP_SESSION.::&DEBUG.:::'
,p_page_id=>7
);
end;
/
prompt --application/shared_components/navigation/breadcrumbentry
begin
null;
end;
/
prompt --application/shared_components/user_interface/templates/popuplov
begin
null;
end;
/
prompt --application/shared_components/user_interface/themes
begin
wwv_flow_imp_shared.create_theme(
 p_id=>wwv_flow_imp.id(20772568093037029)
,p_theme_id=>42
,p_theme_name=>'Universal Theme'
,p_theme_internal_name=>'UNIVERSAL_THEME'
,p_version_identifier=>'24.2'
,p_navigation_type=>'L'
,p_nav_bar_type=>'LIST'
,p_reference_id=>4072363937200175119
,p_is_locked=>false
,p_current_theme_style_id=>2721322117358710262
,p_default_page_template=>4072355960268175073
,p_default_dialog_template=>2100407606326202693
,p_error_template=>2101157952850466385
,p_printer_friendly_template=>4072355960268175073
,p_breadcrumb_display_point=>'REGION_POSITION_01'
,p_sidebar_display_point=>'REGION_POSITION_02'
,p_login_template=>2101157952850466385
,p_default_button_template=>4072362960822175091
,p_default_region_template=>4072358936313175081
,p_default_chart_template=>4072358936313175081
,p_default_form_template=>4072358936313175081
,p_default_reportr_template=>4072358936313175081
,p_default_tabform_template=>4072358936313175081
,p_default_wizard_template=>4072358936313175081
,p_default_menur_template=>2531463326621247859
,p_default_listr_template=>4072358936313175081
,p_default_irr_template=>2100526641005906379
,p_default_report_template=>2538654340625403440
,p_default_label_template=>1609121967514267634
,p_default_menu_template=>4072363345357175094
,p_default_calendar_template=>4072363550766175095
,p_default_list_template=>4072361143931175087
,p_default_nav_list_template=>2526754704087354841
,p_default_top_nav_list_temp=>2526754704087354841
,p_default_side_nav_list_temp=>2467739217141810545
,p_default_nav_list_position=>'SIDE'
,p_default_dialogbtnr_template=>2126429139436695430
,p_default_dialogr_template=>4501440665235496320
,p_default_option_label=>1609121967514267634
,p_default_required_label=>1609122147107268652
,p_default_navbar_list_template=>2847543055748234966
,p_file_prefix => nvl(wwv_flow_application_install.get_static_theme_file_prefix(42),'#APEX_FILES#themes/theme_42/24.2/')
,p_files_version=>64
,p_icon_library=>'FONTAPEX'
,p_javascript_file_urls=>wwv_flow_string.join(wwv_flow_t_varchar2(
'#APEX_FILES#libraries/apex/#MIN_DIRECTORY#widget.stickyWidget#MIN#.js?v=#APEX_VERSION#',
'#THEME_FILES#js/theme42#MIN#.js?v=#APEX_VERSION#'))
,p_css_file_urls=>'#THEME_FILES#css/Core#MIN#.css?v=#APEX_VERSION#'
);
end;
/
prompt --application/shared_components/user_interface/theme_style
begin
wwv_flow_imp_shared.create_theme_style(
 p_id=>wwv_flow_imp.id(20832515270194521)
,p_theme_id=>42
,p_name=>'Redwood Dark'
,p_css_file_urls=>wwv_flow_string.join(wwv_flow_t_varchar2(
'#APEX_FILES#libraries/oracle-fonts/oraclesans-apex#MIN#.css?v=#APEX_VERSION#',
'#THEME_FILES#css/Redwood#MIN#.css?v=#APEX_VERSION#'))
,p_css_classes=>' rw-pillar--ocean rw-mode-body-header--dark rw-mode-body--light rw-mode-header--pillar rw-mode-nav--pillar'
,p_is_public=>true
,p_is_accessible=>false
,p_theme_roller_input_file_urls=>'#THEME_FILES#less/theme/Redwood-Theme.less'
,p_theme_roller_config=>'{"classes":["rw-pillar--ocean","rw-mode-body-header--dark","rw-mode-body--light","rw-mode-header--pillar","rw-mode-nav--pillar"],"vars":{},"customCSS":"","useCustomLess":"N"}'
,p_theme_roller_output_file_url=>'#THEME_DB_FILES#9061595759021316.css'
,p_theme_roller_read_only=>false
);
end;
/
prompt --application/shared_components/user_interface/theme_files
begin
wwv_flow_imp.g_varchar2_table := wwv_flow_imp.empty_varchar2_table;
wwv_flow_imp.g_varchar2_table(1) := '2F2A210D0A20436F707972696768742028632920323032302C20323032342C204F7261636C6520616E642F6F722069747320616666696C69617465732E0D0A202A2F0D0A';
wwv_flow_imp_shared.create_theme_file(
 p_id=>wwv_flow_imp.id(20832905816194524)
,p_theme_id=>42
,p_file_name=>'9061595759021316.css'
,p_mime_type=>'text/css'
,p_file_charset=>'utf-8'
,p_file_content => wwv_flow_imp.varchar2_to_blob(wwv_flow_imp.g_varchar2_table)
);
end;
/
prompt --application/shared_components/user_interface/template_opt_groups
begin
null;
end;
/
prompt --application/shared_components/user_interface/template_options
begin
null;
end;
/
prompt --application/shared_components/globalization/language
begin
null;
end;
/
prompt --application/shared_components/globalization/translations
begin
null;
end;
/
prompt --application/shared_components/logic/build_options
begin
wwv_flow_imp_shared.create_build_option(
 p_id=>wwv_flow_imp.id(20504774289036152)
,p_build_option_name=>'Commented Out'
,p_build_option_status=>'EXCLUDE'
,p_version_scn=>41371165082851
);
end;
/
prompt --application/shared_components/globalization/messages
begin
null;
end;
/
prompt --application/shared_components/globalization/dyntranslations
begin
null;
end;
/
prompt --application/shared_components/security/authentications/oracle_apex_accounts
begin
wwv_flow_imp_shared.create_authentication(
 p_id=>wwv_flow_imp.id(20505054269036155)
,p_name=>'Oracle APEX Accounts'
,p_scheme_type=>'NATIVE_APEX_ACCOUNTS'
,p_invalid_session_type=>'LOGIN'
,p_use_secure_cookie_yn=>'N'
,p_ras_mode=>0
,p_version_scn=>41371165083038
);
end;
/
prompt --application/shared_components/plugins/region_type/markdown
begin
wwv_flow_imp_shared.create_plugin(
 p_id=>wwv_flow_imp.id(20826495218178420)
,p_plugin_type=>'REGION TYPE'
,p_name=>'MARKDOWN'
,p_display_name=>'Markdown Region'
,p_image_prefix => nvl(wwv_flow_application_install.get_static_plugin_file_prefix('REGION TYPE','MARKDOWN'),'')
,p_plsql_code=>wwv_flow_string.join(wwv_flow_t_varchar2(
'procedure render (',
'    p_plugin in            apex_plugin.t_plugin,',
'    p_region in            apex_plugin.t_region,',
'    p_param  in            apex_plugin.t_region_render_param,',
'    p_result in out nocopy apex_plugin.t_region_render_result )',
'as',
'    l_clob_md   clob;',
'    l_clob_html clob;',
'    l_based_on  varchar2(23) := p_region.attributes.get_varchar2(''source'');',
'    l_file_name varchar2(200);',
'    l_to_return apex_plugin.t_region_render_result;',
'begin',
'    if l_based_on = ''INLINE'' then',
'        l_clob_md := p_region.attributes.get_varchar2(''content'');',
'    elsif l_based_on = ''APPLICATION_STATIC_FILE'' then',
'        l_file_name := p_region.attributes.get_varchar2(''file_name'');',
'        begin',
'            select replace(to_clob( file_content ),''#''||''APP_FILES''||''#'',V(''APP_FILES''))',
'              into l_clob_md',
'              from apex_application_static_files',
'             where application_id = :APP_ID',
'               and file_name      = l_file_name',
'               and mime_type      like ''text/%'';',
'        exception',
'            when no_data_found then',
'                raise_application_error( -20000, ''Application static file "'' || l_file_name || ''" not found or is not text/%'' );',
'        end;',
'    end if;',
'    l_clob_html := apex_markdown.to_html( ',
'        p_markdown => l_clob_md,',
'        p_embedded_html_mode => apex_markdown.c_embedded_html_preserve );',
'',
'    apex_util.prn(',
'        p_clob      => ''<div class="is-markdownified">'' || l_clob_html || ''</div>'',',
'        p_escape    => false );',
'end render;'))
,p_api_version=>3
,p_render_function=>'render'
,p_substitute_attributes=>true
,p_version_scn=>41373587449236
,p_subscribe_plugin_settings=>true
,p_help_text=>'Displays HTML for Markdown content from a static application file or entered directly by the developer.'
,p_version_identifier=>'1.0'
);
wwv_flow_imp_shared.create_plugin_attribute(
 p_id=>wwv_flow_imp.id(20826753040178422)
,p_plugin_id=>wwv_flow_imp.id(20826495218178420)
,p_attribute_scope=>'COMPONENT'
,p_attribute_sequence=>1
,p_display_sequence=>10
,p_static_id=>'source'
,p_prompt=>'Source'
,p_attribute_type=>'SELECT LIST'
,p_is_required=>false
,p_is_translatable=>false
,p_lov_type=>'STATIC'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(20827152117178423)
,p_plugin_attribute_id=>wwv_flow_imp.id(20826753040178422)
,p_display_sequence=>10
,p_display_value=>'Inline'
,p_return_value=>'INLINE'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(20827657217178424)
,p_plugin_attribute_id=>wwv_flow_imp.id(20826753040178422)
,p_display_sequence=>20
,p_display_value=>'Application Static File'
,p_return_value=>'APPLICATION_STATIC_FILE'
);
wwv_flow_imp_shared.create_plugin_attribute(
 p_id=>wwv_flow_imp.id(20828210037178425)
,p_plugin_id=>wwv_flow_imp.id(20826495218178420)
,p_attribute_scope=>'COMPONENT'
,p_attribute_sequence=>2
,p_display_sequence=>20
,p_static_id=>'content'
,p_prompt=>'Content'
,p_attribute_type=>'TEXTAREA'
,p_is_required=>false
,p_is_translatable=>false
,p_depending_on_attribute_id=>wwv_flow_imp.id(20826753040178422)
,p_depending_on_has_to_exist=>true
,p_depending_on_condition_type=>'EQUALS'
,p_depending_on_expression=>'INLINE'
);
wwv_flow_imp_shared.create_plugin_attribute(
 p_id=>wwv_flow_imp.id(20828591186178426)
,p_plugin_id=>wwv_flow_imp.id(20826495218178420)
,p_attribute_scope=>'COMPONENT'
,p_attribute_sequence=>3
,p_display_sequence=>30
,p_static_id=>'file_name'
,p_prompt=>'File Name'
,p_attribute_type=>'TEXT'
,p_is_required=>false
,p_is_translatable=>false
,p_depending_on_attribute_id=>wwv_flow_imp.id(20826753040178422)
,p_depending_on_has_to_exist=>true
,p_depending_on_condition_type=>'EQUALS'
,p_depending_on_expression=>'APPLICATION_STATIC_FILE'
);
end;
/
prompt --application/shared_components/plugins/template_component/bicoastal_button_bar
begin
wwv_flow_imp_shared.create_plugin(
 p_id=>wwv_flow_imp.id(22945295826920089)
,p_plugin_type=>'TEMPLATE COMPONENT'
,p_theme_id=>nvl(wwv_flow_application_install.get_theme_id, '')
,p_name=>'BICOASTAL_BUTTON_BAR'
,p_display_name=>'Bicoastal Button Bar'
,p_supported_component_types=>'REGION_ONLY'
,p_image_prefix => nvl(wwv_flow_application_install.get_static_plugin_file_prefix('TEMPLATE COMPONENT','BICOASTAL_BUTTON_BAR'),'')
,p_css_file_urls=>'#PLUGIN_FILES#bicoastal-button-bar#MIN#.css'
,p_partial_template=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<div class="bicoastal-button-bar-outer-container">',
'    <div class="bicoastal-button-bar-inner-container">',
'        {if LEFT_SIDE_BUTTONS/}',
'        <div class="bicoastal-button-bar-left-buttons">',
'            <p>#LEFT_SIDE_BUTTONS#</p>',
'        </div>',
'        {endif/}',
'        {if RIGHT_SIDE_BUTTONS/}',
'        <div class="bicoastal-button-bar-right-buttons">',
'            <p>#RIGHT_SIDE_BUTTONS#</p>',
'        </div>',
'        {endif/}',
'    </div>',
'</div>'))
,p_default_escape_mode=>'HTML'
,p_translate_this_template=>false
,p_api_version=>1
,p_substitute_attributes=>true
,p_version_scn=>41371917076236
,p_subscribe_plugin_settings=>true
,p_version_identifier=>'1.0'
,p_files_version=>15
);
wwv_flow_imp_shared.create_plugin_slot(
 p_id=>wwv_flow_imp.id(22946356090927338)
,p_plugin_id=>wwv_flow_imp.id(22945295826920089)
,p_name=>'LEFT_SIDE_BUTTONS'
,p_placeholder=>'LEFT_SIDE_BUTTONS'
,p_has_grid_support=>false
,p_has_item_support=>false
);
wwv_flow_imp_shared.create_plugin_slot(
 p_id=>wwv_flow_imp.id(22946644157927342)
,p_plugin_id=>wwv_flow_imp.id(22945295826920089)
,p_name=>'RIGHT_SIDE_BUTTONS'
,p_placeholder=>'RIGHT_SIDE_BUTTONS'
,p_has_grid_support=>false
,p_has_item_support=>false
);
end;
/
begin
wwv_flow_imp.g_varchar2_table := wwv_flow_imp.empty_varchar2_table;
wwv_flow_imp.g_varchar2_table(1) := '6269636F617374616C2D627574746F6E2D6261722D6F757465722D636F6E7461696E6572207B0A202020206D617267696E3A20303B0A2020202070616464696E673A20303B0A202020206865696768743A20313030253B0A2020202077696474683A2031';
wwv_flow_imp.g_varchar2_table(2) := '3030253B0A20202020646973706C61793A20666C65783B0A202020206A7573746966792D636F6E74656E743A2063656E7465723B0A20202020616C69676E2D6974656D733A2063656E7465723B0A202020206F766572666C6F773A2068696464656E3B0A';
wwv_flow_imp.g_varchar2_table(3) := '7D0A0A2E6269636F617374616C2D627574746F6E2D6261722D696E6E65722D636F6E7461696E6572207B0A2020202077696474683A20313030253B0A20202020646973706C61793A20666C65783B0A202020206A7573746966792D636F6E74656E743A20';
wwv_flow_imp.g_varchar2_table(4) := '73706163652D6265747765656E3B0A2020202070616464696E673A203020323070783B0A20202020626F782D73697A696E673A20626F726465722D626F783B0A20202020706F736974696F6E3A2072656C61746976653B0A7D0A0A2E6269636F61737461';
wwv_flow_imp.g_varchar2_table(5) := '6C2D627574746F6E2D6261722D6C6566742D627574746F6E732C202E6269636F617374616C2D627574746F6E2D6261722D72696768742D627574746F6E73207B0A20202020646973706C61793A20666C65783B0A20202020616C69676E2D6974656D733A';
wwv_flow_imp.g_varchar2_table(6) := '2063656E7465723B0A7D0A0A2E6269636F617374616C2D627574746F6E2D6261722D6C6566742D627574746F6E73207B0A202020206A7573746966792D636F6E74656E743A20666C65782D73746172743B0A7D0A0A2E6269636F617374616C2D62757474';
wwv_flow_imp.g_varchar2_table(7) := '6F6E2D6261722D72696768742D627574746F6E73207B0A202020206A7573746966792D636F6E74656E743A20666C65782D656E643B0A7D0A';
end;
/
begin
wwv_flow_imp_shared.create_plugin_file(
 p_id=>wwv_flow_imp.id(22948670528944631)
,p_plugin_id=>wwv_flow_imp.id(22945295826920089)
,p_file_name=>'bicoastal-button-bar.css'
,p_mime_type=>'text/css'
,p_file_charset=>'utf-8'
,p_file_content=>wwv_flow_imp.varchar2_to_blob(wwv_flow_imp.g_varchar2_table)
);
end;
/
begin
wwv_flow_imp.g_varchar2_table := wwv_flow_imp.empty_varchar2_table;
wwv_flow_imp.g_varchar2_table(1) := '6269636F617374616C2D627574746F6E2D6261722D6F757465722D636F6E7461696E65727B6D617267696E3A303B70616464696E673A303B6865696768743A313030253B77696474683A313030253B646973706C61793A666C65783B6A7573746966792D';
wwv_flow_imp.g_varchar2_table(2) := '636F6E74656E743A63656E7465723B616C69676E2D6974656D733A63656E7465723B6F766572666C6F773A68696464656E7D2E6269636F617374616C2D627574746F6E2D6261722D696E6E65722D636F6E7461696E65727B77696474683A313030253B64';
wwv_flow_imp.g_varchar2_table(3) := '6973706C61793A666C65783B6A7573746966792D636F6E74656E743A73706163652D6265747765656E3B70616464696E673A3020323070783B626F782D73697A696E673A626F726465722D626F783B706F736974696F6E3A72656C61746976657D2E6269';
wwv_flow_imp.g_varchar2_table(4) := '636F617374616C2D627574746F6E2D6261722D6C6566742D627574746F6E732C2E6269636F617374616C2D627574746F6E2D6261722D72696768742D627574746F6E737B646973706C61793A666C65783B616C69676E2D6974656D733A63656E7465727D';
wwv_flow_imp.g_varchar2_table(5) := '2E6269636F617374616C2D627574746F6E2D6261722D6C6566742D627574746F6E737B6A7573746966792D636F6E74656E743A666C65782D73746172747D2E6269636F617374616C2D627574746F6E2D6261722D72696768742D627574746F6E737B6A75';
wwv_flow_imp.g_varchar2_table(6) := '73746966792D636F6E74656E743A666C65782D656E647D';
end;
/
begin
wwv_flow_imp_shared.create_plugin_file(
 p_id=>wwv_flow_imp.id(22982392707200428)
,p_plugin_id=>wwv_flow_imp.id(22945295826920089)
,p_file_name=>'bicoastal-button-bar.min.css'
,p_mime_type=>'text/css'
,p_file_charset=>'utf-8'
,p_file_content=>wwv_flow_imp.varchar2_to_blob(wwv_flow_imp.g_varchar2_table)
);
end;
/
prompt --application/shared_components/plugins/region_type/mermaid_diagram
begin
wwv_flow_imp_shared.create_plugin(
 p_id=>wwv_flow_imp.id(29976756653028472)
,p_plugin_type=>'REGION TYPE'
,p_name=>'MERMAID_DIAGRAM'
,p_display_name=>'Mermaid Diagram'
,p_image_prefix => nvl(wwv_flow_application_install.get_static_plugin_file_prefix('REGION TYPE','MERMAID_DIAGRAM'),'')
,p_javascript_file_urls=>wwv_flow_string.join(wwv_flow_t_varchar2(
'https://cdnjs.cloudflare.com/ajax/libs/mermaid/10.9.1/mermaid#MIN#.js',
'https://cdn.jsdelivr.net/npm/svg-pan-zoom@3.5.0/dist/svg-pan-zoom#MIN#.js',
'#PLUGIN_FILES#script#MIN#.js'))
,p_plsql_code=>wwv_flow_string.join(wwv_flow_t_varchar2(
'procedure render (',
'    p_plugin in            apex_plugin.t_plugin,',
'    p_region in            apex_plugin.t_region,',
'    p_param  in            apex_plugin.t_region_render_param,',
'    p_result in out nocopy apex_plugin.t_region_render_result )',
'as',
'    c_elem_id varchar2(100) := p_region.static_id || ''_diagram'';',
'begin',
'',
'    if apex_application.g_debug then',
'        apex_plugin_util.debug_region (',
'            p_plugin => p_plugin,',
'            p_region => p_region );',
'    end if;',
'',
'    sys.htp.p( ''<div id="'' || apex_escape.html_attribute( c_elem_id ) || ''"></div>'' );',
'',
'    apex_json.initialize_clob_output;',
'',
'    apex_json.open_object;',
'    apex_json.write( ''elemId'', c_elem_id );',
'    apex_json.write( ''pageItem'', p_region.attributes.get_varchar2( ''page_item'' ) );',
'    apex_json.close_object;',
'',
'    apex_javascript.add_onload_code( ''MermaidDiagram.init( '' || apex_json.get_clob_output( p_free => true ) || '' );'' );',
'end render;'))
,p_api_version=>3
,p_render_function=>'render'
,p_substitute_attributes=>true
,p_version_scn=>41373524489886
,p_subscribe_plugin_settings=>true
,p_help_text=>'Diagram Visualizer based on MermaidJS'
,p_version_identifier=>'1.0'
,p_files_version=>25
);
wwv_flow_imp_shared.create_plugin_attribute(
 p_id=>wwv_flow_imp.id(29978386972919452)
,p_plugin_id=>wwv_flow_imp.id(29976756653028472)
,p_attribute_scope=>'COMPONENT'
,p_attribute_sequence=>1
,p_display_sequence=>10
,p_static_id=>'page_item'
,p_prompt=>'Page Item'
,p_attribute_type=>'PAGE ITEM'
,p_is_required=>true
,p_is_translatable=>false
,p_help_text=>'The page item holding the diagram definition in MermaidJS syntax.'
);
end;
/
begin
wwv_flow_imp.g_varchar2_table := wwv_flow_imp.empty_varchar2_table;
wwv_flow_imp.g_varchar2_table(1) := '676C6F62616C546869732E4D65726D6169644469616772616D3D7B696E69743A653D3E7B636F6E737420743D24282223222B652E656C656D4964292C693D652E656C656D49642B225F737667222C613D617065782E6974656D735B652E70616765497465';
wwv_flow_imp.g_varchar2_table(2) := '6D5D3B6D65726D6169642E696E697469616C697A65287B6D61785465787453697A653A3965352C73746172744F6E4C6F61643A21312C73656375726974794C6576656C3A22737472696374227D293B636F6E737420733D6173796E632066756E6374696F';
wwv_flow_imp.g_varchar2_table(3) := '6E2865297B69662865297B636F6E73747B7376673A617D3D6177616974206D65726D6169642E72656E64657228692C65293B742E68746D6C2861293B73766750616E5A6F6F6D282223222B692C7B6D61785A6F6F6D3A33307D293B242822737667222C74';
wwv_flow_imp.g_varchar2_table(4) := '292E666972737428292E68656967687428223835766822292E63737328226D61785769647468222C223130302522297D656C736520742E656D70747928297D3B696628742E636C6F7365737428222E617065782D746162732D726567696F6E22292E6C65';
wwv_flow_imp.g_varchar2_table(5) := '6E677468297B6C657420653D22222C693D21313B636F6E7374206E3D743D3E7B69262665213D3D74262628732874292C653D74297D3B617065782E7769646765742E7574696C2E6F6E5669736962696C6974794368616E676528742C28653D3E7B693D65';
wwv_flow_imp.g_varchar2_table(6) := '2C6E28612E76616C7565297D29292C612E656C656D656E742E6F6E28226368616E6765222C2828293D3E7B6E28612E76616C7565297D29297D656C736520612E656C656D656E742E6F6E28226368616E6765222C2828293D3E7B7328612E76616C756529';
wwv_flow_imp.g_varchar2_table(7) := '7D29292C7328612E76616C7565297D7D3B';
end;
/
begin
wwv_flow_imp_shared.create_plugin_file(
 p_id=>wwv_flow_imp.id(23146031819608102)
,p_plugin_id=>wwv_flow_imp.id(29976756653028472)
,p_file_name=>'script.min.js'
,p_mime_type=>'text/javascript'
,p_file_charset=>'utf-8'
,p_file_content=>wwv_flow_imp.varchar2_to_blob(wwv_flow_imp.g_varchar2_table)
);
end;
/
begin
wwv_flow_imp.g_varchar2_table := wwv_flow_imp.empty_varchar2_table;
wwv_flow_imp.g_varchar2_table(1) := '676C6F62616C546869732E4D65726D6169644469616772616D203D207B0A20202020696E69743A20636F6E666967203D3E207B0A0A2020202020202020636F6E737420656C656D24203D20242820222322202B20636F6E6669672E656C656D496420293B';
wwv_flow_imp.g_varchar2_table(2) := '0A2020202020202020636F6E7374206469616772616D4964203D20636F6E6669672E656C656D4964202B20275F737667273B0A2020202020202020636F6E7374206974656D203D20617065782E6974656D735B20636F6E6669672E706167654974656D20';
wwv_flow_imp.g_varchar2_table(3) := '5D3B0A0A20202020202020206D65726D6169642E696E697469616C697A6528207B0A2020202020202020202020206D61785465787453697A653A203930303030302C0A20202020202020202020202073746172744F6E4C6F61643A2066616C73652C0A20';
wwv_flow_imp.g_varchar2_table(4) := '202020202020202020202073656375726974794C6576656C3A2022737472696374220A20202020202020207D20293B0A0A2020202020202020636F6E737420726566726573684469616772616D203D206173796E632066756E6374696F6E282076616C75';
wwv_flow_imp.g_varchar2_table(5) := '652029207B0A2020202020202020202020206966282076616C75652029207B0A20202020202020202020202020202020636F6E7374207B20737667207D203D206177616974206D65726D6169642E72656E64657228206469616772616D49642C2076616C';
wwv_flow_imp.g_varchar2_table(6) := '756520293B0A20202020202020202020202020202020656C656D242E68746D6C282073766720293B0A0A202020202020202020202020202020202F2F20436F6E6669677572652070616E6E696E6720616E64207A6F6F6D696E6720666F72207468652053';
wwv_flow_imp.g_varchar2_table(7) := '5647206469616772616D0A202020202020202020202020202020207661722070616E5A6F6F6D203D2073766750616E5A6F6F6D2820222322202B206469616772616D49642C207B206D61785A6F6F6D3A203330207D20293B0A2020202020202020202020';
wwv_flow_imp.g_varchar2_table(8) := '20202020202F2F20576F726B61726F756E64206D656E74696F6E656420696E207376672D70616E2D7A6F6F6D20524541444D4520746F20726573746F72652068656967687420746F203C7376673E20656C656D656E740A20202020202020202020202020';
wwv_flow_imp.g_varchar2_table(9) := '2020202F2F2068747470733A2F2F6769746875622E636F6D2F62756D62752F7376672D70616E2D7A6F6F6D0A2020202020202020202020202020202024282022737667222C20656C656D2420290A20202020202020202020202020202020202020202E66';
wwv_flow_imp.g_varchar2_table(10) := '6972737428290A20202020202020202020202020202020202020202E686569676874282022383576682220290A20202020202020202020202020202020202020202E6373732820226D61785769647468222C2022313030252220293B0A20202020202020';
wwv_flow_imp.g_varchar2_table(11) := '20202020207D20656C7365207B0A20202020202020202020202020202020656C656D242E656D70747928293B0A2020202020202020202020207D0A20202020202020207D3B0A0A20202020202020206966202820656C656D242E636C6F73657374282022';
wwv_flow_imp.g_varchar2_table(12) := '2E617065782D746162732D726567696F6E2220292E6C656E6774682029207B0A2020202020202020202020206C6574206F6C6456616C7565203D2022223B0A2020202020202020202020206C657420697356697369626C65203D2066616C73653B0A2020';
wwv_flow_imp.g_varchar2_table(13) := '202020202020202020200A202020202020202020202020636F6E73742074727952656E646572696E67203D206E657756616C7565203D3E207B0A2020202020202020202020202020202069662820697356697369626C652026262028206F6C6456616C75';
wwv_flow_imp.g_varchar2_table(14) := '6520213D3D206E657756616C756520292029207B0A2020202020202020202020202020202020202020726566726573684469616772616D28206E657756616C756520293B0A20202020202020202020202020202020202020206F6C6456616C7565203D20';
wwv_flow_imp.g_varchar2_table(15) := '6E657756616C75653B0A202020202020202020202020202020207D0A2020202020202020202020207D3B0A0A202020202020202020202020617065782E7769646765742E7574696C2E6F6E5669736962696C6974794368616E67652820656C656D242C20';
wwv_flow_imp.g_varchar2_table(16) := '7053686F77203D3E207B0A20202020202020202020202020202020697356697369626C65203D207053686F773B0A2020202020202020202020202020202074727952656E646572696E6728206974656D2E76616C756520293B0A20202020202020202020';
wwv_flow_imp.g_varchar2_table(17) := '20207D20293B0A0A2020202020202020202020206974656D2E656C656D656E742E6F6E2820226368616E6765222C202829203D3E207B0A2020202020202020202020202020202074727952656E646572696E6728206974656D2E76616C756520293B0A20';
wwv_flow_imp.g_varchar2_table(18) := '20202020202020202020207D20293B0A20202020202020207D20656C7365207B0A2020202020202020202020206974656D2E656C656D656E742E6F6E2820226368616E6765222C202829203D3E207B0A2020202020202020202020202020202072656672';
wwv_flow_imp.g_varchar2_table(19) := '6573684469616772616D28206974656D2E76616C756520293B0A2020202020202020202020207D20293B0A202020202020202020202020726566726573684469616772616D28206974656D2E76616C756520293B0A20202020202020207D0A202020207D';
wwv_flow_imp.g_varchar2_table(20) := '0A7D3B';
end;
/
begin
wwv_flow_imp_shared.create_plugin_file(
 p_id=>wwv_flow_imp.id(29979005389917517)
,p_plugin_id=>wwv_flow_imp.id(29976756653028472)
,p_file_name=>'script.js'
,p_mime_type=>'text/javascript'
,p_file_charset=>'utf-8'
,p_file_content=>wwv_flow_imp.varchar2_to_blob(wwv_flow_imp.g_varchar2_table)
);
end;
/
prompt --application/shared_components/plugins/dynamic_action/ca_insum_getigdata
begin
wwv_flow_imp_shared.create_plugin(
 p_id=>wwv_flow_imp.id(265428846714311657)
,p_plugin_type=>'DYNAMIC ACTION'
,p_name=>'CA.INSUM.GETIGDATA'
,p_display_name=>'Get IG Data'
,p_category=>'COMPONENT'
,p_image_prefix => nvl(wwv_flow_application_install.get_static_plugin_file_prefix('DYNAMIC ACTION','CA.INSUM.GETIGDATA'),'')
,p_plsql_code=>wwv_flow_string.join(wwv_flow_t_varchar2(
'function render ',
'  ( p_dynamic_action in apex_plugin.t_dynamic_action',
'  , p_plugin         in apex_plugin.t_plugin ',
'  )',
'return apex_plugin.t_dynamic_action_render_result',
'as',
'    k_crlf           varchar2(20) := chr(13) ||chr(10);',
'    l_result         apex_plugin.t_dynamic_action_render_result;',
'    l_js_val1        varchar2(32767);',
'    l_js_val2        varchar2(32767);',
'    l_columns        varchar2(32767);',
'    l_paths          varchar2(32767);    ',
'    l_console_query  varchar2(32767) := ',
'q''{',
'select',
'#COLUMNS#',
'       a.INSUM$ROW',
'  from json_table (:#ITEM# , ''$[*]''',
'         columns ',
'#PATHS#',
'           INSUM$ROW                       number         path ''$.INSUM$ROW''',
'                 ) a }''; ',
'    ',
'    --attributes',
'    l_static_id         p_dynamic_action.attribute_01%type := p_dynamic_action.attribute_01;',
'    l_item_name         p_dynamic_action.attribute_02%type := p_dynamic_action.attribute_02;',
'    l_rows_to_return    p_dynamic_action.attribute_03%type := p_dynamic_action.attribute_03;',
'    l_include_columns   p_dynamic_action.attribute_04%type := p_dynamic_action.attribute_04;',
'    l_exclude_columns   p_dynamic_action.attribute_05%type := p_dynamic_action.attribute_05;',
'    ',
'    l_include           boolean;',
'    l_count             number;',
'',
'begin',
'    ',
'    --debug',
'    if apex_application.g_debug ',
'    then',
'        apex_plugin_util.debug_dynamic_action',
'          ( p_plugin         => p_plugin',
'          , p_dynamic_action => p_dynamic_action',
'          );',
'    end if;',
'',
'    for i in (',
'                select igc.name, igc.data_type',
'                  from APEX_APPL_PAGE_IG_COLUMNS igc',
'                  inner join apex_application_page_regions pr on pr.region_id = igc.region_id',
'                  where igc.application_id = :APP_ID',
'                    and (igc.page_id = :APP_PAGE_ID or igc.page_id = 0)',
'                    and pr.static_id = l_static_id',
'                    and igc.name not like ''APEX$%''',
'                  order by igc.display_sequence',
'             ) loop',
'        ',
'        ',
'        if l_include_columns is null then',
'            if l_exclude_columns is null then',
'                l_include := true;',
'            else',
'                select count(*)',
'                  into l_count',
'                  from table(apex_string.split(l_exclude_columns,'',''))',
'                  where trim(column_value) = i.name;',
'',
'                l_include := (l_count = 0);',
'            end if;',
'        else',
'            select count(*)',
'              into l_count',
'              from table(apex_string.split(l_include_columns,'',''))',
'              where trim(column_value) = i.name;',
'            ',
'            l_include := (l_count > 0);',
'        end if;',
'',
'        if l_include then',
'            l_js_val1 :=  l_js_val1 || '' var col'' || i.name || '' = igModel.getFieldKey("''|| i.name ||''");'' || k_crlf;',
'            l_js_val2 :=  l_js_val2 || '' igRecord.'' || i.name || '' = igRow[col''|| i.name ||''];'' || k_crlf;',
'',
'            l_columns := l_columns || ''       a.'' || i.name || '','' || k_crlf;',
'            l_paths := l_paths || ''           '' || rpad(i.name,30) || ''  varchar2(4000) path ''''$.'' || i.name || '''''','' || k_crlf;',
'        end if;',
'    end loop;',
'    ',
'    l_console_query := replace(l_console_query, ''#COLUMNS#'', rtrim(l_columns,k_crlf));',
'    l_console_query := replace(l_console_query, ''#ITEM#'', l_item_name);',
'    l_console_query := replace(l_console_query, ''#PATHS#'', rtrim(l_paths,k_crlf));',
'    ',
'    l_console_query := ''apex.debug(`'' || l_console_query || ''`);'';',
'    ',
'    l_result.javascript_function :=''function(){''',
'        ||     l_console_query',
'        ||     ''  apex.debug("getIGData"); '' || k_crlf',
'        ||     ''  var myIGArray = []; '' || k_crlf',
'        ||     ''  var igGrid = apex.region("'' || l_static_id || ''").widget().interactiveGrid("getViews").grid; '' || k_crlf        ',
'        ||     ''  var igModel = apex.region("'' || l_static_id || ''").widget().interactiveGrid("getViews", "grid").model; '' || k_crlf',
'        ||     l_js_val1  ',
'        ||     case when l_rows_to_return = ''ALL'' then',
'                        ''  var igModel2 = igModel;'' || k_crlf',
'                    else ',
'                        ''  var igModel2 = igGrid.getSelectedRecords();'' || k_crlf       ',
'                    end',
'        ||     ''  let i = 0;''',
'        ||     l_js_val1  ',
'        ||     ''igModel2.forEach(function(igRow) {''  || k_crlf',
'        ||     ''  var igRecord = new Object(); ''  || k_crlf',
'        ||     ''  i++; ''  || k_crlf',
'        ||     ''  '' || l_js_val2  || k_crlf',
'        ||     ''  igRecord.INSUM$ROW = i;''  || k_crlf',
'        ||     ''  myIGArray.push(igRecord);'' || k_crlf',
'        ||     ''});''  || k_crlf  || k_crlf',
'        ||     ''$s("'' || l_item_name || ''", JSON.stringify(myIGArray));'' || k_crlf',
'        || ''}'';',
'        ',
'    return l_result;',
'end render;'))
,p_api_version=>2
,p_render_function=>'render'
,p_standard_attributes=>'ONLOAD'
,p_substitute_attributes=>true
,p_version_scn=>41371384370941
,p_subscribe_plugin_settings=>true
,p_help_text=>wwv_flow_string.join(wwv_flow_t_varchar2(
'Places the data from an Interactive Grid into a page item as a JSON string. That page item can then be submitted for processing as server side code within a Dynamic Action step or as an item to submit for a report region. <strong>The select statement'
||' used to process the data will be shown in the browser console.</strong> The INSUM$ROW column is always added as an indicator of the way the data was sorted at the time it was taken from the IG. An example is shown below.',
'<pre>',
'select',
'       a.ID,',
'       a.FIRST_NAME,',
'       a.LAST_NAME,',
'       a.INSUM$ROW',
'  from json_table (:P1_GRID_DATA , ''$[*]''',
'         columns ',
'           ID                              varchar2(4000) path ''$.ID'',',
'           FIRST_NAME                      varchar2(4000) path ''$.FIRST_NAME'',',
'           LAST_NAME                       varchar2(4000) path ''$.LAST_NAME'',',
'           INSUM$ROW                       number         path ''$.INSUM$ROW''',
'                 ) a ',
'</pre>',
'',
'This may be used within an "Execute PL/SQL Code" Dynamic Action as shown below:',
'',
'<pre>',
'begin',
'  for i in (',
'            select',
'              a.ID,',
'              a.FIRST_NAME,',
'              a.LAST_NAME,',
'              a.INSUM$ROW',
'            from json_table (:P1_GRID_DATA , ''$[*]''',
'                columns ',
'                  ID                              varchar2(4000) path ''$.ID'',',
'                  FIRST_NAME                      varchar2(4000) path ''$.FIRST_NAME'',',
'                  LAST_NAME                       varchar2(4000) path ''$.LAST_NAME'',',
'                  INSUM$ROW                       number         path ''$.INSUM$ROW''',
'                 ) a ',
'                        )',
'      ) loop',
'',
'    my_procedure(i.id, i.first_name, i.last_name);',
'',
'  end loop;',
'end;',
'</pre>'))
,p_version_identifier=>'0.1'
);
wwv_flow_imp_shared.create_plugin_attribute(
 p_id=>wwv_flow_imp.id(265442455214710911)
,p_plugin_id=>wwv_flow_imp.id(265428846714311657)
,p_attribute_scope=>'COMPONENT'
,p_attribute_sequence=>1
,p_display_sequence=>10
,p_prompt=>'IG Region Static ID'
,p_attribute_type=>'TEXT'
,p_is_required=>false
,p_is_translatable=>false
,p_help_text=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<p>Enter the static ID of the Interactive Grid region.</p>',
'<p>Data from the associated Interactive Grid will be placed into the identified page item as a JSON string. That page item can then be submitted for processing as server side code within a Dynamic Action step or as an item to submit for a report regi'
||'on. <strong>The select statement used to process the data will be shown in the browser console.</strong> The INSUM$ROW column is always added as an indicator of the way the data was sorted at the time it was taken from the IG. An example is shown bel'
||'ow.',
'</p>',
'<pre>',
'select',
'       a.ID,',
'       a.FIRST_NAME,',
'       a.LAST_NAME,',
'       a.INSUM$ROW',
'  from json_table (:P1_GRID_DATA , ''$[*]''',
'         columns ',
'           ID                              varchar2(4000) path ''$.ID'',',
'           FIRST_NAME                      varchar2(4000) path ''$.FIRST_NAME'',',
'           LAST_NAME                       varchar2(4000) path ''$.LAST_NAME'',',
'           INSUM$ROW                       number         path ''$.INSUM$ROW''',
'                 ) a ',
'</pre>',
'',
'This may be used within an "Execute PL/SQL Code" Dynamic Action as shown below:',
'',
'<pre>',
'begin',
'  for i in (',
'            select',
'              a.ID,',
'              a.FIRST_NAME,',
'              a.LAST_NAME,',
'              a.INSUM$ROW',
'            from json_table (:P1_GRID_DATA , ''$[*]''',
'                columns ',
'                  ID                              varchar2(4000) path ''$.ID'',',
'                  FIRST_NAME                      varchar2(4000) path ''$.FIRST_NAME'',',
'                  LAST_NAME                       varchar2(4000) path ''$.LAST_NAME'',',
'                  INSUM$ROW                       number         path ''$.INSUM$ROW''',
'                 ) a ',
'                        )',
'      ) loop',
'',
'    my_procedure(i.id, i.first_name, i.last_name);',
'',
'  end loop;',
'end;',
'</pre>'))
);
wwv_flow_imp_shared.create_plugin_attribute(
 p_id=>wwv_flow_imp.id(265436761016608223)
,p_plugin_id=>wwv_flow_imp.id(265428846714311657)
,p_attribute_scope=>'COMPONENT'
,p_attribute_sequence=>2
,p_display_sequence=>20
,p_prompt=>'Item to Hold Data'
,p_attribute_type=>'PAGE ITEM'
,p_is_required=>true
,p_is_translatable=>false
,p_examples=>'P1_GRID_DATA'
,p_help_text=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<p>This DA will put JSON data from the grid into the value of this item on the page. The item can then be sent back to the database with another DA or as part of a region refresh.</p>',
'<p>This item will usually be a hidden item with protection set to "off."</p>'))
);
wwv_flow_imp_shared.create_plugin_attribute(
 p_id=>wwv_flow_imp.id(265431407425553890)
,p_plugin_id=>wwv_flow_imp.id(265428846714311657)
,p_attribute_scope=>'COMPONENT'
,p_attribute_sequence=>3
,p_display_sequence=>30
,p_prompt=>'Rows to Return'
,p_attribute_type=>'SELECT LIST'
,p_is_required=>true
,p_default_value=>'ALL'
,p_is_translatable=>false
,p_lov_type=>'STATIC'
,p_help_text=>'Indicate if all rows or only selected rows should be returned. Note: In both cases, only rows displayed on the screen will be returned.'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(265431693734555097)
,p_plugin_attribute_id=>wwv_flow_imp.id(265431407425553890)
,p_display_sequence=>10
,p_display_value=>'All Rows'
,p_return_value=>'ALL'
,p_help_text=>'Return all rows regardless of the row selector state.'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(265432101579558572)
,p_plugin_attribute_id=>wwv_flow_imp.id(265431407425553890)
,p_display_sequence=>20
,p_display_value=>'Selected Rows'
,p_return_value=>'SELECTED'
,p_help_text=>'Only return rows where the row selector is checked.'
);
wwv_flow_imp_shared.create_plugin_attribute(
 p_id=>wwv_flow_imp.id(265776449499624695)
,p_plugin_id=>wwv_flow_imp.id(265428846714311657)
,p_attribute_scope=>'COMPONENT'
,p_attribute_sequence=>4
,p_display_sequence=>40
,p_prompt=>'Include Columns'
,p_attribute_type=>'TEXT'
,p_is_required=>false
,p_is_translatable=>false
,p_examples=>'ID,FIRST_NAME,LAST_NAME'
,p_help_text=>'List of IG columns that you wish to include. If empty all columns except those listed in "Exclude Columns" will be included. Note: these are the column names/aliases that you have defined in your query or table. This list is case sensitive and will t'
||'ypically be upper case.'
);
wwv_flow_imp_shared.create_plugin_attribute(
 p_id=>wwv_flow_imp.id(265435569623593970)
,p_plugin_id=>wwv_flow_imp.id(265428846714311657)
,p_attribute_scope=>'COMPONENT'
,p_attribute_sequence=>5
,p_display_sequence=>50
,p_prompt=>'Exclude Columns'
,p_attribute_type=>'TEXT'
,p_is_required=>false
,p_is_translatable=>false
,p_examples=>'CREATED_BY,CREATE_DATE,UPDATED_BY,UPDATE_DATE'
,p_help_text=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<p>List of IG columns that you do not wish to exclude. Note: these are the column names/aliases that you have defined in your query or table. This list is case sensitive and will typically be upper case.</p>',
'<p>This value will be ignored if Include Columns is populated</p>'))
);
end;
/
prompt --application/shared_components/plugins/region_type/rw_apex_vs_monaco_editor
begin
wwv_flow_imp_shared.create_plugin(
 p_id=>wwv_flow_imp.id(30148792614861281563)
,p_plugin_type=>'REGION TYPE'
,p_name=>'RW.APEX.VS.MONACO.EDITOR'
,p_display_name=>'APEX-VS-Monaco-Editor'
,p_image_prefix => nvl(wwv_flow_application_install.get_static_plugin_file_prefix('REGION TYPE','RW.APEX.VS.MONACO.EDITOR'),'')
,p_plsql_code=>wwv_flow_string.join(wwv_flow_t_varchar2(
'function sql_to_sys_refcursor (',
'    p_in_sql_statement clob,',
'    p_in_binds         sys.dbms_sql.varchar2_table',
') return sys_refcursor as',
'    l_curs       binary_integer;',
'    l_ref_cursor sys_refcursor;',
'    l_exec       binary_integer;',
'    -- TODO make size dynamic',
'    l_binds      varchar(100);',
'begin',
'    l_curs       := dbms_sql.open_cursor;',
'    dbms_sql.parse(l_curs, p_in_sql_statement, dbms_sql.native);',
'',
'    if p_in_binds.count > 0 then',
'        for i in 1..p_in_binds.count loop',
'            -- TODO find out how to prevent ltrim',
'            l_binds := ltrim(p_in_binds(i), '':'');',
'            dbms_sql.bind_variable(l_curs, l_binds, v(l_binds));',
'        end loop;',
'    end if;',
'',
'    l_exec       := dbms_sql.execute(l_curs);',
'    l_ref_cursor := dbms_sql.to_refcursor(l_curs);',
'    return l_ref_cursor;',
'exception',
'    when others then',
'        if dbms_sql.is_open(l_curs) then',
'            dbms_sql.close_cursor(l_curs);',
'        end if;',
'        raise;',
'end;',
'',
'procedure store_clob (',
'    p_in_plsql_block clob,',
'    p_in_clob        clob',
') as',
'',
'    l_exec    binary_integer;',
'    l_tmp_str varchar2(32767) := null;',
'    l_curs    binary_integer;',
'    l_binds   varchar(100);',
'    l_binds_t sys.dbms_sql.varchar2_table := wwv_flow_utilities.get_binds(p_in_plsql_block);',
'begin',
'    l_curs := dbms_sql.open_cursor;',
'    dbms_sql.parse(l_curs, p_in_plsql_block, dbms_sql.native);',
'',
'    for i in 1..l_binds_t.count loop',
'        -- TODO find out how to prevent ltrim',
'        l_binds := ltrim(l_binds_t(i),'':'');',
'        case l_binds',
'            when ''CLOB'' then',
'                dbms_sql.bind_variable(l_curs, l_binds, p_in_clob);',
'            else',
'                -- get values for APEX items',
'                dbms_sql.bind_variable(l_curs, l_binds, v(l_binds));',
'        end case;',
'',
'    end loop;',
'',
'    l_exec := dbms_sql.execute(l_curs);',
'exception',
'    when others then',
'        if dbms_sql.is_open(l_curs) then',
'            dbms_sql.close_cursor(l_curs);',
'        end if;',
'        apex_debug.error(''APEX-VS-Monaco-Editor - Error while executing dynamic PL/SQL Block after Upload CLOB.'');',
'        apex_debug.error(sqlerrm);',
'        apex_debug.error(dbms_utility.format_error_backtrace);',
'        raise;',
'end;',
'',
'function f_ajax (',
'    p_region in apex_plugin.t_region,',
'    p_plugin in apex_plugin.t_plugin',
') return apex_plugin.t_region_ajax_result is',
'',
'    l_function_type     constant varchar2(100) := apex_application.g_x01;',
'    l_plsql_upload_clob constant p_region.attribute_02%type := p_region.attribute_02;',
'    l_result            apex_plugin.t_region_ajax_result;',
'    l_cur               sys_refcursor;',
'    l_bind_names        sys.dbms_sql.varchar2_table;',
'    l_clob              clob := null;',
'    l_tmp_str           varchar2(32767);',
'begin',
'    if l_function_type = ''POST'' then',
'        begin',
'            dbms_lob.createtemporary(l_clob, false, dbms_lob.call);',
'            for i in 1..apex_application.g_f01.count loop',
'                l_tmp_str := wwv_flow.g_f01(i);',
'                if dbms_lob.getlength(l_tmp_str) > 0 then',
'                    dbms_lob.writeappend(l_clob, dbms_lob.getlength(l_tmp_str), l_tmp_str);',
'                end if;',
'',
'            end loop;',
'',
'            store_clob (',
'                p_in_plsql_block => l_plsql_upload_clob,',
'                p_in_clob        => l_clob',
'            );',
'',
'            apex_debug.info(''APEX-VS-Monaco-Editor - Upload and Execute of Dynamic PL/SQL Block successful with CLOB: '' ||',
'            dbms_lob.getlength(l_clob) || '' Bytes.'');',
'            apex_json.open_object;',
'            apex_json.write(p_name => ''result'', p_value => ''ok'');',
'            apex_json.close_object;',
'            dbms_lob.freetemporary(l_clob);',
'        exception',
'            when others then',
'                dbms_lob.freetemporary(l_clob);',
'                apex_debug.error(''APEX-VS-Monaco-Editor - Error while upload clob'');',
'                apex_debug.error(sqlerrm);',
'                apex_debug.error(dbms_utility.format_error_backtrace);',
'                raise;',
'        end;',
'    else',
'        -- undocumented function of APEX for get all bindings',
'        l_bind_names := wwv_flow_utilities.get_binds(p_region.source);',
'',
'        -- execute binding',
'        l_cur        := sql_to_sys_refcursor(rtrim(p_region.source, '';''), l_bind_names);',
'',
'        -- create json',
'        apex_json.open_object;',
'        apex_json.write(''rows'', l_cur);',
'        apex_json.close_object;',
'    end if;',
'',
'    return l_result;',
'end;',
'',
'function f_render (',
'    p_region              in apex_plugin.t_region,',
'    p_plugin              in apex_plugin.t_plugin,',
'    p_is_printer_friendly in boolean',
') return apex_plugin.t_region_render_result as',
'',
'    -- Render result variable needed for return',
'    l_render_result  apex_plugin.t_region_render_result;',
'    l_base_url       varchar2(32767);',
'    -- static if of the chart region (should be escaped for security)',
'    c_static_id      constant varchar2(32767) := apex_escape.html_attribute(p_region.static_id) ||',
'    ''-container'';',
'    c_refresh_id     constant varchar2(32767) := apex_escape.html_attribute(p_region.static_id);',
'    -- list of items that should be submitted',
'    c_items2submit   constant apex_application_page_regions.ajax_items_to_submit%type := apex_plugin_util.page_item_names_to_jquery(p_region.ajax_items_to_submit);',
'begin',
'    apex_javascript.add_requirejs;',
'',
'    -- add script files (your javascript)',
'    apex_javascript.add_library(',
'        p_name => ''script'',',
'        p_directory => p_plugin.file_prefix,',
'        p_version => null,',
'        p_check_to_add_minified => true,',
'        p_key => ''vsmonacoeditorjssrc''',
'    );',
'',
'    if p_plugin.attribute_01 = ''Y'' then',
'        l_base_url := rtrim(p_plugin.attribute_02);',
'    elsif p_plugin.attribute_03 = ''manual'' then',
'        l_base_url := rtrim(p_plugin.attribute_04);',
'    else',
'        l_base_url := ''/i/libraries/monaco-editor/'' || p_plugin.attribute_03;',
'    end if;',
'',
'    -- add chart container',
'    htp.p(''<div id="'' || c_static_id || ''" class="apex-monaco-editor-container"></div>'');',
'    -- call script js',
'    apex_javascript.add_onload_code(''apexMonacoEditor(apex, apex.jQuery).initialize('' || ',
'    apex_javascript.add_value(c_static_id, true) ||  -- id of the chart container',
'    apex_javascript.add_value(c_refresh_id, true) || -- id where refresh is binded',
'    apex_javascript.add_value(apex_plugin.get_ajax_identifier, true) || -- id for ajax call',
'    apex_javascript.add_value(c_items2submit, true) || -- items to submit for ajax call',
'    apex_javascript.add_value(l_base_url || ''/min/vs'', true) || -- add path to editor files',
'    apex_javascript.add_value(p_region.attribute_01, true) || -- height of the editor region',
'    apex_javascript.add_value(p_region.attribute_03, true) || -- language e.g. sql',
'    apex_javascript.add_value(p_region.attribute_04, true) || -- editor theme',
'    apex_javascript.add_value(p_region.attribute_05, true) || -- list of buttons that are shown in the region e.g. save',
'    apex_javascript.add_value(apex_region.is_read_only, false) ||',
'    '');'');',
'',
'    return l_render_result;',
'end;'))
,p_api_version=>1
,p_render_function=>'F_RENDER'
,p_ajax_function=>'F_AJAX'
,p_standard_attributes=>'SOURCE_SQL:AJAX_ITEMS_TO_SUBMIT'
,p_substitute_attributes=>true
,p_version_scn=>41509957303377
,p_subscribe_plugin_settings=>true
,p_help_text=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<p>This plug-in is used to render the visual studio monaco code editor in APEX. You can load source code as clob and the same or another source code as diff. The plug-in is also able to store the edited code back into the database e.g. in an APEX Col'
||'lection as clob.</p>',
'<p>the following apex.region("#YOUR_STATIC_REGION_ID#") are supported:</p>',
'<ul>',
'<li>save(): Upload current content of the Editor into the Database.</li>',
'<li>setValue(pValue, pDiffValue): Set the current Content and Diff-Content of the Editor.</li>',
'<li>refresh(): Refresh the Editor Content via Ajax.</li>',
'</ul>'))
,p_version_identifier=>'25.03.16'
,p_about_url=>'https://github.com/RonnyWeiss'
,p_files_version=>411
);
wwv_flow_imp_shared.create_plugin_attribute(
 p_id=>wwv_flow_imp.id(100779303843034189)
,p_plugin_id=>wwv_flow_imp.id(30148792614861281563)
,p_attribute_scope=>'APPLICATION'
,p_attribute_sequence=>1
,p_display_sequence=>10
,p_static_id=>'attribute_01'
,p_prompt=>'Use CDN'
,p_attribute_type=>'CHECKBOX'
,p_is_required=>false
,p_default_value=>'Y'
,p_is_translatable=>false
,p_help_text=>'Use CDN to load required static files for the monaco editor. This settings is required when the application is using CDN!'
);
wwv_flow_imp_shared.create_plugin_attribute(
 p_id=>wwv_flow_imp.id(100724186400882780)
,p_plugin_id=>wwv_flow_imp.id(30148792614861281563)
,p_attribute_scope=>'APPLICATION'
,p_attribute_sequence=>2
,p_display_sequence=>20
,p_static_id=>'attribute_02'
,p_prompt=>'Monaco Editor Base URL'
,p_attribute_type=>'TEXT'
,p_is_required=>true
,p_default_value=>'https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.51.0'
,p_is_translatable=>false
,p_depending_on_attribute_id=>wwv_flow_imp.id(100779303843034189)
,p_depending_on_has_to_exist=>true
,p_depending_on_condition_type=>'EQUALS'
,p_depending_on_expression=>'Y'
,p_examples=>'https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.51.0'
,p_help_text=>'Defines the path for the required Monaco Editor static files from the Cloudflare CDN. You can also change this value to another URL.'
);
wwv_flow_imp_shared.create_plugin_attribute(
 p_id=>wwv_flow_imp.id(100782383701062156)
,p_plugin_id=>wwv_flow_imp.id(30148792614861281563)
,p_attribute_scope=>'APPLICATION'
,p_attribute_sequence=>3
,p_display_sequence=>30
,p_static_id=>'attribute_03'
,p_prompt=>'APEX Version'
,p_attribute_type=>'SELECT LIST'
,p_is_required=>true
,p_default_value=>'0.51.0'
,p_is_translatable=>false
,p_depending_on_attribute_id=>wwv_flow_imp.id(100779303843034189)
,p_depending_on_has_to_exist=>true
,p_depending_on_condition_type=>'NOT_EQUALS'
,p_depending_on_expression=>'Y'
,p_lov_type=>'STATIC'
,p_help_text=>'Select your current APEX Version or select "Manual Path" to enter your custom rleative path to the static files of the monaco editor.'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(100783530179069654)
,p_plugin_attribute_id=>wwv_flow_imp.id(100782383701062156)
,p_display_sequence=>10
,p_display_value=>'21.1, 21.2'
,p_return_value=>'0.22.3'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(100783895121082469)
,p_plugin_attribute_id=>wwv_flow_imp.id(100782383701062156)
,p_display_sequence=>20
,p_display_value=>'22.1, 22.2, 23.1, 23.2'
,p_return_value=>'0.32.1'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(100790432539129698)
,p_plugin_attribute_id=>wwv_flow_imp.id(100782383701062156)
,p_display_sequence=>30
,p_display_value=>'24.1'
,p_return_value=>'0.47.0'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(100790807739133078)
,p_plugin_attribute_id=>wwv_flow_imp.id(100782383701062156)
,p_display_sequence=>40
,p_display_value=>'24.2'
,p_return_value=>'0.51.0'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(100791206605134782)
,p_plugin_attribute_id=>wwv_flow_imp.id(100782383701062156)
,p_display_sequence=>50
,p_display_value=>'Manual Path'
,p_return_value=>'manual'
,p_help_text=>'Select this option to enter the path manually.'
);
wwv_flow_imp_shared.create_plugin_attribute(
 p_id=>wwv_flow_imp.id(100791990910149093)
,p_plugin_id=>wwv_flow_imp.id(30148792614861281563)
,p_attribute_scope=>'APPLICATION'
,p_attribute_sequence=>4
,p_display_sequence=>40
,p_static_id=>'attribute_04'
,p_prompt=>'Monaco Editor Path'
,p_attribute_type=>'TEXT'
,p_is_required=>true
,p_default_value=>'/i/libraries/monaco-editor/0.51.0'
,p_is_translatable=>false
,p_depending_on_attribute_id=>wwv_flow_imp.id(100782383701062156)
,p_depending_on_has_to_exist=>true
,p_depending_on_condition_type=>'EQUALS'
,p_depending_on_expression=>'manual'
);
wwv_flow_imp_shared.create_plugin_attribute(
 p_id=>wwv_flow_imp.id(30148792923166281567)
,p_plugin_id=>wwv_flow_imp.id(30148792614861281563)
,p_attribute_scope=>'COMPONENT'
,p_attribute_sequence=>1
,p_display_sequence=>10
,p_static_id=>'attribute_01'
,p_prompt=>'Height'
,p_attribute_type=>'TEXT'
,p_is_required=>true
,p_default_value=>'50vh'
,p_is_translatable=>false
,p_help_text=>'Set height of the editor in px, vh, %...'
);
wwv_flow_imp_shared.create_plugin_attribute(
 p_id=>wwv_flow_imp.id(30148793291580281569)
,p_plugin_id=>wwv_flow_imp.id(30148792614861281563)
,p_attribute_scope=>'COMPONENT'
,p_attribute_sequence=>2
,p_display_sequence=>9999
,p_static_id=>'attribute_02'
,p_prompt=>'Execute on Save'
,p_attribute_type=>'PLSQL'
,p_is_required=>true
,p_default_value=>wwv_flow_string.join(wwv_flow_t_varchar2(
'declare',
'    l_collection_name varchar2(32767) := coalesce(:P1_COLLECTION_NAME, ''VS_CODE_CLOB'');',
'begin',
'    apex_collection.create_or_truncate_collection(p_collection_name => l_collection_name);',
'    apex_collection.add_member(p_collection_name => l_collection_name, p_clob001 => :CLOB);',
'exception',
'    when others then',
'        apex_debug.error(sqlerrm);',
'        apex_debug.error(dbms_utility.format_error_stack);',
'end;'))
,p_is_translatable=>false
,p_depending_on_attribute_id=>wwv_flow_imp.id(30148830019413281596)
,p_depending_on_has_to_exist=>true
,p_depending_on_condition_type=>'IN_LIST'
,p_depending_on_expression=>'save'
,p_help_text=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<pre>',
'declare',
'    l_collection_name varchar2(32767) := coalesce(:P1_COLLECTION_NAME, ''VS_CODE_CLOB'');',
'begin',
'    apex_collection.create_or_truncate_collection(p_collection_name => l_collection_name);',
'    apex_collection.add_member(p_collection_name => l_collection_name, p_clob001 => :CLOB);',
'exception',
'    when others then',
'        apex_debug.error(sqlerrm);',
'        apex_debug.error(dbms_utility.format_error_stack);',
'end;',
'</pre>'))
);
wwv_flow_imp_shared.create_plugin_attribute(
 p_id=>wwv_flow_imp.id(30148793667860281569)
,p_plugin_id=>wwv_flow_imp.id(30148792614861281563)
,p_attribute_scope=>'COMPONENT'
,p_attribute_sequence=>3
,p_display_sequence=>30
,p_static_id=>'attribute_03'
,p_prompt=>'Language'
,p_attribute_type=>'SELECT LIST'
,p_is_required=>true
,p_default_value=>'sql'
,p_is_translatable=>false
,p_lov_type=>'STATIC'
,p_help_text=>'Set the language for the editor. This setting can be overwritten by the sql query source. Just set language in JSON like it''s in this select list attribute.'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148814113764281584)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>10
,p_display_value=>'abap'
,p_return_value=>'abap'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148808091879281580)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>20
,p_display_value=>'azcli'
,p_return_value=>'azcli'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148797139578281572)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>30
,p_display_value=>'bat'
,p_return_value=>'bat'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148808589257281580)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>40
,p_display_value=>'c'
,p_return_value=>'c'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148824573302281592)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>50
,p_display_value=>'cameligo'
,p_return_value=>'cameligo'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148797546152281572)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>60
,p_display_value=>'clojure'
,p_return_value=>'clojure'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148798119526281573)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>70
,p_display_value=>'coffeescript'
,p_return_value=>'coffeescript'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148818640321281587)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>80
,p_display_value=>'cpp'
,p_return_value=>'cpp'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148798571116281573)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>90
,p_display_value=>'csharp'
,p_return_value=>'csharp'
,p_is_quick_pick=>true
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148814555274281584)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>100
,p_display_value=>'csp'
,p_return_value=>'csp'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148815091213281585)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>110
,p_display_value=>'css'
,p_return_value=>'css'
,p_is_quick_pick=>true
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148815543926281585)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>120
,p_display_value=>'dart'
,p_return_value=>'dart'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148809053235281580)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>130
,p_display_value=>'dockerfile'
,p_return_value=>'dockerfile'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148825065799281592)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>140
,p_display_value=>'fsharp'
,p_return_value=>'fsharp'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148825627507281592)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>150
,p_display_value=>'go'
,p_return_value=>'go'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148799069922281573)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>160
,p_display_value=>'graphql'
,p_return_value=>'graphql'
,p_is_quick_pick=>true
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148819116738281587)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>170
,p_display_value=>'handlebars'
,p_return_value=>'handlebars'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148816103802281585)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>180
,p_display_value=>'hcl'
,p_return_value=>'hcl'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148811613206281582)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>190
,p_display_value=>'html'
,p_return_value=>'html'
,p_is_quick_pick=>true
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148819577617281588)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>200
,p_display_value=>'ini'
,p_return_value=>'ini'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148812069840281582)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>210
,p_display_value=>'java'
,p_return_value=>'java'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148820066565281588)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>220
,p_display_value=>'javascript'
,p_return_value=>'javascript'
,p_is_quick_pick=>true
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148809585625281581)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>230
,p_display_value=>'json'
,p_return_value=>'json'
,p_is_quick_pick=>true
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148812575948281583)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>240
,p_display_value=>'julia'
,p_return_value=>'julia'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148813074687281583)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>250
,p_display_value=>'kotlin'
,p_return_value=>'kotlin'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148813558430281583)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>260
,p_display_value=>'less'
,p_return_value=>'less'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148820635164281589)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>270
,p_display_value=>'lexon'
,p_return_value=>'lexon'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148821085823281589)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>280
,p_display_value=>'lua'
,p_return_value=>'lua'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148799626739281574)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>290
,p_display_value=>'markdown'
,p_return_value=>'markdown'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148800063959281574)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>300
,p_display_value=>'mips'
,p_return_value=>'mips'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148817542458281586)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>310
,p_display_value=>'msdax'
,p_return_value=>'msdax'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148810100688281581)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>320
,p_display_value=>'mysql'
,p_return_value=>'mysql'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148794063860281569)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>330
,p_display_value=>'objective-c'
,p_return_value=>'objective-c'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148818040960281587)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>340
,p_display_value=>'pascal'
,p_return_value=>'pascal'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148794564194281570)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>350
,p_display_value=>'pascaligo'
,p_return_value=>'pascaligo'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148800606239281574)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>360
,p_display_value=>'perl'
,p_return_value=>'perl'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148801045274281575)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>370
,p_display_value=>'pgsql'
,p_return_value=>'pgsql'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148805073786281578)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>380
,p_display_value=>'php'
,p_return_value=>'php'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148795081823281570)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>390
,p_display_value=>'plaintext'
,p_return_value=>'plaintext'
,p_is_quick_pick=>true
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148802581465281576)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>400
,p_display_value=>'postiats'
,p_return_value=>'postiats'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148801606323281575)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>410
,p_display_value=>'powerquery'
,p_return_value=>'powerquery'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148803138709281576)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>420
,p_display_value=>'powershell'
,p_return_value=>'powershell'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148821621516281590)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>430
,p_display_value=>'pug'
,p_return_value=>'pug'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148822101026281590)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>440
,p_display_value=>'python'
,p_return_value=>'python'
,p_is_quick_pick=>true
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148803554666281577)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>450
,p_display_value=>'r'
,p_return_value=>'r'
,p_is_quick_pick=>true
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148805572196281578)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>460
,p_display_value=>'razor'
,p_return_value=>'razor'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148806112438281578)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>470
,p_display_value=>'redis'
,p_return_value=>'redis'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148804120287281577)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>480
,p_display_value=>'redshift'
,p_return_value=>'redshift'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148806611830281579)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>490
,p_display_value=>'restructuredtext'
,p_return_value=>'restructuredtext'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148802041902281575)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>500
,p_display_value=>'ruby'
,p_return_value=>'ruby'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148810624882281581)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>510
,p_display_value=>'rust'
,p_return_value=>'rust'
,p_is_quick_pick=>true
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148804609910281577)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>520
,p_display_value=>'sb'
,p_return_value=>'sb'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148807099458281579)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>530
,p_display_value=>'scala'
,p_return_value=>'scala'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148822562600281590)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>540
,p_display_value=>'scheme'
,p_return_value=>'scheme'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148811123193281582)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>550
,p_display_value=>'scss'
,p_return_value=>'scss'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148826054395281593)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>560
,p_display_value=>'shell'
,p_return_value=>'shell'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148795636112281571)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>570
,p_display_value=>'sol'
,p_return_value=>'sol'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148826625857281593)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>580
,p_display_value=>'sql'
,p_return_value=>'sql'
,p_is_quick_pick=>true
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148823051796281591)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>590
,p_display_value=>'st'
,p_return_value=>'st'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148827044992281594)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>600
,p_display_value=>'swift'
,p_return_value=>'swift'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148827585173281594)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>610
,p_display_value=>'systemverilog'
,p_return_value=>'systemverilog'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148796094882281571)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>620
,p_display_value=>'tcl'
,p_return_value=>'tcl'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148807629154281579)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>630
,p_display_value=>'twig'
,p_return_value=>'twig'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148823614996281591)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>640
,p_display_value=>'typescript'
,p_return_value=>'typescript'
,p_is_quick_pick=>true
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148824131932281591)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>650
,p_display_value=>'vb'
,p_return_value=>'vb'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148817110343281586)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>660
,p_display_value=>'verilog'
,p_return_value=>'verilog'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148816564326281586)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>670
,p_display_value=>'xml'
,p_return_value=>'xml'
,p_is_quick_pick=>true
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148796579681281571)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148793667860281569)
,p_display_sequence=>680
,p_display_value=>'yaml'
,p_return_value=>'yaml'
);
wwv_flow_imp_shared.create_plugin_attribute(
 p_id=>wwv_flow_imp.id(30148828066621281594)
,p_plugin_id=>wwv_flow_imp.id(30148792614861281563)
,p_attribute_scope=>'COMPONENT'
,p_attribute_sequence=>4
,p_display_sequence=>40
,p_static_id=>'attribute_04'
,p_prompt=>'Theme'
,p_attribute_type=>'SELECT LIST'
,p_is_required=>true
,p_default_value=>'vs-dark'
,p_is_translatable=>false
,p_lov_type=>'STATIC'
,p_help_text=>'Set Theme of the editor'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148829033128281595)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148828066621281594)
,p_display_sequence=>10
,p_display_value=>'Visual Studio Dark'
,p_return_value=>'vs-dark'
,p_is_quick_pick=>true
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148829443972281595)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148828066621281594)
,p_display_sequence=>20
,p_display_value=>'Visual Studio'
,p_return_value=>'vs'
,p_is_quick_pick=>true
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148828510333281595)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148828066621281594)
,p_display_sequence=>30
,p_display_value=>'High Contrast Black'
,p_return_value=>'hc-black'
,p_is_quick_pick=>true
);
wwv_flow_imp_shared.create_plugin_attribute(
 p_id=>wwv_flow_imp.id(30148830019413281596)
,p_plugin_id=>wwv_flow_imp.id(30148792614861281563)
,p_attribute_scope=>'COMPONENT'
,p_attribute_sequence=>5
,p_display_sequence=>50
,p_static_id=>'attribute_05'
,p_prompt=>'Buttons'
,p_attribute_type=>'CHECKBOXES'
,p_is_required=>false
,p_default_value=>'undo:redo:search:diff:save'
,p_is_translatable=>false
,p_lov_type=>'STATIC'
,p_help_text=>'Set the buttons that should be shown above the editor.'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148831899144281597)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148830019413281596)
,p_display_sequence=>10
,p_display_value=>'Undo'
,p_return_value=>'undo'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148830933570281596)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148830019413281596)
,p_display_sequence=>20
,p_display_value=>'Redo'
,p_return_value=>'redo'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148831384825281597)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148830019413281596)
,p_display_sequence=>30
,p_display_value=>'Search'
,p_return_value=>'search'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148832376303281598)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148830019413281596)
,p_display_sequence=>40
,p_display_value=>'Switch between Single Editor and Diff-Editor'
,p_return_value=>'diff'
);
wwv_flow_imp_shared.create_plugin_attr_value(
 p_id=>wwv_flow_imp.id(30148830368792281596)
,p_plugin_attribute_id=>wwv_flow_imp.id(30148830019413281596)
,p_display_sequence=>50
,p_display_value=>'Save'
,p_return_value=>'save'
);
wwv_flow_imp_shared.create_plugin_std_attribute(
 p_id=>wwv_flow_imp.id(30148833628474281603)
,p_plugin_id=>wwv_flow_imp.id(30148792614861281563)
,p_name=>'SOURCE_SQL'
,p_default_value=>wwv_flow_string.join(wwv_flow_t_varchar2(
'select',
'    -- value of the editor that can be edited and saved',
'    ''DECLARE',
'    TEXT VARCHAR2(25);',
'BEGIN',
'    TEXT := ''''HELLO World'''';',
'    DBMS_OUTPUT.PUT_LINE(TEXT);',
'END;'' as value_edit,',
'    -- value to make diff with first value',
'    ''DECLARE',
'    TEXT VARCHAR2(25);',
'BEGIN',
'    TEXT := ''''HELLO World'''';',
'    DBMS_OUTPUT.PUT_LINE(TEXT);',
'END;'' as value_diff,',
'    -- language that should be used e.g. sql, javascript, json..., all avail. languages you find in attributes',
'    ''sql'' as language',
'from',
'    dual'))
,p_sql_min_column_count=>1
,p_sql_max_column_count=>3
,p_depending_on_has_to_exist=>true
,p_help_text=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<pre>',
'select',
'    -- value of the editor that can be edited and saved',
'    ''DECLARE',
'    TEXT VARCHAR2(25);',
'BEGIN',
'    TEXT := ''''HELLO World'''';',
'    DBMS_OUTPUT.PUT_LINE(TEXT);',
'END;'' as value_edit,',
'    -- value to make diff with first value',
'    ''DECLARE',
'    TEXT VARCHAR2(25);',
'BEGIN',
'    TEXT := ''''HELLO World'''';',
'    DBMS_OUTPUT.PUT_LINE(TEXT);',
'END;'' as value_diff,',
'    -- language that should be used e.g. sql, javascript, json..., all avail. languages you find in attributes',
'    ''sql'' as language',
'from',
'    dual',
'</pre>'))
);
wwv_flow_imp_shared.create_plugin_event(
 p_id=>wwv_flow_imp.id(30148834040310281605)
,p_plugin_id=>wwv_flow_imp.id(30148792614861281563)
,p_name=>'rendered'
,p_display_name=>'Rendered'
);
wwv_flow_imp_shared.create_plugin_event(
 p_id=>wwv_flow_imp.id(30148834344034281606)
,p_plugin_id=>wwv_flow_imp.id(30148792614861281563)
,p_name=>'upload-error'
,p_display_name=>'Upload of Text has caused an error'
);
wwv_flow_imp_shared.create_plugin_event(
 p_id=>wwv_flow_imp.id(30148834778418281606)
,p_plugin_id=>wwv_flow_imp.id(30148792614861281563)
,p_name=>'upload-finished'
,p_display_name=>'Upload of Text finished'
);
end;
/
begin
wwv_flow_imp.g_varchar2_table := wwv_flow_imp.empty_varchar2_table;
wwv_flow_imp.g_varchar2_table(1) := '4D4954204C6963656E73650A0A436F7079726967687420286329203230323520526F6E6E792057656973732C20546F626961732041726E686F6C640A0A5065726D697373696F6E20697320686572656279206772616E7465642C2066726565206F662063';
wwv_flow_imp.g_varchar2_table(2) := '68617267652C20746F20616E7920706572736F6E206F627461696E696E67206120636F70790A6F66207468697320736F66747761726520616E64206173736F63696174656420646F63756D656E746174696F6E2066696C657320287468652022536F6674';
wwv_flow_imp.g_varchar2_table(3) := '7761726522292C20746F206465616C0A696E2074686520536F66747761726520776974686F7574207265737472696374696F6E2C20696E636C7564696E6720776974686F7574206C696D69746174696F6E20746865207269676874730A746F207573652C';
wwv_flow_imp.g_varchar2_table(4) := '20636F70792C206D6F646966792C206D657267652C207075626C6973682C20646973747269627574652C207375626C6963656E73652C20616E642F6F722073656C6C0A636F70696573206F662074686520536F6674776172652C20616E6420746F207065';
wwv_flow_imp.g_varchar2_table(5) := '726D697420706572736F6E7320746F2077686F6D2074686520536F6674776172652069730A6675726E697368656420746F20646F20736F2C207375626A65637420746F2074686520666F6C6C6F77696E6720636F6E646974696F6E733A0A0A5468652061';
wwv_flow_imp.g_varchar2_table(6) := '626F766520636F70797269676874206E6F7469636520616E642074686973207065726D697373696F6E206E6F74696365207368616C6C20626520696E636C7564656420696E20616C6C0A636F70696573206F72207375627374616E7469616C20706F7274';
wwv_flow_imp.g_varchar2_table(7) := '696F6E73206F662074686520536F6674776172652E0A0A54484520534F4654574152452049532050524F564944454420224153204953222C20574954484F55542057415252414E5459204F4620414E59204B494E442C2045585052455353204F520A494D';
wwv_flow_imp.g_varchar2_table(8) := '504C4945442C20494E434C5544494E4720425554204E4F54204C494D4954454420544F205448452057415252414E54494553204F46204D45524348414E544142494C4954592C0A4649544E45535320464F52204120504152544943554C41522050555250';
wwv_flow_imp.g_varchar2_table(9) := '4F534520414E44204E4F4E494E4652494E47454D454E542E20494E204E4F204556454E54205348414C4C205448450A415554484F5253204F5220434F5059524947485420484F4C44455253204245204C4941424C4520464F5220414E5920434C41494D2C';
wwv_flow_imp.g_varchar2_table(10) := '2044414D41474553204F52204F544845520A4C494142494C4954592C205748455448455220494E20414E20414354494F4E204F4620434F4E54524143542C20544F5254204F52204F54484552574953452C2041524953494E472046524F4D2C0A4F555420';
wwv_flow_imp.g_varchar2_table(11) := '4F46204F5220494E20434F4E4E454354494F4E20574954482054484520534F465457415245204F522054484520555345204F52204F54484552204445414C494E475320494E205448450A534F4654574152452E0A';
end;
/
begin
wwv_flow_imp_shared.create_plugin_file(
 p_id=>wwv_flow_imp.id(100721568491367112)
,p_plugin_id=>wwv_flow_imp.id(30148792614861281563)
,p_file_name=>'LICENSE'
,p_mime_type=>'application/octet-stream'
,p_file_charset=>'utf-8'
,p_file_content=>wwv_flow_imp.varchar2_to_blob(wwv_flow_imp.g_varchar2_table)
);
end;
/
begin
wwv_flow_imp.g_varchar2_table := wwv_flow_imp.empty_varchar2_table;
wwv_flow_imp.g_varchar2_table(1) := '4C617374207570646174653A20323032312D30312D31320D0A0D0A23232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323';
wwv_flow_imp.g_varchar2_table(2) := '2323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323230D0A0D0A4C6963656E7365204D6F6E61636F20456469746F72202D2068747470733A';
wwv_flow_imp.g_varchar2_table(3) := '2F2F6769746875622E636F6D2F4D6963726F736F66742F6D6F6E61636F2D656469746F720D0A0D0A546865204D4954204C6963656E736520284D4954290D0A0D0A436F70797269676874202863292032303136202D2070726573656E74204D6963726F73';
wwv_flow_imp.g_varchar2_table(4) := '6F667420436F72706F726174696F6E0D0A0D0A5065726D697373696F6E20697320686572656279206772616E7465642C2066726565206F66206368617267652C20746F20616E7920706572736F6E206F627461696E696E67206120636F7079206F662074';
wwv_flow_imp.g_varchar2_table(5) := '68697320736F66747761726520616E64206173736F63696174656420646F63756D656E746174696F6E2066696C657320287468652022536F66747761726522292C20746F206465616C20696E2074686520536F66747761726520776974686F7574207265';
wwv_flow_imp.g_varchar2_table(6) := '737472696374696F6E2C20696E636C7564696E6720776974686F7574206C696D69746174696F6E207468652072696768747320746F207573652C20636F70792C206D6F646966792C206D657267652C207075626C6973682C20646973747269627574652C';
wwv_flow_imp.g_varchar2_table(7) := '207375626C6963656E73652C20616E642F6F722073656C6C20636F70696573206F662074686520536F6674776172652C20616E6420746F207065726D697420706572736F6E7320746F2077686F6D2074686520536F667477617265206973206675726E69';
wwv_flow_imp.g_varchar2_table(8) := '7368656420746F20646F20736F2C207375626A65637420746F2074686520666F6C6C6F77696E6720636F6E646974696F6E733A0D0A0D0A5468652061626F766520636F70797269676874206E6F7469636520616E642074686973207065726D697373696F';
wwv_flow_imp.g_varchar2_table(9) := '6E206E6F74696365207368616C6C20626520696E636C7564656420696E20616C6C20636F70696573206F72207375627374616E7469616C20706F7274696F6E73206F662074686520536F6674776172652E0D0A0D0A54484520534F465457415245204953';
wwv_flow_imp.g_varchar2_table(10) := '2050524F564944454420224153204953222C20574954484F55542057415252414E5459204F4620414E59204B494E442C2045585052455353204F5220494D504C4945442C20494E434C5544494E4720425554204E4F54204C494D4954454420544F205448';
wwv_flow_imp.g_varchar2_table(11) := '452057415252414E54494553204F46204D45524348414E544142494C4954592C204649544E45535320464F52204120504152544943554C415220505552504F534520414E44204E4F4E494E4652494E47454D454E542E20494E204E4F204556454E542053';
wwv_flow_imp.g_varchar2_table(12) := '48414C4C2054484520415554484F5253204F5220434F5059524947485420484F4C44455253204245204C4941424C4520464F5220414E5920434C41494D2C2044414D41474553204F52204F54484552204C494142494C4954592C20574845544845522049';
wwv_flow_imp.g_varchar2_table(13) := '4E20414E20414354494F4E204F4620434F4E54524143542C20544F5254204F52204F54484552574953452C2041524953494E472046524F4D2C204F5554204F46204F5220494E20434F4E4E454354494F4E20574954482054484520534F46545741524520';
wwv_flow_imp.g_varchar2_table(14) := '4F522054484520555345204F52204F54484552204445414C494E475320494E2054484520534F4654574152452E0D0A';
end;
/
begin
wwv_flow_imp_shared.create_plugin_file(
 p_id=>wwv_flow_imp.id(100721844420367113)
,p_plugin_id=>wwv_flow_imp.id(30148792614861281563)
,p_file_name=>'LICENSE4LIBS'
,p_mime_type=>'application/octet-stream'
,p_file_charset=>'utf-8'
,p_file_content=>wwv_flow_imp.varchar2_to_blob(wwv_flow_imp.g_varchar2_table)
);
end;
/
begin
wwv_flow_imp.g_varchar2_table := wwv_flow_imp.empty_varchar2_table;
wwv_flow_imp.g_varchar2_table(1) := '636F6E737420617065784D6F6E61636F456469746F72203D2066756E6374696F6E2028617065782C202429207B0D0A202020202275736520737472696374223B0D0A20202020636F6E7374207574696C203D207B0D0A2020202020202020226665617475';
wwv_flow_imp.g_varchar2_table(2) := '726544657461696C73223A207B0D0A2020202020202020202020206E616D653A2022415045582D56532D4D6F6E61636F2D456469746F72222C0D0A20202020202020202020202073637269707456657273696F6E3A202232342E30332E3136222C0D0A20';
wwv_flow_imp.g_varchar2_table(3) := '20202020202020202020207574696C56657273696F6E3A202232322E31312E3238222C0D0A20202020202020202020202075726C3A202268747470733A2F2F6769746875622E636F6D2F526F6E6E795765697373222C0D0A202020202020202020202020';
wwv_flow_imp.g_varchar2_table(4) := '6C6963656E73653A20224D49542D4C6963656E7365220D0A20202020202020207D2C0D0A20202020202020206973446566696E6564416E644E6F744E756C6C3A2066756E6374696F6E202870496E70757429207B0D0A2020202020202020202020206966';
wwv_flow_imp.g_varchar2_table(5) := '2028747970656F662070496E70757420213D3D2022756E646566696E6564222026262070496E70757420213D3D206E756C6C2026262070496E70757420213D20222229207B0D0A2020202020202020202020202020202072657475726E20747275653B0D';
wwv_flow_imp.g_varchar2_table(6) := '0A2020202020202020202020207D20656C7365207B0D0A2020202020202020202020202020202072657475726E2066616C73653B0D0A2020202020202020202020207D0D0A20202020202020207D2C0D0A20202020202020206C6F616465723A207B0D0A';
wwv_flow_imp.g_varchar2_table(7) := '20202020202020202020202073746172743A2066756E6374696F6E202869642C207365744D696E48656967687429207B0D0A20202020202020202020202020202020696620287365744D696E48656967687429207B0D0A20202020202020202020202020';
wwv_flow_imp.g_varchar2_table(8) := '2020202020202024286964292E63737328226D696E2D686569676874222C2022313030707822293B0D0A202020202020202020202020202020207D0D0A20202020202020202020202020202020617065782E7574696C2E73686F775370696E6E65722824';
wwv_flow_imp.g_varchar2_table(9) := '28696429293B0D0A2020202020202020202020207D2C0D0A20202020202020202020202073746F703A2066756E6374696F6E202869642C2072656D6F76654D696E48656967687429207B0D0A202020202020202020202020202020206966202872656D6F';
wwv_flow_imp.g_varchar2_table(10) := '76654D696E48656967687429207B0D0A202020202020202020202020202020202020202024286964292E63737328226D696E2D686569676874222C202222293B0D0A202020202020202020202020202020207D0D0A202020202020202020202020202020';
wwv_flow_imp.g_varchar2_table(11) := '2024286964202B2022203E202E752D50726F63657373696E6722292E72656D6F766528293B0D0A2020202020202020202020202020202024286964202B2022203E202E63742D6C6F6164657222292E72656D6F766528293B0D0A20202020202020202020';
wwv_flow_imp.g_varchar2_table(12) := '20207D0D0A20202020202020207D0D0A202020207D3B0D0A202020206C657420656469746F722C0D0A2020202020202020697344696666456469746F72203D2066616C73653B0D0A0D0A202020202F2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A';
wwv_flow_imp.g_varchar2_table(13) := '2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A0D0A20202020202A2A0D0A20202020202A2A205573656420746F2075706C6F616420636C6F620D0A20202020202A2A0D0A20';
wwv_flow_imp.g_varchar2_table(14) := '202020202A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2F0D0A2020202066756E6374696F6E2075706C6F616446696C';
wwv_flow_imp.g_varchar2_table(15) := '65732870436F6E6669672C207053747229207B0D0A20202020202020207574696C2E6C6F616465722E73746172742870436F6E6669672E726567696F6E53656C293B0D0A0D0A2020202020202020636F6E737420737472417272203D20617065782E7365';
wwv_flow_imp.g_varchar2_table(16) := '727665722E6368756E6B2870537472292C0D0A2020202020202020202020206974656D73325375626D6974203D2070436F6E6669672E6974656D73325375626D69743B0D0A0D0A2020202020202020617065782E64656275672E696E666F287B0D0A2020';
wwv_flow_imp.g_varchar2_table(17) := '2020202020202020202022666374223A207574696C2E6665617475726544657461696C732E6E616D65202B2022202D2022202B202275706C6F616446696C6573222C0D0A202020202020202020202020226D7367223A202255706C6F6164207374617274';
wwv_flow_imp.g_varchar2_table(18) := '656421222C0D0A20202020202020202020202022737472417272223A207374724172722C0D0A202020202020202020202020226665617475726544657461696C73223A207574696C2E6665617475726544657461696C730D0A20202020202020207D293B';
wwv_flow_imp.g_varchar2_table(19) := '0D0A0D0A2020202020202020617065782E7365727665722E706C7567696E2870436F6E6669672E616A617849442C207B0D0A2020202020202020202020207830313A2022504F5354222C0D0A2020202020202020202020206630313A207374724172722C';
wwv_flow_imp.g_varchar2_table(20) := '0D0A202020202020202020202020706167654974656D733A206974656D73325375626D69740D0A20202020202020207D2C207B0D0A202020202020202020202020737563636573733A2066756E6374696F6E2028704461746129207B0D0A202020202020';
wwv_flow_imp.g_varchar2_table(21) := '20202020202020202020242870436F6E6669672E726567696F6E49445265667265736853656C292E74726967676572282275706C6F61642D66696E697368656422293B0D0A20202020202020202020202020202020617065782E64656275672E696E666F';
wwv_flow_imp.g_varchar2_table(22) := '287B0D0A202020202020202020202020202020202020202022666374223A207574696C2E6665617475726544657461696C732E6E616D65202B2022202D2022202B202275706C6F616446696C6573222C0D0A202020202020202020202020202020202020';
wwv_flow_imp.g_varchar2_table(23) := '2020226D7367223A202255706C6F61642066696E697368656421222C0D0A2020202020202020202020202020202020202020227044617461223A2070446174612C0D0A202020202020202020202020202020202020202022666561747572654465746169';
wwv_flow_imp.g_varchar2_table(24) := '6C73223A207574696C2E6665617475726544657461696C730D0A202020202020202020202020202020207D293B0D0A202020202020202020202020202020207574696C2E6C6F616465722E73746F702870436F6E6669672E726567696F6E53656C293B0D';
wwv_flow_imp.g_varchar2_table(25) := '0A2020202020202020202020207D2C0D0A2020202020202020202020206572726F723A2066756E6374696F6E20286A715848522C20746578745374617475732C206572726F725468726F776E29207B0D0A20202020202020202020202020202020242870';
wwv_flow_imp.g_varchar2_table(26) := '436F6E6669672E726567696F6E49445265667265736853656C292E74726967676572282275706C6F61642D6572726F7222293B0D0A20202020202020202020202020202020617065782E64656275672E6572726F72287B0D0A2020202020202020202020';
wwv_flow_imp.g_varchar2_table(27) := '20202020202020202022666374223A207574696C2E6665617475726544657461696C732E6E616D65202B2022202D2022202B202275706C6F616446696C6573222C0D0A2020202020202020202020202020202020202020226D7367223A202255706C6F61';
wwv_flow_imp.g_varchar2_table(28) := '64206572726F7221222C0D0A2020202020202020202020202020202020202020226A71584852223A206A715848522C0D0A20202020202020202020202020202020202020202274657874537461747573223A20746578745374617475732C0D0A20202020';
wwv_flow_imp.g_varchar2_table(29) := '20202020202020202020202020202020226572726F725468726F776E223A206572726F725468726F776E2C0D0A2020202020202020202020202020202020202020226665617475726544657461696C73223A207574696C2E666561747572654465746169';
wwv_flow_imp.g_varchar2_table(30) := '6C730D0A202020202020202020202020202020207D293B0D0A0D0A202020202020202020202020202020207574696C2E6C6F616465722E73746F702870436F6E6669672E726567696F6E53656C293B0D0A20202020202020202020202020202020617065';
wwv_flow_imp.g_varchar2_table(31) := '782E6576656E742E7472696767657228704F7074732E616666456C656D656E7449442C2027696D61676575706C6F61646572726F7227293B0D0A2020202020202020202020207D0D0A20202020202020207D293B0D0A202020207D0D0A0D0A202020202F';
wwv_flow_imp.g_varchar2_table(32) := '2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A0D0A20202020202A2A0D0A20202020202A2A205573656420746F20696E';
wwv_flow_imp.g_varchar2_table(33) := '697420616E20656469746F720D0A20202020202A2A0D0A20202020202A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2F';
wwv_flow_imp.g_varchar2_table(34) := '0D0A2020202066756E6374696F6E20696E6974456469746F722870436F6E6669672C20704F72675374722C20704469666653747229207B0D0A2020202020202020636F6E737420656C203D20646F63756D656E742E676574456C656D656E744279496428';
wwv_flow_imp.g_varchar2_table(35) := '70436F6E6669672E726567696F6E4944293B0D0A0D0A202020202020202069662028697344696666456469746F7229207B0D0A202020202020202020202020636F6E7374206F726967696E616C4D6F64656C203D206D6F6E61636F2E656469746F722E63';
wwv_flow_imp.g_varchar2_table(36) := '72656174654D6F64656C28704F72675374722C2070436F6E6669672E6C616E6775616765292C0D0A202020202020202020202020202020206D6F6469666965644D6F64656C203D206D6F6E61636F2E656469746F722E6372656174654D6F64656C287044';
wwv_flow_imp.g_varchar2_table(37) := '6966665374722C2070436F6E6669672E6C616E6775616765293B0D0A0D0A202020202020202020202020656469746F72203D206D6F6E61636F2E656469746F722E63726561746544696666456469746F7228656C2C207B0D0A2020202020202020202020';
wwv_flow_imp.g_varchar2_table(38) := '20202020206F726967696E616C4564697461626C653A202170436F6E6669672E726561644F6E6C792C0D0A20202020202020202020202020202020726561644F6E6C793A20747275652C0D0A202020202020202020202020202020206C616E6775616765';
wwv_flow_imp.g_varchar2_table(39) := '3A2070436F6E6669672E6C616E67756167652C0D0A202020202020202020202020202020207468656D653A2070436F6E6669672E7468656D652C0D0A202020202020202020202020202020206175746F6D617469634C61796F75743A20747275650D0A20';
wwv_flow_imp.g_varchar2_table(40) := '20202020202020202020207D293B0D0A0D0A202020202020202020202020656469746F722E7365744D6F64656C287B0D0A202020202020202020202020202020206F726967696E616C3A206F726967696E616C4D6F64656C2C0D0A202020202020202020';
wwv_flow_imp.g_varchar2_table(41) := '202020202020206D6F6469666965643A206D6F6469666965644D6F64656C0D0A2020202020202020202020207D293B0D0A20202020202020207D20656C7365207B0D0A202020202020202020202020656469746F72203D206D6F6E61636F2E656469746F';
wwv_flow_imp.g_varchar2_table(42) := '722E63726561746528656C2C207B0D0A2020202020202020202020202020202076616C75653A20704F72675374722C0D0A202020202020202020202020202020206C616E67756167653A2070436F6E6669672E6C616E67756167652C0D0A202020202020';
wwv_flow_imp.g_varchar2_table(43) := '202020202020202020207468656D653A2070436F6E6669672E7468656D652C0D0A202020202020202020202020202020206175746F6D617469634C61796F75743A20747275652C0D0A20202020202020202020202020202020726561644F6E6C793A2070';
wwv_flow_imp.g_varchar2_table(44) := '436F6E6669672E726561644F6E6C790D0A2020202020202020202020207D293B0D0A20202020202020207D0D0A202020207D0D0A0D0A202020202F2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A';
wwv_flow_imp.g_varchar2_table(45) := '2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A0D0A20202020202A2A0D0A20202020202A2A205573656420746F20637265617465206120627574746F6E0D0A20202020202A2A0D0A20202020202A2A2A2A2A2A2A2A2A2A2A2A';
wwv_flow_imp.g_varchar2_table(46) := '2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2F0D0A2020202066756E6374696F6E20637265617465427574746F6E287049636F6E29207B0D0A2020';
wwv_flow_imp.g_varchar2_table(47) := '2020202020206C65742069636F6E436F6E7461696E6572203D202428223C6469763E3C2F6469763E22293B0D0A202020202020202069636F6E436F6E7461696E65722E616464436C6173732822617065782D76732D6D6F6E61636F2D656469746F722D74';
wwv_flow_imp.g_varchar2_table(48) := '6F6F6C6261722D636F6E7461696E65722D62746E22293B0D0A202020202020202069636F6E436F6E7461696E65722E616464436C6173732822612D427574746F6E22293B0D0A0D0A20202020202020206C65742069636F6E203D202428223C7370616E3E';
wwv_flow_imp.g_varchar2_table(49) := '3C2F7370616E3E22290D0A202020202020202069636F6E2E616464436C6173732822666122293B0D0A202020202020202069636F6E2E616464436C617373287049636F6E293B0D0A202020202020202069636F6E2E616464436C6173732822617065782D';
wwv_flow_imp.g_varchar2_table(50) := '76732D6D6F6E61636F2D656469746F722D746F6F6C6261722D636F6E7461696E65722D62746E2D69636F6E22293B0D0A0D0A202020202020202069636F6E436F6E7461696E65722E617070656E642869636F6E293B0D0A20202020202020207265747572';
wwv_flow_imp.g_varchar2_table(51) := '6E2069636F6E436F6E7461696E65723B0D0A202020207D0D0A0D0A202020202F2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A';
wwv_flow_imp.g_varchar2_table(52) := '2A2A2A0D0A20202020202A2A0D0A20202020202A2A2066756E6374696F6E20746F20736176652063757272656E742064617461206F662074686520656469746F7220696E746F207468652064617461626173650D0A20202020202A2A0D0A20202020202A';
wwv_flow_imp.g_varchar2_table(53) := '2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2F0D0A2020202066756E6374696F6E2073617665436F6E74656E74287043';
wwv_flow_imp.g_varchar2_table(54) := '6F6E66696729207B0D0A20202020202020206C6574207374723B0D0A202020202020202069662028697344696666456469746F7229207B0D0A202020202020202020202020737472203D20656469746F722E6765744D6F64656C28292E6F726967696E61';
wwv_flow_imp.g_varchar2_table(55) := '6C2E67657456616C756528293B0D0A20202020202020207D20656C7365207B0D0A202020202020202020202020737472203D20656469746F722E67657456616C756528293B0D0A20202020202020207D0D0A202020202020202075706C6F616446696C65';
wwv_flow_imp.g_varchar2_table(56) := '732870436F6E6669672C20737472293B0D0A202020207D0D0A0D0A202020202F2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A';
wwv_flow_imp.g_varchar2_table(57) := '2A2A2A0D0A20202020202A2A0D0A20202020202A2A205573656420746F2072656E64657220546F6F6C6261720D0A20202020202A2A0D0A20202020202A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A';
wwv_flow_imp.g_varchar2_table(58) := '2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2F0D0A2020202066756E6374696F6E20616464546F6F6C6261722870436F6E6669672C20704469666653747229207B0D0A20202020202020206C657420736561726368203D';
wwv_flow_imp.g_varchar2_table(59) := '2066616C73653B0D0A0D0A20202020202020206966202870436F6E6669672E627574746F6E735374722026262070436F6E6669672E627574746F6E735374722E6C656E677468203E203029207B0D0A0D0A2020202020202020202020206C657420636F6E';
wwv_flow_imp.g_varchar2_table(60) := '7461696E6572203D202428223C6469763E3C2F6469763E22293B0D0A202020202020202020202020636F6E7461696E65722E616464436C6173732822617065782D76732D6D6F6E61636F2D656469746F722D746F6F6C6261722D636F6E7461696E657222';
wwv_flow_imp.g_varchar2_table(61) := '293B0D0A202020202020202020202020636F6E7461696E65722E6373732822626F726465722D626F74746F6D222C202231707820736F6C6964207267626128302C302C302C302E3037352922293B0D0A0D0A202020202020202020202020696620287043';
wwv_flow_imp.g_varchar2_table(62) := '6F6E6669672E627574746F6E732E696E6465784F662822756E646F2229203E202D3129207B0D0A2020202020202020202020202020202076617220756E646F42746E203D20637265617465427574746F6E282266612D756E646F22293B0D0A2020202020';
wwv_flow_imp.g_varchar2_table(63) := '2020202020202020202020756E646F42746E2E6F6E2822636C69636B222C2066756E6374696F6E202829207B0D0A202020202020202020202020202020202020202069662028697344696666456469746F7229207B0D0A20202020202020202020202020';
wwv_flow_imp.g_varchar2_table(64) := '2020202020202020202020656469746F722E6765744F726967696E616C456469746F7228292E6765744D6F64656C28292E756E646F28293B0D0A20202020202020202020202020202020202020207D20656C7365207B0D0A202020202020202020202020';
wwv_flow_imp.g_varchar2_table(65) := '202020202020202020202020656469746F722E6765744D6F64656C28292E756E646F28293B0D0A20202020202020202020202020202020202020207D0D0A202020202020202020202020202020207D293B0D0A2020202020202020202020202020202063';
wwv_flow_imp.g_varchar2_table(66) := '6F6E7461696E65722E617070656E6428756E646F42746E293B0D0A2020202020202020202020207D0D0A0D0A2020202020202020202020206966202870436F6E6669672E627574746F6E732E696E6465784F6628227265646F2229203E202D3129207B0D';
wwv_flow_imp.g_varchar2_table(67) := '0A202020202020202020202020202020206C65742072657065617442746E203D20637265617465427574746F6E282266612D72657065617422293B0D0A0D0A2020202020202020202020202020202072657065617442746E2E6F6E2822636C69636B222C';
wwv_flow_imp.g_varchar2_table(68) := '2066756E6374696F6E202829207B0D0A202020202020202020202020202020202020202069662028697344696666456469746F7229207B0D0A202020202020202020202020202020202020202020202020656469746F722E6765744F726967696E616C45';
wwv_flow_imp.g_varchar2_table(69) := '6469746F7228292E6765744D6F64656C28292E7265646F28293B0D0A20202020202020202020202020202020202020207D20656C7365207B0D0A202020202020202020202020202020202020202020202020656469746F722E6765744D6F64656C28292E';
wwv_flow_imp.g_varchar2_table(70) := '7265646F28293B0D0A20202020202020202020202020202020202020207D0D0A202020202020202020202020202020207D293B0D0A20202020202020202020202020202020636F6E7461696E65722E617070656E642872657065617442746E293B0D0A20';
wwv_flow_imp.g_varchar2_table(71) := '20202020202020202020207D0D0A0D0A2020202020202020202020206966202870436F6E6669672E627574746F6E732E696E6465784F6628227365617263682229203E202D3129207B0D0A202020202020202020202020202020206C6574207365617263';
wwv_flow_imp.g_varchar2_table(72) := '6842746E203D20637265617465427574746F6E282266612D73656172636822293B0D0A0D0A2020202020202020202020202020202073656172636842746E2E6F6E2822636C69636B222C2066756E6374696F6E202829207B0D0A20202020202020202020';
wwv_flow_imp.g_varchar2_table(73) := '20202020202020202020736561726368203D20217365617263683B0D0A20202020202020202020202020202020202020206966202873656172636829207B0D0A202020202020202020202020202020202020202020202020696620286973446966664564';
wwv_flow_imp.g_varchar2_table(74) := '69746F7229207B0D0A20202020202020202020202020202020202020202020202020202020656469746F722E6765744F726967696E616C456469746F7228292E676574416374696F6E2827616374696F6E732E66696E6427292E72756E28293B0D0A2020';
wwv_flow_imp.g_varchar2_table(75) := '2020202020202020202020202020202020202020202020202020656469746F722E6765744D6F646966696564456469746F7228292E676574416374696F6E2827616374696F6E732E66696E6427292E72756E28293B0D0A20202020202020202020202020';
wwv_flow_imp.g_varchar2_table(76) := '20202020202020202020207D20656C7365207B0D0A20202020202020202020202020202020202020202020202020202020656469746F722E676574416374696F6E2827616374696F6E732E66696E6427292E72756E28293B0D0A20202020202020202020';
wwv_flow_imp.g_varchar2_table(77) := '20202020202020202020202020207D0D0A20202020202020202020202020202020202020207D20656C7365207B0D0A20202020202020202020202020202020202020202020202069662028697344696666456469746F7229207B0D0A2020202020202020';
wwv_flow_imp.g_varchar2_table(78) := '2020202020202020202020202020202020202020656469746F722E6765744F726967696E616C456469746F7228292E7472696767657228276B6579626F617264272C2027636C6F736546696E6457696467657427293B0D0A202020202020202020202020';
wwv_flow_imp.g_varchar2_table(79) := '20202020202020202020202020202020656469746F722E6765744D6F646966696564456469746F7228292E7472696767657228276B6579626F617264272C2027636C6F736546696E6457696467657427293B0D0A20202020202020202020202020202020';
wwv_flow_imp.g_varchar2_table(80) := '20202020202020207D20656C7365207B0D0A20202020202020202020202020202020202020202020202020202020656469746F722E7472696767657228276B6579626F617264272C2027636C6F736546696E6457696467657427293B0D0A202020202020';
wwv_flow_imp.g_varchar2_table(81) := '2020202020202020202020202020202020207D0D0A20202020202020202020202020202020202020207D0D0A202020202020202020202020202020207D293B0D0A20202020202020202020202020202020636F6E7461696E65722E617070656E64287365';
wwv_flow_imp.g_varchar2_table(82) := '6172636842746E293B0D0A2020202020202020202020207D0D0A0D0A2020202020202020202020206966202870436F6E6669672E627574746F6E732E696E6465784F662822646966662229203E202D3129207B0D0A202020202020202020202020202020';
wwv_flow_imp.g_varchar2_table(83) := '206C6574206469666642746E203D20637265617465427574746F6E282266612D6172726F77732D6822293B0D0A0D0A202020202020202020202020202020206469666642746E2E6F6E2822636C69636B222C2066756E6374696F6E202829207B0D0A2020';
wwv_flow_imp.g_varchar2_table(84) := '2020202020202020202020202020202020206C6574207374723B0D0A0D0A2020202020202020202020202020202020202020736561726368203D2066616C73653B0D0A2020202020202020202020202020202020202020697344696666456469746F7220';
wwv_flow_imp.g_varchar2_table(85) := '3D2021697344696666456469746F723B0D0A20202020202020202020202020202020202020206966202821697344696666456469746F7229207B0D0A202020202020202020202020202020202020202020202020737472203D20656469746F722E676574';
wwv_flow_imp.g_varchar2_table(86) := '4D6F64656C28292E6F726967696E616C2E67657456616C756528293B0D0A20202020202020202020202020202020202020207D20656C7365207B0D0A202020202020202020202020202020202020202020202020737472203D20656469746F722E676574';
wwv_flow_imp.g_varchar2_table(87) := '56616C756528293B0D0A20202020202020202020202020202020202020207D0D0A2020202020202020202020202020202020202020656469746F722E646973706F736528293B0D0A2020202020202020202020202020202020202020696E697445646974';
wwv_flow_imp.g_varchar2_table(88) := '6F722870436F6E6669672C207374722C207044696666537472293B0D0A202020202020202020202020202020207D293B0D0A20202020202020202020202020202020636F6E7461696E65722E617070656E64286469666642746E293B0D0A202020202020';
wwv_flow_imp.g_varchar2_table(89) := '2020202020207D0D0A0D0A2020202020202020202020206966202870436F6E6669672E627574746F6E732E696E6465784F662822736176652229203E202D3129207B0D0A202020202020202020202020202020206C6574207361766542746E203D206372';
wwv_flow_imp.g_varchar2_table(90) := '65617465427574746F6E282266612D7361766522293B0D0A0D0A202020202020202020202020202020207361766542746E2E6F6E2822636C69636B222C2066756E6374696F6E202829207B0D0A20202020202020202020202020202020202020206C6574';
wwv_flow_imp.g_varchar2_table(91) := '207374723B0D0A202020202020202020202020202020202020202069662028697344696666456469746F7229207B0D0A202020202020202020202020202020202020202020202020737472203D20656469746F722E6765744D6F64656C28292E6F726967';
wwv_flow_imp.g_varchar2_table(92) := '696E616C2E67657456616C756528293B0D0A20202020202020202020202020202020202020207D20656C7365207B0D0A202020202020202020202020202020202020202020202020737472203D20656469746F722E67657456616C756528293B0D0A2020';
wwv_flow_imp.g_varchar2_table(93) := '2020202020202020202020202020202020207D0D0A202020202020202020202020202020202020202075706C6F616446696C65732870436F6E6669672C20737472293B0D0A202020202020202020202020202020207D293B0D0A20202020202020202020';
wwv_flow_imp.g_varchar2_table(94) := '202020202020636F6E7461696E65722E617070656E64287361766542746E293B0D0A2020202020202020202020207D0D0A0D0A202020202020202020202020242870436F6E6669672E726567696F6E53656C292E70726570656E6428636F6E7461696E65';
wwv_flow_imp.g_varchar2_table(95) := '72293B0D0A20202020202020207D0D0A0D0A20202020202020202F2F207472696767657220656469746F722066726F6D206F75747369646520746F20736176652074686520746578740D0A2020202020202020242870436F6E6669672E726567696F6E49';
wwv_flow_imp.g_varchar2_table(96) := '445265667265736853656C292E6F6E282273617665222C2066756E6374696F6E202829207B0D0A20202020202020202020202073617665436F6E74656E742870436F6E666967293B0D0A20202020202020207D293B0D0A202020207D0D0A0D0A20202020';
wwv_flow_imp.g_varchar2_table(97) := '2F2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A0D0A20202020202A2A0D0A20202020202A2A2066756E6374696F6E20';
wwv_flow_imp.g_varchar2_table(98) := '746F20736574207468652076616C7565206F6620746865206D6F6E61636F456469746F720D0A20202020202A2A0D0A20202020202A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A';
wwv_flow_imp.g_varchar2_table(99) := '2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2F0D0A2020202066756E6374696F6E2073657456616C7565287056616C75652C20704469666656616C756529207B0D0A202020202020202069662028697344696666456469746F7229207B0D0A';
wwv_flow_imp.g_varchar2_table(100) := '202020202020202020202020656469746F722E6765744F726967696E616C456469746F7228292E6765744D6F64656C28292E73657456616C7565287056616C7565293B0D0A202020202020202020202020696620287574696C2E6973446566696E656441';
wwv_flow_imp.g_varchar2_table(101) := '6E644E6F744E756C6C28704469666656616C75652929207B0D0A20202020202020202020202020202020656469746F722E6765744D6F646966696564456469746F7228292E6765744D6F64656C28292E73657456616C756528704469666656616C756529';
wwv_flow_imp.g_varchar2_table(102) := '3B0D0A2020202020202020202020207D0D0A20202020202020207D20656C7365207B0D0A202020202020202020202020656469746F722E6765744D6F64656C28292E73657456616C7565287056616C7565293B0D0A20202020202020207D0D0A20202020';
wwv_flow_imp.g_varchar2_table(103) := '7D0D0A0D0A202020202F2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A0D0A20202020202A2A0D0A20202020202A2A20';
wwv_flow_imp.g_varchar2_table(104) := '66756E6374696F6E20746F20696E697420746865206D6F6E61636F456469746F720D0A20202020202A2A0D0A20202020202A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A';
wwv_flow_imp.g_varchar2_table(105) := '2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2F0D0A2020202066756E6374696F6E206C6F6164456469746F722870446174612C2070436F6E6669672C207049735265667265736829207B0D0A20202020202020206C6574207374722C0D0A20202020';
wwv_flow_imp.g_varchar2_table(106) := '2020202020202020737472446966663B0D0A0D0A2020202020202020696620287574696C2E6973446566696E6564416E644E6F744E756C6C2870446174612929207B0D0A202020202020202020202020696620287574696C2E6973446566696E6564416E';
wwv_flow_imp.g_varchar2_table(107) := '644E6F744E756C6C2870446174612E726F77732929207B0D0A20202020202020202020202020202020696620287574696C2E6973446566696E6564416E644E6F744E756C6C2870446174612E726F77735B305D2929207B0D0A2020202020202020202020';
wwv_flow_imp.g_varchar2_table(108) := '202020202020202020696620287574696C2E6973446566696E6564416E644E6F744E756C6C2870446174612E726F77735B305D2E56414C55455F454449542929207B0D0A202020202020202020202020202020202020202020202020737472203D207044';
wwv_flow_imp.g_varchar2_table(109) := '6174612E726F77735B305D2E56414C55455F454449543B0D0A20202020202020202020202020202020202020207D0D0A2020202020202020202020202020202020202020696620287574696C2E6973446566696E6564416E644E6F744E756C6C28704461';
wwv_flow_imp.g_varchar2_table(110) := '74612E726F77735B305D2E56414C55455F444946462929207B0D0A20202020202020202020202020202020202020202020202073747244696666203D2070446174612E726F77735B305D2E56414C55455F444946463B0D0A202020202020202020202020';
wwv_flow_imp.g_varchar2_table(111) := '202020202020202020202020697344696666456469746F72203D20747275653B0D0A20202020202020202020202020202020202020207D20656C7365207B0D0A20202020202020202020202020202020202020202020202073747244696666203D207374';
wwv_flow_imp.g_varchar2_table(112) := '723B0D0A20202020202020202020202020202020202020207D0D0A2020202020202020202020202020202020202020696620287574696C2E6973446566696E6564416E644E6F744E756C6C2870446174612E726F77735B305D2E4C414E47554147452929';
wwv_flow_imp.g_varchar2_table(113) := '207B0D0A20202020202020202020202020202020202020202020202070436F6E6669672E6C616E6775616765203D2070446174612E726F77735B305D2E4C414E47554147453B0D0A20202020202020202020202020202020202020207D0D0A2020202020';
wwv_flow_imp.g_varchar2_table(114) := '20202020202020202020207D0D0A2020202020202020202020207D0D0A20202020202020207D0D0A0D0A2020202020202020696620287049735265667265736829207B0D0A20202020202020202020202073657456616C7565287374722C207374724469';
wwv_flow_imp.g_varchar2_table(115) := '6666293B0D0A2020202020202020202020207574696C2E6C6F616465722E73746F702870436F6E6669672E726567696F6E53656C293B0D0A20202020202020207D20656C7365207B0D0A202020202020202020202020726571756972652E636F6E666967';
wwv_flow_imp.g_varchar2_table(116) := '287B0D0A2020202020202020202020202020202070617468733A207B0D0A2020202020202020202020202020202020202020277673273A2070436F6E6669672E706174680D0A202020202020202020202020202020207D0D0A2020202020202020202020';
wwv_flow_imp.g_varchar2_table(117) := '207D293B0D0A0D0A20202020202020202020202072657175697265285B2276732F656469746F722F656469746F722E6D61696E225D2C2066756E6374696F6E202829207B0D0A20202020202020202020202020202020696E6974456469746F722870436F';
wwv_flow_imp.g_varchar2_table(118) := '6E6669672C207374722C2073747244696666293B0D0A20202020202020202020202020202020616464546F6F6C6261722870436F6E6669672C2073747244696666293B0D0A202020202020202020202020202020207574696C2E6C6F616465722E73746F';
wwv_flow_imp.g_varchar2_table(119) := '702870436F6E6669672E726567696F6E53656C293B0D0A20202020202020202020202020202020242870436F6E6669672E726567696F6E49445265667265736853656C292E74726967676572282272656E646572656422293B0D0A202020202020202020';
wwv_flow_imp.g_varchar2_table(120) := '2020207D293B0D0A20202020202020207D0D0A202020207D0D0A0D0A202020202F2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A';
wwv_flow_imp.g_varchar2_table(121) := '2A2A2A2A0D0A20202020202A2A0D0A20202020202A2A2066756E6374696F6E20746F2067657420646174612066726F6D20415045580D0A20202020202A2A0D0A20202020202A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A';
wwv_flow_imp.g_varchar2_table(122) := '2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2A2F0D0A2020202066756E6374696F6E20676574446174612870436F6E6669672C207049735265667265736829207B0D0A2020202020202020636F6E73';
wwv_flow_imp.g_varchar2_table(123) := '74207375626D69744974656D73203D2070436F6E6669672E6974656D73325375626D69743B0D0A20202020202020207574696C2E6C6F616465722E73746172742870436F6E6669672E726567696F6E53656C293B0D0A0D0A20202020202020202F2F2063';
wwv_flow_imp.g_varchar2_table(124) := '616C6C2061706578207365727665720D0A2020202020202020617065782E7365727665722E706C7567696E280D0A20202020202020202020202070436F6E6669672E616A617849442C207B0D0A202020202020202020202020706167654974656D733A20';
wwv_flow_imp.g_varchar2_table(125) := '7375626D69744974656D732C0D0A2020202020202020202020207830313A2027474554272C0D0A20202020202020207D2C207B0D0A202020202020202020202020737563636573733A2066756E6374696F6E2028704461746129207B0D0A202020202020';
wwv_flow_imp.g_varchar2_table(126) := '20202020202020202020617065782E64656275672E696E666F287B0D0A202020202020202020202020202020202020202022666374223A207574696C2E6665617475726544657461696C732E6E616D65202B2022202D2022202B20226765744461746122';
wwv_flow_imp.g_varchar2_table(127) := '2C0D0A202020202020202020202020202020202020202022616A6178526573706F6E7365223A2070446174612C0D0A2020202020202020202020202020202020202020226665617475726544657461696C73223A207574696C2E66656174757265446574';
wwv_flow_imp.g_varchar2_table(128) := '61696C730D0A202020202020202020202020202020207D293B0D0A202020202020202020202020202020206C6F6164456469746F722870446174612C2070436F6E6669672C2070497352656672657368293B0D0A2020202020202020202020207D2C0D0A';
wwv_flow_imp.g_varchar2_table(129) := '2020202020202020202020206572726F723A2066756E6374696F6E2028704461746129207B0D0A20202020202020202020202020202020617065782E64656275672E6572726F72287B0D0A20202020202020202020202020202020202020202266637422';
wwv_flow_imp.g_varchar2_table(130) := '3A207574696C2E6665617475726544657461696C732E6E616D65202B2022202D2022202B202267657444617461222C0D0A202020202020202020202020202020202020202022616A6178526573706F6E7365223A2070446174612C0D0A20202020202020';
wwv_flow_imp.g_varchar2_table(131) := '20202020202020202020202020226665617475726544657461696C73223A207574696C2E6665617475726544657461696C730D0A202020202020202020202020202020207D293B0D0A202020202020202020202020202020207574696C2E6C6F61646572';
wwv_flow_imp.g_varchar2_table(132) := '2E73746F702870436F6E6669672E726567696F6E53656C293B0D0A2020202020202020202020207D2C0D0A20202020202020202020202064617461547970653A20226A736F6E220D0A20202020202020207D293B0D0A202020207D0D0A0D0A2020202072';
wwv_flow_imp.g_varchar2_table(133) := '657475726E207B0D0A2020202020202020696E697469616C697A653A2066756E6374696F6E202870526567696F6E49442C2070526567696F6E4944526566726573682C2070416A617849442C20704974656D73325375626D69742C2070506174682C2070';
wwv_flow_imp.g_varchar2_table(134) := '4865696768742C20704C616E67756167652C20705468656D652C2070427574746F6E732C2070526561644F6E6C7929207B0D0A0D0A202020202020202020202020617065782E64656275672E696E666F287B0D0A20202020202020202020202020202020';
wwv_flow_imp.g_varchar2_table(135) := '22666374223A207574696C2E6665617475726544657461696C732E6E616D65202B2022202D2022202B2022696E697469616C697A65222C0D0A2020202020202020202020202020202022617267756D656E7473223A207B0D0A2020202020202020202020';
wwv_flow_imp.g_varchar2_table(136) := '2020202020202020202270526567696F6E4944223A2070526567696F6E49442C0D0A20202020202020202020202020202020202020202270526567696F6E494452656672657368223A2070526567696F6E4944526566726573682C0D0A20202020202020';
wwv_flow_imp.g_varchar2_table(137) := '202020202020202020202020202270416A61784944223A2070416A617849442C0D0A202020202020202020202020202020202020202022704974656D73325375626D6974223A20704974656D73325375626D69742C0D0A20202020202020202020202020';
wwv_flow_imp.g_varchar2_table(138) := '20202020202020227050617468223A2070506174682C0D0A20202020202020202020202020202020202020202270486569676874223A20704865696768742C0D0A202020202020202020202020202020202020202022704C616E6775616765223A20704C';
wwv_flow_imp.g_varchar2_table(139) := '616E67756167652C0D0A202020202020202020202020202020202020202022705468656D65223A20705468656D652C0D0A20202020202020202020202020202020202020202270427574746F6E73223A2070427574746F6E730D0A202020202020202020';
wwv_flow_imp.g_varchar2_table(140) := '202020202020207D2C0D0A20202020202020202020202020202020226665617475726544657461696C73223A207574696C2E6665617475726544657461696C730D0A2020202020202020202020207D293B0D0A0D0A2020202020202020202020206C6574';
wwv_flow_imp.g_varchar2_table(141) := '20636F6E6669674A534F4E203D207B7D3B0D0A202020202020202020202020636F6E6669674A534F4E2E627574746F6E73203D2070427574746F6E732E73706C697428223A22293B0D0A202020202020202020202020636F6E6669674A534F4E2E627574';
wwv_flow_imp.g_varchar2_table(142) := '746F6E73537472203D2070427574746F6E733B0D0A202020202020202020202020636F6E6669674A534F4E2E686569676874203D2070486569676874207C7C202235307668223B0D0A202020202020202020202020636F6E6669674A534F4E2E6C616E67';
wwv_flow_imp.g_varchar2_table(143) := '75616765203D20704C616E6775616765207C7C2022706C61696E74657874223B0D0A202020202020202020202020636F6E6669674A534F4E2E7468656D65203D20705468656D65207C7C202276732D6461726B223B0D0A20202020202020202020202063';
wwv_flow_imp.g_varchar2_table(144) := '6F6E6669674A534F4E2E726567696F6E4944203D2070526567696F6E49443B0D0A202020202020202020202020636F6E6669674A534F4E2E726567696F6E53656C203D20222322202B2070526567696F6E49443B0D0A202020202020202020202020636F';
wwv_flow_imp.g_varchar2_table(145) := '6E6669674A534F4E2E726567696F6E494452656672657368203D2070526567696F6E4944526566726573683B0D0A202020202020202020202020636F6E6669674A534F4E2E726567696F6E49445265667265736853656C203D20222322202B2070526567';
wwv_flow_imp.g_varchar2_table(146) := '696F6E4944526566726573683B0D0A202020202020202020202020636F6E6669674A534F4E2E70617468203D2070506174683B0D0A202020202020202020202020636F6E6669674A534F4E2E616A61784944203D2070416A617849443B0D0A2020202020';
wwv_flow_imp.g_varchar2_table(147) := '20202020202020636F6E6669674A534F4E2E726561644F6E6C79203D2070526561644F6E6C793B0D0A202020202020202020202020636F6E6669674A534F4E2E6974656D73325375626D6974203D20704974656D73325375626D69743B0D0A0D0A202020';
wwv_flow_imp.g_varchar2_table(148) := '2020202020202020202428636F6E6669674A534F4E2E726567696F6E53656C292E68656967687428636F6E6669674A534F4E2E686569676874293B0D0A2020202020202020202020202428636F6E6669674A534F4E2E726567696F6E53656C292E637373';
wwv_flow_imp.g_varchar2_table(149) := '2822626F72646572222C202231707820736F6C6964207267626128302C302C302C302E3037352922293B0D0A2020202020202020202020202428636F6E6669674A534F4E2E726567696F6E53656C292E63737328226F766572666C6F77222C2022686964';
wwv_flow_imp.g_varchar2_table(150) := '64656E22293B0D0A0D0A2020202020202020202020206765744461746128636F6E6669674A534F4E293B0D0A0D0A202020202020202020202020617065782E726567696F6E2E6372656174652870526567696F6E4944526566726573682C207B0D0A2020';
wwv_flow_imp.g_varchar2_table(151) := '2020202020202020202020202020747970653A20224D6F6E61636F20565320436F646520456469746F72222C0D0A2020202020202020202020202020202073657456616C75653A2066756E6374696F6E20287056616C75652C20704469666656616C7565';
wwv_flow_imp.g_varchar2_table(152) := '29207B0D0A202020202020202020202020202020202020202073657456616C7565287056616C75652C20704469666656616C7565293B0D0A202020202020202020202020202020207D2C0D0A20202020202020202020202020202020726566726573683A';
wwv_flow_imp.g_varchar2_table(153) := '2066756E6374696F6E202829207B0D0A20202020202020202020202020202020202020206765744461746128636F6E6669674A534F4E2C2074727565293B0D0A202020202020202020202020202020207D2C0D0A20202020202020202020202020202020';
wwv_flow_imp.g_varchar2_table(154) := '736176653A2066756E6374696F6E202829207B0D0A202020202020202020202020202020202020202073617665436F6E74656E7428636F6E6669674A534F4E293B0D0A202020202020202020202020202020207D0D0A2020202020202020202020207D29';
wwv_flow_imp.g_varchar2_table(155) := '3B0D0A20202020202020207D0D0A202020207D0D0A7D3B0D0A';
end;
/
begin
wwv_flow_imp_shared.create_plugin_file(
 p_id=>wwv_flow_imp.id(100722178672367113)
,p_plugin_id=>wwv_flow_imp.id(30148792614861281563)
,p_file_name=>'script.js'
,p_mime_type=>'text/javascript'
,p_file_charset=>'utf-8'
,p_file_content=>wwv_flow_imp.varchar2_to_blob(wwv_flow_imp.g_varchar2_table)
);
end;
/
begin
wwv_flow_imp.g_varchar2_table := wwv_flow_imp.empty_varchar2_table;
wwv_flow_imp.g_varchar2_table(1) := '636F6E737420617065784D6F6E61636F456469746F723D66756E6374696F6E28652C74297B2275736520737472696374223B636F6E7374206F3D7B6665617475726544657461696C733A7B6E616D653A22415045582D56532D4D6F6E61636F2D45646974';
wwv_flow_imp.g_varchar2_table(2) := '6F72222C73637269707456657273696F6E3A2232342E30332E3136222C7574696C56657273696F6E3A2232322E31312E3238222C75726C3A2268747470733A2F2F6769746875622E636F6D2F526F6E6E795765697373222C6C6963656E73653A224D4954';
wwv_flow_imp.g_varchar2_table(3) := '2D4C6963656E7365227D2C6973446566696E6564416E644E6F744E756C6C3A66756E6374696F6E2865297B72657475726E206E756C6C213D6526262222213D657D2C6C6F616465723A7B73746172743A66756E6374696F6E286F2C69297B69262674286F';
wwv_flow_imp.g_varchar2_table(4) := '292E63737328226D696E2D686569676874222C22313030707822292C652E7574696C2E73686F775370696E6E65722874286F29297D2C73746F703A66756E6374696F6E28652C6F297B6F2626742865292E63737328226D696E2D686569676874222C2222';
wwv_flow_imp.g_varchar2_table(5) := '292C7428652B22203E202E752D50726F63657373696E6722292E72656D6F766528292C7428652B22203E202E63742D6C6F6164657222292E72656D6F766528297D7D7D3B6C657420692C6E3D21313B66756E6374696F6E206128692C6E297B6F2E6C6F61';
wwv_flow_imp.g_varchar2_table(6) := '6465722E737461727428692E726567696F6E53656C293B636F6E737420613D652E7365727665722E6368756E6B286E292C723D692E6974656D73325375626D69743B652E64656275672E696E666F287B6663743A6F2E6665617475726544657461696C73';
wwv_flow_imp.g_varchar2_table(7) := '2E6E616D652B22202D2075706C6F616446696C6573222C6D73673A2255706C6F6164207374617274656421222C7374724172723A612C6665617475726544657461696C733A6F2E6665617475726544657461696C737D292C652E7365727665722E706C75';
wwv_flow_imp.g_varchar2_table(8) := '67696E28692E616A617849442C7B7830313A22504F5354222C6630313A612C706167654974656D733A727D2C7B737563636573733A66756E6374696F6E286E297B7428692E726567696F6E49445265667265736853656C292E7472696767657228227570';
wwv_flow_imp.g_varchar2_table(9) := '6C6F61642D66696E697368656422292C652E64656275672E696E666F287B6663743A6F2E6665617475726544657461696C732E6E616D652B22202D2075706C6F616446696C6573222C6D73673A2255706C6F61642066696E697368656421222C70446174';
wwv_flow_imp.g_varchar2_table(10) := '613A6E2C6665617475726544657461696C733A6F2E6665617475726544657461696C737D292C6F2E6C6F616465722E73746F7028692E726567696F6E53656C297D2C6572726F723A66756E6374696F6E286E2C612C72297B7428692E726567696F6E4944';
wwv_flow_imp.g_varchar2_table(11) := '5265667265736853656C292E74726967676572282275706C6F61642D6572726F7222292C652E64656275672E6572726F72287B6663743A6F2E6665617475726544657461696C732E6E616D652B22202D2075706C6F616446696C6573222C6D73673A2255';
wwv_flow_imp.g_varchar2_table(12) := '706C6F6164206572726F7221222C6A715848523A6E2C746578745374617475733A612C6572726F725468726F776E3A722C6665617475726544657461696C733A6F2E6665617475726544657461696C737D292C6F2E6C6F616465722E73746F7028692E72';
wwv_flow_imp.g_varchar2_table(13) := '6567696F6E53656C292C652E6576656E742E7472696767657228704F7074732E616666456C656D656E7449442C22696D61676575706C6F61646572726F7222297D7D297D66756E6374696F6E207228652C742C6F297B636F6E737420613D646F63756D65';
wwv_flow_imp.g_varchar2_table(14) := '6E742E676574456C656D656E744279496428652E726567696F6E4944293B6966286E297B636F6E7374206E3D6D6F6E61636F2E656469746F722E6372656174654D6F64656C28742C652E6C616E6775616765292C723D6D6F6E61636F2E656469746F722E';
wwv_flow_imp.g_varchar2_table(15) := '6372656174654D6F64656C286F2C652E6C616E6775616765293B693D6D6F6E61636F2E656469746F722E63726561746544696666456469746F7228612C7B6F726967696E616C4564697461626C653A21652E726561644F6E6C792C726561644F6E6C793A';
wwv_flow_imp.g_varchar2_table(16) := '21302C6C616E67756167653A652E6C616E67756167652C7468656D653A652E7468656D652C6175746F6D617469634C61796F75743A21307D292C692E7365744D6F64656C287B6F726967696E616C3A6E2C6D6F6469666965643A727D297D656C73652069';
wwv_flow_imp.g_varchar2_table(17) := '3D6D6F6E61636F2E656469746F722E63726561746528612C7B76616C75653A742C6C616E67756167653A652E6C616E67756167652C7468656D653A652E7468656D652C6175746F6D617469634C61796F75743A21302C726561644F6E6C793A652E726561';
wwv_flow_imp.g_varchar2_table(18) := '644F6E6C797D297D66756E6374696F6E206C2865297B6C6574206F3D7428223C6469763E3C2F6469763E22293B6F2E616464436C6173732822617065782D76732D6D6F6E61636F2D656469746F722D746F6F6C6261722D636F6E7461696E65722D62746E';
wwv_flow_imp.g_varchar2_table(19) := '22292C6F2E616464436C6173732822612D427574746F6E22293B6C657420693D7428223C7370616E3E3C2F7370616E3E22293B72657475726E20692E616464436C6173732822666122292C692E616464436C6173732865292C692E616464436C61737328';
wwv_flow_imp.g_varchar2_table(20) := '22617065782D76732D6D6F6E61636F2D656469746F722D746F6F6C6261722D636F6E7461696E65722D62746E2D69636F6E22292C6F2E617070656E642869292C6F7D66756E6374696F6E20732865297B6C657420743B743D6E3F692E6765744D6F64656C';
wwv_flow_imp.g_varchar2_table(21) := '28292E6F726967696E616C2E67657456616C756528293A692E67657456616C756528292C6128652C74297D66756E6374696F6E206428652C74297B6E3F28692E6765744F726967696E616C456469746F7228292E6765744D6F64656C28292E7365745661';
wwv_flow_imp.g_varchar2_table(22) := '6C75652865292C6F2E6973446566696E6564416E644E6F744E756C6C2874292626692E6765744D6F646966696564456469746F7228292E6765744D6F64656C28292E73657456616C7565287429293A692E6765744D6F64656C28292E73657456616C7565';
wwv_flow_imp.g_varchar2_table(23) := '2865297D66756E6374696F6E207528652C752C67297B6C657420662C633B6F2E6973446566696E6564416E644E6F744E756C6C28652926266F2E6973446566696E6564416E644E6F744E756C6C28652E726F77732926266F2E6973446566696E6564416E';
wwv_flow_imp.g_varchar2_table(24) := '644E6F744E756C6C28652E726F77735B305D292626286F2E6973446566696E6564416E644E6F744E756C6C28652E726F77735B305D2E56414C55455F4544495429262628663D652E726F77735B305D2E56414C55455F45444954292C6F2E697344656669';
wwv_flow_imp.g_varchar2_table(25) := '6E6564416E644E6F744E756C6C28652E726F77735B305D2E56414C55455F44494646293F28633D652E726F77735B305D2E56414C55455F444946462C6E3D2130293A633D662C6F2E6973446566696E6564416E644E6F744E756C6C28652E726F77735B30';
wwv_flow_imp.g_varchar2_table(26) := '5D2E4C414E475541474529262628752E6C616E67756167653D652E726F77735B305D2E4C414E475541474529292C673F286428662C63292C6F2E6C6F616465722E73746F7028752E726567696F6E53656C29293A28726571756972652E636F6E66696728';
wwv_flow_imp.g_varchar2_table(27) := '7B70617468733A7B76733A752E706174687D7D292C72657175697265285B2276732F656469746F722F656469746F722E6D61696E225D2C2866756E6374696F6E28297B7228752C662C63292C66756E6374696F6E28652C6F297B6C657420643D21313B69';
wwv_flow_imp.g_varchar2_table(28) := '6628652E627574746F6E735374722626652E627574746F6E735374722E6C656E6774683E30297B6C657420733D7428223C6469763E3C2F6469763E22293B696628732E616464436C6173732822617065782D76732D6D6F6E61636F2D656469746F722D74';
wwv_flow_imp.g_varchar2_table(29) := '6F6F6C6261722D636F6E7461696E657222292C732E6373732822626F726465722D626F74746F6D222C2231707820736F6C6964207267626128302C302C302C302E3037352922292C652E627574746F6E732E696E6465784F662822756E646F22293E2D31';
wwv_flow_imp.g_varchar2_table(30) := '297B76617220753D6C282266612D756E646F22293B752E6F6E2822636C69636B222C2866756E6374696F6E28297B6E3F692E6765744F726967696E616C456469746F7228292E6765744D6F64656C28292E756E646F28293A692E6765744D6F64656C2829';
wwv_flow_imp.g_varchar2_table(31) := '2E756E646F28297D29292C732E617070656E642875297D696628652E627574746F6E732E696E6465784F6628227265646F22293E2D31297B6C657420653D6C282266612D72657065617422293B652E6F6E2822636C69636B222C2866756E6374696F6E28';
wwv_flow_imp.g_varchar2_table(32) := '297B6E3F692E6765744F726967696E616C456469746F7228292E6765744D6F64656C28292E7265646F28293A692E6765744D6F64656C28292E7265646F28297D29292C732E617070656E642865297D696628652E627574746F6E732E696E6465784F6628';
wwv_flow_imp.g_varchar2_table(33) := '2273656172636822293E2D31297B6C657420653D6C282266612D73656172636822293B652E6F6E2822636C69636B222C2866756E6374696F6E28297B643D21642C643F6E3F28692E6765744F726967696E616C456469746F7228292E676574416374696F';
wwv_flow_imp.g_varchar2_table(34) := '6E2822616374696F6E732E66696E6422292E72756E28292C692E6765744D6F646966696564456469746F7228292E676574416374696F6E2822616374696F6E732E66696E6422292E72756E2829293A692E676574416374696F6E2822616374696F6E732E';
wwv_flow_imp.g_varchar2_table(35) := '66696E6422292E72756E28293A6E3F28692E6765744F726967696E616C456469746F7228292E7472696767657228226B6579626F617264222C22636C6F736546696E6457696467657422292C692E6765744D6F646966696564456469746F7228292E7472';
wwv_flow_imp.g_varchar2_table(36) := '696767657228226B6579626F617264222C22636C6F736546696E645769646765742229293A692E7472696767657228226B6579626F617264222C22636C6F736546696E6457696467657422297D29292C732E617070656E642865297D696628652E627574';
wwv_flow_imp.g_varchar2_table(37) := '746F6E732E696E6465784F6628226469666622293E2D31297B6C657420743D6C282266612D6172726F77732D6822293B742E6F6E2822636C69636B222C2866756E6374696F6E28297B6C657420743B643D21312C6E3D216E2C743D6E3F692E6765745661';
wwv_flow_imp.g_varchar2_table(38) := '6C756528293A692E6765744D6F64656C28292E6F726967696E616C2E67657456616C756528292C692E646973706F736528292C7228652C742C6F297D29292C732E617070656E642874297D696628652E627574746F6E732E696E6465784F662822736176';
wwv_flow_imp.g_varchar2_table(39) := '6522293E2D31297B6C657420743D6C282266612D7361766522293B742E6F6E2822636C69636B222C2866756E6374696F6E28297B6C657420743B743D6E3F692E6765744D6F64656C28292E6F726967696E616C2E67657456616C756528293A692E676574';
wwv_flow_imp.g_varchar2_table(40) := '56616C756528292C6128652C74297D29292C732E617070656E642874297D7428652E726567696F6E53656C292E70726570656E642873297D7428652E726567696F6E49445265667265736853656C292E6F6E282273617665222C2866756E6374696F6E28';
wwv_flow_imp.g_varchar2_table(41) := '297B732865297D29297D28752C63292C6F2E6C6F616465722E73746F7028752E726567696F6E53656C292C7428752E726567696F6E49445265667265736853656C292E74726967676572282272656E646572656422297D2929297D66756E6374696F6E20';
wwv_flow_imp.g_varchar2_table(42) := '6728742C69297B636F6E7374206E3D742E6974656D73325375626D69743B6F2E6C6F616465722E737461727428742E726567696F6E53656C292C652E7365727665722E706C7567696E28742E616A617849442C7B706167654974656D733A6E2C7830313A';
wwv_flow_imp.g_varchar2_table(43) := '22474554227D2C7B737563636573733A66756E6374696F6E286E297B652E64656275672E696E666F287B6663743A6F2E6665617475726544657461696C732E6E616D652B22202D2067657444617461222C616A6178526573706F6E73653A6E2C66656174';
wwv_flow_imp.g_varchar2_table(44) := '75726544657461696C733A6F2E6665617475726544657461696C737D292C75286E2C742C69297D2C6572726F723A66756E6374696F6E2869297B652E64656275672E6572726F72287B6663743A6F2E6665617475726544657461696C732E6E616D652B22';
wwv_flow_imp.g_varchar2_table(45) := '202D2067657444617461222C616A6178526573706F6E73653A692C6665617475726544657461696C733A6F2E6665617475726544657461696C737D292C6F2E6C6F616465722E73746F7028742E726567696F6E53656C297D2C64617461547970653A226A';
wwv_flow_imp.g_varchar2_table(46) := '736F6E227D297D72657475726E7B696E697469616C697A653A66756E6374696F6E28692C6E2C612C722C6C2C752C662C632C702C44297B652E64656275672E696E666F287B6663743A6F2E6665617475726544657461696C732E6E616D652B22202D2069';
wwv_flow_imp.g_varchar2_table(47) := '6E697469616C697A65222C617267756D656E74733A7B70526567696F6E49443A692C70526567696F6E4944526566726573683A6E2C70416A617849443A612C704974656D73325375626D69743A722C70506174683A6C2C704865696768743A752C704C61';
wwv_flow_imp.g_varchar2_table(48) := '6E67756167653A662C705468656D653A632C70427574746F6E733A707D2C6665617475726544657461696C733A6F2E6665617475726544657461696C737D293B6C6574206D3D7B7D3B6D2E627574746F6E733D702E73706C697428223A22292C6D2E6275';
wwv_flow_imp.g_varchar2_table(49) := '74746F6E735374723D702C6D2E6865696768743D757C7C2235307668222C6D2E6C616E67756167653D667C7C22706C61696E74657874222C6D2E7468656D653D637C7C2276732D6461726B222C6D2E726567696F6E49443D692C6D2E726567696F6E5365';
wwv_flow_imp.g_varchar2_table(50) := '6C3D2223222B692C6D2E726567696F6E4944526566726573683D6E2C6D2E726567696F6E49445265667265736853656C3D2223222B6E2C6D2E706174683D6C2C6D2E616A617849443D612C6D2E726561644F6E6C793D442C6D2E6974656D73325375626D';
wwv_flow_imp.g_varchar2_table(51) := '69743D722C74286D2E726567696F6E53656C292E686569676874286D2E686569676874292C74286D2E726567696F6E53656C292E6373732822626F72646572222C2231707820736F6C6964207267626128302C302C302C302E3037352922292C74286D2E';
wwv_flow_imp.g_varchar2_table(52) := '726567696F6E53656C292E63737328226F766572666C6F77222C2268696464656E22292C67286D292C652E726567696F6E2E637265617465286E2C7B747970653A224D6F6E61636F20565320436F646520456469746F72222C73657456616C75653A6675';
wwv_flow_imp.g_varchar2_table(53) := '6E6374696F6E28652C74297B6428652C74297D2C726566726573683A66756E6374696F6E28297B67286D2C2130297D2C736176653A66756E6374696F6E28297B73286D297D7D297D7D7D3B';
end;
/
begin
wwv_flow_imp_shared.create_plugin_file(
 p_id=>wwv_flow_imp.id(100808723388349990)
,p_plugin_id=>wwv_flow_imp.id(30148792614861281563)
,p_file_name=>'script.min.js'
,p_mime_type=>'text/javascript'
,p_file_charset=>'utf-8'
,p_file_content=>wwv_flow_imp.varchar2_to_blob(wwv_flow_imp.g_varchar2_table)
);
end;
/
prompt --application/user_interfaces/combined_files
begin
null;
end;
/
prompt --application/pages/page_00000
begin
wwv_flow_imp_page.create_page(
 p_id=>0
,p_name=>'Global Page'
,p_step_title=>'Global Page'
,p_autocomplete_on_off=>'OFF'
,p_page_template_options=>'#DEFAULT#'
,p_protection_level=>'D'
,p_page_component_map=>'14'
);
end;
/
prompt --application/pages/page_00001
begin
wwv_flow_imp_page.create_page(
 p_id=>1
,p_name=>'Migrate JSON Tables'
,p_alias=>'MIGRATE-JSON-TABLES'
,p_step_title=>'Migrate JSON Tables to Duality Views'
,p_autocomplete_on_off=>'OFF'
,p_page_template_options=>'#DEFAULT#'
,p_protection_level=>'C'
,p_page_component_map=>'21'
);
wwv_flow_imp_page.create_page_plug(
 p_id=>wwv_flow_imp.id(12145548111473507)
,p_plug_name=>'Buttons'
,p_region_template_options=>'#DEFAULT#:t-ButtonRegion--noUI'
,p_plug_template=>2126429139436695430
,p_plug_display_sequence=>10
,p_location=>null
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'expand_shortcuts', 'N',
  'output_as', 'HTML')).to_clob
);
wwv_flow_imp_page.create_page_plug(
 p_id=>wwv_flow_imp.id(15056342476116113)
,p_plug_name=>'Flex'
,p_plug_display_sequence=>30
,p_location=>null
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'expand_shortcuts', 'N',
  'output_as', 'HTML')).to_clob
);
wwv_flow_imp_page.create_page_plug(
 p_id=>wwv_flow_imp.id(15056479362116114)
,p_plug_name=>'Drop'
,p_plug_display_sequence=>60
,p_plug_new_grid_row=>false
,p_location=>null
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'expand_shortcuts', 'N',
  'output_as', 'HTML')).to_clob
);
wwv_flow_imp_page.create_page_plug(
 p_id=>wwv_flow_imp.id(21111539755883917)
,p_plug_name=>'Migrate JSON Collection Tables to Duality Views'
,p_icon_css_classes=>'fa-magic'
,p_region_template_options=>'#DEFAULT#'
,p_plug_template=>2674017834225413037
,p_plug_display_sequence=>50
,p_plug_display_point=>'REGION_POSITION_01'
,p_location=>null
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'expand_shortcuts', 'N',
  'output_as', 'HTML')).to_clob
);
wwv_flow_imp_page.create_page_plug(
 p_id=>wwv_flow_imp.id(23015223006415242)
,p_plug_name=>'Tabs'
,p_region_template_options=>'#DEFAULT#:t-TabsRegion-mod--simple'
,p_plug_template=>3223171818405608528
,p_plug_display_sequence=>90
,p_location=>null
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'expand_shortcuts', 'N',
  'output_as', 'HTML')).to_clob
);
wwv_flow_imp_page.create_page_plug(
 p_id=>wwv_flow_imp.id(23015364222415243)
,p_plug_name=>'Tables to Migrate'
,p_parent_plug_id=>wwv_flow_imp.id(23015223006415242)
,p_plug_display_sequence=>10
,p_plug_display_point=>'SUB_REGIONS'
,p_location=>null
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'expand_shortcuts', 'N',
  'output_as', 'HTML')).to_clob
);
wwv_flow_imp_page.create_page_plug(
 p_id=>wwv_flow_imp.id(20813330087099634)
,p_plug_name=>'Tables to Migrate'
,p_region_name=>'json_tables_to_migrate'
,p_parent_plug_id=>wwv_flow_imp.id(23015364222415243)
,p_region_css_classes=>'margin-top-md'
,p_region_template_options=>'#DEFAULT#'
,p_component_template_options=>'#DEFAULT#'
,p_plug_template=>2100526641005906379
,p_plug_display_sequence=>100
,p_plug_display_point=>'SUB_REGIONS'
,p_query_type=>'SQL'
,p_plug_source=>wwv_flow_string.join(wwv_flow_t_varchar2(
'select id,',
'       json_table_name,',
'       dualv_name',
'from table(json_duality_companion.json_tables_to_migrate)'))
,p_plug_source_type=>'NATIVE_IG'
,p_prn_units=>'INCHES'
,p_prn_paper_size=>'LETTER'
,p_prn_width=>11
,p_prn_height=>8.5
,p_prn_orientation=>'HORIZONTAL'
,p_prn_page_header_font_color=>'#000000'
,p_prn_page_header_font_family=>'Helvetica'
,p_prn_page_header_font_weight=>'normal'
,p_prn_page_header_font_size=>'12'
,p_prn_page_footer_font_color=>'#000000'
,p_prn_page_footer_font_family=>'Helvetica'
,p_prn_page_footer_font_weight=>'normal'
,p_prn_page_footer_font_size=>'12'
,p_prn_header_bg_color=>'#EEEEEE'
,p_prn_header_font_color=>'#000000'
,p_prn_header_font_family=>'Helvetica'
,p_prn_header_font_weight=>'bold'
,p_prn_header_font_size=>'10'
,p_prn_body_bg_color=>'#FFFFFF'
,p_prn_body_font_color=>'#000000'
,p_prn_body_font_family=>'Helvetica'
,p_prn_body_font_weight=>'normal'
,p_prn_body_font_size=>'10'
,p_prn_border_width=>.5
,p_prn_page_header_alignment=>'CENTER'
,p_prn_page_footer_alignment=>'CENTER'
,p_prn_border_color=>'#666666'
);
wwv_flow_imp_page.create_region_column(
 p_id=>wwv_flow_imp.id(20813712468099637)
,p_name=>'DUALV_NAME'
,p_source_type=>'DB_COLUMN'
,p_source_expression=>'DUALV_NAME'
,p_data_type=>'VARCHAR2'
,p_session_state_data_type=>'VARCHAR2'
,p_is_query_only=>false
,p_item_type=>'NATIVE_TEXT_FIELD'
,p_heading=>'Duality View Name to Create'
,p_heading_alignment=>'LEFT'
,p_display_sequence=>50
,p_value_alignment=>'LEFT'
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'text_case', 'UPPER',
  'trim_spaces', 'BOTH')).to_clob
,p_is_required=>true
,p_max_length=>255
,p_enable_filter=>true
,p_filter_operators=>'C:S:CASE_INSENSITIVE:REGEXP'
,p_filter_is_required=>false
,p_filter_text_case=>'MIXED'
,p_filter_exact_match=>true
,p_filter_lov_type=>'DISTINCT'
,p_use_as_row_header=>false
,p_enable_sort_group=>true
,p_enable_control_break=>true
,p_enable_hide=>true
,p_is_primary_key=>false
,p_duplicate_value=>true
,p_include_in_export=>true
);
wwv_flow_imp_page.create_region_column(
 p_id=>wwv_flow_imp.id(20813785493099638)
,p_name=>'APEX$ROW_ACTION'
,p_session_state_data_type=>'VARCHAR2'
,p_item_type=>'NATIVE_ROW_ACTION'
,p_display_sequence=>20
,p_use_as_row_header=>false
);
wwv_flow_imp_page.create_region_column(
 p_id=>wwv_flow_imp.id(20813856729099639)
,p_name=>'APEX$ROW_SELECTOR'
,p_session_state_data_type=>'VARCHAR2'
,p_item_type=>'NATIVE_ROW_SELECTOR'
,p_display_sequence=>10
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'enable_multi_select', 'Y',
  'hide_control', 'N',
  'show_select_all', 'Y')).to_clob
,p_use_as_row_header=>false
);
wwv_flow_imp_page.create_region_column(
 p_id=>wwv_flow_imp.id(20814234634099643)
,p_name=>'ID'
,p_source_type=>'DB_COLUMN'
,p_source_expression=>'ID'
,p_data_type=>'NUMBER'
,p_session_state_data_type=>'VARCHAR2'
,p_is_query_only=>false
,p_item_type=>'NATIVE_HIDDEN'
,p_display_sequence=>30
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'value_protected', 'Y')).to_clob
,p_use_as_row_header=>false
,p_enable_sort_group=>false
,p_is_primary_key=>true
,p_duplicate_value=>true
,p_include_in_export=>false
);
wwv_flow_imp_page.create_region_column(
 p_id=>wwv_flow_imp.id(20814408296099644)
,p_name=>'JSON_TABLE_NAME'
,p_source_type=>'DB_COLUMN'
,p_source_expression=>'JSON_TABLE_NAME'
,p_data_type=>'VARCHAR2'
,p_session_state_data_type=>'VARCHAR2'
,p_is_query_only=>false
,p_item_type=>'NATIVE_POPUP_LOV'
,p_heading=>'JSON Collection Table Name with Existing Documents'
,p_heading_alignment=>'LEFT'
,p_display_sequence=>40
,p_value_alignment=>'LEFT'
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'case_sensitive', 'N',
  'display_as', 'POPUP',
  'fetch_on_search', 'N',
  'initial_fetch', 'FIRST_ROWSET',
  'manual_entry', 'N',
  'match_type', 'CONTAINS',
  'min_chars', '0')).to_clob
,p_is_required=>false
,p_lov_type=>'SQL_QUERY'
,p_lov_source=>wwv_flow_string.join(wwv_flow_t_varchar2(
'select d, r',
'from',
'(',
'    select table_name d, table_name r',
'      from (',
'        select distinct table_name',
'          from user_tab_columns',
'         where data_type = ''JSON''',
'        minus',
'        select view_name',
'        from user_json_duality_views',
'        minus',
'        select d.referenced_name',
'        from user_json_duality_views v ',
'        left join user_dependencies d on d.name = v.view_name',
'                                        and d.type = ''VIEW''',
'                                        and d.referenced_type = ''TABLE'')',
')',
'where d not in (select json_table_name',
'                   from json_table(:P1_GRID_JSON_CONTENT, ''$[*]''',
'                      columns (',
'                         json_table_name varchar2(4000) path ''$.JSON_TABLE_NAME.v'' ',
'                      )) where json_table_name is not null)',
'order by d'))
,p_lov_display_extra=>false
,p_lov_display_null=>true
,p_lov_cascade_parent_items=>'ID'
,p_ajax_items_to_submit=>'P1_GRID_JSON_CONTENT'
,p_ajax_optimize_refresh=>true
,p_filter_is_required=>false
,p_static_id=>'JSON_TABLE_NAME'
,p_use_as_row_header=>false
,p_enable_hide=>true
,p_is_primary_key=>false
,p_duplicate_value=>true
,p_include_in_export=>true
);
wwv_flow_imp_page.create_interactive_grid(
 p_id=>wwv_flow_imp.id(20813494634099635)
,p_internal_uid=>9042575122926430
,p_is_editable=>true
,p_edit_operations=>'i:u:d'
,p_lost_update_check_type=>'VALUES'
,p_add_row_if_empty=>true
,p_submit_checked_rows=>false
,p_lazy_loading=>false
,p_requires_filter=>false
,p_select_first_row=>true
,p_fixed_row_height=>true
,p_pagination_type=>'SCROLL'
,p_show_total_row_count=>true
,p_show_toolbar=>true
,p_toolbar_buttons=>null
,p_add_button_label=>'Add JSON Table to Migrate'
,p_enable_save_public_report=>false
,p_enable_subscriptions=>true
,p_enable_flashback=>false
,p_define_chart_view=>false
,p_enable_download=>false
,p_download_formats=>null
,p_enable_mail_download=>true
,p_fixed_header=>'PAGE'
,p_show_icon_view=>false
,p_show_detail_view=>false
);
wwv_flow_imp_page.create_ig_report(
 p_id=>wwv_flow_imp.id(20869803957849602)
,p_interactive_grid_id=>wwv_flow_imp.id(20813494634099635)
,p_static_id=>'90989'
,p_type=>'PRIMARY'
,p_default_view=>'GRID'
,p_show_row_number=>false
,p_settings_area_expanded=>true
);
wwv_flow_imp_page.create_ig_report_view(
 p_id=>wwv_flow_imp.id(20869929038849603)
,p_report_id=>wwv_flow_imp.id(20869803957849602)
,p_view_type=>'GRID'
,p_stretch_columns=>true
,p_srv_exclude_null_values=>false
,p_srv_only_display_columns=>true
,p_edit_mode=>false
);
wwv_flow_imp_page.create_ig_report_column(
 p_id=>wwv_flow_imp.id(20871382344849622)
,p_view_id=>wwv_flow_imp.id(20869929038849603)
,p_display_seq=>3
,p_column_id=>wwv_flow_imp.id(20813712468099637)
,p_is_visible=>true
,p_is_frozen=>false
);
wwv_flow_imp_page.create_ig_report_column(
 p_id=>wwv_flow_imp.id(20874772645877957)
,p_view_id=>wwv_flow_imp.id(20869929038849603)
,p_display_seq=>1
,p_column_id=>wwv_flow_imp.id(20813785493099638)
,p_is_visible=>true
,p_is_frozen=>true
);
wwv_flow_imp_page.create_ig_report_column(
 p_id=>wwv_flow_imp.id(20879784073167728)
,p_view_id=>wwv_flow_imp.id(20869929038849603)
,p_display_seq=>4
,p_column_id=>wwv_flow_imp.id(20814234634099643)
,p_is_visible=>true
,p_is_frozen=>false
);
wwv_flow_imp_page.create_ig_report_column(
 p_id=>wwv_flow_imp.id(20880690596167734)
,p_view_id=>wwv_flow_imp.id(20869929038849603)
,p_display_seq=>2
,p_column_id=>wwv_flow_imp.id(20814408296099644)
,p_is_visible=>true
,p_is_frozen=>true
);
wwv_flow_imp_page.create_page_plug(
 p_id=>wwv_flow_imp.id(23015479841415244)
,p_plug_name=>'Generated DDL'
,p_parent_plug_id=>wwv_flow_imp.id(23015223006415242)
,p_plug_display_sequence=>20
,p_plug_display_point=>'SUB_REGIONS'
,p_location=>null
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'expand_shortcuts', 'N',
  'output_as', 'HTML')).to_clob
);
wwv_flow_imp_page.create_page_plug(
 p_id=>wwv_flow_imp.id(22536677407379327)
,p_plug_name=>'Generated DDL'
,p_parent_plug_id=>wwv_flow_imp.id(23015479841415244)
,p_region_template_options=>'#DEFAULT#'
,p_plug_template=>3371237801798025892
,p_plug_display_sequence=>10
,p_plug_grid_column_css_classes=>'margin-top-md'
,p_plug_display_point=>'SUB_REGIONS'
,p_location=>null
,p_plug_source=>wwv_flow_string.join(wwv_flow_t_varchar2(
'select :P1_DDL as value_edit,',
'       null    as value_diff,',
'       ''sql''   as language'))
,p_plug_source_type=>'PLUGIN_RW.APEX.VS.MONACO.EDITOR'
,p_plug_read_only_when_type=>'ALWAYS'
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'attribute_01', 'calc(100vh - 30rem)',
  'attribute_02', 'begin null; end;',
  'attribute_03', 'sql',
  'attribute_04', 'vs',
  'attribute_05', 'search')).to_clob
);
wwv_flow_imp_page.create_page_button(
 p_id=>wwv_flow_imp.id(25133186450872251)
,p_button_sequence=>20
,p_button_plug_id=>wwv_flow_imp.id(12145548111473507)
,p_button_name=>'INFER_AND_GENERATE_SCHEMA'
,p_button_action=>'SUBMIT'
,p_button_template_options=>'#DEFAULT#:t-Button--iconLeft'
,p_button_template_id=>2082829544945815391
,p_button_image_alt=>'Generate DDL for Duality Views and Tables'
,p_icon_css_classes=>'fa-refresh'
,p_grid_new_row=>'N'
,p_grid_new_column=>'Y'
);
wwv_flow_imp_page.create_page_button(
 p_id=>wwv_flow_imp.id(23013243535415222)
,p_button_sequence=>30
,p_button_plug_id=>wwv_flow_imp.id(12145548111473507)
,p_button_name=>'RUN_SCRIPT'
,p_button_action=>'SUBMIT'
,p_button_template_options=>'#DEFAULT#:t-Button--iconLeft'
,p_button_template_id=>2082829544945815391
,p_button_image_alt=>'Run Duality View DDL and Migrate Documents'
,p_button_condition=>':P1_OUTPUT_FORMAT = ''executable'' and :P1_DDL is not null'
,p_button_condition2=>'PLSQL'
,p_button_condition_type=>'EXPRESSION'
,p_icon_css_classes=>'fa-database-play'
,p_grid_column_css_classes=>'u-align-self-center u-justify-content-center'
,p_grid_new_row=>'N'
,p_grid_new_column=>'Y'
);
wwv_flow_imp_page.create_page_item(
 p_id=>wwv_flow_imp.id(20810939020099610)
,p_name=>'P1_CONFIGURATION'
,p_data_type=>'CLOB'
,p_item_sequence=>120
,p_display_as=>'NATIVE_HIDDEN'
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'value_protected', 'Y')).to_clob
);
wwv_flow_imp_page.create_page_item(
 p_id=>wwv_flow_imp.id(20811165835099612)
,p_name=>'P1_DDL'
,p_data_type=>'CLOB'
,p_item_sequence=>130
,p_display_as=>'NATIVE_HIDDEN'
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'value_protected', 'N')).to_clob
);
wwv_flow_imp_page.create_page_item(
 p_id=>wwv_flow_imp.id(20811950255099620)
,p_name=>'P1_USE_FLEX_FIELDS'
,p_item_sequence=>30
,p_item_plug_id=>wwv_flow_imp.id(15056342476116113)
,p_item_default=>'Y'
,p_prompt=>'Use Flex Fields'
,p_display_as=>'NATIVE_YES_NO'
,p_field_template=>1609121967514267634
,p_item_template_options=>'#DEFAULT#'
,p_help_text=>'<p>When <code>useFlexFields</code> is true, for each duality view <em>VIEWNAME</em>, a flex column named <code>ORA$<em>VIEWNAME</em>_FLEX</code> is added to each table that directly underlies the top-level fields of an object in the supported documen'
||'ts. (The fields stored in a given flex column are unnested to that object.) The default value is <strong>true</strong>.</p>'
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'use_defaults', 'Y')).to_clob
);
wwv_flow_imp_page.create_page_item(
 p_id=>wwv_flow_imp.id(20812315501099623)
,p_name=>'P1_OUTPUT_FORMAT'
,p_item_sequence=>50
,p_item_default=>'executable'
,p_prompt=>'Format'
,p_display_as=>'NATIVE_SELECT_LIST'
,p_lov=>'STATIC:PL/SQL;executable,SQL;standalone'
,p_cHeight=>1
,p_begin_on_new_line=>'N'
,p_field_template=>1609121967514267634
,p_item_template_options=>'#DEFAULT#'
,p_lov_display_extra=>'NO'
,p_help_text=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<p>',
'    Defines the format of the output data definition language (DDL) script. ',
'    The default value is <code>executable</code>, which means you can execute the DDL script directly:',
'    it uses PL/SQL <code>EXECUTE IMMEDIATE</code>. The other possible value is <code>standalone</code>, ',
'    which means you can use the DDL script in a SQL script that you run separately.',
'<p>',
'<p>',
'    If the generated DDL is larger than 32K bytes then you must use <code>standalone</code>; otherwise, an error',
'    is raised when you use <code>EXECUTE IMMEDIATE</code>. An <code>executable</code> script can be too large',
'    if the input data sets are themselves very large or they have many levels of nested values.',
'</p>'))
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'page_action_on_selection', 'NONE')).to_clob
);
wwv_flow_imp_page.create_page_item(
 p_id=>wwv_flow_imp.id(20812889112099629)
,p_name=>'P1_UPDATEABLE_DUALITY_VIEWS'
,p_item_sequence=>40
,p_item_default=>'Y'
,p_prompt=>'Updateable Views?'
,p_display_as=>'NATIVE_YES_NO'
,p_begin_on_new_line=>'N'
,p_field_template=>1609121967514267634
,p_item_template_options=>'#DEFAULT#'
,p_help_text=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<p>',
'    Determines whether the duality views to be generated are to be updatable (true) or not (false).',
'    When true, annotations are set for maximum updatability of each view. When false all of the',
'    views created are read-only. The default value is true.',
'</p>'))
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'use_defaults', 'Y')).to_clob
);
wwv_flow_imp_page.create_page_item(
 p_id=>wwv_flow_imp.id(20815179140099652)
,p_name=>'P1_GRID_JSON_CONTENT'
,p_data_type=>'CLOB'
,p_item_sequence=>150
,p_display_as=>'NATIVE_HIDDEN'
,p_is_persistent=>'N'
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'value_protected', 'N')).to_clob
);
wwv_flow_imp_page.create_page_item(
 p_id=>wwv_flow_imp.id(21146124006070411)
,p_name=>'P1_CLEAR'
,p_item_sequence=>110
,p_display_as=>'NATIVE_HIDDEN'
,p_is_persistent=>'N'
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'value_protected', 'Y')).to_clob
);
wwv_flow_imp_page.create_page_item(
 p_id=>wwv_flow_imp.id(23013759928415227)
,p_name=>'P1_EXISTING_DUALITY_VIEWS'
,p_item_sequence=>140
,p_display_as=>'NATIVE_HIDDEN'
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'value_protected', 'Y')).to_clob
);
wwv_flow_imp_page.create_page_item(
 p_id=>wwv_flow_imp.id(23111904106574187)
,p_name=>'P1_IGNORE_EXISTING_VIEWS'
,p_item_sequence=>70
,p_item_plug_id=>wwv_flow_imp.id(15056479362116114)
,p_item_default=>'N'
,p_prompt=>'Ignore Existing Views?'
,p_display_as=>'NATIVE_YES_NO'
,p_begin_on_new_line=>'N'
,p_field_template=>1609121967514267634
,p_item_template_options=>'#DEFAULT#'
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'use_defaults', 'Y')).to_clob
);
wwv_flow_imp_page.create_page_item(
 p_id=>wwv_flow_imp.id(23112190840577753)
,p_name=>'P1_DROP_DEPENDENT_TABLES'
,p_item_sequence=>80
,p_item_plug_id=>wwv_flow_imp.id(15056479362116114)
,p_item_default=>'N'
,p_prompt=>'Also Drop Dependent Tables?'
,p_display_as=>'NATIVE_YES_NO'
,p_begin_on_new_line=>'N'
,p_field_template=>1609121967514267634
,p_item_template_options=>'#DEFAULT#'
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'use_defaults', 'Y')).to_clob
);
wwv_flow_imp_page.create_page_validation(
 p_id=>wwv_flow_imp.id(23013644287415226)
,p_validation_name=>'Ensure Duality Views Don''t Exist Already'
,p_validation_sequence=>10
,p_validation=>wwv_flow_string.join(wwv_flow_t_varchar2(
'declare',
'    l_existing_views varchar2(4000);',
'begin',
'    if nvl(:P1_IGNORE_EXISTING_VIEWS,''N'') = ''N'' then',
'        l_existing_views := json_duality_companion.existing_duality_views_to_migrate;',
'        if l_existing_views is not null then',
'            return ',
'                case ',
'                    when instr(l_existing_views,'','') > 0 ',
'                    then ''These target duality views already exist:'' ',
'                    else ''This target duality view already exists:''',
'                end',
'                ||'' ''',
'                ||l_existing_views;',
'        end if;',
'    end if;',
'    return null;',
'end;'))
,p_validation2=>'PLSQL'
,p_validation_type=>'FUNC_BODY_RETURNING_ERR_TEXT'
,p_when_button_pressed=>wwv_flow_imp.id(23013243535415222)
,p_error_display_location=>'INLINE_WITH_FIELD_AND_NOTIFICATION'
);
wwv_flow_imp_page.create_page_da_event(
 p_id=>wwv_flow_imp.id(23012654010415216)
,p_name=>'When Format Changed - DDL'
,p_event_sequence=>10
,p_triggering_element_type=>'ITEM'
,p_triggering_element=>'P1_OUTPUT_FORMAT'
,p_bind_type=>'bind'
,p_execution_type=>'IMMEDIATE'
,p_bind_event_type=>'change'
);
wwv_flow_imp_page.create_page_da_action(
 p_id=>wwv_flow_imp.id(23012792221415217)
,p_event_id=>wwv_flow_imp.id(23012654010415216)
,p_event_result=>'TRUE'
,p_action_sequence=>10
,p_execute_on_page_init=>'N'
,p_name=>'Clear DDL Hidden Item'
,p_action=>'NATIVE_CLEAR'
,p_affected_elements_type=>'ITEM'
,p_affected_elements=>'P1_DDL'
);
wwv_flow_imp_page.create_page_da_action(
 p_id=>wwv_flow_imp.id(23012954846415219)
,p_event_id=>wwv_flow_imp.id(23012654010415216)
,p_event_result=>'TRUE'
,p_action_sequence=>20
,p_execute_on_page_init=>'N'
,p_name=>'Clear Code Editor'
,p_action=>'NATIVE_JAVASCRIPT_CODE'
,p_attribute_01=>'monaco.editor.getModels()[0].setValue("");'
);
wwv_flow_imp_page.create_page_da_event(
 p_id=>wwv_flow_imp.id(21110479750883906)
,p_name=>'On Page Load'
,p_event_sequence=>30
,p_bind_type=>'bind'
,p_execution_type=>'IMMEDIATE'
,p_bind_event_type=>'ready'
);
wwv_flow_imp_page.create_page_da_action(
 p_id=>wwv_flow_imp.id(20815461464099655)
,p_event_id=>wwv_flow_imp.id(21110479750883906)
,p_event_result=>'TRUE'
,p_action_sequence=>20
,p_execute_on_page_init=>'N'
,p_name=>'Get Grid Data as JSON'
,p_action=>'PLUGIN_CA.INSUM.GETIGDATA'
,p_attribute_01=>'json_tables_to_migrate'
,p_attribute_02=>'P1_GRID_JSON_CONTENT'
,p_attribute_03=>'ALL'
,p_attribute_04=>'JSON_TABLE_NAME'
,p_attribute_05=>'ID,DUALV_NAME'
);
wwv_flow_imp_page.create_page_da_event(
 p_id=>wwv_flow_imp.id(21111385896883915)
,p_name=>'When Grid Row Initialized'
,p_event_sequence=>50
,p_triggering_element_type=>'REGION'
,p_triggering_region_id=>wwv_flow_imp.id(20813330087099634)
,p_bind_type=>'bind'
,p_execution_type=>'IMMEDIATE'
,p_bind_event_type=>'NATIVE_IG|REGION TYPE|apexbeginrecordedit'
);
wwv_flow_imp_page.create_page_da_action(
 p_id=>wwv_flow_imp.id(20815342094099654)
,p_event_id=>wwv_flow_imp.id(21111385896883915)
,p_event_result=>'TRUE'
,p_action_sequence=>10
,p_execute_on_page_init=>'N'
,p_name=>'Get Grid Data as JSON'
,p_action=>'PLUGIN_CA.INSUM.GETIGDATA'
,p_attribute_01=>'json_tables_to_migrate'
,p_attribute_02=>'P1_GRID_JSON_CONTENT'
,p_attribute_03=>'ALL'
,p_attribute_04=>'JSON_TABLE_NAME'
,p_attribute_05=>'ID,DUALV_NAME'
);
wwv_flow_imp_page.create_page_da_action(
 p_id=>wwv_flow_imp.id(21110717804883908)
,p_event_id=>wwv_flow_imp.id(21111385896883915)
,p_event_result=>'TRUE'
,p_action_sequence=>30
,p_execute_on_page_init=>'N'
,p_action=>'NATIVE_JAVASCRIPT_CODE'
,p_attribute_01=>'console.log($v(''P1_GRID_JSON_CONTENT''));'
);
wwv_flow_imp_page.create_page_da_event(
 p_id=>wwv_flow_imp.id(21147465151070424)
,p_name=>'When Table Name Changed'
,p_event_sequence=>60
,p_triggering_element_type=>'COLUMN'
,p_triggering_region_id=>wwv_flow_imp.id(20813330087099634)
,p_triggering_element=>'JSON_TABLE_NAME'
,p_condition_element_type=>'COLUMN'
,p_condition_element=>'JSON_TABLE_NAME'
,p_triggering_condition_type=>'NOT_NULL'
,p_bind_type=>'bind'
,p_execution_type=>'IMMEDIATE'
,p_bind_event_type=>'change'
);
wwv_flow_imp_page.create_page_da_action(
 p_id=>wwv_flow_imp.id(21147550401070425)
,p_event_id=>wwv_flow_imp.id(21147465151070424)
,p_event_result=>'TRUE'
,p_action_sequence=>10
,p_execute_on_page_init=>'Y'
,p_name=>'Default Duality View Name'
,p_action=>'NATIVE_SET_VALUE'
,p_affected_elements_type=>'COLUMN'
,p_affected_elements=>'DUALV_NAME'
,p_attribute_01=>'JAVASCRIPT_EXPRESSION'
,p_attribute_05=>'$v(''JSON_TABLE_NAME'')+"_DV"'
,p_attribute_09=>'N'
,p_wait_for_result=>'Y'
);
wwv_flow_imp_page.create_page_da_event(
 p_id=>wwv_flow_imp.id(23012295513415212)
,p_name=>'When Format Changed - Switches'
,p_event_sequence=>70
,p_triggering_element_type=>'ITEM'
,p_triggering_element=>'P1_OUTPUT_FORMAT'
,p_triggering_condition_type=>'JAVASCRIPT_EXPRESSION'
,p_triggering_expression=>wwv_flow_string.join(wwv_flow_t_varchar2(
'$v(''P1_OUTPUT_FORMAT'') === "executable" && ',
'$v(''P1_DDL'')           !== ""'))
,p_bind_type=>'bind'
,p_execution_type=>'IMMEDIATE'
,p_bind_event_type=>'change'
);
wwv_flow_imp_page.create_page_da_action(
 p_id=>wwv_flow_imp.id(23012348910415213)
,p_event_id=>wwv_flow_imp.id(23012295513415212)
,p_event_result=>'TRUE'
,p_action_sequence=>10
,p_execute_on_page_init=>'Y'
,p_action=>'NATIVE_SHOW'
,p_affected_elements_type=>'ITEM'
,p_affected_elements=>'P1_IGNORE_EXISTING_VIEWS,P1_DROP_DEPENDENT_TABLES'
);
wwv_flow_imp_page.create_page_da_action(
 p_id=>wwv_flow_imp.id(23012539001415215)
,p_event_id=>wwv_flow_imp.id(23012295513415212)
,p_event_result=>'FALSE'
,p_action_sequence=>10
,p_execute_on_page_init=>'Y'
,p_action=>'NATIVE_HIDE'
,p_affected_elements_type=>'ITEM'
,p_affected_elements=>'P1_IGNORE_EXISTING_VIEWS,P1_DROP_DEPENDENT_TABLES'
);
wwv_flow_imp_page.create_page_da_action(
 p_id=>wwv_flow_imp.id(23013395365415223)
,p_event_id=>wwv_flow_imp.id(23012295513415212)
,p_event_result=>'TRUE'
,p_action_sequence=>20
,p_execute_on_page_init=>'Y'
,p_action=>'NATIVE_SHOW'
,p_affected_elements_type=>'BUTTON'
,p_affected_button_id=>wwv_flow_imp.id(23013243535415222)
);
wwv_flow_imp_page.create_page_da_action(
 p_id=>wwv_flow_imp.id(23013453898415224)
,p_event_id=>wwv_flow_imp.id(23012295513415212)
,p_event_result=>'FALSE'
,p_action_sequence=>20
,p_execute_on_page_init=>'Y'
,p_action=>'NATIVE_HIDE'
,p_affected_elements_type=>'BUTTON'
,p_affected_button_id=>wwv_flow_imp.id(23013243535415222)
);
wwv_flow_imp_page.create_page_da_event(
 p_id=>wwv_flow_imp.id(16145377070168787)
,p_name=>'When Ignore Switch Changed'
,p_event_sequence=>80
,p_triggering_element_type=>'ITEM'
,p_triggering_element=>'P1_IGNORE_EXISTING_VIEWS'
,p_condition_element=>'P1_IGNORE_EXISTING_VIEWS'
,p_triggering_condition_type=>'EQUALS'
,p_triggering_expression=>'Y'
,p_bind_type=>'bind'
,p_execution_type=>'IMMEDIATE'
,p_bind_event_type=>'change'
);
wwv_flow_imp_page.create_page_da_action(
 p_id=>wwv_flow_imp.id(16145743248168799)
,p_event_id=>wwv_flow_imp.id(16145377070168787)
,p_event_result=>'TRUE'
,p_action_sequence=>10
,p_execute_on_page_init=>'Y'
,p_name=>'Enable Drop Switch'
,p_action=>'NATIVE_JAVASCRIPT_CODE'
,p_attribute_01=>wwv_flow_string.join(wwv_flow_t_varchar2(
'$("#P1_DROP_DEPENDENT_TABLES").parent(".a-Switch").removeClass("apex_disabled");',
'',
''))
);
wwv_flow_imp_page.create_page_da_action(
 p_id=>wwv_flow_imp.id(16146254406168801)
,p_event_id=>wwv_flow_imp.id(16145377070168787)
,p_event_result=>'FALSE'
,p_action_sequence=>10
,p_execute_on_page_init=>'Y'
,p_name=>'Disable Drop Switch'
,p_action=>'NATIVE_JAVASCRIPT_CODE'
,p_attribute_01=>'$("#P1_DROP_DEPENDENT_TABLES").parent(".a-Switch").addClass("apex_disabled");'
);
wwv_flow_imp_page.create_page_da_event(
 p_id=>wwv_flow_imp.id(15056020878116110)
,p_name=>'When Use Flex Switch Changed'
,p_event_sequence=>90
,p_triggering_element_type=>'ITEM'
,p_triggering_element=>'P1_USE_FLEX_FIELDS'
,p_condition_element=>'P1_USE_FLEX_FIELDS'
,p_triggering_condition_type=>'EQUALS'
,p_triggering_expression=>'Y'
,p_bind_type=>'bind'
,p_execution_type=>'IMMEDIATE'
,p_bind_event_type=>'change'
);
wwv_flow_imp_page.create_page_da_action(
 p_id=>wwv_flow_imp.id(15056169683116111)
,p_event_id=>wwv_flow_imp.id(15056020878116110)
,p_event_result=>'TRUE'
,p_action_sequence=>10
,p_execute_on_page_init=>'Y'
,p_name=>'Enable Min Frequency'
,p_action=>'NATIVE_ENABLE'
,p_affected_elements_type=>'ITEM'
,p_affected_elements=>'P1_MIN_FREQUENCY'
);
wwv_flow_imp_page.create_page_da_action(
 p_id=>wwv_flow_imp.id(15056285474116112)
,p_event_id=>wwv_flow_imp.id(15056020878116110)
,p_event_result=>'FALSE'
,p_action_sequence=>10
,p_execute_on_page_init=>'Y'
,p_name=>'Disable Min Frequency'
,p_action=>'NATIVE_DISABLE'
,p_affected_elements_type=>'ITEM'
,p_affected_elements=>'P1_MIN_FREQUENCY'
);
wwv_flow_imp_page.create_page_process(
 p_id=>wwv_flow_imp.id(20812678774099627)
,p_process_sequence=>10
,p_process_point=>'AFTER_SUBMIT'
,p_process_type=>'NATIVE_EXECUTION_CHAIN'
,p_process_name=>'Create Duality Views and Tables'
,p_attribute_01=>'N'
,p_error_display_location=>'INLINE_IN_NOTIFICATION'
,p_process_when_button_id=>wwv_flow_imp.id(25133186450872251)
,p_internal_uid=>9041759262926422
);
wwv_flow_imp_page.create_page_process(
 p_id=>wwv_flow_imp.id(12128960206684801)
,p_process_sequence=>40
,p_process_point=>'AFTER_SUBMIT'
,p_process_type=>'NATIVE_EXECUTION_CHAIN'
,p_process_name=>'Run Generated DDL Script'
,p_attribute_01=>'N'
,p_error_display_location=>'INLINE_IN_NOTIFICATION'
,p_process_when_button_id=>wwv_flow_imp.id(23013243535415222)
,p_internal_uid=>12128960206684801
);
wwv_flow_imp_page.create_page_process(
 p_id=>wwv_flow_imp.id(21146269525070412)
,p_process_sequence=>10
,p_process_point=>'BEFORE_HEADER'
,p_process_type=>'NATIVE_EXECUTION_CHAIN'
,p_process_name=>'If Clearing Tables to Migrate...'
,p_attribute_01=>'N'
,p_process_when=>'P1_CLEAR'
,p_process_when_type=>'VAL_OF_ITEM_IN_COND_EQ_COND2'
,p_process_when2=>'Y'
,p_internal_uid=>9375350013897207
);
wwv_flow_imp_page.create_page_process(
 p_id=>wwv_flow_imp.id(11245420179242048)
,p_process_sequence=>10
,p_parent_process_id=>wwv_flow_imp.id(11245308318242047)
,p_process_type=>'NATIVE_INVOKE_API'
,p_process_name=>'Drop Existing Duality Views'
,p_attribute_01=>'PLSQL_PACKAGE'
,p_attribute_03=>'JSON_DUALITY_COMPANION'
,p_attribute_04=>'DROP_DUALITY_VIEWS_TO_MIGRATE'
,p_internal_uid=>11245420179242048
);
wwv_flow_imp_shared.create_invokeapi_comp_param(
 p_id=>wwv_flow_imp.id(11245552782242049)
,p_page_process_id=>wwv_flow_imp.id(11245420179242048)
,p_page_id=>1
,p_name=>'p_drop_related_tables'
,p_direction=>'IN'
,p_data_type=>'BOOLEAN'
,p_has_default=>true
,p_display_sequence=>10
,p_value_type=>'ITEM'
,p_value=>'P1_DROP_DEPENDENT_TABLES'
,p_format_mask=>'Y,N'
);
wwv_flow_imp_page.create_page_process(
 p_id=>wwv_flow_imp.id(12919003696105911)
,p_process_sequence=>10
,p_parent_process_id=>wwv_flow_imp.id(12918938743105910)
,p_process_type=>'NATIVE_INVOKE_API'
,p_process_name=>'Drop Dependent Tables from DDL'
,p_attribute_01=>'PLSQL_PACKAGE'
,p_attribute_03=>'JSON_DUALITY_COMPANION'
,p_attribute_04=>'DROP_TABLES_FROM_DDL'
,p_internal_uid=>12919003696105911
);
wwv_flow_imp_shared.create_invokeapi_comp_param(
 p_id=>wwv_flow_imp.id(12919117469105912)
,p_page_process_id=>wwv_flow_imp.id(12919003696105911)
,p_page_id=>1
,p_name=>'p_ddl'
,p_direction=>'IN'
,p_data_type=>'CLOB'
,p_has_default=>false
,p_display_sequence=>10
,p_value_type=>'ITEM'
,p_value=>'P1_DDL'
);
wwv_flow_imp_page.create_page_process(
 p_id=>wwv_flow_imp.id(20815108088099651)
,p_process_sequence=>10
,p_parent_process_id=>wwv_flow_imp.id(20814988455099650)
,p_process_type=>'NATIVE_PLSQL'
,p_process_name=>'Clear DDL'
,p_process_sql_clob=>':P1_DDL := null;'
,p_process_clob_language=>'PLSQL'
,p_internal_uid=>9044188576926446
);
wwv_flow_imp_page.create_page_process(
 p_id=>wwv_flow_imp.id(21146415275070413)
,p_process_sequence=>10
,p_parent_process_id=>wwv_flow_imp.id(21146269525070412)
,p_process_type=>'NATIVE_INVOKE_API'
,p_process_name=>'Clear Tables to Migrate'
,p_attribute_01=>'PLSQL_PACKAGE'
,p_attribute_03=>'JSON_DUALITY_COMPANION'
,p_attribute_04=>'CLEAR_JSON_TABLES_TO_MIGRATE'
,p_internal_uid=>9375495763897208
);
wwv_flow_imp_page.create_page_process(
 p_id=>wwv_flow_imp.id(20813921212099640)
,p_process_sequence=>20
,p_region_id=>wwv_flow_imp.id(20813330087099634)
,p_parent_process_id=>wwv_flow_imp.id(20812678774099627)
,p_process_type=>'NATIVE_IG_DML'
,p_process_name=>'Tables to Migrate - Save Interactive Grid Data'
,p_attribute_01=>'PLSQL_CODE'
,p_attribute_04=>wwv_flow_string.join(wwv_flow_t_varchar2(
'case :APEX$ROW_STATUS',
'when ''C'' then',
'    :ID := json_duality_companion.add_json_table_to_migrate(',
'            :JSON_TABLE_NAME,',
'            :DUALV_NAME);',
'when ''U'' then',
'    json_duality_companion.update_json_table_to_migrate(',
'            json_duality_companion.t_json_table_to_migrate(',
'                :ID,',
'                :JSON_TABLE_NAME,',
'                :DUALV_NAME));',
'when ''D'' then',
'    json_duality_companion.remove_json_table_to_migrate(',
'            json_duality_companion.t_json_table_to_migrate(',
'                :ID,',
'                :JSON_TABLE_NAME,',
'                :DUALV_NAME));',
'end case;',
''))
,p_attribute_05=>'N'
,p_attribute_06=>'N'
,p_internal_uid=>9043001700926435
);
wwv_flow_imp_page.create_page_process(
 p_id=>wwv_flow_imp.id(23013217411415221)
,p_process_sequence=>20
,p_parent_process_id=>wwv_flow_imp.id(20812678774099627)
,p_process_type=>'NATIVE_PLSQL'
,p_process_name=>'Ensure at Least One Table'
,p_process_sql_clob=>wwv_flow_string.join(wwv_flow_t_varchar2(
'if json_duality_companion.count_json_tables_to_migrate = 0 then',
'    apex_error.add_error (',
'        p_message          => ''Please select at least one table to migrate'',',
'        p_display_location => apex_error.c_on_error_page);',
'end if;'))
,p_process_clob_language=>'PLSQL'
,p_internal_uid=>11242297900242016
);
wwv_flow_imp_page.create_page_process(
 p_id=>wwv_flow_imp.id(20814856069099649)
,p_process_sequence=>30
,p_parent_process_id=>wwv_flow_imp.id(20812678774099627)
,p_process_type=>'NATIVE_EXECUTION_CHAIN'
,p_process_name=>'If Any Tables to Migrate...'
,p_attribute_01=>'N'
,p_process_when=>'json_duality_companion.json_tables_to_migrate_count > 0'
,p_process_when_type=>'EXPRESSION'
,p_process_when2=>'PLSQL'
,p_internal_uid=>9043936557926444
);
wwv_flow_imp_page.create_page_process(
 p_id=>wwv_flow_imp.id(20814988455099650)
,p_process_sequence=>40
,p_parent_process_id=>wwv_flow_imp.id(20812678774099627)
,p_process_type=>'NATIVE_EXECUTION_CHAIN'
,p_process_name=>'Else...'
,p_attribute_01=>'N'
,p_process_when=>'json_duality_companion.json_tables_to_migrate_count = 0'
,p_process_when_type=>'EXPRESSION'
,p_process_when2=>'PLSQL'
,p_internal_uid=>9044068943926445
);
wwv_flow_imp_page.create_page_process(
 p_id=>wwv_flow_imp.id(20811583354099616)
,p_process_sequence=>50
,p_parent_process_id=>wwv_flow_imp.id(20814856069099649)
,p_process_type=>'NATIVE_INVOKE_API'
,p_process_name=>'Adjust Configuration'
,p_attribute_01=>'PLSQL_PACKAGE'
,p_attribute_03=>'JSON_DUALITY_COMPANION'
,p_attribute_04=>'JSON_DUALITY_MIGRATOR_CONFIG'
,p_internal_uid=>9040663842926411
);
wwv_flow_imp_shared.create_invokeapi_comp_param(
 p_id=>wwv_flow_imp.id(20811655889099617)
,p_page_process_id=>wwv_flow_imp.id(20811583354099616)
,p_page_id=>1
,p_direction=>'OUT'
,p_data_type=>'CLOB'
,p_ignore_output=>false
,p_display_sequence=>10
,p_value_type=>'ITEM'
,p_value=>'P1_CONFIGURATION'
);
wwv_flow_imp_shared.create_invokeapi_comp_param(
 p_id=>wwv_flow_imp.id(20811879421099619)
,p_page_process_id=>wwv_flow_imp.id(20811583354099616)
,p_page_id=>1
,p_name=>'p_use_flex_fields'
,p_direction=>'IN'
,p_data_type=>'BOOLEAN'
,p_has_default=>true
,p_display_sequence=>30
,p_value_type=>'ITEM'
,p_value=>'P1_USE_FLEX_FIELDS'
,p_format_mask=>'Y,N'
);
wwv_flow_imp_shared.create_invokeapi_comp_param(
 p_id=>wwv_flow_imp.id(20812364112099624)
,p_page_process_id=>wwv_flow_imp.id(20811583354099616)
,p_page_id=>1
,p_name=>'p_output_format'
,p_direction=>'IN'
,p_data_type=>'VARCHAR2'
,p_has_default=>true
,p_display_sequence=>40
,p_value_type=>'ITEM'
,p_value=>'P1_OUTPUT_FORMAT'
);
wwv_flow_imp_shared.create_invokeapi_comp_param(
 p_id=>wwv_flow_imp.id(20813213123099632)
,p_page_process_id=>wwv_flow_imp.id(20811583354099616)
,p_page_id=>1
,p_name=>'p_updatable_duality_views'
,p_direction=>'IN'
,p_data_type=>'BOOLEAN'
,p_has_default=>true
,p_display_sequence=>50
,p_value_type=>'ITEM'
,p_value=>'P1_UPDATEABLE_DUALITY_VIEWS'
,p_format_mask=>'Y,N'
);
wwv_flow_imp_page.create_page_process(
 p_id=>wwv_flow_imp.id(25133289518872252)
,p_process_sequence=>60
,p_parent_process_id=>wwv_flow_imp.id(20814856069099649)
,p_process_type=>'NATIVE_INVOKE_API'
,p_process_name=>'Infer and Generate Schema'
,p_attribute_01=>'PLSQL_PACKAGE'
,p_attribute_03=>'DBMS_JSON_DUALITY'
,p_attribute_04=>'INFER_AND_GENERATE_SCHEMA'
,p_internal_uid=>13362370007699047
);
wwv_flow_imp_shared.create_invokeapi_comp_param(
 p_id=>wwv_flow_imp.id(20810546684099606)
,p_page_process_id=>wwv_flow_imp.id(25133289518872252)
,p_page_id=>1
,p_name=>'config'
,p_direction=>'IN'
,p_data_type=>'JSON'
,p_has_default=>false
,p_display_sequence=>20
,p_value_type=>'EXPRESSION'
,p_value_language=>'PLSQL'
,p_value=>'JSON(:P1_CONFIGURATION)'
);
wwv_flow_imp_shared.create_invokeapi_comp_param(
 p_id=>wwv_flow_imp.id(25133590153872255)
,p_page_process_id=>wwv_flow_imp.id(25133289518872252)
,p_page_id=>1
,p_direction=>'OUT'
,p_data_type=>'CLOB'
,p_ignore_output=>false
,p_display_sequence=>10
,p_value_type=>'ITEM'
,p_value=>'P1_DDL'
);
wwv_flow_imp_page.create_page_process(
 p_id=>wwv_flow_imp.id(20812760682099628)
,p_process_sequence=>70
,p_parent_process_id=>wwv_flow_imp.id(20814856069099649)
,p_process_type=>'NATIVE_PLSQL'
,p_process_name=>'Trim Unprintable Characters'
,p_process_sql_clob=>wwv_flow_string.join(wwv_flow_t_varchar2(
':P1_DDL := RTRIM(:P1_DDL,CHR(0));',
''))
,p_process_clob_language=>'PLSQL'
,p_internal_uid=>9041841170926423
);
wwv_flow_imp_page.create_page_process(
 p_id=>wwv_flow_imp.id(11245308318242047)
,p_process_sequence=>90
,p_parent_process_id=>wwv_flow_imp.id(12128960206684801)
,p_process_type=>'NATIVE_EXECUTION_CHAIN'
,p_process_name=>'If Ignoring Duality View Existence...'
,p_attribute_01=>'N'
,p_process_when=>'P1_IGNORE_EXISTING_VIEWS'
,p_process_when_type=>'VAL_OF_ITEM_IN_COND_EQ_COND2'
,p_process_when2=>'Y'
,p_internal_uid=>11245308318242047
);
wwv_flow_imp_page.create_page_process(
 p_id=>wwv_flow_imp.id(12918938743105910)
,p_process_sequence=>100
,p_parent_process_id=>wwv_flow_imp.id(12128960206684801)
,p_process_type=>'NATIVE_EXECUTION_CHAIN'
,p_process_name=>'If Dropping Dependent Tables...'
,p_attribute_01=>'N'
,p_process_when=>'P1_DROP_DEPENDENT_TABLES'
,p_process_when_type=>'VAL_OF_ITEM_IN_COND_EQ_COND2'
,p_process_when2=>'Y'
,p_internal_uid=>12918938743105910
);
wwv_flow_imp_page.create_page_process(
 p_id=>wwv_flow_imp.id(11245652648242050)
,p_process_sequence=>110
,p_parent_process_id=>wwv_flow_imp.id(12128960206684801)
,p_process_type=>'NATIVE_PLSQL'
,p_process_name=>'Create Generated Artifacts'
,p_process_sql_clob=>'execute immediate :P1_DDL;'
,p_process_clob_language=>'PLSQL'
,p_internal_uid=>11245652648242050
);
wwv_flow_imp_page.create_page_process(
 p_id=>wwv_flow_imp.id(12129097105684802)
,p_process_sequence=>120
,p_parent_process_id=>wwv_flow_imp.id(12128960206684801)
,p_process_type=>'NATIVE_INVOKE_API'
,p_process_name=>'Import JSON Collection Tables to New Duality Views'
,p_attribute_01=>'PLSQL_PACKAGE'
,p_attribute_03=>'JSON_DUALITY_COMPANION'
,p_attribute_04=>'IMPORT_DUALITY_VIEWS_TO_MIGRATE'
,p_process_success_message=>'Ran DDL and Migrated Documents Successfully'
,p_internal_uid=>12129097105684802
);
end;
/
prompt --application/pages/page_00002
begin
wwv_flow_imp_page.create_page(
 p_id=>2
,p_name=>'Create View for JSON Doc'
,p_alias=>'CREATE-VIEW-FOR-JSON-DOC'
,p_step_title=>'Create Duality View for JSON Doc'
,p_autocomplete_on_off=>'OFF'
,p_inline_css=>wwv_flow_string.join(wwv_flow_t_varchar2(
'.vertical-stretch {',
'   height: calc(100vh - 32rem);',
'}'))
,p_page_template_options=>'#DEFAULT#:t-DeferredRendering'
,p_protection_level=>'C'
,p_page_component_map=>'13'
);
wwv_flow_imp_page.create_page_plug(
 p_id=>wwv_flow_imp.id(12918056502105901)
,p_plug_name=>'Tabs'
,p_region_template_options=>'#DEFAULT#:t-TabsRegion-mod--simple'
,p_plug_template=>3223171818405608528
,p_plug_display_sequence=>120
,p_location=>null
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'expand_shortcuts', 'N',
  'output_as', 'HTML')).to_clob
);
wwv_flow_imp_page.create_page_plug(
 p_id=>wwv_flow_imp.id(12918473500105905)
,p_plug_name=>'Generated Duality View DDL'
,p_parent_plug_id=>wwv_flow_imp.id(12918056502105901)
,p_plug_display_sequence=>120
,p_plug_display_point=>'SUB_REGIONS'
,p_location=>null
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'expand_shortcuts', 'N',
  'output_as', 'HTML')).to_clob
);
wwv_flow_imp_page.create_page_plug(
 p_id=>wwv_flow_imp.id(21150043895070450)
,p_plug_name=>'Example JSON Document'
,p_region_name=>'json_example'
,p_parent_plug_id=>wwv_flow_imp.id(12918056502105901)
,p_region_template_options=>'#DEFAULT#'
,p_plug_template=>3371237801798025892
,p_plug_display_sequence=>110
,p_plug_display_point=>'SUB_REGIONS'
,p_location=>null
,p_plug_source=>wwv_flow_string.join(wwv_flow_t_varchar2(
'select :P2_EXAMPLE_JSON_DOCUMENT as value_edit,',
'       null                      as value_diff,',
'       ''json''                    as language'))
,p_plug_source_type=>'PLUGIN_RW.APEX.VS.MONACO.EDITOR'
,p_ajax_items_to_submit=>'P2_EXAMPLE_JSON_DOCUMENT'
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'attribute_01', 'calc(100vh - 32rem)',
  'attribute_02', wwv_flow_string.join(wwv_flow_t_varchar2(
    'begin',
    '  null;',
    'end;')),
  'attribute_03', 'json',
  'attribute_04', 'vs')).to_clob
);
wwv_flow_imp_page.create_page_plug(
 p_id=>wwv_flow_imp.id(21125253506707063)
,p_plug_name=>'Create Duality View for JSON Document'
,p_icon_css_classes=>'fa-eye'
,p_region_template_options=>'#DEFAULT#'
,p_plug_template=>2674017834225413037
,p_plug_display_sequence=>10
,p_plug_display_point=>'REGION_POSITION_01'
,p_location=>null
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'expand_shortcuts', 'N',
  'output_as', 'HTML')).to_clob
);
wwv_flow_imp_page.create_page_plug(
 p_id=>wwv_flow_imp.id(21145813283070407)
,p_plug_name=>'Buttons'
,p_region_template_options=>'#DEFAULT#:t-ButtonRegion--noUI'
,p_plug_template=>2126429139436695430
,p_plug_display_sequence=>90
,p_location=>null
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'expand_shortcuts', 'N',
  'output_as', 'HTML')).to_clob
);
wwv_flow_imp_page.create_page_button(
 p_id=>wwv_flow_imp.id(21112057422883922)
,p_button_sequence=>50
,p_button_plug_id=>wwv_flow_imp.id(21145813283070407)
,p_button_name=>'CREATE_NEW_DUALITY_VIEW'
,p_button_action=>'DEFINED_BY_DA'
,p_button_template_options=>'#DEFAULT#'
,p_button_template_id=>4072362960822175091
,p_button_image_alt=>'Create New JSON Duality View for Document'
,p_warn_on_unsaved_changes=>null
,p_grid_new_row=>'Y'
);
wwv_flow_imp_page.create_page_item(
 p_id=>wwv_flow_imp.id(21111642304883918)
,p_name=>'P2_NEW_DUALITY_VIEW_NAME'
,p_is_required=>true
,p_item_sequence=>10
,p_prompt=>'New Duality View Name'
,p_display_as=>'NATIVE_TEXT_FIELD'
,p_cSize=>30
,p_colspan=>6
,p_field_template=>1609122147107268652
,p_item_template_options=>'#DEFAULT#'
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'disabled', 'N',
  'submit_when_enter_pressed', 'N',
  'subtype', 'TEXT',
  'text_case', 'UPPER',
  'trim_spaces', 'BOTH')).to_clob
);
wwv_flow_imp_page.create_page_item(
 p_id=>wwv_flow_imp.id(21111746493883919)
,p_name=>'P2_EXAMPLE_JSON_DOCUMENT'
,p_data_type=>'CLOB'
,p_item_sequence=>100
,p_display_as=>'NATIVE_HIDDEN'
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'value_protected', 'N')).to_clob
);
wwv_flow_imp_page.create_page_item(
 p_id=>wwv_flow_imp.id(21111841299883920)
,p_name=>'P2_IGNORE_EXISTING_VIEW'
,p_item_sequence=>30
,p_item_default=>'N'
,p_prompt=>'Ignore Existing View?'
,p_display_as=>'NATIVE_YES_NO'
,p_begin_on_new_line=>'N'
,p_field_template=>1609121967514267634
,p_item_template_options=>'#DEFAULT#'
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'use_defaults', 'Y')).to_clob
);
wwv_flow_imp_page.create_page_item(
 p_id=>wwv_flow_imp.id(21112378628883925)
,p_name=>'P2_DDL'
,p_data_type=>'CLOB'
,p_item_sequence=>70
,p_item_plug_id=>wwv_flow_imp.id(12918473500105905)
,p_display_as=>'NATIVE_TEXTAREA'
,p_cSize=>30
,p_cHeight=>10
,p_tag_css_classes=>'u-fixedFont vertical-stretch'
,p_read_only_when_type=>'ALWAYS'
,p_field_template=>1609121967514267634
,p_item_template_options=>'#DEFAULT#'
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'auto_height', 'N',
  'character_counter', 'N',
  'resizable', 'Y',
  'trim_spaces', 'BOTH')).to_clob
);
wwv_flow_imp_page.create_page_item(
 p_id=>wwv_flow_imp.id(21113037714883932)
,p_name=>'P2_CONFIG'
,p_data_type=>'CLOB'
,p_item_sequence=>80
,p_display_as=>'NATIVE_HIDDEN'
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'value_protected', 'Y')).to_clob
);
wwv_flow_imp_page.create_page_item(
 p_id=>wwv_flow_imp.id(21146596221070415)
,p_name=>'P2_DROP_DEPENDENT_TABLES'
,p_item_sequence=>40
,p_item_default=>'N'
,p_prompt=>'Also Drop Dependent Tables?'
,p_display_as=>'NATIVE_YES_NO'
,p_begin_on_new_line=>'N'
,p_field_template=>1609121967514267634
,p_item_template_options=>'#DEFAULT#'
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'use_defaults', 'Y')).to_clob
);
wwv_flow_imp_page.create_page_item(
 p_id=>wwv_flow_imp.id(21173170130358435)
,p_name=>'P2_USE_FLEX_FIELDS'
,p_item_sequence=>20
,p_item_default=>'N'
,p_prompt=>'Use Flex Fields'
,p_display_as=>'NATIVE_YES_NO'
,p_begin_on_new_line=>'N'
,p_field_template=>1609121967514267634
,p_item_template_options=>'#DEFAULT#'
,p_help_text=>'<p>When <code>useFlexFields</code> is true, for each duality view <em>VIEWNAME</em>, a flex column named <code>ORA$<em>VIEWNAME</em>_FLEX</code> is added to each table that directly underlies the top-level fields of an object in the supported documen'
||'ts. (The fields stored in a given flex column are unnested to that object.) The default value is <strong>true</strong>.</p>'
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'use_defaults', 'Y')).to_clob
);
wwv_flow_imp_page.create_page_computation(
 p_id=>wwv_flow_imp.id(21147366269070423)
,p_computation_sequence=>10
,p_computation_item=>'P2_DROP_DEPENDENT_TABLES'
,p_computation_point=>'BEFORE_HEADER'
,p_computation_type=>'STATIC_ASSIGNMENT'
,p_computation=>'N'
,p_compute_when=>'P2_DROP_DEPENDENT_TABLES'
,p_compute_when_type=>'ITEM_IS_NULL'
);
wwv_flow_imp_page.create_page_validation(
 p_id=>wwv_flow_imp.id(21911153390072409)
,p_validation_name=>'Ensure Some JSON is Provided'
,p_validation_sequence=>10
,p_validation=>'P2_EXAMPLE_JSON_DOCUMENT'
,p_validation_type=>'ITEM_NOT_NULL'
,p_error_message=>'Please provide an example JSON document'
,p_associated_item=>wwv_flow_imp.id(21111642304883918)
,p_error_display_location=>'INLINE_WITH_FIELD_AND_NOTIFICATION'
);
wwv_flow_imp_page.create_page_validation(
 p_id=>wwv_flow_imp.id(21111983561883921)
,p_validation_name=>'Duality View Existence Check Before Create'
,p_validation_sequence=>30
,p_validation=>wwv_flow_string.join(wwv_flow_t_varchar2(
'nvl(:P2_IGNORE_EXISTING_VIEW,''N'') = ''Y''',
'or not json_duality_companion.duality_view_exists(:P2_NEW_DUALITY_VIEW_NAME)'))
,p_validation2=>'PLSQL'
,p_validation_type=>'EXPRESSION'
,p_error_message=>'There is already a JSON Duality View named &P2_NEW_DUALITY_VIEW_NAME.'
,p_when_button_pressed=>wwv_flow_imp.id(21112057422883922)
,p_associated_item=>wwv_flow_imp.id(21111642304883918)
,p_error_display_location=>'INLINE_WITH_FIELD_AND_NOTIFICATION'
);
wwv_flow_imp_page.create_page_validation(
 p_id=>wwv_flow_imp.id(21114837510883950)
,p_validation_name=>'Ensure Example JSON is Valid'
,p_validation_sequence=>40
,p_validation=>'json_duality_companion.is_valid_json(:P2_EXAMPLE_JSON_DOCUMENT)'
,p_validation2=>'PLSQL'
,p_validation_type=>'EXPRESSION'
,p_error_message=>'Syntax error in example JSON document'
,p_associated_item=>wwv_flow_imp.id(21111746493883919)
,p_error_display_location=>'INLINE_WITH_FIELD_AND_NOTIFICATION'
);
wwv_flow_imp_page.create_page_da_event(
 p_id=>wwv_flow_imp.id(21146623303070416)
,p_name=>'When Switch Changed'
,p_event_sequence=>10
,p_triggering_element_type=>'ITEM'
,p_triggering_element=>'P2_IGNORE_EXISTING_VIEW'
,p_condition_element=>'P2_IGNORE_EXISTING_VIEW'
,p_triggering_condition_type=>'EQUALS'
,p_triggering_expression=>'Y'
,p_bind_type=>'bind'
,p_execution_type=>'IMMEDIATE'
,p_bind_event_type=>'change'
);
wwv_flow_imp_page.create_page_da_action(
 p_id=>wwv_flow_imp.id(21146776635070417)
,p_event_id=>wwv_flow_imp.id(21146623303070416)
,p_event_result=>'TRUE'
,p_action_sequence=>10
,p_execute_on_page_init=>'Y'
,p_name=>'Enable Drop Switch'
,p_action=>'NATIVE_JAVASCRIPT_CODE'
,p_attribute_01=>wwv_flow_string.join(wwv_flow_t_varchar2(
'$("#P2_DROP_DEPENDENT_TABLES").parent(".a-Switch").removeClass("apex_disabled");',
'',
''))
);
wwv_flow_imp_page.create_page_da_action(
 p_id=>wwv_flow_imp.id(21146881344070418)
,p_event_id=>wwv_flow_imp.id(21146623303070416)
,p_event_result=>'FALSE'
,p_action_sequence=>10
,p_execute_on_page_init=>'Y'
,p_name=>'Disable Drop Switch'
,p_action=>'NATIVE_JAVASCRIPT_CODE'
,p_attribute_01=>'$("#P2_DROP_DEPENDENT_TABLES").parent(".a-Switch").addClass("apex_disabled");'
);
wwv_flow_imp_page.create_page_da_event(
 p_id=>wwv_flow_imp.id(21150189811070451)
,p_name=>'On Click Create New DualV'
,p_event_sequence=>20
,p_triggering_element_type=>'BUTTON'
,p_triggering_button_id=>wwv_flow_imp.id(21112057422883922)
,p_bind_type=>'bind'
,p_execution_type=>'IMMEDIATE'
,p_bind_event_type=>'click'
);
wwv_flow_imp_page.create_page_da_action(
 p_id=>wwv_flow_imp.id(21150290885070452)
,p_event_id=>wwv_flow_imp.id(21150189811070451)
,p_event_result=>'TRUE'
,p_action_sequence=>10
,p_execute_on_page_init=>'N'
,p_name=>'Get Value from Code Editor'
,p_action=>'NATIVE_JAVASCRIPT_CODE'
,p_attribute_01=>'$s(''P2_EXAMPLE_JSON_DOCUMENT'',monaco.editor.getModels()[0].getValue());'
);
wwv_flow_imp_page.create_page_da_action(
 p_id=>wwv_flow_imp.id(21150324019070453)
,p_event_id=>wwv_flow_imp.id(21150189811070451)
,p_event_result=>'TRUE'
,p_action_sequence=>30
,p_execute_on_page_init=>'N'
,p_action=>'NATIVE_SUBMIT_PAGE'
,p_attribute_01=>'CREATE_NEW_DUALITY_VIEW'
,p_attribute_02=>'N'
);
wwv_flow_imp_page.create_page_process(
 p_id=>wwv_flow_imp.id(21112199727883923)
,p_process_sequence=>10
,p_process_point=>'AFTER_SUBMIT'
,p_process_type=>'NATIVE_EXECUTION_CHAIN'
,p_process_name=>'Create New JSON Duality View for Document'
,p_attribute_01=>'N'
,p_error_display_location=>'INLINE_IN_NOTIFICATION'
,p_process_when_button_id=>wwv_flow_imp.id(21112057422883922)
,p_internal_uid=>9341280216710718
);
wwv_flow_imp_page.create_page_process(
 p_id=>wwv_flow_imp.id(12918777333105908)
,p_process_sequence=>10
,p_parent_process_id=>wwv_flow_imp.id(12918606264105907)
,p_process_type=>'NATIVE_INVOKE_API'
,p_process_name=>'Drop Tables from Generated DDL'
,p_attribute_01=>'PLSQL_PACKAGE'
,p_attribute_03=>'JSON_DUALITY_COMPANION'
,p_attribute_04=>'DROP_TABLES_FROM_DDL'
,p_internal_uid=>12918777333105908
);
wwv_flow_imp_shared.create_invokeapi_comp_param(
 p_id=>wwv_flow_imp.id(12918876924105909)
,p_page_process_id=>wwv_flow_imp.id(12918777333105908)
,p_page_id=>2
,p_name=>'p_ddl'
,p_direction=>'IN'
,p_data_type=>'CLOB'
,p_has_default=>false
,p_display_sequence=>10
,p_value_type=>'ITEM'
,p_value=>'P2_DDL'
);
wwv_flow_imp_page.create_page_process(
 p_id=>wwv_flow_imp.id(21146997257070419)
,p_process_sequence=>10
,p_parent_process_id=>wwv_flow_imp.id(21112199727883923)
,p_process_type=>'NATIVE_EXECUTION_CHAIN'
,p_process_name=>'If Ignoring Duality View Existence...'
,p_attribute_01=>'N'
,p_process_when=>'P2_IGNORE_EXISTING_VIEW'
,p_process_when_type=>'VAL_OF_ITEM_IN_COND_EQ_COND2'
,p_process_when2=>'Y'
,p_internal_uid=>9376077745897214
);
wwv_flow_imp_page.create_page_process(
 p_id=>wwv_flow_imp.id(21147020795070420)
,p_process_sequence=>10
,p_parent_process_id=>wwv_flow_imp.id(21146997257070419)
,p_process_type=>'NATIVE_INVOKE_API'
,p_process_name=>'Drop Existing Duality View'
,p_attribute_01=>'PLSQL_PACKAGE'
,p_attribute_03=>'JSON_DUALITY_COMPANION'
,p_attribute_04=>'DROP_DUALITY_VIEW'
,p_internal_uid=>9376101283897215
);
wwv_flow_imp_shared.create_invokeapi_comp_param(
 p_id=>wwv_flow_imp.id(21147130565070421)
,p_page_process_id=>wwv_flow_imp.id(21147020795070420)
,p_page_id=>2
,p_name=>'p_dualv_name'
,p_direction=>'IN'
,p_data_type=>'VARCHAR2'
,p_has_default=>false
,p_display_sequence=>10
,p_value_type=>'ITEM'
,p_value=>'P2_NEW_DUALITY_VIEW_NAME'
);
wwv_flow_imp_shared.create_invokeapi_comp_param(
 p_id=>wwv_flow_imp.id(21147224089070422)
,p_page_process_id=>wwv_flow_imp.id(21147020795070420)
,p_page_id=>2
,p_name=>'p_drop_related_tables'
,p_direction=>'IN'
,p_data_type=>'BOOLEAN'
,p_has_default=>true
,p_display_sequence=>20
,p_value_type=>'ITEM'
,p_value=>'P2_DROP_DEPENDENT_TABLES'
,p_format_mask=>'Y,N'
);
wwv_flow_imp_page.create_page_process(
 p_id=>wwv_flow_imp.id(21112276613883924)
,p_process_sequence=>30
,p_parent_process_id=>wwv_flow_imp.id(21112199727883923)
,p_process_type=>'NATIVE_INVOKE_API'
,p_process_name=>'Create Temp JSON Table'
,p_attribute_01=>'PLSQL_PACKAGE'
,p_attribute_03=>'JSON_DUALITY_COMPANION'
,p_attribute_04=>'CREATE_TEMP_JSON_COLLECTION_FOR'
,p_internal_uid=>9341357102710719
);
wwv_flow_imp_shared.create_invokeapi_comp_param(
 p_id=>wwv_flow_imp.id(21112463054883926)
,p_page_process_id=>wwv_flow_imp.id(21112276613883924)
,p_page_id=>2
,p_name=>'p_json_document'
,p_direction=>'IN'
,p_data_type=>'CLOB'
,p_has_default=>false
,p_display_sequence=>10
,p_value_type=>'ITEM'
,p_value=>'P2_EXAMPLE_JSON_DOCUMENT'
);
wwv_flow_imp_page.create_page_process(
 p_id=>wwv_flow_imp.id(21114043908883942)
,p_process_sequence=>40
,p_parent_process_id=>wwv_flow_imp.id(21112199727883923)
,p_process_type=>'NATIVE_INVOKE_API'
,p_process_name=>'Clear JSON Table Migration List'
,p_attribute_01=>'PLSQL_PACKAGE'
,p_attribute_03=>'JSON_DUALITY_COMPANION'
,p_attribute_04=>'CLEAR_JSON_TABLES_TO_MIGRATE'
,p_internal_uid=>9343124397710737
);
wwv_flow_imp_page.create_page_process(
 p_id=>wwv_flow_imp.id(21113683926883938)
,p_process_sequence=>50
,p_parent_process_id=>wwv_flow_imp.id(21112199727883923)
,p_process_type=>'NATIVE_INVOKE_API'
,p_process_name=>'Add Temp JSON Table to Migration List'
,p_attribute_01=>'PLSQL_PACKAGE'
,p_attribute_03=>'JSON_DUALITY_COMPANION'
,p_attribute_04=>'ADD_JSON_TABLE_TO_MIGRATE'
,p_internal_uid=>9342764415710733
);
wwv_flow_imp_shared.create_invokeapi_comp_param(
 p_id=>wwv_flow_imp.id(21113745038883939)
,p_page_process_id=>wwv_flow_imp.id(21113683926883938)
,p_page_id=>2
,p_direction=>'OUT'
,p_data_type=>'NUMBER'
,p_ignore_output=>true
,p_display_sequence=>10
);
wwv_flow_imp_shared.create_invokeapi_comp_param(
 p_id=>wwv_flow_imp.id(21113896482883940)
,p_page_process_id=>wwv_flow_imp.id(21113683926883938)
,p_page_id=>2
,p_name=>'p_json_table_name'
,p_direction=>'IN'
,p_data_type=>'VARCHAR2'
,p_has_default=>false
,p_display_sequence=>20
,p_value_type=>'EXPRESSION'
,p_value_language=>'PLSQL'
,p_value=>'json_duality_companion.c_json_temp_table'
);
wwv_flow_imp_shared.create_invokeapi_comp_param(
 p_id=>wwv_flow_imp.id(21114017581883941)
,p_page_process_id=>wwv_flow_imp.id(21113683926883938)
,p_page_id=>2
,p_name=>'p_dualv_name'
,p_direction=>'IN'
,p_data_type=>'VARCHAR2'
,p_has_default=>false
,p_display_sequence=>30
,p_value_type=>'ITEM'
,p_value=>'P2_NEW_DUALITY_VIEW_NAME'
);
wwv_flow_imp_page.create_page_process(
 p_id=>wwv_flow_imp.id(21112605539883927)
,p_process_sequence=>60
,p_parent_process_id=>wwv_flow_imp.id(21112199727883923)
,p_process_type=>'NATIVE_INVOKE_API'
,p_process_name=>'Get Migration Config'
,p_attribute_01=>'PLSQL_PACKAGE'
,p_attribute_03=>'JSON_DUALITY_COMPANION'
,p_attribute_04=>'JSON_DUALITY_MIGRATOR_CONFIG'
,p_internal_uid=>9341686028710722
);
wwv_flow_imp_shared.create_invokeapi_comp_param(
 p_id=>wwv_flow_imp.id(21112667502883928)
,p_page_process_id=>wwv_flow_imp.id(21112605539883927)
,p_page_id=>2
,p_direction=>'OUT'
,p_data_type=>'CLOB'
,p_ignore_output=>false
,p_display_sequence=>10
,p_value_type=>'ITEM'
,p_value=>'P2_CONFIG'
);
wwv_flow_imp_shared.create_invokeapi_comp_param(
 p_id=>wwv_flow_imp.id(21112803546883929)
,p_page_process_id=>wwv_flow_imp.id(21112605539883927)
,p_page_id=>2
,p_name=>'p_use_flex_fields'
,p_direction=>'IN'
,p_data_type=>'BOOLEAN'
,p_has_default=>true
,p_display_sequence=>20
,p_value_type=>'ITEM'
,p_value=>'P2_USE_FLEX_FIELDS'
,p_format_mask=>'Y,N'
);
wwv_flow_imp_shared.create_invokeapi_comp_param(
 p_id=>wwv_flow_imp.id(21112849862883930)
,p_page_process_id=>wwv_flow_imp.id(21112605539883927)
,p_page_id=>2
,p_name=>'p_output_format'
,p_direction=>'IN'
,p_data_type=>'VARCHAR2'
,p_has_default=>true
,p_display_sequence=>30
,p_value_type=>'API_DEFAULT'
);
wwv_flow_imp_shared.create_invokeapi_comp_param(
 p_id=>wwv_flow_imp.id(21112972611883931)
,p_page_process_id=>wwv_flow_imp.id(21112605539883927)
,p_page_id=>2
,p_name=>'p_updatable_duality_views'
,p_direction=>'IN'
,p_data_type=>'BOOLEAN'
,p_has_default=>true
,p_display_sequence=>40
,p_value_type=>'API_DEFAULT'
);
wwv_flow_imp_page.create_page_process(
 p_id=>wwv_flow_imp.id(21113183510883933)
,p_process_sequence=>70
,p_parent_process_id=>wwv_flow_imp.id(21112199727883923)
,p_process_type=>'NATIVE_INVOKE_API'
,p_process_name=>'Infer and Generate Schema'
,p_attribute_01=>'PLSQL_PACKAGE'
,p_attribute_03=>'DBMS_JSON_DUALITY'
,p_attribute_04=>'INFER_AND_GENERATE_SCHEMA'
,p_internal_uid=>9342263999710728
);
wwv_flow_imp_shared.create_invokeapi_comp_param(
 p_id=>wwv_flow_imp.id(21113316826883934)
,p_page_process_id=>wwv_flow_imp.id(21113183510883933)
,p_page_id=>2
,p_direction=>'OUT'
,p_data_type=>'CLOB'
,p_ignore_output=>false
,p_display_sequence=>10
,p_value_type=>'ITEM'
,p_value=>'P2_DDL'
);
wwv_flow_imp_shared.create_invokeapi_comp_param(
 p_id=>wwv_flow_imp.id(21113413293883935)
,p_page_process_id=>wwv_flow_imp.id(21113183510883933)
,p_page_id=>2
,p_name=>'config'
,p_direction=>'IN'
,p_data_type=>'JSON'
,p_has_default=>false
,p_display_sequence=>20
,p_value_type=>'EXPRESSION'
,p_value_language=>'PLSQL'
,p_value=>'JSON(:P2_CONFIG)'
);
wwv_flow_imp_page.create_page_process(
 p_id=>wwv_flow_imp.id(12918568580105906)
,p_process_sequence=>90
,p_parent_process_id=>wwv_flow_imp.id(21112199727883923)
,p_process_type=>'NATIVE_PLSQL'
,p_process_name=>'Trim CHR(0) from DDL'
,p_process_sql_clob=>':P2_DDL := rtrim(:P2_DDL,chr(0));'
,p_process_clob_language=>'PLSQL'
,p_internal_uid=>12918568580105906
);
wwv_flow_imp_page.create_page_process(
 p_id=>wwv_flow_imp.id(12918606264105907)
,p_process_sequence=>100
,p_parent_process_id=>wwv_flow_imp.id(21112199727883923)
,p_process_type=>'NATIVE_EXECUTION_CHAIN'
,p_process_name=>'If Dropping Dependent Tables...'
,p_attribute_01=>'N'
,p_process_when=>'P2_DROP_DEPENDENT_TABLES'
,p_process_when_type=>'VAL_OF_ITEM_IN_COND_EQ_COND2'
,p_process_when2=>'Y'
,p_internal_uid=>12918606264105907
);
wwv_flow_imp_page.create_page_process(
 p_id=>wwv_flow_imp.id(21113425749883936)
,p_process_sequence=>110
,p_parent_process_id=>wwv_flow_imp.id(21112199727883923)
,p_process_type=>'NATIVE_PLSQL'
,p_process_name=>'Create Generated Artifacts'
,p_process_sql_clob=>'execute immediate :P2_DDL;'
,p_process_clob_language=>'PLSQL'
,p_internal_uid=>9342506238710731
);
wwv_flow_imp_page.create_page_process(
 p_id=>wwv_flow_imp.id(21113568868883937)
,p_process_sequence=>120
,p_parent_process_id=>wwv_flow_imp.id(21112199727883923)
,p_process_type=>'NATIVE_INVOKE_API'
,p_process_name=>'Import Temp JSON Table Into New Duality View'
,p_attribute_01=>'PLSQL_PACKAGE'
,p_attribute_03=>'DBMS_JSON_DUALITY'
,p_attribute_04=>'IMPORT'
,p_process_success_message=>'New Duality View &P2_NEW_DUALITY_VIEW_NAME. created for JSON document'
,p_internal_uid=>9342649357710732
);
wwv_flow_imp_shared.create_invokeapi_comp_param(
 p_id=>wwv_flow_imp.id(21114134142883943)
,p_page_process_id=>wwv_flow_imp.id(21113568868883937)
,p_page_id=>2
,p_name=>'table_owner_name'
,p_direction=>'IN'
,p_data_type=>'VARCHAR2'
,p_has_default=>true
,p_display_sequence=>10
,p_value_type=>'API_DEFAULT'
);
wwv_flow_imp_shared.create_invokeapi_comp_param(
 p_id=>wwv_flow_imp.id(21114311652883944)
,p_page_process_id=>wwv_flow_imp.id(21113568868883937)
,p_page_id=>2
,p_name=>'table_name'
,p_direction=>'IN'
,p_data_type=>'VARCHAR2'
,p_has_default=>false
,p_display_sequence=>20
,p_value_type=>'EXPRESSION'
,p_value_language=>'PLSQL'
,p_value=>'json_duality_companion.c_json_temp_table'
);
wwv_flow_imp_shared.create_invokeapi_comp_param(
 p_id=>wwv_flow_imp.id(21114366044883945)
,p_page_process_id=>wwv_flow_imp.id(21113568868883937)
,p_page_id=>2
,p_name=>'view_owner_name'
,p_direction=>'IN'
,p_data_type=>'VARCHAR2'
,p_has_default=>true
,p_display_sequence=>30
,p_value_type=>'API_DEFAULT'
);
wwv_flow_imp_shared.create_invokeapi_comp_param(
 p_id=>wwv_flow_imp.id(21114461709883946)
,p_page_process_id=>wwv_flow_imp.id(21113568868883937)
,p_page_id=>2
,p_name=>'view_name'
,p_direction=>'IN'
,p_data_type=>'VARCHAR2'
,p_has_default=>false
,p_display_sequence=>40
,p_value_type=>'ITEM'
,p_value=>'P2_NEW_DUALITY_VIEW_NAME'
);
wwv_flow_imp_shared.create_invokeapi_comp_param(
 p_id=>wwv_flow_imp.id(21114575863883947)
,p_page_process_id=>wwv_flow_imp.id(21113568868883937)
,p_page_id=>2
,p_name=>'err_log_owner_name'
,p_direction=>'IN'
,p_data_type=>'VARCHAR2'
,p_has_default=>true
,p_display_sequence=>50
,p_value_type=>'API_DEFAULT'
);
wwv_flow_imp_shared.create_invokeapi_comp_param(
 p_id=>wwv_flow_imp.id(21114707356883948)
,p_page_process_id=>wwv_flow_imp.id(21113568868883937)
,p_page_id=>2
,p_name=>'err_log_name'
,p_direction=>'IN'
,p_data_type=>'VARCHAR2'
,p_has_default=>true
,p_display_sequence=>60
,p_value_type=>'API_DEFAULT'
);
wwv_flow_imp_shared.create_invokeapi_comp_param(
 p_id=>wwv_flow_imp.id(21114812387883949)
,p_page_process_id=>wwv_flow_imp.id(21113568868883937)
,p_page_id=>2
,p_name=>'reject_limit'
,p_direction=>'IN'
,p_data_type=>'NUMBER'
,p_has_default=>true
,p_display_sequence=>70
,p_value_type=>'API_DEFAULT'
);
wwv_flow_imp_page.create_page_process(
 p_id=>wwv_flow_imp.id(21146447152070414)
,p_process_sequence=>130
,p_parent_process_id=>wwv_flow_imp.id(21112199727883923)
,p_process_type=>'NATIVE_INVOKE_API'
,p_process_name=>'Drop Temp JSON Table'
,p_attribute_01=>'PLSQL_PACKAGE'
,p_attribute_03=>'JSON_DUALITY_COMPANION'
,p_attribute_04=>'DROP_TEMP_JSON_COLLECTION'
,p_internal_uid=>9375527640897209
);
wwv_flow_imp_page.create_page_process(
 p_id=>wwv_flow_imp.id(23015192853415241)
,p_process_sequence=>140
,p_parent_process_id=>wwv_flow_imp.id(21112199727883923)
,p_process_type=>'NATIVE_INVOKE_API'
,p_process_name=>'Clear JSON Table Migration List Again'
,p_attribute_01=>'PLSQL_PACKAGE'
,p_attribute_03=>'JSON_DUALITY_COMPANION'
,p_attribute_04=>'CLEAR_JSON_TABLES_TO_MIGRATE'
,p_internal_uid=>11244273342242036
);
end;
/
prompt --application/pages/page_00003
begin
wwv_flow_imp_page.create_page(
 p_id=>3
,p_name=>'Browse/Edit JSON'
,p_alias=>'BROWSE-EDIT-JSON'
,p_step_title=>'Browse/Edit JSON'
,p_autocomplete_on_off=>'OFF'
,p_javascript_code_onload=>wwv_flow_string.join(wwv_flow_t_varchar2(
'apex.page.warnOnUnsavedChanges( "", () => {',
'',
'    const oldDoc = $v(''P3_JSON_DOCUMENT_OLD'').replace(/\r\n/g, ''\n'');',
'    const newDoc = monaco.editor.getModels()[0].getValue().replace(/\r\n/g, ''\n'');',
'',
'    // Compare the normalized strings',
'    return oldDoc !== newDoc;',
'} );'))
,p_page_template_options=>'#DEFAULT#:t-DeferredRendering'
,p_protection_level=>'C'
,p_page_component_map=>'16'
);
wwv_flow_imp_page.create_page_plug(
 p_id=>wwv_flow_imp.id(12144905010473501)
,p_plug_name=>'No JSON Relational Duality Views or JSON Collection Tables to Browse Yet'
,p_region_template_options=>'#DEFAULT#:t-Alert--horizontal:t-Alert--defaultIcons:t-Alert--info'
,p_plug_template=>2040683448887306517
,p_plug_display_sequence=>180
,p_location=>null
,p_plug_source_type=>'PLUGIN_MARKDOWN'
,p_plug_display_condition_type=>'ITEM_IS_NULL'
,p_plug_display_when_condition=>'P3_DUALV_NAME_ORIG'
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'file_name', 'nothing_to_browse.md',
  'source', 'APPLICATION_STATIC_FILE')).to_clob
);
wwv_flow_imp_page.create_page_plug(
 p_id=>wwv_flow_imp.id(21911585507072413)
,p_plug_name=>'Browse/Edit JSON'
,p_title=>'Browse/Edit JSON Duality View and Collection Table Documents'
,p_icon_css_classes=>'fa-server-edit'
,p_region_template_options=>'#DEFAULT#'
,p_plug_template=>2674017834225413037
,p_plug_display_sequence=>30
,p_plug_display_point=>'REGION_POSITION_01'
,p_location=>null
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'expand_shortcuts', 'N',
  'output_as', 'HTML')).to_clob
);
wwv_flow_imp_page.create_page_plug(
 p_id=>wwv_flow_imp.id(21911941357072417)
,p_plug_name=>'JSON Document Form'
,p_region_template_options=>'#DEFAULT#'
,p_plug_template=>4501440665235496320
,p_plug_display_sequence=>70
,p_query_type=>'FUNC_BODY_RETURNING_SQL'
,p_function_body_language=>'PLSQL'
,p_plug_source=>wwv_flow_string.join(wwv_flow_t_varchar2(
'return case',
'        when :P3_DUALV_NAME is not null then',
'            apex_string.format(q''~',
'            select resid,',
'                   etag,',
'                   json_serialize(data returning clob pretty %s) as json_document',
'            from %s',
'            order by resid',
'            ~'',',
'            case when nvl(:P3_USE_EJSON,''N'')=''Y'' then ''extended'' end,',
'            :P3_DUALV_NAME)',
'        else',
'            -- Make the APEX Builder query parser happy when :P3_DUALV_NAME is null',
'            q''~',
'            select cast(null as varchar2(255)) as resid, ',
'                   cast(null as varchar2(255)) as etag, ',
'                   to_clob(null)               as json_document',
'              from dual',
'            ~''',
'       end;'))
,p_is_editable=>true
,p_edit_operations=>'i:u:d'
,p_lost_update_check_type=>'VALUES'
,p_plug_source_type=>'NATIVE_FORM'
,p_ajax_items_to_submit=>'P3_USE_EJSON,P3_DUALV_NAME'
,p_plug_display_condition_type=>'ITEM_IS_NOT_NULL'
,p_plug_display_when_condition=>'P3_DUALV_NAME_ORIG'
);
wwv_flow_imp_page.create_page_plug(
 p_id=>wwv_flow_imp.id(21912317539072420)
,p_plug_name=>'JSON Editor'
,p_region_css_classes=>'margin-top-md'
,p_region_template_options=>'#DEFAULT#'
,p_plug_template=>3371237801798025892
,p_plug_display_sequence=>80
,p_location=>null
,p_plug_source=>wwv_flow_string.join(wwv_flow_t_varchar2(
'select :P3_JSON_DOCUMENT as value_edit,',
'       null              as value_diff,',
'       ''json''            as language'))
,p_plug_source_type=>'PLUGIN_RW.APEX.VS.MONACO.EDITOR'
,p_ajax_items_to_submit=>'P3_JSON_DOCUMENT'
,p_plug_display_condition_type=>'ITEM_IS_NOT_NULL'
,p_plug_display_when_condition=>'P3_DUALV_NAME_ORIG'
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'attribute_01', 'calc(100vh - 30rem)',
  'attribute_02', 'begin null; end;',
  'attribute_03', 'json',
  'attribute_04', 'vs',
  'attribute_05', 'search')).to_clob
);
wwv_flow_imp_page.create_page_plug(
 p_id=>wwv_flow_imp.id(22939158357832626)
,p_plug_name=>'Buttons'
,p_region_template_options=>'#DEFAULT#:t-ButtonRegion--noUI'
,p_plug_template=>2126429139436695430
,p_plug_display_sequence=>50
,p_location=>null
,p_plug_display_condition_type=>'ITEM_IS_NOT_NULL'
,p_plug_display_when_condition=>'P3_DUALV_NAME_ORIG'
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'expand_shortcuts', 'N',
  'output_as', 'HTML')).to_clob
);
wwv_flow_imp_page.create_page_plug(
 p_id=>wwv_flow_imp.id(15057226753116122)
,p_plug_name=>'Extended Indicator'
,p_parent_plug_id=>wwv_flow_imp.id(22939158357832626)
,p_plug_display_sequence=>10
,p_plug_grid_column_css_classes=>'u-align-self-center'
,p_plug_display_point=>'SUB_REGIONS'
,p_location=>null
,p_plug_source=>'<em>Extended JSON</em>:'
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'expand_shortcuts', 'N',
  'output_as', 'HTML')).to_clob
);
wwv_flow_imp_page.create_page_plug(
 p_id=>wwv_flow_imp.id(15057399286116123)
,p_plug_name=>'Extended JSON Toggle'
,p_parent_plug_id=>wwv_flow_imp.id(22939158357832626)
,p_plug_display_sequence=>20
,p_plug_new_grid_row=>false
,p_plug_display_point=>'SUB_REGIONS'
,p_location=>null
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'expand_shortcuts', 'N',
  'output_as', 'HTML')).to_clob
);
wwv_flow_imp_page.create_page_button(
 p_id=>wwv_flow_imp.id(15056707072116117)
,p_button_sequence=>10
,p_button_plug_id=>wwv_flow_imp.id(15057399286116123)
,p_button_name=>'USE_EXTENDED_JSON'
,p_button_action=>'SUBMIT'
,p_button_template_options=>'#DEFAULT#:t-Button--iconLeft'
,p_button_template_id=>2082829544945815391
,p_button_image_alt=>'OFF'
,p_button_condition=>'P3_USE_EJSON'
,p_button_condition2=>'N'
,p_button_condition_type=>'VAL_OF_ITEM_IN_COND_EQ_COND2'
,p_icon_css_classes=>'fa-align-left'
,p_grid_new_row=>'Y'
);
wwv_flow_imp_page.create_page_button(
 p_id=>wwv_flow_imp.id(15056833268116118)
,p_button_sequence=>10
,p_button_plug_id=>wwv_flow_imp.id(15057399286116123)
,p_button_name=>'USE_STANDARD_JSON'
,p_button_action=>'SUBMIT'
,p_button_template_options=>'#DEFAULT#:t-Button--iconLeft'
,p_button_template_id=>2082829544945815391
,p_button_image_alt=>'ON'
,p_button_condition=>'P3_USE_EJSON'
,p_button_condition2=>'Y'
,p_button_condition_type=>'VAL_OF_ITEM_IN_COND_EQ_COND2'
,p_icon_css_classes=>'fa-ai-sparkle-generate-text'
,p_grid_new_row=>'Y'
);
wwv_flow_imp_page.create_page_button(
 p_id=>wwv_flow_imp.id(22534660310379307)
,p_button_sequence=>30
,p_button_plug_id=>wwv_flow_imp.id(22939158357832626)
,p_button_name=>'SAVE_DOCUMENT'
,p_button_action=>'DEFINED_BY_DA'
,p_button_template_options=>'#DEFAULT#:t-Button--iconLeft'
,p_button_template_id=>2082829544945815391
,p_button_image_alt=>'Save'
,p_button_position=>'NEXT'
,p_warn_on_unsaved_changes=>null
,p_button_condition=>'P3_RESID'
,p_button_condition_type=>'ITEM_IS_NOT_NULL'
,p_icon_css_classes=>'fa-save'
);
wwv_flow_imp_page.create_page_button(
 p_id=>wwv_flow_imp.id(22539150153379352)
,p_button_sequence=>50
,p_button_plug_id=>wwv_flow_imp.id(22939158357832626)
,p_button_name=>'DELETE_DOCUMENT'
,p_button_action=>'SUBMIT'
,p_button_template_options=>'#DEFAULT#:t-Button--iconLeft'
,p_button_template_id=>2082829544945815391
,p_button_image_alt=>'Delete'
,p_button_position=>'NEXT'
,p_button_condition=>'P3_RESID'
,p_button_condition_type=>'ITEM_IS_NOT_NULL'
,p_icon_css_classes=>'fa-remove'
);
wwv_flow_imp_page.create_page_button(
 p_id=>wwv_flow_imp.id(22535195086379312)
,p_button_sequence=>60
,p_button_plug_id=>wwv_flow_imp.id(22939158357832626)
,p_button_name=>'CREATE_DOCUMENT'
,p_button_action=>'DEFINED_BY_DA'
,p_button_template_options=>'#DEFAULT#:t-Button--iconLeft'
,p_button_template_id=>2082829544945815391
,p_button_image_alt=>'Add New'
,p_button_position=>'NEXT'
,p_warn_on_unsaved_changes=>null
,p_button_condition=>'P3_RESID'
,p_button_condition_type=>'ITEM_IS_NOT_NULL'
,p_icon_css_classes=>'fa-server-new'
);
wwv_flow_imp_page.create_page_button(
 p_id=>wwv_flow_imp.id(22939240070832627)
,p_button_sequence=>80
,p_button_plug_id=>wwv_flow_imp.id(22939158357832626)
,p_button_name=>'DUPLICATE_DOCUMENT'
,p_button_action=>'DEFINED_BY_DA'
,p_button_template_options=>'#DEFAULT#:t-Button--iconLeft'
,p_button_template_id=>2082829544945815391
,p_button_image_alt=>'Duplicate'
,p_button_position=>'NEXT'
,p_warn_on_unsaved_changes=>null
,p_button_condition=>'P3_RESID'
,p_button_condition_type=>'ITEM_IS_NOT_NULL'
,p_icon_css_classes=>'fa-copy'
);
wwv_flow_imp_page.create_page_button(
 p_id=>wwv_flow_imp.id(23015600550415245)
,p_button_sequence=>90
,p_button_plug_id=>wwv_flow_imp.id(22939158357832626)
,p_button_name=>'REREAD_DOCUMENT'
,p_button_action=>'REDIRECT_PAGE'
,p_button_template_options=>'#DEFAULT#:t-Button--iconLeft'
,p_button_template_id=>2082829544945815391
,p_button_image_alt=>'Reread'
,p_button_position=>'NEXT'
,p_button_redirect_url=>'f?p=&APP_ID.:3:&SESSION.::&DEBUG.::P3_RESID:&P3_RESID.'
,p_icon_css_classes=>'fa-refresh'
);
wwv_flow_imp_page.create_page_button(
 p_id=>wwv_flow_imp.id(22535846683379319)
,p_button_sequence=>100
,p_button_plug_id=>wwv_flow_imp.id(22939158357832626)
,p_button_name=>'ADD_DOCUMENT'
,p_button_action=>'DEFINED_BY_DA'
,p_button_template_options=>'#DEFAULT#:t-Button--iconLeft'
,p_button_template_id=>2082829544945815391
,p_button_image_alt=>'Save New'
,p_button_position=>'NEXT'
,p_warn_on_unsaved_changes=>null
,p_button_condition=>'P3_RESID'
,p_button_condition_type=>'ITEM_IS_NULL'
,p_icon_css_classes=>'fa-save'
);
wwv_flow_imp_page.create_page_button(
 p_id=>wwv_flow_imp.id(22539333582379354)
,p_button_sequence=>110
,p_button_plug_id=>wwv_flow_imp.id(22939158357832626)
,p_button_name=>'CANCEL_ADD_DOCUMENT'
,p_button_action=>'REDIRECT_PAGE'
,p_button_template_options=>'#DEFAULT#:t-Button--iconLeft'
,p_button_template_id=>2082829544945815391
,p_button_image_alt=>'Cancel'
,p_button_position=>'NEXT'
,p_button_redirect_url=>'f?p=&APP_ID.:3:&SESSION.::&DEBUG.::P3_RESID:&P3_RESID_FOR_CANCEL.'
,p_button_condition=>':P3_RESID is null and :P3_RESID_FOR_CANCEL is not null'
,p_button_condition2=>'PLSQL'
,p_button_condition_type=>'EXPRESSION'
,p_icon_css_classes=>'fa-remove'
);
wwv_flow_imp_page.create_page_button(
 p_id=>wwv_flow_imp.id(21912618757072423)
,p_button_sequence=>10
,p_button_plug_id=>wwv_flow_imp.id(22939158357832626)
,p_button_name=>'PREVIOUS_DOCUMENT'
,p_button_action=>'DEFINED_BY_DA'
,p_button_template_options=>'#DEFAULT#:t-Button--iconLeft'
,p_button_template_id=>2082829544945815391
,p_button_image_alt=>'Previous'
,p_button_position=>'PREVIOUS'
,p_warn_on_unsaved_changes=>null
,p_icon_css_classes=>'fa-chevron-left'
);
wwv_flow_imp_page.create_page_button(
 p_id=>wwv_flow_imp.id(21912424629072422)
,p_button_sequence=>40
,p_button_plug_id=>wwv_flow_imp.id(22939158357832626)
,p_button_name=>'NEXT_DOCUMENT'
,p_button_action=>'DEFINED_BY_DA'
,p_button_template_options=>'#DEFAULT#:t-Button--iconLeft'
,p_button_template_id=>2082829544945815391
,p_button_image_alt=>'Next'
,p_button_position=>'PREVIOUS'
,p_warn_on_unsaved_changes=>null
,p_icon_css_classes=>'fa-chevron-right'
);
wwv_flow_imp_page.create_page_branch(
 p_id=>wwv_flow_imp.id(21914055637072438)
,p_branch_name=>'Next Document'
,p_branch_action=>'f?p=&APP_ID.:3:&SESSION.::&DEBUG.::P3_RESID,P3_DUALV_NAME:&P3_NEXT_PRIMARY_KEY.,&P3_DUALV_NAME_ORIG.&success_msg=#SUCCESS_MSG#'
,p_branch_point=>'AFTER_PROCESSING'
,p_branch_type=>'REDIRECT_URL'
,p_branch_when_button_id=>wwv_flow_imp.id(21912424629072422)
,p_branch_sequence=>10
);
wwv_flow_imp_page.create_page_branch(
 p_id=>wwv_flow_imp.id(21914254826072440)
,p_branch_name=>'Previous Document'
,p_branch_action=>'f?p=&APP_ID.:3:&SESSION.::&DEBUG.::P3_RESID,P3_DUALV_NAME:&P3_PREVIOUS_PRIMARY_KEY.,&P3_DUALV_NAME_ORIG.&success_msg=#SUCCESS_MSG#'
,p_branch_point=>'AFTER_PROCESSING'
,p_branch_type=>'REDIRECT_URL'
,p_branch_when_button_id=>wwv_flow_imp.id(21912618757072423)
,p_branch_sequence=>20
);
wwv_flow_imp_page.create_page_branch(
 p_id=>wwv_flow_imp.id(22535754521379318)
,p_branch_name=>'Create Document'
,p_branch_action=>'f?p=&APP_ID.:3:&SESSION.::&DEBUG.::P3_CREATE_DOCUMENT,P3_RESID_FOR_CANCEL,P3_DUALV_NAME:Y,&P3_RESID.,&P3_DUALV_NAME_ORIG.&success_msg=#SUCCESS_MSG#'
,p_branch_point=>'AFTER_PROCESSING'
,p_branch_type=>'REDIRECT_URL'
,p_branch_when_button_id=>wwv_flow_imp.id(22535195086379312)
,p_branch_sequence=>30
);
wwv_flow_imp_page.create_page_branch(
 p_id=>wwv_flow_imp.id(22939879562832633)
,p_branch_name=>'Duplicate Document'
,p_branch_action=>'f?p=&APP_ID.:3:&SESSION.::&DEBUG.::P3_CREATE_DOCUMENT,P3_RESID_FOR_CANCEL,P3_DUPLICATE,P3_DUALV_NAME:Y,&P3_RESID.,Y,&P3_DUALV_NAME_ORIG.&success_msg=#SUCCESS_MSG#'
,p_branch_point=>'AFTER_PROCESSING'
,p_branch_type=>'REDIRECT_URL'
,p_branch_when_button_id=>wwv_flow_imp.id(22939240070832627)
,p_branch_sequence=>40
);
wwv_flow_imp_page.create_page_branch(
 p_id=>wwv_flow_imp.id(22539513795379355)
,p_branch_name=>'Stay on Same Doc for Save and Add'
,p_branch_action=>'f?p=&APP_ID.:3:&SESSION.::&DEBUG.::P3_RESID,P3_DUALV_NAME:&P3_RESID.,&P3_DUALV_NAME_ORIG.&success_msg=#SUCCESS_MSG#'
,p_branch_point=>'AFTER_PROCESSING'
,p_branch_type=>'REDIRECT_URL'
,p_branch_sequence=>50
,p_branch_condition_type=>'REQUEST_IN_CONDITION'
,p_branch_condition=>'|ADD_DOCUMENT|SAVE_DOCUMENT|'
);
wwv_flow_imp_page.create_page_item(
 p_id=>wwv_flow_imp.id(11245178307242045)
,p_name=>'P3_DUALV_NAME_ORIG'
,p_item_sequence=>170
,p_display_as=>'NATIVE_HIDDEN'
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'value_protected', 'Y')).to_clob
);
wwv_flow_imp_page.create_page_item(
 p_id=>wwv_flow_imp.id(15056950766116119)
,p_name=>'P3_USE_EJSON'
,p_item_sequence=>200
,p_item_default=>'N'
,p_display_as=>'NATIVE_HIDDEN'
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'value_protected', 'Y')).to_clob
);
wwv_flow_imp_page.create_page_item(
 p_id=>wwv_flow_imp.id(21911745250072415)
,p_name=>'P3_DUALV_NAME'
,p_item_sequence=>10
,p_prompt=>'Collection Table or Duality View Name'
,p_display_as=>'NATIVE_SELECT_ONE'
,p_named_lov=>'LOV_JSON_COLLECTIONS'
,p_lov=>wwv_flow_string.join(wwv_flow_t_varchar2(
'select collection_name, collection_name as collection_name2, case collection_type when ''DUALITY VIEW'' then ''fa-eye'' when ''TABLE'' then ''fa-table'' end collection_type_icon',
'from user_json_collections',
'order by collection_name'))
,p_cSize=>30
,p_display_when=>'P3_DUALV_NAME_ORIG'
,p_display_when_type=>'ITEM_IS_NOT_NULL'
,p_field_template=>1609121967514267634
,p_item_template_options=>'#DEFAULT#'
,p_warn_on_unsaved_changes=>'I'
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'case_sensitive', 'N',
  'fetch_on_search', 'N',
  'match_type', 'CONTAINS',
  'min_chars', '0')).to_clob
);
wwv_flow_imp_page.create_page_item(
 p_id=>wwv_flow_imp.id(21912136611072419)
,p_name=>'P3_JSON_DOCUMENT'
,p_data_type=>'CLOB'
,p_source_data_type=>'CLOB'
,p_item_sequence=>20
,p_item_plug_id=>wwv_flow_imp.id(21911941357072417)
,p_item_source_plug_id=>wwv_flow_imp.id(21911941357072417)
,p_source=>'JSON_DOCUMENT'
,p_source_type=>'REGION_SOURCE_COLUMN'
,p_display_as=>'NATIVE_HIDDEN'
,p_is_persistent=>'N'
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'value_protected', 'N')).to_clob
);
wwv_flow_imp_page.create_page_item(
 p_id=>wwv_flow_imp.id(21912638889072424)
,p_name=>'P3_NEXT_PRIMARY_KEY'
,p_item_sequence=>90
,p_display_as=>'NATIVE_HIDDEN'
,p_is_persistent=>'N'
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'value_protected', 'Y')).to_clob
);
wwv_flow_imp_page.create_page_item(
 p_id=>wwv_flow_imp.id(21912724337072425)
,p_name=>'P3_PREVIOUS_PRIMARY_KEY'
,p_item_sequence=>100
,p_display_as=>'NATIVE_HIDDEN'
,p_is_persistent=>'N'
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'value_protected', 'Y')).to_clob
);
wwv_flow_imp_page.create_page_item(
 p_id=>wwv_flow_imp.id(21912916231072426)
,p_name=>'P3_PAGINATION_DISPLAY'
,p_item_sequence=>110
,p_display_as=>'NATIVE_HIDDEN'
,p_is_persistent=>'N'
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'value_protected', 'Y')).to_clob
);
wwv_flow_imp_page.create_page_item(
 p_id=>wwv_flow_imp.id(21913291714072430)
,p_name=>'P3_URL_TO_THIS_PAGE'
,p_item_sequence=>120
,p_display_as=>'NATIVE_HIDDEN'
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'value_protected', 'N')).to_clob
);
wwv_flow_imp_page.create_page_item(
 p_id=>wwv_flow_imp.id(21913787191072435)
,p_name=>'P3_JSON_DOCUMENT_OLD'
,p_item_sequence=>130
,p_display_as=>'NATIVE_HIDDEN'
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'value_protected', 'Y')).to_clob
);
wwv_flow_imp_page.create_page_item(
 p_id=>wwv_flow_imp.id(21913977552072437)
,p_name=>'P3_ETAG'
,p_source_data_type=>'VARCHAR2'
,p_is_query_only=>true
,p_item_sequence=>40
,p_item_source_plug_id=>wwv_flow_imp.id(21911941357072417)
,p_source=>'ETAG'
,p_source_type=>'REGION_SOURCE_COLUMN'
,p_display_as=>'NATIVE_HIDDEN'
,p_is_persistent=>'N'
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'value_protected', 'Y')).to_clob
);
wwv_flow_imp_page.create_page_item(
 p_id=>wwv_flow_imp.id(22536531916379326)
,p_name=>'P3_CREATE_DOCUMENT'
,p_item_sequence=>140
,p_display_as=>'NATIVE_HIDDEN'
,p_is_persistent=>'N'
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'value_protected', 'Y')).to_clob
);
wwv_flow_imp_page.create_page_item(
 p_id=>wwv_flow_imp.id(22536745475379328)
,p_name=>'P3_RESID'
,p_source_data_type=>'VARCHAR2'
,p_is_primary_key=>true
,p_item_sequence=>30
,p_item_source_plug_id=>wwv_flow_imp.id(21911941357072417)
,p_prompt=>'Current Document RESID'
,p_source=>'RESID'
,p_source_type=>'REGION_SOURCE_COLUMN'
,p_display_as=>'NATIVE_DISPLAY_ONLY'
,p_begin_on_new_line=>'N'
,p_display_when=>'P3_DUALV_NAME_ORIG'
,p_display_when_type=>'ITEM_IS_NOT_NULL'
,p_field_template=>1609121967514267634
,p_item_template_options=>'#DEFAULT#'
,p_is_persistent=>'N'
,p_protection_level=>'S'
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'based_on', 'VALUE',
  'format', 'PLAIN',
  'send_on_page_submit', 'Y',
  'show_line_breaks', 'Y')).to_clob
);
wwv_flow_imp_page.create_page_item(
 p_id=>wwv_flow_imp.id(22539258406379353)
,p_name=>'P3_RESID_FOR_CANCEL'
,p_item_sequence=>150
,p_display_as=>'NATIVE_HIDDEN'
,p_is_persistent=>'N'
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'value_protected', 'Y')).to_clob
);
wwv_flow_imp_page.create_page_item(
 p_id=>wwv_flow_imp.id(22939951887832634)
,p_name=>'P3_DUPLICATE'
,p_item_sequence=>160
,p_display_as=>'NATIVE_HIDDEN'
,p_is_persistent=>'N'
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'value_protected', 'Y')).to_clob
);
wwv_flow_imp_page.create_page_computation(
 p_id=>wwv_flow_imp.id(21913838166072436)
,p_computation_sequence=>10
,p_computation_item=>'P3_JSON_DOCUMENT_OLD'
,p_computation_point=>'AFTER_HEADER'
,p_computation_type=>'ITEM_VALUE'
,p_computation=>'P3_JSON_DOCUMENT'
);
wwv_flow_imp_page.create_page_computation(
 p_id=>wwv_flow_imp.id(21911848824072416)
,p_computation_sequence=>10
,p_computation_item=>'P3_DUALV_NAME'
,p_computation_point=>'BEFORE_HEADER'
,p_computation_type=>'QUERY'
,p_computation=>wwv_flow_string.join(wwv_flow_t_varchar2(
'select max(collection_name)',
'  from user_json_collections',
'where collection_name = :P3_DUALV_NAME'))
,p_computation_comment=>'Null out the P3_DUALV_NAME if it''s current value it no longer a valid duality view or JSON collection'
);
wwv_flow_imp_page.create_page_computation(
 p_id=>wwv_flow_imp.id(23015719179415246)
,p_computation_sequence=>20
,p_computation_item=>'P3_DUALV_NAME'
,p_computation_point=>'BEFORE_HEADER'
,p_computation_type=>'QUERY'
,p_computation=>wwv_flow_string.join(wwv_flow_t_varchar2(
'select collection_name',
'from user_json_collections',
'order by case when collection_name = :P2_DUALV_NAME then 0 else 1 end, collection_name',
'fetch first row only'))
,p_compute_when=>'P3_DUALV_NAME'
,p_compute_when_type=>'ITEM_IS_NULL'
);
wwv_flow_imp_page.create_page_computation(
 p_id=>wwv_flow_imp.id(22536840297379329)
,p_computation_sequence=>30
,p_computation_item=>'P3_RESID'
,p_computation_point=>'BEFORE_HEADER'
,p_computation_type=>'FUNCTION_BODY'
,p_computation_language=>'PLSQL'
,p_computation=>wwv_flow_string.join(wwv_flow_t_varchar2(
'declare',
'    l_first_resid varchar2(255);',
'begin',
'    execute immediate apex_string.format(''select resid from %s order by resid fetch first row only'', :P3_DUALV_NAME)',
'    into l_first_resid;',
'    return l_first_resid;',
'exception',
'    when no_data_found then',
'        return null;',
'end;'))
,p_compute_when=>wwv_flow_string.join(wwv_flow_t_varchar2(
':P3_DUALV_NAME is not null and',
':P3_RESID      is     null and',
'nvl(:P3_CREATE_DOCUMENT,''N'')=''N'''))
,p_compute_when_text=>'PLSQL'
,p_compute_when_type=>'EXPRESSION'
);
wwv_flow_imp_page.create_page_computation(
 p_id=>wwv_flow_imp.id(11245295676242046)
,p_computation_sequence=>40
,p_computation_item=>'P3_DUALV_NAME_ORIG'
,p_computation_point=>'BEFORE_HEADER'
,p_computation_type=>'ITEM_VALUE'
,p_computation=>'P3_DUALV_NAME'
);
wwv_flow_imp_page.create_page_validation(
 p_id=>wwv_flow_imp.id(23017538357432924)
,p_validation_name=>'Ensure Some JSON is Provided'
,p_validation_sequence=>10
,p_validation=>'P3_JSON_DOCUMENT'
,p_validation_type=>'ITEM_NOT_NULL'
,p_error_message=>'JSON cannot be empty. Delete a document using the appropriate button.'
,p_associated_item=>wwv_flow_imp.id(21911745250072415)
,p_error_display_location=>'INLINE_WITH_FIELD_AND_NOTIFICATION'
);
wwv_flow_imp_page.create_page_validation(
 p_id=>wwv_flow_imp.id(23017064426420385)
,p_validation_name=>'Ensure JSON is Valid'
,p_validation_sequence=>20
,p_validation=>'json_duality_companion.is_valid_json(:P3_JSON_DOCUMENT)'
,p_validation2=>'PLSQL'
,p_validation_type=>'EXPRESSION'
,p_error_message=>'Syntax error in JSON document'
,p_associated_item=>wwv_flow_imp.id(21911745250072415)
,p_error_display_location=>'INLINE_WITH_FIELD_AND_NOTIFICATION'
);
wwv_flow_imp_page.create_page_da_event(
 p_id=>wwv_flow_imp.id(21913086506072428)
,p_name=>'When DualV Name Changed'
,p_event_sequence=>10
,p_triggering_element_type=>'ITEM'
,p_triggering_element=>'P3_DUALV_NAME'
,p_bind_type=>'bind'
,p_execution_type=>'IMMEDIATE'
,p_bind_event_type=>'change'
);
wwv_flow_imp_page.create_page_da_action(
 p_id=>wwv_flow_imp.id(21913424526072432)
,p_event_id=>wwv_flow_imp.id(21913086506072428)
,p_event_result=>'TRUE'
,p_action_sequence=>10
,p_execute_on_page_init=>'N'
,p_action=>'NATIVE_EXECUTE_PLSQL_CODE'
,p_attribute_01=>wwv_flow_string.join(wwv_flow_t_varchar2(
':P3_URL_TO_THIS_PAGE := apex_page.get_url(',
'                            p_page => :APP_PAGE_ID,',
'                            p_items => ''P3_DUALV_NAME'',',
'                            p_values => :P3_DUALV_NAME);'))
,p_attribute_02=>'P3_DUALV_NAME'
,p_attribute_03=>'P3_URL_TO_THIS_PAGE'
,p_attribute_04=>'N'
,p_attribute_05=>'PLSQL'
,p_wait_for_result=>'Y'
);
wwv_flow_imp_page.create_page_da_action(
 p_id=>wwv_flow_imp.id(21913187904072429)
,p_event_id=>wwv_flow_imp.id(21913086506072428)
,p_event_result=>'TRUE'
,p_action_sequence=>20
,p_execute_on_page_init=>'N'
,p_action=>'NATIVE_JAVASCRIPT_CODE'
,p_attribute_01=>'apex.navigation.redirect(apex.items.P3_URL_TO_THIS_PAGE.value);'
);
wwv_flow_imp_page.create_page_da_event(
 p_id=>wwv_flow_imp.id(21914369309072441)
,p_name=>'When Click Previous Document'
,p_event_sequence=>20
,p_triggering_element_type=>'BUTTON'
,p_triggering_button_id=>wwv_flow_imp.id(21912618757072423)
,p_bind_type=>'bind'
,p_execution_type=>'IMMEDIATE'
,p_bind_event_type=>'click'
);
wwv_flow_imp_page.create_page_da_action(
 p_id=>wwv_flow_imp.id(21914485602072442)
,p_event_id=>wwv_flow_imp.id(21914369309072441)
,p_event_result=>'TRUE'
,p_action_sequence=>10
,p_execute_on_page_init=>'N'
,p_action=>'NATIVE_JAVASCRIPT_CODE'
,p_attribute_01=>'$s(''P3_JSON_DOCUMENT'',monaco.editor.getModels()[0].getValue());'
);
wwv_flow_imp_page.create_page_da_action(
 p_id=>wwv_flow_imp.id(21914598521072443)
,p_event_id=>wwv_flow_imp.id(21914369309072441)
,p_event_result=>'TRUE'
,p_action_sequence=>30
,p_execute_on_page_init=>'N'
,p_action=>'NATIVE_SUBMIT_PAGE'
,p_attribute_01=>'PREVIOUS_DOCUMENT'
,p_attribute_02=>'N'
);
wwv_flow_imp_page.create_page_da_event(
 p_id=>wwv_flow_imp.id(21914777864072445)
,p_name=>'When Click Next Document'
,p_event_sequence=>30
,p_triggering_element_type=>'BUTTON'
,p_triggering_button_id=>wwv_flow_imp.id(21912424629072422)
,p_bind_type=>'bind'
,p_execution_type=>'IMMEDIATE'
,p_bind_event_type=>'click'
);
wwv_flow_imp_page.create_page_da_action(
 p_id=>wwv_flow_imp.id(21914672529072444)
,p_event_id=>wwv_flow_imp.id(21914777864072445)
,p_event_result=>'TRUE'
,p_action_sequence=>10
,p_execute_on_page_init=>'N'
,p_action=>'NATIVE_JAVASCRIPT_CODE'
,p_attribute_01=>'$s(''P3_JSON_DOCUMENT'',monaco.editor.getModels()[0].getValue());'
);
wwv_flow_imp_page.create_page_da_action(
 p_id=>wwv_flow_imp.id(21914853893072446)
,p_event_id=>wwv_flow_imp.id(21914777864072445)
,p_event_result=>'TRUE'
,p_action_sequence=>30
,p_execute_on_page_init=>'N'
,p_action=>'NATIVE_SUBMIT_PAGE'
,p_attribute_01=>'NEXT_DOCUMENT'
,p_attribute_02=>'N'
);
wwv_flow_imp_page.create_page_da_event(
 p_id=>wwv_flow_imp.id(22534769304379308)
,p_name=>'When Click Save'
,p_event_sequence=>40
,p_triggering_element_type=>'BUTTON'
,p_triggering_button_id=>wwv_flow_imp.id(22534660310379307)
,p_bind_type=>'bind'
,p_execution_type=>'IMMEDIATE'
,p_bind_event_type=>'click'
);
wwv_flow_imp_page.create_page_da_action(
 p_id=>wwv_flow_imp.id(22534942856379310)
,p_event_id=>wwv_flow_imp.id(22534769304379308)
,p_event_result=>'TRUE'
,p_action_sequence=>10
,p_execute_on_page_init=>'N'
,p_action=>'NATIVE_JAVASCRIPT_CODE'
,p_attribute_01=>'$s(''P3_JSON_DOCUMENT'',monaco.editor.getModels()[0].getValue());'
);
wwv_flow_imp_page.create_page_da_action(
 p_id=>wwv_flow_imp.id(22535107244379311)
,p_event_id=>wwv_flow_imp.id(22534769304379308)
,p_event_result=>'TRUE'
,p_action_sequence=>30
,p_execute_on_page_init=>'N'
,p_action=>'NATIVE_SUBMIT_PAGE'
,p_attribute_01=>'SAVE_DOCUMENT'
,p_attribute_02=>'N'
);
wwv_flow_imp_page.create_page_da_event(
 p_id=>wwv_flow_imp.id(22535354577379314)
,p_name=>'When Click Create'
,p_event_sequence=>50
,p_triggering_element_type=>'BUTTON'
,p_triggering_button_id=>wwv_flow_imp.id(22535195086379312)
,p_bind_type=>'bind'
,p_execution_type=>'IMMEDIATE'
,p_bind_event_type=>'click'
);
wwv_flow_imp_page.create_page_da_action(
 p_id=>wwv_flow_imp.id(22535565200379316)
,p_event_id=>wwv_flow_imp.id(22535354577379314)
,p_event_result=>'TRUE'
,p_action_sequence=>10
,p_execute_on_page_init=>'N'
,p_action=>'NATIVE_JAVASCRIPT_CODE'
,p_attribute_01=>'$s(''P3_JSON_DOCUMENT'',monaco.editor.getModels()[0].getValue());'
);
wwv_flow_imp_page.create_page_da_action(
 p_id=>wwv_flow_imp.id(22535670587379317)
,p_event_id=>wwv_flow_imp.id(22535354577379314)
,p_event_result=>'TRUE'
,p_action_sequence=>30
,p_execute_on_page_init=>'N'
,p_action=>'NATIVE_SUBMIT_PAGE'
,p_attribute_01=>'CREATE_DOCUMENT'
,p_attribute_02=>'N'
);
wwv_flow_imp_page.create_page_da_event(
 p_id=>wwv_flow_imp.id(22535925996379320)
,p_name=>'When Click Add Document'
,p_event_sequence=>60
,p_triggering_element_type=>'BUTTON'
,p_triggering_button_id=>wwv_flow_imp.id(22535846683379319)
,p_bind_type=>'bind'
,p_execution_type=>'IMMEDIATE'
,p_bind_event_type=>'click'
);
wwv_flow_imp_page.create_page_da_action(
 p_id=>wwv_flow_imp.id(22536190192379322)
,p_event_id=>wwv_flow_imp.id(22535925996379320)
,p_event_result=>'TRUE'
,p_action_sequence=>10
,p_execute_on_page_init=>'N'
,p_action=>'NATIVE_JAVASCRIPT_CODE'
,p_attribute_01=>'$s(''P3_JSON_DOCUMENT'',monaco.editor.getModels()[0].getValue());'
);
wwv_flow_imp_page.create_page_da_action(
 p_id=>wwv_flow_imp.id(22536290080379323)
,p_event_id=>wwv_flow_imp.id(22535925996379320)
,p_event_result=>'TRUE'
,p_action_sequence=>20
,p_execute_on_page_init=>'N'
,p_action=>'NATIVE_SUBMIT_PAGE'
,p_attribute_01=>'ADD_DOCUMENT'
,p_attribute_02=>'N'
);
wwv_flow_imp_page.create_page_da_event(
 p_id=>wwv_flow_imp.id(22937218483832606)
,p_name=>'On Page Load - Enable/Disable Previous Button'
,p_event_sequence=>70
,p_condition_element=>'P3_PREVIOUS_PRIMARY_KEY'
,p_triggering_condition_type=>'NOT_NULL'
,p_bind_type=>'bind'
,p_execution_type=>'IMMEDIATE'
,p_bind_event_type=>'ready'
);
wwv_flow_imp_page.create_page_da_action(
 p_id=>wwv_flow_imp.id(22937239744832607)
,p_event_id=>wwv_flow_imp.id(22937218483832606)
,p_event_result=>'TRUE'
,p_action_sequence=>10
,p_execute_on_page_init=>'Y'
,p_action=>'NATIVE_ENABLE'
,p_affected_elements_type=>'BUTTON'
,p_affected_button_id=>wwv_flow_imp.id(21912618757072423)
);
wwv_flow_imp_page.create_page_da_action(
 p_id=>wwv_flow_imp.id(22937398203832608)
,p_event_id=>wwv_flow_imp.id(22937218483832606)
,p_event_result=>'FALSE'
,p_action_sequence=>10
,p_execute_on_page_init=>'Y'
,p_action=>'NATIVE_DISABLE'
,p_affected_elements_type=>'BUTTON'
,p_affected_button_id=>wwv_flow_imp.id(21912618757072423)
);
wwv_flow_imp_page.create_page_da_event(
 p_id=>wwv_flow_imp.id(22937481411832609)
,p_name=>'On Page Load - Enable/Disable Next'
,p_event_sequence=>80
,p_condition_element=>'P3_NEXT_PRIMARY_KEY'
,p_triggering_condition_type=>'NOT_NULL'
,p_bind_type=>'bind'
,p_execution_type=>'IMMEDIATE'
,p_bind_event_type=>'ready'
);
wwv_flow_imp_page.create_page_da_action(
 p_id=>wwv_flow_imp.id(22937552631832610)
,p_event_id=>wwv_flow_imp.id(22937481411832609)
,p_event_result=>'TRUE'
,p_action_sequence=>10
,p_execute_on_page_init=>'Y'
,p_action=>'NATIVE_ENABLE'
,p_affected_elements_type=>'BUTTON'
,p_affected_button_id=>wwv_flow_imp.id(21912424629072422)
);
wwv_flow_imp_page.create_page_da_action(
 p_id=>wwv_flow_imp.id(22937654664832611)
,p_event_id=>wwv_flow_imp.id(22937481411832609)
,p_event_result=>'FALSE'
,p_action_sequence=>10
,p_execute_on_page_init=>'Y'
,p_action=>'NATIVE_DISABLE'
,p_affected_elements_type=>'BUTTON'
,p_affected_button_id=>wwv_flow_imp.id(21912424629072422)
);
wwv_flow_imp_page.create_page_da_event(
 p_id=>wwv_flow_imp.id(22939506054832629)
,p_name=>'When Click Duplicate'
,p_event_sequence=>90
,p_triggering_element_type=>'BUTTON'
,p_triggering_button_id=>wwv_flow_imp.id(22939240070832627)
,p_bind_type=>'bind'
,p_execution_type=>'IMMEDIATE'
,p_bind_event_type=>'click'
);
wwv_flow_imp_page.create_page_da_action(
 p_id=>wwv_flow_imp.id(22939664813832631)
,p_event_id=>wwv_flow_imp.id(22939506054832629)
,p_event_result=>'TRUE'
,p_action_sequence=>10
,p_execute_on_page_init=>'N'
,p_action=>'NATIVE_JAVASCRIPT_CODE'
,p_attribute_01=>'$s(''P3_JSON_DOCUMENT'',monaco.editor.getModels()[0].getValue());'
);
wwv_flow_imp_page.create_page_da_action(
 p_id=>wwv_flow_imp.id(22939723841832632)
,p_event_id=>wwv_flow_imp.id(22939506054832629)
,p_event_result=>'TRUE'
,p_action_sequence=>30
,p_execute_on_page_init=>'N'
,p_action=>'NATIVE_SUBMIT_PAGE'
,p_attribute_01=>'DUPLICATE_DOCUMENT'
,p_attribute_02=>'N'
);
wwv_flow_imp_page.create_page_process(
 p_id=>wwv_flow_imp.id(21914956828072447)
,p_process_sequence=>10
,p_process_point=>'AFTER_SUBMIT'
,p_process_type=>'NATIVE_EXECUTION_CHAIN'
,p_process_name=>'Save Document If Not Toggling EJSON'
,p_attribute_01=>'N'
,p_error_display_location=>'INLINE_IN_NOTIFICATION'
,p_process_when=>'|USE_STANDARD_JSON|USE_EXTENDED_JSON|'
,p_process_when_type=>'REQUEST_NOT_IN_CONDITION'
,p_internal_uid=>10144037316899242
);
wwv_flow_imp_page.create_page_process(
 p_id=>wwv_flow_imp.id(15057033652116120)
,p_process_sequence=>20
,p_process_point=>'AFTER_SUBMIT'
,p_process_type=>'NATIVE_PLSQL'
,p_process_name=>'Use EJSON'
,p_process_sql_clob=>':P3_USE_EJSON := ''Y'';'
,p_process_clob_language=>'PLSQL'
,p_error_display_location=>'INLINE_IN_NOTIFICATION'
,p_process_when_button_id=>wwv_flow_imp.id(15056707072116117)
,p_internal_uid=>15057033652116120
);
wwv_flow_imp_page.create_page_process(
 p_id=>wwv_flow_imp.id(15057189662116121)
,p_process_sequence=>30
,p_process_point=>'AFTER_SUBMIT'
,p_process_type=>'NATIVE_PLSQL'
,p_process_name=>'Use Standard JSON'
,p_process_sql_clob=>':P3_USE_EJSON := ''N'';'
,p_process_clob_language=>'PLSQL'
,p_error_display_location=>'INLINE_IN_NOTIFICATION'
,p_process_when_button_id=>wwv_flow_imp.id(15056833268116118)
,p_internal_uid=>15057189662116121
);
wwv_flow_imp_page.create_page_process(
 p_id=>wwv_flow_imp.id(21912067384072418)
,p_process_sequence=>20
,p_process_point=>'BEFORE_HEADER'
,p_region_id=>wwv_flow_imp.id(21911941357072417)
,p_process_type=>'NATIVE_FORM_INIT'
,p_process_name=>'Initialize form Browse/Edit View'
,p_attribute_01=>'P3_NEXT_PRIMARY_KEY'
,p_attribute_02=>'P3_PREVIOUS_PRIMARY_KEY'
,p_attribute_03=>'P3_PAGINATION_DISPLAY'
,p_process_when=>'P3_DUALV_NAME_ORIG'
,p_process_when_type=>'ITEM_IS_NOT_NULL'
,p_internal_uid=>10141147872899213
);
wwv_flow_imp_page.create_page_process(
 p_id=>wwv_flow_imp.id(22940024704832635)
,p_process_sequence=>30
,p_process_point=>'BEFORE_HEADER'
,p_process_type=>'NATIVE_PLSQL'
,p_process_name=>'Duplicate ResId to Cancel Doc'
,p_process_sql_clob=>wwv_flow_string.join(wwv_flow_t_varchar2(
'execute immediate apex_string.format(q''~',
'   select json_serialize(',
'            json_transform(data,',
'                remove ''$."_id"'',',
'                remove ''$."_metadata"'')',
'             returning clob pretty)',
'     from %s',
'     where resid = :resid',
'~'', :P3_DUALV_NAME)',
'into :P3_JSON_DOCUMENT',
'using :P3_RESID_FOR_CANCEL;'))
,p_process_clob_language=>'PLSQL'
,p_process_when=>wwv_flow_string.join(wwv_flow_t_varchar2(
'nvl(:P3_DUPLICATE,''N'')=''Y'' and ',
':P3_RESID_FOR_CANCEL is not null'))
,p_process_when_type=>'EXPRESSION'
,p_process_when2=>'PLSQL'
,p_internal_uid=>11169105193659430
);
wwv_flow_imp_page.create_page_process(
 p_id=>wwv_flow_imp.id(21915144438072449)
,p_process_sequence=>10
,p_parent_process_id=>wwv_flow_imp.id(21914956828072447)
,p_process_type=>'NATIVE_EXECUTION_CHAIN'
,p_process_name=>'If Document Exists...'
,p_attribute_01=>'N'
,p_process_when=>'P3_RESID'
,p_process_when_type=>'ITEM_IS_NOT_NULL'
,p_internal_uid=>10144224926899244
);
wwv_flow_imp_page.create_page_process(
 p_id=>wwv_flow_imp.id(21915401257072451)
,p_process_sequence=>10
,p_parent_process_id=>wwv_flow_imp.id(21915144438072449)
,p_process_type=>'NATIVE_EXECUTION_CHAIN'
,p_process_name=>'If Updating & Document Changed'
,p_attribute_01=>'N'
,p_process_when=>':P3_RESID is not null and coalesce(:P3_JSON_DOCUMENT,''~'') != coalesce(:P3_JSON_DOCUMENT_OLD,''~'')'
,p_process_when_type=>'EXPRESSION'
,p_process_when2=>'PLSQL'
,p_internal_uid=>10144481745899246
);
wwv_flow_imp_page.create_page_process(
 p_id=>wwv_flow_imp.id(21915497148072452)
,p_process_sequence=>10
,p_parent_process_id=>wwv_flow_imp.id(21915058591072448)
,p_process_type=>'NATIVE_PLSQL'
,p_process_name=>'Insert JSON Document'
,p_process_sql_clob=>wwv_flow_string.join(wwv_flow_t_varchar2(
'execute immediate apex_string.format(q''~',
'    insert into %s(data) ',
'    values (json(:data extended))',
'    returning resid, etag',
'         into :resid, :etag',
'~'',:P3_DUALV_NAME_ORIG)',
'using :P3_JSON_DOCUMENT',
'returning into :P3_RESID, :P3_ETAG;',
''))
,p_process_clob_language=>'PLSQL'
,p_internal_uid=>10144577636899247
);
wwv_flow_imp_page.create_page_process(
 p_id=>wwv_flow_imp.id(21915663667072454)
,p_process_sequence=>10
,p_parent_process_id=>wwv_flow_imp.id(21915575594072453)
,p_process_type=>'NATIVE_PLSQL'
,p_process_name=>'Delete JSON Document'
,p_process_sql_clob=>wwv_flow_string.join(wwv_flow_t_varchar2(
'execute immediate apex_string.format(q''~',
'    delete from %s ',
'    where resid = :resid',
'      and etag  = :etag',
'~'',:P3_DUALV_NAME_ORIG)',
'using :P3_RESID, :P3_ETAG;',
''))
,p_process_clob_language=>'PLSQL'
,p_internal_uid=>10144744155899249
);
wwv_flow_imp_page.create_page_process(
 p_id=>wwv_flow_imp.id(22534602311379306)
,p_process_sequence=>10
,p_parent_process_id=>wwv_flow_imp.id(21915401257072451)
,p_process_type=>'NATIVE_PLSQL'
,p_process_name=>'Update JSON Document'
,p_process_sql_clob=>wwv_flow_string.join(wwv_flow_t_varchar2(
'execute immediate apex_string.format(q''~',
'    update %s ',
'    set data = json(:data extended)',
'    where resid = :resid',
'~'',:P3_DUALV_NAME_ORIG)',
'using :P3_JSON_DOCUMENT, :P3_RESID;',
''))
,p_process_clob_language=>'PLSQL'
,p_internal_uid=>10763682800206101
);
wwv_flow_imp_page.create_page_process(
 p_id=>wwv_flow_imp.id(21915058591072448)
,p_process_sequence=>20
,p_parent_process_id=>wwv_flow_imp.id(21914956828072447)
,p_process_type=>'NATIVE_EXECUTION_CHAIN'
,p_process_name=>'Else if Document is New...'
,p_attribute_01=>'N'
,p_process_when=>'P3_RESID'
,p_process_when_type=>'ITEM_IS_NULL'
,p_internal_uid=>10144139079899243
);
wwv_flow_imp_page.create_page_process(
 p_id=>wwv_flow_imp.id(21915575594072453)
,p_process_sequence=>20
,p_parent_process_id=>wwv_flow_imp.id(21915144438072449)
,p_process_type=>'NATIVE_EXECUTION_CHAIN'
,p_process_name=>'Else If Deleting Document'
,p_attribute_01=>'N'
,p_process_when_button_id=>wwv_flow_imp.id(22539150153379352)
,p_internal_uid=>10144656082899248
);
end;
/
prompt --application/pages/page_00004
begin
wwv_flow_imp_page.create_page(
 p_id=>4
,p_name=>'Create JSON Table'
,p_alias=>'CREATE-JSON-TABLE'
,p_step_title=>'Create JSON Table'
,p_autocomplete_on_off=>'OFF'
,p_page_template_options=>'#DEFAULT#:t-DeferredRendering'
,p_protection_level=>'C'
,p_page_component_map=>'17'
);
wwv_flow_imp_page.create_page_plug(
 p_id=>wwv_flow_imp.id(22128208289334274)
,p_plug_name=>'Create JSON Collection Table'
,p_icon_css_classes=>'fa-table'
,p_region_template_options=>'#DEFAULT#'
,p_plug_template=>2674017834225413037
,p_plug_display_sequence=>10
,p_plug_display_point=>'REGION_POSITION_01'
,p_location=>null
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'expand_shortcuts', 'N',
  'output_as', 'HTML')).to_clob
);
wwv_flow_imp_page.create_page_button(
 p_id=>wwv_flow_imp.id(12145063976473502)
,p_button_sequence=>30
,p_button_name=>'CREATE_NEW_TABLE'
,p_button_action=>'SUBMIT'
,p_button_template_options=>'#DEFAULT#'
,p_button_template_id=>4072362960822175091
,p_button_image_alt=>'Create New JSON Collection Table'
,p_grid_new_row=>'Y'
);
wwv_flow_imp_page.create_page_item(
 p_id=>wwv_flow_imp.id(12164855148166761)
,p_name=>'P4_NEW_JSON_COLLECTION_TABLE_NAME'
,p_is_required=>true
,p_item_sequence=>10
,p_prompt=>'New JSON Collection Table Name'
,p_display_as=>'NATIVE_TEXT_FIELD'
,p_cSize=>30
,p_colspan=>6
,p_field_template=>1609122147107268652
,p_item_template_options=>'#DEFAULT#'
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'disabled', 'N',
  'submit_when_enter_pressed', 'N',
  'subtype', 'TEXT',
  'text_case', 'UPPER',
  'trim_spaces', 'BOTH')).to_clob
);
wwv_flow_imp_page.create_page_item(
 p_id=>wwv_flow_imp.id(12165163295169050)
,p_name=>'P4_IGNORE_EXISTING_TABLE'
,p_item_sequence=>20
,p_item_default=>'N'
,p_prompt=>'Ignore Existing Table?'
,p_display_as=>'NATIVE_YES_NO'
,p_begin_on_new_line=>'N'
,p_field_template=>1609121967514267634
,p_item_template_options=>'#DEFAULT#'
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'use_defaults', 'Y')).to_clob
);
wwv_flow_imp_page.create_page_process(
 p_id=>wwv_flow_imp.id(12145179139473503)
,p_process_sequence=>10
,p_process_point=>'AFTER_SUBMIT'
,p_process_type=>'NATIVE_EXECUTION_CHAIN'
,p_process_name=>'Create New Table'
,p_attribute_01=>'N'
,p_error_display_location=>'INLINE_IN_NOTIFICATION'
,p_internal_uid=>12145179139473503
);
wwv_flow_imp_page.create_page_process(
 p_id=>wwv_flow_imp.id(12145213187473504)
,p_process_sequence=>10
,p_parent_process_id=>wwv_flow_imp.id(12145179139473503)
,p_process_type=>'NATIVE_EXECUTION_CHAIN'
,p_process_name=>'If Ignore Existing Table...'
,p_attribute_01=>'N'
,p_process_when=>'P4_IGNORE_EXISTING_TABLE'
,p_process_when_type=>'VAL_OF_ITEM_IN_COND_EQ_COND2'
,p_process_when2=>'Y'
,p_internal_uid=>12145213187473504
);
wwv_flow_imp_page.create_page_process(
 p_id=>wwv_flow_imp.id(12145338294473505)
,p_process_sequence=>10
,p_parent_process_id=>wwv_flow_imp.id(12145213187473504)
,p_process_type=>'NATIVE_PLSQL'
,p_process_name=>'Drop Existing Table'
,p_process_sql_clob=>wwv_flow_string.join(wwv_flow_t_varchar2(
'execute immediate apex_string.format(',
'  ''drop table %s cascade constraints'',',
'  :P4_NEW_JSON_COLLECTION_TABLE_NAME);'))
,p_process_clob_language=>'PLSQL'
,p_internal_uid=>12145338294473505
);
wwv_flow_imp_page.create_page_process(
 p_id=>wwv_flow_imp.id(12145463538473506)
,p_process_sequence=>20
,p_parent_process_id=>wwv_flow_imp.id(12145179139473503)
,p_process_type=>'NATIVE_PLSQL'
,p_process_name=>'Create New JSON Collection'
,p_process_sql_clob=>wwv_flow_string.join(wwv_flow_t_varchar2(
'execute immediate apex_string.format(',
'  ''create json collection table %s'',',
'  :P4_NEW_JSON_COLLECTION_TABLE_NAME);'))
,p_process_clob_language=>'PLSQL'
,p_internal_uid=>12145463538473506
);
end;
/
prompt --application/pages/page_00005
begin
wwv_flow_imp_page.create_page(
 p_id=>5
,p_name=>'About'
,p_alias=>'ABOUT'
,p_step_title=>'About'
,p_autocomplete_on_off=>'OFF'
,p_page_template_options=>'#DEFAULT#:t-DeferredRendering'
,p_protection_level=>'C'
,p_page_component_map=>'11'
);
wwv_flow_imp_page.create_page_plug(
 p_id=>wwv_flow_imp.id(21911384400072411)
,p_plug_name=>'About'
,p_region_template_options=>'#DEFAULT#'
,p_plug_template=>4501440665235496320
,p_plug_display_sequence=>10
,p_location=>null
,p_plug_source_type=>'PLUGIN_MARKDOWN'
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'file_name', 'companion_about.md',
  'source', 'APPLICATION_STATIC_FILE')).to_clob
);
wwv_flow_imp_page.create_page_plug(
 p_id=>wwv_flow_imp.id(22140314833416416)
,p_plug_name=>'About JSON Duality Companion'
,p_icon_css_classes=>'fa-badgerine'
,p_region_template_options=>'#DEFAULT#'
,p_plug_template=>2674017834225413037
,p_plug_display_sequence=>10
,p_plug_display_point=>'REGION_POSITION_01'
,p_location=>null
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'expand_shortcuts', 'N',
  'output_as', 'HTML')).to_clob
);
end;
/
prompt --application/pages/page_00006
begin
wwv_flow_imp_page.create_page(
 p_id=>6
,p_name=>'Show Definition'
,p_alias=>'SHOW-DEFINITION'
,p_step_title=>'Show Definition'
,p_warn_on_unsaved_changes=>'N'
,p_autocomplete_on_off=>'OFF'
,p_page_template_options=>'#DEFAULT#:t-DeferredRendering'
,p_protection_level=>'C'
,p_page_component_map=>'17'
);
wwv_flow_imp_page.create_page_plug(
 p_id=>wwv_flow_imp.id(22143133076445661)
,p_plug_name=>'Show Definition and Related Tables for Duality View'
,p_icon_css_classes=>'fa-network-hub'
,p_region_template_options=>'#DEFAULT#'
,p_plug_template=>2674017834225413037
,p_plug_display_sequence=>10
,p_plug_display_point=>'REGION_POSITION_01'
,p_location=>null
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'expand_shortcuts', 'N',
  'output_as', 'HTML')).to_clob
);
wwv_flow_imp_page.create_page_plug(
 p_id=>wwv_flow_imp.id(23014515041415234)
,p_plug_name=>'Tabs'
,p_region_template_options=>'#DEFAULT#:js-useLocalStorage:t-TabsRegion-mod--simple'
,p_plug_template=>3223171818405608528
,p_plug_display_sequence=>50
,p_location=>null
,p_plug_display_condition_type=>'ITEM_IS_NOT_NULL'
,p_plug_display_when_condition=>'P6_DUALV_NAME'
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'expand_shortcuts', 'N',
  'output_as', 'HTML')).to_clob
);
wwv_flow_imp_page.create_page_plug(
 p_id=>wwv_flow_imp.id(23014616920415235)
,p_plug_name=>'Definition'
,p_parent_plug_id=>wwv_flow_imp.id(23014515041415234)
,p_plug_display_sequence=>10
,p_plug_display_point=>'SUB_REGIONS'
,p_location=>null
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'expand_shortcuts', 'N',
  'output_as', 'HTML')).to_clob
);
wwv_flow_imp_page.create_page_plug(
 p_id=>wwv_flow_imp.id(23014768392415237)
,p_plug_name=>'Definition'
,p_parent_plug_id=>wwv_flow_imp.id(23014616920415235)
,p_region_template_options=>'#DEFAULT#'
,p_plug_template=>3371237801798025892
,p_plug_display_sequence=>10
,p_plug_grid_column_css_classes=>'margin-top-md'
,p_plug_display_point=>'SUB_REGIONS'
,p_location=>null
,p_plug_source=>wwv_flow_string.join(wwv_flow_t_varchar2(
'SELECT dbms_metadata.get_ddl(''VIEW'',:P6_DUALV_NAME) as value_edit,',
'       null as value_diff,',
'       ''sql'' as language'))
,p_plug_source_type=>'PLUGIN_RW.APEX.VS.MONACO.EDITOR'
,p_ajax_items_to_submit=>'P6_DUALV_NAME'
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'attribute_01', 'calc(100vh - 27rem)',
  'attribute_02', 'begin null; end;',
  'attribute_03', 'sql',
  'attribute_04', 'vs',
  'attribute_05', 'search')).to_clob
);
wwv_flow_imp_page.create_page_plug(
 p_id=>wwv_flow_imp.id(23014698710415236)
,p_plug_name=>'Related Tables'
,p_parent_plug_id=>wwv_flow_imp.id(23014515041415234)
,p_plug_display_sequence=>20
,p_plug_display_point=>'SUB_REGIONS'
,p_location=>null
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'expand_shortcuts', 'N',
  'output_as', 'HTML')).to_clob
);
wwv_flow_imp_page.create_page_plug(
 p_id=>wwv_flow_imp.id(22538686037379347)
,p_plug_name=>'Diagram'
,p_parent_plug_id=>wwv_flow_imp.id(23014698710415236)
,p_plug_display_sequence=>40
,p_plug_display_point=>'SUB_REGIONS'
,p_location=>null
,p_plug_source_type=>'PLUGIN_MERMAID_DIAGRAM'
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'page_item', 'P6_DIAGRAM')).to_clob
);
wwv_flow_imp_page.create_page_plug(
 p_id=>wwv_flow_imp.id(24297652088046897)
,p_plug_name=>'No JSON Relational Duality Views Yet'
,p_region_template_options=>'#DEFAULT#:t-Alert--horizontal:t-Alert--defaultIcons:t-Alert--info'
,p_plug_template=>2040683448887306517
,p_plug_display_sequence=>60
,p_location=>null
,p_plug_source_type=>'PLUGIN_MARKDOWN'
,p_plug_display_condition_type=>'ITEM_IS_NULL'
,p_plug_display_when_condition=>'P6_DUALV_NAME'
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'file_name', 'nothing_to_describe.md',
  'source', 'APPLICATION_STATIC_FILE')).to_clob
);
wwv_flow_imp_page.create_page_item(
 p_id=>wwv_flow_imp.id(22537244833379333)
,p_name=>'P6_DIAGRAM'
,p_item_sequence=>30
,p_display_as=>'NATIVE_HIDDEN'
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'value_protected', 'Y')).to_clob
);
wwv_flow_imp_page.create_page_item(
 p_id=>wwv_flow_imp.id(22912981700178855)
,p_name=>'P6_DUALV_NAME'
,p_item_sequence=>10
,p_prompt=>'Duality View Name'
,p_display_as=>'NATIVE_SELECT_ONE'
,p_named_lov=>'LOV_DUALITY_VIEWS'
,p_lov=>wwv_flow_string.join(wwv_flow_t_varchar2(
'select view_name d, view_name r, ''fa-eye'' icon',
'from user_json_duality_views',
'order by view_name'))
,p_cSize=>30
,p_colspan=>6
,p_display_when=>'P6_DUALV_NAME'
,p_display_when_type=>'ITEM_IS_NOT_NULL'
,p_field_template=>1609121967514267634
,p_item_template_options=>'#DEFAULT#'
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'case_sensitive', 'N',
  'fetch_on_search', 'N',
  'match_type', 'CONTAINS',
  'min_chars', '0')).to_clob
);
wwv_flow_imp_page.create_page_item(
 p_id=>wwv_flow_imp.id(23014893450415238)
,p_name=>'P6_DDL'
,p_data_type=>'CLOB'
,p_item_sequence=>60
,p_display_as=>'NATIVE_HIDDEN'
,p_is_persistent=>'N'
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'value_protected', 'N')).to_clob
);
wwv_flow_imp_page.create_page_computation(
 p_id=>wwv_flow_imp.id(22913351516183100)
,p_computation_sequence=>30
,p_computation_item=>'P6_DUALV_NAME'
,p_computation_point=>'BEFORE_HEADER'
,p_computation_type=>'QUERY'
,p_computation=>wwv_flow_string.join(wwv_flow_t_varchar2(
'select max(view_name)',
'from user_json_duality_views',
'where view_name = :P6_DUALV_NAME'))
,p_computation_comment=>'Set the value to null if it''s current value is no longer a valid duality view name.'
);
wwv_flow_imp_page.create_page_computation(
 p_id=>wwv_flow_imp.id(12129117594684803)
,p_computation_sequence=>40
,p_computation_item=>'P6_DUALV_NAME'
,p_computation_point=>'BEFORE_HEADER'
,p_computation_type=>'QUERY'
,p_computation=>wwv_flow_string.join(wwv_flow_t_varchar2(
'select view_name',
'from user_json_duality_views',
'order by case when view_name = coalesce(:P2_DUALV_NAME,:P3_DUALV_NAME) then 0 else 1 end, view_name',
'fetch first row only'))
,p_compute_when=>'P6_DUALV_NAME'
,p_compute_when_type=>'ITEM_IS_NULL'
);
wwv_flow_imp_page.create_page_computation(
 p_id=>wwv_flow_imp.id(23015000521415239)
,p_computation_sequence=>50
,p_computation_item=>'P6_DDL'
,p_computation_point=>'BEFORE_HEADER'
,p_computation_type=>'EXPRESSION'
,p_computation_language=>'PLSQL'
,p_computation=>'dbms_metadata.get_ddl(''VIEW'',:P6_DUALV_NAME)'
,p_compute_when=>'P6_DUALV_NAME'
,p_compute_when_type=>'ITEM_IS_NOT_NULL'
);
wwv_flow_imp_page.create_page_da_event(
 p_id=>wwv_flow_imp.id(22537742827379338)
,p_name=>'When View Name Changes'
,p_event_sequence=>10
,p_triggering_element_type=>'ITEM'
,p_triggering_element=>'P6_DUALV_NAME'
,p_bind_type=>'bind'
,p_execution_type=>'IMMEDIATE'
,p_bind_event_type=>'change'
);
wwv_flow_imp_page.create_page_da_action(
 p_id=>wwv_flow_imp.id(22537852050379339)
,p_event_id=>wwv_flow_imp.id(22537742827379338)
,p_event_result=>'TRUE'
,p_action_sequence=>10
,p_execute_on_page_init=>'N'
,p_action=>'NATIVE_EXECUTE_PLSQL_CODE'
,p_attribute_01=>wwv_flow_string.join(wwv_flow_t_varchar2(
':P6_DIAGRAM := json_duality_companion.diagram_text_for_dualv(:P6_DUALV_NAME);',
':P6_DDL := dbms_metadata.get_ddl(''VIEW'',:P6_DUALV_NAME);'))
,p_attribute_02=>'P6_DUALV_NAME'
,p_attribute_03=>'P6_DIAGRAM,P6_DDL'
,p_attribute_04=>'N'
,p_attribute_05=>'PLSQL'
,p_wait_for_result=>'Y'
);
wwv_flow_imp_page.create_page_da_action(
 p_id=>wwv_flow_imp.id(22538984783379350)
,p_event_id=>wwv_flow_imp.id(22537742827379338)
,p_event_result=>'TRUE'
,p_action_sequence=>20
,p_execute_on_page_init=>'N'
,p_action=>'NATIVE_REFRESH'
,p_affected_elements_type=>'REGION'
,p_affected_region_id=>wwv_flow_imp.id(22538686037379347)
,p_attribute_01=>'N'
);
wwv_flow_imp_page.create_page_da_action(
 p_id=>wwv_flow_imp.id(23015058646415240)
,p_event_id=>wwv_flow_imp.id(22537742827379338)
,p_event_result=>'TRUE'
,p_action_sequence=>30
,p_execute_on_page_init=>'N'
,p_name=>'Update Code Editor'
,p_action=>'NATIVE_JAVASCRIPT_CODE'
,p_attribute_01=>'monaco.editor.getModels()[0].setValue($v(''P6_DDL''));'
);
wwv_flow_imp_page.create_page_process(
 p_id=>wwv_flow_imp.id(22537444138379335)
,p_process_sequence=>10
,p_process_point=>'BEFORE_HEADER'
,p_process_type=>'NATIVE_INVOKE_API'
,p_process_name=>'Get Diagram Text'
,p_attribute_01=>'PLSQL_PACKAGE'
,p_attribute_03=>'JSON_DUALITY_COMPANION'
,p_attribute_04=>'DIAGRAM_TEXT_FOR_DUALV'
,p_process_when=>'P6_DUALV_NAME'
,p_process_when_type=>'ITEM_IS_NOT_NULL'
,p_internal_uid=>10766524627206130
);
wwv_flow_imp_shared.create_invokeapi_comp_param(
 p_id=>wwv_flow_imp.id(22537607985379336)
,p_page_process_id=>wwv_flow_imp.id(22537444138379335)
,p_page_id=>6
,p_direction=>'OUT'
,p_data_type=>'CLOB'
,p_ignore_output=>false
,p_display_sequence=>10
,p_value_type=>'ITEM'
,p_value=>'P6_DIAGRAM'
);
wwv_flow_imp_shared.create_invokeapi_comp_param(
 p_id=>wwv_flow_imp.id(22537718916379337)
,p_page_process_id=>wwv_flow_imp.id(22537444138379335)
,p_page_id=>6
,p_name=>'p_dualv_name'
,p_direction=>'IN'
,p_data_type=>'VARCHAR2'
,p_has_default=>false
,p_display_sequence=>20
,p_value_type=>'ITEM'
,p_value=>'P6_DUALV_NAME'
);
end;
/
prompt --application/pages/page_00007
begin
wwv_flow_imp_page.create_page(
 p_id=>7
,p_name=>'Experiment with SQL'
,p_alias=>'EXPERIMENT-WITH-SQL'
,p_step_title=>'Experiment with SQL'
,p_autocomplete_on_off=>'OFF'
,p_inline_css=>wwv_flow_string.join(wwv_flow_t_varchar2(
'.sql-results tbody { font-family: Courier; font-size: 10pt }',
'.sql-results  thead tr th { font-weight: boldest;   border-bottom: 1px dotted lightgrey; }',
'.sql-results  tr { padding-top: 5px }',
'.sql-results  td,th { padding-left: 5px; padding-right: 5px; text-align: left; border-right: 1px dotted lightgrey; }',
'.sql-results  td:last-child, th:last-child { border-right: none }',
'.sql-results tbody tr:nth-child(even) {background: lightblue; color: black}',
'.sql-results table { ',
'    border-spacing: 0;',
'    border-collapse: collapse;',
'}'))
,p_page_template_options=>'#DEFAULT#:t-DeferredRendering'
,p_protection_level=>'C'
,p_page_component_map=>'25'
);
wwv_flow_imp_page.create_page_plug(
 p_id=>wwv_flow_imp.id(22537954366379340)
,p_plug_name=>'SQL Query'
,p_region_css_classes=>'margin-top-md'
,p_region_template_options=>'#DEFAULT#'
,p_plug_template=>3371237801798025892
,p_plug_display_sequence=>20
,p_location=>null
,p_plug_source=>wwv_flow_string.join(wwv_flow_t_varchar2(
'select :P7_SQL as value_edit,',
'       null    as value_diff,',
'       ''sql''   as language'))
,p_plug_source_type=>'PLUGIN_RW.APEX.VS.MONACO.EDITOR'
,p_ajax_items_to_submit=>'P1_SQL'
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'attribute_01', '30vh',
  'attribute_02', 'begin null; end;',
  'attribute_03', 'sql',
  'attribute_04', 'vs')).to_clob
);
wwv_flow_imp_page.create_page_plug(
 p_id=>wwv_flow_imp.id(22538303116379343)
,p_plug_name=>'Results'
,p_region_template_options=>'#DEFAULT#:t-Region--noUI:t-Region--scrollBody'
,p_plug_template=>4072358936313175081
,p_plug_display_sequence=>40
,p_location=>null
,p_function_body_language=>'PLSQL'
,p_plug_source=>'return eba_demo_xslt.html_for_sql(apex_session_state.get_clob(''P7_SQL''));'
,p_plug_source_type=>'NATIVE_DYNAMIC_CONTENT'
,p_ajax_items_to_submit=>'P7_SQL'
);
wwv_flow_imp_page.create_page_plug(
 p_id=>wwv_flow_imp.id(22561345702285784)
,p_plug_name=>'Experiment with SQL'
,p_icon_css_classes=>'fa-file-sql-o'
,p_region_template_options=>'#DEFAULT#'
,p_plug_template=>2674017834225413037
,p_plug_display_sequence=>10
,p_plug_display_point=>'REGION_POSITION_01'
,p_location=>null
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'expand_shortcuts', 'N',
  'output_as', 'HTML')).to_clob
);
wwv_flow_imp_page.create_page_button(
 p_id=>wwv_flow_imp.id(22538149048379342)
,p_button_sequence=>10
,p_button_name=>'RUN_QUERY'
,p_button_action=>'DEFINED_BY_DA'
,p_button_template_options=>'#DEFAULT#:t-Button--iconLeft'
,p_button_template_id=>2082829544945815391
,p_button_image_alt=>'Run Query'
,p_warn_on_unsaved_changes=>null
,p_icon_css_classes=>'fa-database-play'
,p_grid_new_row=>'Y'
);
wwv_flow_imp_page.create_page_item(
 p_id=>wwv_flow_imp.id(22538106715379341)
,p_name=>'P7_SQL'
,p_item_sequence=>30
,p_display_as=>'NATIVE_HIDDEN'
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'value_protected', 'Y')).to_clob
);
wwv_flow_imp_page.create_page_da_event(
 p_id=>wwv_flow_imp.id(22538327501379344)
,p_name=>'When Click Run Query'
,p_event_sequence=>10
,p_triggering_element_type=>'BUTTON'
,p_triggering_button_id=>wwv_flow_imp.id(22538149048379342)
,p_bind_type=>'bind'
,p_execution_type=>'IMMEDIATE'
,p_bind_event_type=>'click'
);
wwv_flow_imp_page.create_page_da_action(
 p_id=>wwv_flow_imp.id(22538493943379345)
,p_event_id=>wwv_flow_imp.id(22538327501379344)
,p_event_result=>'TRUE'
,p_action_sequence=>10
,p_execute_on_page_init=>'N'
,p_name=>'Copy Code Editor to P7_SQL'
,p_action=>'NATIVE_JAVASCRIPT_CODE'
,p_attribute_01=>'$s(''P7_SQL'',monaco.editor.getModels()[0].getValue());'
);
wwv_flow_imp_page.create_page_da_action(
 p_id=>wwv_flow_imp.id(23011944794415209)
,p_event_id=>wwv_flow_imp.id(22538327501379344)
,p_event_result=>'TRUE'
,p_action_sequence=>20
,p_execute_on_page_init=>'N'
,p_action=>'NATIVE_JAVASCRIPT_CODE'
,p_attribute_01=>wwv_flow_string.join(wwv_flow_t_varchar2(
'// First clear the errors',
'apex.message.clearErrors();',
'',
'// Now show new errors',
'apex.message.showErrors( [',
'    {',
'        type:       "error",',
'        location:   "page",',
'        message:    "Please provide a SQL query to run",',
'        unsafe:     false',
'    }',
'] );'))
,p_client_condition_type=>'NULL'
,p_client_condition_element=>'P7_SQL'
);
wwv_flow_imp_page.create_page_da_action(
 p_id=>wwv_flow_imp.id(22538568148379346)
,p_event_id=>wwv_flow_imp.id(22538327501379344)
,p_event_result=>'TRUE'
,p_action_sequence=>30
,p_execute_on_page_init=>'N'
,p_action=>'NATIVE_REFRESH'
,p_affected_elements_type=>'REGION'
,p_affected_region_id=>wwv_flow_imp.id(22538303116379343)
,p_attribute_01=>'N'
,p_client_condition_type=>'NOT_NULL'
,p_client_condition_element=>'P7_SQL'
);
end;
/
prompt --application/pages/page_09999
begin
wwv_flow_imp_page.create_page(
 p_id=>9999
,p_name=>'Login Page'
,p_alias=>'LOGIN'
,p_step_title=>'JSON Duality Companion - Log In'
,p_warn_on_unsaved_changes=>'N'
,p_first_item=>'AUTO_FIRST_ITEM'
,p_autocomplete_on_off=>'OFF'
,p_step_template=>2101157952850466385
,p_page_template_options=>'#DEFAULT#'
,p_page_is_public_y_n=>'Y'
,p_protection_level=>'C'
,p_page_component_map=>'12'
);
wwv_flow_imp_page.create_page_plug(
 p_id=>wwv_flow_imp.id(20799899011037142)
,p_plug_name=>'JSON Duality Companion'
,p_region_template_options=>'#DEFAULT#'
,p_plug_template=>2674157997338192145
,p_plug_display_sequence=>10
,p_location=>null
,p_region_image=>'#APP_FILES#icons/app-icon-512.png'
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'expand_shortcuts', 'N',
  'output_as', 'HTML',
  'show_line_breaks', 'Y')).to_clob
);
wwv_flow_imp_page.create_page_button(
 p_id=>wwv_flow_imp.id(20801436409037156)
,p_button_sequence=>40
,p_button_plug_id=>wwv_flow_imp.id(20799899011037142)
,p_button_name=>'LOGIN'
,p_button_action=>'SUBMIT'
,p_button_template_options=>'#DEFAULT#'
,p_button_template_id=>4072362960822175091
,p_button_is_hot=>'Y'
,p_button_image_alt=>'Sign In'
,p_button_position=>'NEXT'
,p_button_alignment=>'LEFT'
,p_grid_new_row=>'Y'
,p_grid_new_column=>'Y'
);
wwv_flow_imp_page.create_page_item(
 p_id=>wwv_flow_imp.id(20800381122037150)
,p_name=>'P9999_USERNAME'
,p_item_sequence=>10
,p_item_plug_id=>wwv_flow_imp.id(20799899011037142)
,p_prompt=>'Username'
,p_placeholder=>'Username'
,p_display_as=>'NATIVE_TEXT_FIELD'
,p_cSize=>40
,p_cMaxlength=>100
,p_tag_attributes=>'autocomplete="username"'
,p_label_alignment=>'RIGHT'
,p_field_template=>2040785906935475274
,p_item_icon_css_classes=>'fa-user'
,p_item_template_options=>'#DEFAULT#'
,p_is_persistent=>'N'
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'disabled', 'N',
  'send_on_page_submit', 'N',
  'submit_when_enter_pressed', 'N',
  'subtype', 'TEXT',
  'trim_spaces', 'NONE')).to_clob
);
wwv_flow_imp_page.create_page_item(
 p_id=>wwv_flow_imp.id(20800664518037152)
,p_name=>'P9999_PASSWORD'
,p_item_sequence=>20
,p_item_plug_id=>wwv_flow_imp.id(20799899011037142)
,p_prompt=>'Password'
,p_placeholder=>'Password'
,p_display_as=>'NATIVE_PASSWORD'
,p_cSize=>40
,p_cMaxlength=>100
,p_tag_attributes=>'autocomplete="current-password"'
,p_label_alignment=>'RIGHT'
,p_field_template=>2040785906935475274
,p_item_icon_css_classes=>'fa-key'
,p_item_template_options=>'#DEFAULT#'
,p_is_persistent=>'N'
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'submit_when_enter_pressed', 'Y')).to_clob
);
wwv_flow_imp_page.create_page_item(
 p_id=>wwv_flow_imp.id(20801027825037154)
,p_name=>'P9999_REMEMBER'
,p_item_sequence=>30
,p_item_plug_id=>wwv_flow_imp.id(20799899011037142)
,p_prompt=>'Remember username'
,p_display_as=>'NATIVE_SINGLE_CHECKBOX'
,p_label_alignment=>'RIGHT'
,p_display_when=>'apex_authentication.persistent_cookies_enabled'
,p_display_when2=>'PLSQL'
,p_display_when_type=>'EXPRESSION'
,p_field_template=>2040785906935475274
,p_item_template_options=>'#DEFAULT#'
,p_escape_on_http_output=>'N'
,p_attributes=>wwv_flow_t_plugin_attributes(wwv_flow_t_varchar2(
  'use_defaults', 'Y')).to_clob
);
wwv_flow_imp_page.create_page_process(
 p_id=>wwv_flow_imp.id(20803711907037165)
,p_process_sequence=>10
,p_process_point=>'AFTER_SUBMIT'
,p_process_type=>'NATIVE_INVOKE_API'
,p_process_name=>'Set Username Cookie'
,p_attribute_01=>'PLSQL_PACKAGE'
,p_attribute_03=>'APEX_AUTHENTICATION'
,p_attribute_04=>'SEND_LOGIN_USERNAME_COOKIE'
,p_error_display_location=>'INLINE_IN_NOTIFICATION'
,p_internal_uid=>9032792395863960
);
wwv_flow_imp_shared.create_invokeapi_comp_param(
 p_id=>wwv_flow_imp.id(20804185749037166)
,p_page_process_id=>wwv_flow_imp.id(20803711907037165)
,p_page_id=>9999
,p_name=>'p_username'
,p_direction=>'IN'
,p_data_type=>'VARCHAR2'
,p_has_default=>false
,p_display_sequence=>1
,p_value_type=>'EXPRESSION'
,p_value_language=>'PLSQL'
,p_value=>'lower( :P9999_USERNAME )'
);
wwv_flow_imp_shared.create_invokeapi_comp_param(
 p_id=>wwv_flow_imp.id(20804680912037167)
,p_page_process_id=>wwv_flow_imp.id(20803711907037165)
,p_page_id=>9999
,p_name=>'p_consent'
,p_direction=>'IN'
,p_data_type=>'BOOLEAN'
,p_has_default=>false
,p_display_sequence=>2
,p_value_type=>'ITEM'
,p_value=>'P9999_REMEMBER'
);
wwv_flow_imp_page.create_page_process(
 p_id=>wwv_flow_imp.id(20801731463037158)
,p_process_sequence=>20
,p_process_point=>'AFTER_SUBMIT'
,p_process_type=>'NATIVE_INVOKE_API'
,p_process_name=>'Login'
,p_attribute_01=>'PLSQL_PACKAGE'
,p_attribute_03=>'APEX_AUTHENTICATION'
,p_attribute_04=>'LOGIN'
,p_error_display_location=>'INLINE_IN_NOTIFICATION'
,p_internal_uid=>9030811951863953
);
wwv_flow_imp_shared.create_invokeapi_comp_param(
 p_id=>wwv_flow_imp.id(20802292206037161)
,p_page_process_id=>wwv_flow_imp.id(20801731463037158)
,p_page_id=>9999
,p_name=>'p_username'
,p_direction=>'IN'
,p_data_type=>'VARCHAR2'
,p_has_default=>false
,p_display_sequence=>1
,p_value_type=>'ITEM'
,p_value=>'P9999_USERNAME'
);
wwv_flow_imp_shared.create_invokeapi_comp_param(
 p_id=>wwv_flow_imp.id(20802774470037163)
,p_page_process_id=>wwv_flow_imp.id(20801731463037158)
,p_page_id=>9999
,p_name=>'p_password'
,p_direction=>'IN'
,p_data_type=>'VARCHAR2'
,p_has_default=>false
,p_display_sequence=>2
,p_value_type=>'ITEM'
,p_value=>'P9999_PASSWORD'
);
wwv_flow_imp_shared.create_invokeapi_comp_param(
 p_id=>wwv_flow_imp.id(20803263074037164)
,p_page_process_id=>wwv_flow_imp.id(20801731463037158)
,p_page_id=>9999
,p_name=>'p_set_persistent_auth'
,p_direction=>'IN'
,p_data_type=>'BOOLEAN'
,p_has_default=>true
,p_display_sequence=>3
,p_value_type=>'API_DEFAULT'
);
wwv_flow_imp_page.create_page_process(
 p_id=>wwv_flow_imp.id(20805618941037169)
,p_process_sequence=>30
,p_process_point=>'AFTER_SUBMIT'
,p_process_type=>'NATIVE_SESSION_STATE'
,p_process_name=>'Clear Page(s) Cache'
,p_attribute_01=>'CLEAR_CACHE_CURRENT_PAGE'
,p_error_display_location=>'INLINE_IN_NOTIFICATION'
,p_internal_uid=>9034699429863964
);
wwv_flow_imp_page.create_page_process(
 p_id=>wwv_flow_imp.id(20805215913037168)
,p_process_sequence=>10
,p_process_point=>'BEFORE_HEADER'
,p_process_type=>'NATIVE_PLSQL'
,p_process_name=>'Get Username Cookie'
,p_process_sql_clob=>wwv_flow_string.join(wwv_flow_t_varchar2(
':P9999_USERNAME := apex_authentication.get_login_username_cookie;',
':P9999_REMEMBER := case when :P9999_USERNAME is not null then ''Y'' end;'))
,p_process_clob_language=>'PLSQL'
,p_internal_uid=>9034296401863963
);
end;
/
prompt --application/deployment/definition
begin
wwv_flow_imp_shared.create_install(
 p_id=>wwv_flow_imp.id(20866007560419587)
,p_required_free_kb=>100
,p_required_sys_privs=>'CREATE PROCEDURE:CREATE TABLE:CREATE TRIGGER:CREATE VIEW'
);
end;
/
prompt --application/deployment/install/install_xslt_packages_for_mini_sql_page
begin
wwv_flow_imp_shared.create_install_script(
 p_id=>wwv_flow_imp.id(21160090219186029)
,p_install_id=>wwv_flow_imp.id(20866007560419587)
,p_name=>'XSLT Packages for Mini SQL Page'
,p_sequence=>20
,p_script_type=>'INSTALL'
,p_script_clob=>wwv_flow_string.join(wwv_flow_t_varchar2(
'create or replace PACKAGE "EBA_DEMO_XSLT" is',
'    function validate_sql_statement( p_sql clob) return varchar2;',
'    function html_for_sql( p_sql clob ) return clob;',
'end;',
'/',
'create or replace PACKAGE "EBA_DEMO_XSLT_STYLESHEETS" is',
'   c_rowset_to_table constant xmltype := xmltype(q''[',
'        <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">',
'          <xsl:template match="/">',
'              <xsl:apply-templates/>',
'          </xsl:template>',
'          <xsl:template match="ROWSET">',
'            <table class="sql-results" cellspacing="0">',
'              <!-- Apply templates in "ColumnHeader" mode to just *first* ROW child -->',
'              <thead><xsl:apply-templates select="ROW[1]/*" mode="ColumnHeaders"/></thead>',
'              <!-- Then apply templates to all child nodes normally -->',
'              <tbody><xsl:apply-templates/></tbody>',
'            </table>',
'          </xsl:template>',
'          <xsl:template match="ROW">',
'            <tr><xsl:apply-templates/></tr>',
'          </xsl:template>',
'          <!-- Match any element child of a ROW -->',
'          <xsl:template match="ROW/*">',
'            <td><xsl:apply-templates/></td>',
'          </xsl:template>',
'          <!-- Match any element child of a ROW when in "ColumnHeaders" Mode-->',
'          <xsl:template match="ROW/*" mode="ColumnHeaders">',
'            <th>',
'              <!-- Put the value of the *name* of the current element -->',
'              <xsl:value-of select="name(.)"/>',
'            </th>',
'          </xsl:template>',
'        </xsl:stylesheet>     ',
'   ]''); ',
'end;',
'/',
'create or replace PACKAGE BODY "EBA_DEMO_XSLT" is ',
'    function results_div(p_prefix varchar2, p_message varchar2) return varchar2 is',
'    begin',
'        return ''<div class="sql-results"><strong>''||p_prefix||'':</strong> ''||p_message||''</div>'';',
'    end;',
'',
'    function validate_sql_statement( p_sql clob) return varchar2 is',
'        l_cursor number := dbms_sql.open_cursor;',
'        l_first_word varchar2(200);',
'    begin',
'        if p_sql is not null then',
'            l_first_word := substr(regexp_substr ( p_sql, ''[A-z]*'' ),1,200);',
'            if upper(l_first_word) not in (''SELECT'',''WITH'') then',
'                return ''Query must start with SELECT or WITH'';',
'            end if;',
'            execute immediate ''alter session set cursor_sharing=force'';',
'            dbms_sql.parse( l_cursor, p_sql, dbms_sql.native );',
'            execute immediate ''alter session set cursor_sharing=exact'';',
'            dbms_sql.close_cursor( l_cursor );',
'        end if;',
'        return null;',
'    exception',
'        when others then',
'            execute immediate ''alter session set cursor_sharing=exact'';',
'            dbms_sql.close_cursor( l_cursor );',
'            return sqlerrm;',
'    end;',
'',
'    function html_for_sql( p_sql clob ) return clob is',
'        ctx dbms_xmlgen.ctxhandle;',
'        l_html clob;',
'        l_xml_clob clob;',
'        l_validate_result varchar2(4000);',
'        l_xml xmltype;',
'        c_stylesheet xmltype := eba_demo_xslt_stylesheets.c_rowset_to_table;',
'    begin',
'        if p_sql is not null then',
'            l_validate_result := validate_sql_statement(p_sql);',
'            if l_validate_result is null then',
'                ctx := dbms_xmlgen.newcontext(p_sql);',
'                dbms_xmlgen.setnullhandling(ctx, dbms_xmlgen.empty_tag);',
'                l_xml_clob := dbms_xmlgen.getxml(ctx);',
'                dbms_xmlgen.closecontext(ctx);',
'                if l_xml_clob is not null then',
'                    l_xml := xmltype(l_xml_clob);',
'                    select xmlserialize( content xmltransform(l_xml,c_stylesheet) as clob) into l_html from dual;',
'                else',
'                    l_html := results_div(''INFO'',''No rows found'');',
'                end if;',
'            else',
'                l_html := results_div(''ERROR'',l_validate_result);',
'            end if;',
'        end if;',
'        return l_html;',
'    end;',
'end;',
'/',
' '))
);
wwv_flow_imp_shared.create_install_object(
 p_id=>wwv_flow_imp.id(22920748850613029)
,p_script_id=>wwv_flow_imp.id(21160090219186029)
,p_object_owner=>'#OWNER#'
,p_object_type=>'PACKAGE'
,p_object_name=>'EBA_DEMO_XSLT'
);
wwv_flow_imp_shared.create_install_object(
 p_id=>wwv_flow_imp.id(22920867448613042)
,p_script_id=>wwv_flow_imp.id(21160090219186029)
,p_object_owner=>'#OWNER#'
,p_object_type=>'PACKAGE'
,p_object_name=>'EBA_DEMO_XSLT_STYLESHEETS'
);
end;
/
prompt --application/deployment/install/install_json_duality_companion_package
begin
wwv_flow_imp_shared.create_install_script(
 p_id=>wwv_flow_imp.id(22347506596948964)
,p_install_id=>wwv_flow_imp.id(20866007560419587)
,p_name=>'JSON_DUALITY_COMPANION Package'
,p_sequence=>30
,p_script_type=>'INSTALL'
,p_script_clob=>wwv_flow_string.join(wwv_flow_t_varchar2(
'create or replace package json_duality_companion is',
'    c_json_temp_table        constant varchar2(42) := ''JSON_DUALITY_COMPANION_TEMP_TABLE'';',
'',
'    type t_json_table_to_migrate is record (',
'        id              number,',
'        json_table_name varchar2(255),',
'        dualv_name      varchar2(255));',
'',
'    type t_json_tables_to_migrate is table of t_json_table_to_migrate;',
'',
'    function get_table_names_from_ddl(p_ddl clob) ',
'        return apex_t_varchar2;',
'',
'    procedure clear_json_tables_to_migrate;',
'',
'    function json_tables_to_migrate_count',
'    return number;',
'',
'    function add_json_table_to_migrate(',
'        p_json_table_name in varchar2,',
'        p_dualv_name      in varchar2)',
'        return               number;',
'',
'    procedure update_json_table_to_migrate(',
'        p_json_table_to_migrate in t_json_table_to_migrate);',
'',
'    procedure remove_json_table_to_migrate(',
'        p_json_table_to_migrate in t_json_table_to_migrate);',
'',
'    function count_json_tables_to_migrate',
'        return number;',
'',
'    function json_tables_to_migrate',
'        return t_json_tables_to_migrate',
'    pipelined;',
'',
'    function json_duality_migrator_config(',
'        p_use_flex_fields         in boolean  default true,',
'        p_output_format           in varchar2 default ''executable'',',
'        p_updatable_duality_views in boolean  default true)',
'        return           clob;',
'',
'    procedure create_temp_json_collection_for(',
'        p_json_document in clob);',
'',
'    procedure drop_temp_json_collection;',
'',
'    function duality_view_exists(',
'        p_dualv_name in varchar2)',
'        return          boolean;',
'',
'    function existing_duality_views_to_migrate',
'        return varchar2;',
'',
'    function is_valid_json(',
'        p_json_document in clob)',
'        return             boolean;',
'',
'    procedure insert_doc_into_duality_view(',
'        p_json_document in clob,',
'        p_dualv_name    in varchar2);',
'',
'    procedure drop_duality_view(',
'        p_dualv_name in varchar2,',
'        p_drop_related_tables in boolean default false);',
'',
'    procedure drop_tables_from_ddl(',
'        p_ddl clob);',
'',
'    procedure drop_duality_views_to_migrate(',
'         p_drop_related_tables in boolean default false);',
'',
'    procedure import_duality_views_to_migrate;',
'',
'    function diagram_text_for_dualv(',
'        p_dualv_name in varchar2)',
'        return          clob;     ',
'        ',
'end json_duality_companion;',
'/',
'create or replace package body json_duality_companion is',
'',
'    c_json_tables_to_migrate  constant varchar2(50) := ''JSON_DUALITY_COMPANION.JSON_TABLES_TO_MIGRATE'';',
'    c_newline                 constant varchar2(2)  := chr(13)||chr(10);',
'    c_mermaid_erd             constant varchar2(9)  := ''erDiagram'';',
'    c_one_to_many             constant varchar2(8)  := '' ||--|{ '';',
'    c_open_curly_brace        constant varchar2(2)  := '' {'';',
'    c_closed_curly_brace      constant varchar2(1)  := ''}'';',
'    c_empty_relationship_name constant varchar2(2)  :=  ''""'';',
'    c_colon_separator         constant varchar2(3)  :=  '' : '';',
'    c_spaces                  constant varchar2(2)  := ''  '';',
'    ',
'    cursor q_json_tables_to_migrate is',
'        select seq_id as id,',
'               c001   as json_table_name,',
'               c002   as dualv_name',
'          from apex_collections',
'         where collection_name = c_json_tables_to_migrate',
'         order by seq_id;',
'',
'    cursor q_count_json_tables_to_migrate is',
'        select count(*) as num_tables',
'          from apex_collections',
'         where collection_name = c_json_tables_to_migrate',
'         order by seq_id;',
'',
'    function get_table_names_from_ddl(p_ddl clob) ',
'        return apex_t_varchar2',
'    is',
'        l_tables apex_t_varchar2 := apex_t_varchar2();',
'        l_idx    pls_integer;',
'    begin',
'        for j in (select column_value as line from apex_string.split(p_ddl,chr(10))) loop',
'            if j.line like ''EXECUTE IMMEDIATE ''''CREATE TABLE %('' then',
'                l_idx := instr(j.line, ''CREATE TABLE '') + length(''CREATE TABLE '');',
'                j.line := substr(j.line, l_idx);',
'                l_idx := instr(j.line, ''('') - 1;',
'                apex_string.push(l_tables,trim(substr(j.line, 1, l_idx)));',
'            end if;',
'        end loop; ',
'    return l_tables;',
'    end get_table_names_from_ddl;',
'',
'    -- Concatentate a varchar2 to a clob as fast as possible.',
'    -- Quicker than only a dbms_lob.append',
'    -- Thank you to Mathieu Meeuwissen for the suggested approach',
'    procedure vc_append(p_clob in out nocopy clob,',
'                        p_vc   in out nocopy varchar2,',
'                        p_text               varchar2)',
'      is',
'      begin',
'        p_vc := p_vc || p_text;',
'      exception',
'        when value_error',
'        then',
'          if p_clob is null',
'          then',
'            p_clob := p_vc;',
'          else',
'            dbms_lob.append(p_clob,p_vc);',
'          end if;',
'          p_vc := p_text;',
'      end vc_append;',
'',
'    -- Format table title for Mermaid JS ER diagram',
'    function format_title(',
'                p_table_name       in varchar2) ',
'                return                varchar2',
'    is',
'      l_table_name varchar2(200) := p_table_name;',
'    begin',
'        return ''"''||l_table_name||''"'';',
'    end format_title;',
'',
'    function count_json_tables_to_migrate',
'    return number',
'    is',
'    begin',
'        for j in q_count_json_tables_to_migrate loop',
'            return j.num_tables;',
'        end loop;',
'    end;',
'',
'    function json_tables_to_migrate',
'    return t_json_tables_to_migrate',
'    pipelined is',
'    begin',
'        for j in q_json_tables_to_migrate loop',
'            pipe row(t_json_table_to_migrate(',
'                        j.id,',
'                        j.json_table_name,',
'                        j.dualv_name));',
'        end loop;',
'    end;',
'',
'    function json_tables_to_migrate_count',
'    return number',
'    is',
'    begin',
'        return apex_collection.collection_member_count(c_json_tables_to_migrate);',
'    end json_tables_to_migrate_count;',
'',
'    procedure clear_json_tables_to_migrate',
'    is',
'    begin',
'        apex_collection.create_or_truncate_collection(c_json_tables_to_migrate);',
'    end clear_json_tables_to_migrate;',
'',
'    function add_json_table_to_migrate(',
'        p_json_table_name in varchar2,',
'        p_dualv_name      in varchar2)',
'        return               number',
'    is',
'    begin',
'        if not apex_collection.collection_exists(c_json_tables_to_migrate) then',
'            clear_json_tables_to_migrate;',
'        end if;',
'        return apex_collection.add_member(',
'                p_collection_name => c_json_tables_to_migrate,',
'                p_c001            => p_json_table_name,',
'                p_c002            => p_dualv_name);',
'    end add_json_table_to_migrate;',
'',
'    procedure update_json_table_to_migrate(',
'        p_json_table_to_migrate t_json_table_to_migrate)',
'    is',
'    begin',
'        apex_collection.update_member(',
'            p_collection_name => c_json_tables_to_migrate,',
'            p_seq             => p_json_table_to_migrate.id,',
'            p_c001            => p_json_table_to_migrate.json_table_name,',
'            p_c002            => p_json_table_to_migrate.dualv_name);',
'    end update_json_table_to_migrate;',
'',
'    procedure remove_json_table_to_migrate(',
'        p_json_table_to_migrate t_json_table_to_migrate)',
'    is',
'    begin',
'        apex_collection.delete_member(',
'            p_collection_name => c_json_tables_to_migrate,',
'            p_seq             => p_json_table_to_migrate.id);',
'    end remove_json_table_to_migrate;',
'',
'    function json_duality_migrator_config(',
'        p_use_flex_fields         in boolean  default true,',
'        p_output_format           in varchar2 default ''executable'',',
'        p_updatable_duality_views in boolean  default true)',
'        return           clob',
'    is',
'        l_ret         clob;',
'        l_config      json_object_t := json_object_t();',
'',
'        function json_table_names_array',
'        return json_array_t',
'        is',
'            l_ret json_array_t := json_array_t();',
'        begin',
'            for j in q_json_tables_to_migrate loop',
'                l_ret.append(j.json_table_name);',
'            end loop;',
'            return l_ret;',
'        end json_table_names_array;',
'',
'        function dualv_names_array',
'        return json_array_t',
'        is',
'            l_ret json_array_t := json_array_t();',
'        begin',
'            for j in q_json_tables_to_migrate loop',
'                l_ret.append(j.dualv_name);',
'            end loop;',
'            return l_ret;',
'        end dualv_names_array;',
'    begin',
'        l_config.put(''tableNames'',json_table_names_array());',
'        l_config.put(''viewNames'',dualv_names_array());',
'        if not p_use_flex_fields then ',
'            l_config.put(''useFlexFields'',p_use_flex_fields);',
'        end if;',
'        if not p_updatable_duality_views then ',
'            l_config.put(''updatability'',p_updatable_duality_views);',
'        end if;',
'        if p_output_format != ''executable'' then',
'            l_config.put(''outputFormat'',p_output_format);',
'        end if;',
'        l_ret := l_config.to_clob;',
'        select json_serialize(l_ret returning clob pretty)',
'          into l_ret;',
'        return l_ret;',
'    end json_duality_migrator_config;',
'',
'    procedure create_temp_json_collection_for(',
'        p_json_document in clob)',
'    is',
'        pragma autonomous_transaction;',
'        l_json json := json(p_json_document extended);',
'    begin',
'        execute immediate apex_string.format(''drop table if exists %s'',c_json_temp_table);',
'        execute immediate apex_string.format(''create json collection table %s'',c_json_temp_table);',
'        execute immediate apex_string.format(''insert into %s(data) values (:data)'',c_json_temp_table)',
'        using l_json;',
'        commit;',
'    end create_temp_json_collection_for;',
'',
'    procedure drop_temp_json_collection',
'    is',
'        pragma autonomous_transaction;',
'    begin',
'        execute immediate apex_string.format(''drop table if exists %s'',c_json_temp_table);',
'        commit;',
'    end drop_temp_json_collection;',
'',
'    function is_valid_json(',
'        p_json_document in clob)',
'        return             boolean',
'    is',
'        l_json json;',
'    begin',
'        l_json := json(p_json_document extended);',
'        return true;',
'    exception',
'        when others then',
'            return false;',
'    end is_valid_json;',
'',
'    procedure insert_doc_into_duality_view(',
'        p_json_document in clob,',
'        p_dualv_name    in varchar2)',
'    is',
'    begin',
'        execute immediate apex_string.format(''insert into %s(data) values(:data)'',p_dualv_name)',
'        using p_json_document;',
'    end insert_doc_into_duality_view;',
'',
'    procedure drop_duality_view(',
'        p_dualv_name in varchar2,',
'        p_drop_related_tables in boolean default false)',
'    is',
'        pragma autonomous_transaction;',
'        l_tables_to_drop apex_t_varchar2 := apex_t_varchar2();',
'    begin',
'        if p_drop_related_tables then',
'            for j in (select referenced_name as table_to_drop',
'                        from user_dependencies',
'                       where name = p_dualv_name',
'                         and type = ''VIEW'' ',
'                         and referenced_type = ''TABLE''',
'                         and referenced_name not like ''BIN$%'') loop',
'                ',
'                apex_string.push(l_tables_to_drop,j.table_to_drop);',
'            end loop;',
'            apex_debug.info(''Will drop %s tables related to duality view %s'',l_tables_to_drop.count,p_dualv_name);',
'        end if;',
'        execute immediate apex_string.format(''drop view if exists %s'',p_dualv_name);',
'        apex_debug.info(''Dropped duality view %s'',p_dualv_name);',
'        for j in 1..l_tables_to_drop.count loop',
'            execute immediate apex_string.format(''drop table if exists %s cascade constraints'',l_tables_to_drop(j));',
'            apex_debug.info(''Dropped dependent table %s for duality view %s'',l_tables_to_drop(j),p_dualv_name);',
'        end loop;',
'        commit;',
'    end drop_duality_view;',
'    ',
'    procedure drop_duality_views_to_migrate(',
'         p_drop_related_tables in boolean default false)',
'    is',
'    begin ',
'        for j in q_json_tables_to_migrate loop',
'            drop_duality_view(j.dualv_name,p_drop_related_tables);',
'        end loop;      ',
'    end drop_duality_views_to_migrate;',
'',
'    -----------------------------------------------------------------------------  ',
'    -- Generate Mermaid JS ER diagram text for all tables related to duality view',
'    ----------------------------------------------------------------------------- ',
'    function diagram_text_for_dualv(',
'    p_dualv_name in varchar2)',
'    return          clob',
'    is',
'        l_ret               clob;',
'        l_ret_vc            varchar2(32767);',
'',
'        procedure p(p_text varchar2) is',
'        begin',
'            vc_append(l_ret,l_ret_vc,p_text || c_newline);',
'        end;',
'',
'        function final_clob return clob is',
'        begin',
'            return l_ret || l_ret_vc;',
'        end;',
'',
'    begin',
'        p(c_mermaid_erd);',
'        -- add top level tables having no foreign key of their own',
'        for t in (select ut.table_name as lone_table_name',
'                    from user_tables ut',
'                   where (ut.table_name in (select referenced_name as table_to_drop',
'                                              from user_dependencies',
'                                             where name = p_dualv_name',
'                                               and type = ''VIEW'' ',
'                                               and referenced_type = ''TABLE''))',
'                   minus',
'                  select distinct table_name from user_constraints uc',
'                   where uc.constraint_type = ''R''',
'                     and (uc.table_name in (select referenced_name as table_to_drop',
'                                              from user_dependencies',
'                                             where name = p_dualv_name',
'                                               and type = ''VIEW'' ',
'                                               and referenced_type = ''TABLE''))) loop',
'            p(format_title(t.lone_table_name));',
'        end loop;',
'        -- add tables that include a foreign key',
'        for t in (select fk.table_name as many_table, pk.table_name as one_table',
'                    from user_constraints fk',
'                    left outer join user_constraints pk on pk.constraint_name = fk.r_constraint_name',
'                    where fk.constraint_type = ''R''',
'                    and (fk.table_name in (select referenced_name as table_to_drop',
'                                              from user_dependencies',
'                                             where name = p_dualv_name',
'                                               and type = ''VIEW'' ',
'                                               and referenced_type = ''TABLE''))',
'                    and (pk.table_name in (select referenced_name as table_to_drop',
'                                              from user_dependencies',
'                                             where name = p_dualv_name',
'                                               and type = ''VIEW'' ',
'                                               and referenced_type = ''TABLE''))) loop',
'            p(format_title(t.one_table)',
'                || c_one_to_many',
'                || format_title(t.many_table)',
'                || c_colon_separator',
'                || c_empty_relationship_name);',
'        end loop;',
'        -- If we''re including columns, then generate the table descriptions',
'        -- to accompany the relationships above.',
'        for t in (select table_name',
'                   from user_tables',
'                   where (table_name in (select referenced_name as table_to_drop',
'                                              from user_dependencies',
'                                             where name = p_dualv_name',
'                                               and type = ''VIEW'' ',
'                                               and referenced_type = ''TABLE''))) loop',
'            p(format_title(t.table_name)||c_open_curly_brace);',
'            for col in (select c.column_name,',
'                     case when to_char(c.data_length) is not null and (c.data_type = ''NUMBER'')',
'                          then ''number'' || case when c.data_precision is not null then ''_''||to_char(c.data_precision) || ''_'' || nvl(c.data_scale,0) end',
'                          when c.data_type in (''BLOB'',''CLOB'',''DATE'')',
'                          then lower(c.data_type)',
'                          when c.data_type in (''VARCHAR2'',''VARCHAR'')',
'                          then ''varchar2_'' || c.char_length',
'                          when c.data_type like ''TIMESTAMP%''',
'                          then case',
'                                  when c.data_type like ''TIMESTAMP%WITH LOCAL TIME ZONE''',
'                                  then ''timestamp_ltz''',
'                                  when c.data_type like ''TIMESTAMP%WITH TIME ZONE''',
'                                  then ''timestamp_tz''',
'                                  else ''timestamp''                                  ',
'                               end',
'                          when to_char(c.data_length) is not null and c.data_type not in (''JSON'',''BOOLEAN'') ',
'                          then lower(c.data_type) ||''_''|| to_char(c.data_length)',
'                          else lower(c.data_type)',
'                     end as quicksql_data_type                ',
'                       from user_tab_columns c',
'                       where table_name = t.table_name',
'                       order by column_id) loop',
'                       p(c_spaces||replace(col.column_name,''$'',''_'')||c_spaces||col.quicksql_data_type);',
'            end loop;',
'            p(c_closed_curly_brace);',
'        end loop;',
'        return final_clob;',
'    end diagram_text_for_dualv;',
'    ',
'    function duality_view_exists(',
'        p_dualv_name in varchar2)',
'        return          boolean',
'    is',
'    begin',
'        for j in (select view_name',
'                    from user_json_duality_views',
'                   where view_name = p_dualv_name) loop',
'            return true;',
'        end loop;',
'        return false;',
'    end duality_view_exists;',
'',
'    function existing_duality_views_to_migrate',
'        return varchar2',
'    is',
'        l_list apex_t_varchar2;',
'    begin',
'        for j in q_json_tables_to_migrate loop',
'            if duality_view_exists(j.dualv_name) then',
'                apex_string.push(l_list,j.dualv_name);',
'            end if;',
'        end loop;',
'        return apex_string.join(l_list,'', '');',
'    end existing_duality_views_to_migrate;',
'',
'    procedure import_duality_views_to_migrate',
'    is',
'    begin',
'        for j in q_json_tables_to_migrate loop',
'            dbms_json_duality.import(',
'                table_name   => j.json_table_name,',
'                view_name    => j.dualv_name,',
'                err_log_name => j.dualv_name||''_ERR_LOG'');',
'        end loop;',
'    end import_duality_views_to_migrate;',
'',
'    procedure drop_tables_from_ddl(',
'        p_ddl clob)',
'    is',
'    begin',
'        for j in (select column_value as table_name from get_table_names_from_ddl(p_ddl)) loop',
'            execute immediate apex_string.format(''drop table if exists %s cascade constraints'', j.table_name);',
'        end loop;',
'    end drop_tables_from_ddl;',
'  ',
'end json_duality_companion;',
'/'))
);
wwv_flow_imp_shared.create_install_object(
 p_id=>wwv_flow_imp.id(22347686474948967)
,p_script_id=>wwv_flow_imp.id(22347506596948964)
,p_object_owner=>'#OWNER#'
,p_object_type=>'PACKAGE'
,p_object_name=>'JSON_DUALITY_COMPANION'
);
end;
/
prompt --application/deployment/checks
begin
wwv_flow_imp_shared.create_install_check(
 p_id=>wwv_flow_imp.id(23022616073658168)
,p_install_id=>wwv_flow_imp.id(20866007560419587)
,p_name=>'Requires 23ai Version 23.4'
,p_sequence=>10
,p_check_type=>'FUNCTION_BODY'
,p_check_condition=>wwv_flow_string.join(wwv_flow_t_varchar2(
'declare',
'    l_version_string constant varchar2(8) := ''Version''||chr(32);',
'    l_oracle_string  constant varchar2(6) := ''Oracle'';',
'    l_major_version           varchar2(100);',
'    l_minor_version           number;',
'    l_patch_version           number;',
'begin',
'    select to_number(regexp_substr(substr(banner_full, instr(banner_full, l_version_string) + length(l_version_string)), ''([0-9]+)\.([0-9]+)'', 1, 1, null, 1)),',
'           to_number(regexp_substr(substr(banner_full, instr(banner_full, l_version_string) + length(l_version_string)), ''([0-9]+)\.([0-9]+)'', 1, 1, null, 2)),',
'           to_number(regexp_substr(substr(banner_full, instr(banner_full, l_version_string) + length(l_version_string)), ''([0-9]+)\.([0-9]+)'', 1, 1, null, 3))',
'    into l_major_version, l_minor_version, l_patch_version',
'    from v$version',
'    where banner like l_oracle_string||''%'';',
'',
'    return l_major_version > 23 or (l_major_version = 23 and l_minor_version >= 4);',
'end;'))
,p_check_condition2=>'PLSQL'
,p_failure_message=>'This application requires Oracle 23ai version 23.4 or later.'
);
wwv_flow_imp_shared.create_install_check(
 p_id=>wwv_flow_imp.id(15062246934131963)
,p_install_id=>wwv_flow_imp.id(20866007560419587)
,p_name=>'Requires CREATE TABLE privilege'
,p_sequence=>20
,p_check_type=>'EXISTS'
,p_check_condition=>wwv_flow_string.join(wwv_flow_t_varchar2(
'select privilege',
'from session_privs',
'where privilege = ''CREATE TABLE'''))
,p_failure_message=>'Parsing Schema requires the CREATE TABLE privilege to use this application'
);
wwv_flow_imp_shared.create_install_check(
 p_id=>wwv_flow_imp.id(15062366350137748)
,p_install_id=>wwv_flow_imp.id(20866007560419587)
,p_name=>'Requires CREATE VIEW privilege'
,p_sequence=>30
,p_check_type=>'EXISTS'
,p_check_condition=>wwv_flow_string.join(wwv_flow_t_varchar2(
'select privilege',
'from session_privs',
'where privilege = ''CREATE VIEW'''))
,p_failure_message=>'Parsing schema requires the CREATE VIEW privilege to use this application'
);
end;
/
prompt --application/deployment/buildoptions
begin
null;
end;
/
prompt --application/end_environment
begin
wwv_flow_imp.import_end(p_auto_install_sup_obj => nvl(wwv_flow_application_install.get_auto_install_sup_obj, false)
);
commit;
end;
/
set verify on feedback on define on
prompt  ...done
