All files / output zcl_abapgit_gui_page_db.clas.mjs

6.38% Statements 39/611
66.66% Branches 2/3
6.25% Functions 1/16
6.38% Lines 39/611

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 6111x 1x 1x                             1x     1x 1x     1x 1x 1x     1x 1x 1x     1x 1x   1x     1x 1x   1x     1x 1x   1x     1x 1x                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x
const {zcl_abapgit_gui_component} = await import("./zcl_abapgit_gui_component.clas.mjs");
const {cx_root} = await import("./cx_root.clas.mjs");
// zcl_abapgit_gui_page_db.clas.abap
class zcl_abapgit_gui_page_db extends zcl_abapgit_gui_component {
  static INTERNAL_TYPE = 'CLAS';
  static INTERNAL_NAME = 'ZCL_ABAPGIT_GUI_PAGE_DB';
  static IMPLEMENTED_INTERFACES = ["ZIF_ABAPGIT_GUI_EVENT_HANDLER","ZIF_ABAPGIT_GUI_RENDERABLE","ZIF_ABAPGIT_GUI_MENU_PROVIDER","ZIF_ABAPGIT_HTML_TABLE"];
  static ATTRIBUTES = {"MT_METHODS": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Structure({
  "class": new abap.types.Character(30, {"qualifiedName":"SEOCLSNAME","ddicName":"SEOCLSNAME","description":"SEOCLSNAME"}),
  "description": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_BACKGROUND=>TY_METHOD-DESCRIPTION"})}, "zcl_abapgit_background=>ty_method", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"SORTED","isUnique":true,"keyFields":["CLASS"]},"secondary":[]}, "zcl_abapgit_background=>ty_methods");}, "visibility": "I", "is_constant": " ", "is_class": " "},
  "C_ACTION": {"type": () => {return new abap.types.Structure({
  "delete": new abap.types.String({qualifiedName: "STRING"}),
  "backup": new abap.types.String({qualifiedName: "STRING"}),
  "restore": new abap.types.String({qualifiedName: "STRING"})}, undefined, undefined, {}, {});}, "visibility": "I", "is_constant": "X", "is_class": "X"},
  "C_CSS_URL": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "visibility": "I", "is_constant": "X", "is_class": "X"},
  "C_TOC_FILENAME": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "visibility": "I", "is_constant": "X", "is_class": "X"}};
  static METHODS = {"REGISTER_STYLESHEET": {"visibility": "I", "parameters": {}},
  "RENDER_STATS": {"visibility": "I", "parameters": {"RI_HTML": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_HTML", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_HTML"});}, "is_optional": " "}, "IT_DB_ENTRIES": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Structure({
  "type": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_type"}),
  "value": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_value"}),
  "data_str": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_PERSISTENCE=>TY_CONTENT-DATA_STR"})}, "zif_abapgit_persistence=>ty_content", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"SORTED","isUnique":true,"keyFields":["TYPE","VALUE"]},"secondary":[]}, "zif_abapgit_persistence=>ty_contents");}, "is_optional": " "}}},
  "RENDER_TABLE": {"visibility": "I", "parameters": {"RI_HTML": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_HTML", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_HTML"});}, "is_optional": " "}, "IT_DB_ENTRIES": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Structure({
  "type": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_type"}),
  "value": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_value"}),
  "data_str": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_PERSISTENCE=>TY_CONTENT-DATA_STR"})}, "zif_abapgit_persistence=>ty_content", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"SORTED","isUnique":true,"keyFields":["TYPE","VALUE"]},"secondary":[]}, "zif_abapgit_persistence=>ty_contents");}, "is_optional": " "}}},
  "DO_BACKUP_DB": {"visibility": "I", "parameters": {}},
  "DO_DELETE_ENTRY": {"visibility": "I", "parameters": {"IS_KEY": {"type": () => {return new abap.types.Structure({
  "type": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_type"}),
  "value": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_value"}),
  "data_str": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_PERSISTENCE=>TY_CONTENT-DATA_STR"})}, "zif_abapgit_persistence=>ty_content", undefined, {}, {});}, "is_optional": " "}}},
  "DO_RESTORE_DB": {"visibility": "I", "parameters": {}},
  "EXPLAIN_CONTENT": {"visibility": "I", "parameters": {"RV_TEXT": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "IS_DATA": {"type": () => {return new abap.types.Structure({
  "type": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_type"}),
  "value": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_value"}),
  "data_str": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_PERSISTENCE=>TY_CONTENT-DATA_STR"})}, "zif_abapgit_persistence=>ty_content", undefined, {}, {});}, "is_optional": " "}}},
  "EXPLAIN_CONTENT_REPO": {"visibility": "I", "parameters": {"RS_EXPL": {"type": () => {return new abap.types.Structure({
  "value": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_GUI_PAGE_DB=>TY_EXPLANATION-VALUE"}),
  "extra": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_GUI_PAGE_DB=>TY_EXPLANATION-EXTRA"})}, "zcl_abapgit_gui_page_db=>ty_explanation", undefined, {}, {});}, "is_optional": " "}, "IS_DATA": {"type": () => {return new abap.types.Structure({
  "type": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_type"}),
  "value": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_value"}),
  "data_str": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_PERSISTENCE=>TY_CONTENT-DATA_STR"})}, "zif_abapgit_persistence=>ty_content", undefined, {}, {});}, "is_optional": " "}}},
  "EXPLAIN_CONTENT_REPO_CS": {"visibility": "I", "parameters": {"RS_EXPL": {"type": () => {return new abap.types.Structure({
  "value": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_GUI_PAGE_DB=>TY_EXPLANATION-VALUE"}),
  "extra": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_GUI_PAGE_DB=>TY_EXPLANATION-EXTRA"})}, "zcl_abapgit_gui_page_db=>ty_explanation", undefined, {}, {});}, "is_optional": " "}, "IS_DATA": {"type": () => {return new abap.types.Structure({
  "type": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_type"}),
  "value": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_value"}),
  "data_str": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_PERSISTENCE=>TY_CONTENT-DATA_STR"})}, "zif_abapgit_persistence=>ty_content", undefined, {}, {});}, "is_optional": " "}}},
  "EXPLAIN_CONTENT_BACKGROUND": {"visibility": "I", "parameters": {"RS_EXPL": {"type": () => {return new abap.types.Structure({
  "value": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_GUI_PAGE_DB=>TY_EXPLANATION-VALUE"}),
  "extra": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_GUI_PAGE_DB=>TY_EXPLANATION-EXTRA"})}, "zcl_abapgit_gui_page_db=>ty_explanation", undefined, {}, {});}, "is_optional": " "}, "IS_DATA": {"type": () => {return new abap.types.Structure({
  "type": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_type"}),
  "value": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_value"}),
  "data_str": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_PERSISTENCE=>TY_CONTENT-DATA_STR"})}, "zif_abapgit_persistence=>ty_content", undefined, {}, {});}, "is_optional": " "}}},
  "CREATE": {"visibility": "U", "parameters": {"RI_PAGE": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_GUI_RENDERABLE", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_GUI_RENDERABLE"});}, "is_optional": " "}}},
  "CONSTRUCTOR": {"visibility": "U", "parameters": {}}};
  #mt_methods;
  constructor() {
    const sup = super();
    this.me = new abap.types.ABAPObject();
    this.me.set(this);
    this.INTERNAL_ID = abap.internalIdCounter++;
    this.FRIENDS_ACCESS_INSTANCE = {
      "SUPER": sup.FRIENDS_ACCESS_INSTANCE,
      "register_stylesheet": this.#register_stylesheet.bind(this),
      "render_stats": this.#render_stats.bind(this),
      "render_table": this.#render_table.bind(this),
      "do_backup_db": this.#do_backup_db.bind(this),
      "explain_content": this.#explain_content.bind(this),
      "explain_content_repo": this.#explain_content_repo.bind(this),
      "explain_content_repo_cs": this.#explain_content_repo_cs.bind(this),
      "explain_content_background": this.#explain_content_background.bind(this),
    };
    this.#mt_methods = abap.types.TableFactory.construct(new abap.types.Structure({
    "class": new abap.types.Character(30, {"qualifiedName":"SEOCLSNAME","ddicName":"SEOCLSNAME","description":"SEOCLSNAME"}),
    "description": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_BACKGROUND=>TY_METHOD-DESCRIPTION"})}, "zcl_abapgit_background=>ty_method", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"SORTED","isUnique":true,"keyFields":["CLASS"]},"secondary":[]}, "zcl_abapgit_background=>ty_methods");
    this.FRIENDS_ACCESS_INSTANCE["mt_methods"] = this.#mt_methods;
    this.c_action = zcl_abapgit_gui_page_db.c_action;
    this.c_css_url = zcl_abapgit_gui_page_db.c_css_url;
    this.c_toc_filename = zcl_abapgit_gui_page_db.c_toc_filename;
  }
  async constructor_(INPUT) {
    await super.constructor_();
    await this.#register_stylesheet();
    return this;
  }
  async create() {
    return zcl_abapgit_gui_page_db.create();
  }
  static async create() {
    let ri_page = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_GUI_RENDERABLE", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_GUI_RENDERABLE"});
    let lo_component = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_GUI_PAGE_DB", RTTIName: "\\CLASS=ZCL_ABAPGIT_GUI_PAGE_DB"});
    lo_component.set(await (new abap.Classes['ZCL_ABAPGIT_GUI_PAGE_DB']()).constructor_());
    ri_page.set((await abap.Classes['ZCL_ABAPGIT_GUI_PAGE_HOC'].create({iv_page_title: abap.CharacterFactory.get(16, 'Database Utility'), iv_extra_css_url: zcl_abapgit_gui_page_db.c_css_url, ii_page_menu_provider: lo_component, ii_child_component: lo_component})));
    return ri_page;
  }
  async #do_backup_db() {
    let lt_data = abap.types.TableFactory.construct(new abap.types.Structure({
    "type": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_type"}),
    "value": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_value"}),
    "data_str": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_PERSISTENCE=>TY_CONTENT-DATA_STR"})}, "zif_abapgit_persistence=>ty_content", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"SORTED","isUnique":true,"keyFields":["TYPE","VALUE"]},"secondary":[]}, "zif_abapgit_persistence=>ty_contents");
    let lv_text = new abap.types.String({qualifiedName: "STRING"});
    let lt_toc = abap.types.TableFactory.construct(new abap.types.String({qualifiedName: "STRING"}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"isUnique":false,"type":"STANDARD","keyFields":[],"name":"primary_key"},"secondary":[]}, "STRING_TABLE");
    let lo_zip = new abap.types.ABAPObject({qualifiedName: "CL_ABAP_ZIP", RTTIName: "\\CLASS=CL_ABAP_ZIP"});
    let lv_zip = new abap.types.XString({qualifiedName: "XSTRING"});
    let lv_path = new abap.types.String({qualifiedName: "STRING"});
    let lv_filename = new abap.types.String({qualifiedName: "STRING"});
    let li_fe_serv = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_FRONTEND_SERVICES", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_FRONTEND_SERVICES"});
    let fs_ls_data_ = new abap.types.FieldSymbol(new abap.types.Structure({
    "type": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_type"}),
    "value": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_value"}),
    "data_str": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_PERSISTENCE=>TY_CONTENT-DATA_STR"})}, "zif_abapgit_persistence=>ty_content", undefined, {}, {}));
    lt_data.set((await (await abap.Classes['ZCL_ABAPGIT_PERSISTENCE_DB'].get_instance()).get().list()));
    lv_text.set(new abap.types.String().set(`Table of Content\n`));
    abap.statements.insertInternal({data: lv_text, table: lt_toc});
    lv_text.set(new abap.types.String().set(`================\n`));
    abap.statements.insertInternal({data: lv_text, table: lt_toc});
    lv_text.set(new abap.types.String().set(`\n`));
    abap.statements.insertInternal({data: lv_text, table: lt_toc});
    lo_zip.set(await (new abap.Classes['CL_ABAP_ZIP']()).constructor_());
    for await (const unique847 of abap.statements.loop(lt_data)) {
      fs_ls_data_.assign(unique847);
      if (abap.compare.eq(fs_ls_data_.get().type, abap.Classes['ZCL_ABAPGIT_PERSISTENCE_DB'].c_type_repo_csum)) {
        abap.statements.concatenate({source: [fs_ls_data_.get().type, abap.CharacterFactory.get(1, '_'), fs_ls_data_.get().value, abap.CharacterFactory.get(4, '.txt')], target: lv_filename});
      } else {
        abap.statements.concatenate({source: [fs_ls_data_.get().type, abap.CharacterFactory.get(1, '_'), fs_ls_data_.get().value, abap.CharacterFactory.get(4, '.xml')], target: lv_filename});
      }
      await lo_zip.get().add({name: lv_filename, content: (await abap.Classes['ZCL_ABAPGIT_CONVERT'].string_to_xstring_utf8({iv_string: fs_ls_data_.get().data_str}))});
      lv_text.set((await this.#explain_content({is_data: fs_ls_data_})));
      abap.statements.replace({target: lv_text, all: false, with: abap.CharacterFactory.get(1, ''), of: abap.CharacterFactory.get(8, '<strong>')});
      abap.statements.replace({target: lv_text, all: false, with: abap.CharacterFactory.get(1, ''), of: abap.CharacterFactory.get(9, '</strong>')});
      lv_text.set(new abap.types.String().set(`${abap.templateFormatting(fs_ls_data_.get().type)},${abap.templateFormatting(fs_ls_data_.get().value)},${abap.templateFormatting(lv_text)}\n`));
      abap.statements.insertInternal({data: lv_text, table: lt_toc});
    }
    await lo_zip.get().add({name: zcl_abapgit_gui_page_db.c_toc_filename, content: (await abap.Classes['ZCL_ABAPGIT_CONVERT'].string_to_xstring_utf8({iv_string: abap.builtin.concat_lines_of({table: lt_toc})}))});
    lv_zip.set((await lo_zip.get().save()));
    abap.statements.concatenate({source: [abap.CharacterFactory.get(15, 'abapGit_Backup_'), abap.builtin.sy.get().datlo, abap.CharacterFactory.get(1, '_'), abap.builtin.sy.get().timlo, abap.CharacterFactory.get(4, '.zip')], target: lv_filename});
    li_fe_serv.set((await abap.Classes['ZCL_ABAPGIT_UI_FACTORY'].get_frontend_services()));
    lv_path.set((await li_fe_serv.get().zif_abapgit_frontend_services$show_file_save_dialog({iv_title: abap.CharacterFactory.get(14, 'abapGit Backup'), iv_extension: abap.CharacterFactory.get(3, 'zip'), iv_default_filename: lv_filename})));
    await li_fe_serv.get().zif_abapgit_frontend_services$file_download({iv_path: lv_path, iv_xstr: lv_zip});
    await abap.statements.message({text: abap.CharacterFactory.get(33, 'abapGit Backup successfully saved'), type: abap.CharacterFactory.get(1, 'S')});
  }
  async do_delete_entry(INPUT) {
    return zcl_abapgit_gui_page_db.do_delete_entry(INPUT);
  }
  static async do_delete_entry(INPUT) {
    let is_key = INPUT?.is_key;
    if (is_key?.getQualifiedName === undefined || is_key.getQualifiedName() !== "ZIF_ABAPGIT_PERSISTENCE=>TY_CONTENT") { is_key = undefined; }
    if (is_key === undefined) { is_key = new abap.types.Structure({
    "type": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_type"}),
    "value": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_value"}),
    "data_str": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_PERSISTENCE=>TY_CONTENT-DATA_STR"})}, "zif_abapgit_persistence=>ty_content", undefined, {}, {}).set(INPUT.is_key); }
    let lv_answer = new abap.types.Character(1, {});
    abap.statements.assert(abap.compare.initial(is_key.get().type) === false);
    lv_answer.set((await (await abap.Classes['ZCL_ABAPGIT_UI_FACTORY'].get_popups()).get().zif_abapgit_popups$popup_to_confirm({iv_titlebar: abap.CharacterFactory.get(7, 'Warning'), iv_text_question: new abap.types.String().set(`Are you sure you want to delete entry ${abap.templateFormatting(is_key.get().type)} ${abap.templateFormatting(is_key.get().value)}?`), iv_text_button_1: abap.CharacterFactory.get(3, 'Yes'), iv_icon_button_1: abap.CharacterFactory.get(11, 'ICON_DELETE'), iv_text_button_2: abap.CharacterFactory.get(2, 'No'), iv_icon_button_2: abap.CharacterFactory.get(11, 'ICON_CANCEL'), iv_default_button: abap.CharacterFactory.get(1, '2'), iv_display_cancel_button: abap.builtin.abap_false})));
    if (abap.compare.eq(lv_answer, abap.CharacterFactory.get(1, '2'))) {
      const unique848 = await (new abap.Classes['ZCX_ABAPGIT_CANCEL']()).constructor_();
      unique848.EXTRA_CX = {"INTERNAL_FILENAME": "zcl_abapgit_gui_page_db.clas.abap","INTERNAL_LINE": 217};
      throw unique848;
    }
    await (await abap.Classes['ZCL_ABAPGIT_PERSISTENCE_DB'].get_instance()).get().delete({iv_type: is_key.get().type, iv_value: is_key.get().value});
    if (abap.compare.eq(is_key.get().type, abap.Classes['ZCL_ABAPGIT_PERSISTENCE_DB'].c_type_repo)) {
      await (await abap.Classes['ZCL_ABAPGIT_PERSISTENCE_DB'].get_instance()).get().delete({iv_type: abap.Classes['ZCL_ABAPGIT_PERSISTENCE_DB'].c_type_repo_csum, iv_value: is_key.get().value});
      await (await abap.Classes['ZCL_ABAPGIT_REPO_SRV'].get_instance()).get().zif_abapgit_repo_srv$init();
    }
    abap.statements.commit();
  }
  async do_restore_db() {
    return zcl_abapgit_gui_page_db.do_restore_db();
  }
  static async do_restore_db() {
    let lv_answer = new abap.types.Character(1, {});
    let lo_zip = new abap.types.ABAPObject({qualifiedName: "CL_ABAP_ZIP", RTTIName: "\\CLASS=CL_ABAP_ZIP"});
    let lv_zip = new abap.types.XString({qualifiedName: "XSTRING"});
    let lv_path = new abap.types.String({qualifiedName: "STRING"});
    let lv_filename = new abap.types.String({qualifiedName: "STRING"});
    let lv_data = new abap.types.XString({qualifiedName: "XSTRING"});
    let ls_data = new abap.types.Structure({
    "type": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_type"}),
    "value": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_value"}),
    "data_str": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_PERSISTENCE=>TY_CONTENT-DATA_STR"})}, "zif_abapgit_persistence=>ty_content", undefined, {}, {});
    let lt_data = abap.types.TableFactory.construct(new abap.types.Structure({
    "type": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_type"}),
    "value": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_value"}),
    "data_str": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_PERSISTENCE=>TY_CONTENT-DATA_STR"})}, "zif_abapgit_persistence=>ty_content", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"SORTED","isUnique":true,"keyFields":["TYPE","VALUE"]},"secondary":[]}, "zif_abapgit_persistence=>ty_contents");
    let lt_data_old = abap.types.TableFactory.construct(new abap.types.Structure({
    "type": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_type"}),
    "value": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_value"}),
    "data_str": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_PERSISTENCE=>TY_CONTENT-DATA_STR"})}, "zif_abapgit_persistence=>ty_content", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"SORTED","isUnique":true,"keyFields":["TYPE","VALUE"]},"secondary":[]}, "zif_abapgit_persistence=>ty_contents");
    let li_fe_serv = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_FRONTEND_SERVICES", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_FRONTEND_SERVICES"});
    let fs_ls_zipfile_ = new abap.types.FieldSymbol(new abap.types.Structure({
    "name": new abap.types.String({qualifiedName: "CL_ABAP_ZIP=>T_FILE-NAME"}),
    "size": new abap.types.Integer({qualifiedName: "CL_ABAP_ZIP=>T_FILE-SIZE"})}, "cl_abap_zip=>t_file", undefined, {}, {}));
    li_fe_serv.set((await abap.Classes['ZCL_ABAPGIT_UI_FACTORY'].get_frontend_services()));
    lv_path.set((await li_fe_serv.get().zif_abapgit_frontend_services$show_file_open_dialog({iv_title: abap.CharacterFactory.get(22, 'Restore abapGit Backup'), iv_extension: abap.CharacterFactory.get(3, 'zip'), iv_default_filename: abap.CharacterFactory.get(20, 'abapGit_Backup_*.zip')})));
    lv_zip.set((await li_fe_serv.get().zif_abapgit_frontend_services$file_upload({iv_path: lv_path})));
    lo_zip.set(await (new abap.Classes['CL_ABAP_ZIP']()).constructor_());
    try {
      await lo_zip.get().load({zip: lv_zip});
      abap.builtin.sy.get().subrc.set(0);
    } catch (e) {
      if (e.classic) {
          switch (e.classic.toUpperCase()) {
          case "ZIP_PARSE_ERROR": abap.builtin.sy.get().subrc.set(1); break;
          default: abap.builtin.sy.get().subrc.set(2); break;
            }
        } else {
            throw e;
        }
      }
      if (abap.compare.ne(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) {
        await abap.Classes['ZCX_ABAPGIT_EXCEPTION'].raise({iv_text: abap.CharacterFactory.get(22, 'Error loading ZIP file')});
      }
      for await (const unique849 of abap.statements.loop(lo_zip.get().files,{where: async (I) => {return abap.compare.ne(I.name, zcl_abapgit_gui_page_db.c_toc_filename);}})) {
        fs_ls_zipfile_.assign(unique849);
        ls_data.clear();
        lv_filename.set(fs_ls_zipfile_.get().name);
        abap.statements.replace({target: lv_filename, all: false, with: abap.CharacterFactory.get(1, ''), of: abap.CharacterFactory.get(4, '.xml')});
        abap.statements.replace({target: lv_filename, all: false, with: abap.CharacterFactory.get(1, ''), of: abap.CharacterFactory.get(4, '.txt')});
        if (abap.compare.cp(lv_filename, abap.CharacterFactory.get(8, 'REPO_CS*'))) {
          ls_data.get().type.set(lv_filename.getOffset({length: 7}));
          ls_data.get().value.set(lv_filename.getOffset({offset: 8}));
        } else {
          abap.statements.split({source: lv_filename, at: abap.CharacterFactory.get(1, '_'), targets: [ls_data.get().type,ls_data.get().value]});
        }
        try {
          await abap.Classes['ZCL_ABAPGIT_PERSISTENCE_DB'].validate_entry_type({iv_type: ls_data.get().type});
        } catch (e) {
          if ((abap.Classes['ZCX_ABAPGIT_EXCEPTION'] && e instanceof abap.Classes['ZCX_ABAPGIT_EXCEPTION'])) {
            await abap.Classes['ZCX_ABAPGIT_EXCEPTION'].raise({iv_text: new abap.types.String().set(`Invalid DB entry type. This is not an abapGit Backup`)});
          } else {
            throw e;
          }
        }
        try {
          await lo_zip.get().get({name: fs_ls_zipfile_.get().name, content: lv_data});
          abap.builtin.sy.get().subrc.set(0);
        } catch (e) {
          if (e.classic) {
              switch (e.classic.toUpperCase()) {
              case "ZIP_INDEX_ERROR": abap.builtin.sy.get().subrc.set(1); break;
              case "ZIP_DECOMPRESSION_ERROR": abap.builtin.sy.get().subrc.set(2); break;
              default: abap.builtin.sy.get().subrc.set(3); break;
                }
            } else {
                throw e;
            }
          }
          if (abap.compare.ne(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) {
            await abap.Classes['ZCX_ABAPGIT_EXCEPTION'].raise({iv_text: new abap.types.String().set(`Error getting file ${abap.templateFormatting(fs_ls_zipfile_.get().name)} from ZIP`)});
          }
          ls_data.get().data_str.set((await abap.Classes['ZCL_ABAPGIT_CONVERT'].xstring_to_string_utf8({iv_data: lv_data})));
          abap.statements.insertInternal({data: ls_data, table: lt_data});
        }
        lv_answer.set((await (await abap.Classes['ZCL_ABAPGIT_UI_FACTORY'].get_popups()).get().zif_abapgit_popups$popup_to_confirm({iv_titlebar: abap.CharacterFactory.get(7, 'Warning'), iv_text_question: abap.CharacterFactory.get(81, 'All existing repositories and settings will be deleted and overwritten! Continue?'), iv_text_button_1: abap.CharacterFactory.get(7, 'Restore'), iv_icon_button_1: abap.CharacterFactory.get(11, 'ICON_IMPORT'), iv_text_button_2: abap.CharacterFactory.get(6, 'Cancel'), iv_icon_button_2: abap.CharacterFactory.get(11, 'ICON_CANCEL'), iv_default_button: abap.CharacterFactory.get(1, '2'), iv_display_cancel_button: abap.builtin.abap_false})));
        if (abap.compare.ne(lv_answer, abap.CharacterFactory.get(1, '1'))) {
          const unique850 = await (new abap.Classes['ZCX_ABAPGIT_CANCEL']()).constructor_();
          unique850.EXTRA_CX = {"INTERNAL_FILENAME": "zcl_abapgit_gui_page_db.clas.abap","INTERNAL_LINE": 328};
          throw unique850;
        }
        lt_data_old.set((await (await abap.Classes['ZCL_ABAPGIT_PERSISTENCE_DB'].get_instance()).get().list()));
        for await (const unique851 of abap.statements.loop(lt_data_old)) {
          ls_data.set(unique851);
          await (await abap.Classes['ZCL_ABAPGIT_PERSISTENCE_DB'].get_instance()).get().delete({iv_type: ls_data.get().type, iv_value: ls_data.get().value});
        }
        abap.statements.commit();
        for await (const unique852 of abap.statements.loop(lt_data)) {
          ls_data.set(unique852);
          await (await abap.Classes['ZCL_ABAPGIT_PERSISTENCE_DB'].get_instance()).get().add({iv_type: ls_data.get().type, iv_value: ls_data.get().value, iv_data: ls_data.get().data_str});
        }
        abap.statements.commit();
        await abap.statements.message({text: abap.CharacterFactory.get(36, 'abapGit Backup successfully restored'), type: abap.CharacterFactory.get(1, 'S')});
      }
      async #explain_content(INPUT) {
        let rv_text = new abap.types.String({qualifiedName: "STRING"});
        let is_data = INPUT?.is_data;
        if (is_data?.getQualifiedName === undefined || is_data.getQualifiedName() !== "ZIF_ABAPGIT_PERSISTENCE=>TY_CONTENT") { is_data = undefined; }
        if (is_data === undefined) { is_data = new abap.types.Structure({
        "type": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_type"}),
        "value": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_value"}),
        "data_str": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_PERSISTENCE=>TY_CONTENT-DATA_STR"})}, "zif_abapgit_persistence=>ty_content", undefined, {}, {}).set(INPUT.is_data); }
        let lv_descr = new abap.types.String({qualifiedName: "STRING"});
        let ls_explanation = new abap.types.Structure({
        "value": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_GUI_PAGE_DB=>TY_EXPLANATION-VALUE"}),
        "extra": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_GUI_PAGE_DB=>TY_EXPLANATION-EXTRA"})}, "zcl_abapgit_gui_page_db=>ty_explanation", undefined, {}, {});
        let unique853 = is_data.get().type;
        if (abap.compare.eq(unique853, abap.Classes['ZCL_ABAPGIT_PERSISTENCE_DB'].c_type_repo)) {
          lv_descr.set(abap.CharacterFactory.get(13, 'Repo Settings'));
          ls_explanation.set((await this.#explain_content_repo({is_data: is_data})));
        } else if (abap.compare.eq(unique853, abap.Classes['ZCL_ABAPGIT_PERSISTENCE_DB'].c_type_background)) {
          lv_descr.set(abap.CharacterFactory.get(19, 'Background Settings'));
          ls_explanation.set((await this.#explain_content_background({is_data: is_data})));
        } else if (abap.compare.eq(unique853, abap.Classes['ZCL_ABAPGIT_PERSISTENCE_DB'].c_type_user)) {
          lv_descr.set(abap.CharacterFactory.get(17, 'Personal Settings'));
          ls_explanation.get().value.set((await (await abap.Classes['ZCL_ABAPGIT_ENV_FACTORY'].get_user_record()).get().zif_abapgit_user_record$get_name({iv_username: is_data.get().value})));
        } else if (abap.compare.eq(unique853, abap.Classes['ZCL_ABAPGIT_PERSISTENCE_DB'].c_type_settings)) {
          lv_descr.set(abap.CharacterFactory.get(15, 'Global Settings'));
        } else if (abap.compare.eq(unique853, abap.Classes['ZCL_ABAPGIT_PERSISTENCE_DB'].c_type_packages)) {
          lv_descr.set(abap.CharacterFactory.get(21, 'Local Package Details'));
        } else if (abap.compare.eq(unique853, abap.Classes['ZCL_ABAPGIT_PERSISTENCE_DB'].c_type_repo_csum)) {
          lv_descr.set(abap.CharacterFactory.get(14, 'Repo Checksums'));
          ls_explanation.set((await this.#explain_content_repo_cs({is_data: is_data})));
        } else {
          if (abap.compare.ge(abap.builtin.strlen({val: is_data.get().data_str}), new abap.types.Integer().set(250))) {
            ls_explanation.get().value.set(is_data.get().data_str.getOffset({length: 250}));
          } else {
            ls_explanation.get().value.set(is_data.get().data_str);
          }
          ls_explanation.get().value.set(abap.builtin.escape({val: ls_explanation.get().value, format: abap.Classes['CL_ABAP_FORMAT'].e_html_attr}));
          ls_explanation.get().value.set(new abap.types.String().set(`<pre>${abap.templateFormatting(ls_explanation.get().value)}</pre>`));
        }
        if (abap.compare.initial(ls_explanation.get().value) === false) {
          lv_descr.set(new abap.types.String().set(`${abap.templateFormatting(lv_descr)}: `));
        }
        if (abap.compare.initial(ls_explanation.get().extra) === false) {
          ls_explanation.get().extra.set(new abap.types.String().set(` (${abap.templateFormatting(ls_explanation.get().extra)})`));
        }
        rv_text.set(new abap.types.String().set(`${abap.templateFormatting(lv_descr)}<strong>${abap.templateFormatting(ls_explanation.get().value)}</strong>${abap.templateFormatting(ls_explanation.get().extra)}`));
        if (abap.compare.ge(abap.builtin.strlen({val: rv_text}), new abap.types.Integer().set(250))) {
          rv_text.set(abap.operators.concat(rv_text.getOffset({length: 250}),abap.CharacterFactory.get(3, '...')));
        }
        return rv_text;
      }
      async #explain_content_background(INPUT) {
        let rs_expl = new abap.types.Structure({
        "value": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_GUI_PAGE_DB=>TY_EXPLANATION-VALUE"}),
        "extra": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_GUI_PAGE_DB=>TY_EXPLANATION-EXTRA"})}, "zcl_abapgit_gui_page_db=>ty_explanation", undefined, {}, {});
        let is_data = INPUT?.is_data;
        if (is_data?.getQualifiedName === undefined || is_data.getQualifiedName() !== "ZIF_ABAPGIT_PERSISTENCE=>TY_CONTENT") { is_data = undefined; }
        if (is_data === undefined) { is_data = new abap.types.Structure({
        "type": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_type"}),
        "value": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_value"}),
        "data_str": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_PERSISTENCE=>TY_CONTENT-DATA_STR"})}, "zif_abapgit_persistence=>ty_content", undefined, {}, {}).set(INPUT.is_data); }
        let ls_result = new abap.types.Structure({
        "line": new abap.types.Integer({qualifiedName: "I"}),
        "offset": new abap.types.Integer({qualifiedName: "I"}),
        "length": new abap.types.Integer({qualifiedName: "I"}),
        "submatches": abap.types.TableFactory.construct(new abap.types.Structure({
        "offset": new abap.types.Integer({qualifiedName: "I"}),
        "length": new abap.types.Integer({qualifiedName: "I"})}, "SUBMATCH_RESULT", "SUBMATCH_RESULT", {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"isUnique":false,"type":"STANDARD","keyFields":[],"name":"primary_key"},"secondary":[]}, "SUBMATCH_RESULT_TAB")}, "MATCH_RESULT", "MATCH_RESULT", {}, {});
        let ls_match = new abap.types.Structure({
        "offset": new abap.types.Integer({qualifiedName: "I"}),
        "length": new abap.types.Integer({qualifiedName: "I"})}, "SUBMATCH_RESULT", "SUBMATCH_RESULT", {}, {});
        let lv_class = new abap.types.String({qualifiedName: "STRING"});
        let ls_method = new abap.types.Structure({
        "class": new abap.types.Character(30, {"qualifiedName":"SEOCLSNAME","ddicName":"SEOCLSNAME","description":"SEOCLSNAME"}),
        "description": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_BACKGROUND=>TY_METHOD-DESCRIPTION"})}, "zcl_abapgit_background=>ty_method", undefined, {}, {});
        rs_expl.get().value.set(new abap.types.String().set(`${abap.templateFormatting((await (await (await abap.Classes['ZCL_ABAPGIT_REPO_SRV'].get_instance()).get().zif_abapgit_repo_srv$get({iv_key: is_data.get().value})).get().zif_abapgit_repo$get_name()))}`));
        abap.statements.find(is_data.get().data_str, {regex: abap.CharacterFactory.get(21, '<METHOD>(.*)</METHOD>'), first: true, ignoringCase: true, results: ls_result});
        abap.statements.readTable(ls_result.get().submatches,{index: abap.IntegerFactory.get(1),
          into: ls_match});
        if (abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) {
          lv_class.set(is_data.get().data_str.getOffset({offset: ls_match.get().offset, length: ls_match.get().length}));
        }
        if (abap.compare.initial(this.#mt_methods)) {
          this.#mt_methods.set((await abap.Classes['ZCL_ABAPGIT_BACKGROUND'].list_methods()));
        }
        abap.statements.readTable(this.#mt_methods,{withTableKey: true,
          into: ls_method,
          withKey: (i) => {return abap.compare.eq(i.class, lv_class);},
          withKeyValue: [{key: (i) => {return i.class}, value: lv_class}],
          usesTableLine: false,
          withKeySimple: {"class": lv_class}});
        if (abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) {
          rs_expl.get().extra.set(ls_method.get().description);
        } else {
          rs_expl.get().extra.set(lv_class);
        }
        return rs_expl;
      }
      async #explain_content_repo(INPUT) {
        let rs_expl = new abap.types.Structure({
        "value": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_GUI_PAGE_DB=>TY_EXPLANATION-VALUE"}),
        "extra": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_GUI_PAGE_DB=>TY_EXPLANATION-EXTRA"})}, "zcl_abapgit_gui_page_db=>ty_explanation", undefined, {}, {});
        let is_data = INPUT?.is_data;
        if (is_data?.getQualifiedName === undefined || is_data.getQualifiedName() !== "ZIF_ABAPGIT_PERSISTENCE=>TY_CONTENT") { is_data = undefined; }
        if (is_data === undefined) { is_data = new abap.types.Structure({
        "type": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_type"}),
        "value": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_value"}),
        "data_str": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_PERSISTENCE=>TY_CONTENT-DATA_STR"})}, "zif_abapgit_persistence=>ty_content", undefined, {}, {}).set(INPUT.is_data); }
        let ls_result = new abap.types.Structure({
        "line": new abap.types.Integer({qualifiedName: "I"}),
        "offset": new abap.types.Integer({qualifiedName: "I"}),
        "length": new abap.types.Integer({qualifiedName: "I"}),
        "submatches": abap.types.TableFactory.construct(new abap.types.Structure({
        "offset": new abap.types.Integer({qualifiedName: "I"}),
        "length": new abap.types.Integer({qualifiedName: "I"})}, "SUBMATCH_RESULT", "SUBMATCH_RESULT", {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"isUnique":false,"type":"STANDARD","keyFields":[],"name":"primary_key"},"secondary":[]}, "SUBMATCH_RESULT_TAB")}, "MATCH_RESULT", "MATCH_RESULT", {}, {});
        let ls_match = new abap.types.Structure({
        "offset": new abap.types.Integer({qualifiedName: "I"}),
        "length": new abap.types.Integer({qualifiedName: "I"})}, "SUBMATCH_RESULT", "SUBMATCH_RESULT", {}, {});
        let lv_cnt = new abap.types.Integer({qualifiedName: "I"});
        abap.statements.find(is_data.get().data_str, {regex: abap.CharacterFactory.get(10, '<OFFLINE/>'), first: true, ignoringCase: true, count: lv_cnt});
        if (abap.compare.gt(lv_cnt, abap.IntegerFactory.get(0))) {
          rs_expl.get().extra.set(abap.CharacterFactory.get(6, 'Online'));
        } else {
          rs_expl.get().extra.set(abap.CharacterFactory.get(7, 'Offline'));
        }
        abap.statements.find(is_data.get().data_str, {regex: abap.CharacterFactory.get(33, '<DISPLAY_NAME>(.*)</DISPLAY_NAME>'), first: true, ignoringCase: true, results: ls_result});
        abap.statements.readTable(ls_result.get().submatches,{index: abap.IntegerFactory.get(1),
          into: ls_match});
        if (abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) {
          rs_expl.get().value.set(is_data.get().data_str.getOffset({offset: ls_match.get().offset, length: ls_match.get().length}));
        } else {
          abap.statements.find(is_data.get().data_str, {regex: abap.CharacterFactory.get(17, '<NAME>(.*)</NAME>'), first: true, ignoringCase: true, results: ls_result});
          abap.statements.readTable(ls_result.get().submatches,{index: abap.IntegerFactory.get(1),
            into: ls_match});
          if (abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) {
            rs_expl.get().value.set(is_data.get().data_str.getOffset({offset: ls_match.get().offset, length: ls_match.get().length}));
          }
        }
        if (abap.compare.initial(rs_expl.get().value)) {
          abap.statements.find(is_data.get().data_str, {regex: abap.CharacterFactory.get(15, '<URL>(.*)</URL>'), first: true, ignoringCase: true, results: ls_result});
          abap.statements.readTable(ls_result.get().submatches,{index: abap.IntegerFactory.get(1),
            into: ls_match});
          if (abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) {
            rs_expl.get().value.set(is_data.get().data_str.getOffset({offset: ls_match.get().offset, length: ls_match.get().length}));
            if (abap.compare.gt(lv_cnt, abap.IntegerFactory.get(0))) {
              rs_expl.get().value.set((await abap.Classes['ZCL_ABAPGIT_URL'].name({iv_url: rs_expl.get().value})));
            }
          }
        }
        return rs_expl;
      }
      async #explain_content_repo_cs(INPUT) {
        let rs_expl = new abap.types.Structure({
        "value": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_GUI_PAGE_DB=>TY_EXPLANATION-VALUE"}),
        "extra": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_GUI_PAGE_DB=>TY_EXPLANATION-EXTRA"})}, "zcl_abapgit_gui_page_db=>ty_explanation", undefined, {}, {});
        let is_data = INPUT?.is_data;
        if (is_data?.getQualifiedName === undefined || is_data.getQualifiedName() !== "ZIF_ABAPGIT_PERSISTENCE=>TY_CONTENT") { is_data = undefined; }
        if (is_data === undefined) { is_data = new abap.types.Structure({
        "type": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_type"}),
        "value": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_value"}),
        "data_str": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_PERSISTENCE=>TY_CONTENT-DATA_STR"})}, "zif_abapgit_persistence=>ty_content", undefined, {}, {}).set(INPUT.is_data); }
        let lt_lines = abap.types.TableFactory.construct(new abap.types.String({qualifiedName: "STRING"}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"isUnique":false,"type":"STANDARD","keyFields":[],"name":"primary_key"},"secondary":[]}, "STRING_TABLE");
        if (abap.compare.gt(abap.builtin.strlen({val: is_data.get().data_str}), abap.IntegerFactory.get(0))) {
          abap.statements.split({source: is_data.get().data_str, at: abap.Classes['CL_ABAP_CHAR_UTILITIES'].newline, table: lt_lines});
          rs_expl.get().extra.set(new abap.types.String().set(`${abap.templateFormatting(abap.builtin.lines({val: lt_lines}))} lines`));
          abap.statements.readTable(lt_lines,{index: abap.IntegerFactory.get(1),
            into: rs_expl.get().value});
          if (abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) {
            abap.statements.replace({target: rs_expl.get().value, all: false, with: abap.CharacterFactory.get(1, ''), of: abap.CharacterFactory.get(11, '#repo_name#')});
            rs_expl.get().value.set(abap.builtin.escape({val: rs_expl.get().value, format: abap.Classes['CL_ABAP_FORMAT'].e_html_attr}));
          }
        }
        return rs_expl;
      }
      async #register_stylesheet() {
        let lo_buf = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_STRING_BUFFER", RTTIName: "\\CLASS=ZCL_ABAPGIT_STRING_BUFFER"});
        lo_buf.set(await (new abap.Classes['ZCL_ABAPGIT_STRING_BUFFER']()).constructor_());
        await (await this.gui_services()).get().zif_abapgit_gui_services$register_page_asset({iv_url: zcl_abapgit_gui_page_db.c_css_url, iv_type: abap.CharacterFactory.get(8, 'text/css'), iv_mime_name: abap.CharacterFactory.get(20, 'ZABAPGIT_CSS_PAGE_DB'), iv_inline: (await lo_buf.get().join_w_newline_and_flush())});
      }
      async #render_stats(INPUT) {
        let ri_html = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_HTML", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_HTML"});
        let it_db_entries = INPUT?.it_db_entries;
        if (it_db_entries?.getQualifiedName === undefined || it_db_entries.getQualifiedName() !== "ZIF_ABAPGIT_PERSISTENCE=>TY_CONTENTS") { it_db_entries = undefined; }
        if (it_db_entries === undefined) { it_db_entries = abap.types.TableFactory.construct(new abap.types.Structure({
        "type": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_type"}),
        "value": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_value"}),
        "data_str": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_PERSISTENCE=>TY_CONTENT-DATA_STR"})}, "zif_abapgit_persistence=>ty_content", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"SORTED","isUnique":true,"keyFields":["TYPE","VALUE"]},"secondary":[]}, "zif_abapgit_persistence=>ty_contents").set(INPUT.it_db_entries); }
        let lv_cnt = new abap.types.Integer({qualifiedName: "I"});
        let lv_online = new abap.types.Integer({qualifiedName: "I"});
        let lv_offline = new abap.types.Integer({qualifiedName: "I"});
        let lv_users = new abap.types.Integer({qualifiedName: "I"});
        let fs_ls_db_entry_ = new abap.types.FieldSymbol(new abap.types.Structure({
        "type": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_type"}),
        "value": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_value"}),
        "data_str": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_PERSISTENCE=>TY_CONTENT-DATA_STR"})}, "zif_abapgit_persistence=>ty_content", undefined, {}, {}));
        for await (const unique854 of abap.statements.loop(it_db_entries)) {
          fs_ls_db_entry_.assign(unique854);
          if (abap.compare.eq(fs_ls_db_entry_.get().type, abap.Classes['ZCL_ABAPGIT_PERSISTENCE_DB'].c_type_repo)) {
            abap.statements.find(fs_ls_db_entry_.get().data_str, {regex: abap.CharacterFactory.get(10, '<OFFLINE/>'), first: true, ignoringCase: true, count: lv_cnt});
            if (abap.compare.gt(lv_cnt, abap.IntegerFactory.get(0))) {
              lv_online.set(abap.operators.add(lv_online,abap.IntegerFactory.get(1)));
            } else {
              lv_offline.set(abap.operators.add(lv_offline,abap.IntegerFactory.get(1)));
            }
          } else if (abap.compare.eq(fs_ls_db_entry_.get().type, abap.Classes['ZCL_ABAPGIT_PERSISTENCE_DB'].c_type_user)) {
            lv_users.set(abap.operators.add(lv_users,abap.IntegerFactory.get(1)));
          }
        }
        ri_html.set((await abap.Classes['ZCL_ABAPGIT_HTML'].create()));
        await ri_html.get().zif_abapgit_html$add({ig_chunk: new abap.types.String().set(`Repositories: ${abap.templateFormatting(abap.operators.add(lv_online,lv_offline))} (${abap.templateFormatting(lv_online)} online, ${abap.templateFormatting(lv_offline)} offline),`)});
        await ri_html.get().zif_abapgit_html$add({ig_chunk: new abap.types.String().set(`Users: ${abap.templateFormatting(lv_users)}`)});
        return ri_html;
      }
      async #render_table(INPUT) {
        let ri_html = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_HTML", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_HTML"});
        let it_db_entries = INPUT?.it_db_entries;
        if (it_db_entries?.getQualifiedName === undefined || it_db_entries.getQualifiedName() !== "ZIF_ABAPGIT_PERSISTENCE=>TY_CONTENTS") { it_db_entries = undefined; }
        if (it_db_entries === undefined) { it_db_entries = abap.types.TableFactory.construct(new abap.types.Structure({
        "type": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_type"}),
        "value": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_value"}),
        "data_str": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_PERSISTENCE=>TY_CONTENT-DATA_STR"})}, "zif_abapgit_persistence=>ty_content", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"SORTED","isUnique":true,"keyFields":["TYPE","VALUE"]},"secondary":[]}, "zif_abapgit_persistence=>ty_contents").set(INPUT.it_db_entries); }
        ri_html.set((await (await (await (await (await (await abap.Classes['ZCL_ABAPGIT_HTML_TABLE'].create({ii_renderer: this.me})).get().define_column({iv_column_id: abap.CharacterFactory.get(4, 'type'), iv_column_title: abap.CharacterFactory.get(4, 'Type')})).get().define_column({iv_column_id: abap.CharacterFactory.get(5, 'value'), iv_column_title: abap.CharacterFactory.get(3, 'Key')})).get().define_column({iv_column_id: abap.CharacterFactory.get(4, 'expl'), iv_column_title: abap.CharacterFactory.get(4, 'Data')})).get().define_column({iv_column_id: abap.CharacterFactory.get(3, 'cmd')})).get().render({it_data: it_db_entries})));
        return ri_html;
      }
      async zif_abapgit_gui_event_handler$on_event(INPUT) {
        let rs_handled = new abap.types.Structure({
        "page": new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_GUI_RENDERABLE", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_GUI_RENDERABLE"}),
        "state": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_GUI_EVENT_HANDLER=>TY_HANDLING_RESULT-STATE"})}, "zif_abapgit_gui_event_handler=>ty_handling_result", undefined, {}, {});
        let ii_event = INPUT?.ii_event;
        if (ii_event?.getQualifiedName === undefined || ii_event.getQualifiedName() !== "ZIF_ABAPGIT_GUI_EVENT") { ii_event = undefined; }
        if (ii_event === undefined) { ii_event = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_GUI_EVENT", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_GUI_EVENT"}).set(INPUT.ii_event); }
        let ls_db = new abap.types.Structure({
        "type": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_type"}),
        "value": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_value"}),
        "data_str": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_PERSISTENCE=>TY_CONTENT-DATA_STR"})}, "zif_abapgit_persistence=>ty_content", undefined, {}, {});
        let lo_query = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_STRING_MAP", RTTIName: "\\CLASS=ZCL_ABAPGIT_STRING_MAP"});
        lo_query.set((await ii_event.get().zif_abapgit_gui_event$query()));
        let unique855 = ii_event.get().zif_abapgit_gui_event$mv_action;
        if (abap.compare.eq(unique855, zcl_abapgit_gui_page_db.c_action.get().delete)) {
          await lo_query.get().to_abap({cs_container: ls_db});
          await this.do_delete_entry({is_key: ls_db});
          rs_handled.get().state.set(abap.Classes['ZCL_ABAPGIT_GUI'].c_event_state.get().re_render);
        } else if (abap.compare.eq(unique855, zcl_abapgit_gui_page_db.c_action.get().backup)) {
          await this.#do_backup_db();
          rs_handled.get().state.set(abap.Classes['ZCL_ABAPGIT_GUI'].c_event_state.get().re_render);
        } else if (abap.compare.eq(unique855, zcl_abapgit_gui_page_db.c_action.get().restore)) {
          await this.do_restore_db();
          rs_handled.get().state.set(abap.Classes['ZCL_ABAPGIT_GUI'].c_event_state.get().re_render);
        }
        return rs_handled;
      }
      async zif_abapgit_gui_menu_provider$get_menu() {
        let ro_toolbar = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_HTML_TOOLBAR", RTTIName: "\\CLASS=ZCL_ABAPGIT_HTML_TOOLBAR"});
        ro_toolbar.set((await abap.Classes['ZCL_ABAPGIT_HTML_TOOLBAR'].create({iv_id: abap.CharacterFactory.get(24, 'toolbar-database-utility')})));
        await ro_toolbar.get().add({iv_txt: abap.CharacterFactory.get(6, 'Backup'), iv_act: zcl_abapgit_gui_page_db.c_action.get().backup});
        await ro_toolbar.get().add({iv_txt: abap.CharacterFactory.get(7, 'Restore'), iv_act: zcl_abapgit_gui_page_db.c_action.get().restore});
        await ro_toolbar.get().add({iv_txt: abap.CharacterFactory.get(4, 'Back'), iv_act: abap.Classes['ZIF_ABAPGIT_DEFINITIONS'].zif_abapgit_definitions$c_action.get().go_back});
        return ro_toolbar;
      }
      async zif_abapgit_gui_renderable$render() {
        let ri_html = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_HTML", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_HTML"});
        let lt_db_entries = abap.types.TableFactory.construct(new abap.types.Structure({
        "type": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_type"}),
        "value": new abap.types.Character(12, {"qualifiedName":"zif_abapgit_persistence=>ty_value"}),
        "data_str": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_PERSISTENCE=>TY_CONTENT-DATA_STR"})}, "zif_abapgit_persistence=>ty_content", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"SORTED","isUnique":true,"keyFields":["TYPE","VALUE"]},"secondary":[]}, "zif_abapgit_persistence=>ty_contents");
        await this.register_handlers();
        lt_db_entries.set((await (await abap.Classes['ZCL_ABAPGIT_PERSISTENCE_DB'].get_instance()).get().list()));
        ri_html.set((await abap.Classes['ZCL_ABAPGIT_HTML'].create()));
        await ri_html.get().zif_abapgit_html$add({ig_chunk: abap.CharacterFactory.get(21, '<div class="db-list">')});
        await ri_html.get().zif_abapgit_html$add({ig_chunk: (await this.#render_stats({it_db_entries: lt_db_entries}))});
        await ri_html.get().zif_abapgit_html$add({ig_chunk: abap.CharacterFactory.get(6, '</div>')});
        await ri_html.get().zif_abapgit_html$add({ig_chunk: abap.CharacterFactory.get(21, '<div class="db-list">')});
        await ri_html.get().zif_abapgit_html$add({ig_chunk: (await this.#render_table({it_db_entries: lt_db_entries}))});
        await ri_html.get().zif_abapgit_html$add({ig_chunk: abap.CharacterFactory.get(6, '</div>')});
        return ri_html;
      }
      async zif_abapgit_html_table$get_row_attrs(INPUT) {
        let rs_attrs = new abap.types.Structure({
        "css_class": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_HTML_TABLE=>TY_ROW_ATTRS-CSS_CLASS"}),
        "data": new abap.types.Structure({
        "name": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_HTML=>TY_DATA_ATTR-NAME"}),
        "value": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_HTML=>TY_DATA_ATTR-VALUE"})}, "zif_abapgit_html=>ty_data_attr", undefined, {}, {})}, "zif_abapgit_html_table=>ty_row_attrs", undefined, {}, {});
        let iv_table_id = INPUT?.iv_table_id;
        if (iv_table_id?.getQualifiedName === undefined || iv_table_id.getQualifiedName() !== "STRING") { iv_table_id = undefined; }
        if (iv_table_id === undefined) { iv_table_id = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_table_id); }
        let iv_row_index = INPUT?.iv_row_index;
        if (iv_row_index?.getQualifiedName === undefined || iv_row_index.getQualifiedName() !== "I") { iv_row_index = undefined; }
        if (iv_row_index === undefined) { iv_row_index = new abap.types.Integer({qualifiedName: "I"}).set(INPUT.iv_row_index); }
        let is_row = INPUT?.is_row;
        return rs_attrs;
      }
      async zif_abapgit_html_table$render_cell(INPUT) {
        let rs_render = new abap.types.Structure({
        "css_class": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_HTML_TABLE=>TY_CELL_RENDER-CSS_CLASS"}),
        "content": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_HTML_TABLE=>TY_CELL_RENDER-CONTENT"}),
        "html": new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_HTML", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_HTML"})}, "zif_abapgit_html_table=>ty_cell_render", undefined, {}, {});
        let iv_table_id = INPUT?.iv_table_id;
        if (iv_table_id?.getQualifiedName === undefined || iv_table_id.getQualifiedName() !== "STRING") { iv_table_id = undefined; }
        if (iv_table_id === undefined) { iv_table_id = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_table_id); }
        let iv_row_index = INPUT?.iv_row_index;
        if (iv_row_index?.getQualifiedName === undefined || iv_row_index.getQualifiedName() !== "I") { iv_row_index = undefined; }
        if (iv_row_index === undefined) { iv_row_index = new abap.types.Integer({qualifiedName: "I"}).set(INPUT.iv_row_index); }
        let is_row = INPUT?.is_row;
        let iv_column_id = INPUT?.iv_column_id;
        if (iv_column_id?.getQualifiedName === undefined || iv_column_id.getQualifiedName() !== "STRING") { iv_column_id = undefined; }
        if (iv_column_id === undefined) { iv_column_id = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_column_id); }
        let iv_value = INPUT?.iv_value;
        let lv_action = new abap.types.String({qualifiedName: "STRING"});
        let lo_toolbar = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_HTML_TOOLBAR", RTTIName: "\\CLASS=ZCL_ABAPGIT_HTML_TOOLBAR"});
        let unique856 = iv_column_id;
        if (abap.compare.eq(unique856, abap.CharacterFactory.get(4, 'type')) || abap.compare.eq(unique856, abap.CharacterFactory.get(5, 'value'))) {
          rs_render.get().content.set(new abap.types.String().set(`${abap.templateFormatting(iv_value)}`));
        } else if (abap.compare.eq(unique856, abap.CharacterFactory.get(4, 'expl'))) {
          rs_render.get().content.set((await this.#explain_content({is_data: is_row})));
          rs_render.get().css_class.set(abap.CharacterFactory.get(4, 'data'));
        } else if (abap.compare.eq(unique856, abap.CharacterFactory.get(3, 'cmd'))) {
          lv_action.set((await abap.Classes['ZCL_ABAPGIT_HTML_ACTION_UTILS'].dbkey_encode({is_key: is_row})));
          lo_toolbar.set((await (await (await (await abap.Classes['ZCL_ABAPGIT_HTML_TOOLBAR'].create({iv_id: abap.CharacterFactory.get(26, 'actionbar-database-utility')})).get().add({iv_txt: abap.CharacterFactory.get(7, 'Display'), iv_act: new abap.types.String().set(`${abap.templateFormatting(abap.Classes['ZIF_ABAPGIT_DEFINITIONS'].zif_abapgit_definitions$c_action.get().db_display)}?${abap.templateFormatting(lv_action)}`)})).get().add({iv_txt: abap.CharacterFactory.get(4, 'Edit'), iv_act: new abap.types.String().set(`${abap.templateFormatting(abap.Classes['ZIF_ABAPGIT_DEFINITIONS'].zif_abapgit_definitions$c_action.get().db_edit)}?${abap.templateFormatting(lv_action)}`)})).get().add({iv_txt: abap.CharacterFactory.get(6, 'Delete'), iv_act: new abap.types.String().set(`${abap.templateFormatting(zcl_abapgit_gui_page_db.c_action.get().delete)}?${abap.templateFormatting(lv_action)}`)})));
          await (await abap.Classes['ZCL_ABAPGIT_EXIT'].get_instance()).get().zif_abapgit_exit$enhance_any_toolbar({io_menu: lo_toolbar});
          rs_render.get().html.set((await lo_toolbar.get().render()));
        }
        return rs_render;
      }
    }
    abap.Classes['ZCL_ABAPGIT_GUI_PAGE_DB'] = zcl_abapgit_gui_page_db;
    zcl_abapgit_gui_page_db.c_action = new abap.types.Structure({
    "delete": new abap.types.String({qualifiedName: "STRING"}),
    "backup": new abap.types.String({qualifiedName: "STRING"}),
    "restore": new abap.types.String({qualifiedName: "STRING"})}, undefined, undefined, {}, {});
    zcl_abapgit_gui_page_db.c_action.get().delete.set('delete');
    zcl_abapgit_gui_page_db.c_action.get().backup.set('backup');
    zcl_abapgit_gui_page_db.c_action.get().restore.set('restore');
    zcl_abapgit_gui_page_db.c_css_url = new abap.types.String({qualifiedName: "STRING"});
    zcl_abapgit_gui_page_db.c_css_url.set('css/page_db.css');
    zcl_abapgit_gui_page_db.c_toc_filename = new abap.types.String({qualifiedName: "STRING"});
    zcl_abapgit_gui_page_db.c_toc_filename.set('#_Table_of_Content_#.txt');
    zcl_abapgit_gui_page_db.ty_explanation = new abap.types.Structure({
    "value": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_GUI_PAGE_DB=>TY_EXPLANATION-VALUE"}),
    "extra": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_GUI_PAGE_DB=>TY_EXPLANATION-EXTRA"})}, "zcl_abapgit_gui_page_db=>ty_explanation", undefined, {}, {});
export {zcl_abapgit_gui_page_db};