All files / output zcl_abapgit_gui.clas.mjs

6.95% Statements 38/546
66.66% Branches 2/3
3.22% Functions 1/31
6.95% Lines 38/546

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 5461x 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 {cx_root} = await import("./cx_root.clas.mjs");
// zcl_abapgit_gui.clas.abap
class zcl_abapgit_gui {
  static INTERNAL_TYPE = 'CLAS';
  static INTERNAL_NAME = 'ZCL_ABAPGIT_GUI';
  static IMPLEMENTED_INTERFACES = ["ZIF_ABAPGIT_GUI_SERVICES"];
  static ATTRIBUTES = {"MV_ROLLBACK_ON_ERROR": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "visibility": "I", "is_constant": " ", "is_class": " "},
  "MI_CUR_PAGE": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_GUI_RENDERABLE", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_GUI_RENDERABLE"});}, "visibility": "I", "is_constant": " ", "is_class": " "},
  "MT_STACK": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Structure({
  "page": new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_GUI_RENDERABLE", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_GUI_RENDERABLE"}),
  "bookmark": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"})}, "zcl_abapgit_gui=>ty_page_stack", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "");}, "visibility": "I", "is_constant": " ", "is_class": " "},
  "MT_EVENT_HANDLERS": {"type": () => {return abap.types.TableFactory.construct(new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_GUI_EVENT_HANDLER", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_GUI_EVENT_HANDLER"}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "");}, "visibility": "I", "is_constant": " ", "is_class": " "},
  "MI_ROUTER": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_GUI_EVENT_HANDLER", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_GUI_EVENT_HANDLER"});}, "visibility": "I", "is_constant": " ", "is_class": " "},
  "MI_ASSET_MAN": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_GUI_ASSET_MANAGER", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_GUI_ASSET_MANAGER"});}, "visibility": "I", "is_constant": " ", "is_class": " "},
  "MI_HOTKEY_CTL": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_GUI_HOTKEY_CTL", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_GUI_HOTKEY_CTL"});}, "visibility": "I", "is_constant": " ", "is_class": " "},
  "MI_HTML_PROCESSOR": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_GUI_HTML_PROCESSOR", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_GUI_HTML_PROCESSOR"});}, "visibility": "I", "is_constant": " ", "is_class": " "},
  "MI_HTML_VIEWER": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_HTML_VIEWER", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_HTML_VIEWER"});}, "visibility": "I", "is_constant": " ", "is_class": " "},
  "MO_HTML_PARTS": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_HTML_PARTS", RTTIName: "\\CLASS=ZCL_ABAPGIT_HTML_PARTS"});}, "visibility": "I", "is_constant": " ", "is_class": " "},
  "MI_COMMON_LOG": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_LOG", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_LOG"});}, "visibility": "I", "is_constant": " ", "is_class": " "},
  "C_EVENT_STATE": {"type": () => {return new abap.types.Structure({
  "not_handled": new abap.types.Integer({qualifiedName: "I"}),
  "re_render": new abap.types.Integer({qualifiedName: "I"}),
  "new_page": new abap.types.Integer({qualifiedName: "I"}),
  "go_back": new abap.types.Integer({qualifiedName: "I"}),
  "no_more_act": new abap.types.Integer({qualifiedName: "I"}),
  "new_page_w_bookmark": new abap.types.Integer({qualifiedName: "I"}),
  "go_back_to_bookmark": new abap.types.Integer({qualifiedName: "I"}),
  "new_page_replacing": new abap.types.Integer({qualifiedName: "I"})}, undefined, undefined, {}, {});}, "visibility": "U", "is_constant": "X", "is_class": "X"}};
  static METHODS = {"CACHE_HTML": {"visibility": "I", "parameters": {"RV_URL": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "IV_TEXT": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}}},
  "STARTUP": {"visibility": "I", "parameters": {}},
  "RENDER": {"visibility": "I", "parameters": {}},
  "CALL_PAGE": {"visibility": "I", "parameters": {"II_PAGE": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_GUI_RENDERABLE", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_GUI_RENDERABLE"});}, "is_optional": " "}, "IV_WITH_BOOKMARK": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "is_optional": " "}, "IV_REPLACING": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "is_optional": " "}}},
  "HANDLE_ACTION": {"visibility": "I", "parameters": {"IV_ACTION": {"type": () => {return new abap.types.Character();}, "is_optional": " "}, "IV_GETDATA": {"type": () => {return new abap.types.Character();}, "is_optional": " "}, "IT_POSTDATA": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Character(256, {"qualifiedName":"zif_abapgit_html_viewer=>ty_char256"}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zif_abapgit_html_viewer=>ty_post_data");}, "is_optional": " "}}},
  "HANDLE_ERROR": {"visibility": "I", "parameters": {"IV_STATE": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "is_optional": " "}, "IX_EXCEPTION": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZCX_ABAPGIT_EXCEPTION", RTTIName: "\\CLASS=ZCX_ABAPGIT_EXCEPTION"});}, "is_optional": " "}}},
  "IS_PAGE_MODAL": {"visibility": "I", "parameters": {"RV_YES": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "is_optional": " "}, "II_PAGE": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_GUI_RENDERABLE", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_GUI_RENDERABLE"});}, "is_optional": " "}}},
  "IS_NEW_PAGE": {"visibility": "I", "parameters": {"RV_NEW_PAGE": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "is_optional": " "}, "IV_STATE": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "is_optional": " "}}},
  "GO_HOME": {"visibility": "U", "parameters": {"IV_ACTION": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}}},
  "BACK": {"visibility": "U", "parameters": {"RV_EXIT": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "is_optional": " "}, "IV_TO_BOOKMARK": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "is_optional": " "}, "IV_GRACEFUL": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "is_optional": " "}}},
  "BACK_GRACEFUL": {"visibility": "U", "parameters": {"RV_HANDLED": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "is_optional": " "}}},
  "ON_EVENT": {"visibility": "U", "parameters": {"ACTION": {"type": () => {return new abap.types.Character();}, "is_optional": " "}, "FRAME": {"type": () => {return new abap.types.Character();}, "is_optional": " "}, "GETDATA": {"type": () => {return new abap.types.Character();}, "is_optional": " "}, "POSTDATA": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Character(256, {"qualifiedName":"zif_abapgit_html_viewer=>ty_char256"}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zif_abapgit_html_viewer=>ty_post_data");}, "is_optional": " "}, "QUERY_TABLE": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Structure({
  "name": new abap.types.Character(30, {"qualifiedName":"zif_abapgit_html_viewer=>ty_name_value-name"}),
  "value": new abap.types.Character(250, {"qualifiedName":"zif_abapgit_html_viewer=>ty_name_value-value"})}, "zif_abapgit_html_viewer=>ty_name_value", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zif_abapgit_html_viewer=>ty_query_table");}, "is_optional": " "}}},
  "CONSTRUCTOR": {"visibility": "U", "parameters": {"IO_COMPONENT": {"type": () => {return new abap.types.ABAPObject({qualifiedName: undefined, RTTIName: undefined});}, "is_optional": " "}, "II_ASSET_MAN": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_GUI_ASSET_MANAGER", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_GUI_ASSET_MANAGER"});}, "is_optional": " "}, "II_HOTKEY_CTL": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_GUI_HOTKEY_CTL", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_GUI_HOTKEY_CTL"});}, "is_optional": " "}, "II_HTML_PROCESSOR": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_GUI_HTML_PROCESSOR", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_GUI_HTML_PROCESSOR"});}, "is_optional": " "}, "IV_ROLLBACK_ON_ERROR": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "is_optional": " "}}},
  "FREE": {"visibility": "U", "parameters": {}},
  "SET_FOCUS": {"visibility": "U", "parameters": {}}};
  #mv_rollback_on_error;
  #mi_cur_page;
  #mt_stack;
  #mt_event_handlers;
  #mi_router;
  #mi_asset_man;
  #mi_hotkey_ctl;
  #mi_html_processor;
  #mi_html_viewer;
  #mo_html_parts;
  #mi_common_log;
  constructor() {
    this.me = new abap.types.ABAPObject();
    this.me.set(this);
    this.INTERNAL_ID = abap.internalIdCounter++;
    this.FRIENDS_ACCESS_INSTANCE = {
      "cache_html": this.#cache_html.bind(this),
      "startup": this.#startup.bind(this),
      "render": this.#render.bind(this),
      "call_page": this.#call_page.bind(this),
      "handle_action": this.#handle_action.bind(this),
      "handle_error": this.#handle_error.bind(this),
      "is_page_modal": this.#is_page_modal.bind(this),
      "is_new_page": this.#is_new_page.bind(this),
      "go_home": this.go_home.bind(this),
      "back": this.back.bind(this),
      "back_graceful": this.back_graceful.bind(this),
      "on_event": this.on_event.bind(this),
      "free": this.free.bind(this),
      "set_focus": this.set_focus.bind(this),
    };
    this.#mv_rollback_on_error = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});
    this.FRIENDS_ACCESS_INSTANCE["mv_rollback_on_error"] = this.#mv_rollback_on_error;
    this.#mi_cur_page = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_GUI_RENDERABLE", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_GUI_RENDERABLE"});
    this.FRIENDS_ACCESS_INSTANCE["mi_cur_page"] = this.#mi_cur_page;
    this.#mt_stack = abap.types.TableFactory.construct(new abap.types.Structure({
    "page": new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_GUI_RENDERABLE", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_GUI_RENDERABLE"}),
    "bookmark": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"})}, "zcl_abapgit_gui=>ty_page_stack", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "");
    this.FRIENDS_ACCESS_INSTANCE["mt_stack"] = this.#mt_stack;
    this.#mt_event_handlers = abap.types.TableFactory.construct(new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_GUI_EVENT_HANDLER", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_GUI_EVENT_HANDLER"}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "");
    this.FRIENDS_ACCESS_INSTANCE["mt_event_handlers"] = this.#mt_event_handlers;
    this.#mi_router = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_GUI_EVENT_HANDLER", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_GUI_EVENT_HANDLER"});
    this.FRIENDS_ACCESS_INSTANCE["mi_router"] = this.#mi_router;
    this.#mi_asset_man = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_GUI_ASSET_MANAGER", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_GUI_ASSET_MANAGER"});
    this.FRIENDS_ACCESS_INSTANCE["mi_asset_man"] = this.#mi_asset_man;
    this.#mi_hotkey_ctl = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_GUI_HOTKEY_CTL", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_GUI_HOTKEY_CTL"});
    this.FRIENDS_ACCESS_INSTANCE["mi_hotkey_ctl"] = this.#mi_hotkey_ctl;
    this.#mi_html_processor = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_GUI_HTML_PROCESSOR", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_GUI_HTML_PROCESSOR"});
    this.FRIENDS_ACCESS_INSTANCE["mi_html_processor"] = this.#mi_html_processor;
    this.#mi_html_viewer = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_HTML_VIEWER", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_HTML_VIEWER"});
    this.FRIENDS_ACCESS_INSTANCE["mi_html_viewer"] = this.#mi_html_viewer;
    this.#mo_html_parts = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_HTML_PARTS", RTTIName: "\\CLASS=ZCL_ABAPGIT_HTML_PARTS"});
    this.FRIENDS_ACCESS_INSTANCE["mo_html_parts"] = this.#mo_html_parts;
    this.#mi_common_log = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_LOG", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_LOG"});
    this.FRIENDS_ACCESS_INSTANCE["mi_common_log"] = this.#mi_common_log;
    this.c_event_state = zcl_abapgit_gui.c_event_state;
  }
  async back(INPUT) {
    let rv_exit = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});
    let iv_to_bookmark = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});
    if (INPUT && INPUT.iv_to_bookmark) {iv_to_bookmark.set(INPUT.iv_to_bookmark);}
    if (INPUT === undefined || INPUT.iv_to_bookmark === undefined) {iv_to_bookmark = abap.builtin.abap_false;}
    let iv_graceful = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});
    if (INPUT && INPUT.iv_graceful) {iv_graceful.set(INPUT.iv_graceful);}
    if (INPUT === undefined || INPUT.iv_graceful === undefined) {iv_graceful = abap.builtin.abap_false;}
    let lv_index = new abap.types.Integer({qualifiedName: "I"});
    let ls_stack = new abap.types.Structure({
    "page": new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_GUI_RENDERABLE", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_GUI_RENDERABLE"}),
    "bookmark": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"})}, "zcl_abapgit_gui=>ty_page_stack", undefined, {}, {});
    if (abap.compare.cp((await this.#mi_html_viewer.get().zif_abapgit_html_viewer$get_url()), abap.CharacterFactory.get(5, 'http*'))) {
      await this.#mi_html_viewer.get().zif_abapgit_html_viewer$back();
      return rv_exit;
    }
    lv_index.set(abap.builtin.lines({val: this.#mt_stack}));
    if (abap.compare.eq(lv_index, abap.IntegerFactory.get(0))) {
      rv_exit.set(abap.builtin.abap_true);
      return rv_exit;
    }
    if (abap.compare.eq(iv_graceful, abap.builtin.abap_true) && abap.compare.eq((await this.back_graceful()), abap.builtin.abap_true)) {
      return rv_exit;
    }
    const indexBackup1 = abap.builtin.sy.get().index.get();
    const unique665 = lv_index.get();
    for (let unique666 = 0; unique666 < unique665; unique666++) {
      abap.builtin.sy.get().index.set(unique666 + 1);
      abap.statements.readTable(this.#mt_stack,{index: lv_index,
        into: ls_stack});
      abap.statements.assert(abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0)));
      await abap.statements.deleteInternal(this.#mt_stack,{index: lv_index});
      abap.statements.assert(abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0)));
      lv_index.set(abap.operators.minus(lv_index,abap.IntegerFactory.get(1)));
      if (abap.compare.eq(iv_to_bookmark, abap.builtin.abap_false) || abap.compare.eq(ls_stack.get().bookmark, abap.builtin.abap_true)) {
        break;
      }
    }
    abap.builtin.sy.get().index.set(indexBackup1);
    this.#mi_cur_page.set(ls_stack.get().page);
    await this.#render();
    return rv_exit;
  }
  async back_graceful() {
    let rv_handled = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});
    let li_handler = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_GUI_EVENT_HANDLER", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_GUI_EVENT_HANDLER"});
    let ls_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, {}, {});
    abap.statements.readTable(this.#mt_event_handlers,{index: abap.IntegerFactory.get(1),
      into: li_handler});
    if (abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) {
      ls_handled.set((await li_handler.get().zif_abapgit_gui_event_handler$on_event({ii_event: (await abap.Classes['ZCL_ABAPGIT_GUI_EVENT'].new({iv_action: abap.Classes['ZIF_ABAPGIT_DEFINITIONS'].zif_abapgit_definitions$c_action.get().go_back, ii_gui_services: this.me}))})));
      if (abap.compare.eq(ls_handled.get().state, zcl_abapgit_gui.c_event_state.get().re_render)) {
        await this.#render();
        rv_handled.set(abap.builtin.abap_true);
      } else if (abap.compare.eq(ls_handled.get().state, zcl_abapgit_gui.c_event_state.get().no_more_act)) {
        rv_handled.set(abap.builtin.abap_true);
      }
    }
    return rv_handled;
  }
  async #cache_html(INPUT) {
    let rv_url = new abap.types.String({qualifiedName: "STRING"});
    let iv_text = INPUT?.iv_text;
    if (iv_text?.getQualifiedName === undefined || iv_text.getQualifiedName() !== "STRING") { iv_text = undefined; }
    if (iv_text === undefined) { iv_text = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_text); }
    rv_url.set((await this.zif_abapgit_gui_services$cache_asset({iv_text: iv_text, iv_type: abap.CharacterFactory.get(4, 'text'), iv_subtype: abap.CharacterFactory.get(4, 'html')})));
    return rv_url;
  }
  async #call_page(INPUT) {
    let ii_page = INPUT?.ii_page;
    if (ii_page?.getQualifiedName === undefined || ii_page.getQualifiedName() !== "ZIF_ABAPGIT_GUI_RENDERABLE") { ii_page = undefined; }
    if (ii_page === undefined) { ii_page = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_GUI_RENDERABLE", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_GUI_RENDERABLE"}).set(INPUT.ii_page); }
    let iv_with_bookmark = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});
    if (INPUT && INPUT.iv_with_bookmark) {iv_with_bookmark.set(INPUT.iv_with_bookmark);}
    if (INPUT === undefined || INPUT.iv_with_bookmark === undefined) {iv_with_bookmark = abap.builtin.abap_false;}
    let iv_replacing = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});
    if (INPUT && INPUT.iv_replacing) {iv_replacing.set(INPUT.iv_replacing);}
    if (INPUT === undefined || INPUT.iv_replacing === undefined) {iv_replacing = abap.builtin.abap_false;}
    let ls_stack = new abap.types.Structure({
    "page": new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_GUI_RENDERABLE", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_GUI_RENDERABLE"}),
    "bookmark": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"})}, "zcl_abapgit_gui=>ty_page_stack", undefined, {}, {});
    if (abap.compare.eq(iv_replacing, abap.builtin.abap_false) && abap.compare.initial(this.#mi_cur_page) === false) {
      ls_stack.get().page.set(this.#mi_cur_page);
      ls_stack.get().bookmark.set(iv_with_bookmark);
      abap.statements.append({source: ls_stack, target: this.#mt_stack});
    }
    this.#mi_cur_page.set(ii_page);
    await this.#render();
  }
  async constructor_(INPUT) {
    let io_component = new abap.types.ABAPObject({qualifiedName: undefined, RTTIName: undefined});
    if (INPUT && INPUT.io_component) {io_component.set(INPUT.io_component);}
    let ii_asset_man = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_GUI_ASSET_MANAGER", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_GUI_ASSET_MANAGER"});
    if (INPUT && INPUT.ii_asset_man) {ii_asset_man.set(INPUT.ii_asset_man);}
    let ii_hotkey_ctl = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_GUI_HOTKEY_CTL", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_GUI_HOTKEY_CTL"});
    if (INPUT && INPUT.ii_hotkey_ctl) {ii_hotkey_ctl.set(INPUT.ii_hotkey_ctl);}
    let ii_html_processor = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_GUI_HTML_PROCESSOR", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_GUI_HTML_PROCESSOR"});
    if (INPUT && INPUT.ii_html_processor) {ii_html_processor.set(INPUT.ii_html_processor);}
    let iv_rollback_on_error = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});
    if (INPUT && INPUT.iv_rollback_on_error) {iv_rollback_on_error.set(INPUT.iv_rollback_on_error);}
    if (INPUT === undefined || INPUT.iv_rollback_on_error === undefined) {iv_rollback_on_error = abap.builtin.abap_true;}
    if (abap.compare.initial(io_component) === false) {
      if (abap.compare.eq((await abap.Classes['ZCL_ABAPGIT_GUI_UTILS'].is_renderable({io_obj: io_component})), abap.builtin.abap_true)) {
        await abap.statements.cast(this.#mi_cur_page, io_component);
      } else {
        if (abap.compare.eq((await abap.Classes['ZCL_ABAPGIT_GUI_UTILS'].is_event_handler({io_obj: io_component})), abap.builtin.abap_false)) {
          await abap.Classes['ZCX_ABAPGIT_EXCEPTION'].raise({iv_text: abap.CharacterFactory.get(51, 'Component must be renderable or be an event handler')});
        }
        await abap.statements.cast(this.#mi_router, io_component);
      }
    }
    this.#mo_html_parts.set(await (new abap.Classes['ZCL_ABAPGIT_HTML_PARTS']()).constructor_());
    this.#mv_rollback_on_error.set(iv_rollback_on_error);
    this.#mi_asset_man.set(ii_asset_man);
    this.#mi_hotkey_ctl.set(ii_hotkey_ctl);
    this.#mi_html_processor.set(ii_html_processor);
    await this.#startup();
    return this;
  }
  async free() {
    abap.statements.setHandler({EVENT_NAME: "SAPEVENT", EVENT_CLASS: "ZIF_ABAPGIT_HTML_VIEWER"}, [this.on_event.bind(this)], "ALL", abap.builtin.space);
    await this.#mi_html_viewer.get().zif_abapgit_html_viewer$close_document();
    await this.#mi_html_viewer.get().zif_abapgit_html_viewer$free();
    this.#mi_html_viewer.clear();
  }
  async go_home(INPUT) {
    let iv_action = INPUT?.iv_action;
    if (iv_action?.getQualifiedName === undefined || iv_action.getQualifiedName() !== "STRING") { iv_action = undefined; }
    if (iv_action === undefined) { iv_action = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_action); }
    let ls_stack = new abap.types.Structure({
    "page": new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_GUI_RENDERABLE", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_GUI_RENDERABLE"}),
    "bookmark": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"})}, "zcl_abapgit_gui=>ty_page_stack", undefined, {}, {});
    if (abap.compare.initial(this.#mi_router) === false) {
      this.#mt_stack.clear();
      this.#mt_event_handlers.clear();
      abap.statements.append({source: this.#mi_router, target: this.#mt_event_handlers});
      await this.on_event({action: new abap.types.String().set(`${abap.templateFormatting(iv_action)}`)});
    } else {
      if (abap.compare.gt(abap.builtin.lines({val: this.#mt_stack}), abap.IntegerFactory.get(0))) {
        abap.statements.readTable(this.#mt_stack,{index: abap.IntegerFactory.get(1),
          into: ls_stack});
        this.#mi_cur_page.set(ls_stack.get().page);
      }
      await this.#render();
    }
  }
  async #handle_action(INPUT) {
    let iv_action = INPUT?.iv_action;
    let iv_getdata = INPUT?.iv_getdata || new abap.types.Character();
    let it_postdata = abap.types.TableFactory.construct(new abap.types.Character(256, {"qualifiedName":"zif_abapgit_html_viewer=>ty_char256"}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zif_abapgit_html_viewer=>ty_post_data");
    if (INPUT && INPUT.it_postdata) {it_postdata.set(INPUT.it_postdata);}
    let lx_exception = new abap.types.ABAPObject({qualifiedName: "ZCX_ABAPGIT_EXCEPTION", RTTIName: "\\CLASS=ZCX_ABAPGIT_EXCEPTION"});
    let li_handler = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_GUI_EVENT_HANDLER", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_GUI_EVENT_HANDLER"});
    let li_event = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_GUI_EVENT", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_GUI_EVENT"});
    let ls_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, {}, {});
    li_event.set(await (new abap.Classes['ZCL_ABAPGIT_GUI_EVENT']()).constructor_({ii_gui_services: this.me, iv_action: iv_action, iv_getdata: iv_getdata, it_postdata: it_postdata}));
    try {
      ls_handled.set((await (await abap.Classes['ZCL_ABAPGIT_EXIT'].get_instance()).get().zif_abapgit_exit$on_event({ii_event: li_event})));
      if (abap.compare.eq(ls_handled.get().state, zcl_abapgit_gui.c_event_state.get().not_handled)) {
        for await (const unique667 of abap.statements.loop(this.#mt_event_handlers)) {
          li_handler.set(unique667);
          ls_handled.set((await li_handler.get().zif_abapgit_gui_event_handler$on_event({ii_event: li_event})));
          if (abap.compare.initial(ls_handled.get().state) === false && abap.compare.ne(ls_handled.get().state, zcl_abapgit_gui.c_event_state.get().not_handled)) {
            break;
          }
        }
      }
      if (abap.compare.eq((await this.#is_page_modal({ii_page: this.#mi_cur_page})), abap.builtin.abap_true) && !(abap.compare.eq(ls_handled.get().state, zcl_abapgit_gui.c_event_state.get().re_render) || abap.compare.eq(ls_handled.get().state, zcl_abapgit_gui.c_event_state.get().go_back) || abap.compare.eq(ls_handled.get().state, zcl_abapgit_gui.c_event_state.get().no_more_act))) {
        ls_handled.get().state.set(zcl_abapgit_gui.c_event_state.get().no_more_act);
      }
      let unique668 = ls_handled.get().state;
      if (abap.compare.eq(unique668, zcl_abapgit_gui.c_event_state.get().re_render)) {
        await this.#render();
      } else if (abap.compare.eq(unique668, zcl_abapgit_gui.c_event_state.get().new_page)) {
        await this.#call_page({ii_page: ls_handled.get().page});
      } else if (abap.compare.eq(unique668, zcl_abapgit_gui.c_event_state.get().new_page_w_bookmark)) {
        await this.#call_page({ii_page: ls_handled.get().page, iv_with_bookmark: abap.builtin.abap_true});
      } else if (abap.compare.eq(unique668, zcl_abapgit_gui.c_event_state.get().new_page_replacing)) {
        await this.#call_page({ii_page: ls_handled.get().page, iv_replacing: abap.builtin.abap_true});
      } else if (abap.compare.eq(unique668, zcl_abapgit_gui.c_event_state.get().go_back)) {
        await this.back();
      } else if (abap.compare.eq(unique668, zcl_abapgit_gui.c_event_state.get().go_back_to_bookmark)) {
        await this.back({iv_to_bookmark: abap.builtin.abap_true});
      } else if (abap.compare.eq(unique668, zcl_abapgit_gui.c_event_state.get().no_more_act)) {
      } else {
        await abap.Classes['ZCX_ABAPGIT_EXCEPTION'].raise({iv_text: new abap.types.String().set(`Unknown action: ${abap.templateFormatting(iv_action)}`)});
      }
    } catch (e) {
      if ((abap.Classes['ZCX_ABAPGIT_CANCEL'] && e instanceof abap.Classes['ZCX_ABAPGIT_CANCEL'])) {
      } else if ((abap.Classes['ZCX_ABAPGIT_EXCEPTION'] && e instanceof abap.Classes['ZCX_ABAPGIT_EXCEPTION'])) {
        lx_exception.set(e);
        await this.#handle_error({iv_state: ls_handled.get().state, ix_exception: lx_exception});
      } else {
        throw e;
      }
    }
  }
  async #handle_error(INPUT) {
    let iv_state = INPUT?.iv_state;
    if (iv_state?.getQualifiedName === undefined || iv_state.getQualifiedName() !== "I") { iv_state = undefined; }
    if (iv_state === undefined) { iv_state = new abap.types.Integer({qualifiedName: "I"}).set(INPUT.iv_state); }
    let ix_exception = INPUT?.ix_exception;
    if (ix_exception?.getQualifiedName === undefined || ix_exception.getQualifiedName() !== "ZCX_ABAPGIT_EXCEPTION") { ix_exception = undefined; }
    if (ix_exception === undefined) { ix_exception = new abap.types.ABAPObject({qualifiedName: "ZCX_ABAPGIT_EXCEPTION", RTTIName: "\\CLASS=ZCX_ABAPGIT_EXCEPTION"}).set(INPUT.ix_exception); }
    let li_gui_error_handler = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_GUI_ERROR_HANDLER", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_GUI_ERROR_HANDLER"});
    let lx_exception = new abap.types.ABAPObject({qualifiedName: "CX_ROOT", RTTIName: "\\CLASS=CX_ROOT"});
    if (abap.compare.eq(this.#mv_rollback_on_error, abap.builtin.abap_true)) {
      abap.statements.rollback();
    }
    try {
      await abap.statements.cast(li_gui_error_handler, this.#mi_cur_page);
      if (abap.compare.initial(li_gui_error_handler) === false && abap.compare.eq((await li_gui_error_handler.get().zif_abapgit_gui_error_handler$handle_error({ix_error: ix_exception})), abap.builtin.abap_true)) {
        if (abap.compare.eq((await this.#is_new_page({iv_state: iv_state})), abap.builtin.abap_true)) {
          await abap.statements.message({exception: ix_exception, type: abap.CharacterFactory.get(1, 'S'), displayLike: abap.CharacterFactory.get(1, 'E')});
          await this.back();
        } else {
          await this.#render();
        }
      } else if (abap.compare.initial(ix_exception.get().mi_log) === false) {
        this.#mi_common_log.set(ix_exception.get().mi_log);
        if (abap.compare.ge((await this.#mi_common_log.get().zif_abapgit_log$get_log_level()), abap.Classes['ZIF_ABAPGIT_LOG'].zif_abapgit_log$c_log_level.get().warning)) {
          await abap.Classes['ZCL_ABAPGIT_LOG_VIEWER'].show_log({ii_log: this.#mi_common_log});
        }
      } else {
        await abap.statements.message({exception: ix_exception, type: abap.CharacterFactory.get(1, 'S'), displayLike: abap.CharacterFactory.get(1, 'E')});
      }
    } catch (e) {
      if ((abap.Classes['ZCX_ABAPGIT_EXCEPTION'] && e instanceof abap.Classes['ZCX_ABAPGIT_EXCEPTION']) || (abap.Classes['CX_SY_MOVE_CAST_ERROR'] && e instanceof abap.Classes['CX_SY_MOVE_CAST_ERROR'])) {
        lx_exception.set(e);
        await abap.statements.message({exception: lx_exception, type: abap.CharacterFactory.get(1, 'S'), displayLike: abap.CharacterFactory.get(1, 'E')});
      } else {
        throw e;
      }
    }
  }
  async #is_new_page(INPUT) {
    let rv_new_page = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});
    let iv_state = INPUT?.iv_state;
    if (iv_state?.getQualifiedName === undefined || iv_state.getQualifiedName() !== "I") { iv_state = undefined; }
    if (iv_state === undefined) { iv_state = new abap.types.Integer({qualifiedName: "I"}).set(INPUT.iv_state); }
    rv_new_page.set(abap.builtin.boolc(abap.compare.eq(iv_state, zcl_abapgit_gui.c_event_state.get().new_page) || abap.compare.eq(iv_state, zcl_abapgit_gui.c_event_state.get().new_page_w_bookmark)));
    return rv_new_page;
  }
  async #is_page_modal(INPUT) {
    let rv_yes = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});
    let ii_page = INPUT?.ii_page;
    if (ii_page?.getQualifiedName === undefined || ii_page.getQualifiedName() !== "ZIF_ABAPGIT_GUI_RENDERABLE") { ii_page = undefined; }
    if (ii_page === undefined) { ii_page = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_GUI_RENDERABLE", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_GUI_RENDERABLE"}).set(INPUT.ii_page); }
    let li_modal = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_GUI_MODAL", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_GUI_MODAL"});
    try {
      if (abap.compare.initial(ii_page) === false) {
        await abap.statements.cast(li_modal, ii_page);
        rv_yes.set((await li_modal.get().zif_abapgit_gui_modal$is_modal()));
      }
    } catch (e) {
      if ((abap.Classes['CX_SY_MOVE_CAST_ERROR'] && e instanceof abap.Classes['CX_SY_MOVE_CAST_ERROR'])) {
      } else {
        throw e;
      }
    }
    return rv_yes;
  }
  async on_event(INPUT) {
    let action = new abap.types.Character();
    if (INPUT && INPUT.action) {action = INPUT.action;}
    let frame = new abap.types.Character();
    if (INPUT && INPUT.frame) {frame = INPUT.frame;}
    let getdata = new abap.types.Character();
    if (INPUT && INPUT.getdata) {getdata = INPUT.getdata;}
    let postdata = abap.types.TableFactory.construct(new abap.types.Character(256, {"qualifiedName":"zif_abapgit_html_viewer=>ty_char256"}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zif_abapgit_html_viewer=>ty_post_data");
    if (INPUT && INPUT.postdata) {postdata = INPUT.postdata;}
    let query_table = abap.types.TableFactory.construct(new abap.types.Structure({
    "name": new abap.types.Character(30, {"qualifiedName":"zif_abapgit_html_viewer=>ty_name_value-name"}),
    "value": new abap.types.Character(250, {"qualifiedName":"zif_abapgit_html_viewer=>ty_name_value-value"})}, "zif_abapgit_html_viewer=>ty_name_value", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zif_abapgit_html_viewer=>ty_query_table");
    if (INPUT && INPUT.query_table) {query_table = INPUT.query_table;}
    await this.#handle_action({iv_action: action, iv_getdata: getdata, it_postdata: postdata});
  }
  async #render() {
    let lv_url = new abap.types.String({qualifiedName: "STRING"});
    let lv_html = new abap.types.String({qualifiedName: "STRING"});
    let li_html = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_HTML", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_HTML"});
    if (abap.compare.initial(this.#mi_cur_page)) {
      await abap.Classes['ZCX_ABAPGIT_EXCEPTION'].raise({iv_text: abap.CharacterFactory.get(26, 'GUI error: no current page')});
    }
    this.#mt_event_handlers.clear();
    await this.#mo_html_parts.get().clear();
    if (abap.compare.initial(this.#mi_router) === false && abap.compare.eq((await this.#is_page_modal({ii_page: this.#mi_cur_page})), abap.builtin.abap_false)) {
      abap.statements.append({source: this.#mi_router, target: this.#mt_event_handlers});
    }
    if (abap.compare.initial(this.#mi_hotkey_ctl) === false) {
      await this.#mi_hotkey_ctl.get().zif_abapgit_gui_hotkey_ctl$reset();
    }
    li_html.set((await this.#mi_cur_page.get().zif_abapgit_gui_renderable$render()));
    lv_html.set((await li_html.get().zif_abapgit_html$render({iv_no_indent_jscss: abap.builtin.abap_true})));
    if (abap.compare.initial(this.#mi_html_processor) === false) {
      lv_html.set((await this.#mi_html_processor.get().zif_abapgit_gui_html_processor$process({iv_html: lv_html, ii_gui_services: this.me})));
    }
    lv_url.set((await this.#cache_html({iv_text: lv_html})));
    await this.#mi_html_viewer.get().zif_abapgit_html_viewer$show_url({iv_url: lv_url});
  }
  async set_focus() {
    await this.#mi_html_viewer.get().zif_abapgit_html_viewer$set_focus();
  }
  async #startup() {
    let lt_events = abap.types.TableFactory.construct(new abap.types.Structure({
    "eventid": new abap.types.Integer({qualifiedName: "EVENTID"}),
    "appl_event": new abap.types.Character(1, {"qualifiedName":"appl_event"})}, "cntl_simple_event", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "cntl_simple_events");
    let ls_event = new abap.types.Structure({
    "eventid": new abap.types.Integer({qualifiedName: "EVENTID"}),
    "appl_event": new abap.types.Character(1, {"qualifiedName":"appl_event"})}, "cntl_simple_event", undefined, {}, {});
    let lt_assets = abap.types.TableFactory.construct(new abap.types.Structure({
    "url": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GUI_ASSET_MANAGER=>TY_WEB_ASSET-URL"}),
    "type": new abap.types.Character(50, {"qualifiedName":"zif_abapgit_gui_asset_manager=>ty_web_asset-type"}),
    "subtype": new abap.types.Character(50, {"qualifiedName":"zif_abapgit_gui_asset_manager=>ty_web_asset-subtype"}),
    "content": new abap.types.XString({qualifiedName: "ZIF_ABAPGIT_GUI_ASSET_MANAGER=>TY_WEB_ASSET-CONTENT"}),
    "is_cacheable": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"})}, "zif_abapgit_gui_asset_manager=>ty_web_asset", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zif_abapgit_gui_asset_manager=>ty_web_assets");
    let fs_ls_asset_ = new abap.types.FieldSymbol(new abap.types.Structure({
    "url": new abap.types.String({qualifiedName: "ZIF_ABAPGIT_GUI_ASSET_MANAGER=>TY_WEB_ASSET-URL"}),
    "type": new abap.types.Character(50, {"qualifiedName":"zif_abapgit_gui_asset_manager=>ty_web_asset-type"}),
    "subtype": new abap.types.Character(50, {"qualifiedName":"zif_abapgit_gui_asset_manager=>ty_web_asset-subtype"}),
    "content": new abap.types.XString({qualifiedName: "ZIF_ABAPGIT_GUI_ASSET_MANAGER=>TY_WEB_ASSET-CONTENT"}),
    "is_cacheable": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"})}, "zif_abapgit_gui_asset_manager=>ty_web_asset", undefined, {}, {}));
    this.#mi_html_viewer.set((await abap.Classes['ZCL_ABAPGIT_UI_CORE_FACTORY'].get_html_viewer()));
    if (abap.compare.initial(this.#mi_asset_man) === false) {
      lt_assets.set((await this.#mi_asset_man.get().zif_abapgit_gui_asset_manager$get_all_assets()));
      for await (const unique669 of abap.statements.loop(lt_assets,{where: async (I) => {return abap.compare.eq(I.is_cacheable, abap.builtin.abap_true);},topEquals: {"is_cacheable": abap.builtin.abap_true}})) {
        fs_ls_asset_.assign(unique669);
        await this.zif_abapgit_gui_services$cache_asset({iv_xdata: fs_ls_asset_.get().content, iv_url: fs_ls_asset_.get().url, iv_type: fs_ls_asset_.get().type, iv_subtype: fs_ls_asset_.get().subtype});
      }
    }
    ls_event.get().eventid.set(this.#mi_html_viewer.get().zif_abapgit_html_viewer$c_id_sapevent);
    ls_event.get().appl_event.set(abap.builtin.abap_true);
    abap.statements.append({source: ls_event, target: lt_events});
    await this.#mi_html_viewer.get().zif_abapgit_html_viewer$set_registered_events({it_events: lt_events});
    abap.statements.setHandler({EVENT_NAME: "SAPEVENT", EVENT_CLASS: "ZIF_ABAPGIT_HTML_VIEWER"}, [this.on_event.bind(this)], "ALL");
  }
  async zif_abapgit_gui_services$cache_asset(INPUT) {
    let rv_url = new abap.types.String({qualifiedName: "STRING"});
    let iv_text = new abap.types.String({qualifiedName: "STRING"});
    if (INPUT && INPUT.iv_text) {iv_text.set(INPUT.iv_text);}
    let iv_xdata = new abap.types.XString({qualifiedName: "XSTRING"});
    if (INPUT && INPUT.iv_xdata) {iv_xdata.set(INPUT.iv_xdata);}
    let iv_url = new abap.types.String({qualifiedName: "STRING"});
    if (INPUT && INPUT.iv_url) {iv_url.set(INPUT.iv_url);}
    let iv_type = INPUT?.iv_type;
    let iv_subtype = INPUT?.iv_subtype;
    
    
    let lt_xdata = abap.types.TableFactory.construct(new abap.types.Hex({length: 200}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "");
    let lv_size = new abap.types.Integer({qualifiedName: "I"});
    let lt_html = abap.types.TableFactory.construct(new abap.types.Character(200, {"qualifiedName":"ty_char"}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "");
    abap.statements.assert(INPUT && INPUT.iv_text || INPUT && INPUT.iv_xdata);
    if (INPUT && INPUT.iv_text) {
      await abap.Classes['ZCL_ABAPGIT_CONVERT'].string_to_tab({iv_str: iv_text, ev_size: lv_size, et_tab: lt_html});
      await this.#mi_html_viewer.get().zif_abapgit_html_viewer$load_data({iv_type: iv_type, iv_subtype: iv_subtype, iv_size: lv_size, iv_url: iv_url, ev_assigned_url: rv_url, ct_data_table: lt_html});
    } else {
      await abap.Classes['ZCL_ABAPGIT_CONVERT'].xstring_to_bintab({iv_xstr: iv_xdata, ev_size: lv_size, et_bintab: lt_xdata});
      await this.#mi_html_viewer.get().zif_abapgit_html_viewer$load_data({iv_type: iv_type, iv_subtype: iv_subtype, iv_size: lv_size, iv_url: iv_url, ev_assigned_url: rv_url, ct_data_table: lt_xdata});
    }
    abap.statements.assert(abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0)));
    return rv_url;
  }
  async zif_abapgit_gui_services$get_current_page_name() {
    let rv_page_name = new abap.types.String({qualifiedName: "STRING"});
    let li_page_hoc = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_GUI_PAGE_HOC", RTTIName: "\\CLASS=ZCL_ABAPGIT_GUI_PAGE_HOC"});
    if (abap.compare.initial(this.#mi_cur_page) === false) {
      rv_page_name.set((await (await abap.Classes['CL_ABAP_CLASSDESCR'].describe_by_object_ref({p_object_ref: this.#mi_cur_page})).get().get_relative_name()));
      if (abap.compare.eq(rv_page_name, abap.CharacterFactory.get(24, 'ZCL_ABAPGIT_GUI_PAGE_HOC'))) {
        await abap.statements.cast(li_page_hoc, this.#mi_cur_page);
        if (abap.compare.initial((await li_page_hoc.get().get_child())) === false) {
          rv_page_name.set((await (await abap.Classes['CL_ABAP_CLASSDESCR'].describe_by_object_ref({p_object_ref: (await li_page_hoc.get().get_child())})).get().get_relative_name()));
        }
      }
    }
    return rv_page_name;
  }
  async zif_abapgit_gui_services$get_hotkeys_ctl() {
    let ri_hotkey_ctl = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_GUI_HOTKEY_CTL", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_GUI_HOTKEY_CTL"});
    ri_hotkey_ctl.set(this.#mi_hotkey_ctl);
    return ri_hotkey_ctl;
  }
  async zif_abapgit_gui_services$get_html_parts() {
    let ro_parts = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_HTML_PARTS", RTTIName: "\\CLASS=ZCL_ABAPGIT_HTML_PARTS"});
    ro_parts.set(this.#mo_html_parts);
    return ro_parts;
  }
  async zif_abapgit_gui_services$get_log(INPUT) {
    let ri_log = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_LOG", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_LOG"});
    let iv_create_new = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});
    if (INPUT && INPUT.iv_create_new) {iv_create_new.set(INPUT.iv_create_new);}
    if (INPUT === undefined || INPUT.iv_create_new === undefined) {iv_create_new = abap.builtin.abap_false;}
    if (abap.compare.eq(iv_create_new, abap.builtin.abap_true) || abap.compare.initial(this.#mi_common_log)) {
      this.#mi_common_log.set(await (new abap.Classes['ZCL_ABAPGIT_LOG']()).constructor_());
    }
    ri_log.set(this.#mi_common_log);
    return ri_log;
  }
  async zif_abapgit_gui_services$register_event_handler(INPUT) {
    let ii_event_handler = INPUT?.ii_event_handler;
    if (ii_event_handler?.getQualifiedName === undefined || ii_event_handler.getQualifiedName() !== "ZIF_ABAPGIT_GUI_EVENT_HANDLER") { ii_event_handler = undefined; }
    if (ii_event_handler === undefined) { ii_event_handler = new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_GUI_EVENT_HANDLER", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_GUI_EVENT_HANDLER"}).set(INPUT.ii_event_handler); }
    abap.statements.assert(abap.compare.initial(ii_event_handler) === false);
    abap.statements.insertInternal({data: ii_event_handler, index: abap.IntegerFactory.get(1), table: this.#mt_event_handlers});
  }
  async zif_abapgit_gui_services$register_page_asset(INPUT) {
    let iv_url = INPUT?.iv_url;
    if (iv_url?.getQualifiedName === undefined || iv_url.getQualifiedName() !== "STRING") { iv_url = undefined; }
    if (iv_url === undefined) { iv_url = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_url); }
    let iv_type = INPUT?.iv_type;
    if (iv_type?.getQualifiedName === undefined || iv_type.getQualifiedName() !== "STRING") { iv_type = undefined; }
    if (iv_type === undefined) { iv_type = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_type); }
    let iv_mime_name = new abap.types.Character(40, {});
    if (INPUT && INPUT.iv_mime_name) {iv_mime_name.set(INPUT.iv_mime_name);}
    let iv_inline = new abap.types.String({qualifiedName: "STRING"});
    if (INPUT && INPUT.iv_inline) {iv_inline.set(INPUT.iv_inline);}
    await this.#mi_asset_man.get().zif_abapgit_gui_asset_manager$register_asset({iv_url: iv_url, iv_type: iv_type, iv_mime_name: iv_mime_name, iv_inline: iv_inline, iv_cacheable: abap.builtin.abap_false});
  }
}
abap.Classes['ZCL_ABAPGIT_GUI'] = zcl_abapgit_gui;
zcl_abapgit_gui.c_event_state = new abap.types.Structure({
"not_handled": new abap.types.Integer({qualifiedName: "I"}),
"re_render": new abap.types.Integer({qualifiedName: "I"}),
"new_page": new abap.types.Integer({qualifiedName: "I"}),
"go_back": new abap.types.Integer({qualifiedName: "I"}),
"no_more_act": new abap.types.Integer({qualifiedName: "I"}),
"new_page_w_bookmark": new abap.types.Integer({qualifiedName: "I"}),
"go_back_to_bookmark": new abap.types.Integer({qualifiedName: "I"}),
"new_page_replacing": new abap.types.Integer({qualifiedName: "I"})}, undefined, undefined, {}, {});
zcl_abapgit_gui.c_event_state.get().not_handled.set(0);
zcl_abapgit_gui.c_event_state.get().re_render.set(1);
zcl_abapgit_gui.c_event_state.get().new_page.set(2);
zcl_abapgit_gui.c_event_state.get().go_back.set(3);
zcl_abapgit_gui.c_event_state.get().no_more_act.set(4);
zcl_abapgit_gui.c_event_state.get().new_page_w_bookmark.set(5);
zcl_abapgit_gui.c_event_state.get().go_back_to_bookmark.set(6);
zcl_abapgit_gui.c_event_state.get().new_page_replacing.set(7);
zcl_abapgit_gui.ty_page_stack = new abap.types.Structure({
"page": new abap.types.ABAPObject({qualifiedName: "ZIF_ABAPGIT_GUI_RENDERABLE", RTTIName: "\\INTERFACE=ZIF_ABAPGIT_GUI_RENDERABLE"}),
"bookmark": new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"})}, "zcl_abapgit_gui=>ty_page_stack", undefined, {}, {});
export {zcl_abapgit_gui};