@datagrok/hit-triage 1.10.8 → 1.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. package/.grokignore +2 -0
  2. package/.turbo/turbo-build.log +24 -6
  3. package/.vscode/settings.json +16 -0
  4. package/CHANGELOG.md +80 -1
  5. package/CLAUDE.md +87 -10
  6. package/README_HD.md +14 -14
  7. package/README_HT.md +6 -6
  8. package/README_PH.md +110 -0
  9. package/bdd/bdd.config.json +3 -0
  10. package/bdd/bindings/campaign.ts +626 -0
  11. package/bdd/bindings/hit-design.ts +93 -0
  12. package/bdd/bindings/landing.ts +839 -0
  13. package/bdd/bindings/pepti-hit.ts +35 -0
  14. package/bdd/features/campaign/crumbs.feature +22 -0
  15. package/bdd/features/campaign/grid.feature +56 -0
  16. package/bdd/features/campaign/merge.feature +105 -0
  17. package/bdd/features/campaign/molecule-vid.feature +40 -0
  18. package/bdd/features/campaign/permissions.feature +46 -0
  19. package/bdd/features/campaign/progress-tracker.feature +89 -0
  20. package/bdd/features/campaign/refresh-hint.feature +33 -0
  21. package/bdd/features/campaign/ribbon.feature +49 -0
  22. package/bdd/features/campaign/stage-choices.feature +39 -0
  23. package/bdd/features/campaign/submit.feature +135 -0
  24. package/bdd/features/campaign/tracker-cards.feature +46 -0
  25. package/bdd/features/campaign/view-only.feature +37 -0
  26. package/bdd/features/hit-design/campaign-column-metadata.feature +61 -0
  27. package/bdd/features/landing/campaign-deep-links.feature +61 -0
  28. package/bdd/features/landing/hit-design-campaigns-fixes.feature +116 -0
  29. package/bdd/features/landing/hit-design-campaigns.feature +153 -0
  30. package/bdd/features/landing/hit-triage-campaigns.feature +99 -0
  31. package/bdd/features/landing/new-campaign.feature +69 -0
  32. package/bdd/features/landing/pep-triage-campaigns.feature +41 -0
  33. package/bdd/features/landing/pepti-hit-landing.feature +132 -0
  34. package/bdd/features/pepti-hit/helm-edit.feature +47 -0
  35. package/bdd/features/templates/template-editor.feature +130 -0
  36. package/bdd/features/templates/template-picker.feature +112 -0
  37. package/bdd/features/templates/triage-forms.feature +59 -0
  38. package/bdd/fixtures/bar-chart.layout +1 -0
  39. package/bdd/fixtures/merge-local.csv +2 -0
  40. package/bdd/generated/campaign/crumbs.test.ts +33 -0
  41. package/bdd/generated/campaign/grid.test.ts +79 -0
  42. package/bdd/generated/campaign/merge.test.ts +134 -0
  43. package/bdd/generated/campaign/molecule-vid.test.ts +52 -0
  44. package/bdd/generated/campaign/permissions.test.ts +58 -0
  45. package/bdd/generated/campaign/progress-tracker.test.ts +129 -0
  46. package/bdd/generated/campaign/refresh-hint.test.ts +44 -0
  47. package/bdd/generated/campaign/ribbon.test.ts +65 -0
  48. package/bdd/generated/campaign/stage-choices.test.ts +55 -0
  49. package/bdd/generated/campaign/submit.test.ts +167 -0
  50. package/bdd/generated/campaign/tracker-cards.test.ts +49 -0
  51. package/bdd/generated/campaign/view-only.test.ts +51 -0
  52. package/bdd/generated/hit-design/campaign-column-metadata.test.ts +76 -0
  53. package/bdd/generated/landing/campaign-deep-links.test.ts +68 -0
  54. package/bdd/generated/landing/hit-design-campaigns-fixes.test.ts +99 -0
  55. package/bdd/generated/landing/hit-design-campaigns.test.ts +160 -0
  56. package/bdd/generated/landing/hit-triage-campaigns.test.ts +107 -0
  57. package/bdd/generated/landing/new-campaign.test.ts +78 -0
  58. package/bdd/generated/landing/pep-triage-campaigns.test.ts +52 -0
  59. package/bdd/generated/landing/pepti-hit-landing.test.ts +130 -0
  60. package/bdd/generated/pepti-hit/helm-edit.test.ts +64 -0
  61. package/bdd/generated/templates/template-editor.test.ts +137 -0
  62. package/bdd/generated/templates/template-picker.test.ts +119 -0
  63. package/bdd/generated/templates/triage-forms.test.ts +68 -0
  64. package/bdd/package.json +1 -0
  65. package/bdd/tsconfig.json +13 -0
  66. package/css/hit-triage.css +27 -23
  67. package/dist/package-test.js +690 -4
  68. package/dist/package-test.js.map +1 -1
  69. package/dist/package.js +318 -73
  70. package/dist/package.js.map +1 -1
  71. package/package.json +15 -8
  72. package/queries/locks.sql +37 -0
  73. package/src/app/accordeons/layout-input.ts +52 -44
  74. package/src/app/accordeons/new-campaign-accordeon.ts +91 -54
  75. package/src/app/accordeons/new-hit-design-campaign-accordeon.ts +3 -67
  76. package/src/app/accordeons/new-pep-triage-template-accordeon.ts +39 -41
  77. package/src/app/accordeons/new-template-accordeon.ts +41 -24
  78. package/src/app/ai/view-functions.ts +22 -19
  79. package/src/app/base-view.ts +99 -8
  80. package/src/app/consts.ts +8 -5
  81. package/src/app/dialogs/functions-dialog.ts +14 -9
  82. package/src/app/dialogs/merge-table-dialog.ts +181 -325
  83. package/src/app/hit-app-base.ts +61 -90
  84. package/src/app/hit-design-app.ts +492 -882
  85. package/src/app/hit-design-views/info-view.ts +57 -407
  86. package/src/app/hit-design-views/submit-view.ts +216 -111
  87. package/src/app/hit-design-views/tiles-view.ts +168 -123
  88. package/src/app/hit-design-views/utils.css +0 -8
  89. package/src/app/hit-triage-app.ts +69 -38
  90. package/src/app/hit-triage-views/info-view.ts +70 -371
  91. package/src/app/pep-triage-app.ts +2 -2
  92. package/src/app/pep-triage-views/info-view.ts +42 -83
  93. package/src/app/pepti-hit-app.ts +32 -183
  94. package/src/app/pepti-hits-views/info-view.ts +15 -37
  95. package/src/app/shared/campaign-catalog.ts +408 -0
  96. package/src/app/shared/campaign-session.ts +557 -0
  97. package/src/app/shared/compute-editor.ts +274 -0
  98. package/src/app/shared/hit-home.ts +45 -0
  99. package/src/app/shared/new-campaign-form.ts +90 -0
  100. package/src/app/shared/permissions-editor.ts +93 -0
  101. package/src/app/shared/template-editor.ts +331 -0
  102. package/src/app/shared/template-picker.ts +154 -0
  103. package/src/app/types.ts +2 -0
  104. package/src/app/utils/merge-table.ts +183 -78
  105. package/src/app/utils.ts +34 -325
  106. package/src/package-api.ts +29 -8
  107. package/src/package-test.ts +17 -2
  108. package/src/package.g.ts +12 -8
  109. package/src/package.ts +19 -7
  110. package/src/tests/ai.ts +244 -0
  111. package/src/tests/campaign-layout.ts +82 -0
  112. package/src/tests/campaign-session.ts +168 -0
  113. package/src/tests/campaigns.ts +23 -0
  114. package/src/tests/catalog.ts +156 -0
  115. package/src/tests/compat.ts +482 -0
  116. package/src/tests/compute.ts +165 -0
  117. package/src/tests/fixtures.ts +359 -0
  118. package/src/tests/merge.ts +149 -0
  119. package/src/tests/owners.ts +11 -0
  120. package/src/tests/save-lock.ts +932 -0
  121. package/src/tests/storage.ts +106 -0
  122. package/src/tests/template-editor.ts +538 -0
  123. package/src/tests/templates.ts +143 -0
  124. package/src/tests/triage-start.ts +81 -0
  125. package/src/tests/u2-guards.ts +384 -0
  126. package/src/tests/vid.ts +77 -0
  127. package/tsconfig.json +3 -0
  128. package/src/app/accordeons/new-hit-design-template-accordeon.ts +0 -238
  129. package/src/app/dialogs/permissions-dialog.ts +0 -66
package/dist/package.js CHANGED
@@ -1,4 +1,4 @@
1
- var hittriage;(()=>{"use strict";var e={804(e,t,i){i.d(t,{A:()=>o});var n=i(126),a=i.n(n),r=i(454),l=i.n(r)()(a());l.push([e.id,`.statistics-mpo-header {
1
+ var hittriage;(()=>{"use strict";var e={2804(e,t,n){n.d(t,{A:()=>l});var r=n(7126),i=n.n(r),o=n(5454),a=n.n(o)()(i());a.push([e.id,`.statistics-mpo-header {
2
2
  margin-top: 10px;
3
3
  padding-bottom: 5px;
4
4
  border-bottom: 1px solid var(--grey-2);
@@ -312,70 +312,13 @@ var hittriage;(()=>{"use strict";var e={804(e,t,i){i.d(t,{A:()=>o});var n=i(126)
312
312
  margin-top: 0 !important;
313
313
  }
314
314
  }
315
- `,"",{version:3,sources:["webpack://./../../libraries/statistics/dist/css/styles.css"],names:[],mappings:"AAAA;EACE,gBAAgB;EAChB,mBAAmB;EACnB,sCAAsC;EACtC,SAAS;AACX;;AAEA;EACE,iBAAiB;AACnB;;AAEA;EACE,YAAY;AACd;;AAEA;EACE,YAAY;EACZ,eAAe;AACjB;;AAEA;EACE,YAAY;AACd;;AAEA;EACE,YAAY;EACZ,gBAAgB;EAChB,oBAAoB;EACpB,8BAA8B;AAChC;;AAEA;EACE,iBAAiB;AACnB;;AAEA;EACE,gBAAgB;EAChB,uBAAuB;EACvB,mBAAmB;AACrB;;AAEA;EACE,YAAY;AACd;;AAEA;EACE,oBAAoB;EACpB,8BAA8B;EAC9B,mBAAmB;EACnB,QAAQ;AACV;;AAEA;EACE,SAAS;EACT,iBAAiB;EACjB,oBAAoB;EACpB,kBAAkB;EAClB,mBAAmB;EACnB,cAAc;AAChB;;AAEA;;EAEE,mBAAmB;AACrB;;AAEA;EACE,WAAW;AACb;;AAEA;EACE,aAAa;EACb,mBAAmB;EACnB,2BAA2B;EAC3B,cAAc;EACd,gBAAgB;EAChB,SAAS;;EAET,eAAe;AACjB;;AAEA;EACE,cAAc;AAChB;;;AAGA;;EAEE,uBAAuB;EACvB,0BAA0B;EAC1B,gBAAgB;EAChB,uBAAuB;AACzB;;AAEA;EACE,2BAA2B;EAC3B,qBAAqB;AACvB;;AAEA;EACE,WAAW;EACX,YAAY;AACd;;AAEA;EACE,YAAY;EACZ,iBAAiB;AACnB;;AAEA;EACE,aAAa;EACb,mBAAmB;EACnB,QAAQ;EACR,kBAAkB;AACpB;;AAEA;EACE,YAAY;AACd;;AAEA;EACE,eAAe;EACf,oBAAoB;EACpB,yBAAyB;EACzB,qBAAqB;AACvB;;AAEA;EACE,WAAW;EACX,cAAc;AAChB;;AAEA;EACE,OAAO;EACP,WAAW;AACb;;AAEA;EACE,WAAW;AACb;;AAEA;EACE,aAAa;EACb,mBAAmB;EACnB,oBAAoB;AACtB;;AAEA;EACE,YAAY;EACZ,kCAAkC;EAClC,kBAAkB;EAClB,gBAAgB;EAChB,gBAAgB;EAChB,yBAAyB;EACzB,2BAA2B;AAC7B;;AAEA;EACE,oCAAoC;EACpC,yBAAyB;AAC3B;;AAEA;EACE,cAAc;AAChB;;AAEA;EACE,iBAAiB;EACjB,gBAAgB;EAChB,gBAAgB;EAChB,cAAc;AAChB;;AAEA;EACE,iBAAiB;EACjB,gBAAgB;AAClB;;AAEA;EACE,sBAAsB;EACtB,mBAAmB;EACnB,sCAAsC;AACxC;;AAEA;EACE,kBAAkB;AACpB;;AAEA;EACE,eAAe;EACf,oBAAoB;EACpB,eAAe;AACjB;;AAEA;EACE,oBAAoB;AACtB;;AAEA;EACE,oBAAoB;AACtB;;AAEA;EACE,oBAAoB;AACtB;;AAEA;EACE,wBAAwB;AAC1B;;AAEA;EACE,kBAAkB;EAClB,kBAAkB;EAClB,oBAAoB;EACpB,gCAAgC;EAChC,kBAAkB;EAClB,iBAAiB;AACnB;;AAEA;EACE,eAAe;EACf,mBAAmB;EACnB,cAAc;EACd,oBAAoB;EACpB,YAAY;EACZ,eAAe;EACf,oBAAoB;AACtB;;AAEA;EACE,oBAAoB;AACtB;;AAEA;EACE,oBAAoB;EACpB,gBAAgB;EAChB,mBAAmB;AACrB;;AAEA;EACE,SAAS;EACT,qBAAqB;EACrB,kBAAkB;AACpB;;AAEA;EACE,cAAc;AAChB;;AAEA;EACE,eAAe;EACf,yBAAyB;EACzB,oBAAoB;EACpB,qBAAqB;EACrB,sCAAsC;EACtC,mBAAmB;EACnB,kBAAkB;AACpB;;AAEA;EACE,aAAa;EACb,8BAA8B;EAC9B,UAAU;AACZ;;AAEA;EACE,cAAc;AAChB;;AAEA;EACE,uBAAuB;EACvB,uBAAuB;EACvB,QAAQ;AACV;;AAEA;EACE,SAAS;AACX;;AAEA;EACE,gBAAgB;EAChB,eAAe;EACf,kBAAkB;EAClB,eAAe;EACf,wCAAwC;EACxC,kBAAkB;EAClB,kCAAkC;AACpC;;AAEA;EACE,WAAW;EACX,kCAAkC;EAClC,oCAAoC;AACtC;;AAEA;EACE,eAAe;AACjB;;AAEA;EACE;IACE,sBAAsB;IACtB,uBAAuB;EACzB;;EAEA;IACE,sBAAsB;IACtB,kBAAkB;EACpB;;EAEA;IACE,wBAAwB;EAC1B;AACF",sourcesContent:[".statistics-mpo-header {\n margin-top: 10px;\n padding-bottom: 5px;\n border-bottom: 1px solid var(--grey-2);\n gap: 10px;\n}\n\n.statistics-mpo-header > * {\n font-weight: bold;\n}\n\n.statistics-mpo-header > *:first-child {\n width: 130px;\n}\n\n.statistics-mpo-header > *:nth-child(2) {\n width: 120px;\n min-width: 60px;\n}\n\n.statistics-mpo-header > *:nth-child(3) {\n flex-grow: 1;\n}\n\n.statistics-mpo-property-cell {\n width: 130px;\n max-width: 130px;\n align-self: flex-end;\n margin-bottom: 20px !important;\n}\n\n.ui-form .statistics-mpo-property-cell > div:first-child {\n padding-left: 4px;\n}\n\n.statistics-mpo-property-cell > div:first-child {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.statistics-mpo-weight-input {\n width: 100px;\n}\n\n.statistics-mpo-weight-cell {\n align-self: flex-end;\n margin-bottom: 20px !important;\n align-items: center;\n gap: 4px;\n}\n\n.statistics-mpo-control-buttons {\n gap: 10px;\n margin-left: 10px;\n color: var(--blue-1);\n visibility: hidden;\n white-space: nowrap;\n flex-shrink: 0;\n}\n\n.statistics-mpo-row:hover .statistics-mpo-control-buttons,\n.statistics-mpo-cat-row:hover .statistics-mpo-control-buttons {\n visibility: visible;\n}\n\n.statistics-mpo-range-input {\n width: 70px;\n}\n\n.statistics-mpo-row {\n display: flex;\n align-items: center;\n justify-content: flex-start;\n padding: 8px 0;\n min-height: 70px;\n gap: 10px;\n\n flex-wrap: wrap;\n}\n\n.statistics-mpo-row > * {\n flex: 0 0 auto;\n}\n\n\n.statistics-mpo-row .ui-input-choice .ui-input-editor,\n.statistics-mpo-row .ui-input-column .ui-input-editor {\n width: 100px !important;\n max-width: none !important;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ui-form .statistics-mpo-row .ui-input-root {\n margin-bottom: 0 !important;\n padding: 0 !important;\n}\n\n.statistics-mpo-editor-fill {\n width: 100%;\n height: 100%;\n}\n\n.statistics-mpo-cat-editor {\n width: 280px;\n margin-left: 30px;\n}\n\n.statistics-mpo-cat-row {\n display: flex;\n align-items: center;\n gap: 4px;\n margin-bottom: 2px;\n}\n\n.statistics-mpo-cat-name {\n width: 120px;\n}\n\n.statistics-mpo-cat-col-header {\n font-size: 11px;\n color: var(--grey-3);\n text-transform: uppercase;\n letter-spacing: 0.3px;\n}\n\n.statistics-mpo-desirability-dialog .statistics-mpo-cat-editor {\n width: auto;\n margin-left: 0;\n}\n\n.statistics-mpo-desirability-dialog .statistics-mpo-cat-name {\n flex: 1;\n width: auto;\n}\n\n.statistics-mpo-cat-desirability {\n width: 70px;\n}\n\n.statistics-compute-dialog-pane-header {\n display: flex;\n align-items: center;\n justify-content: end;\n}\n\n.statistics-compute-dialog-host>.d4-tab-host.d4-tab-vertical>.d4-tab-header-stripe>.d4-tab-header.statistics-compute-dialog-pane-header {\n border: none;\n border-left: 4px solid transparent;\n border-radius: 1px;\n padding: 4px 8px;\n min-height: 28px;\n justify-content: flex-end;\n flex-direction: row-reverse;\n}\n\n.statistics-compute-dialog-host>.d4-tab-host.d4-tab-vertical>.d4-tab-header-stripe>.d4-tab-header.statistics-compute-dialog-pane-header.selected {\n border-left: 4px solid var(--blue-1);\n background-color: #f2f2f5;\n}\n\n.statistics-compute-dialog-host>.d4-tab-host.d4-tab-vertical>.d4-tab-header-stripe>.d4-tab-header.statistics-compute-dialog-pane-header>span {\n padding: 0 4px;\n}\n\n.statistics-compute-dialog-host {\n max-height: 550px;\n max-width: 800px;\n min-width: 550px;\n overflow: clip;\n}\n\n.statistics-compute-dialog-descriptors-group {\n margin-left: 16px;\n overflow: hidden;\n}\n\n.statistics-compute-dialog-rerun-input {\n margin: 4px 0 8px 15px;\n padding-bottom: 6px;\n border-bottom: 1px solid var(--grey-2);\n}\n\n.oy-scroll {\n overflow-y: scroll;\n}\n\n.statistics-mpo-weight-toggle {\n cursor: pointer;\n color: var(--grey-4);\n font-size: 12px;\n}\n\n.statistics-mpo-weight-toggle:hover {\n color: var(--grey-5);\n}\n\n.statistics-mpo-weight-toggle-active {\n color: var(--grey-4);\n}\n\n.statistics-mpo-weight-toggle-active:hover {\n color: var(--grey-5);\n}\n\n.statistics-mpo-hidden {\n display: none !important;\n}\n\n.statistics-mpo-empty-state {\n text-align: center;\n padding: 48px 24px;\n color: var(--grey-4);\n border: 1px dashed var(--grey-2);\n border-radius: 8px;\n margin: 16px 12px;\n}\n\n.statistics-mpo-empty-state i {\n font-size: 48px;\n margin-bottom: 16px;\n display: block;\n color: var(--blue-1);\n opacity: 0.3;\n cursor: default;\n pointer-events: none;\n}\n\n.statistics-mpo-empty-state h3 {\n color: var(--grey-5);\n}\n\n.statistics-mpo-empty-state p {\n color: var(--grey-3);\n max-width: 360px;\n margin-inline: auto;\n}\n\n.statistics-mpo-dialog-header-row {\n gap: 12px;\n align-items: flex-end;\n margin-bottom: 8px;\n}\n\n.statistics-mpo-dialog-header-row .ui-input-root {\n flex: 0 1 auto;\n}\n\n.statistics-mpo-section-header {\n font-size: 11px;\n text-transform: uppercase;\n color: var(--blue-1);\n letter-spacing: 0.5px;\n border-bottom: 1px solid var(--grey-2);\n padding-bottom: 4px;\n margin: 12px 0 8px;\n}\n\n.statistics-mpo-param-grid.ui-form {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 0 8px;\n}\n\n.statistics-mpo-desirability-dialog .statistics-mpo-plot {\n margin: 0 auto;\n}\n\n.statistics-mpo-plot-wrap {\n justify-content: center;\n align-items: flex-start;\n gap: 6px;\n}\n\n.statistics-mpo-plot-wrap .statistics-mpo-plot {\n margin: 0;\n}\n\n.statistics-mpo-curve-btn {\n padding: 1px 6px;\n font-size: 11px;\n text-align: center;\n cursor: pointer;\n border: 1px solid var(--grey-2, #dbdcdf);\n border-radius: 3px;\n background: var(--grey-1, #f2f2f5);\n}\n\n.statistics-mpo-curve-btn.statistics-mpo-toggle-on {\n color: #fff;\n background: var(--blue-1, #1f77b4);\n border-color: var(--blue-1, #1f77b4);\n}\n\n.statistics-mpo-curve-btn + .statistics-mpo-curve-btn {\n margin-top: 4px;\n}\n\n@media (max-width: 500px) {\n .statistics-mpo-row {\n flex-direction: column;\n align-items: flex-start;\n }\n\n .statistics-mpo-row > * {\n width: 100% !important;\n margin-bottom: 5px;\n }\n\n .statistics-mpo-weight-cell {\n margin-top: 0 !important;\n }\n}\n"],sourceRoot:""}]);let o=l},312(e,t,i){i.d(t,{A:()=>o});var n=i(126),a=i.n(n),r=i(454),l=i.n(r)()(a());l.push([e.id,`.ui-app-header {
316
-
317
- }
318
-
319
- .ui-app-header-icon {
320
- width: 150px;
321
- height: 150px;
322
- margin-right: 20px;
323
- }
324
-
325
- .u2-panel {
326
- gap: 10px;
327
- }
328
-
329
- .u2-app-header-bottom-line {
330
- border-bottom: solid 1px lightgrey;
331
- }
332
-
333
- .u2-app-header-with-name {
334
- gap: 60px;
335
- }
336
-
337
- .u2-app-header-with-name .ui-app-header-icon{
338
- width: 90px;
339
- height: 90px;
340
- }
341
-
342
- .u2-app-header-app-name-and-slogan-div {
343
- gap: 10px;
344
- margin-top: 10px;
345
- }
346
-
347
- .u2-app-header-app-name-div {
348
- font-size: 20px;
349
- font-weight: bold;
350
- }
351
-
352
- .u2-app-header-description {
353
- margin-top: 10px;
354
- margin-bottom: 10px;
355
- }`,"",{version:3,sources:["webpack://./../../libraries/utils/dist/src/u2.css"],names:[],mappings:"AAAA;;AAEA;;AAEA;IACI,YAAY;IACZ,aAAa;IACb,kBAAkB;AACtB;;AAEA;IACI,SAAS;AACb;;AAEA;IACI,kCAAkC;AACtC;;AAEA;IACI,SAAS;AACb;;AAEA;IACI,WAAW;IACX,YAAY;AAChB;;AAEA;IACI,SAAS;IACT,gBAAgB;AACpB;;AAEA;IACI,eAAe;IACf,iBAAiB;AACrB;;AAEA;IACI,gBAAgB;IAChB,mBAAmB;AACvB",sourcesContent:[".ui-app-header {\n\n}\n\n.ui-app-header-icon {\n width: 150px;\n height: 150px;\n margin-right: 20px;\n}\n\n.u2-panel {\n gap: 10px;\n}\n\n.u2-app-header-bottom-line {\n border-bottom: solid 1px lightgrey;\n}\n\n.u2-app-header-with-name {\n gap: 60px;\n}\n\n.u2-app-header-with-name .ui-app-header-icon{\n width: 90px;\n height: 90px;\n}\n\n.u2-app-header-app-name-and-slogan-div {\n gap: 10px;\n margin-top: 10px;\n}\n\n.u2-app-header-app-name-div {\n font-size: 20px;\n font-weight: bold;\n}\n\n.u2-app-header-description {\n margin-top: 10px;\n margin-bottom: 10px;\n}"],sourceRoot:""}]);let o=l},946(e,t,i){i.d(t,{A:()=>o});var n=i(126),a=i.n(n),r=i(454),l=i.n(r)()(a());l.push([e.id,`.grok-hit-triage-view .d4-grid {
356
- width: initial !important;
357
- height: initial !important;
358
- }
359
-
360
- table.hit-triage-table {
361
- margin: 10px;
362
- width: calc(100% - 20px);
363
- }
364
-
365
- .hit-triage-table-container {
366
- max-width: 600px;
367
- max-height: 500px;
368
- overflow-y: scroll;
369
- }
370
-
371
- .hit-triage-error-div {
315
+ `,"",{version:3,sources:["webpack://./../../libraries/statistics/dist/css/styles.css"],names:[],mappings:"AAAA;EACE,gBAAgB;EAChB,mBAAmB;EACnB,sCAAsC;EACtC,SAAS;AACX;;AAEA;EACE,iBAAiB;AACnB;;AAEA;EACE,YAAY;AACd;;AAEA;EACE,YAAY;EACZ,eAAe;AACjB;;AAEA;EACE,YAAY;AACd;;AAEA;EACE,YAAY;EACZ,gBAAgB;EAChB,oBAAoB;EACpB,8BAA8B;AAChC;;AAEA;EACE,iBAAiB;AACnB;;AAEA;EACE,gBAAgB;EAChB,uBAAuB;EACvB,mBAAmB;AACrB;;AAEA;EACE,YAAY;AACd;;AAEA;EACE,oBAAoB;EACpB,8BAA8B;EAC9B,mBAAmB;EACnB,QAAQ;AACV;;AAEA;EACE,SAAS;EACT,iBAAiB;EACjB,oBAAoB;EACpB,kBAAkB;EAClB,mBAAmB;EACnB,cAAc;AAChB;;AAEA;;EAEE,mBAAmB;AACrB;;AAEA;EACE,WAAW;AACb;;AAEA;EACE,aAAa;EACb,mBAAmB;EACnB,2BAA2B;EAC3B,cAAc;EACd,gBAAgB;EAChB,SAAS;;EAET,eAAe;AACjB;;AAEA;EACE,cAAc;AAChB;;;AAGA;;EAEE,uBAAuB;EACvB,0BAA0B;EAC1B,gBAAgB;EAChB,uBAAuB;AACzB;;AAEA;EACE,2BAA2B;EAC3B,qBAAqB;AACvB;;AAEA;EACE,WAAW;EACX,YAAY;AACd;;AAEA;EACE,YAAY;EACZ,iBAAiB;AACnB;;AAEA;EACE,aAAa;EACb,mBAAmB;EACnB,QAAQ;EACR,kBAAkB;AACpB;;AAEA;EACE,YAAY;AACd;;AAEA;EACE,eAAe;EACf,oBAAoB;EACpB,yBAAyB;EACzB,qBAAqB;AACvB;;AAEA;EACE,WAAW;EACX,cAAc;AAChB;;AAEA;EACE,OAAO;EACP,WAAW;AACb;;AAEA;EACE,WAAW;AACb;;AAEA;EACE,aAAa;EACb,mBAAmB;EACnB,oBAAoB;AACtB;;AAEA;EACE,YAAY;EACZ,kCAAkC;EAClC,kBAAkB;EAClB,gBAAgB;EAChB,gBAAgB;EAChB,yBAAyB;EACzB,2BAA2B;AAC7B;;AAEA;EACE,oCAAoC;EACpC,yBAAyB;AAC3B;;AAEA;EACE,cAAc;AAChB;;AAEA;EACE,iBAAiB;EACjB,gBAAgB;EAChB,gBAAgB;EAChB,cAAc;AAChB;;AAEA;EACE,iBAAiB;EACjB,gBAAgB;AAClB;;AAEA;EACE,sBAAsB;EACtB,mBAAmB;EACnB,sCAAsC;AACxC;;AAEA;EACE,kBAAkB;AACpB;;AAEA;EACE,eAAe;EACf,oBAAoB;EACpB,eAAe;AACjB;;AAEA;EACE,oBAAoB;AACtB;;AAEA;EACE,oBAAoB;AACtB;;AAEA;EACE,oBAAoB;AACtB;;AAEA;EACE,wBAAwB;AAC1B;;AAEA;EACE,kBAAkB;EAClB,kBAAkB;EAClB,oBAAoB;EACpB,gCAAgC;EAChC,kBAAkB;EAClB,iBAAiB;AACnB;;AAEA;EACE,eAAe;EACf,mBAAmB;EACnB,cAAc;EACd,oBAAoB;EACpB,YAAY;EACZ,eAAe;EACf,oBAAoB;AACtB;;AAEA;EACE,oBAAoB;AACtB;;AAEA;EACE,oBAAoB;EACpB,gBAAgB;EAChB,mBAAmB;AACrB;;AAEA;EACE,SAAS;EACT,qBAAqB;EACrB,kBAAkB;AACpB;;AAEA;EACE,cAAc;AAChB;;AAEA;EACE,eAAe;EACf,yBAAyB;EACzB,oBAAoB;EACpB,qBAAqB;EACrB,sCAAsC;EACtC,mBAAmB;EACnB,kBAAkB;AACpB;;AAEA;EACE,aAAa;EACb,8BAA8B;EAC9B,UAAU;AACZ;;AAEA;EACE,cAAc;AAChB;;AAEA;EACE,uBAAuB;EACvB,uBAAuB;EACvB,QAAQ;AACV;;AAEA;EACE,SAAS;AACX;;AAEA;EACE,gBAAgB;EAChB,eAAe;EACf,kBAAkB;EAClB,eAAe;EACf,wCAAwC;EACxC,kBAAkB;EAClB,kCAAkC;AACpC;;AAEA;EACE,WAAW;EACX,kCAAkC;EAClC,oCAAoC;AACtC;;AAEA;EACE,eAAe;AACjB;;AAEA;EACE;IACE,sBAAsB;IACtB,uBAAuB;EACzB;;EAEA;IACE,sBAAsB;IACtB,kBAAkB;EACpB;;EAEA;IACE,wBAAwB;EAC1B;AACF",sourcesContent:[".statistics-mpo-header {\n margin-top: 10px;\n padding-bottom: 5px;\n border-bottom: 1px solid var(--grey-2);\n gap: 10px;\n}\n\n.statistics-mpo-header > * {\n font-weight: bold;\n}\n\n.statistics-mpo-header > *:first-child {\n width: 130px;\n}\n\n.statistics-mpo-header > *:nth-child(2) {\n width: 120px;\n min-width: 60px;\n}\n\n.statistics-mpo-header > *:nth-child(3) {\n flex-grow: 1;\n}\n\n.statistics-mpo-property-cell {\n width: 130px;\n max-width: 130px;\n align-self: flex-end;\n margin-bottom: 20px !important;\n}\n\n.ui-form .statistics-mpo-property-cell > div:first-child {\n padding-left: 4px;\n}\n\n.statistics-mpo-property-cell > div:first-child {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.statistics-mpo-weight-input {\n width: 100px;\n}\n\n.statistics-mpo-weight-cell {\n align-self: flex-end;\n margin-bottom: 20px !important;\n align-items: center;\n gap: 4px;\n}\n\n.statistics-mpo-control-buttons {\n gap: 10px;\n margin-left: 10px;\n color: var(--blue-1);\n visibility: hidden;\n white-space: nowrap;\n flex-shrink: 0;\n}\n\n.statistics-mpo-row:hover .statistics-mpo-control-buttons,\n.statistics-mpo-cat-row:hover .statistics-mpo-control-buttons {\n visibility: visible;\n}\n\n.statistics-mpo-range-input {\n width: 70px;\n}\n\n.statistics-mpo-row {\n display: flex;\n align-items: center;\n justify-content: flex-start;\n padding: 8px 0;\n min-height: 70px;\n gap: 10px;\n\n flex-wrap: wrap;\n}\n\n.statistics-mpo-row > * {\n flex: 0 0 auto;\n}\n\n\n.statistics-mpo-row .ui-input-choice .ui-input-editor,\n.statistics-mpo-row .ui-input-column .ui-input-editor {\n width: 100px !important;\n max-width: none !important;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.ui-form .statistics-mpo-row .ui-input-root {\n margin-bottom: 0 !important;\n padding: 0 !important;\n}\n\n.statistics-mpo-editor-fill {\n width: 100%;\n height: 100%;\n}\n\n.statistics-mpo-cat-editor {\n width: 280px;\n margin-left: 30px;\n}\n\n.statistics-mpo-cat-row {\n display: flex;\n align-items: center;\n gap: 4px;\n margin-bottom: 2px;\n}\n\n.statistics-mpo-cat-name {\n width: 120px;\n}\n\n.statistics-mpo-cat-col-header {\n font-size: 11px;\n color: var(--grey-3);\n text-transform: uppercase;\n letter-spacing: 0.3px;\n}\n\n.statistics-mpo-desirability-dialog .statistics-mpo-cat-editor {\n width: auto;\n margin-left: 0;\n}\n\n.statistics-mpo-desirability-dialog .statistics-mpo-cat-name {\n flex: 1;\n width: auto;\n}\n\n.statistics-mpo-cat-desirability {\n width: 70px;\n}\n\n.statistics-compute-dialog-pane-header {\n display: flex;\n align-items: center;\n justify-content: end;\n}\n\n.statistics-compute-dialog-host>.d4-tab-host.d4-tab-vertical>.d4-tab-header-stripe>.d4-tab-header.statistics-compute-dialog-pane-header {\n border: none;\n border-left: 4px solid transparent;\n border-radius: 1px;\n padding: 4px 8px;\n min-height: 28px;\n justify-content: flex-end;\n flex-direction: row-reverse;\n}\n\n.statistics-compute-dialog-host>.d4-tab-host.d4-tab-vertical>.d4-tab-header-stripe>.d4-tab-header.statistics-compute-dialog-pane-header.selected {\n border-left: 4px solid var(--blue-1);\n background-color: #f2f2f5;\n}\n\n.statistics-compute-dialog-host>.d4-tab-host.d4-tab-vertical>.d4-tab-header-stripe>.d4-tab-header.statistics-compute-dialog-pane-header>span {\n padding: 0 4px;\n}\n\n.statistics-compute-dialog-host {\n max-height: 550px;\n max-width: 800px;\n min-width: 550px;\n overflow: clip;\n}\n\n.statistics-compute-dialog-descriptors-group {\n margin-left: 16px;\n overflow: hidden;\n}\n\n.statistics-compute-dialog-rerun-input {\n margin: 4px 0 8px 15px;\n padding-bottom: 6px;\n border-bottom: 1px solid var(--grey-2);\n}\n\n.oy-scroll {\n overflow-y: scroll;\n}\n\n.statistics-mpo-weight-toggle {\n cursor: pointer;\n color: var(--grey-4);\n font-size: 12px;\n}\n\n.statistics-mpo-weight-toggle:hover {\n color: var(--grey-5);\n}\n\n.statistics-mpo-weight-toggle-active {\n color: var(--grey-4);\n}\n\n.statistics-mpo-weight-toggle-active:hover {\n color: var(--grey-5);\n}\n\n.statistics-mpo-hidden {\n display: none !important;\n}\n\n.statistics-mpo-empty-state {\n text-align: center;\n padding: 48px 24px;\n color: var(--grey-4);\n border: 1px dashed var(--grey-2);\n border-radius: 8px;\n margin: 16px 12px;\n}\n\n.statistics-mpo-empty-state i {\n font-size: 48px;\n margin-bottom: 16px;\n display: block;\n color: var(--blue-1);\n opacity: 0.3;\n cursor: default;\n pointer-events: none;\n}\n\n.statistics-mpo-empty-state h3 {\n color: var(--grey-5);\n}\n\n.statistics-mpo-empty-state p {\n color: var(--grey-3);\n max-width: 360px;\n margin-inline: auto;\n}\n\n.statistics-mpo-dialog-header-row {\n gap: 12px;\n align-items: flex-end;\n margin-bottom: 8px;\n}\n\n.statistics-mpo-dialog-header-row .ui-input-root {\n flex: 0 1 auto;\n}\n\n.statistics-mpo-section-header {\n font-size: 11px;\n text-transform: uppercase;\n color: var(--blue-1);\n letter-spacing: 0.5px;\n border-bottom: 1px solid var(--grey-2);\n padding-bottom: 4px;\n margin: 12px 0 8px;\n}\n\n.statistics-mpo-param-grid.ui-form {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 0 8px;\n}\n\n.statistics-mpo-desirability-dialog .statistics-mpo-plot {\n margin: 0 auto;\n}\n\n.statistics-mpo-plot-wrap {\n justify-content: center;\n align-items: flex-start;\n gap: 6px;\n}\n\n.statistics-mpo-plot-wrap .statistics-mpo-plot {\n margin: 0;\n}\n\n.statistics-mpo-curve-btn {\n padding: 1px 6px;\n font-size: 11px;\n text-align: center;\n cursor: pointer;\n border: 1px solid var(--grey-2, #dbdcdf);\n border-radius: 3px;\n background: var(--grey-1, #f2f2f5);\n}\n\n.statistics-mpo-curve-btn.statistics-mpo-toggle-on {\n color: #fff;\n background: var(--blue-1, #1f77b4);\n border-color: var(--blue-1, #1f77b4);\n}\n\n.statistics-mpo-curve-btn + .statistics-mpo-curve-btn {\n margin-top: 4px;\n}\n\n@media (max-width: 500px) {\n .statistics-mpo-row {\n flex-direction: column;\n align-items: flex-start;\n }\n\n .statistics-mpo-row > * {\n width: 100% !important;\n margin-bottom: 5px;\n }\n\n .statistics-mpo-weight-cell {\n margin-top: 0 !important;\n }\n}\n"],sourceRoot:""}]);let l=a},946(e,t,n){n.d(t,{A:()=>l});var r=n(7126),i=n.n(r),o=n(5454),a=n.n(o)()(i());a.push([e.id,`.hit-triage-error-div {
372
316
  color: red;
373
317
  text-align: start;
374
318
  }
375
319
 
376
- .mx-5 {
377
- margin-left: 5px;
378
- margin-right: 5px;
320
+ .hit-triage-input-error {
321
+ border-bottom: 1px solid var(--red-3);
379
322
  }
380
323
 
381
324
  .hit-triage-new-template-functions-input > .ui-box {
@@ -388,7 +331,6 @@ table.hit-triage-table {
388
331
  overflow-y: scroll;
389
332
  }
390
333
 
391
-
392
334
  .hit-triage-new-template-functions-input > .d4-tab-host {
393
335
  width: 100% !important;
394
336
  }
@@ -413,19 +355,322 @@ table.hit-triage-table {
413
355
  text-overflow: ellipsis;
414
356
  }
415
357
 
416
- .hit-triage-info-view-container .fa-trash-alt:hover {
417
- color: #ff0000 !important;
418
- }`,"",{version:3,sources:["webpack://./css/hit-triage.css"],names:[],mappings:"AAAA;IACI,yBAAyB;IACzB,0BAA0B;AAC9B;;AAEA;IACI,YAAY;IACZ,wBAAwB;AAC5B;;AAEA;IACI,gBAAgB;IAChB,iBAAiB;IACjB,kBAAkB;AACtB;;AAEA;IACI,UAAU;IACV,iBAAiB;AACrB;;AAEA;IACI,gBAAgB;IAChB,iBAAiB;AACrB;;AAEA;IACI,aAAa;AACjB;;AAEA;IACI,iBAAiB;IACjB,2BAA2B;IAC3B,kBAAkB;AACtB;;;AAGA;IACI,sBAAsB;AAC1B;;AAEA;CACC,gBAAgB;IACb,mBAAmB;IACnB,uBAAuB;CAC1B,iBAAiB;IACd,UAAU;AACd;;AAEA;CACC,cAAc;CACd,eAAe;CACf,iBAAiB;AAClB;;AAEA;CACC,mBAAmB;IAChB,gBAAgB;IAChB,uBAAuB;AAC3B;;AAEA;IACI,yBAAyB;AAC7B",sourcesContent:[".grok-hit-triage-view .d4-grid {\n width: initial !important;\n height: initial !important;\n}\n\ntable.hit-triage-table {\n margin: 10px;\n width: calc(100% - 20px);\n}\n\n.hit-triage-table-container {\n max-width: 600px;\n max-height: 500px;\n overflow-y: scroll;\n}\n\n.hit-triage-error-div {\n color: red;\n text-align: start;\n}\n\n.mx-5 {\n margin-left: 5px;\n margin-right: 5px;\n}\n\n.hit-triage-new-template-functions-input > .ui-box {\n height: 300px;\n}\n\n.hit-triage-new-template-functions-input {\n max-height: 200px;\n max-width: unset !important;\n overflow-y: scroll;\n}\n\n\n.hit-triage-new-template-functions-input > .d4-tab-host {\n width: 100% !important;\n}\n\n.d4-ribbon-name .ui-breadcrumbs {\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n flex-wrap: nowrap;\n padding: 0;\n}\n\n.d4-ribbon-name .ui-breadcrumbs i {\n padding: 0 6px;\n font-size: 10px;\n font-weight: bold;\n}\n\n.d4-ribbon-name .ui-breadcrumbs-element:first-child {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.hit-triage-info-view-container .fa-trash-alt:hover {\n color: #ff0000 !important;\n}"],sourceRoot:""}]);let o=l},10(e,t,i){i.d(t,{A:()=>o});var n=i(126),a=i.n(n),r=i(454),l=i.n(r)()(a());l.push([e.id,`img[alt='hitDesignReadmeImg'] {
419
- max-width: 100%;
358
+ .hit-triage-home-header {
359
+ margin-left: 10px;
360
+ }
361
+
362
+ .hit-triage-home {
363
+ --u2-page-padding-x: 10px;
364
+ --u2-page-section-indent: 14px;
365
+ }
366
+
367
+ .hit-triage-template-editor {
368
+ height: 100%;
369
+ --u2-form-section-gap: 16px;
420
370
  }
421
371
 
422
- .hit-design-stage-editing-dialog {
423
- z-index: 10000 !important;
372
+ .hit-triage-compute-box {
373
+ --u2-master-detail-height: 322px;
374
+ max-width: 762px;
424
375
  }
425
376
 
426
- .hit-design-groupped-campaigns-table .d4-accordion-pane-content.expanded {
427
- margin: 0 !important;
428
- }`,"",{version:3,sources:["webpack://./src/app/hit-design-views/utils.css"],names:[],mappings:"AAAA;IACI,eAAe;AACnB;;AAEA;IACI,yBAAyB;AAC7B;;AAEA;IACI,oBAAoB;AACxB",sourcesContent:["img[alt='hitDesignReadmeImg'] {\n max-width: 100%;\n}\n\n.hit-design-stage-editing-dialog {\n z-index: 10000 !important;\n}\n\n.hit-design-groupped-campaigns-table .d4-accordion-pane-content.expanded {\n margin: 0 !important;\n}"],sourceRoot:""}]);let o=l},454(e){e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var i="",n=void 0!==t[5];return t[4]&&(i+="@supports (".concat(t[4],") {")),t[2]&&(i+="@media ".concat(t[2]," {")),n&&(i+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),i+=e(t),n&&(i+="}"),t[2]&&(i+="}"),t[4]&&(i+="}"),i}).join("")},t.i=function(e,i,n,a,r){"string"==typeof e&&(e=[[null,e,void 0]]);var l={};if(n)for(var o=0;o<this.length;o++){var s=this[o][0];null!=s&&(l[s]=!0)}for(var u=0;u<e.length;u++){var c=[].concat(e[u]);n&&l[c[0]]||(void 0!==r&&(void 0===c[5]||(c[1]="@layer".concat(c[5].length>0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=r),i&&(c[2]&&(c[1]="@media ".concat(c[2]," {").concat(c[1],"}")),c[2]=i),a&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=a):c[4]="".concat(a)),t.push(c))}},t}},126(e){e.exports=function(e){var t=e[1],i=e[3];if(!i)return t;if("function"==typeof btoa){var n=btoa(unescape(encodeURIComponent(JSON.stringify(i))));return[t].concat(["/*# ".concat("sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(n)," */")]).join("\n")}return[t].join("\n")}},2(e){var t=[];function i(e){for(var i=-1,n=0;n<t.length;n++)if(t[n].identifier===e){i=n;break}return i}function n(e,n){for(var a={},r=[],l=0;l<e.length;l++){var o=e[l],s=n.base?o[0]+n.base:o[0],u=a[s]||0,c="".concat(s," ").concat(u);a[s]=u+1;var p=i(c),d={css:o[1],media:o[2],sourceMap:o[3],supports:o[4],layer:o[5]};if(-1!==p)t[p].references++,t[p].updater(d);else{var m=function(e,t){var i=t.domAPI(t);return i.update(e),function(t){t?(t.css!==e.css||t.media!==e.media||t.sourceMap!==e.sourceMap||t.supports!==e.supports||t.layer!==e.layer)&&i.update(e=t):i.remove()}}(d,n);n.byIndex=l,t.splice(l,0,{identifier:c,updater:m,references:1})}r.push(c)}return r}e.exports=function(e,a){var r=n(e=e||[],a=a||{});return function(e){e=e||[];for(var l=0;l<r.length;l++){var o=i(r[l]);t[o].references--}for(var s=n(e,a),u=0;u<r.length;u++){var c=i(r[u]);0===t[c].references&&(t[c].updater(),t.splice(c,1))}r=s}}},129(e){var t={};e.exports=function(e,i){var n=function(e){if(void 0===t[e]){var i=document.querySelector(e);if(window.HTMLIFrameElement&&i instanceof window.HTMLIFrameElement)try{i=i.contentDocument.head}catch(e){i=null}t[e]=i}return t[e]}(e);if(!n)throw Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");n.appendChild(i)}},838(e){e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},986(e,t,i){e.exports=function(e){var t=i.nc;t&&e.setAttribute("nonce",t)}},611(e){e.exports=function(e){if("u"<typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(i){var n,a,r;n="",i.supports&&(n+="@supports (".concat(i.supports,") {")),i.media&&(n+="@media ".concat(i.media," {")),(a=void 0!==i.layer)&&(n+="@layer".concat(i.layer.length>0?" ".concat(i.layer):""," {")),n+=i.css,a&&(n+="}"),i.media&&(n+="}"),i.supports&&(n+="}"),(r=i.sourceMap)&&"u">typeof btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(r))))," */")),e.styleTagTransform(n,t,e.options)},remove:function(){var e;null===(e=t).parentNode||e.parentNode.removeChild(e)}}}},515(e){e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}}},t={};function i(n){var a=t[n];if(void 0!==a)return a.exports;var r=t[n]={id:n,exports:{}};return e[n](r,r.exports,i),r.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.nc=void 0;var n={};(()=>{let e;i.r(n),i.d(n,{demoFileIngest2:()=>nt,pepTriageApp:()=>i9,peptiHitApp:()=>i8,demoFileSubmit:()=>nn,hitDesignAppTreeBrowser:()=>i2,hitDesignApp:()=>i3,pepTriageAppTreeBrowser:()=>i6,htPackageSettingEditor:()=>no,peptiHitAppTreeBrowser:()=>i4,registerMoleculesToViD:()=>na,initHT:()=>i0,demoFileIngest1:()=>ne,demoFileIngest:()=>i7,gasteigerCellRenderer:()=>nl,hitTriageApp:()=>i5,hitDesignVidPanel:()=>nr,HTPackage:()=>nm,_package:()=>nh,demoPeptideSequences:()=>ni,PackageFunctions:()=>nf,hitTriageAppTreeBrowser:()=>i1});let t=grok,a=ui,r=DG,l="campaignId",o="campaignId",s="enriched_table.csv",u="campaign.json",c="HitTriageDataSource",p="HitTriageSubmitFunction",d="Selected hits",m="Stage",h="Molecule",g="Helm",f="V-iD",y="HIT_DESIGN_VID",v="Source",b="New Template",w="Start",A="Create",C="Download",E="Cancel",T="Continue Campaign",x="New Campaign",S="No Information",O="HDCampaignsGrouping",P="HDCampaignTableColumns",N="HDCampaignsTableSorting";var F,B,I,k,V,D,j,_,L=((V={}).None="None",V.Template="Template",V.Status="Status",V.Author="Author",V.LastModifiedUser="Last Modified User",V);let M={Name:e=>{var t;return null!=(t=e.friendlyName)?t:e.name},Code:e=>e.name,Created:e=>e.createDate,Author:e=>{var t;return null!=(t=e.authorUserFriendlyName)?t:""},"Last Modified by":e=>{var t;return null!=(t=e.lastModifiedUserName)?t:""},Molecules:e=>{var t;return(null!=(t=e.rowCount)?t:0).toString()},Status:e=>e.status},H="HTCampaignsGrouping",R="HTCampaignTableColumns",U="HTCampaignsTableSorting",q={Name:e=>{var t;return null!=(t=e.friendlyName)?t:e.name},Code:e=>e.name,Created:e=>e.createDate,Author:e=>{var t;return null!=(t=e.authorUserFriendlyName)?t:""},"Last Modified by":e=>{var t;return null!=(t=e.lastModifiedUserName)?t:""},Total:e=>{var t;return(null!=(t=e.rowCount)?t:0).toString()},Selected:e=>{var t;return(null!=(t=e.filteredRowCount)?t:0).toString()},Status:e=>e.status},Y="pepTriageDataSource";var G=i(2),W=i.n(G),J=i(611),z=i.n(J),Q=i(129),K=i.n(Q),Z=i(986),X=i.n(Z),ee=i(838),et=i.n(ee),ei=i(515),en=i.n(ei),ea=i(946),er={};er.styleTagTransform=en(),er.setAttributes=X(),er.insert=K().bind(null,"head"),er.domAPI=z(),er.insertStyleElement=et(),W()(ea.A,er),ea.A&&ea.A.locals&&ea.A.locals;let el="script",eo="function-package",es="data-query",eu="HTScript",ec="HTQuery",ep="molecules";function ed(e,t,i,n,a,r,l){try{var o=e[r](l),s=o.value}catch(e){i(e);return}o.done?t(s):Promise.resolve(s).then(n,a)}function em(e){var t,i,n;let a=null!=(t=localStorage.getItem(e))?t:"{}";try{let e=JSON.parse(a);return{order:null!=(i=null==e?void 0:e.order)?i:[],hidden:null!=(n=null==e?void 0:e.hidden)?n:[]}}catch(e){console.error("error parsing function ordering",e)}return{order:[],hidden:[]}}function eh(e){try{var t;return null==(t=e.package)?void 0:t.name}catch(e){return}}function eg(e,t,i){var n;return(n=function*(){if(0===i.rowCount)return;let n=e.col(t);if(!n)throw Error("There is no molecule column in dataframe");let a=i.col(ep);if(a||(yield i.meta.detectSemanticTypes(),a=i.columns.bySemType(r.SEMTYPE.MOLECULE)),!a)throw Error("There is no original molecule column in query result dataframe");let l=i.columns.names().filter(e=>(null==e?void 0:e.toLowerCase())!==ep),o=l.filter(t=>{let n=e.col(t);return null!=n&&n.type===i.col(t).type});var s=!0,u=!1,c=void 0;try{for(var p,d=l[Symbol.iterator]();!(s=(p=d.next()).done);s=!0){let t=p.value;!o.includes(t)&&e.col(t)&&e.columns.remove(t)}}catch(e){u=!0,c=e}finally{try{s||null==d.return||d.return()}finally{if(u)throw c}}if(o.length){let t=new Map;for(let e=0;e<a.length;e++){if(a.isNone(e))continue;let i=a.get(e);t.has(i)||t.set(i,e)}var m=!0,h=!1,g=void 0;try{for(var f,y=o[Symbol.iterator]();!(m=(f=y.next()).done);m=!0){let a=f.value,r=i.col(a),l=e.col(a);for(let e=0;e<n.length;e++){let i=n.isNone(e)?void 0:t.get(n.get(e));l.set(e,void 0===i||r.isNone(i)?null:r.get(i),!1)}}}catch(e){h=!0,g=e}finally{try{m||null==y.return||y.return()}finally{if(h)throw g}}}let v=l.filter(e=>!o.includes(e));v.length&&e.join(i,[t],[a.name],void 0,v,void 0,!0)},function(){var e=this,t=arguments;return new Promise(function(i,a){var r=n.apply(e,t);function l(e){ed(r,i,a,l,o,"next",e)}function o(e){ed(r,i,a,l,o,"throw",e)}l(void 0)})})()}function ef(e,t,i,n,a,r,l){try{var o=e[r](l),s=o.value}catch(e){i(e);return}o.done?t(s):Promise.resolve(s).then(n,a)}function ey(e){return function(){var t=this,i=arguments;return new Promise(function(n,a){var r=e.apply(t,i);function l(e){ef(r,n,a,l,o,"next",e)}function o(e){ef(r,n,a,l,o,"throw",e)}l(void 0)})}}let ev=e=>`${e.getFullYear()}/${e.getMonth()+1}/${e.getDate()}`;function eb(e,t){let i=document.title,n=window.location.href.split("?")[0]+"?"+e+"="+t;if(history.replaceState){let e={Title:i,Url:n};history.replaceState(e,e.Title,e.Url)}}function ew(e,i,n,r){var l;let o=a.breadcrumbs([i,n]),s=o.onPathClick.subscribe(t=>{1===t.length&&(s.unsubscribe(),eA(e),r())}),u=null==(l=t.shell.v.ribbonMenu.root.parentElement)?void 0:l.getElementsByClassName("d4-ribbon-name")[0];return u&&(u.textContent="",u.appendChild(o.root)),{breadcrumbs:o,sub:s}}function eA(e){let t=e.getRibbonPanels();(null==t?void 0:t.length)&&(t.pop(),e.setRibbonPanels(t))}function eC(e){return e.reduce((e,t)=>e||t.reduce((e,t)=>e||t.classList.contains("hit-design-submit-button")||Array.from(t.children).some(e=>e.classList.contains("hit-design-submit-button")),!1),!1)}function eE(e,i){return ey(function*(){try{var n,a,l,o,s;let u=r.User.current().id,c=null==(n=r.User.current().group)?void 0:n.id;if(e===u)return!0;for(let e of i){let i=yield t.dapi.groups.find(e);if(i){if(i.personal){let e=yield t.dapi.groups.getUser(i);if((null==e?void 0:e.id)===u)return!0}else if(c&&((null!=(a=null==(o=i.members)?void 0:o.length)?a:0)>0&&i.members.some(e=>(null==e?void 0:e.id)===c)||(null!=(l=null==(s=i.adminMembers)?void 0:s.length)?l:0)>0&&i.adminMembers.some(e=>(null==e?void 0:e.id)===c)))return!0}}}catch(e){nh.logger.error(e)}return!1})()}function eT(e,t){return ey(function*(){return eE(e,t.edit)})()}function ex(e,t){return ey(function*(){return eE(e,Array.from(new Set([...t.view,...t.edit])))})()}function eS(e){return localStorage.getItem(e)}function eO(e,t){localStorage.setItem(e,t)}function eP(e,t,i){if(!t)return;let n=null!=i?i:M,a=t.columnName in n?n[t.columnName]:e=>{var i,n,a;return null!=(i=null==(a=e.campaignFields)?void 0:a[null!=(n=t.columnName.replace("campaignFields.",""))?n:""])?i:""},r=new Map;e.forEach(e=>{r.set(e,a(e))});let l=Array.from(r.values()).every(e=>{var t;return ej(e)||!isNaN(Number(null!=(t=null==e?void 0:e.toString())?t:""))}),o=!l&&Array.from(r.values()).every(e=>{var t;return ej(e)||!isNaN(Date.parse(null!=(t=null==e?void 0:e.toString())?t:""))});l?e.forEach(e=>{r.set(e,ej(r.get(e))?t.ascending?1/0:-1/0:Number(r.get(e)))}):o&&e.forEach(e=>{var i,n;r.set(e,ej(r.get(e))?t.ascending?1/0:-1/0:Date.parse(null!=(i=null==(n=r.get(e))?void 0:n.toString())?i:""))}),e.sort((e,i)=>{let n=r.get(e),a=r.get(i);if(l||o)return t.ascending?n-a:a-n;let s=ej(n)?"":n.toString(),u=ej(a)?"":a.toString();return t.ascending?s.localeCompare(u):u.localeCompare(s)}),r.clear()}function eN(){let e=eS(P),t=["Code","Created","Author","Last Modified by","Molecules","Status"];if(!e)return t;try{let i=JSON.parse(e);if(Array.isArray(i)&&i.every(e=>"string"==typeof e))return i;return t}catch(e){return console.error("error parsing campaign table columns",e),t}}function eF(e){eO(P,JSON.stringify(e))}function eB(){let e=eS(R),t=["Created","Author","Total","Selected","Status"];if(!e)return t;try{let i=JSON.parse(e);if(Array.isArray(i)&&i.every(e=>"string"==typeof e))return i;return t}catch(e){return console.error("error parsing HT campaign table columns",e),t}}function eI(e){eO(R,JSON.stringify(e))}let ek=(e,t)=>{var i,n,a,r,l,o;switch(e){case L.Template:return null!=(i=null==(n=t.template)?void 0:n.key)?i:t.templateName;case L.Status:return t.status;case L.Author:return null!=(a=t.authorUserFriendlyName)?a:S;case L.LastModifiedUser:return null!=(r=t.lastModifiedUserName)?r:S;default:if(e.startsWith("campaignFields.")){let i=e.replace("campaignFields.","");return null!=(l=null==(o=t.campaignFields)?void 0:o[i])?l:S}return""}};function eV(e,t){if(t===L.None)return{"":e};let i={};for(let n of e){let e=ek(t,n);i[e]||(i[e]=[]),i[e].push(n)}return i}function eD(e,t,i=9){e.classList.add("hit-design-groupped-campaigns-table");let n=Object.keys(t);if(n.length<2)return e;let r=e.getElementsByTagName("tbody")[0],l=Array.from(e.getElementsByTagName("tr")).filter(e=>!e.classList.contains("header")),o=0,s=(e,t,i)=>{var n;for(let a=t;a<i;a++)(null==(n=l[a])?void 0:n.style)&&(l[a].style.display=e?"table-row":"none")};for(let e of n){let n=l[o];if(!n)break;let u=t[e].length,c=o,p=o+u,d=a.accordion(`Hit-Design-campaigns-group-${e}`).addPane(e,()=>a.div(),void 0,void 0,!1);d.root.style.marginLeft="-24px",d.root.onclick=()=>{s(d.expanded,c,p)},s(d.expanded,c,p);let m=r.insertRow(0),h=m.insertCell(0);h.appendChild(d.root),h.colSpan=i,r.insertBefore(m,n),o+=u}}function ej(e){return""===e||null==e||"number"==typeof e&&isNaN(e)}function e_(e){return ey(function*(){return JSON.parse((yield nh.files.readAsText(e)))})()}let eL={String:r.TYPE.STRING,Number:r.TYPE.FLOAT,Boolean:r.TYPE.BOOL,Date:r.TYPE.DATE_TIME,Molecule:r.SEMTYPE.MOLECULE};function e$(e,t,i,n,a,r,l){try{var o=e[r](l),s=o.value}catch(e){i(e);return}o.done?t(s):Promise.resolve(s).then(n,a)}function eM(e){return function(){var t=this,i=arguments;return new Promise(function(n,a){var r=e.apply(t,i);function l(e){e$(r,n,a,l,o,"next",e)}function o(e){e$(r,n,a,l,o,"throw",e)}l(void 0)})}}function eH(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{},n=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(i).filter(function(e){return Object.getOwnPropertyDescriptor(i,e).enumerable}))),n.forEach(function(t){var n;n=i[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function eR(e,i,n){return eM(function*(e,i,n=c,l){var o,s,u;let p=a.divText("",{style:{color:"red"}}),d=null,m=()=>eM(function*(){try{if(!(d=h.value))return;if(yield d.meta.detectSemanticTypes(),!d.columns.bySemType(r.SEMTYPE.MOLECULE)){p.innerText="No molecules column found";return}p.innerText=""}catch(e){p.innerText="Error parsing file"}})(),h=a.input.table("Dataframe",{onValueChanged:m});yield m();let g=a.div([h,p]);0===Object.keys(i).length&&Array.from(new Set(r.Func.find({meta:{role:n}}).concat(r.Func.find({tags:[n]})))).forEach(e=>{var t;i[null!=(t=e.friendlyName)?t:e.name]=e});let f=null,y=()=>eM(function*(){f=i[A.value].prepare();let e=yield f.getEditor();e.classList.remove("ui-form"),b.innerHTML="",b.appendChild(e)})(),b=a.div([]),A=a.input.choice(v,{value:null!=(o=e.queryFunctionName)?o:Object.keys(i)[0],items:Object.keys(i),onValueChanged:y});yield y(),e.queryFunctionName&&(null==(u=A.root.getElementsByTagName("select").item(0))||u.setAttribute("disabled","true"));let C=a.div([A,b]);C.style.display="none";let T=a.div([g,C]),x=a.input.string("Campaign Name",{value:"",nullable:!0});x.setTooltip("Optional friendly name for the campaign");let S=e.campaignFields.map(e=>{var t,i;return e.type===r.SEMTYPE.MOLECULE?(t=eH({},e),i=i={type:"String",semtype:r.SEMTYPE.MOLECULE},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t.push.apply(t,i)}return t})(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}),t):e}).map(e=>r.Property.fromOptions(eH({name:e.name,type:eL[e.type],nullable:!e.required},e.semtype?{semType:e.semtype}:{}))),O={},P=S.length?a.input.form(O,S):a.div();P.classList.remove("ui-form"),"File"===e.dataSourceType?(g.style.display="inherit",C.style.display="none"):(g.style.display="none",C.style.display="inherit");let N=a.div([x.root,...null!=(s=null==l?void 0:l.extraFormElements)?s:[],T,...S.length?[P]:[]]),F=a.buttonsInput([]);return N.appendChild(F),{promise:new Promise(n=>{let r=a.bigButton(w,()=>eM(function*(){var a,r,o,s;if("File"===e.dataSourceType){if(!d)return void t.shell.error("No file selected");let e=d;e.name=d.name,n({df:e,type:"File",campaignProps:O,friendlyName:(null==(a=x.value)?void 0:a.trim())||void 0,extraData:null==l||null==(r=l.getExtraData)?void 0:r.call(l)})}else{let e=i[A.value];if(!e)return void t.shell.error("No function selected");let a={};Object.entries(f.inputs).forEach(([e,t])=>{a[e]=t}),n({df:yield e.apply(a),type:"Query",campaignProps:O,friendlyName:(null==(o=x.value)?void 0:o.trim())||void 0,extraData:null==l||null==(s=l.getExtraData)?void 0:s.call(l)})}})());F.appendChild(r)}),root:N,cancelPromise:new Promise(e=>{a.button(E,()=>e())})}}).apply(this,arguments)}let eU=$;var eq=i.n(eU),eY=i(804),eG={};function eW(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=Array(t);i<t;i++)n[i]=e[i];return n}function eJ(e,t,i,n,a,r,l){try{var o=e[r](l),s=o.value}catch(e){i(e);return}o.done?t(s):Promise.resolve(s).then(n,a)}function ez(e){return function(){var t=this,i=arguments;return new Promise(function(n,a){var r=e.apply(t,i);function l(e){eJ(r,n,a,l,o,"next",e)}function o(e){eJ(r,n,a,l,o,"throw",e)}l(void 0)})}}function eQ(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i,n,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var r=[],l=!0,o=!1;try{for(a=a.call(e);!(l=(i=a.next()).done)&&(r.push(i.value),!t||r.length!==t);l=!0);}catch(e){o=!0,n=e}finally{try{l||null==a.return||a.return()}finally{if(o)throw n}}return r}}(e,t)||function(e,t){if(e){if("string"==typeof e)return eW(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);if("Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i)return Array.from(i);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return eW(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function eK(e,t,i,n,a,r,l){try{var o=e[r](l),s=o.value}catch(e){i(e);return}o.done?t(s):Promise.resolve(s).then(n,a)}function eZ(e,i,n,l,o,s){var u;return(u=function*(){var u,c,p,d,m;return u=e.computeFunctions,c=()=>t.chem.descriptorsTree(),p="HTFunctionOrderingLS",d=void 0,m=s?{label:"Re-run when campaign opens",tooltip:"Recompute this function for the whole molecule column every time this campaign is opened. Useful for database lookups that may resolve after the molecule was first drawn."}:void 0,ez(function*(){let e,t,s,h,g,f=p,y=[];u.functions.filter(e=>{let t=e.inputs;return t.length>=2&&"dataframe"===t[0].propertyType&&"column"===t[1].propertyType}).forEach(e=>{var t,i,n,a;y.push({func:e,args:null!=(t=null==l||null==(a=l.compute)||null==(n=a.functions)||null==(i=n.find(t=>t.name===e.name&&t.package===e.package.name))?void 0:i.args)?t:{}})}),u.scripts.filter(e=>{let t=e.inputs;return t.length>=2&&"dataframe"===t[0].propertyType&&"column"===t[1].propertyType}).forEach(e=>{var t,i,n,a;y.push({func:e,args:null!=(t=null==l||null==(a=l.compute)||null==(n=a.scripts)||null==(i=n.find(t=>t.id===e.id))?void 0:i.args)?t:{}})}),u.queries.filter(e=>e.inputs.length>0&&"list"===e.inputs[0].propertyType).forEach(e=>{var t,i,n,a;y.push({func:e,args:null!=(t=null==l||null==(a=l.compute)||null==(n=a.queries)||null==(i=n.find(t=>t.id===e.id))?void 0:i.args)?t:{}})});let v=a.div([],{classes:"statistics-compute-dialog-host"}),b=[],w=a.tree(),A=a.wait(()=>ez(function*(){try{if(!c)return a.divText("No descriptors provider configured");let f=yield c();w.root.classList.add("statistics-compute-dialog-descriptors-group");let y=Object.keys(f),v=null!=(n=null==l||null==(o=l.compute)||null==(r=o.descriptors)?void 0:r.args)?n:[];var e=!0,t=!1,i=void 0;try{for(var n,r,o,s,u=y[Symbol.iterator]();!(e=(s=u.next()).done);e=!0){let e=s.value,t=function(e,t){let i=t.group(e,null,!1);return i.enableCheckBox(!1),i}(e,w);var p=!0,d=!1,m=void 0;try{for(var h,g=f[e].descriptors[Symbol.iterator]();!(p=(h=g.next()).done);p=!0){let e=h.value,i=t.item(e.name,e);b.push(i),i.enableCheckBox(v.includes(e.name))}}catch(e){d=!0,m=e}finally{try{p||null==g.return||g.return()}finally{if(d)throw m}}}}catch(e){t=!0,i=e}finally{try{e||null==u.return||u.return()}finally{if(t)throw i}}return w.root}catch(e){console.error(e)}return a.divText("Failed to load descriptors")})());A.classList.add("oy-scroll");let C="Descriptors",E={[C]:C},T={[C]:A},x={},S={[C]:!1};S[C]=!!(null==l||null==(D=l.compute)||null==(V=D.descriptors)?void 0:V.enabled)&&(null==l||null==(L=l.compute)||null==(_=L.descriptors)||null==(j=_.args)?void 0:j.length)>0;let O={};var P,N,F,B=!0,I=!1,k=void 0;try{for(var V,D,j,_,L,M,H,R,U,q,Y,G,W,J,z,Q,K,Z,X,ee,et,ei,en,ea,er=y[Symbol.iterator]();!(B=(ea=er.next()).done);B=!0){let e=ea.value;try{let t=e.func,i=t.prepare(e.args),n=t.type===eo?`${t.package.name}:${t.name}`:t.type===el?`${eu}:${null!=(M=t.name)?M:""}:${t.id}`:`${ec}:${null!=(H=t.name)?H:""}:${t.id}`;x[n]=i;let r=a.div();a.setUpdateIndicator(r,!0),i.buildEditor(r,{condensed:!1}).then(i=>{var n,a;(null==i||null==(n=i[0])?void 0:n.root)&&(i[0].root.style.display="none"),(null==i||null==(a=i[1])?void 0:a.root)&&t.type!==es&&(i[1].root.style.display="none"),i.forEach(t=>{var i,n;(null==(i=t.property)?void 0:i.name)&&Object.keys(e.args).includes(null==(n=t.property)?void 0:n.name)&&(t.value=e.args[t.property.name]),t.fireChanged()})}).catch(e=>{console.error(e),a.setUpdateIndicator(r,!1),r.appendChild(a.divText("Failed to build function editor"))}).finally(()=>a.setUpdateIndicator(r,!1)),r.classList.add("oy-scroll"),r.style.marginLeft="15px",r.style.removeProperty("max-width"),E[null!=(R=t.friendlyName)?R:t.name]=n,S[n]=null!=(U=(null==l||null==(W=l.compute)||null==(G=W.functions)?void 0:G.some(t=>e.func.type===eo&&t.name===e.func.name&&t.package===eh(e.func)))||(null==l||null==(z=l.compute)||null==(J=z.scripts)?void 0:J.some(e=>e.id===t.id))||(null==l||null==(K=l.compute)||null==(Q=K.queries)?void 0:Q.some(e=>e.id===t.id)))&&U,O[n]=null!=(q=(null==l||null==(X=l.compute)||null==(Z=X.functions)?void 0:Z.some(e=>`${e.package}:${e.name}`===n&&e.rerunOnOpen))||(null==l||null==(et=l.compute)||null==(ee=et.scripts)?void 0:ee.some(e=>`${eu}:${e.name}:${e.id}`===n&&e.rerunOnOpen))||(null==l||null==(en=l.compute)||null==(ei=en.queries)?void 0:ei.some(e=>`${ec}:${e.name}:${e.id}`===n&&e.rerunOnOpen)))&&q,T[null!=(Y=t.friendlyName)?Y:t.name]=function(e,t){if(!m||e===C)return t;let i=a.input.bool(m.label,{value:!!O[e],onValueChanged:t=>{O[e]=!!t}});return i.setTooltip(m.tooltip),i.root.classList.add("statistics-compute-dialog-rerun-input"),a.divV([i.root,t])}(n,r)}catch(e){console.error(e);continue}}}catch(e){I=!0,k=e}finally{try{B||null==er.return||er.return()}finally{if(I)throw k}}let ep=a.tabControl(T,{vertical:!0});ep.onTabChanged.subscribe(()=>{try{ep.currentPane.content.style.removeProperty("max-width")}catch(e){}}),ep.header.style.overflow="scroll",ep.root.style.width="100%",ep.root.style.minWidth="350px",v.appendChild(ep.root);let ed=[];function eg(e){var t,i;ep.clear();let n=null!=(t=e.order)?t:Object.keys(T);0===n.length&&(n=Object.keys(T)),n.forEach(e=>{T[e]&&ep.addPane(e,()=>T[e])}),Object.keys(T).forEach(t=>{var i;n.includes(t)||!T[t]||(null!=(i=e.hidden)?i:[]).includes(t)||ep.addPane(t,()=>T[t])}),(null!=(i=e.hidden)?i:[]).forEach(e=>{S[E[e]]=!1}),ed=[],ep.panes.forEach(e=>{let t=E[e.name],i=!!S[t],n=i=>{var n,a;if(d&&i)for(let e=0;e<ed.length;e++)E[ep.panes[e].name]!==t&&(ed[e].value=null),S[E[ep.panes[e].name]]=!1;S[t]=i,i?null==(a=eq()(e.content).find("input"))||a.removeAttr("disabled"):null==(n=eq()(e.content).find("input"))||n.attr("disabled","true")},r=d?a.input.radio("",{items:[""],value:i?"":void 0,onValueChanged:e=>n(""===e)}):a.input.bool("",{value:i,onValueChanged:e=>n(!!e)});r.setTooltip("Toggle calculation of this function"),ed.push(r),e.header.appendChild(r.root),e.header.classList.add("statistics-compute-dialog-pane-header")}),ep.panes.length>0&&(ep.currentPane=ep.panes[0])}function ef(){let e={descriptors:[],externals:{},scripts:{},queries:{}};m&&(e.rerunOnOpen={},Object.keys(O).forEach(t=>{S[t]&&O[t]&&(e.rerunOnOpen[t]=!0)})),e.descriptors=S[C]?b.filter(e=>e.checked).map(e=>e.value.name):[];let t=Object.entries(x).filter(e=>{let t=eQ(e,2),i=t[0];return t[1],S[i]});t.filter(e=>{let t=eQ(e,2),i=t[0];return t[1],!i.startsWith(eu)&&!i.startsWith(ec)}).forEach(t=>{let i=eQ(t,2),n=i[0],a=i[1];e.externals[n]={},Object.entries(a.inputs).slice(2).forEach(t=>{let i=eQ(t,2),a=i[0],r=i[1];e.externals[n][a]=r})}),t.filter(e=>{let t=eQ(e,2),i=t[0];return t[1],i.startsWith(eu)}).forEach(t=>{let i=eQ(t,2),n=i[0],a=i[1];e.scripts[n]={},Object.entries(a.inputs).slice(2).forEach(t=>{let i=eQ(t,2),a=i[0],r=i[1];e.scripts[n][a]=r})}),t.filter(e=>{let t=eQ(e,2),i=t[0];return t[1],i.startsWith(ec)}).forEach(t=>{let i=eQ(t,2),n=i[0],a=i[1];e.queries[n]={},Object.entries(a.inputs).slice(1).forEach(t=>{let i=eQ(t,2),a=i[0],r=i[1];e.queries[n][a]=r})}),console.log(e),i(e)}return eg(em(f)),ep.root.appendChild((P=Object.keys(T),N=e=>{eg(e)},e=em(f),(t=r.DataFrame.fromColumns(P.map(e=>r.Column.fromStrings(e,[e])))).columns.setOrder(null!=(F=e.order)?F:[]),(s=a.input.columns("reorder",{table:t,value:t.columns.toList().filter(t=>!e.hidden.includes(t.name))})).onChanged.subscribe(()=>{try{let e=s.value.map(e=>e.name),i=P.filter(t=>!e.includes(t)),n={order:s.value.map(e=>e.name),hidden:i};t.columns.setOrder(n.order),localStorage.setItem(f,JSON.stringify(n)),N(n)}catch(e){console.error(e)}}),h=Array.from(s.root.children),setTimeout(()=>{h.forEach(e=>{e.style.maxWidth="0px",e.style.overflow="hidden",e.style.padding="0px",e.style.paddingRight="0px",e.style.visibility="hidden",e instanceof HTMLLabelElement&&(e.style.display="none")})},200),s.root.style.justifyContent="end",s.root.style.width="40px",s.root.style.height="0px",s.root.style.overflow="visible",s.root.style.padding="0px",g=a.icons.edit(()=>{h.forEach(e=>{e.click()})},"Order or hide functions"),s.addOptions(g),Array.from(s.root.children).forEach(e=>{e.style.borderBottom="unset"}),g.style.fontSize="16px",s.root)),o&&a.dialog("Compute").add(v).onOK(()=>ef()).onCancel(n).show({resizable:!0}),{root:v,okProxy:ef}})()},function(){var e=this,t=arguments;return new Promise(function(i,n){var a=u.apply(e,t);function r(e){eK(a,i,n,r,l,"next",e)}function l(e){eK(a,i,n,r,l,"throw",e)}r(void 0)})})()}eG.styleTagTransform=en(),eG.setAttributes=X(),eG.insert=K().bind(null,"head"),eG.domAPI=z(),eG.insertStyleElement=et(),W()(eY.A,eG),eY.A&&eY.A.locals&&eY.A.locals;let eX=rxjs;class e0{get root(){return this._root}get items(){return this._items}set items(e){this._items=e,this.render()}addItem(e,t){this._items.push(e),this.render(),(void 0===t||t)&&this.onItemAdded.next(e)}removeItem(e,t){-1!==this._items.indexOf(e)&&(this._items.splice(this._items.indexOf(e),1),this.render(),(void 0===t||t)&&this.onItemRemoved.next(e))}removeAtIndex(e,t){if(e<0||e>=this._items.length)return;let i=this._items.splice(e,1);this.render(),(void 0===t||t)&&this.onItemRemoved.next(i[0])}removeAllItems(){this._items=[],this.render()}render(){if(a.empty(this._root),!this.options.horizontalInputNames){var e=!0,t=!1,i=void 0;try{for(var n,r,l,o=this.properties[Symbol.iterator]();!(e=(l=o.next()).done);e=!0){let e=l.value,t=null!=(n=e.caption)?n:e.name;(null==(r=this.options.customLabels)?void 0:r[e.name])&&(t=this.options.customLabels[e.name]);let i=a.divText(t);i.style.fontWeight="bold",this._root.appendChild(i)}}catch(e){t=!0,i=e}finally{try{e||null==o.return||o.return()}finally{if(t)throw i}}}var s=!0,u=!1,c=void 0;try{for(var p,d=this._items[Symbol.iterator]();!(s=(p=d.next()).done);s=!0){let e=p.value,t=this.getItemDiv(e);var m=!0,h=!1,g=void 0;try{for(var f,y=t[Symbol.iterator]();!(m=(f=y.next()).done);m=!0){let e=f.value;this._root.appendChild(e)}}catch(e){h=!0,g=e}finally{try{m||null==y.return||y.return()}finally{if(h)throw g}}}}catch(e){u=!0,c=e}finally{try{s||null==d.return||d.return()}finally{if(u)throw c}}if(this.options.allowAdd){let e=this.getItemDiv(null!=(A=null==(C=(E=this.options).newItemFunction)?void 0:C.call(E))?A:void 0,!0);var v=!0,b=!1,w=void 0;try{for(var A,C,E,T,x=e[Symbol.iterator]();!(v=(T=x.next()).done);v=!0){let e=T.value;this._root.appendChild(e)}}catch(e){b=!0,w=e}finally{try{v||null==x.return||x.return()}finally{if(b)throw w}}}}get addingItem(){let e={};return Object.keys(this.addingItemInputs).forEach(t=>{e[t]=this.addingItemInputs[t].value}),e}getItemDiv(e,t){let i=void 0===e?{}:e,n=[],l={},o=null;var s=!0,u=!1,c=void 0;try{for(var p,d,m,h=this.properties[Symbol.iterator]();!(s=(m=h.next()).done);s=!0){let e=m.value;void 0===i[e.name]&&(i[e.name]=null);let s=(null==(p=this.options.customInputs)?void 0:p[e.name])?this.options.customInputs[e.name](i):a.input.forProperty(e,i),u=null==(d=this.options.validators)?void 0:d[e.name];u&&s.addValidator(u),n.push(this.options.horizontalInputNames?s.root:this.hideLabel(s.root)),e.propertyType!==r.TYPE.BOOL&&"color"!==e.name.toLowerCase()&&s.input&&(s.input.style.width="100%"),l[e.name]=s,s.onChanged.subscribe(()=>{i[e.name]=s.value,t?this.onAddingItemChanged.next({item:i,fieldName:e.name}):this.onItemChanged.next({item:i,fieldName:e.name})}),s.root.style.alignItems="center",o=s}}catch(e){u=!0,c=e}finally{try{s||null==h.return||h.return()}finally{if(u)throw c}}let g=null;if(t)this.addingItemInputs=l,g=a.icons.add(()=>{let e=this.options.newItemFunction?this.options.newItemFunction():{};Object.keys(l).forEach(t=>{e[t]=l[t].value}),this._items.push(e),this.onItemAdded.next(e),this.render()},this.options.addButtonTooltip);else{if(!this.options.allowRemove)return n;g=a.icons.delete(()=>{this._items.splice(this._items.indexOf(i),1),this.onItemRemoved.next(i),this.render()},this.options.removeButtonTooltip)}return o&&o.addOptions?o.addOptions(g):null==o||o.root.appendChild(g),g.style.color="#2083d5",n}hideLabel(e){return e.getElementsByTagName("label")[0]&&e.removeChild(e.getElementsByTagName("label")[0]),e}hasErrors(){return this._root.querySelectorAll(".d4-invalid").length>0}constructor(e,t,i){this.onItemChanged=new eX.Subject,this.onAddingItemChanged=new eX.Subject,this.onItemAdded=new eX.Subject,this.onItemRemoved=new eX.Subject,this.options={removeButtonTooltip:"Remove item",addButtonTooltip:"Add item",allowAdd:!0,allowRemove:!0},this.addingItemInputs={},this.properties=e,this.options=function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{},n=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(i).filter(function(e){return Object.getOwnPropertyDescriptor(i,e).enumerable}))),n.forEach(function(t){var n;n=i[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},this.options,void 0===i?{}:i),this._root=a.divV([],{style:{display:"grid",gridTemplateColumns:`repeat(${this.properties.length}, 1fr)`,alignItems:"center",gap:"12px"},classes:"ui-items-grid"}),this._items=void 0===t?[]:t,this.render()}}function e1(e,t,i,n,a,r,l){try{var o=e[r](l),s=o.value}catch(e){i(e);return}o.done?t(s):Promise.resolve(s).then(n,a)}function e2(){let e=r.Property.fromOptions({name:"layout",caption:"Layout",type:"file"}),i=r.InputBase.forProperty(e),n=null,l=null,o=null,s=null;return i.onChanged.subscribe(e=>{var a;return(a=function*(){let e=i.value;if(e){try{o=e.fullPath&&(yield t.dapi.files.exists(e.fullPath))?e.fullPath:null}catch(e){o=null}try{let t=yield e.readAsString(),i=r.ViewLayout.fromJson(t);i?(n=i,l=i.viewState,s=null):(n=null,l=null,o=null,s="Invalid layout file")}catch(e){n=null,l=null,o=null,s="Invalid layout file"}i.input.classList[s?"add":"remove"]("d4-invalid")}else n=null,l=null,o=null},function(){var e=this,t=arguments;return new Promise(function(i,n){var r=a.apply(e,t);function l(e){e1(r,i,n,l,o,"next",e)}function o(e){e1(r,i,n,l,o,"throw",e)}l(void 0)})})()}),a.tooltip.bind(i.root,()=>s||"Select a layout file"),{dataFileInput:i,getLayout:()=>n,getLayoutViewState:()=>l,getLocalFilePath:()=>o}}function e4(e,t,i,n,a,r,l){try{var o=e[r](l),s=o.value}catch(e){i(e);return}o.done?t(s):Promise.resolve(s).then(n,a)}function e5(e){return function(){var t=this,i=arguments;return new Promise(function(n,a){var r=e.apply(t,i);function l(e){e4(r,n,a,l,o,"next",e)}function o(e){e4(r,n,a,l,o,"throw",e)}l(void 0)})}}function e3(e){let t=new e0([r.Property.fromOptions({name:"Name",type:r.TYPE.STRING}),r.Property.fromOptions({name:"Type",type:r.TYPE.STRING,choices:Object.keys(eL)}),r.Property.fromOptions({name:"Required",type:r.TYPE.BOOL})],e?e.map(e=>({Name:e.name,Type:e.type,Required:e.required})):void 0,{horizontalInputNames:!1});t.root.style.maxWidth="750px";let i={};t.onItemAdded.subscribe(e=>{i={}}),t.onAddingItemChanged.subscribe(e=>{e&&(i=e.item)});let n=a.h2("Additional fields");a.tooltip.bind(n,"Additional fields to be filled by user for each campaign");let l=a.div([n,t.root]);return{getFields:function(){let e=t.items.filter(e=>e.Name).map(e=>{var t;return{name:e.Name,type:e.Type,required:null!=(t=e.Required)&&t}});if(i.Name&&""!==i.Name&&i.Type){var n;null!=(n=i).Required||(n.Required=!1),e.push({name:i.Name,type:i.Type,required:i.Required})}return e},fieldsDiv:a.div([l])}}function e8(e,t,i,n,a,r,l){try{var o=e[r](l),s=o.value}catch(e){i(e);return}o.done?t(s):Promise.resolve(s).then(n,a)}function e6(e){return function(){var t=this,i=arguments;return new Promise(function(n,a){var r=e.apply(t,i);function l(e){e8(r,n,a,l,o,"next",e)}function o(e){e8(r,n,a,l,o,"throw",e)}l(void 0)})}}class e9 extends r.ViewBase{get template(){return this.app.template}onActivated(){}onReset(){}process(){return e6(function*(){})()}deleteCampaign(e,t){return e6(function*(){var i;yield nh.files.delete(`${e}/campaigns/${t}`),null==(i=nh.campaignsCache[e])||delete i[t]})()}deleteCampaignAndRefresh(e,t){return e6(function*(){var i;yield this.deleteCampaign(e,t),this.deletedCampaigns.push(t),yield null==(i=this.init)?void 0:i.call(this)}).call(this)}constructor(e){super(),this.deletedCampaigns=[],this.app=e}}var e7=i(312),te={};function tt(e,t,i,n,a,r,l){try{var o=e[r](l),s=o.value}catch(e){i(e);return}o.done?t(s):Promise.resolve(s).then(n,a)}function ti(e,t,i,n,a,r,l){try{var o=e[r](l),s=o.value}catch(e){i(e);return}o.done?t(s):Promise.resolve(s).then(n,a)}function tn(e){return function(){var t=this,i=arguments;return new Promise(function(n,a){var r=e.apply(t,i);function l(e){ti(r,n,a,l,o,"next",e)}function o(e){ti(r,n,a,l,o,"throw",e)}l(void 0)})}}te.styleTagTransform=en(),te.setAttributes=X(),te.insert=K().bind(null,"head"),te.domAPI=z(),te.insertStyleElement=et(),W()(e7.A,te),e7.A&&e7.A.locals&&e7.A.locals,(B=e=(F=D||(D={})).panels||(F.panels={})).vert=function(e,t){return r._options(a.divV(e.map(e=>a.render(e)),{classes:"u2-panel"}),t)},B.horz=function(e,t){return r._options(a.divH(e.map(e=>a.render(e)),{classes:"u2-panel"}),t)},F.appHeader=function(t){let i=a.iconImage("",t.iconPath);eq()(i).addClass("ui-app-header-icon").css("margin-right","20px"),t.iconSize&&(i.style.width=`${t.iconSize}px`,i.style.height=`${t.iconSize}px`);let n=e.horz([],{classes:"ui-app-header"});if(t.appTitle){n.classList.add("u2-app-header-with-name");let e=a.divV([a.divText(t.appTitle,"u2-app-header-app-name-div")],"u2-app-header-app-name-and-slogan-div");t.appSubTitle&&e.append(a.divText(t.appSubTitle));let r=a.div(i);n.append(a.divH([r,e]))}else n.append(i);let r=e.vert([a.markdown(t.description),t.learnMoreUrl?a.link("Learn more",t.learnMoreUrl,void 0,{style:{marginLeft:"15px"}}):null]);return r.classList.add("u2-app-header-description"),n.append(r),t.bottomLine&&n.classList.add("u2-app-header-bottom-line"),n},(F.tools||(F.tools={})).runAsync=function(e,i){var n;return(n=function*(){a.setUpdateIndicator(e,!0);try{return yield i()}catch(e){t.log.error(e)}finally{a.setUpdateIndicator(e,!1)}},function(){var e=this,t=arguments;return new Promise(function(i,a){var r=n.apply(e,t);function l(e){tt(r,i,a,l,o,"next",e)}function o(e){tt(r,i,a,l,o,"throw",e)}l(void 0)})})()};let ta={view:[r.Group.defaultGroupsIds["All users"]],edit:[r.Group.defaultGroupsIds["All users"]]};class tr{getDialogContent(){return tn(function*(){let e=[],i=[];for(let i of this.permissions.view){let n=yield t.dapi.groups.find(i);n&&e.push(n)}for(let e of this.permissions.edit){let n=yield t.dapi.groups.find(e);n&&i.push(n)}return this.editGroupsInput.value=i,this.viewGroupsInput.value=e,a.divV([this.viewGroupsInput.root,this.editGroupsInput.root])}).call(this)}show(e){return tn(function*(){var t;let i=yield this.getDialogContent(),n=a.dialog("Edit Permissions").add(i).onOK(()=>{let t=new Set(this.editGroupsInput.value.map(e=>e.id)),i=new Set(this.viewGroupsInput.value.map(e=>e.id));this.permissions.edit=Array.from(t),t.forEach(e=>i.add(e)),this.permissions.view=Array.from(i),0===this.permissions.view.length&&(this.permissions.view=ta.view),e(this.permissions)});(null==(t=i.parentElement)?void 0:t.style)&&(i.parentElement.style.overflow="visible"),n.show()}).call(this)}constructor(e){this.permissions=null!=e?e:ta,this.editGroupsInput=a.input.userGroups("Can Edit"),this.editGroupsInput.root.style.marginBottom="16px",this.viewGroupsInput=a.input.userGroups("Can View")}}function tl(e,t,i,n,a,r,l){try{var o=e[r](l),s=o.value}catch(e){i(e);return}o.done?t(s):Promise.resolve(s).then(n,a)}function to(e){return function(){var t=this,i=arguments;return new Promise(function(n,a){var r=e.apply(t,i);function l(e){tl(r,n,a,l,o,"next",e)}function o(e){tl(r,n,a,l,o,"throw",e)}l(void 0)})}}function ts(e,t,i,n,a,r,l){try{var o=e[r](l),s=o.value}catch(e){i(e);return}o.done?t(s):Promise.resolve(s).then(n,a)}function tu(e){return function(){var t=this,i=arguments;return new Promise(function(n,a){var r=e.apply(t,i);function l(e){ts(r,n,a,l,o,"next",e)}function o(e){ts(r,n,a,l,o,"throw",e)}l(void 0)})}}(I=j||(j={})).acquireCampaignLock=function(e,i,n){return to(function*(){return yield t.data.query("HitTriage:AcquireCampaignLock",{appName:e,campaignId:i,lockedBy:n})})()},I.releaseCampaignLock=function(e,i){return to(function*(){return yield t.data.query("HitTriage:ReleaseCampaignLock",{appName:e,campaignId:i})})()},I.getLastModified=function(e,i){return to(function*(){return yield t.data.query("HitTriage:GetLastModified",{appName:e,campaignId:i})})()},I.addMolecule=function(e,i,n,a){return to(function*(){return yield t.data.query("HitTriage:AddMolecule",{canonicalSmiles:e,appName:i,campaignId:n,createdBy:a})})()},I.addMolecules=function(e,i,n,a){return to(function*(){return yield t.data.query("HitTriage:AddMolecules",{smiles:e,appName:i,campaignId:n,createdBy:a})})()},I.getMoleculeByVid=function(e){return to(function*(){return yield t.data.query("HitTriage:GetMoleculeByVid",{vid:e})})()},I.getCampaignsByVid=function(e,i){return to(function*(){return yield t.data.query("HitTriage:GetCampaignsByVid",{vid:e,appName:i})})()},(k=_||(_={})).initHT=function(){return to(function*(){return yield t.functions.call("HitTriage:InitHT",{})})()},k.hitTriageAppTreeBrowser=function(e){return to(function*(){return yield t.functions.call("HitTriage:HitTriageAppTreeBrowser",{treeNode:e})})()},k.hitDesignAppTreeBrowser=function(e){return to(function*(){return yield t.functions.call("HitTriage:HitDesignAppTreeBrowser",{treeNode:e})})()},k.peptiHitAppTreeBrowser=function(e){return to(function*(){return yield t.functions.call("HitTriage:PeptiHitAppTreeBrowser",{treeNode:e})})()},k.hitTriageApp=function(){return to(function*(){return yield t.functions.call("HitTriage:HitTriageApp",{})})()},k.hitDesignApp=function(){return to(function*(){return yield t.functions.call("HitTriage:HitDesignApp",{})})()},k.peptiHitApp=function(){return to(function*(){return yield t.functions.call("HitTriage:PeptiHitApp",{})})()},k.pepTriageAppTreeBrowser=function(e){return to(function*(){return yield t.functions.call("HitTriage:PepTriageAppTreeBrowser",{treeNode:e})})()},k.pepTriageApp=function(){return to(function*(){return yield t.functions.call("HitTriage:PepTriageApp",{})})()},k.demoFileIngest=function(){return to(function*(){return yield t.functions.call("HitTriage:DemoFileIngest",{})})()},k.demoFileIngest1=function(){return to(function*(){return yield t.functions.call("HitTriage:DemoFileIngest1",{})})()},k.demoFileIngest2=function(e){return to(function*(){return yield t.functions.call("HitTriage:DemoFileIngest2",{numberOfMolecules:e})})()},k.demoPeptideSequences=function(e){return to(function*(){return yield t.functions.call("HitTriage:DemoPeptideSequences",{peptideCount:e})})()},k.demoFileSubmit=function(e,i){return to(function*(){return yield t.functions.call("HitTriage:DemoFileSubmit",{df:e,molecules:i})})()},k.registerMoleculesToViD=function(){return to(function*(){return yield t.functions.call("HitTriage:RegisterMoleculesToViD",{})})()},k.hitDesignVidPanel=function(e){return to(function*(){return yield t.functions.call("HitTriage:HitDesignVidPanel",{vid:e})})()},k.gasteigerCellRenderer=function(){return to(function*(){return yield t.functions.call("HitTriage:GasteigerCellRenderer",{})})()},k.htPackageSettingEditor=function(e){return to(function*(){return yield t.functions.call("HitTriage:HtPackageSettingEditor",{propList:e})})()};class tc{get canEdit(){return this.hasEditPermission}get appName(){return this._appName}setCanEdit(e){return tu(function*(){if(!e.authorUserId||!e.permissions){this.hasEditPermission=!0;return}this.hasEditPermission=yield eT(e.authorUserId,e.permissions)}).call(this)}getFilterType(e){let t=this.dataFrame.col(e);return(null==t?void 0:t.semType)===r.SEMTYPE.MOLECULE?r.FILTER_TYPE.SUBSTRUCTURE:(null==t?void 0:t.type)===r.COLUMN_TYPE.BOOL?r.FILTER_TYPE.BOOL_COLUMNS:(null==t?void 0:t.type)===r.COLUMN_TYPE.STRING?r.FILTER_TYPE.CATEGORICAL:r.FILTER_TYPE.HISTOGRAM}download(e,t,i=!1){let n=document.createElement("a"),a=r.DataFrame.fromColumns(e.columns.toList().filter(e=>!e.name.startsWith("~"))).toCsv({filteredRowsOnly:i});n.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(a)),n.setAttribute("download",t+".csv"),n.click()}getNewCampaignName(e,t){return tu(function*(){let i=(yield nh.files.list(e)).map(e=>e.name).filter(e=>e.startsWith(`${t}-`)&&!!parseInt(e.substring(t.length+1)));if(0===i.length)return t+"-1";let n=i.map(e=>e.substring(t.length+1)).filter(Boolean).map(e=>parseInt(e,10)).sort((e,t)=>e-t);return t+"-"+(n[n.length-1]+1).toString()})()}setBaseUrl(){let e=document.title;if(history.replaceState){let t={Title:e,Url:this.baseUrl};history.replaceState(t,t.Title,t.Url)}}unionDataframes(e,t,i,n){var a,l,o,s;let u=i;e.col(i).name=n,i=n;let c=null==(l=e.col(i))||null==(a=l.toList())?void 0:a.map(e=>nh.convertToSmiles(e)),p=null==(s=t.col(n))||null==(o=s.toList())?void 0:o.map(e=>nh.convertToSmiles(e));if(!c||!p)throw Error("Molecule column not found");let d=new Map;p.forEach((e,t)=>{e&&"MALFORMED_INPUT_VALUE"!==e&&d.set(e,t)});let m=(e,t,i,n)=>{try{if(e.type===t.type)e.set(i,t.get(n),!1);else if(e.type===r.COLUMN_TYPE.STRING)e.set(i,t.getString(n),!1);else if(e.type===r.COLUMN_TYPE.INT){let a=t.get(n);"number"==typeof a?e.set(i,Math.round(a),!1):"string"==typeof a&&a.length>0&&!isNaN(Number(a))&&e.set(i,Math.round(Number(a)),!1)}else if(e.type===r.COLUMN_TYPE.FLOAT){let a=t.get(n);"number"==typeof a?e.set(i,a,!1):"string"==typeof a&&a.length>0&&!isNaN(Number(a))&&e.set(i,Number(a),!1)}else e.set(i,t.get(n),!1)}catch(a){nh.logger.error(`Error setting column value for column ${e.name} at row ${i} from column ${t.name} at row ${n}: ${a}`)}};this.isJoining=!0;try{let i=[];for(let n of e.columns)if(!t.columns.contains(n.name)){let e=t.columns.addNew(n.name,n.type);n.semType&&(e.semType=n.semType),i.push(n.name)}for(let n=0;n<c.length;n++)if(c[n]&&"MALFORMED_INPUT_VALUE"!==c[n])if(d.has(c[n])){if(i.length>0){let a=d.get(c[n]);for(let r of i)m(t.col(r),e.col(r),a,n)}}else for(let i of(t.rows.addNew(null,!0),e.columns))m(t.col(i.name),i,t.rowCount-1,n)}finally{setTimeout(()=>{this.isJoining=!1},500),e.col(i).name=u}return t}aquireAndWaitCampaignLock(e,t=3e4){return tu(function*(){let i=Date.now(),n=0,a=null,l=r.User.current(),o=l&&(l.friendlyName||l.name)||"unknown";for(;Date.now()-i<t&&n<5;)try{let t=yield j.acquireCampaignLock(this.appName,e,o);if(t&&t.rowCount>0){var s;return{aquired:!0,expires_at:null==t||null==(s=t.col("expires_at"))?void 0:s.getString(0)}}a=null,yield r.delay(200)}catch(e){a=e,n++}if(a)throw a;return{aquired:!1,expires_at:null}}).call(this)}releaseCampaignLock(e){return tu(function*(){var t,i;return(null==(i=yield j.releaseCampaignLock(this.appName,e))||null==(t=i.col("updated_at"))?void 0:t.getString(0))||null}).call(this)}constructor(e,t){this.parentCall=e,this.isJoining=!1,this.hasEditPermission=!1,this.baseUrl=new URL(window.location.href).origin+`/apps/HitTriage/${t.replace(" ","")}`,this._appName=t,this.computeFunctions=function(e){let t=Array.from(new Set(r.Func.find({meta:{role:e}}).concat(r.Func.find({tags:[e]})))),i=t.filter(e=>e.type===eo);return{functions:i,scripts:t.filter(e=>e.type===el),queries:t.filter(e=>e.type===es)}}("HitTriageFunction")}}function tp(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{},n=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(i).filter(function(e){return Object.getOwnPropertyDescriptor(i,e).enumerable}))),n.forEach(function(t){var n;n=i[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function td(e,t=!1){var i;let n=r.DataFrame.create(1);if(t){let e=n.columns.addNew(g,r.TYPE.STRING);e.semType=r.SEMTYPE.MACROMOLECULE,e.meta.units="helm",e.setTag("units","helm"),e.setTag("cell.renderer","helm"),e.setTag(".alphabetIsMultichar","true")}let a=n.columns.addNew(h,r.TYPE.STRING);return a.semType=r.SEMTYPE.MOLECULE,a.meta.units=r.UNITS.Molecule.SMILES,a.set(0,null),(null==e||null==(i=e.stages)?void 0:i.length)>0&&n.columns.addNew(m,r.TYPE.STRING).set(0,e.stages[0]),n.columns.addNew(f,r.TYPE.STRING),n}function tm(e,i=!1){var n;let l=td(e,i),o=e.campaignFields.map(e=>{var t,i;return e.type===r.SEMTYPE.MOLECULE?(t=tp({},e),i=i={type:"String",semtype:r.SEMTYPE.MOLECULE},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t.push.apply(t,i)}return t})(Object(i)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}),t):e}).map(e=>r.Property.fromOptions(tp({name:e.name,type:eL[e.type],nullable:!e.required},e.semtype?{semType:e.semtype}:{}))),s={},u=a.input.string("Campaign Name",{tooltipText:"New campaign name. If empty, campaign code will be used."}),c=a.input.form(s,o);c.prepend(u.root),c.classList.remove("ui-form");let p=a.div([...(null==(n=e.campaignFields)||n.length,[]),c]),d=a.buttonsInput([]);return p.appendChild(d),{promise:new Promise(i=>{let n=a.bigButton(w,()=>{for(let i of e.campaignFields)if(i.required&&(!s[i.name]||""===s[i.name]))return void t.shell.error(`Field '${i.name}' is required`);i({df:l,campaignProps:s,name:u.value})});d.appendChild(n)}),root:p,cancelPromise:new Promise(e=>{a.button(E,()=>e())})}}function th(e,t,i,n,a,r,l){try{var o=e[r](l),s=o.value}catch(e){i(e);return}o.done?t(s):Promise.resolve(s).then(n,a)}function tg(e){return function(){var t=this,i=arguments;return new Promise(function(n,a){var r=e.apply(t,i);function l(e){th(r,n,a,l,o,"next",e)}function o(e){th(r,n,a,l,o,"throw",e)}l(void 0)})}}function tf(e){let t=new e0([r.Property.fromOptions({name:"Name",type:r.TYPE.STRING})],e?e.map(e=>({Name:e})):void 0,{horizontalInputNames:!0}),i={};return t.onItemAdded.subscribe(e=>{i={}}),t.onAddingItemChanged.subscribe(e=>{e&&(i=e.item)}),{getFields:function(){let e=t.items.filter(e=>e.Name).map(e=>e.Name);return i.Name&&""!==i.Name&&e.push(i.Name),e},fieldsDiv:t.root,itemsGrid:t}}function ty(e,t,i,n,a,r,l){try{var o=e[r](l),s=o.value}catch(e){i(e);return}o.done?t(s):Promise.resolve(s).then(n,a)}function tv(e){return function(){var t=this,i=arguments;return new Promise(function(n,a){var r=e.apply(t,i);function l(e){ty(r,n,a,l,o,"next",e)}function o(e){ty(r,n,a,l,o,"throw",e)}l(void 0)})}}tc.molFileExtReaders=["sdf","mol","smi","mol2"].map(e=>{let t=r.Func.find({meta:{role:r.FUNC_TYPES.FILE_IMPORTER}}).concat(r.Func.find({tags:["file-handler"]})).find(t=>{var i;return(null==t||null==(i=t.options)?void 0:i.ext)&&"string"==typeof t.options.ext&&t.options.ext.split(",").includes(e)});return{ext:e,handlerFunc:t}}).filter(e=>e.handlerFunc);class tb extends e9{onActivated(){t.shell.windows.showHelp=!0,t.shell.windows.help.showHelp(nh.webRoot+"README_HD.md")}getAppHeader(){return D.appHeader({iconPath:nh.webRoot+"/images/icons/hit-design-icon.png",learnMoreUrl:"https://github.com/datagrok-ai/public/blob/master/packages/HitTriage/README_HD.md",description:"- Configure your own workflow using the template editor\n- Sketch molecules in the molecular spreadsheet\n- Annotate and share ideas with the team\n- Calculate different molecular properties\n- Save campaigns and continue from where you left off\n- Submit final selection to the function of your choice"})}refreshCampaignsTable(){return tv(function*(){if(null!=this.campaignsTableRoot){a.setUpdateIndicator(this.campaignsTableRoot,!0);try{let e=yield this.getCampaignsTable();a.setUpdateIndicator(this.campaignsTableRoot,!1),a.empty(this.campaignsTableRoot),this.campaignsTableRoot.appendChild(e)}catch(e){t.shell.error("Failed to update campaigns table"),console.error(e)}finally{a.setUpdateIndicator(this.campaignsTableRoot,!1)}}}).call(this)}init(e){return tv(function*(){a.setUpdateIndicator(this.root,!0);try{let t=a.h1(T),i=a.h1(x,{style:{marginLeft:"10px"}}),n=a.div(),l=a.divH([]),o=a.div([l,n],"ui-form"),s=yield this.getCampaignsTable();this.campaignsTableRoot=a.div([s],{style:{position:"relative"}});let u=a.iconFA("layer-group",()=>tv(function*(){let e=r.Menu.popup();Object.values(L).forEach(t=>{e.item(t,()=>tv(function*(){eO(O,t),yield this.refreshCampaignsTable()}).call(this))});let t=e.group("Campaign Fields"),i=yield nh.loadCampaigns(this.app.appName,this.deletedCampaigns),n=new Set;Object.values(i).forEach(e=>{e.campaignFields&&Object.keys(e.campaignFields).forEach(e=>n.add(e))}),Array.from(n).forEach(e=>{t.item(e,()=>tv(function*(){var t;t=`campaignFields.${e}`,eO(O,t),yield this.refreshCampaignsTable()}).call(this))}),e.show({element:d,x:120,y:d.offsetTop+30})}).call(this),"Group by");u.style.marginBottom="9px",u.style.marginLeft="8px",u.style.fontSize="15px",u.style.color="var(--blue-1)",a.tooltip.bind(u,()=>`Group Campaigns. Current: ${this.currentGroupping}`);let c=a.iconFA("eye",()=>tv(function*(){let e=r.Menu.popup(),t=yield nh.loadCampaigns(this.app.appName,this.deletedCampaigns),i=function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{},n=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(i).filter(function(e){return Object.getOwnPropertyDescriptor(i,e).enumerable}))),n.forEach(function(t){var n;n=i[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},M);delete i.Name,Object.values(t).forEach(e=>{e.campaignFields&&Object.keys(e.campaignFields).forEach(e=>{i[`campaignFields.${e}`]=t=>{var i,n;return null!=(i=null==(n=t.campaignFields)?void 0:n[e])?i:""}})});let n=eN().reduce((e,t)=>(e[t]=!0,e),{});Object.keys(i).filter(e=>!e.startsWith("campaignFields.")).forEach(t=>{var i;e.item(t,()=>{n[t]=!n[t],eF(Object.keys(n).filter(e=>n[e])),this.refreshCampaignsTable()},null,{check:null!=(i=n[t])&&i})});let a=e.group("Campaign Fields");Object.keys(i).filter(e=>e.startsWith("campaignFields.")).forEach(e=>{var t;a.item(e.replace("campaignFields.",""),()=>{n[e]=!n[e],eF(Object.keys(n).filter(e=>n[e])),this.refreshCampaignsTable()},null,{check:null!=(t=n[e])&&t})}),e.show({element:d,x:100,y:d.offsetTop+30})}).call(this),"View");a.tooltip.bind(c,"Edit visible columns in campaigns table"),c.style.marginBottom="9px",c.style.marginLeft="8px",c.style.fontSize="15px",c.style.color="var(--blue-1)";let p=a.iconFA("sync",()=>tv(function*(){yield this.refreshCampaignsTable()}).call(this),"Refresh");p.style.marginBottom="9px",p.style.marginLeft="8px",p.style.color="var(--blue-1)",a.tooltip.bind(p,()=>"Refresh campaigns table");let d=a.divH([t,c,u,p],{style:{alignItems:"center"}});eq()(this._contentRoot).empty(),this._contentRoot.appendChild(a.divV([d],{style:{marginLeft:"10px"}})),this._contentRoot.appendChild(this.campaignsTableRoot),this._contentRoot.appendChild(i),this._contentRoot.appendChild(o),yield this.startNewCampaign(n,l,e)}finally{a.setUpdateIndicator(this.root,!1)}}).call(this)}startNewCampaign(e,i,n){return tv(function*(){var r;let l=(yield nh.files.list(`${this.app.appName}/templates`)).filter(e=>e.name.endsWith(".json")).map(e=>e.name.slice(0,-5));n&&!l.includes(n.name)&&l.push(n.name);let o=null,s=!0,u=()=>tv(function*(){if(!s)return;let t=c.value,i=n&&n.name===t?n:yield e_(`${this.app.appName}/templates/${t}.json`);o=i;let a=yield this.getNewCampaignAccordeon(i);eq()(e).empty(),e.appendChild(a)}).call(this),c=a.input.choice("Template",{value:null!=(r=null==n?void 0:n.name)?r:l[0],items:l,onValueChanged:()=>tv(function*(){yield u()})()});c.root.style.width="100%";let p=a.icons.add(()=>{this.createNewTemplate()},b),d=a.icons.copy(()=>{o&&this.createNewTemplate(o)},"Clone template"),m=a.icons.delete(()=>{c.value&&!(c.items.length<2)&&a.dialog("Delete template").add(a.divText(`Are you sure you want to delete template ${c.value}?`)).onOK(()=>tv(function*(){try{let e=c.value;yield nh.files.delete(`${this.app.appName}/templates/${e}.json`),s=!1,c.items=c.items.filter(t=>t!==e),c.value=c.items[0],s=!0,yield u(),t.shell.info("Template "+e+" was deleted successfully")}catch(e){s=!0,t.shell.error("Failed to delete template "+c.value),console.error(e)}}).call(this)).show()},"Delete template");m.style.color="var(--blue-1)",p.style.color="#2083d5",c.addOptions(p),c.addOptions(d),c.addOptions(m),yield u(),eq()(i).empty(),i.appendChild(c.root)}).call(this)}checkCampaign(e){return tv(function*(){var t;let i=new URLSearchParams(location.search);if(!i.has(o)&&!e)return;let n=null!=e?e:i.get(o);if(!(yield nh.files.exists(`${this.app.appName}/campaigns/${n}/${u}`)))return;let a=JSON.parse((yield nh.files.readAsText(`${this.app.appName}/campaigns/${n}/${u}`)));if(a){if(a.authorUserId&&a.permissions&&!(yield ex(a.authorUserId,a.permissions)))return void this.app.setBaseUrl();this.app.campaign=a}let r=null!=(t=a.template)?t:yield e_(`${this.app.appName}/templates/${a.templateName}.json`);return yield this.app.setTemplate(r,n),e&&eb(o,e),a.template=r,a}).call(this)}getCampaignsTable(){return tv(function*(){var e;let i,n=yield nh.loadCampaigns(this.app.appName,this.deletedCampaigns),l=null!=(e=eS(O))?e:L.None,o=(i=eS(N))?JSON.parse(i):null,s=Object.values(n);o&&eP(s,o);let u=eV(s,l),c=eN();this.currentGroupping=l,this.app.existingStatuses=Array.from(new Set(s.map(e=>e.status).filter(e=>!!e)));let p=e=>{var i,n;let l=a.icons.delete(()=>tv(function*(){a.dialog("Delete campaign").add(a.divText(`Are you sure you want to delete campaign ${e.name}?`)).onOK(()=>tv(function*(){yield this.deleteCampaignAndRefresh(this.app.appName,e.name)}).call(this)).show()}).call(this),"Delete campaign"),o=a.iconFA("share",()=>tv(function*(){yield new tr(e.permissions).show(i=>tv(function*(){try{e.permissions=i,null!=e.authorUserId||(e.authorUserId=t.shell.user.id),yield nh.saveCampaignJson(this.app.appName,e),t.shell.info("Permissions updated for campaign "+e.name)}catch(i){t.shell.error("Failed to update permissions for campaign "+e.name),console.error(i)}}).call(this))}).call(this),"Manage campaign permissions");return l.style.display="none",o.style.display="none",eT(null!=(i=e.authorUserId)?i:r.User.current().id,null!=(n=e.permissions)?n:ta).then(e=>{e&&(l.style.display="inline-block",o.style.display="inline-block")}),l.style.color="var(--blue-1)",o.style.color="var(--blue-1)",[o,l]},d=a.table(Object.values(u).flat(),e=>{var t;return[a.link(null!=(t=e.friendlyName)?t:e.name,()=>this.setCampaign(e.name),"Continue Campaign",""),...c.map(t=>{var i,n,a;return t.startsWith("campaignFields.")?null!=(i=null==(a=e.campaignFields)?void 0:a[t.replace("campaignFields.","")])?i:"":null!=(n=M[t](e))?n:""}),...p(e)]},["Name",...c.map(e=>e.replace("campaignFields.","")),"",""]);return d.style.color="var(--grey-5)",d.style.marginLeft="24px",d.querySelectorAll("tr.header > td").forEach((e,t)=>{if(!e.textContent)return;let i=0===t?"Name":c[t-1];if(o&&i===o.columnName){let t=o.ascending?"↑":"↓";e.appendChild(a.span([t],{style:{fontSize:"12px",marginLeft:"2px"}}))}e.addEventListener("dblclick",()=>{var e;let t={columnName:i,ascending:!0};o&&i===o.columnName&&(t=o.ascending?{columnName:i,ascending:!1}:null),(e=t)?eO(N,JSON.stringify(e)):localStorage.removeItem(N),this.refreshCampaignsTable()})}),eD(d,u),d}).call(this)}setCampaign(e){return tv(function*(){let t=yield this.checkCampaign(e);this.app.campaign=t}).call(this)}getNewCampaignAccordeon(e){return tv(function*(){let{root:t,promise:i,cancelPromise:n}=tm(e);return i.then(t=>tv(function*(){var i,n;this.app.clearCampaign(),this.app.dataFrame=t.df,yield this.app.setTemplate(e),this.app.campaignProps=t.campaignProps;let a=(null==(i=t.name)?void 0:i.trim())?null==(n=t.name)?void 0:n.trim():void 0;yield this.app.saveCampaign(!1,!0,{friendlyName:a}),e.layoutViewState&&this.app.campaign&&(this.app.campaign.layout=e.layoutViewState)}).call(this)),n.then(()=>{this.init()}),t}).call(this)}createNewTemplate(e){return tv(function*(){a.setUpdateIndicator(this.root,!0);try{var i;let n=yield(i=this.app,tg(function*(){var n,l,o,s,u,c,d,m,h,g,f;let y=yield nh.files.list(`${i.appName}/templates`),v=!1,b=!1,w=y.map(e=>e.name.slice(0,-5)),C=[];for(let e of y)try{let t=JSON.parse((yield nh.files.readAsText(e)));C.push(t.key)}catch(e){console.error(e)}let T=Array.from(new Set(r.Func.find({meta:{role:p}}).concat(r.Func.find({tags:[p]})))),x={};T.forEach(e=>{var t;x[null!=(t=e.friendlyName)?t:e.name]=e});let S=a.input.choice("Submit function",{value:null,items:[null,...Object.keys(x)]});S.nullable=!0,S.value=null!=(n=null==e||null==(d=e.submit)?void 0:d.fName)?n:null,S.setTooltip("Select function to be called upon submitting");let O=a.divText("Template name is empty or already exists",{classes:"hit-triage-error-div"}),P=a.divText("Template key is empty or already exists",{classes:"hit-triage-error-div"}),N=e2();function F(){var e,t,i,n;if(""===B.value||w.includes(null!=(e=null==(t=B.value)?void 0:t.trim())?e:"")){let e=null!=(i=B.input.offsetLeft)?i:0,t=null!=(n=B.input.offsetWidth)?n:0;O.style.marginLeft=`${e}px`,O.style.width=`${t}px`,O.style.opacity="100%",O.style.borderTop="1px solid red",v=!0}else O.style.borderTop="none",O.style.opacity="0%",v=!1}let B=a.input.string("Name",{value:null!=(l=null==e?void 0:e.name)?l:"",onValueChanged:F});function I(){var e,t,i,n;if(""===k.value||C.includes(null!=(e=null==(t=k.value)?void 0:t.trim())?e:"")){let e=null!=(i=k.input.offsetLeft)?i:0,t=null!=(n=k.input.offsetWidth)?n:0;P.style.marginLeft=`${e}px`,P.style.width=`${t}px`,P.style.borderTop="1px solid red",P.style.opacity="100%",b=!0}else P.style.opacity="0%",P.style.borderTop="none",b=!1}let k=a.input.string("Key",{value:null!=(o=null==e?void 0:e.key)?o:"",onValueChanged:I});k.setTooltip("Template key used for campaign prefix"),B.setTooltip("Template name"),B.root.style.borderBottom="none",k.root.style.borderBottom="none",O.style.opacity="0%",P.style.opacity="0%";let V=null,D={compute:{descriptors:{enabled:!0,args:null!=(s=null==e||null==(h=e.compute)||null==(m=h.descriptors)?void 0:m.args)?s:[]},functions:null!=(u=null==e||null==(g=e.compute)?void 0:g.functions)?u:[]}},j=yield eZ(i,e=>{V=e},()=>null,D,!1,!0);j.root.classList.add("hit-triage-new-template-functions-input");let _=e3(null==e?void 0:e.campaignFields),L=tf(null==e?void 0:e.stages),M=a.divV([a.divV([B,O]),a.divV([k,P]),N.dataFileInput,_.fieldsDiv]),H=a.h2("Stages");a.tooltip.bind(H,'Define Stages for designed molecules. For example, "Design", "Synthesis", "Test", etc.');let R=a.h2("Compute");a.tooltip.bind(R,'Define functions to be calculated for each molecule. For example, "Descriptors", "Descriptors:Descriptors", etc.');let U=a.div([a.h2("Details"),M,H,L.fieldsDiv,R,j.root,a.h2("Submit"),S.root],"ui-form"),q=a.buttonsInput([]);U.appendChild(q);let Y=null!=(c=null==(f=q.getElementsByClassName("ui-input-editor"))?void 0:f[0])?c:q,G=new Promise(e=>{let t=a.button(E,()=>e());Y.appendChild(t)});return{root:U,template:new Promise(e=>{let n=a.bigButton(A,()=>tg(function*(){var n,a,r,l,o,s,u,c,p;if(F(),I(),j.okProxy(),v||!B.value||""===B.value)return void t.shell.error("Template name is empty or already exists");if(b||!k.value||""===k.value)return void t.shell.error("Template key is empty or already exists");let d=S.value?x[S.value]:void 0,m=function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{},n=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(i).filter(function(e){return Object.getOwnPropertyDescriptor(i,e).enumerable}))),n.forEach(function(t){var n;n=i[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({name:B.value,key:k.value,campaignFields:_.getFields(),stages:L.getFields(),layoutViewState:null!=(n=N.getLayoutViewState())?n:void 0,localLayoutPath:null!=(a=N.getLocalFilePath())?a:void 0,compute:{descriptors:{enabled:!!(null==V||null==(u=V.descriptors)?void 0:u.length),args:null!=(r=null==V?void 0:V.descriptors)?r:[]},functions:Object.entries(null!=(l=null==V?void 0:V.externals)?l:{}).map(([e,t])=>{var i;let n=e.split(":");return{name:n[1],package:n[0],args:t,rerunOnOpen:!!(null==V||null==(i=V.rerunOnOpen)?void 0:i[e])}}),scripts:Object.entries(null!=(o=null==V?void 0:V.scripts)?o:{}).filter(([e,t])=>e.startsWith(eu)&&3===e.split(":").length).map(([e,t])=>{var i,n,a;let r=e.split(":");return{name:null!=(i=r[1])?i:"",id:null!=(n=r[2])?n:"",args:t,rerunOnOpen:!!(null==V||null==(a=V.rerunOnOpen)?void 0:a[e])}}),queries:Object.entries(null!=(s=null==V?void 0:V.queries)?s:{}).filter(([e,t])=>e.startsWith(ec)&&3===e.split(":").length).map(([e,t])=>{var i,n,a;let r=e.split(":");return{name:null!=(i=r[1])?i:"",id:null!=(n=r[2])?n:"",args:t,rerunOnOpen:!!(null==V||null==(a=V.rerunOnOpen)?void 0:a[e])}})}},d?{submit:{fName:d.name,package:eh(d)}}:{});yield(c=m,p=i.appName,tg(function*(){yield nh.files.writeAsText(`${p}/templates/${c.name}.json`,JSON.stringify(c))})()),t.shell.info("Template created successfully"),e(m)})());Y.appendChild(n)}),cancelPromise:G}})()),l=new r.ViewBase,o=t.shell.v;l.name="New Template",l.root.appendChild(n.root),l.parentCall=this.app.parentCall,t.shell.addView(l),l.path=new URL(this.app.baseUrl).pathname+"/new-template";let{sub:s}=ew(l,this.app.appName,b,()=>tv(function*(){t.shell.v=o,l.close()})());n.template.then(e=>tv(function*(){yield this.init(e),l.close(),eA(l),t.shell.v=o,s.unsubscribe()}).call(this)),n.cancelPromise.then(()=>tv(function*(){s.unsubscribe(),l.close(),t.shell.v=o})())}finally{a.setUpdateIndicator(this.root,!1)}}).call(this)}constructor(e){super(e),this.currentGroupping="None",this._appHeader=null,this._contentRoot=a.div([],{classes:"hit-triage-info-view-container"}),this.campaignsTableRoot=null,this.name="Hit Design",this.aiDescription=iC(e.appName),this._appHeader=this.getAppHeader(),this.root.appendChild(a.div([this._appHeader],{style:{marginLeft:"10px"}})),this.root.appendChild(this._contentRoot),t.shell.windows.showHelp=!0,t.shell.windows.help.showHelp(nh.webRoot+"README_HD.md"),this.checkCampaign().then(e=>{this.app.campaign=e,this.init()})}}function tw(e,t,i,n,a,r,l){try{var o=e[r](l),s=o.value}catch(e){i(e);return}o.done?t(s):Promise.resolve(s).then(n,a)}function tA(e){return function(){var t=this,i=arguments;return new Promise(function(n,a){var r=e.apply(t,i);function l(e){tw(r,n,a,l,o,"next",e)}function o(e){tw(r,n,a,l,o,"throw",e)}l(void 0)})}}function tC(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{},n=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(i).filter(function(e){return Object.getOwnPropertyDescriptor(i,e).enumerable}))),n.forEach(function(t){var n;n=i[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function tE(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t.push.apply(t,i)}return t})(Object(t)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(t,i))}),e}function tT(e,t,i,n,a,r,l){try{var o=e[r](l),s=o.value}catch(e){i(e);return}o.done?t(s):Promise.resolve(s).then(n,a)}function tx(e){return function(){var t=this,i=arguments;return new Promise(function(n,a){var r=e.apply(t,i);function l(e){tT(r,n,a,l,o,"next",e)}function o(e){tT(r,n,a,l,o,"throw",e)}l(void 0)})}}function tS(){return{convertToSmiles:e=>nh.convertToSmiles(e),logger:nh.logger,molColName:h}}function tO(e,i,n){return tx(function*(e,i,n,a=[],l=[]){return function(e,i,n,a){return tA(function*(e,i,n,a,l,o){let s=r.TaskBarProgressIndicator.create("Calculating ..."),u=null!=(b=null==o?void 0:o.convertToSmiles)?b:e=>e,c=null!=(w=null==o?void 0:o.logger)?w:console,p=null!=(A=null==o?void 0:o.molColName)?A:"Molecule",d=e.map(e=>u(e)),m=r.Column.fromStrings(p,d),h=r.DataFrame.fromColumns([m]);h.name="HD cell values",yield h.meta.detectSemanticTypes();let g=[];g.push(new Promise(e=>tA(function*(){try{i.length&&(yield t.chem.descriptors(h,m.name,i))}catch(e){c.error("Descriptors calculation error"),c.error(e)}e()})()));var f=!0,y=!1,v=void 0;try{for(var b,w,A,C,E=n[Symbol.iterator]();!(f=(C=E.next()).done);f=!0){let e=C.value;g.push(new Promise(t=>tA(function*(){try{let i=e.args,n=r.Func.find({package:e.package,name:e.name});if(!n.length||!n[0]){console.warn(`Function ${e.name} from package ${e.package} is not found`),t();return}let a=n[0],l=a.inputs[0].name,o=a.inputs[1].name;yield a.apply(tE(tC({},i),{[l]:h,[o]:m.name}))}catch(e){c.error(e)}t()})()))}}catch(e){y=!0,v=e}finally{try{f||null==E.return||E.return()}finally{if(y)throw v}}var T=!0,x=!1,S=void 0;try{for(var O,P=(void 0===a?[]:a)[Symbol.iterator]();!(T=(O=P.next()).done);T=!0){let e=O.value,t=e.args;g.push(new Promise(i=>tA(function*(){try{let i=r.Func.find({name:e.name}).filter(t=>t.type===el&&t.id===e.id)[0];if(i){let e=i.inputs[0].name,r=i.inputs[1].name,u=yield i.apply(tE(tC({},t),{[e]:h,[r]:m.name}));if(u&&u.rowCount===h.rowCount&&"python"===i.language){var n=!0,a=!1,l=void 0;try{for(var o,s=u.columns[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){let e=o.value;e.name=h.columns.getUnusedName(e.name),h.columns.add(e)}}catch(e){a=!0,l=e}finally{try{n||null==s.return||s.return()}finally{if(a)throw l}}}}}catch(e){c.error(e)}i()})()))}}catch(e){x=!0,S=e}finally{try{T||null==P.return||P.return()}finally{if(x)throw S}}var N=!0,F=!1,B=void 0;try{for(var I,k=(void 0===l?[]:l)[Symbol.iterator]();!(N=(I=k.next()).done);N=!0){let e=I.value,t=e.args;g.push(new Promise(i=>tA(function*(){try{let n=r.Func.find({name:e.name}).filter(t=>t.type===es&&t.id===e.id)[0];if(n){let e=n.inputs[0].name,a=[d],r=yield n.apply(tE(tC({},t),{[e]:a}));if(!r||0===r.rowCount)return void i();yield eg(h,p,r)}}catch(e){c.error(e)}i()})()))}}catch(e){F=!0,B=e}finally{try{N||null==k.return||k.return()}finally{if(F)throw B}}yield Promise.all(g),s.close();let V=h.col(p);for(let t=0;t<V.length;t++)V.set(t,e[t],!1);return h}).apply(this,arguments)}(e,i,n,a,l,tS())}).apply(this,arguments)}function tP(e,i,n){return tx(function*(){var a;return a=tS(),tA(function*(){let l=r.TaskBarProgressIndicator.create("Calculating ..."),o=null!=(y=null==a?void 0:a.convertToSmiles)?y:e=>e,s=null!=(v=null==a?void 0:a.logger)?v:console,u=i.col(n);if(!u)throw Error("There is no molecule column in dataframe");let c=`~${n}.canonicalSmiles`,p=i.columns.getOrCreate(c,r.TYPE.STRING);p.semType=r.SEMTYPE.MOLECULE;let d=u.toList();for(let e=0;e<d.length;e++){if(u.isNone(e))continue;let t=d[e];if(!t)continue;let i=o(t);p.set(e,i,!1)}let m=[];m.push(new Promise(n=>tA(function*(){try{e.descriptors&&e.descriptors.length>0&&(yield t.chem.descriptors(i,c,e.descriptors))}catch(e){s.error("Descriptors calculation error"),s.error(e)}n()})()));var h=!0,g=!1,f=void 0;try{for(var y,v,b,w,A,C=Object.keys(e.externals)[Symbol.iterator]();!(h=(A=C.next()).done);h=!0){let t=A.value;m.push(new Promise(n=>tA(function*(){try{let n=e.externals[t],a=r.Func.find({package:t.split(":")[0],name:t.split(":")[1]})[0],l=a.inputs[0].name,o=a.inputs[1].name;n&&(yield a.apply(tE(tC({},n),{[l]:i,[o]:c})))}catch(e){s.error(e)}n()})()))}}catch(e){g=!0,f=e}finally{try{h||null==C.return||C.return()}finally{if(g)throw f}}var E=!0,T=!1,x=void 0;try{for(var S,O=Object.keys(null!=(b=e.scripts)?b:{})[Symbol.iterator]();!(E=(S=O.next()).done);E=!0){let t=S.value,n=e.scripts[t];m.push(new Promise(e=>tA(function*(){if(n){let d=t.split(":"),m=d[2];if(!m)return void e();try{let t=d[1],s=r.Func.find({name:t}).filter(e=>e.type===el&&e.id===m)[0];if(!s)return void e();let h=s.inputs[0].name,g=s.inputs[1].name,f=yield s.apply(tE(tC({},n),{[h]:i,[g]:c}));if(f&&f.rowCount===i.rowCount&&"python"===s.language){var a=!0,l=!1,o=void 0;try{for(var u,p=f.columns[Symbol.iterator]();!(a=(u=p.next()).done);a=!0){let e=u.value;e.name=i.columns.getUnusedName(e.name),i.columns.add(e)}}catch(e){l=!0,o=e}finally{try{a||null==p.return||p.return()}finally{if(l)throw o}}}}catch(e){s.error(e)}}e()})()))}}catch(e){T=!0,x=e}finally{try{E||null==O.return||O.return()}finally{if(T)throw x}}var P=!0,N=!1,F=void 0;try{for(var B,I=Object.keys(null!=(w=e.queries)?w:{})[Symbol.iterator]();!(P=(B=I.next()).done);P=!0){let t=B.value,n=e.queries[t];m.push(new Promise(e=>tA(function*(){if(n){let a=t.split(":"),l=a[2];if(!l)return void e();try{let t=a[1],o=r.Func.find({name:t}).filter(e=>e.type===es&&e.id===l)[0];if(!o)return void e();let s=o.inputs[0].name,u=yield o.apply(tE(tC({},n),{[s]:p.toList()}));u&&(yield eg(i,c,u))}catch(e){console.error(e)}}e()})()))}}catch(e){N=!0,F=e}finally{try{P||null==I.return||I.return()}finally{if(N)throw F}}yield Promise.all(m),l.close()})()})()}function tN(e,t,i,n,a,r,l){try{var o=e[r](l),s=o.value}catch(e){i(e);return}o.done?t(s):Promise.resolve(s).then(n,a)}function tF(e){return function(){var t=this,i=arguments;return new Promise(function(n,a){var r=e.apply(t,i);function l(e){tN(r,n,a,l,o,"next",e)}function o(e){tN(r,n,a,l,o,"throw",e)}l(void 0)})}}class tB extends e9{getStatus(){var e,t,i;return null!=(e=null!=(t=this.statusInput.value)?t:null==(i=this.app.campaign)?void 0:i.status)?e:"No Status"}submitWithStatus(e){return tF(function*(){var t,i;return this.statusInput.value=(null==e?void 0:e.trim())?e.trim():null!=(t=null==(i=this.app.campaign)?void 0:i.status)?t:"Submitted",yield this.submit()}).call(this)}render(){var e,t,i;this.statusInput.value=null!=(e=null==(t=this.app.campaign)?void 0:t.status)?e:"",a.empty(this.content),this.content=a.divV([a.h1("Summary"),a.div([a.tableFromMap(this.app.getSummary())]),this.statusInput.root]);let n=a.dialog("Submit");n.add(this.content),n.addButton("Save",()=>{this.app.campaign.status=this.getStatus(),this.app.saveCampaign(),n.close()}),n.show();let l=Array.from(new Set(r.Func.find({meta:{role:p}}).concat(r.Func.find({tags:[p]})))),o=l.reduce((e,t)=>{var i;return e[null!=(i=t.friendlyName)?i:t.name]=t,e},{});if(l.length>0){let e=this.app.submitParams,t=e?l.find(t=>t.name===e.fName&&eh(t)==e.package):void 0,r=null!=(i=null==t?void 0:t.friendlyName)?i:null==t?void 0:t.name,s=a.input.choice("Submit function",{value:r,items:[...Object.keys(o)],nullable:!0});s.onChanged.subscribe(()=>{var e,t;let i=o[null!=(e=s.value)?e:""];this.app.campaign.template.submit=i?{fName:i.name,package:eh(i)}:void 0,null==(t=n.getButton("Submit"))||t.remove(),i&&n.addButton("Submit",()=>{this.submit(),n.close()},void 0,"Submit the campaign file to the specified function")}),s.fireChanged(),this.content.appendChild(s.root)}}onActivated(){}submit(){return tF(function*(){let e=this.app.submitParams;if(!e)return t.shell.error("No submit function selected. Please select a function to submit the campaign."),!1;let i=r.Func.find({name:e.fName,package:e.package})[0];if(!i)return t.shell.error(`Function ${e.fName} not found.`),!1;let n=r.DataFrame.fromCsv(this.app.dataFrame.toCsv({filteredRowsOnly:!0}));return yield i.apply({df:n,molecules:this.app.molColName}),this.app.campaign.status=this.getStatus(),yield this.app.saveCampaign(),t.shell.info("Submitted successfully."),!0}).call(this)}constructor(e){var t;super(e),this.name="Submit",this.statusInput=a.input.string("Status",{value:null==(t=this.app.campaign)?void 0:t.status,nullable:!1}),this.statusSuggestionsMenu=r.Menu.popup(),this.statusInput.root.style.marginLeft="12px",this.content=a.div(),this.statusInput.onChanged.subscribe(()=>{var e,t,i,n;this.statusSuggestionsMenu.clear();let a=(null!=(e=this.statusInput.value)?e:"").toLowerCase(),r=this.app.existingStatuses.filter(e=>{var t;return(null==e||null==(t=e.toLowerCase())?void 0:t.includes(a))&&(null==e?void 0:e.toLowerCase())!==a}).filter((e,t)=>t<5);if(r.length){if(r.forEach(e=>{this.statusSuggestionsMenu.item(e,()=>{this.statusInput.value=e,this.statusSuggestionsMenu.root.remove(),this.statusInput.root.focus()})}),null==(t=this.content.parentElement)?void 0:t.parentElement){let e=this.statusInput.root.offsetLeft+(null!=(i=null==(n=this.statusInput.input)?void 0:n.offsetLeft)?i:0),t=this.statusInput.root.offsetTop+this.statusInput.root.offsetHeight+this.content.parentElement.offsetTop;this.statusSuggestionsMenu.show({element:this.content.parentElement.parentElement,x:e,y:t})}}else this.statusSuggestionsMenu.root.remove()})}}var tI=i(10),tk={};function tV(e,t,i,n,a,r,l){try{var o=e[r](l),s=o.value}catch(e){i(e);return}o.done?t(s):Promise.resolve(s).then(n,a)}tk.styleTagTransform=en(),tk.setAttributes=X(),tk.insert=K().bind(null,"head"),tk.domAPI=z(),tk.insertStyleElement=et(),W()(tI.A,tk),tI.A&&tI.A.locals&&tI.A.locals;let tD=rxjs.operators;function tj(e,t,i,n,a,r,l){try{var o=e[r](l),s=o.value}catch(e){i(e);return}o.done?t(s):Promise.resolve(s).then(n,a)}function t_(e){return function(){var t=this,i=arguments;return new Promise(function(n,a){var r=e.apply(t,i);function l(e){tj(r,n,a,l,o,"next",e)}function o(e){tj(r,n,a,l,o,"throw",e)}l(void 0)})}}let tL="defaultCampaignFolder",t$="System.AppData/HitTriage";function tM(e){return t_(function*(){if(!e)return[(yield t.dapi.groups.find(r.Group.defaultGroupsIds["All users"]))].filter(Boolean);try{let i=JSON.parse(e);return(yield Promise.all(i.map(e=>t.dapi.groups.find(e)))).filter(Boolean)}catch(e){return console.error(e),[(yield t.dapi.groups.find(r.Group.defaultGroupsIds["All users"]))].filter(Boolean)}})()}function tH(e,t,i,n,a,r,l){try{var o=e[r](l),s=o.value}catch(e){i(e);return}o.done?t(s):Promise.resolve(s).then(n,a)}function tR(e){return function(){var t=this,i=arguments;return new Promise(function(n,a){var r=e.apply(t,i);function l(e){tH(r,n,a,l,o,"next",e)}function o(e){tH(r,n,a,l,o,"throw",e)}l(void 0)})}}function tU(e){var t;let i=null==(t=nh.meta)?void 0:t.sok;if(!i)throw Error("Secret key for SMILES obfuscation is not set");let n="";for(let t=0;t<e.length;t++)n+=String.fromCharCode(e.charCodeAt(t)^i.charCodeAt(t%i.length));return btoa(n)}function tq(){var e,t,i;let n=r.User.current();return null!=(e=null!=(t=null!=(i=null==n?void 0:n.login)?i:null==n?void 0:n.friendlyName)?t:n.name)?e:"unknown user"}function tY(e,i,n){return tR(function*(){let a=nh.convertToSmiles(e);if(!a||""===a||"MALFORMED_INPUT_VALUE"===a)return"";let r=tU(a),l=yield j.addMolecule(r,n,i,tq());return 0!==l.rowCount&&l.col("vid")?l.col("vid").getString(0):(t.shell.error("Molecule registration returned no data"),"")})()}function tG(e,i,n){return tR(function*(){let a=new Map,r=new Map;if(e.forEach((e,t)=>{let i=nh.convertToSmiles(e);i&&""!==i&&"MALFORMED_INPUT_VALUE"!==i&&(r.has(i)||r.set(i,[]),r.get(i).push(t))}),0===r.size)return a;let l=Array.from(r.keys());for(let o=0;o<l.length;o+=50){let s=l.slice(o,o+50);if(0!==s.length)try{let t=s.map(e=>tU(e)),l=yield j.addMolecules(t,n,i,tq());if(!l||l.rowCount!==s.length||!l.col("vid"))throw console.error("Molecule registration returned incomplete data for batch",`${o}-${o+s.length}`,`Batch size: ${s.length}, Result rows: ${null==l?void 0:l.rowCount}. Vid column found: ${!!(null==l?void 0:l.col("vid"))}`),Error("Resulting molecule registration has no or incomplete data");let u=l.col("vid").toList();for(let t=0;t<l.rowCount;t++){let i=r.get(s[t]),n=u[t];for(let t of i)a.set(e[t],n)}}catch(e){t.shell.error("Error registering molecules batch. see console for details."),nh.logger.error(e)}}return a})()}function tW(e,t,i,n,a,r,l){try{var o=e[r](l),s=o.value}catch(e){i(e);return}o.done?t(s):Promise.resolve(s).then(n,a)}function tJ(e){return function(){var t=this,i=arguments;return new Promise(function(n,a){var r=e.apply(t,i);function l(e){tW(r,n,a,l,o,"next",e)}function o(e){tW(r,n,a,l,o,"throw",e)}l(void 0)})}}let tz=["molecule","smiles","mol","structure","canonical_smiles","canonicalsmiles"],tQ=["v-id","vid","v_id"],tK=["csv",...tc.molFileExtReaders.map(e=>e.ext)];function tZ(e){var t,i,n;let a=null==(i=e.extension)?void 0:i.toLowerCase();if(a)return a;let r=null!=(t=null==(n=e.name)?void 0:n.toLowerCase())?t:"",l=r.lastIndexOf(".");return l>=0?r.slice(l+1):""}function tX(e){return tJ(function*(){let t=tZ(e);if("csv"===t){let t=yield e.readAsString();return r.DataFrame.fromCsv(t)}let i=tc.molFileExtReaders.find(e=>e.ext===t);if(!i)return null;let n=yield e.readAsBytes();if(!n)return null;let a=i.handlerFunc.inputs[0].name,l=yield i.handlerFunc.apply({[a]:n});return Array.isArray(l)?l[0]:l})()}function t0(e){var t,i;let n=(null!=(t=e.fullPath)?t:"").toLowerCase(),a=(null!=(i=e.name)?i:"").toLowerCase();return!n||n===a}function t1(e,t,i,n){try{if(e.type===t.type)return void e.set(i,t.get(n),!1);if(e.type===r.COLUMN_TYPE.STRING)return void e.set(i,t.getString(n),!1);let a=t.get(n);if(e.type===r.COLUMN_TYPE.INT)return void("number"==typeof a?e.set(i,Math.round(a),!1):"string"==typeof a&&a.length>0&&!isNaN(Number(a))&&e.set(i,Math.round(Number(a)),!1));if(e.type===r.COLUMN_TYPE.FLOAT)return void("number"==typeof a?e.set(i,a,!1):"string"==typeof a&&a.length>0&&!isNaN(Number(a))&&e.set(i,Number(a),!1));e.set(i,a,!1)}catch(a){nh.logger.error(`Merge: failed to set ${e.name}[${i}] from ${t.name}[${n}]: ${a}`)}}function t2(e,t){if(e.isNone(t))return!0;if(e.type===r.COLUMN_TYPE.STRING){let i=e.get(t);return""===i||null==i}return!1}function t4(e,i,n){return tJ(function*(){var a,r,l,o,s,u,c,p,d;if(!e.dataFrame)throw Error("Campaign has no data");let g=e.dataFrame,y=e.molColName,v=n.addNewRows&&!!n.molColName,b=n.runComputeOnNewRows&&v,{map:w}=function(e,t,i){let n=Array(e.rowCount).fill(null),a=new Map;if("smiles"===i){let i=e.col(t);if(!i)throw Error(`Campaign has no molecule column "${t}"`);for(let t=0;t<e.rowCount;t++){let e=i.get(t);if(!e)continue;let r=nh.convertToSmiles(e);r&&"MALFORMED_INPUT_VALUE"!==r&&(n[t]=r,a.has(r)||a.set(r,t))}}else{let t=e.col(f);if(!t)throw Error(`Campaign has no "${f}" column`);for(let i=0;i<e.rowCount;i++){let e=t.get(i);e&&(n[i]=e,a.has(e)||a.set(e,i))}}return{keys:n,map:a}}(g,y,n.mode),A=function(e,t){let i=Array(e.rowCount).fill(null);if("smiles"===t.mode){let n=e.col(t.molColName);if(!n)throw Error(`Incoming table has no column "${t.molColName}"`);for(let t=0;t<e.rowCount;t++){let e=n.get(t);if(!e)continue;let a=nh.convertToSmiles(e);a&&"MALFORMED_INPUT_VALUE"!==a&&(i[t]=a)}}else{let n=e.col(t.vidColName);if(!n)throw Error(`Incoming table has no column "${t.vidColName}"`);for(let t=0;t<e.rowCount;t++){let e=n.get(t);e&&(i[t]=String(e))}}return i}(i,n),C=[],E=[];for(let e=0;e<i.rowCount;e++){let t=A[e];if(!t)continue;let i=w.get(t);void 0!==i?C.push({campRow:i,incRow:e}):v&&E.push(e)}let T=null;if(b&&n.molColName&&E.length>0){let p=null!=(a=null==(l=e.campaign)||null==(r=l.template)?void 0:r.compute)?a:null==(o=e.template)?void 0:o.compute,d=i.col(n.molColName);if(p&&d){let e=E.map(e=>d.get(e)),i=p.descriptors.enabled&&null!=(s=p.descriptors.args)?s:[];try{T=yield tO(e,i,p.functions,null!=(u=p.scripts)?u:[],null!=(c=p.queries)?c:[])}catch(e){nh.logger.error(e),t.shell.warning("Merge: compute pipeline failed; merging without computed columns.")}}}let x=function(e,t,i,n){let a=[];for(let t of e.columns.toList()){if("smiles"===n.mode&&t.name===f)continue;let e=t.name;n.molColName&&t.name===n.molColName&&(e=i),"vid"===n.mode&&n.vidColName&&t.name===n.vidColName&&(e=f),a.push({col:t,target:e,isComputed:!1})}if(t)for(let e of t.columns.toList())e.name!==h&&e.name!==i&&(a.some(t=>t.target===e.name)||a.push({col:e,target:e.name,isComputed:!0}));return a}(i,T,y,n),S=new Set;for(let e of x)if(!g.columns.contains(e.target)){let t=g.columns.addNew(e.target,e.col.type);e.col.semType&&(t.semType=e.col.semType),S.add(e.target)}e.isJoining=!0;try{for(let{campRow:e,incRow:t}of C)for(let i of x){if(i.isComputed||"smiles"===n.mode&&i.target===y||"vid"===n.mode&&i.target===f)continue;let a=g.col(i.target);if(!a)continue;let r=t2(a,e);(S.has(i.target)||r||"overwrite"===n.clashStrategy)&&t1(a,i.col,e,t)}let t=g.rowCount;if(E.length>0){let a=(null!=(p=null==(d=e.stages)?void 0:d.length)?p:0)>0&&g.columns.contains(m);for(let t=0;t<E.length;t++){let i=E[t];g.rows.addNew(null,!0);let n=g.rowCount-1;for(let e of x){let a=e.isComputed?t:i;t1(g.col(e.target),e.col,n,a)}if(a){let t=g.col(m);t2(t,n)&&t.set(n,e.stages[0],!1)}}if(n.molColName){let a=i.col(n.molColName),r=g.col(f);if(a&&r&&e.campaignId){let i=E.map(e=>a.get(e)).filter(e=>!!e&&""!==e);if(i.length>0)try{let n=yield tG(i,e.campaignId,e.appName);for(let e=0;e<E.length;e++){let i=a.get(E[e]),l=i?n.get(i):void 0;l&&r.set(t+e,l,!1)}}catch(e){nh.logger.error(e)}}}}}finally{setTimeout(()=>{e.isJoining=!1},500)}g.fireValuesChanged()})()}function t5(e,t,i,n,a,r,l){try{var o=e[r](l),s=o.value}catch(e){i(e);return}o.done?t(s):Promise.resolve(s).then(n,a)}function t3(e){return function(){var t=this,i=arguments;return new Promise(function(n,a){var r=e.apply(t,i);function l(e){t5(r,n,a,l,o,"next",e)}function o(e){t5(r,n,a,l,o,"throw",e)}l(void 0)})}}let t8={smiles:"By canonical SMILES",vid:"By V-iD"},t6={skip:"Skip (keep campaign value)",overwrite:"Overwrite (use incoming value)"},t9="(none)";function t7(e,t,i){e.items=t,null!=i&&t.includes(i)?e.value=i:t.length>0?e.value=t[0]:e.value=null}function ie(e,t,i,n,a,r,l){try{var o=e[r](l),s=o.value}catch(e){i(e);return}o.done?t(s):Promise.resolve(s).then(n,a)}function it(e){return function(){var t=this,i=arguments;return new Promise(function(n,a){var r=e.apply(t,i);function l(e){ie(r,n,a,l,o,"next",e)}function o(e){ie(r,n,a,l,o,"throw",e)}l(void 0)})}}function ii(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{},n=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(i).filter(function(e){return Object.getOwnPropertyDescriptor(i,e).enumerable}))),n.forEach(function(t){var n;n=i[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}class ia extends tc{get infoView(){return this._infoView}get submitView(){return this._submitView}get version(){var e,t;return null!=(e=null==(t=this._campaign)?void 0:t.version)?e:0}handleJoiningDataframe(e){return it(function*(){let i=e.columns.bySemTypeAll(r.SEMTYPE.MOLECULE);if(!i||0===i.length)return void t.shell.error("No molecule column found");let n=null;if(i.length>1){var l;let e=i.map(e=>e.name),r=null!=(l=i.find(e=>{var t,i;return(null==e||null==(t=e.name)?void 0:t.toLowerCase())==="smiles"||(null==e||null==(i=e.name)?void 0:i.toLowerCase())==="molecule"}))?l:i[0],o=a.input.choice("Primary Molecule Column",{items:e,value:r.name,nullable:!1}),s=new Promise(e=>{a.dialog("Select Primary Molecule Column").add(a.divText("Multiple molecule columns found. Please select the primary molecule column to be used for calculations.")).add(o).onOK(()=>e(o.value)).onCancel(()=>e(null)).show()});if(!(n=yield s))return void t.shell.info("Operation cancelled by user")}else n=i[0].name;e.col(n)?(yield t4(this,e,{mode:"smiles",molColName:n,addNewRows:!0,runComputeOnNewRows:!0,clashStrategy:"overwrite"}),yield this.saveCampaign(!1)):t.shell.error("No molecule column found")}).call(this)}get submitParams(){var e,t,i,n;return null!=(e=null==(i=this.campaign)||null==(t=i.template)?void 0:t.submit)?e:null==(n=this.template)?void 0:n.submit}_initViewSubs(){this.multiView.subs.push(t.events.onCurrentViewChanged.subscribe(()=>it(function*(){try{if(t.shell.v===this._designView){var e,i,n,a;t.shell.windows.showHelp=!1,this.setBaseUrl(),eb(l,null!=(e=null!=(i=this._campaignId)?i:null==(n=this._campaign)?void 0:n.name)?e:"");let{sub:r}=ew(t.shell.v,this.appName,null==(a=t.shell.v)?void 0:a.name,()=>{var e;t.shell.v=this.mainView,null==(e=this._designView)||e.close(),this._infoView.init(),r.unsubscribe()})}else t.shell.v===this.mainView&&this.setBaseUrl()}catch(e){console.error(e)}}).call(this))),this.multiView.subs.push(t.events.onFileImportRequest.subscribe(e=>{var i,n;if(!t.shell.tv||!this._designView||t.shell.tv!==this._designView||!(null==e||null==(i=e.args)?void 0:i.file))return;let a=e.args.file;((null==(n=a.name)?void 0:n.endsWith(".csv"))||tc.molFileExtReaders.some(e=>{var t;return null==(t=a.name)?void 0:t.endsWith(e.ext)}))&&(e.preventDefault(),this.handleUploadingDataframe(a))}))}handleUploadingDataframe(e){return it(function*(){try{var i;let n=null;if(e.name.endsWith(".csv"))n=r.DataFrame.fromCsv((yield e.text()));else{let i=yield new Promise(t=>it(function*(){let i=new FileReader,n=null,a=null;i.onload=()=>{a=i.result?new Uint8Array(i.result):null,n&&clearTimeout(n),t(a)},i.readAsArrayBuffer(e),n=setTimeout(()=>{i.abort(),t(null)},1e4)})());if(!i)return void t.shell.error("Failed to read file");let a=tc.molFileExtReaders.find(t=>e.name.endsWith(t.ext)).handlerFunc,r=a.inputs[0].name;n=(yield a.apply({[r]:i}))[0]}if(!n)throw Error("Failed to read file");if(n.name=e.name.slice(0,e.name.lastIndexOf(".")),yield n.meta.detectSemanticTypes(),yield t.data.detectSemanticTypes(n),!n.columns.bySemType(r.SEMTYPE.MOLECULE))return void t.shell.addTableView(n);let l=a.dialog("Uploading table with molecules").add(a.divText("Add new table to workspace or join with existing Hit Design campaign")).addButton("Add to workspace",()=>{l.close(),t.shell.addTableView(n)}).addButton("Add to existing campaign",()=>{l.close(),this.handleJoiningDataframe(n)});null==(i=l.getButton("CANCEL"))||i.remove(),l.show()}catch(e){t.shell.error("Hit Design Failed to read file"),console.error(e)}}).call(this)}get stages(){var e,t,i,n,a;return null!=(e=null!=(t=null==(n=this.campaign)||null==(i=n.template)?void 0:i.stages)?t:null==(a=this.template)?void 0:a.stages)?e:[]}setStages(e){return it(function*(){var i;if(!this.campaign||!this.campaign.template||!this.template)return void t.shell.error("Campaign or template is not set");if(!(null==e?void 0:e.length))return void t.shell.error("Removing all stages is not allowed");let n=null==(i=this.dataFrame)?void 0:i.col(m);if(!n)return void t.shell.error("No stage column found");let a=[],r=new Set(e),l=[...r],o=this.dataFrame.rowCount,s=n.categories,u=n.getRawData();for(let t=0;t<o;t++){let i=s[u[t]];r.has(i)||(n.set(t,e[0],!1),a.push(i))}a.length>0&&t.shell.warning(`Some stages were removed: (${a.join(", ")}). Corresponding rows were set to stage "${e[0]}"`),this.campaign.template.stages=l,this.template.stages=l,yield this.saveCampaign(!0)}).call(this)}refreshCampaign(){return it(function*(){this._campaignId&&this.template?this._isSaving?t.shell.info("Campaign is being saved. Please wait a moment and try again."):(clearInterval(this._updateCheckIntervalId),this._refreshIconTooltip="Refresh Campaign",yield this.setTemplate(this.template,this._campaignId)):t.shell.warning("No campaign to refresh")}).call(this)}setTemplate(e,i){return it(function*(){var n,u,c,p,d,m,g,f,y,v,b,w,A;if(i){let e=`System.AppData/HitTriage/${this.appName}/campaigns`;this._filePath=null!=(y=null==(v=this.campaign)?void 0:v.savePath)?y:`${e}/${i}/${s}`,this.dataFrame=yield t.dapi.files.readCsv(this._filePath),(null==(b=this._campaign)?void 0:b.columnSemTypes)&&Object.entries(this._campaign.columnSemTypes).forEach(([e,t])=>{let i=this.dataFrame.columns.byName(e);i&&t&&(i.semType=t)}),(null==(w=this._campaign)?void 0:w.columnTypes)&&Object.entries(this._campaign.columnTypes).forEach(([e,t])=>{let i=this.dataFrame.columns.byName(e);if(i&&i.type!==t)try{this.dataFrame.changeColumnType(e,t)}catch(e){console.error(e)}})}else{(null==(f=this._designView)?void 0:f.dataFrame)&&t.shell.closeTable(this._designView.dataFrame),this._designView=void 0,eb(o,i=yield this.getNewCampaignName(`${this.appName}/campaigns`,e.key));let n=yield t_(function*(){var e;let i=nh.settings;if(!i)return t$;let n=null!=(e=i[tL])?e:t$;return(yield t.dapi.files.exists(n))?n:t$})();n.endsWith("/")||(n+="/"),this._filePath=`${n}${this.appName}/campaigns/${i}/${s}`}if(!this.dataFrame){t.shell.error("DataFrame is empty"),clearInterval(this._updateCheckIntervalId),this._updateCheckIntervalId=null;return}yield this.dataFrame.meta.detectSemanticTypes(),this._molColName=null!=(n=null==(p=this.dataFrame.columns.bySemType(r.SEMTYPE.MOLECULE))?void 0:p.name)?n:h,this._campaignId=i,this.template=e,null!=this._submitView||(this._submitView=new tB(this)),t.shell.windows.showHelp=!1,this.campaign?yield this.setCanEdit(this.campaign):this.hasEditPermission=!0,i&&(null==(m=this.campaign)||null==(d=m.mergeConfig)?void 0:d.autoMergeOnOpen)&&this.campaign.mergeConfig.filePath&&(yield(A=this,tJ(function*(){var e,i,n;let a=null==(e=A.campaign)?void 0:e.mergeConfig;if((null==a?void 0:a.autoMergeOnOpen)&&a.filePath&&A.dataFrame)try{if(!(yield t.dapi.files.exists(a.filePath)))return void t.shell.warning(`Auto-merge: source file not found or not accessible: ${a.filePath}`);let e=r.FileInfo.fromString(a.filePath,""),l=yield tX(e);if(!l)return void t.shell.warning("Auto-merge: could not read the saved source file; merge skipped.");yield l.meta.detectSemanticTypes(),yield t.data.detectSemanticTypes(l);let o=(i=function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{},n=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(i).filter(function(e){return Object.getOwnPropertyDescriptor(i,e).enumerable}))),n.forEach(function(t){var n;n=i[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},a),n={runComputeOnNewRows:!1},n=null!=n?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(n)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t.push.apply(t,i)}return t})(Object(n)).forEach(function(e){Object.defineProperty(i,e,Object.getOwnPropertyDescriptor(n,e))}),i);yield t4(A,l,o)}catch(e){nh.logger.error(e),t.shell.warning("Auto-merge failed; opening the campaign without merging.")}})())),i&&this.campaign&&(yield this.reComputeOnCampaignOpen());let C=this.designView;this.currentDesignViewId=C.name,this.setBaseUrl(),eb(l,null!=(u=null!=(c=this._campaignId)?c:null==(g=this._campaign)?void 0:g.name)?u:""),this.campaign&&(this.campaign.template=e),j.getLastModified(this.appName,this._campaignId).then(e=>{var i;let n=null==e||null==(i=e.col("updated_at"))?void 0:i.getString(0);this._lastExpiresTimeString=null!=n?n:null,this._needsRefresh=!1,clearInterval(this._updateCheckIntervalId);let r=!1;this._updateCheckIntervalId=setInterval(()=>it(function*(){if(!r&&!this._needsRefresh){if(r=!0,this._designView&&!Array.from(t.shell.tableViews).some(e=>e===this._designView)){clearInterval(this._updateCheckIntervalId),console.log("Clearing campaign update check interval"),this._updateCheckIntervalId=null,r=!1;return}if(!this._campaignId||!this.template||this._isSaving||this.isJoining||!this._designView||t.shell.v!==this._designView){r=!1;return}try{var e;let t=yield j.getLastModified(this.appName,this._campaignId),i=null==t||null==(e=t.col("updated_at"))?void 0:e.getString(0);if(!i){r=!1;return}this._lastExpiresTimeString!==i&&this._refreshCampaignIcon&&(this._lastExpiresTimeString=i,a.hints.addHintIndicator(this._refreshCampaignIcon,!0,1e4),this._refreshIconTooltip="New changes available. Click to refresh campaign.",this._lastExpiresTimeString=i,this._needsRefresh=!0)}catch(e){console.error(e)}r=!1}}).call(this),3e3)}).catch(e=>console.error(e))}).call(this)}get campaignId(){return this._campaignId}get designView(){let e=this.getDesignView();return iT(e,this,"design"),this._designView=e}get designViewName(){return this._designViewName}set designViewName(e){this._designViewName=e,this._designView&&(this._designView.name=e)}get molColName(){var e,t,i,n;return null!=(e=this._molColName)?e:this._molColName=null!=(t=null==(n=this.dataFrame)||null==(i=n.columns.bySemType(r.SEMTYPE.MOLECULE))?void 0:i.name)?t:h}get campaign(){return this._campaign}set campaign(e){this._campaign=e}clearCampaign(){this._campaign=void 0}cacheDuplicateVIDs(){var e;let t=null==(e=this.dataFrame)?void 0:e.col(f);if(!t){this._duplicateVidCache=void 0;return}let i=t.version,n=new Uint32Array(t.categories.length).fill(0),a=t.getRawData().subarray(0,t.length);a.forEach(e=>n[e]++),this._duplicateVidCache={colVersion:i,valueCounts:n,indexes:a}}get duplicateVidCache(){var e;let t=null==(e=this.dataFrame)?void 0:e.col(f);if(t)return this._duplicateVidCache&&t.version===this._duplicateVidCache.colVersion||this.cacheDuplicateVIDs(),this._duplicateVidCache}performSingleCellCalculations(e,t){return it(function*(){let i=this.template.compute;if(t&&""!==t){for(let n of(yield tO([t],i.descriptors.args,i.functions,i.scripts,i.queries)).columns.toList())n.name!==h&&(this.dataFrame.columns.contains(n.name)||(this.dataFrame.columns.addNew(n.name,n.type).semType=n.semType),this.dataFrame.col(n.name).set(e,n.get(0),!1));this.dataFrame.fireValuesChanged(),this.saveCampaign(!1)}}).call(this)}reComputeOnCampaignOpen(){return it(function*(){var e,i,n,a;let r=null==(a=this.template)?void 0:a.compute;if(!r||!this.dataFrame||!this.molColName)return;let l=(null!=(e=r.functions)?e:[]).filter(e=>e.rerunOnOpen),o=(null!=(i=r.scripts)?i:[]).filter(e=>e.rerunOnOpen),s=(null!=(n=r.queries)?n:[]).filter(e=>e.rerunOnOpen);if(!l.length&&!o.length&&!s.length)return;let u=this.dataFrame.col(this.molColName);if(u)try{let e=u.toList();for(let t of(yield tO(e,[],l,o,s)).columns.toList()){if(t.name===this.molColName||t.name===h)continue;let e=this.dataFrame.col(t.name);e&&e.type===t.type||(e&&this.dataFrame.columns.remove(t.name),e=this.dataFrame.columns.addNew(t.name,t.type)),e.semType=t.semType;let i=Math.min(t.length,e.length);for(let n=0;n<i;n++)e.set(n,t.isNone(n)?null:t.get(n),!1)}this.dataFrame.fireValuesChanged()}catch(e){nh.logger.error(e),t.shell.warning("Re-run on open failed for some functions; opening the campaign anyway.")}}).call(this)}initDesignViewRibbons(e,i,n=!1){let l=t.events.onViewRemoved.subscribe(t=>{t.id===(null==e?void 0:e.id)&&(i.forEach(e=>e.unsubscribe()),l.unsubscribe())}),o=null==e?void 0:e.getRibbonPanels();if(o&&!eC(o)){var s,u,c;setTimeout(()=>{let{sub:i}=ew(e,this.appName,e.name,()=>{t.shell.v=this.mainView,null==e||e.close(),this._infoView.init(),i.unsubscribe()})},1e3);let i=()=>it(function*(){var t;eZ(this,t=>it(function*(){var i,n,r,l,o,s,u,c,p,d;let m=this.template.compute.descriptors.args,h=this.template.compute.functions,g=null!=(i=this.template.compute.scripts)?i:[],f=null!=(n=this.template.compute.queries)?n:[],y=t.descriptors,v={descriptors:{enabled:!!(null==t||null==(d=t.descriptors)?void 0:d.length),args:null!=(r=null==t?void 0:t.descriptors)?r:[]},functions:Object.entries(null!=(l=null==t?void 0:t.externals)?l:{}).map(([e,i])=>{var n;let a=e.split(":");return{name:a[1],package:a[0],args:i,rerunOnOpen:!!(null==t||null==(n=t.rerunOnOpen)?void 0:n[e])}}),scripts:Object.entries(null!=(o=null==t?void 0:t.scripts)?o:{}).filter(([e,t])=>e.startsWith(eu)&&3===e.split(":").length).map(([e,i])=>{var n,a,r;let l=e.split(":");return{name:null!=(n=l[1])?n:"",id:null!=(a=l[2])?a:"",args:i,rerunOnOpen:!!(null==t||null==(r=t.rerunOnOpen)?void 0:r[e])}}),queries:Object.entries(null!=(s=null==t?void 0:t.queries)?s:{}).filter(([e,t])=>e.startsWith(ec)&&3===e.split(":").length).map(([e,i])=>{var n,a,r;let l=e.split(":");return{name:null!=(n=l[1])?n:"",id:null!=(a=l[2])?a:"",args:i,rerunOnOpen:!!(null==t||null==(r=t.rerunOnOpen)?void 0:r[e])}})};this.template.compute=v,this.campaign.template=this.template;let b=y.filter(e=>!m.includes(e)),w={};Object.entries(null!=(u=null==t?void 0:t.externals)?u:{}).filter(([e,t])=>{let i=h.find(t=>`${t.package}:${t.name}`===e);return!i||!Object.entries(t).every(([e,t])=>i.args[e]===t)}).forEach(([e,t])=>{w[e]=t});let A={};Object.entries(null!=(c=null==t?void 0:t.scripts)?c:{}).filter(([e,t])=>{let i=g.find(t=>`${eu}:${t.name}:${t.id}`===e);return!i||!Object.entries(t).every(([e,t])=>i.args[e]===t)}).forEach(([e,t])=>{A[e]=t});let C={};Object.entries(null!=(p=null==t?void 0:t.queries)?p:{}).filter(([e,t])=>{let i=f.find(t=>`${ec}:${t.name}:${t.id}`===e);return!i||!Object.entries(t).every(([e,t])=>i.args[e]===t)}).forEach(([e,t])=>{C[e]=t}),a.setUpdateIndicator(e.grid.root,!0);try{yield tP({descriptors:b,externals:w,scripts:A,queries:C},this.dataFrame,this.molColName),this.dataFrame.fireValuesChanged()}finally{a.setUpdateIndicator(e.grid.root,!1),this.saveCampaign(!1)}}).call(this),()=>null,null==(t=this.campaign)?void 0:t.template,!0,!0)}).call(this),l=a.iconFA("wrench",i,"Calculate additional properties"),p=a.iconFA("code-merge",()=>{var e;e=this,t3(function*(){var i,n,l,o,s,u;if(!e.dataFrame)return void t.shell.error("Cannot merge: campaign has no data.");let c=null==(u=e.campaign)?void 0:u.mergeConfig,p=null,d=!1,m=!1,h=a.input.file("Source file",{nullable:!0,tooltipText:`Pick a file from your computer or from a Datagrok file share.
429
- Allowed extensions: ${tK.join(", ")}.
430
- Files picked from a share are remembered with the campaign and reloaded automatically next time.`,onValueChanged:e=>{var i;return i=e,t3(function*(){if(m)return;if(!i){p=null,N(null),O();return}let e=tZ(i);if(!tK.includes(e)){setTimeout(()=>{m=!0;try{h.value=null}finally{m=!1}O()},0),t.shell.warning(`Unsupported file type ".${e||"?"}". Allowed: ${tK.join(", ")}.`);return}yield P(i,null)})()}});h.input.setAttribute("placeholder",`Drop file or pick from share — ${tK.join(", ")}`);let g=a.input.choice("Merge by",{items:Object.values(t8),value:t8[null!=(i=null==c?void 0:c.mode)?i:"vid"],nullable:!1,tooltipText:'Join key. "Canonical SMILES" matches by canonicalized molecule structure; "V-iD" matches by the campaign\'s V-iD identifier.',onValueChanged:()=>O()}),f=a.input.choice("Molecule column (incoming)",{items:[],value:null,nullable:!0,tooltipText:"Column in the incoming table holding the molecules. Required for SMILES merge. In V-iD merge it is optional — if set, unmatched rows can be added to the campaign and registered with new V-iDs.",onValueChanged:()=>O()}),v=a.input.choice("V-iD column (incoming)",{items:[],value:null,nullable:!0,tooltipText:"Column in the incoming table holding V-iD strings. Used as the join key when merging by V-iD.",onValueChanged:()=>O()}),b=a.input.bool("Add unmatched rows",{value:null==(n=null==c?void 0:c.addNewRows)||n,tooltipText:"When on, rows from the incoming table whose key is not present in the campaign are added as new rows. When off, only existing rows are updated. Disabled when no incoming molecule column is selected (nothing to register the new row with).",onValueChanged:()=>O()}),w=a.input.bool("Run compute on new rows",{value:null==(l=null==c?void 0:c.runComputeOnNewRows)||l,tooltipText:"Run the campaign's compute pipeline (descriptors, functions, scripts, queries) on the incoming molecules so new rows arrive with all calculated columns filled in. Disabled when no rows will be added.",onValueChanged:()=>O()}),A=a.input.choice("On clashing data",{items:Object.values(t6),value:t6[null!=(o=null==c?void 0:c.clashStrategy)?o:"overwrite"],nullable:!1,tooltipText:'How to resolve cells that have a value on both sides for a matched row. "Skip" keeps the existing campaign value; "Overwrite" replaces it with the incoming value. Empty campaign cells are always filled from the incoming table regardless of this setting.',onValueChanged:()=>O()}),C=a.input.bool("Auto-merge on campaign open",{value:null!=(s=null==c?void 0:c.autoMergeOnOpen)&&s,tooltipText:"When on, this file is re-read and merged into the campaign every time the campaign is opened, using the configuration below. Compute is never re-run for this implicit pass and the campaign is not auto-saved. Only available for files picked from a Datagrok file share — local uploads cannot be re-read on open.",onValueChanged:()=>O()}),E=a.divText("");E.style.color="var(--failure)",E.style.fontSize="12px",E.style.marginTop="8px",E.style.minHeight="16px";let T=a.divV([h.root,g.root,f.root,v.root,b.root,w.root,A.root,C.root,E]);T.style.minWidth="420px";let x=e=>e===t8.vid?"vid":"smiles",S=e=>{let t=e.value;return t&&t!==t9?t:void 0};function O(){var e;let t,i=x(g.value),n=!!p&&!d;g.enabled=n,f.enabled=n,v.enabled=n&&"vid"===i,A.enabled=n;let a=S(f),r=S(v),l=n&&!!a;b.enabled=l,w.enabled=l&&!0===b.value;let o=h.value;C.enabled=!!o&&!t0(o);let s="";d?s="Reading file…":n?"smiles"!==i||a?"vid"!==i||r||(s="Pick the V-iD column from the incoming table."):s="Pick the molecule column from the incoming table.":s="Pick a source file to merge from.",E.textContent=s,e=""===s,(t=F.getButton("OK"))&&(e?(t.removeAttribute("disabled"),t.classList.remove("disabled")):(t.setAttribute("disabled","true"),t.classList.add("disabled")))}function P(e,i){return t3(function*(){var n,r,l;d=!0,p=null,O(),a.setUpdateIndicator(T,!0,"Reading file...");try{let i=yield tX(e);if(!i)throw Error("Empty result");i.name=(null!=(n=e.name)?n:"").replace(/\.[^.]+$/,""),yield i.meta.detectSemanticTypes(),yield t.data.detectSemanticTypes(i),p=i}catch(i){nh.logger.error(i),t.shell.error(`Failed to read "${e.name}". Check that the file is accessible and well-formed.`),p=null}finally{a.setUpdateIndicator(T,!1),d=!1}N(i),i&&(g.value=t8[(r=i).mode],b.value=r.addNewRows,w.value=r.runComputeOnNewRows,A.value=t6[r.clashStrategy],C.value=null!=(l=r.autoMergeOnOpen)&&l),O()})()}function N(e){var t,i,n,a,l,o;if(!p){t7(f,[]),t7(v,[]);return}let s=p.columns.toList().map(e=>e.name),u=null!=(t=null!=(i=null==e?void 0:e.molColName)?i:null==(l=function(e){var t;let i=e.columns.toList(),n=i.filter(e=>e.semType===r.SEMTYPE.MOLECULE);if(n.length>0){let e=n.find(e=>tz.includes(e.name.toLowerCase()));return null!=e?e:n[0]}let a=i.find(e=>tz.includes(e.name.toLowerCase()));return a||(null!=(t=i.find(e=>e.type===r.COLUMN_TYPE.STRING))?t:null)}(p))?void 0:l.name)?t:null;t7(f,[t9,...s],null!=u?u:t9);let c=null!=(n=null!=(a=null==e?void 0:e.vidColName)?a:null==(o=function(e){let t=e.columns.toList(),i=t.find(e=>tQ.includes(e.name.toLowerCase()));if(i)return i;let n=t.find(e=>e.semType===y);return n||null}(p))?void 0:o.name)?n:null;t7(v,[t9,...s],null!=c?c:t9)}let F=a.dialog("Merge with table");if(F.add(T),F.onOK(()=>t3(function*(){yield t3(function*(){if(!p)return;let i=x(g.value),n=S(f),a=S(v),l=h.value,o=l&&!t0(l)?l.fullPath:void 0,s={mode:i,filePath:o,molColName:n,vidColName:"vid"===i?a:void 0,addNewRows:!!b.value&&!!n,runComputeOnNewRows:!!w.value&&!!b.value&&!!n,clashStrategy:A.value===t6.overwrite?"overwrite":"skip",autoMergeOnOpen:!!C.value&&!!o},u=r.TaskBarProgressIndicator.create("Merging table into campaign...");try{yield t4(e,p,s),e.campaign&&(e.campaign.mergeConfig=s,yield e.saveCampaign(!1)),t.shell.info("Table merged into campaign.")}catch(e){nh.logger.error(e),t.shell.error("Merge failed. See console for details.")}finally{u.close()}})()})()),F.show(),O(),null==c?void 0:c.filePath)try{if(yield t.dapi.files.exists(c.filePath)){let e=r.FileInfo.fromString(c.filePath,"");m=!0;try{h.value=e}finally{m=!1}yield P(e,c)}else t.shell.warning(`Saved merge file not found or not accessible: ${c.filePath}`)}catch(e){nh.logger.error(e),t.shell.warning("Could not restore previously saved merge file.")}})()},"Merge another table into the campaign"),d=a.icons.add(()=>{var e;null==(e=this.dataFrame)||e.rows.addNew(null,!0)},"Add new row"),h=a.iconSvg("view-layout",()=>{this.applyTemplateLayout(e)},`Apply template layout ${(null==(s=this.template)?void 0:s.localLayoutPath)?"(Loaded from mounted file storage)":"(Static)"}`);this._refreshCampaignIcon=a.icons.sync(()=>it(function*(){this.refreshCampaign()}).call(this),"Refresh"),a.tooltip.bind(this._refreshCampaignIcon,()=>this._refreshIconTooltip);let g=a.iconFA("share",()=>it(function*(){var e;yield new tr(null==(e=this.campaign)?void 0:e.permissions).show(e=>{this.campaign.permissions=e,this.saveCampaign(!0)})}).call(this),"Edit campaign permissions"),f=a.bigButton("Progress tracker",()=>{!function e(i,n){var l,o,s,u,c,p,d,h,g,f;let y=null==(o=i.campaign)?void 0:o.tilesViewerFormSketch,v=null;if(y&&y.length>0)try{v=JSON.parse(y)}catch(e){console.error("Failed to parse sketch state string",e)}v&&v.elementStates&&(null!=(h=v.elementStates.length)?h:0)>0&&(v.elementStates=v.elementStates.filter(e=>{var t;return(null==e||null==(t=e.viewerSettings)?void 0:t.column)&&i.dataFrame.col(e.viewerSettings.column)}),v.elementStates.forEach(e=>{var t;(null==e||null==(t=e.viewerSettings)?void 0:t.table)&&(e.viewerSettings.table=i.dataFrame.name)}));let b=function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{},n=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(i).filter(function(e){return Object.getOwnPropertyDescriptor(i,e).enumerable}))),n.forEach(function(t){var n;n=i[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({lanesColumnName:m,lanes:i.stages},(null!=(l=null==v||null==(s=v.elementStates)?void 0:s.length)?l:0)>0?{sketchState:v}:{}),w=n();if(!w)return void t.shell.error("Failed to create tiles viewer. table view is not available.");let A=null,C=a.dialog("Progress Tracker");try{let e=(A=w.addViewer(r.VIEWER.TILE_VIEWER,b)).getOptions();e.look.sketchState=(null!=(g=null==v||null==(f=v.elementStates)?void 0:f.length)?g:0)>0?v:null,A.setOptions(e),A.copyViewersLook(A)}catch(e){t.shell.error("Failed to create tiles viewer with preset layout.\n Falling back to default layout."),console.error("Failed to create tiles viewer",e),A&&(A.close(),A.detach()),A=w.addViewer(r.VIEWER.TILE_VIEWER,{lanesColumnName:m,lanes:i.stages})}if(!A)return void t.shell.error("Failed to create tiles viewer. check the console for more details.");let E=null,T=()=>{try{A.detach(),A.close()}catch(e){}};C.add(A.root),C.addButton("Modify Stages",()=>{null==E||E.close();let r=tf(i.stages);(E=a.dialog("Modify Stages").add(r.fieldsDiv).onOK(()=>{var l;return(l=function*(){T(),a.setUpdateIndicator(C.root,!0);try{yield i.setStages(r.getFields()),a.setUpdateIndicator(C.root,!1),C.close(),yield new Promise(t=>setTimeout(()=>{t(),e(i,n)},100))}catch(e){t.shell.error("Failed to update stages. check the console for more details."),console.error("Failed to update stages",e)}finally{(null==C?void 0:C.root)&&document.contains(C.root)&&C.close()}},function(){var e=this,t=arguments;return new Promise(function(i,n){var a=l.apply(e,t);function r(e){tV(a,i,n,r,o,"next",e)}function o(e){tV(a,i,n,r,o,"throw",e)}r(void 0)})})()}).show()).root.classList.add("hit-design-stage-editing-dialog")},0);let x=t.events.onCurrentViewChanged.subscribe(()=>{t.shell.v===w?C.root.style.display="flex":C.root.style.setProperty("display","none","important")}),S=null==(c=i.dataFrame)||null==(u=c.col(m))?void 0:u.version,O=C.onClose.subscribe(()=>{var e,n;O.unsubscribe(),x.unsubscribe(),null==E||E.close();try{let e=A.props.sketchState;if(e&&"object"==typeof e){let t=JSON.stringify(e);i.campaign&&(i.campaign.tilesViewerFormSketch=t)}}catch(e){t.shell.error("Failed to save sketch state. check the console for more details."),console.error("Failed to save sketch state",e)}T(),void 0!=S&&(null==(n=i.dataFrame)||null==(e=n.col(m))?void 0:e.version)!==S&&i.saveCampaign()});C.showModal(!0),null==(p=C.getButton("CANCEL"))||p.remove(),C.onOK(()=>{}),null==(d=document.querySelector(".d4-modal-background"))||d.remove()}(this,()=>{var e;return null!=(e=this._designView)?e:null})}),v=a.bigButton("Submit...",()=>{var e;null==(e=this._submitView)||e.render()}),b=r.Func.find({meta:{role:"HitDesignerFunction"}}).filter(e=>1===e.outputs.length&&e.outputs[0].propertyType===r.TYPE.DATA_FRAME);v.classList.add("hit-design-submit-button");let w=[v];if(this.stages.length>0&&w.unshift(f),this.campaign&&this.template&&!this.campaign.template&&(this.campaign.template=this.template),((null==(u=this.template)?void 0:u.layoutViewState)||(null==(c=this.template)?void 0:c.localLayoutPath))&&w.unshift(h),this.hasEditPermission&&w.unshift(g),b.length>0&&n){let e=b[0],i=a.iconFA("pen-nib",()=>it(function*(){let i={};if(e.inputs.length>0&&this.dataFrame&&this.dataFrame.currentRowIdx>=0&&e.inputs[0].semType===r.SEMTYPE.MOLECULE){var n;let t=nh.convertToSmiles(null==(n=this.dataFrame.col(this.molColName))?void 0:n.get(this.dataFrame.currentRowIdx));t&&(i[e.inputs[0].name]=t)}let l=e.prepare(i),o=yield l.getEditor();a.dialog(e.friendlyName).add(o).onOK(()=>it(function*(){let i=r.TaskBarProgressIndicator.create(`Running ${e.friendlyName}`);try{yield l.call();let n=l.getOutputParamValue();if(!n||!n.rowCount){t.shell.warning(`${e.friendlyName} returned an empty result`),i.close();return}yield n.meta.detectSemanticTypes(),yield t.data.detectSemanticTypes(n),yield this.handleJoiningDataframe(n)}catch(i){t.shell.error(`Failed to run ${e.friendlyName}`),nh.logger.error(i)}finally{i.close()}}).call(this)).show()}).call(this),e.description?e.description:e.friendlyName);w.unshift(i)}w.unshift(l),w.unshift(p),w.unshift(d),w.unshift(this._refreshCampaignIcon),o.push(w),o.some(e=>{var t;let i=null!=(t=null==e?void 0:e.findIndex(e=>{var t;return(null==e||null==(t=e.textContent)?void 0:t.toLowerCase())==="save"}))?t:-1;return -1!==i&&(e.splice(i,1),!0)}),o=o.filter(e=>{var t;return(null!=(t=null==e?void 0:e.length)?t:0)>0}),e.setRibbonPanels(o)}return e}applyTemplateLayout(e){return it(function*(){var i,n;if(!e)return void t.shell.error("No view found");if(null==(i=this.template)?void 0:i.localLayoutPath)try{let i=yield t.dapi.files.readAsText(this.template.localLayoutPath),n=r.ViewLayout.fromJson(i);e.loadLayout(n);return}catch(e){t.shell.error("Failed to apply layout from mounted file storage. Falling back to static layout"),nh.logger.error(e)}if(!(null==(n=this.template)?void 0:n.layoutViewState))return void t.shell.error("No layout found");try{let t=r.ViewLayout.fromViewState(this.template.layoutViewState);e.loadLayout(t)}catch(e){t.shell.error("Failed to apply template layout. Check console for more details."),nh.logger.error(e)}}).call(this)}getDesignView(){var e,i,n,a,l,o,s;this._designView&&this._designView.close();let u=[],c=null==(n=this.dataFrame.col(this.molColName))?void 0:n.toList().every(e=>!e&&""===e),p=t.shell.addTableView(this.dataFrame);this._designViewName=null!=(e=null!=(i=null==(a=this.campaign)?void 0:a.friendlyName)?i:null==(l=this.campaign)?void 0:l.name)?e:this._designViewName,p.name=this._designViewName,p._onAdded();let d=null==(o=this._campaign)?void 0:o.layout;if(d)try{let e=r.ViewLayout.fromViewState(d);p.loadLayout(e)}catch(e){t.shell.error("Failed to apply layout. Falling back to default layout."),console.error(e)}this.checkGrid(p),c&&t.functions.call("Chem:editMoleculeCell",{cell:p.grid.cell(this._molColName,0)}),this.initGridSubs(p,u);let h=null==(s=p.grid)?void 0:s.col(f);h&&(h.editable=!1);let g=this.dataFrame.col(f);return g&&(g.semType=y,g.valueComparer=(e,t)=>e===t?0:null===e?-1:null===t?1:parseInt(e.substring(1))-parseInt(t.substring(1))),u.push(this.dataFrame.onRowsAdded.pipe((0,tD.filter)(()=>!this.isJoining)).subscribe(()=>{try{if(this.stages.length>0)for(let t=0;t<this.dataFrame.rowCount;t++){var e;let i=this.dataFrame.col(m).get(t);(!i||""===i||(null==(e=this.dataFrame.col(m))?void 0:e.isNone(t)))&&this.dataFrame.set(m,t,this.stages[0])}let i=null;for(let e=0;e<this.dataFrame.rowCount;e++){let t=p.grid.cell(this.molColName,e);t&&(""===t.cell.value||null===t.cell.value)&&(i=t)}i&&t.functions.call("Chem:editMoleculeCell",{cell:i})}catch(e){console.error(e)}})),u.push(t.events.onContextMenu.subscribe(e=>{try{var i,n,a,l,o,s,u,c,d,m,h,g;let t=null==e||null==(i=e.args)?void 0:i.context;if(!t||(null==t?void 0:t.type)!==r.VIEWER.GRID||!t.tableView||t.tableView.id!==p.id||(null==e||null==(l=e.args)||null==(a=l.item)||null==(n=a.tableColumn)?void 0:n.name)!==this.molColName||!(null==e||null==(s=e.args)||null==(o=s.item)?void 0:o.isTableCell))return;let f=null==e||null==(u=e.args)?void 0:u.menu;if(!f)return;f.item("Add new row",()=>{this.dataFrame.rows.addNew(null,!0)}),f.item("Duplicate molecule",()=>{try{var t,i,n,a;let r=this.dataFrame.rows.addNew(null,!0),l=r.get(this.molColName);null!=l&&r.idx>-1&&(this.dataFrame.cell(r.idx,this.molColName).value=null!=(t=null==e||null==(a=e.args)||null==(n=a.item)||null==(i=n.cell)?void 0:i.value)?t:"")}catch(e){console.error(e)}});let y=null==e||null==(d=e.args)||null==(c=d.item)?void 0:c.tableRowIndex,v=null==e||null==(g=e.args)||null==(h=g.item)||null==(m=h.cell)?void 0:m.value;v&&(null!=y?y:-1)>-1&&f.item("Re-Run Calculations",()=>it(function*(){try{yield this.performSingleCellCalculations(y,v)}catch(e){console.error(e)}}).call(this))}catch(e){t.log.error(e)}})),u.push(t.events.onViewLayoutApplied.subscribe(e=>{e&&e.view===p&&this.initGridSubs(p,u)})),this.initDesignViewRibbons(p,u,!0),p.parentCall=this.parentCall,p}checkGrid(e){e.grid||(t.shell.error("Applied layout created view without grid. Resetting layout."),e.resetLayout())}initGridSubs(e,i){if(!this._gridSubs||this._gridSubs.grid!==e.grid){if(this._gridSubs&&this._gridSubs.subs.forEach(e=>e.unsubscribe()),this.checkGrid(e),!e.grid)return void t.shell.error("No grid found, cannot initialize grid subscriptions");this._gridSubs={grid:e.grid,subs:[]},(null==e?void 0:e.grid)&&this._gridSubs.subs.push(e.grid.onCellValueEdited.subscribe(e=>it(function*(){try{var i,n;if((null==(i=e.tableColumn)?void 0:i.name)===m)return void(yield this.saveCampaign(!1));if((null==(n=e.tableColumn)?void 0:n.name)!==this.molColName)return;let t=e.cell.value,a=e.tableRowIndex;if(t)try{let e=yield tY(t,this._campaignId,this.appName);this.dataFrame.col(f).set(a,e,!0)}catch(e){console.error("Failed to register molecule")}yield this.performSingleCellCalculations(a,t)}catch(e){t.shell.error("Failed to process molecule edit, check console for details"),console.error(e)}}).call(this))),(null==e?void 0:e.grid)&&this._gridSubs.subs.push(e.grid.onCellRender.subscribe(e=>{try{var t;let i=e.cell,n=this.duplicateVidCache;if(!i||!i.isTableCell||!i.tableColumn||!n||i.tableColumn.name!==f||(null!=(t=i.tableRowIndex)?t:-1)<0)return;n.valueCounts[n.indexes[i.tableRowIndex]]>1&&(e.cell.style.backColor=r.Color.setAlpha(r.Color.getCategoricalColor(n.indexes[i.tableRowIndex]),150))}catch(e){}})),this._gridSubs.subs.forEach(e=>i.push(e))}}getSummary(){var e,i,n,l,o,u,c,p,d,m,h,g,f,y,v,b,w,A;let E,T,x=()=>{var e,t;let i=this._filePath.indexOf(null!=(e=this.campaignId)?e:null==(t=this._campaign)?void 0:t.name);return -1===i?this._filePath:this._filePath.substring(0,i-1)},S=ii({},null!=(e=null==(u=this.campaign)?void 0:u.campaignFields)?e:this.campaignProps);this.template&&this.template.campaignFields&&Object.entries(S).forEach(([e,i])=>{let n=this.template.campaignFields.find(t=>t.name===e);n&&"Date"===n.type&&i?"Invalid Date"!==new Date(i).toString()?S[e]=new Date(i).toLocaleDateString():i.date?S[e]=new Date(i.date).toLocaleDateString():S[e]=i:n&&n.type===r.SEMTYPE.MOLECULE&&i&&(S[e]=t.chem.drawMolecule(i))});let O=()=>{let e=a.icons.edit(()=>{let i=x(),l=a.input.string("Path",{value:i}),o=l.root.getElementsByTagName("label").item(0);o&&o.remove(),l.root.style.width="100%";let u=a.button("Save",()=>it(function*(){var i;if(!(yield(i=l.value,ey(function*(){return i&&""!==i.trim()?!!(yield t.dapi.files.exists(i))||(t.shell.error("Given folder does not exist"),!1):(t.shell.error("Path can not be empty"),!1)})())))return;let o=l.value;o.endsWith("/")?this._filePath=`${o}${this.campaignId}/${s}`:this._filePath=`${o}/${this.campaignId}/${s}`,this._campaign&&(this._campaign.savePath=this._filePath),yield this.saveCampaign(!0),a.empty(r);let u=x();n=a.link(u,()=>{var e,t,i;return this.download(this.dataFrame,null!=(e=null!=(t=this.campaignId)?t:null==(i=this._campaign)?void 0:i.name)?e:"Molecules")},C),r.appendChild(n),r.appendChild(e)}).call(this)),c=a.button("Cancel",()=>{a.empty(r),r.appendChild(n),r.appendChild(e)});a.empty(r),l.addOptions(c),l.addOptions(u),r.appendChild(l.root),l.input.focus()},"Edit file path");e.style.marginLeft="5px";let i=x(),n=a.link(i,()=>{var e,t,i;return this.download(this.dataFrame,null!=(e=null!=(t=this.campaignId)?t:null==(i=this._campaign)?void 0:i.name)?e:"Molecules")},C),r=a.divH([n,e],{style:{alignItems:"center"}});return r},P=null!=(i=null!=(n=null==(c=this.campaign)?void 0:c.friendlyName)?n:null==(p=this.campaign)?void 0:p.name)?i:this.campaignId;return w=ii({Name:(y=a.divText(P),v={tooltip:"Edit Campaign Name",nullable:!1,onOk:e=>it(function*(){this.campaign.friendlyName=e,yield this.saveCampaign(!0)}).call(this),validator:e=>it(function*(){return(null==e?void 0:e.trim())?null:"Campaign name can not be empty"})()},E=a.icons.edit(()=>{var e,i,n,r,l;let o=null!=(e=null!=(i=null==v?void 0:v.tooltip)?i:y.textContent)?e:"",s=null!=(n=null==v?void 0:v.beforeEditTextContent)?n:e=>e,u=null!=(r=null==v?void 0:v.afterEditTextContent)?r:e=>e,c=a.input.string("smth",{value:s(null!=(l=y.textContent)?l:""),onValueChanged:()=>ey(function*(){var e;let t=yield d();setTimeout(()=>{var e,i;if(t){c.input.classList.add("d4-invalid"),o=t;return}c.input.classList.remove("d4-invalid"),o=null!=(e=null!=(i=null==v?void 0:v.tooltip)?i:y.textContent)?e:""},100),null==v||null==(e=v.onChange)||e.call(v,c.value)})()});a.tooltip.bind(c.input,()=>o);let p=c.root.getElementsByTagName("label").item(0);p&&p.remove(),c.root.style.width="100%";let d=()=>ey(function*(){var e;let t=(null==(e=c.value)?void 0:e.trim())||(null==v?void 0:v.nullable)?null:"Field cannot be empty";return null!=t?t:(null==v?void 0:v.validator)?yield v.validator(c.value):null})(),m=a.button("Save",()=>ey(function*(){var e,i;let n=yield d();n?t.shell.error(n):(yield null==v||null==(i=v.onOk)?void 0:i.call(v,c.value),y.textContent=null!=(e=u(c.value))?e:"",a.empty(T),T.appendChild(y),T.appendChild(E))})()),h=a.button("Cancel",()=>{var e;a.empty(T),T.appendChild(y),T.appendChild(E),null==v||null==(e=v.onCancel)||e.call(v)});a.empty(T),c.addOptions(h),c.addOptions(m),T.appendChild(c.root),c.input.focus()},null!=(b=null==v?void 0:v.tooltip)?b:"Edit"),T=a.divH([y,E],{style:{display:"flex",alignItems:"center"}}),E.style.marginLeft="5px",T),Code:null!=(l=this.campaignId)?l:null==(d=this._campaign)?void 0:d.name,Template:null!=(o=null==(m=this.template)?void 0:m.name)?o:"Molecules","File Path":O()},(null==(h=this.campaign)?void 0:h.authorUserFriendlyName)?{Author:this.campaign.authorUserFriendlyName}:{},(null==(g=this.campaign)?void 0:g.lastModifiedUserName)?{"Last Modified By":this.campaign.lastModifiedUserName}:{},(null==(f=this.campaign)?void 0:f.createDate)?{"Create Date":this.campaign.createDate}:{},S),A=A={"Number of Molecules":this.dataFrame.rowCount.toString(),"Enrichment Methods":[this.template.compute.descriptors.enabled?"descriptors":"",...this.template.compute.functions.map(e=>e.name)].filter(e=>e&&""!==e.trim()).join(", ")},Object.getOwnPropertyDescriptors?Object.defineProperties(w,Object.getOwnPropertyDescriptors(A)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t.push.apply(t,i)}return t})(Object(A)).forEach(function(e){Object.defineProperty(w,e,Object.getOwnPropertyDescriptor(A,e))}),w}saveCampaign(e=!0,i=!1,n){return it(function*(){var l,o,s,c,p,d,m,h,g,f,y,v,b,w,A,C,E,T,x,S,O,P,N,F,B,I;this._isSaving=!0;let k=this.campaignId,V=setTimeout(()=>{var e;(null==(e=this._designView)?void 0:e.grid)&&a.setUpdateIndicator(this._designView.grid.root,!0,"Someone else is saving the campaign. Please wait...")},500);try{let e=yield this.aquireAndWaitCampaignLock(k);if(!(null==e?void 0:e.aquired))throw Error("Could not acquire lock for campaign during 30 seconds")}catch(e){return clearTimeout(V),(null==(N=this._designView)?void 0:N.grid)&&a.setUpdateIndicator(this._designView.grid.root,!1),t.shell.error("Failed to acquire campaign lock. Someone else might be editing the campaign. Please try again later."),this._isSaving=!1,this.campaign}clearTimeout(V),(null==(y=this._designView)?void 0:y.grid)&&a.setUpdateIndicator(this._designView.grid.root,!0,"Saving Campaign...");let D=this.template.name,j=this.dataFrame,_={};j.columns.toList().forEach(e=>_[e.name]=e.semType);let L={};j.columns.toList().forEach(e=>L[e.name]=e.type);let M=null!=(l=null==(v=this.campaign)?void 0:v.tilesViewerFormSketch)?l:void 0,H=null!=(o=null==(b=this.campaign)?void 0:b.authorUserId)?o:t.shell.user.id,R=null!=(s=null==(w=this.campaign)?void 0:w.permissions)?s:yield it(function*(){try{let e=yield t_(function*(){try{var e,t;let i=nh.settings,n={view:[],edit:[]};if(!i)return n;return n.view=yield tM(null!=(e=i.view)?e:""),n.edit=yield tM(null!=(t=i.edit)?t:""),n}catch(e){return console.error(e),{view:[],edit:[]}}})(),t={view:e.view.map(e=>e.id),edit:e.edit.map(e=>e.id)};return 0===t.edit.length&&(t.edit=[ta.edit["0"]]),0===t.view.length&&(t.view=[ta.view["0"]]),t}catch(e){t.shell.error("Failed to get default permissions"),console.error(e)}return ta})(),U=H?null!=(c=null==(A=this.campaign)?void 0:A.authorUserFriendlyName)?c:null==(C=yield t.dapi.users.find(H))?void 0:C.friendlyName:void 0,q={name:k,friendlyName:null!=(p=null!=(d=null==(E=this.campaign)?void 0:E.friendlyName)?d:null==n?void 0:n.friendlyName)?p:k,templateName:D,status:null!=(m=null==(T=this.campaign)?void 0:T.status)?m:"In Progress",createDate:null!=(h=null==(x=this.campaign)?void 0:x.createDate)?h:ev(new Date),campaignFields:null!=(g=null==(S=this.campaign)?void 0:S.campaignFields)?g:this.campaignProps,columnSemTypes:_,rowCount:j.rowCount,filteredRowCount:j.filter.trueCount,savePath:this._filePath,columnTypes:L,tilesViewerFormSketch:M,version:this.version+1,authorUserId:H,authorUserFriendlyName:U,lastModifiedUserName:t.shell.user.friendlyName,permissions:R,mergeConfig:null==(O=this.campaign)?void 0:O.mergeConfig};if(!this.hasEditPermission)return t.shell.error("You do not have permission to modify this campaign"),(null==(F=this._designView)?void 0:F.grid)&&a.setUpdateIndicator(this._designView.grid.root,!1),yield this.releaseCampaignLock(k),this._isSaving=!1,q;let Y=`${this.appName}/campaigns/${k}/${u}`,G=j;if(yield nh.files.exists(Y)){let e=JSON.parse((yield nh.files.readAsText(Y)));if((null!=(B=e.version)?B:0)>this.version&&(q.version=Math.max(this.version,null!=(I=e.version)?I:0)+1,yield t.dapi.files.exists(this._filePath)))try{let e=yield t.dapi.files.readCsv(this._filePath);G=this.unionDataframes(e,j,this.molColName,this.molColName)}catch(e){console.error(e)}}let W=r.DataFrame.fromColumns(G.columns.toList().filter(e=>!e.name.startsWith("~"))).toCsv();yield t.dapi.files.writeAsText(this._filePath,W);let J=this._designView.saveLayout();J?q.layout=J.viewState:t.shell.warning("Layout cound not be saved"),q.template=this.template,yield nh.saveCampaignJson(this.appName,q),e&&t.shell.info("Campaign saved successfully."),!e&&i&&t.shell.info("Campaign created successfully."),this.campaign=q,this.designViewName=null!=(f=q.friendlyName)?f:q.name;let z=yield this.releaseCampaignLock(k);return this._lastExpiresTimeString=z,(null==(P=this._designView)?void 0:P.grid)&&a.setUpdateIndicator(this._designView.grid.root,!1),this._isSaving=!1,this._refreshIconTooltip="Refresh Campaign",q}).call(this)}constructor(e,t="Hit Design",i=e=>new tb(e)){super(e,t),this._designViewName="Design",this._filePath=`System.AppData/HitTriage/${this.appName}/campaigns`,this._molColName=h,this.campaignProps={},this.existingStatuses=[],this._refreshIconTooltip="Refresh Campaign",this._updateCheckIntervalId=null,this._needsRefresh=!1,this._lastExpiresTimeString=null,this._refreshCampaignIcon=null,this._gridSubs=null,this._isSaving=!1,this._infoView=i(this),this.multiView=new r.MultiView({viewFactories:{[this._infoView.name]:()=>this._infoView}}),this.multiView.subs.push(this.multiView.tabs.onTabChanged.subscribe(e=>{this.multiView.currentView instanceof e9&&this.multiView.currentView.onActivated()})),this.multiView.parentCall=e,iE(this.multiView,this),this.mainView=this.multiView,this._initViewSubs()}}function ir(e,t,i,n,a,r,l){try{var o=e[r](l),s=o.value}catch(e){i(e);return}o.done?t(s):Promise.resolve(s).then(n,a)}function il(e){return function(){var t=this,i=arguments;return new Promise(function(n,a){var r=e.apply(t,i);function l(e){ir(r,n,a,l,o,"next",e)}function o(e){ir(r,n,a,l,o,"throw",e)}l(void 0)})}}function io(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{},n=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(i).filter(function(e){return Object.getOwnPropertyDescriptor(i,e).enumerable}))),n.forEach(function(t){var n;n=i[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function is(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t.push.apply(t,i)}return t})(Object(t)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(t,i))}),e}let iu=new Map;function ic(e,i,n,a){let r=iu.get(e);return r||(r=t.functions.register({signature:i,run:a,isAsync:!0,namespace:"HitTriageAI",tags:"hit-ai-function",options:{description:n}}),iu.set(e,r)),r}let ip=new WeakMap;function id(e){var t,i;let n=null!=(t=null==e?void 0:e.jsView)?t:e;for(let t of[n,e,null==n?void 0:n.currentView]){if(null==t)continue;let e=ip.get(t);if(e instanceof tc)return e;if(t.app instanceof tc)return t.app;if((null==(i=t.currentView)?void 0:i.app)instanceof tc)return t.currentView.app}throw Error("The current view does not belong to a Hit Triage / Hit Design app")}function im(e){let t=id(e);if(!(t instanceof ia))throw Error("This action applies only to Hit Design / PeptiHit campaigns");return t}function ih(e){var t,i;let n=null!=(t=null==e?void 0:e.jsView)?t:e;if(n instanceof r.TableView)return n;let a=id(e),l=null!=(i=a._designView)?i:a._pickView;if(l instanceof r.TableView)return l;throw Error("No campaign table view is open")}function ig(e){var t;return io(is(io({code:e.name},e.friendlyName&&e.friendlyName!==e.name?{name:e.friendlyName}:{}),{template:e.templateName,status:null!=(t=e.status)?t:null}),e.authorUserFriendlyName?{author:e.authorUserFriendlyName}:{},e.createDate?{created:e.createDate}:{},null!=e.rowCount?{rows:e.rowCount}:{})}function iy(e){var t,i,n,a;let r=null==e?void 0:e.compute;return r?{descriptors:(null==(a=r.descriptors)?void 0:a.enabled)?r.descriptors.args:[],functions:(null!=(t=r.functions)?t:[]).map(e=>`${e.package}:${e.name}`),scripts:(null!=(i=r.scripts)?i:[]).map(e=>e.name),queries:(null!=(n=r.queries)?n:[]).map(e=>e.name)}:null}function iv(e){return il(function*(){return!e.authorUserId||!e.permissions||(yield eT(e.authorUserId,e.permissions))})()}function ib(e,t){return il(function*(){var i,n;let a=yield nh.loadCampaigns(e.appName,[]);return null!=(i=null!=(n=a[t])?n:Object.values(a).find(e=>{var i;return(null!=(i=e.friendlyName)?i:"").toLowerCase()===t.toLowerCase()}))?i:null})()}function iw(e){return il(function*(){return(yield nh.files.list(`${e}/templates`)).filter(e=>e.name.endsWith(".json")).map(e=>e.name.slice(0,-5))})()}function iA(){return[ic("getHitCampaignState","dynamic getHitCampaignState(view view)","State of the open campaign - name, template, status, molecule column, stages, columns, row counts, edit permission, submit function. Call this first. The molecule data itself lives in the attached table",e=>il(function*(){var t,i,n,a,r;let l=id(e),o=l.dataFrame,s=l instanceof ia?l.stages:[];return is(io(is(io({app:l.appName,campaign:l.campaign?ig(l.campaign):null},l.campaignId?{code:l.campaignId}:{}),{moleculeColumn:null!=(t=l.molColName)?t:null}),l.helmColName?{sequenceColumn:l.helmColName}:{},s.length?{stages:s}:{}),{rows:null!=(i=null==o?void 0:o.rowCount)?i:0,filteredRows:null!=(n=null==o?void 0:o.filter.trueCount)?n:0,columns:o?o.columns.toList().filter(e=>!e.name.startsWith("~")).map(e=>io({name:e.name,type:e.type},e.semType?{semType:e.semType}:{})):[],canEdit:l.canEdit,submitFunction:l.submitParams?`${l.submitParams.package}:${l.submitParams.fName}`:null,compute:iy(null!=(a=null==(r=l.campaign)?void 0:r.template)?a:l.template)})})()),ic("saveHitCampaign","dynamic saveHitCampaign(view view)","Save the open campaign - its table, layout and metadata",e=>il(function*(){var t,i;let n=id(e);return n.canEdit?(yield n.saveCampaign(),{success:!0,campaign:null!=(t=n.campaignId)?t:null==(i=n.campaign)?void 0:i.name}):{success:!1,error:"You do not have permission to modify this campaign"}})()),ic("setHitCampaignStatus","dynamic setHitCampaignStatus(view view, string status)","Set the status of the open campaign (free text, e.g. In Progress, Approved) and save it",(e,t)=>il(function*(){let i=id(e);return(null==t?void 0:t.trim())?i.campaign?i.canEdit?(i.campaign.status=t.trim(),yield i.saveCampaign(),{success:!0,status:i.campaign.status}):{success:!1,error:"You do not have permission to modify this campaign"}:{success:!1,error:"No campaign is open"}:{success:!1,error:"status is required"}})()),ic("submitHitCampaign","dynamic submitHitCampaign(view view, string status)","Submit the campaign molecules to the configured submit function and save. status is optional and applies to Hit Design campaigns (Hit Triage submits always set the status to Submitted). ALWAYS confirm with the user first",(e,t)=>il(function*(){let i=id(e);if(!i.canEdit)return{success:!1,error:"You do not have permission to modify this campaign"};if(!i.submitParams)return{success:!1,error:"No submit function is configured for this campaign template"};let n=i.submitView;return n?(n.submitWithStatus?yield n.submitWithStatus(null!=t?t:void 0):yield n.submit())?{success:!0,submittedTo:`${i.submitParams.package}:${i.submitParams.fName}`}:{success:!1,error:"The configured submit function could not be run"}:{success:!1,error:"The campaign is not fully open yet"}})()),ic("searchHitTableFunctions","dynamic searchHitTableFunctions(view view, string query, int limit)","Search the standard table view functions (hundreds of data commands - add columns, aggregate, select rows, viewers). ALWAYS pass a query. Invoke matches with callHitTableFunction",(e,t,i)=>il(function*(){let n=ih(e),a=r.View.prototype.getFunctions.call(n),l=(null!=t?t:"").toLowerCase().split(/\s+/).filter(e=>e.length>0),o=a.map(e=>({f:e,s:(e=>{if(!l.length)return 1;let t=[e.name,e.friendlyName,e.description].filter(Boolean).join(" ").toLowerCase();return l.filter(e=>t.includes(e)).length})(e)})).filter(e=>e.s>0).sort((e,t)=>t.s-e.s).map(e=>e.f),s=i&&i>0?i:10;return io({total:o.length,functions:o.slice(0,s).map(e=>({name:e.name,description:e.description||e.friendlyName||e.name,inputs:e.inputs.filter(e=>"view"!==e.name&&"view"!==e.propertyType).map(e=>({name:e.name,type:e.propertyType}))}))},o.length>s?{note:`Showing ${s} of ${o.length} — refine the query`}:{})})()),ic("callHitTableFunction","dynamic callHitTableFunction(view view, string name, map parameters)","Invoke a standard table view function by name (from searchHitTableFunctions) with parameters keyed by input name",(e,t,i)=>il(function*(){var n;let a=ih(e),l=r.View.prototype.getFunctions.call(a),o=null!=(n=l.find(e=>e.name===t))?n:l.find(e=>e.name.toLowerCase()===(null!=t?t:"").toLowerCase());if(!o)return{success:!1,error:`No table function '${t}' — call searchHitTableFunctions to find it`};let s=io({},null!=i?i:{});for(let e of o.inputs)e.name in s||"view"!==e.name&&"view"!==e.propertyType||(s[e.name]=a);let u=yield o.apply(s);return io({success:!0},null!=u?{result:function(e){if(null==e||"string"==typeof e||"number"==typeof e||"boolean"==typeof e)return e;if(e instanceof r.DataFrame)return{type:"dataframe",name:e.name,rowCount:e.rowCount,columns:e.columns.names()};if(e instanceof r.Column)return{type:"column",name:e.name,length:e.length};if(e instanceof r.ViewBase)return{type:"view",name:e.name};try{return JSON.parse(JSON.stringify(e))}catch(t){return String(e)}}(u)}:{})})())]}function iC(e){return`${e} — the landing page of a molecule campaign app where teams ${"Hit Design"===e||"PeptiHit"===e?"design molecules in a spreadsheet, calculate properties, and track progress through stages":"ingest a molecule dataset, calculate properties, and filter it down to the hits"}. Act on it through the view functions (search list_view_functions with "hit"): getHitAppInfo (call first), listHitCampaigns / getHitCampaignDetails / openHitCampaign to browse and continue campaigns, listHitTemplates / getHitTemplateDetails for the templates, createHitCampaign / deleteHitCampaign to manage them (confirm deletions with the user first).`}function iE(e,t){ip.set(e,t),e.aiDescription=iC(t.appName),e.getFunctions=()=>[ic("getHitAppInfo","dynamic getHitAppInfo(view view)","Overview of this Hit app - its name, saved campaign and template counts, the campaign currently open. Call this first",e=>il(function*(){var t,i,n;let a=id(e),r=yield nh.loadCampaigns(a.appName,[]);return{app:a.appName,campaigns:Object.keys(r).length,templates:yield iw(a.appName),currentCampaign:null!=(t=null!=(i=a.campaignId)?i:null==(n=a.campaign)?void 0:n.name)?t:null,canCreateCampaignsHere:a instanceof ia}})()),ic("listHitCampaigns","dynamic listHitCampaigns(view view)","List the saved campaigns of this Hit app with code, name, template, status, author and row count. Campaigns are addressed by code",e=>il(function*(){let t=id(e),i=Object.values((yield nh.loadCampaigns(t.appName,[])));return{total:i.length,campaigns:i.map(ig)}})()),ic("getHitCampaignDetails","dynamic getHitCampaignDetails(view view, string campaignCode)","Full detail of one saved campaign - fields, row counts, compute methods, stages, whether the current user can edit it",(e,t)=>il(function*(){var i,n;let a=id(e),r=yield ib(a,t);return r?is(io({},ig(r),r.campaignFields&&Object.keys(r.campaignFields).length?{campaignFields:r.campaignFields}:{},null!=r.filteredRowCount?{filteredRows:r.filteredRowCount}:{},r.lastModifiedUserName?{lastModifiedBy:r.lastModifiedUserName}:{},(null==(n=r.template)||null==(i=n.stages)?void 0:i.length)?{stages:r.template.stages}:{}),{compute:iy(r.template),canEdit:yield iv(r)}):{success:!1,error:`No campaign '${t}' — call listHitCampaigns for codes`}})()),ic("openHitCampaign","dynamic openHitCampaign(view view, string campaignCode)","Open a saved campaign so the user can work on it - loads its table and shows the campaign view",(e,t)=>il(function*(){let i=id(e),n=yield ib(i,t);return n?(yield i.infoView.setCampaign(n.name),i.campaignId!==n.name)?{success:!1,error:"Failed to open the campaign — you may not have permission to view it"}:{success:!0,campaign:n.name,note:"The campaign view is now open"}:{success:!1,error:`No campaign '${t}' — call listHitCampaigns for codes`}})()),ic("listHitTemplates","dynamic listHitTemplates(view view)","List the campaign template names of this Hit app",e=>il(function*(){return{templates:yield iw(id(e).appName)}})()),ic("getHitTemplateDetails","dynamic getHitTemplateDetails(view view, string templateName)","Full detail of one campaign template - its campaign fields, stages, compute methods, data source and submit function",(e,t)=>il(function*(){var i,n;let a=id(e),r=`${a.appName}/templates/${t}.json`;if(!(yield nh.files.exists(r)))return{success:!1,error:`No template '${t}' — call listHitTemplates for names`};let l=yield e_(r);return io(is(io({name:l.name,key:l.key,campaignFields:(null!=(i=l.campaignFields)?i:[]).map(e=>({name:e.name,type:e.type,required:!!e.required}))},(null==(n=l.stages)?void 0:n.length)?{stages:l.stages}:{},l.dataSourceType?{dataSourceType:l.dataSourceType}:{},l.queryFunctionName?{dataSourceFunction:l.queryFunctionName}:{}),{compute:iy(l)}),l.submit?{submitFunction:`${l.submit.package}:${l.submit.fName}`}:{})})()),ic("createHitCampaign","dynamic createHitCampaign(view view, string templateName, string campaignName, map campaignFields)","Create a new campaign from a template and open it. Hit Design and PeptiHit only. campaignName and campaignFields are optional, but fields the template marks required must be provided",(e,t,i,n)=>il(function*(){var a;let r=im(e),l=`${r.appName}/templates/${t}.json`;if(!(yield nh.files.exists(l)))return{success:!1,error:`No template '${t}' — call listHitTemplates for names`};let o=yield e_(l),s=(null!=(a=o.campaignFields)?a:[]).filter(e=>e.required&&((null==n?void 0:n[e.name])==null||""===n[e.name])).map(e=>e.name);if(s.length)return{success:!1,error:`Missing required campaign fields: ${s.join(", ")} — pass them in campaignFields`};r.clearCampaign(),r.dataFrame=td(o,"PeptiHit"===r.appName),yield r.setTemplate(o),r.campaignProps=io({},null!=n?n:{});let u=(null==i?void 0:i.trim())?i.trim():void 0;return yield r.saveCampaign(!1,!0,{friendlyName:u}),o.layoutViewState&&r.campaign&&(r.campaign.layout=o.layoutViewState),{success:!0,campaign:r.campaignId,note:"The campaign is created and its design view is open"}})()),ic("deleteHitCampaign","dynamic deleteHitCampaign(view view, string campaignCode)","Permanently delete a saved campaign. ALWAYS confirm with the user first",(e,t)=>il(function*(){let i=id(e),n=yield ib(i,t);return n?(yield iv(n))?(yield i.infoView.deleteCampaignAndRefresh(i.appName,n.name),{success:!0,deleted:n.name}):{success:!1,error:"You do not have permission to delete this campaign"}:{success:!1,error:`No campaign '${t}' — call listHitCampaigns for codes`}})())]}function iT(e,t,i){var n;ip.set(e,t),n=t.appName,e.aiDescription=`An open ${n} campaign — a molecule spreadsheet for ${"design"===i?"sketching and editing molecules in the grid. Hit-specific functions: getHitCampaignState (call first), setHitMolecule / setHitStage / setHitStages / recalculateHitRow to edit, saveHitCampaign / setHitCampaignStatus / submitHitCampaign to persist":"filtering the enriched molecule table down to the hits. Hit-specific functions: getHitCampaignState (call first), saveHitCampaign / setHitCampaignStatus / submitHitCampaign"}. The underlying table view also has hundreds of standard data commands — find them with searchHitTableFunctions (always pass a query) and run them with callHitTableFunction. The data itself lives in the attached table.`,e.getFunctions=()=>"design"===i?[...iA(),ic("setHitMolecule","dynamic setHitMolecule(view view, string molecule, int row)","Set the molecule of a row (SMILES or molblock, HELM for PeptiHit). Omit row to add a new row. Registers the V-iD and runs the configured property calculations",(e,t,i)=>il(function*(){var n,a,r,l;let o=im(e);if(!o.canEdit)return{success:!1,error:"You do not have permission to modify this campaign"};if(!(null==t?void 0:t.trim()))return{success:!1,error:"molecule is required"};let s=o.dataFrame;if(!s)return{success:!1,error:"No campaign table is open"};let u=o.helmColName,c=u?s.col(u):s.col(o.molColName);if(!c)return{success:!1,error:"The molecule column was not found"};let p=null!=i?i:null;if(null==p)s.rows.addNew(null,!0),p=s.rowCount-1;else if(p<0||p>=s.rowCount)return{success:!1,error:`row must be between 0 and ${s.rowCount-1}`};if(c.set(p,t,!0),u){yield o.performSingleCellCalculations(p,t);let e=null==(a=s.col(o.molColName))?void 0:a.get(p);if(e)try{let t=yield tY(e,o.campaignId,o.appName);t&&(null==(r=s.col(f))||r.set(p,t,!0))}catch(e){console.error("Failed to register molecule",e)}}else{try{let e=yield tY(t,o.campaignId,o.appName);e&&(null==(l=s.col(f))||l.set(p,e,!0))}catch(e){console.error("Failed to register molecule",e)}yield o.performSingleCellCalculations(p,t)}return io({success:!0,row:p},(null==(n=s.col(f))?void 0:n.get(p))?{vId:s.col(f).get(p)}:{})})()),ic("setHitStage","dynamic setHitStage(view view, int row, string stage)","Move a row to another stage of the campaign progress tracker and save",(e,t,i)=>il(function*(){let n=im(e);if(!n.canEdit)return{success:!1,error:"You do not have permission to modify this campaign"};let a=n.dataFrame,r=null==a?void 0:a.col(m);return a&&r?null==t||t<0||t>=a.rowCount?{success:!1,error:`row must be between 0 and ${a.rowCount-1}`}:n.stages.includes(i)?(r.set(t,i,!0),yield n.saveCampaign(!1),{success:!0,row:t,stage:i}):{success:!1,error:`Unknown stage '${i}' — the stages are: ${n.stages.join(", ")}`}:{success:!1,error:"This campaign has no stage column"}})()),ic("setHitStages","dynamic setHitStages(view view, list stages)","Replace the stage list of the campaign progress tracker. Rows in a removed stage move to the first stage. Saves the campaign",(e,t)=>il(function*(){var i,n;let a=im(e);return a.canEdit?!Array.isArray(t)||!t.length||t.some(e=>"string"!=typeof e||!e.trim())?{success:!1,error:"Pass stages as a non-empty list of names"}:(null==(i=a.campaign)?void 0:i.template)&&a.template?(null==(n=a.dataFrame)?void 0:n.col(m))?(yield a.setStages(t.map(e=>e.trim())),{success:!0,stages:a.stages}):{success:!1,error:"This campaign has no stage column"}:{success:!1,error:"No campaign is open"}:{success:!1,error:"You do not have permission to modify this campaign"}})()),ic("recalculateHitRow","dynamic recalculateHitRow(view view, int row)","Re-run the configured property calculations for one row of the campaign",(e,t)=>il(function*(){var i;let n=im(e),a=n.dataFrame;if(!a)return{success:!1,error:"No campaign table is open"};if(null==t||t<0||t>=a.rowCount)return{success:!1,error:`row must be between 0 and ${a.rowCount-1}`};let r=n.helmColName,l=null==(i=r?a.col(r):a.col(n.molColName))?void 0:i.get(t);return l?(yield n.performSingleCellCalculations(t,l),{success:!0,row:t}):{success:!1,error:"The row has no molecule to calculate from"}})())]:iA()}function ix(e,t,i,n,a,r,l){try{var o=e[r](l),s=o.value}catch(e){i(e);return}o.done?t(s):Promise.resolve(s).then(n,a)}function iS(e){return function(){var t=this,i=arguments;return new Promise(function(n,a){var r=e.apply(t,i);function l(e){ix(r,n,a,l,o,"next",e)}function o(e){ix(r,n,a,l,o,"throw",e)}l(void 0)})}}class iO extends e9{onActivated(){t.shell.windows.showHelp=!0,t.shell.windows.help.showHelp(this.readmePath)}refreshCampaignsTable(){return iS(function*(){if(null!=this.campaignsTableRoot){a.setUpdateIndicator(this.campaignsTableRoot,!0);try{let e=yield this.getCampaignsTable();a.setUpdateIndicator(this.campaignsTableRoot,!1),a.empty(this.campaignsTableRoot),this.campaignsTableRoot.appendChild(e)}catch(e){t.shell.error("Failed to update campaigns table"),console.error(e)}finally{a.setUpdateIndicator(this.campaignsTableRoot,!1)}}}).call(this)}getAppHeader(){return D.appHeader({iconPath:nh.webRoot+"/images/icons/hit-triage-icon.png",learnMoreUrl:"https://github.com/datagrok-ai/public/blob/master/packages/HitTriage/README_HT.md",description:"- Configure your own workflow using the template editor.\n- Calculate different molecular properties.\n- Filter molecules using different criteria.\n- Submit processed dataframe to the function of your choice.\n- Save campaigns and continue any time from where you left off.\n "})}getTemplatesFolder(){return`${this.app.appName}/templates`}getDataSourceTag(){return c}getDataSourceFunctionsMap(){return this.dataSourceFunctionsMap}init(e){return iS(function*(){a.setUpdateIndicator(this.root,!0);try{let t=a.h1(T),i=a.h1(x,{style:{marginLeft:"10px"}}),n=a.div(),l=a.div([],{classes:"ui-form"}),o=yield this.getCampaignsTable();this.campaignsTableRoot=a.div([o],{style:{position:"relative"}});let s=a.iconFA("layer-group",()=>iS(function*(){let e=r.Menu.popup();Object.values(L).forEach(t=>{e.item(t,()=>iS(function*(){eO(H,t),yield this.refreshCampaignsTable()}).call(this))});let t=e.group("Campaign Fields"),i=yield nh.loadCampaigns(this.app.appName,this.deletedCampaigns),n=new Set;Object.values(i).forEach(e=>{e.campaignFields&&Object.keys(e.campaignFields).forEach(e=>n.add(e))}),Array.from(n).forEach(e=>{t.item(e,()=>iS(function*(){var t;t=`campaignFields.${e}`,eO(H,t),yield this.refreshCampaignsTable()}).call(this))}),e.show({element:p,x:120,y:p.offsetTop+30})}).call(this),"Group by");s.style.marginBottom="9px",s.style.marginLeft="8px",s.style.fontSize="15px",s.style.color="var(--blue-1)",a.tooltip.bind(s,()=>`Group Campaigns. Current: ${this.currentGroupping}`);let u=a.iconFA("eye",()=>iS(function*(){let e=r.Menu.popup(),t=yield nh.loadCampaigns(this.app.appName,this.deletedCampaigns),i=function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{},n=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(i).filter(function(e){return Object.getOwnPropertyDescriptor(i,e).enumerable}))),n.forEach(function(t){var n;n=i[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},q);delete i.Name,Object.values(t).forEach(e=>{e.campaignFields&&Object.keys(e.campaignFields).forEach(e=>{i[`campaignFields.${e}`]=t=>{var i,n;return null!=(i=null==(n=t.campaignFields)?void 0:n[e])?i:""}})});let n=eB().reduce((e,t)=>(e[t]=!0,e),{});Object.keys(i).filter(e=>!e.startsWith("campaignFields.")).forEach(t=>{var i;e.item(t,()=>{n[t]=!n[t],eI(Object.keys(n).filter(e=>n[e])),this.refreshCampaignsTable()},null,{check:null!=(i=n[t])&&i})});let a=e.group("Campaign Fields");Object.keys(i).filter(e=>e.startsWith("campaignFields.")).forEach(e=>{var t;a.item(e.replace("campaignFields.",""),()=>{n[e]=!n[e],eI(Object.keys(n).filter(e=>n[e])),this.refreshCampaignsTable()},null,{check:null!=(t=n[e])&&t})}),e.show({element:p,x:100,y:p.offsetTop+30})}).call(this),"View");a.tooltip.bind(u,"Edit visible columns in campaigns table"),u.style.marginBottom="9px",u.style.marginLeft="8px",u.style.fontSize="15px",u.style.color="var(--blue-1)";let c=a.iconFA("sync",()=>iS(function*(){yield this.refreshCampaignsTable()}).call(this),"Refresh");c.style.marginBottom="9px",c.style.marginLeft="8px",c.style.color="var(--blue-1)",a.tooltip.bind(c,()=>"Refresh campaigns table");let p=a.divH([t,u,s,c],{style:{alignItems:"center"}});yield this.startNewCampaign(n,l,e),eq()(this._contentRoot).empty(),this._contentRoot.appendChild(a.divV([p],{style:{marginLeft:"10px"}})),this._contentRoot.appendChild(this.campaignsTableRoot),this._contentRoot.appendChild(i),this._contentRoot.appendChild(l),this._contentRoot.appendChild(n)}catch(e){throw a.setUpdateIndicator(this.root,!1),e}finally{a.setUpdateIndicator(this.root,!1)}}).call(this)}startNewCampaign(e,i,n){return iS(function*(){var r;let l=(yield nh.files.list(this.getTemplatesFolder())).filter(e=>e.name.endsWith(".json")).map(e=>e.name.slice(0,-5));n&&!l.includes(n.name)&&l.push(n.name);let o=null,s=!0,u=()=>iS(function*(){if(!s)return;let t=c.value,i=n&&n.name===t?n:yield e_(this.getTemplatesFolder()+"/"+t+".json");o=i;let a=yield this.getNewCampaignAccordeon(i,e);eq()(e).empty(),e.className="ui-form",e.appendChild(a)}).call(this),c=a.input.choice("Template",{value:null!=(r=null==n?void 0:n.name)?r:l[0],items:l,onValueChanged:()=>iS(function*(){yield u()})()});c.root.style.width="100%";let p=a.icons.add(()=>iS(function*(){a.setUpdateIndicator(this.root,!0),yield this.createNewTemplate(),a.setUpdateIndicator(this.root,!1)}).call(this),b),d=a.icons.copy(()=>{o&&this.createNewTemplate(o)},"Clone template"),m=a.icons.delete(()=>{c.value&&!(c.items.length<2)&&a.dialog("Delete template").add(a.divText(`Are you sure you want to delete template ${c.value}?`)).onOK(()=>iS(function*(){try{let e=c.value;yield nh.files.delete(`${this.getTemplatesFolder()}/${e}.json`),s=!1,c.items=c.items.filter(t=>t!==e),c.value=c.items[0],s=!0,yield u(),t.shell.info("Template "+e+" was deleted successfully")}catch(e){s=!0,t.shell.error("Failed to delete template "+c.value),console.error(e)}}).call(this)).show()},"Delete template");m.style.color="var(--blue-1)",p.style.color="#2083d5",c.addOptions(p),c.addOptions(d),c.addOptions(m),yield u(),eq()(i).empty(),i.appendChild(c.root)}).call(this)}checkCampaign(e){return iS(function*(){let t=new URLSearchParams(location.search);if(!t.has(l)&&!e)return;let i=null!=e?e:t.get(l);if(!(yield nh.files.exists(`${this.app.appName}/campaigns/${i}/${u}`)))return;let n=JSON.parse((yield nh.files.readAsText(`${this.app.appName}/campaigns/${i}/${u}`)));if(n){if(n.authorUserId&&n.permissions&&!(yield ex(n.authorUserId,n.permissions)))return void this.app.setBaseUrl();this.app.campaign=n}let a=yield e_(`${this.getTemplatesFolder()}/${n.templateName}.json`);return this.app.setTemplate(a,n.filters,i,n.ingest),e&&eb(l,e),n}).call(this)}getCampaignsTable(){return iS(function*(){var e;let i,n=yield nh.loadCampaigns(this.app.appName,this.deletedCampaigns),l=null!=(e=eS(H))?e:L.None,o=(i=eS(U))?JSON.parse(i):null,s=Object.values(n);o&&eP(s,o,q);let u=eV(s,l),c=eB();this.currentGroupping=l;let p=e=>{var i,n;let l=a.icons.delete(()=>iS(function*(){var t;a.dialog("Delete campaign").add(a.divText(`Are you sure you want to delete campaign ${null!=(t=e.friendlyName)?t:e.name}?`)).onOK(()=>iS(function*(){yield this.deleteCampaignAndRefresh(this.app.appName,e.name)}).call(this)).show()}).call(this),"Delete campaign"),o=a.iconFA("share",()=>iS(function*(){yield new tr(e.permissions).show(i=>iS(function*(){var n,a;try{e.permissions=i,null!=e.authorUserId||(e.authorUserId=t.shell.user.id),yield nh.saveCampaignJson(this.app.appName,e),t.shell.info("Permissions updated for campaign "+(null!=(n=e.friendlyName)?n:e.name))}catch(i){t.shell.error("Failed to update permissions for campaign "+(null!=(a=e.friendlyName)?a:e.name)),console.error(i)}}).call(this))}).call(this),"Manage campaign permissions");return l.style.display="none",o.style.display="none",eT(null!=(i=e.authorUserId)?i:r.User.current().id,null!=(n=e.permissions)?n:ta).then(e=>{e&&(l.style.display="inline-block",o.style.display="inline-block")}),l.style.color="var(--blue-1)",o.style.color="var(--blue-1)",[o,l]},d=Object.values(u).flat(),m=a.table(d,e=>{var t;return[a.link(null!=(t=e.friendlyName)?t:e.name,()=>this.setCampaign(e.name),"Continue Campaign",""),...c.map(t=>{var i,n,a,r;return t.startsWith("campaignFields.")?null!=(i=null==(a=e.campaignFields)?void 0:a[t.replace("campaignFields.","")])?i:"":null!=(n=null==(r=q[t])?void 0:r.call(q,e))?n:""}),...p(e)]},["Name",...c.map(e=>e.replace("campaignFields.","")),"",""]);return m.style.color="var(--grey-5)",m.style.marginLeft="24px",m.querySelectorAll("tr.header > td").forEach((e,t)=>{if(!e.textContent)return;let i=0===t?"Name":c[t-1];if(o&&i===o.columnName){let t=o.ascending?"↑":"↓";e.appendChild(a.span([t],{style:{fontSize:"12px",marginLeft:"2px"}}))}e.addEventListener("dblclick",()=>{var e;let t={columnName:i,ascending:!0};o&&i===o.columnName&&(t=o.ascending?{columnName:i,ascending:!1}:null),(e=t)?eO(U,JSON.stringify(e)):localStorage.removeItem(U),this.refreshCampaignsTable()})}),eD(m,u),m}).call(this)}setCampaign(e){return iS(function*(){let t=yield this.checkCampaign(e);this.app.campaign=t}).call(this)}getNewCampaignAccordeon(e,t){return iS(function*(){a.setUpdateIndicator(t,!0);let{root:i,promise:n,cancelPromise:r}=yield eR(e,this.getDataSourceFunctionsMap(),this.getDataSourceTag());return a.setUpdateIndicator(t,!1),n.then(t=>iS(function*(){this.app.dataFrame=t.df,this.app._fileInputType=t.type,yield this.app.setTemplate(e,void 0,void 0,void 0,t.friendlyName),this.app.campaignProps=t.campaignProps,yield this.app.saveCampaign(void 0,!1),e.layoutViewState&&this.app.campaign&&(this.app.campaign.layout=e.layoutViewState)}).call(this)),r.then(()=>{this.init()}),i}).call(this)}createNewTemplate(e){return iS(function*(){var i,n;let l=yield(i=this.app,n=this.getDataSourceFunctionsMap(),e5(function*(){var l,o,s;let u=(yield nh.files.list("Hit Triage/templates")).map(e=>e.name.slice(0,-5)),d=[];for(let e of u){let t=yield e_(`Hit Triage/templates/${e}.json`);d.push(t.key)}let m=Array.from(new Set(r.Func.find({meta:{role:p}}).concat(r.Func.find({tags:[p]})))),h={};m.forEach(e=>{var t;h[null!=(t=e.friendlyName)?t:e.name]=e});let g=(null==e?void 0:e.submit)?Object.keys(h).find(t=>{var i,n;return(null==(i=h[t])?void 0:i.name)===(null==(n=e.submit)?void 0:n.fName)}):null,f=a.input.choice("Submit function",{value:null!=g?g:null,items:[null,...Object.keys(h)]});g||(f.value=null),f.nullable=!0,f.fireChanged(),f.setTooltip("Select function to be called upon submitting");let y=e2(),b=a.divText("Template name is empty or already exists",{classes:"hit-triage-error-div"}),w=a.divText("Template key is empty or already exists",{classes:"hit-triage-error-div"}),C=a.input.string("Name",{value:e?`${e.name} (copy)`:"",onValueChanged:e=>{""===e||u.includes(e)?(C.root.style.borderBottom="1px solid red",b.style.opacity="100%"):(C.root.style.borderBottom="none",b.style.opacity="0%")}}),T=a.input.string("Key",{value:e?`${e.key}-copy`:"",onValueChanged:e=>{""===e||d.includes(e)?(T.root.style.borderBottom="1px solid red",w.style.opacity="100%"):(T.root.style.borderBottom="none",w.style.opacity="0%")}});T.setTooltip("Template key used for campaign prefix"),C.setTooltip("Template name"),C.root.style.borderBottom="none",T.root.style.borderBottom="none",b.style.opacity="0%",w.style.opacity="0%";let x=null,S=e||{compute:{descriptors:{enabled:!0,args:[]},functions:[]}},O=yield eZ(i,e=>{x=e},()=>null,S,!1);O.root.classList.add("hit-triage-new-template-functions-input"),0===Object.entries(n).length&&Array.from(new Set(r.Func.find({meta:{role:c}}).concat(r.Func.find({tags:[c]})))).forEach(e=>{var t;n[null!=(t=e.friendlyName)?t:e.name]=e});let P=Object.keys(n),N=a.input.choice(v,{value:P[0],items:P}),F=a.input.choice("Ingest using",{value:null!=(l=null==e?void 0:e.dataSourceType)?l:"Query",items:["Query","File"],onValueChanged:e=>{N.root.style.display="Query"===e?"block":"none"}});(null==e?void 0:e.dataSourceType)&&(N.root.style.display="Query"===e.dataSourceType?"block":"none");let B=e3(null==e?void 0:e.campaignFields),I=a.div([a.h2("Details"),a.div([C,b]),a.div([T,w]),F.root,N.root,y.dataFileInput,B.fieldsDiv,a.h2("Compute"),O.root,a.h2("Submit"),f.root],"ui-form"),k=a.buttonsInput([]),V=null!=(o=null==(s=k.getElementsByClassName("ui-input-editor"))?void 0:s[0])?o:k;I.appendChild(k);let D=new Promise(e=>{let t=a.button(E,()=>e());V.appendChild(t)});return{root:I,template:new Promise(e=>{let i=a.bigButton(A,()=>e5(function*(){var i,n,a,r,l,o,s,u,c,p,d;if(O.okProxy(),"100%"===b.style.opacity)return void t.shell.error("Template name is empty or already exists");let m=f.value?h[f.value]:void 0,g=(c=function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{},n=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(i).filter(function(e){return Object.getOwnPropertyDescriptor(i,e).enumerable}))),n.forEach(function(t){var n;n=i[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({name:C.value,key:T.value,campaignFields:B.getFields(),dataSourceType:null!=(i=F.value)?i:"Query",layoutViewState:null!=(n=y.getLayoutViewState())?n:void 0,compute:{descriptors:{enabled:!!(null==x||null==(u=x.descriptors)?void 0:u.length),args:null!=(a=null==x?void 0:x.descriptors)?a:[]},functions:Object.entries(null!=(r=null==x?void 0:x.externals)?r:{}).map(([e,t])=>{let i=e.split(":");return{name:i[1],package:i[0],args:t}}),scripts:Object.entries(null!=(l=null==x?void 0:x.scripts)?l:{}).filter(([e,t])=>e.startsWith(eu)&&3===e.split(":").length).map(([e,t])=>{var i,n;let a=e.split(":");return{name:null!=(i=a[1])?i:"",id:null!=(n=a[2])?n:"",args:t}}),queries:Object.entries(null!=(o=null==x?void 0:x.queries)?o:{}).filter(([e,t])=>e.startsWith(ec)&&3===e.split(":").length).map(([e,t])=>{var i,n;let a=e.split(":");return{name:null!=(i=a[1])?i:"",id:null!=(n=a[2])?n:"",args:t}})}},m?{submit:{fName:m.name,package:eh(m)}}:{}),p=p={queryFunctionName:"Query"===F.value&&null!=(s=N.value)?s:void 0},Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(p)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t.push.apply(t,i)}return t})(Object(p)).forEach(function(e){Object.defineProperty(c,e,Object.getOwnPropertyDescriptor(p,e))}),c);d=g,nh.files.writeAsText(`Hit Triage/templates/${d.name}.json`,JSON.stringify(d)),t.shell.info("Template created successfully"),e(g)})());V.appendChild(i)}),cancelPromise:D}})()),o=new r.ViewBase,s=t.shell.v;o.name="New Template",o.root.appendChild(l.root),o.parentCall=this.app.parentCall,t.shell.addView(o),o.path=new URL(this.app.baseUrl).pathname+"/new-template",o.parentView=s;let{sub:u}=ew(t.shell.v,this.app.appName,b,()=>{t.shell.v=s,o.close()});l.template.then(e=>iS(function*(){yield this.init(e),o.close(),eA(o),t.shell.v=s,u.unsubscribe()}).call(this)),l.cancelPromise.then(()=>{u.unsubscribe(),o.close(),t.shell.v=s})}).call(this)}constructor(e){super(e),this.readmePath=nh.webRoot+"README_HT.md",this.dataSourceFunctionsMap={},this.currentGroupping="None",this._appHeader=null,this._contentRoot=a.div([],{classes:"hit-triage-info-view-container"}),this.campaignsTableRoot=null,this.name="Hit Triage",this.aiDescription=iC(e.appName),this._appHeader=this.getAppHeader(),this.root.appendChild(a.div([this._appHeader],{style:{marginLeft:"10px"}})),this.root.appendChild(this._contentRoot),t.shell.windows.showHelp=!0,t.shell.windows.help.showHelp(this.readmePath),this.checkCampaign().then(e=>{this.app.campaign=e,this.init()})}}function iP(e,t,i,n,a,r,l){try{var o=e[r](l),s=o.value}catch(e){i(e);return}o.done?t(s):Promise.resolve(s).then(n,a)}class iN extends e9{render(){return a.empty(this.root),a.divV([a.h1("Summary"),a.div([a.tableFromMap(this.app.getSummary())])])}onActivated(){this.render()}submit(){var e;return(e=function*(){let e=this.app.submitParams;if(!e)return!1;let i=r.Func.find({name:e.fName,package:e.package})[0];if(!i)return t.shell.error(`Function ${e.fName} not found.`),!1;let n=r.DataFrame.fromCsv(this.app.dataFrame.toCsv({filteredRowsOnly:!0}));return yield i.apply({df:n,molecules:this.app.molColName}),this.app.campaign&&(this.app.campaign.status="Submitted"),yield this.app.saveCampaign("Submitted"),t.shell.info("Submitted successfully."),!0},function(){var t=this,i=arguments;return new Promise(function(n,a){var r=e.apply(t,i);function l(e){iP(r,n,a,l,o,"next",e)}function o(e){iP(r,n,a,l,o,"throw",e)}l(void 0)})}).call(this)}constructor(e){super(e),this.name="Submit"}}function iF(e,t,i,n,a,r,l){try{var o=e[r](l),s=o.value}catch(e){i(e);return}o.done?t(s):Promise.resolve(s).then(n,a)}function iB(e){return function(){var t=this,i=arguments;return new Promise(function(n,a){var r=e.apply(t,i);function l(e){iF(r,n,a,l,o,"next",e)}function o(e){iF(r,n,a,l,o,"throw",e)}l(void 0)})}}function iI(e,t,i,n,a,r,l){try{var o=e[r](l),s=o.value}catch(e){i(e);return}o.done?t(s):Promise.resolve(s).then(n,a)}function ik(e){return function(){var t=this,i=arguments;return new Promise(function(n,a){var r=e.apply(t,i);function l(e){iI(r,n,a,l,o,"next",e)}function o(e){iI(r,n,a,l,o,"throw",e)}l(void 0)})}}function iV(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{},n=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(i).filter(function(e){return Object.getOwnPropertyDescriptor(i,e).enumerable}))),n.forEach(function(t){var n;n=i[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function iD(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t.push.apply(t,i)}return t})(Object(t)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(t,i))}),e}class ij extends tc{get infoView(){return this._infoView}get submitView(){return this._submitView}get submitParams(){var e,t,i,n;return null!=(e=null==(i=this.campaign)||null==(t=i.template)?void 0:t.submit)?e:null==(n=this.template)?void 0:n.submit}prepareDataFrame(e){return ik(function*(){})()}setTemplate(e,i,n,a,o){return ik(function*(){var s,u,c,p,d,m,h,g,f,y,v,b,w,A,C,E,T,x,S,O;if(this._friendlyName=null!=o?o:null==(v=this._campaign)?void 0:v.friendlyName,(null==(b=this._pickView)?void 0:b.dataFrame)&&t.shell.closeTable(null==(w=this._pickView)?void 0:w.dataFrame),this._pickView=void 0,n?a&&(this._fileInputType=a.type,"File"===a.type?this.dataFrame=yield t.dapi.files.readCsv(a.query):this.dataFrame=yield t.functions.call(a.query)):eb(l,n=yield this.getNewCampaignName(`${this.appName}/campaigns`,e.key)),!this.dataFrame)return void console.error("Dataframe is empty.");if((null==(A=this._campaign)?void 0:A.columnSemTypes)&&Object.entries(this._campaign.columnSemTypes).forEach(([e,t])=>{let i=this.dataFrame.columns.byName(e);i&&i.semType!==t&&(i.semType=t)}),(null==(C=this._campaign)?void 0:C.columnTypes)&&Object.entries(this._campaign.columnTypes).forEach(([e,t])=>{let i=this.dataFrame.columns.byName(e);if(i&&i.type!==t)try{i.convertTo(t)}catch(e){console.error(e)}}),yield this.dataFrame.meta.detectSemanticTypes(),yield this.prepareDataFrame(e),this._molColName=null!=(s=null==(E=this.dataFrame.columns.bySemType(r.SEMTYPE.MOLECULE))?void 0:E.name)?s:void 0,this._dfName=null!=(u=this.dataFrame.name)?u:null==a?void 0:a.query,this.dataFrame.name=null!=(c=null!=(p=this._dfName)?p:this.dataFrame.name)?c:"Molecules",this._campaignId=n,this.template=(null==(T=this.campaign)?void 0:T.template)?iD(iV({},this.campaign.template),{dataSourceType:e.dataSourceType,queryFunctionName:e.queryFunctionName}):e,this._campaignFilters=i,!i){let t={},i={},n={};e.compute.functions.forEach(e=>{t[`${e.package}:${e.name}`]=e.args}),null==(S=e.compute.scripts)||S.forEach(e=>{i[`${eu}:${e.name}:${e.id}`]=e.args}),null==(O=e.compute.queries)||O.forEach(e=>{n[`${ec}:${e.name}:${e.id}`]=e.args}),yield tP({descriptors:e.compute.descriptors.enabled?e.compute.descriptors.args:[],externals:t,scripts:i,queries:n},this.dataFrame,this._molColName)}this.campaign?yield this.setCanEdit(this.campaign):this.hasEditPermission=!0,this._filterViewName=`${this.appName} | ${null!=(d=null!=(m=this._friendlyName)?m:this._campaignId)?d:"Pick"}`;let P=t.shell.v,N=t.shell.addView(this.pickView);this.currentPickViewId=N.name,this._submitView=new iN(this),this.setBaseUrl(),eb(l,null!=(h=null!=(g=this._campaignId)?g:null==(x=this._campaign)?void 0:x.name)?h:"");let F=null!=(f=null!=(y=this._friendlyName)?y:this._campaignId)?f:"Pick";setTimeout(()=>{this._pickViewPromise&&this._pickViewPromise.then(()=>{let{sub:e}=ew(N,this.appName,F,()=>{t.shell.v=P,N.close(),e.unsubscribe()})})},300),t.shell.windows.showHelp=!1}).call(this)}get filterSettings(){return this._campaignFilters}get campaignId(){return this._campaignId}get pickView(){let e=this.getFilterView();return iT(e,this,"pick"),this._pickView=e}get molColName(){var e,t,i;return null!=(e=this._molColName)?e:this._molColName=null==(i=this.dataFrame)||null==(t=i.columns.bySemType(r.SEMTYPE.MOLECULE))?void 0:t.name}get fileInputType(){return this._fileInputType}get campaign(){return this._campaign}set campaign(e){this._campaign=e}getFilterView(){let e=null;this._pickViewPromise=new Promise(t=>{e=t});let t=()=>ik(function*(){eZ(this,e=>ik(function*(){var t,i,n,a,r,l,o;let s=this.template.compute.descriptors.args,u=this.template.compute.functions,c=null!=(t=this.template.compute.scripts)?t:[],p=null!=(i=this.template.compute.queries)?i:[],d=e.descriptors,m={descriptors:{enabled:!!(null==e||null==(o=e.descriptors)?void 0:o.length),args:null!=(n=null==e?void 0:e.descriptors)?n:[]},functions:Object.entries(null!=(a=null==e?void 0:e.externals)?a:{}).map(([e,t])=>{let i=e.split(":");return{name:i[1],package:i[0],args:t}}),scripts:Object.entries(null!=(r=null==e?void 0:e.scripts)?r:{}).filter(([e,t])=>e.startsWith(eu)&&3===e.split(":").length).map(([e,t])=>{var i,n;let a=e.split(":");return{name:null!=(i=a[1])?i:"",id:null!=(n=a[2])?n:"",args:t}}),queries:Object.entries(null!=(l=null==e?void 0:e.queries)?l:{}).filter(([e,t])=>e.startsWith(ec)&&3===e.split(":").length).map(([e,t])=>{var i,n;let a=e.split(":");return{name:null!=(i=a[1])?i:"",id:null!=(n=a[2])?n:"",args:t}})};this.template.compute=m;let h=d.filter(e=>!s.includes(e)),g=m.functions.filter(e=>{if(!u.some(t=>t.name===e.name&&t.package===e.package))return!0;let t=u.find(t=>t.name===e.name&&t.package===e.package);return!Object.entries(e.args).every(([e,i])=>t.args[e]===i)}),f=m.scripts.filter(e=>{if(!c.some(t=>t.id===e.id))return!0;let t=c.find(t=>t.id===e.id);return!Object.entries(e.args).every(([e,i])=>t.args[e]===i)}),y=m.queries.filter(e=>{if(!p.some(t=>t.id===e.id))return!0;let t=p.find(t=>t.id===e.id);return!Object.entries(e.args).every(([e,i])=>t.args[e]===i)}),v={};g.forEach(e=>{v[`${e.package}:${e.name}`]=e.args});let b={};f.forEach(e=>{b[`${eu}:${e.name}:${e.id}`]=e.args});let w={};y.forEach(e=>{w[`${ec}:${e.name}:${e.id}`]=e.args}),yield tP({descriptors:h,externals:v,scripts:b,queries:w},this.dataFrame,this._molColName),this.saveCampaign("In Progress",!1)}).call(this),()=>null,this.template,!0)}).call(this);this.dataFrame.col(d)||this.dataFrame.columns.addNewBool(d).init(!1);let i=r.TableView.create(this.dataFrame,!1),n=i.getRibbonPanels(),l=a.iconFA("wrench",t,"Calculate additional properties"),o=a.bigButton("Submit",()=>{var e;let t=null==(e=this._submitView)?void 0:e.render();if(t){let e=a.dialog("Submit");e.add(t),e.addButton("Save",()=>{this.saveCampaign(),e.close()}),e.addButton("Submit",()=>{var t;null==(t=this._submitView)||t.submit(),e.close()}),e.show()}}),s=a.iconFA("share",()=>ik(function*(){var e;yield new tr(null==(e=this.campaign)?void 0:e.permissions).show(e=>{this.campaign.permissions=e,this.saveCampaign(void 0,!0)})}).call(this),"Edit permissions");o.classList.add("hit-design-submit-button");let u=eC(n);return n.push([l,...this.hasEditPermission?[s]:[],...u?[]:[o]]),n.some(e=>{var t;let i=null!=(t=null==e?void 0:e.findIndex(e=>{var t;return(null==e||null==(t=e.textContent)?void 0:t.toLowerCase())==="save"}))?t:-1;return -1!==i&&(e.splice(i,1),!0)}),n=n.filter(e=>{var t;return(null!=(t=null==e?void 0:e.length)?t:0)>0}),i.setRibbonPanels(n),i.name=this._filterViewName,setTimeout(()=>ik(function*(){var t,n,a;i._onAdded(),yield new Promise(e=>setTimeout(e,1e3));let l=i.filters(this._campaignFilters?{filters:this._campaignFilters}:void 0),o=null!=(t=null==(n=this._campaign)?void 0:n.layout)?t:null==(a=this.template)?void 0:a.layoutViewState;if(o)try{let e=r.ViewLayout.fromViewState(o);i.loadLayout(e)}catch(e){console.error(e)}i.dataFrame.onFilterChanged.subscribe(e=>{this._filterDescriptions=Array.from(i.dataFrame.rows.filters),this._campaignFilters=l.getOptions().look.filters}),setTimeout(()=>{this._filterDescriptions=Array.from(i.dataFrame.rows.filters),this._campaignFilters=l.getOptions().look.filters},300),e&&e()}).call(this),300),i.parentCall=this.parentCall,i}getSummary(){var e,t,i,n,r,l,o;let s=null!=(e=null==(r=this.campaign)?void 0:r.campaignFields)?e:this.campaignProps;return iD(iV({Template:null!=(t=null==(l=this.template)?void 0:l.name)?t:"Molecules","File path":a.divH([a.link(null!=(i=this._dfName)?i:"-",()=>this.download(this.dataFrame,"molecules"),C)],{style:{alignItems:"center"}})},s),{"Number of molecules":this.dataFrame.rowCount.toString(),"Enrichment methods":[this.template.compute.descriptors.enabled?"descriptors":"",...this.template.compute.functions.map(e=>e.name)].filter(e=>e&&""!==e.trim()).join(", "),Filters:this._filterDescriptions.join(", "),"Result Molecules":a.divH([a.link(null!=(n=null==(o=this.dataFrame)?void 0:o.filter.trueCount.toString())?n:"0",()=>{this.download(this.dataFrame,"hits",!0)},C)],{style:{alignItems:"center"}})})}saveCampaign(e,i=!0){return ik(function*(){var n,l,o,u,c,p,d,m,h,g,f,y,v,b,w;let A=this.campaignId,C=this.filterSettings,E=this.template.name,T=this.dataFrame,x=`System:AppData/HitTriage/${this.appName}/campaigns/${A}/`,S=null!=A?A:yield iB(function*(){return new Promise(e=>iB(function*(){let t=a.input.string("Campaign name",{value:""});a.dialog("Save Campaign").add(a.div(t.root)).onOK(function(){t.value&&""!==t.value?e(t.value):e(A)}).show()})())})(),O={};T.columns.toList().forEach(e=>O[e.name]=e.semType);let P={};T.columns.toList().forEach(e=>P[e.name]=e.type);let N=null!=(n=null==(m=this.campaign)?void 0:m.authorUserId)?n:t.shell.user.id,F=null!=(l=null==(h=this.campaign)?void 0:h.permissions)?l:ta,B=N?null!=(o=null==(g=this.campaign)?void 0:g.authorUserFriendlyName)?o:null==(f=yield t.dapi.users.find(N))?void 0:f.friendlyName:void 0,I={name:S,friendlyName:null!=(u=this._friendlyName)?u:null==(y=this.campaign)?void 0:y.friendlyName,templateName:E,filters:null!=C?C:{},ingest:{type:"File",query:`${x}${s}`,molColName:this.molColName},status:null!=(c=null!=e?e:null==(v=this.campaign)?void 0:v.status)?c:"In Progress",createDate:null!=(p=null==(b=this.campaign)?void 0:b.createDate)?p:ev(new Date),campaignFields:null!=(d=null==(w=this.campaign)?void 0:w.campaignFields)?d:this.campaignProps,columnSemTypes:O,rowCount:T.rowCount,filteredRowCount:T.filter.trueCount,template:this.template,columnTypes:P,authorUserId:N,authorUserFriendlyName:B,lastModifiedUserName:t.shell.user.friendlyName,permissions:F};if(this.campaign=I,!this.hasEditPermission)return t.shell.error("You do not have permission to modify this campaign"),I;let k=r.DataFrame.fromColumns(T.columns.toList().filter(e=>!e.name.startsWith("~"))).toCsv();yield nh.files.writeAsText(`${this.appName}/campaigns/${A}/${s}`,k);let V=this._pickView.saveLayout();return V?I.layout=V.viewState:t.shell.warning("Layout cound not be saved"),yield nh.saveCampaignJson(this.appName,I),i&&t.shell.info("Campaign saved successfully."),I}).call(this)}constructor(e,i="Hit Triage",n=e=>new iO(e)){super(e,i),this._filterViewName="Hit Triage | Pick",this._filterDescriptions=[],this.campaignProps={},this._pickViewPromise=null,this._infoView=n(this),this.multiView=new r.MultiView({viewFactories:{[this._infoView.name]:()=>this._infoView}}),this.multiView.tabs.onTabChanged.subscribe(e=>{this.multiView.currentView instanceof e9&&this.multiView.currentView.onActivated()}),this.multiView.parentCall=e,iE(this.multiView,this),t.events.onCurrentViewChanged.subscribe(()=>{try{var e,i,n,a;(null==(e=t.shell.v)?void 0:e.name)===this.currentPickViewId&&(t.shell.windows.showHelp=!1,this.setBaseUrl(),eb(l,null!=(i=null!=(n=this._campaignId)?n:null==(a=this._campaign)?void 0:a.name)?i:""))}catch(e){console.error(e)}})}}class i_ extends r.GridCellRenderer{get name(){return"customGasteigerPNG"}get cellType(){return"customGasteigerPNG"}get defaultHeight(){return 200}get defaultWidth(){return 200}render(e,t,i,n,a,r,l){if(r.gridRow<0||!r.cell.value)return;let o=r.cell.value,s=new Image(n-2,a-2);s.src="data:image/png;base64,"+o,s.onload=function(){e.drawImage(s,t+2,i+2,n-2,a-2)}}}function iL(e,t,i,n,a,r,l){try{var o=e[r](l),s=o.value}catch(e){i(e);return}o.done?t(s):Promise.resolve(s).then(n,a)}function i$(e){return function(){var t=this,i=arguments;return new Promise(function(n,a){var r=e.apply(t,i);function l(e){iL(r,n,a,l,o,"next",e)}function o(e){iL(r,n,a,l,o,"throw",e)}l(void 0)})}}class iM extends tb{getNewCampaignAccordeon(e){return i$(function*(){let{root:t,promise:i,cancelPromise:n}=tm(e,!0);return i.then(t=>i$(function*(){this.app.dataFrame=t.df,yield this.app.setTemplate(e),this.app.campaignProps=t.campaignProps,yield this.app.saveCampaign(!1),e.layoutViewState&&this.app.campaign&&(this.app.campaign.layout=e.layoutViewState)}).call(this)),n.then(()=>{this.init()}),t}).call(this)}getAppHeader(){return D.appHeader({iconPath:nh.webRoot+"/images/icons/pepti-hit-icon.png",learnMoreUrl:"https://github.com/datagrok-ai/public/blob/master/packages/HitTriage/README_HD.md",description:"- Configure your own workflow using the template editor\n- Sketch Helm sequences in the spreadsheet\n- Annotate and share ideas with the team\n- Convert to molecular form and calculate different properties\n- Save campaigns and continue from where you left off\n- Submit final selection to the function of your choice"})}constructor(e){super(e),this.name="PeptiHit",t.shell.windows.showHelp=!0,t.shell.windows.help.showHelp(nh.webRoot+"README_HD.md")}}function iH(e,t,i,n,a,r,l){try{var o=e[r](l),s=o.value}catch(e){i(e);return}o.done?t(s):Promise.resolve(s).then(n,a)}function iR(e){return function(){var t=this,i=arguments;return new Promise(function(n,a){var r=e.apply(t,i);function l(e){iH(r,n,a,l,o,"next",e)}function o(e){iH(r,n,a,l,o,"throw",e)}l(void 0)})}}class iU extends ia{setTemplate(e,t){var i=this,n=()=>super.setTemplate;return iR(function*(){var a,l;yield n().call(i,e,t),this._helmColName=null!=(a=null==(l=this.dataFrame.columns.bySemType(r.SEMTYPE.MACROMOLECULE))?void 0:l.name)?a:g}).call(this)}get helmColName(){var e,t;return null!=(e=this._helmColName)?e:null==(t=this.dataFrame.columns.bySemType(r.SEMTYPE.MACROMOLECULE))?void 0:t.name}performSingleCellCalculations(e,i){var n=this,a=()=>super.performSingleCellCalculations;return iR(function*(){try{var l;if(!i)throw Error("No cell value provided");let o=r.Column.fromStrings(this.helmColName,[i]),s=r.DataFrame.fromColumns([o]);o.semType=r.SEMTYPE.MACROMOLECULE,o.setTag("units","helm"),o.setTag(".alphabetIsMultichar","true"),yield t.functions.call("Bio:toAtomicLevel",{table:s,seqCol:o,nonlinear:!0});let u=s.columns.names().find(e=>e.toLowerCase()!==this.helmColName.toLowerCase()),c=u?null==(l=s.col(u))?void 0:l.get(0):null;if(!c)throw Error("Failed to convert sequence to atomic level");this.dataFrame.set(this.molColName,e,c),yield a().call(n,e,c)}catch(e){console.error(e)}}).call(this)}getDesignView(){var e,i,n,a,l,o,s;let u=[],c=null==(n=this.dataFrame.col(this.helmColName))?void 0:n.toList().every(e=>!e&&""===e),p=this.dataFrame.col(this.helmColName);if(!p)throw Error("No helm column found");p.semType=r.SEMTYPE.MACROMOLECULE,p.setTag("units","helm"),p.setTag(".alphabetIsMultichar","true"),p.setTag("cell.renderer","helm");let d=t.shell.addTableView(this.dataFrame);this._designViewName=null!=(e=null==(a=this.campaign)?void 0:a.name)?e:this._designViewName,d.name=this._designViewName,d._onAdded();let h=null!=(i=null==(l=this._campaign)?void 0:l.layout)?i:null==(o=this.template)?void 0:o.layoutViewState;if(h)try{let e=r.ViewLayout.fromViewState(h);d.loadLayout(e)}catch(e){t.shell.error("Failed to apply layout. Falling back to default layout."),console.error(e)}let g=null==(s=d.grid)?void 0:s.col(f);g&&(g.editable=!1);let v=this.dataFrame.col(f);return v&&(v.semType=y,v.valueComparer=(e,t)=>e===t?0:null===e?-1:null===t?1:parseInt(e.substring(1))-parseInt(t.substring(1))),c&&t.functions.call("Helm:editMoleculeCell",{cell:d.grid.cell(this.helmColName,0)}),u.push(this.dataFrame.onRowsAdded.pipe((0,tD.filter)(()=>!this.isJoining)).subscribe(()=>{try{if(this.stages.length>0)for(let t=0;t<this.dataFrame.rowCount;t++){var e;let i=this.dataFrame.col(m).get(t);(!i||""===i||(null==(e=this.dataFrame.col(m))?void 0:e.isNone(t)))&&this.dataFrame.set(m,t,this.stages[0])}let i=null;for(let e=0;e<this.dataFrame.rowCount;e++){let t=d.grid.cell(this.helmColName,e);t&&(""===t.cell.value||null===t.cell.value)&&(i=t)}i&&t.functions.call("Helm:editMoleculeCell",{cell:i})}catch(e){console.error(e)}})),u.push(t.events.onContextMenu.subscribe(e=>{try{var i,n,a,l,o,s,u,c,p,m,h,g;let t=null==e||null==(i=e.args)?void 0:i.context;if(!t||(null==t?void 0:t.type)!==r.VIEWER.GRID||!t.tableView||t.tableView.id!==d.id||(null==e||null==(l=e.args)||null==(a=l.item)||null==(n=a.tableColumn)?void 0:n.name)!==this.helmColName||!(null==e||null==(s=e.args)||null==(o=s.item)?void 0:o.isTableCell))return;let f=null==e||null==(u=e.args)?void 0:u.menu;if(!f)return;f.item("Add new row",()=>{this.dataFrame.rows.addNew(null,!0)}),f.item("Duplicate Sequence",()=>{try{var t,i,n,a;let r=this.dataFrame.rows.addNew(null,!0),l=r.get(this.helmColName);null!=l&&r.idx>-1&&(this.dataFrame.cell(r.idx,this.helmColName).value=null!=(t=null==e||null==(a=e.args)||null==(n=a.item)||null==(i=n.cell)?void 0:i.value)?t:"")}catch(e){console.error(e)}});let y=null==e||null==(p=e.args)||null==(c=p.item)?void 0:c.tableRowIndex,v=null==e||null==(g=e.args)||null==(h=g.item)||null==(m=h.cell)?void 0:m.value;v&&(null!=y?y:-1)>-1&&f.item("Re-Run Calculations",()=>iR(function*(){try{yield this.performSingleCellCalculations(y,v)}catch(e){console.error(e)}}).call(this))}catch(e){t.log.error(e)}})),(null==d?void 0:d.grid)||(t.shell.error("Applied layout created view without grid. Resetting layout."),d.resetLayout()),(null==d?void 0:d.grid)&&u.push(d.grid.onCellValueEdited.subscribe(e=>iR(function*(){try{var i,n;if((null==(i=e.tableColumn)?void 0:i.name)===m)return void(yield this.saveCampaign(!1));if((null==(n=e.tableColumn)?void 0:n.name)!==this.helmColName)return;let t=e.cell.value,a=e.tableRowIndex;yield this.performSingleCellCalculations(a,t);try{let e=this.dataFrame.col(this.molColName).get(a),t=yield tY(null!=e?e:"",this.campaignId,this.appName);t&&this.dataFrame.col(f).set(a,t,!0)}catch(e){console.error("Error updating V-iD column:",e)}}catch(e){t.shell.error("Error performing cell calculations: "+e),console.error(e)}}).call(this))),(null==d?void 0:d.grid)&&u.push(d.grid.onCellRender.subscribe(e=>{try{var t;let i=this.duplicateVidCache,n=e.cell;if(!n||!n.isTableCell||!n.tableColumn||!i||n.tableColumn.name!==f||(null!=(t=n.tableRowIndex)?t:-1)<0)return;i.valueCounts[i.indexes[n.tableRowIndex]]>1&&(e.cell.style.backColor=r.Color.setAlpha(r.Color.getCategoricalColor(i.indexes[n.tableRowIndex]),150))}catch(e){}})),this.initDesignViewRibbons(d,u),d.parentCall=this.parentCall,d}constructor(e){super(e,"PeptiHit",e=>new iM(e)),this._helmColName=g}}function iq(e,t,i,n,a,r,l){try{var o=e[r](l),s=o.value}catch(e){i(e);return}o.done?t(s):Promise.resolve(s).then(n,a)}function iY(e){return function(){var t=this,i=arguments;return new Promise(function(n,a){var r=e.apply(t,i);function l(e){iq(r,n,a,l,o,"next",e)}function o(e){iq(r,n,a,l,o,"throw",e)}l(void 0)})}}function iG(e,t,i,n,a,r,l){try{var o=e[r](l),s=o.value}catch(e){i(e);return}o.done?t(s):Promise.resolve(s).then(n,a)}function iW(e){return function(){var t=this,i=arguments;return new Promise(function(n,a){var r=e.apply(t,i);function l(e){iG(r,n,a,l,o,"next",e)}function o(e){iG(r,n,a,l,o,"throw",e)}l(void 0)})}}class iJ extends iO{onActivated(){t.shell.windows.showHelp=!0,t.shell.windows.help.showHelp(nh.webRoot+"README_HT.md")}getAppHeader(){return D.appHeader({iconPath:nh.webRoot+"/images/icons/hit-triage-icon.png",learnMoreUrl:"https://github.com/datagrok-ai/public/blob/master/packages/HitTriage/README_HT.md",description:"- Configure your own workflow using the template editor\n- Load sequence datasets and auto-convert to molecules\n- Calculate different molecular properties\n- Filter sequences using different criteria\n- Save campaigns and continue any time from where you left off\n- Submit final selection to the function of your choice"})}getTemplatesFolder(){return`${this.app.appName}/templates`}getDataSourceTag(){return Y}getDataSourceFunctionsMap(){return this.pepTriageDataSourceFunctionsMap}getNewCampaignAccordeon(e,t){return iW(function*(){var i,n;let r=a.input.string("Sequence Column",{value:null!=(i=e.sequenceColumnName)?i:"",nullable:!1});r.setTooltip("Name of the sequence column in the dataset");let l=a.input.string("Molecule Column",{value:null!=(n=e.moleculeColumnName)?n:"",nullable:!0});l.setTooltip("Name of the molecule column (leave empty to auto-convert from sequences)"),a.setUpdateIndicator(t,!0);let{root:o,promise:s,cancelPromise:u}=yield eR(e,this.getDataSourceFunctionsMap(),this.getDataSourceTag(),{extraFormElements:[r.root,l.root],getExtraData:()=>{var t,i;return{sequenceColumnName:(null==(t=r.value)?void 0:t.trim())||e.sequenceColumnName,moleculeColumnName:(null==(i=l.value)?void 0:i.trim())||void 0}}});return a.setUpdateIndicator(t,!1),s.then(t=>iW(function*(){var i,n,a,r,l,o;let s=(l=function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{},n=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(i).filter(function(e){return Object.getOwnPropertyDescriptor(i,e).enumerable}))),n.forEach(function(t){var n;n=i[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},e),o=o={sequenceColumnName:null!=(i=null==(a=t.extraData)?void 0:a.sequenceColumnName)?i:e.sequenceColumnName,moleculeColumnName:null!=(n=null==(r=t.extraData)?void 0:r.moleculeColumnName)?n:e.moleculeColumnName},Object.getOwnPropertyDescriptors?Object.defineProperties(l,Object.getOwnPropertyDescriptors(o)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t.push.apply(t,i)}return t})(Object(o)).forEach(function(e){Object.defineProperty(l,e,Object.getOwnPropertyDescriptor(o,e))}),l);this.app.dataFrame=t.df,this.app._fileInputType=t.type,yield this.app.setTemplate(s,void 0,void 0,void 0,t.friendlyName),this.app.campaignProps=t.campaignProps,yield this.app.saveCampaign(void 0,!1),s.layoutViewState&&this.app.campaign&&(this.app.campaign.layout=s.layoutViewState)}).call(this)),u.then(()=>{this.init()}),o}).call(this)}createNewTemplate(e){return iW(function*(){var i,n;let l=yield(i=this.app,n=this.getDataSourceFunctionsMap(),iY(function*(){var l,o,s,u,c;let d=`${i.appName}/templates`,m=(yield nh.files.list(d)).filter(e=>e.name.endsWith(".json")).map(e=>e.name.slice(0,-5)),h=[];for(let e of m){let t=yield e_(`${d}/${e}.json`);h.push(t.key)}let g=Array.from(new Set(r.Func.find({meta:{role:p}}).concat(r.Func.find({tags:[p]})))),f={};g.forEach(e=>{var t;f[null!=(t=e.friendlyName)?t:e.name]=e});let y=(null==e?void 0:e.submit)?Object.keys(f).find(t=>{var i,n;return(null==(i=f[t])?void 0:i.name)===(null==(n=e.submit)?void 0:n.fName)}):null,b=a.input.choice("Submit function",{value:null!=y?y:null,items:[null,...Object.keys(f)]});y||(b.value=null),b.nullable=!0,b.fireChanged(),b.setTooltip("Select function to be called upon submitting");let w=e2(),C=a.divText("Template name is empty or already exists",{classes:"hit-triage-error-div"}),T=a.divText("Template key is empty or already exists",{classes:"hit-triage-error-div"}),x=a.input.string("Name",{value:e?`${e.name} (copy)`:"",onValueChanged:e=>{""===e||m.includes(e)?(x.root.style.borderBottom="1px solid red",C.style.opacity="100%"):(x.root.style.borderBottom="none",C.style.opacity="0%")}}),S=a.input.string("Key",{value:e?`${e.key}-copy`:"",onValueChanged:e=>{""===e||h.includes(e)?(S.root.style.borderBottom="1px solid red",T.style.opacity="100%"):(S.root.style.borderBottom="none",T.style.opacity="0%")}});S.setTooltip("Template key used for campaign prefix"),x.setTooltip("Template name"),x.root.style.borderBottom="none",S.root.style.borderBottom="none",C.style.opacity="0%",T.style.opacity="0%";let O=a.input.string("Sequence Column",{value:null!=(l=null==e?void 0:e.sequenceColumnName)?l:"",nullable:!1});O.setTooltip("Name of the sequence column in the dataset (mandatory)");let P=a.divText("Sequence column name is required",{classes:"hit-triage-error-div"});P.style.opacity="0%",O.onChanged.subscribe(()=>{var e;(null==(e=O.value)?void 0:e.trim())?(O.root.style.borderBottom="none",P.style.opacity="0%"):(O.root.style.borderBottom="1px solid red",P.style.opacity="100%")});let N=a.input.string("Molecule Column",{value:null!=(o=null==e?void 0:e.moleculeColumnName)?o:"",nullable:!0});N.setTooltip("Name of the molecule column (optional). If empty, sequences will be auto-converted to molecules.");let F=null,B=e||{compute:{descriptors:{enabled:!0,args:[]},functions:[]}},I=yield eZ(i,e=>{F=e},()=>null,B,!1);I.root.classList.add("hit-triage-new-template-functions-input"),0===Object.entries(n).length&&Array.from(new Set(r.Func.find({meta:{role:Y}}).concat(r.Func.find({tags:[Y]})))).forEach(e=>{var t;n[null!=(t=e.friendlyName)?t:e.name]=e});let k=Object.keys(n),V=a.input.choice(v,{value:k[0],items:k}),D=a.input.choice("Ingest using",{value:null!=(s=null==e?void 0:e.dataSourceType)?s:"Query",items:["Query","File"],onValueChanged:e=>{V.root.style.display="Query"===e?"block":"none"}});(null==e?void 0:e.dataSourceType)&&(V.root.style.display="Query"===e.dataSourceType?"block":"none");let j=e3(null==e?void 0:e.campaignFields),_=a.div([a.h2("Details"),a.div([x,C]),a.div([S,T]),a.h2("Sequence Configuration"),a.div([O,P]),N.root,a.h2("Data Ingestion"),D.root,V.root,w.dataFileInput,j.fieldsDiv,a.h2("Compute"),I.root,a.h2("Submit"),b.root],"ui-form"),L=a.buttonsInput([]),M=null!=(u=null==(c=L.getElementsByClassName("ui-input-editor"))?void 0:c[0])?u:L;_.appendChild(L);let H=new Promise(e=>{let t=a.button(E,()=>e());M.appendChild(t)});return{root:_,template:new Promise(e=>{let i=a.bigButton(A,()=>iY(function*(){var i,n,a,r,l,o,s,u,c,p,m,h;if(I.okProxy(),"100%"===C.style.opacity)return void t.shell.error("Template name is empty or already exists");if("100%"===T.style.opacity)return void t.shell.error("Template key is empty or already exists");if(!(null==(u=O.value)?void 0:u.trim()))return void t.shell.error("Sequence column name is required");let g=b.value?f[b.value]:void 0,y=(m=function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{},n=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(i).filter(function(e){return Object.getOwnPropertyDescriptor(i,e).enumerable}))),n.forEach(function(t){var n;n=i[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({name:x.value,key:S.value,sequenceColumnName:O.value.trim(),moleculeColumnName:(null==(c=N.value)?void 0:c.trim())||void 0,campaignFields:j.getFields(),dataSourceType:null!=(i=D.value)?i:"Query",layoutViewState:null!=(n=w.getLayoutViewState())?n:void 0,compute:{descriptors:{enabled:!!(null==F||null==(p=F.descriptors)?void 0:p.length),args:null!=(a=null==F?void 0:F.descriptors)?a:[]},functions:Object.entries(null!=(r=null==F?void 0:F.externals)?r:{}).map(([e,t])=>{let i=e.split(":");return{name:i[1],package:i[0],args:t}}),scripts:Object.entries(null!=(l=null==F?void 0:F.scripts)?l:{}).filter(([e,t])=>e.startsWith(eu)&&3===e.split(":").length).map(([e,t])=>{var i,n;let a=e.split(":");return{name:null!=(i=a[1])?i:"",id:null!=(n=a[2])?n:"",args:t}}),queries:Object.entries(null!=(o=null==F?void 0:F.queries)?o:{}).filter(([e,t])=>e.startsWith(ec)&&3===e.split(":").length).map(([e,t])=>{var i,n;let a=e.split(":");return{name:null!=(i=a[1])?i:"",id:null!=(n=a[2])?n:"",args:t}})}},g?{submit:{fName:g.name,package:eh(g)}}:{}),h=h={queryFunctionName:"Query"===D.value&&null!=(s=V.value)?s:void 0},Object.getOwnPropertyDescriptors?Object.defineProperties(m,Object.getOwnPropertyDescriptors(h)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t.push.apply(t,i)}return t})(Object(h)).forEach(function(e){Object.defineProperty(m,e,Object.getOwnPropertyDescriptor(h,e))}),m);nh.files.writeAsText(`${d}/${y.name}.json`,JSON.stringify(y)),t.shell.info("Template created successfully"),e(y)})());M.appendChild(i)}),cancelPromise:H}})()),o=new r.ViewBase,s=t.shell.v;o.name="New Template",o.root.appendChild(l.root),o.parentCall=this.app.parentCall,t.shell.addView(o),o.path=new URL(this.app.baseUrl).pathname+"/new-template",o.parentView=s;let{sub:u}=ew(t.shell.v,this.app.appName,b,()=>{t.shell.v=s,o.close()});l.template.then(e=>iW(function*(){yield this.init(e),o.close(),eA(o),t.shell.v=s,u.unsubscribe()}).call(this)),l.cancelPromise.then(()=>{u.unsubscribe(),o.close(),t.shell.v=s})}).call(this)}constructor(e){super(e),this.pepTriageDataSourceFunctionsMap={},this.name="PepTriage",t.shell.windows.showHelp=!0,t.shell.windows.help.showHelp(nh.webRoot+"README_HT.md")}}function iz(e,t,i,n,a,r,l){try{var o=e[r](l),s=o.value}catch(e){i(e);return}o.done?t(s):Promise.resolve(s).then(n,a)}function iQ(e,t,i,n,a,r,l){try{var o=e[r](l),s=o.value}catch(e){i(e);return}o.done?t(s):Promise.resolve(s).then(n,a)}class iK extends ij{get seqColName(){return this._seqColName}prepareDataFrame(e){var i;return(i=function*(){if(!this.dataFrame)return;yield this.dataFrame.meta.detectSemanticTypes();let i=e.sequenceColumnName,n=i?this.dataFrame.col(i):null;if(n||(n=this.dataFrame.columns.bySemType(r.SEMTYPE.MACROMOLECULE)),!n)throw Error(`Sequence column '${null!=i?i:"Macromolecule"}' not found in the dataset. Make sure the data contains a column with sequences.`);this._seqColName=n.name;let a=r.TaskBarProgressIndicator.create("Initializing sequences...");try{var l,o;let i=yield(l=function*(){let e=r.Func.find({package:"Bio",name:"getSeqHelper"});if(0===e.length)throw Error("Package 'Bio' must be installed for SeqHelper.");return(yield e[0].prepare().call()).getOutputParamValue()},function(){var e=this,t=arguments;return new Promise(function(i,n){var a=l.apply(e,t);function r(e){iz(a,i,n,r,o,"next",e)}function o(e){iz(a,i,n,r,o,"throw",e)}r(void 0)})})(),s=i.getSeqHandler(n);yield s.refinerPromise,i.getSeqHandler(n);let u=e.moleculeColumnName,c=u?this.dataFrame.col(u):null;if((c||(c=this.dataFrame.columns.bySemType(r.SEMTYPE.MOLECULE)),!c)&&(a.update(50,"Converting sequences to molecules..."),yield t.functions.call("Bio:toAtomicLevel",{table:this.dataFrame,seqCol:n,nonlinear:!0}),yield this.dataFrame.meta.detectSemanticTypes(),!(c=null!=(o=this.dataFrame.columns.bySemTypeAll(r.SEMTYPE.MOLECULE).find(e=>e.name.toLowerCase().includes(n.name.toLowerCase())))?o:null)))return void t.shell.warning("Failed to convert sequences to molecules. Calculations may not work.");this.reorderColumns(n.name,c.name)}catch(e){nh.logger.error(e),t.shell.error("Error preparing sequence data: "+(e instanceof Error?e.message:e))}finally{a.close()}},function(){var e=this,t=arguments;return new Promise(function(n,a){var r=i.apply(e,t);function l(e){iQ(r,n,a,l,o,"next",e)}function o(e){iQ(r,n,a,l,o,"throw",e)}l(void 0)})}).call(this)}reorderColumns(e,t){if(!this.dataFrame)return;let i=this.dataFrame.col(e),n=this.dataFrame.col(t);i&&(this.dataFrame.columns.remove(e),this.dataFrame.columns.insert(i,0)),n&&(this.dataFrame.columns.remove(t),this.dataFrame.columns.insert(n,1))}constructor(e){super(e,"PepTriage",e=>new iJ(e))}}function iZ(e,t,i,n,a,r,l){try{var o=e[r](l),s=o.value}catch(e){i(e);return}o.done?t(s):Promise.resolve(s).then(n,a)}function iX(e){return function(){var t=this,i=arguments;return new Promise(function(n,a){var r=e.apply(t,i);function l(e){iZ(r,n,a,l,o,"next",e)}function o(e){iZ(r,n,a,l,o,"throw",e)}l(void 0)})}}function i0(){return iX(function*(){yield nf.initHT()})()}function i1(e){return iX(function*(){yield nf.hitTriageAppTreeBrowser(e)})()}function i2(e){return iX(function*(){yield nf.hitDesignAppTreeBrowser(e)})()}function i4(e){return iX(function*(){yield nf.peptiHitAppTreeBrowser(e)})()}function i5(){return iX(function*(){return yield nf.hitTriageApp()})()}function i3(){return iX(function*(){return yield nf.hitDesignApp()})()}function i8(){return iX(function*(){return yield nf.peptiHitApp()})()}function i6(e){return iX(function*(){yield nf.pepTriageAppTreeBrowser(e)})()}function i9(){return iX(function*(){return yield nf.pepTriageApp()})()}function i7(){return iX(function*(){return yield nf.demoFileIngest()})()}function ne(){return iX(function*(){return yield nf.demoFileIngest1()})()}function nt(e){return iX(function*(){return yield nf.demoFileIngest2(e)})()}function ni(e){return iX(function*(){return yield nf.demoPeptideSequences(e)})()}function nn(e,t){return iX(function*(){yield nf.demoFileSubmit(e,t)})()}function na(){return iX(function*(){yield nf.registerMoleculesToViD()})()}function nr(e){return nf.hitDesignVidPanel(e)}function nl(){return nf.gasteigerCellRenderer()}function no(e){return iX(function*(){return yield nf.htPackageSettingEditor(e)})()}function ns(e,t,i,n,a,r,l){try{var o=e[r](l),s=o.value}catch(e){i(e);return}o.done?t(s):Promise.resolve(s).then(n,a)}function nu(e){return function(){var t=this,i=arguments;return new Promise(function(n,a){var r=e.apply(t,i);function l(e){ns(r,n,a,l,o,"next",e)}function o(e){ns(r,n,a,l,o,"throw",e)}l(void 0)})}}function nc(e,t,i,n){var a,r=arguments.length,l=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(a=e[o])&&(l=(r<3?a(l):r>3?a(t,i,l):a(t,i))||l);return r>3&&l&&Object.defineProperty(t,i,l),l}function np(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function nd(e,t){return function(i,n){t(i,n,e)}}class nm extends r.Package{convertToSmiles(e){return e?this.molToSmilesLruCache.getOrCreate(e,e=>t.chem.convert(e,t.chem.Notation.Unknown,t.chem.Notation.Smiles)):""}loadCampaigns(e,i){return nu(function*(){var n;return this.campaignsCache[e]||(this.campaignsCache[e]=yield(n=null!=i?i:[],ey(function*(){let i=(yield nh.files.list(`${e}/campaigns`)).filter(e=>-1===n.indexOf(e.name)),a={},r=i.map(i=>ey(function*(){try{let n=JSON.parse((yield nh.files.readAsText(`${e}/campaigns/${i.name}/${u}`)));if(n.authorUserId&&n.permissions&&!(yield ex(n.authorUserId,n.permissions)))return null;if(n.authorUserId&&!n.authorUserFriendlyName){let e=yield t.dapi.users.find(n.authorUserId);e&&(n.authorUserFriendlyName=e.friendlyName)}a[n.name]=n}catch(e){console.error(e)}return null})());return yield Promise.all(r),a})())),this.campaignsCache[e]}).call(this)}saveCampaignJson(e,t){return nu(function*(){let i=`${e}/campaigns/${t.name}/${u}`;yield this.files.writeAsText(i,JSON.stringify(t)),this.campaignsCache[e][t.name]=t}).call(this)}constructor(...e){super(...e),this.molToSmilesLruCache=new r.LruCache(2e3),this.campaignsCache={}}}let nh=new nm;function ng(e,i){return nu(function*(){let n=a.div([],{style:{width:"50px",height:"24px",position:"relative"}});n.innerHTML='<div class="grok-loader"><div></div><div></div><div></div><div></div></div>';let l=e.item(n),o=yield nh.loadCampaigns(i,[]),s=null,u=!0;for(let[i,n]of Object.entries(o)){var c,p,d;let i=null!=(c=n.templateName)?c:null==(d=n.template)?void 0:d.name,a=i?e.getOrCreateGroup(i,null,u):e;u=!1;let l=a.item(null!=(p=n.friendlyName)?p:n.name);l.root.addEventListener("dblclick",e=>{e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault()}),r.debounce(l.onSelected,200).subscribe(e=>nu(function*(){try{var e;let o="ingest"in n?n.ingest.query:n.savePath;if(!o||!(yield t.dapi.files.exists(o)))return void t.shell.error("File not found: "+o);let u=yield t.dapi.files.readCsv(o);if(!u)return;u.name=null!=(e=n.friendlyName)?e:n.name;let c=n.columnSemTypes;if(c)for(let[e,t]of Object.entries(c)){let i=u.columns.byName(e);i&&(i.semType=t,t===r.SEMTYPE.MACROMOLECULE&&e===g&&(i.setTag("units","helm"),i.setTag(".alphabetIsMultichar","true"),i.setTag("cell.renderer","helm")))}let p=document.activeElement,d=!1;function i(){setTimeout(()=>{!d&&p&&document.activeElement!==p&&p&&"focus"in p&&p.focus()})}window.addEventListener("focusout",i);try{s&&s.close()}catch(e){}try{s=t.shell.addTableView(u);let e=n.layout;e&&s.loadLayout(r.ViewLayout.fromViewState(e))}catch(e){console.error(e)}function a(){window.removeEventListener("focusout",i)}function l(){a(),d=!0}window.addEventListener("click",l,{once:!0}),setTimeout(()=>{a(),window.removeEventListener("click",l)},5e3)}catch(e){console.error(e)}})())}l.remove()})()}class nf{static initHT(){return nu(function*(){try{yield t.functions.call("Chem:init",{})}catch(e){console.error("error initializing chem package",e)}})()}static hitTriageAppTreeBrowser(e){return nu(function*(){yield ng(e,"Hit Triage")})()}static hitDesignAppTreeBrowser(e){return nu(function*(){yield ng(e,"Hit Design")})()}static peptiHitAppTreeBrowser(e){return nu(function*(){yield ng(e,"PeptiHit")})()}static hitTriageApp(){return nu(function*(){return new ij(t.functions.getCurrentCall()).multiView})()}static hitDesignApp(){return nu(function*(){return new ia(t.functions.getCurrentCall()).multiView})()}static peptiHitApp(){return nu(function*(){let e=t.functions.getCurrentCall();return yield t.functions.call("Bio:initBio",{}),new iU(e).multiView})()}static pepTriageAppTreeBrowser(e){return nu(function*(){yield ng(e,"PepTriage")})()}static pepTriageApp(){return nu(function*(){let e=t.functions.getCurrentCall();return yield t.functions.call("Bio:initBio",{}),new iK(e).multiView})()}static demoFileIngest(){return nu(function*(){let e=t.data.demo.molecules(100);return e.name="100 Molecules",e})()}static demoFileIngest1(){return nu(function*(){let e=t.data.demo.molecules(5e3);return e.name="5000 Molecules",e})()}static demoFileIngest2(e){return nu(function*(){let i=t.data.demo.molecules(e);return i.name="Variable Molecules number",i})()}static demoPeptideSequences(e){return nu(function*(){let t=["PEPTIDE1{A.G.L.V.K}$$$$V2.0","PEPTIDE1{G.A.V.L.I.P}$$$$V2.0","PEPTIDE1{F.W.Y.H.K.R}$$$$V2.0","PEPTIDE1{D.E.N.Q.S.T}$$$$V2.0","PEPTIDE1{A.R.N.D.C.E}$$$$V2.0","PEPTIDE1{G.H.I.L.K.M}$$$$V2.0","PEPTIDE1{F.P.S.T.W.Y}$$$$V2.0","PEPTIDE1{V.A.G.L.I}$$$$V2.0","PEPTIDE1{K.R.H.D.E}$$$$V2.0","PEPTIDE1{N.Q.S.T.C.M}$$$$V2.0","PEPTIDE1{A.V.L.I.P.F}$$$$V2.0","PEPTIDE1{W.Y.G.A.R}$$$$V2.0","PEPTIDE1{K.H.D.E.N.Q}$$$$V2.0","PEPTIDE1{S.T.C.M.F.W}$$$$V2.0","PEPTIDE1{Y.A.G.V.L.I}$$$$V2.0","PEPTIDE1{P.K.R.H.D}$$$$V2.0","PEPTIDE1{E.N.Q.S.T.C}$$$$V2.0","PEPTIDE1{M.F.W.Y.A.G}$$$$V2.0","PEPTIDE1{V.L.I.P.K.R}$$$$V2.0","PEPTIDE1{H.D.E.N.Q.S}$$$$V2.0"],i=[];for(let n=0;n<e;n++)i.push(t[n%t.length]);let n=r.Column.fromStrings("Helm",i);n.semType=r.SEMTYPE.MACROMOLECULE,n.setTag("units","helm"),n.setTag(".alphabetIsMultichar","true");let a=r.DataFrame.fromColumns([n]);return a.name="Demo Peptide Sequences",a})()}static demoFileSubmit(e,i){return nu(function*(){t.shell.info(e.rowCount),t.shell.info(i)})()}static registerMoleculesToViD(){return nu(function*(){tR(function*(){let e="Hit Design",i=yield nh.loadCampaigns(e),n=Object.keys(i),l=a.input.choice("Select Campaign",{value:null,nullable:!0,items:n,tooltipText:"Select campaign to register its molecules. Leave empty to register all campaigns"}),o=yield new Promise(e=>tR(function*(){a.dialog("Register Existing Campaign Molecules").add(a.divText("This operation will go through all molecules in the selected campaign(s) and register them into V-iD storage.\n This operation is irreversible.")).add(a.divText("You can select a specific campaign or leave it empty to process all campaigns.")).add(a.divText("After this opteration, all VIDs throughout all campaigns will become unique, and old V-iDs will no longer be valid.")).add(a.divText("WARNING: Depending on the number of molecules, this operation can take a long time.")).add(l).onOK(()=>{l.value?e([i[l.value]]):e(n.map(e=>i[e]))}).onCancel(()=>e(null)).show()})()),u=r.TaskBarProgressIndicator.create("Registering molecules...");if(!o||0===o.length)return void u.close();let c=o.length;for(let i of o){u.update(0/c*100,`Processing campaign: ${i.name}`);try{var p;let n=`System.AppData/HitTriage/${e}/campaigns`,a=null!=(p=null==i?void 0:i.savePath)?p:`${n}/${i.name}/${s}`,r=yield t.dapi.files.readCsv(a);if(!r){t.shell.warning(`Failed to load campaign table for campaign ${i.name} at path ${a}`),console.warn(`Failed to load campaign table for campaign ${i.name} at path ${a}`);continue}let l=r.col(h);if(!l){t.shell.warning(`Molecule column not found in campaign ${i.name} table`),console.warn(`Molecule column not found in campaign ${i.name} table`);continue}let o=r.col(f);if(!o){t.shell.warning(`V-iD column not found in campaign ${i.name} table`),console.warn(`V-iD column not found in campaign ${i.name} table`);continue}let u=l.toList(),c=yield tG(u,i.name,e);for(let e=0;e<r.rowCount;e++){let t=u[e];if(!t||""===t){o.set(e,"",!1);continue}let i=c.get(t);i&&o.set(e,i,!1)}o.fireValuesChanged(),yield t.dapi.files.writeAsText(a,r.toCsv()),t.shell.info(`Finished processing campaign ${i.name}`),console.log(`Finished processing campaign ${i.name}`)}catch(e){t.shell.error(`Error processing campaign ${i.name}. See console for details.`),console.error(`Error processing campaign ${i.name} molecules registration:`,e)}}u.close()})()})()}static hitDesignVidPanel(e){return r.Widget.fromRoot(a.card(a.wait(()=>nu(function*(){if(!(null==e?void 0:e.value))return a.divText("No V-iD provided");let i=yield j.getCampaignsByVid(e.value,null);if(!i||0===i.rowCount)return a.divText(`No campaigns found for V-iD: ${e.value}`);let n=yield j.getMoleculeByVid(e.value);if(!n||0===n.rowCount)return a.divText(`No molecule found for V-iD: ${e.value}`);let r=function(e){var t;let i=null==(t=nh.meta)?void 0:t.sok;if(!i)throw Error("Secret key for SMILES deobfuscation is not set");let n=atob(e),a="";for(let e=0;e<n.length;e++)a+=String.fromCharCode(n.charCodeAt(e)^i.charCodeAt(e%i.length));return a}(n.col("mh_string").get(0)),l=t.chem.drawMolecule(r,300,300),o=new Map;for(let e=0;e<i.rowCount;e++){let t=i.col("app_name").get(e),n=i.col("campaign_id").get(e),a=i.col("created_by").get(e);o.has(t)||o.set(t,[]),o.get(t).push({campaignId:n,createdBy:a})}let s=a.divV([l],{style:{gap:"10px",justifyContent:"center"}});for(let[e,t]of o.entries()){let i=a.table(t.map(e=>[e.campaignId,e.createdBy]),e=>[e[0],e[1]],["Campaigns","Created By"]),n=a.divV([a.h3(`${e} Campaigns`),i],{style:{gap:"4px"}});s.appendChild(n)}return s})())))}static gasteigerCellRenderer(){return new i_}static htPackageSettingEditor(e){return nu(function*(){return t_(function*(){let i=e.filter(e=>"DefaultUserGroupsSharing"===e.category),n=[];for(let e of i){let i=`${e.name[0].toUpperCase()}${e.name.slice(1)}`,l=e.get(null),o=yield tM(l),s=a.input.userGroups(i);yield r.delay(200),s.value=o,s.onInput.subscribe(()=>{try{var i;let t=(null==(i=s.value)?void 0:i.length)?JSON.stringify(s.value.map(e=>e.id)):"";e.set(null,t)}catch(e){t.shell.error("Error Setting group. Check console for more details"),console.error(e)}}),s.setTooltip(`Selected groups will be granted ${i.toLowerCase()} permissions by default on newly created campaigns`),n.push(s)}let l=r.Widget.fromRoot(a.form(n,{style:{overflow:"visible"}}));l.root.prepend(a.h1("Default Campaign Sharing",{style:{marginBottom:"6px",marginTop:"6px"}}));let o=e.find(e=>e.name===tL);if(o){var s;let e='Default storage for newly created campaigns. For each app, folders will be created under their name. For example, for Hit Design, the campaign files will be saved under <b>"Your folder/Hit Design/campaigns/enriched_table.csv"</b>',i=e,n=null!=(s=o.get(null))?s:t$,u=a.h1("Default Campaign Storage",{style:{marginBottom:"6px",marginTop:"6px"}}),c=a.input.string("Folder Path",{value:n});a.tooltip.bind(c.input,()=>i),r.debounce(c.onChanged,200).subscribe(n=>t_(function*(){let n=c.value;try{if(!n){o.set(null,t$),i=e+'<br><br> <b style="color: red">Cannot be empty.</b>',c.input.classList.add("d4-invalid");return}if(!(yield t.dapi.files.exists(n))){o.set(null,t$),i=e+'<br><br> <b style="color: red">Folder does not exist.</b>',c.input.classList.add("d4-invalid");return}o.set(null,n),i=e,c.input.classList.remove("d4-invalid")}catch(e){t.shell.error("Error Setting default storage. Check console for more details"),console.error(e)}})()),l.root.appendChild(u),l.root.appendChild(c.root)}return setTimeout(()=>{var e;return(null==(e=l.root.parentElement)?void 0:e.style)&&(l.root.parentElement.style.overflow="visible")},200),l})()})()}}nc([t.decorators.init(),np("design:type",Function),np("design:paramtypes",[]),np("design:returntype",Promise)],nf,"initHT",null),nc([t.decorators.treeBrowser({meta:{app:"Hit Triage"}}),np("design:type",Function),np("design:paramtypes",[void 0===r||void 0===r.TreeViewGroup?Object:r.TreeViewGroup]),np("design:returntype",Promise)],nf,"hitTriageAppTreeBrowser",null),nc([t.decorators.treeBrowser({meta:{app:"Hit Design"}}),np("design:type",Function),np("design:paramtypes",[void 0===r||void 0===r.TreeViewGroup?Object:r.TreeViewGroup]),np("design:returntype",Promise)],nf,"hitDesignAppTreeBrowser",null),nc([t.decorators.treeBrowser({meta:{app:"PeptiHit"}}),np("design:type",Function),np("design:paramtypes",[void 0===r||void 0===r.TreeViewGroup?Object:r.TreeViewGroup]),np("design:returntype",Promise)],nf,"peptiHitAppTreeBrowser",null),nc([t.decorators.app({browsePath:"Chem",name:"Hit Triage",tags:["app"]}),np("design:type",Function),np("design:paramtypes",[]),np("design:returntype",Promise)],nf,"hitTriageApp",null),nc([t.decorators.app({icon:"images/icons/hit-design-icon.png",browsePath:"Chem",name:"Hit Design",tags:["app"]}),np("design:type",Function),np("design:paramtypes",[]),np("design:returntype",Promise)],nf,"hitDesignApp",null),nc([t.decorators.app({icon:"images/icons/pepti-hit-icon.png",browsePath:"Peptides",name:"PeptiHit",tags:["app"]}),np("design:type",Function),np("design:paramtypes",[]),np("design:returntype",Promise)],nf,"peptiHitApp",null),nc([t.decorators.treeBrowser({meta:{app:"PepTriage"}}),np("design:type",Function),np("design:paramtypes",[void 0===r||void 0===r.TreeViewGroup?Object:r.TreeViewGroup]),np("design:returntype",Promise)],nf,"pepTriageAppTreeBrowser",null),nc([t.decorators.app({icon:"images/icons/hit-triage-icon.png",browsePath:"Peptides",name:"PepTriage",tags:["app"]}),np("design:type",Function),np("design:paramtypes",[]),np("design:returntype",Promise)],nf,"pepTriageApp",null),nc([t.decorators.func({name:"Demo Molecules 100",meta:{role:"hitTriageDataSource"}}),np("design:type",Function),np("design:paramtypes",[]),np("design:returntype",Promise)],nf,"demoFileIngest",null),nc([t.decorators.func({name:"Demo Molecules 5000",meta:{role:"hitTriageDataSource"}}),np("design:type",Function),np("design:paramtypes",[]),np("design:returntype",Promise)],nf,"demoFileIngest1",null),nc([t.decorators.func({name:"Demo Molecules variable",meta:{role:"hitTriageDataSource"}}),nd(0,t.decorators.param({type:"int",options:{description:"Molecules counts"}})),np("design:type",Function),np("design:paramtypes",[Number]),np("design:returntype",Promise)],nf,"demoFileIngest2",null),nc([t.decorators.func({name:"Demo Peptide Sequences",meta:{role:"pepTriageDataSource"}}),np("design:type",Function),np("design:paramtypes",[Number]),np("design:returntype",Promise)],nf,"demoPeptideSequences",null),nc([t.decorators.func({name:"Demo File Submit",meta:{role:"hitTriageSubmitFunction"}}),nd(0,t.decorators.param({options:{description:"Dataframe"}})),nd(1,t.decorators.param({options:{description:"Molecules column name"}})),np("design:type",Function),np("design:paramtypes",[void 0===r||void 0===r.DataFrame?Object:r.DataFrame,String]),np("design:returntype",Promise)],nf,"demoFileSubmit",null),nc([t.decorators.func({}),np("design:type",Function),np("design:paramtypes",[]),np("design:returntype",Promise)],nf,"registerMoleculesToViD",null),nc([t.decorators.panel({name:"Hit Design V-iD"}),nd(0,t.decorators.param({type:"semantic_value",options:{semType:"HIT_DESIGN_VID"}})),np("design:type",Function),np("design:paramtypes",[void 0===r||void 0===r.SemanticValue?Object:r.SemanticValue]),np("design:returntype",void 0===r||void 0===r.Widget?Object:r.Widget)],nf,"hitDesignVidPanel",null),nc([t.decorators.func({meta:{cellType:"customGasteigerPNG",columnTags:"quality=customGasteigerPNG",role:"cellRenderer"},name:"gasteigerRenderer",outputs:[{type:"grid_cell_renderer",name:"result"}]}),np("design:type",Function),np("design:paramtypes",[]),np("design:returntype",i_)],nf,"gasteigerCellRenderer",null),nc([t.decorators.func({name:"Hit Triage package settings editor",meta:{role:"packageSettingsEditor"},tags:["packageSettingsEditor"]}),nd(0,t.decorators.param({name:"propList",type:"object"})),np("design:type",Function),np("design:paramtypes",[Array]),np("design:returntype",Promise)],nf,"htPackageSettingEditor",null)})(),hittriage=n})();
377
+ /* the progress tracker (tiles-view.ts): lanes scroll sideways; the Tile Viewer has no setting for a value's ellipsis */
378
+ .hit-design-tracker-lanes {
379
+ height: 100%;
380
+ overflow: auto hidden;
381
+ }
382
+ .hit-design-tracker-lanes .d4-tile-viewer-form input.ui-input-editor {text-overflow: ellipsis;}
383
+ `,"",{version:3,sources:["webpack://./css/hit-triage.css"],names:[],mappings:"AAAA;IACI,UAAU;IACV,iBAAiB;AACrB;;AAEA;IACI,qCAAqC;AACzC;;AAEA;IACI,aAAa;AACjB;;AAEA;IACI,iBAAiB;IACjB,2BAA2B;IAC3B,kBAAkB;AACtB;;AAEA;IACI,sBAAsB;AAC1B;;AAEA;CACC,gBAAgB;IACb,mBAAmB;IACnB,uBAAuB;CAC1B,iBAAiB;IACd,UAAU;AACd;;AAEA;CACC,cAAc;CACd,eAAe;CACf,iBAAiB;AAClB;;AAEA;CACC,mBAAmB;IAChB,gBAAgB;IAChB,uBAAuB;AAC3B;;AAEA;IACI,iBAAiB;AACrB;;AAEA;IACI,yBAAyB;IACzB,8BAA8B;AAClC;;AAEA;IACI,YAAY;IACZ,2BAA2B;AAC/B;;AAEA;IACI,gCAAgC;IAChC,gBAAgB;AACpB;;AAEA,uHAAuH;AACvH;IACI,YAAY;IACZ,qBAAqB;AACzB;AACA,sEAAsE,uBAAuB,CAAC",sourcesContent:[".hit-triage-error-div {\n color: red;\n text-align: start;\n}\n\n.hit-triage-input-error {\n border-bottom: 1px solid var(--red-3);\n}\n\n.hit-triage-new-template-functions-input > .ui-box {\n height: 300px;\n}\n\n.hit-triage-new-template-functions-input {\n max-height: 200px;\n max-width: unset !important;\n overflow-y: scroll;\n}\n\n.hit-triage-new-template-functions-input > .d4-tab-host {\n width: 100% !important;\n}\n\n.d4-ribbon-name .ui-breadcrumbs {\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n flex-wrap: nowrap;\n padding: 0;\n}\n\n.d4-ribbon-name .ui-breadcrumbs i {\n padding: 0 6px;\n font-size: 10px;\n font-weight: bold;\n}\n\n.d4-ribbon-name .ui-breadcrumbs-element:first-child {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.hit-triage-home-header {\n margin-left: 10px;\n}\n\n.hit-triage-home {\n --u2-page-padding-x: 10px;\n --u2-page-section-indent: 14px;\n}\n\n.hit-triage-template-editor {\n height: 100%;\n --u2-form-section-gap: 16px;\n}\n\n.hit-triage-compute-box {\n --u2-master-detail-height: 322px;\n max-width: 762px;\n}\n\n/* the progress tracker (tiles-view.ts): lanes scroll sideways; the Tile Viewer has no setting for a value's ellipsis */\n.hit-design-tracker-lanes {\n height: 100%;\n overflow: auto hidden;\n}\n.hit-design-tracker-lanes .d4-tile-viewer-form input.ui-input-editor {text-overflow: ellipsis;}\n"],sourceRoot:""}]);let l=a},10(e,t,n){n.d(t,{A:()=>l});var r=n(7126),i=n.n(r),o=n(5454),a=n.n(o)()(i());a.push([e.id,`img[alt='hitDesignReadmeImg'] {
384
+ max-width: 100%;
385
+ }
386
+ `,"",{version:3,sources:["webpack://./src/app/hit-design-views/utils.css"],names:[],mappings:"AAAA;IACI,eAAe;AACnB",sourcesContent:["img[alt='hitDesignReadmeImg'] {\n max-width: 100%;\n}\n"],sourceRoot:""}]);let l=a},5454(e){e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n}).join("")},t.i=function(e,n,r,i,o){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(r)for(var l=0;l<this.length;l++){var s=this[l][0];null!=s&&(a[s]=!0)}for(var u=0;u<e.length;u++){var d=[].concat(e[u]);r&&a[d[0]]||(void 0!==o&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=o),n&&(d[2]&&(d[1]="@media ".concat(d[2]," {").concat(d[1],"}")),d[2]=n),i&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=i):d[4]="".concat(i)),t.push(d))}},t}},7126(e){e.exports=function(e){var t=e[1],n=e[3];if(!n)return t;if("function"==typeof btoa){var r=btoa(unescape(encodeURIComponent(JSON.stringify(n))));return[t].concat(["/*# ".concat("sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(r)," */")]).join("\n")}return[t].join("\n")}},8707(e,t,n){var r=n(3621),i=n.n(r),o=n(2611),a=n.n(o),l=n(6129),s=n.n(l),u=n(8986),d=n.n(u),c=n(838),p=n.n(c),h=n(3515),m=n.n(h),f=n(946),g={};g.styleTagTransform=m(),g.setAttributes=d(),g.insert=s().bind(null,"head"),g.domAPI=a(),g.insertStyleElement=p(),i()(f.A,g),f.A&&f.A.locals&&f.A.locals},3621(e){var t=[];function n(e){for(var n=-1,r=0;r<t.length;r++)if(t[r].identifier===e){n=r;break}return n}function r(e,r){for(var i={},o=[],a=0;a<e.length;a++){var l=e[a],s=r.base?l[0]+r.base:l[0],u=i[s]||0,d="".concat(s," ").concat(u);i[s]=u+1;var c=n(d),p={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(-1!==c)t[c].references++,t[c].updater(p);else{var h=function(e,t){var n=t.domAPI(t);return n.update(e),function(t){t?(t.css!==e.css||t.media!==e.media||t.sourceMap!==e.sourceMap||t.supports!==e.supports||t.layer!==e.layer)&&n.update(e=t):n.remove()}}(p,r);r.byIndex=a,t.splice(a,0,{identifier:d,updater:h,references:1})}o.push(d)}return o}e.exports=function(e,i){var o=r(e=e||[],i=i||{});return function(e){e=e||[];for(var a=0;a<o.length;a++){var l=n(o[a]);t[l].references--}for(var s=r(e,i),u=0;u<o.length;u++){var d=n(o[u]);0===t[d].references&&(t[d].updater(),t.splice(d,1))}o=s}}},6129(e){var t={};e.exports=function(e,n){var r=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!r)throw Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},838(e){e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},8986(e,t,n){e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},2611(e){e.exports=function(e){if("u"<typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){var r,i,o;r="",n.supports&&(r+="@supports (".concat(n.supports,") {")),n.media&&(r+="@media ".concat(n.media," {")),(i=void 0!==n.layer)&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,i&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}"),(o=n.sourceMap)&&"u">typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),e.styleTagTransform(r,t,e.options)},remove:function(){var e;null===(e=t).parentNode||e.parentNode.removeChild(e)}}}},3515(e){e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},249(e,t,n){n.d(t,{FN:()=>c,H_:()=>s,NI:()=>d,T4:()=>u});var r=n(6082),i=n(7389),o=n(4328);function a(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}function l(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function l(e){a(o,r,i,l,s,"next",e)}function s(e){a(o,r,i,l,s,"throw",e)}l(void 0)})}}function s(){return r.InputBase.forProperty(r.Property.fromOptions({name:"layout",caption:"Layout",type:"file"}))}function u(e){return l(function*(){var t;let n;try{n=r.ViewLayout.fromJson((yield e.readAsString()))}catch(e){return null}if(!n)return null;let i=!!(null==(t=e.fullPath)?void 0:t.includes(":"))&&(yield o.dapi.files.exists(e.fullPath).catch(()=>!1));return{viewState:n.viewState,localPath:i?e.fullPath:null}})()}function d(e,t){var n;return r.FileInfo.fromString(null!=(n=e.localPath)?n:`${t}.layout`,r.ViewLayout.fromViewState(e.viewState).toJson())}function c(e){var t;let n=s(),r=(null==e?void 0:e.layoutViewState)?{viewState:e.layoutViewState,localPath:null!=(t=e.localLayoutPath)?t:null}:null,o=null,a=0;return n.onChanged.subscribe(e=>l(function*(){let e=++a,t=n.value,i=t?yield u(t):null;e===a&&(r=i,o=t&&!i?"Invalid layout file":null,n.input.classList.toggle("d4-invalid",null!==o))})()),i.tooltip.bind(n.root,()=>o||"Select a layout file"),null!==r&&(n.value=d(r,e.name)),{dataFileInput:n,getLayoutViewState:()=>{var e;return null!=(e=null==r?void 0:r.viewState)?e:null}}}},4394(e,t,n){n.d(t,{b:()=>m});var r=n(4328),i=n(6082),o=n(7389),a=n(9832),l=n(2671),s=n(2232),u=n(5234);function d(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}function c(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){d(o,r,i,a,l,"next",e)}function l(e){d(o,r,i,a,l,"throw",e)}a(void 0)})}}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}n(8707);let h="Value can't be empty";function m(e,t,n,d){return c(function*(){var m,f,g;let v,b=(0,a.vPA)(0),y=()=>b.value++,_=o.divText("",{style:{color:"red"}}),w=null,x=()=>c(function*(){try{if(!(w=k.value))return;if(yield w.meta.detectSemanticTypes(),!u.C.moleculeColumn(w)){_.innerText="No molecules column found";return}_.innerText=""}catch(e){_.innerText="Error parsing file"}finally{y()}})(),k=o.input.table("Dataframe",{onValueChanged:x});yield x();let O=o.div([k,_]);0===Object.keys(t).length&&Array.from(new Set(i.Func.find({meta:{role:n}}).concat(i.Func.find({tags:[n]})))).forEach(e=>{var n;t[null!=(n=e.friendlyName)?n:e.name]=e});let A=null,S=()=>c(function*(){for(let e of(A=t[E.value].prepare(),null==v||v.dispose(),v=d.owner.child("data-source-call"),A.inputParams.values()))v.subscribe(e.onChanged,y);let e=yield A.getEditor();e.classList.remove("ui-form"),P.innerHTML="",P.appendChild(e),y()})(),P=o.div([]),E=o.input.choice(s.Ru.dataSourceFunction,{value:null!=(m=e.queryFunctionName)?m:Object.keys(t)[0],items:Object.keys(t),onValueChanged:S});yield S(),e.queryFunctionName&&(null==(g=E.root.getElementsByTagName("select").item(0))||g.setAttribute("disabled","true"));let C=o.div([E,P]);C.style.display="none";let j=o.div([O,C]),T=o.input.string("Campaign Name",{value:"",nullable:!0});T.setTooltip("Optional friendly name for the campaign");let N=e.campaignFields.map(e=>{var t,n;return e.type===i.SEMTYPE.MOLECULE?(t=p({},e),n=n={type:"String",semtype:i.SEMTYPE.MOLECULE},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t):e}).map(e=>i.Property.fromOptions(p({name:e.name,type:l.u[e.type],nullable:!e.required},e.semtype?{semType:e.semtype}:{}))),I={},D=N.length?o.input.form(I,N,{onValueChanged:y}):o.div();D.classList.remove("ui-form"),"File"===e.dataSourceType?(O.style.display="inherit",C.style.display="none"):(O.style.display="none",C.style.display="inherit");let L=e=>null==e||""===e,z=(0,a.EWP)(()=>{if(b.value,"File"===e.dataSourceType&&!w)return"Pick a file";if("File"!==e.dataSourceType){var t;let e=[...null!=(t=null==A?void 0:A.inputParams.values())?t:[]].find(e=>!e.property.nullable&&L(e.value));if(e)return`${e.property.caption||e.name}: ${h}`}let n=e.campaignFields.find(e=>e.required&&L(I[e.name]));return n?`${n.name}: ${h}`:null}),F=(0,a.vPA)(!1),B=d.owner.build(()=>(0,a.x6e)(s.Ru.StartCampaign,()=>c(function*(){F.value=!0;try{let n=yield c(function*(){var n,r;let i=(null==(n=T.value)?void 0:n.trim())||void 0,o=null==(r=d.getExtraData)?void 0:r.call(d);if("File"===e.dataSourceType)return{df:w,type:"File",campaignProps:I,friendlyName:i,extraData:o};let a={};for(let[e,t]of Object.entries(A.inputs))a[e]=t;return{df:yield t[E.value].apply(a),type:"Query",campaignProps:I,friendlyName:i,extraData:o}})();if(0===n.df.rowCount)return void r.shell.warning(`${"File"===e.dataSourceType?"The file has":`${E.value} returned`} no rows, so no campaign was created`);yield d.start(n)}finally{F.value=!1}})(),{primary:!0,disabled:(0,a.EWP)(()=>F.value?"Starting…":z.value)})),M=o.div([T.root,...null!=(f=d.extraFormElements)?f:[],j,...N.length?[D]:[]]),R=o.buttonsInput([]);R.appendChild(B),M.appendChild(R);let q=o.div([M],"ui-form"),H=d.column;if(H&&"u">typeof ResizeObserver){let e=new ResizeObserver(()=>H.report(q,Math.max(0,...Array.from(q.querySelectorAll("label.ui-input-label")).filter(e=>e.textContent).map(e=>e.offsetWidth))));e.observe(q),d.owner.own(()=>{e.disconnect(),H.leave(q)})}return q})()}},4111(e,t,n){n.d(t,{R:()=>o});var r=n(6082),i=n(2232);function o(e,t=!1){var n;let a=r.DataFrame.create(1);if(t){let e=a.columns.addNew(i.Zf,r.TYPE.STRING);e.semType=r.SEMTYPE.MACROMOLECULE,e.meta.units="helm",e.setTag("units","helm"),e.setTag("cell.renderer","helm"),e.setTag(".alphabetIsMultichar","true")}let l=a.columns.addNew(i.Lz,r.TYPE.STRING);return l.semType=r.SEMTYPE.MOLECULE,l.meta.units=r.UNITS.Molecule.MOLBLOCK,l.set(0,null),(null==e||null==(n=e.stages)?void 0:n.length)>0&&a.columns.addNew(i.yJ,r.TYPE.STRING).set(0,e.stages[0]),a.columns.addNew(i.Hz,r.TYPE.STRING),a}},5101(e,t,n){n.d(t,{W:()=>g});var r=n(6082),i=n(7389),o=n(4328),a=n(9446),l=n(2232),s=n(4281);n(8707);var u=n(8434),d=n(249),c=n(1259),p=n(5372),h=n(5210);function m(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}function f(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){m(o,r,i,a,l,"next",e)}function l(e){m(o,r,i,a,l,"throw",e)}a(void 0)})}}function g(e,t,n){return f(function*(){var m,g,v,b,y;let _=`${e.appName}/templates`,w=(yield a._package.files.list(_)).filter(e=>e.name.endsWith(".json")).map(e=>e.name.slice(0,-5)),x=[];for(let e of w){let t=yield(0,c.PM)(`${_}/${e}.json`);x.push(t.key)}let k=Array.from(new Set(r.Func.find({meta:{role:l.yv}}).concat(r.Func.find({tags:[l.yv]})))),O={};k.forEach(e=>{var t;O[null!=(t=e.friendlyName)?t:e.name]=e});let A=(null==n?void 0:n.submit)?Object.keys(O).find(e=>{var t,r;return(null==(t=O[e])?void 0:t.name)===(null==(r=n.submit)?void 0:r.fName)}):null,S=i.input.choice("Submit function",{value:null!=A?A:null,items:[null,...Object.keys(O)]});A||(S.value=null),S.nullable=!0,S.fireChanged(),S.setTooltip("Select function to be called upon submitting");let P=(0,d.FN)(n),E=i.divText("Template name is empty or already exists",{classes:"hit-triage-error-div"}),C=i.divText("Template key is empty or already exists",{classes:"hit-triage-error-div"}),j=()=>{var e;return!(null==(e=F.value)?void 0:e.trim())||w.includes(F.value)?"Template name is empty or already exists":null},T=()=>{var e;return!(null==(e=B.value)?void 0:e.trim())||x.includes(B.value)?"Template key is empty or already exists":null},N=()=>{var e;return(null==(e=M.value)?void 0:e.trim())?null:"Sequence column name is required"},I=null,D=null,L=!1;function z(){var e,t;D=null!=(e=null!=(t=j())?t:T())?e:N(),I&&null!==D!==L&&(L=null!==D,i.setDisabled(I,L,()=>D))}let F=i.input.string("Name",{value:n?(0,h.IL)(n.name,new Set(w.map(e=>e.toLowerCase()))):"",onValueChanged:()=>{(0,p.yc)(F,E,null!==j()),z()}}),B=i.input.string("Key",{value:n?(0,h.EK)(n.key,new Set(x.map(e=>e.toLowerCase()))):"",onValueChanged:()=>{(0,p.yc)(B,C,null!==T()),z()}});B.setTooltip("Template key used for campaign prefix"),F.setTooltip("Template name"),E.style.opacity="0%",C.style.opacity="0%";let M=i.input.string("Sequence Column",{value:null!=(m=null==n?void 0:n.sequenceColumnName)?m:"",nullable:!1});M.setTooltip("Name of the sequence column in the dataset (mandatory)");let R=i.divText("Sequence column name is required",{classes:"hit-triage-error-div"});R.style.opacity="0%",M.onChanged.subscribe(()=>{(0,p.yc)(M,R,null!==N()),z()});let q=i.input.string("Molecule Column",{value:null!=(g=null==n?void 0:n.moleculeColumnName)?g:"",nullable:!0});q.setTooltip("Name of the molecule column (optional). If empty, sequences will be auto-converted to molecules.");let H=null,W=n||{compute:{descriptors:{enabled:!0,args:[]},functions:[]}},V=yield(0,u.Fw)(e,e=>{H=e},()=>null,W,!1);V.root.classList.add("hit-triage-new-template-functions-input"),0===Object.entries(t).length&&Array.from(new Set(r.Func.find({meta:{role:l.b1}}).concat(r.Func.find({tags:[l.b1]})))).forEach(e=>{var n;t[null!=(n=e.friendlyName)?n:e.name]=e});let G=Object.keys(t),U=i.input.choice(l.Ru.dataSourceFunction,{value:G[0],items:G}),K=i.input.choice("Ingest using",{value:null!=(v=null==n?void 0:n.dataSourceType)?v:"Query",items:["Query","File"],onValueChanged:e=>{U.root.style.display="Query"===e?"block":"none"}});(null==n?void 0:n.dataSourceType)&&(U.root.style.display="Query"===n.dataSourceType?"block":"none");let Y=(0,p.v0)(null==n?void 0:n.campaignFields),Q=i.div([i.h2("Details"),i.div([F,E]),i.div([B,C]),i.h2("Sequence Configuration"),i.div([M,R]),q.root,i.h2("Data Ingestion"),K.root,U.root,P.dataFileInput,Y.fieldsDiv,i.h2("Compute"),V.root,i.h2("Submit"),S.root],"ui-form"),J=i.buttonsInput([]),Z=null!=(b=null==(y=J.getElementsByClassName("ui-input-editor"))?void 0:y[0])?b:J;Q.appendChild(J);let X=new Promise(e=>{let t=i.button(l.Ru.cancel,()=>e());Z.appendChild(t)});return{root:Q,template:new Promise(e=>{I=i.bigButton(l.Ru.createTemplate,()=>f(function*(){var t,n,r,i,l,u,d,p,h,m,f,g,v;V.okProxy();let b=null!=(t=null!=(n=j())?n:T())?t:N();if(b)return void o.shell.error(b);let y=S.value?O[S.value]:void 0,w=(g=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({name:F.value,key:B.value,sequenceColumnName:M.value.trim(),moleculeColumnName:(null==(m=q.value)?void 0:m.trim())||void 0,campaignFields:Y.getFields(),dataSourceType:null!=(r=K.value)?r:"Query",layoutViewState:null!=(i=P.getLayoutViewState())?i:void 0,compute:{descriptors:{enabled:!!(null==H||null==(f=H.descriptors)?void 0:f.length),args:null!=(l=null==H?void 0:H.descriptors)?l:[]},functions:Object.entries(null!=(u=null==H?void 0:H.externals)?u:{}).map(([e,t])=>{let n=e.split(":");return{name:n[1],package:n[0],args:t}}),scripts:Object.entries(null!=(d=null==H?void 0:H.scripts)?d:{}).filter(([e,t])=>e.startsWith(s.Wn)&&3===e.split(":").length).map(([e,t])=>{var n,r;let i=e.split(":");return{name:null!=(n=i[1])?n:"",id:null!=(r=i[2])?r:"",args:t}}),queries:Object.entries(null!=(p=null==H?void 0:H.queries)?p:{}).filter(([e,t])=>e.startsWith(s.ru)&&3===e.split(":").length).map(([e,t])=>{var n,r;let i=e.split(":");return{name:null!=(n=i[1])?n:"",id:null!=(r=i[2])?r:"",args:t}})}},y?{submit:{fName:y.name,package:(0,c.Vu)(y)}}:{}),v=v={queryFunctionName:"Query"===K.value&&null!=(h=U.value)?h:void 0},Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(v)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(v)).forEach(function(e){Object.defineProperty(g,e,Object.getOwnPropertyDescriptor(v,e))}),g);try{yield a._package.files.writeAsText(`${_}/${w.name}.json`,JSON.stringify(w))}catch(e){o.shell.error(`Could not save template ${w.name}: ${e instanceof Error?e.message:e}`);return}o.shell.info("Template created successfully"),e(w)})()),Z.appendChild(I),z()}),cancelPromise:X}})()}},5372(e,t,n){n.d(t,{v0:()=>_,Nz:()=>b,yc:()=>y});var r=n(6082),i=n(7389),o=n(4328),a=n(9446),l=n(2671),s=n(2232),u=n(4281);n(8707);var d=n(8434),c=n(1858);class p{get root(){return this._root}get items(){return this._items}set items(e){this._items=e,this.render()}addItem(e,t){this._items.push(e),this.render(),(void 0===t||t)&&this.onItemAdded.next(e)}removeItem(e,t){-1!==this._items.indexOf(e)&&(this._items.splice(this._items.indexOf(e),1),this.render(),(void 0===t||t)&&this.onItemRemoved.next(e))}removeAtIndex(e,t){if(e<0||e>=this._items.length)return;let n=this._items.splice(e,1);this.render(),(void 0===t||t)&&this.onItemRemoved.next(n[0])}removeAllItems(){this._items=[],this.render()}render(){if(i.empty(this._root),!this.options.horizontalInputNames){var e=!0,t=!1,n=void 0;try{for(var r,o,a,l=this.properties[Symbol.iterator]();!(e=(a=l.next()).done);e=!0){let e=a.value,t=null!=(r=e.caption)?r:e.name;(null==(o=this.options.customLabels)?void 0:o[e.name])&&(t=this.options.customLabels[e.name]);let n=i.divText(t);n.style.fontWeight="bold",this._root.appendChild(n)}}catch(e){t=!0,n=e}finally{try{e||null==l.return||l.return()}finally{if(t)throw n}}}var s=!0,u=!1,d=void 0;try{for(var c,p=this._items[Symbol.iterator]();!(s=(c=p.next()).done);s=!0){let e=c.value,t=this.getItemDiv(e);var h=!0,m=!1,f=void 0;try{for(var g,v=t[Symbol.iterator]();!(h=(g=v.next()).done);h=!0){let e=g.value;this._root.appendChild(e)}}catch(e){m=!0,f=e}finally{try{h||null==v.return||v.return()}finally{if(m)throw f}}}}catch(e){u=!0,d=e}finally{try{s||null==p.return||p.return()}finally{if(u)throw d}}if(this.options.allowAdd){let e=this.getItemDiv(null!=(w=null==(x=(k=this.options).newItemFunction)?void 0:x.call(k))?w:void 0,!0);var b=!0,y=!1,_=void 0;try{for(var w,x,k,O,A=e[Symbol.iterator]();!(b=(O=A.next()).done);b=!0){let e=O.value;this._root.appendChild(e)}}catch(e){y=!0,_=e}finally{try{b||null==A.return||A.return()}finally{if(y)throw _}}}}get addingItem(){let e={};return Object.keys(this.addingItemInputs).forEach(t=>{e[t]=this.addingItemInputs[t].value}),e}getItemDiv(e,t){let n=void 0===e?{}:e,o=[],a={},l=null;var s=!0,u=!1,d=void 0;try{for(var c,p,h,m=this.properties[Symbol.iterator]();!(s=(h=m.next()).done);s=!0){let e=h.value;void 0===n[e.name]&&(n[e.name]=null);let s=(null==(c=this.options.customInputs)?void 0:c[e.name])?this.options.customInputs[e.name](n):i.input.forProperty(e,n),u=null==(p=this.options.validators)?void 0:p[e.name];u&&s.addValidator(u),o.push(this.options.horizontalInputNames?s.root:this.hideLabel(s.root)),e.propertyType!==r.TYPE.BOOL&&"color"!==e.name.toLowerCase()&&s.input&&(s.input.style.width="100%"),a[e.name]=s,s.onChanged.subscribe(()=>{n[e.name]=s.value,t?this.onAddingItemChanged.next({item:n,fieldName:e.name}):this.onItemChanged.next({item:n,fieldName:e.name})}),s.root.style.alignItems="center",l=s}}catch(e){u=!0,d=e}finally{try{s||null==m.return||m.return()}finally{if(u)throw d}}let f=null;if(t)this.addingItemInputs=a,f=i.icons.add(()=>{let e=this.options.newItemFunction?this.options.newItemFunction():{};Object.keys(a).forEach(t=>{e[t]=a[t].value}),this._items.push(e),this.onItemAdded.next(e),this.render()},this.options.addButtonTooltip);else{if(!this.options.allowRemove)return o;f=i.icons.delete(()=>{this._items.splice(this._items.indexOf(n),1),this.onItemRemoved.next(n),this.render()},this.options.removeButtonTooltip)}return l&&l.addOptions?l.addOptions(f):null==l||l.root.appendChild(f),f.style.color="#2083d5",o}hideLabel(e){return e.getElementsByTagName("label")[0]&&e.removeChild(e.getElementsByTagName("label")[0]),e}hasErrors(){return this._root.querySelectorAll(".d4-invalid").length>0}constructor(e,t,n){this.onItemChanged=new c.Subject,this.onAddingItemChanged=new c.Subject,this.onItemAdded=new c.Subject,this.onItemRemoved=new c.Subject,this.options={removeButtonTooltip:"Remove item",addButtonTooltip:"Add item",allowAdd:!0,allowRemove:!0},this.addingItemInputs={},this.properties=e,this.options=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},this.options,void 0===n?{}:n),this._root=i.divV([],{style:{display:"grid",gridTemplateColumns:`repeat(${this.properties.length}, 1fr)`,alignItems:"center",gap:"12px"},classes:"ui-items-grid"}),this._items=void 0===t?[]:t,this.render()}}var h=n(249),m=n(1259),f=n(5210);function g(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}function v(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){g(o,r,i,a,l,"next",e)}function l(e){g(o,r,i,a,l,"throw",e)}a(void 0)})}}function b(e,t,n){return v(function*(){var l,c,p;let g=(yield a._package.files.list("Hit Triage/templates")).map(e=>e.name.slice(0,-5)),b=[];for(let e of g){let t=yield(0,m.PM)(`Hit Triage/templates/${e}.json`);b.push(t.key)}let w=Array.from(new Set(r.Func.find({meta:{role:s.yv}}).concat(r.Func.find({tags:[s.yv]})))),x={};w.forEach(e=>{var t;x[null!=(t=e.friendlyName)?t:e.name]=e});let k=(null==n?void 0:n.submit)?Object.keys(x).find(e=>{var t,r;return(null==(t=x[e])?void 0:t.name)===(null==(r=n.submit)?void 0:r.fName)}):null,O=i.input.choice("Submit function",{value:null!=k?k:null,items:[null,...Object.keys(x)]});k||(O.value=null),O.nullable=!0,O.fireChanged(),O.setTooltip("Select function to be called upon submitting");let A=(0,h.FN)(n),S=i.divText("Template name is empty or already exists",{classes:"hit-triage-error-div"}),P=i.divText("Template key is empty or already exists",{classes:"hit-triage-error-div"}),E=()=>{var e;return!(null==(e=D.value)?void 0:e.trim())||g.includes(D.value)?"Template name is empty or already exists":null},C=()=>{var e;return!(null==(e=L.value)?void 0:e.trim())||b.includes(L.value)?"Template key is empty or already exists":null},j=null,T=null,N=!1;function I(){var e;T=null!=(e=E())?e:C(),j&&null!==T!==N&&(N=null!==T,i.setDisabled(j,N,()=>T))}let D=i.input.string("Name",{value:n?(0,f.IL)(n.name,new Set(g.map(e=>e.toLowerCase()))):"",onValueChanged:()=>{y(D,S,null!==E()),I()}}),L=i.input.string("Key",{value:n?(0,f.EK)(n.key,new Set(b.map(e=>e.toLowerCase()))):"",onValueChanged:()=>{y(L,P,null!==C()),I()}});L.setTooltip("Template key used for campaign prefix"),D.setTooltip("Template name"),S.style.opacity="0%",P.style.opacity="0%";let z=null,F=n||{compute:{descriptors:{enabled:!0,args:[]},functions:[]}},B=yield(0,d.Fw)(e,e=>{z=e},()=>null,F,!1);B.root.classList.add("hit-triage-new-template-functions-input"),0===Object.entries(t).length&&Array.from(new Set(r.Func.find({meta:{role:s.dY}}).concat(r.Func.find({tags:[s.dY]})))).forEach(e=>{var n;t[null!=(n=e.friendlyName)?n:e.name]=e});let M=Object.keys(t),R=i.input.choice(s.Ru.dataSourceFunction,{value:M[0],items:M}),q=i.input.choice("Ingest using",{value:null!=(l=null==n?void 0:n.dataSourceType)?l:"Query",items:["Query","File"],onValueChanged:e=>{R.root.style.display="Query"===e?"block":"none"}});(null==n?void 0:n.dataSourceType)&&(R.root.style.display="Query"===n.dataSourceType?"block":"none");let H=_(null==n?void 0:n.campaignFields),W=i.div([i.h2("Details"),i.div([D,S]),i.div([L,P]),q.root,R.root,A.dataFileInput,H.fieldsDiv,i.h2("Compute"),B.root,i.h2("Submit"),O.root],"ui-form"),V=i.buttonsInput([]),G=null!=(c=null==(p=V.getElementsByClassName("ui-input-editor"))?void 0:p[0])?c:V;W.appendChild(V);let U=new Promise(e=>{let t=i.button(s.Ru.cancel,()=>e());G.appendChild(t)});return{root:W,template:new Promise(e=>{j=i.bigButton(s.Ru.createTemplate,()=>v(function*(){var t,n,r,i,l,s,d,c,p,h,f,g;B.okProxy();let v=null!=(t=E())?t:C();if(v)return void o.shell.error(v);let b=O.value?x[O.value]:void 0,y=(h=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({name:D.value,key:L.value,campaignFields:H.getFields(),dataSourceType:null!=(n=q.value)?n:"Query",layoutViewState:null!=(r=A.getLayoutViewState())?r:void 0,compute:{descriptors:{enabled:!!(null==z||null==(p=z.descriptors)?void 0:p.length),args:null!=(i=null==z?void 0:z.descriptors)?i:[]},functions:Object.entries(null!=(l=null==z?void 0:z.externals)?l:{}).map(([e,t])=>{let n=e.split(":");return{name:n[1],package:n[0],args:t}}),scripts:Object.entries(null!=(s=null==z?void 0:z.scripts)?s:{}).filter(([e,t])=>e.startsWith(u.Wn)&&3===e.split(":").length).map(([e,t])=>{var n,r;let i=e.split(":");return{name:null!=(n=i[1])?n:"",id:null!=(r=i[2])?r:"",args:t}}),queries:Object.entries(null!=(d=null==z?void 0:z.queries)?d:{}).filter(([e,t])=>e.startsWith(u.ru)&&3===e.split(":").length).map(([e,t])=>{var n,r;let i=e.split(":");return{name:null!=(n=i[1])?n:"",id:null!=(r=i[2])?r:"",args:t}})}},b?{submit:{fName:b.name,package:(0,m.Vu)(b)}}:{}),f=f={queryFunctionName:"Query"===q.value&&null!=(c=R.value)?c:void 0},Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(f)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(f)).forEach(function(e){Object.defineProperty(h,e,Object.getOwnPropertyDescriptor(f,e))}),h);try{yield(g=y,a._package.files.writeAsText(`Hit Triage/templates/${g.name}.json`,JSON.stringify(g)))}catch(e){o.shell.error(`Could not save template ${y.name}: ${e instanceof Error?e.message:e}`);return}o.shell.info("Template created successfully"),e(y)})()),G.appendChild(j),I()}),cancelPromise:U}})()}function y(e,t,n){e.root.classList.toggle("hit-triage-input-error",n),t.style.opacity=n?"100%":"0%"}function _(e){let t=new p([r.Property.fromOptions({name:"Name",type:r.TYPE.STRING}),r.Property.fromOptions({name:"Type",type:r.TYPE.STRING,choices:Object.keys(l.u)}),r.Property.fromOptions({name:"Required",type:r.TYPE.BOOL})],e?e.map(e=>({Name:e.name,Type:e.type,Required:e.required})):void 0,{horizontalInputNames:!1});t.root.style.maxWidth="750px";let n={};t.onItemAdded.subscribe(e=>{n={}}),t.onAddingItemChanged.subscribe(e=>{e&&(n=e.item)});let o=i.h2("Additional fields");i.tooltip.bind(o,"Additional fields to be filled by user for each campaign");let a=i.div([o,t.root]);return{getFields:function(){let e=t.items.filter(e=>e.Name).map(e=>{var t;return{name:e.Name,type:e.Type,required:null!=(t=e.Required)&&t}});if(n.Name&&""!==n.Name&&n.Type){var r;null!=(r=n).Required||(r.Required=!1),e.push({name:n.Name,type:n.Type,required:n.Required})}return e},fieldsDiv:i.div([a])}}},5048(e,t,n){n.d(t,{Nh:()=>j,W9:()=>C,tS:()=>T});var r=n(4328),i=n(6082),o=n(6788),a=n(5234),l=n(2684),s=n(9446),u=n(2232),d=n(1259),c=n(532);function p(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}function h(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){p(o,r,i,a,l,"next",e)}function l(e){p(o,r,i,a,l,"throw",e)}a(void 0)})}}function m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function f(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}let g="The campaign was not saved; the balloon says why",v=new Map;function b(e,t,n,i){let o=v.get(e);return o||(o=r.functions.register({signature:t,run:i,isAsync:!0,namespace:"HitTriageAI",tags:"hit-ai-function",options:{description:n}}),v.set(e,o)),o}let y=new WeakMap;function _(e){var t,n;let r=null!=(t=null==e?void 0:e.jsView)?t:e;for(let t of[r,e,null==r?void 0:r.currentView]){if(null==t)continue;let e=y.get(t);if(e instanceof a.C)return e;if(t.app instanceof a.C)return t.app;if((null==(n=t.currentView)?void 0:n.app)instanceof a.C)return t.currentView.app}throw Error("The current view does not belong to a Hit Triage / Hit Design app")}function w(e){let t=_(e);if(!(t instanceof l.J))throw Error("This action applies only to Hit Design / PeptiHit campaigns");return t}function x(e){var t,n;let r=null!=(t=null==e?void 0:e.jsView)?t:e;if(r instanceof i.TableView)return r;let o=_(e),a=null!=(n=o.designView)?n:o._pickView;if(a instanceof i.TableView)return a;throw Error("No campaign table view is open")}function k(e){var t;return m(f(m({code:e.name},e.friendlyName&&e.friendlyName!==e.name?{name:e.friendlyName}:{}),{template:e.templateName,status:null!=(t=e.status)?t:null}),e.authorUserFriendlyName?{author:e.authorUserFriendlyName}:{},e.createDate?{created:e.createDate}:{},null!=e.rowCount?{rows:e.rowCount}:{})}function O(e){var t,n,r,i;let o=null==e?void 0:e.compute;return o?{descriptors:(null==(i=o.descriptors)?void 0:i.enabled)?o.descriptors.args:[],functions:(null!=(t=o.functions)?t:[]).map(e=>`${e.package}:${e.name}`),scripts:(null!=(n=o.scripts)?n:[]).map(e=>e.name),queries:(null!=(r=o.queries)?r:[]).map(e=>e.name)}:null}function A(e){return h(function*(){return!e.authorUserId||!e.permissions||(yield(0,d.Zg)(e.authorUserId,e.permissions))})()}function S(e,t){return h(function*(){var n,r;let i=yield s._package.loadCampaigns(e.appName,[]);return null!=(n=null!=(r=i[t])?r:Object.values(i).find(e=>{var n;return(null!=(n=e.friendlyName)?n:"").toLowerCase()===t.toLowerCase()}))?n:null})()}function P(e){return h(function*(){return(yield s._package.files.list(`${e}/templates`)).filter(e=>e.name.endsWith(".json")).map(e=>e.name.slice(0,-5))})()}function E(){return[b("getHitCampaignState","dynamic getHitCampaignState(view view)","State of the open campaign - name, template, status, molecule column, stages, columns, row counts, edit permission, submit function. Call this first. The molecule data itself lives in the attached table",e=>h(function*(){var t,n,r,i,a;let s=_(e),u=s.dataFrame,d=s instanceof l.J?s.stages:[];return f(m(f(m({app:s.appName,campaign:s.campaign?k(s.campaign):null},s.campaignId?{code:s.campaignId}:{}),{moleculeColumn:null!=(t=s.molColName)?t:null}),s.helmColName?{sequenceColumn:s.helmColName}:{},d.length?{stages:d}:{}),{rows:null!=(n=null==u?void 0:u.rowCount)?n:0,filteredRows:null!=(r=null==u?void 0:u.filter.trueCount)?r:0,columns:u?o.OD.listedColumns(u).map(e=>m({name:e.name,type:e.type},e.semType?{semType:e.semType}:{})):[],canEdit:s.canEdit,submitFunction:s.submitParams?`${s.submitParams.package}:${s.submitParams.fName}`:null,compute:O(null!=(i=null==(a=s.campaign)?void 0:a.template)?i:s.template)})})()),b("saveHitCampaign","dynamic saveHitCampaign(view view)","Save the open campaign - its table, layout and metadata",e=>h(function*(){var t,n;let r=_(e);return r.canEdit?(yield r.saveCampaign())===void 0?{success:!1,error:g}:{success:!0,campaign:null!=(t=r.campaignId)?t:null==(n=r.campaign)?void 0:n.name}:{success:!1,error:"You do not have permission to modify this campaign"}})()),b("setHitCampaignStatus","dynamic setHitCampaignStatus(view view, string status)","Set the status of the open campaign (free text, e.g. In Progress, Approved) and save it",(e,t)=>h(function*(){var n;let r=_(e);if(!(null==t?void 0:t.trim()))return{success:!1,error:"status is required"};if(!r.campaign)return{success:!1,error:"No campaign is open"};if(!r.canEdit)return{success:!1,error:"You do not have permission to modify this campaign"};let i=r.campaign,o=i.status;return(i.status=t.trim(),(yield r.saveCampaign())===void 0)?(i.status=o,{success:!1,error:g}):{success:!0,status:null==(n=r.campaign)?void 0:n.status}})()),b("submitHitCampaign","dynamic submitHitCampaign(view view, string status)","Submit the campaign molecules to the configured submit function and save. status is optional and applies to Hit Design campaigns (Hit Triage submits always set the status to Submitted). ALWAYS confirm with the user first",(e,t)=>h(function*(){let n=_(e);if(!n.canEdit)return{success:!1,error:"You do not have permission to modify this campaign"};if(!n.submitParams)return{success:!1,error:"No submit function is configured for this campaign template"};let r=n.submitView;return r?(r.submitWithStatus?yield r.submitWithStatus(null!=t?t:void 0):yield r.submit())?{success:!0,submittedTo:`${n.submitParams.package}:${n.submitParams.fName}`}:{success:!1,error:"The configured submit function could not be run"}:{success:!1,error:"The campaign is not fully open yet"}})()),b("searchHitTableFunctions","dynamic searchHitTableFunctions(view view, string query, int limit)","Search the standard table view functions (hundreds of data commands - add columns, aggregate, select rows, viewers). ALWAYS pass a query. Invoke matches with callHitTableFunction",(e,t,n)=>h(function*(){let r=x(e),o=i.View.prototype.getFunctions.call(r),a=(null!=t?t:"").toLowerCase().split(/\s+/).filter(e=>e.length>0),l=o.map(e=>({f:e,s:(e=>{if(!a.length)return 1;let t=[e.name,e.friendlyName,e.description].filter(Boolean).join(" ").toLowerCase();return a.filter(e=>t.includes(e)).length})(e)})).filter(e=>e.s>0).sort((e,t)=>t.s-e.s).map(e=>e.f),s=n&&n>0?n:10;return m({total:l.length,functions:l.slice(0,s).map(e=>({name:e.name,description:e.description||e.friendlyName||e.name,inputs:e.inputs.filter(e=>"view"!==e.name&&"view"!==e.propertyType).map(e=>({name:e.name,type:e.propertyType}))}))},l.length>s?{note:`Showing ${s} of ${l.length} — refine the query`}:{})})()),b("callHitTableFunction","dynamic callHitTableFunction(view view, string name, map parameters)","Invoke a standard table view function by name (from searchHitTableFunctions) with parameters keyed by input name",(e,t,n)=>h(function*(){var r;let a=x(e),l=i.View.prototype.getFunctions.call(a),s=null!=(r=l.find(e=>e.name===t))?r:l.find(e=>e.name.toLowerCase()===(null!=t?t:"").toLowerCase());if(!s)return{success:!1,error:`No table function '${t}' — call searchHitTableFunctions to find it`};let u=m({},null!=n?n:{});for(let e of s.inputs)e.name in u||"view"!==e.name&&"view"!==e.propertyType||(u[e.name]=a);let d=yield s.apply(u);return m({success:!0},null!=d?{result:function(e){if(null==e||"string"==typeof e||"number"==typeof e||"boolean"==typeof e)return e;if(e instanceof i.DataFrame)return{type:"dataframe",name:e.name,rowCount:e.rowCount,columns:o.OD.listedColumns(e).map(e=>e.name)};if(e instanceof i.Column)return{type:"column",name:e.name,length:e.length};if(e instanceof i.ViewBase)return{type:"view",name:e.name};try{return JSON.parse(JSON.stringify(e))}catch(t){return String(e)}}(d)}:{})})())]}function C(e){return`${e} — the landing page of a molecule campaign app where teams ${"Hit Design"===e||"PeptiHit"===e?"design molecules in a spreadsheet, calculate properties, and track progress through stages":"ingest a molecule dataset, calculate properties, and filter it down to the hits"}. Act on it through the view functions (search list_view_functions with "hit"): getHitAppInfo (call first), listHitCampaigns / getHitCampaignDetails / openHitCampaign to browse and continue campaigns, listHitTemplates / getHitTemplateDetails for the templates, createHitCampaign / deleteHitCampaign to manage them (confirm deletions with the user first).`}function j(e,t){y.set(e,t),e.aiDescription=C(t.appName),e.getFunctions=()=>[b("getHitAppInfo","dynamic getHitAppInfo(view view)","Overview of this Hit app - its name, saved campaign and template counts, the campaign currently open. Call this first",e=>h(function*(){var t,n,r;let i=_(e),o=yield s._package.loadCampaigns(i.appName,[]);return{app:i.appName,campaigns:Object.keys(o).length,templates:yield P(i.appName),currentCampaign:null!=(t=null!=(n=i.campaignId)?n:null==(r=i.campaign)?void 0:r.name)?t:null,canCreateCampaignsHere:i instanceof l.J}})()),b("listHitCampaigns","dynamic listHitCampaigns(view view)","List the saved campaigns of this Hit app with code, name, template, status, author and row count. Campaigns are addressed by code",e=>h(function*(){let t=_(e),n=Object.values((yield s._package.loadCampaigns(t.appName,[])));return{total:n.length,campaigns:n.map(k)}})()),b("getHitCampaignDetails","dynamic getHitCampaignDetails(view view, string campaignCode)","Full detail of one saved campaign - fields, row counts, compute methods, stages, whether the current user can edit it",(e,t)=>h(function*(){var n,r;let i=_(e),o=yield S(i,t);return o?f(m({},k(o),o.campaignFields&&Object.keys(o.campaignFields).length?{campaignFields:o.campaignFields}:{},null!=o.filteredRowCount?{filteredRows:o.filteredRowCount}:{},o.lastModifiedUserName?{lastModifiedBy:o.lastModifiedUserName}:{},(null==(r=o.template)||null==(n=r.stages)?void 0:n.length)?{stages:o.template.stages}:{}),{compute:O(o.template),canEdit:yield A(o)}):{success:!1,error:`No campaign '${t}' — call listHitCampaigns for codes`}})()),b("openHitCampaign","dynamic openHitCampaign(view view, string campaignCode)","Open a saved campaign so the user can work on it - loads its table and shows the campaign view",(e,t)=>h(function*(){let n=_(e),r=yield S(n,t);return r?(yield n.infoView.setCampaign(r.name),n.campaignId!==r.name)?{success:!1,error:"Failed to open the campaign — you may not have permission to view it"}:{success:!0,campaign:r.name,note:"The campaign view is now open"}:{success:!1,error:`No campaign '${t}' — call listHitCampaigns for codes`}})()),b("listHitTemplates","dynamic listHitTemplates(view view)","List the campaign template names of this Hit app",e=>h(function*(){return{templates:yield P(_(e).appName)}})()),b("getHitTemplateDetails","dynamic getHitTemplateDetails(view view, string templateName)","Full detail of one campaign template - its campaign fields, stages, compute methods, data source and submit function",(e,t)=>h(function*(){var n,r;let i=_(e),o=`${i.appName}/templates/${t}.json`;if(!(yield s._package.files.exists(o)))return{success:!1,error:`No template '${t}' — call listHitTemplates for names`};let a=yield(0,d.PM)(o);return m(f(m({name:a.name,key:a.key,campaignFields:(null!=(n=a.campaignFields)?n:[]).map(e=>({name:e.name,type:e.type,required:!!e.required}))},(null==(r=a.stages)?void 0:r.length)?{stages:a.stages}:{},a.dataSourceType?{dataSourceType:a.dataSourceType}:{},a.queryFunctionName?{dataSourceFunction:a.queryFunctionName}:{}),{compute:O(a)}),a.submit?{submitFunction:`${a.submit.package}:${a.submit.fName}`}:{})})()),b("createHitCampaign","dynamic createHitCampaign(view view, string templateName, string campaignName, map campaignFields)","Create a new campaign from a template and open it. Hit Design and PeptiHit only. campaignName and campaignFields are optional, but fields the template marks required must be provided",(e,t,n,r)=>h(function*(){var i;let o=w(e),a=`${o.appName}/templates/${t}.json`;if(!(yield s._package.files.exists(a)))return{success:!1,error:`No template '${t}' — call listHitTemplates for names`};let l=yield(0,d.PM)(a),u=(null!=(i=l.campaignFields)?i:[]).filter(e=>e.required&&((null==r?void 0:r[e.name])==null||""===r[e.name])).map(e=>e.name);return u.length?{success:!1,error:`Missing required campaign fields: ${u.join(", ")} — pass them in campaignFields`}:(yield o.startNewCampaign(l,m({},null!=r?r:{}),(null==n?void 0:n.trim())||void 0),{success:!0,campaign:o.campaignId,note:"The campaign is created and its design view is open"})})()),b("deleteHitCampaign","dynamic deleteHitCampaign(view view, string campaignCode)","Permanently delete a saved campaign. ALWAYS confirm with the user first",(e,t)=>h(function*(){let n=_(e),r=yield S(n,t);return r?(yield A(r))?(yield n.infoView.deleteCampaignAndRefresh(n.appName,r.name),{success:!0,deleted:r.name}):{success:!1,error:"You do not have permission to delete this campaign"}:{success:!1,error:`No campaign '${t}' — call listHitCampaigns for codes`}})())]}function T(e,t,n){var r;y.set(e,t),r=t.appName,e.aiDescription=`An open ${r} campaign — a molecule spreadsheet for ${"design"===n?"sketching and editing molecules in the grid. Hit-specific functions: getHitCampaignState (call first), setHitMolecule / setHitStage / setHitStages / recalculateHitRow to edit, saveHitCampaign / setHitCampaignStatus / submitHitCampaign to persist":"filtering the enriched molecule table down to the hits. Hit-specific functions: getHitCampaignState (call first), saveHitCampaign / setHitCampaignStatus / submitHitCampaign"}. The underlying table view also has hundreds of standard data commands — find them with searchHitTableFunctions (always pass a query) and run them with callHitTableFunction. The data itself lives in the attached table.`,e.getFunctions=()=>"design"===n?[...E(),b("setHitMolecule","dynamic setHitMolecule(view view, string molecule, int row)","Set the molecule of a row (SMILES or molblock, HELM for PeptiHit). Omit row to add a new row. Registers the V-iD and runs the configured property calculations",(e,t,n)=>h(function*(){var r,i,o,a;let l=w(e);if(!l.canEdit)return{success:!1,error:"You do not have permission to modify this campaign"};if(!(null==t?void 0:t.trim()))return{success:!1,error:"molecule is required"};let s=l.dataFrame;if(!s)return{success:!1,error:"No campaign table is open"};let d=l.helmColName,p=d?s.col(d):s.col(l.molColName);if(!p)return{success:!1,error:"The molecule column was not found"};let h=null!=n?n:null;if(null==h)s.rows.addNew(null,!0),h=s.rowCount-1;else if(h<0||h>=s.rowCount)return{success:!1,error:`row must be between 0 and ${s.rowCount-1}`};if(p.set(h,t,!0),d){yield l.performSingleCellCalculations(h,t);let e=null==(i=s.col(l.molColName))?void 0:i.get(h);if(e)try{let t=yield(0,c.Go)(e,l.campaignId,l.appName);t&&(null==(o=s.col(u.Hz))||o.set(h,t,!0))}catch(e){console.error("Failed to register molecule",e)}}else{try{let e=yield(0,c.Go)(t,l.campaignId,l.appName);e&&(null==(a=s.col(u.Hz))||a.set(h,e,!0))}catch(e){console.error("Failed to register molecule",e)}yield l.performSingleCellCalculations(h,t)}return m({success:!0,row:h},(null==(r=s.col(u.Hz))?void 0:r.get(h))?{vId:s.col(u.Hz).get(h)}:{})})()),b("setHitStage","dynamic setHitStage(view view, int row, string stage)","Move a row to another stage of the campaign progress tracker and save",(e,t,n)=>h(function*(){let r=w(e);if(!r.canEdit)return{success:!1,error:"You do not have permission to modify this campaign"};let i=r.dataFrame,o=null==i?void 0:i.col(u.yJ);return i&&o?null==t||t<0||t>=i.rowCount?{success:!1,error:`row must be between 0 and ${i.rowCount-1}`}:r.stages.includes(n)?(o.set(t,n,!0),(yield r.saveCampaign(!1))===void 0)?{success:!1,error:`The row moved to ${n}, but ${g.toLowerCase()}`}:{success:!0,row:t,stage:n}:{success:!1,error:`Unknown stage '${n}' — the stages are: ${r.stages.join(", ")}`}:{success:!1,error:"This campaign has no stage column"}})()),b("setHitStages","dynamic setHitStages(view view, list stages)","Replace the stage list of the campaign progress tracker. Rows in a removed stage move to the first stage. Saves the campaign",(e,t)=>h(function*(){var n,r;let i=w(e);return i.canEdit?!Array.isArray(t)||!t.length||t.some(e=>"string"!=typeof e||!e.trim())?{success:!1,error:"Pass stages as a non-empty list of names"}:(null==(n=i.campaign)?void 0:n.template)&&i.template?(null==(r=i.dataFrame)?void 0:r.col(u.yJ))?(yield i.setStages(t.map(e=>e.trim())))?{success:!0,stages:i.stages}:{success:!1,error:`The stages changed, but ${g.toLowerCase()}`}:{success:!1,error:"This campaign has no stage column"}:{success:!1,error:"No campaign is open"}:{success:!1,error:"You do not have permission to modify this campaign"}})()),b("recalculateHitRow","dynamic recalculateHitRow(view view, int row)","Re-run the configured property calculations for one row of the campaign",(e,t)=>h(function*(){var n;let r=w(e),i=r.dataFrame;if(!i)return{success:!1,error:"No campaign table is open"};if(null==t||t<0||t>=i.rowCount)return{success:!1,error:`row must be between 0 and ${i.rowCount-1}`};let o=r.helmColName,a=null==(n=o?i.col(o):i.col(r.molColName))?void 0:n.get(t);return a?(yield r.performSingleCellCalculations(t,a),{success:!0,row:t}):{success:!1,error:"The row has no molecule to calculate from"}})())]:E()}},3854(e,t,n){n.d(t,{vq:()=>g,om:()=>f,_w:()=>v});var r=n(4328),i=n(6082),o=n(9832),a=n(6788),l=n(2232),s=n(9446),u=n(6287),d=n(7776),c=n(897);function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function h(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}function m(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){h(o,r,i,a,l,"next",e)}function l(e){h(o,r,i,a,l,"throw",e)}a(void 0)})}}class f extends i.ViewBase{get template(){return this.app.template}onActivated(){}onReset(){}process(){return m(function*(){})()}constructor(e){super(),this.app=e}}class g extends Error{constructor(e){super(e),this.name="CampaignUnavailableError"}}class v extends f{onActivated(){r.shell.windows.showHelp=!0,r.shell.windows.help.showHelp(this.helpUrl)}init(e){return m(function*(){var t;null==(t=this.home)||t.dispose();let n=o.HGh.root("hit-home");this.home=n.build(()=>{var t;return t=this.homeOptions(e),(0,o.s9R)(e=>{var n,r;let i=(0,o.vPA)(!1),a=(0,d.id)((n=p({},t.catalog),r=r={narrow:i},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(r)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}),n)),s=a.table.root,u=new ResizeObserver(()=>{s.clientWidth>0&&(i.value=s.clientWidth<820)});u.observe(s),e.own(()=>u.disconnect());let h=(0,c.j)(t.picker),m=new o.YW0({labelColumn:!1,sections:[{title:l.Ru.continueCampaigns,actions:a.chrome(),content:a.table},{title:l.Ru.createNewCampaignHeader,content:h,maxWidth:c.k}]});return{root:(0,o.y4m)([(0,o.y4m)([new o.jJZ(p({name:"app-header"},t.header))],"hit-triage-home-header"),(0,o.y4m)([m])],"hit-triage-home"),catalog:a,picker:h}},{name:"hit-home"})}),this.home.own(()=>n.dispose()),this.root.replaceChildren((0,a.Hc)(this.home))}).call(this)}deleteCampaign(e,t){return m(function*(){var n;yield s._package.files.delete(`${e}/campaigns/${t}`),null==(n=s._package.campaignsCache[e])||delete n[t],this.deletedCampaigns.push(t),yield u.P.deleteCampaignRecords(e,t).catch(e=>s._package.logger.error(e))}).call(this)}deleteCampaignAndRefresh(e,t){return m(function*(){var n;yield this.deleteCampaign(e,t),yield null==(n=this.home)?void 0:n.catalog.reload()}).call(this)}setCampaign(e){return m(function*(){yield this.open(()=>this.checkCampaign(e),e)}).call(this)}openLinked(){return m(function*(){var e;let t=null!=(e=this.app.parentCall.getParamValue(l.l2))?e:new URLSearchParams(location.search).get(l.l2);t&&(yield this.open(()=>this.checkCampaign(t),t))}).call(this)}catalogOptions(e,t,n){return{app:this.app.appName,family:e,deleted:this.deletedCampaigns,label:t,onLoaded:n,open:e=>this.setCampaign(e),remove:e=>this.deleteCampaign(this.app.appName,e)}}open(e,t){return m(function*(){let n=this.app.campaign,i=this.app.dataFrame;try{yield e()}catch(e){this.app.dataFrame===i&&(this.app.campaign=n),e instanceof g||s._package.logger.error(e),r.shell.error(`Campaign ${t} could not be opened: ${e instanceof Error?e.message:e}`),this.app.setBaseUrl()}}).call(this)}constructor(e,t){super(e),this.deletedCampaigns=[],this.helpUrl=s._package.webRoot+t}}},2232(e,t,n){n.d(t,{FD:()=>w,FS:()=>c,Gs:()=>T,HC:()=>D,HE:()=>N,Hz:()=>f,IV:()=>E,Iz:()=>C,Lk:()=>b,Lz:()=>h,Pf:()=>O,Ru:()=>v,WC:()=>A,XA:()=>j,YG:()=>k,Zf:()=>m,b1:()=>I,bO:()=>P,cx:()=>y,dY:()=>u,ge:()=>i,hO:()=>l,l2:()=>r,lq:()=>s,mY:()=>_,mz:()=>o,pr:()=>g,rU:()=>S,wS:()=>a,yJ:()=>p,yv:()=>d});let r="campaignId",i="campaignId",o="enriched_table.csv",a="campaign.json",l="HitTriageFunction",s="HitDesignerFunction",u="HitTriageDataSource",d="HitTriageSubmitFunction",c="Selected hits",p="Stage",h="Molecule",m="Helm",f="V-iD",g="HIT_DESIGN_VID",v={startNewCampaign:"New Campaign",createNewCampaign:"New Campaign",dataSourceFunction:"Source",createNewTemplate:"New Template",StartCampaign:"Start",createTemplate:"Create",createCampaign:"Create",download:"Download",cancel:"Cancel",continueCampaigns:"Continue Campaign",createNewCampaignHeader:"New Campaign",selectTemplate:"Template",noInformation:"No Information"},b="HDCampaignsGrouping",y="HDCampaignTableColumns",_="HDCampaignsTableSorting",w="HDCampaignsCollapsed";var x,k=((x={}).None="None",x.Template="Template",x.Status="Status",x.Author="Author",x.LastModifiedUser="Last Modified User",x);let O="Last Modified by",A={Name:e=>{var t;return null!=(t=e.friendlyName)?t:e.name},Code:e=>e.name,Created:e=>e.createDate,Author:e=>{var t;return null!=(t=e.authorUserFriendlyName)?t:""},[O]:e=>{var t;return null!=(t=e.lastModifiedUserName)?t:""},Molecules:e=>{var t;return(null!=(t=e.rowCount)?t:0).toString()},Status:e=>e.status},S=["Code","Created","Author",O,"Molecules","Status"],P="HTCampaignsGrouping",E="HTCampaignTableColumns",C="HTCampaignsTableSorting",j="HTCampaignsCollapsed",T={Name:e=>{var t;return null!=(t=e.friendlyName)?t:e.name},Code:e=>e.name,Created:e=>e.createDate,Author:e=>{var t;return null!=(t=e.authorUserFriendlyName)?t:""},[O]:e=>{var t;return null!=(t=e.lastModifiedUserName)?t:""},Total:e=>{var t;return(null!=(t=e.rowCount)?t:0).toString()},Selected:e=>{var t;return(null!=(t=e.filteredRowCount)?t:0).toString()},Status:e=>e.status},N=["Created","Author","Total","Selected","Status"],I="pepTriageDataSource",D="HTFunctionOrderingLS"},8434(e,t,n){n.d(t,{Ji:()=>C,Fw:()=>T,dG:()=>j});var r=n(4328),i=n(7389);let o=$;var a=n.n(o),l=n(3621),s=n.n(l),u=n(2611),d=n.n(u),c=n(6129),p=n.n(c),h=n(8986),m=n.n(h),f=n(838),g=n.n(f),v=n(3515),b=n.n(v),y=n(2804),_={};_.styleTagTransform=b(),_.setAttributes=m(),_.insert=p().bind(null,"head"),_.domAPI=d(),_.insertStyleElement=g(),s()(y.A,_),y.A&&y.A.locals&&y.A.locals;var w=n(4281),x=n(5236);function k(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function O(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}function A(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){O(o,r,i,a,l,"next",e)}function l(e){O(o,r,i,a,l,"throw",e)}a(void 0)})}}function S(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,i=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var o=[],a=!0,l=!1;try{for(i=i.call(e);!(a=(n=i.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==i.return||i.return()}finally{if(l)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return k(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return k(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}n(8707);var P=n(2232);function E(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}let C={label:"Re-run when campaign opens",tooltip:"Recompute this function for the whole molecule column every time this campaign is opened. Useful for database lookups that may resolve after the molecule was first drawn."},j=()=>r.chem.descriptorsTree();function T(e,t,n,r,o,l){var s;return(s=function*(){var s,u,d,c;return s=e.computeFunctions,u=P.HC,d=void 0,c=l?C:void 0,A(function*(){let e=null!=u?u:"HTFunctionOrderingLS",l=[];s.functions.filter(e=>{let t=e.inputs;return t.length>=2&&"dataframe"===t[0].propertyType&&"column"===t[1].propertyType}).forEach(e=>{var t,n,i,o;l.push({func:e,args:null!=(t=null==r||null==(o=r.compute)||null==(i=o.functions)||null==(n=i.find(t=>t.name===e.name&&t.package===e.package.name))?void 0:n.args)?t:{}})}),s.scripts.filter(e=>{let t=e.inputs;return t.length>=2&&"dataframe"===t[0].propertyType&&"column"===t[1].propertyType}).forEach(e=>{var t,n,i,o;l.push({func:e,args:null!=(t=null==r||null==(o=r.compute)||null==(i=o.scripts)||null==(n=i.find(t=>t.id===e.id))?void 0:n.args)?t:{}})}),s.queries.filter(e=>e.inputs.length>0&&"list"===e.inputs[0].propertyType).forEach(e=>{var t,n,i,o;l.push({func:e,args:null!=(t=null==r||null==(o=r.compute)||null==(i=o.queries)||null==(n=i.find(t=>t.id===e.id))?void 0:n.args)?t:{}})});let p=i.div([],{classes:"statistics-compute-dialog-host"}),h=[],m=i.tree(),f=i.wait(()=>A(function*(){try{if(!j)return i.divText("No descriptors provider configured");let v=yield j();m.root.classList.add("statistics-compute-dialog-descriptors-group");let b=Object.keys(v),y=null!=(o=null==r||null==(l=r.compute)||null==(a=l.descriptors)?void 0:a.args)?o:[];var e=!0,t=!1,n=void 0;try{for(var o,a,l,s,u=b[Symbol.iterator]();!(e=(s=u.next()).done);e=!0){let e=s.value,t=function(e,t){let n=t.group(e,null,!1);return n.enableCheckBox(!1),n}(e,m);var d=!0,c=!1,p=void 0;try{for(var f,g=v[e].descriptors[Symbol.iterator]();!(d=(f=g.next()).done);d=!0){let e=f.value,n=t.item(e.name,e);h.push(n),n.enableCheckBox(y.includes(e.name))}}catch(e){c=!0,p=e}finally{try{d||null==g.return||g.return()}finally{if(c)throw p}}}}catch(e){t=!0,n=e}finally{try{e||null==u.return||u.return()}finally{if(t)throw n}}return m.root}catch(e){console.error(e)}return i.divText("Failed to load descriptors")})());f.classList.add("oy-scroll");let g="Descriptors",v={[g]:g},b={[g]:f},y={},_={[g]:!1};_[g]=!!(null==r||null==(T=r.compute)||null==(C=T.descriptors)?void 0:C.enabled)&&(null==r||null==(D=r.compute)||null==(I=D.descriptors)||null==(N=I.args)?void 0:N.length)>0;let k={};var O=!0,P=!1,E=void 0;try{for(var C,T,N,I,D,L,z,F,B,M,R,q,H,W,V,G,U,K,Y,Q,J,Z,X,ee,et=l[Symbol.iterator]();!(O=(ee=et.next()).done);O=!0){let e=ee.value;try{let t=e.func,n=t.prepare(e.args),o=t.type===w.Vm.function?`${t.package.name}:${t.name}`:t.type===w.Vm.script?`${w.Wn}:${null!=(L=t.name)?L:""}:${t.id}`:`${w.ru}:${null!=(z=t.name)?z:""}:${t.id}`;y[o]=n;let a=i.div();i.setUpdateIndicator(a,!0),n.buildEditor(a,{condensed:!1}).then(n=>{var r,i;(null==n||null==(r=n[0])?void 0:r.root)&&(n[0].root.style.display="none"),(null==n||null==(i=n[1])?void 0:i.root)&&t.type!==w.Vm.query&&(n[1].root.style.display="none"),n.forEach(t=>{var n,r;(null==(n=t.property)?void 0:n.name)&&Object.keys(e.args).includes(null==(r=t.property)?void 0:r.name)&&(t.value=e.args[t.property.name]),t.fireChanged()})}).catch(e=>{console.error(e),i.setUpdateIndicator(a,!1),a.appendChild(i.divText("Failed to build function editor"))}).finally(()=>i.setUpdateIndicator(a,!1)),a.classList.add("oy-scroll"),a.style.marginLeft="15px",a.style.removeProperty("max-width"),v[null!=(F=t.friendlyName)?F:t.name]=o,_[o]=null!=(B=(null==r||null==(H=r.compute)||null==(q=H.functions)?void 0:q.some(t=>e.func.type===w.Vm.function&&t.name===e.func.name&&t.package===(0,x.Vu)(e.func)))||(null==r||null==(V=r.compute)||null==(W=V.scripts)?void 0:W.some(e=>e.id===t.id))||(null==r||null==(U=r.compute)||null==(G=U.queries)?void 0:G.some(e=>e.id===t.id)))&&B,k[o]=null!=(M=(null==r||null==(Y=r.compute)||null==(K=Y.functions)?void 0:K.some(e=>`${e.package}:${e.name}`===o&&e.rerunOnOpen))||(null==r||null==(J=r.compute)||null==(Q=J.scripts)?void 0:Q.some(e=>`${w.Wn}:${e.name}:${e.id}`===o&&e.rerunOnOpen))||(null==r||null==(X=r.compute)||null==(Z=X.queries)?void 0:Z.some(e=>`${w.ru}:${e.name}:${e.id}`===o&&e.rerunOnOpen)))&&M,b[null!=(R=t.friendlyName)?R:t.name]=function(e,t){if(!c||e===g)return t;let n=i.input.bool(c.label,{value:!!k[e],onValueChanged:t=>{k[e]=!!t}});return n.setTooltip(c.tooltip),n.root.classList.add("statistics-compute-dialog-rerun-input"),i.divV([n.root,t])}(o,a)}catch(e){console.error(e);continue}}}catch(e){P=!0,E=e}finally{try{O||null==et.return||et.return()}finally{if(P)throw E}}let en=i.tabControl(b,{vertical:!0});en.onTabChanged.subscribe(()=>{try{en.currentPane.content.style.removeProperty("max-width")}catch(e){}}),en.header.style.overflow="scroll",en.root.style.width="100%",en.root.style.minWidth="350px",p.appendChild(en.root);let er=[];function ei(e){var t,n;en.clear();let r=null!=(t=e.order)?t:Object.keys(b);0===r.length&&(r=Object.keys(b)),r.forEach(e=>{b[e]&&en.addPane(e,()=>b[e])}),Object.keys(b).forEach(t=>{var n;r.includes(t)||!b[t]||(null!=(n=e.hidden)?n:[]).includes(t)||en.addPane(t,()=>b[t])}),(null!=(n=e.hidden)?n:[]).forEach(e=>{_[v[e]]=!1}),er=[],en.panes.forEach(e=>{let t=v[e.name],n=!!_[t],r=n=>{var r,i;if(d&&n)for(let e=0;e<er.length;e++)v[en.panes[e].name]!==t&&(er[e].value=null),_[v[en.panes[e].name]]=!1;_[t]=n,n?null==(i=a()(e.content).find("input"))||i.removeAttr("disabled"):null==(r=a()(e.content).find("input"))||r.attr("disabled","true")},o=d?i.input.radio("",{items:[""],value:n?"":void 0,onValueChanged:e=>r(""===e)}):i.input.bool("",{value:n,onValueChanged:e=>r(!!e)});o.setTooltip("Toggle calculation of this function"),er.push(o),e.header.appendChild(o.root),e.header.classList.add("statistics-compute-dialog-pane-header")}),en.panes.length>0&&(en.currentPane=en.panes[0])}function eo(){let e={descriptors:[],externals:{},scripts:{},queries:{}};c&&(e.rerunOnOpen={},Object.keys(k).forEach(t=>{_[t]&&k[t]&&(e.rerunOnOpen[t]=!0)})),e.descriptors=_[g]?h.filter(e=>e.checked).map(e=>e.value.name):[];let n=Object.entries(y).filter(e=>{let t=S(e,2),n=t[0];return t[1],_[n]});n.filter(e=>{let t=S(e,2),n=t[0];return t[1],!n.startsWith(w.Wn)&&!n.startsWith(w.ru)}).forEach(t=>{let n=S(t,2),r=n[0],i=n[1];e.externals[r]={},Object.entries(i.inputs).slice(2).forEach(t=>{let n=S(t,2),i=n[0],o=n[1];e.externals[r][i]=o})}),n.filter(e=>{let t=S(e,2),n=t[0];return t[1],n.startsWith(w.Wn)}).forEach(t=>{let n=S(t,2),r=n[0],i=n[1];e.scripts[r]={},Object.entries(i.inputs).slice(2).forEach(t=>{let n=S(t,2),i=n[0],o=n[1];e.scripts[r][i]=o})}),n.filter(e=>{let t=S(e,2),n=t[0];return t[1],n.startsWith(w.ru)}).forEach(t=>{let n=S(t,2),r=n[0],i=n[1];e.queries[r]={},Object.entries(i.inputs).slice(1).forEach(t=>{let n=S(t,2),i=n[0],o=n[1];e.queries[r][i]=o})}),console.log(e),t(e)}return ei((0,x.CF)(e)),en.root.appendChild((0,x.ej)(Object.keys(b),e=>{ei(e)},e)),o&&i.dialog("Compute").add(p).onOK(()=>eo()).onCancel(n).show({resizable:!0}),{root:p,okProxy:eo}})()},function(){var e=this,t=arguments;return new Promise(function(n,r){var i=s.apply(e,t);function o(e){E(i,n,r,o,a,"next",e)}function a(e){E(i,n,r,o,a,"throw",e)}o(void 0)})})()}},1254(e,t,n){n.d(t,{x:()=>m});var r=n(6082),i=n(4328),o=n(9832),a=n(6788),l=n(9861),s=n(9446);function u(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}function d(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){u(o,r,i,a,l,"next",e)}function l(e){u(o,r,i,a,l,"throw",e)}a(void 0)})}}let c={smiles:"By canonical SMILES",vid:"By V-iD"},p={skip:"Skip (keep campaign value)",overwrite:"Overwrite (use incoming value)"},h="(none)";function m(e,t){return d(function*(){var n;if(!e.dataFrame)return void i.shell.error("Cannot merge: campaign has no data.");let u=null==(n=e.campaign)?void 0:n.mergeConfig,m=new o.lGe("Merge with table",{name:"merge-table"}),f=m.build(()=>{var t,n,f,g,v;let b=(0,o.vPA)(null),y=(0,o.vPA)(!1),_=(0,o.EWP)(()=>null!==b.value&&!y.value),w=(0,o.EWP)(()=>b.value?a.OD.listedColumns(b.value):[]),x=(0,o.EWP)(()=>[h,...w.value.map(e=>e.name)]),k=e=>{let t=e.value;return t&&t!==h?t:void 0},O=(0,a.Fg)("Source file",{name:"source-file",nullable:!0,fill:!0,placeholder:`Drop file or pick from share — ${l.zS.join(", ")}`,tooltipText:`Pick a file from your computer or from a Datagrok file share.
387
+ Allowed extensions: ${l.zS.join(", ")}.
388
+ Files picked from a share are remembered with the campaign and reloaded automatically next time.`,onEnter:()=>{},onChanged:e=>void F(e,null)});O.addValidator(e=>e&&!l.zS.includes((0,l.AO)(e))?`Unsupported file type ".${(0,l.AO)(e)||"?"}". Allowed: ${l.zS.join(", ")}.`:null);let A=(0,o.EWP)(()=>y.value?"Reading the source file…":null===b.value?"Pick a source file first":null),S=new o.oGE({label:"Merge by",name:"merge-by",items:Object.values(c),value:c[null!=(t=null==u?void 0:u.mode)?t:"vid"],nullable:!1,disabled:A,tooltipText:'Join key. "Canonical SMILES" matches by canonicalized molecule structure; "V-iD" matches by the campaign\'s V-iD identifier.'}),P=(0,o.EWP)(()=>S.value===c.vid),E=new o.oGE({label:"Molecule column (incoming)",name:"molecule-column",items:x,value:h,nullable:!0,disabled:A,tooltipText:"Column in the incoming table holding the molecules. Required for SMILES merge. In V-iD merge it is optional — if set, unmatched rows can be added to the campaign and registered with new V-iDs."}),C=new o.oGE({label:"V-iD column (incoming)",name:"vid-column",items:x,value:h,nullable:!0,disabled:(0,o.EWP)(()=>{var e;return null!=(e=A.value)?e:P.value?null:"Used only when merging by V-iD"}),tooltipText:"Column in the incoming table holding V-iD strings. Used as the join key when merging by V-iD."}),j=(0,o.EWP)(()=>{var e;return null!=(e=A.value)?e:void 0===k(E)?"Pick the molecule column (incoming) first":null}),T=new o.d52({label:"Add unmatched rows",name:"add-rows",value:null==(n=null==u?void 0:u.addNewRows)||n,disabled:j,tooltipText:"When on, rows from the incoming table whose key is not present in the campaign are added as new rows. When off, only existing rows are updated. Disabled when no incoming molecule column is selected (nothing to register the new row with)."}),N=new o.d52({label:"Run compute on new rows",name:"run-compute",value:null==(f=null==u?void 0:u.runComputeOnNewRows)||f,disabled:(0,o.EWP)(()=>{var e;return null!=(e=j.value)?e:T.value?null:"Turn on Add unmatched rows first"}),tooltipText:"Run the campaign's compute pipeline (descriptors, functions, scripts, queries) on the incoming molecules so new rows arrive with all calculated columns filled in. Disabled when no rows will be added."}),I=new o.oGE({label:"On clashing data",name:"on-clash",items:Object.values(p),value:p[null!=(g=null==u?void 0:u.clashStrategy)?g:"overwrite"],nullable:!1,disabled:A,tooltipText:'How to resolve cells that have a value on both sides for a matched row. "Skip" keeps the existing campaign value; "Overwrite" replaces it with the incoming value. Empty campaign cells are always filled from the incoming table regardless of this setting.'}),D=new o.d52({label:"Auto-merge on campaign open",name:"auto-merge",value:null!=(v=null==u?void 0:u.autoMergeOnOpen)&&v,disabled:(0,o.EWP)(()=>{let e=O.value;return e?(0,l.lj)(e)?"Only a file picked from a Datagrok file share is merged again on open":null:"Pick a source file first"}),tooltipText:"When on, this file is re-read and merged into the campaign every time the campaign is opened, using the configuration below. Compute is never re-run for this implicit pass and the campaign is not auto-saved. Only available for files picked from a Datagrok file share — local uploads cannot be re-read on open."}),L=new o.lVW;for(let e of[O,S,E,C,T,N,I,D])L.add(e);m.add(L),m.okDisabled((0,o.EWP)(()=>y.value?"Reading file…":_.value?P.value||void 0!==k(E)?P.value&&void 0===k(C)?"Pick the V-iD column from the incoming table.":null:"Pick the molecule column from the incoming table.":"Pick a source file to merge from."),{footer:!0});let z=0;function F(e,t){return d(function*(){var n,r,o,a,u,d,m,f;let g=++z;if(b.value=null,y.value=!1,!e||!l.zS.includes((0,l.AO)(e)))return;y.value=!0;let v=null;try{if(!(v=yield(0,l.tr)(e)))throw Error("Empty result");v.name=(null!=(m=e.name)?m:"").replace(/\.[^.]+$/,""),yield v.meta.detectSemanticTypes(),yield i.data.detectSemanticTypes(v)}catch(t){s._package.logger.error(t),i.shell.error(`Failed to read "${e.name}". Check that the file is accessible and well-formed.`),v=null}g!==z||(y.value=!1,b.value=v,v&&(E.value=null!=(n=null!=(r=null==t?void 0:t.molColName)?r:null==(u=(0,l.uS)(w.peek()))?void 0:u.name)?n:h,C.value=null!=(o=null!=(a=null==t?void 0:t.vidColName)?a:null==(d=(0,l.pR)(w.peek()))?void 0:d.name)?o:h,t&&(S.value=c[t.mode],T.value=t.addNewRows,N.value=t.runComputeOnNewRows,I.value=p[t.clashStrategy],D.value=null!=(f=t.autoMergeOnOpen)&&f)))})()}return m.onOK(()=>d(function*(){let t=b.peek();if(!t)return!1;let n=k(E),o=O.peek(),a=o&&!(0,l.lj)(o)?o.fullPath:void 0,u=T.peek()&&!!n,d={mode:P.peek()?"vid":"smiles",filePath:a,molColName:n,vidColName:P.peek()?k(C):void 0,addNewRows:u,runComputeOnNewRows:u&&N.peek(),clashStrategy:I.peek()===p.overwrite?"overwrite":"skip",autoMergeOnOpen:D.peek()&&!!a},c=r.TaskBarProgressIndicator.create("Merging table into campaign...");try{yield(0,l.f_)(e,t,d),e.campaign&&(e.campaign.mergeConfig=d,yield e.saveCampaign(!1)),i.shell.info("Table merged into campaign.")}catch(e){return s._package.logger.error(e),i.shell.error("Merge failed. See console for details."),!1}finally{c.close()}})()),{file:O,read:F}});if(t.show(m,{width:560}),null==u?void 0:u.filePath)try{if(!(yield i.dapi.files.exists(u.filePath)))return void i.shell.warning(`Saved merge file not found or not accessible: ${u.filePath}`);if(!m.isOpen.peek()||null!==f.file.peek())return;let e=r.FileInfo.fromString(u.filePath,"");f.file.reset(e),yield f.read(e,u)}catch(e){s._package.logger.error(e),i.shell.warning("Could not restore previously saved merge file.")}})()}},5234(e,t,n){n.d(t,{d:()=>c,C:()=>p});var r=n(6082),i=n(9446),o=n(2232),a=n(4281),l=n(1259),s=n(6287);function u(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}function d(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){u(o,r,i,a,l,"next",e)}function l(e){u(o,r,i,a,l,"throw",e)}a(void 0)})}}class c extends Error{}class p{get canEdit(){return this.hasEditPermission}get appName(){return this._appName}setCanEdit(e){return d(function*(){this.hasEditPermission=yield this.canEditCampaign(e)}).call(this)}canEditCampaign(e){return d(function*(){return!(null==e?void 0:e.authorUserId)||!e.permissions||(yield(0,l.Zg)(e.authorUserId,e.permissions))})()}static moleculeColumns(e){return e.columns.bySemTypeAll(r.SEMTYPE.MOLECULE).filter(e=>!e.name.startsWith("~"))}static moleculeColumn(e){var t;return null!=(t=p.moleculeColumns(e)[0])?t:null}getFilterType(e){let t=this.dataFrame.col(e);return(null==t?void 0:t.semType)===r.SEMTYPE.MOLECULE?r.FILTER_TYPE.SUBSTRUCTURE:(null==t?void 0:t.type)===r.COLUMN_TYPE.BOOL?r.FILTER_TYPE.BOOL_COLUMNS:(null==t?void 0:t.type)===r.COLUMN_TYPE.STRING?r.FILTER_TYPE.CATEGORICAL:r.FILTER_TYPE.HISTOGRAM}download(e,t,n=!1){let i=document.createElement("a"),o=r.DataFrame.fromColumns(e.columns.toList().filter(e=>!e.name.startsWith("~"))).toCsv({filteredRowsOnly:n});i.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(o)),i.setAttribute("download",t+".csv"),i.click()}getNewCampaignName(e,t){return d(function*(){let n=(yield i._package.files.list(e)).map(e=>e.name).filter(e=>e.startsWith(`${t}-`)&&!!parseInt(e.substring(t.length+1)));if(0===n.length)return t+"-1";let r=n.map(e=>e.substring(t.length+1)).filter(Boolean).map(e=>parseInt(e,10)).sort((e,t)=>e-t);return t+"-"+(r[r.length-1]+1).toString()})()}lockNewCampaignCode(e,t){return d(function*(){let n=e=>parseInt(e.substring(t.length+1),10)||0;for(let r=0;r<20;r++){if(!(yield this.aquireAndWaitCampaignLock(e)).aquired)throw new c(`Could not lock campaign ${e} within 30 seconds`);let r=!1;try{r=!(yield i._package.files.exists(`${this.appName}/campaigns/${e}/${o.wS}`))}finally{r||(yield this.dropCampaignLock(e))}if(r)return e;let a=yield this.getNewCampaignName(`${this.appName}/campaigns`,t);e=`${t}-${Math.max(n(e)+1,n(a))}`}throw Error(`No free campaign code of ${t} after 20 attempts`)}).call(this)}setBaseUrl(){let e=document.title;if(history.replaceState){let t={Title:e,Url:this.baseUrl};history.replaceState(t,t.Title,t.Url)}}aquireAndWaitCampaignLock(e,t=3e4){return d(function*(){let n=Date.now(),i=0,o=null;for(;Date.now()-n<t&&i<5;)try{let t=yield s.P.acquireCampaignLock(this.appName,e,this.lockHolder);if(t&&t.rowCount>0){var a;return{aquired:!0,expires_at:null==t||null==(a=t.col("expires_at"))?void 0:a.getString(0)}}o=null,yield r.delay(200)}catch(e){o=e,i++}if(o)throw o;return{aquired:!1,expires_at:null}}).call(this)}dropCampaignLock(e){return d(function*(){yield s.P.dropCampaignLock(this.appName,e,this.lockHolder).catch(e=>i._package.logger.error(e))}).call(this)}releaseCampaignLock(e){return d(function*(){var t;let n=yield s.P.releaseCampaignLock(this.appName,e);return n.rowCount>0&&(null==(t=n.col("updated_at"))?void 0:t.getString(0))||null}).call(this)}constructor(e,t){var n,i;this.parentCall=e,this.hasEditPermission=!1,this.lockHolder=`${(null==(n=r.User.current())?void 0:n.friendlyName)||(null==(i=r.User.current())?void 0:i.name)||"unknown"} \xb7 ${r.Utils.randomString(6)}`,this.baseUrl=new URL(window.location.href).origin+`/apps/HitTriage/${t.replace(" ","")}`,this._appName=t,this.computeFunctions=function(e){let t=Array.from(new Set(r.Func.find({meta:{role:e}}).concat(r.Func.find({tags:[e]})))),n=t.filter(e=>e.type===a.Vm.function);return{functions:n,scripts:t.filter(e=>e.type===a.Vm.script),queries:t.filter(e=>e.type===a.Vm.query)}}(o.hO)}}p.molFileExtReaders=["sdf","mol","smi","mol2"].map(e=>{let t=r.Func.find({meta:{role:r.FUNC_TYPES.FILE_IMPORTER}}).concat(r.Func.find({tags:["file-handler"]})).find(t=>{var n;return(null==t||null==(n=t.options)?void 0:n.ext)&&"string"==typeof t.options.ext&&t.options.ext.split(",").includes(e)});return{ext:e,handlerFunc:t}}).filter(e=>e.handlerFunc)},2684(e,t,n){n.d(t,{J:()=>Q});var r=n(4328),i=n(7389),o=n(6082),a=n(9832),l=n(2321),s=n(2232),u=n(4281),d=n(3912);n(8707);var c=n(3621),p=n.n(c),h=n(2611),m=n.n(h),f=n(6129),g=n.n(f),v=n(8986),b=n.n(v),y=n(838),_=n.n(y),w=n(3515),x=n.n(w),k=n(10),O={};O.styleTagTransform=x(),O.setAttributes=b(),O.insert=g().bind(null,"head"),O.domAPI=m(),O.insertStyleElement=_(),p()(k.A,O),k.A&&k.A.locals&&k.A.locals;var A=n(9446),S=n(1259),P=n(6788),E=n(7776);function C(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}function j(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){C(o,r,i,a,l,"next",e)}function l(e){C(o,r,i,a,l,"throw",e)}a(void 0)})}}let T="You can view this campaign but not change it",N="The campaign was not saved";class I{static submitFunctions(){return new Map([...new Set([...o.Func.find({meta:{role:s.yv}}),...o.Func.find({tags:[s.yv]})])].map(e=>{var t;return[null!=(t=e.friendlyName)?t:e.name,e]}))}render(){var e,t;let n=this.app,r=n.campaign,i=n.canEdit,o=I.submitFunctions(),l=n.submitParams,s=null!=(e=null==(t=[...o].find(([,e])=>e.name===(null==l?void 0:l.fName)&&(0,S.Vu)(e)===(null==l?void 0:l.package)))?void 0:t[0])?e:null,u=new a.lGe("Submit",{name:"submit"});u.build(()=>{var e;let t=new a.BZS,l=new a.lVW({quiet:!0,labelColumn:t});for(let e of this.summaryRows())l.add(e);let d=new a.lVW({labelColumn:t}),c=new a.Z9o({label:"Status",name:"status",value:null!=(e=null==r?void 0:r.status)?e:"",readOnly:!i,minChars:1,source:e=>j(function*(){let t=e.toLowerCase();return n.existingStatuses.filter(e=>(null==e?void 0:e.toLowerCase().includes(t))&&e.toLowerCase()!==t).slice(0,5)})()}),p=new a.oGE({label:"Submit function",name:"submit-function",items:[...o.keys()],value:s,nullable:!0,readOnly:!i});d.add(c),d.add(p),u.add((0,a.y4m)([l.root,d.root]));let h=()=>{var e;return(null==(e=c.peek())?void 0:e.trim())||(null==r?void 0:r.status)||"No Status"},m=()=>{var e,t;let r=null==(t=n.campaign)?void 0:t.template,i=null==r?void 0:r.submit,a=o.get(null!=(e=p.peek())?e:"");return r&&(r.submit=a?{fName:a.name,package:(0,S.Vu)(a)}:void 0),()=>r&&(r.submit=i)},f=(0,a.EWP)(()=>{var e;return o.get(null!=(e=p.value)?e:"")});u.addButton("Save",()=>j(function*(){let e=n.campaign;if(!e)return;let t=m(),r=e.status;e.status=h(),(yield n.saveCampaign())!==void 0?u.close():(e.status=r,t())})(),{disabled:i?null:T}),u.onOK(()=>j(function*(){let e=m(),t=!1;try{t=yield this.submit(h())}finally{t||e()}return t}).call(this),{text:"Submit",primary:!0}),u.okDisabled((0,a.EWP)(()=>i?void 0===f.value?"Choose a submit function":null:T)),u.status((0,a.EWP)(()=>{var e,t;return void 0===f.value?null:`Submits ${null!=(e=null==(t=n.dataFrame)?void 0:t.filter.trueCount)?e:0} molecules to ${f.value.friendlyName}`}))}),P.SZ.of(n.designView).show(u,{width:640})}summaryRows(){var e,t,n,i,l,u,d,c,p,h;let m=this.app,f=m.campaign,g=m.template,v=null!=(e=null!=(t=m.campaignId)?t:null==f?void 0:f.name)?e:"",b=(e,t)=>new a.ksK({label:e,value:String(null!=t?t:""),readOnly:!0}),y=this.editable(b("Name",null!=(n=null!=(i=null==f?void 0:f.friendlyName)?i:null==f?void 0:f.name)?n:v),"Edit Campaign Name",e=>j(function*(){if(!e.trim())return"Campaign name can not be empty";let t=m.campaign,n=t.friendlyName;return(t.friendlyName=e,(yield m.saveCampaign(!0))!==void 0)?null:(t.friendlyName=n,N)})()),_=this.editable(b("File Path",m.campaignFolder),"Edit file path",e=>j(function*(){if(!(yield(0,S.LD)(e)))return"Given folder does not exist";let t=m.filePath;return(m.filePath=`${e.replace(/\/$/,"")}/${v}/${s.mz}`,m.campaign&&(m.campaign.savePath=m.filePath),(yield m.saveCampaign(!0))!==void 0)?null:(m.filePath=t,m.campaign&&(m.campaign.savePath=t),N)})());_.addOptions((0,a.gbS)("arrow-to-bottom",()=>m.download(m.dataFrame,v||"Molecules"),{tooltip:s.Ru.download}));let w=[y,b("Code",v),b("Template",null!=(l=null==g?void 0:g.name)?l:"Molecules"),_];for(let[e,t]of((null==f?void 0:f.authorUserFriendlyName)&&w.push(b("Author",f.authorUserFriendlyName)),(null==f?void 0:f.lastModifiedUserName)&&w.push(b("Last Modified By",f.lastModifiedUserName)),(null==f?void 0:f.createDate)&&w.push(b("Create Date",f.createDate)),Object.entries(null!=(u=null==f?void 0:f.campaignFields)?u:m.campaignProps))){let n=null==g||null==(h=g.campaignFields)?void 0:h.find(t=>t.name===e);(null==n?void 0:n.type)==="Molecule"&&t?w.push(new a.WXT({label:e,value:t,render:e=>e?r.chem.drawMolecule(e,160,100):null})):w.push(b(e,(null==n?void 0:n.type)==="Date"?(0,E.gF)(t):t))}w.push(b("Number of Molecules",null!=(d=null==(p=m.dataFrame)?void 0:p.rowCount)?d:0));let x=null==g?void 0:g.compute,k=[(null==x?void 0:x.descriptors.enabled)?"Descriptors":"",...(null!=(c=null==x?void 0:x.functions)?c:[]).map(e=>{var t,n;return null!=(t=null==(n=o.Func.find({package:e.package,name:e.name})[0])?void 0:n.friendlyName)?t:e.name})];return w.push(b("Enrichment Methods",k.filter(e=>""!==e.trim()).join(", "))),w}editable(e,t,n){let r=(0,a.vPA)(e.peek()),i=(0,a.vPA)(!1),o=(0,a.vPA)(null);e.addValidator(e=>{var t;return(null==(t=o.value)?void 0:t.value)===e?o.value.message:null});let l=t=>{r.value=t,o.value=null,e.reset(t),i.value=!1},s=()=>j(function*(){var t;let r=null!=(t=e.peek())?t:"",i=yield n(r);null===i?l(r):(o.value={value:r,message:i},e.touch())})(),u=()=>{var e;return l(null!=(e=r.peek())?e:"")},d=(0,a.gbS)("pencil",()=>{i.value=!0,e.focus()},{tooltip:t}),c=(0,a.gbS)("check",s,{tooltip:"Save"}),p=(0,a.gbS)("times",u,{tooltip:"Cancel"});for(let t of[d,c,p])e.addOptions(t);return e.scope.listen(e.root,"keydown",e=>{let t=e.key;i.peek()&&("Enter"===t||"Escape"===t)&&(e.preventDefault(),e.stopPropagation(),"Enter"===t?s():u())}),e.effect(()=>{let t=i.value;e.readOnly=!t,d.hidden=t,c.hidden=!t,p.hidden=!t}),e}submitWithStatus(e){return j(function*(){var t;return yield this.submit((null==e?void 0:e.trim())||(null==(t=this.app.campaign)?void 0:t.status)||"Submitted")}).call(this)}submit(){return j(function*(e=(()=>{var e,t;return null!=(e=null==(t=this.app.campaign)?void 0:t.status)?e:"No Status"})()){let t=this.app,n=t.submitParams;if(!n)return r.shell.error("No submit function selected. Please select a function to submit the campaign."),!1;let i=o.Func.find({name:n.fName,package:n.package})[0];if(!i)return r.shell.error(`Function ${n.fName} not found.`),!1;let a=o.DataFrame.fromCsv(t.dataFrame.toCsv({filteredRowsOnly:!0}));yield i.apply({df:a,molecules:t.molColName});let l=t.campaign,s=l.status;return(l.status=e,(yield t.saveCampaign())===void 0)?(l.status=s,!1):(r.shell.info("Submitted successfully."),!0)}).apply(this,arguments)}constructor(e){this.app=e}}var D=n(5234),L=n(3854),z=n(8434),F=n(3330),B=n(4233),M=n(6882),R=n(4111),q=n(4958),H=n(532),W=n(9861),V=n(5048);function G(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}function U(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){G(o,r,i,a,l,"next",e)}function l(e){G(o,r,i,a,l,"throw",e)}a(void 0)})}}function K(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function Y(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}class Q extends D.C{get infoView(){return this._infoView}get submitView(){return this._submitView}get version(){var e,t;return null!=(e=null==(t=this._campaign)?void 0:t.version)?e:0}get designView(){var e;return null==(e=this._session)?void 0:e.view}get isSaving(){return this._saves>0}sessionOptions(){var e,t,n;let r=null!=(e=null==(t=this.campaign)?void 0:t.layout)?e:this.campaign||null==(n=this.template)?void 0:n.layoutViewState;return{entryColumn:this.molColName,editor:"Chem:editMoleculeCell",duplicateLabel:"Duplicate molecule",registerFirst:!0,designer:!0,layout:r}}prepareTable(e){}handleJoiningDataframe(e){return U(function*(){let t=D.C.moleculeColumns(e);if(0===t.length)return void r.shell.error("No molecule column found");let n=t[0].name;if(t.length>1){var i;let e=null!=(i=t.find(e=>{var t,n;return(null==e||null==(t=e.name)?void 0:t.toLowerCase())==="smiles"||(null==e||null==(n=e.name)?void 0:n.toLowerCase())==="molecule"}))?i:t[0],o=this._session,a=this.dataFrame;if(n=yield(0,M.WJ)(t.map(e=>e.name),e.name,null==o?void 0:o.host),(null==o?void 0:o.host.scope.isDisposed)||this.dataFrame!==a)return;if(!n)return void r.shell.info("Operation cancelled by user")}e.col(n)?(yield(0,W.f_)(this,e,{mode:"smiles",molColName:n,addNewRows:!0,runComputeOnNewRows:!0,clashStrategy:"overwrite"}),yield this.saveCampaign(!1)):r.shell.error("No molecule column found")}).call(this)}get submitParams(){var e,t,n,r;return null!=(e=null==(n=this.campaign)||null==(t=n.template)?void 0:t.submit)?e:null==(r=this.template)?void 0:r.submit}get stages(){var e,t,n,r,i;return null!=(e=null!=(t=null==(r=this.campaign)||null==(n=r.template)?void 0:n.stages)?t:null==(i=this.template)?void 0:i.stages)?e:[]}setStages(e){return U(function*(){var t;if(!this.campaign||!this.campaign.template||!this.template)return r.shell.error("Campaign or template is not set"),!1;if(!(null==e?void 0:e.length))return r.shell.error("Removing all stages is not allowed"),!1;let n=null==(t=this.dataFrame)?void 0:t.col(s.yJ);if(!n)return r.shell.error("No stage column found"),!1;let i=new Set(e),a=[...i];for(let t=0;t<this.dataFrame.rowCount;t++)i.has(n.get(t))||n.set(t,e[0],!1);return this.campaign.template.stages=a,this.template.stages=a,n.setTag(o.TAGS.CHOICES,JSON.stringify(a)),(yield this.saveCampaign(!0))!==void 0}).call(this)}refreshCampaign(){return U(function*(){this._campaignId&&this.template?this.isSaving?r.shell.info("Campaign is being saved. Please wait a moment and try again."):yield this.setTemplate(this.template,this._campaignId):r.shell.warning("No campaign to refresh")}).call(this)}openTicket(){return++this._opens}setTemplate(e,t){return U(function*(e,t,n=t?this._campaign:void 0,i=this.openTicket()){var a,l,u,d,c,p,h,m,f;let g,v;if(t){let e=`System.AppData/HitTriage/${this.appName}/campaigns`;for(let i of(v=null!=(u=null==n?void 0:n.savePath)?u:`${e}/${t}/${s.mz}`,(g=yield r.dapi.files.readCsv(v)).columns.names().filter(e=>e.startsWith("~"))))g.columns.remove(i);for(let[e,t]of Object.entries(null!=(d=null==n?void 0:n.columnSemTypes)?d:{})){let n=g.columns.byName(e);n&&t&&(n.semType=t)}for(let[e,t]of Object.entries(null!=(c=null==n?void 0:n.columnTypes)?c:{})){let n=g.columns.byName(e);if(n&&n.type!==t)try{g.changeColumnType(e,t)}catch(e){console.error(e)}}for(let[e,t]of Object.entries(null!=(p=null==n?void 0:n.columnTags)?p:{})){let n=g.columns.byName(e);if(n){for(let[e,r]of Object.entries(t))e&&r&&n.setTag(e,r);t[".category-order"]&&n.type===o.COLUMN_TYPE.STRING&&n.setCategoryOrder(n.getCategoryOrder())}}for(let e of g.columns.toList()){let t=e.getTag(o.TAGS.SOURCE_PRECISION);null!==t&&e.getTag(o.TAGS.FORMAT)===`0.${"0".repeat(parseInt(t,10))}`&&(e.tags.delete(o.TAGS.FORMAT),e.tags.delete(o.TAGS.SOURCE_PRECISION))}}else{t=yield this.getNewCampaignName(`${this.appName}/campaigns`,e.key);let n=yield(0,q.kY)();n.endsWith("/")||(n+="/"),v=`${n}${this.appName}/campaigns/${t}/${s.mz}`,g=this.newCampaignFrame(e)}if(!g)return r.shell.error("DataFrame is empty"),!1;let b=g.clone();yield g.meta.detectSemanticTypes();let y=null!=(a=null==(l=D.C.moleculeColumn(g))?void 0:l.name)?a:s.Lz,_=yield this.canEditCampaign(n);return n&&(yield(0,W.RA)(this,n.mergeConfig,{df:g,molColName:y,campaignId:t,stages:null!=(h=null!=(m=null==(f=n.template)?void 0:f.stages)?m:e.stages)?h:[]})),n&&(yield this.reComputeOnCampaignOpen(g,e,y)),i===this._opens&&(this.dataFrame&&this.dataFrame!==g&&this._closed.set(this.dataFrame,Y(K({},this.state()),{session:void 0})),this._campaign=n,n&&(n.template=e),this.template=e,this._campaignId=t,this._filePath=v,this.dataFrame=g,this._base=b,this._molColName=y,this.hasEditPermission=_,null!=this._submitView||(this._submitView=new I(this)),r.shell.windows.showHelp=!1,this.openView(),this.setBaseUrl(),(0,S.W6)(s.l2,t),!0)}).apply(this,arguments)}openView(){var e,t,n,i,o;null==(n=this._session)||n.view.close();let a=this.dataFrame;this.prepareTable(a),this._designViewName=null!=(e=null!=(t=null==(i=this.campaign)?void 0:i.friendlyName)?t:null==(o=this.campaign)?void 0:o.name)?e:this._designViewName;let l=r.shell.addTableView(a);l.name=this._designViewName,l.parentCall=this.parentCall,(0,V.tS)(l,this,"design");let s=this._session=(0,M.N2)(this,l,this.sessionOptions());s.host.own(()=>{this._session===s&&(this._session=void 0)})}get campaignId(){return this._campaignId}get designViewName(){return this._designViewName}set designViewName(e){this._designViewName=e,this.designView&&(this.designView.name=e)}get molColName(){var e,t,n;return null!=(e=this._molColName)?e:this._molColName=null!=(t=this.dataFrame&&(null==(n=D.C.moleculeColumn(this.dataFrame))?void 0:n.name))?t:s.Lz}get filePath(){return this._filePath}set filePath(e){this._filePath=e}get campaignFolder(){var e,t;let n=this._filePath.indexOf(null!=(e=this.campaignId)?e:null==(t=this._campaign)?void 0:t.name);return -1===n?this._filePath:this._filePath.substring(0,n-1)}get campaign(){return this._campaign}set campaign(e){this._campaign=e}startNewCampaign(e,t,n){return U(function*(){(yield this.setTemplate(e))&&(this.campaignProps=t,yield this.saveCampaign(!1,!0,{friendlyName:n}))}).call(this)}newCampaignFrame(e){return(0,R.R)(e)}cacheDuplicateVIDs(){var e;let t=null==(e=this.dataFrame)?void 0:e.col(s.Hz);if(!t){this._duplicateVidCache=void 0;return}let n=t.version,r=new Uint32Array(t.categories.length).fill(0),i=t.getRawData().subarray(0,t.length);i.forEach(e=>r[e]++),this._duplicateVidCache={colVersion:n,valueCounts:r,indexes:i}}get duplicateVidCache(){var e;let t=null==(e=this.dataFrame)?void 0:e.col(s.Hz);if(t)return this._duplicateVidCache&&t.version===this._duplicateVidCache.colVersion||this.cacheDuplicateVIDs(),this._duplicateVidCache}nextRun(e){var t;let n=(null!=(t=this._rowRuns.get(e))?t:0)+1;return this._rowRuns.set(e,n),n}isLatestRun(e,t){return this._rowRuns.get(e)===t}performSingleCellCalculations(e,t){return U(function*(){let n=this.template.compute;if(!t||!A._package.convertToSmiles(t))return;let r=this.dataFrame,i=this.nextRun(e),a=yield(0,d.H)([t],n.descriptors.args,n.functions,n.scripts,n.queries);if(this.isLatestRun(e,i)&&this.dataFrame===r){for(let t of a.columns.toList()){if(t.name===s.Lz)continue;let n=r.col(t.name);n?n.type!==t.type&&(0,W.h$)(n)&&(n.type!==o.COLUMN_TYPE.FLOAT||t.type!==o.COLUMN_TYPE.INT)&&r.changeColumnType(t.name,t.type):r.columns.addNew(t.name,t.type).semType=t.semType,r.col(t.name).set(e,t.get(0),!1)}r.fireValuesChanged(),this.saveCampaign(!1)}}).call(this)}registerRow(e){return U(function*(){var t;let n=this.dataFrame,r=null==n?void 0:n.col(this.molColName),i=null==r?void 0:r.get(e);if(!n||!i)return;let o=yield(0,H.Go)(i,this._campaignId,this.appName);o&&r.get(e)===i&&(null==(t=n.col(s.Hz))||t.set(e,o,!0))}).call(this)}reComputeOnCampaignOpen(e,t,n){return U(function*(){var i,o,a;let l=t.compute;if(!l)return;let u=(null!=(i=l.functions)?i:[]).filter(e=>e.rerunOnOpen),c=(null!=(o=l.scripts)?o:[]).filter(e=>e.rerunOnOpen),p=(null!=(a=l.queries)?a:[]).filter(e=>e.rerunOnOpen);if(!u.length&&!c.length&&!p.length)return;let h=e.col(n);if(h)try{let t=h.toList();for(let r of(yield(0,d.H)(t,[],u,c,p)).columns.toList()){if(r.name===n||r.name===s.Lz)continue;let t=e.col(r.name);t&&t.type===r.type||(t&&e.columns.remove(r.name),t=e.columns.addNew(r.name,r.type)),t.semType=r.semType;let i=Math.min(r.length,t.length);for(let e=0;e<i;e++)t.set(e,r.isNone(e)?null:r.get(e),!1)}e.fireValuesChanged()}catch(e){A._package.logger.error(e),r.shell.warning("Re-run on open failed for some functions; opening the campaign anyway.")}})()}editCompute(){let e=new a.lGe("Compute",{name:"compute"});e.build(()=>{var t,n,r;let i=(0,B.$)({functions:this.computeFunctions,value:null!=(t=null==(r=this.campaign)||null==(n=r.template)?void 0:n.compute)?t:this.template.compute,descriptors:z.dG,orderKey:s.HC,rerunOnOpen:z.Ji}),o=(0,a.vPA)(!1);i.ready.then(()=>o.value=!0),e.add(i),e.okDisabled((0,a.EWP)(()=>o.value?null:"Listing the descriptors…"),{footer:!0}),e.onOK(()=>void this.applyCompute(i.read()))}),this._session.host.show(e,{width:800,resizable:!0})}applyCompute(e){return U(function*(){var t,n,r,o,a;let l=this.template.compute,s=this.dataFrame;this.template.compute=e,this.campaign&&(this.campaign.template=this.template);let c=(e,t,n)=>Object.fromEntries(e.filter(e=>{let r=t.find(t=>n(t)===n(e));return!r||!Object.entries(e.args).every(([e,t])=>r.args[e]===t)}).map(e=>[n(e),e.args])),p=null==(t=this.designView)?void 0:t.grid;p&&i.setUpdateIndicator(p.root,!0);try{yield(0,d.E)({descriptors:e.descriptors.args.filter(e=>!l.descriptors.args.includes(e)),externals:c(e.functions,l.functions,e=>`${e.package}:${e.name}`),scripts:c(null!=(n=e.scripts)?n:[],null!=(r=l.scripts)?r:[],e=>`${u.Wn}:${e.name}:${e.id}`),queries:c(null!=(o=e.queries)?o:[],null!=(a=l.queries)?a:[],e=>`${u.ru}:${e.name}:${e.id}`)},s,this.molColName)}finally{p&&i.setUpdateIndicator(p.root,!1),this.dataFrame===s&&this.saveCampaign(!1)}}).call(this)}saveCampaign(e=!0,t=!1,n){let r=this.dataFrame;if(!r)return Promise.resolve(void 0);let i=this._nextSave;if((null==i?void 0:i.request.df)===r){var o,a,l;return(o=i.request).notify||(o.notify=e),(a=i.request).isCreating||(a.isCreating=t),null!=(l=i.request).customProps||(l.customProps=n),i.done}let s={df:r,notify:e,isCreating:t,customProps:n},u=this._saves>0;this._saves++;let d=()=>{var e;return(null==(e=this._nextSave)?void 0:e.request)===s&&(this._nextSave=void 0),this._write(s)},c=(u?this._queue.then(d,d):d()).finally(()=>this._saves--);return this._queue=c,u&&(this._nextSave={request:s,done:c}),c}state(){return{campaign:this._campaign,template:this.template,campaignId:this._campaignId,filePath:this._filePath,molColName:this.molColName,base:this._base,canEdit:this.hasEditPermission,fields:this.campaignProps,session:this._session}}recordSave(e,t){if(this.dataFrame!==e){let n=this._closed.get(e);n&&Object.assign(n,t);return}t.campaign&&(this._campaign=t.campaign),t.base&&(this._base=t.base),void 0!==t.filePath&&(this._filePath=t.filePath),void 0!==t.campaignId&&(this._campaignId=t.campaignId,(0,S.W6)(s.l2,t.campaignId))}_write(e){return U(function*({df:e,notify:t,isCreating:n,customProps:i}){var a,l,u,d;let c=()=>this.dataFrame===e,p=c()?this.state():this._closed.get(e);if(!p)return;if(!p.canEdit)return void r.shell.error("You do not have permission to modify this campaign");let h=(null==(l=p.session)?void 0:l.host.scope.isDisposed)?void 0:p.session,{campaignId:m,filePath:f}=p;null==h||h.waitingForLock(!0);try{if(p.campaign){let e=yield this.aquireAndWaitCampaignLock(m);if(!(null==e?void 0:e.aquired))throw new D.d("Could not acquire lock for campaign during 30 seconds")}else{let t=yield this.lockNewCampaignCode(m,p.template.key);t!==m&&(f=f.replace(`/${m}/${s.mz}`,`/${t}/${s.mz}`),m=t,this.recordSave(e,{campaignId:m,filePath:f}))}}catch(e){A._package.logger.error(e),r.shell.error(e instanceof D.d?"Failed to acquire campaign lock. Someone else might be editing the campaign. Please try again later.":`Failed to save the campaign: ${e instanceof Error?e.message:e}`);return}finally{null==h||h.waitingForLock(!1)}null==h||h.saving(!0);let g=Y(K({},p),{campaignId:m,filePath:f}),v=null!=(a=null==(u=p.campaign)?void 0:u.version)?a:0,b=!1;try{let a=yield this.mergeStaleSave(e,g),l=yield this.campaignToSave(e,g,i);void 0!==a&&(l.version=Math.max(v,a)+1);let s=e.columns.toList().filter(e=>!e.name.startsWith("~")&&!(0,W.h$)(e)),u=o.DataFrame.fromColumns(s).toCsv(),p=e.clone();yield r.dapi.files.writeAsText(f,u),b=!0;let y=h&&!h.host.scope.isDisposed?h.view:void 0,_=null==y?void 0:y.saveLayout();y&&!_?r.shell.warning("Layout cound not be saved"):_&&(l.layout=_.viewState),l.template=g.template,yield A._package.saveCampaignJson(this.appName,l),t&&r.shell.info("Campaign saved successfully."),!t&&n&&r.shell.info("Campaign created successfully.");let w=yield this.releaseCampaignLock(m);return this.recordSave(e,{campaign:l,base:p}),c()&&(this.designViewName=null!=(d=l.friendlyName)?d:l.name,null==h||h.saved(w)),l}catch(e){A._package.logger.error(e),yield(b?this.releaseCampaignLock(m):this.dropCampaignLock(m)).catch(e=>A._package.logger.error(e)),r.shell.error(`Failed to save the campaign: ${e instanceof Error?e.message:e}`);return}finally{null==h||h.saving(!1)}}).apply(this,arguments)}campaignToSave(e,t,n){return U(function*(){var i,a,l,u,d,c,p,h,m,f;let g=e.columns.toList().filter(e=>!e.name.startsWith("~")&&!(0,W.h$)(e)),v={},b={},y={};for(let e of g)v[e.name]=e.semType,b[e.name]=e.type,y[e.name]=Object.fromEntries(Array.from(e.tags).filter(([t])=>t!==W.Ee&&(e.name!==s.yJ||t!==o.TAGS.CHOICES)));let _=t.campaign,w=null!=(i=null==_?void 0:_.authorUserId)?i:r.shell.user.id,x=null!=(a=null==_?void 0:_.permissions)?a:yield U(function*(){try{let e=yield(0,q.fv)(),t={view:e.view.map(e=>e.id),edit:e.edit.map(e=>e.id)};return 0===t.edit.length&&(t.edit=[F.A.edit["0"]]),0===t.view.length&&(t.view=[F.A.view["0"]]),t}catch(e){r.shell.error("Failed to get default permissions"),console.error(e)}return F.A})(),k=w?null!=(l=null==_?void 0:_.authorUserFriendlyName)?l:null==(f=yield r.dapi.users.find(w))?void 0:f.friendlyName:void 0;return Y(K({},_),{name:t.campaignId,friendlyName:null!=(u=null!=(d=null==_?void 0:_.friendlyName)?d:null==n?void 0:n.friendlyName)?u:t.campaignId,templateName:t.template.name,status:null!=(c=null==_?void 0:_.status)?c:"In Progress",createDate:null!=(p=null==_?void 0:_.createDate)?p:(0,S.NF)(new Date),campaignFields:null!=(h=null==_?void 0:_.campaignFields)?h:t.fields,columnSemTypes:v,rowCount:e.rowCount,filteredRowCount:e.filter.trueCount,savePath:t.filePath,columnTypes:b,columnTags:y,version:(null!=(m=null==_?void 0:_.version)?m:0)+1,authorUserId:w,authorUserFriendlyName:k,lastModifiedUserName:r.shell.user.friendlyName,permissions:x})})()}mergeStaleSave(e,t){return U(function*(){var n,i,o,a;let l=`${this.appName}/campaigns/${t.campaignId}/${s.wS}`;if(!(yield A._package.files.exists(l)))return;let u=JSON.parse((yield A._package.files.readAsText(l))),d=null!=(n=u.version)?n:0;if(d<=(null!=(i=null==(a=t.campaign)?void 0:a.version)?i:0))return;let c=null!=(o=u.savePath)?o:t.filePath;return(yield r.dapi.files.exists(c))&&(0,W.Ed)(this,e,t.molColName,(yield r.dapi.files.readCsv(c)),t.base),d}).call(this)}constructor(e,t="Hit Design",n=e=>new l.x(e)){super(e,t),this._designViewName="Design",this._filePath=`System.AppData/HitTriage/${this.appName}/campaigns`,this._molColName=s.Lz,this.campaignProps={},this.existingStatuses=[],this.joining=0,this._saves=0,this._queue=Promise.resolve(),this._closed=new WeakMap,this._opens=0,this._rowRuns=new Map,this._infoView=n(this),this.multiView=new o.MultiView({viewFactories:{[this._infoView.name]:()=>this._infoView}}),this.multiView.helpUrl=this._infoView.helpUrl,this.multiView.subs.push(this.multiView.tabs.onTabChanged.subscribe(e=>{this.multiView.currentView instanceof L.om&&this.multiView.currentView.onActivated()})),this.multiView.subs.push(r.events.onCurrentViewChanged.subscribe(()=>{r.shell.v===this.mainView&&this.setBaseUrl()})),this.multiView.parentCall=e,(0,V.Nh)(this.multiView,this),this.mainView=this.multiView}}},2321(e,t,n){n.d(t,{x:()=>f});var r=n(4328),i=n(9446),o=n(2232),a=n(1259),l=n(3854),s=n(9832),u=n(6788),d=n(897);function c(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}var p=n(5210),h=n(5048);function m(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}class f extends l._w{header(){return{icon:i._package.webRoot+"/images/icons/hit-design-icon.png",learnMore:"https://github.com/datagrok-ai/public/blob/master/packages/HitTriage/README_HD.md",items:["Configure your own workflow using the template editor","Sketch molecules in the molecular spreadsheet","Annotate and share ideas with the team","Calculate different molecular properties","Save campaigns and continue from where you left off","Submit final selection to the function of your choice"]}}homeOptions(e){return{header:this.header(),catalog:this.catalogOptions("HD",e=>e.name,e=>this.app.existingStatuses=Array.from(new Set(e.map(e=>e.status).filter(e=>!!e)))),picker:{app:this.app.appName,preset:e,edit:e=>void(0,p._t)({app:this.app,preset:e,onCreated:e=>this.init(e)}),form:(e,{column:t})=>{var n;return n={template:e,column:t,nextCode:()=>this.app.getNewCampaignName(`${this.app.appName}/campaigns`,e.key),start:({fields:t,name:n})=>this.app.startNewCampaign(e,t,n)},(0,s.s9R)(()=>{let e=new s.lVW({labelColumn:n.column,maxWidth:d.k}),t=new s.ksK({label:"Campaign Name",name:"campaign-name",placeholder:"Optional",tooltipText:"New campaign name. If empty, campaign code will be used."});e.add(t);let r=n.template.campaignFields.map(e=>[e,function(e){let t={label:e.name,name:e.name,required:!0===e.required};if("Molecule"===e.type||"Molecule"===e.semtype)return(0,u.VR)(e.name,{name:e.name,required:!0===e.required});switch(e.type){case"Number":return new s.Q7x(t);case"Date":return new s.J3s(t);case"Boolean":return new s.d52({label:e.name,name:e.name});default:return new s.ksK(t)}}(e)]);for(let[,t]of r)e.add(t);let i=new s.Cqk(()=>n.nextCode(),{debounceMs:0}),a=(0,s.vPA)(!1),l=(0,s.EWP)(()=>r.filter(([e,t])=>e.required&&null!==t.validity.value).map(([e])=>e.name)),p=(0,s.x6e)(o.Ru.StartCampaign,()=>{var e;return(e=function*(){a.value=!0;try{var e;yield n.start({fields:function(e){let t={};for(let[n,r]of e){let e=r.peek();s.pde.isEmpty(e)||!1===e||(t[n.name]=e instanceof Date?{_value:e.getTime(),isUtc:!1,date:e.toISOString()}:e)}return t}(r),name:(null==(e=t.peek())?void 0:e.trim())||void 0})}finally{a.value=!1}},function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){c(o,r,i,a,l,"next",e)}function l(e){c(o,r,i,a,l,"throw",e)}a(void 0)})})()},{primary:!0,disabled:(0,s.EWP)(()=>a.value?"Starting…":e.problem.value)}),h=(0,s.EWP)(()=>l.value.length>0?`Fill in ${l.value.join(", ")} to start`:void 0===i.value?"":`Creates ${i.value} from ${n.template.name}`);return e.addButtons(t=>t.append(p,(0,s.Bsq)(e.shownProblem,h)),{align:"editors"}),{root:(0,s.y4m)([e.root]),form:e}},{name:"new-campaign"})}}}}checkCampaign(e){var t;return(t=function*(){var t,n;let s=this.app.openTicket();if(!(yield i._package.files.exists(`${this.app.appName}/campaigns/${e}/${o.wS}`)))return;let u=JSON.parse((yield i._package.files.readAsText(`${this.app.appName}/campaigns/${e}/${o.wS}`)));if(u.authorUserId&&u.permissions&&!(yield(0,a.sE)(u.authorUserId,u.permissions)))return void this.app.setBaseUrl();let d=`${this.app.appName}/templates/${u.templateName}.json`;if(!u.template&&!(yield i._package.files.exists(d)))throw new l.vq("its template is missing");let c=null!=(t=u.savePath)?t:`System.AppData/HitTriage/${this.app.appName}/campaigns/${e}/${o.mz}`;if(!(yield r.dapi.files.exists(c)))throw new l.vq(`its table ${c} is missing`);let p=null!=(n=u.template)?n:yield(0,a.PM)(d);if(yield this.app.setTemplate(p,e,u,s))return(0,a.W6)(o.ge,e),u.template=p,u},function(){var e=this,n=arguments;return new Promise(function(r,i){var o=t.apply(e,n);function a(e){m(o,r,i,a,l,"next",e)}function l(e){m(o,r,i,a,l,"throw",e)}a(void 0)})}).call(this)}constructor(e,t="README_HD.md"){super(e,t),this.name="Hit Design",this.aiDescription=(0,h.W9)(e.appName),this.onActivated(),this.init().then(()=>this.openLinked())}}},4025(e,t,n){n.d(t,{P:()=>S});var r=n(4328),i=n(7389),o=n(6082),a=n(6788),l=n(7070),s=n(3854);function u(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}class d extends s.om{render(){return i.empty(this.root),i.divV([i.h1("Summary"),i.div([i.tableFromMap(this.app.getSummary())])])}onActivated(){this.render()}submit(){var e;return(e=function*(){let e=this.app.submitParams;if(!e)return!1;let t=o.Func.find({name:e.fName,package:e.package})[0];if(!t)return r.shell.error(`Function ${e.fName} not found.`),!1;let n=o.DataFrame.fromCsv(this.app.dataFrame.toCsv({filteredRowsOnly:!0}));return yield t.apply({df:n,molecules:this.app.molColName}),this.app.campaign&&(this.app.campaign.status="Submitted"),yield this.app.saveCampaign("Submitted"),r.shell.info("Submitted successfully."),!0},function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){u(o,r,i,a,l,"next",e)}function l(e){u(o,r,i,a,l,"throw",e)}a(void 0)})}).call(this)}constructor(e){super(e),this.name="Submit"}}var c=n(2232),p=n(4281),h=n(1259),m=n(9446),f=n(8434),g=n(5234);function v(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}function b(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){v(o,r,i,a,l,"next",e)}function l(e){v(o,r,i,a,l,"throw",e)}a(void 0)})}}var y=n(3912),_=n(3330),w=n(5048);function x(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}function k(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){x(o,r,i,a,l,"next",e)}function l(e){x(o,r,i,a,l,"throw",e)}a(void 0)})}}function O(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function A(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}n(8707);class S extends g.C{get infoView(){return this._infoView}get submitView(){return this._submitView}get submitParams(){var e,t,n,r;return null!=(e=null==(n=this.campaign)||null==(t=n.template)?void 0:t.submit)?e:null==(r=this.template)?void 0:r.submit}prepareDataFrame(e){return k(function*(){})()}setTemplate(e,t,n,i,o){return k(function*(){var l,s,u,m,f,v,b,_,w,x,k,S,P,E,C,j,T,N,I;if(this._friendlyName=null!=o?o:null==(w=this._campaign)?void 0:w.friendlyName,(null==(x=this._pickView)?void 0:x.dataFrame)&&r.shell.closeTable(null==(k=this._pickView)?void 0:k.dataFrame),this._pickView=void 0,n?i&&(this._fileInputType=i.type,"File"===i.type?this.dataFrame=yield r.dapi.files.readCsv(i.query):this.dataFrame=yield r.functions.call(i.query)):(n=yield this.getNewCampaignName(`${this.appName}/campaigns`,e.key),(0,h.W6)(c.l2,n)),!this.dataFrame)return void console.error("Dataframe is empty.");if((null==(S=this._campaign)?void 0:S.columnSemTypes)&&Object.entries(this._campaign.columnSemTypes).forEach(([e,t])=>{let n=this.dataFrame.columns.byName(e);n&&n.semType!==t&&(n.semType=t)}),(null==(P=this._campaign)?void 0:P.columnTypes)&&Object.entries(this._campaign.columnTypes).forEach(([e,t])=>{let n=this.dataFrame.columns.byName(e);if(n&&n.type!==t)try{n.convertTo(t)}catch(e){console.error(e)}}),yield this.dataFrame.meta.detectSemanticTypes(),yield this.prepareDataFrame(e),this._molColName=null!=(l=null==(E=g.C.moleculeColumn(this.dataFrame))?void 0:E.name)?l:void 0,this._dfName=null!=(s=this.dataFrame.name)?s:null==i?void 0:i.query,this.dataFrame.name=null!=(u=null!=(m=this._dfName)?m:this.dataFrame.name)?u:"Molecules",this._campaignId=n,this.template=(null==(C=this.campaign)?void 0:C.template)?A(O({},this.campaign.template),{dataSourceType:e.dataSourceType,queryFunctionName:e.queryFunctionName}):e,this._campaignFilters=t,!t){let t={},n={},r={};e.compute.functions.forEach(e=>{t[`${e.package}:${e.name}`]=e.args}),null==(N=e.compute.scripts)||N.forEach(e=>{n[`${p.Wn}:${e.name}:${e.id}`]=e.args}),null==(I=e.compute.queries)||I.forEach(e=>{r[`${p.ru}:${e.name}:${e.id}`]=e.args}),yield(0,y.E)({descriptors:e.compute.descriptors.enabled?e.compute.descriptors.args:[],externals:t,scripts:n,queries:r},this.dataFrame,this._molColName)}this.campaign?yield this.setCanEdit(this.campaign):this.hasEditPermission=!0,this._filterViewName=`${this.appName} | ${null!=(f=null!=(v=this._friendlyName)?v:this._campaignId)?f:"Pick"}`;let D=r.shell.v,L=r.shell.addView(this.pickView);a.SZ.of(L).subscribe(r.events.onCurrentViewChanged,()=>{if((0,a.eg)(r.shell.v,L)){var e,t,n;r.shell.windows.showHelp=!1,this.setBaseUrl(),(0,h.W6)(c.l2,null!=(e=null!=(t=this._campaignId)?t:null==(n=this._campaign)?void 0:n.name)?e:"")}}),this._submitView=new d(this),this.setBaseUrl(),(0,h.W6)(c.l2,null!=(b=null!=(_=this._campaignId)?_:null==(j=this._campaign)?void 0:j.name)?b:""),null==(T=this._pickViewPromise)||T.then(()=>{var e,t;let{breadcrumbs:n,sub:i}=(0,h._S)(L,this.appName,null!=(e=null!=(t=this._friendlyName)?t:this._campaignId)?e:"Pick",()=>{r.shell.v=D,L.close(),i.unsubscribe()});this._crumbLabel=[...n.root.querySelectorAll(".ui-breadcrumbs-text-element")].pop()}),r.shell.windows.showHelp=!1}).call(this)}get filterSettings(){return this._campaignFilters}get campaignId(){return this._campaignId}get pickView(){let e=this.getFilterView();return(0,w.tS)(e,this,"pick"),this._pickView=e}get molColName(){var e,t;return null!=(e=this._molColName)?e:this._molColName=this.dataFrame&&(null==(t=g.C.moleculeColumn(this.dataFrame))?void 0:t.name)}get fileInputType(){return this._fileInputType}get campaign(){return this._campaign}set campaign(e){this._campaign=e}getFilterView(){let e=null;this._pickViewPromise=new Promise(t=>{e=t});let t=()=>k(function*(){(0,f.Fw)(this,e=>k(function*(){var t,n,r,i,o,a,l;let s=this.template.compute.descriptors.args,u=this.template.compute.functions,d=null!=(t=this.template.compute.scripts)?t:[],c=null!=(n=this.template.compute.queries)?n:[],h=e.descriptors,m={descriptors:{enabled:!!(null==e||null==(l=e.descriptors)?void 0:l.length),args:null!=(r=null==e?void 0:e.descriptors)?r:[]},functions:Object.entries(null!=(i=null==e?void 0:e.externals)?i:{}).map(([e,t])=>{let n=e.split(":");return{name:n[1],package:n[0],args:t}}),scripts:Object.entries(null!=(o=null==e?void 0:e.scripts)?o:{}).filter(([e,t])=>e.startsWith(p.Wn)&&3===e.split(":").length).map(([e,t])=>{var n,r;let i=e.split(":");return{name:null!=(n=i[1])?n:"",id:null!=(r=i[2])?r:"",args:t}}),queries:Object.entries(null!=(a=null==e?void 0:e.queries)?a:{}).filter(([e,t])=>e.startsWith(p.ru)&&3===e.split(":").length).map(([e,t])=>{var n,r;let i=e.split(":");return{name:null!=(n=i[1])?n:"",id:null!=(r=i[2])?r:"",args:t}})};this.template.compute=m;let f=h.filter(e=>!s.includes(e)),g=m.functions.filter(e=>{if(!u.some(t=>t.name===e.name&&t.package===e.package))return!0;let t=u.find(t=>t.name===e.name&&t.package===e.package);return!Object.entries(e.args).every(([e,n])=>t.args[e]===n)}),v=m.scripts.filter(e=>{if(!d.some(t=>t.id===e.id))return!0;let t=d.find(t=>t.id===e.id);return!Object.entries(e.args).every(([e,n])=>t.args[e]===n)}),b=m.queries.filter(e=>{if(!c.some(t=>t.id===e.id))return!0;let t=c.find(t=>t.id===e.id);return!Object.entries(e.args).every(([e,n])=>t.args[e]===n)}),_={};g.forEach(e=>{_[`${e.package}:${e.name}`]=e.args});let w={};v.forEach(e=>{w[`${p.Wn}:${e.name}:${e.id}`]=e.args});let x={};b.forEach(e=>{x[`${p.ru}:${e.name}:${e.id}`]=e.args}),yield(0,y.E)({descriptors:f,externals:_,scripts:w,queries:x},this.dataFrame,this._molColName),this.saveCampaign("In Progress",!1)}).call(this),()=>null,this.template,!0)}).call(this);this.dataFrame.col(c.FS)||this.dataFrame.columns.addNewBool(c.FS).init(!1);let n=o.TableView.create(this.dataFrame,!1),r=n.getRibbonPanels(),a=i.iconFA("wrench",t,"Calculate additional properties"),l=i.bigButton("Submit",()=>{var e;let t=null==(e=this._submitView)?void 0:e.render();if(t){let e=i.dialog("Submit");e.add(t),e.addButton("Save",()=>{this.saveCampaign(),e.close()}),e.addButton("Submit",()=>{var t;null==(t=this._submitView)||t.submit(),e.close()}),e.show()}}),s=i.iconFA("share",()=>k(function*(){var e,t;yield _.M.show(null==(e=this.campaign)?void 0:e.permissions,{subject:this.campaignId,author:null==(t=this.campaign)?void 0:t.authorUserFriendlyName,save:e=>(this.campaign.permissions=e,this.saveCampaign(void 0,!0))})}).call(this),"Edit permissions");l.classList.add("hit-design-submit-button");let u=(0,h.WP)(r);return r.push([a,...this.hasEditPermission?[s]:[],...u?[]:[l]]),r.some(e=>{var t;let n=null!=(t=null==e?void 0:e.findIndex(e=>{var t;return(null==e||null==(t=e.textContent)?void 0:t.toLowerCase())==="save"}))?t:-1;return -1!==n&&(e.splice(n,1),!0)}),r=r.filter(e=>{var t;return(null!=(t=null==e?void 0:e.length)?t:0)>0}),n.setRibbonPanels(r),n.name=this._filterViewName,setTimeout(()=>k(function*(){var t,r,i,a;n._onAdded(),yield new Promise(e=>setTimeout(e,1e3));let l=n.filters((null==(r=this._campaignFilters)?void 0:r.length)?{filters:this._campaignFilters}:void 0),s=null!=(t=null==(i=this._campaign)?void 0:i.layout)?t:null==(a=this.template)?void 0:a.layoutViewState;if(s)try{let e=o.ViewLayout.fromViewState(s);n.loadLayout(e)}catch(e){console.error(e)}n.dataFrame.onFilterChanged.subscribe(e=>{this._filterDescriptions=Array.from(n.dataFrame.rows.filters),this._campaignFilters=l.getOptions().look.filters}),setTimeout(()=>{this._filterDescriptions=Array.from(n.dataFrame.rows.filters),this._campaignFilters=l.getOptions().look.filters},300),e&&e()}).call(this),300),n.parentCall=this.parentCall,n}getSummary(){var e,t,n,r,o,a,l;let s=null!=(e=null==(o=this.campaign)?void 0:o.campaignFields)?e:this.campaignProps;return A(O({Template:null!=(t=null==(a=this.template)?void 0:a.name)?t:"Molecules","File path":i.divH([i.link(null!=(n=this._dfName)?n:"-",()=>this.download(this.dataFrame,"molecules"),c.Ru.download)],{style:{alignItems:"center"}})},s),{"Number of molecules":this.dataFrame.rowCount.toString(),"Enrichment methods":[this.template.compute.descriptors.enabled?"descriptors":"",...this.template.compute.functions.map(e=>e.name)].filter(e=>e&&""!==e.trim()).join(", "),Filters:this._filterDescriptions.join(", "),"Result Molecules":i.divH([i.link(null!=(r=null==(l=this.dataFrame)?void 0:l.filter.trueCount.toString())?r:"0",()=>{this.download(this.dataFrame,"hits",!0)},c.Ru.download)],{style:{alignItems:"center"}})})}saveCampaign(e,t=!0){return k(function*(){let n;if(this.campaign)return yield this.writeCampaign(this.campaignId,e,t);try{n=yield this.lockNewCampaignCode(this.campaignId,this.template.key)}catch(e){m._package.logger.error(e),r.shell.error("Failed to acquire campaign lock. Someone else might be editing the campaign. Please try again later.");return}n!==this._campaignId&&(this._campaignId=n,(0,h.W6)(c.l2,n),!this._friendlyName&&(this._pickView&&(this._pickView.name=`${this.appName} | ${n}`),this._crumbLabel&&(this._crumbLabel.textContent=n)));try{return yield this.writeCampaign(n,e,t)}finally{yield this.dropCampaignLock(n)}}).call(this)}writeCampaign(e,t,n=!0){return k(function*(){var l,s,u,d,p,f,g,v,y,w,x,k,S,P,E;let C=this.filterSettings,j=this.template.name,T=this.dataFrame,N=`System:AppData/HitTriage/${this.appName}/campaigns/${e}/`,I=null!=e?e:yield b(function*(){return new Promise(t=>b(function*(){let n=i.input.string("Campaign name",{value:""});i.dialog("Save Campaign").add(i.div(n.root)).onOK(function(){n.value&&""!==n.value?t(n.value):t(e)}).show()})())})(),D=a.OD.listedColumns(T),L={},z={};for(let e of D)L[e.name]=e.semType,z[e.name]=e.type;let F=null!=(l=null==(v=this.campaign)?void 0:v.authorUserId)?l:r.shell.user.id,B=null!=(s=null==(y=this.campaign)?void 0:y.permissions)?s:_.A,M=F?null!=(u=null==(w=this.campaign)?void 0:w.authorUserFriendlyName)?u:null==(x=yield r.dapi.users.find(F))?void 0:x.friendlyName:void 0,R=A(O({},this.campaign),{name:I,friendlyName:null!=(d=this._friendlyName)?d:null==(k=this.campaign)?void 0:k.friendlyName,templateName:j,filters:null!=C?C:[],ingest:{type:"File",query:`${N}${c.mz}`,molColName:this.molColName},status:null!=(p=null!=t?t:null==(S=this.campaign)?void 0:S.status)?p:"In Progress",createDate:null!=(f=null==(P=this.campaign)?void 0:P.createDate)?f:(0,h.NF)(new Date),campaignFields:null!=(g=null==(E=this.campaign)?void 0:E.campaignFields)?g:this.campaignProps,columnSemTypes:L,rowCount:T.rowCount,filteredRowCount:T.filter.trueCount,template:this.template,columnTypes:z,authorUserId:F,authorUserFriendlyName:M,lastModifiedUserName:r.shell.user.friendlyName,permissions:B});if(!this.hasEditPermission)return this.campaign=R,r.shell.error("You do not have permission to modify this campaign"),R;let q=o.DataFrame.fromColumns(D).toCsv();yield m._package.files.writeAsText(`${this.appName}/campaigns/${e}/${c.mz}`,q);let H=this._pickView.saveLayout();return H?R.layout=H.viewState:r.shell.warning("Layout cound not be saved"),yield m._package.saveCampaignJson(this.appName,R),this.campaign=R,n&&r.shell.info("Campaign saved successfully."),R}).call(this)}constructor(e,t="Hit Triage",n=e=>new l.u(e)){super(e,t),this._filterViewName="Hit Triage | Pick",this._filterDescriptions=[],this.campaignProps={},this._pickViewPromise=null,this._infoView=n(this),this.multiView=new o.MultiView({viewFactories:{[this._infoView.name]:()=>this._infoView}}),this.multiView.helpUrl=this._infoView.helpUrl,this.multiView.tabs.onTabChanged.subscribe(e=>{this.multiView.currentView instanceof s.om&&this.multiView.currentView.onActivated()}),this.multiView.parentCall=e,(0,w.Nh)(this.multiView,this)}}},7070(e,t,n){n.d(t,{u:()=>f});var r=n(4328),i=n(7389),o=n(6082),a=n(9446),l=n(2232);n(8707);var s=n(1259),u=n(4394),d=n(5372),c=n(3854),p=n(5048);function h(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}function m(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){h(o,r,i,a,l,"next",e)}function l(e){h(o,r,i,a,l,"throw",e)}a(void 0)})}}class f extends c._w{header(){return{icon:a._package.webRoot+"/images/icons/hit-triage-icon.png",learnMore:"https://github.com/datagrok-ai/public/blob/master/packages/HitTriage/README_HT.md",items:["Configure your own workflow using the template editor.","Calculate different molecular properties.","Filter molecules using different criteria.","Submit processed dataframe to the function of your choice.","Save campaigns and continue any time from where you left off."]}}getTemplatesFolder(){return`${this.app.appName}/templates`}getDataSourceTag(){return l.dY}getDataSourceFunctionsMap(){return this.dataSourceFunctionsMap}homeOptions(e){return{header:this.header(),catalog:this.catalogOptions("HT",e=>{var t;return null!=(t=e.friendlyName)?t:e.name}),picker:{app:this.app.appName,preset:e,edit:e=>void this.createNewTemplate(e),form:(e,t)=>this.getNewCampaignForm(e,t)}}}checkCampaign(e){return m(function*(){if(!(yield a._package.files.exists(`${this.app.appName}/campaigns/${e}/${l.wS}`)))return;let t=JSON.parse((yield a._package.files.readAsText(`${this.app.appName}/campaigns/${e}/${l.wS}`)));if(t.authorUserId&&t.permissions&&!(yield(0,s.sE)(t.authorUserId,t.permissions)))return void this.app.setBaseUrl();let n=`${this.getTemplatesFolder()}/${t.templateName}.json`;if(!(yield a._package.files.exists(n)))throw new c.vq("its template is missing");if("File"===t.ingest.type&&!(yield r.dapi.files.exists(t.ingest.query)))throw new c.vq(`its table ${t.ingest.query} is missing`);let i=yield(0,s.PM)(n);return this.app.campaign=t,yield this.app.setTemplate(i,t.filters,e,t.ingest),(0,s.W6)(l.l2,e),t}).call(this)}getNewCampaignForm(e,{owner:t,column:n}){return(0,u.b)(e,this.getDataSourceFunctionsMap(),this.getDataSourceTag(),{owner:t,column:n,start:t=>this.startCampaign(e,t)})}startCampaign(e,t){return m(function*(){this.app.campaign=void 0,this.app.dataFrame=t.df,this.app._fileInputType=t.type,yield this.app.setTemplate(e,void 0,void 0,void 0,t.friendlyName),this.app.campaignProps=t.campaignProps;let n=yield this.app.saveCampaign(void 0,!1);e.layoutViewState&&n&&(n.layout=e.layoutViewState)}).call(this)}createNewTemplate(e){return m(function*(){i.setUpdateIndicator(this.root,!0);try{let t=yield(0,d.Nz)(this.app,this.getDataSourceFunctionsMap(),e);this.showTemplateEditor(t)}finally{i.setUpdateIndicator(this.root,!1)}}).call(this)}showTemplateEditor(e){let t=new o.ViewBase,n=r.shell.v;t.name="New Template",t.root.appendChild(e.root),t.parentCall=this.app.parentCall,r.shell.addView(t),t.path=new URL(this.app.baseUrl).pathname+"/new-template",t.parentView=n;let{sub:i}=(0,s._S)(r.shell.v,this.app.appName,l.Ru.createNewTemplate,()=>{r.shell.v=n,t.close()});e.template.then(e=>m(function*(){yield this.init(e),t.close(),(0,s.pl)(t),r.shell.v=n,i.unsubscribe()}).call(this)),e.cancelPromise.then(()=>{i.unsubscribe(),t.close(),r.shell.v=n})}constructor(e){super(e,"README_HT.md"),this.dataSourceFunctionsMap={},this.name="Hit Triage",this.aiDescription=(0,p.W9)(e.appName),this.onActivated(),this.init().then(()=>this.openLinked())}}},980(e,t,n){n.d(t,{z:()=>g});var r=n(4328),i=n(6082),o=n(4025),a=n(7389),l=n(9446),s=n(2232),u=n(7070),d=n(4394),c=n(5101);function p(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}class h extends u.u{header(){return{icon:l._package.webRoot+"/images/icons/hit-triage-icon.png",learnMore:"https://github.com/datagrok-ai/public/blob/master/packages/HitTriage/README_HT.md",items:["Configure your own workflow using the template editor","Load sequence datasets and auto-convert to molecules","Calculate different molecular properties","Filter sequences using different criteria","Save campaigns and continue any time from where you left off","Submit final selection to the function of your choice"]}}getDataSourceTag(){return s.b1}getDataSourceFunctionsMap(){return this.pepTriageDataSourceFunctionsMap}getNewCampaignForm(e,{owner:t,column:n}){var r,i;let o=a.input.string("Sequence Column",{value:null!=(r=e.sequenceColumnName)?r:"",nullable:!1});o.setTooltip("Name of the sequence column in the dataset");let l=a.input.string("Molecule Column",{value:null!=(i=e.moleculeColumnName)?i:"",nullable:!0});return l.setTooltip("Name of the molecule column (leave empty to auto-convert from sequences)"),(0,d.b)(e,this.getDataSourceFunctionsMap(),this.getDataSourceTag(),{owner:t,column:n,start:t=>this.startCampaign(e,t),extraFormElements:[o.root,l.root],getExtraData:()=>{var t,n;return{sequenceColumnName:(null==(t=o.value)?void 0:t.trim())||e.sequenceColumnName,moleculeColumnName:(null==(n=l.value)?void 0:n.trim())||void 0}}})}startCampaign(e,t){var n,r,i,o,a,l;return super.startCampaign((a=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},e),l=l={sequenceColumnName:null!=(n=null==(i=t.extraData)?void 0:i.sequenceColumnName)?n:e.sequenceColumnName,moleculeColumnName:null!=(r=null==(o=t.extraData)?void 0:o.moleculeColumnName)?r:e.moleculeColumnName},Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(l)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(l)).forEach(function(e){Object.defineProperty(a,e,Object.getOwnPropertyDescriptor(l,e))}),a),t)}createNewTemplate(e){var t;return(t=function*(){a.setUpdateIndicator(this.root,!0);try{this.showTemplateEditor((yield(0,c.W)(this.app,this.getDataSourceFunctionsMap(),e)))}finally{a.setUpdateIndicator(this.root,!1)}},function(){var e=this,n=arguments;return new Promise(function(r,i){var o=t.apply(e,n);function a(e){p(o,r,i,a,l,"next",e)}function l(e){p(o,r,i,a,l,"throw",e)}a(void 0)})}).call(this)}constructor(e){super(e),this.pepTriageDataSourceFunctionsMap={},this.name="PepTriage"}}function m(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}function f(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}class g extends o.P{get seqColName(){return this._seqColName}prepareDataFrame(e){var t;return(t=function*(){if(!this.dataFrame)return;yield this.dataFrame.meta.detectSemanticTypes();let t=e.sequenceColumnName,n=t?this.dataFrame.col(t):null;if(n||(n=this.dataFrame.columns.bySemType(i.SEMTYPE.MACROMOLECULE)),!n)throw Error(`Sequence column '${null!=t?t:"Macromolecule"}' not found in the dataset. Make sure the data contains a column with sequences.`);this._seqColName=n.name;let a=i.TaskBarProgressIndicator.create("Initializing sequences...");try{var s,u;let t=yield(s=function*(){let e=i.Func.find({package:"Bio",name:"getSeqHelper"});if(0===e.length)throw Error("Package 'Bio' must be installed for SeqHelper.");return(yield e[0].prepare().call()).getOutputParamValue()},function(){var e=this,t=arguments;return new Promise(function(n,r){var i=s.apply(e,t);function o(e){m(i,n,r,o,a,"next",e)}function a(e){m(i,n,r,o,a,"throw",e)}o(void 0)})})(),l=t.getSeqHandler(n);yield l.refinerPromise,t.getSeqHandler(n);let d=e.moleculeColumnName,c=d?this.dataFrame.col(d):null;if((c||(c=o.P.moleculeColumn(this.dataFrame)),!c)&&(a.update(50,"Converting sequences to molecules..."),yield r.functions.call("Bio:toAtomicLevel",{table:this.dataFrame,seqCol:n,nonlinear:!0}),yield this.dataFrame.meta.detectSemanticTypes(),!(c=null!=(u=o.P.moleculeColumns(this.dataFrame).find(e=>e.name.toLowerCase().includes(n.name.toLowerCase())))?u:null)))return void r.shell.warning("Failed to convert sequences to molecules. Calculations may not work.");this.reorderColumns(n.name,c.name)}catch(e){l._package.logger.error(e),r.shell.error("Error preparing sequence data: "+(e instanceof Error?e.message:e))}finally{a.close()}},function(){var e=this,n=arguments;return new Promise(function(r,i){var o=t.apply(e,n);function a(e){f(o,r,i,a,l,"next",e)}function l(e){f(o,r,i,a,l,"throw",e)}a(void 0)})}).call(this)}reorderColumns(e,t){if(!this.dataFrame)return;let n=this.dataFrame.col(e),r=this.dataFrame.col(t);n&&(this.dataFrame.columns.remove(e),this.dataFrame.columns.insert(n,0)),r&&(this.dataFrame.columns.remove(t),this.dataFrame.columns.insert(r,1))}constructor(e){super(e,"PepTriage",e=>new h(e))}}},1428(e,t,n){n.d(t,{r:()=>p});var r=n(4328),i=n(6082),o=n(2232),a=n(2684),l=n(9446),s=n(2321);class u extends s.x{header(){return{icon:l._package.webRoot+"/images/icons/pepti-hit-icon.png",learnMore:"https://github.com/datagrok-ai/public/blob/master/packages/HitTriage/README_PH.md",items:["Configure your own workflow using the template editor","Sketch Helm sequences in the spreadsheet","Annotate and share ideas with the team","Convert to molecular form and calculate different properties","Save campaigns and continue from where you left off","Submit final selection to the function of your choice"]}}constructor(e){super(e,"README_PH.md"),this.name="PeptiHit"}}var d=n(4111);function c(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}class p extends a.J{newCampaignFrame(e){return(0,d.R)(e,!0)}prepareTable(e){var t,n;this._helmColName=null!=(t=null==(n=e.columns.bySemType(i.SEMTYPE.MACROMOLECULE))?void 0:n.name)?t:o.Zf;let r=e.col(this._helmColName);if(!r)throw Error("No helm column found");r.semType=i.SEMTYPE.MACROMOLECULE,r.setTag("units","helm"),r.setTag(".alphabetIsMultichar","true"),r.setTag("cell.renderer","helm")}sessionOptions(){var e,t,n;let r=null!=(e=null==(t=this.campaign)?void 0:t.layout)?e:null==(n=this.template)?void 0:n.layoutViewState;return{entryColumn:this.helmColName,editor:"Helm:editMoleculeCell",duplicateLabel:"Duplicate Sequence",registerFirst:!1,designer:!1,layout:r}}get helmColName(){var e,t;return null!=(e=this._helmColName)?e:null==(t=this.dataFrame.columns.bySemType(i.SEMTYPE.MACROMOLECULE))?void 0:t.name}performSingleCellCalculations(e,t){var n,o=this,a=()=>super.performSingleCellCalculations;return(n=function*(){try{var n;if(!t)throw Error("No cell value provided");let l=this.dataFrame,s=this.nextRun(e),u=i.Column.fromStrings(this.helmColName,[t]),d=i.DataFrame.fromColumns([u]);if(u.semType=i.SEMTYPE.MACROMOLECULE,u.setTag("units","helm"),u.setTag(".alphabetIsMultichar","true"),yield r.functions.call("Bio:toAtomicLevel",{table:d,seqCol:u,nonlinear:!0}),!this.isLatestRun(e,s)||this.dataFrame!==l)return;let c=d.columns.names().find(e=>e.toLowerCase()!==this.helmColName.toLowerCase()),p=c?null==(n=d.col(c))?void 0:n.get(0):null;if(!p)throw Error("Failed to convert sequence to atomic level");l.set(this.molColName,e,p),yield a().call(o,e,p)}catch(e){console.error(e)}},function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(e){c(o,r,i,a,l,"next",e)}function l(e){c(o,r,i,a,l,"throw",e)}a(void 0)})}).call(this)}constructor(e){super(e,"PeptiHit",e=>new u(e)),this._helmColName=o.Zf}}},7776(e,t,n){n.d(t,{gF:()=>_,id:()=>b});var r=n(4328),i=n(6082),o=n(9832),a=n(9446),l=n(6287),s=n(2232),u=n(1259),d=n(3330);function c(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}function p(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){c(o,r,i,a,l,"next",e)}function l(e){c(o,r,i,a,l,"throw",e)}a(void 0)})}}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}let m={HD:{keys:{grouping:s.Lk,columns:s.cx,sorting:s.mY,collapsed:s.FD},getters:s.WC,defaultColumns:s.rU,counts:["Molecules"],saveLog:!0},HT:{keys:{grouping:s.bO,columns:s.IV,sorting:s.Iz,collapsed:s.XA},getters:s.Gs,defaultColumns:s.HE,counts:["Total","Selected"],saveLog:!1}},f="Accordion:Hit-Design-campaigns-group-",g="campaignFields.",v=new Intl.Collator(void 0,{numeric:!0});function b(e){let t=m[e.family],n=(0,o.vPA)([]),c=(0,o.vPA)(new Map),b=new WeakMap,O=new Map,A=!1,S=0,P=new o.Cqk(()=>p(function*(){var r,o,h;let m=A;A=!1;let f=++S,[g,v]=yield Promise.all([a._package.loadCampaigns(e.app,e.deleted,m),p(function*(){let n=e.app,r=e=>(a._package.logger.error(e),null),[i,o]=yield Promise.all([a._package.files.list(`${n}/campaigns`,!0).catch(r),t.saveLog?l.P.getLastModifiedAll(n).catch(r):null]),u=new Map;for(let e of null!=i?i:[]){var d;let t=null==(d=e.updatedOn)?void 0:d.valueOf();e.name===s.wS&&void 0!==t&&u.set(e.path.split("/").slice(-2)[0],t)}if(o){let e=o.col("campaign_id"),t=o.col("updated_at");for(let n=0;n<o.rowCount;n++)t.isNone(n)||u.set(e.get(n),t.get(n).valueOf())}return u})()]),b=Object.values(g);return f!==S||(O=v,n.value=b,o=b,h=f,p(function*(){let e=i.User.current().id,t=new Map,n=yield Promise.all(o.map(n=>p(function*(){var r,i;return[n.name,(yield(0,u.Zg)(null!=(r=n.authorUserId)?r:e,null!=(i=n.permissions)?i:d.A,t))]})()));h===S&&(c.value=new Map(n))})(),null==(r=e.onLoaded)||r.call(e,b)),b})(),{debounceMs:0}),E=(0,o.EWP)(()=>JSON.stringify(x(n.value))),C=new o.Gwp({name:"campaigns",label:"Campaigns",items:P,keyOf:e=>e.name,columns:(0,o.EWP)(()=>{var t;return E.value,function(e,t,n,r=!1){let{getters:i,counts:a}=m[e],l=[{name:"Name",value:i.Name,pinned:!0,link:"Continue Campaign",maxWidth:r?"200px":"320px"}];for(let e of Object.keys(i).filter(e=>"Name"!==e))if(l.push(a.includes(e)?{name:e,value:t=>Number(i[e](t)),align:"right",description:"Selected"===e?"Rows passing the saved filters":void 0}:"Status"===e?{name:e,value:i[e],render:e=>{var t;return(t=e.status)?(0,o._Qr)([(0,o.Omf)(function(e){let t=e.toLowerCase();return t.includes("progress")?"accent":t.includes("submitted")||t.includes("completed")?"success":t.includes("hold")||t.includes("queued")||t.includes("awaiting")?"warning":"default"}(t)),(0,o.Lnh)(t)],{gap:"s"}):""}}:{name:e,value:i[e]}),e===s.Pf){let e=e=>n(e)>0?new Date(n(e)):null;l.push({name:"Last Modified",value:e,type:"date",render:t=>w(e(t))})}for(let[e,n]of x(t))l.push({name:g+e,header:e,value:t=>{var n;return y(null==(n=t.campaignFields)?void 0:n[e])},render:t=>{var n;return _(null==(n=t.campaignFields)?void 0:n[e])},menuGroup:"Campaign Fields",menuDetail:n,maxWidth:"240px"});return l}(e.family,n.peek(),e=>T(e),null==(t=e.narrow)?void 0:t.value)}),groupings:(0,o.EWP)(()=>(E.value,function(e){let t=e=>{var t,n,r;return(null!=(t=null!=(n=null==(r=e.template)?void 0:r.name)?n:e.templateName)?t:"").trim()},n=[{name:s.YG.Template,key:e=>t(e).toLowerCase(),groupLabel:(e,n)=>t(n)},{name:s.YG.Status,key:e=>e.status},{name:s.YG.Author,key:e=>e.authorUserFriendlyName},{name:s.YG.LastModifiedUser,label:s.Pf,key:e=>e.lastModifiedUserName}];for(let[t,r]of x(e))n.push({name:g+t,label:t,key:e=>{var n;return y(null==(n=e.campaignFields)?void 0:n[t])},menuGroup:"Campaign Fields",menuDetail:r,groupLabel:(e,n)=>{var r;return _(null==(r=n.campaignFields)?void 0:r[t])}});return n}(n.peek()))),defaultColumns:t.defaultColumns,defaultOrder:(e,t)=>T(t)-T(e)||v.compare(e.name,t.name),emptyGroupLabel:s.Ru.noInformation,actionsVisible:"always",access:e=>N(e),viewOnly:{icon:"eye",tooltip:"View only: you can open this campaign but not change it"},actions:t=>{var n;return n=t,[{text:"Manage campaign permissions",icon:"users",requires:"edit",run:()=>{var t;t=n,p(function*(){yield d.M.show(t.permissions,{subject:k(t),author:t.authorUserFriendlyName,save:n=>p(function*(){let o=e.app,u=i.User.current(),d=yield l.P.acquireCampaignLock(o,t.name,u.friendlyName||u.name);if(!(null==d?void 0:d.rowCount))throw Error("Another session is saving this campaign. Try again in a moment.");try{var c,p,m;let e=JSON.parse((yield a._package.files.readAsText(`${o}/campaigns/${t.name}/${s.wS}`)));yield a._package.saveCampaignJson(o,(p=h({},e),m={permissions:n,authorUserId:null!=(c=e.authorUserId)?c:u.id},m=null!=m?m:{},Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(m)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(m)).forEach(function(e){Object.defineProperty(p,e,Object.getOwnPropertyDescriptor(m,e))}),p))}finally{yield l.P.releaseCampaignLock(o,t.name).catch(e=>a._package.logger.error(e))}r.shell.info("Permissions updated for campaign "+e.label(t)),yield j()})()})})()}},{text:"Delete campaign",icon:"trash-alt",requires:"edit",destructive:!0,run:()=>{var t;t=n,p(function*(){var n;(yield(0,o.ZDJ)({title:"Delete campaign",name:"delete-campaign",confirmText:"Delete",destructive:!0,message:`Are you sure you want to delete campaign ${k(t,!0)}?`,detail:`Its ${(0,o.LSg)(null!=(n=t.rowCount)?n:0,"molecule","molecules")} and its layout are removed for everyone. This cannot be undone.`,onConfirm:()=>e.remove(t.name)}))&&(yield j(),r.shell.info(`Campaign ${e.label(t)} deleted`))})()}}]},onActivate:t=>e.open(t.name),empty:"No campaigns yet. Start the first one under New Campaign.",footer:e=>{let t=e.filter(e=>"view"===N(e).value).length;return(0,o.LSg)(e.length,"campaign","campaigns")+(t>0?` \xb7 ${t} view only`:"")},refresh:()=>j(!0),persist:function(e){let{keys:t,defaultColumns:n}=m[e],r=e=>{try{var t;return JSON.parse(null!=(t=localStorage.getItem(e))?t:"null")}catch(e){return null}},i=e=>{var n;let r=o.xBQ.parse(e.sort);return[[t.grouping,null!=(n=e.groupBy)?n:s.YG.None],[t.columns,JSON.stringify(e.columns)],[t.sorting,r?JSON.stringify({columnName:r.column,ascending:!r.descending}):null],[t.collapsed,JSON.stringify(e.collapsed)]]},a=new Map;return{load:()=>{var e,l,u;let d=localStorage.getItem(t.grouping),c=r(t.sorting),p={groupBy:d&&d!==s.YG.None?d:null,sort:"string"==typeof(null==c?void 0:c.columnName)&&"boolean"==typeof c.ascending?o.xBQ.of(c.columnName,!c.ascending):""},m=r(t.columns);for(let[o,s]of(Array.isArray(m)&&m.every(e=>"string"==typeof e)&&(p.columns=m),p.collapsed=null!=(e=r(t.collapsed))?e:null===(u=null!=(l=p.groupBy)?l:null)?{}:{[u]:Object.keys(localStorage).filter(e=>e.startsWith(f)).filter(e=>{try{var t;return(null==(t=JSON.parse(localStorage.getItem(e)))?void 0:t[e.slice(f.length)])===!1}catch(e){return!1}}).map(e=>e.slice(f.length))},i(h({columns:n},p))))a.set(o,s);return p},save:e=>{for(let[t,n]of i(e))a.has(t)&&a.get(t)===n||(a.set(t,n),null===n?localStorage.removeItem(t):localStorage.setItem(t,n))}}}(e.family)});return{table:C,chrome:()=>C.chrome({columns:"Edit visible columns in campaigns table",group:e=>`Group Campaigns. Current: ${e}`,refresh:"Refresh campaigns table"}),reload:j};function j(e=!1){return A||(A=e),P.refresh()}function T(e){var t;return null!=(t=O.get(e.name))?t:Date.parse(e.createDate)||0}function N(e){let t=b.get(e);return void 0===t&&(t=(0,o.EWP)(()=>{let t=c.value.get(e.name);return void 0===t?"pending":t?"edit":"view"}),b.set(e,t)),t}}function y(e){var t;if(e instanceof Date||null===e||"object"!=typeof e)return e;let n=null!=(t=e.date)?t:e._value,r="string"==typeof n||"number"==typeof n?new Date(n):null;return null===r||isNaN(r.getTime())?void 0:r}function _(e){let t=y(e);return t instanceof Date?w(t):null==t?"":String(t)}function w(e){return null===e||isNaN(e.getTime())?"":`${e.getFullYear()}/${e.getMonth()+1}/${e.getDate()}`}function x(e){let t=new Map;for(let a of e){var n,r,i,o;for(let e of Object.keys(null!=(n=a.campaignFields)?n:{}))t.set(e,(null!=(r=t.get(e))?r:new Set).add(null!=(i=null==(o=a.template)?void 0:o.name)?i:a.templateName))}return[...t.keys()].sort().map(e=>[e,[...t.get(e)].join(", ")])}function k(e,t=!1){let n=e.friendlyName;return n&&n!==e.name?t?`${n} (${e.name})`:`${e.name} (${n})`:e.name}},6882(e,t,n){n.d(t,{WJ:()=>_,N2:()=>y});var r=n(4328),i=n(7389),o=n(6082),a=n(9832),l=n(6788),s=n(5234),u=n(2232),d=n(1259),c=n(9446),p=n(6287),h=n(1254),m=n(9861);function f(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}var g=n(3330);function v(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}function b(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){v(o,r,i,a,l,"next",e)}function l(e){v(o,r,i,a,l,"throw",e)}a(void 0)})}}function y(e,t,n){let v=l.SZ.of(t);return v.build(()=>{var y;let _,w,x,k,O,A,S,P=(0,a.vPA)(!1),E=(0,a.vPA)(!1),C=null,j=!1;void 0!==n.layout?function(e){try{let n=o.ViewLayout.fromViewState(e);(function(e,t){var n;let r=function(e){var t,n;let r,i,a=new Set;for(let l of(t=e,r=[],(i=e=>{if(Array.isArray(e))for(let t of e)i(t);else if(null!==e&&"object"==typeof e)for(let t of(r.push(e),Object.values(e)))i(t)})(JSON.parse(t)),r))if("string"==typeof l.columnName&&void 0!==l.cellType&&"number"!==l.cellType&&a.add(l.columnName),"FiltersLook"===l["#type"]&&Array.isArray(l.filters))for(let e of l.filters){let t=null!=(n=null==e?void 0:e.column)?n:null==e?void 0:e.columnName;"string"==typeof t&&e.type!==o.FILTER_TYPE.HISTOGRAM&&a.add(t)}return a}(e.viewState);for(let i of null!=(n=e.boundColumnNames)?n:[])i.startsWith("~")||t.columns.contains(i)||t.columns.addNew(i,r.has(i)?o.COLUMN_TYPE.STRING:o.COLUMN_TYPE.FLOAT).setTag(m.Ee,"true")})(n,t.dataFrame),t.loadLayout(n)}catch(e){r.shell.error("Failed to apply layout. Falling back to default layout."),console.error(e)}I()}(n.layout):I();let T=v.signals;return(_=e.stages).length>0&&(null==(y=t.dataFrame.col(u.yJ))||y.setTag(o.TAGS.CHOICES,JSON.stringify(_))),(w=t.dataFrame.col(u.Hz))&&(w.semType=u.pr,w.valueComparer=(e,t)=>e===t?0:null===e?-1:null===t?1:parseInt(e.substring(1))-parseInt(t.substring(1))),x=t.dataFrame,v.effect(()=>{var t;T.isCurrent.value&&(r.shell.windows.showHelp=!1,e.setBaseUrl(),(0,d.W6)(u.l2,null!=(t=e.campaignId)?t:""))}),v.effect(()=>{let t=T.grid.value;if(null===t)return;let i=t.col(u.Hz);i&&(i.editable=!1),(0,a.B1Y)(t.onCellValueEdited,t=>{var i;i=t,b(function*(){var t;let o=null==(t=i.tableColumn)?void 0:t.name;if(o===u.yJ)return void(yield e.saveCampaign(!1));let a=i.cell.value,l=i.tableRowIndex;if(o!==n.entryColumn||null==l)return;let s=()=>v.scope.isDisposed?void 0:e.registerRow(l).catch(e=>console.error("Failed to register molecule",e)),d=()=>v.scope.isDisposed?void 0:e.performSingleCellCalculations(l,a);try{n.registerFirst?(a&&(yield s()),yield d()):(yield d(),yield s())}catch(e){r.shell.error("Failed to process molecule edit, check console for details"),console.error(e)}})()}),(0,a.B1Y)(t.onCellRender,t=>(function(t){var n,r;let i=t.cell,a=e.duplicateVidCache;if(!a||!(null==i?void 0:i.isTableCell)||(null==(r=i.tableColumn)?void 0:r.name)!==u.Hz||(null!=(n=i.tableRowIndex)?n:-1)<0)return;let l=a.indexes[i.tableRowIndex];a.valueCounts[l]>1&&(t.cell.style.backColor=o.Color.setAlpha(o.Color.getCategoricalColor(l),150))})(t))}),(0,a.B1Y)(x.onRowsAdded,()=>{0===e.joining&&function(){let i=t.dataFrame,o=e.stages,a=i.col(u.yJ);if(o.length>0&&a)for(let e=0;e<i.rowCount;e++)(!a.get(e)||a.isNone(e))&&a.set(e,o[0]);let l=null;for(let e=0;e<i.rowCount;e++){let r=t.grid.cell(n.entryColumn,e);r&&(""===r.cell.value||null===r.cell.value)&&(l=r)}l&&r.functions.call(n.editor,{cell:l})}()}),(0,a.B1Y)(r.events.onContextMenu,r=>(function(r){var i,a,l,s,u,d,c;let p=null==r||null==(a=r.args)?void 0:a.context,h=null==r||null==(l=r.args)?void 0:l.item,m=null==r||null==(s=r.args)?void 0:s.menu;if((null==p?void 0:p.type)!==o.VIEWER.GRID||(null==(u=p.tableView)?void 0:u.id)!==t.id||!m||(null==h||null==(d=h.tableColumn)?void 0:d.name)!==n.entryColumn||!h.isTableCell)return;let f=t.dataFrame;m.item("Add new row",()=>f.rows.addNew(null,!0)),m.item(n.duplicateLabel,()=>{var e,t;let r=f.rows.addNew(null,!0);r.idx>-1&&(f.cell(r.idx,n.entryColumn).value=null!=(e=null==(t=h.cell)?void 0:t.value)?e:"")});let g=null==(c=h.cell)?void 0:c.value,v=null!=(i=h.tableRowIndex)?i:-1;g&&v>-1&&m.item("Re-Run Calculations",()=>void e.performSingleCellCalculations(v,g).catch(e=>console.error(e)))})(r)),(0,a.B1Y)(r.events.onFileImportRequest,n=>{var i,o,u,d,c,p;let h,f;return f=null!=(o=null==(h=null==(i=n)||null==(u=i.args)?void 0:u.file)||null==(c=h.name)||null==(d=c.split(".").pop())?void 0:d.toLowerCase())?o:"",void(h&&(0,l.eg)(r.shell.tv,t)&&m.zS.includes(f)&&(i.preventDefault(),p=h,b(function*(){let t;try{if(!(t=yield(0,m.Ty)(p)))throw Error("Failed to read file");t.name=p.name.slice(0,p.name.lastIndexOf(".")),yield t.meta.detectSemanticTypes(),yield r.data.detectSemanticTypes(t)}catch(e){r.shell.error("Hit Design Failed to read file"),console.error(e);return}let n=t;if(!s.C.moleculeColumn(n))return void r.shell.addTableView(n);let i=new a.lGe("Uploading table with molecules",{name:"upload-molecules"});i.add((0,a.Lnh)("Add new table to workspace or join with existing Hit Design campaign")),i.addButton("Add to workspace",()=>{i.close(),r.shell.addTableView(n)}),i.onOK(()=>e.handleJoiningDataframe(n),{text:"Add to existing campaign",primary:!0}),v.show(i)})()))}),function(){let i=e.template,s=[{icon:"sync",tooltip:"Refresh Campaign",name:"Refresh",run:()=>e.refreshCampaign(),hint:(0,a.EWP)(()=>P.value?"New changes available. Click to refresh campaign.":null),hintDetail:"New changes"},{icon:"plus",tooltip:"Add new row",run:()=>{t.dataFrame.rows.addNew(null,!0)}},{icon:"code-merge",tooltip:"Merge another table into the campaign",text:"Merge another table into the campaign...",run:()=>(0,h.x)(e,v)},{icon:"wrench",tooltip:"Calculate additional properties",text:"Calculate additional properties...",run:()=>e.editCompute()}],d=n.designer?o.Func.find({meta:{role:u.lq}}).find(e=>1===e.outputs.length&&e.outputs[0].propertyType===o.TYPE.DATA_FRAME):void 0;if(d&&s.push({icon:"pen-nib",tooltip:d.description||d.friendlyName,text:`${d.friendlyName}...`,run:()=>(function(n){let i=t.dataFrame,s={},u=n.inputs[0];if((null==u?void 0:u.semType)===o.SEMTYPE.MOLECULE&&i.currentRowIdx>=0){var d;let t=c._package.convertToSmiles(null==(d=i.col(e.molColName))?void 0:d.get(i.currentRowIdx));t&&(s[u.name]=t)}let p=n.prepare(s),h=new a.lGe(n.friendlyName,{name:"designer"});h.add(()=>(0,l.F8)(p)),h.onOK(()=>b(function*(){let t=o.TaskBarProgressIndicator.create(`Running ${n.friendlyName}`);try{yield p.call();let t=p.getOutputParamValue();if(!(null==t?void 0:t.rowCount))return void r.shell.warning(`${n.friendlyName} returned an empty result`);yield t.meta.detectSemanticTypes(),yield r.data.detectSemanticTypes(t),yield e.handleJoiningDataframe(t)}catch(e){return r.shell.error(`Failed to run ${n.friendlyName}`),c._package.logger.error(e),!1}finally{t.close()}})()),v.show(h)})(d)}),e.canEdit&&s.push({icon:"users",tooltip:"Edit campaign permissions",text:"Edit campaign permissions...",run:()=>{let t,n,r;return t=e.campaign,n=e.campaignId,r=null==t?void 0:t.friendlyName,g.M.show(null==t?void 0:t.permissions,{subject:r&&r!==n?`${n} (${r})`:n,author:null==t?void 0:t.authorUserFriendlyName,host:v,save:t=>b(function*(){let n=e.campaign;if(!n)return!1;let r=n.permissions;return n.permissions=t,(yield e.saveCampaign(!0))!==void 0||(n.permissions=r,!1)})()})}}),(null==i?void 0:i.layoutViewState)||(null==i?void 0:i.localLayoutPath)){let n=i.localLayoutPath?"Loaded from mounted file storage":"Static";s.push({icon:"svg-view-layout",tooltip:`Apply template layout (${n})`,run:()=>b(function*(){let n=e.template;if(null==n?void 0:n.localLayoutPath)try{t.loadLayout(o.ViewLayout.fromJson((yield r.dapi.files.readAsText(n.localLayoutPath))));return}catch(e){r.shell.error("Failed to apply layout from mounted file storage. Falling back to static layout"),c._package.logger.error(e)}if(!(null==n?void 0:n.layoutViewState))return void r.shell.error("No layout found");try{t.loadLayout(o.ViewLayout.fromViewState(n.layoutViewState))}catch(e){r.shell.error("Failed to apply template layout. Check console for more details."),c._package.logger.error(e)}})()})}let p=[...e.stages.length>0?[{text:"Progress tracker",run:()=>{N()}}]:[],{text:"Submit...",run:()=>{var t;return null==(t=e.submitView)?void 0:t.render()},cls:"hit-design-submit-button"}];v.ribbon({hideSave:!0,name:"hit-design-actions",actions:s,buttons:p,breadcrumbs:{parent:e.mainView,onClick:()=>{t.close(),e.infoView.init()}},status:(0,a.EWP)(()=>e.canEdit?E.value?"Waiting for another session to finish saving…":"":"View only — changes are not saved")})}(),(k=t.dataFrame.col(n.entryColumn))&&k.toList().every(e=>!e)&&r.functions.call(n.editor,{cell:t.grid.cell(n.entryColumn,0)}),(O=e.campaignId)&&v.task(t=>b(function*(){try{let e=C,t=yield D(O);C===e&&(C=t)}catch(e){console.error(e)}t.build(()=>t.owner.setInterval(()=>void b(function*(){if(!(j||P.peek())&&T.isCurrent.peek()&&!e.isSaving&&!(e.joining>0)&&e.campaignId){j=!0;try{let t=C,n=yield D(e.campaignId);!n||n===t||C!==t||e.isSaving||v.scope.isDisposed||(C=n,P.value=!0)}catch(e){console.error(e)}finally{j=!1}}})(),3e3))})()),{view:t,host:v,needsRefresh:P,saving:e=>{let n=t.grid;n&&i.setUpdateIndicator(n.root,e,"Saving Campaign...")},waitingForLock:e=>{null==A||A(),E.value=!1,e&&(A=v.scope.setTimeout(()=>E.value=!0,500))},saved:e=>{C=e,P.value=!1},openTracker:N};function N(){return(null==S?void 0:S.isOpen.peek())||(S=function(e,t){let n=t.view,i=n.dataFrame,l=new a.lGe("Progress Tracker",{name:"progress-tracker",closeOnly:!0}),s=(0,a.y4m)([],"hit-design-tracker-lanes"),d=null,c=g(),p=(0,a.vPA)(0),h=(0,a.vPA)(0),m=(0,a.vPA)(0);return l.build(()=>{l.add(s),l.addButton("Modify Stages",()=>{let n;(n=new a.lGe("Modify Stages",{name:"modify-stages"})).build(()=>{let t=new a.$Mz({name:"stages",orderable:!0,addText:"Add stage",newItem:()=>({name:""}),value:e.stages.map(e=>({name:e})),rowName:(e,t)=>`Stage ${t+1}`,columns:[{name:"name",header:"Name",input:e=>new a.ksK({value:null!=e?e:"",inline:!0})}]}),r=(0,a.EWP)(()=>{var e;return[...new Set((null!=(e=t.value)?e:[]).map(e=>{var t;return null==(t=e.name)?void 0:t.trim()}).filter(e=>!!e))]}),i=(0,a.EWP)(()=>{let e=new Set(r.value),t=r.value[0],n=new Map;for(let t of g()){var i;t&&!e.has(t)&&n.set(t,(null!=(i=n.get(t))?i:0)+1)}return void 0===t||0===n.size?null:[...n].map(([e,n])=>`${n} ${1===n?"molecule":"molecules"} in ${e} move to ${t}`).join("; ")});n.add(t),n.add((0,a.Bsq)(i)),n.okDisabled((0,a.EWP)(()=>0===r.value.length?"A campaign needs at least one stage":null),{footer:!0}),n.onOK(()=>{var t;return(t=function*(){y();try{(yield e.setStages(r.peek()))&&(c=g(),p.value=0)}finally{b()}},function(){var e=this,n=arguments;return new Promise(function(r,i){var o=t.apply(e,n);function a(e){f(o,r,i,a,l,"next",e)}function l(e){f(o,r,i,a,l,"throw",e)}a(void 0)})})()})}),t.show(n,{width:420})},{start:!0});let n=new ResizeObserver(()=>m.value=s.clientWidth);n.observe(s),l.own(()=>n.disconnect());let o=(0,a.EWP)(()=>m.value>0&&h.value>m.value?" \xb7 scroll sideways for more stages":"");l.status((0,a.EWP)(()=>(0===p.value?"Drag a card to another lane to change its stage":`${p.value} ${1===p.value?"molecule":"molecules"} moved \xb7 saved when the tracker closes`)+o.value)),l.onClose(()=>(function(){try{let t=null==d?void 0:d.props.sketchState;t&&"object"==typeof t&&e.campaign&&(e.campaign.tilesViewerFormSketch=JSON.stringify(t))}catch(e){r.shell.error("Failed to save sketch state. check the console for more details."),console.error("Failed to save sketch state",e)}y(),e.dataFrame===i&&v()>0&&e.saveCampaign()})()),(0,a.B1Y)(i.onValuesChanged,()=>p.value=v())}),b(),t.show(l,{modal:!0,x:12,y:12,width:window.innerWidth-24,height:window.innerHeight-24});function g(){var e,t;return null!=(e=null==(t=i.col(u.yJ))?void 0:t.toList())?e:[]}function v(){return g().reduce((e,t,n)=>n<c.length&&t!==c[n]?e+1:e,0)}function b(){var t;let i,a,l;y();let c=(a=new Set(e.stages),[...e.stages,...new Set(g().filter(e=>!!e&&!a.has(e)))]),p=function(){var t,r,i;let o,a=null==(r=e.campaign)?void 0:r.tilesViewerFormSketch;if(!a)return null;try{o=JSON.parse(a)}catch(e){return console.error("Failed to parse sketch state string",e),null}let l=n.dataFrame;for(let e of(o.table=l.name,o.elementStates=(null!=(t=o.elementStates)?t:[]).filter(e=>{var t;return(null==e||null==(t=e.viewerSettings)?void 0:t.column)&&l.col(e.viewerSettings.column)}),o.elementStates))(null==e||null==(i=e.viewerSettings)?void 0:i.table)&&(e.viewerSettings.table=l.name);return o.elementStates.length>0?o:null}();try{let e=(i=n.addViewer(o.VIEWER.TILE_VIEWER,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({lanesColumnName:u.yJ,lanes:c},p?{sketchState:p}:{}))).getOptions();e.look.sketchState=p,i.setOptions(e),i.copyViewersLook(i)}catch(e){r.shell.error("Failed to create tiles viewer with preset layout.\n Falling back to default layout."),console.error("Failed to create tiles viewer",e),i=n.addViewer(o.VIEWER.TILE_VIEWER,{lanesColumnName:u.yJ,lanes:c})}h.value=c.length*((l=Math.max(0,...(null!=(t=null==p?void 0:p.elementStates)?t:[]).map(e=>(Number(null==e?void 0:e.left)||0)+(Number(null==e?void 0:e.width)||0))))>0?l+40:368),Object.assign(i.root.style,{minWidth:`${h.value}px`,height:"100%"}),s.replaceChildren(i.root),d=i}function y(){let e=d;if(d=null,e)try{e.detach(),e.close()}catch(e){}}}(e,v)),S}function I(){t.grid||(r.shell.error("Applied layout created view without grid. Resetting layout."),t.resetLayout())}function D(t){return b(function*(){var n,r;let i=yield p.P.getLastModified(e.appName,t);return i.rowCount>0&&null!=(n=null==(r=i.col("updated_at"))?void 0:r.getString(0))?n:null})()}})}function _(e,t,n){return b(function*(){if(null==n?void 0:n.scope.isDisposed)return null;let r=null,i=new a.lGe("Select Primary Molecule Column",{name:"primary-molecule-column"});return i.build(()=>{let n=new a.oGE({label:"Primary Molecule Column",items:e,value:t,nullable:!1});i.add((0,a.Lnh)("Multiple molecule columns found. Please select the primary molecule column to be used for calculations.")),i.add(n),i.onOK(()=>{r=n.peek()})}),yield new Promise(e=>{i.onClose(()=>e()),n?n.show(i):i.show()}),r})()}},4233(e,t,n){n.d(t,{$:()=>u});var r=n(9832),i=n(6788),o=n(4281),a=n(5236);function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}n(8707);let s="Descriptors";function u(e){return(0,r.s9R)(t=>{var n,u,d;let c=(0,r.vPA)(!1),p=(0,r.vPA)(null),h=(0,r.vPA)(null),m=e.value.descriptors,f=(0,r.vPA)(new Set(null!=(n=null==m?void 0:m.args)?n:[])),g=void 0===e.descriptors?void 0:{key:s,name:s,skip:0,rerun:(0,r.vPA)(!1),checked:(0,r.vPA)(!!(null==m?void 0:m.enabled)&&(null!=(u=null==m||null==(d=m.args)?void 0:d.length)?u:0)>0)},v=[...g?[g]:[],...function(e,t){let n=[],i=(e,t,i,o)=>{try{var a,l;let s=i();n.push({key:t(),name:null!=(a=e.friendlyName)?a:e.name,skip:o,checked:(0,r.vPA)(void 0!==s),rerun:(0,r.vPA)(!!(null==s?void 0:s.rerunOnOpen)),call:e.prepare(null!=(l=null==s?void 0:s.args)?l:{})})}catch(e){console.error(e)}},l=e=>e.inputs.length>=2&&"dataframe"===e.inputs[0].propertyType&&"column"===e.inputs[1].propertyType;for(let n of e.functions.filter(l))i(n,()=>`${n.package.name}:${n.name}`,()=>{var e;return null==(e=t.functions)?void 0:e.find(e=>e.name===n.name&&e.package===(0,a.Vu)(n))},2);for(let n of e.scripts.filter(l))i(n,()=>{var e;return`${o.Wn}:${null!=(e=n.name)?e:""}:${n.id}`},()=>{var e;return null==(e=t.scripts)?void 0:e.find(e=>e.id===n.id)},2);for(let n of e.queries.filter(e=>e.inputs.length>0&&"list"===e.inputs[0].propertyType))i(n,()=>{var e;return`${o.ru}:${null!=(e=n.name)?e:""}:${n.id}`},()=>{var e;return null==(e=t.queries)?void 0:e.find(e=>e.id===n.id)},1);return n}(e.functions,e.value)],b=(0,r.vPA)((0,a.CF)(e.orderKey)),y=void 0===e.descriptors?Promise.resolve():e.descriptors().then(e=>{p.value=e},e=>{h.value=e instanceof Error?e.message:String(e)}),_=new Map;for(let n of v)_.set(n.key,void 0===n.call?function(){let e=new r.ksK({inline:!0,search:!0,name:"descriptor-search",placeholder:"Search descriptors"}),n=new r.U5B({itemHeight:24,onCheck:(e,t)=>(function(e,t){let n=void 0!==e.data?[e.data]:e.children.map(e=>e.data),r=new Set(f.peek());for(let e of n)t?r.add(e):r.delete(e);f.value=r,c.value=!0,t&&(g.checked.value=!0)})(e,t)}),i=(0,r.y4m)([(0,r.Bsq)((0,r.EWP)(()=>null===h.value?null:`Could not list the descriptors: ${h.value}`),"Listing the descriptors…")]);return t.effect(()=>{let t=e.value.trim().toLowerCase(),r=function(e){let t=p.value,n=f.value;if(null===t)return[];let r=[];for(let[i,{descriptors:o}]of Object.entries(t)){let t=""===e?o:o.filter(t=>t.name.toLowerCase().includes(e));if(0===t.length)continue;let a=o.filter(e=>n.has(e.name)).length;r.push({id:`group:${i}`,label:`${i} \xb7 ${a} of ${o.length}`,checked:a>0,children:t.map(e=>({id:`${i}/${e.name}`,label:e.name,tooltip:e.description,data:e.name,checked:n.has(e.name)}))})}return r}(t);n.setRoots(r),""!==t&&(n.expanded.value=new Set(r.map(e=>e.id)))}),t.effect(()=>{let e=null!==p.value;n.root.hidden=!e,i.hidden=e}),(0,r.yPk)([e.root,i,n.root],{gap:"s",cls:"hit-triage-compute-descriptors"})}():function(t){let n=Object.fromEntries(t.call.func.inputs.slice(0,t.skip).map(e=>[e.name,{visible:!1}])),o=(0,i.F8)(t.call,{showTableSelectors:!1,skipTableAutoFill:!0,editors:"auto",overrides:n}),a=e.rerunOnOpen;return a&&o.add(new r.d52({label:a.label,name:`rerun-${t.key}`,bind:t.rerun,tooltipText:a.tooltip})),o}(n));let w=new r.qjb({items:(0,r.EWP)(()=>(function(){let{order:e,hidden:t}=b.value,n=t=>e.includes(t.name)?e.indexOf(t.name):e.length;return v.map((e,t)=>({e,at:t})).filter(({e})=>!t.includes(e.name)).sort((e,t)=>n(e.e)-n(t.e)||e.at-t.at).map(({e})=>e)})()),keyOf:e=>e.key,label:"Functions",row:e=>({label:e.name,check:e.checked,checkTooltip:"Toggle calculation of this function",hint:void 0!==e.call?void 0:(0,r.EWP)(()=>{let t=x().length;return e.checked.value&&t>0?`${t} selected`:""})}),detail:e=>_.get(e.key),disabled:e=>void 0===e.call?null:(0,r.EWP)(()=>e.checked.value?null:`Check ${e.name} to change its settings`)});return w.root.classList.add("hit-triage-compute-box"),{root:(0,r.yPk)([(0,r._Qr)([(0,r.nfo)("Reorder…",()=>void t.build(()=>{var t,n;let i,o,l=(t=v.map(e=>e.name),n=b.peek().order,i=[...new Set(t)],[...o=n.filter(e=>i.includes(e)),...i.filter(e=>!o.includes(e))]),s=b.peek().hidden,u=new r.zTF({name:"functions",orderable:!0,items:l,value:l.filter(e=>!s.includes(e))});new r.lGe("Order and hide functions").add(u).onOK(()=>{let t=u.peek();b.value={order:t,hidden:l.filter(e=>!t.includes(e))},(0,a.oo)(b.peek(),e.orderKey)}).show()}))]),w],{gap:"s"}),ready:y,edited:c,read:function(){var t,n;let i,a,s=new Set(b.peek().hidden),u=l({descriptors:!g&&(null==m?void 0:m.enabled)&&null!=(t=m.args)?t:[],externals:{},scripts:{},queries:{}},e.rerunOnOpen?{rerunOnOpen:{}}:{});for(let e of v){if(!e.checked.peek()||s.has(e.name))continue;if(void 0===e.call){u.descriptors=(0,r.O8t)(()=>x());continue}let t={};for(let[n,r]of Object.entries(e.call.inputs).slice(e.skip))t[n]=r;(e.key.startsWith(`${o.Wn}:`)?u.scripts:e.key.startsWith(`${o.ru}:`)?u.queries:u.externals)[e.key]=t,u.rerunOnOpen&&e.rerun.peek()&&(u.rerunOnOpen[e.key]=!0)}return n=u,i=e=>n.rerunOnOpen?{rerunOnOpen:!!n.rerunOnOpen[e]}:{},a=(e,t)=>Object.entries(null!=e?e:{}).filter(([e])=>e.startsWith(t)&&3===e.split(":").length).map(([e,t])=>{let[,n,r]=e.split(":");return l({name:n,id:r,args:t},i(e))}),{descriptors:{enabled:n.descriptors.length>0,args:n.descriptors},functions:Object.entries(n.externals).map(([e,t])=>{let[n,r]=e.split(":");return l({name:r,package:n,args:t},i(e))}),scripts:a(n.scripts,o.Wn),queries:a(n.queries,o.ru)}}};function x(){let e=p.value,t=f.value;return null===e?[...t]:Object.values(e).flatMap(e=>e.descriptors.map(e=>e.name)).filter(e=>t.has(e))}},{name:"compute-editor"})}},3330(e,t,n){n.d(t,{A:()=>d,M:()=>c});var r=n(4328),i=n(6082),o=n(9832),a=n(6788);function l(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function u(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}let d={view:[i.Group.defaultGroupsIds["All users"]],edit:[i.Group.defaultGroupsIds["All users"]]};class c{static show(e,t){var n;return(n=function*(){var n;let i=null!=e?e:d,l=[...new Set([...i.view,...i.edit])],s=(yield Promise.all(l.map(e=>r.dapi.groups.find(e)))).filter(e=>null!=e);if(null==(n=t.host)?void 0:n.scope.isDisposed)return;let u=s.map(e=>({principal:e.id,can:{view:!0,edit:i.edit.includes(e.id)}})),p=new Map(s.map(e=>[e.id,e])),h=new o.lGe("Edit Permissions",{name:"edit-permissions"});h.build(()=>{let e=new o.xHQ({name:"access",fill:!0,capabilities:[{name:"view",label:"Can View"},{name:"edit",label:"Can Edit"}],principalLabel:"User or group",principals:s.map(e=>({value:e.id,label:e.friendlyName})),icon:e=>p.has(e)?(0,a.$t)(p.get(e)):null,value:u,picker:e=>(0,a.C_)({placeholder:"+ Add user or group…",onPick:(t,n)=>{p.set(t.id,t),e({value:t.id,label:n})}}).root,onInput:t=>{let n=c.implied(u,t);u=n,n!==t&&(e.value=n)}}),n=(0,o.EWP)(()=>{var t;return null!=(t=e.value)?t:[]}),r=(0,o.EWP)(()=>n.value.some(e=>e.can.edit)),i=(0,o.EWP)(()=>!n.value.some(e=>e.can.view||e.can.edit));h.add((0,o.yPk)([e.root,(0,o.Bsq)((0,o.vPA)(null),(0,o.EWP)(()=>i.value?"With no one listed, all users can view.":"Can Edit includes Can View.")),(0,o.Bsq)((0,o.vPA)(null),(0,o.EWP)(()=>{var e;return r.value?`OK saves who can access ${t.subject}`:`Only ${null!=(e=t.author)?e:"the author"} will be able to edit ${t.subject}`}))])),h.onOK(()=>{var n;return t.save(c.stored(null!=(n=e.peek())?n:[]))})}),t.host?t.host.show(h,{width:440}):h.show({width:440})},function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(e){l(o,r,i,a,s,"next",e)}function s(e){l(o,r,i,a,s,"throw",e)}a(void 0)})})()}static implied(e,t){let n=!1,r=t.map(t=>{var r;if(!t.can.edit||t.can.view)return t;n=!0;let i=(null==(r=e.find(e=>e.principal===t.principal))?void 0:r.can.view)===!0;return u(s({},t),{can:i?u(s({},t.can),{edit:!1}):u(s({},t.can),{view:!0})})});return n?r:t}static stored(e){let t=e.filter(e=>e.can.edit).map(e=>e.principal),n=e.filter(e=>e.can.view||e.can.edit).map(e=>e.principal);return{edit:t,view:n.length>0?n:[...d.view]}}}},5210(e,t,n){n.d(t,{EK:()=>O,IL:()=>k,_t:()=>y});var r=n(4328),i=n(7389),o=n(6082),a=n(9832),l=n(6788),s=n(9446),u=n(2671),d=n(2232),c=n(1259),p=n(8434),h=n(249),m=n(4233);function f(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}function g(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){f(o,r,i,a,l,"next",e)}function l(e){f(o,r,i,a,l,"throw",e)}a(void 0)})}}function v(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function b(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function y(e){return g(function*(){let{app:t,preset:n}=e,u=r.shell.v;i.setUpdateIndicator(u.root,!0);try{let i,f=yield x(t.appName),y=!1,A=()=>{y=!0,S.close()},S=l.SZ.create({name:d.Ru.createNewTemplate,content:()=>{var u;return{root:(u={app:t.appName,preset:n,existing:f,functions:t.computeFunctions,cancel:A,created:t=>g(function*(){try{yield e.onCreated(t)}catch(e){r.shell.error(`Template ${t.name} was created, but the app could not show it: ${e instanceof Error?e.message:e}`)}A()})()},i=(0,a.s9R)(e=>{var t,n,i,f,y;let A=new Set,S=new Map,P=Array.from(new Map(o.Func.find({meta:{role:d.yv}}).concat(o.Func.find({tags:[d.yv]})).map(e=>[e.nqName,e])).values()),E=(0,a.vPA)(!1),C=(0,a.vPA)(!1),j=(0,a.vPA)(!1),T=0;et(u.existing);let N=u.preset,I=(0,a.vPA)((null==N?void 0:N.layoutViewState)?{viewState:N.layoutViewState,localPath:null!=(t=N.localLayoutPath)?t:null}:null),D=new a.lVW,L=new a.ksK({label:"Name",name:"name",required:!0,tooltipText:"Template name",value:N?k(N.name,A):""});L.addValidator(e=>A.has(e.trim().toLowerCase())?"A template with this name already exists":null);let z=new a.ksK({label:"Key",name:"key",required:!0,tooltipText:"Template key used for campaign prefix",value:N?O(N.key,new Set(S.keys())):""});z.addValidator(e=>{let t=S.get(e.trim().toLowerCase());return void 0===t?null:`${e.trim()} is used by ${t}`});let F=(0,h.H_)();F.setTooltip("Select a layout file");let B=I.peek();null!==B&&(F.value=(0,h.NI)(B,N.name));let M=(0,l.Yt)(F,"layout",{fill:!0});M.addValidator(e=>null===e||E.value||null!==I.value?null:"Not a layout file"),M.effect(()=>{let t=M.value;(0,a.O8t)(()=>{var n;n=t,g(function*(){let t=++T;E.value=!0;let r=null===n?null:yield(0,h.T4)(n);t!==T||e.isDisposed||((0,a.vAk)(()=>{I.value=r,E.value=!1}),M.revalidate())})()})});let R=new a.$Mz({label:"",name:"fields",addText:"Add field",value:null!=(n=null==N?void 0:N.campaignFields)?n:[],newItem:()=>({name:"",type:"String",required:!1}),rowName:(e,t)=>e.name||`Field ${t+1}`,columns:[{name:"name",header:"Name",input:e=>new a.ksK({inline:!0,value:null!=e?e:""})},{name:"type",header:"Type",width:"120px",input:e=>new a.oGE({inline:!0,nullable:!1,items:w,value:null!=e?e:"String"})},{name:"required",header:"Required",width:"64px",input:e=>new a.d52({inline:!0,value:!0===e})}]}),q=new a.$Mz({label:"",name:"stages",addText:"Add stage",orderable:!0,value:(null!=(i=null==N?void 0:N.stages)?i:[]).map(e=>({name:e})),newItem:()=>({name:""}),rowName:(e,t)=>`Stage ${t+1}`,columns:[{name:"name",header:"Name",input:e=>new a.ksK({inline:!0,value:null!=e?e:""})}]}),H=null==N?void 0:N.submit,W=void 0===H?void 0:P.find(e=>e.name===H.fName&&(!H.package||(0,c.Vu)(e)===H.package)),V=new a.oGE({label:"Submit function",name:"submit-function",nullable:!0,tooltipText:"Select function to be called upon submitting",value:null!=(f=null==W?void 0:W.nqName)?f:null,items:P.map(e=>{var t;return{value:e.nqName,label:null!=(t=e.friendlyName)?t:e.name}})}),G=(0,m.$)({functions:u.functions,value:null!=(y=null==N?void 0:N.compute)?y:_,descriptors:p.dG,orderKey:d.HC,rerunOnOpen:p.Ji}),U=(e,t)=>{let n=new a.wn6({title:e,hint:t,collapsible:!1});return D.addElement(n.root),n.body},K=U("Details");D.add(L,K).add(z,K).add(M,K),D.add(R,U("Additional fields","filled in by people when they start a campaign")),D.add(q,U("Stages","new molecules start in the first stage")),U("Compute","calculated for every molecule").append(G.root),D.add(V,U("Submit"));let Y=(0,a.EWP)(()=>[L,z].filter(e=>""===e.value.trim()).map(e=>e.label)),Q=(0,a.EWP)(()=>{let e=z.value.trim();return Y.value.length>0?`Fill in ${Y.value.join(" and ")} to create the template`:`Creates template "${L.value.trim()}"; campaigns get codes ${e}-1, ${e}-2, …`}),J=(0,a.x6e)(d.Ru.createTemplate,()=>void g(function*(){let e,t,n=(e=I.peek(),t=P.find(e=>e.nqName===V.peek()),v(b(v({name:L.peek().trim(),key:z.peek().trim(),campaignFields:R.peek().filter(e=>e.name).map(e=>b(v({},e),{required:!!e.required})),stages:q.peek().map(e=>e.name).filter(e=>e)},null===e?{}:v({layoutViewState:e.viewState},null===e.localPath?{}:{localLayoutPath:e.localPath})),{compute:G.read()}),void 0===t?{}:{submit:{fName:t.name,package:(0,c.Vu)(t)}}));C.value=!0;try{et((yield x(u.app)));let e=[L,z].filter(e=>(e.revalidate(),null!==e.validity.peek()));if(e.length>0){for(let t of(C.value=!1,e))t.touch();return}yield s._package.files.writeAsText(`${u.app}/templates/${n.name}.json`,JSON.stringify(n))}catch(e){C.value=!1,r.shell.error(`Could not save template ${n.name}: ${e instanceof Error?e.message:e}`);return}r.shell.info("Template created successfully"),yield u.created(n)})(),{primary:!0,disabled:(0,a.EWP)(()=>C.value?"Creating the template…":E.value?"Reading the layout…":D.problem.value)}),Z=new a.YW0({content:D,maxWidth:820,labelColumn:!1});D.addButtons(e=>e.append((0,a.Bsq)(D.shownProblem,Q),(0,a.x6e)(d.Ru.cancel,()=>u.cancel()),J),{host:Z.footer});let X=(0,a.y4m)([Z],"hit-triage-template-editor");for(let e of["input","change"])(0,a.on)(X,e,()=>j.value=!0);let ee=!0;return e.effect(()=>{R.value,q.value,ee||(0,a.O8t)(()=>j.value=!0),ee=!1}),{root:X,get dirty(){return j.peek()||G.edited.peek()}};function et(e){for(let t of e)""!==t.name.trim()&&A.add(t.name.trim().toLowerCase()),""!==t.key.trim()&&S.set(t.key.trim().toLowerCase(),t.name)}},{name:"template-editor"})),path:`${new URL(t.baseUrl).pathname}/new-template`}}}).view;S.parentView=u,S.parentCall=t.parentCall,S.helpUrl=`${s._package.webRoot}${"PeptiHit"===t.appName?"README_PH.md":"README_HD.md"}#templates`,r.shell.addView(S);let P=!0;i.subscribe(r.events.onCurrentViewChanged,()=>{let e=r.shell.v,t=P&&!y&&(null==e?void 0:e.dart)===u.dart&&Array.from(r.shell.views).some(e=>e.dart===S.dart);P=(null==e?void 0:e.dart)===S.dart,t&&g(function*(){!i.dirty||(yield(0,a.ZDJ)({title:"Discard the new template?",name:"discard-template",message:"What you filled in for the new template is not saved.",confirmText:"Discard",destructive:!0}))?A():r.shell.v=S})()})}catch(e){r.shell.error(`Could not open the template editor: ${e instanceof Error?e.message:e}`)}finally{i.setUpdateIndicator(u.root,!1)}})()}let _={descriptors:{enabled:!1,args:[]},functions:[],scripts:[],queries:[]},w=Object.keys(u.u);function x(e){return g(function*(){let t=`${e}/templates`;return(yield s._package.files.exists(t))?Promise.all((yield s._package.files.list(t)).filter(e=>e.name.endsWith(".json")).map(e=>g(function*(){let t=e.name.slice(0,-5);try{var n;return{name:t,key:String(null!=(n=JSON.parse((yield s._package.files.readAsText(e))).key)?n:"")}}catch(e){return{name:t,key:""}}})())):[]})()}function k(e,t){for(let n=1;;n++){let r=1===n?`${e} (copy)`:`${e} (copy ${n})`;if(!t.has(r.toLowerCase()))return r}}function O(e,t){if(""===e)return"";let[,n,r]=/^(.*?)(\d*)$/.exec(e),i=e=>`${n}${String(e).padStart(r.length,"0")}`,o=""===r?2:Number(r)+1;for(;t.has(i(o).toLowerCase());)o++;return i(o)}},897(e,t,n){n.d(t,{j:()=>c,k:()=>d});var r=n(4328),i=n(9832),o=n(9446),a=n(2232),l=n(1259);function s(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}function u(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){s(o,r,i,a,l,"next",e)}function l(e){s(o,r,i,a,l,"throw",e)}a(void 0)})}}let d=720;function c(e){return(0,i.s9R)(t=>{let n=(0,i.vPA)(null),s=new i.Cqk(()=>u(function*(){var t;let n=`${e.app}/templates`,r=(yield o._package.files.exists(n))?(yield o._package.files.list(n)).filter(e=>e.name.endsWith(".json")).map(e=>e.name.slice(0,-5)):[],i=null==(t=e.preset)?void 0:t.name;return void 0===i||r.includes(i)?r:[...r,i]})(),{debounceMs:0});t.effect(()=>{let e=s.state.value;"ready"===e.kind&&(n.value=e.value)});let c=(0,i.EWP)(()=>{let e=s.state.value,t=n.value;return"error"===e.kind?`error:${e.message}`:null===t?"loading":0===t.length?"empty":"ready"}),p=(0,i.y4m)();return(0,i.__1)(p,()=>[c.value],e=>e,t=>{var s,c,p;let h,m,f,g,v;return"loading"===(s=t)?(0,i.qVA)(3):s.startsWith("error:")?(0,i.p$C)(`Could not list the templates: ${s.slice(6)}`,{error:!0}):"empty"===s?(0,i.p$C)("No templates yet. A template sets the fields, stages and calculations of every campaign made from it.",{icon:"file-plus",actions:[(0,i.x6e)("Create template",()=>e.edit(),{primary:!0})]}):(h=new i.BZS,m=new i.lVW({labelColumn:h,maxWidth:d}),f=new i.oGE({label:a.Ru.selectTemplate,name:"template",nullable:!1,required:!1,items:(0,i.EWP)(()=>{var e;return null!=(e=n.value)?e:[]}),value:null!=(c=null==(p=e.preset)?void 0:p.name)?c:n.peek()[0]}),g=new i.Cqk(()=>{var t;return t=f.peek(),u(function*(){let n=e.preset;return(null==n?void 0:n.name)===t?n:yield(0,l.PM)(`${e.app}/templates/${t}.json`)})()},{deps:()=>f.value,debounceMs:0}),f.addOptions((0,i.gbS)("plus",()=>e.edit(),{tooltip:a.Ru.createNewTemplate})),f.addOptions((0,i.gbS)("copy",()=>{let t=g.peek();void 0!==t&&e.edit(t)},{tooltip:"Clone template"})),f.addOptions((0,i.gbS)("trash-alt",()=>{var t;t=f,u(function*(){var a;let l=t.peek();if(null===l||!(yield(0,i.ZDJ)({title:"Delete template",name:"delete-template",confirmText:"Delete",destructive:!0,message:`Are you sure you want to delete template ${l}?`,detail:"Campaigns made from it keep working.",onConfirm:()=>o._package.files.delete(`${e.app}/templates/${l}.json`)})))return;let s=(null!=(a=n.peek())?a:[]).filter(e=>e!==l);(0,i.vAk)(()=>{var e;n.value=s,t.value=null!=(e=s[0])?e:null}),r.shell.info(`Template ${l} was deleted successfully`)})()},{tooltip:"Delete template",disabled:(0,i.EWP)(()=>{var e,t;return(null!=(e=null==(t=n.value)?void 0:t.length)?e:0)<2?"The last template cannot be deleted":null})})),m.add(f),v=(0,i.y4m)([]),(0,i.__1)(v,()=>[g.state.value],e=>"ready"===e.kind?`ready:${e.value.name}`:e.kind,t=>(function(t,n){if("error"===t.kind)return(0,i.p$C)(`Could not read the template: ${t.message}`,{error:!0});if("ready"!==t.kind)return(0,i.qVA)(3);let r=i.HGh.ambient,o=e.form(t.value,{column:n,owner:r});if(!(o instanceof Promise))return i.EcF.is(o)?o.root:o;let a=(0,i.y4m)([(0,i.qVA)(3)]);return o.then(e=>{r.isDisposed||a.replaceChildren(i.EcF.is(e)?e.root:e)},e=>{r.isDisposed||a.replaceChildren((0,i.p$C)(`Could not build the form: ${e instanceof Error?e.message:e}`,{error:!0}))}),a})(t,h)),(0,i.y4m)([m.root,v]))}),{root:p,names:n}},{name:"template-picker"})}},2671(e,t,n){n.d(t,{u:()=>i});var r=n(6082);let i={String:r.TYPE.STRING,Number:r.TYPE.FLOAT,Boolean:r.TYPE.BOOL,Date:r.TYPE.DATE_TIME,Molecule:r.SEMTYPE.MOLECULE}},1259(e,t,n){n.d(t,{LD:()=>_,NF:()=>c,PM:()=>w,S:()=>g,Vu:()=>s.Vu,W6:()=>p,WP:()=>f,Zg:()=>b,_S:()=>h,pl:()=>m,sE:()=>y});var r=n(4328),i=n(7389),o=n(6082),a=n(2232),l=n(9446),s=n(5236);function u(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}function d(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){u(o,r,i,a,l,"next",e)}function l(e){u(o,r,i,a,l,"throw",e)}a(void 0)})}}let c=e=>`${e.getFullYear()}/${e.getMonth()+1}/${e.getDate()}`;function p(e,t){let n=document.title,r=window.location.href.split("?")[0]+"?"+e+"="+t;if(history.replaceState){let e={Title:n,Url:r};history.replaceState(e,e.Title,e.Url)}}function h(e,t,n,o){var a;let l=i.breadcrumbs([t,n]),s=l.onPathClick.subscribe(t=>{1===t.length&&(s.unsubscribe(),m(e),o())}),u=null==(a=r.shell.v.ribbonMenu.root.parentElement)?void 0:a.getElementsByClassName("d4-ribbon-name")[0];return u&&(u.textContent="",u.appendChild(l.root)),{breadcrumbs:l,sub:s}}function m(e){let t=e.getRibbonPanels();(null==t?void 0:t.length)&&(t.pop(),e.setRibbonPanels(t))}function f(e){return e.reduce((e,t)=>e||t.reduce((e,t)=>e||t.classList.contains("hit-design-submit-button")||Array.from(t.children).some(e=>e.classList.contains("hit-design-submit-button")),!1),!1)}function g(e,t){return d(function*(){let n=(yield l._package.files.list(`${e}/campaigns`)).filter(e=>-1===t.indexOf(e.name)),i={},o=new Map,s=n.map(t=>d(function*(){try{let n=JSON.parse((yield l._package.files.readAsText(`${e}/campaigns/${t.name}/${a.wS}`)));if(n.authorUserId&&n.permissions&&!(yield y(n.authorUserId,n.permissions,o)))return null;if(n.authorUserId&&!n.authorUserFriendlyName){let e=yield r.dapi.users.find(n.authorUserId);e&&(n.authorUserFriendlyName=e.friendlyName)}i[n.name]=n}catch(n){console.warn(`Skipped campaign ${e}/${t.name}:`,n)}return null})());return yield Promise.all(s),i})()}function v(e,t,n){return d(function*(){try{if(e===o.User.current().id||t.includes(o.Group.defaultGroupsIds["All users"]))return!0;for(let e of t){let t=null==n?void 0:n.get(e);if(void 0===t&&(t=function(e){return d(function*(){var t,n,i,a;let l=o.User.current(),s=yield r.dapi.groups.find(e);if(!s)return!1;if(s.personal)return(null==(i=yield r.dapi.groups.getUser(s))?void 0:i.id)===l.id;let u=null==(a=l.group)?void 0:a.id;return!!u&&[...null!=(t=s.members)?t:[],...null!=(n=s.adminMembers)?n:[]].some(e=>(null==e?void 0:e.id)===u)})()}(e),null==n||n.set(e,t)),yield t)return!0}}catch(e){l._package.logger.error(e)}return!1})()}function b(e,t,n){return d(function*(){return v(e,t.edit,n)})()}function y(e,t,n){return d(function*(){return v(e,Array.from(new Set([...t.view,...t.edit])),n)})()}function _(e){return d(function*(){return e&&""!==e.trim()?!!(yield r.dapi.files.exists(e))||(r.shell.error("Given folder does not exist"),!1):(r.shell.error("Path can not be empty"),!1)})()}function w(e){return d(function*(){return JSON.parse((yield l._package.files.readAsText(e)))})()}},3912(e,t,n){n.d(t,{E:()=>y,H:()=>b});var r=n(4328),i=n(6082),o=n(4281),a=n(5236);function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function s(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}function u(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){s(o,r,i,a,l,"next",e)}function l(e){s(o,r,i,a,l,"throw",e)}a(void 0)})}}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function c(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,i=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var o=[],a=!0,l=!1;try{for(i=i.call(e);!(a=(n=i.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==i.return||i.return()}finally{if(l)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var h=n(2232),m=n(9446);function f(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}function g(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){f(o,r,i,a,l,"next",e)}function l(e){f(o,r,i,a,l,"throw",e)}a(void 0)})}}function v(){return{convertToSmiles:e=>m._package.convertToSmiles(e),logger:m._package.logger,molColName:h.Lz}}function b(e,t,n){return g(function*(e,t,n,l=[],s=[]){return function(e,t,n,l){return u(function*(e,t,n,l,s,p){let h=i.TaskBarProgressIndicator.create("Calculating ..."),m=null!=(O=null==p?void 0:p.convertToSmiles)?O:e=>e,f=null!=(A=null==p?void 0:p.logger)?A:console,g=null!=(S=null==p?void 0:p.molColName)?S:"Molecule",v=e.map(e=>m(e)),b=i.Column.fromStrings(g,v),y=i.DataFrame.fromColumns([b]);y.name="HD cell values",yield y.meta.detectSemanticTypes();let _=[];_.push(new Promise(e=>u(function*(){try{t.length&&(yield r.chem.descriptors(y,b.name,t))}catch(e){f.error("Descriptors calculation error"),f.error(e)}e()})()));var w=!0,x=!1,k=void 0;try{for(var O,A,S,P,E=n[Symbol.iterator]();!(w=(P=E.next()).done);w=!0){let e=P.value;_.push(new Promise(t=>u(function*(){try{let n=e.args,r=i.Func.find({package:e.package,name:e.name});if(!r.length||!r[0]){console.warn(`Function ${e.name} from package ${e.package} is not found`),t();return}let o=r[0],a=o.inputs[0].name,l=o.inputs[1].name;yield o.apply(c(d({},n),{[a]:y,[l]:b.name}))}catch(e){f.error(e)}t()})()))}}catch(e){x=!0,k=e}finally{try{w||null==E.return||E.return()}finally{if(x)throw k}}var C=!0,j=!1,T=void 0;try{for(var N,I=(void 0===l?[]:l)[Symbol.iterator]();!(C=(N=I.next()).done);C=!0){let e=N.value,t=e.args;_.push(new Promise(n=>u(function*(){try{let n=i.Func.find({name:e.name}).filter(t=>t.type===o.Vm.script&&t.id===e.id)[0];if(n){let e=n.inputs[0].name,i=n.inputs[1].name,o=yield n.apply(c(d({},t),{[e]:y,[i]:b.name}));if(o&&o.rowCount===y.rowCount&&"python"===n.language){var r=!0,a=!1,l=void 0;try{for(var s,u=o.columns[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){let e=s.value;e.name=y.columns.getUnusedName(e.name),y.columns.add(e)}}catch(e){a=!0,l=e}finally{try{r||null==u.return||u.return()}finally{if(a)throw l}}}}}catch(e){f.error(e)}n()})()))}}catch(e){j=!0,T=e}finally{try{C||null==I.return||I.return()}finally{if(j)throw T}}var D=!0,L=!1,z=void 0;try{for(var F,B=(void 0===s?[]:s)[Symbol.iterator]();!(D=(F=B.next()).done);D=!0){let e=F.value,t=e.args;_.push(new Promise(n=>u(function*(){try{let r=i.Func.find({name:e.name}).filter(t=>t.type===o.Vm.query&&t.id===e.id)[0];if(r){let e=r.inputs[0].name,i=[v],o=yield r.apply(c(d({},t),{[e]:i}));if(!o||0===o.rowCount)return void n();yield(0,a.vC)(y,g,o)}}catch(e){f.error(e)}n()})()))}}catch(e){L=!0,z=e}finally{try{D||null==B.return||B.return()}finally{if(L)throw z}}yield Promise.all(_),h.close();let M=y.col(g);for(let t=0;t<M.length;t++)M.set(t,e[t],!1);return y}).apply(this,arguments)}(e,t,n,l,s,v())}).apply(this,arguments)}function y(e,t,n){return g(function*(){var l;return l=v(),u(function*(){let s=i.TaskBarProgressIndicator.create("Calculating ..."),h=null!=(O=null==l?void 0:l.convertToSmiles)?O:e=>e,m=null!=(A=null==l?void 0:l.logger)?A:console,f=t.col(n);if(!f)throw Error("There is no molecule column in dataframe");let g=i.Column.fromList(i.COLUMN_TYPE.STRING,n,f.toList().map((e,t)=>f.isNone(t)||!e?null:h(e)));g.semType=i.SEMTYPE.MOLECULE;let v=i.DataFrame.fromColumns([g,...t.columns.toList().filter(e=>e.name&&!e.name.startsWith("~")&&e.name!==n).map(e=>e.clone())]),b=new Map(v.columns.toList().map(e=>[e.name,{dart:e.dart,version:e.version}])),y=new Map([...b.keys()].filter(e=>e!==n).map(e=>[v.columns.getUnusedName(e),e])),_=[];_.push(new Promise(t=>u(function*(){try{e.descriptors&&e.descriptors.length>0&&(yield r.chem.descriptors(v,n,e.descriptors))}catch(e){m.error("Descriptors calculation error"),m.error(e)}t()})()));var w=!0,x=!1,k=void 0;try{for(var O,A,S,P,E,C=Object.keys(e.externals)[Symbol.iterator]();!(w=(E=C.next()).done);w=!0){let t=E.value;_.push(new Promise(r=>u(function*(){try{let r=e.externals[t],o=i.Func.find({package:t.split(":")[0],name:t.split(":")[1]})[0],a=o.inputs[0].name,l=o.inputs[1].name;r&&(yield o.apply(c(d({},r),{[a]:v,[l]:n})))}catch(e){m.error(e)}r()})()))}}catch(e){x=!0,k=e}finally{try{w||null==C.return||C.return()}finally{if(x)throw k}}var j=!0,T=!1,N=void 0;try{for(var I,D=Object.keys(null!=(S=e.scripts)?S:{})[Symbol.iterator]();!(j=(I=D.next()).done);j=!0){let t=I.value,r=e.scripts[t];_.push(new Promise(e=>u(function*(){if(r){let h=t.split(":"),f=h[2];if(!f)return void e();try{let t=h[1],m=i.Func.find({name:t}).filter(e=>e.type===o.Vm.script&&e.id===f)[0];if(!m)return void e();let g=m.inputs[0].name,b=m.inputs[1].name,y=yield m.apply(c(d({},r),{[g]:v,[b]:n}));if(y&&y.rowCount===v.rowCount&&"python"===m.language){var a=!0,l=!1,s=void 0;try{for(var u,p=y.columns[Symbol.iterator]();!(a=(u=p.next()).done);a=!0){let e=u.value;e.name=v.columns.getUnusedName(e.name),v.columns.add(e)}}catch(e){l=!0,s=e}finally{try{a||null==p.return||p.return()}finally{if(l)throw s}}}}catch(e){m.error(e)}}e()})()))}}catch(e){T=!0,N=e}finally{try{j||null==D.return||D.return()}finally{if(T)throw N}}var L=!0,z=!1,F=void 0;try{for(var B,M=Object.keys(null!=(P=e.queries)?P:{})[Symbol.iterator]();!(L=(B=M.next()).done);L=!0){let t=B.value,r=e.queries[t];_.push(new Promise(e=>u(function*(){if(r){let l=t.split(":"),s=l[2];if(!s)return void e();try{let t=l[1],u=i.Func.find({name:t}).filter(e=>e.type===o.Vm.query&&e.id===s)[0];if(!u)return void e();let p=u.inputs[0].name,h=yield u.apply(c(d({},r),{[p]:g.toList()}));h&&(yield(0,a.vC)(v,n,h))}catch(e){console.error(e)}}e()})()))}}catch(e){z=!0,F=e}finally{try{L||null==M.return||M.return()}finally{if(z)throw F}}yield Promise.all(_),s.close();var R=!0,q=!1,H=void 0;try{for(var W,V=v.columns.toList()[Symbol.iterator]();!(R=(W=V.next()).done);R=!0){let e=W.value,o=b.get(e.name);if(e.name===n||void 0!==o&&o.dart===e.dart&&o.version===e.version)continue;let a=o?e.name:null!=(Y=y.get(e.name))?Y:e.name,l=t.col(a);if((null==l?void 0:l.type)===e.type||(null==l?void 0:l.type)===i.COLUMN_TYPE.FLOAT&&e.type===i.COLUMN_TYPE.INT){for(let t=0;t<e.length;t++)l.set(t,e.isNone(t)?null:e.get(t),!1);e.semType&&(l.semType=e.semType);continue}let s=e.clone();if(s.name=a,!l){t.columns.add(s);continue}let u=function(e,t){let n=[];var i=!0,o=!1,a=void 0;try{for(var l,s=r.shell.tableViews[Symbol.iterator]();!(i=(l=s.next()).done);i=!0){let r=l.value;if((null==(h=r.dataFrame)?void 0:h.dart)===e.dart){var u=!0,d=!1,c=void 0;try{for(var h,m,f,g=r.viewers[Symbol.iterator]();!(u=(f=g.next()).done);u=!0){let e=f.value,r=Object.fromEntries(Object.entries(null!=(m=e.getOptions(!0).look)?m:{}).filter(e=>{let n=p(e,2),r=n[0],i=n[1];return r.endsWith("ColumnName")?i===t:r.endsWith("ColumnNames")?Array.isArray(i)&&i.includes(t):"filters"===r&&Array.isArray(i)&&i.some(e=>(null==e?void 0:e.column)===t)}));Object.keys(r).length>0&&n.push([e,r])}}catch(e){d=!0,c=e}finally{try{u||null==g.return||g.return()}finally{if(d)throw c}}}}}catch(e){o=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(o)throw a}}return n}(t,a);t.columns.replace(l,s);var G=!0,U=!1,K=void 0;try{for(var Y,Q,J=u[Symbol.iterator]();!(G=(Q=J.next()).done);G=!0){let e=p(Q.value,2),t=e[0],n=e[1];t.setOptions(n)}}catch(e){U=!0,K=e}finally{try{G||null==J.return||J.return()}finally{if(U)throw K}}}}catch(e){q=!0,H=e}finally{try{R||null==V.return||V.return()}finally{if(q)throw H}}t.fireValuesChanged()})()})()}},9861(e,t,n){n.d(t,{AO:()=>g,Ed:()=>E,Ee:()=>x,RA:()=>C,Ty:()=>b,f_:()=>P,h$:()=>k,lj:()=>O,pR:()=>w,tr:()=>v,uS:()=>_,zS:()=>f});var r=n(6082),i=n(4328),o=n(6788),a=n(5234),l=n(2232),s=n(3912),u=n(532),d=n(9446);function c(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}function p(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){c(o,r,i,a,l,"next",e)}function l(e){c(o,r,i,a,l,"throw",e)}a(void 0)})}}let h=["molecule","smiles","mol","structure","canonical_smiles","canonicalsmiles"],m=["v-id","vid","v_id"],f=["csv",...a.C.molFileExtReaders.map(e=>e.ext)];function g(e){var t,n,r;let i=null==(n=e.extension)?void 0:n.toLowerCase();if(i)return i;let o=null!=(t=null==(r=e.name)?void 0:r.toLowerCase())?t:"",a=o.lastIndexOf(".");return a>=0?o.slice(a+1):""}function v(e){return p(function*(){let t=g(e);return"csv"===t?r.DataFrame.fromCsv((yield e.readAsString())):y(t,(yield e.readAsBytes()))})()}function b(e){return p(function*(){var t,n;let i=null!=(t=null==(n=e.name.split(".").pop())?void 0:n.toLowerCase())?t:"";return"csv"===i?r.DataFrame.fromCsv((yield e.text())):y(i,new Uint8Array((yield e.arrayBuffer())))})()}function y(e,t){return p(function*(){let n=a.C.molFileExtReaders.find(t=>t.ext===e);if(!n||!t)return null;let r=n.handlerFunc.inputs[0].name,i=yield n.handlerFunc.apply({[r]:t});return Array.isArray(i)?i[0]:i})()}function _(e){var t;let n=e.filter(e=>e.semType===r.SEMTYPE.MOLECULE);if(n.length>0){let e=n.find(e=>h.includes(e.name.toLowerCase()));return null!=e?e:n[0]}let i=e.find(e=>h.includes(e.name.toLowerCase()));return i||(null!=(t=e.find(e=>e.type===r.COLUMN_TYPE.STRING))?t:null)}function w(e){let t=e.find(e=>m.includes(e.name.toLowerCase()));if(t)return t;let n=e.find(e=>e.semType===l.pr);return n||null}let x=".hit-design-placeholder";function k(e){return"true"===e.getTag(x)&&e.stats.missingValueCount===e.length}function O(e){var t,n;let r=(null!=(t=e.fullPath)?t:"").toLowerCase(),i=(null!=(n=e.name)?n:"").toLowerCase();return!r||r===i}function A(e,t,n,i){try{if(e.type===t.type)return void e.set(n,t.get(i),!1);if(e.type===r.COLUMN_TYPE.STRING)return void e.set(n,t.getString(i),!1);let o=t.get(i);if(e.type===r.COLUMN_TYPE.INT)return void("number"==typeof o?e.set(n,Math.round(o),!1):"string"==typeof o&&o.length>0&&!isNaN(Number(o))&&e.set(n,Math.round(Number(o)),!1));if(e.type===r.COLUMN_TYPE.FLOAT)return void("number"==typeof o?e.set(n,o,!1):"string"==typeof o&&o.length>0&&!isNaN(Number(o))&&e.set(n,Number(o),!1));e.set(n,o,!1)}catch(r){d._package.logger.error(`Merge: failed to set ${e.name}[${n}] from ${t.name}[${i}]: ${r}`)}}function S(e,t){if(e.isNone(t))return!0;if(e.type===r.COLUMN_TYPE.STRING){let n=e.get(t);return""===n||null==n}return!1}function P(e,t,n){return p(function*(e,t,n,r=function(e){var t,n,r,i;if(!e.dataFrame)throw Error("Campaign has no data");return{df:e.dataFrame,molColName:e.molColName,campaignId:e.campaignId,stages:e.stages,compute:null!=(t=null==(r=e.campaign)||null==(n=r.template)?void 0:n.compute)?t:null==(i=e.template)?void 0:i.compute}}(e)){let a=r.df,c=r.molColName,p=n.addNewRows&&!!n.molColName,h=n.runComputeOnNewRows&&p,{map:m}=function(e,t,n){let r=Array(e.rowCount).fill(null),i=new Map;if("smiles"===n){let n=e.col(t);if(!n)throw Error(`Campaign has no molecule column "${t}"`);for(let t=0;t<e.rowCount;t++){let e=n.get(t);if(!e)continue;let o=d._package.convertToSmiles(e);o&&"MALFORMED_INPUT_VALUE"!==o&&(r[t]=o,i.has(o)||i.set(o,t))}}else{let t=e.col(l.Hz);if(!t)throw Error(`Campaign has no "${l.Hz}" column`);for(let n=0;n<e.rowCount;n++){let e=t.get(n);e&&(r[n]=e,i.has(e)||i.set(e,n))}}return{keys:r,map:i}}(a,c,n.mode),f=function(e,t){let n=Array(e.rowCount).fill(null);if("smiles"===t.mode){let r=e.col(t.molColName);if(!r)throw Error(`Incoming table has no column "${t.molColName}"`);for(let t=0;t<e.rowCount;t++){let e=r.get(t);if(!e)continue;let i=d._package.convertToSmiles(e);i&&"MALFORMED_INPUT_VALUE"!==i&&(n[t]=i)}}else{let r=e.col(t.vidColName);if(!r)throw Error(`Incoming table has no column "${t.vidColName}"`);for(let t=0;t<e.rowCount;t++){let e=r.get(t);e&&(n[t]=String(e))}}return n}(t,n),g=[],v=[];for(let e=0;e<t.rowCount;e++){let t=f[e];if(!t)continue;let n=m.get(t);void 0!==n?g.push({campRow:n,incRow:e}):p&&v.push(e)}let b=null;if(h&&n.molColName&&v.length>0){let e=r.compute,o=t.col(n.molColName);if(e&&o){var y,_,w;let t=v.map(e=>o.get(e)),n=e.descriptors.enabled&&null!=(y=e.descriptors.args)?y:[];try{b=yield(0,s.H)(t,n,e.functions,null!=(_=e.scripts)?_:[],null!=(w=e.queries)?w:[])}catch(e){d._package.logger.error(e),i.shell.warning("Merge: compute pipeline failed; merging without computed columns.")}}}let x=function(e,t,n,r){let i=[];for(let t of o.OD.listedColumns(e)){if("smiles"===r.mode&&t.name===l.Hz)continue;let e=t.name;r.molColName&&t.name===r.molColName&&(e=n),"vid"===r.mode&&r.vidColName&&t.name===r.vidColName&&(e=l.Hz),i.push({col:t,target:e,isComputed:!1})}if(t)for(let e of o.OD.listedColumns(t))e.name!==l.Lz&&e.name!==n&&(i.some(t=>t.target===e.name)||i.push({col:e,target:e.name,isComputed:!0}));return i}(t,b,c,n),O=new Set;for(let e of x){let t=a.col(e.target);(null===t||k(t))&&(null===t?a.columns.addNew(e.target,e.col.type):t.type!==e.col.type&&a.changeColumnType(e.target,e.col.type),e.col.semType&&(a.col(e.target).semType=e.col.semType),O.add(e.target))}let P=a.rowCount;e.joining++;try{for(let{campRow:e,incRow:t}of g)for(let r of x){if(r.isComputed||"smiles"===n.mode&&r.target===c||"vid"===n.mode&&r.target===l.Hz)continue;let i=a.col(r.target);if(!i)continue;let o=S(i,e);(O.has(r.target)||o||"overwrite"===n.clashStrategy)&&A(i,r.col,e,t)}let e=r.stages.length>0&&a.columns.contains(l.yJ);for(let t=0;t<v.length;t++){let n=v[t];a.rows.addNew(null,!0);let i=a.rowCount-1;for(let e of x){let r=e.isComputed?t:n;A(a.col(e.target),e.col,i,r)}if(e){let e=a.col(l.yJ);S(e,i)&&e.set(i,r.stages[0],!1)}}}finally{e.joining--}let E=n.molColName?t.col(n.molColName):null,C=a.col(l.Hz),j=E?v.map(e=>E.get(e)).filter(e=>!!e&&""!==e):[];if(E&&C&&r.campaignId&&j.length>0)try{let t=yield(0,u.l9)(j,r.campaignId,e.appName);for(let e=0;e<v.length;e++){let n=E.get(v[e]),r=n?t.get(n):void 0;r&&C.set(P+e,r,!1)}}catch(e){d._package.logger.error(e)}a.fireValuesChanged()}).apply(this,arguments)}function E(e,t,n,r,i){if(!r.col(n)||!t.col(n))throw Error("Molecule column not found");let o=e=>{let t=null==e?void 0:e.col(n),r=t?Array.from({length:e.rowCount},(e,n)=>{var r;let i;return(i=(r=t.get(n))?d._package.convertToSmiles(r):null)&&"MALFORMED_INPUT_VALUE"!==i?i:null}):[],i=new Map,o=new Set;for(let[e,t]of r.entries())null!==t&&(i.has(t)&&o.add(t),i.set(t,e));return{keys:r,rows:i,twice:o}},a=o(t),l=o(r),s=o(i);e.joining++;try{let e=new Set;for(let n of r.columns){let r=t.col(n.name);(null===r||k(r))&&(null===r?t.columns.addNew(n.name,n.type):r.type!==n.type&&t.changeColumnType(n.name,n.type),n.semType&&(t.col(n.name).semType=n.semType),e.add(n.name))}for(let o=0;o<r.rowCount;o++){let u=l.keys[o];if(null===u)continue;let d=a.rows.get(u);if(void 0===d){for(let e of(t.rows.addNew(null,!0),r.columns))A(t.col(e.name),e,t.rowCount-1,o);continue}let c=s.rows.get(u),p=void 0!==c&&!a.twice.has(u)&&!l.twice.has(u)&&!s.twice.has(u);for(let a of r.columns){if(a.name===n)continue;let r=t.col(a.name);if(e.has(a.name)){A(r,a,d,o);continue}let l=null==i?void 0:i.col(a.name),s=l?l.getString(c):"";p&&r.getString(d)===s&&r.getString(d)!==a.getString(o)&&A(r,a,d,o)}}}finally{e.joining--}t.fireValuesChanged()}function C(e,t,n){return p(function*(){if((null==t?void 0:t.autoMergeOnOpen)&&t.filePath)try{var o,a;if(!(yield i.dapi.files.exists(t.filePath)))return void i.shell.warning(`Auto-merge: source file not found or not accessible: ${t.filePath}`);let l=r.FileInfo.fromString(t.filePath,""),s=yield v(l);if(!s)return void i.shell.warning("Auto-merge: could not read the saved source file; merge skipped.");yield s.meta.detectSemanticTypes(),yield i.data.detectSemanticTypes(s);let u=(o=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},t),a={runComputeOnNewRows:!1},a=null!=a?a:{},Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(a)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(a)).forEach(function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(a,e))}),o);yield P(e,s,u,n)}catch(e){d._package.logger.error(e),i.shell.warning("Auto-merge failed; opening the campaign without merging.")}})()}},532(e,t,n){n.d(t,{Go:()=>m,g$:()=>g,jD:()=>p,l9:()=>f});var r=n(7389),i=n(4328),o=n(6082),a=n(9446),l=n(6287),s=n(2232);function u(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}function d(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){u(o,r,i,a,l,"next",e)}function l(e){u(o,r,i,a,l,"throw",e)}a(void 0)})}}function c(e){var t;let n=null==(t=a._package.meta)?void 0:t.sok;if(!n)throw Error("Secret key for SMILES obfuscation is not set");let r="";for(let t=0;t<e.length;t++)r+=String.fromCharCode(e.charCodeAt(t)^n.charCodeAt(t%n.length));return btoa(r)}function p(e){var t;let n=null==(t=a._package.meta)?void 0:t.sok;if(!n)throw Error("Secret key for SMILES deobfuscation is not set");let r=atob(e),i="";for(let e=0;e<r.length;e++)i+=String.fromCharCode(r.charCodeAt(e)^n.charCodeAt(e%n.length));return i}function h(){var e,t,n;let r=o.User.current();return null!=(e=null!=(t=null!=(n=null==r?void 0:r.login)?n:null==r?void 0:r.friendlyName)?t:r.name)?e:"unknown user"}function m(e,t,n){return d(function*(){let r=a._package.convertToSmiles(e);if(!r||""===r||"MALFORMED_INPUT_VALUE"===r)return"";let o=c(r),s=yield l.P.addMolecule(o,n,t,h());return 0!==s.rowCount&&s.col("vid")?s.col("vid").getString(0):(i.shell.error("Molecule registration returned no data"),"")})()}function f(e,t,n){return d(function*(){let r=new Map,o=new Map;if(e.forEach((e,t)=>{let n=a._package.convertToSmiles(e);n&&""!==n&&"MALFORMED_INPUT_VALUE"!==n&&(o.has(n)||o.set(n,[]),o.get(n).push(t))}),0===o.size)return r;let s=Array.from(o.keys());for(let u=0;u<s.length;u+=50){let d=s.slice(u,u+50);if(0!==d.length)try{let i=d.map(e=>c(e)),a=yield l.P.addMolecules(i,n,t,h());if(!a||a.rowCount!==d.length||!a.col("vid"))throw console.error("Molecule registration returned incomplete data for batch",`${u}-${u+d.length}`,`Batch size: ${d.length}, Result rows: ${null==a?void 0:a.rowCount}. Vid column found: ${!!(null==a?void 0:a.col("vid"))}`),Error("Resulting molecule registration has no or incomplete data");let s=a.col("vid").toList();for(let t=0;t<a.rowCount;t++){let n=o.get(d[t]),i=s[t];for(let t of n)r.set(e[t],i)}}catch(e){i.shell.error("Error registering molecules batch. see console for details."),a._package.logger.error(e)}}return r})()}function g(){return d(function*(){let e="Hit Design",t=yield a._package.loadCampaigns(e),n=Object.keys(t),l=r.input.choice("Select Campaign",{value:null,nullable:!0,items:n,tooltipText:"Select campaign to register its molecules. Leave empty to register all campaigns"}),u=yield new Promise(e=>d(function*(){r.dialog("Register Existing Campaign Molecules").add(r.divText("This operation will go through all molecules in the selected campaign(s) and register them into V-iD storage.\n This operation is irreversible.")).add(r.divText("You can select a specific campaign or leave it empty to process all campaigns.")).add(r.divText("After this opteration, all VIDs throughout all campaigns will become unique, and old V-iDs will no longer be valid.")).add(r.divText("WARNING: Depending on the number of molecules, this operation can take a long time.")).add(l).onOK(()=>{l.value?e([t[l.value]]):e(n.map(e=>t[e]))}).onCancel(()=>e(null)).show()})()),c=o.TaskBarProgressIndicator.create("Registering molecules...");if(!u||0===u.length)return void c.close();let p=u.length;for(let t of u){c.update(0/p*100,`Processing campaign: ${t.name}`);try{var h;let n=`System.AppData/HitTriage/${e}/campaigns`,r=null!=(h=null==t?void 0:t.savePath)?h:`${n}/${t.name}/${s.mz}`,o=yield i.dapi.files.readCsv(r);if(!o){i.shell.warning(`Failed to load campaign table for campaign ${t.name} at path ${r}`),console.warn(`Failed to load campaign table for campaign ${t.name} at path ${r}`);continue}let a=o.col(s.Lz);if(!a){i.shell.warning(`Molecule column not found in campaign ${t.name} table`),console.warn(`Molecule column not found in campaign ${t.name} table`);continue}let l=o.col(s.Hz);if(!l){i.shell.warning(`V-iD column not found in campaign ${t.name} table`),console.warn(`V-iD column not found in campaign ${t.name} table`);continue}let u=a.toList(),d=yield f(u,t.name,e);for(let e=0;e<o.rowCount;e++){let t=u[e];if(!t||""===t){l.set(e,"",!1);continue}let n=d.get(t);n&&l.set(e,n,!1)}l.fireValuesChanged(),yield i.dapi.files.writeAsText(r,o.toCsv()),i.shell.info(`Finished processing campaign ${t.name}`),console.log(`Finished processing campaign ${t.name}`)}catch(e){i.shell.error(`Error processing campaign ${t.name}. See console for details.`),console.error(`Error processing campaign ${t.name} molecules registration:`,e)}}c.close()})()}},6287(e,t,n){n.d(t,{P:()=>o});var r,i,o,a,l=n(4328);function s(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}function u(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){s(o,r,i,a,l,"next",e)}function l(e){s(o,r,i,a,l,"throw",e)}a(void 0)})}}(r=o||(o={})).acquireCampaignLock=function(e,t,n){return u(function*(){return yield l.data.query("HitTriage:AcquireCampaignLock",{appName:e,campaignId:t,lockedBy:n})})()},r.releaseCampaignLock=function(e,t){return u(function*(){return yield l.data.query("HitTriage:ReleaseCampaignLock",{appName:e,campaignId:t})})()},r.getLastModified=function(e,t){return u(function*(){return yield l.data.query("HitTriage:GetLastModified",{appName:e,campaignId:t})})()},r.getLastModifiedAll=function(e){return u(function*(){return yield l.data.query("HitTriage:GetLastModifiedAll",{appName:e})})()},r.dropCampaignLock=function(e,t,n){return u(function*(){return yield l.data.query("HitTriage:DropCampaignLock",{appName:e,campaignId:t,lockedBy:n})})()},r.deleteCampaignRecords=function(e,t){return u(function*(){return yield l.data.query("HitTriage:DeleteCampaignRecords",{appName:e,campaignId:t})})()},r.addMolecule=function(e,t,n,r){return u(function*(){return yield l.data.query("HitTriage:AddMolecule",{canonicalSmiles:e,appName:t,campaignId:n,createdBy:r})})()},r.addMolecules=function(e,t,n,r){return u(function*(){return yield l.data.query("HitTriage:AddMolecules",{smiles:e,appName:t,campaignId:n,createdBy:r})})()},r.getMoleculeByVid=function(e){return u(function*(){return yield l.data.query("HitTriage:GetMoleculeByVid",{vid:e})})()},r.getCampaignsByVid=function(e,t){return u(function*(){return yield l.data.query("HitTriage:GetCampaignsByVid",{vid:e,appName:t})})()},(i=a||(a={})).initHT=function(){return u(function*(){return yield l.functions.call("HitTriage:InitHT",{})})()},i.hitTriageAppTreeBrowser=function(e){return u(function*(){return yield l.functions.call("HitTriage:HitTriageAppTreeBrowser",{treeNode:e})})()},i.hitDesignAppTreeBrowser=function(e){return u(function*(){return yield l.functions.call("HitTriage:HitDesignAppTreeBrowser",{treeNode:e})})()},i.peptiHitAppTreeBrowser=function(e){return u(function*(){return yield l.functions.call("HitTriage:PeptiHitAppTreeBrowser",{treeNode:e})})()},i.hitTriageApp=function(e){return u(function*(){return yield l.functions.call("HitTriage:HitTriageApp",{campaignId:e})})()},i.hitDesignApp=function(e){return u(function*(){return yield l.functions.call("HitTriage:HitDesignApp",{campaignId:e})})()},i.peptiHitApp=function(e){return u(function*(){return yield l.functions.call("HitTriage:PeptiHitApp",{campaignId:e})})()},i.pepTriageAppTreeBrowser=function(e){return u(function*(){return yield l.functions.call("HitTriage:PepTriageAppTreeBrowser",{treeNode:e})})()},i.pepTriageApp=function(e){return u(function*(){return yield l.functions.call("HitTriage:PepTriageApp",{campaignId:e})})()},i.demoFileIngest=function(){return u(function*(){return yield l.functions.call("HitTriage:DemoFileIngest",{})})()},i.demoFileIngest1=function(){return u(function*(){return yield l.functions.call("HitTriage:DemoFileIngest1",{})})()},i.demoFileIngest2=function(e){return u(function*(){return yield l.functions.call("HitTriage:DemoFileIngest2",{numberOfMolecules:e})})()},i.demoPeptideSequences=function(e){return u(function*(){return yield l.functions.call("HitTriage:DemoPeptideSequences",{peptideCount:e})})()},i.demoFileSubmit=function(e,t){return u(function*(){return yield l.functions.call("HitTriage:DemoFileSubmit",{df:e,molecules:t})})()},i.registerMoleculesToViD=function(){return u(function*(){return yield l.functions.call("HitTriage:RegisterMoleculesToViD",{})})()},i.hitDesignVidPanel=function(e){return u(function*(){return yield l.functions.call("HitTriage:HitDesignVidPanel",{vid:e})})()},i.gasteigerCellRenderer=function(){return u(function*(){return yield l.functions.call("HitTriage:GasteigerCellRenderer",{})})()},i.htPackageSettingEditor=function(e){return u(function*(){return yield l.functions.call("HitTriage:HtPackageSettingEditor",{propList:e})})()}},9446(e,t,n){n.r(t),n.d(t,{demoFileIngest2:()=>C,pepTriageApp:()=>S,peptiHitApp:()=>O,demoFileSubmit:()=>T,hitDesignAppTreeBrowser:()=>_,hitDesignApp:()=>k,pepTriageAppTreeBrowser:()=>A,htPackageSettingEditor:()=>L,peptiHitAppTreeBrowser:()=>w,registerMoleculesToViD:()=>N,initHT:()=>b,demoFileIngest1:()=>E,demoFileIngest:()=>P,gasteigerCellRenderer:()=>D,hitTriageApp:()=>x,hitDesignVidPanel:()=>I,HTPackage:()=>q,_package:()=>H,demoPeptideSequences:()=>j,PackageFunctions:()=>V,hitTriageAppTreeBrowser:()=>y});var r=n(4328),i=n(7389),o=n(6082),a=n(4025),l=n(2684);class s extends o.GridCellRenderer{get name(){return"customGasteigerPNG"}get cellType(){return"customGasteigerPNG"}get defaultHeight(){return 200}get defaultWidth(){return 200}render(e,t,n,r,i,o,a){if(o.gridRow<0||!o.cell.value)return;let l=o.cell.value,s=new Image(r-2,i-2);s.src="data:image/png;base64,"+l,s.onload=function(){e.drawImage(s,t+2,n+2,r-2,i-2)}}}var u=n(1259),d=n(1428),c=n(980),p=n(2232),h=n(4958),m=n(532),f=n(6287);function g(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}function v(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){g(o,r,i,a,l,"next",e)}function l(e){g(o,r,i,a,l,"throw",e)}a(void 0)})}}function b(){return v(function*(){yield V.initHT()})()}function y(e){return v(function*(){yield V.hitTriageAppTreeBrowser(e)})()}function _(e){return v(function*(){yield V.hitDesignAppTreeBrowser(e)})()}function w(e){return v(function*(){yield V.peptiHitAppTreeBrowser(e)})()}function x(e){return v(function*(){return yield V.hitTriageApp(e)})()}function k(e){return v(function*(){return yield V.hitDesignApp(e)})()}function O(e){return v(function*(){return yield V.peptiHitApp(e)})()}function A(e){return v(function*(){yield V.pepTriageAppTreeBrowser(e)})()}function S(e){return v(function*(){return yield V.pepTriageApp(e)})()}function P(){return v(function*(){return yield V.demoFileIngest()})()}function E(){return v(function*(){return yield V.demoFileIngest1()})()}function C(e){return v(function*(){return yield V.demoFileIngest2(e)})()}function j(e){return v(function*(){return yield V.demoPeptideSequences(e)})()}function T(e,t){return v(function*(){yield V.demoFileSubmit(e,t)})()}function N(){return v(function*(){yield V.registerMoleculesToViD()})()}function I(e){return V.hitDesignVidPanel(e)}function D(){return V.gasteigerCellRenderer()}function L(e){return v(function*(){return yield V.htPackageSettingEditor(e)})()}function z(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}function F(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){z(o,r,i,a,l,"next",e)}function l(e){z(o,r,i,a,l,"throw",e)}a(void 0)})}}function B(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a}function M(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function R(e,t){return function(n,r){t(n,r,e)}}class q extends o.Package{convertToSmiles(e){return e?this.molToSmilesLruCache.getOrCreate(e,e=>r.chem.convert(e,r.chem.Notation.Unknown,r.chem.Notation.Smiles)):""}loadCampaigns(e,t,n=!1){return F(function*(){return(n||!this.campaignsCache[e])&&(this.campaignsCache[e]=yield(0,u.S)(e,null!=t?t:[])),this.campaignsCache[e]}).call(this)}saveCampaignJson(e,t){return F(function*(){let n=`${e}/campaigns/${t.name}/${p.wS}`;yield this.files.writeAsText(n,JSON.stringify(t));let r=this.campaignsCache[e];r&&(r[t.name]=t)}).call(this)}constructor(...e){super(...e),this.molToSmilesLruCache=new o.LruCache(2e3),this.campaignsCache={}}}let H=new q;function W(e,t){return F(function*(){let n=i.div([],{style:{width:"50px",height:"24px",position:"relative"}});n.innerHTML='<div class="grok-loader"><div></div><div></div><div></div><div></div></div>';let a=e.item(n),l=yield H.loadCampaigns(t,[]),s=null,u=!0;for(let[t,n]of Object.entries(l)){var d,c,h;let t=null!=(d=n.templateName)?d:null==(h=n.template)?void 0:h.name,i=t?e.getOrCreateGroup(t,null,u):e;u=!1;let a=i.item(null!=(c=n.friendlyName)?c:n.name);a.root.addEventListener("dblclick",e=>{e.stopImmediatePropagation(),e.stopPropagation(),e.preventDefault()}),o.debounce(a.onSelected,200).subscribe(e=>F(function*(){try{var e;let l="ingest"in n?n.ingest.query:n.savePath;if(!l||!(yield r.dapi.files.exists(l)))return void r.shell.error("File not found: "+l);let u=yield r.dapi.files.readCsv(l);if(!u)return;u.name=null!=(e=n.friendlyName)?e:n.name;let d=n.columnSemTypes;if(d)for(let[e,t]of Object.entries(d)){let n=u.columns.byName(e);n&&(n.semType=t,t===o.SEMTYPE.MACROMOLECULE&&e===p.Zf&&(n.setTag("units","helm"),n.setTag(".alphabetIsMultichar","true"),n.setTag("cell.renderer","helm")))}let c=document.activeElement,h=!1;function t(){setTimeout(()=>{!h&&c&&document.activeElement!==c&&c&&"focus"in c&&c.focus()})}window.addEventListener("focusout",t);try{s&&s.close()}catch(e){}try{s=r.shell.addTableView(u);let e=n.layout;e&&s.loadLayout(o.ViewLayout.fromViewState(e))}catch(e){console.error(e)}function i(){window.removeEventListener("focusout",t)}function a(){i(),h=!0}window.addEventListener("click",a,{once:!0}),setTimeout(()=>{i(),window.removeEventListener("click",a)},5e3)}catch(e){console.error(e)}})())}a.remove()})()}class V{static initHT(){return F(function*(){try{yield r.functions.call("Chem:init",{})}catch(e){console.error("error initializing chem package",e)}})()}static hitTriageAppTreeBrowser(e){return F(function*(){yield W(e,"Hit Triage")})()}static hitDesignAppTreeBrowser(e){return F(function*(){yield W(e,"Hit Design")})()}static peptiHitAppTreeBrowser(e){return F(function*(){yield W(e,"PeptiHit")})()}static hitTriageApp(e){return F(function*(){let e=r.functions.getCurrentCall();return new a.P(e).multiView})()}static hitDesignApp(e){return F(function*(){let e=r.functions.getCurrentCall();return new l.J(e).multiView})()}static peptiHitApp(e){return F(function*(){let e=r.functions.getCurrentCall();return yield r.functions.call("Bio:initBio",{}),new d.r(e).multiView})()}static pepTriageAppTreeBrowser(e){return F(function*(){yield W(e,"PepTriage")})()}static pepTriageApp(e){return F(function*(){let e=r.functions.getCurrentCall();return yield r.functions.call("Bio:initBio",{}),new c.z(e).multiView})()}static demoFileIngest(){return F(function*(){let e=r.data.demo.molecules(100);return e.name="100 Molecules",e})()}static demoFileIngest1(){return F(function*(){let e=r.data.demo.molecules(5e3);return e.name="5000 Molecules",e})()}static demoFileIngest2(e){return F(function*(){let t=r.data.demo.molecules(e);return t.name="Variable Molecules number",t})()}static demoPeptideSequences(e){return F(function*(){let t=["PEPTIDE1{A.G.L.V.K}$$$$V2.0","PEPTIDE1{G.A.V.L.I.P}$$$$V2.0","PEPTIDE1{F.W.Y.H.K.R}$$$$V2.0","PEPTIDE1{D.E.N.Q.S.T}$$$$V2.0","PEPTIDE1{A.R.N.D.C.E}$$$$V2.0","PEPTIDE1{G.H.I.L.K.M}$$$$V2.0","PEPTIDE1{F.P.S.T.W.Y}$$$$V2.0","PEPTIDE1{V.A.G.L.I}$$$$V2.0","PEPTIDE1{K.R.H.D.E}$$$$V2.0","PEPTIDE1{N.Q.S.T.C.M}$$$$V2.0","PEPTIDE1{A.V.L.I.P.F}$$$$V2.0","PEPTIDE1{W.Y.G.A.R}$$$$V2.0","PEPTIDE1{K.H.D.E.N.Q}$$$$V2.0","PEPTIDE1{S.T.C.M.F.W}$$$$V2.0","PEPTIDE1{Y.A.G.V.L.I}$$$$V2.0","PEPTIDE1{P.K.R.H.D}$$$$V2.0","PEPTIDE1{E.N.Q.S.T.C}$$$$V2.0","PEPTIDE1{M.F.W.Y.A.G}$$$$V2.0","PEPTIDE1{V.L.I.P.K.R}$$$$V2.0","PEPTIDE1{H.D.E.N.Q.S}$$$$V2.0"],n=[];for(let r=0;r<e;r++)n.push(t[r%t.length]);let r=o.Column.fromStrings("Helm",n);r.semType=o.SEMTYPE.MACROMOLECULE,r.setTag("units","helm"),r.setTag(".alphabetIsMultichar","true");let i=o.DataFrame.fromColumns([r]);return i.name="Demo Peptide Sequences",i})()}static demoFileSubmit(e,t){return F(function*(){r.shell.info(e.rowCount),r.shell.info(t)})()}static registerMoleculesToViD(){return F(function*(){(0,m.g$)()})()}static hitDesignVidPanel(e){return o.Widget.fromRoot(i.card(i.wait(()=>F(function*(){if(!(null==e?void 0:e.value))return i.divText("No V-iD provided");let t=yield f.P.getCampaignsByVid(e.value,null);if(!t||0===t.rowCount)return i.divText(`No campaigns found for V-iD: ${e.value}`);let n=yield f.P.getMoleculeByVid(e.value);if(!n||0===n.rowCount)return i.divText(`No molecule found for V-iD: ${e.value}`);let o=(0,m.jD)(n.col("mh_string").get(0)),a=r.chem.drawMolecule(o,300,300),l=new Map;for(let e=0;e<t.rowCount;e++){let n=t.col("app_name").get(e),r=t.col("campaign_id").get(e),i=t.col("created_by").get(e);l.has(n)||l.set(n,[]),l.get(n).push({campaignId:r,createdBy:i})}let s=i.divV([a],{style:{gap:"10px",justifyContent:"center"}});for(let[e,t]of l.entries()){let n=i.table(t.map(e=>[e.campaignId,e.createdBy]),e=>[e[0],e[1]],["Campaigns","Created By"]),r=i.divV([i.h3(`${e} Campaigns`),n],{style:{gap:"4px"}});s.appendChild(r)}return s})())))}static gasteigerCellRenderer(){return new s}static htPackageSettingEditor(e){return F(function*(){return(0,h.X4)(e)})()}}B([r.decorators.init(),M("design:type",Function),M("design:paramtypes",[]),M("design:returntype",Promise)],V,"initHT",null),B([r.decorators.treeBrowser({meta:{app:"Hit Triage"}}),M("design:type",Function),M("design:paramtypes",[void 0===o||void 0===o.TreeViewGroup?Object:o.TreeViewGroup]),M("design:returntype",Promise)],V,"hitTriageAppTreeBrowser",null),B([r.decorators.treeBrowser({meta:{app:"Hit Design"}}),M("design:type",Function),M("design:paramtypes",[void 0===o||void 0===o.TreeViewGroup?Object:o.TreeViewGroup]),M("design:returntype",Promise)],V,"hitDesignAppTreeBrowser",null),B([r.decorators.treeBrowser({meta:{app:"PeptiHit"}}),M("design:type",Function),M("design:paramtypes",[void 0===o||void 0===o.TreeViewGroup?Object:o.TreeViewGroup]),M("design:returntype",Promise)],V,"peptiHitAppTreeBrowser",null),B([r.decorators.app({browsePath:"Chem",name:"Hit Triage",tags:["app"]}),R(0,r.decorators.param({name:"campaignId",options:{optional:!0}})),M("design:type",Function),M("design:paramtypes",[String]),M("design:returntype",Promise)],V,"hitTriageApp",null),B([r.decorators.app({icon:"images/icons/hit-design-icon.png",browsePath:"Chem",name:"Hit Design",tags:["app"]}),R(0,r.decorators.param({name:"campaignId",options:{optional:!0}})),M("design:type",Function),M("design:paramtypes",[String]),M("design:returntype",Promise)],V,"hitDesignApp",null),B([r.decorators.app({icon:"images/icons/pepti-hit-icon.png",browsePath:"Peptides",name:"PeptiHit",tags:["app"]}),R(0,r.decorators.param({name:"campaignId",options:{optional:!0}})),M("design:type",Function),M("design:paramtypes",[String]),M("design:returntype",Promise)],V,"peptiHitApp",null),B([r.decorators.treeBrowser({meta:{app:"PepTriage"}}),M("design:type",Function),M("design:paramtypes",[void 0===o||void 0===o.TreeViewGroup?Object:o.TreeViewGroup]),M("design:returntype",Promise)],V,"pepTriageAppTreeBrowser",null),B([r.decorators.app({icon:"images/icons/hit-triage-icon.png",browsePath:"Peptides",name:"PepTriage",tags:["app"]}),R(0,r.decorators.param({name:"campaignId",options:{optional:!0}})),M("design:type",Function),M("design:paramtypes",[String]),M("design:returntype",Promise)],V,"pepTriageApp",null),B([r.decorators.func({name:"Demo Molecules 100",meta:{role:"hitTriageDataSource"}}),M("design:type",Function),M("design:paramtypes",[]),M("design:returntype",Promise)],V,"demoFileIngest",null),B([r.decorators.func({name:"Demo Molecules 5000",meta:{role:"hitTriageDataSource"}}),M("design:type",Function),M("design:paramtypes",[]),M("design:returntype",Promise)],V,"demoFileIngest1",null),B([r.decorators.func({name:"Demo Molecules variable",meta:{role:"hitTriageDataSource"}}),R(0,r.decorators.param({type:"int",options:{description:"Molecules counts"}})),M("design:type",Function),M("design:paramtypes",[Number]),M("design:returntype",Promise)],V,"demoFileIngest2",null),B([r.decorators.func({name:"Demo Peptide Sequences",meta:{role:"pepTriageDataSource"}}),M("design:type",Function),M("design:paramtypes",[Number]),M("design:returntype",Promise)],V,"demoPeptideSequences",null),B([r.decorators.func({name:"Demo File Submit",meta:{role:"hitTriageSubmitFunction"}}),R(0,r.decorators.param({options:{description:"Dataframe"}})),R(1,r.decorators.param({options:{description:"Molecules column name"}})),M("design:type",Function),M("design:paramtypes",[void 0===o||void 0===o.DataFrame?Object:o.DataFrame,String]),M("design:returntype",Promise)],V,"demoFileSubmit",null),B([r.decorators.func({}),M("design:type",Function),M("design:paramtypes",[]),M("design:returntype",Promise)],V,"registerMoleculesToViD",null),B([r.decorators.panel({name:"Hit Design V-iD"}),R(0,r.decorators.param({type:"semantic_value",options:{semType:"HIT_DESIGN_VID"}})),M("design:type",Function),M("design:paramtypes",[void 0===o||void 0===o.SemanticValue?Object:o.SemanticValue]),M("design:returntype",void 0===o||void 0===o.Widget?Object:o.Widget)],V,"hitDesignVidPanel",null),B([r.decorators.func({meta:{cellType:"customGasteigerPNG",columnTags:"quality=customGasteigerPNG",role:"cellRenderer"},name:"gasteigerRenderer",outputs:[{type:"grid_cell_renderer",name:"result"}]}),M("design:type",Function),M("design:paramtypes",[]),M("design:returntype",s)],V,"gasteigerCellRenderer",null),B([r.decorators.func({name:"Hit Triage package settings editor",meta:{role:"packageSettingsEditor"},tags:["packageSettingsEditor"]}),R(0,r.decorators.param({name:"propList",type:"object"})),M("design:type",Function),M("design:paramtypes",[Array]),M("design:returntype",Promise)],V,"htPackageSettingEditor",null)},4958(e,t,n){n.d(t,{X4:()=>m,fv:()=>p,kY:()=>h});var r=n(4328),i=n(7389),o=n(6082),a=n(9446);function l(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}function s(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){l(o,r,i,a,s,"next",e)}function s(e){l(o,r,i,a,s,"throw",e)}a(void 0)})}}let u="defaultCampaignFolder",d="System.AppData/HitTriage";function c(e){return s(function*(){if(!e)return[(yield r.dapi.groups.find(o.Group.defaultGroupsIds["All users"]))].filter(Boolean);try{let t=JSON.parse(e);return(yield Promise.all(t.map(e=>r.dapi.groups.find(e)))).filter(Boolean)}catch(e){return console.error(e),[(yield r.dapi.groups.find(o.Group.defaultGroupsIds["All users"]))].filter(Boolean)}})()}function p(){return s(function*(){try{var e,t;let n=a._package.settings,r={view:[],edit:[]};if(!n)return r;return r.view=yield c(null!=(e=n.view)?e:""),r.edit=yield c(null!=(t=n.edit)?t:""),r}catch(e){return console.error(e),{view:[],edit:[]}}})()}function h(){return s(function*(){var e;let t=a._package.settings;if(!t)return d;let n=null!=(e=t[u])?e:d;return(yield r.dapi.files.exists(n))?n:d})()}function m(e){return s(function*(){let t=e.filter(e=>"DefaultUserGroupsSharing"===e.category),n=[];for(let e of t){let t=`${e.name[0].toUpperCase()}${e.name.slice(1)}`,a=e.get(null),l=yield c(a),s=i.input.userGroups(t);yield o.delay(200),s.value=l,s.onInput.subscribe(()=>{try{var t;let n=(null==(t=s.value)?void 0:t.length)?JSON.stringify(s.value.map(e=>e.id)):"";e.set(null,n)}catch(e){r.shell.error("Error Setting group. Check console for more details"),console.error(e)}}),s.setTooltip(`Selected groups will be granted ${t.toLowerCase()} permissions by default on newly created campaigns`),n.push(s)}let a=o.Widget.fromRoot(i.form(n,{style:{overflow:"visible"}}));a.root.prepend(i.h1("Default Campaign Sharing",{style:{marginBottom:"6px",marginTop:"6px"}}));let l=e.find(e=>e.name===u);if(l){var p;let e='Default storage for newly created campaigns. For each app, folders will be created under their name. For example, for Hit Design, the campaign files will be saved under <b>"Your folder/Hit Design/campaigns/enriched_table.csv"</b>',t=e,n=null!=(p=l.get(null))?p:d,u=i.h1("Default Campaign Storage",{style:{marginBottom:"6px",marginTop:"6px"}}),c=i.input.string("Folder Path",{value:n});i.tooltip.bind(c.input,()=>t),o.debounce(c.onChanged,200).subscribe(n=>s(function*(){let n=c.value;try{if(!n){l.set(null,d),t=e+'<br><br> <b style="color: red">Cannot be empty.</b>',c.input.classList.add("d4-invalid");return}if(!(yield r.dapi.files.exists(n))){l.set(null,d),t=e+'<br><br> <b style="color: red">Folder does not exist.</b>',c.input.classList.add("d4-invalid");return}l.set(null,n),t=e,c.input.classList.remove("d4-invalid")}catch(e){r.shell.error("Error Setting default storage. Check console for more details"),console.error(e)}})()),a.root.appendChild(u),a.root.appendChild(c.root)}return setTimeout(()=>{var e;return(null==(e=a.root.parentElement)?void 0:e.style)&&(a.root.parentElement.style.overflow="visible")},200),a})()}},4281(e,t,n){n.d(t,{Vm:()=>r,Wn:()=>i,h3:()=>a,ru:()=>o});let r={script:"script",function:"function-package",query:"data-query"},i="HTScript",o="HTQuery",a="molecules"},5236(e,t,n){n.d(t,{CF:()=>l,Vu:()=>d,ej:()=>u,oo:()=>s,vC:()=>c});var r=n(6082),i=n(7389),o=n(4281);function a(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}function l(e){var t,n,r;let i=null!=(t=localStorage.getItem(e))?t:"{}";try{let e=JSON.parse(i);return{order:null!=(n=null==e?void 0:e.order)?n:[],hidden:null!=(r=null==e?void 0:e.hidden)?r:[]}}catch(e){console.error("error parsing function ordering",e)}return{order:[],hidden:[]}}function s(e,t){localStorage.setItem(t,JSON.stringify(e))}function u(e,t,n){var o;let a=l(n),u=r.DataFrame.fromColumns(e.map(e=>r.Column.fromStrings(e,[e])));u.columns.setOrder(null!=(o=a.order)?o:[]);let d=i.input.columns("reorder",{table:u,value:u.columns.toList().filter(e=>!a.hidden.includes(e.name))});d.onChanged.subscribe(()=>{try{let r=d.value.map(e=>e.name),i=e.filter(e=>!r.includes(e)),o={order:d.value.map(e=>e.name),hidden:i};u.columns.setOrder(o.order),s(o,n),t(o)}catch(e){console.error(e)}});let c=Array.from(d.root.children);setTimeout(()=>{c.forEach(e=>{e.style.maxWidth="0px",e.style.overflow="hidden",e.style.padding="0px",e.style.paddingRight="0px",e.style.visibility="hidden",e instanceof HTMLLabelElement&&(e.style.display="none")})},200),d.root.style.justifyContent="end",d.root.style.width="40px",d.root.style.height="0px",d.root.style.overflow="visible",d.root.style.padding="0px";let p=i.icons.edit(()=>{c.forEach(e=>{e.click()})},"Order or hide functions");return d.addOptions(p),Array.from(d.root.children).forEach(e=>{e.style.borderBottom="unset"}),p.style.fontSize="16px",d.root}function d(e){try{var t;return null==(t=e.package)?void 0:t.name}catch(e){return}}function c(e,t,n){var i;return(i=function*(){if(0===n.rowCount)return;let i=e.col(t);if(!i)throw Error("There is no molecule column in dataframe");let a=n.col(o.h3);if(a||(yield n.meta.detectSemanticTypes(),a=n.columns.bySemType(r.SEMTYPE.MOLECULE)),!a)throw Error("There is no original molecule column in query result dataframe");let l=n.columns.names().filter(e=>(null==e?void 0:e.toLowerCase())!==o.h3),s=l.filter(t=>{let r=e.col(t);return null!=r&&r.type===n.col(t).type});var u=!0,d=!1,c=void 0;try{for(var p,h=l[Symbol.iterator]();!(u=(p=h.next()).done);u=!0){let t=p.value;!s.includes(t)&&e.col(t)&&e.columns.remove(t)}}catch(e){d=!0,c=e}finally{try{u||null==h.return||h.return()}finally{if(d)throw c}}if(s.length){let t=new Map;for(let e=0;e<a.length;e++){if(a.isNone(e))continue;let n=a.get(e);t.has(n)||t.set(n,e)}var m=!0,f=!1,g=void 0;try{for(var v,b=s[Symbol.iterator]();!(m=(v=b.next()).done);m=!0){let r=v.value,o=n.col(r),a=e.col(r);for(let e=0;e<i.length;e++){let n=i.isNone(e)?void 0:t.get(i.get(e));a.set(e,void 0===n||o.isNone(n)?null:o.get(n),!1)}}}catch(e){f=!0,g=e}finally{try{m||null==b.return||b.return()}finally{if(f)throw g}}}let y=l.filter(e=>!s.includes(e));y.length&&e.join(n,[t],[a.name],void 0,y,void 0,!0)},function(){var e=this,t=arguments;return new Promise(function(n,r){var o=i.apply(e,t);function l(e){a(o,n,r,l,s,"next",e)}function s(e){a(o,n,r,l,s,"throw",e)}l(void 0)})})()}},6082(e){e.exports=DG},3095(e){e.exports=DG.U2},4328(e){e.exports=grok},1858(e){e.exports=rxjs},7389(e){e.exports=ui},949(e,t,n){let r;n.d(t,{BN:()=>eh,UU:()=>em,cY:()=>ep,rD:()=>eg,ll:()=>ec,Ej:()=>ef});let i=Math.min,o=Math.max,a=Math.round,l=Math.floor,s=e=>({x:e,y:e}),u={left:"right",right:"left",bottom:"top",top:"bottom"};function d(e,t){return"function"==typeof e?e(t):e}function c(e){return e.split("-")[0]}function p(e){return e.split("-")[1]}function h(e){return"x"===e?"y":"x"}function m(e){return"y"===e?"height":"width"}function f(e){let t=e[0];return"t"===t||"b"===t?"y":"x"}function g(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}let v=["left","right"],b=["right","left"],y=["top","bottom"],_=["bottom","top"];function w(e){let t=c(e);return u[t]+e.slice(t.length)}function x(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function k(e,t,n){let r,{reference:i,floating:o}=e,a=f(t),l=h(f(t)),s=m(l),u=c(t),d=i.x+i.width/2-o.width/2,g=i.y+i.height/2-o.height/2,v=i[s]/2-o[s]/2;switch(u){case"top":r={x:d,y:i.y-o.height};break;case"bottom":r={x:d,y:i.y+i.height};break;case"right":r={x:i.x+i.width,y:g};break;case"left":r={x:i.x-o.width,y:g};break;default:r={x:i.x,y:i.y}}let b=p(t);return b&&(r[l]+=v*("end"===b?1:-1)*(n&&"y"===a?-1:1)),r}async function O(e,t){var n,r,i,o,a;void 0===t&&(t={});let{x:l,y:s,platform:u,rects:c,elements:p,strategy:h}=e,{boundary:m="clippingAncestors",rootBoundary:f="viewport",elementContext:g="floating",altBoundary:v=!1,padding:b=0}=d(t,e),y="number"!=typeof b?{top:null!=(r=b.top)?r:0,right:null!=(i=b.right)?i:0,bottom:null!=(o=b.bottom)?o:0,left:null!=(a=b.left)?a:0}:{top:b,right:b,bottom:b,left:b},_=p[v?"floating"===g?"reference":"floating":g],w=x(await u.getClippingRect({element:null==(n=await (null==u.isElement?void 0:u.isElement(_)))||n?_:_.contextElement||await (null==u.getDocumentElement?void 0:u.getDocumentElement(p.floating)),boundary:m,rootBoundary:f,strategy:h})),k="floating"===g?{x:l,y:s,width:c.floating.width,height:c.floating.height}:c.reference,O=await (null==u.getOffsetParent?void 0:u.getOffsetParent(p.floating)),A=await (null==u.isElement?void 0:u.isElement(O))&&await (null==u.getScale?void 0:u.getScale(O))||{x:1,y:1},S=x(u.convertOffsetParentRelativeRectToViewportRelativeRect?await u.convertOffsetParentRelativeRectToViewportRelativeRect({elements:p,rect:k,offsetParent:O,strategy:h}):k);return{top:(w.top-S.top+y.top)/A.y,bottom:(S.bottom-w.bottom+y.bottom)/A.y,left:(w.left-S.left+y.left)/A.x,right:(S.right-w.right+y.right)/A.x}}let A=async(e,t,n)=>{let{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,l=a.detectOverflow?a:{...a,detectOverflow:O},s=await (null==a.isRTL?void 0:a.isRTL(t)),u=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:d,y:c}=k(u,r,s),p=r,h=0,m={};for(let n=0;n<o.length;n++){let f=o[n];if(!f)continue;let{name:g,fn:v}=f,{x:b,y:y,data:_,reset:w}=await v({x:d,y:c,initialPlacement:r,placement:p,strategy:i,middlewareData:m,rects:u,platform:l,elements:{reference:e,floating:t}});d=null!=b?b:d,c=null!=y?y:c,m[g]={...m[g],..._},w&&h<50&&(h++,"object"==typeof w&&(w.placement&&(p=w.placement),w.rects&&(u=!0===w.rects?await a.getElementRects({reference:e,floating:t,strategy:i}):w.rects),{x:d,y:c}=k(u,p,s)),n=-1)}return{x:d,y:c,placement:p,strategy:i,middlewareData:m}},S=new Set(["left","top"]);async function P(e,t){let{placement:n,platform:r,elements:i}=e,o=await (null==r.isRTL?void 0:r.isRTL(i.floating)),a=c(n),l=p(n),s="y"===f(n),u=S.has(a)?-1:1,h=o&&s?-1:1,m=d(t,e),{mainAxis:g,crossAxis:v,alignmentAxis:b}="number"==typeof m?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return l&&"number"==typeof b&&(v="end"===l?-1*b:b),s?{x:v*h,y:g*u}:{x:g*u,y:v*h}}function E(){return"u">typeof window}function C(e){return N(e)?(e.nodeName||"").toLowerCase():"#document"}function j(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function T(e){var t;return null==(t=(N(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function N(e){return!!E()&&(e instanceof Node||e instanceof j(e).Node)}function I(e){return!!E()&&(e instanceof Element||e instanceof j(e).Element)}function D(e){return!!E()&&(e instanceof HTMLElement||e instanceof j(e).HTMLElement)}function L(e){return!(!E()||"u"<typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof j(e).ShadowRoot)}function z(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=V(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&"inline"!==i&&"contents"!==i}function F(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}let B=/transform|translate|scale|rotate|perspective|filter/,M=/paint|layout|strict|content/,R=e=>!!e&&"none"!==e;function q(e){let t=I(e)?V(e):e;return R(t.transform)||R(t.translate)||R(t.scale)||R(t.rotate)||R(t.perspective)||!H()&&(R(t.backdropFilter)||R(t.filter))||B.test(t.willChange||"")||M.test(t.contain||"")}function H(){return null==r&&(r="u">typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),r}function W(e){return/^(html|body|#document)$/.test(C(e))}function V(e){return j(e).getComputedStyle(e)}function G(e){return I(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function U(e){if("html"===C(e))return e;let t=e.assignedSlot||e.parentNode||L(e)&&e.host||T(e);return L(t)?t.host:t}function K(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);let i=function e(t){let n=U(t);return W(n)?(t.ownerDocument||t).body:D(n)&&z(n)?n:e(n)}(e),o=i===(null==(r=e.ownerDocument)?void 0:r.body),a=j(i);if(!o)return t.concat(i,K(i,[],n));{let e=Y(a);return t.concat(a,a.visualViewport||[],z(i)?i:[],e&&n?K(e):[])}}function Y(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Q(e){let t=V(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=D(e),o=i?e.offsetWidth:n,l=i?e.offsetHeight:r,s=a(n)!==o||a(r)!==l;return s&&(n=o,r=l),{width:n,height:r,$:s}}function J(e){return I(e)?e:e.contextElement}function Z(e){let t=J(e);if(!D(t))return s(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:o}=Q(t),l=(o?a(n.width):n.width)/r,u=(o?a(n.height):n.height)/i;return l&&Number.isFinite(l)||(l=1),u&&Number.isFinite(u)||(u=1),{x:l,y:u}}let X=s(0);function ee(e){let t=j(e);return H()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:X}function et(e,t,n,r){var i;void 0===t&&(t=!1),void 0===n&&(n=!1);let o=e.getBoundingClientRect(),a=J(e),l=s(1);t&&(r?I(r)&&(l=Z(r)):l=Z(e));let u=(void 0===(i=n)&&(i=!1),r&&i&&r===j(a))?ee(a):s(0),d=(o.left+u.x)/l.x,c=(o.top+u.y)/l.y,p=o.width/l.x,h=o.height/l.y;if(a&&r){let e=j(a),t=I(r)?j(r):r,n=e,i=Y(n);for(;i&&t!==n;){let e=Z(i),t=i.getBoundingClientRect(),r=V(i),o=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,a=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;d*=e.x,c*=e.y,p*=e.x,h*=e.y,d+=o,c+=a,i=Y(n=j(i))}}return x({width:p,height:h,x:d,y:c})}function en(e,t){let n=G(e).scrollLeft;return t?t.left+n:et(T(e)).left+n}function er(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-en(e,n),y:n.top+t.scrollTop}}function ei(e,t,n){var r;let i;if("viewport"===t||"layoutViewport"===t)i=function(e,t,n){void 0===n&&(n="viewport");let r="layoutViewport"===n,i=j(e),o=T(e),a=i.visualViewport,l=o.clientWidth,s=o.clientHeight,u=0,d=0;if(a){let e=!H()||"fixed"===t;r?e||(u=-a.offsetLeft,d=-a.offsetTop):(l=a.width,s=a.height,e&&(u=a.offsetLeft,d=a.offsetTop))}if(0>=en(o)){let e=o.ownerDocument,t=e.body,n=getComputedStyle(t),r="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(o.clientWidth-t.clientWidth-r),a="stable both-edges"===getComputedStyle(o).scrollbarGutter?i/2:i;a<=25&&(l-=a)}return{width:l,height:s,x:u,y:d}}(e,n,t);else if("document"===t){let t,n,a,l,s,u;t=G(r=T(e)),n=r.ownerDocument.body,a=o(r.scrollWidth,r.clientWidth,n.scrollWidth,n.clientWidth),l=o(r.scrollHeight,r.clientHeight,n.scrollHeight,n.clientHeight),s=-t.scrollLeft+en(r),u=-t.scrollTop,"rtl"===V(n).direction&&(s+=o(r.clientWidth,n.clientWidth)-a),i={width:a,height:l,x:s,y:u}}else if(I(t)){let e,r,o,a,l,s;r=(e=et(t,!0,"fixed"===n)).top+t.clientTop,o=e.left+t.clientLeft,a=Z(t),l=t.clientWidth*a.x,s=t.clientHeight*a.y,i={width:l,height:s,x:o*a.x,y:r*a.y}}else{let n=ee(e);i={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return x(i)}function eo(e){return"static"===V(e).position}function ea(e,t){if(!D(e)||"fixed"===V(e).position)return null;if(t)return t(e);let n=e.offsetParent;return T(e)===n&&(n=n.ownerDocument.body),n}function el(e,t){var n;let r=j(e);if(F(e))return r;if(!D(e)){let t=U(e);for(;t&&!W(t);){if(I(t)&&!eo(t))return t;t=U(t)}return r}let i=ea(e,t);for(;i&&(n=i,/^(table|td|th)$/.test(C(n)))&&eo(i);)i=ea(i,t);return i&&W(i)&&eo(i)&&!q(i)?r:i||function(e){let t=U(e);for(;D(t)&&!W(t);){if(q(t))return t;if(F(t))break;t=U(t)}return null}(e)||r}let es=async function(e){let t=this.getOffsetParent||el,n=this.getDimensions,r=await n(e.floating);return{reference:function(e,t,n){let r=D(t),i=T(t),o="fixed"===n,a=et(e,!0,o,t),l={scrollLeft:0,scrollTop:0},u=s(0);if((r||!o)&&(("body"!==C(t)||z(i))&&(l=G(t)),r)){let e=et(t,!0,o,t);u.x=e.x+t.clientLeft,u.y=e.y+t.clientTop}!r&&i&&(u.x=en(i));let d=!i||r||o?s(0):er(i,l);return{x:a.left+l.scrollLeft-u.x-d.x,y:a.top+l.scrollTop-u.y-d.y,width:a.width,height:a.height}}(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},eu={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,o="fixed"===i,a=T(r),l=!!t&&F(t.floating);if(r===a||l&&o)return n;let u={scrollLeft:0,scrollTop:0},d=s(1),c=s(0),p=D(r);if((p||!o)&&(("body"!==C(r)||z(a))&&(u=G(r)),p)){let e=et(r);d=Z(r),c.x=e.x+r.clientLeft,c.y=e.y+r.clientTop}let h=!a||p||o?s(0):er(a,u);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-u.scrollLeft*d.x+c.x+h.x,y:n.y*d.y-u.scrollTop*d.y+c.y+h.y}},getDocumentElement:T,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e,l=[..."clippingAncestors"===n?F(t)?[]:function(e,t){let n=t.get(e);if(n)return n;let r=K(e,[],!1).filter(e=>I(e)&&"body"!==C(e)),i=null,o="fixed"===V(e).position,a=o?U(e):e;for(;I(a)&&!W(a);){let e=V(a),t=q(a),n=i?i.position:o?"fixed":"";t||"fixed"!==n&&("absolute"!==n||"static"!==e.position)?i=e:r=r.filter(e=>e!==a),a=U(a)}return t.set(e,r),r}(t,this._c):[].concat(n),r],s=ei(t,l[0],a),u=s.top,d=s.right,c=s.bottom,p=s.left;for(let e=1;e<l.length;e++){let n=ei(t,l[e],a);u=o(n.top,u),d=i(n.right,d),c=i(n.bottom,c),p=o(n.left,p)}return{width:d-p,height:c-u,x:p,y:u}},getOffsetParent:el,getElementRects:es,getClientRects:function(e){return e.getClientRects?Array.from(e.getClientRects()):[]},getDimensions:function(e){let{width:t,height:n}=Q(e);return{width:t,height:n}},getScale:Z,isElement:I,isRTL:function(e){return"rtl"===V(e).direction}};function ed(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ec(e,t,n,r){let a;void 0===r&&(r={});let{ancestorScroll:s=!0,ancestorResize:u=!0,elementResize:d="function"==typeof ResizeObserver,layoutShift:c="function"==typeof IntersectionObserver,animationFrame:p=!1}=r,h=J(e),m=s||u?[...h?K(h):[],...t?K(t):[]]:[];m.forEach(e=>{s&&e.addEventListener("scroll",n),u&&e.addEventListener("resize",n)});let f=h&&c?function(e,t,n){let r,a=null,s=T(e);function u(){var e;clearTimeout(r),null==(e=a)||e.disconnect(),a=null}function d(n,c){void 0===n&&(n=!1),void 0===c&&(c=1),u();let p=e.getBoundingClientRect(),{left:h,top:m,width:f,height:g}=p;if(n||t(),!f||!g)return;let v={rootMargin:-l(m)+"px "+-l(s.clientWidth-(h+f))+"px "+-l(s.clientHeight-(m+g))+"px "+-l(h)+"px",threshold:o(0,i(1,c))||1},b=!0;function y(t){let n=t[0].intersectionRatio;if(!ed(p,e.getBoundingClientRect()))return d();if(n!==c){if(!b)return d();n?d(!1,n):r=setTimeout(()=>{d(!1,1e-7)},1e3)}b=!1}try{a=new IntersectionObserver(y,{...v,root:s.ownerDocument})}catch(e){a=new IntersectionObserver(y,v)}a.observe(e)}let c=j(e),p=()=>d(n);return c.addEventListener("resize",p),d(!0),()=>{c.removeEventListener("resize",p),u()}}(h,n,u):null,g=-1,v=null;d&&(v=new ResizeObserver(e=>{let[r]=e;r&&r.target===h&&v&&t&&(v.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var e;null==(e=v)||e.observe(t)})),n()}),h&&!p&&v.observe(h),t&&v.observe(t));let b=p?et(e):null;return p&&function t(){let r=et(e);b&&!ed(b,r)&&n(),b=r,a=requestAnimationFrame(t)}(),n(),()=>{var e;m.forEach(e=>{s&&e.removeEventListener("scroll",n),u&&e.removeEventListener("resize",n)}),null==f||f(),null==(e=v)||e.disconnect(),v=null,p&&cancelAnimationFrame(a)}}let ep=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;let{x:i,y:o,placement:a,middlewareData:l}=t,s=await P(t,e);return a===(null==(n=l.offset)?void 0:n.placement)&&null!=(r=l.arrow)&&r.alignmentOffset?{}:{x:i+s.x,y:o+s.y,data:{...s,placement:a}}}}},eh=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){let{x:n,y:r,placement:a,platform:l}=t,{mainAxis:s=!0,crossAxis:u=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...p}=d(e,t),m={x:n,y:r},g=await l.detectOverflow(t,p),v=f(a),b=h(v),y=m[b],_=m[v],w=(e,t)=>o(t+g["y"===e?"top":"left"],i(t,t-g["y"===e?"bottom":"right"]));s&&(y=w(b,y)),u&&(_=w(v,_));let x=c.fn({...t,[b]:y,[v]:_});return{...x,data:{x:x.x-n,y:x.y-r,enabled:{[b]:s,[v]:u}}}}}},em=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r,i,o,a,l,s,u;let x,k,O,{placement:A,middlewareData:S,rects:P,initialPlacement:E,platform:C,elements:j}=t,{mainAxis:T=!0,crossAxis:N=!0,fallbackPlacements:I,fallbackStrategy:D="bestFit",fallbackAxisSideDirection:L="none",flipAlignment:z=!0,...F}=d(e,t);if(null!=(n=S.arrow)&&n.alignmentOffset)return{};let B=c(A),M=f(E),R=c(E)===E,q=await (null==C.isRTL?void 0:C.isRTL(j.floating)),H=I||(R||!z?[w(E)]:(x=w(E),[g(E),x,g(x)])),W="none"!==L;!I&&W&&H.push(...(k=p(E),O=function(e,t,n){switch(e){case"top":case"bottom":if(n)return t?b:v;return t?v:b;case"left":case"right":return t?y:_;default:return[]}}(c(E),"start"===L,q),k&&(O=O.map(e=>e+"-"+k),z&&(O=O.concat(O.map(g)))),O));let V=[E,...H],G=await C.detectOverflow(t,F),U=[],K=(null==(r=S.flip)?void 0:r.overflows)||[];if(T&&U.push(G[B]),N){let e,t,n,r,i=(l=A,s=P,void 0===(u=q)&&(u=!1),e=p(l),n=m(t=h(f(l))),r="x"===t?e===(u?"end":"start")?"right":"left":"start"===e?"bottom":"top",s.reference[n]>s.floating[n]&&(r=w(r)),[r,w(r)]);U.push(G[i[0]],G[i[1]])}if(K=[...K,{placement:A,overflows:U}],!U.every(e=>e<=0)){let e=((null==(i=S.flip)?void 0:i.index)||0)+1,t=V[e];if(t&&("alignment"!==N||M===f(t)||K.every(e=>f(e.placement)!==M||e.overflows[0]>0)))return{data:{index:e,overflows:K},reset:{placement:t}};let n=null==(o=K.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:o.placement;if(!n)switch(D){case"bestFit":{let e=null==(a=K.filter(e=>{if(W){let t=f(e.placement);return t===M||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:a[0];e&&(n=e);break}case"initialPlacement":n=E}if(A!==n)return{reset:{placement:n}}}return{}}}},ef=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){let n,r,{placement:a,rects:l,platform:s,elements:u}=t,{apply:h=()=>{},...m}=d(e,t),g=await s.detectOverflow(t,m),v=c(a),b=p(a),y="y"===f(a),{width:_,height:w}=l.floating;"top"===v||"bottom"===v?(n=v,r=b===(await (null==s.isRTL?void 0:s.isRTL(u.floating))?"start":"end")?"left":"right"):(r=v,n="end"===b?"top":"bottom");let x=w-g.top-g.bottom,k=_-g.left-g.right,O=i(w-g[n],x),A=i(_-g[r],k),S=t.middlewareData.shift,P=!S,E=O,C=A;null!=S&&S.enabled.x&&(C=k),null!=S&&S.enabled.y&&(E=x),P&&!b&&(y?C=_-2*o(g.left,g.right):E=w-2*o(g.top,g.bottom)),await h({...t,availableWidth:C,availableHeight:E});let j=await s.getDimensions(u.floating);return _!==j.width||w!==j.height?{reset:{rects:!0}}:{}}}},eg=(e,t,n)=>{let r=new Map,i=null!=n?n:{},o={...eu,...i.platform,_c:r};return A(e,t,{...i,platform:o})}},30(e,t,n){n.d(t,{cm:()=>d,ih:()=>s,l5:()=>c});var r=n(108),i=n(169),o=n(7614);function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function s(e,t){let n=null!=(c=null==t?void 0:t.access)?c:o.v.full,r=(null==t?void 0:t.row)===void 0?n:n.row(t.row),i=[],a=!1;var s=!0,u=!1,d=void 0;try{for(var c,p,h=e[Symbol.iterator]();!(s=(p=h.next()).done);s=!0){let e=p.value;if(void 0!==e.requires&&!r.can(e.requires)){a||(a=!0===e.separator);continue}i.push(a&&!e.separator?function(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}(l({},e),{separator:!0}):e),a=!1}}catch(e){u=!0,d=e}finally{try{s||null==h.return||h.return()}finally{if(u)throw d}}return i}function u(e,t){var n=!0,r=!1,i=void 0;try{for(var o,l,s=t.entries()[Symbol.iterator]();!(n=(l=s.next()).done);n=!0){let n=(o=l.value,function(e){if(Array.isArray(e))return e}(o)||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var i=[],o=!0,a=!1;try{for(r=r.call(e);!(o=(t=r.next()).done)&&(i.push(t.value),2!==i.length);o=!0);}catch(e){a=!0,n=e}finally{try{o||null==r.return||r.return()}finally{if(a)throw n}}return i}}(o)||function(e){if(e){if("string"==typeof e)return a(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return a(e,2)}}(o)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),r=n[0],i=n[1],s=t[r-1];void 0!==s&&(i.separator||i.destructive&&!s.destructive)&&e.separator(),e.item(i.text,i.run,{disabled:i.disabled,shortcut:i.shortcut,detail:i.detail,check:i.check})}}catch(e){r=!0,i=e}finally{try{n||null==s.return||s.return()}finally{if(r)throw i}}}function d(e,t){return(0,r.T$)("row-actions",()=>{let n=document.createElement("div");n.className="u2-row-actions",n.dataset.u2="row-actions",n.setAttribute("role","toolbar");var i=!0,o=!1,a=void 0;try{for(var u,d,c=s(e,t)[Symbol.iterator]();!(i=(d=c.next()).done);i=!0){let e=d.value;if(!e.icon)continue;let t=(0,r.gb)(e.icon,()=>e.run(),l({tooltip:e.text},void 0!==e.disabled?{disabled:e.disabled}:{}));t.dataset.u2Item=null!=(u=e.name)?u:e.text,e.destructive&&t.classList.add("u2-row-action-destructive"),n.append(t)}}catch(e){o=!0,a=e}finally{try{i||null==c.return||c.return()}finally{if(o)throw a}}return n})}function c(e,t){let n=new i.W,r=s(e,t);u(n,r);let o=r.length>0;var a=!0,l=!1,d=void 0;try{for(var c,p,h=(null!=(c=null==t?void 0:t.groups)?c:[])[Symbol.iterator]();!(a=(p=h.next()).done);a=!0){let e=p.value,r=s(e.actions,t);0!==r.length&&(o&&n.separator(),o=!0,n.group(e.text),u(n,r),n.endGroup())}}catch(e){l=!0,d=e}finally{try{a||null==h.return||h.return()}finally{if(l)throw d}}return n}},7119(e,t,n){n.d(t,{e:()=>d});var r=n(7115),i=n(9701),o=n(4977),a=n(5232),l=n(9947);function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function u(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}class d extends i.Ec{setDisabled(e,t){let n=this._buttons.get(e);n&&a.B.apply(n,t||null)}getState(){var e;let t=this.selected.peek();return s(u(s({},super.getState()),{value:"single"===this._toggle?null!=(e=t[0])?e:null:t}),0===t.length?{}:{current:t[0]})}getItems(){let e=this.selected.peek(),t=this._items.map((t,n)=>{var r,i;return u(s({key:t.id,label:null!=(r=null!=(i=t.text)?i:t.tooltip)?r:t.id,index:n},"none"===this._toggle?{}:{selected:e.includes(t.id)}),{disabled:this._buttons.get(t.id).disabled,rendered:!0})});return{count:t.length,list:t,truncated:!1}}_build(e,t){var n;let r=a.B.focusable(document.createElement("button"));if(r.type="button",r.className="u2-btn-group-item",r.dataset.id=e.id,r.dataset.u2Item=e.id,r.tabIndex=-1,e.icon&&r.append((0,l.K)(e.icon)),e.text&&!t){let t=document.createElement("span");t.className="u2-btn-group-label",t.dataset.u2Part="item-label",t.textContent=e.text,r.append(t)}let i=null!=(n=e.tooltip)?n:t?e.text:void 0;return o.m.bind(r,()=>{var e,t;return null!=(e=null!=(t=a.B.of(r))?t:i)?e:""},{owner:this.scope}),i&&t&&r.setAttribute("aria-label",i),"single"===this._toggle?(r.setAttribute("role","radio"),r.setAttribute("aria-checked","false")):"multi"===this._toggle&&r.setAttribute("aria-pressed","false"),a.B.apply(r,e.disabled||null),this.scope.listen(r,"click",t=>this._activate(e,t)),this._buttons.set(e.id,r),r}_activate(e,t){if("single"===this._toggle)this.selected.value=[e.id];else if("multi"===this._toggle){let t=this.selected.peek();this.selected.value=t.includes(e.id)?t.filter(t=>t!==e.id):t.concat([e.id])}e.onClick&&e.onClick(t,this)}_applySelection(){let e=new Set(this.selected.value);var t=!0,n=!1,r=void 0;try{for(var i,o=this._items[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){let t=i.value,n=this._buttons.get(t.id),r=e.has(t.id);n.classList.toggle("u2-btn-group-selected",r),"single"===this._toggle?n.setAttribute("aria-checked",String(r)):"multi"===this._toggle&&n.setAttribute("aria-pressed",String(r))}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}}_stops(){return this._items.map(e=>this._buttons.get(e.id))}_roving(){let e=this._stops();var t=!0,n=!1,r=void 0;try{for(var i,o,a=this._buttons.values()[Symbol.iterator]();!(t=(o=a.next()).done);t=!0)o.value.tabIndex=-1}catch(e){n=!0,r=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw r}}if(0===e.length)return;let l=null!=(i=e.find(e=>e.dataset.id===this._active))?i:e[0];this._active=l.dataset.id,l.tabIndex=0}_onFocusIn(e){let t=e.target;t.dataset&&this._buttons.has(t.dataset.id)&&(this._active=t.dataset.id,this._roving())}_onKeyDown(e){if("ArrowLeft"!==e.key&&"ArrowRight"!==e.key)return;let t=this._stops();if(0===t.length)return;e.preventDefault();let n=Math.max(t.findIndex(e=>e.dataset.id===this._active),0),r=t[(n+("ArrowRight"===e.key?1:-1)+t.length)%t.length];this._active=r.dataset.id,this._roving(),r.focus()}constructor(e){super(),this.selected=(0,r.vP)([]),this._buttons=new Map,this._items=e.items,this._toggle=null!=(a=e.toggle)?a:"none";const t=!0===e.iconOnly;this.root.classList.add("u2-btn-group",`u2-btn-group-${null!=(l=e.density)?l:"form"}`),t&&this.root.classList.add("u2-btn-group-icons"),this.root.dataset.u2="button-group",this.root.setAttribute("role","single"===this._toggle?"radiogroup":"group");var n=!0,i=!1,o=void 0;try{for(var a,l,s,u=this._items[Symbol.iterator]();!(n=(s=u.next()).done);n=!0){const e=s.value;this.root.append(this._build(e,t))}}catch(e){i=!0,o=e}finally{try{n||null==u.return||u.return()}finally{if(i)throw o}}this.scope.listen(this.root,"keydown",e=>this._onKeyDown(e)),this.scope.listen(this.root,"focusin",e=>this._onFocusIn(e)),this.effect(()=>this._applySelection()),this._roving()}}},108(e,t,n){n.d(t,{SE:()=>m,T$:()=>d,ey:()=>f,gb:()=>h});var r=n(1518),i=n(4977),o=n(8609),a=n(9947),l=n(169);let s="u2: signal binding needs an owner — build under `owner.build(…)` or `component((self) => …)`; after an `await`, inside `owner.task(async (t) => … t.build(…))`",u=new Set;function d(e,t){let n=r.HG.ambient,i=void 0===n?void 0:new r.HG(n,{label:e,lazy:!0});return r.HG.runWith(i,()=>t(i))}function c(e,t){if("string"==typeof t)return void e.setAttribute("aria-label",t);let n=r.HG.ambient;if(!n)throw Error(s);n.effect(()=>{var n;return e.setAttribute("aria-label",String(null!=(n=t.value)?n:""))})}function p(e,t){c(e,t);let n=()=>{var e;return"string"==typeof t?t:String(null!=(e=t.peek())?e:"")},o=r.HG.ambient;o?i.m.bind(e,n,{owner:o}):e.title=n()}function h(e,t,n){let i,l=null==n?void 0:n.toggle,d=null==n?void 0:n.disabled,h=(0,o.x6)((0,a.K)(e,{variant:null==n?void 0:n.variant}),e=>{if(l&&(l.value=!l.peek()),(null==n?void 0:n.menu)!==void 0){let e=(null==i?void 0:i.isOpen.peek())===!0;null==i||i.close(),null==(i=e?void 0:n.menu())||i.show({anchor:h})}return t(e)},void 0===d?void 0:{disabled:d,tooltip:null==n?void 0:n.tooltip});h.classList.add("u2-icon-btn"),h.dataset.u2="icon-button";let m=null==n?void 0:n.tooltip;if(m&&void 0!==d?c(h,m):m?p(h,m):r.Yz.enabled&&!u.has(e)&&(u.add(e),console.warn(`u2: iconButton("${e}") has no tooltip — an icon-only button needs one for its accessible name`)),!l)return h;let f=r.HG.ambient;if(!f)throw Error(s);return f.effect(()=>{let e=l.value;h.classList.toggle("u2-icon-btn-pressed",e),h.setAttribute("aria-pressed",String(e))}),h}function m(e,t,n,r){let i=null==r?void 0:r.disabled,l=(0,o.x6)((0,a.K)(t),n,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({primary:null==r?void 0:r.primary},void 0===i?{}:{disabled:i,tooltip:null==r?void 0:r.tooltip})),s=(0,o.Ln)(e,"u2-btn-label");return(null==r?void 0:r.iconRight)?l.prepend(s):l.append(s),l.dataset.u2="button",(null==r?void 0:r.tooltip)&&void 0!==i?l.setAttribute("aria-label",r.tooltip):(null==r?void 0:r.tooltip)&&p(l,r.tooltip),l}function f(e,t,n){return d("dropdown-button",i=>{let s,u,d,c=null==n?void 0:n.split,h=null==n?void 0:n.primary,f=()=>!!d&&(d.close(),!0),g=()=>{if(f())return;let e=l.W.popup();t(e),d=e,e.show({anchor:s});let n=new r.HG(void 0,{label:"dropdown-menu"});n.effect(()=>{let t=e.isOpen.value;u.setAttribute("aria-expanded",String(t)),t||(d===e&&(d=void 0),n.dispose())})},v=c?e=>{f(),c(e)}:g,b=(null==n?void 0:n.icon)?m(e,n.icon,v,{primary:h}):(0,o.x6)((0,o.Ln)(e,"u2-btn-label"),v,{primary:h});if((null==n?void 0:n.tooltip)&&p(b,n.tooltip),c){let e=(0,o.x6)((0,a.K)("chevron-down",{cls:"u2-dropdown-chevron"}),g,{primary:h});e.classList.add("u2-dropdown-arrow"),e.setAttribute("aria-label","More"),s=(0,o.y4)([b,e],"u2-dropdown-split"),u=e}else b.append((0,a.K)("chevron-down",{cls:"u2-dropdown-chevron"})),b.classList.add("u2-dropdown-btn"),s=b,u=b;s.dataset.u2="dropdown-button",u.setAttribute("aria-haspopup","menu"),u.setAttribute("aria-expanded","false");let y=e=>{"ArrowDown"!==e.key||d||(e.preventDefault(),g())};return i?(i.listen(s,"keydown",y),i.own(f)):s.addEventListener("keydown",y),s})}},7373(e,t,n){n.d(t,{G:()=>j,d:()=>C});var r=n(7115),i=n(9701),o=n(1518),a=n(7974),l=n(4894),s=n(4977),u=n(8609),d=n(7614),c=n(4911),p=n(6163),h=n(9614),m=n(169),f=n(108),g=n(30),v=n(9947),b=n(1600),y=n(2127);function _(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function w(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}function x(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){w(o,r,i,a,l,"next",e)}function l(e){w(o,r,i,a,l,"throw",e)}a(void 0)})}}function k(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function O(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function A(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,i=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var o=[],a=!0,l=!1;try{for(i=i.call(e);!(a=(n=i.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==i.return||i.return()}finally{if(l)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return _(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}let S=[],P=/^[-+]?(\d+\.?\d*|\.\d+)(e[-+]?\d+)?$/i,E=/^\d{4}[-/.]\d{1,2}[-/.]\d{1,2}([T ]\d{1,2}:\d{2}(:\d{2}(\.\d+)?)?(Z|[+-]\d{2}:?\d{2})?)?$/,C=new Intl.Collator(void 0,{numeric:!0});class j extends i.Ec{chrome(e){return this.build(()=>{var t,n,i;let o=(0,r.EW)(()=>0===this._items.value.length&&this.loading.value?"Loading…":null),a=null!=(t=null==e?void 0:e.group)?t:e=>`Group by. Current: ${e}`,l=[(0,f.gb)("eye",()=>{},{tooltip:null!=(n=null==e?void 0:e.columns)?n:"Choose columns",disabled:o,menu:()=>this.build(()=>this.columnsMenu())}),(0,f.gb)("layer-group",()=>{},{disabled:o,tooltip:(0,r.EW)(()=>a(this._groupingLabel(this.state.value.groupBy))),menu:()=>this.build(()=>this.groupMenu())})],s=this.name,d=["columns","group"];if(void 0!==this._refreshFn){let t=(0,f.gb)("sync",()=>void this.refresh(),{tooltip:null!=(i=null==e?void 0:e.refresh)?i:"Refresh",disabled:o});(0,u.QZ)(()=>{let e=this.loading.value;t.classList.toggle("u2-catalog-refreshing",e),e?t.setAttribute("aria-busy","true"):t.removeAttribute("aria-busy")}),l.push(t),d.push("refresh")}return void 0!==s&&l.forEach((e,t)=>e.dataset.u2Name=`${s}-${d[t]}`),l})}refresh(){return x(function*(){let e=this._refreshFn;if(void 0===e||this._refreshing.peek())return;this._refreshing.value=!0;let t=null;try{yield e(),t=this._error.peek()}catch(e){t=e instanceof Error?e.message:String(e)}finally{this.scope.isDisposed||(this._refreshing.value=!1)}null!==t&&this._items.peek().length>0&&y.m.error(`Could not refresh: ${t}`)}).call(this)}columnsMenu(){let e=m.W.popup(),t=this.state.peek().columns,n=new Map;var r=!0,i=!1,o=void 0;try{for(var a,l,s=this._columns.peek().peek()[Symbol.iterator]();!(r=(l=s.next()).done);r=!0){let r=l.value;r.pinned||(void 0!==r.menuGroup?n.set(r.menuGroup,[...null!=(a=n.get(r.menuGroup))?a:[],r]):this._columnItem(e,r,t))}}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}var u=!0,d=!1,c=void 0;try{for(var p,h=n[Symbol.iterator]();!(u=(p=h.next()).done);u=!0){let n=A(p.value,2),r=n[0],i=n[1];e.separator().group(r);var f=!0,g=!1,v=void 0;try{for(var b,y=i[Symbol.iterator]();!(f=(b=y.next()).done);f=!0){let n=b.value;this._columnItem(e,n,t)}}catch(e){g=!0,v=e}finally{try{f||null==y.return||y.return()}finally{if(g)throw v}}e.endGroup()}}catch(e){d=!0,c=e}finally{try{u||null==h.return||h.return()}finally{if(d)throw c}}return e}groupMenu(){let e=m.W.popup(),t=this.state.peek().groupBy;e.item("None",()=>this.groupBy(null),{check:null===t});let n=new Map;var r=!0,i=!1,o=void 0;try{for(var a,l,s,u=this._groupings.peek().peek()[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){let r=s.value;void 0!==r.menuGroup?n.set(r.menuGroup,[...null!=(a=n.get(r.menuGroup))?a:[],r]):e.item(null!=(l=r.label)?l:r.name,()=>this.groupBy(r.name),{check:t===r.name,detail:r.menuDetail})}}catch(e){i=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(i)throw o}}var d=!0,c=!1,p=void 0;try{for(var h,f=n[Symbol.iterator]();!(d=(h=f.next()).done);d=!0){let n=A(h.value,2),r=n[0],i=n[1];e.separator().group(r);var g=!0,v=!1,b=void 0;try{for(var y,_,w=i[Symbol.iterator]();!(g=(_=w.next()).done);g=!0){let n=_.value;e.item(null!=(y=n.label)?y:n.name,()=>this.groupBy(n.name),{check:t===n.name,detail:n.menuDetail})}}catch(e){v=!0,b=e}finally{try{g||null==w.return||w.return()}finally{if(v)throw b}}e.endGroup()}}catch(e){c=!0,p=e}finally{try{d||null==f.return||f.return()}finally{if(c)throw p}}return e}sortBy(e,t){this._patchState({sort:null===e?"":h.x.of(e,!(void 0===t||t))})}groupBy(e){this._patchState({groupBy:e})}showColumn(e,t){let n=this.state.peek().columns.filter(t=>t!==e);this._patchState({columns:void 0===t||t?[...n,e]:n})}foldGroup(e,t){var n;let r=this.state.peek().groupBy;if(null===r)return;let i=null!=(n=this.state.peek().collapsed[r])?n:[],o=void 0===t||t?[...i.filter(t=>t!==e),e]:i.filter(t=>t!==e);this._patchState({collapsed:O(k({},this.state.peek().collapsed),{[r]:o})})}getItems(e){let t=this._view.peek(),n=this._shownColumns.peek()[0],r=[],i=(e,t)=>r.push({key:this._keyOf(e),index:r.length,label:void 0===n?"":c.y.value(n.value(e)),rendered:t});if(t.sectioned){var o=!0,l=!1,s=void 0;try{for(var u,d=t.groups[Symbol.iterator]();!(o=(u=d.next()).done);o=!0){let e=u.value;r.push({key:`section:${e.key}`,index:r.length,label:e.label,expanded:!e.folded,rendered:!0});var p=!0,h=!1,m=void 0;try{for(var f,g=e.items[Symbol.iterator]();!(p=(f=g.next()).done);p=!0){let t=f.value;i(t,!e.folded)}}catch(e){h=!0,m=e}finally{try{p||null==g.return||g.return()}finally{if(h)throw m}}}}catch(e){l=!0,s=e}finally{try{o||null==d.return||d.return()}finally{if(l)throw s}}}else{var v=!0,b=!1,y=void 0;try{for(var _,w=t.ordered[Symbol.iterator]();!(v=(_=w.next()).done);v=!0){let e=_.value;i(e,!0)}}catch(e){b=!0,y=e}finally{try{v||null==w.return||w.return()}finally{if(b)throw y}}}return a.p.itemsState(r,null==e?void 0:e.all)}getState(){var e;let t=this.state.peek(),n=this._view.peek(),r=this._shownColumns.peek(),i=this._columns.peek().peek().filter(e=>!e.pinned&&!r.some(t=>t.name===e.name)),o=n.groups.reduce((e,t)=>e+(t.folded&&n.sectioned?0:t.items.length),0),a=h.x.parse(t.sort);return O(k({},super.getState()),{extra:{sort:null===a?"":`${a.column} ${a.descending?"desc":"asc"}`,groupBy:null!=(e=t.groupBy)?e:"",columns:r.map(e=>e.name).join(","),hidden:i.map(e=>e.name).join(","),collapsed:n.groups.filter(e=>e.folded).map(e=>e.key).join(","),groups:n.sectioned?n.groups.map(e=>`${e.label} (${e.items.length})`).join(", "):"",rows:o,total:n.ordered.length}})}revealItem(e){return x(function*(){let t=this.getItems({all:!0}).list,n=t.find(t=>t.key===e);if(void 0===n){let r=e.trim().toLowerCase(),i=t.filter(e=>e.label.toLowerCase()===r);if(i.length>1)throw Error(`u2: ${i.length} items match "${e}": ${i.map(e=>e.key).join(", ")}`);n=i[0]}if(void 0===n)return null;if(!n.rendered){let e=this._view.peek().groups.find(e=>e.items.some(e=>this._keyOf(e)===n.key));void 0!==e&&this.foldGroup(e.key,!1)}var r=!0,i=!1,o=void 0;try{for(var a,l=this._table.root.querySelectorAll("[data-u2-item]")[Symbol.iterator]();!(r=(a=l.next()).done);r=!0){let e=a.value;if(e.dataset.u2Item===n.key)return e}}catch(e){i=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return null}).call(this)}static storage(e){let t=`u2.catalog.${e}`;return{load:()=>{try{var e;let n=null==(e=globalThis.localStorage)?void 0:e.getItem(t);return n?JSON.parse(n):{}}catch(e){return{}}},save:e=>{try{var n;null==(n=globalThis.localStorage)||n.setItem(t,JSON.stringify(e))}catch(e){}}}}static _typeOf(e){let t=!0,n=!0,r=!1;var i=!0,o=!1,a=void 0;try{for(var l,s=e[Symbol.iterator]();!(i=(l=s.next()).done);i=!0){let e=l.value;if(!j._empty(e)&&(r=!0,t&&(t="number"==typeof e?Number.isFinite(e):"string"==typeof e&&P.test(e.trim())),n&&(n=e instanceof Date?!isNaN(e.getTime()):"string"==typeof e&&E.test(e.trim())&&!isNaN(Date.parse(e))),!t&&!n))break}}catch(e){o=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(o)throw a}}return r?t?"number":n?"date":"string":"string"}static sortItems(e,t,n){let r=n?1:-1;if(void 0!==t.compare)return e.sort((e,n)=>r*t.compare(e,n));let i=new Map(e.map(e=>[e,t.value(e)])),o=void 0===t.type||"auto"===t.type?j._typeOf(i.values()):t.type,a=e=>"number"===o?Number(e):"date"===o?e instanceof Date?e.getTime():Date.parse(String(e)):c.y.value(e),l=new Map;var s=!0,u=!1,d=void 0;try{for(var p,h=i[Symbol.iterator]();!(s=(p=h.next()).done);s=!0){let e=A(p.value,2),t=e[0],n=e[1];j._empty(n)||l.set(t,a(n))}}catch(e){u=!0,d=e}finally{try{s||null==h.return||h.return()}finally{if(u)throw d}}return e.sort((e,t)=>{let n=l.get(e),i=l.get(t);return void 0===n||void 0===i?n===i?0:void 0===n?1:-1:r*("number"==typeof n?n-i:C.compare(n,i))})}_compute(e,t,n,r){let i=[...e];void 0!==this._o.defaultOrder&&i.sort(this._o.defaultOrder);let o=h.x.parse(r.sort),a=null===o?void 0:t.find(e=>e.name===o.column);null!==o&&void 0!==a&&!1!==a.sortable&&(i=void 0!==this._o.sorter?this._o.sorter(i,a,!o.descending):j.sortItems(i,a,!o.descending));let l=null===r.groupBy?void 0:n.find(e=>e.name===r.groupBy);if(void 0===l)return{ordered:i,rows:i,groups:[{key:"",label:"",items:i,folded:!1}],sectioned:!1,labels:new Map};let s=new Map;var u=!0,d=!1,p=void 0;try{for(var m,f,g,v,b=i[Symbol.iterator]();!(u=(v=b.next()).done);u=!0){let e=v.value,t=c.y.value(l.key(e)),n=""===t?this._emptyLabel:t,r=s.get(n);void 0===r?s.set(n,[e]):r.push(e)}}catch(e){d=!0,p=e}finally{try{u||null==b.return||b.return()}finally{if(d)throw p}}let y=(null==(m=this._o.emptyGroupLast)||m)&&s.has(this._emptyLabel),_=[...s.keys()].filter(e=>!y||e!==this._emptyLabel);void 0!==l.compare&&_.sort(l.compare),y&&_.push(this._emptyLabel);let w=null!=(f=r.collapsed[l.name])?f:[],x=_.map(e=>{var t,n;let r=s.get(e),i=e===this._emptyLabel?e:null!=(t=null==(n=l.groupLabel)?void 0:n.call(l,e,r[0]))?t:e;return{key:e,label:i,items:r,folded:w.includes(e)}}),A=new Map(x.map(e=>[e.key,e.label])),S=x.length>1||null!=(g=this._o.singleGroupHeader)&&g&&1===x.length;if(!S)return{ordered:i,rows:i,groups:x.map(e=>O(k({},e),{folded:!1})),sectioned:S,labels:A};let P=[];var E=!0,C=!1,T=void 0;try{for(var N,I=x[Symbol.iterator]();!(E=(N=I.next()).done);E=!0){let e=N.value;P.push({section:e.key},...e.items)}}catch(e){C=!0,T=e}finally{try{E||null==I.return||I.return()}finally{if(C)throw T}}return{ordered:x.flatMap(e=>e.items),rows:P,groups:x,sectioned:S,labels:A}}_tableColumns(e){let t=e.map((e,t)=>{var n,r;return{header:null!=(n=e.header)?n:e.name,name:e.name,render:t=>this._cell(e.name,t),align:e.align,width:e.width,maxWidth:e.maxWidth,sortable:null==(r=e.sortable)||r,tooltip:e.description,pinned:0===t&&e.pinned?"start":void 0}});return void 0!==this._o.actions&&t.push({header:"",render:e=>this._actionsCell(e),pinned:"end"}),t}_cell(e,t){let n=this._columns.peek().peek().find(t=>t.name===e);if(void 0!==n.render)return n.render(t);let r=c.y.value(n.value(t));if(!n.link)return r;let i=(0,u.nf)(r,()=>{var e,n;return null==(e=(n=this._o).onActivate)?void 0:e.call(n,t)});return"string"==typeof n.link&&s.m.bind(i,n.link),i}_actionsCell(e){var t,n,i;let o=document.createElement("div");o.className="u2-catalog-actions";let a=null!=(t=null==(n=(i=this._o).access)?void 0:n.call(i,e))?t:"edit",l=t=>{let n=this._o.actions(e).map(e=>O(k({},e),{run:()=>this.build(()=>e.run())})),r=(0,g.cm)(n,{access:"view"===t?d.v.readOnly:d.v.full});"pending"===t?(r.classList.add("u2-catalog-actions-pending"),r.setAttribute("aria-hidden","true")):"view"===t&&void 0!==this._o.viewOnly&&r.append((0,v.K)(this._o.viewOnly.icon,{tooltip:this._o.viewOnly.tooltip,cls:"u2-catalog-view-only"})),o.replaceChildren(r)};return"string"==typeof a?l(a):(0,u.QZ)(()=>{let e=a.value;(0,r.O8)(()=>l(e))}),o}_accessNow(e){var t,n,r;let i=null!=(t=null==(n=(r=this._o).access)?void 0:n.call(r,e))?t:"edit";return"string"==typeof i?i:i.peek()}_showMode(e){var t;if(null==(t=this._modeScope)||t.dispose(),this._modeScope=void 0,"table"===e)return void this._host.replaceChildren(this._scroll);let n=new o.HG(this.scope,{label:"catalog-state"});this._modeScope=n,this._host.replaceChildren(n.build(()=>this._stateView(e)))}_stateView(e){if("loading"===e)return(0,b.qV)(8);if("error"===e){var t;let e=void 0===this._refreshFn?[]:[(0,u.x6)("Retry",()=>void this.refresh())];return(0,b.p$)(null!=(t=this._error.peek())?t:"",{error:!0,actions:e})}let n=this._o.empty;return"function"==typeof n?n():(0,b.p$)(null!=n?n:"Nothing here yet",{icon:"folder-open"})}_watchOverflow(){let e=this._scroll,t=new ResizeObserver(()=>this.root.classList.toggle("u2-catalog-overflow",e.scrollWidth>e.clientWidth+1));t.observe(e),t.observe(this._table.root),this.own(()=>t.disconnect())}_columnItem(e,t,n){var r;e.item(null!=(r=t.header)?r:t.name,()=>this.showColumn(t.name,!this.state.peek().columns.includes(t.name)),{check:n.includes(t.name),detail:t.menuDetail,keepOpen:!0})}_groupingLabel(e){var t;let n=null===e?void 0:this._groupings.peek().peek().find(t=>t.name===e);return void 0===n?"None":null!=(t=n.label)?t:n.name}_patchState(e){this.state.value=k({},this.state.peek(),e)}static _merge(e,t){let n=null!=t?t:{},r=e=>Array.isArray(e)&&e.every(e=>"string"==typeof e),i=n.sort,o="string"==typeof i?i:null===i?"":"string"==typeof(null==i?void 0:i.column)&&"boolean"==typeof i.ascending?h.x.of(i.column,!i.ascending):e.sort,a=n.collapsed;return{columns:r(n.columns)?[...n.columns]:e.columns,sort:o,groupBy:null===n.groupBy||"string"==typeof n.groupBy?n.groupBy:e.groupBy,collapsed:"object"!=typeof a||null===a||Array.isArray(a)?e.collapsed:Object.fromEntries(Object.entries(a).filter(e=>r(A(e,2)[1])))}}static _empty(e){return null==e||""===e||"number"==typeof e&&isNaN(e)}static _shape(e){return JSON.stringify([e.name,e.header,e.width,e.align,e.maxWidth,e.pinned,e.sortable,e.description,e.link])}static _same(e,t){let n=[];return(0,r.EW)(()=>{let r=e();return(r.length!==n.length||r.some((e,r)=>t(e)!==t(n[r])))&&(n=r),n})}constructor(e){var t,n,i,o,a,s,u;super(document.createElement("div")),this._refreshing=(0,r.vP)(!1),this._o=e,this._keyOf=e.keyOf,this._emptyLabel=null!=(t=e.emptyGroupLabel)?t:"No information",this.root.classList.add("u2-catalog"),this.root.dataset.u2="catalog-table",void 0!==e.name&&(this.name=e.name),void 0!==e.label&&this.root.setAttribute("aria-label",e.label),"always"===e.actionsVisible&&this.root.classList.add("u2-catalog-actions-always");const c=e.items;if(c instanceof l.C){const t=(0,r.vP)([]);this.effect(()=>{let e=c.state.value;"ready"===e.kind&&(t.value=e.value)}),this._items=t,this.loading=(0,r.EW)(()=>"loading"===c.state.value.kind||this._refreshing.value),this._error=(0,r.EW)(()=>{let e=c.state.value;return"error"===e.kind?`Could not load: ${e.message}`:null}),this._refreshFn=null!=(s=e.refresh)?s:()=>c.refresh()}else{this._items=c instanceof r.HN?c:(0,r.vP)(c);const t=e.loading;this.loading=(0,r.EW)(()=>{var e;return null!=(e=null==t?void 0:t.value)&&e||this._refreshing.value}),this._error=null!=(u=e.error)?u:(0,r.vP)(null),this._refreshFn=e.refresh}const h=e.columns;this._columns=(0,r.vP)(h instanceof r.HN?h:(0,r.vP)(h));const m=null!=(n=e.groupings)?n:[];this._groupings=(0,r.vP)(m instanceof r.HN?m:(0,r.vP)(m));const f="string"==typeof e.persist?j.storage(e.persist):e.persist,v={columns:null!=(i=e.defaultColumns)?i:this._columns.peek().peek().filter(e=>!e.pinned).map(e=>e.name),sort:"",groupBy:null,collapsed:{}};if(this.state=(0,r.vP)(j._merge(j._merge(v,null!=(o=e.state)?o:{}),null!=(a=null==f?void 0:f.load())?a:{})),this._shownColumns=j._same(()=>{let e=this._columns.value.value,t=this.state.value.columns;return[...e.filter(e=>e.pinned),...t.map(t=>e.find(e=>e.name===t&&!e.pinned)).filter(e=>void 0!==e)]},j._shape),this._view=(0,r.EW)(()=>this._compute(this._items.value,this._columns.value.value,this._groupings.value.value,this.state.value)),this.shown=(0,r.EW)(()=>this._view.value.ordered),this._table=this.build(()=>{var t,n;return new p.t({columns:(0,r.EW)(()=>this._tableColumns(this._shownColumns.value)),items:(0,r.EW)(()=>this._view.value.rows),keyOf:e.keyOf,row:(e,t,n)=>n.classList.add("u2-row"),sort:(0,r.EW)(()=>this.state.value.sort),onSort:e=>this._patchState({sort:e}),sortGesture:null!=(t=e.sortGesture)?t:"dblclick",collapsed:(0,r.EW)(()=>{var e;let t=this.state.value;return null===t.groupBy?S:null!=(e=t.collapsed[t.groupBy])?e:S}),onCollapse:e=>{let t=this.state.peek();null!==t.groupBy&&this._patchState({collapsed:O(k({},t.collapsed),{[t.groupBy]:[...e]})})},contextActions:void 0===e.actions?void 0:t=>(0,g.ih)(e.actions(t),{access:"edit"===this._accessNow(t)?d.v.full:d.v.readOnly}),sectionLabel:e=>{var t;return null!=(t=this._view.peek().labels.get(e))?t:e},sectionCounts:!0,rowHeight:null!=(n=e.rowHeight)?n:"control"})}),this._scroll=document.createElement("div"),this._scroll.className="u2-catalog-scroll",this._scroll.append(this._table.root),this._host=document.createElement("div"),this._host.className="u2-catalog-body",this._footer=document.createElement("div"),this._footer.className="u2-catalog-footer",this._footer.dataset.u2Part="footer",this.root.append(this._host,this._footer),void 0!==f){let e=!0;this.effect(()=>{let t=this.state.value;e?e=!1:(0,r.O8)(()=>f.save(t))})}const b=(0,r.EW)(()=>this._items.value.length>0?"table":null!==this._error.value?"error":this.loading.value?"loading":"empty");this.effect(()=>{let e=b.value;(0,r.O8)(()=>this._showMode(e))}),this.effect(()=>{this.loading.value?this.root.setAttribute("aria-busy","true"):this.root.removeAttribute("aria-busy")}),this.effect(()=>{var t,n;let r=this._view.value.ordered,i="table"===b.value&&null!=(t=null==(n=e.footer)?void 0:n.call(e,r))?t:"";this._footer.textContent=i,this._footer.hidden=""===i}),this._watchOverflow()}}},9378(e,t,n){n.d(t,{b:()=>h});var r=n(7115),i=n(4911),o=n(9947),a=n(9383),l=n(4335),s=n(9614);function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function c(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,i=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var o=[],a=!0,l=!1;try{for(i=i.call(e);!(a=(n=i.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==i.return||i.return()}finally{if(l)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}class h extends l.Vw{static column(e){let t=e.indexOf(":");return t<0?{name:e}:{name:e.slice(0,t),header:e.slice(t+1)}}get columns(){return this._columns}set columns(e){this._columns=e.map(e=>"string"==typeof e?h.column(e):e),this._template=h._templateOf(this._columns),this._shape++;let t=this._header();this._head.replaceWith(t),this._head=t,this.refresh()}setItems(e){var t,n;if(this._liveNow=null!=(t=this._liveOption)?t:!Array.isArray(e),Array.isArray(e)||e instanceof r.HN){this.keyOf=this._optionKeyOf,super.setItems(e);return}this.keyOf=null!=(n=this._optionKeyOf)?n:t=>e.keyOf(t),super.setItems(e.items)}get viewport(){return Math.max(0,this.root.clientHeight-this._headerHeight)}_resizeColumn(e,t){let n=`${Math.max(32,Math.round(t))}px`;this._columns=this._columns.map((t,r)=>r===e?c(d({},t),{width:n}):t),this._template=h._templateOf(this._columns),this._head.style.gridTemplateColumns=this._template;var r=!0,i=!1,o=void 0;try{for(var a,l=this.content.querySelectorAll(".u2-data-table-row")[Symbol.iterator]();!(r=(a=l.next()).done);r=!0)a.value.style.gridTemplateColumns=this._template}catch(e){i=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}}_listen(){let e=this.scope;e.listen(this.root,"click",e=>{let t=e.target,n=t.closest(".u2-data-table-head");null!==n&&void 0!==this._sort&&null===t.closest(".u2-data-table-resize")&&(this._sort.value=s.x.next(this._sort.peek(),n.dataset.column))}),e.listen(this.root,"pointerdown",e=>{let t=e.target.closest(".u2-data-table-resize");null!==t&&this._startResize(e,t.parentElement)}),this.own(()=>{var e;return null==(e=this._endResize)?void 0:e.call(this)})}_startResize(e,t){var n;e.preventDefault(),null==(n=this._endResize)||n.call(this);let r=Array.prototype.indexOf.call(this._head.children,t),i=e.clientX,o=t.getBoundingClientRect().width,a=e=>this._resizeColumn(r,o+e.clientX-i),l=()=>{document.removeEventListener("pointermove",a),document.removeEventListener("pointerup",l),this._endResize=void 0};document.addEventListener("pointermove",a),document.addEventListener("pointerup",l),this._endResize=l}_showSort(e,t){let n=void 0===t?this._head:t,r=s.x.parse(e);var i=!0,a=!1,l=void 0;try{for(var u,d,c=n.children[Symbol.iterator]();!(i=(d=c.next()).done);i=!0){let e=d.value,t=null!==r&&e.dataset.column===r.column;e.setAttribute("aria-sort",t?r.descending?"descending":"ascending":"none"),null==(u=e.querySelector(".u2-data-table-sort"))||u.remove(),t&&e.insertBefore((0,o.K)(r.descending?"arrow-down":"arrow-up",{cls:"u2-data-table-sort"}),e.querySelector(".u2-data-table-resize"))}}catch(e){a=!0,l=e}finally{try{i||null==c.return||c.return()}finally{if(a)throw l}}}createRow(){let e=document.createElement("div");return e.className="u2-data-table-row",e.setAttribute("role","row"),e.style.height=`${this.itemHeight}px`,this._cells(e),e}_cells(e){e.style.gridTemplateColumns=this._template,e.replaceChildren(...this._columns.map(e=>{let t=document.createElement("div");return t.setAttribute("role","gridcell"),t.className=h._cellClass(e),l.Vw.capture(t,this._cellBaseline),t})),this._rowShape.set(e,this._shape)}placeRow(e,t){return e.setAttribute("aria-rowindex",String(t+2)),!this._liveNow}fillRow(e,t){this._fit&&this._fitColumns(),this._rowShape.get(e)!==this._shape?this._cells(e):e.style.gridTemplateColumns=this._template,this.placeRow(e,t);let n=this.items[t],r=this.keyOf,i=this._cellState,o=void 0===i||void 0===r?void 0:r(n),a=e.children;var s=!0,u=!1,d=void 0;try{for(var c,m=this._columns.entries()[Symbol.iterator]();!(s=(c=m.next()).done);s=!0){let e=p(c.value,2),r=e[0],s=e[1],u=a[r];l.Vw.restore(u,this._cellBaseline),u.className=h._cellClass(s),0===r&&u.setAttribute("data-u2-part","item-label");let d=void 0===s.render?h._text(n,s.name):s.render(n,t,u);if("string"==typeof d?u.textContent=d:u.replaceChildren(d),void 0===o)continue;i.isChanged(o,s.name)&&u.classList.add("u2-cell-changed"),void 0===i.canEdit||i.canEdit(o,s.name)||u.classList.add("u2-cell-readonly");let m=i.errorOf(o,s.name);null!==m&&(u.classList.add("u2-cell-error"),u.title=m.message)}}catch(e){u=!0,d=e}finally{try{s||null==m.return||m.return()}finally{if(u)throw d}}}_fitColumns(){this._fit=!1;let e=getComputedStyle(document.body),t=`${e.fontSize} ${e.fontFamily}`;if(0===(0,a.sc)("M",t))return;let n=document.createElement("div"),r=this.items.slice(0,100);this._columns=this._columns.map(e=>{let i=/^minmax\((\d+)px, [\d.]+fr\)$/.exec(null!=(f=e.width)?f:"");if(null===i)return e;let o=Math.ceil((0,a.sc)(null!=(g=e.header)?g:e.name,`bold ${t}`))+16+20*(void 0!==this._sort),l=o;var s=!0,u=!1,m=void 0;try{for(var f,g,v,b,y=r.entries()[Symbol.iterator]();!(s=(b=y.next()).done);s=!0){let r=p(b.value,2),i=r[0],o=r[1],s=void 0===e.render?h._text(o,e.name):e.render(o,i,n),u="string"==typeof s?s:null!=(v=s.textContent)?v:"";l=Math.max(l,Math.ceil((0,a.sc)(u,t))+16)}}catch(e){u=!0,m=e}finally{try{s||null==y.return||y.return()}finally{if(u)throw m}}let _=Math.min(l,400);return c(d({},e),{width:`minmax(${Math.max(o,Math.min(Number(i[1]),_))}px, ${_}fr)`})}),this._template=h._templateOf(this._columns),this._head.style.gridTemplateColumns=this._template}rowKey(e,t){return"Enter"===e.key&&(this._onActivate&&e.preventDefault(),this.activate(t),!0)}activate(e){var t;null==(t=this._onActivate)||t.call(this,this.items[e],e)}_header(){let e=document.createElement("div");e.className="u2-data-table-header",e.setAttribute("role","row"),e.style.gridTemplateColumns=this._template,e.style.height=`${this._headerHeight}px`,this.root.style.setProperty("--u2-data-table-header-height",`${this._headerHeight}px`),e.classList.toggle("u2-data-table-sortable",void 0!==this._sort);var t=!0,n=!1,r=void 0;try{for(var i,o,a=this._columns[Symbol.iterator]();!(t=(o=a.next()).done);t=!0){let t=o.value,n=document.createElement("div");n.className=`${h._cellClass(t)} u2-data-table-head`,n.dataset.u2="column-header",n.setAttribute("role","columnheader"),n.dataset.column=t.name;let r=document.createElement("span");r.className="u2-data-table-head-label",r.textContent=n.title=null!=(i=t.header)?i:t.name;let a=document.createElement("div");a.className="u2-data-table-resize",n.append(r,a),e.append(n)}}catch(e){n=!0,r=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw r}}return void 0!==this._sort&&this._showSort(this._sort.peek(),e),e}static _templateOf(e){return e.map(e=>{var t;return null!=(t=e.width)?t:"minmax(80px, 1fr)"}).join(" ")}static _cellClass(e){return void 0===e.align?"u2-data-table-cell":`u2-data-table-cell u2-data-table-align-${e.align}`}static _text(e,t){return i.y.value(e[t])}constructor(e){var t,n,r;const i=e.columns[0];super(c(d({},e),{itemHeight:null!=(t=e.rowHeight)?t:24,liveItems:!1,labelOf:null!=(n=e.labelOf)?n:void 0===i?void 0:e=>h._text(e,i.name)}),{host:"u2-data-table",u2:"data-table",role:"grid"}),this._cellBaseline=new Map,this._shape=0,this._rowShape=new WeakMap,this._liveNow=!1,this._columns=e.columns,this._cellState=e.cellState,this._onActivate=e.onActivate,this._optionKeyOf=e.keyOf,this._liveOption=e.liveItems,this._headerHeight=Math.min(this.itemHeight,28),this._sort=e.sort,this._fit=null!=(r=e.fitColumns)&&r,this._template=h._templateOf(e.columns),this._head=this._header(),this.root.prepend(this._head),this._listen();const o=this._sort;void 0!==o&&this.effect(()=>this._showSort(o.value)),e.items&&this.setItems(e.items)}}},9571(e,t,n){n.d(t,{GH:()=>v});var r=n(9701),i=n(7115),o=n(8609),a=n(8049),l=n(108),s=n(9947),u=n(4335);function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,i=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var o=[],a=!0,l=!1;try{for(i=i.call(e);!(a=(n=i.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==i.return||i.return()}finally{if(l)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return d(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return d(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}let p=["res","converters","internal"];function h(e){let t=[],n=[],r=[];var i=!0,o=!1,a=void 0;try{for(var l,s=e.split(" ")[Symbol.iterator]();!(i=(l=s.next()).done);i=!0){let e=l.value;if(""!==e)if(e.startsWith("#")||e.startsWith("@")){let t=e.slice(1).toLowerCase();""!==t&&(e.startsWith("#")?n:r).push(t)}else t.push(e.toLowerCase())}}catch(e){o=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(o)throw a}}return{terms:t,tags:n,roles:r}}function m(e,t){return!e.tags.includes("internal")&&t.every(t=>e.search.includes(t))}function f(e,t){return e.size===t.size&&[...e].every(e=>t.has(e))}function g(e,t){let n=h(t).terms,r=new Map;var i=!0,o=!1,a=void 0;try{for(var l,s=e[Symbol.iterator]();!(i=(l=s.next()).done);i=!0){let e=l.value,t=m(e,n);var u=!0,d=!1,c=void 0;try{for(var p,f,g=e.tags[Symbol.iterator]();!(u=(f=g.next()).done);u=!0){let e=f.value;r.set(e,(null!=(p=r.get(e))?p:0)+ +!!t)}}catch(e){d=!0,c=e}finally{try{u||null==g.return||g.return()}finally{if(d)throw c}}}}catch(e){o=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(o)throw a}}return r}class v extends r.Ec{setItems(e){this._source.value=Array.isArray(e)?(0,i.vP)(e):e}getItems(e){return this._list.getItems(e)}revealItem(e){return this._list.revealItem(e)}bindStep(e){if("search"===e)return this.query;if("selected"===e)return null!=this._selectedName||(this._selectedName=(0,i.EW)(()=>{var e,t;return null!=(e=null==(t=this.selected.value)?void 0:t.name)?e:null})),this._selectedName;return super.bindStep(e)}bindProps(){let e=super.bindProps();return e.push({name:"search",type:"string",writable:!0}),e.some(e=>"selected"===e.name)||e.push({name:"selected",type:"string",writable:!1}),e}_live(e,t){var n;if(!(e instanceof i.HN))return(0,i.vP)(null!=e?e:t);let r=(0,i.vP)(null!=(n=e.peek())?n:t);return this.effect(()=>{let t=e.value;void 0!==t&&(r.value=t)}),r}_activate(e){var t,n;void 0!==e&&(null==(t=(n=this.options).onActivate)||t.call(n,e),this.fireEvent("activate",e))}_renderRow(e,t){var n,r;t.setAttribute("data-u2-func",e.name),t.setAttribute("aria-label",void 0!==e.signature&&this.showSignature.peek()?`${e.label} — ${e.signature}`:e.label),e.description&&(t.title=e.description);let i=this.options.render;if(i)return i(e,t);let a=[],l=this.options.runAction;if(l){let t=document.createElement("button");t.type="button",t.className="u2-btn u2-icon-btn u2-fb-run",t.title="Run",t.setAttribute("aria-label","Run"),t.append((0,s.K)("play",{variant:"solid"})),t.addEventListener("click",()=>l(e)),a.push(t)}let u=null==(n=(r=this.options).icon)?void 0:n.call(r,e);return u&&a.push((0,o.y4)([u],"u2-fb-icon")),a.push((0,o.Ln)(e.label,"u2-fb-label")),void 0!==e.signature&&a.push((0,o.Ln)(e.signature,"u2-fb-sig")),(0,o.y4)(a,"u2-fb-row")}_rebuildTagRows(e){var t,n;let r=this._source.value.value,i=new Set((null!=(t=this.options.ignoreTags)?t:p).map(e=>e.toLowerCase())),a=new Set((null!=(n=this.options.visibleTags)?n:[]).map(e=>e.toLowerCase())),l=[...new Set(r.flatMap(e=>e.tags))].filter(e=>!i.has(e)&&(0===a.size||a.has(e))).sort();if(l.length===this._tagList.length&&l.every((e,t)=>e===this._tagList[t]))return;this._tagList=l,this._tagRows.clear();let s=l.map(e=>{let t=this._paneRow("fb-tag",this.checkedTags,e,e,e,!0);return this._tagRows.set(e,t),t.row});e.replaceChildren((0,o.y4)(["Tags"],"u2-fb-pane-header"),...s),this._applyPaneState(g(r,this.query.peek()),this.checkedTags.peek(),this.checkedRoles.peek())}_applyPaneState(e,t,n){var r=!0,i=!1,o=void 0;try{for(var a,l,s=this._tagRows[Symbol.iterator]();!(r=(l=s.next()).done);r=!0){let n=c(l.value,2),r=n[0],i=n[1];i.box.checked=t.has(r),i.count.textContent=String(null!=(a=e.get(r))?a:0)}}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}var u=!0,d=!1,p=void 0;try{for(var h,m=this._roleRows[Symbol.iterator]();!(u=(h=m.next()).done);u=!0){let e=c(h.value,2),t=e[0];e[1].box.checked=n.has(t)}}catch(e){d=!0,p=e}finally{try{u||null==m.return||m.return()}finally{if(d)throw p}}}_paneRow(e,t,n,r,i,a){let l=document.createElement("input");l.type="checkbox",l.className="u2-input-checkbox",l.setAttribute("aria-label",r),l.addEventListener("change",()=>{let e=new Set(t.peek());l.checked?e.add(n):e.delete(n),t.value=e});let s=(0,o.Ln)(r,"u2-fb-pane-label");s.title=i||r,s.addEventListener("click",()=>{let e=t.peek();t.value=e.has(n)&&1===e.size?new Set:new Set([n])});let u=a?(0,o.Ln)("","u2-fb-count"):null,d=(0,o.y4)(u?[l,s,u]:[l,s],"u2-fb-pane-row");return d.dataset.u2=e,d.dataset.value=n,{row:d,box:l,count:u}}_listen(e,t,n){e.addEventListener(t,n),this.own(()=>e.removeEventListener(t,n))}constructor(e){var t,n,r;let s=void 0===e?{}:e;super(),this._source=(0,i.vP)((0,i.vP)([])),this._selected=(0,i.vP)(null),this._tagRows=new Map,this._roleRows=new Map,this._tagList=[],this._lastShown=[],this._scrollPending=!1,this.options=s,this.root.classList.add("u2-functions-browser"),this.root.dataset.u2="functions-browser";let d=null!=(t=s.search)?t:"";const c=h(d).tags,p=(null!=(n=s.tags)?n:[]).map(e=>e.toLowerCase()).filter(e=>!c.includes(e));p.length>0&&(d=[d.trim(),...p.map(e=>`#${e}`)].filter(e=>""!==e).join(" "));const v=h(d);this.query=(0,i.vP)(d),this.checkedTags=(0,i.vP)(new Set(v.tags)),this.checkedRoles=(0,i.vP)(new Set(v.roles)),this.showSearch=this._live(s.showSearch,!0),this.showTags=this._live(s.showTags,!0),this.showSignature=this._live(s.showSignature,!0),this.showRunButton=this._live(s.showRunButton,!0),void 0!==s.items&&this.setItems(s.items),this._shown=(0,i.EW)(()=>{var e,t,n,r;let i,o,a;return e=this._source.value.value,t=this.query.value,n=this.checkedTags.value,r=this.checkedRoles.value,o=new Set([...(i=h(t)).tags,...n]),a=new Set([...i.roles,...r]),e.filter(e=>{var t;return m(e,i.terms)&&(0===o.size||e.tags.some(e=>o.has(e)))&&(0===a.size||(null!=(t=e.roles)?t:[]).some(e=>a.has(e)))})});const b=this.build(()=>new a.k({search:!0,inline:!0,placeholder:"Search by name, #tag, or @role",bind:this.query})),y=this.build(()=>(0,l.gb)("filter",()=>{},{tooltip:"Toggle filter panel",toggle:this.showTags})),_=(0,o._Q)([b,y],"u2-fb-search");_.dataset.u2="fb-search",this._listen(b.root,"keydown",e=>{"ArrowDown"===e.key&&(e.preventDefault(),this._list.focusRows())});const w=void 0===s.roles?null:(0,o.y4)([],"u2-fb-pane");if(w){w.dataset.u2="fb-roles";const e=(null!=(r=s.roles)?r:[]).map(e=>{let t=e.role.toLowerCase(),n=this._paneRow("fb-role",this.checkedRoles,t,e.role,e.description,!1);return this._roleRows.set(t,n),n.row});w.replaceChildren((0,o.y4)(["Roles"],"u2-fb-pane-header"),...e)}const x=(0,o.y4)([],"u2-fb-pane");x.dataset.u2="fb-tags";const k=(0,o.yP)(w?[w,x]:[x],"u2-fb-panes");k.dataset.u2="fb-panes";const O=s.contextActions;this._list=this.build(()=>{var e;return new u.wj({itemHeight:null!=(e=s.itemHeight)?e:28,keyOf:e=>e.name,labelOf:e=>e.label,render:(e,t,n)=>this._renderRow(e,n),contextActions:O?e=>O(e):void 0})}),this._list.root.setAttribute("data-u2","fb-list"),this._list.setItems(this._shown);const A=(0,o.Ln)("","u2-fb-empty-message"),S=this.build(()=>(0,o.x6)("Clear search",()=>this.query.value=""));S.classList.add("u2-fb-clear"),S.dataset.u2="fb-clear";const P=(0,o.yP)([A,S],"u2-async-empty u2-fb-empty");P.dataset.u2="fb-empty";const E=(0,o.Ln)("","u2-fb-status");E.dataset.u2="fb-status";const C=(0,o.yP)([this._list,P,E],"u2-fb-main");this.root.append(_,(0,o._Q)([k,C],"u2-fb-body")),this.selected=this._selected,this.effect(()=>{var e,t,n,r;let i=this._shown.value,o=this._list.selectedIndex.value,a=null!=(e=i[o])?e:null,l=null!=(t=null==a?void 0:a.name)?t:null,s=null!=(n=null==(r=this._selected.peek())?void 0:r.name)?n:null,u=i!==this._lastShown;if(this._lastShown=i,u&&l!==s){if(null!==s&&i.some(e=>e.name===s)){this._scrollPending=!0;return}this._selected.value=null,this._scrollPending=!1;return}this._selected.value=a,(u||this._scrollPending)&&o>=0&&this._list.scrollToIndex(o),this._scrollPending=!1}),this.effect(()=>{let e=h(this.query.value);(0,i.vA)(()=>{f(new Set(e.tags),this.checkedTags.peek())||(this.checkedTags.value=new Set(e.tags)),f(new Set(e.roles),this.checkedRoles.peek())||(this.checkedRoles.value=new Set(e.roles))})}),this.effect(()=>{let e=this.checkedTags.value,t=this.checkedRoles.value,n=h(this.query.peek());f(new Set(n.tags),e)&&f(new Set(n.roles),t)||(this.query.value=[...n.terms,...[...e].map(e=>`#${e}`),...[...t].map(e=>`@${e}`)].join(" "))}),this.effect(()=>this._rebuildTagRows(x)),this.effect(()=>this._applyPaneState(g(this._source.value.value,this.query.value),this.checkedTags.value,this.checkedRoles.value)),this.effect(()=>_.hidden=!1===this.showSearch.value),this.effect(()=>k.hidden=!1===this.showTags.value),this.effect(()=>this.root.classList.toggle("u2-fb-no-signature",!1===this.showSignature.value)),this.effect(()=>this.root.classList.toggle("u2-fb-no-run",!1===this.showRunButton.value)),this.effect(()=>{let e=this._source.value.value.filter(e=>!e.tags.includes("internal")).length,t=this._shown.value,n=t.length>0;E.textContent=`${t.length} of ${e}`,A.textContent=n?"":0===e?"No functions.":`No functions match "${this.query.value.trim()}".`,S.hidden=n||0===e,P.hidden=n,this._list.root.hidden=!n});let j=!0;this.effect(()=>{var e,t;let n=this.selected.value;if(j){j=!1;return}null==(e=(t=this.options).onChanged)||e.call(t,n),this.fireEvent("change",n)}),this._listen(this._list.root,"dblclick",e=>{let t=e.target,n=null==t?void 0:t.closest(".u2-list-row");n&&this._activate(this._shown.peek()[Number(n.dataset.index)])}),this._listen(this._list.root,"keydown",e=>{var t;"Enter"===e.key&&this._activate(null!=(t=this.selected.peek())?t:void 0)})}}},2855(e,t,n){n.d(t,{Q:()=>p});var r=n(9701),i=n(1518),o=n(7974),a=n(7115),l=n(4335);function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function u(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}function d(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,i=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var o=[],a=!0,l=!1;try{for(i=i.call(e);!(a=(n=i.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==i.return||i.return()}finally{if(l)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}let c=0;class p extends r.Ec{setItems(e){this._source.value=Array.isArray(e)?(0,a.vP)(e):e}scrollToIndex(e){let t=Math.floor(e/this.columns.peek())*this._options.cellHeight,n=t+this._options.cellHeight-this.root.clientHeight;t<this.root.scrollTop?this.root.scrollTop=t:n>this.root.scrollTop&&(this.root.scrollTop=n),this._renderVisible()}get renderedCount(){return this._cells.size}cellAt(e){var t,n;return null!=(t=null==(n=this._cells.get(e))?void 0:n.el)?t:null}refresh(e){var t=!0,n=!1,r=void 0;try{for(var i,o=this._cells[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){let t=d(i.value,2),n=t[0],r=t[1];(void 0===e||r.key===e)&&this._fill(r,n)}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}}getItems(e){let t=this.selectedIndex.peek();return o.p.itemsState(this._items.map((e,n)=>({key:this._keyAt(n),label:this._label(n),index:n,selected:n===t,rendered:this._cells.has(n)})),null==e?void 0:e.all)}revealItem(e){var t;return(t=function*(){let t=this._find(e);return t<0?null:(this.scrollToIndex(t),yield new Promise(e=>{setTimeout(e,100),"function"==typeof requestAnimationFrame&&requestAnimationFrame(()=>e())}),this._cells.has(t)||this._renderVisible(),this.cellAt(t))},function(){var e=this,n=arguments;return new Promise(function(r,i){var o=t.apply(e,n);function a(e){u(o,r,i,a,l,"next",e)}function l(e){u(o,r,i,a,l,"throw",e)}a(void 0)})}).call(this)}onKeyDown(e){let t,n=this._items.length-1;if(n<0)return;let r=this.columns.peek(),i=Math.max(1,Math.floor(this.root.clientHeight/this._options.cellHeight)-1)*r,o=this.selectedIndex.peek();switch(e.key){case"ArrowRight":t=o+1;break;case"ArrowLeft":t=o<0?n:o-1;break;case"ArrowDown":t=o+r;break;case"ArrowUp":t=o<0?n:o-r;break;case"PageDown":t=o+i;break;case"PageUp":t=o<0?n:o-i;break;case"Home":t=0;break;case"End":t=n;break;case"Enter":case" ":if(o<0)return;e.preventDefault(),this._activate(o);return;default:return}e.preventDefault(),this.selectedIndex.value=Math.max(0,Math.min(n,t)),this.scrollToIndex(this.selectedIndex.value)}_measure(){this._width.value=this.root.clientWidth}_activate(e){var t,n;this.selectedIndex.value=e,null==(t=(n=this._options).onActivate)||t.call(n,this._items[e],e)}_layout(e){let t=Math.ceil(this._items.length/e);this._content.style.height=`${t*this._options.cellHeight}px`,this.selectedIndex.peek()>=this._items.length&&(this.selectedIndex.value=-1);let n=new Map;var r=!0,i=!1,o=void 0;try{for(var a,l=this._cells.values()[Symbol.iterator]();!(r=(a=l.next()).done);r=!0){let e=a.value;n.has(e.key)?this._release(e):n.set(e.key,e)}}catch(e){i=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}this._cells.clear();let s=this._window();for(let e=s.start;e<s.end;e++){let t=n.get(this._keyAt(e));void 0!==t&&(n.delete(t.key),this._cells.set(e,t),t.item===this._items[e]?this._place(t.el,e):this._fill(t,e))}var u=!0,d=!1,c=void 0;try{for(var p,h=n.values()[Symbol.iterator]();!(u=(p=h.next()).done);u=!0){let e=p.value;this._release(e)}}catch(e){d=!0,c=e}finally{try{u||null==h.return||h.return()}finally{if(d)throw c}}for(let e=s.start;e<s.end;e++)this._cells.has(e)||this._insertCell(e);this._rendered=s}_renderVisible(){let e=this._window();var t=!0,n=!1,r=void 0;try{for(var i,o=(0,l.Zw)(this._rendered,e)[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){let e=i.value;for(let t=e.start;t<e.end;t++)this._releaseCell(t)}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}var a=!0,s=!1,u=void 0;try{for(var d,c=(0,l.Zw)(e,this._rendered)[Symbol.iterator]();!(a=(d=c.next()).done);a=!0){let e=d.value;for(let t=e.start;t<e.end;t++)this._insertCell(t)}}catch(e){s=!0,u=e}finally{try{a||null==c.return||c.return()}finally{if(s)throw u}}this._rendered=e}_window(){if(0===this.root.clientWidth)return{start:0,end:0};let e=this._options.cellHeight,t=this.columns.peek(),n=this._items.length,r=Math.floor(this.root.scrollTop/e),i=Math.ceil(this.root.clientHeight/e),o=e=>Math.max(0,Math.min(n,e));return{start:o((r-2)*t),end:o((r+i+2)*t)}}_identity(e){if(void 0!==this._options.keyOf)return this._options.keyOf(e);if("string"==typeof e||"number"==typeof e)return String(e);if(null===e||"object"!=typeof e)return;let t=e.name,n=e.id;return"string"==typeof t?t:"string"==typeof n?n:void 0}_keyAt(e){var t;return null!=(t=this._identity(this._items[e]))?t:`#${e}`}_label(e){if(void 0!==this._options.labelOf)return this._options.labelOf(this._items[e]);let t=this.cellAt(e);return(null===t?"":r.Ec.text(t)||t.title)||this._keyAt(e)}_find(e){var t;let n=this._items.length;for(let t=0;t<n;t++)if(this._keyAt(t)===e)return t;let r=e.trim().toLowerCase(),i=[];for(let e=0;e<n;e++)this._label(e).toLowerCase()===r&&i.push(e);if(i.length>1)throw Error(`u2: ${i.length} items match "${e}": `+i.map(e=>this._keyAt(e)).join(", "));return null!=(t=i[0])?t:-1}_insertCell(e){var t;let n={el:null!=(t=this._pool.pop())?t:this._createCell(),key:"",item:this._items[e],scope:this._cellScope()};this._cells.set(e,n),this._render(n,e),this._content.append(n.el)}_fill(e,t){e.scope.dispose(),e.scope=this._cellScope(),this._render(e,t)}_render(e,t){e.item=this._items[t],e.key=this._keyAt(t);let n=e.el;n.className="u2-grid-cell",n.removeAttribute("title"),n.dataset.u2Item=e.key,this._place(n,t);let r=(0,a.O8)(()=>e.scope.run(()=>this._options.render(e.item,t,n)));n.replaceChildren(...void 0===r?[]:[r])}_place(e,t){let n=this.columns.peek();e.style.left=`${t%n*100/n}%`,e.style.width=`${100/n}%`,e.style.top=`${Math.floor(t/n)*this._options.cellHeight}px`,e.id=this._idPrefix+t,e.dataset.index=String(t),e.setAttribute("aria-posinset",String(t+1)),e.setAttribute("aria-setsize",String(this._items.length)),this._setSelected(e,this.selectedIndex.peek()===t)}_cellScope(){return new i.HG(this.scope,{label:"row",lazy:!0})}_releaseCell(e){let t=this._cells.get(e);this._cells.delete(e),this._release(t)}_release(e){e.scope.dispose(),e.el.remove(),this._pool.push(e.el)}_createCell(){let e=document.createElement("div");return e.setAttribute("role","option"),e.style.height=`${this._options.cellHeight}px`,e}_setSelected(e,t){e.classList.toggle("u2-grid-cell-selected",t),e.setAttribute("aria-selected",String(t))}constructor(e){super(),this.selectedIndex=(0,a.vP)(-1),this._width=(0,a.vP)(0),this._content=document.createElement("div"),this._source=(0,a.vP)((0,a.vP)([])),this._cells=new Map,this._pool=[],this._idPrefix=`u2-grid-${++c}-cell-`,this._items=[],this._rendered={start:0,end:0},this._options=e,this.columns=(0,a.EW)(()=>Math.max(1,Math.floor(this._width.value/e.cellWidth))),this.root.classList.add("u2-grid"),this.root.tabIndex=0,this.root.setAttribute("data-u2","grid"),this.root.setAttribute("role","listbox"),this._content.className="u2-grid-content",this.root.append(this._content),this.scope.listen(this.root,"scroll",()=>{this._measure(),this._renderVisible()}),this.scope.listen(this.root,"keydown",e=>this.onKeyDown(e)),this.scope.listen(this._content,"click",e=>{let t=e.target.closest(".u2-grid-cell");t&&this._activate(Number(t.dataset.index))});const t=new ResizeObserver(()=>{this._measure(),this._renderVisible()});t.observe(this.root),this.own(()=>t.disconnect()),this._measure(),this.effect(()=>{let e=this._source.value.value,t=this.columns.value;(0,a.O8)(()=>{let n=this.selectedIndex.peek(),r=n>=0&&n<this._items.length?this._identity(this._items[n]):void 0;this._items=e,this._layout(t),void 0!==r&&(this.selectedIndex.value=this._items.findIndex(e=>this._identity(e)===r))})}),this.effect(()=>{let e=this.selectedIndex.value;e<0?this.root.removeAttribute("aria-activedescendant"):this.root.setAttribute("aria-activedescendant",this._idPrefix+e);var t=!0,n=!1,r=void 0;try{for(var i,o=this._cells[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){let t=d(i.value,2),n=t[0],r=t[1];this._setSelected(r.el,n===e)}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}})}}},4335(e,t,n){n.d(t,{Vw:()=>b,Zw:()=>m,wj:()=>y});var r=n(9701),i=n(1518),o=n(7115),a=n(4977),l=n(30),s=n(2454);function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function d(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function p(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function h(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,i=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var o=[],a=!0,l=!1;try{for(i=i.call(e);!(a=(n=i.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==i.return||i.return()}finally{if(l)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e,t){let n;if(e.end<=e.start)return[];let r={start:n=Math.max(e.start,t.start),end:Math.max(n,Math.min(e.end,t.end))};if(r.end<=r.start)return[e];let i=[];return e.start<r.start&&i.push({start:e.start,end:r.start}),r.end<e.end&&i.push({start:r.end,end:e.end}),i}let f=0,g=new Set,v=new Set(["ArrowDown","ArrowUp","Home","End","PageDown","PageUp","Enter"," "]);class b extends r.Ec{selectKeys(e){let t=this.keyOf;if(void 0===t)return;let n=new Set(e),r=new Set;var i=!0,o=!1,a=void 0;try{for(var l,s=this.items.entries()[Symbol.iterator]();!(i=(l=s.next()).done);i=!0){let e=h(l.value,2),i=e[0],o=e[1];n.has(t(o))&&r.add(i)}}catch(e){o=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(o)throw a}}let u=this.selectedIndex.peek();this._write(r,0===r.size?-1:r.has(u)?u:[...r][0])}selectedKeys(){let e=this.keyOf;return void 0===e?[]:[...this._selected.peek()].map(e=>this.items[e]).filter(e=>void 0!==e).map(e)}focusRows(){this.root.focus(),0>this.selectedIndex.peek()&&this.items.length>0&&(this.selectedIndex.value=0)}setItems(e){this._source.value=Array.isArray(e)?(0,o.vP)(e):e}scrollToIndex(e){let t=e*this.itemHeight,n=t+this.itemHeight-this.viewport;t<this.root.scrollTop?this.root.scrollTop=t:n>this.root.scrollTop&&(this.root.scrollTop=n),this._renderVisible()}get renderedCount(){return this._rows.size}rowAt(e){var t,n;return null!=(t=null==(n=this._rows.get(e))?void 0:n.el)?t:null}refresh(e){var t=!0,n=!1,r=void 0;try{for(var i,o=this._rows[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){let t=h(i.value,2),n=t[0],r=t[1];(void 0===e||r.key===e)&&this._rerender(r,n)}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}}getItems(e){let t=this.items.length,n=(null==e?void 0:e.all)?t:Math.min(t,s.k),r=this._selected.peek(),i=[];for(let e=0;e<n;e++){let t=this.rowAt(e);i.push({key:this.keyAt(e),label:this._label(e),index:e,selected:r.has(e),disabled:(null==t?void 0:t.getAttribute("aria-disabled"))==="true",rendered:null!==t})}return{count:t,list:i,truncated:n<t}}revealItem(e){var t;return(t=function*(){let t=this._find(e);return t<0?null:(this.scrollToIndex(t),yield new Promise(e=>{setTimeout(e,100),"function"==typeof requestAnimationFrame&&requestAnimationFrame(()=>e())}),this._rows.has(t)||this._renderVisible(),this.rowAt(t))},function(){var e=this,n=arguments;return new Promise(function(r,i){var o=t.apply(e,n);function a(e){d(o,r,i,a,l,"next",e)}function l(e){d(o,r,i,a,l,"throw",e)}a(void 0)})}).call(this)}getState(){return p(c({},super.getState()),{selection:[...this._selected.peek()].map(e=>this.keyAt(e))})}keyAt(e){var t;return null!=(t=this._identity(this.items[e]))?t:`#${e}`}patchRow(e,t){return!1}placeRow(e,t){return!1}setSelected(e,t){e.classList.toggle(`${this._chrome.host}-row-selected`,t),e.setAttribute("aria-selected",String(t))}get viewport(){return this.root.clientHeight}indexOf(e){let t=e.target.closest(`.${this._chrome.host}-row`);return null===t?-1:Number(t.dataset.index)}static capture(e,t){if(!(t.size>0)){var n=!0,r=!1,i=void 0;try{for(var o,a=e.getAttributeNames()[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){let n=o.value;t.set(n,e.getAttribute(n))}}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}}}static restore(e,t){var n=!0,r=!1,i=void 0;try{for(var o,a=e.getAttributeNames()[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){let n=o.value;t.has(n)||e.removeAttribute(n)}}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}var l=!0,s=!1,u=void 0;try{for(var d,c=t[Symbol.iterator]();!(l=(d=c.next()).done);l=!0){let t=h(d.value,2),n=t[0],r=t[1];e.setAttribute(n,r)}}catch(e){s=!0,u=e}finally{try{l||null==c.return||c.return()}finally{if(s)throw u}}}_single(e){this._anchor=e,this._write(new Set([e]),e)}_toggle(e){let t=new Set(this._selected.peek());if(t.has(e)){if(1===t.size)return;t.delete(e);let n=this.selectedIndex.peek();this._write(t,n===e?[...t][t.size-1]:n)}else t.add(e),this._write(t,e)}_range(e){let t=this.selectedIndex.peek(),n=Math.max(0,Math.min(this.items.length-1,this._anchor>=0?this._anchor:t>=0?t:e)),r=e>=n?1:-1,i=new Set;for(let t=n;t!==e+r;t+=r)i.add(t);this._write(i,e)}_write(e,t){this._multiWrite=t,(0,o.vA)(()=>{this.selectedIndex.value=t,this._selected.value=e})}_onKeyDown(e){let t,n=this.items.length-1;if(n<0||e.target!==this.root)return;let r=this._seeded&&v.has(e.key);r&&this._unseed();let i=this.selectedIndex.value;if(i>=0&&this.rowKey(e,i))return;let o=Math.max(1,Math.floor(this.viewport/this.itemHeight)-1);switch(e.key){case"ArrowDown":t=r?i:i+1;break;case"ArrowUp":t=i<0?n:i-1;break;case"PageDown":t=i+o;break;case"PageUp":t=i<0?n:i-o;break;case"Home":t=0;break;case"End":t=n;break;default:return}e.preventDefault(),this.selectedIndex.value=Math.max(0,Math.min(n,t)),this.scrollToIndex(this.selectedIndex.value)}_apply(e){let t,n,r=this.items,i=this.selectedIndex.peek(),o=i>=0&&i<r.length?this._identity(r[i]):void 0,a=[],l=i<0||void 0!==o;var s,u=!0,d=!1,c=void 0;try{for(var p,h=this._selected.peek()[Symbol.iterator]();!(u=(p=h.next()).done);u=!0){let e=p.value,t=l&&e<r.length?this._identity(r[e]):void 0;if(void 0===t){l=!1;break}a.push(t)}}catch(e){d=!0,c=e}finally{try{u||null==h.return||h.return()}finally{if(d)throw c}}if(this.items=e,this.content.style.height=`${e.length*this.itemHeight}px`,l&&a.length>0){let e=this._indicesOf(new Set(a));t=new Set(a.map(t=>e.get(t)).filter(e=>void 0!==e)),(n=void 0===o?-1:null!=(s=e.get(o))?s:-1)<0&&t.size>0&&(n=[...t][0])}else t=(n=i<e.length?i:-1)<0?new Set:new Set([n]);this._anchor=n,this._write(t,n),this._reconcile()}_indicesOf(e){let t=new Map;for(let n=0;n<this.items.length&&t.size<e.size;n++){let r=this._identity(this.items[n]);void 0!==r&&e.has(r)&&!t.has(r)&&t.set(r,n)}return t}_reconcile(){let e=new Map;var t=!0,n=!1,r=void 0;try{for(var i,o=this._rows.values()[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){let t=i.value;e.has(t.key)?this._release(t):e.set(t.key,t)}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}this._rows.clear();let a=this._window();for(let t=a.start;t<a.end;t++){let n=e.get(this.keyAt(t));void 0!==n&&(e.delete(n.key),this._rows.set(t,n),this._keep(n,t))}var l=!0,s=!1,u=void 0;try{for(var d,c=e.values()[Symbol.iterator]();!(l=(d=c.next()).done);l=!0){let e=d.value;this._release(e)}}catch(e){s=!0,u=e}finally{try{l||null==c.return||c.return()}finally{if(s)throw u}}for(let e=a.start;e<a.end;e++)this._rows.has(e)||this._insertRow(e);this._rendered=a,this._order()}_order(){let e=this.content.firstChild;for(let n=this._rendered.start;n<this._rendered.end;n++){var t;let r=null==(t=this._rows.get(n))?void 0:t.el;void 0!==r&&(r===e?e=r.nextSibling:this.content.insertBefore(r,e))}}_keep(e,t){let n=!this._live&&this.items[t]===e.item;e.item=this.items[t],this._place(e.el,t),this._hook(e,()=>this.placeRow(e.el,t))&&(n||!this._live&&this._hook(e,()=>this.patchRow(e.el,t)))?this._mark(e.el,t):this._rerender(e,t)}_hook(e,t){return!0===(0,o.O8)(()=>e.scope.run(t))}_renderVisible(){let e=this._window();var t=!0,n=!1,r=void 0;try{for(var i,o=m(this._rendered,e)[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){let e=i.value;for(let t=e.start;t<e.end;t++)this._releaseRow(t)}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}let a=this._rendered;var l=!0,s=!1,u=void 0;try{for(var d,c=m(e,a)[Symbol.iterator]();!(l=(d=c.next()).done);l=!0){let e=d.value;for(let t=e.start;t<e.end;t++)this._insertRow(t)}}catch(e){s=!0,u=e}finally{try{l||null==c.return||c.return()}finally{if(s)throw u}}this._rendered=e,e.start<a.start&&a.end>a.start&&this._order()}_window(){let e=this.items.length,t=this.viewport;t<=0&&e>0&&!this._retried?(this._retried=!0,this._later()):t>0&&(this._retried=!1);let n=Math.floor(this.root.scrollTop/this.itemHeight),r=Math.ceil(t/this.itemHeight),i=t=>Math.max(0,Math.min(e,t));return{start:i(n-3),end:i(n+r+3)}}_identity(e){if(void 0!==this.keyOf)return this.keyOf(e);if("string"==typeof e||"number"==typeof e)return String(e);if(null===e||"object"!=typeof e)return;let t=e.name,n=e.id;return"string"==typeof t?t:"string"==typeof n?n:void 0}_label(e){var t;if(void 0!==this._labelOf)return this._labelOf(this.items[e]);let n=this.rowAt(e);return null===n?this.keyAt(e):r.Ec.text(null!=(t=n.querySelector('[data-u2-part="item-label"]'))?t:n)}_find(e){var t;let n=this.items.length;for(let t=0;t<n;t++)if(this.keyAt(t)===e)return t;let r=e.trim().toLowerCase(),i=[];for(let e=0;e<n;e++)this._label(e).toLowerCase()===r&&i.push(e);if(i.length>1)throw Error(`u2: ${i.length} items match "${e}": `+i.map(e=>this.keyAt(e)).join(", "));return null!=(t=i[0])?t:-1}_later(){0===this._retry&&"function"==typeof requestAnimationFrame&&(this._retry=requestAnimationFrame(()=>{this._retry=0,this.scope.isDisposed||this._renderVisible()}))}_insertRow(e){let t=this._pool.pop();void 0===t?(t=this.createRow(),b.capture(t,this._baseline)):b.restore(t,this._baseline);let n={el:t,key:this.keyAt(e),item:this.items[e],scope:this._rowScope()};this._rows.set(e,n),this._fill(n,e),this.content.append(t)}_rerender(e,t){e.scope.dispose(),e.scope=this._rowScope(),e.item=this.items[t],b.restore(e.el,this._baseline),this._fill(e,t)}_fill(e,t){this._place(e.el,t),e.el.dataset.u2Item=e.key,(0,o.O8)(()=>e.scope.run(()=>this.fillRow(e.el,t))),this._mark(e.el,t)}seed(e){this.selectedIndex.value=e,this._seeded=!0,this.root.classList.add(`${this._chrome.host}-seeded`)}_unseed(){this._seeded=!1,this.root.classList.remove(`${this._chrome.host}-seeded`)}_mark(e,t,n,r){let i=void 0===n?this._selected.peek():n,o=void 0===r?this.selectedIndex.peek():r;this.setSelected(e,i.has(t)),e.classList.toggle(`${this._chrome.host}-row-current`,t===o)}_place(e,t){e.style.top=`${t*this.itemHeight}px`,e.id=this._idPrefix+t,e.dataset.index=String(t)}_rowScope(){return new i.HG(this.scope,{label:"row",lazy:!0})}_releaseRow(e){let t=this._rows.get(e);this._rows.delete(e),this._release(t)}_release(e){e.scope.dispose(),e.el.remove(),this._pool.push(e.el)}constructor(e,t){var n,r;super(),this.selectedIndex=(0,o.vP)(-1),this.content=document.createElement("div"),this.items=[],this._selected=(0,o.vP)(g),this._seeded=!1,this._source=(0,o.vP)((0,o.vP)([])),this._rows=new Map,this._pool=[],this._baseline=new Map,this._anchor=-1,this._rendered={start:0,end:0},this._retry=0,this._retried=!1,this.selectedIndices=this._selected,this._chrome=t,this.itemHeight=null!=(n=e.itemHeight)?n:22,this.keyOf=e.keyOf,this._labelOf=e.labelOf,this._live=null==(r=e.liveItems)||r,this._idPrefix=`${t.host}-${++f}-row-`,this.root.classList.add(t.host),this.root.tabIndex=0,this.root.setAttribute("data-u2",t.u2),this.root.setAttribute("role",t.role),this.content.className=`${t.host}-content`,this.root.append(this.content);const i=this.scope;i.listen(this.root,"scroll",()=>this._renderVisible()),i.listen(this.root,"keydown",e=>this._onKeyDown(e)),i.listen(this.content,"click",e=>{let t=this.indexOf(e);t<0||(this._unseed(),e.ctrlKey||e.metaKey?this._toggle(t):e.shiftKey?this._range(t):this._single(t))}),i.listen(this.content,"mouseover",e=>{for(let t=e.target;null!==t&&t!==this.content;t=t.parentElement)if(t.scrollWidth>t.clientWidth)return void a.m.titleIfCut(t)}),i.listen(this.content,"dblclick",e=>{let t=this.indexOf(e);t>=0&&this.activate(t)});const s=e.contextActions;s&&i.listen(this.content,"contextmenu",t=>{var n,r,i;let o=this.indexOf(t);if(o<0)return;this._selected.peek().has(o)?this._write(this._selected.peek(),o):this._single(o);let a=s(this.items[o],o),u=null==(i=e.contextGroups)?void 0:i.call(e,this.items[o],o);(0!==a.length||0!==(null!=u?u:[]).length)&&(t.preventDefault(),t.stopPropagation(),(0,l.l5)(a,{groups:u}).show({x:null!=(n=t.clientX)?n:0,y:null!=(r=t.clientY)?r:0}))});const u=new ResizeObserver(()=>this._renderVisible());u.observe(this.root),this.own(()=>{u.disconnect(),0!==this._retry&&cancelAnimationFrame(this._retry)}),this.effect(()=>{let e=this._source.value.value;(0,o.O8)(()=>this._apply(e))}),this.effect(()=>{let e=this.selectedIndex.value,t=this._multiWrite;this._multiWrite=void 0,t!==e&&(this._anchor=e,this._selected.value=e<0?g:new Set([e]))}),this.effect(()=>{let e=this.selectedIndex.value,t=this._selected.value;e<0?this.root.removeAttribute("aria-activedescendant"):this.root.setAttribute("aria-activedescendant",this._idPrefix+e);var n=!0,r=!1,i=void 0;try{for(var o,a=this._rows[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){let n=h(o.value,2),r=n[0],i=n[1];this._mark(i.el,r,t,e)}}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}})}}class y extends b{createRow(){let e=document.createElement("div");return e.className="u2-list-row",e.setAttribute("role",this._rowRole),e.style.height=`${this.itemHeight}px`,e}fillRow(e,t){this.placeRow(e,t),e.replaceChildren(this._renderItem(this.items[t],t,e))}placeRow(e,t){return e.setAttribute("aria-posinset",String(t+1)),e.setAttribute("aria-setsize",String(this.items.length)),!0}patchRow(e,t){let n=e.children[0];return void 0!==this._update&&void 0!==n&&!1!==this._update(this.items[t],t,e,n)}rowKey(e,t){if("Enter"!==e.key&&"Delete"!==e.key)return!1;let n="Enter"===e.key?this._onEnter:this._onDelete;return n&&e.preventDefault(),null==n||n(this.items[t],t),!0}activate(e){var t;null==(t=this._onEnter)||t.call(this,this.items[e],e)}setSelected(e,t){super.setSelected(e,t);var n=!0,r=!1,i=void 0;try{for(var o,a=Array.from(e.querySelectorAll(".u2-row-actions button"))[Symbol.iterator]();!(n=(o=a.next()).done);n=!0)o.value.tabIndex=t?0:-1}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}}constructor(e){var t,n;super(p(c({},e),{liveItems:null!=(t=e.liveItems)&&t}),{host:"u2-list",u2:"list",role:"listbox"}),this._rowRole=null!=(n=e.rowRole)?n:"option",this._renderItem=e.render,this._update=e.update,this._onEnter=e.onEnter,this._onDelete=e.onDelete}}},9614(e,t,n){n.d(t,{x:()=>r});class r{static parse(e){let t=e.split(",")[0],n=t.startsWith("!"),r=n?t.slice(1):t;return""===r?null:{column:r,descending:n}}static of(e,t){return void 0!==t&&t?`!${e}`:e}static next(e,t){let n=r.parse(e);return(null==n?void 0:n.column)!==t?t:n.descending?"":`!${t}`}}},6163(e,t,n){n.d(t,{V:()=>b,t:()=>v});var r=n(7115),i=n(9701),o=n(1518),a=n(4860),l=n(7974),s=n(4911),u=n(4977),d=n(9947),c=n(5315),p=n(30),h=n(9614);function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function f(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}function g(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,i=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var o=[],a=!0,l=!1;try{for(i=i.call(e);!(a=(n=i.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==i.return||i.return()}finally{if(l)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return m(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return m(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}class v extends i.Ec{get columns(){return this._cols}set columns(e){this._columnsSource.value=e instanceof r.HN?e:(0,r.vP)(e)}setItems(e){this._source.value=e instanceof r.HN?e:(0,r.vP)(e)}getItems(e){let t=this.selectedIndex.peek(),n=[];var r=!0,o=!1,a=void 0;try{for(var s,u,d=this._body.querySelectorAll(".u2-table-row")[Symbol.iterator]();!(r=(u=d.next()).done);r=!0){let e=u.value,r=Number(e.dataset.index);n.push({key:e.dataset.u2Item,index:n.length,label:i.Ec.text(null!=(s=e.querySelector('[data-u2-part="item-label"]'))?s:e),selected:r===t,rendered:!0})}}catch(e){o=!0,a=e}finally{try{r||null==d.return||d.return()}finally{if(o)throw a}}return l.p.itemsState(n,null==e?void 0:e.all)}revealItem(e){var t,n=this,r=()=>super.revealItem;return(t=function*(){let t=yield r().call(n,e);if(null!==t)return t.classList.contains("u2-table-section")?null:t;let i=this._collapsed,o=e.trim().toLowerCase(),a=this._items.findIndex((t,n)=>this._hidden.has(n)&&(this._identity(t)===e||this._labelOf(t,n).toLowerCase()===o));if(void 0===i||a<0)return null;let l=this._sectionOf(a);return this._onCollapse(i.peek().filter(e=>e!==l)),r().call(n,e)},function(){var e=this,n=arguments;return new Promise(function(r,i){var o=t.apply(e,n);function a(e){f(o,r,i,a,l,"next",e)}function l(e){f(o,r,i,a,l,"throw",e)}a(void 0)})}).call(this)}static isSection(e){return"object"==typeof e&&null!==e&&"string"==typeof e.section&&1===Object.keys(e).length}toggleSection(e){let t=this._collapsed;if(void 0===t)return;let n=t.peek();this._onCollapse(n.includes(e)?n.filter(t=>t!==e):[...n,e])}_labelOf(e,t){let n=this._cols[0];if(void 0===n)return"";let r=new o.HG(void 0,{label:"table-label",lazy:!0});try{let o=r.build(()=>n.render(e,t));return("string"==typeof o?o:i.Ec.text(o)).trim()}finally{r.dispose()}}_apply(e){let t=this.selectedIndex.peek(),n=t>=0&&t<this._items.length&&!v.isSection(this._items[t])?this._identity(this._items[t]):void 0;this._items=e;let r=null!=(d=null==(c=this._collapsed)?void 0:c.peek())?d:[],i=[],o=new Set,a=!1;var l=!0,s=!1,u=void 0;try{for(var d,c,p,h,m=e.entries()[Symbol.iterator]();!(l=(h=m.next()).done);l=!0){let e=g(h.value,2),t=e[0],n=e[1];v.isSection(n)?(a=r.includes(n.section),i.push({item:n,index:t,key:`section:${n.section}`})):a?o.add(t):i.push({item:n,index:t,key:null!=(p=this._identity(n))?p:`#${t}`})}}catch(e){s=!0,u=e}finally{try{l||null==m.return||m.return()}finally{if(s)throw u}}if(this._hidden=o,t>=0){let r=void 0===n?t<e.length&&!v.isSection(e[t])?t:-1:e.findIndex(e=>!v.isSection(e)&&this._identity(e)===n);r!==t&&(this.selectedIndex.value=r)}this._entries.value=i}_identity(e){if(void 0!==this._keyOf)return this._keyOf(e);if("string"==typeof e||"number"==typeof e)return String(e);if(null===e||"object"!=typeof e)return;let t=e.name,n=e.id;return"string"==typeof t?t:"string"==typeof n?n:void 0}_layout(e){var t,n;this._cols=e,this._shape++,null==(t=this._colgroup)||t.remove(),this._colgroup=void 0,e.some(e=>e.width)&&(this._colgroup=this._colgroupOf(e),this.root.prepend(this._colgroup)),null==(n=this._head)||n.remove(),this._head=void 0,this._headerVisible&&(this._head=this._headOf(e),this.root.insertBefore(this._head,this._body),void 0!==this._sort&&this._showSort(this._sort.peek())),(this._entries.peek().length>0||this._items.length>0)&&this._apply(this._items)}_colgroupOf(e){let t=document.createElement("colgroup");var n=!0,r=!1,i=void 0;try{for(var o,a=e[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){let e=o.value,n=document.createElement("col");e.width&&(n.style.width=e.width),t.append(n)}}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}return t}_headOf(e){let t=document.createElement("thead"),n=document.createElement("tr");n.className="u2-table-header";let r="dblclick"===this._gesture?"Double-click":"Click";var i=!0,o=!1,a=void 0;try{for(var l,s=e[Symbol.iterator]();!(i=(l=s.next()).done);i=!0){let e=l.value,t=document.createElement("th");t.dataset.u2="column-header",t.setAttribute("role","columnheader"),t.textContent=e.header,v._decorate(t,e);let i=!0===e.sortable&&void 0!==e.name&&void 0!==this._sort;i&&(t.classList.add("u2-table-sortable"),t.tabIndex=0);let o=i?`${r} to sort by ${e.header}`:void 0,a=[e.tooltip,o].filter(e=>e).join("\n");""!==a&&v._tip(t,a),n.append(t)}}catch(e){o=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(o)throw a}}return t.append(n),t}_row(e){let t=document.createElement("tr");if(this._shown.set(t,e.item),this._rowShape.set(t,this._shape),t.dataset.index=String(e.index),v.isSection(e.item)){t.className="u2-table-section",t.dataset.u2Part="section";let n=document.createElement("th");return n.setAttribute("role","rowheader"),t.append(n),this._fillSection(t,e),t}let n=e.item;t.className="u2-table-row",t.setAttribute("role","row");var r=!0,i=!1,o=void 0;try{for(var a,l,s=this._cols[Symbol.iterator]();!(r=(l=s.next()).done);r=!0){let r=l.value,i=document.createElement("td");v._decorate(i,r);let o=r.render(n,e.index);"string"==typeof o?i.textContent=o:i.append(o),0===t.children.length&&(i.dataset.u2Part="item-label"),t.append(i)}}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return null==(a=this._rowHook)||a.call(this,n,e.index,t),this._mark(t,e.index===this.selectedIndex.peek()),t}_fillSection(e,t){var n,r;let i=t.item.section,o=e.children[0];o.colSpan=Math.max(1,this._cols.length);let a=document.createElement("span");a.className="u2-table-section-label",a.dataset.u2Part="item-label",a.textContent=null!=(n=null==(r=this._sectionLabel)?void 0:r.call(this,i))?n:i;let l=[a];this._sectionCounts&&l.push((0,c.qS)(String(this._rowsUnder(t.index))));let s=this._collapsed;if(void 0!==s){let t=s.peek().includes(i);l.unshift((0,d.K)(t?"angle-right":"angle-down",{cls:"u2-table-chevron"})),e.classList.add("u2-table-section-foldable"),e.setAttribute("aria-expanded",String(!t)),o.tabIndex=0}o.replaceChildren(...l)}_rowsUnder(e){let t=0;for(let n=e+1;n<this._items.length&&!v.isSection(this._items[n]);n++)t++;return t}_sectionOf(e){for(let t=e;t>=0;t--){let e=this._items[t];if(v.isSection(e))return e.section}}_patch(e,t){if(this._rowShape.get(e)!==this._shape)return!1;let n=v.isSection(t.item);return(!!n||this._shown.get(e)===t.item)&&(this._shown.set(e,t.item),e.dataset.index=String(t.index),n?this._fillSection(e,t):this._mark(e,t.index===this.selectedIndex.peek()),!0)}_select(e){var t=!0,n=!1,r=void 0;try{for(var i,o=this._body.querySelectorAll(".u2-table-row")[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){let t=i.value;this._mark(t,Number(t.dataset.index)===e)}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}}_mark(e,t){e.classList.toggle("u2-table-row-selected",t),this._selectable&&(t?e.setAttribute("aria-selected","true"):e.removeAttribute("aria-selected"))}_onClick(e){let t=e.target,n=t.closest(".u2-table-section-foldable");if(null!==n&&this._body.contains(n))return void this._toggleRow(n);let r=t.closest(".u2-table-row");if(!r)return;let i=Number(r.dataset.index);this._selectable&&(this.selectedIndex.value=i),this._fire(i)}_toggleRow(e){let t=this._items[Number(e.dataset.index)];v.isSection(t)&&this.toggleSection(t.section)}_onHeaderGesture(e){let t=e.target.closest("th.u2-table-sortable");null!==t&&void 0!==this._head&&this._head.contains(t)&&(e.preventDefault(),this._sortBy(t))}_sortBy(e){let t=this._sort;void 0!==t&&void 0!==e.dataset.column&&this._onSort(h.x.next(t.peek(),e.dataset.column))}_onContextMenu(e){this._showContextMenu(e.target,{x:e.clientX,y:e.clientY})&&(e.preventDefault(),e.stopPropagation())}_showContextMenu(e,t){let n=e.closest(".u2-table-row"),r=null===n?-1:Number(n.dataset.index),i=this._items[r];if(null===n||void 0===i||v.isSection(i))return!1;let o=this._contextActions(i,r);return 0!==o.length&&(this._selectable&&(this.selectedIndex.value=r),(0,p.l5)(o).show(null!=t?t:{anchor:n}),!0)}_onKeyDown(e){let t=e.target;if(void 0!==this._contextActions&&("ContextMenu"===e.key||e.shiftKey&&"F10"===e.key)){this._showContextMenu(t)&&e.preventDefault();return}if("Enter"===e.key||" "===e.key){var n;let r=t.closest("th.u2-table-sortable");if(null!==r&&(null==(n=this._head)?void 0:n.contains(r))){e.preventDefault(),this._sortBy(r);return}let i=t.closest(".u2-table-section-foldable");if(null!==i&&this._body.contains(i)){e.preventDefault(),this._toggleRow(i);return}}this._selectable&&this._onRowKey(e)}_onRowKey(e){let t,n=[];var r=!0,i=!1,o=void 0;try{for(var a,l=this._items.entries()[Symbol.iterator]();!(r=(a=l.next()).done);r=!0){let e=g(a.value,2),t=e[0],r=e[1];v.isSection(r)||this._hidden.has(t)||n.push(t)}}catch(e){i=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}if(0===n.length)return;let s=n.indexOf(this.selectedIndex.peek());switch(e.key){case"ArrowDown":t=s+1;break;case"ArrowUp":t=s<0?n.length-1:s-1;break;case"Home":t=0;break;case"End":t=n.length-1;break;case"Enter":e.preventDefault(),this._fire(this.selectedIndex.peek());return;default:return}e.preventDefault(),this.selectedIndex.value=n[Math.max(0,Math.min(n.length-1,t))]}_fire(e){let t=this._items[e];this._onRowClick&&e>=0&&e<this._items.length&&!v.isSection(t)&&this._onRowClick(t,e)}_showSort(e){if(void 0===this._head)return;let t=h.x.parse(e);var n=!0,r=!1,i=void 0;try{for(var o,a,l=this._head.querySelectorAll("th.u2-table-sortable")[Symbol.iterator]();!(n=(a=l.next()).done);n=!0){let e=a.value,n=null!==t&&e.dataset.column===t.column;e.setAttribute("aria-sort",n?t.descending?"descending":"ascending":"none"),e.classList.toggle("u2-table-sorted",n),null==(o=e.querySelector(".u2-table-sort"))||o.remove(),n&&e.append((0,d.K)(t.descending?"arrow-down":"arrow-up",{cls:"u2-table-sort"}))}}catch(e){r=!0,i=e}finally{try{n||null==l.return||l.return()}finally{if(r)throw i}}}static _decorate(e,t){void 0!==t.name&&(e.dataset.column=t.name),t.align&&e.classList.add(`u2-table-align-${t.align}`),t.pinned&&e.classList.add(`u2-table-pin-${t.pinned}`),t.maxWidth&&(e.classList.add("u2-table-clip"),e.style.maxWidth=t.maxWidth)}static _tip(e,t){let n=o.HG.ambient;void 0===n?e.title=t:u.m.bind(e,t,{owner:n})}constructor(e){var t,n,i,o,l,s;super(document.createElement("table")),this.selectedIndex=(0,r.vP)(-1),this._cols=[],this._body=document.createElement("tbody"),this._source=(0,r.vP)((0,r.vP)([])),this._entries=(0,r.vP)([]),this._shown=new WeakMap,this._shape=0,this._rowShape=new WeakMap,this._items=[],this._hidden=new Set;const d=e.columns;this._columnsSource=(0,r.vP)(d instanceof r.HN?d:(0,r.vP)(d)),this._keyOf=e.keyOf,this._rowHook=e.row,this._onRowClick=e.onRowClick,this._selectable=null!=(t=e.selectable)&&t,this._headerVisible=null==(n=e.headerVisible)||n;const c=this._sort=e.sort;this._onSort=null!=(i=e.onSort)?i:e=>{c.value=e},this._gesture=null!=(o=e.sortGesture)?o:"click";const p=this._collapsed=e.collapsed;this._onCollapse=null!=(l=e.onCollapse)?l:e=>{p.value=e},this._contextActions=e.contextActions,this._sectionLabel=e.sectionLabel,this._sectionCounts=null!=(s=e.sectionCounts)&&s,this.root.classList.add("u2-table"),this.root.dataset.u2="table",(this._selectable||this._onRowClick)&&this.root.classList.add("u2-table-interactive"),e.fixedLayout&&this.root.classList.add("u2-table-fixed"),"control"===e.rowHeight&&this.root.classList.add("u2-table-control"),this._selectable&&(this.root.tabIndex=0),this.root.append(this._body),this.scope.listen(this.root,this._gesture,e=>this._onHeaderGesture(e)),this.scope.listen(this._body,"click",e=>this._onClick(e)),this.scope.listen(this.root,"keydown",e=>this._onKeyDown(e)),this.scope.listen(this._body,"pointerover",e=>{let t=e.target.closest(".u2-table-clip");null!==t&&u.m.titleIfCut(t)}),void 0!==this._contextActions&&this.scope.listen(this._body,"contextmenu",e=>this._onContextMenu(e)),e.items&&this.setItems(e.items),this.effect(()=>{let e=this._columnsSource.value.value;(0,r.O8)(()=>this._layout(e))}),this.effect(()=>{var e;let t=this._source.value.value;null==(e=this._collapsed)||e.value,(0,r.O8)(()=>this._apply(t))}),this.build(()=>(0,a._)(this._body,this._entries,e=>e.key,e=>this._row(e),{update:(e,t)=>this._patch(e,t)})),this.effect(()=>this._select(this.selectedIndex.value)),void 0!==c&&this.effect(()=>this._showSort(c.value))}}function b(e){let t=document.createElement("table");t.className="u2-table u2-table-map",t.dataset.u2="table";let n=document.createElement("tbody");var r=!0,i=!1,o=void 0;try{for(var a,l=Object.keys(e)[Symbol.iterator]();!(r=(a=l.next()).done);r=!0){let t=a.value,r=document.createElement("tr");r.className="u2-table-row",r.dataset.u2Item=t;let i=document.createElement("td");i.className="u2-table-key",i.dataset.u2Part="item-label",i.textContent=t;let o=document.createElement("td"),l=e[t];l instanceof HTMLElement?o.append(l):o.textContent=s.y.value(l),r.append(i,o),n.append(r)}}catch(e){i=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return t.append(n),t}},1831(e,t,n){n.d(t,{U:()=>m});var r=n(9701),i=n(7115),o=n(4335),a=n(9947),l=n(5232),s=n(2454);function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function d(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}function c(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){d(o,r,i,a,l,"next",e)}function l(e){d(o,r,i,a,l,"throw",e)}a(void 0)})}}function p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,i=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var o=[],a=!0,l=!1;try{for(i=i.call(e);!(a=(n=i.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==i.return||i.return()}finally{if(l)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}class h extends o.wj{getItems(e){return this._tree.getItems(e)}revealItem(e){return this._tree.revealItem(e)}revealRow(e){return super.revealItem(e)}getState(){return this._tree.getState()}constructor(e,t){super(e),this._tree=t}}class m extends r.Ec{setRoots(e){this._roots.value=[...e],this._prune()}refresh(e){this._list.refresh(e)}focusRows(){this._list.focusRows()}clearSelection(){this._list.selectedIndex.value=-1}nodeForRow(e){let t=this._flat.peek()[m._rowIndex(e)];return t&&"node"===t.kind?t.node:null}expandPath(e){return c(function*(){if(0===e.length)return;let t=this._roots.peek();for(let n=0;n<e.length-1;n++){let r=t.find(t=>t.id===e[n]);if(!r)return;t=yield this._childrenOf(r)}let n=this.expanded.peek(),r=new Set([...n,...e.slice(0,-1)]);r.size!==n.size&&(this.expanded.value=r);let i=e[e.length-1],o=this._flat.peek().findIndex(e=>"node"===e.kind&&e.node.id===i);o>=0&&this._select(o)}).call(this)}getItems(e){let t=this._flat.peek(),n=this._list.selectedIndices.peek(),r=[],i=0;var o=!0,a=!1,l=void 0;try{for(var u,d=t.entries()[Symbol.iterator]();!(o=(u=d.next()).done);o=!0){let t=p(u.value,2),o=t[0],a=t[1];"node"===a.kind&&(((null==e?void 0:e.all)||i<s.k)&&r.push({key:a.node.id,label:a.label,index:i,level:a.depth+1,expanded:a.branch?a.open:void 0,checked:a.checked,selected:n.has(o),disabled:!!a.disabled,rendered:null!==this._list.rowAt(o)}),i++)}}catch(e){a=!0,l=e}finally{try{o||null==d.return||d.return()}finally{if(a)throw l}}return{count:i,list:r,truncated:r.length<i}}getState(){var e,t;return e=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},super.getState()),t=t={selection:this.selectedNodes.peek().map(e=>e.id)},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}rename(e){return c(function*(){if(!this._rename||(yield new Promise(e=>(0,i.vn)(e)),(yield this.revealItem(e))===null))return!1;let t=this._flat.peek().findIndex(t=>"node"===t.kind&&t.node.id===e);return this._select(t),this._startRename(t),!0}).call(this)}revealItem(e){return c(function*(){let t=this._pathTo(e);if(null===t)return null;let n=this.expanded.peek(),r=new Set([...n,...t.slice(0,-1)]);r.size!==n.size&&(this.expanded.value=r);let i=t[t.length-1];return this._flat.peek().some(e=>"node"===e.kind&&e.node.id===i)?this._list.revealRow(i):null}).call(this)}_pathTo(e){var t;let n=e.trim().toLowerCase(),r=[],i=[],o=(t,a)=>{var l=!0,s=!1,u=void 0;try{for(var d,c,p=t[Symbol.iterator]();!(l=(c=p.next()).done);l=!0){let t=c.value,l=[...a,t.id];t.id===e?r.push(l):t.label.trim().toLowerCase()===n&&i.push(l);let s=Array.isArray(t.children)?t.children:null==(d=this._loads.get(t.id))?void 0:d.children;s&&o(s,l)}}catch(e){s=!0,u=e}finally{try{l||null==p.return||p.return()}finally{if(s)throw u}}};if(o(this._roots.peek(),[]),r.length>0)return r[0];if(i.length>1)throw Error(`u2: ${i.length} items match "${e}": `+i.map(e=>e[e.length-1]).join(", "));return null!=(t=i[0])?t:null}_rebuild(){let e=[],t=[];this._loaded.value,this._flatten(this._roots.value,0,e,t);let n=new Map,r=e.map(e=>{let t=m._key(e),r=this._shown.get(t),i=void 0!==r&&m._same(r,e)?r:e;return n.set(t,i),i});this._shown=n,this._flat.value=r,(0,i.O8)(()=>{var e=!0,n=!1,r=void 0;try{for(var i,o=t[Symbol.iterator]();!(e=(i=o.next()).done);e=!0){let e=i.value;this._load(e)}}catch(e){n=!0,r=e}finally{try{e||null==o.return||o.return()}finally{if(n)throw r}}})}_flatten(e,t,n,r){let i=this.expanded.value;var o=!0,a=!1,l=void 0;try{for(var s,u,d=e[Symbol.iterator]();!(o=(u=d.next()).done);o=!0){let e=u.value,o="function"==typeof e.children?this._loads.get(e.id):void 0,a=void 0!==o&&o.loader===e.children,l=m._isBranch(e)&&!(a&&(null==(s=o.children)?void 0:s.length)===0),d=l&&i.has(e.id);if(n.push({node:e,depth:t,kind:"node",branch:l,open:d,label:e.label,tooltip:e.tooltip,checked:e.checked,locked:e.locked,disabled:e.disabled}),i.has(e.id)){if(Array.isArray(e.children)){this._flatten(e.children,t+1,n,r);continue}"function"==typeof e.children&&(a||r.push(e),(null==o?void 0:o.children)!==void 0?this._flatten(o.children,t+1,n,r):a&&void 0!==o.error?n.push(m._status(e,t+1,"error",o.error)):n.push(m._status(e,t+1,"loading")))}}}catch(e){a=!0,l=e}finally{try{o||null==d.return||d.return()}finally{if(a)throw l}}}_childrenOf(e){return Array.isArray(e.children)?Promise.resolve(e.children):"function"!=typeof e.children?Promise.resolve([]):this._load(e)}_load(e){let t,n=e.children,r=this._loads.get(e.id);if(void 0!==r&&r.loader===n&&void 0===r.error)return r.promise;null==r||r.scope.dispose();let o=this.scope.child("tree-load"),a={loader:n,scope:o,promise:Promise.resolve([]),children:null==r?void 0:r.children};this._loads.set(e.id,a);try{t=o.build(()=>(0,i.O8)(n))}catch(e){t=Promise.reject(e)}let l=(t,n)=>{if(this._loads.get(e.id)!==a)return;let r=void 0!==a.children;a.children=t,a.error=n,r&&this._prune(),this._loaded.value++};return a.promise=t.then(e=>(l(e),e),e=>(l(void 0,e instanceof Error?e.message:String(e)),[])),a.promise}_prune(){if(0===this._loads.size)return;let e=new Set,t=n=>{var r=!0,i=!1,o=void 0;try{for(var a,l,s=n[Symbol.iterator]();!(r=(l=s.next()).done);r=!0){let n=l.value;if(e.has(n.id))continue;e.add(n.id);let r=Array.isArray(n.children)?n.children:null==(a=this._loads.get(n.id))?void 0:a.children;r&&t(r)}}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}};t(this._roots.peek());var n=!0,r=!1,i=void 0;try{for(var o,a=this._loads[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){let t=p(o.value,2),n=t[0],r=t[1];e.has(n)||(r.scope.dispose(),this._loads.delete(n))}}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}}_renderRow(e,t){var n,r;t.setAttribute("aria-level",String(e.depth+1));let i=document.createElement("div");if(i.className="u2-tree-row",i.style.setProperty("--u2-tree-indent",`${20*e.depth}px`),"node"!==e.kind)return t.removeAttribute("data-u2-item"),i.append(m._twistie(!1,!1),m._span(`u2-tree-${e.kind}`,"loading"===e.kind?"Loading…":null!=(r=e.message)?r:"")),i;e.branch&&t.setAttribute("aria-expanded",String(e.open)),void 0!==e.checked&&t.setAttribute("aria-checked",String(e.checked));let o=void 0===this._render?m._span("u2-tree-label",e.label):this._render(e.node);return o.classList.add("u2-tree-label"),o.dataset.u2Part="item-label",i.append(m._twistie(e.branch,e.open)),void 0!==e.checked&&i.append(this._checkbox(e)),i.append(o),e.disabled&&(i.classList.add("u2-tree-row-disabled"),l.B.apply(t,e.disabled)),i.title=e.disabled||(null!=(n=e.tooltip)?n:e.label),i}_onClick(e){let t=e.target;if(!t)return;let n=this._flat.peek()[m._rowIndex(t)];n&&"node"===n.kind&&(t.closest(".u2-tree-check")?(e.stopPropagation(),e.preventDefault(),this._toggleCheck(n.node)):t.closest(".u2-tree-twistie")&&(e.stopPropagation(),this._setExpanded(n.node.id,!this.expanded.peek().has(n.node.id))))}_toggleCheck(e){void 0!==this._check&&void 0!==e.checked&&!0!==e.locked&&this._check(e,!e.checked)}_onKeyDown(e){let t=this._flat.peek(),n=this._list.selectedIndex.peek(),r=t[n];if(r)switch(e.key){case"ArrowRight":e.preventDefault(),"node"===r.kind&&m._isBranch(r.node)&&!this.expanded.peek().has(r.node.id)?this._setExpanded(r.node.id,!0):n+1<t.length&&t[n+1].depth>r.depth&&this._select(n+1);break;case"ArrowLeft":if(e.preventDefault(),"node"===r.kind&&this.expanded.peek().has(r.node.id)){this._setExpanded(r.node.id,!1);break}for(let e=n-1;e>=0;e--)if(t[e].depth<r.depth){this._select(e);break}break;case"Enter":e.preventDefault(),this._select(n);break;case"F2":e.preventDefault(),this._startRename(n);break;case" ":if("node"!==r.kind||void 0===r.node.checked)break;e.preventDefault(),this._toggleCheck(r.node)}}_startRename(e){var t,n;let r=this._rename,i=this._flat.peek()[e];if(!r||!i||"node"!==i.kind)return;null==(t=this._endRename)||t.call(this);let o=null==(n=this._list.rowAt(e))?void 0:n.querySelector(".u2-tree-label");if(!o)return;let a=document.createElement("input");a.className="u2-tree-rename",a.setAttribute("aria-label",`Rename ${i.node.label}`),a.value=i.node.label,o.replaceWith(a),a.focus(),a.select();let l=!0,s=e=>{l&&(l=!1,e&&e!==i.node.label&&(o.textContent=e,r(i.node,e)),a.isConnected&&a.replaceWith(o))};this._endRename=s,a.addEventListener("blur",()=>s()),a.addEventListener("keydown",e=>{e.stopPropagation(),("Enter"===e.key||"Escape"===e.key)&&(s("Enter"===e.key?a.value.trim():void 0),this._list.root.focus())})}_setExpanded(e,t){let n=new Set(this.expanded.peek());if(t)n.add(e);else{n.delete(e);let t=this._loads.get(e);(null==t?void 0:t.error)!==void 0&&(t.scope.dispose(),this._loads.delete(e))}this.expanded.value=n}_select(e){this._list.selectedIndex.value=e,this._list.scrollToIndex(e)}_checkbox(e){var t,n;let r=document.createElement("input");return r.type="checkbox",r.className="u2-tree-check",r.checked=!0===e.checked,r.disabled=void 0===this._check||!0===e.locked&&!0!==e.checked,!0===e.locked&&!0===e.checked&&r.setAttribute("aria-disabled","true"),r.tabIndex=-1,r.setAttribute("aria-label",null!=(t=null==(n=this._checkLabel)?void 0:n.call(this,e.node))?t:e.label),r}static _key(e){return"node"===e.kind?e.node.id:`${e.kind}:${e.node.id}`}static _same(e,t){return e.node===t.node&&e.depth===t.depth&&e.kind===t.kind&&e.message===t.message&&e.branch===t.branch&&e.open===t.open&&e.label===t.label&&e.tooltip===t.tooltip&&e.checked===t.checked&&e.locked===t.locked&&e.disabled===t.disabled}static _status(e,t,n,r){return{node:e,depth:t,kind:n,message:r,branch:!1,open:!1,label:e.label}}static _isBranch(e){return void 0!==e.children}static _rowIndex(e){let t=e instanceof Element?e.closest(".u2-list-row"):null;return t?Number(t.dataset.index):-1}static _twistie(e,t){let n=(0,a.K)(t?"chevron-down":"chevron-right",{cls:"u2-tree-twistie"});return e||n.classList.add("u2-tree-twistie-hidden"),n}static _span(e,t){let n=document.createElement("span");return n.className=e,n.textContent=t,n}constructor(e){let t=void 0===e?{}:e;super(),this.expanded=(0,i.vP)(new Set),this._roots=(0,i.vP)([]),this._flat=(0,i.vP)([]),this._loads=new Map,this._loaded=(0,i.vP)(0),this._shown=new Map,this._rename=t.onRename,this._render=t.render,this._check=t.onCheck,this._checkLabel=t.checkLabel;const n=t.contextActions;this._list=this.build(()=>{var e;return new h({itemHeight:null!=(e=t.itemHeight)?e:20,rowRole:"treeitem",keyOf:m._key,labelOf:e=>e.node.label,render:(e,t,n)=>this._renderRow(e,n),contextActions:n?e=>"node"===e.kind?n(e.node):[]:void 0},this)}),this.own(()=>{var e;return null==(e=this._endRename)?void 0:e.call(this)}),this.root.classList.add("u2-tree"),this.root.dataset.u2="tree",this._list.root.setAttribute("role","tree"),this._list.setItems(this._flat),this.root.append(this._list.root),this.selectedNode=(0,i.EW)(()=>{let e=this._flat.value[this._list.selectedIndex.value];return e&&"node"===e.kind?e.node:null}),this.selectedNodes=(0,i.EW)(()=>{let e=this._flat.value,t=[];var n=!0,r=!1,i=void 0;try{for(var o,a=this._list.selectedIndices.value[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){let n=e[o.value];n&&"node"===n.kind&&t.push(n.node)}}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}return t}),this.scope.listen(this._list.root,"click",e=>this._onClick(e),{capture:!0}),this.scope.listen(this._list.root,"dblclick",e=>{let t=e.target;t&&!t.closest(".u2-tree-twistie")&&this._startRename(m._rowIndex(t))}),this.scope.listen(this._list.root,"keydown",e=>this._onKeyDown(e)),this.effect(()=>this._rebuild())}}},6588(e,t,n){n.d(t,{n:()=>s});var r=n(7115),i=n(9701),o=n(9947),a=n(6099);let l=0;class s extends i.Ec{addPane(e,t,n,i){let l="object"==typeof n?n:{expanded:n,icon:i};i=l.icon;let s=a.a.stored("accordion",l.persistKey),u=null!=s?s:!0===l.expanded,d=`${this._idPrefix}-${this._nextPaneId++}`,c=document.createElement("div");c.className="u2-accordion-pane";let p=document.createElement("div");p.className="u2-accordion-header",p.id=`${d}-header`,p.tabIndex=0===this._panes.length?0:-1,p.title=e,p.dataset.u2Item=e,p.setAttribute("role","button"),p.setAttribute("aria-controls",`${d}-content`);let h=document.createElement("span");h.className="u2-accordion-chevron",h.append((0,o.Z)("chevron-down")),p.append(h);let m=void 0===i?void 0:(0,o.Z)(i);if(m){let e=document.createElement("span");e.className="u2-accordion-icon",e.append(m),p.append(e)}let f=document.createElement("span");f.className="u2-accordion-title",f.dataset.u2Part="item-label",f.textContent=e,p.append(f);let g=void 0===l.hint&&void 0===l.validity?void 0:document.createElement("span");void 0!==g&&(g.className="u2-accordion-hint",g.dataset.u2Part="pane-hint",p.append(g));let v=document.createElement("div");v.className="u2-accordion-content",v.id=`${d}-content`,v.setAttribute("role","region"),v.setAttribute("aria-labelledby",p.id),c.append(p,v),this.root.append(c);let b=this.scope.child("accordion-pane"),y={title:e,icon:m,root:c,header:p,content:v,scope:b,expanded:(0,r.vP)(u),persistKey:l.persistKey,validity:l.validity,userSet:null!==s,builder:"function"==typeof t?t:void 0};return y.builder||v.append(t),this._panes.push(y),b.effect(()=>this._apply(y)),void 0!==g&&a.a.bindHint(b,{root:c,header:p,hint:g,cls:"u2-accordion-pane",text:l.hint,validity:l.validity,folded:()=>!y.expanded.value,tooltip:()=>y.title}),y}getPane(e){return this._panes.find(t=>t.title===e)}setPaneTitle(e,t){let n=this._panes[e];void 0!==n&&(n.title=t,n.header.title=t,n.header.dataset.u2Item=t,n.header.querySelector(".u2-accordion-title").textContent=t)}paneAt(e){return this._panes[e]}removePane(e){let t=this._panes.findIndex(t=>t.title===e);if(t<0)return;let n=this._panes[t];n.scope.dispose(),n.root.remove(),this._panes.splice(t,1),this._panes.length>0&&!this._panes.some(e=>0===e.header.tabIndex)&&(this._panes[0].header.tabIndex=0)}getItems(){let e=this._panes.map((e,t)=>{var n,r,i;return r=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({key:e.title,label:e.title,index:t,expanded:e.expanded.peek()},(null==(n=e.validity)?void 0:n.peek())!=null?{invalid:!0}:{}),i=i={rendered:!0},Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(i)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(i,e))}),r});return{count:e.length,list:e,truncated:!1}}_apply(e){let t=e.expanded.value;if(e.header.setAttribute("aria-expanded",String(t)),e.content.style.display=t?"":"none",!t||!e.builder)return;let n=e.builder;e.builder=void 0,(0,r.O8)(()=>e.content.append(e.scope.build(n)))}_toggle(e){let t=this._panes[e];t.expanded.value=!t.expanded.peek(),t.userSet=!0,a.a.store("accordion",t.persistKey,t.expanded.peek())}_focus(e){for(let t=0;t<this._panes.length;t++)this._panes[t].header.tabIndex=t===e?0:-1;this._panes[e].header.focus()}_onClick(e){let t=e.target.closest(".u2-accordion-header");if(!t)return;let n=this._panes.findIndex(e=>e.header===t);n<0||(this._focus(n),this._toggle(n))}_onKeyDown(e){let t,n=this._panes.findIndex(e=>e.header===document.activeElement);if(n<0)return;let r=this._panes.length-1;switch(e.key){case"ArrowUp":t=0===n?r:n-1;break;case"ArrowDown":t=n===r?0:n+1;break;case"Home":t=0;break;case"End":t=r;break;case"Enter":case" ":e.preventDefault(),this._toggle(n);return;default:return}e.preventDefault(),this._focus(t)}constructor(e){super(),this._idPrefix=`u2-accordion-${++l}`,this._panes=[],this._nextPaneId=0,this.root.classList.add("u2-accordion"),this.root.classList.toggle("u2-accordion-flush",(null==e?void 0:e.flush)===!0),this.root.dataset.u2="accordion",this.scope.listen(this.root,"click",e=>this._onClick(e)),this.scope.listen(this.root,"keydown",e=>this._onKeyDown(e))}}},9178(e,t,n){n.d(t,{Z:()=>s});var r=n(7115),i=n(9701),o=n(1518),a=n(8609),l=n(9947);class s extends i.Ec{getState(){var e,t;return e=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},super.getState()),t=t={selected:this.selected.peek()},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}accessibleLabel(){var e;let t=void 0===this._title?"":i.Ec.text(this._title);return null!=(e=i.Ec.labelOf(this.root))?e:t||void 0}_build(e){let t=this._header(e);t&&this.root.append(t),void 0!==e.media&&this.root.append(s._media(e.media));let n=s._part((0,a.y4)(e.children,"u2-card-body"),"body");return this.root.append(n),e.footer&&this.root.append(s._part((0,a.y4)(e.footer,"u2-card-footer"),"footer")),n}_header(e){let t=e.title,n=e.subtitle,r=e.icon,i=e.actions;if(void 0===t&&void 0===n&&void 0===r&&!(null==i?void 0:i.length))return;let o=[];if(void 0!==r){let e=(0,l.Z)(r);e.classList.add("u2-card-icon"),o.push(e)}if(void 0!==t||void 0!==n){let e=[];void 0!==t&&e.push(this._title=s._part((0,a.Ln)(t,"u2-card-title"),"title")),void 0!==n&&e.push(s._part((0,a.Ln)(n,"u2-card-subtitle"),"subtitle")),o.push((0,a.y4)(e,"u2-card-titles"))}return(null==i?void 0:i.length)&&o.push(s._part((0,a.y4)(i,"u2-card-actions"),"actions")),s._part((0,a.y4)(o,"u2-card-header"),"header")}static _media(e){if("string"!=typeof e)return s._part((0,a.y4)([e],"u2-card-media"),"media");let t=document.createElement("img");return t.className="u2-card-media-img",t.src=e,t.alt="",s._part((0,a.y4)([t],"u2-card-media"),"media")}static _part(e,t){return e.dataset.u2Part=t,e}_wire(e){let t=e.onClick,n=!!e.selectable,r=!!e.clickable||void 0!==t,i=r||n;if((n||void 0!==e.selected)&&this._showSelection(i),!i)return;r&&this.root.classList.add("u2-card-clickable"),n&&this.root.classList.add("u2-card-selectable"),this.root.setAttribute("role","button"),this.root.tabIndex=0;let a="select"!==e.selectMode,l=e=>{n&&(this.selected.value=!a||!this.selected.peek()),null==t||t(e,this)},s=this.scope;s.listen(this.root,"click",e=>{let t=e.target.closest('button, a, input, textarea, select, [contenteditable="true"], [role="button"]');(null===t||t===this.root)&&l(e)}),s.listen(this.root,"keydown",e=>{let t=e.key;e.target===this.root&&("Enter"===t||" "===t)&&(e.preventDefault(),l(e))}),o.Yz.enabled&&this.root.addEventListener("click",()=>{var e;s.isDisposed&&this.root.isConnected&&console.warn(`u2: a click on card "${null!=(e=this.accessibleLabel())?e:""}", which was disposed with its owner`)})}_showSelection(e){this.effect(()=>{let t=this.selected.value;this.root.classList.toggle("u2-card-selected",t),e?this.root.setAttribute("aria-pressed",String(t)):t?this.root.setAttribute("aria-current","true"):this.root.removeAttribute("aria-current")})}constructor(e){let t=void 0===e?{}:e;super(),this.selected=t.selected instanceof r.HN?t.selected:(0,r.vP)(!!t.selected),this.root.classList.add("u2-card"),this.root.classList.toggle("u2-card-compact",!0===t.compact),this.root.dataset.u2="card",this.body=this.build(()=>this._build(t)),this._wire(t)}}},8848(e,t,n){n.d(t,{l:()=>f});var r=n(7115),i=n(9701),o=n(1518),a=n(317),l=n(3830),s=n(4977),u=n(8609),d=n(5232),c=n(9947),p=n(8195),h=n(5315);function m(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}class f extends i.Ec{static create(e,t){return new f(e,t)}get modal(){return this._modal&&!this.root.hidden}add(e){let t="function"==typeof e?this.build(e):e,n=i.Ec.is(t)?t.root:t;return"string"!=typeof n&&this._adopt(n),this._content.append(n),this}addButton(e,t,n){var r;let i=f._owned(t),o=this._button(e,e=>i(e,this),null==n?void 0:n.primary,null==n?void 0:n.disabled);return(null==n?void 0:n.start)===!0?(o.classList.add("u2-dialog-start"),this._buttons.insertBefore(o,f._firstAction(this._buttons,!0))):this._buttons.insertBefore(o,null!=(r=this._okBtn)?r:null),this._cancelButton(),this}onHelp(e){return this._onHelp=f._owned(e),this._helpBtn||(this._helpBtn=f._titleButton("u2-dialog-help","help","question","Help"),this.scope.listen(this._helpBtn,"click",()=>{var e;return null==(e=this._onHelp)?void 0:e.call(this)}),this._bar.insertBefore(this._helpBtn,this._closeBtn)),this}getButton(e){let t=e.trim().toLowerCase();return[...this._buttons.querySelectorAll("button"),...this._bar.querySelectorAll("button")].find(e=>{var n,r;return(null!=(n=e.textContent)?n:"").trim().toLowerCase()===t||(null==(r=e.getAttribute("aria-label"))?void 0:r.toLowerCase())===t})}onOK(e,t){this._onOK=f._owned(e);let n=this._okButton(null==t?void 0:t.text);return(null==t?void 0:t.primary)!==void 0&&n.classList.toggle("u2-btn-primary",t.primary),this}okDisabled(e,t){return this._okButton(),this._okOff.value=e,(null==t?void 0:t.footer)===!0&&this._footerLine(),this}status(e){return this._quiet.value=e,this._footerLine().classList.add("u2-dialog-status"),this}_footerLine(){if(void 0===this._reasonLine){let e=(0,r.EW)(()=>{let e=this._quiet.value;return null===e||"string"==typeof e?e:e.value}),t=this._reasonLine=this.build(()=>(0,h.Bs)((0,r.EW)(()=>this._okReason.value||null),e));t.classList.add("u2-dialog-reason","u2-status-line-warning"),t.dataset.u2Part="reason",this._buttons.insertBefore(t,f._firstAction(this._buttons,!1))}return this._reasonLine}static _firstAction(e,t){var n;return null!=(n=Array.from(e.children).find(e=>!e.classList.contains("u2-dialog-start")&&(t||!e.classList.contains("u2-dialog-reason"))))?n:null}closeGuard(e){return this._closeGuard=e,this}onCancel(e){return this._closeOnly&&o._U.report("close-only-cancel","onCancel() on a close-only dialog: it has no CANCEL, and CLOSE, ✕ and Escape close it as OK does — put the work in onOK, or in onClose to run on every close."),this._onCancel=f._owned(e),this._cancelButton(),this}_cancelButton(){this._cancelBtn||this._closeOnly||(this._cancelBtn=this._button("CANCEL",()=>this._dismiss()),this._buttons.insertBefore(this._cancelBtn,f._firstAction(this._buttons,!1)))}onClose(e){return this._onClose.push(f._owned(e)),this}show(e){var t,n;let r=void 0===e?{}:e;if(void 0!==this._unstack)return this;if(this.scope.isDisposed)return console.warn(`u2: dialog "${this._title.textContent}" was disposed when it closed — create it with {keepAlive: true} to show it again`),this;let i=this._u2.adopter;void 0===i||this._keepAlive||(this._u2.adopter=void 0,i.scope.disown(i.release)),this._restore=null!=(t=document.activeElement)?t:void 0,this._error.value=null,void 0!==r.width&&(this.root.style.width=`${r.width}px`),void 0!==r.height&&(this.root.style.height=`${r.height}px`),this.root.classList.toggle("u2-dialog-sized",void 0!==r.height||!0===r.resizable),this.root.classList.toggle("u2-dialog-resizable",!0===r.resizable),this._modal=!0===r.modal;let o=l.h.nextDialogZ();if(this._modal?(this._backdrop.style.zIndex=String(o),this.root.style.zIndex=String(o+1),this.root.setAttribute("aria-modal","true"),document.body.append(this._backdrop)):(this.root.style.zIndex=String(o),this.root.removeAttribute("aria-modal")),document.body.append(this.root),this._unstack=l.h.pushDialog(this),this._open.value=!0,this._form.value=f._formOf(this._content),this._alignLabels(),this._at={x:r.x,y:r.y},this._place(r.x,r.y),!0===r.resizable){let e=this.root.getBoundingClientRect();this._at={x:e.left,y:e.top}}let a=f._focusable(this._content).find(e=>!f._readOnly(e));return(null!=(n=null!=a?a:this._okBtn)?n:this.root).focus(),(a instanceof HTMLInputElement||a instanceof HTMLTextAreaElement)&&a.select(),this._pin(r.visible,r.owner),this}_pin(e,t){if(void 0===e&&void 0===t)return;let n=this._showing=this.scope.child("dialog-showing");void 0!==e&&n.effect(()=>this._hide(!e.value)),void 0!==t&&n.own(a.Q.adopt(t,()=>this.close()))}_hide(e){this.root.hidden!==e&&(this.root.hidden=e,this._backdrop.hidden=e,e||this._place(this._at.x,this._at.y))}static _readOnly(e){return!0===e.readOnly||"true"===e.getAttribute("aria-readonly")||null!==e.closest(".u2-input-readonly")}close(e){let t=this._unstack;if(void 0===t)return;this._unstack=void 0,t(),null==(u=this._pending)||u.abort(),this._setBusy(void 0),this._drag=void 0,null==(d=this._showing)||d.dispose(),this._showing=void 0,this._hide(!1),this._backdrop.remove(),this.root.remove(),this._open.value=!1;let n=this._restore;this._restore=void 0;let r=f._topmost();void 0===r||(null==n?void 0:n.isConnected)&&r.contains(n)?(null==n?void 0:n.isConnected)&&n.focus():r.focus();let i=null!=(s=this._closing)?s:void 0===e?"code":e;var o=!0,a=!1,l=void 0;try{for(var s,u,d,c,p=this._onClose[Symbol.iterator]();!(o=(c=p.next()).done);o=!0){let e=c.value;try{e(i)}catch(e){this.scope.reportError(e)}}}catch(e){a=!0,l=e}finally{try{o||null==p.return||p.return()}finally{if(a)throw l}}this.fireEvent("close",i),this._keepAlive||this.dispose()}dispose(){this.close(),super.dispose()}cancelByKey(){var e;void 0!==this._pending?this._pending.abort():this._closeOnly&&(null==(e=this._okBtn)?void 0:e.disabled)!==!0?this._accept():this._dismiss()}getState(){var e,t,n,r;return n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},super.getState()),r=r={open:this._open.peek(),busy:this._busy.peek(),error:this._error.peek(),valid:(null==(t=f._formOf(this._content))||null==(e=t.validity)?void 0:e.peek())==null},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(r)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}),n}static _formOf(e){let t=e.querySelector(".u2-form"),n=null===t?void 0:i.Ec.forElement(t);return n instanceof p.l?n:void 0}accessibleLabel(){return i.Ec.text(this._title)||void 0}_okButton(e){if(this._okBtn)void 0!==e&&(this._okBtn.textContent=e);else{let t=this._okBtn=this._button(null!=e?e:"OK",()=>this._accept());s.m.bind(t,()=>{var e;return null!=(e=d.B.of(t))?e:""},{owner:this.scope}),this._buttons.append(t),this._cancelButton(),this.effect(()=>{let e=this._okReason.value;this._busy.peek()||d.B.apply(t,e)})}return this._okBtn}_button(e,t,n,r){return this.build(()=>(0,u.x6)(e,t,{primary:n,disabled:r}))}_accept(){var e,t;let n;if(void 0!==this._pending||(null==(e=this._closeGuard)?void 0:e.call(this))===!1)return;this._error.value=null;let r=new AbortController;this._closing="ok";try{n=null==(t=this._onOK)?void 0:t.call(this,{signal:r.signal})}catch(e){this._fail(e);return}finally{this._closing=void 0}if(void 0===this._unstack)return;let i=o.HG.thenable(n);void 0!==i?this._await(i,r):!1!==n&&this.close("ok")}_await(e,t){var n;return(n=function*(){let n;this._setBusy(t);try{n=yield e}catch(e){this._pending===t&&(this._setBusy(void 0),this._fail(e));return}this._pending===t&&(this._setBusy(void 0),!1!==n&&this.close("ok"))},function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(e){m(o,r,i,a,l,"next",e)}function l(e){m(o,r,i,a,l,"throw",e)}a(void 0)})}).call(this)}_dismiss(){var e,t;let n;if((null==(e=this._closeGuard)?void 0:e.call(this))!==!1){this._closing="cancel";try{n=null==(t=this._onCancel)?void 0:t.call(this)}catch(e){this.scope.reportError(e)}finally{this._closing=void 0}!1!==n&&this.close("cancel")}}_fail(e){(null==e?void 0:e.name)!=="AbortError"&&(this._error.value=e instanceof Error?e.message:String(e))}_setBusy(e){this._pending=e;let t=void 0!==e;if(this._busy.peek()===t)return;this._busy.value=t;let n=this._okBtn;if(t){this._buttons.contains(document.activeElement)&&this.root.focus(),this._held=[...this._buttons.querySelectorAll("button")].filter(e=>!e.disabled);var r=!0,i=!1,o=void 0;try{for(var a,l=this._held[Symbol.iterator]();!(r=(a=l.next()).done);r=!0){let e=a.value;d.B.apply(e,f.WAITING)}}catch(e){i=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}this.root.setAttribute("aria-busy","true"),null==n||n.setAttribute("aria-busy","true"),null==n||n.append(this._spinner);return}var s=!0,u=!1,c=void 0;try{for(var p,h=this._held[Symbol.iterator]();!(s=(p=h.next()).done);s=!0){let e=p.value;d.B.of(e)===f.WAITING&&d.B.apply(e,null)}}catch(e){u=!0,c=e}finally{try{s||null==h.return||h.return()}finally{if(u)throw c}}this._held=[],void 0!==n&&d.B.apply(n,this._okReason.peek()),this.root.removeAttribute("aria-busy"),null==n||n.removeAttribute("aria-busy"),this._spinner.remove()}_adopt(e){let t=o.HG.ambient;if(t!==this.scope)for(let n=0,r=[e,...e.querySelectorAll(".u2-component")];n<r.length;n++){let e=r[n],o=i.Ec.forElement(e);if(void 0===o||o.root!==e||o===this)continue;let a=o._u2,l=a.adopter;if(!(void 0===l&&void 0===t&&o.ambientAdoption)&&(void 0===l||l.scope!==t))continue;void 0!==l&&l.scope.disown(l.release);let s=()=>o.dispose();a.adopter={scope:this.scope,release:s},this.scope.own(s)}}_raise(){if(void 0===this._unstack)return;let e=l.h.nextDialogZ();parseInt(this.root.style.zIndex,10)<e-1&&(this.root.style.zIndex=String(e)),l.h.raiseDialog(this)}_place(e,t){this.root.style.left="0px";let n=this.root.getBoundingClientRect(),r=null!=e?e:(window.innerWidth-n.width)/2,i=null!=t?t:(window.innerHeight-n.height)/2;this.root.style.left=`${Math.max(0,Math.min(r,window.innerWidth-n.width))}px`,this.root.style.top=`${Math.max(0,Math.min(i,window.innerHeight-n.height))}px`}_onPointerDown(e){if(0!==e.button||e.target.closest("button"))return;e.preventDefault();let t=this.root.getBoundingClientRect();this._drag={dx:e.clientX-t.left,dy:e.clientY-t.top},this._bar.setPointerCapture(e.pointerId)}_onPointerMove(e){this._drag&&(this._at={x:e.clientX-this._drag.dx,y:e.clientY-this._drag.dy},this._place(this._at.x,this._at.y))}_alignLabels(){let e=Array.from(this._content.children).filter(e=>e.classList.contains("u2-input-root"));p.l.fitChoices(this._content,e);let t=e.map(e=>e.querySelector(".u2-input-label")).filter(e=>null!==e);if(0===t.length)return;this._content.style.setProperty("--u2-dialog-label-width","auto");let n=0;var r=!0,i=!1,o=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done);r=!0){let e=a.value;n=Math.max(n,Math.ceil(e.getBoundingClientRect().width))}}catch(e){i=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}this._content.style.setProperty("--u2-dialog-label-width",`${n}px`);var u=!0,d=!1,c=void 0;try{for(var h,m=t[Symbol.iterator]();!(u=(h=m.next()).done);u=!0){let e=h.value;s.m.titleIfCut(e)}}catch(e){d=!0,c=e}finally{try{u||null==m.return||m.return()}finally{if(d)throw c}}}_endDrag(){this._drag=void 0}_onKeyDown(e){if("Escape"===e.key)e.defaultPrevented||(e.preventDefault(),e.stopPropagation(),this.cancelByKey());else if(this._okBtn&&f.entersDefault(e)){var t;e.preventDefault(),this._okBtn.disabled?this._busy.peek()||(null==(t=this._form.peek())?void 0:t.validate())===!1||this._okBtn.focus():this._accept()}else"Tab"===e.key&&this._trapTab(e)}_trapTab(e){let t=f._focusable(this.root);if(0===t.length)return;let n=document.activeElement;e.shiftKey&&n===t[0]?(e.preventDefault(),t[t.length-1].focus()):e.shiftKey||n!==t[t.length-1]||(e.preventDefault(),t[0].focus())}static _topmost(){let e;var t=!0,n=!1,r=void 0;try{for(var i,o=Array.from(document.querySelectorAll(".u2-dialog"))[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){let t=i.value;t.isConnected&&!t.hidden&&(void 0===e||Number(t.style.zIndex||0)>=Number(e.style.zIndex||0))&&(e=t)}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}return e}static entersDefault(e){if("Enter"!==e.key||e.defaultPrevented)return!1;let t=e.target;return!(t instanceof Element)||null===t.closest('button, a, input[type="checkbox"], input[type="radio"], select, textarea, .u2-chip, .u2-chips-chip, [role="button"], [role="checkbox"], [role="option"]')}static _owned(e){let t=o.HG.ambient;return(...n)=>(0,r.vA)(()=>o.HG.runWith((null==t?void 0:t.isDisposed)?void 0:t,()=>e(...n)))}static _titleButton(e,t,n,r){let i=document.createElement("button");return i.type="button",i.className=e,i.dataset.u2Part=t,i.setAttribute("aria-label",r),i.append((0,c.K)(n)),i}static _focusable(e){return Array.from(e.querySelectorAll('a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')).filter(e=>null!==e.offsetParent)}constructor(e,t){let n=void 0===t?{}:t;super(),this._open=(0,r.vP)(!1),this._busy=(0,r.vP)(!1),this._error=(0,r.vP)(null),this._title=document.createElement("div"),this._bar=document.createElement("div"),this._closeBtn=f._titleButton("u2-dialog-close","close","times","Close"),this._content=document.createElement("div"),this._errorRow=document.createElement("div"),this._buttons=document.createElement("div"),this._backdrop=document.createElement("div"),this._spinner=document.createElement("span"),this._onClose=[],this._quiet=(0,r.vP)(null),this._okOff=(0,r.vP)(void 0),this._form=(0,r.vP)(void 0),this._okReason=(0,r.EW)(()=>{var e,t;return null!=(e=null==(t=this._form.value)?void 0:t.problem.value)?e:d.B.read(this._okOff.value)}),this._held=[],this._at={},this._modal=!1,this.isOpen=this._open,this.busy=this._busy,this.error=this._error,this._keepAlive=!0===n.keepAlive,this._closeOnly=!0===n.closeOnly,void 0!==n.name&&(this.name=n.name),this.root.classList.add("u2-dialog"),this.root.dataset.u2="dialog",this.root.tabIndex=-1,this.root.setAttribute("role","dialog");const i=`u2-dialog-${++f._seq}-title`;this._title.className="u2-dialog-title-text",this._title.id=i,this._title.dataset.u2Part="title",this._title.textContent=e,this.root.setAttribute("aria-labelledby",i);const o=this._closeBtn;this._bar.className="u2-dialog-title",this._bar.append(this._title,o),this._content.className="u2-dialog-content",this._content.dataset.u2Part="body",this._errorRow.className="u2-dialog-error",this._errorRow.dataset.u2Part="error-row",this._errorRow.setAttribute("role","alert"),this._errorRow.hidden=!0,this._buttons.className="u2-dialog-buttons",this._buttons.dataset.u2Part="footer",this._backdrop.className="u2-dialog-backdrop",this._spinner.className="u2-dialog-busy",this._spinner.dataset.u2Part="busy",this._spinner.setAttribute("aria-hidden","true"),this.root.append(this._bar,this._content,this._errorRow,this._buttons);const a=this.scope;a.listen(o,"click",()=>this.cancelByKey()),a.listen(this._bar,"pointerdown",e=>this._onPointerDown(e)),a.listen(this._bar,"pointermove",e=>this._onPointerMove(e)),a.listen(this._bar,"pointerup",()=>this._endDrag()),a.listen(this._bar,"pointercancel",()=>this._endDrag()),a.listen(this._backdrop,"pointerdown",e=>e.preventDefault()),a.listen(this.root,"pointerdown",()=>this._raise()),a.listen(this.root,"keydown",e=>this._onKeyDown(e)),a.listen(this._content,"input",()=>this._error.value=null),a.listen(this._content,"change",()=>this._error.value=null);const l=()=>{void 0!==this._unstack&&this._place(this._at.x,this._at.y)};a.listen(window,"resize",l);const s=new ResizeObserver(l);s.observe(this.root),this.own(()=>s.disconnect()),this.effect(()=>{let e=this._error.value;this._errorRow.textContent=null!=e?e:"",this._errorRow.hidden=null===e}),this._closeOnly&&this._okButton("CLOSE")}}f.isRoot=!0,f.WAITING="Wait for OK to finish",f._seq=0},6099(e,t,n){n.d(t,{a:()=>i});var r=n(7115);class i{static stored(e,t){if(void 0===t)return null;try{var n;let r=null==(n=globalThis.localStorage)?void 0:n.getItem(`u2.${e}.${t}`);return"true"===r||"false"!==r&&null}catch(e){return null}}static store(e,t,n){if(void 0!==t)try{var r;null==(r=globalThis.localStorage)||r.setItem(`u2.${e}.${t}`,String(n))}catch(e){}}static bindHint(e,t){let n=t.root,i=t.header,o=t.hint,a=t.cls,l=t.text,s=t.validity,u=t.folded,d=o;l instanceof HTMLElement&&((d=document.createElement("span")).className=`${a}-message`,o.append(l,d)),e.effect(()=>{var e,c,p,h;let m=null!=(e=null==s?void 0:s.value)?e:null,f=null!==m&&u();n.classList.toggle(`${a}-invalid`,null!==m),null===m?i.removeAttribute("aria-invalid"):i.setAttribute("aria-invalid","true"),void 0!==s&&(i.title=null!=(c=null!=m?m:null==(h=t.tooltip)?void 0:h.call(t))?c:""),l instanceof HTMLElement?(l.hidden=f,d.textContent=f?m:""):o.textContent=f?m:l instanceof r.HN?String(null!=(p=l.value)?p:""):null!=l?l:""})}}},1019(e,t,n){n.d(t,{Y:()=>l});var r=n(9701),i=n(8609),o=n(8195);let a=e=>void 0===e?[]:Array.isArray(e)?e:[e];class l extends r.Ec{get header(){return this._header}get footer(){return void 0===this._footer&&(this._footer=this._part("footer",[]),this.root.append(this._footer)),this._footer}_part(e,t){let n=(0,i.y4)(t.map(e=>this._adopt(e)),`u2-page-${e}`);return n.dataset.u2Part=e,n}_section(e){let t=[];if(void 0!==e.title||void 0!==e.actions){var n;let r=this.build(()=>{var t;return(0,i.h1)(null!=(t=e.title)?t:"")});r.className="u2-page-section-title",r.dataset.u2Part="section-title";let o=(0,i.y4)([r,...(null!=(n=e.actions)?n:[]).map(e=>this._adopt(e))],"u2-page-section-header");o.dataset.u2Part="section-header",t.push(o)}let r=(0,i.y4)(a(e.content).map(e=>this._adopt(e)),"u2-page-section-content");r.dataset.u2Part="section-content",void 0!==e.maxWidth&&(r.style.maxWidth=`${e.maxWidth}px`),t.push(r);let o=(0,i.y4)(t,"u2-page-section");return o.dataset.u2Part="section",void 0!==e.name&&(o.dataset.u2Name=e.name),o}_adopt(e){return r.Ec.is(e)?(this.own(()=>e.dispose()),e.root):e}constructor(e){var t,n;let r=void 0===e?{}:e;super();const i=this.root;i.classList.add("u2-page"),i.dataset.u2="page",void 0!==r.name&&(this.name=r.name),void 0!==r.maxWidth&&i.style.setProperty("--u2-page-max-width",`${r.maxWidth}px`),void 0!==r.header&&(this._header=this._part("header",a(r.header)),i.append(this._header)),this.body=this._part("body",[...(null!=(t=r.sections)?t:[]).map(e=>this._section(e)),...a(r.content)]),i.append(this.body),void 0!==r.footer&&this.footer.append(...r.footer.map(e=>this._adopt(e))),!1!==r.labelColumn&&(this.labelColumn=null!=(n=r.labelColumn)?n:new o.B,o.B.share(i,this.labelColumn))}}},1573(e,t,n){n.d(t,{w:()=>c});var r=n(7115),i=n(9701),o=n(8609),a=n(5232),l=n(9947),s=n(6099);function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}let d=0;class c extends i.Ec{add(...e){var t=!0,n=!1,r=void 0;try{for(var o,a=e[Symbol.iterator]();!(t=(o=a.next()).done);t=!0){let e=o.value;this.body.append(i.Ec.is(e)?e.root:e)}}catch(e){n=!0,r=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw r}}return this}get userSet(){return this._userSet}getState(){var e,t,n,r;let i=null!=(e=null==(t=this._validity)?void 0:t.peek())?e:null;return u((n=u({},super.getState()),r=r={expanded:!this._collapsible||this.expanded.peek()},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(r)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}),n),null!==i?{valid:!1,error:i}:{})}accessibleLabel(){var e;return null!=(e=this.root.getAttribute("aria-label"))?e:i.Ec.text(this._title)||void 0}constructor(e){super(),this._userSet=!1;const t=`u2-section-${++d}`;this.root.classList.add("u2-section"),this.root.dataset.u2="section",this.root.setAttribute("role","group");const n=s.a.stored("section",e.persistKey);this._userSet=null!==n,this.expanded=e.expanded instanceof r.HN?e.expanded:(0,r.vP)(null!=n?n:!1!==e.expanded),null!==n&&e.expanded instanceof r.HN&&(this.expanded.value=n),this._validity=e.validity;const u=this._collapsible=!1!==e.collapsible,c=this._title=this.build(()=>(0,o.Ln)(e.title,"u2-section-title"));c.id=`${t}-title`,c.dataset.u2Part="title",this.root.setAttribute("aria-labelledby",c.id);const p=void 0===e.hint&&void 0===e.validity?void 0:(0,o.Ln)("","u2-section-hint");if(void 0!==p&&(p.dataset.u2Part="section-hint"),this.header=(0,o.y4)(void 0===p?[c]:[c,p],"u2-section-header"),this.header.id=`${t}-header`,this.header.dataset.u2Part="header",this.body=(0,o.y4)([],"u2-section-body"),this.body.id=`${t}-body`,this.body.dataset.u2Part="body",this.body.setAttribute("role","region"),this.body.setAttribute("aria-labelledby",this.header.id),this.root.append(this.header,this.body),void 0!==p&&s.a.bindHint(this.scope,{root:this.root,header:this.header,hint:p,cls:"u2-section",text:e.hint,validity:e.validity,folded:()=>u&&!this.expanded.value}),void 0!==e.disabled){const t=(0,o.Ln)("","u2-section-reason");t.dataset.u2Part="reason",this.header.append(t),a.B.follow(e.disabled,e=>{t.textContent=null!=e?e:"",a.B.region(this.body,e)},this.scope)}if(void 0!==e.actions){const t=(0,o.Ln)("","u2-section-actions");t.dataset.u2Part="actions";var h=!0,m=!1,f=void 0;try{for(var g,v=e.actions[Symbol.iterator]();!(h=(g=v.next()).done);h=!0){const e=g.value;t.append(i.Ec.is(e)?e.root:e)}}catch(e){m=!0,f=e}finally{try{h||null==v.return||v.return()}finally{if(m)throw f}}for(let e=0,n=["click","keydown"];e<n.length;e++){const r=n[e];this.scope.listen(t,r,e=>e.stopPropagation())}this.header.append(t)}if(!u)return;const b=document.createElement("span");b.className="u2-section-chevron",b.setAttribute("aria-hidden","true"),b.append((0,l.Z)("chevron-down")),"end"===e.chevron?(this.header.classList.add("u2-section-chevron-end"),this.header.append(b)):this.header.prepend(b),this.header.setAttribute("role","button"),this.header.setAttribute("aria-controls",this.body.id),this.header.tabIndex=0;const y=()=>{this.expanded.value=!this.expanded.peek(),this._userSet=!0,s.a.store("section",e.persistKey,this.expanded.peek())};this.scope.listen(this.header,"click",y),this.scope.listen(this.header,"keydown",e=>{let t=e.key;("Enter"===t||" "===t)&&(e.preventDefault(),y())}),this.effect(()=>{let e=this.expanded.value;this.header.setAttribute("aria-expanded",String(e)),this.body.style.display=e?"":"none"})}}},4151(e,t,n){n.d(t,{O:()=>o});var r=n(9701),i=n(7115);class o extends r.Ec{getState(){var e,t;return e=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},super.getState()),t=t={extra:{sizes:this.sizes.peek().map(e=>Math.round(1e3*e)/10).join(",")}},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}_createSash(e){let t=document.createElement("div");return t.className="u2-sash",t.dataset.u2Part="sash",t.tabIndex=0,t.setAttribute("role","separator"),t.setAttribute("aria-orientation",this._horizontal?"vertical":"horizontal"),t.setAttribute("aria-valuemin","0"),t.setAttribute("aria-valuemax","100"),this.scope.listen(t,"pointerdown",t=>this._onPointerDown(t,e)),this.scope.listen(t,"pointermove",e=>this._onPointerMove(e)),this.scope.listen(t,"pointerup",()=>this._endDrag()),this.scope.listen(t,"pointercancel",()=>this._endDrag()),this.scope.listen(t,"pointerenter",()=>this._hover(t,!0)),this.scope.listen(t,"pointerleave",()=>this._hover(t,!1)),this.scope.listen(t,"dblclick",()=>this._resetPair(e)),this.scope.listen(t,"keydown",t=>this._onKeyDown(t,e)),t}_hover(e,t){var n;null==(n=this._hoverTimer)||n.call(this),this._hoverTimer=void 0,t?this._hoverTimer=this.scope.setTimeout(()=>e.classList.add("u2-sash-hover"),150):e.classList.remove("u2-sash-hover")}_onPointerDown(e,t){if(0!==e.button)return;e.preventDefault();let n=this._sashes[t];n.setPointerCapture(e.pointerId),n.classList.add("u2-sash-active"),this.root.classList.add("u2-splitter-dragging"),this._drag={index:t,startSizes:this.sizes.peek(),startPos:this._coord(e),total:this._total()}}_onPointerMove(e){!this._drag||(this._pointerPos=this._coord(e),this._frame||(this._frame=this.scope.requestFrame(()=>{this._frame=void 0,this._applyDrag()})))}_endDrag(){this._drag&&(this._frame&&(this._frame(),this._frame=void 0,this._applyDrag()),this._sashes[this._drag.index].classList.remove("u2-sash-active"),this.root.classList.remove("u2-splitter-dragging"),this._drag=void 0)}_applyDrag(){let e=this._drag;this._resize(e.index,e.startSizes,(this._pointerPos-e.startPos)/e.total,e.total)}_onKeyDown(e,t){let n=this._horizontal?"ArrowLeft":"ArrowUp",r=this._horizontal?"ArrowRight":"ArrowDown";if(e.key!==n&&e.key!==r)return;e.preventDefault();let i=(e.shiftKey?.1:.02)*(e.key===r?1:-1);this._resize(t,this.sizes.peek(),i,this._total())}_resetPair(e){let t=this.sizes.peek().slice(),n=(t[e]+t[e+1])/2;t[e]=n,t[e+1]=n,this.sizes.value=t}_resize(e,t,n,r){let i=this._minSize/r,o=i-t[e],a=t[e+1]-i;if(o>a)return;let l=Math.max(o,Math.min(a,n)),s=t.slice();s[e]+=l,s[e+1]-=l,this.sizes.value=s}_clamp(){let e=this._total();if(0===e||this._drag)return;let t=Math.min(this._minSize/e,1/this._panels.length),n=this.sizes.peek(),r=n.reduce((e,n)=>e+Math.max(0,t-n),0);if(r<1e-6)return;let i=n.reduce((e,n)=>e+Math.max(0,n-t),0);this.sizes.value=n.map(e=>e<=t?t:e-(e-t)/i*r)}_layout(){let e=this.sizes.value,t=0;for(let n=0;n<this._panels.length;n++){let r=100*e[n];this._panels[n].style.flexBasis=`${r}%`,t+=r;let i=this._sashes[n];i&&(i.style.setProperty(this._horizontal?"left":"top",`calc(${t}% - 2px)`),i.setAttribute("aria-valuenow",String(Math.round(t))))}}_total(){return this._horizontal?this.root.clientWidth:this.root.clientHeight}_coord(e){return this._horizontal?e.clientX:e.clientY}constructor(e,t){super(),this._panels=[],this._sashes=[],this._pointerPos=0,this._horizontal="horizontal"===t.direction,this._minSize=null!=(u=t.minSize)?u:60;const n=(null==(d=t.sizes)?void 0:d.length)===e.length?t.sizes:e.map(()=>1/e.length),o=n.reduce((e,t)=>e+t,0);this.sizes=(0,i.vP)(n.map(e=>e/o)),this.root.classList.add("u2-splitter",this._horizontal?"u2-splitter-horizontal":"u2-splitter-vertical"),this.root.dataset.u2="splitter";var a=!0,l=!1,s=void 0;try{for(var u,d,c,p=e[Symbol.iterator]();!(a=(c=p.next()).done);a=!0){const e=c.value;r.Ec.is(e)&&this.own(()=>e.dispose());const t=document.createElement("div");t.className="u2-splitter-panel",t.append(r.Ec.is(e)?e.root:e),this._panels.push(t),this.root.append(t)}}catch(e){l=!0,s=e}finally{try{a||null==p.return||p.return()}finally{if(l)throw s}}for(let t=0;t<e.length-1;t++){const e=this._createSash(t);this._sashes.push(e),this.root.append(e)}this.effect(()=>this._layout());const h=new ResizeObserver(()=>this._clamp());h.observe(this.root),this.own(()=>h.disconnect())}}},4980(e,t,n){n.d(t,{q:()=>d});var r=n(7115),i=n(9701),o=n(1518),a=n(9947);function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function s(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}let u=0;class d extends i.Ec{addTab(e){var t;let n=document.createElement("div");n.className="u2-tabs-tab",n.id=`${this._idPrefix}-tab-${e.id}`,n.dataset.id=e.id,n.dataset.u2Item=e.id,n.tabIndex=-1,n.title=null!=(t=e.tooltip)?t:e.title,n.setAttribute("role","tab"),n.setAttribute("aria-selected","false"),n.setAttribute("aria-controls",`${this._idPrefix}-panel-${e.id}`);let r=document.createElement("span");r.className="u2-tabs-label",r.dataset.u2Part="item-label",r.textContent=e.title;let o=document.createElement("span");o.className=e.closable?"u2-tabs-close":"u2-tabs-mark",e.closable&&(o.title="Close",o.dataset.u2Part="close"),void 0!==e.icon&&n.append(d._icon(e.icon)),n.append(r,o);let a=document.createElement("div");a.className="u2-tabs-panel",a.id=`${this._idPrefix}-panel-${e.id}`,a.style.display="none",a.setAttribute("role","tabpanel"),a.setAttribute("aria-labelledby",n.id),this._scroller.append(n),this._content.append(a);let l=this._eager&&"function"!=typeof e.content,s={options:e,header:n,panel:a,mark:o,built:l,scope:this.scope.child("tab-validity")};l&&a.append(e.content instanceof i.Ec?e.content.root:e.content),this._tabs.value=[...this._tabs.peek(),s],void 0!==e.validity?this._watchValidity(s,e.validity):"function"!=typeof e.content&&this._watchContent(s,e.content),null===this.activeTab.peek()&&(this.activeTab.value=e.id),this._updateOverflow()}_watchValidity(e,t){e.scope.effect(()=>{let n=t.value;(0,r.O8)(()=>this.setInvalid(e.options.id,n))})}_watchContent(e,t){let n=t.shownProblem instanceof r.HN?t.shownProblem:t.error;t instanceof i.Ec&&n instanceof r.HN&&this._watchValidity(e,n)}closeTab(e){let t=this._tabs.peek(),n=t.findIndex(t=>t.options.id===e);if(n<0)return;t[n].header.remove(),t[n].panel.remove(),t[n].scope.dispose();let r=t.slice();r.splice(n,1),this._tabs.value=r,this.activeTab.peek()===e&&(this.activeTab.value=r.length>0?r[Math.min(n,r.length-1)].options.id:null),this._updateOverflow(),this.fireEvent("tabClosed",e)}getState(){let e=this.activeTab.peek();return l({},super.getState(),null===e?{}:{current:e})}getItems(){let e=this.activeTab.peek(),t=this._tabs.peek().map((t,n)=>{let r=t.options,i=r.id,o=r.title,a=r.tooltip;return s(l({key:i,label:o||a||i,index:n,selected:i===e,current:i===e},t.invalid?{invalid:!0}:{}),{rendered:!0})});return{count:t.length,list:t,truncated:!1}}setDirty(e,t){let n=this._find(e);n&&n.mark.classList.toggle("u2-tabs-dirty",t)}setInvalid(e,t){var n;let r=this._find(e);void 0!==r&&(r.invalid=t,r.header.classList.toggle("u2-tabs-invalid",null!==t),null===t?r.header.removeAttribute("aria-invalid"):r.header.setAttribute("aria-invalid","true"),r.header.title=null!=(n=null!=t?t:r.options.tooltip)?n:r.options.title)}static _icon(e){let t=document.createElement("span");return t.className="u2-tabs-icon",t.append((0,a.Z)(e)),t}setTabTitle(e,t){let n=this._find(e);void 0!==n&&(n.options=s(l({},n.options),{title:t}),n.header.querySelector(".u2-tabs-label").textContent=t,void 0!==n.options.tooltip||n.invalid||(n.header.title=t),this._tabs.value=[...this._tabs.peek()])}_find(e){return this._tabs.peek().find(t=>t.options.id===e)}_applyActive(){let e=this.activeTab.value;var t=!0,n=!1,o=void 0;try{for(var a,l=this._tabs.value[Symbol.iterator]();!(t=(a=l.next()).done);t=!0){let t=a.value,n=t.options.id===e;if(t.header.classList.toggle("u2-tabs-tab-active",n),t.header.setAttribute("aria-selected",String(n)),t.header.tabIndex=n?0:-1,t.panel.style.display=n?"":"none",n){if(!t.built){t.built=!0;let e=t.options.content;this.scope.child("tab").build(()=>(0,r.O8)(()=>{let n="function"==typeof e?e():e;t.panel.append(n instanceof i.Ec?n.root:n),"function"==typeof e&&void 0===t.options.validity&&this._watchContent(t,n)}))}this._reveal(t)}}}catch(e){n=!0,o=e}finally{try{t||null==l.return||l.return()}finally{if(n)throw o}}}_reveal(e){let t=this._scroller.getBoundingClientRect(),n=e.header.getBoundingClientRect();this._scroller.scrollLeft+=Math.min(0,n.left-t.left)+Math.max(0,n.right-t.right),this._scroller.scrollTop+=Math.min(0,n.top-t.top)+Math.max(0,n.bottom-t.bottom)}_focus(e){var t=!0,n=!1,r=void 0;try{for(var i,o=this._tabs.peek()[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){let t=i.value;t.header.tabIndex=t===e?0:-1}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}e.header.focus(),e.header.scrollIntoView({block:"nearest",inline:"nearest"})}_onPointerDown(e){let t=e.target,n=t.closest(".u2-tabs-tab");if(!n)return;let r=this._find(n.dataset.id);if(r){if(1===e.button){e.preventDefault(),r.options.closable&&this.closeTab(r.options.id);return}if(0===e.button){if(t.closest(".u2-tabs-close")){e.preventDefault(),this.closeTab(r.options.id);return}this.activeTab.value=r.options.id}}}_onKeyDown(e){let t,n=this._tabs.peek(),r=n.findIndex(e=>e.header===document.activeElement);if(r<0)return;let i=n.length-1,o=0===r?i:r-1,a=r===i?0:r+1,l="vertical"===this.orientation;switch(e.key){case"ArrowLeft":t=o;break;case"ArrowRight":t=a;break;case"ArrowUp":if(!l)return;t=o;break;case"ArrowDown":if(!l)return;t=a;break;case"Home":t=0;break;case"End":t=i;break;case"Enter":case" ":e.preventDefault(),this.activeTab.value=n[r].options.id;return;case"Delete":{if(!n[r].options.closable)return;e.preventDefault(),this.closeTab(n[r].options.id);let t=this._tabs.peek();t.length>0&&this._focus(t[Math.min(r,t.length-1)]);return}default:return}e.preventDefault(),this._focus(n[t])}_onMenuClick(e){let t=e.target.closest(".u2-tabs-overflow-item");if(!t)return;let n=this._find(t.dataset.id);this._menuOpen.value=!1,n&&(this.activeTab.value=n.options.id,n.header.scrollIntoView({block:"nearest",inline:"nearest"}))}_onDocumentPointerDown(e){let t=e.target;this._menu.contains(t)||this._overflow.contains(t)||(this._menuOpen.value=!1)}_onDocumentKeyDown(e){"Escape"===e.key&&(this._menuOpen.value=!1,this._overflow.focus())}_renderMenu(){let e=this._menuOpen.value;if(this._menu.classList.toggle("u2-tabs-overflow-menu-open",e),!e){this._menu.textContent="";return}let t=o.HG.ambient;t.listen(document,"pointerdown",e=>this._onDocumentPointerDown(e)),t.listen(document,"keydown",e=>this._onDocumentKeyDown(e));let n=this.activeTab.value;this._menu.replaceChildren(...this._tabs.value.map(e=>{let t=e.options,r=t.id,i=t.title,o=t.icon,a=t.tooltip,l=document.createElement("div");return l.className="u2-tabs-overflow-item",l.dataset.id=r,l.setAttribute("role","menuitem"),l.classList.toggle("u2-tabs-overflow-item-active",r===n),void 0!==o&&l.append(d._icon("string"==typeof o?o:o.cloneNode(!0))),l.append(i||a||r),l}))}_updateOverflow(){let e="vertical"===this.orientation?this._scroller.scrollHeight>this._scroller.clientHeight+1:this._scroller.scrollWidth>this._scroller.clientWidth+1;this._overflow.classList.toggle("u2-tabs-overflow-visible",e),this._overflow.tabIndex=e?0:-1,e||(this._menuOpen.value=!1)}constructor(e){super(),this.activeTab=(0,r.vP)(null),this._idPrefix=`u2-tabs-${++u}`,this._header=document.createElement("div"),this._scroller=document.createElement("div"),this._overflow=document.createElement("button"),this._menu=document.createElement("div"),this._content=document.createElement("div"),this._tabs=(0,r.vP)([]),this._menuOpen=(0,r.vP)(!1),this.orientation=null!=(s=null==e?void 0:e.orientation)?s:"horizontal",this._eager=(null==e?void 0:e.eager)===!0,this.root.classList.add("u2-tabs"),this.root.classList.toggle("u2-tabs-vertical","vertical"===this.orientation),this.root.classList.toggle("u2-tabs-document",(null==e?void 0:e.variant)==="document"),this.root.dataset.u2="tabs",this._header.className="u2-tabs-header",this._header.setAttribute("role","tablist"),this._header.setAttribute("aria-orientation",this.orientation),this._scroller.className="u2-tabs-scroller",this._scroller.setAttribute("role","presentation"),this._overflow.className="u2-tabs-overflow",this._overflow.type="button",this._overflow.tabIndex=-1,this._overflow.textContent="⌄",this._overflow.title="Show all tabs",this._overflow.setAttribute("aria-haspopup","menu"),this._menu.className="u2-tabs-overflow-menu",this._menu.setAttribute("role","menu"),this._header.append(this._scroller,this._overflow,this._menu),this._content.className="u2-tabs-content",this.root.append(this._header,this._content);const t=this.scope;t.listen(this._scroller,"pointerdown",e=>this._onPointerDown(e)),t.listen(this._scroller,"keydown",e=>this._onKeyDown(e)),t.listen(this._overflow,"click",()=>this._menuOpen.value=!this._menuOpen.peek()),t.listen(this._menu,"click",e=>this._onMenuClick(e));const n=null==e?void 0:e.onTabClosed;n&&this.on("tabClosed",(e,t)=>n(e,t));const i=new ResizeObserver(()=>this._updateOverflow());i.observe(this._header),this.own(()=>i.disconnect()),this.effect(()=>this._applyActive()),this.effect(()=>this._renderMenu());var o=!0,a=!1,l=void 0;try{for(var s,d,c,p=(null!=(d=null==e?void 0:e.tabs)?d:[])[Symbol.iterator]();!(o=(c=p.next()).done);o=!0){const e=c.value;this.addTab(e)}}catch(e){a=!0,l=e}finally{try{o||null==p.return||p.return()}finally{if(a)throw l}}}}},2271(e,t,n){n.d(t,{s:()=>f});var r=n(7115),i=n(9701),o=n(1518),a=n(8609),l=n(5232),s=n(4977),u=n(8848),d=n(5315),c=n(2127);function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function h(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}let m=0;class f extends i.Ec{next(){if(this._recheck.value=this._recheck.peek()+1,null!==this._blockReason.peek())return;let e=this._index.peek();if(e===this._steps.length-1)return void this._finish();let t=this._steps[e].options.commit,n=n=>{!1===n||this.scope.isDisposed||this._index.peek()!==e||(t&&(this._committed=e),this._index.value=e+1)};t?this._run(t,n):n(void 0)}back(){let e=this._index.peek();e-1>this._committed&&!this._busy.peek()&&(this._index.value=e-1)}goTo(e){let t=this._steps.findIndex(t=>t.options.id===e),n=this._index.peek();t<0||t===n||t<=this._committed||this._busy.peek()||(this._visited.has(e)&&(t<n||this._steps.slice(n,t).every(e=>!e.options.commit&&null===f._gate(e.options.canProceed)))?this._index.value=t:t===n+1&&this.next())}setStepTitle(e,t){let n=this._steps[e];void 0!==n&&(n.options=h(p({},n.options),{title:t}),n.marker.querySelector(".u2-wizard-title").textContent=t)}resumeFrom(e){var t=!0,n=!1,r=void 0;try{for(var i,o=e._visited[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){let e=i.value;this._steps.some(t=>t.options.id===e)&&this._visited.add(e)}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}let a=this._steps.findIndex(t=>t.options.id===e.currentStep.peek());a>=0&&(this._index.value=a)}setStepFailed(e,t){let n=new Set(this._failed.peek());t?n.add(e):n.delete(e),this._failed.value=n}openInDialog(e,t){let n=void 0===t?{}:t;if(!this._dialog){let t=this.build(()=>u.l.create(e,{keepAlive:!0}).add(this).closeGuard(()=>this._guard()).onClose(()=>{this._completed.peek()||(!0===this._steps[this._index.peek()].options.done?this._finish():this._cancelled())}));this._dialog=t,this._cancel=this._button("CANCEL",()=>{this._guard()&&t.close()}),this._cancel.classList.add("u2-wizard-cancel"),this._footer.insertBefore(this._cancel,this._back)}return this._dialog.show({modal:!0,width:n.width,height:n.height})}getState(){let e=this._blockReason.peek(),t=this._error.peek();return h(p({},super.getState()),{current:this.currentStep.peek(),busy:this._busy.peek(),valid:null===e&&null===t,error:null!=t?t:this._busy.peek()?null:e})}getItems(){let e=this._index.peek(),t=this._steps.map((t,n)=>({key:t.options.id,label:t.options.title,index:n,current:n===e,completed:n<e&&this._visited.has(t.options.id),disabled:"true"===t.marker.getAttribute("aria-disabled"),rendered:!0}));return{count:t.length,list:t,truncated:!1}}_addStep(e){var t;let n=this._steps.length,r=document.createElement("li");r.className="u2-wizard-step",r.id=`${this._idPrefix}-step-${n}`,r.dataset.id=e.id,r.dataset.u2Item=e.id,r.tabIndex=0===n?0:-1;let i=document.createElement("span");i.className="u2-wizard-marker",i.textContent=String(n+1);let o=document.createElement("span");o.className="u2-wizard-title",o.dataset.u2Part="item-label",o.textContent=e.title,r.append(i,o),s.m.bind(r,()=>{var e;return null!=(e=l.B.of(r))?e:""},{owner:this.scope}),this._rail.append(r);let a=document.createElement("div");a.className="u2-wizard-panel",a.style.display="none",a.setAttribute("role","group"),a.setAttribute("aria-labelledby",r.id),this._content.append(a);let u=this.scope.child("wizard-step"),d="function"==typeof e.content?e.content:void 0;d||a.append(e.content);let c=(null!=(t=e.actions)?t:[]).map(e=>{let t=this._button(e.text,()=>this._run(e.run));return s.m.bind(t,()=>{var e;return null!=(e=l.B.of(t))?e:""},{owner:this.scope}),this.effect(()=>{var r;return t.style.display=this._index.value===n&&(null==(r=e.visible)?void 0:r.value)!==!1?"":"none"}),this._footer.insertBefore(t,this._next),t});this._steps.push({options:e,marker:r,circle:i,panel:a,scope:u,actions:c,builder:d})}_run(e,t){let n;if(this._busy.peek())return;this._error.value=null;let i=new AbortController;try{n=this._call(()=>e({signal:i.signal}))}catch(e){this._fail(e);return}let a=o.HG.thenable(n);if(void 0===a){null==t||t(n);return}this._pending=i,this._busy.value=!0;let l=e=>{this._pending!==i||this.scope.isDisposed||(this._pending=void 0,clearTimeout(this._abandon),this._abandon=void 0,(0,r.vA)(()=>{this._busy.value=!1,e()}))};a.then(e=>l(()=>null==t?void 0:t(e)),e=>l(()=>this._fail(e)))}_call(e){let t=this._owner;return(0,r.vA)(()=>o.HG.runWith((null==t?void 0:t.isDisposed)?void 0:t,e))}_fail(e){(null==e?void 0:e.name)!=="AbortError"&&(this._error.value=e instanceof Error?e.message:String(e))}_guard(){let e=this._pending;void 0!==e&&(e.abort(),null!=this._abandon||(this._abandon=setTimeout(()=>{var t;this._abandon=void 0,this._pending!==e||this.scope.isDisposed||(this._pending=void 0,this._busy.value=!1,c.m.warning(`${this._steps[this._index.peek()].options.title}: the step did not stop when cancelled and was abandoned`),null==(t=this._dialog)||t.close())},2e3)));return!this._busy.peek()}_applyStep(){let e=this._index.value,t=this._steps[e],n=this._failed.value;this._visited.add(t.options.id);for(let t=0;t<this._steps.length;t++){let r=this._steps[t],i=t===e,o=!i&&this._visited.has(r.options.id),a=o&&t<e;r.marker.classList.toggle("u2-wizard-step-current",i),r.marker.classList.toggle("u2-wizard-step-done",a),r.marker.classList.toggle("u2-wizard-step-failed",n.has(r.options.id));let s=i?null:o?t<=this._committed?f.COMMITTED:null:f.NOT_REACHED;l.B.apply(r.marker,s),null===s&&r.marker.setAttribute("aria-disabled","false"),r.marker.tabIndex=i?0:-1,r.circle.textContent=n.has(r.options.id)?"!":a?"✓":String(t+1),r.panel.style.display=i?"":"none",i?r.marker.setAttribute("aria-current","step"):r.marker.removeAttribute("aria-current")}let i=!0===t.options.done,o=document.activeElement;i&&(o===this._next||null===o||o===document.body)&&t.marker.focus(),this._back.style.display=0===e||i?"none":"",void 0!==this._cancel&&(this._cancel.style.display=i?"none":""),(0,r.O8)(()=>{this._error.value=null;let e=t.builder;e&&(t.builder=void 0,t.panel.append(t.scope.build(e)));let n=t.options.onActivate;if(n){var r;null==(r=t.visit)||r.dispose(),(t.visit=t.scope.child("wizard-visit")).run(()=>n(t.options))}this.fireEvent("step",t.options.id)})}_applyNextText(){var e,t;let n=this._index.value,r=this._steps[n].options,i="string"==typeof r.nextText?r.nextText:null==(t=r.nextText)?void 0:t.value,o=n===this._steps.length-1;this._next.textContent=o?!0===r.done?"CLOSE":null!=(e=r.finishText)?e:"FINISH":null!=i?i:"NEXT",this._next.classList.toggle("u2-btn-primary",!0!==r.done&&(o||void 0!==r.commit||void 0!==r.nextText))}_applyGate(){let e=this._blockReason.value,t=this._busy.value,n=this._steps[this._index.value],r=t?f.WAITING:null;l.B.apply(this._next,e),l.B.apply(this._back,r),this.root.classList.toggle("u2-wizard-busy",t),this.root.setAttribute("aria-busy",String(t)),n.actions.forEach((e,t)=>l.B.apply(e,null!=r?r:l.B.read(n.options.actions[t].disabled)))}_finish(){let e=this._options.onFinish;void 0===e?this._complete():this._run(e,e=>!1!==e&&this._complete())}_complete(){this._completed.value=!0,this.fireEvent("finish"),this._dialog&&this._dialog.close()}_cancelled(){try{this._call(()=>{var e,t;return null==(e=(t=this._options).onCancel)?void 0:e.call(t)})}catch(e){this.scope.reportError(e)}this.fireEvent("cancel")}_button(e,t,n){return this.build(()=>(0,a.x6)(e,()=>t(),{primary:n}))}_focusStep(e){for(let t=0;t<this._steps.length;t++)this._steps[t].marker.tabIndex=t===e?0:-1;this._steps[e].marker.focus()}_onRailClick(e){let t=e.target.closest(".u2-wizard-step");t&&this.goTo(t.dataset.id)}_onRailKeyDown(e){let t,n=this._steps.findIndex(e=>e.marker===document.activeElement);if(n<0)return;let r=this._steps.length-1;switch(e.key){case"ArrowLeft":t=0===n?r:n-1;break;case"ArrowRight":t=n===r?0:n+1;break;case"Enter":case" ":e.preventDefault(),this.goTo(this._steps[n].options.id);return;default:return}e.preventDefault(),this._focusStep(t)}_onContentKeyDown(e){if("Enter"!==e.key||e.defaultPrevented)return;let t=this._steps[this._index.peek()],n=t===this._steps[this._steps.length-1];if(e.ctrlKey||e.metaKey){if(!n)return}else if(!u.l.entersDefault(e)||!0===t.options.done)return;e.preventDefault(),this.next()}static _gate(e){return"function"==typeof e?e()||null:l.B.read(e)}constructor(e){super(),this.status=document.createElement("span"),this._idPrefix=`u2-wizard-${++m}`,this._steps=[],this._visited=new Set,this._rail=document.createElement("ol"),this._content=document.createElement("div"),this._footer=document.createElement("div"),this._errorRow=document.createElement("span"),this._index=(0,r.vP)(0),this._completed=(0,r.vP)(!1),this._recheck=(0,r.vP)(0),this._busy=(0,r.vP)(!1),this._error=(0,r.vP)(null),this._failed=(0,r.vP)(new Set),this._committed=-1,this._options=e,this._owner=o.HG.ambient,this.currentStep=(0,r.EW)(()=>this._steps[this._index.value].options.id),this.completed=this._completed,this.busy=this._busy,this.error=this._error,this._blockReason=(0,r.EW)(()=>(this._recheck.value,this._busy.value?f.WAITING:f._gate(this._steps[this._index.value].options.canProceed))),this.root.classList.add("u2-wizard"),this.root.dataset.u2="wizard",this._rail.className="u2-wizard-steps",this._rail.dataset.u2Part="steps",this._content.className="u2-wizard-content",this._content.dataset.u2Part="body",this._footer.className="u2-wizard-buttons",this._footer.dataset.u2Part="footer",this._errorRow.className="u2-wizard-error",this._errorRow.dataset.u2Part="error-row",this._errorRow.setAttribute("role","alert"),this._errorRow.hidden=!0,this.status.className="u2-wizard-status",this.status.dataset.u2Part="status";const t=document.createElement("span");t.className="u2-wizard-left",this._back=this._button("BACK",()=>this.back()),this._next=this._button("NEXT",()=>this.next()),s.m.bind(this._next,()=>{var e;return null!=(e=this._blockReason.peek())?e:""},{owner:this.scope}),s.m.bind(this._back,()=>{var e;return null!=(e=l.B.of(this._back))?e:""},{owner:this.scope}),this._footer.append(t,this._back,this._next),this.root.append(this._rail,this._content,this._footer);const n=this.scope;n.listen(this._rail,"click",e=>this._onRailClick(e)),n.listen(this._rail,"keydown",e=>this._onRailKeyDown(e)),n.listen(this._content,"keydown",e=>this._onContentKeyDown(e));var i=!0,a=!1,u=void 0;try{for(var c,p=e.steps[Symbol.iterator]();!(i=(c=p.next()).done);i=!0){const e=c.value;this._addStep(e)}}catch(e){a=!0,u=e}finally{try{i||null==p.return||p.return()}finally{if(a)throw u}}const h=void 0===e.start?0:e.steps.findIndex(t=>t.id===e.start);if(h<0)throw Error(`Wizard: no step "${e.start}" to start on`);var g=!0,v=!1,b=void 0;try{for(var y,_=e.steps.slice(0,h)[Symbol.iterator]();!(g=(y=_.next()).done);g=!0){const e=y.value;this._visited.add(e.id)}}catch(e){v=!0,b=e}finally{try{g||null==_.return||_.return()}finally{if(v)throw b}}this._index.value=h,this._reason=this.build(()=>(0,d.Bs)((0,r.EW)(()=>this._busy.value?null:this._blockReason.value))),this._reason.classList.add("u2-wizard-reason","u2-status-line-warning"),this._reason.dataset.u2Part="reason",t.append(this.status,this._reason,this._errorRow),this.effect(()=>this._applyStep()),this.effect(()=>this._applyNextText()),this.effect(()=>this._applyGate()),this.own(()=>clearTimeout(this._abandon)),this.effect(()=>{let e=this._error.value;this._errorRow.textContent=null!=e?e:"",this._errorRow.hidden=null===e})}}f.WAITING="Wait for the running step to finish",f.NOT_REACHED="Not reached yet: get there with NEXT",f.COMMITTED="Already saved: it cannot be changed now"},2657(e,t,n){n.d(t,{j:()=>d});var r=n(9701),i=n(8609),o=n(7974),a=n(9947);function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}let s=/\[([^\]]+)\]\(([^)\s]+)\)/g,u=/^[a-z0-9-]+$/;class d extends r.Ec{_fit(){let e=this.root.clientWidth;0!==e&&(this.root.classList.toggle("u2-app-header-compact",e<480),this.root.classList.toggle("u2-app-header-narrow",e<400))}getState(){let e=this._learnMore;return l({},super.getState(),void 0===e?{}:{extra:l({learnMore:e.text},void 0===e.href?{}:{learnMoreHref:e.href})})}getItems(e){return o.p.itemsState(this._items.map((e,t)=>({key:String(t),label:r.Ec.text(e),index:t,rendered:!0})),null==e?void 0:e.all)}accessibleLabel(){var e;let t=void 0===this._title?"":r.Ec.text(this._title);return null!=(e=r.Ec.labelOf(this.root))?e:t||void 0}_lead(e){let t=(0,i.y4)([d._part(d._icon(e.icon),"icon")],"u2-app-header-lead");if(void 0===e.title)return t;this._title=d._part((0,i.Ln)(e.title),"title");let n=(0,i.y4)([this._title],"u2-app-header-names");return void 0!==e.subtitle&&n.append(d._part((0,i.Ln)(e.subtitle),"subtitle")),t.append(n),t}_body(e){var t,n;let r=document.createElement("ul");r.className="u2-app-header-items";for(let i=0,o=[...null!=(t=e.items)?t:[],...d._bullets(null!=(n=e.description)?n:"")];i<o.length;i++){let e=o[i],t=d._part(document.createElement("li"),"item");t.dataset.u2Item=String(this._items.length),t.append(d._content(e)),this._items.push(t),r.append(t)}let o=(0,i.y4)([r],"u2-app-header-body"),l=this._learnMore;if(void 0===l)return o;let s=d._part(d._link(l),"learn-more");if(void 0!==l.href){let e=(0,a.K)("external-link-square",{cls:"u2-app-header-external"});e.setAttribute("aria-hidden","true"),s.append(e)}return o.append(s),o}static _content(e){return"string"==typeof e||e instanceof HTMLElement?e:r.Ec.is(e)?e.root:d._isLink(e)?d._link(e):(0,i.Ln)(e)}static _isLink(e){return"string"==typeof e.text}static _link(e){var t;let n=e.onClick;return(0,i.nf)(e.text,null!=(t=e.href)?t:e=>null==n?void 0:n(e))}static _bullets(e){return e.split("\n").map(e=>e.trim().replace(/^[-*+]\s+/,"")).filter(e=>""!==e).map(e=>{let t=(0,i.Ln)(""),n=0;var r=!0,o=!1,a=void 0;try{for(var l,u=e.matchAll(s)[Symbol.iterator]();!(r=(l=u.next()).done);r=!0){let r=l.value;t.append(e.slice(n,r.index),(0,i.nf)(r[1],r[2])),n=r.index+r[0].length}}catch(e){o=!0,a=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw a}}return t.append(e.slice(n)),t})}static _icon(e){if("string"!=typeof e)return e;if(u.test(e))return(0,a.K)(e);let t=(0,i.y4)([]);return t.style.backgroundImage=`url(${JSON.stringify(e)})`,t}static _part(e,t){return e.classList.add(`u2-app-header-${t}`),e.dataset.u2Part=t,e}constructor(e){var t,n;super(),this._items=[],this.root.classList.add("u2-app-header"),this.root.classList.toggle("u2-app-header-named",void 0!==e.title),this.root.classList.toggle("u2-app-header-rule",!0===e.bottomLine),this.root.dataset.u2="app-header",this.root.style.setProperty("--u2-app-header-icon-size",`${null!=(t=e.iconSize)?t:void 0!==e.title?90:150}px`);const r="string"==typeof e.learnMore?{href:e.learnMore}:e.learnMore;this._learnMore=void 0===r?void 0:function(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}(l({},r),{text:null!=(n=r.text)?n:"Learn more"}),this.build(()=>this.root.append(this._lead(e),this._body(e))),void 0!==e.name&&(this.name=e.name);let i=0;const o=new ResizeObserver(()=>{cancelAnimationFrame(i),i=requestAnimationFrame(()=>this._fit())});o.observe(this.root),this.own(()=>{o.disconnect(),cancelAnimationFrame(i)})}}},1600(e,t,n){n.d(t,{p$:()=>u,qV:()=>d});var r=n(6090),i=n(9701),o=n(1518),a=n(7115),l=n(8609),s=n(9947);function u(e,t){var n;let r=document.createElement("div");r.className=(null==t?void 0:t.error)?"u2-empty-state u2-empty-state-error":"u2-empty-state",r.dataset.u2="empty-state",r.setAttribute("role",(null==t?void 0:t.error)?"alert":"status"),(null==t?void 0:t.icon)!==void 0&&r.append((0,s.K)(t.icon,{cls:"u2-empty-state-icon"}));let i=document.createElement("div");if(i.className="u2-empty-state-text",i.textContent=e,r.append(i),(null!=(n=null==t?void 0:t.actions)?n:[]).length>0){let e=document.createElement("div");e.className="u2-empty-state-actions",e.append(...t.actions),r.append(e)}return r}function d(e){let t=void 0===e?3:e,n=document.createElement("div");n.className="u2-skeleton",n.setAttribute("aria-hidden","true");for(let e=0;e<t;e++){let e=document.createElement("div");e.className="u2-skeleton-line",n.append(e)}return n}class c extends i.Ec{static owned(e,t,n){let i=new r._(e),o=new c(i,t,n);return o.own(()=>i.dispose()),o}getState(){var e,t;let n=this._source.state.peek();return e=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},super.getState()),t=t={error:"error"===n.kind?n.message:null},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}refresh(e){this._query=null!=e?e:this._query,this._source.query(this._query)}_apply(e){let t="loading"===e.kind;if(this.root.classList.toggle("u2-async-stale",t&&this._ready),t&&this._ready)return void this.root.setAttribute("aria-busy","true");this._ready="ready"===e.kind,this._releaseContent();let n=new o.HG;this._content=n;let r=n.build(()=>this._build(e));this.root.setAttribute("aria-busy",String("loading"===e.kind)),this.root.replaceChildren(...r?[r]:[])}_build(e){if("loading"===e.kind){let e,t;return this._skeleton?d():((e=document.createElement("div")).className="u2-loader",e.setAttribute("role","status"),(t=document.createElement("span")).className="u2-loader-spinner",e.append(t),e)}if("ready"===e.kind)return(0,a.O8)(()=>this._render(e.items));if("empty"===e.kind)return c._div("u2-async-empty",this._empty);if("error"===e.kind){let t=c._div("u2-async-error");return t.append(c._div("u2-async-error-message",e.message),this._retry),t}}_releaseContent(){this._content&&this._content.dispose(),this._content=void 0}static _div(e,t){let n=document.createElement("div");return n.className=e,void 0!==t&&(n.textContent=t),n}constructor(e,t,n){var r,i;super(),this._query="",this._ready=!1,this._source=e,this._render=t,this._empty=null!=(r=null==n?void 0:n.empty)?r:"No data",this._skeleton=null!=(i=null==n?void 0:n.skeleton)&&i,this.root.classList.add("u2-async-view"),this.root.dataset.u2="async-view",this._retry=this.build(()=>(0,l.x6)("Retry",()=>e.retry())),this.own(()=>this._releaseContent()),this.effect(()=>this._apply(e.state.value))}}},5315(e,t,n){n.d(t,{Bs:()=>s,Om:()=>a,Tc:()=>l,qS:()=>o}),n(1518);var r=n(8609),i=n(9947);function o(e,t){var n;let i=(0,r.Ln)(e,"u2-badge");return i.classList.add(`u2-badge-${null!=(n=null==t?void 0:t.variant)?n:"default"}`),i.dataset.u2="badge",i}function a(e){let t=(0,r.Ln)("","u2-dot");return t.classList.add(`u2-dot-${null!=e?e:"default"}`),t.dataset.u2="dot",t.setAttribute("aria-hidden","true"),t}function l(e,t){let n=(0,r.Ln)("","u2-tag");n.dataset.u2="tag",n.append((0,r.Ln)(e,"u2-tag-text"));let i=null==t?void 0:t.onRemove;if(i){let t=document.createElement("button");t.type="button",t.className="u2-tag-remove",t.textContent="✕",t.setAttribute("aria-label",`Remove ${e}`),t.addEventListener("click",()=>i()),n.append(t)}return n}function s(e,t){let n=(0,r.Ln)("","u2-status-line-text"),o=(0,i.K)("exclamation-triangle",{cls:"u2-status-line-mark"});o.setAttribute("aria-hidden","true");let a=(0,r.Ln)("","u2-status-line");return a.dataset.u2="status-line",a.setAttribute("role","status"),a.append(o,n),(0,r.QZ)(()=>{var r;let i=e.value,l=void 0===t?"":"string"==typeof t?t:String(null!=(r=t.value)?r:"");a.classList.toggle("u2-status-line-problem",null!==i),o.hidden=null===i,n.textContent=null!=i?i:l,a.title=n.textContent}),a}},6002(e,t,n){n.d(t,{R:()=>r,d:()=>i});let r=`
389
+ abacus acorn ad address-book address-card adjust air-conditioner air-freshener alarm-clock
390
+ alarm-exclamation alarm-plus alarm-snooze album album-collection alicorn alien alien-monster
391
+ align-center align-justify align-left align-right align-slash allergies ambulance
392
+ american-sign-language-interpreting amp-guitar analytics anchor angel angle-double-down
393
+ angle-double-left angle-double-right angle-double-up angle-down angle-left angle-right angle-up
394
+ angry ankh apple-alt apple-crate archive archway arrow-alt-circle-down arrow-alt-circle-left
395
+ arrow-alt-circle-right arrow-alt-circle-up arrow-alt-down arrow-alt-from-bottom
396
+ arrow-alt-from-left arrow-alt-from-right arrow-alt-from-top arrow-alt-left arrow-alt-right
397
+ arrow-alt-square-down arrow-alt-square-left arrow-alt-square-right arrow-alt-square-up
398
+ arrow-alt-to-bottom arrow-alt-to-left arrow-alt-to-right arrow-alt-to-top arrow-alt-up
399
+ arrow-circle-down arrow-circle-left arrow-circle-right arrow-circle-up arrow-down
400
+ arrow-from-bottom arrow-from-left arrow-from-right arrow-from-top arrow-left arrow-right
401
+ arrow-square-down arrow-square-left arrow-square-right arrow-square-up arrow-to-bottom
402
+ arrow-to-left arrow-to-right arrow-to-top arrow-up arrows arrows-alt arrows-alt-h arrows-alt-v
403
+ arrows-h arrows-v assistive-listening-systems asterisk at atlas atom atom-alt audio-description
404
+ award axe axe-battle baby baby-carriage backpack backspace backward bacon bacteria bacterium
405
+ badge badge-check badge-dollar badge-percent badge-sheriff badger-honey bags-shopping bahai
406
+ balance-scale balance-scale-left balance-scale-right ball-pile ballot ballot-check ban band-aid
407
+ banjo barcode barcode-alt barcode-read barcode-scan bars baseball baseball-ball basketball-ball
408
+ basketball-hoop bat bath battery-bolt battery-empty battery-full battery-half battery-quarter
409
+ battery-slash battery-three-quarters bed bed-alt bed-bunk bed-empty beer bell bell-exclamation
410
+ bell-on bell-plus bell-school bell-school-slash bell-slash bells betamax bezier-curve bible
411
+ bicycle biking biking-mountain binoculars biohazard birthday-cake blanket blender blender-phone
412
+ blind blinds blinds-open blinds-raised blog bold bolt bomb bone bone-break bong book book-alt
413
+ book-dead book-heart book-medical book-open book-reader book-spells book-user bookmark books
414
+ books-medical boombox boot booth-curtain border-all border-bottom border-center-h
415
+ border-center-v border-inner border-left border-none border-outer border-right border-style
416
+ border-style-alt border-top bow-arrow bowling-ball bowling-pins box box-alt box-ballot box-check
417
+ box-fragile box-full box-heart box-open box-tissue box-up box-usd boxes boxes-alt boxing-glove
418
+ brackets brackets-curly braille brain bread-loaf bread-slice briefcase briefcase-medical
419
+ bring-forward bring-front broadcast-tower broom browser brush bug building bullhorn bullseye
420
+ bullseye-arrow bullseye-pointer burger-soda burn burrito bus bus-alt bus-school business-time
421
+ cabinet-filing cactus calculator calculator-alt calendar calendar-alt calendar-check
422
+ calendar-day calendar-edit calendar-exclamation calendar-minus calendar-plus calendar-star
423
+ calendar-times calendar-week camcorder camera camera-alt camera-home camera-movie
424
+ camera-polaroid camera-retro campfire campground candle-holder candy-cane candy-corn cannabis
425
+ capsules car car-alt car-battery car-building car-bump car-bus car-crash car-garage car-mechanic
426
+ car-side car-tilt car-wash caravan caravan-alt caret-circle-down caret-circle-left
427
+ caret-circle-right caret-circle-up caret-down caret-left caret-right caret-square-down
428
+ caret-square-left caret-square-right caret-square-up caret-up carrot cars cart-arrow-down
429
+ cart-plus cash-register cassette-tape cat cat-space cauldron cctv certificate chair chair-office
430
+ chalkboard chalkboard-teacher charging-station chart-area chart-bar chart-line chart-line-down
431
+ chart-network chart-pie chart-pie-alt chart-scatter check check-circle check-double check-square
432
+ cheese cheese-swiss cheeseburger chess chess-bishop chess-bishop-alt chess-board chess-clock
433
+ chess-clock-alt chess-king chess-king-alt chess-knight chess-knight-alt chess-pawn
434
+ chess-pawn-alt chess-queen chess-queen-alt chess-rook chess-rook-alt chevron-circle-down
435
+ chevron-circle-left chevron-circle-right chevron-circle-up chevron-double-down
436
+ chevron-double-left chevron-double-right chevron-double-up chevron-down chevron-left
437
+ chevron-right chevron-square-down chevron-square-left chevron-square-right chevron-square-up
438
+ chevron-up child chimney church circle circle-notch city clarinet claw-marks clinic-medical
439
+ clipboard clipboard-check clipboard-list clipboard-list-check clipboard-prescription
440
+ clipboard-user clock clone closed-captioning cloud cloud-download cloud-download-alt
441
+ cloud-drizzle cloud-hail cloud-hail-mixed cloud-meatball cloud-moon cloud-moon-rain cloud-music
442
+ cloud-rain cloud-rainbow cloud-showers cloud-showers-heavy cloud-sleet cloud-snow cloud-sun
443
+ cloud-sun-rain cloud-upload cloud-upload-alt clouds clouds-moon clouds-sun club cocktail code
444
+ code-branch code-commit code-merge coffee coffee-pot coffee-togo coffin coffin-cross cog cogs
445
+ coin coins columns comet comment comment-alt comment-alt-check comment-alt-dollar
446
+ comment-alt-dots comment-alt-edit comment-alt-exclamation comment-alt-lines comment-alt-medical
447
+ comment-alt-minus comment-alt-music comment-alt-plus comment-alt-slash comment-alt-smile
448
+ comment-alt-times comment-check comment-dollar comment-dots comment-edit comment-exclamation
449
+ comment-lines comment-medical comment-minus comment-music comment-plus comment-slash
450
+ comment-smile comment-times comments comments-alt comments-alt-dollar comments-dollar
451
+ compact-disc compass compass-slash compress compress-alt compress-arrows-alt compress-wide
452
+ computer-classic computer-speaker concierge-bell construction container-storage conveyor-belt
453
+ conveyor-belt-alt cookie cookie-bite copy copyright corn couch cow cowbell cowbell-more
454
+ credit-card credit-card-blank credit-card-front cricket croissant crop crop-alt cross crosshairs
455
+ crow crown crutch crutches cube cubes curling cut dagger database deaf debug deer deer-rudolph
456
+ democrat desktop desktop-alt dewpoint dharmachakra diagnoses diamond dice dice-d10 dice-d12
457
+ dice-d20 dice-d4 dice-d6 dice-d8 dice-five dice-four dice-one dice-six dice-three dice-two
458
+ digging digital-tachograph diploma directions disc-drive disease divide dizzy dna do-not-enter
459
+ dog dog-leashed dollar-sign dolly dolly-empty dolly-flatbed dolly-flatbed-alt
460
+ dolly-flatbed-empty donate door-closed door-open dot-circle dove download drafting-compass
461
+ dragon draw-circle draw-polygon draw-square dreidel drone drone-alt drum drum-steelpan drumstick
462
+ drumstick-bite dryer dryer-alt duck dumbbell dumpster dumpster-fire dungeon ear ear-muffs
463
+ eclipse eclipse-alt edit egg egg-fried eject elephant ellipsis-h ellipsis-h-alt ellipsis-v
464
+ ellipsis-v-alt empty-set engine-warning envelope envelope-open envelope-open-dollar
465
+ envelope-open-text envelope-square equals eraser ethernet euro-sign exchange exchange-alt
466
+ exclamation exclamation-circle exclamation-square exclamation-triangle expand expand-alt
467
+ expand-arrows expand-arrows-alt expand-wide external-link external-link-alt external-link-square
468
+ external-link-square-alt eye eye-dropper eye-evil eye-slash fan fan-table farm fast-backward
469
+ fast-forward faucet faucet-drip fax feather feather-alt female field-hockey fighter-jet file
470
+ file-alt file-archive file-audio file-certificate file-chart-line file-chart-pie file-check
471
+ file-code file-contract file-csv file-download file-edit file-excel file-exclamation file-export
472
+ file-image file-import file-invoice file-invoice-dollar file-medical file-medical-alt file-minus
473
+ file-music file-pdf file-plus file-powerpoint file-prescription file-search file-signature
474
+ file-spreadsheet file-times file-upload file-user file-video file-word files-medical fill
475
+ fill-drip film film-alt film-canister filter fingerprint fire fire-alt fire-extinguisher
476
+ fire-smoke fireplace first-aid fish fish-cooked fist-raised flag flag-alt flag-checkered
477
+ flag-usa flame flashlight flask flask-poison flask-potion flower flower-daffodil flower-tulip
478
+ flushed flute flux-capacitor fog folder folder-download folder-minus folder-open folder-plus
479
+ folder-times folder-tree folder-upload folders font font-awesome-logo-full font-case
480
+ football-ball football-helmet forklift forward fragile french-fries frog frosty-head frown
481
+ frown-open function funnel-dollar futbol galaxy game-board game-board-alt game-console-handheld
482
+ gamepad gamepad-alt garage garage-car garage-open gas-pump gas-pump-slash gavel gem genderless
483
+ ghost gift gift-card gifts gingerbread-man glass glass-champagne glass-cheers glass-citrus
484
+ glass-martini glass-martini-alt glass-whiskey glass-whiskey-rocks glasses glasses-alt globe
485
+ globe-africa globe-americas globe-asia globe-europe globe-snow globe-stand golf-ball golf-club
486
+ gopuram graduation-cap gramophone greater-than greater-than-equal grimace grin grin-alt
487
+ grin-beam grin-beam-sweat grin-hearts grin-squint grin-squint-tears grin-stars grin-tears
488
+ grin-tongue grin-tongue-squint grin-tongue-wink grin-wink grip-horizontal grip-lines
489
+ grip-lines-vertical grip-vertical guitar guitar-electric guitars h-square h1 h2 h3 h4 hamburger
490
+ hammer hammer-war hamsa hand-heart hand-holding hand-holding-box hand-holding-heart
491
+ hand-holding-magic hand-holding-medical hand-holding-seedling hand-holding-usd
492
+ hand-holding-water hand-lizard hand-middle-finger hand-paper hand-peace hand-point-down
493
+ hand-point-left hand-point-right hand-point-up hand-pointer hand-receiving hand-rock
494
+ hand-scissors hand-sparkles hand-spock hands hands-heart hands-helping hands-usd hands-wash
495
+ handshake handshake-alt handshake-alt-slash handshake-slash hanukiah hard-hat hashtag hat-chef
496
+ hat-cowboy hat-cowboy-side hat-santa hat-winter hat-witch hat-wizard hdd head-side
497
+ head-side-brain head-side-cough head-side-cough-slash head-side-headphones head-side-mask
498
+ head-side-medical head-side-virus head-vr heading headphones headphones-alt headset heart
499
+ heart-broken heart-circle heart-rate heart-square heartbeat heat helicopter helmet-battle
500
+ hexagon highlighter hiking hippo history hockey-mask hockey-puck hockey-sticks holly-berry home
501
+ home-alt home-heart home-lg home-lg-alt hood-cloak horizontal-rule horse horse-head horse-saddle
502
+ hospital hospital-alt hospital-symbol hospital-user hospitals hot-tub hotdog hotel hourglass
503
+ hourglass-end hourglass-half hourglass-start house house-damage house-day house-flood
504
+ house-leave house-night house-return house-signal house-user hryvnia humidity hurricane i-cursor
505
+ ice-cream ice-skate icicles icons icons-alt id-badge id-card id-card-alt igloo image
506
+ image-polaroid images inbox inbox-in inbox-out indent industry industry-alt infinity info
507
+ info-circle info-square inhaler integral intersection inventory island-tropical italic
508
+ jack-o-lantern jedi joint journal-whills joystick jug kaaba kazoo kerning key key-skeleton
509
+ keyboard keynote khanda kidneys kiss kiss-beam kiss-wink-heart kite kiwi-bird knife-kitchen
510
+ lambda lamp lamp-desk lamp-floor landmark landmark-alt language laptop laptop-code laptop-house
511
+ laptop-medical lasso laugh laugh-beam laugh-squint laugh-wink layer-group layer-minus layer-plus
512
+ leaf leaf-heart leaf-maple leaf-oak lemon less-than less-than-equal level-down level-down-alt
513
+ level-up level-up-alt life-ring light-ceiling light-switch light-switch-off light-switch-on
514
+ lightbulb lightbulb-dollar lightbulb-exclamation lightbulb-on lightbulb-slash lights-holiday
515
+ line-columns line-height link lips lira-sign list list-alt list-music list-ol list-ul location
516
+ location-arrow location-circle location-slash lock lock-alt lock-open lock-open-alt
517
+ long-arrow-alt-down long-arrow-alt-left long-arrow-alt-right long-arrow-alt-up long-arrow-down
518
+ long-arrow-left long-arrow-right long-arrow-up loveseat low-vision luchador luggage-cart lungs
519
+ lungs-virus mace magic magnet mail-bulk mailbox male mandolin map map-marked map-marked-alt
520
+ map-marker map-marker-alt map-marker-alt-slash map-marker-check map-marker-edit
521
+ map-marker-exclamation map-marker-minus map-marker-plus map-marker-question map-marker-slash
522
+ map-marker-smile map-marker-times map-pin map-signs marker mars mars-double mars-stroke
523
+ mars-stroke-h mars-stroke-v mask meat medal medkit megaphone meh meh-blank meh-rolling-eyes
524
+ memory menorah mercury meteor microchip microphone microphone-alt microphone-alt-slash
525
+ microphone-slash microphone-stand microscope microwave mind-share minus minus-circle
526
+ minus-hexagon minus-octagon minus-square mistletoe mitten mobile mobile-alt mobile-android
527
+ mobile-android-alt money-bill money-bill-alt money-bill-wave money-bill-wave-alt money-check
528
+ money-check-alt money-check-edit money-check-edit-alt monitor-heart-rate monkey monument moon
529
+ moon-cloud moon-stars mortar-pestle mosque motorcycle mountain mountains mouse mouse-alt
530
+ mouse-pointer mp3-player mug mug-hot mug-marshmallows mug-tea music music-alt music-alt-slash
531
+ music-slash narwhal network-wired neuter newspaper not-equal notes-medical object-group
532
+ object-ungroup octagon oil-can oil-temp om omega ornament otter outdent outlet oven overline
533
+ page-break pager paint-brush paint-brush-alt paint-roller palette pallet pallet-alt paper-plane
534
+ paperclip parachute-box paragraph paragraph-rtl parking parking-circle parking-circle-slash
535
+ parking-slash passport pastafarianism paste pause pause-circle paw paw-alt paw-claws peace
536
+ pegasus pen pen-alt pen-fancy pen-nib pen-square pencil pencil-alt pencil-paintbrush
537
+ pencil-ruler pennant people-arrows people-carry pepper-hot percent percentage person-booth
538
+ person-carry person-dolly person-dolly-empty person-sign phone phone-alt phone-laptop
539
+ phone-office phone-plus phone-rotary phone-slash phone-square phone-square-alt phone-volume
540
+ photo-video pi piano piano-keyboard pie pig piggy-bank pills pizza pizza-slice place-of-worship
541
+ plane plane-alt plane-arrival plane-departure plane-slash planet-moon planet-ringed play
542
+ play-circle plug plus plus-circle plus-hexagon plus-octagon plus-square podcast podium
543
+ podium-star police-box poll poll-h poll-people poo poo-storm poop popcorn portal-enter
544
+ portal-exit portrait pound-sign power-off pray praying-hands prescription prescription-bottle
545
+ prescription-bottle-alt presentation print print-search print-slash procedures project-diagram
546
+ projector pump-medical pump-soap pumpkin puzzle-piece qrcode question question-circle
547
+ question-square quidditch quote-left quote-right quran rabbit rabbit-fast racquet radar
548
+ radiation radiation-alt radio radio-alt rainbow raindrops ram ramp-loading random raygun receipt
549
+ record-vinyl rectangle-landscape rectangle-portrait rectangle-wide recycle redo redo-alt
550
+ refrigerator registered remove-format repeat repeat-1 repeat-1-alt repeat-alt reply reply-all
551
+ republican restroom retweet retweet-alt ribbon ring rings-wedding road robot rocket
552
+ rocket-launch route route-highway route-interstate router rss rss-square ruble-sign ruler
553
+ ruler-combined ruler-horizontal ruler-triangle ruler-vertical running rupee-sign rv sack
554
+ sack-dollar sad-cry sad-tear salad sandwich satellite satellite-dish sausage save sax-hot
555
+ saxophone scalpel scalpel-path scanner scanner-image scanner-keyboard scanner-touchscreen
556
+ scarecrow scarf school screwdriver scroll scroll-old scrubber scythe sd-card search
557
+ search-dollar search-location search-minus search-plus seedling send-back send-backward sensor
558
+ sensor-alert sensor-fire sensor-on sensor-smoke server shapes share share-all share-alt
559
+ share-alt-square share-square sheep shekel-sign shield shield-alt shield-check shield-cross
560
+ shield-virus ship shipping-fast shipping-timed shish-kebab shoe-prints shopping-bag
561
+ shopping-basket shopping-cart shovel shovel-snow shower shredder shuttle-van shuttlecock sickle
562
+ sigma sign sign-in sign-in-alt sign-language sign-out sign-out-alt signal signal-1 signal-2
563
+ signal-3 signal-4 signal-alt signal-alt-1 signal-alt-2 signal-alt-3 signal-alt-slash
564
+ signal-slash signal-stream signature sim-card sink siren siren-on sitemap skating skeleton
565
+ ski-jump ski-lift skiing skiing-nordic skull skull-cow skull-crossbones slash sledding sleigh
566
+ sliders-h sliders-h-square sliders-v sliders-v-square smile smile-beam smile-plus smile-wink
567
+ smog smoke smoking smoking-ban sms snake snooze snow-blowing snowboarding snowflake snowflakes
568
+ snowman snowmobile snowplow soap socks solar-panel solar-system sort sort-alpha-down
569
+ sort-alpha-down-alt sort-alpha-up sort-alpha-up-alt sort-alt sort-amount-down
570
+ sort-amount-down-alt sort-amount-up sort-amount-up-alt sort-circle sort-circle-down
571
+ sort-circle-up sort-down sort-numeric-down sort-numeric-down-alt sort-numeric-up
572
+ sort-numeric-up-alt sort-shapes-down sort-shapes-down-alt sort-shapes-up sort-shapes-up-alt
573
+ sort-size-down sort-size-down-alt sort-size-up sort-size-up-alt sort-up soup spa space-shuttle
574
+ space-station-moon space-station-moon-alt spade sparkles speaker speakers spell-check spider
575
+ spider-black-widow spider-web spinner spinner-third splotch spray-can sprinkler square
576
+ square-full square-root square-root-alt squirrel staff stamp star star-and-crescent
577
+ star-christmas star-exclamation star-half star-half-alt star-of-david star-of-life star-shooting
578
+ starfighter starfighter-alt stars starship starship-freighter steak steering-wheel step-backward
579
+ step-forward stethoscope sticky-note stocking stomach stop stop-circle stopwatch stopwatch-20
580
+ store store-alt store-alt-slash store-slash stream street-view stretcher strikethrough
581
+ stroopwafel subscript subway suitcase suitcase-rolling sun sun-cloud sun-dust sun-haze
582
+ sunglasses sunrise sunset superscript surprise swatchbook swimmer swimming-pool sword
583
+ sword-laser sword-laser-alt swords swords-laser synagogue sync sync-alt syringe table
584
+ table-tennis tablet tablet-alt tablet-android tablet-android-alt tablet-rugged tablets
585
+ tachometer tachometer-alt tachometer-alt-average tachometer-alt-fast tachometer-alt-fastest
586
+ tachometer-alt-slow tachometer-alt-slowest tachometer-average tachometer-fast tachometer-fastest
587
+ tachometer-slow tachometer-slowest taco tag tags tally tanakh tape tasks tasks-alt taxi teeth
588
+ teeth-open telescope temperature-down temperature-frigid temperature-high temperature-hot
589
+ temperature-low temperature-up tenge tennis-ball terminal text text-height text-size text-width
590
+ th th-large th-list theater-masks thermometer thermometer-empty thermometer-full
591
+ thermometer-half thermometer-quarter thermometer-three-quarters theta thumbs-down thumbs-up
592
+ thumbtack thunderstorm thunderstorm-moon thunderstorm-sun ticket ticket-alt tilde times
593
+ times-circle times-hexagon times-octagon times-square tint tint-slash tire tire-flat
594
+ tire-pressure-warning tire-rugged tired toggle-off toggle-on toilet toilet-paper
595
+ toilet-paper-alt toilet-paper-slash tombstone tombstone-alt toolbox tools tooth toothbrush torah
596
+ torii-gate tornado tractor trademark traffic-cone traffic-light traffic-light-go
597
+ traffic-light-slow traffic-light-stop trailer train tram transgender transgender-alt transporter
598
+ transporter-1 transporter-2 transporter-3 transporter-empty trash trash-alt trash-restore
599
+ trash-restore-alt trash-undo trash-undo-alt treasure-chest tree tree-alt tree-christmas
600
+ tree-decorated tree-large tree-palm trees triangle triangle-music trophy trophy-alt truck
601
+ truck-container truck-couch truck-loading truck-monster truck-moving truck-pickup truck-plow
602
+ truck-ramp trumpet tshirt tty turkey turntable turtle tv tv-alt tv-music tv-retro typewriter ufo
603
+ ufo-beam umbrella umbrella-beach underline undo undo-alt unicorn union universal-access
604
+ university unlink unlock unlock-alt upload usb-drive usd-circle usd-square user user-alien
605
+ user-alt user-alt-slash user-astronaut user-chart user-check user-circle user-clock user-cog
606
+ user-cowboy user-crown user-edit user-friends user-graduate user-hard-hat user-headset
607
+ user-injured user-lock user-md user-md-chat user-minus user-music user-ninja user-nurse
608
+ user-plus user-robot user-secret user-shield user-slash user-tag user-tie user-times user-unlock
609
+ user-visor users users-class users-cog users-crown users-medical users-slash utensil-fork
610
+ utensil-knife utensil-spoon utensils utensils-alt vacuum vacuum-robot value-absolute
611
+ vector-square venus venus-double venus-mars vest vest-patches vhs vial vials video video-plus
612
+ video-slash vihara violin virus virus-slash viruses voicemail volcano volleyball-ball volume
613
+ volume-down volume-mute volume-off volume-slash volume-up vote-nay vote-yea vr-cardboard
614
+ wagon-covered walker walkie-talkie walking wallet wand wand-magic warehouse warehouse-alt washer
615
+ watch watch-calculator watch-fitness water water-lower water-rise wave-sine wave-square
616
+ wave-triangle waveform waveform-path webcam webcam-slash weight weight-hanging whale wheat
617
+ wheelchair whistle wifi wifi-1 wifi-2 wifi-slash wind wind-turbine wind-warning window
618
+ window-alt window-close window-frame window-frame-open window-maximize window-minimize
619
+ window-restore windsock wine-bottle wine-glass wine-glass-alt won-sign wreath wrench x-ray
620
+ yen-sign yin-yang
621
+ `.trim().split(/\s+/),i=`
622
+ 500px accessible-icon accusoft acquisitions-incorporated adn adversal affiliatetheme airbnb
623
+ algolia alipay amazon amazon-pay amilia android angellist angrycreative angular app-store
624
+ app-store-ios apper apple apple-pay artstation asymmetrik atlassian audible autoprefixer avianex
625
+ aviato aws bandcamp battle-net behance behance-square bimobject bitbucket bitcoin bity black-tie
626
+ blackberry blogger blogger-b bluetooth bluetooth-b bootstrap btc buffer buromobelexperte
627
+ buy-n-large buysellads canadian-maple-leaf cc-amazon-pay cc-amex cc-apple-pay cc-diners-club
628
+ cc-discover cc-jcb cc-mastercard cc-paypal cc-stripe cc-visa centercode centos chrome chromecast
629
+ cloudflare cloudscale cloudsmith cloudversify codepen codiepie confluence connectdevelop contao
630
+ cotton-bureau cpanel creative-commons creative-commons-by creative-commons-nc
631
+ creative-commons-nc-eu creative-commons-nc-jp creative-commons-nd creative-commons-pd
632
+ creative-commons-pd-alt creative-commons-remix creative-commons-sa creative-commons-sampling
633
+ creative-commons-sampling-plus creative-commons-share creative-commons-zero critical-role css3
634
+ css3-alt cuttlefish d-and-d d-and-d-beyond dailymotion dashcube deezer delicious deploydog
635
+ deskpro dev deviantart dhl diaspora digg digital-ocean discord discourse dochub docker
636
+ draft2digital dribbble dribbble-square dropbox drupal dyalog earlybirds ebay edge edge-legacy
637
+ elementor ello ember empire envira erlang ethereum etsy evernote expeditedssl facebook
638
+ facebook-f facebook-messenger facebook-square fantasy-flight-games fedex fedora figma firefox
639
+ firefox-browser first-order first-order-alt firstdraft flickr flipboard fly font-awesome
640
+ font-awesome-alt font-awesome-flag fonticons fonticons-fi fort-awesome fort-awesome-alt forumbee
641
+ foursquare free-code-camp freebsd fulcrum galactic-republic galactic-senate get-pocket gg
642
+ gg-circle git git-alt git-square github github-alt github-square gitkraken gitlab gitter glide
643
+ glide-g gofore goodreads goodreads-g google google-drive google-pay google-play google-plus
644
+ google-plus-g google-plus-square google-wallet gratipay grav gripfire grunt guilded gulp
645
+ hacker-news hacker-news-square hackerrank hips hire-a-helper hive hooli hornbill hotjar houzz
646
+ html5 hubspot ideal imdb innosoft instagram instagram-square instalod intercom internet-explorer
647
+ invision ioxhost itch-io itunes itunes-note java jedi-order jenkins jira joget joomla js
648
+ js-square jsfiddle kaggle keybase keycdn kickstarter kickstarter-k korvue laravel lastfm
649
+ lastfm-square leanpub less line linkedin linkedin-in linode linux lyft magento mailchimp
650
+ mandalorian markdown mastodon maxcdn mdb medapps medium medium-m medrt meetup megaport mendeley
651
+ microblog microsoft mix mixcloud mixer mizuni modx monero napster neos nimblr node node-js npm
652
+ ns8 nutritionix octopus-deploy odnoklassniki odnoklassniki-square old-republic opencart openid
653
+ opera optin-monster orcid osi page4 pagelines palfed patreon paypal penny-arcade perbyte
654
+ periscope phabricator phoenix-framework phoenix-squadron php pied-piper pied-piper-alt
655
+ pied-piper-hat pied-piper-pp pied-piper-square pinterest pinterest-p pinterest-square
656
+ playstation product-hunt pushed python qq quinscape quora r-project raspberry-pi ravelry react
657
+ reacteurope readme rebel red-river reddit reddit-alien reddit-square redhat renren replyd
658
+ researchgate resolving rev rocketchat rockrms rust safari salesforce sass schlix scribd
659
+ searchengin sellcast sellsy servicestack shirtsinbulk shopify shopware simplybuilt sistrix sith
660
+ sketch skyatlas skype slack slack-hash slideshare snapchat snapchat-ghost snapchat-square
661
+ soundcloud sourcetree speakap speaker-deck spotify squarespace stack-exchange stack-overflow
662
+ stackpath staylinked steam steam-square steam-symbol sticker-mule strava stripe stripe-s
663
+ studiovinari stumbleupon stumbleupon-circle superpowers supple suse swift symfony teamspeak
664
+ telegram telegram-plane tencent-weibo the-red-yeti themeco themeisle think-peaks tiktok
665
+ trade-federation trello tumblr tumblr-square twitch twitter twitter-square typo3 uber ubuntu
666
+ uikit umbraco uncharted uniregistry unity unsplash untappd ups usb usps ussunnah vaadin viacoin
667
+ viadeo viadeo-square viber vimeo vimeo-square vimeo-v vine vk vnv vuejs watchman-monitoring waze
668
+ weebly weibo weixin whatsapp whatsapp-square whmcs wikipedia-w windows wix wizards-of-the-coast
669
+ wodu wolf-pack-battalion wordpress wordpress-simple wpbeginner wpexplorer wpforms wpressr xbox
670
+ xing xing-square y-combinator yahoo yammer yandex yandex-international yarn yelp yoast youtube
671
+ youtube-square zhihu
672
+ `.trim().split(/\s+/)},9947(e,t,n){n.d(t,{K:()=>d,Z:()=>c});var r=n(1518),i=n(4977),o=n(6002);let a=['300 12px "Font Awesome 5 Pro Light"','400 12px "Font Awesome 5 Pro Regular"','900 12px "Font Awesome 5 Pro Solid"','400 12px "Font Awesome 5 Brands U2"'],l=!1,s={light:"fal",regular:"far",solid:"fas",brands:"fab"},u=new Set(o.d);function d(e,t){var n;!function(){if(!l&&document.fonts&&document.documentElement.classList.contains("u2-standalone")){l=!0;var e=!0,t=!1,n=void 0;try{for(var r,i=a[Symbol.iterator]();!(e=(r=i.next()).done);e=!0){let e=r.value;document.fonts.load(e).catch(()=>void 0)}}catch(e){t=!0,n=e}finally{try{e||null==i.return||i.return()}finally{if(t)throw n}}}}();let o=document.createElement("i"),d=null!=(n=null==t?void 0:t.variant)?n:u.has(e)?"brands":"light";o.className=["grok-icon","u2-icon",...e.startsWith("svg-")?["svg-icon",e]:[s[d],`fa-${e}`],(null==t?void 0:t.size)?`u2-icon-${t.size}`:void 0,null==t?void 0:t.cls].filter(e=>e).join(" "),o.dataset.u2="icon";let c=null==t?void 0:t.tooltip;if(c){o.setAttribute("aria-label",c);let e=r.HG.ambient;e?i.m.bind(o,c,{owner:e}):o.title=c}return o}function c(e){return"string"==typeof e?d(e):e}},2127(e,t,n){n.d(t,{m:()=>c});var r=n(3830),i=n(1518),o=n(7115),a=n(8609),l=n(9947),s=n(108);let u={info:"info-circle",warning:"exclamation-triangle",error:"times-circle"};class d{static get host(){if(!d._container||!d._container.isConnected){let e=(0,a.y4)([],"u2-notify-container");e.dataset.u2="notify",r.h.host.append(e),d._container=e}return d._container}static info(e,t){return d.show(e,"info",void 0===t?{}:t)}static warning(e,t){return d.show(e,"warning",void 0===t?{}:t)}static error(e,t){return d.show(e,"error",void 0===t?{}:t)}static show(e,t,n){var r,c,p,h,m,f;let g,v=void 0===t?"info":t,b=void 0===n?{}:n,y=b.oneTimeKey,_=b.singleKey;if(void 0!==_&&d._singleKeys.has(_)||void 0!==y&&!d._claimOneTime(y))return null;void 0!==_&&d._singleKeys.add(_);let w=i.HG.ambient,x=new i.HG(void 0,{label:"notify",lazy:!0}),k="function"==typeof e?x.build(e):e,O=!1,A=()=>{if(O)return;O=!0,x.dispose();let e=b.onClose;void 0!==e&&(0,o.vA)(()=>i.HG.runWith((null==w?void 0:w.isDisposed)?void 0:w,e))},S=!1,P=null!=(r=b.autoHide)?r:"error"!==v,E=null!=(c=b.timeout)?c:1e4,C=null==(h=d.presenter)?void 0:h.call(d,k,v,(m=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},b),f=f={autoHide:P,timeout:E},Object.getOwnPropertyDescriptors?Object.defineProperties(m,Object.getOwnPropertyDescriptors(f)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(f)).forEach(function(e){Object.defineProperty(m,e,Object.getOwnPropertyDescriptor(f,e))}),m),()=>{S=!0,void 0!==g&&d._open.delete(g),void 0!==_&&d._singleKeys.delete(_),A()});if(void 0!==C)return g=C.close,S||d._open.add(C.close),C;let j=(0,a.y4)([],"u2-notify-content");"string"==typeof k?j.textContent=k:j.append(k);let T=i.HG.runWith(void 0,()=>(0,a.y4)([(0,l.K)(u[v],{cls:"u2-notify-type-icon"}),j],`u2-notify u2-notify-${v}`));T.setAttribute("role","info"===v?"status":"alert");let N=!1,I=()=>{N||(N=!0,window.clearTimeout(L),T.remove(),d._open.delete(I),void 0!==_&&d._singleKeys.delete(_),A())};d._open.add(I);let D=i.HG.runWith(void 0,()=>(0,s.gb)("copy",()=>{var e,t;let n=void 0===b.copyText?null!=(e=T.textContent)?e:"":`${T.textContent}
673
+
674
+ ${b.copyText}`;try{null==(t=navigator.clipboard)||t.writeText(n)}catch(e){}},{tooltip:"Copy to clipboard"}));D.addEventListener("click",e=>e.stopPropagation()),T.append((0,a.y4)([D,i.HG.runWith(void 0,()=>(0,s.gb)("times",I,{tooltip:"Close"}))],"u2-notify-icons")),(null==(p=b.closeOnClick)||p)&&T.addEventListener("click",I);let L=0;if(P){let e=(0,a.y4)([],"u2-notify-timer");e.style.animationDuration=`${E}ms`,T.append(e);let t=Date.now(),n=E;L=window.setTimeout(I,n),T.addEventListener("pointerenter",()=>{window.clearTimeout(L),n-=Date.now()-t}),T.addEventListener("pointerleave",()=>{t=Date.now(),L=window.setTimeout(I,Math.max(n,0))})}return d.host.append(T),{root:T,close:I}}static closeAll(){for(let e=0,t=[...d._open];e<t.length;e++)(0,t[e])()}static _claimOneTime(e){try{let t=`u2-notify-${e}`;if(null!==window.localStorage.getItem(t))return!1;return window.localStorage.setItem(t,new Date().toISOString()),!0}catch(e){return!0}}}d._singleKeys=new Set,d._open=new Set;let c=d},8797(e,t,n){n.d(t,{z:()=>a});var r=n(7115),i=n(9701),o=n(8609);class a extends i.Ec{get value(){return this.signal.value}set value(e){this.signal.value=e}peek(){return this.signal.peek()}bindStep(e){return""===e?this.signal:super.bindStep(e)}get indeterminate(){return this._indeterminate}set indeterminate(e){this._indeterminate=e,this.root.classList.toggle("u2-progress-indeterminate",e),this.root.setAttribute("aria-busy",String(e)),this._apply(this.peek())}getState(){var e,t;let n=Math.round(100*this.peek());return e=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},super.getState()),t=t={value:this.peek(),text:this._indeterminate?"":`${n}%`},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}_apply(e){let t=Number.isFinite(e)?Math.min(1,Math.max(0,e)):0;if(t!==e){this.value=t;return}let n=Math.round(1e3*t)/10;if(this._percent&&(this._percent.textContent=this._indeterminate?"":`${Math.round(n)}%`),this._indeterminate){this._fill.style.width="",this._track.removeAttribute("aria-valuenow");return}this._fill.style.width=`${n}%`,this._track.setAttribute("aria-valuenow",String(n/100))}constructor(e){var t;super(),this._track=document.createElement("div"),this._fill=document.createElement("div"),this.signal=(0,r.vP)(0),this._indeterminate=null!=(t=null==e?void 0:e.indeterminate)&&t,this.root.classList.add("u2-progress"),this.root.dataset.u2="progress-bar",this._track.className="u2-progress-track",this._track.dataset.u2Part="track",this._track.setAttribute("role","progressbar"),this._track.setAttribute("aria-valuemin","0"),this._track.setAttribute("aria-valuemax","1"),this._fill.className="u2-progress-fill",this._track.append(this._fill);const n=document.createElement("div");n.className="u2-progress-row",n.append(this._track),(null==e?void 0:e.showPercent)&&(this._percent=(0,o.Ln)("","u2-progress-percent"),this._percent.dataset.u2Part="percent",n.append(this._percent)),this.root.append(n);const i=null==e?void 0:e.description;if(void 0!==i){const e=this.build(()=>(0,o.Ln)(i,"u2-progress-description"));e.dataset.u2Part="label",this.root.append(e)}this.root.classList.toggle("u2-progress-indeterminate",this._indeterminate),this.root.setAttribute("aria-busy",String(this._indeterminate)),this.effect(()=>this._apply(this.value))}}},3855(e,t,n){n.d(t,{h:()=>d});var r=n(7115),i=n(9701),o=n(8609),a=n(4911),l=n(9947),s=n(1600);function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}class d extends i.Ec{getState(){var e,t,n;let r=null==(e=this._options.source)?void 0:e.state.peek(),o=void 0===r?d._peek(this._options.value):"ready"===r.kind?r.value:void 0,a=d._peek(this._options.delta);return u((t=u({},super.getState()),n=n={value:null!=o?o:null,text:i.Ec.text(this._valueEl)},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t),void 0!==a&&Number.isFinite(a)?{extra:{delta:a}}:{})}_renderValue(){let e=this._options.source;if(void 0===e){let e=d._current(this._options.value);this._valueEl.textContent=void 0===e?"—":this._format(e);return}let t=e.state.value;"ready"===t.kind?this._valueEl.textContent=this._format(t.value):"error"===t.kind?this._valueEl.replaceChildren((0,o.y4)([t.message],"u2-stat-error")):this._valueEl.replaceChildren((0,s.qV)(1))}_renderDelta(){let e=this._deltaEl,t=d._current(this._options.delta);if(e.classList.remove("u2-stat-delta-up","u2-stat-delta-down"),e.textContent="",e.hidden=void 0===t||!Number.isFinite(t),e.hidden)return;0!==t&&(e.classList.add(t>0!=!!this._options.deltaInverted?"u2-stat-delta-up":"u2-stat-delta-down"),e.append((0,l.K)(t>0?"arrow-up":"arrow-down",{cls:"u2-stat-delta-icon"})));let n=this._options.deltaFormat;e.append((0,o.Ln)(n?n(t):`${t>0?"+":""}${Math.round(100*t)}%`))}_format(e){let t=this._options.format;return t?t(e):"number"==typeof e?a.y.count(e):e}static _peek(e){return e instanceof r.HN?e.peek():e}static _current(e){return e instanceof r.HN?e.value:e}constructor(e){super(),this._options=e,this.root.classList.add("u2-card","u2-stat-card"),this.root.dataset.u2="stat-card",this._valueEl=(0,o.y4)(void 0,"u2-stat-value"),this._valueEl.dataset.u2Part="value",this._deltaEl=void 0===e.delta?void 0:(0,o.y4)(void 0,"u2-stat-delta"),this._deltaEl&&(this._deltaEl.dataset.u2Part="delta"),this.build(()=>{void 0!==e.icon&&this.root.append((0,l.K)(e.icon,{cls:"u2-stat-icon"}));let t=(0,o.Ln)(e.label,"u2-stat-label");t.dataset.u2Part="label",this.root.append(this._valueEl,t),this._deltaEl&&this.root.append(this._deltaEl)}),this.effect(()=>this._renderValue()),this._deltaEl&&this.effect(()=>this._renderDelta())}}},9793(e,t,n){n.d(t,{o:()=>W});var r=n(7115),i=n(1518),o=n(4977),a=n(7974),l=n(8609),s=n(5232),u=n(7371),d=n(9701),c=n(4911),p=n(4208),h=n(108),m=n(7119),f=n(9947),g=n(4653),v=n(8049),b=n(5363),y=n(4969),_=n(8574),w=n(476),x=n(8075),k=n(136);function O(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function A(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}function S(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){A(o,r,i,a,l,"next",e)}function l(e){A(o,r,i,a,l,"throw",e)}a(void 0)})}}function P(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function E(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function C(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,i=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var o=[],a=!0,l=!1;try{for(i=i.call(e);!(a=(n=i.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==i.return||i.return()}finally{if(l)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return O(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return O(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function j(e){var t;return(0,u.i9)(e)?null!=(t=e.name)?t:e.id:(0,u.bl)(e)?e.span:c.y.value(e)}function T(e,t){return(t===u.Nd.INT||t===u.Nd.FLOAT)&&""!==e.trim()&&Number.isFinite(Number(e))?Number(e):e}function N(e,t){return{root:e.root,set:e=>t(Array.isArray(e)?void 0:e),setDisabled:t=>e.disabled=t}}function I(e,t){return{root:e.root,setDisabled:t=>e.disabled=t,set:n=>{let r=t(n);(0,u.$y)(e.peek(),r)||(e.value=r)}}}function D(e,t){let n=(0,h.gb)("times",e,{tooltip:`Remove ${void 0===t?"condition":t}`});return n.classList.add("u2-fb-remove"),n.dataset.u2Part="remove",n}function L(){let e=(0,l.y4)([(0,f.K)("grip-vertical")],"u2-fb-handle");return e.dataset.u2Part="handle",e.title="Drag to move",e.setAttribute("role","button"),e.setAttribute("aria-label","Drag to move"),e}function z(e,t){let n=(0,l.Ln)("",e);return n.dataset.u2Part=t,n.hidden=!0,n}function F(e,t,n,r){let i=void 0!==r&&r;e.classList.toggle("u2-fb-invalid",null!==n&&!i),e.classList.toggle("u2-fb-missing",null!==n&&i),t.textContent=null!=n?n:"",t.hidden=null===n,null===n?e.removeAttribute("title"):e.title=n}class B extends d.Ec{update(e){var t,n;this._cond=e,this._prop.setItems(B._items(this._host.properties().map(e=>{var t;return{value:e.name,label:null!=(t=e.friendlyName)?t:e.name}}),e.property)),this._prop.value=e.property;let r=(0,u.MZ)(this._host.schema,e.property),i=r?this._host.operators(r):[];this._op.setItems(B._items(i.map(e=>({value:e.id,label:e.label})),e.operator)),this._op.value=e.operator;let o=i.find(t=>t.id===e.operator);this._propText.textContent=null!=(t=null==r?void 0:r.friendlyName)?t:e.property,this._opText.textContent=null!=(n=null==o?void 0:o.label)?n:e.operator;let a=`${e.property} ${null==o?void 0:o.editor}/${null==o?void 0:o.arity}`;a!==this._editorKey?(this._editorKey=a,this._buildEditors(e,r,o)):this._syncEditors(e),this.applyLock()}setProblem(e,t){F(this.root,this._problem,e,void 0!==t&&t)}focus(){var e;null==(e=this._prop.root.querySelector("select"))||e.focus()}_build(e){this._handle=L(),this._prop=new g.o({inline:!0,nullable:!1,items:[],value:e.property,onChanged:e=>this._onProperty(e)}),this._prop.root.classList.add("u2-fb-prop"),this._prop.root.dataset.u2Part="prop",this._op=new g.o({inline:!0,nullable:!1,items:[],value:e.operator,onChanged:e=>this._onOperator(e)}),this._op.root.classList.add("u2-fb-op"),this._op.root.dataset.u2Part="op",this._propText=z("u2-fb-prop-text","prop-text"),this._opText=z("u2-fb-op-text","op-text"),this._valueHost=(0,l.y4)([],"u2-fb-values"),this._remove=D(()=>this._host.remove(this.id)),this._problem=z("u2-fb-problem","problem"),this._valueHost.append(this._problem),this.root.append(this._handle,this._prop.root,this._propText,this._op.root,this._opText,this._valueHost,this._remove),this.own(()=>this._releaseEditors())}static _items(e,t){return e.some(e=>e.value===t)?e:[...e,{value:t,label:t}]}_onProperty(e){var t,n;if(null===e||e===this._cond.property)return;let r=(0,u.MZ)(this._host.schema,e),i=r?this._host.operators(r):[],o=i.some(e=>e.id===this._cond.operator)?this._cond.operator:null!=(t=null==(n=i[0])?void 0:n.id)?t:this._cond.operator;this._host.change(this.id,{property:e,operator:o,value:void 0})}_onOperator(e){if(null===e||e===this._cond.operator)return;let t=C([this._cond.operator,e].map(e=>u.II.get(e)),2),n=t[0],r=t[1],i=void 0!==r&&(null==n?void 0:n.arity)===r.arity&&(null==n?void 0:n.editor)===r.editor;this._host.change(this.id,i?{operator:e}:{operator:e,value:void 0})}_change(e){(0,u.$y)(e,this._cond.value)||this._host.change(this.id,{value:e})}applyLock(){let e=this._host.lockOf(this.id),t="none"!==e,n=this._host.disabled();this.root.classList.toggle("u2-fb-locked",t),this._remove.hidden=t,this._handle.hidden=t||!this._host.advanced(),this._prop.root.hidden=t,this._op.root.hidden=t,this._propText.hidden=!t,this._opText.hidden=!t,s.B.apply(this._remove,n);for(let e=0,t=[this._prop,this._op];e<t.length;e++){let r=t[e];r.disabled!==n&&(r.disabled=n)}var r=!0,i=!1,o=void 0;try{for(var a,l=this._editors[Symbol.iterator]();!(r=(a=l.next()).done);r=!0)a.value.setDisabled(null!=n?n:"all"===e?B.LOCKED:null)}catch(e){i=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}}_releaseEditors(){var e;null==(e=this._editorScope)||e.dispose(),this._editorScope=void 0,this._editors=[],this._valueHost.textContent="",this._valueHost.append(this._problem)}_buildEditors(e,t,n){if(this._releaseEditors(),!t||!n||"none"===n.editor||0===n.arity)return;let r=new i.HG;this._editorScope=r,r.build(()=>{if("list"===n.editor)this._mount(this._listEditor(e,t),"value");else if("range"===n.editor){let n=C(B._bounds(e),2),r=n[0],i=n[1];this._mount(this._scalarEditor(t,r,e=>this._writeBound(0,e)),"value"),this._valueHost.insertBefore((0,l.Ln)("and","u2-fb-and"),this._problem),this._mount(this._scalarEditor(t,i,e=>this._writeBound(1,e)),"value2")}else this._mount(this._singleEditor(e,t),"value")})}_mount(e,t){e.root.classList.add(`u2-fb-${t}`),e.root.dataset.u2Part=t,this._valueHost.insertBefore(e.root,this._problem),this._editors.push(e)}_syncEditors(e){let t=2===this._editors.length?B._bounds(e):[e.value];for(let e=0;e<this._editors.length;e++)this._editors[e].set(t[e])}static _bounds(e){return Array.isArray(e.value)?[e.value[0],e.value[1]]:[void 0,void 0]}_writeBound(e,t){var n,r;let i=B._bounds(this._cond);i[e]=t,this._change(i.every(e=>void 0===e)?void 0:[null!=(n=i[0])?n:null,null!=(r=i[1])?r:null])}_singleEditor(e,t){var n,r;let i=null==(n=(r=this._host).editors)?void 0:n.call(r,t,{inline:!0,value:e.value,onChanged:e=>this._change(e)});return i?I(i,e=>e):this._scalarEditor(t,Array.isArray(e.value)?void 0:e.value,e=>this._change(e),e.operator)}_listEditor(e,t){var n;let r=(0,u.I)(t),i=this._host.schema.values,o=e=>Array.isArray(e)?e:[];return I(new x.u(E(P({inline:!0,value:o(e.value),itemText:j,allowNew:!0,createItem:e=>T(e,r),placeholder:"Type a value…"},i?{source:(e,n)=>S(function*(){return(yield i(t,e,n)).map(e=>(0,u.i9)(e.value)&&e.label?E(P({},e.value),{name:e.label}):e.value)})()}:{items:null!=(n=t.choices)?n:[]}),{onChanged:e=>this._change(0===e.length?void 0:e)})),o)}_scalarEditor(e,t,n,r){let i=(0,u.I)(e);if(e.choices){let r=e=>null==e?null:String(e),o=new g.o({inline:!0,items:e.choices,value:r(t),onChanged:e=>n(null===e?void 0:T(e,i))});return N(o,e=>o.value=r(e))}let o=this._host.schema.values;if(i===u.Nd.REF&&o){let i=new k.S({inline:!0,prop:e,schema:this._host.schema,operator:r,value:(0,u.i9)(t)?t:null,onChanged:e=>n(null!=e?e:void 0)});return N(i,e=>i.value=(0,u.i9)(e)?e:null)}switch(i){case u.Nd.INT:case u.Nd.FLOAT:{let r=new b.Q({inline:!0,mode:i,min:e.min,max:e.max,value:"number"==typeof t?t:null,onChanged:e=>n(null===e?void 0:e)});return N(r,e=>r.value="number"==typeof e?e:null)}case u.Nd.BIG_INT:{let e=e=>"number"==typeof e||"string"==typeof e&&/^-?\d+$/.test(e)?BigInt(e):null,r=new y.G({inline:!0,value:e(t),onChanged:e=>n(null===e?void 0:e.toString())});return N(r,t=>r.value=e(t))}case u.Nd.BOOL:{let e=e=>!0===e?"true":!1===e?"false":null,r=new g.o({inline:!0,items:["true","false"],value:e(t),onChanged:e=>n(null===e?void 0:"true"===e)});return N(r,t=>r.value=e(t))}case u.Nd.DATE_TIME:{let e=e=>(0,u.bl)(e)?(0,p.uA)((0,p.Ho)(e.span,new Date),e.span):e instanceof Date?e:null,r=new _.e({inline:!0,relative:!0,value:e(t),onChanged:e=>n(null===e?void 0:void 0===(0,p.ee)(e)?e:{span:(0,p.ee)(e)})});return N(r,t=>{var n,i,o,a;(n=r.peek())!==(i=e(t))&&(null===n||null===i||(null!=(o=(0,p.ee)(n))?o:n.getTime())!==(null!=(a=(0,p.ee)(i))?a:i.getTime()))&&(r.value=e(t))})}default:{let r=e=>null==e?"":j(e),a={inline:!0,value:r(t),onChanged:e=>n(""===e?void 0:e)},l=o&&i===u.Nd.STRING?new w.Z(E(P({},a),{openOnFocus:!0,source:(t,n)=>S(function*(){return(yield o(e,t,n)).map(e=>j(e.value))})()})):new v.k(a);return N(l,e=>l.value=r(e))}}}constructor(e,t){super(),this._editorKey="",this._editors=[],this.id=e.id,this._host=t,this._cond=e,this.root.classList.add("u2-fb-cond"),this.root.dataset.u2="filter-row",this.root.dataset.u2Node=e.id,this.build(()=>this._build(e)),this.update(e)}}B.LOCKED="Locked by the template",B.NOTHING_TO_ADD="The schema has no property to filter by";class M extends d.Ec{update(e){this._text.textContent=`(${(0,u.GP)(e)||"…"})`,this.applyLock()}applyLock(){let e=this._host.lockOf(this.id);this.root.classList.toggle("u2-fb-locked","none"!==e),this._remove.hidden="none"!==e,s.B.apply(this._remove,this._host.disabled())}setProblem(e){F(this.root,this._problem,e)}constructor(e,t){super(),this.id=e.id,this._host=t,this.root.classList.add("u2-fb-cond","u2-fb-nested"),this.root.dataset.u2="filter-row",this.root.dataset.u2Node=e.id,this._text=(0,l.Ln)("","u2-fb-nested-text"),this._text.dataset.u2Part="value",this._remove=this.build(()=>D(()=>this._host.remove(this.id))),this._problem=z("u2-fb-problem","problem"),this.root.append(this._text,this._remove,this._problem),this.update(e)}}class R extends d.Ec{get id(){return this._group.id}update(e){this._group=e,this.connector.selected.peek()[0]!==e.op&&(this.connector.selected.value=[e.op]),this.root.classList.toggle("u2-fb-negated",!0===e.not),this.not.classList.toggle("u2-fb-not-on",!0===e.not),this.not.setAttribute("aria-pressed",String(!0===e.not)),this.applyLock()}applyLock(){let e=this._host.advanced(),t="none"!==this._host.lockOf(this.id),n=this._host.disabled();this.root.classList.toggle("u2-fb-locked",t),this.not.hidden=!e;let r=null!=n?n:t?B.LOCKED:null;s.B.apply(this.not,r),this.not.title=null!=r?r:"Negate the group",this.connector.setDisabled("and",r),this.connector.setDisabled("or",r),this.add.hidden=t||!this._host.allowAdd,s.B.apply(this.add,null!=n?n:0===this._host.properties().length?B.NOTHING_TO_ADD:null),this.addGroup.hidden=!e||t||!this._host.allowAdd,s.B.apply(this.addGroup,n),this.remove&&(this.remove.hidden=t,s.B.apply(this.remove,n)),this.handle&&(this.handle.hidden=t)}setProblem(e){this.root.classList.toggle("u2-fb-invalid",null!==e),null===e?this.header.removeAttribute("title"):this.header.title=e}constructor(e,t,n){let r=void 0!==n&&n;super(),this._host=t,this._group=e,this.root.classList.add(r?"u2-fb-root":"u2-fb-group"),r||(this.root.dataset.u2="filter-group",this.root.dataset.u2Node=e.id),this.connector=this.build(()=>new m.e({toggle:"single",density:"toolbar",items:[{id:"and",text:"and"},{id:"or",text:"or"}]})),this.connector.root.classList.add("u2-fb-connector"),this.connector.root.dataset.u2Part="connector",this.not=(0,l.x6)("not",()=>this._host.change(this.id,{not:!0!==this._group.not||void 0})),this.not.classList.add("u2-fb-not"),this.not.dataset.u2Part="not",this.not.title="Negate the group",this.add=this.build(()=>(0,h.gb)("plus",()=>this._host.add(this.id,"condition"),{tooltip:"Add condition"})),this.add.classList.add("u2-fb-add"),this.add.dataset.u2Part="add",this.addGroup=this.build(()=>(0,h.gb)("folder-plus",()=>this._host.add(this.id,"group"),{tooltip:"Add group"})),this.addGroup.classList.add("u2-fb-add-group"),this.addGroup.dataset.u2Part="add-group";const i=[this.connector.root,this.not,this.add,this.addGroup];r||(this.handle=L(),this.remove=this.build(()=>D(()=>this._host.remove(this.id),"group")),i.unshift(this.handle),i.push(this.remove)),this.header=(0,l.y4)(i,r?"u2-fb-header":"u2-fb-group-header"),this.rows=(0,l.y4)([],r?"u2-fb-rows":"u2-fb-group-rows"),this.rows.dataset.u2Part="rows",this.root.append(this.header,this.rows),this.effect(()=>{let e=this.connector.selected.value[0];void 0!==e&&e!==this._group.op&&this._host.change(this.id,{op:e})}),this.update(e)}}function q(e,t,n,r,i){var o;if((null==(o=e.parent)?void 0:o.id)!==t)return{parentId:t,index:n,kind:r,rect:i};let a=n>e.index?n-1:n;return a===e.index?null:{parentId:t,index:a,kind:r,rect:i}}class H{dispose(){this._end(!1),this._host.root.removeEventListener("pointerdown",this._onDown),this.indicator.remove()}_down(e){if(0!==e.button||this._drag)return;let t=e.target.closest('[data-u2-part="handle"]'),n=null==t?void 0:t.closest("[data-u2-node]");t&&n&&(e.preventDefault(),this._drag={id:n.dataset.u2Node,row:n,x:e.clientX,y:e.clientY,active:!1,hits:[],target:null},t.setPointerCapture(e.pointerId),document.addEventListener("pointermove",this._onMove),document.addEventListener("pointerup",this._onUp),document.addEventListener("pointercancel",this._onCancel),document.addEventListener("keydown",this._onKey))}_move(e){let t=this._drag;if(!t)return;if(!t.active){if(4>Math.abs(e.clientX-t.x)&&4>Math.abs(e.clientY-t.y))return;t.active=!0,t.hits=this._host.hits(),t.row.classList.add("u2-fb-dragging")}let n=function(e,t,n,r,i){let o,a=new Map;u.Cu.walk(e,(e,t,n)=>a.set(e.id,{parent:t,index:n,depth:t?a.get(t.id).depth+1:0}));let l=a.get(i);if(!l)return null;var s=!0,d=!1,c=void 0;try{for(var p,h,m=t[Symbol.iterator]();!(s=(h=m.next()).done);s=!0){let e=h.value;a.has(e.id)&&(p=e.rect,n>=p.x&&n<=p.x+p.width&&r>=p.y&&r<=p.y+p.height)&&(!o||a.get(e.id).depth>=a.get(o.id).depth)&&(o=e)}}catch(e){d=!0,c=e}finally{try{s||null==m.return||m.return()}finally{if(d)throw c}}if(!o||o.id===i)return null;let f=u.Cu.find(e,i);if(u.Cu.isGroup(f)&&u.Cu.find(f,o.id))return null;let g=u.Cu.find(e,o.id);if(u.Cu.isGroup(g))return q(l,g.id,g.nodes.length,"into",o.rect);let v=a.get(g.id),b=v.parent,y=v.index,_=r>o.rect.y+o.rect.height/2,w={x:o.rect.x,y:_?o.rect.y+o.rect.height:o.rect.y,width:o.rect.width,height:2};return q(l,b.id,y+ +!!_,"line",w)}(this._host.tree(),t.hits,e.clientX,e.clientY,t.id);t.target=n&&this._host.accepts(t.id,n.parentId)?n:null,this._show(t.target)}_end(e){let t=this._drag;!t||(this._drag=void 0,document.removeEventListener("pointermove",this._onMove),document.removeEventListener("pointerup",this._onUp),document.removeEventListener("pointercancel",this._onCancel),document.removeEventListener("keydown",this._onKey),t.active&&(t.row.classList.remove("u2-fb-dragging"),this._show(null),e&&t.target&&this._host.drop(t.id,t.target)))}_show(e){let t=this.indicator;if(t.hidden=null===e,!e)return;let n=this._host.root,r=n.getBoundingClientRect();t.classList.toggle("u2-fb-drop-into","into"===e.kind),t.classList.toggle("u2-fb-drop-line","line"===e.kind),t.style.left=`${e.rect.x-r.left+n.scrollLeft}px`,t.style.top=`${e.rect.y-r.top+n.scrollTop}px`,t.style.width=`${e.rect.width}px`,t.style.height=`${e.rect.height}px`}constructor(e){this._host=e,this._onDown=e=>this._down(e),this._onMove=e=>this._move(e),this._onUp=()=>this._end(!0),this._onCancel=()=>this._end(!1),this._onKey=e=>{"Escape"===e.key&&this._end(!1)},this.indicator=(0,l.y4)([],"u2-fb-drop"),this.indicator.hidden=!0,e.root.append(this.indicator),e.root.addEventListener("pointerdown",this._onDown)}}class W extends a.p{addCondition(e,t){var n,r,i;let o=this.peek(),a=this._host.properties()[0];if(!a)return"";let l=u.Cu.cond(a.name,null!=(n=null==(r=this._host.operators(a)[0])?void 0:r.id)?n:"=");return this._append(o,l,e,t),null==(i=this._rows.get(l.id))||i.focus(),l.id}addGroup(e,t){let n=this.peek(),r=e&&u.Cu.find(n,e)||n,i=u.Cu.group(u.Cu.isGroup(r)&&"and"===r.op?"or":"and");return this._append(n,i,e,t),i.id}get disabled(){return super.disabled}set disabled(e){super.disabled=e,null==(l=this._rootRow)||l.applyLock();var t=!0,n=!1,r=void 0;try{for(var i,o,a,l,u,d,c,p=(null!=(i=null==(u=this._rows)?void 0:u.values())?i:[])[Symbol.iterator]();!(t=(c=p.next()).done);t=!0)c.value.applyLock()}catch(e){n=!0,r=e}finally{try{t||null==p.return||p.return()}finally{if(n)throw r}}for(let e=0,t=[...null!=(o=this._links)?o:[],...null!=(a=null==(d=this._joins)?void 0:d.values())?a:[]];e<t.length;e++){let n=t[e];s.B.apply(n,this.disabled)}}touch(){super.touch(),this._revealed.value=!0}removeNode(e){this.value=u.Cu.remove(this.peek(),e)}setMode(e){var t;return"simple"!==e||u.Cu.isFlat(this.peek())?"advanced"===e&&(null==(t=this.options.template)?void 0:t.allowAdvanced)===!1?(this._showHint(null),!1):(this._mode.value=e,!0):(this._showHint(this.peek()),!1)}getWidgetStatus(){let e=super.getWidgetStatus();return e.parts.rows=this._rootRow.rows,e.parts.add=this._rootRow.add,e.parts.connector=this._rootRow.connector.root,e.parts.mode=this._modeLink,this._queryEl&&(e.parts.query=this._queryEl),e.tree=this.peek(),e.query=this._query.peek(),e.problems=this._problems.peek(),e.mode=this._advanced()?"advanced":"simple",e}static withIds(e){if(!e||!Array.isArray(e.nodes))return u.Cu.group("and");let t=!0;return u.Cu.walk(e,e=>{"string"!=typeof e.id&&(t=!1)}),t?e:u.Cu.clone(e,!0)}isEmptyValue(e){return a.p.isEmpty(e)||0===u.Cu.count(e)}createEditor(){var e,t,n,i;let o=this.options;this._mode=o.mode instanceof r.HN?o.mode:(0,r.vP)(null!=(e=o.mode)?e:"simple"),this._query=(0,r.EW)(()=>u.Cu.format(this.value)),this._problems=(0,r.EW)(()=>u.Cu.validate(this.value,o.schema,o.target,o.template)),this._rows=new Map,this._scopes=new Map,this._joins=new Map,this._horizontal="horizontal"===o.orientation,this._warned=!1,this._touchedRows=(0,r.vP)(new Set),this._revealed=(0,r.vP)(!1),this._host={schema:o.schema,editors:null!=(t=o.editors)?t:W.defaultEditors,allowAdd:(null==(n=o.template)?void 0:n.allowAdd)!==!1,properties:()=>this._properties(),operators:e=>this._operators(e),lockOf:e=>this._lockOf(e),disabled:()=>this.disabled,advanced:()=>this._advanced(),change:(e,t)=>this._change(e,t),add:(e,t)=>"group"===t?this.addGroup(e):this.addCondition(e),remove:e=>this.removeNode(e)},this._rootRow=new R(W.withIds(this.peek()),this._host,!0),this._links=[];let a=(e,t)=>{let n=(0,l.nf)(e,()=>{null===this.disabled&&t()});return this._links.push(n),n};this._modeLink=a((0,r.EW)(()=>"simple"===this._mode.value?"Advanced":"Simple"),()=>this.setMode("simple"===this._mode.peek()?"advanced":"simple")),this._modeLink.classList.add("u2-fb-mode"),this._modeLink.dataset.u2Part="mode",this._modeLink.hidden=(null==(i=o.template)?void 0:i.allowAdvanced)===!1,this._rootRow.header.append(this._modeLink);let s=[(0,l.Ln)("No conditions")];if(this._host.allowAdd){let e=a("Add condition",()=>this.addCondition());e.classList.add("u2-fb-none-add"),e.dataset.u2Part="none-add",s.push(e)}return this._none=(0,l._Q)(s,"u2-fb-none"),this._none.dataset.u2Part="none",this._hintText=(0,l.Ln)("","u2-fb-hint-text"),this._flatten=a("Flatten",()=>{let e=u.Cu.flatten(this.peek());e&&(this.value=e,this._mode.value="simple")}),this._flatten.dataset.u2Part="flatten",this._hintMode=a("Advanced",()=>this.setMode("advanced")),this._hintMode.dataset.u2Part="hint-mode",this._hint=(0,l.y4)([this._hintText,this._flatten,this._hintMode],"u2-fb-hint"),this._hint.dataset.u2Part="hint",this._hint.setAttribute("role","status"),this._hint.hidden=!0,this._panel=(0,l.y4)([this._rootRow,this._hint],"u2-fb"),o.showQuery&&(this._queryEl=(0,l.Ln)(this._query,"u2-fb-query"),this._queryEl.dataset.u2Part="query",this._panel.append(this._queryEl)),this._drag=new H({root:this._panel,tree:()=>this.peek(),hits:()=>this._hits(),accepts:(e,t)=>this._accepts(e,t),drop:(e,t)=>this.value=u.Cu.move(this.peek(),e,t.parentId,t.index)}),this.own(()=>this._drag.dispose()),this.scope.listen(this._panel,"focusout",e=>{var t,n;let r=e.target,i=(null==(t=r.closest)?void 0:t.call(r,".u2-fb-values"))?null==(n=r.closest("[data-u2-node]"))?void 0:n.dataset.u2Node:void 0;void 0!==i&&this._touchRow(i)}),this.addValidator(()=>{var e,t;return null!=(e=null==(t=this._problems.value[0])?void 0:t.message)?e:null}),this.effect(()=>this._render()),this._panel}_advanced(){var e;return"advanced"===this._mode.value&&(null==(e=this.options.template)?void 0:e.allowAdvanced)!==!1}_touchRow(e){this._touchedRows.peek().has(e)||(this._touchedRows.value=new Set([...this._touchedRows.peek(),e]))}_change(e,t){"value"in t&&this._touchRow(e);let n=this.peek(),r=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},u.Cu.find(n,e),t);var i=!0,o=!1,a=void 0;try{for(var l,s=Object.keys(t)[Symbol.iterator]();!(i=(l=s.next()).done);i=!0){let e=l.value;void 0===r[e]&&delete r[e]}}catch(e){o=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(o)throw a}}this.value=u.Cu.replace(n,e,r)}_accepts(e,t){var n;return"none"===this._lockOf(e)&&"none"===this._lockOf(t)&&(this._host.allowAdd||(null==(n=u.Cu.parentOf(this.peek(),e))?void 0:n.id)===t)}_append(e,t,n,r){let i=n&&u.Cu.find(e,n)||e,o=u.Cu.isGroup(i)?i:e;this.value=u.Cu.insert(e,o.id,null!=r?r:o.nodes.length,t)}_properties(){var e;let t=null==(e=this.options.template)?void 0:e.allowedProperties,n=this.options.schema.properties;return t?n.filter(e=>t.includes(e.name)):n}_operators(e){var t,n,r,i,o;let a=u.Cu.operators.for(e),l=null!=(t=null==(n=(r=this.options.schema).operators)?void 0:n.call(r,e,a))?t:a,s=null==(o=this.options.template)||null==(i=o.allowedOperators)?void 0:i[e.name];return s?l.filter(e=>s.includes(e.id)):l}_lockOf(e){var t;let n=u.Cu.lockOf(this.peek(),e),r=null==(t=this.options.template)?void 0:t.root,i=r?u.Cu.lockOf(r,e):"none";return"all"===n||"all"===i?"all":"value"===n||"value"===i?"value":"none"}_hits(){let e=Array.from(this._panel.querySelectorAll("[data-u2-node]")).map(e=>({id:e.dataset.u2Node,rect:e.getBoundingClientRect()}));return e.push({id:this.peek().id,rect:this._rootRow.rows.getBoundingClientRect()}),e}_showHint(e){var t;let n=null!==e&&null!==u.Cu.flatten(e),r=null!==e&&!this._advanced()&&(null==(t=this.options.template)?void 0:t.allowAdvanced)!==!1;this._hintText.textContent=null===e?"This filter cannot use advanced mode.":n?"This filter has nested groups. ":"This filter has nested groups that cannot be flattened. ",this._flatten.hidden=!n,this._hintMode.hidden=!r,this._hint.hidden=!1}_render(){let e=this.value,t=W.withIds(e);if(t!==e)return void this.systemWrite(t);let n=this._advanced(),r=this._horizontal&&!n;n&&this._horizontal&&!this._warned&&(this._warned=!0,console.warn("u2: FilterBuilder ignores orientation in advanced mode")),n||u.Cu.isFlat(t)?this._hint.hidden=!0:this._showHint(t),this._panel.classList.toggle("u2-fb-horizontal",r),this.root.classList.toggle("u2-fb-blank",0===u.Cu.count(t)),this._panel.classList.toggle("u2-fb-advanced",n),this._rootRow.header.hidden=r,this._rootRow.update(t),r||this._rootRow.add.parentElement===this._rootRow.header||this._rootRow.header.insertBefore(this._rootRow.add,this._rootRow.addGroup);let i=new Set,o=this._revealed.value?this._problems.value:this._problems.value.filter(e=>"missing-value"!==e.code||null==e.nodeId||this._touchedRows.value.has(e.nodeId));this._renderChildren(t,this._rootRow,n,r,o,i);var a=!0,l=!1,s=void 0;try{for(var d,c=this._rows.keys()[Symbol.iterator]();!(a=(d=c.next()).done);a=!0){let e=d.value;i.has(e)||this._releaseRow(e)}}catch(e){l=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(l)throw s}}var p=!0,h=!1,m=void 0;try{for(var f,g=this._joins.values()[Symbol.iterator]();!(p=(f=g.next()).done);p=!0)f.value.textContent=t.op}catch(e){h=!0,m=e}finally{try{p||null==g.return||g.return()}finally{if(h)throw m}}this.refreshDisabled()}_renderChildren(e,t,n,r,i,o){let a=[];var l=!0,s=!1,d=void 0;try{for(var c,p,h=e.nodes[Symbol.iterator]();!(l=(p=h.next()).done);l=!0){let e=p.value,t=u.Cu.isGroup(e)?n?"group":"nested":"cond",l=this._rows.get(e.id);l&&W._kindOf(l)!==t&&(this._releaseRow(e.id),l=void 0),l?l.update(e):l=this._mountRow(t,e);let s=i.find(t=>t.nodeId===e.id);l.setProblem(null!=(c=null==s?void 0:s.message)?c:null,(null==s?void 0:s.code)==="missing-value"),o.add(e.id),r&&a.length>0&&a.push(this._join(e.id)),a.push(l.root),l instanceof R&&this._renderChildren(e,l,n,!1,i,o)}}catch(e){s=!0,d=e}finally{try{l||null==h.return||h.return()}finally{if(s)throw d}}0===a.length&&t===this._rootRow&&a.push(this._none),r&&!this._rootRow.add.hidden&&a.push(this._rootRow.add),W._place(t.rows,a)}_mountRow(e,t){let n=new i.HG,r=()=>n.dispose();this.scope.own(r),n.own(()=>this.scope.disown(r)),this._scopes.set(t.id,n);let o=n.build(()=>"cond"===e?new B(t,this._host):"group"===e?new R(t,this._host):new M(t,this._host));return this._rows.set(t.id,o),o}_releaseRow(e){var t;null==(t=this._scopes.get(e))||t.dispose(),this._scopes.delete(e),this._rows.delete(e),this._joins.delete(e)}static _kindOf(e){return e instanceof B?"cond":e instanceof R?"group":"nested"}static _place(e,t){for(let r=0;r<t.length;r++){var n;let i=t[r];e.children[r]!==i&&e.insertBefore(i,null!=(n=e.children[r])?n:null)}for(;e.children.length>t.length;)e.children[e.children.length-1].remove()}_join(e){let t=this._joins.get(e);if(!t){let n=this._scopes.get(e);(t=n.build(()=>(0,l.x6)("",()=>{let e=this.peek();this.value=u.Cu.update(e,e.id,{op:"and"===e.op?"or":"and"})}))).classList.add("u2-fb-join"),t.setAttribute("aria-label","Switch and/or"),o.m.bind(t,"Switch and/or",{owner:n}),this._joins.set(e,t)}return t}constructor(e){super(e,u.Cu.group("and")),this.query=this._query,this.problems=this._problems,this.mode=this._mode,this.modeSwitch=this._modeLink,this.root.classList.add("u2-filter-builder"),this.root.dataset.u2="filter-builder"}}W.defaultEditors=null},2120(e,t,n){n.d(t,{$:()=>v});var r=n(7115),i=n(7974),o=n(8191),a=n(8609),l=n(9383),s=n(2357),u=n(9947),d=n(7371);let c={[d.Nd.STRING]:"font",[d.Nd.INT]:"hashtag",[d.Nd.FLOAT]:"hashtag",[d.Nd.BIG_INT]:"hashtag",[d.Nd.DATE_TIME]:"calendar",[d.Nd.BOOL]:"check-square",[d.Nd.STRING_LIST]:"list",[d.Nd.REF]:"link"},p={[d.Nd.BOOL]:["true","false"],[d.Nd.DATE_TIME]:["now","-1d","-1w","-1m"],[d.Nd.REF]:["@current"]},h={"is null":"= null","is not null":"!= null"},m=new Set(["like","!like","starts","ends"]),f=/([A-Za-z_]\w*)\s+under\s+[^"'\s]\S*(\s+\S+)*\s*$/i;function g(e,t,n){let r=n?[n]:[];return r.push("string"==typeof e?(0,a.Ln)(e,"u2-fq-text"):e),t&&r.push((0,a.Ln)(t,"u2-fq-secondary")),(0,a.y4)(r,"u2-fq-row")}class v extends i.p{get placeholder(){return this._input.placeholder}set placeholder(e){this._input.placeholder=null!=e?e:""}commit(){let e=this.options;if(null===this._raw.peek()&&this._text.peek()===this._display(this.peek()))return this._problems.value=[],this._dirty=!1,!0;let t=this._text.peek(),n=d.Cu.parse(t,e.schema,e.target),r=n.root,i=n.problems;if(this._problems.value=v.worded(t,e.schema,i),i.length>0)return this.touch(),!1;this._dirty=!1,this._raw.value=null;let o=this.peek();return d.Cu.equals(r,o)?this._text.value=this._display(o):this.value=r,!0}static worded(e,t,n){var r,i,o;let a=0===n.length?null:f.exec(e);if(null===a)return n;let l=d.Cu.property(t,a[1]),s=(null!=(r=null==l?void 0:l.ref)?r:"").split(".").pop()||"row";return[(i=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},n[0]),o=o={message:`under takes a ${s} — pick one from the list`},Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(o)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(o)).forEach(function(e){Object.defineProperty(i,e,Object.getOwnPropertyDescriptor(o,e))}),i),...n.slice(1)]}showText(e,t){let n=void 0===t?[]:t;if(this._raw.value=e,null===e){this._dirty=!1,(0,r.O8)(()=>this._syncText());return}this._dirty=!0,this._text.value=e,this._problems.value=n,this.revalidate(),n.length>0&&this.touch()}getWidgetStatus(){let e=super.getWidgetStatus();return e.tree=this.peek(),e.query=this._text.peek(),e.problems=this._problems.peek(),e.mode="text",e}isEmptyValue(e){return i.p.isEmpty(e)||0===d.Cu.count(e)}createEditor(){var e;let t=document.createElement("input");this._input=t,t.type="text",t.autocomplete="off",t.spellcheck=!1,t.placeholder=null!=(e=this.options.placeholder)?e:"",t.setAttribute("role","combobox"),t.setAttribute("aria-autocomplete","list"),this._dirty=!1,this._text=(0,r.vP)(""),this._prefix=(0,r.vP)(""),this._view=(0,r.vP)({kind:"idle"}),this._problems=(0,r.vP)([]),this._raw=(0,r.vP)(null),this._items=(0,r.EW)(()=>{let e=this._view.value;return"ready"===e.kind?e.items:[]}),this._list=new s.j({prefix:"u2-fq",anchor:t,scope:this.scope,items:this._items,view:this._view,text:this._prefix,minChars:0,render:e=>e.render(),autoHighlight:!0,maxHeight:"calc(var(--dg-control-height) * 6)",matchWidth:!1,onPick:e=>(this._moved=!0,this._insert(e)),onDismiss:()=>this._list.dismiss(),onRetry:()=>this._refresh()}),this.own(()=>{var e;return null==(e=this._abort)?void 0:e.abort()}),(0,o.n)(t,this._text,{owner:this.scope}),this.scope.listen(t,"input",()=>{this._dirty=!0,this._suggest()}),this.scope.listen(t,"keydown",e=>this._onKeyDown(e));let n=()=>{this._list.isOpen.peek()&&this._refresh()};return this.scope.listen(t,"keyup",e=>{let t=e.key;("ArrowLeft"===t||"ArrowRight"===t||"Home"===t||"End"===t)&&n()}),this.scope.listen(t,"click",()=>{this._list.isOpen.peek()?this._refresh():"value"===d.Cu.completionContext(this._text.peek(),this._caret(),this.options.schema).expect&&this._suggest()}),this.scope.listen(t,"select",n),this.scope.listen(t,"focus",()=>{this._text.peek()===this._display(this.peek())&&(this._dirty=!1)}),this.scope.listen(t,"blur",()=>{this._list.dismiss(),this._dirty&&this.commit()}),this.effect(()=>t.setAttribute("aria-expanded",String(this._list.isOpen.value))),this.addValidator(()=>{var e,t;return null!=(e=null==(t=this._problems.value[0])?void 0:t.message)?e:null}),this.effect(()=>this._syncText()),this._searchSkin(t)}_searchSkin(e){let t=document.createElement("div");t.className="u2-input-search u2-fq-search";let n=this.createClearButton(()=>{this._list.dismiss(),this._text.value="",this.commit(),e.focus()},"Clear filter");return this.effect(()=>n.hidden=""===this._text.value),t.append(e,n),t}_syncText(){let e=this.value;null!==this._raw.peek()||this._dirty&&document.activeElement===this._input||(this._dirty=!1,this._text.value=this._display(e),this._problems.value=d.Cu.validate(e,this.options.schema,this.options.target).filter(e=>"missing-value"!==e.code))}_display(e){var t,n,r;return null!=(t=null==(n=(r=this.options).display)?void 0:n.call(r,e))?t:d.Cu.format(e)}_caret(){var e;return null!=(e=this._input.selectionStart)?e:this._text.peek().length}_suggest(){this._moved=!1,this._list.clearActive(),this._refresh()?this._list.open():this._list.dismiss()}_refresh(){var e,t;let n=d.Cu.completionContext(this._text.peek(),this._caret(),this.options.schema);this._context=n,void 0!==n.valueSpan&&void 0!==n.property&&((null==(t=n.operator)?void 0:t.id)==="under"||d.Cu.kindOf(n.property)===d.Nd.REF)&&(n.replace=n.valueSpan,n.prefix=this._text.peek().slice(n.valueSpan.start,n.valueSpan.end)),this._prefix.value=n.prefix,this._list.popup.style.marginLeft=`${this._caretOffset(n.replace.start)}px`,null==(e=this._abort)||e.abort(),this._abort=void 0;let r=n.prefix.toLowerCase(),i=e=>e.toLowerCase().startsWith(r);switch(n.expect){case"property":return this._ready(this.options.schema.properties.filter(e=>{var t;return i(e.name)||i(null!=(t=e.friendlyName)?t:"")}).map(e=>this._propertyOption(e)));case"operator":return this._ready(this._operators(n.property).map(e=>{var t;return{spelling:null!=(t=h[e.id])?t:e.id,op:e}}).filter(e=>i(e.spelling)).map(e=>({text:e.spelling,render:()=>g((0,a.Ln)(e.spelling,"u2-fq-code"),e.op.label)})));case"connector":return this._ready(["and","or"].filter(i).map(e=>({text:e,render:()=>g((0,a.Ln)(e,"u2-fq-code"))})));case"value":return this._values(n,i)}return!0}_caretOffset(e){return Math.max(0,Math.min((0,l.sc)(this._text.peek().slice(0,e),getComputedStyle(this._input).font)-this._input.scrollLeft,this._input.clientWidth-320))}_ready(e){return this._view.value=e.length>0?{kind:"ready",items:e}:{kind:"empty"},1!==e.length||"null"!==e[0].text}_operators(e){var t,n,r;if(!e)return d.Cu.operators.all().filter(e=>void 0===e.semType);let i=d.Cu.operators.for(e);return null!=(t=null==(n=(r=this.options.schema).operators)?void 0:n.call(r,e,i))?t:i}_propertyOption(e){var t;let n=null!=(t=e.friendlyName)?t:e.name;return{text:d.Cu.formatProperty(e.name),render:()=>g(n,n===e.name?void 0:e.name,(0,u.K)(c[d.Cu.kindOf(e)],{cls:"u2-fq-icon"}))}}_values(e,t){var n,r,i,o;let l=e.property,s=(l?[...null!=(n=p[d.Cu.kindOf(l)])?n:[],"null"]:["null"]).filter(t).map(e=>({text:e,render:()=>g((0,a.Ln)(e,"u2-fq-code"))})),u=l?v._rangeHint(l):null;null!==u&&s.unshift({text:"",info:!0,render:()=>g((0,a.Ln)(u,"u2-fq-info"))});let c=this.options.schema.values;if(!l||!c)return this._ready(s);let h=new AbortController;this._abort=h,this._view.value={kind:"loading"};let m=null==(r=(i=this.options.schema).renderer)?void 0:r.call(i,l),f=e=>{h.signal.aborted||(this._view.value={kind:"error",message:e instanceof Error?e.message:String(e)})};return c(l,e.prefix,h.signal,{operator:null==(o=e.operator)?void 0:o.id}).then(t=>{if(h.signal.aborted)return;let n=[...t.map(t=>({text:v._valueText(e,t.value),render:()=>{var e,n,r,i;let o,a;return o=t.value,(a=null!=(e=null==m||null==(r=m.listItem)?void 0:r.call(m,o))?e:null==m||null==(i=m.markup)?void 0:i.call(m,o))?g(a):g(null!=(n=t.label)?n:m?m.caption(o):String(o),void 0===t.count?void 0:String(t.count))}})),...s];this._ready(n)||this._list.dismiss()},f),!0}static _valueText(e,t){let n="string"==typeof t&&void 0!==e.operator&&m.has(e.operator.id);return d.Cu.formatValue(n?d.Cu.escapeLike(t):t)}static _rangeHint(e){let t=d.Cu.kindOf(e);if(t!==d.Nd.INT&&t!==d.Nd.FLOAT||void 0===e.min&&void 0===e.max)return null;let n=void 0!==e.min&&void 0!==e.max?`${e.min}–${e.max}`:void 0!==e.min?`≥ ${e.min}`:`≤ ${e.max}`;return`number ${n}`}_insert(e){var t,n;let r=this._items.peek()[e],i=this._context;if(void 0===r||r.info||!i)return!1;let o=this._text.peek(),a=/^\s/.test(o.slice(i.replace.end))?r.text:`${r.text} `,l=i.replace.start+r.text.length+1;this._dirty=!0,this._text.value=o.slice(0,i.replace.start)+a+o.slice(i.replace.end),this._input.focus();let s=this._applyPick(),u=s?this._text.peek().length:l;return this._input.value=this._text.peek(),null==(t=(n=this._input).setSelectionRange)||t.call(n,u,u),s?this._list.dismiss():this._suggest(),!0}_applyPick(){let e=this.options;return d.Cu.parse(this._text.peek(),e.schema,e.target).problems.length>0?(this._problems.value=[],!1):this.commit()}_acceptable(e){if(this._typed(e))return!1;if(this._moved)return!0;let t=this._items.peek()[e],n=this._context;if(void 0===t||void 0===n)return!1;let r=this._text.peek().slice(n.replace.start,n.replace.end).trim().toLowerCase();return""===r||t.text.toLowerCase().includes(r)}_typed(e){let t=this._items.peek()[e],n=this._context;return void 0!==t&&void 0!==n&&t.text===this._text.peek().slice(n.replace.start,n.replace.end)}_onKeyDown(e){let t=this._list.isOpen.peek();switch(e.key){case"ArrowDown":e.preventDefault(),t?(this._moved=!0,this._list.move(1)):this._suggest();break;case"ArrowUp":t&&(e.preventDefault(),this._moved=!0,this._list.move(-1));break;case"Enter":if(e.ctrlKey||e.metaKey)break;e.preventDefault(),t&&this._acceptable(this._list.activeIndex.peek())&&this._insert(this._list.activeIndex.peek())?e.stopPropagation():(this._list.dismiss(),this.commit());break;case" ":""===this._text.peek()&&(e.preventDefault(),t||this._suggest());break;case"Escape":t&&(e.stopPropagation(),this._list.dismiss());break;case"Tab":this._list.dismiss()}}constructor(e){super(e,d.Cu.group("and")),this._moved=!1,this.text=this._text,this.query=(0,r.EW)(()=>this._text.value),this.problems=this._problems,this.raw=this._raw,this.isOpen=this._list.isOpen,this.root.classList.add("u2-filter-query-input"),this.root.dataset.u2="filter-query-input"}}},136(e,t,n){n.d(t,{S:()=>a});var r=n(7974),i=n(8918),o=n(7371);class a extends r.p{createEditor(){var e;let t=this.options,n=t.prop,r=t.schema,a=null==(e=r.renderer)?void 0:e.call(r,n),l=e=>{var t;return null===e?null:{value:e,label:null!=(t=e.name)?t:e.id}},s=new i.o({source:(e,t)=>r.values(n,e,t,{operator:this.options.operator}),itemText:e=>{var t,n;return null!=(t=null!=(n=e.label)?n:null==a?void 0:a.caption(e.value))?t:String(e.value)},render:(null==a?void 0:a.listItem)?e=>a.listItem(e.value):void 0,placeholder:this.options.placeholder,debounceMs:this.options.debounceMs});return s.selected.value=l(this.peek()),this.effect(()=>{var e;let t=s.selected.value,n=null===t?null:t.value;(0,o.$y)(null!=n?n:void 0,null!=(e=this.peek())?e:void 0)||(this.value=n)}),this.effect(()=>{var e;let t=this.value,n=null==(e=s.selected.peek())?void 0:e.value;(0,o.$y)(null!=t?t:void 0,n)||(s.selected.value=l(t))}),s.root}constructor(e){super(e,null),this.root.dataset.u2="ref-input"}}},5812(e,t,n){n.d(t,{x:()=>m});var r=n(7115),i=n(7974),o=n(8609),a=n(5232),l=n(4860),s=n(6e3);function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function d(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function c(e){return"string"==typeof e?e:e.value}function p(e){return"string"==typeof e?e:e.label}let h=["ArrowUp","ArrowDown","Home","End","PageUp","PageDown"];class m extends i.p{get principals(){return this._principals.peek()}set principals(e){this.setPrincipals(e)}get principalLabel(){var e;return null!=(e=this.options.principalLabel)?e:"Group"}set principalLabel(e){this.options.principalLabel=null!=e?e:void 0,this.root.querySelector(".u2-access-grid th").textContent=this.principalLabel}get addText(){var e;return null!=(e=this.options.addText)?e:"+ add group or user…"}set addText(e){this.options.addText=null!=e?e:void 0;let t=this.root.querySelector(".u2-access-grid-add");null!==t&&(t.setAttribute("aria-label",this.addText),t.options.length>0&&(t.options[0].text=this.addText))}setPrincipals(e){this._principals.value=e}get disabled(){return super.disabled}set disabled(e){super.disabled=e,this._sweeps.value=this._sweeps.peek()+1}getItems(e){return i.p.itemsState((0,r.O8)(()=>this._rows()).map((e,t)=>u({key:e.key,label:e.label,index:t,rendered:!0},null===e.from?{}:{disabled:!0})),null==e?void 0:e.all)}displayText(){return(0,r.O8)(()=>this._rows()).filter(e=>null===e.from).map(e=>e.label).join(", ")}createEditor(){let e=this.options,t=e.principals,n=e.inherited,i=e.locked;this._capabilities=this.options.capabilities.map(e=>"string"==typeof e?{name:e,label:e.charAt(0).toUpperCase()+e.slice(1)}:e),this._principals=(0,r.vP)(Array.isArray(t)?t:[]),this._inherited=(0,r.vP)(Array.isArray(n)?n:[]),this._locked=(0,r.vP)(Array.isArray(i)?i:[]),this._sweeps=(0,r.vP)(0),this._keyNav=!1;let o=document.createElement("table");o.className="u2-access-grid",o.setAttribute("role","grid");let a=document.createElement("tr");a.append(m._cell("th",null!=(c=this.options.principalLabel)?c:"Group"));var s=!0,u=!1,d=void 0;try{for(var c,p,h=this._capabilities[Symbol.iterator]();!(s=(p=h.next()).done);s=!0){let e=p.value;a.append(m._cell("th",e.label,"u2-access-grid-cap"))}}catch(e){u=!0,d=e}finally{try{s||null==h.return||h.return()}finally{if(u)throw d}}a.append(m._cell("th","","u2-access-grid-action"));let f=document.createElement("thead");f.append(a),this._body=document.createElement("tbody");let g=m._cell("td","");g.colSpan=this._capabilities.length+2;let v=document.createElement("tr");v.append(g);let b=document.createElement("tfoot");b.append(v),o.append(f,this._body,b);let y=this.options.picker;if(void 0!==y)g.append(y(e=>this._add(e.value,e.label)));else{let e=this._select();g.append(e),this.effect(()=>this._fillPicker(e))}return this.scope.listen(this._body,"change",e=>this._onChange(e.target)),this.scope.listen(this._body,"click",e=>this._onClick(e.target)),(0,l._)(this._body,()=>this._rows(),e=>e.key,e=>this._row(e),{update:(e,t)=>this._patch(e,t)}),o}_rows(){var e;this._sweeps.value;let t=this.disabled,n=this._locked.value,r=this._principals.value,i=e=>{let t=r.find(t=>c(t)===e);return void 0===t?e:p(t)};return[...this._inherited.value.map(e=>({key:`inherited:${e.principal}`,row:e,label:i(e.principal),from:e.from,off:t,locked:n})),...(null!=(e=this.value)?e:[]).map(e=>({key:e.principal,row:e,label:i(e.principal),from:null,off:t,locked:n}))]}_row(e){let t=document.createElement("tr");t.className=null===e.from?"u2-access-grid-row":"u2-access-grid-row u2-access-grid-inherited",t.setAttribute("role","row"),t.dataset.u2Key=e.row.principal;let n=m._cell("td",""),r=null==(c=null!=(d=this.options.icon)?d:s.S.principalIcon)?void 0:c(e.row.principal);if(r){let e=(0,o.Ln)("","u2-access-grid-icon");e.append(r),n.append(e)}let i=(0,o.Ln)(e.label,"u2-access-grid-principal");i.dataset.u2Part="item-label",n.append(i),null!==e.from&&""!==e.from&&n.append((0,o.Ln)(e.from,"u2-access-grid-from")),t.append(n);var a=!0,l=!1,u=void 0;try{for(var d,c,p,h=this._capabilities[Symbol.iterator]();!(a=(p=h.next()).done);a=!0){let e=p.value,n=document.createElement("input");n.type="checkbox",n.className="u2-input-checkbox u2-access-grid-check",n.dataset.u2Key=e.name;let r=m._cell("td","","u2-access-grid-cap");r.append(n),t.append(r)}}catch(e){l=!0,u=e}finally{try{a||null==h.return||h.return()}finally{if(l)throw u}}let f=m._cell("td","","u2-access-grid-action");if(t.append(f),null===e.from){let e=document.createElement("button");e.type="button",e.className="u2-access-grid-remove",e.dataset.u2Key="remove",e.textContent="✕",f.append(e)}return this._patch(t,e),t}_patch(e,t){if((null!=(o=null==(s=e.querySelector(".u2-access-grid-from"))?void 0:s.textContent)?o:"")!==(null!=(l=t.from)?l:""))return!1;e.querySelector(".u2-access-grid-principal").textContent=t.label;var n=!0,r=!1,i=void 0;try{for(var o,l,s,u,d=e.querySelectorAll(".u2-access-grid-check")[Symbol.iterator]();!(n=(u=d.next()).done);n=!0){let e=u.value,n=this._capabilities.find(t=>t.name===e.dataset.u2Key),r=t.locked.includes(n.name);e.checked=!0===t.row.can[n.name]&&!r,e.disabled=null!==t.off||null!==t.from||r,a.B.apply(e,null!==t.off?null:null!==t.from?m.INHERITED:r?m.LOCKED:null),e.setAttribute("aria-label",`${n.label} for ${t.label}`)}}catch(e){r=!0,i=e}finally{try{n||null==d.return||d.return()}finally{if(r)throw i}}let c=e.querySelector(".u2-access-grid-remove");return null!==c&&(c.disabled=null!==t.off,c.setAttribute("aria-label",`Remove ${t.label}`)),!0}_select(){var e;let t=document.createElement("select");t.className="u2-access-grid-add",t.setAttribute("aria-label",null!=(e=this.options.addText)?e:"+ add group or user…");let n=()=>{this._keyNav=!1,this._add(t.value)};return this.scope.listen(t,"keydown",e=>{let r=e.key;"Enter"===r&&""!==t.value?(e.preventDefault(),e.stopPropagation(),n()):(h.includes(r)||1===r.length)&&!e.altKey&&(this._keyNav=!0,this.scope.setTimeout(()=>this._keyNav=!1,0))}),this.scope.listen(t,"change",()=>{this._keyNav||n()}),this.scope.listen(t,"blur",()=>{this._keyNav=!1,t.value=""}),t}_fillPicker(e){let t=new Set([...null!=(a=this.value)?a:[],...this._inherited.value].map(e=>e.principal)),n=this._principals.value;e.textContent="",e.append(new Option(null!=(l=this.options.addText)?l:"+ add group or user…",""));var r=!0,i=!1,o=void 0;try{for(var a,l,s,u=n[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){let n=s.value;t.has(c(n))||e.append(new Option(p(n),c(n)))}}catch(e){i=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(i)throw o}}e.value=""}_add(e,t){let n=null!=(d=this.peek())?d:[];if(""===e||null!==this.disabled||n.some(t=>t.principal===e))return;let i=this._locked.peek(),o=this._capabilities.find(e=>!i.includes(e.name)),a={};var l=!0,s=!1,u=void 0;try{for(var d,p,h=this._capabilities[Symbol.iterator]();!(l=(p=h.next()).done);l=!0){let e=p.value;a[e.name]=e===o}}catch(e){s=!0,u=e}finally{try{l||null==h.return||h.return()}finally{if(s)throw u}}(0,r.vA)(()=>{void 0===t||this._principals.peek().some(t=>c(t)===e)||(this._principals.value=[...this._principals.peek(),{value:e,label:t}]),this.value=[...n,{principal:e,can:a}]})}_onChange(e){var t;let n=e.dataset.u2Key,r=e.closest("tr"),i=null==r?void 0:r.dataset.u2Key;if(void 0===n||void 0===i)return;let o=r.classList.contains("u2-access-grid-inherited")||this._locked.peek().includes(n);if(null!==this.disabled||o){e.checked=!e.checked;return}this.value=(null!=(t=this.peek())?t:[]).map(t=>t.principal===i?d(u({},t),{can:d(u({},t.can),{[n]:e.checked})}):t)}_onClick(e){var t,n,r,i;let o=e.closest(".u2-access-grid-remove");if(null===o||null!==this.disabled)return;let a=o.closest("tr");if(a.contains(document.activeElement)){let e=[...this._body.querySelectorAll(".u2-access-grid-remove")],t=e.indexOf(o),a=this._body.parentElement.querySelector("tfoot").querySelector("input, select, button, [tabindex]");null==(i=null!=(n=null!=(r=e[t+1])?r:e[t-1])?n:a)||i.focus()}this.value=(null!=(t=this.peek())?t:[]).filter(e=>e.principal!==a.dataset.u2Key)}static _cell(e,t,n){let r=document.createElement(e);return r.textContent=t,void 0!==n&&(r.className=n),r}constructor(e){super(e,[]),this.root.dataset.u2="access-grid",this.liveOption("principals",e.principals,e=>this.setPrincipals(null!=e?e:[])),this.liveOption("inherited",e.inherited,e=>this._inherited.value=e),this.liveOption("locked",e.locked,e=>this._locked.value=e)}}m.INHERITED="Inherited: change it where it is granted",m.LOCKED="This capability cannot be changed here"},8195(e,t,n){n.d(t,{B:()=>u,l:()=>c});var r=n(7115),i=n(9701),o=n(9383),a=n(7974);function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function s(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}class u{static share(e,t){u._shared.set(e,t)}static around(e){for(let t=e.parentElement;null!==t;t=t.parentElement){let e=u._shared.get(t);if(void 0!==e)return e}}report(e,t){this._members.set(e,t),this._update()}leave(e){this._members.delete(e),this._update()}_update(){let e=0;var t=!0,n=!1,r=void 0;try{for(var i,o=this._members.values()[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){let t=i.value;e=Math.max(e,t)}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}this._width.value=e}constructor(){this._width=(0,r.vP)(0),this._members=new Map,this.width=this._width}}u._shared=new WeakMap;let d=new Set;class c extends i.Ec{get inputs(){return this._inputs}add(e,t){var n,r;if(void 0===e.name){let t=null!=(r=e.root.dataset.u2)?r:"input";d.has(t)||(d.add(t),console.warn(`u2: a ${t} with neither name nor label was added to a form — it has no form key and no automation id; give it a name`))}this._inputs.push(e),e.own(()=>this.remove(e)),(null!=t?t:this._rows).append(e.root);let i="choice-input"===e.root.dataset.u2?e.root.querySelector("select"):null;return null!==i&&"u">typeof MutationObserver&&(null!=(n=this._choices)?n:this._choices=new MutationObserver(()=>this._scheduleFrame())).observe(i,{childList:!0}),this._rebuildValidity(),this._scheduleAlign(),this}remove(e){let t=this._inputs.indexOf(e);return t<0||(this._inputs.splice(t,1),e.root.remove(),this.scope.isDisposed||(this._rebuildValidity(),this._scheduleAlign())),this}addAll(e){var t=!0,n=!1,r=void 0;try{for(var i,o=e[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){let e=i.value;this.add(e)}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}return this}addGroup(e,t,n){let r=document.createElement("span");r.className="u2-input-label u2-form-group-label",r.id=`${this.rootId}-group-${++c._groups}`,r.textContent=e;let i=document.createElement("div");i.className="u2-form-group-items";let o=document.createElement("div");o.className="u2-form-group",o.setAttribute("role","group"),o.setAttribute("aria-labelledby",r.id),o.append(r,i),(null!=(u=null==n?void 0:n.host)?u:this._rows).append(o);var a=!0,l=!1,s=void 0;try{for(var u,d,p=t[Symbol.iterator]();!(a=(d=p.next()).done);a=!0){let e=d.value;e.root.classList.add("u2-input-in-group"),e.root.classList.toggle("u2-input-caption-after",(null==n?void 0:n.captionsAfter)===!0),this.add(e,i)}}catch(e){l=!0,s=e}finally{try{a||null==p.return||p.return()}finally{if(l)throw s}}return this}addColumns(e,t){let n=document.createElement("div");n.className="u2-form-columns",n.dataset.u2Part="columns",(null==t?void 0:t.minWidth)!==void 0&&n.style.setProperty("--u2-form-column-min",`${t.minWidth}px`),(null==t?void 0:t.columns)!==void 0&&n.style.setProperty("--u2-form-columns",String(t.columns)),(null!=(a=null==t?void 0:t.host)?a:this._rows).append(n);var r=!0,i=!1,o=void 0;try{for(var a,l,s=e[Symbol.iterator]();!(r=(l=s.next()).done);r=!0){let e=l.value;this.add(e,n)}}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return this}addElement(e){return this._rows.append(e),this}addButtons(e,t){if(!this._buttons){var n;this._buttons=document.createElement("div"),this._buttons.className="u2-form-buttons",(null!=(n=null==t?void 0:t.host)?n:this.root).append(this._buttons)}return(null==t?void 0:t.align)!==void 0&&(this._buttons.classList.toggle("u2-form-buttons-editors","editors"===t.align),this._buttons.classList.toggle("u2-form-buttons-start","start"===t.align)),e(this._buttons),this}focusFirst(e){var t;let n=null!=(t=void 0===e?void 0:this._inputs.find(e))?t:this._inputs[0];null==n||n.focus()}validate(){let e;var t=!0,n=!1,r=void 0;try{for(var i,o=this._inputs[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){let t=i.value;t.validates&&(t.touch(),void 0===e&&null!==t.validity.peek()&&(e=t))}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}return null==e||e.focus(),void 0===e}getState(){let e=this.validity.peek();return s(l({},super.getState()),{valid:null===e,error:e})}getItems(e){let t=this._inputs.map((e,t)=>{var n;return s(l({key:null!=(n=e.name)?n:`#${t}`,label:e.label,index:t},null!==e.validity.peek()?{invalid:!0}:{},null===e.disabled?{}:{disabled:!0}),{rendered:e.root.isConnected})});return a.p.itemsState(t,null==e?void 0:e.all)}getValues(){let e={};var t=!0,n=!1,r=void 0;try{for(var i,o=this._inputs[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){let t=i.value;t.name&&(e[t.name]=t.peek())}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}return e}setValues(e){(0,r.vA)(()=>{var t=!0,n=!1,r=void 0;try{for(var i,o=this._inputs[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){let t=i.value;t.name&&t.name in e&&(t.value=e[t.name])}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}})}_rebuildValidity(){let e=this._inputs.slice(),t=t=>(0,r.EW)(()=>{var n=!0,r=!1,i=void 0;try{for(var o,a=e[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){let e=o.value,n=e.validates?t(e):null;if(n)return n}}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}return null}),n=(e,t)=>null!==t&&e.label?`${e.label}: ${t}`:t;(0,r.vA)(()=>{this._first.value=t(e=>e.validity.value),this._firstShown.value=t(e=>e.error.value),this._firstNamed.value=t(e=>n(e,e.validity.value)),this._firstShownNamed.value=t(e=>n(e,e.error.value))})}_onKeyDown(e){if("Enter"!==e.key||e.defaultPrevented||e.target instanceof HTMLTextAreaElement)return;let t=e.target,n=this._inputs.findIndex(e=>e.root.contains(t));n<0||n===this._inputs.length-1||(e.preventDefault(),this._inputs[n+1].focus())}_scheduleAlign(){this._queued||(this._queued=!0,queueMicrotask(()=>{this._queued=!1,this._alignLabels()}))}_scheduleFrame(){this._frame||(this._frame=requestAnimationFrame(()=>{this._frame=0,this._alignLabels()}))}layoutNow(){this._alignLabels()}_join(e){this._column=e,this.own(()=>e.leave(this)),this.effect(()=>{let t=e.width.value;t>0&&(0,r.O8)(()=>this._applyLabelWidth(t))})}_alignLabels(){var e,t,n;if("tall"===this._layout||this.scope.isDisposed)return;if(void 0!==this._labelWidth)return void this._applyLabelWidth(this._labelWidth);if(this._joins&&void 0===this._column){let e=u.around(this.root);void 0!==e&&this._join(e)}let r=this._measureLabels();null==(t=this._column)||t.report(this,r),this._applyLabelWidth(null!=(e=null==(n=this._column)?void 0:n.width.peek())?e:r)}_measureLabels(){this._tallBeforeMeasure||(this._tallBeforeMeasure=this.root.classList.contains("u2-form-tall")),this.root.classList.remove("u2-form-tall"),this.root.style.setProperty("--u2-form-label-width","0px"),this.root.classList.add("u2-form-measuring");let e=[...this.root.querySelectorAll(".u2-form-group-label")];var t=!0,n=!1,r=void 0;try{for(var i,o=this._inputs[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){let t=i.value;t.root.classList.contains("u2-input-caption-after")||t.root.classList.contains("u2-input-in-group")||e.push(...t.root.querySelectorAll(".u2-input-label, .ui-input-label"))}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}let a=0;var l=!0,s=!1,u=void 0;try{for(var d,p,h=e[Symbol.iterator]();!(l=(p=h.next()).done);l=!0){let e=p.value,t=Math.max(e.offsetWidth,Math.ceil(e.getBoundingClientRect().width));t?this._labelMemo.set(e,t):t=null!=(d=this._labelMemo.get(e))?d:c._textWidth(e),a=Math.max(a,t)}}catch(e){s=!0,u=e}finally{try{l||null==h.return||h.return()}finally{if(s)throw u}}return this.root.classList.remove("u2-form-measuring"),a}_applyLabelWidth(e){var t;if(this.scope.isDisposed)return;let n=this.root.classList.contains("u2-form-tall")||this._tallBeforeMeasure;if(this._tallBeforeMeasure=!1,this.root.classList.remove("u2-form-tall"),e?this.root.style.setProperty("--u2-form-label-width",`${e}px`):this.root.style.removeProperty("--u2-form-label-width"),c.fitChoices(this.root,this._inputs.map(e=>e.root)),"auto"!==this._layout)return;if(null!==this.root.closest(".u2-dialog")||(null==(t=this.root.parentElement)?void 0:t.closest(".u2-form"))!=null)return void this.root.classList.remove("u2-form-wide");let r=c._pickLayout(this.root.clientWidth,e,this._minEditorWidth(),n?"tall":this.root.classList.contains("u2-form-wide")?"wide":"normal");this.root.classList.toggle("u2-form-tall","tall"===r),this.root.classList.toggle("u2-form-wide","wide"===r)}static _textWidth(e){var t,n;let r=null!=(t=e.textContent)?t:"";if(""===r||!e.isConnected)return 0;let i=getComputedStyle(e),a=i.font||`${i.fontSize} ${i.fontFamily}`,l=(0,o.sc)(r,a);if(0===l)return 0;let s=l+(parseFloat(i.paddingLeft)||0)+(parseFloat(i.paddingRight)||0);return(null==(n=e.parentElement)?void 0:n.classList.contains("u2-input-required"))&&(s+=(0,o.sc)("*",a)+(parseFloat(getComputedStyle(e,"::after").marginLeft)||0)),Math.ceil(s)}static _pickLayout(e,t,n,r){return e<=0?r:e-t<n?"tall":e-t>n+10?"wide":r}_minEditorWidth(){if(void 0===this._minEditor){let e=parseFloat(getComputedStyle(this.root).getPropertyValue("--dg-form-min-editor-width"));if(!Number.isFinite(e))return 150;this._minEditor=e}return this._minEditor}static fitChoices(e,t){if(!e.isConnected)return;let n=document.createElement("span");n.style.cssText="position: absolute; visibility: hidden; white-space: pre; padding: 0; margin: 0;",e.append(n);var r=!0,i=!1,o=void 0;try{for(var a,l=t[Symbol.iterator]();!(r=(a=l.next()).done);r=!0){let e=a.value;if("choice-input"!==e.dataset.u2)continue;let t=40;var s=!0,u=!1,d=void 0;try{for(var c,p=e.querySelectorAll("option")[Symbol.iterator]();!(s=(c=p.next()).done);s=!0)n.textContent=c.value.textContent,t=Math.max(t,Math.ceil(n.getBoundingClientRect().width))}catch(e){u=!0,d=e}finally{try{s||null==p.return||p.return()}finally{if(u)throw d}}e.style.setProperty("--u2-choice-width",`${Math.min(t+30,.8*innerWidth)}px`)}}catch(e){i=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}n.remove()}constructor(e){var t;let n=void 0===e?{}:e;super(),this._rows=document.createElement("div"),this._inputs=[],this._first=(0,r.vP)((0,r.EW)(()=>null)),this._firstShown=(0,r.vP)((0,r.EW)(()=>null)),this._firstNamed=(0,r.vP)((0,r.EW)(()=>null)),this._firstShownNamed=(0,r.vP)((0,r.EW)(()=>null)),this._frame=0,this._queued=!1,this._tallBeforeMeasure=!1,this._labelMemo=new WeakMap,this.validity=(0,r.EW)(()=>this._first.value.value),this.error=(0,r.EW)(()=>this._firstShown.value.value),this.problem=(0,r.EW)(()=>this._firstNamed.value.value),this.shownProblem=(0,r.EW)(()=>this._firstShownNamed.value.value),this.root.classList.add("u2-form"),this.root.dataset.u2="form",this._layout=null!=(t=n.layout)?t:"auto",this._labelWidth=n.labelWidth,void 0!==this._labelWidth&&this.root.style.setProperty("--u2-form-label-width",`${this._labelWidth}px`),this._joins=void 0===n.labelColumn,n.labelColumn&&this._join(n.labelColumn),void 0!==n.maxWidth&&this.root.style.setProperty("--u2-form-max-width",`${n.maxWidth}px`),"compact"===n.density&&(this.root.dataset.dgDensity="compact"),"auto"===this._layout&&this.root.classList.add("u2-form-auto"),"wide"===this._layout&&this.root.classList.add("u2-form-wide"),"tall"===this._layout&&this.root.classList.add("u2-form-tall"),n.quiet&&this.root.classList.add("u2-quiet");const i=n.captionAlign;i instanceof r.HN?this.effect(()=>this.root.classList.toggle("u2-form-captions-left","left"===i.value)):"left"===i&&this.root.classList.add("u2-form-captions-left"),this._rows.className="u2-form-rows",this.root.append(this._rows);const o=e=>this._onKeyDown(e);if(this.root.addEventListener("keydown",o),this.own(()=>this.root.removeEventListener("keydown",o)),this.own(()=>{var e;this._frame&&cancelAnimationFrame(this._frame),null==(e=this._choices)||e.disconnect()}),"tall"!==this._layout&&"u">typeof ResizeObserver){const e=new ResizeObserver(()=>this._scheduleFrame());e.observe(this.root),this.own(()=>e.disconnect())}}}c._groups=0},5113(e,t,n){n.d(t,{Y:()=>y});var r=n(7115),i=n(9701),o=n(1518),a=n(7974),l=n(4860),s=n(9383),u=n(8049),d=n(5363),c=n(6050),p=n(4653),h=n(2570);function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function g(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function v(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,i=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var o=[],a=!0,l=!1;try{for(i=i.call(e);!(a=(n=i.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==i.return||i.return()}finally{if(l)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return m(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return m(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}let b=0;class y extends i.Ec{get properties(){return this._groups.peek().flatMap(e=>v(e,2)[1])}set properties(e){this.setProperties(null!=e?e:[],this.values.peek())}setProperties(e,t){(0,r.vA)(()=>{this.values.value=f({},t),this._groups.value=y._group(e)})}getItems(e){let t=new Set;var n=!0,r=!1,i=void 0;try{for(var o,l=this.root.querySelectorAll(".u2-propgrid-row")[Symbol.iterator]();!(n=(o=l.next()).done);n=!0){let e=o.value;t.add(e.dataset.u2Item)}}catch(e){r=!0,i=e}finally{try{n||null==l.return||l.return()}finally{if(r)throw i}}let u=this._groups.peek().flatMap(e=>v(e,2)[1]).map((e,n)=>g(f({key:e.name,label:(0,s.Hh)(e.name),index:n},e.readonly?{disabled:!0}:{}),{rendered:t.has(e.name)}));return a.p.itemsState(u,null==e?void 0:e.all)}_group(e){let t=document.createElement("div");t.className="u2-propgrid-section",t.setAttribute("role","rowgroup");let n=document.createElement("div");n.className="u2-propgrid-group",e&&(n.id=`${this._idPrefix}-${this._groupId++}`,t.append(this._createHeader(e,n,o.HG.ambient))),t.append(n);let i=(0,r.EW)(()=>{var t,n;return null!=(t=null==(n=this._groups.value.find(t=>v(t,1)[0]===e))?void 0:n[1])?t:[]});return(0,l._)(n,i,e=>e.name,e=>this._createRow(e,o.HG.ambient),{update:(e,t)=>{let n=y._sameRow(this._shown.get(e),t);return n&&this._shown.set(e,t),n}}),t}_createHeader(e,t,n){let i=this._collapsed.get(e);i||(i=(0,r.vP)(!1),this._collapsed.set(e,i));let o=i,a=document.createElement("div");a.className="u2-propgrid-category",a.dataset.u2Part="category",a.tabIndex=0,a.title=e,a.setAttribute("role","button"),a.setAttribute("aria-controls",t.id);let l=document.createElement("span");l.className="u2-propgrid-chevron",l.textContent="▸";let s=document.createElement("span");s.className="u2-propgrid-category-title",s.textContent=e,a.append(l,s),n.effect(()=>{let e=o.value;a.setAttribute("aria-expanded",String(!e)),t.style.display=e?"none":""});let u=()=>o.value=!o.peek();return n.listen(a,"click",u),n.listen(a,"keydown",e=>{let t=e.key;("Enter"===t||" "===t)&&(e.preventDefault(),u())}),a}_createRow(e,t){let n=document.createElement("div");this._shown.set(n,e),n.className="u2-propgrid-row",n.setAttribute("role","row"),n.dataset.u2Name=e.name;let i=document.createElement("div");i.className="u2-propgrid-name",i.setAttribute("role","rowheader"),i.dataset.u2Part="item-label",i.textContent=(0,s.Hh)(e.name),e.description&&(i.title=e.description);let o=document.createElement("div");o.className="u2-propgrid-editor",o.setAttribute("role","gridcell"),n.append(i,o);let a=(0,r.EW)(()=>this.values.value[e.name]);if(e.readonly){n.classList.add("u2-propgrid-row-readonly"),n.setAttribute("aria-readonly","true");let e=document.createElement("span");return e.className="u2-propgrid-value",o.append(e),t.effect(()=>e.textContent=(0,s.Qq)(a.value)),n}let l=this._createInput(e);return o.append(l.root),this._bridge(e,l,a,t),n}_createInput(e){switch(e.type){case"bool":return new c.d({inline:!0});case"choice":var t;return new p.o({inline:!0,items:null!=(t=e.choices)?t:[]});case"int":case"double":return new d.Q({inline:!0,mode:"int"===e.type?"int":"float",min:e.min,max:e.max});case"string_list":return new h.Z({inline:!0,placeholder:e.description});default:return new u.k({inline:!0})}}_bridge(e,t,n,i){i.effect(()=>t.value=y._coerce(e,n.value)),i.effect(()=>{let n=t.value,i=this.values.peek();if(y.same(e,y._coerce(e,i[e.name]),n))return;this.values.value=g(f({},i),{[e.name]:n});let o={name:e.name,value:n};(0,r.O8)(()=>{var e;null==(e=this._onChange)||e.call(this,o,this),this.fireEvent("change",o)})})}static _sameRow(e,t){var n,r;return e===t||void 0!==e&&e.type===t.type&&!!e.readonly==!!t.readonly&&e.min===t.min&&e.max===t.max&&e.description===t.description&&(null!=(n=e.choices)?n:[]).join("\n")===(null!=(r=t.choices)?r:[]).join("\n")}static _group(e){let t=new Map;t.set("",[]);var n=!0,r=!1,i=void 0;try{for(var o,a,l=e[Symbol.iterator]();!(n=(a=l.next()).done);n=!0){let e=a.value,n=null!=(o=e.category)?o:"",r=t.get(n);r||(r=[],t.set(n,r)),r.push(e)}}catch(e){r=!0,i=e}finally{try{n||null==l.return||l.return()}finally{if(r)throw i}}return[...t].filter(e=>v(e,2)[1].length>0)}static _coerce(e,t){switch(e.type){case"bool":return!0===t;case"int":case"double":{if("number"==typeof t)return t;let e=null==t||""===t?NaN:Number(t);return isFinite(e)?e:null}case"choice":return null==t?null:String(t);case"string_list":return Array.isArray(t)&&t.every(e=>"string"==typeof e)?t:[];default:return(0,s.Qq)(t)}}static same(e,t,n){return"string_list"===e.type&&Array.isArray(t)&&Array.isArray(n)?t.length===n.length&&t.every((e,t)=>e===n[t]):t===n}constructor(e){let t=void 0===e?{}:e;super(),this.values=(0,r.vP)({}),this._idPrefix=`u2-propgrid-${++b}`,this._collapsed=new Map,this._groups=(0,r.vP)([]),this._shown=new WeakMap,this._groupId=0,this._onChange=t.onChanged&&a.p.bindOwned(t.onChanged,{owner:this.scope}),this.root.classList.add("u2-propgrid"),this.root.dataset.u2="property-grid",this.root.setAttribute("role","grid"),this.build(()=>(0,l._)(this.root,this._groups,e=>{let t=v(e,1)[0];return`category:${t}`},e=>{let t=v(e,1)[0];return this._group(t)},{update:()=>!0}))}}},4969(e,t,n){n.d(t,{G:()=>l});var r=n(7974),i=n(7115),o=n(9383);let a=/^[+-]?\d+$/;class l extends r.p{static parse(e){let t=e.trim();return""===t?null:a.test(t)?BigInt(t):void 0}createEditor(){var e;this._bad=(0,i.vP)(!1);let t=document.createElement("input");this._input=t,t.type="text",t.autocomplete="off",t.inputMode="numeric",t.placeholder=null!=(e=this.options.placeholder)?e:"";let n=!1;return this.effect(()=>{let e=this.value;n?n=!1:t.value=(0,o.Qq)(e)}),this.scope.listen(t,"input",()=>{let e=l.parse(t.value);if(this._bad.value=void 0===e,void 0===e||"change"===this.options.commitOn)return;let r=this.peek();this.value=e,n=!Object.is(this.peek(),r)}),this.scope.listen(t,"blur",()=>this._commit()),this.scope.listen(t,"keydown",e=>{"Enter"===e.key&&this._commit()}),this.addValidator(()=>this._bad.value?"Not an integer":null),t}get unreadable(){return this._bad.value}_commit(){let e=l.parse(this._input.value);void 0!==e&&(this.value=e,this._input.value=(0,o.Qq)(this.peek()))}constructor(e){super(void 0===e?{}:e,null),this.root.dataset.u2="bigint-input"}}},6050(e,t,n){n.d(t,{d:()=>i});var r=n(7974);class i extends r.p{getState(){var e,t;return e=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},super.getState()),t=t={checked:!0===this.peek()},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}createEditor(){let e=document.createElement("span");return e.className="u2-input-bool",e.append(this.options.switch?this._createSwitch():this._createCheckbox()),e}_createCheckbox(){let e=document.createElement("input");return e.type="checkbox",e.className="u2-input-checkbox",this.effect(()=>e.checked=!0===this.value),this.scope.listen(e,"change",()=>this.value=e.checked),e}_createSwitch(){let e=document.createElement("span");e.className="u2-input-switch",e.tabIndex=0,e.setAttribute("role","switch");let t=document.createElement("span");return t.className="u2-input-switch-thumb",e.append(t),this.effect(()=>{let t=!0===this.value;e.classList.toggle("u2-input-switch-on",t),e.setAttribute("aria-checked",String(t))}),this.scope.listen(e,"click",()=>this._toggle()),this.scope.listen(e,"keydown",e=>{let t=e.key;(" "===t||"Enter"===t)&&(e.preventDefault(),this._toggle())}),e}_toggle(){null!==this.disabled||this.readOnly||(this.value=!this.peek())}constructor(e){let t=void 0===e?{}:e;super(t,!1),this.root.dataset.u2="bool-input",t.captionAfter&&this.root.classList.add("u2-input-caption-after"),t.switch&&this.scope.listen(this.root,"click",e=>{null!==e.target.closest('[data-u2-part="label"]')&&this._toggle()})}}},8770(e,t,n){n.d(t,{z:()=>u});var r=n(7974),i=n(7115),o=n(8609),a=n(4860),l=n(7036);function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}class u extends r.p{get order(){return this._order}get items(){return this._items.peek()}set items(e){this.setItems(e)}setItems(e){var t;let n=e.map(u._value),r=this._order.peek().filter(e=>n.includes(e));this._items.value=e,this._order.value=this.options.orderable?[...r,...n.filter(e=>!r.includes(e))]:n;let i=null!=(t=this.peek())?t:[],o=i.filter(e=>n.includes(e));o.length!==i.length&&this.systemWrite(o)}move(e,t){this._place(e,t),this._commit()}getItems(e){var t;let n=new Set(null!=(t=this.peek())?t:[]);return r.p.itemsState(this._order.peek().map((e,t)=>({key:e,label:this._label(e),index:t,checked:n.has(e),selected:n.has(e),rendered:!0})),null==e?void 0:e.all)}displayText(){var e;return(null!=(e=this.peek())?e:[]).map(e=>this._label(e)).join(", ")}createEditor(){var e;let t=this.options.items,n=this._list=(0,o.y4)([],"u2-checklist");n.setAttribute("role","list"),this._items=(0,i.vP)(t instanceof i.HN?t.peek():t);let r=this._items.peek().map(u._value),l=(null!=(e=this.peek())?e:[]).filter(e=>r.includes(e));if(this._order=(0,i.vP)(this.options.orderable?[...l,...r.filter(e=>!l.includes(e))]:r),(0,a._)(n,this._order,e=>e,e=>this._row(e),{empty:()=>{var e;return(0,o.Ln)(null!=(e=this.options.emptyText)?e:"No items","u2-checklist-empty")}}),t instanceof i.HN){let e=!0;this.effect(()=>{let n=t.value;e||(0,i.O8)(()=>this.setItems(n)),e=!1})}return this.options.orderable&&this.effect(()=>{var e;let t=(null!=(e=this.value)?e:[]).filter(e=>this._order.peek().includes(e));this._order.peek().filter(e=>t.includes(e)).some((e,n)=>e!==t[n])&&(this._order.value=[...t,...this._order.peek().filter(e=>!t.includes(e))])}),n}_row(e){let t=(0,o.y4)([],"u2-checklist-item");if(t.setAttribute("role","listitem"),this.options.orderable){let e=l._.handle();t.append(e),l._.wire(t,e,()=>Array.from(this._list.children),(e,t)=>this._place(e,t),()=>this._commit())}let n=document.createElement("input");n.type="checkbox",n.className="u2-input-checkbox",n.value=e;let r=document.createElement("label");r.className="u2-checklist-label";let i=(0,o.Ln)(this._label(e));return i.dataset.u2Part="item-label",r.append(n,i),t.append(r),(0,o.QZ)(()=>{var t;n.checked=(null!=(t=this.value)?t:[]).includes(e)}),(0,o.on)(n,"change",()=>this._commit()),n.disabled=null!==this.disabled,t}_place(e,t){var n;let r=this._order.peek().slice(),i=(function(e){if(Array.isArray(e))return e}(n=r.splice(e,1))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var i=[],o=!0,a=!1;try{for(r=r.call(e);!(o=(t=r.next()).done)&&(i.push(t.value),1!==i.length);o=!0);}catch(e){a=!0,n=e}finally{try{o||null==r.return||r.return()}finally{if(a)throw n}}return i}}(n)||function(e){if(e){if("string"==typeof e)return s(e,1);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return s(e,1)}}(n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0];r.splice(t,0,i),this._order.value=r}_commit(){var e;let t=new Set(Array.from(this._list.querySelectorAll(".u2-input-checkbox")).filter(e=>e.checked).map(e=>e.value)),n=this._order.peek().filter(e=>t.has(e)),r=null!=(e=this.peek())?e:[];(n.length!==r.length||n.some((e,t)=>e!==r[t]))&&(this.value=n)}_label(e){let t=this._items.peek().find(t=>u._value(t)===e);return void 0===t?e:"string"==typeof t?t:t.label}static _value(e){return"string"==typeof e?e:e.value}constructor(e){super(e,[]),this.root.dataset.u2="checklist-input"}}},6205(e,t,n){n.d(t,{a:()=>s});var r=n(7115),i=n(7974),o=n(4860);function a(e){return"string"==typeof e?e:e.value}function l(e){return"string"==typeof e?e:e.label}class s extends i.p{get items(){return this._items.peek()}get emptyText(){var e;return null!=(e=this.options.emptyText)?e:"No items"}set emptyText(e){this.options.emptyText=null!=e?e:void 0;let t=this.root.querySelector(".u2-chips-empty");null!==t&&(t.textContent=this.emptyText)}set items(e){this.setItems(e)}setItems(e){var t;this._items.value=e;let n=new Set(e.map(a)),r=null!=(t=this.peek())?t:[],i=r.filter(e=>n.has(e));i.length!==r.length&&this.systemWrite(i)}getItems(e){let t=new Set(this.peek());return i.p.itemsState(this._items.peek().map((e,n)=>({key:a(e),label:l(e),index:n,selected:t.has(a(e)),rendered:!0})),null==e?void 0:e.all)}displayText(){let e=new Set(this.peek());return this._items.peek().filter(t=>e.has(a(t))).map(l).join(", ")}createEditor(){this._items=(0,r.vP)(this.options.items);let e=document.createElement("div");return e.className="u2-chips",e.setAttribute("role","group"),this.scope.listen(e,"click",e=>{let t=e.target.closest(".u2-chips-chip");null!==t&&null===this.disabled&&this._toggle(t.dataset.value)}),(0,o._)(e,this._items,e=>a(e),e=>this._chip(e),{update:(e,t)=>{e.querySelector('[data-u2-part="item-label"]').textContent=l(t)},empty:()=>{var e;let t=document.createElement("span");return t.className="u2-chips-empty",t.textContent=null!=(e=this.options.emptyText)?e:"No items",t}}),this.effect(()=>{let t=new Set(this.value);var n=!0,r=!1,i=void 0;try{for(var o,a=e.querySelectorAll(".u2-chips-chip")[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){let e=o.value;s._press(e,t.has(e.dataset.value))}}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}}),e}_chip(e){let t=document.createElement("button");t.type="button",t.className="u2-chips-chip",t.setAttribute("role","button"),t.dataset.value=a(e);let n=document.createElement("span");return n.dataset.u2Part="item-label",n.textContent=l(e),t.append(n),t.disabled=null!==this.disabled,s._press(t,new Set(this.peek()).has(a(e))),t}_toggle(e){let t=new Set(this.peek());t.has(e)?t.delete(e):t.add(e),this.value=this._items.peek().map(a).filter(e=>t.has(e))}static _press(e,t){e.classList.toggle("u2-chips-chip-on",t),e.setAttribute("aria-pressed",String(t))}constructor(e){super(e,[]),this.root.dataset.u2="chips-input"}}},4291(e,t,n){n.d(t,{k:()=>c});var r=n(7115),i=n(9701),o=n(7974),a=n(5232),l=n(4977),s=n(9947),u=n(169);function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}class c extends i.Ec{get value(){return this.signal.value}set value(e){this.signal.value=e}peek(){return this.signal.peek()}follow(e){return this.effect(()=>{let t=e();Object.is(t,this.signal.peek())||(this.signal.value=t)})}get disabled(){return a.B.now(this._options.disabled)}get isOpen(){var e;return(null==(e=this._menu)?void 0:e.isOpen.peek())===!0}getItems(e){let t=this.signal.peek();return o.p.itemsState(this._items.peek().map(c._item).map((e,n)=>({key:e.value,label:e.label,index:n,selected:e.value===t,checked:e.value===t,rendered:!0})),null==e?void 0:e.all)}getState(){var e,t;let n=this.validity.peek();return e=d({},super.getState()),t=t={value:this.signal.peek(),text:this._text.peek(),valid:null===n,error:n,open:this.isOpen},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}accessibleLabel(){return this._options.label||super.accessibleLabel()}_toggle(){this.isOpen?this._menu.close():null===this.disabled&&(this._menu=this.build(()=>this._buildMenu()),this._menu.show({anchor:this.root}))}_buildMenu(){let e=u.W.popup(),t=this.signal.peek();var n=!0,r=!1,i=void 0;try{for(var o,a=this._items.peek().map(c._item)[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){let n=o.value;e.item(n.label,()=>this._pick(n.value),d({check:n.value===t},void 0===n.description?{}:{detail:n.description}))}}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}let l=this._options.actions,s="function"==typeof l?l():null!=l?l:[];s.length>0&&e.separator();var p=!0,h=!1,m=void 0;try{for(var f,g=s[Symbol.iterator]();!(p=(f=g.next()).done);p=!0){let t=f.value;e.item(t.text,t.run,{disabled:t.disabled,shortcut:t.shortcut,detail:t.detail,check:t.check})}}catch(e){h=!0,m=e}finally{try{p||null==g.return||g.return()}finally{if(h)throw m}}return e}_pick(e){var t;Object.is(e,this.signal.peek())||(this.signal.value=e,null==(t=this._onInput)||t.call(this,e,this))}static _item(e){return"string"==typeof e?{value:e,label:e}:e}constructor(e){var t,n;super(a.B.focusable(document.createElement("button"))),this._options=e;const i=this.root;i.type="button",i.classList.add("u2-choice-chip"),i.dataset.u2="choice-chip",i.setAttribute("aria-haspopup","menu"),i.setAttribute("aria-expanded","false"),void 0!==e.name&&(this.name=e.name),this.signal=null!=(t=e.bind)?t:(0,r.vP)(null!=(n=e.value)?n:null);const u=e.items;this._items=u instanceof r.HN?u:(0,r.vP)(u),this.validity=(0,r.EW)(()=>a.B.read(e.invalid));const d=(0,r.EW)(()=>{var e;let t=this.signal.value;return null!=(e=this._items.value.map(c._item).find(e=>e.value===t))?e:null});this._text=(0,r.EW)(()=>{var t,n,i;return null!=(t=null!=(n=e.valueText instanceof r.HN?e.valueText.value:e.valueText)?n:null==(i=d.value)?void 0:i.label)?t:"–"});const p=(0,r.EW)(()=>{var t,n,i;return null!=(t=null!=(n=e.description instanceof r.HN?e.description.value:e.description)?n:null==(i=d.value)?void 0:i.description)?t:null});this._onInput=void 0===e.onInput?void 0:o.p.bindOwned(e.onInput,{owner:this.scope});const h=document.createElement("span");if(h.className="u2-choice-chip-value",h.dataset.u2Part="value",e.label){const t=document.createElement("span");t.className="u2-choice-chip-label",t.dataset.u2Part="label",t.textContent=e.label,i.append(t," ")}const m=(0,s.K)("chevron-down",{cls:"u2-choice-chip-caret"});m.setAttribute("aria-hidden","true"),i.append(h,m);const f=(0,r.EW)(()=>{var e;return null!=(e=this.validity.value)?e:p.value});this.effect(()=>{var t;h.textContent=this._text.value;let n=a.B.read(e.disabled),r=this.validity.value;if(a.B.apply(i,n),null===n){let e=f.value;null===e?i.removeAttribute("aria-description"):i.setAttribute("aria-description",e)}i.classList.toggle("u2-choice-chip-invalid",null!==r),i.setAttribute("aria-invalid",String(null!==r)),null!==n&&(null==(t=this._menu)||t.close())});const g=e.active;void 0!==g&&this.effect(()=>i.classList.toggle("u2-choice-chip-active",g instanceof r.HN?g.value:g)),l.m.bind(i,()=>{var t;let n=a.B.now(e.disabled);if(null!==n)return n;let r=null!=(t=f.peek())?t:this._text.peek();return e.label?`${e.label}: ${r}`:r},{owner:this.scope}),this.scope.listen(i,"click",()=>this._toggle()),this.scope.listen(i,"keydown",e=>{"ArrowDown"!==e.key||this.isOpen||(e.preventDefault(),this._toggle())}),this.own(()=>{var e;return null==(e=this._menu)?void 0:e.close()})}}},4653(e,t,n){n.d(t,{F:()=>p,o:()=>d});var r=n(7115),i=n(1518),o=n(7974),a=n(9947);function l(e){return"string"==typeof e?e:e.value}function s(e){return"string"==typeof e?e:e.label}function u(e){return e.every(e=>null!=e)?e:(i._U.report("item-null","a choice list holds a null item, which is skipped: pass strings or {value, label} items (for open tables, `Platform.tableNames()`)"),e.filter(e=>null!=e))}class d extends o.p{get items(){return this._items}set items(e){this.setItems(e)}setItems(e){var t;this._items=u(e),this._fill();let n=this.peek();this.systemWrite(null!==n&&this._items.some(e=>l(e)===n)?n:null),this._select.value=null!=(t=this.peek())?t:""}getItems(e){let t=this.peek();return o.p.itemsState(this._items.map((e,n)=>({key:l(e),label:s(e),index:n,selected:l(e)===t,rendered:!0})),null==e?void 0:e.all)}createEditor(){let e=document.createElement("select");this._select=e;let t=this.options.items;return this._items=u(t instanceof r.HN?t.peek():t),this._fill(),this.scope.listen(e,"change",()=>this.value=""===e.value?null:e.value),this.effect(()=>{var t;return e.value=null!=(t=this.value)?t:""}),e}_fill(){let e,t=this._select;if(t.textContent="",0===this._items.length&&void 0!==this.options.emptyText){let e=new Option(this.options.emptyText,"");e.disabled=!0,e.selected=!0,t.append(e);return}this.nullable&&t.append(new Option("",""));let n=t;var r=!0,i=!1,o=void 0;try{for(var a,u=this._items[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){let r=a.value,i="string"==typeof r?void 0:r.group;i!==e&&(e=i,(n=void 0===i?t:Object.assign(document.createElement("optgroup"),{label:i}))!==t&&t.append(n)),n.append(new Option(s(r),l(r)))}}catch(e){i=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(i)throw o}}}constructor(e){super(e,null),this.root.dataset.u2="choice-input";const t=e.items;if(t instanceof r.HN){let e=!0;this.effect(()=>{let n=t.value;e||(0,r.O8)(()=>this.setItems(n)),e=!1})}}}let c=0;class p extends o.p{get emptyText(){var e;return null!=(e=this.options.emptyText)?e:"No items"}set emptyText(e){this.options.emptyText=null!=e?e:void 0;let t=this._itemsHost.querySelector(".u2-multi-choice-empty");null!==t&&(t.textContent=this.emptyText)}get disabled(){return super.disabled}set disabled(e){super.disabled=e,void 0!==this._summaryToggle&&(this._summaryToggle.tabIndex=null===this.disabled?0:-1)}get items(){return this._items}set items(e){this.setItems(e)}getItems(e){var t;let n=new Set(null!=(t=this.peek())?t:[]);return o.p.itemsState(this._items.map((e,t)=>{let r=n.has(l(e));return{key:l(e),label:s(e),index:t,checked:r,selected:r,rendered:!0}}),null==e?void 0:e.all)}displayText(){var e;let t=new Set(null!=(e=this.peek())?e:[]);return this._items.filter(e=>t.has(l(e))).map(s).join(", ")}get expanded(){return this._expanded}setItems(e){var t;this._fill(e);let n=new Set(null!=(t=this.peek())?t:[]),r=this._items.filter(e=>n.has(l(e))).map(l);r.length!==n.size&&this.systemWrite(r)}createEditor(){let e=document.createElement("div");return e.className="u2-multi-choice",e.setAttribute("role","group"),this._itemsHost=e,this.options.showSummaryCheckbox&&this._buildSummary(e),this._fill(this.options.items),this.scope.listen(e,"change",e=>{this._summaryBox&&e.target===this._summaryBox?0===this._items.length?this._updateSummary():this.value=this._summaryBox.checked?this._items.map(l):[]:this.value=this._boxes.filter(e=>e.checked).map(e=>e.value)}),this.effect(()=>{let e=new Set(null!=(i=this.value)?i:[]);var t=!0,n=!1,r=void 0;try{for(var i,o,a=this._boxes[Symbol.iterator]();!(t=(o=a.next()).done);t=!0){let t=o.value;t.checked=e.has(t.value)}}catch(e){n=!0,r=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw r}}this._updateSummary()}),e}_buildSummary(e){let t=document.createElement("div");t.className="u2-multi-choice-summary";let n=document.createElement("input");n.type="checkbox",n.className="u2-input-checkbox",this._summaryBox=n;let i=document.createElement("span");i.className="u2-multi-choice-summary-text",i.id=`u2-multi-choice-summary-${++c}`,n.setAttribute("aria-labelledby",i.id),this._summaryText=i;let o=document.createElement("span");o.className="u2-multi-choice-chevron",o.append((0,a.Z)("chevron-down"));let l=document.createElement("span");l.className="u2-multi-choice-summary-toggle",l.tabIndex=0,l.setAttribute("role","button"),l.setAttribute("aria-label","Collapse list"),l.append(i,o),t.append(n,l);let s=document.createElement("div");s.className="u2-multi-choice-items",e.append(t,s),this._itemsHost=s,this._summaryToggle=l;let u=(0,r.vP)(!0);this._expanded=u;let d=()=>{null===this.disabled&&(u.value=!u.peek())};this.scope.listen(l,"click",d),this.scope.listen(l,"keydown",e=>{let t=e.key;("Enter"===t||" "===t)&&(e.preventDefault(),d())}),this.effect(()=>{let e=u.value;l.setAttribute("aria-expanded",String(e)),s.style.display=e?"":"none"})}_updateSummary(){let e=this._summaryBox;if(!e)return;let t=this._items.length,n=this._boxes.filter(e=>e.checked).length;e.checked=n===t&&t>0,e.indeterminate=n>0&&n<t,this._summaryText.textContent=`${n} of ${t}`}_fill(e){let t=u(e);this._items=t;let n=new Set(null!=(a=this.peek())?a:[]);if(this._itemsHost.textContent="",this._boxes=[],0===t.length){let e=document.createElement("div");e.className="u2-multi-choice-empty",e.textContent=null!=(d=this.options.emptyText)?d:"No items",this._itemsHost.append(e),this._updateSummary();return}var r=!0,i=!1,o=void 0;try{for(var a,d,c,p=t[Symbol.iterator]();!(r=(c=p.next()).done);r=!0){let e=c.value,t=document.createElement("label");t.className="u2-multi-choice-item",t.dataset.u2Item=l(e),t.dataset.value=l(e);let r=document.createElement("input");r.type="checkbox",r.className="u2-input-checkbox",r.value=l(e),r.checked=n.has(r.value);let i=document.createElement("span");i.dataset.u2Part="item-label",i.textContent=s(e),t.append(r,i),this._itemsHost.append(t),this._boxes.push(r)}}catch(e){i=!0,o=e}finally{try{r||null==p.return||p.return()}finally{if(i)throw o}}this._updateSummary(),this.refreshDisabled()}constructor(e){super(e,[]),this.root.dataset.u2="multi-choice-input"}}},8321(e,t,n){n.d(t,{A:()=>a});var r=n(7974),i=n(7115);let o=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i;class a extends r.p{createEditor(){this._bad=(0,i.vP)(!1);let e=document.createElement("input");this._text=e,e.type="text",e.autocomplete="off",e.spellcheck=!1,e.className="u2-color-text",e.placeholder="#rrggbb";let t=document.createElement("button");this._swatch=t,t.type="button",t.className="u2-color-swatch",t.setAttribute("aria-label","string"==typeof this.options.label?`Pick ${this.options.label}`:"Pick a color");let n=document.createElement("input");this._picker=n,n.type="color",n.className="u2-color-picker",n.tabIndex=-1,n.setAttribute("aria-hidden","true");let r=!1;this.effect(()=>{let t=this.value;r?r=!1:(e.value=t,this._bad.value=!1),this._paint(t)}),this.scope.listen(e,"input",()=>{let t=e.value.trim();this._bad.value=!o.test(t),this._bad.peek()||t===this.peek()||(r=!0,this.value=t)}),this.scope.listen(n,"input",()=>{this._bad.value=!1,this.value=n.value}),this.scope.listen(t,"click",()=>n.click());let a=document.createElement("span");return a.className="u2-color-box",a.append(t,n),this.addRail(a,{edits:!0}),this.options.swatchOnly&&(this.root.classList.add("u2-color-box-only"),e.hidden=!0),this.addValidator(()=>this._bad.value?"Not a color":null),e}resetEditor(){this._bad.value=!1,this._text.value=this.peek(),this._paint(this.peek())}get unreadable(){return this._bad.value}_paint(e){this._swatch.style.background=e,this._picker.value=a.toHex6(e)}static toHex6(e){let t=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i.exec(e);return t?`#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}`.toLowerCase():e.toLowerCase()}constructor(e){super(void 0===e?{}:e,"#000000"),this.root.dataset.u2="color-input"}}},8574(e,t,n){n.d(t,{J:()=>x,e:()=>k});var r=n(7115),i=n(8255),o=n(7974),a=n(3830),l=n(8609),s=n(108),u=n(4208);let d=["January","February","March","April","May","June","July","August","September","October","November","December"],c=["Su","Mo","Tu","We","Th","Fr","Sa"],p=/^(\d{4})-(\d{1,2})-(\d{1,2})$/,h=/^(\d{4})-(\d{1,2})-(\d{1,2})[ T](\d{1,2}):(\d{1,2})$/;function m(e){return e<10?`0${e}`:String(e)}function f(e,t){return t?i.A.utcParts(e):{year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate()}}function g(e,t){let n=f(e,void 0!==t&&t);return new Date(n.year,n.month-1,n.day)}function v(e){return new Date(e.getFullYear(),e.getMonth(),1)}function b(e,t){return new Date(e.getFullYear(),e.getMonth(),e.getDate()+t)}function y(e,t){let n=new Date(e.getFullYear(),e.getMonth()+t,1),r=new Date(n.getFullYear(),n.getMonth()+1,0).getDate();return new Date(n.getFullYear(),n.getMonth(),Math.min(e.getDate(),r))}function _(e,t){let n=f(e,void 0!==t&&t);return`${n.year}-${m(n.month)}-${m(n.day)}`}class w extends o.p{get unreadable(){return this._bad.value}getState(){var e,t;return e=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},super.getState()),t=t={open:this._open.peek()},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}createEditor(){var e;this._id=`u2-date-${++w._seq}`,this._bad=(0,r.vP)(!1),this._open=(0,r.vP)(!1),this._machine=(0,r.vP)("idle"),this._month=(0,r.vP)(v(new Date)),this._active=(0,r.vP)(g(new Date)),this._time=(0,r.vP)(0),this._dayEls=(0,r.vP)([]);let t=document.createElement("input");this._input=t,t.type="text",t.autocomplete="off",t.placeholder=this._pattern,t.setAttribute("aria-label",null!=(e=(0,o.Q)(this.options.label))?e:this._pattern);let n=!1;this.effect(()=>{let e=this.value,r=this._parse(t.value);n?n=!1:(void 0===r||(null==r?void 0:r.getTime())!==(null==e?void 0:e.getTime()))&&(t.value=this._format(e))}),this.scope.listen(t,"input",()=>{let e=this._parse(t.value);this._bad.value=void 0===e,void 0!==e&&e!==this.peek()&&(n=!0,this.value=e)}),this.scope.listen(t,"blur",()=>{this._commit(),this._send({type:"blur"})}),this.scope.listen(t,"focus",()=>this._send({type:"focus"})),this.scope.listen(t,"keydown",e=>this._onFieldKeyDown(e)),this._toggle=(0,s.gb)("calendar-alt",()=>this._send({type:"toggleOpen"}),{tooltip:"Pick a date"}),this._toggle.classList.add("u2-date-toggle"),this._toggle.setAttribute("aria-haspopup","dialog"),this.addOptions(this._toggle,{edits:!0});let i=document.createElement("div");return this._field=i,i.className="u2-date",i.append(t),this._popup=this._buildPopup(),this.effect(()=>{let e=this._open.value;this._toggle.setAttribute("aria-expanded",String(e)),i.classList.toggle("u2-date-open",e)}),this.effect(()=>this._renderCalendar()),this.effect(()=>this._applyDays()),this.addValidator(()=>this._bad.value?`Not a ${this.withTime?"date-time":"date"}`:null),i}get _pattern(){let e=this.withTime?"yyyy-MM-dd HH:mm":"yyyy-MM-dd";return this.options.relative?`${e} or -1w`:e}get _utc(){return!0===this.options.utcDates}get _firstDay(){var e;return null!=(e=this.options.firstDayOfWeek)?e:i.A.firstDayOfWeek()}_buildPopup(){let e=w._el("div","u2-date-popup");e.setAttribute("role","dialog"),e.setAttribute("aria-label",this.withTime?"Choose date and time":"Choose date"),this._title=w._el("div","u2-date-title"),this._title.id=`${this._id}-title`;let t=w._el("div","u2-date-header");t.append((0,s.gb)("chevron-left",()=>this._shiftMonth(-1),{tooltip:"Previous month"}),this._title,(0,s.gb)("chevron-right",()=>this._shiftMonth(1),{tooltip:"Next month"}),(0,l.x6)("Today",()=>this._send({type:"today"})));let n=w._el("div","u2-date-grid");n.setAttribute("role","grid"),n.setAttribute("aria-labelledby",this._title.id);let r=w._el("div","u2-date-weekdays");r.setAttribute("role","row");for(let e=0;e<7;e++){let t=w._el("div","u2-date-weekday",c[(this._firstDay+e)%7]);t.setAttribute("role","columnheader"),r.append(t)}return this._weeks=w._el("div","u2-date-weeks"),this._weeks.setAttribute("role","rowgroup"),n.append(r,this._weeks),e.append(t,n),this.withTime&&e.append(this._buildTime()),this.scope.listen(n,"keydown",e=>this._onGridKeyDown(e)),this.scope.listen(n,"click",e=>this._onGridClick(e)),this.scope.listen(e,"keydown",e=>this._onPopupKeyDown(e)),this.scope.listen(e,a.B,()=>this._send({type:"dismiss"})),e}_buildTime(){let e=w._el("div","u2-date-time");return this._hours=this._segment("Hours"),this._minutes=this._segment("Minutes"),e.append(w._el("span","u2-date-time-label","Time"),this._hours,w._el("span","u2-date-time-sep",":"),this._minutes),e}_segment(e){let t=document.createElement("input");return t.className="u2-date-time-seg",t.type="text",t.inputMode="numeric",t.autocomplete="off",t.maxLength=2,t.setAttribute("aria-label",e),this.scope.listen(t,"input",()=>this._onTimeInput(t)),this.scope.listen(t,"keydown",e=>this._onTimeKeyDown(e,t)),this.scope.listen(t,"blur",()=>this._syncTime()),t}_send(e){let t=this._machine.peek();switch(e.type){case"focus":"idle"===t&&(this._machine.value="focused");break;case"blur":"open"!==t&&(this._machine.value="idle");break;case"open":this._openPopup();break;case"toggleOpen":"open"===t?this._dismiss(!0):this._openPopup();break;case"escape":this._dismiss(!0);break;case"dismiss":this._dismiss(!1);break;case"today":this._today();break;case"select":this._select(e.date)}}_openPopup(){if(this._open.peek())return;let e=this.peek(),t=null===e?this._defaultDay():g(e,this._utc);this._month.value=v(t),this._active.value=t;let n=null===e?{hours:0,minutes:0}:this._utc?i.A.utcParts(e):{hours:e.getHours(),minutes:e.getMinutes()};this._time.value=60*n.hours+n.minutes,this._machine.value="open",this._closeOverlay=a.h.show(this._field,this._popup,{owner:this.scope,matchWidth:!1}),this._open.value=!0,this._syncTime(),this._focusActive()}_dismiss(e){if(!this._open.peek())return;this._open.value=!1,this._machine.value=e?"focused":"idle";let t=this._closeOverlay;this._closeOverlay=void 0,t&&t(),e&&this._input.focus()}_defaultDay(){let e=g(new Date),t=this.options,n=t.min,r=t.max;return void 0!==n&&e<g(n,this._utc)?g(n,this._utc):void 0!==r&&e>g(r,this._utc)?g(r,this._utc):e}_shiftMonth(e){this._goto(y(this._active.peek(),e),!1)}_today(){let e=g(new Date);this._disabled(e)?this._goto(e,!0):this._select(e)}_goto(e,t){(e.getFullYear()!==this._month.peek().getFullYear()||e.getMonth()!==this._month.peek().getMonth())&&(this._month.value=v(e)),this._active.value=e,t&&this._focusActive()}_select(e){this._disabled(e)||(this._set(this._combine(e)),this._dismiss(!0))}_combine(e){let t=this.withTime?this._time.peek():0,n=Math.floor(t/60),r=t%60;return this._utc?i.A.fromUtcParts({year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate(),hours:n,minutes:r}):this.withTime?new Date(e.getFullYear(),e.getMonth(),e.getDate(),n,r):g(e)}_focusActive(){queueMicrotask(this.scope.bind(()=>{if(!this._open.peek())return;let e=_(this._active.peek());var t=!0,n=!1,r=void 0;try{for(var i,o=this._dayEls.peek()[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){let t=i.value;t.dataset.date===e&&t.focus()}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}}))}_onFieldKeyDown(e){"Enter"===e.key?this._commit():"ArrowDown"===e.key&&(e.preventDefault(),this._send({type:"open"}))}_onPopupKeyDown(e){"Escape"===e.key&&this._send({type:"escape"})}_onGridKeyDown(e){let t,n=this._active.peek();switch(e.key){case"ArrowLeft":t=b(n,-1);break;case"ArrowRight":t=b(n,1);break;case"ArrowUp":t=b(n,-7);break;case"ArrowDown":t=b(n,7);break;case"PageUp":t=y(n,e.shiftKey?-12:-1);break;case"PageDown":t=y(n,e.shiftKey?12:1);break;case"Home":t=b(n,-this._weekOffset(n));break;case"End":t=b(n,6-this._weekOffset(n));break;case"Enter":case" ":e.preventDefault(),this._send({type:"select",date:n});return;default:return}e.preventDefault(),this._goto(t,!0)}_onGridClick(e){let t,n=e.target.closest(".u2-date-day");n&&this._send({type:"select",date:new Date((t=n.dataset.date.split("-").map(Number))[0],t[1]-1,t[2])})}_onTimeInput(e){let t=e.value.replace(/\D/g,"").slice(0,2);t!==e.value&&(e.value=t),this._readTime(),2===t.length&&e===this._hours&&this._minutes.focus()}_onTimeKeyDown(e,t){if("Enter"===e.key){e.preventDefault(),this._send({type:"select",date:this._active.peek()});return}let n="ArrowUp"===e.key?1:"ArrowDown"===e.key?-1:0;if(0===n)return;e.preventDefault();let r=t===this._hours?24:60;t.value=m(((Number(t.value)||0)+n+r)%r),this._readTime()}_readTime(){let e=Math.min(Number(this._hours.value)||0,23),t=Math.min(Number(this._minutes.value)||0,59);this._time.value=60*e+t;let n=this.peek();null!==n&&this._set(this._combine(g(n,this._utc)))}_syncTime(){if(!this._hours||!this._minutes)return;let e=this._time.peek();this._hours.value=m(Math.floor(e/60)),this._minutes.value=m(e%60)}_weekOffset(e){return(e.getDay()-this._firstDay+7)%7}_renderCalendar(){if(!this._open.value){this._dayEls.value=[];return}let e=this._month.value;this._title.textContent=`${d[e.getMonth()]} ${e.getFullYear()}`;let t=b(e,-this._weekOffset(e)),n=_(new Date),r=[];this._weeks.textContent="";for(let i=0;i<6;i++){let o=w._el("div","u2-date-week");o.setAttribute("role","row");for(let a=0;a<7;a++){let l=b(t,7*i+a),s=this._dayCell(l,e,n);o.append(s),r.push(s)}this._weeks.append(o)}this._dayEls.value=r}_dayCell(e,t,n){let r=w._el("div","u2-date-day",String(e.getDate())),i=_(e);return r.dataset.date=i,r.tabIndex=-1,r.setAttribute("role","gridcell"),r.setAttribute("aria-label",`${d[e.getMonth()]} ${e.getDate()}, ${e.getFullYear()}`),e.getMonth()!==t.getMonth()&&r.classList.add("u2-date-adjacent"),i===n&&(r.classList.add("u2-date-today"),r.setAttribute("aria-current","date")),this._disabled(e)&&(r.classList.add("u2-date-day-disabled"),r.setAttribute("aria-disabled","true")),r}_applyDays(){let e=this.value,t=null===e?null:_(e,this._utc),n=_(this._active.value);var r=!0,i=!1,o=void 0;try{for(var a,l=this._dayEls.value[Symbol.iterator]();!(r=(a=l.next()).done);r=!0){let e=a.value,r=e.dataset.date===t;e.setAttribute("aria-selected",String(r)),e.classList.toggle("u2-date-selected",r),e.tabIndex=e.dataset.date===n?0:-1}}catch(e){i=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}}_commit(){let e=this._parse(this._input.value);void 0!==e&&this._set(e)}_set(e){this._bad.value=!1,this.value=null===e?null:this._clamp(e),this._input.value=this._format(this.peek())}_disabled(e){let t=this.options,n=t.min,r=t.max,i=g(e).getTime();return void 0!==n&&i<g(n,this._utc).getTime()||void 0!==r&&i>g(r,this._utc).getTime()}_clamp(e){let t=this.options,n=t.min,r=t.max;return void 0!==n&&e<n?this._normalize(n):void 0!==r&&e>r?this._normalize(r):e}_normalize(e){if(this._utc){let t=i.A.utcParts(e);return this.withTime?i.A.fromUtcParts(t):i.A.fromUtcParts({year:t.year,month:t.month,day:t.day})}return this.withTime?new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes()):g(e)}_format(e){if(null===e)return"";let t=(0,u.ee)(e);if(void 0!==t)return t;let n=_(e,this._utc);if(!this.withTime)return n;let r=this._utc?i.A.utcParts(e):{hours:e.getHours(),minutes:e.getMinutes()},o=r.hours,a=r.minutes;return`${n} ${m(o)}:${m(a)}`}_parse(e){let t=e.trim();if(!t)return null;if(this.options.relative&&(0,u.Yw)(t))return(0,u.uA)((0,u.Ho)(t,new Date),t);let n=(this.withTime?h:p).exec(t);if(!n)return;let r=Number(n[2]),o=Number(n[3]),a=void 0===n[4]?0:Number(n[4]),l=void 0===n[5]?0:Number(n[5]);if(r<1||r>12||o<1||a>23||l>59)return;let s=Number(n[1]),d=this._utc?i.A.fromUtcParts({year:s,month:r,day:o,hours:a,minutes:l}):new Date(s,r-1,o,a,l),c=f(d,this._utc);return c.month===r&&c.day===o?d:void 0}static _el(e,t,n){let r=document.createElement(e);return r.className=t,void 0!==n&&(r.textContent=n),r}constructor(e){super(e,null),this.isOpen=this._open,this.machineState=this._machine}}w._seq=0;class x extends w{get withTime(){return!1}constructor(e){super(void 0===e?{}:e),this.root.dataset.u2="date-input"}}class k extends w{get withTime(){return!0}constructor(e){super(void 0===e?{}:e),this.root.dataset.u2="datetime-input"}}},5539(e,t,n){n.d(t,{W:()=>i});var r=n(7974);class i extends r.p{createEditor(){this._rendered=null;let e=document.createElement("div");this._box=e,e.className="u2-dynamic";let t=this.options.size;return(null==t?void 0:t.width)!==void 0&&(e.style.width=`${t.width}px`),(null==t?void 0:t.height)!==void 0&&(e.style.height=`${t.height}px`),this.effect(()=>this._show(this.options.render(this.value))),this.own(()=>this._show(null)),e}_show(e){var t;null==(t=this._rendered)||t.remove(),this._rendered=e,null!==e&&this._box.append(e)}constructor(e){super(e,null),this.root.dataset.u2="dynamic-input"}}},5143(e,t,n){n.d(t,{O:()=>p});var r=n(7974),i=n(3830),o=n(9947);let a=["monospace","serif","sans-serif","cursive","fantasy","system-ui"],l=["monospace","serif","cursive"],s=[8,9,10,11,12,14,18,24,36,48,72,96],u=["Monospace","Arial","Open Sans","Roboto"],d="Roboto",c=/^-?\d+$/;class p extends r.p{static parse(e){let t,n;if(!e)return null;let r=e.trim(),i=r.indexOf('"'),o=r.lastIndexOf('"');if(i>=0&&o>i){if(n=r.substring(i+1,o),3!==(t=r.substring(0,i).trim().split(" ").filter(e=>e)).length)return null}else if(4!==(t=r.split(" ").filter(e=>e)).length||(n=t[3].toLowerCase(),!l.includes(n)))return null;let a=t[0].toLowerCase(),s=t[1].toLowerCase(),u=t[2].toLowerCase();if("bold"!==a&&"normal"!==a||"italic"!==s&&"normal"!==s||!u.endsWith("px"))return null;let d=u.substring(0,u.length-2);return c.test(d)?{bold:"bold"===a,italic:"italic"===s,size:Number(d),family:n}:null}static compose(e){let t=e.bold?"bold":"normal",n=e.italic?"italic":"normal",r=""===e.family?d:e.family,i=`${e.size}px`;return a.includes(r.toLowerCase())?`${t} ${n} ${i} ${r.toLowerCase()}`:`${t} ${n} ${i} "${r}"`}createEditor(){this._id=`u2-font-${++p._seq}`,this._font={bold:!1,italic:!1,size:10,family:d};let e=document.createElement("input");this._size=e,e.type="text",e.autocomplete="off",e.className="u2-font-size",e.setAttribute("aria-label","Font size"),e.setAttribute("aria-controls",`${this._id}-sizes`);let t=this._step(-1,"Decrease font size"),n=this._step(1,"Increase font size");this._bold=this._toggle("B","Bold","u2-font-bold"),this._italic=this._toggle("I","Italic","u2-font-italic");let r=document.createElement("select");this._family=r,r.className="u2-font-family",r.setAttribute("aria-label","Font family");var o=!0,a=!1,l=void 0;try{for(var h,m,f,g=(null!=(h=this.options.families)?h:u)[Symbol.iterator]();!(o=(f=g.next()).done);o=!0){let e=f.value;r.append(new Option(e,e))}}catch(e){a=!0,l=e}finally{try{o||null==g.return||g.return()}finally{if(a)throw l}}this._popup=document.createElement("div"),this._popup.className="u2-font-sizes",this._popup.id=`${this._id}-sizes`,this._popup.setAttribute("role","listbox");var v=!0,b=!1,y=void 0;try{for(var _,w=(null!=(m=this.options.sizes)?m:s)[Symbol.iterator]();!(v=(_=w.next()).done);v=!0){let e=_.value,t=document.createElement("div");t.className="u2-font-size-option",t.dataset.size=String(e),t.dataset.u2Item=String(e),t.setAttribute("role","option"),t.textContent=String(e),this._popup.append(t)}}catch(e){b=!0,y=e}finally{try{v||null==w.return||w.return()}finally{if(b)throw y}}let x=!1;this.effect(()=>{let e=this.value;x?x=!1:this._apply(e)});let k=()=>{let e=p.compose(this._font);e!==this.peek()&&(x=!0,this.value=e)};this.scope.listen(e,"input",()=>{let t=e.value.trim();this._font.size=c.test(t)?Number(t):10,k()}),this.scope.listen(e,"mousedown",()=>this._toggleSizes()),this.scope.listen(e,"blur",()=>this._closeSizes()),this.scope.listen(r,"change",()=>{this._font.family=r.value,k()});let O=e=>{let t=this._font.size+e;t<0||(this._font.size=t,this._size.value=String(t),k())};this.scope.listen(t,"click",()=>O(-1)),this.scope.listen(n,"click",()=>O(1)),this.scope.listen(this._bold,"click",()=>{this._font.bold=!this._font.bold,this._paint(),k()}),this.scope.listen(this._italic,"click",()=>{this._font.italic=!this._font.italic,this._paint(),k()}),this.scope.listen(this._popup,"pointerdown",e=>{let t=e.target.closest(".u2-font-size-option");t&&(e.preventDefault(),this._font.size=Number(t.dataset.size),this._size.value=t.dataset.size,this._closeSizes(),k())}),this.scope.listen(this._popup,i.B,()=>this._closeOverlay=void 0);let A=document.createElement("div");return A.className="u2-font",A.append(e,t,n,this._bold,this._italic,r),A}_step(e,t){let n=document.createElement("button");return n.type="button",n.className="u2-font-step",n.append((0,o.K)(e<0?"minus":"plus")),n.setAttribute("aria-label",t),n.title=t,n}_toggle(e,t,n){let r=document.createElement("button");return r.type="button",r.className=`u2-font-toggle ${n}`,r.textContent=e,r.setAttribute("aria-label",t),r.setAttribute("aria-pressed","false"),r}_apply(e){var t,n,r;let i=p.parse(e);this._font={bold:null!=(t=null==i?void 0:i.bold)&&t,italic:null!=(n=null==i?void 0:i.italic)&&n,size:null!=(r=null==i?void 0:i.size)?r:10,family:i&&""!==i.family?i.family:d},this._size.value=null===i?"":String(i.size),this._selectFamily(this._font.family),this._paint()}_selectFamily(e){if(!Array.from(this._family.querySelectorAll("option")).some(t=>t.value===e)){let t=new Option(e,e);t.hidden=!0,this._family.append(t)}this._family.value=e}_paint(){this._paintToggle(this._bold,this._font.bold),this._paintToggle(this._italic,this._font.italic)}_paintToggle(e,t){e.classList.toggle("u2-font-toggle-active",t),e.setAttribute("aria-pressed",String(t))}getState(){var e,t;return e=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},super.getState()),t=t={open:void 0!==this._closeOverlay},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}getItems(e){var t;let n=void 0!==this._closeOverlay;return r.p.itemsState((null!=(t=this.options.sizes)?t:s).map((e,t)=>({key:String(e),label:String(e),index:t,selected:e===this._font.size,rendered:n})),null==e?void 0:e.all)}revealItem(e){return void 0===this._closeOverlay&&this._toggleSizes(),super.revealItem(e)}displayText(){return this.peek()}_toggleSizes(){this._closeOverlay?this._closeSizes():this._closeOverlay=i.h.show(this._size,this._popup,{owner:this.scope})}_closeSizes(){let e=this._closeOverlay;this._closeOverlay=void 0,e&&e()}constructor(e){super(void 0===e?{}:e,p.compose({bold:!1,italic:!1,size:10,family:d})),this.root.dataset.u2="font-input"}}p._seq=0},1043(e,t,n){n.d(t,{_:()=>m});var r=n(7974),i=n(1518),o=n(3830),a=n(8609),l=n(9947),s=n(6002),u=n(2855),d=n(8049);function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}let p=[...s.R,...s.d],h=new Set(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","PageUp","PageDown","Enter"]);class m extends r.p{getState(){var e,t;return e=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},super.getState()),t=t={open:void 0!==this._popup},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}createEditor(){let e=(0,a.Ln)("","u2-icon-input-preview"),t=(0,a.Ln)("","u2-icon-input-name"),n=this._control=(0,a.y4)([e,t],"u2-icon-input");n.tabIndex=0;for(let e=0,t=[["role","button"],["aria-haspopup","listbox"],["aria-expanded","false"]];e<t.length;e++){var r;let i=function(e){if(Array.isArray(e))return e}(r=t[e])||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var i=[],o=!0,a=!1;try{for(r=r.call(e);!(o=(t=r.next()).done)&&(i.push(t.value),2!==i.length);o=!0);}catch(e){a=!0,n=e}finally{try{o||null==r.return||r.return()}finally{if(a)throw n}}return i}}(r)||function(e){if(e){if("string"==typeof e)return c(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return c(e,2)}}(r)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),o=i[0],a=i[1];n.setAttribute(o,a)}return this.effect(()=>{let n=this.value;e.replaceChildren(...n?[(0,l.K)(n)]:[]),t.textContent=n||"—"}),this.scope.listen(n,"click",()=>this._toggle()),this.scope.listen(n,"keydown",e=>{let t=e.key;if(("Backspace"===t||"Delete"===t)&&this.nullable)this.value="";else{if("Enter"!==t&&" "!==t)return;this._toggle()}e.preventDefault()}),this.own(()=>this._close()),n}_toggle(){if(null!==this.disabled)return;if(this._popup)return this._close();let e=this._popup=new i.HG;e.build(()=>{var t,n;let r=null!=(t=this.options.names)?t:p,i=new d.k({placeholder:"Search…",search:!0,inline:!0}),s=new u.Q({cellWidth:28,cellHeight:28,render:(e,t,n)=>(n.title=e,(0,l.K)(e)),onActivate:e=>{this.value=e,this._close()}});e.effect(()=>{let e=i.value.trim().toLowerCase().replace(/\s+/g,"-");s.setItems(e?r.filter(t=>t.includes(e)):r)});let c=(0,a.yP)([i,s],"u2-icon-input-popup");e.listen(c,"keydown",e=>{h.has(e.key)&&!s.root.contains(e.target)&&s.onKeyDown(e)}),e.listen(c,o.B,()=>this._close()),o.h.show(this._control,c,{owner:e}),this._control.setAttribute("aria-expanded","true"),null==(n=i.root.querySelector("input"))||n.focus()})}_close(){var e;null==(e=this._popup)||e.dispose(),this._popup=void 0,this._control.setAttribute("aria-expanded","false")}constructor(e){super(void 0===e?{}:e,""),this.root.dataset.u2="icon-input"}}},7447(e,t,n){n.d(t,{M:()=>i});var r=n(7974);class i extends r.p{get alt(){var e;return null!=(e=this.options.alt)?e:""}set alt(e){this.options.alt=null!=e?e:void 0,this.root.querySelector(".u2-image-preview").alt=this.alt}createEditor(){var e;let t=document.createElement("img");t.className="u2-image-preview",t.alt=null!=(e=this.options.alt)?e:"";let n=document.createElement("button");n.type="button",n.className="u2-image-remove",n.textContent="REMOVE",this.scope.listen(n,"click",()=>this.value=""),this.effect(()=>{let e=this.value;t.src=e,t.hidden=""===e,n.hidden=""===e});let r=document.createElement("div");return r.className="u2-image",r.append(t,n),r}constructor(e){super(void 0===e?{}:e,""),this.root.dataset.u2="image-input"}}},2570(e,t,n){n.d(t,{Z:()=>l});var r=n(7974),i=n(8609),o=n(9947);let a=/,(?=(?:[^"]*"[^"]*")*(?![^"]*"))/;class l extends r.p{static parse(e){let t=e.replace(/[\r\n]/g,"");return""===t?[]:t.split(a).map(e=>{let t=e.trim();return t.startsWith('"')?t.substring(1,t.length-1):t})}static join(e){return e.map(e=>`${e}`.includes(",")?`"${e}"`:`${e}`).join(",")}getItems(e){return r.p.itemsState(this.peek().map((e,t)=>({key:e,label:e,index:t,rendered:!1})),null==e?void 0:e.all)}get expanded(){return this._expanded}set expanded(e){this._expanded=e,this._field.hidden=e,this._area.hidden=!e,this._glyph.classList.toggle("fa-expand",!e),this._glyph.classList.toggle("fa-compress",e),this._toggle.setAttribute("aria-label",e?"Collapse":"Expand")}createEditor(){this._expanded=!1;let e=document.createElement("input");this._field=e,e.type="text",e.autocomplete="off",e.className="u2-list-text";let t=document.createElement("textarea");this._area=t,t.className="u2-list-text u2-list-area",t.hidden=!0;let n=!1;this.effect(()=>{let r=this.value;if(n){n=!1;return}let i=l.join(r);e.value=i,t.value=i});let r=r=>{let i=r.value;n=!0,this.value=l.parse(i),(r===e?t:e).value=i};this.scope.listen(e,"input",()=>r(e)),this.scope.listen(t,"input",()=>r(t)),this._glyph=(0,o.K)("expand"),this._toggle=(0,i.x6)(this._glyph,()=>this.expanded=!this._expanded),this._toggle.classList.add("u2-icon-btn","u2-list-toggle"),this._toggle.setAttribute("aria-label","Expand");let a=document.createElement("div");return a.className="u2-list",a.append(e,t),this.addOptions(this._toggle),a}constructor(e){var t;let n=void 0===e?{}:e;super(n,[]),this.root.dataset.u2="list-input",this.liveOption("placeholder",null!=(t=n.placeholder)?t:"Comma-separated values",e=>{this._field.placeholder=e,this._area.placeholder=e})}}},8752(e,t,n){n.d(t,{h:()=>s});var r=n(7974),i=n(7115),o=n(9947);function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,i=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var o=[],a=!0,l=!1;try{for(i=i.call(e);!(a=(n=i.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==i.return||i.return()}finally{if(l)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}class s extends r.p{getItems(e){return r.p.itemsState(this._rows.map((e,t)=>{let n=l(e,1)[0];return{key:s._key(n,t),label:n,index:t,rendered:!0}}),null==e?void 0:e.all)}createEditor(){this._dup=(0,i.vP)(!1),this._keyless=(0,i.vP)(!1);let e=document.createElement("div");return this._body=e,e.className="u2-map",e.setAttribute("role","grid"),this.effect(()=>{let e=this.value;void 0!==this._rows&&s._same(e,this._value())||this._load(e)}),this.scope.listen(e,"input",e=>this._onInput(e.target)),this.scope.listen(e,"click",e=>this._onClick(e.target)),this.addValidator(()=>this._dup.value?"Duplicate keys are not allowed":this._keyless.value?"A value needs its key":null),e}resetEditor(){this._load(this.peek())}_load(e){this._rows=Object.keys(e).map(t=>[t,e[t]]),0===this._rows.length&&this._rows.push(["",""]),this._render()}_render(){this._body.textContent="";for(let e=0;e<this._rows.length;e++)this._body.append(this._row(e));this._mark(),this.refreshDisabled()}_row(e){let t=document.createElement("div");t.className="u2-map-row",t.setAttribute("role","row"),t.dataset.u2Item=s._key(this._rows[e][0],e);let n=document.createElement("div");return n.className="u2-map-actions",n.append(this._button(e,"add","plus","Add row"),this._button(e,"remove","minus","Remove row")),t.append(this._cell(e,0,"Key"),this._cell(e,1,"Value"),n),t}_cell(e,t,n){let r=document.createElement("input");return r.type="text",r.autocomplete="off",r.className=0===t?"u2-map-key":"u2-map-value",r.placeholder=n,r.setAttribute("aria-label",n),r.value=this._rows[e][t],r.dataset.row=String(e),r.dataset.part=String(t),r}_button(e,t,n,r){let i=document.createElement("button");return i.type="button",i.className="u2-map-btn",i.append((0,o.K)(n)),i.dataset.row=String(e),i.dataset.act=t,i.setAttribute("aria-label",r),i.title=r,i}_onInput(e){let t=e.dataset.part;if(void 0===t)return;let n=Number(e.dataset.row);this._rows[n][Number(t)]=e.value,"0"===t&&(e.closest(".u2-map-row").dataset.u2Item=s._key(this._rows[n][0],n)),this._commit()}_onClick(e){let t=e.closest(".u2-map-btn");if(!t)return;let n=Number(t.dataset.row);"add"===t.dataset.act?this._rows.splice(n+1,0,["",""]):this._rows.splice(n,1),0===this._rows.length&&this._rows.push(["",""]),this._render(),this._commit()}_commit(){let e=this._value();this._mark(),this._dup.peek()||s._same(this.peek(),e)||(this.value=e)}_value(){let e={};var t=!0,n=!1,r=void 0;try{for(var i,o=this._rows[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){let t=l(i.value,2),n=t[0],r=t[1];""!==n&&(e[n]=r)}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}return e}static _key(e,t){return""===e?`#${t}`:e}_mark(){let e=new Set,t=new Set;var n=!0,r=!1,i=void 0;try{for(var o,a=this._rows[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){let n=l(o.value,1)[0];""!==n&&(e.has(n)?t.add(n):e.add(n))}}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}let s=t.size>0,u=this._rows.map(e=>{let t=l(e,2),n=t[0],r=t[1];return""===n&&""!==r});this._dup.peek()!==s&&(this._dup.value=s),this._keyless.peek()!==u.includes(!0)&&(this._keyless.value=u.includes(!0));let d=this._body.querySelectorAll(".u2-map-key");for(let e=0;e<d.length;e++)d[e].classList.toggle("u2-invalid",t.has(this._rows[e][0])||u[e])}static _same(e,t){let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;var r=!0,i=!1,o=void 0;try{for(var a,l=n[Symbol.iterator]();!(r=(a=l.next()).done);r=!0){let n=a.value;if(e[n]!==t[n])return!1}}catch(e){i=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return!0}constructor(e){super(void 0===e?{}:e,{}),this.root.dataset.u2="map-input"}}},5361(e,t,n){var r=n(7115),i=n(1518),o=n(9701),a=n(6090),l=n(2357),s=n(8609),u=n(5232),d=n(108);function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}let p={"@":"at","#":"hashtag"},h=new Set(["DIV","P"]);class m extends o.Ec{get value(){return m._serialize(this._editor).replace(/\n$/,"")}getState(){var e,t;let n=this._options.placeholder;return c((e=c({},super.getState()),t=t={value:this.value,text:o.Ec.text(this._editor),open:this._open.peek()},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e),n?{placeholder:n}:{})}accessibleLabel(){var e,t;return null!=(e=null!=(t=super.accessibleLabel())?t:o.Ec.labelOf(this._editor))?e:this._options.placeholder||void 0}set value(e){this._endSession(),this._editor.textContent="";var t=!0,n=!1,r=void 0;try{for(var i,o=this._parse(e)[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){let e=i.value;this._editor.append(e)}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}this._refreshEmpty()}insertMention(e,t){let n=void 0===t?this._providers[0]:t;if(void 0===n)return;let r=this._session;r&&r.provider===n?this._replaceQuery(r,e):(this._insertAtCaret(this._chipFor(n,e),document.createTextNode(" ")),this._afterEdit())}openMentions(e){var t;let n=void 0===e?this._providers[0]:e;if(void 0===n)return;this._closeSession(),this._editor.focus();let r=document.createElement("span");r.className="u2-msg-query",r.textContent=n.trigger,this._insertAtCaret(r),this._startSession(n,r),this._caretTo(null!=(t=r.firstChild)?t:r,n.trigger.length),this._refreshEmpty()}send(){if(this._empty.peek())return;let e=this.value,t=this._options.onSend;void 0===t?this.clear():Promise.resolve(t(e)).then(()=>this.clear()).catch(e=>console.error("u2: message not sent",e))}clear(){this._closeSession(),this._editor.textContent="",this._afterEdit()}focus(){this._editor.focus()}static _serialize(e){let t="";var n=!0,r=!1,i=void 0;try{for(var o,a,l,s=Array.from(e.childNodes)[Symbol.iterator]();!(n=(l=s.next()).done);n=!0){let e=l.value;if(3===e.nodeType){t+=null!=(a=e.textContent)?a:"";continue}1===e.nodeType&&(e.classList.contains("u2-msg-chip")?t+=null!=(o=e.dataset.token)?o:"":"BR"===e.tagName?t+="\n":h.has(e.tagName)?t+=`${m._serialize(e)}
675
+ `:t+=m._serialize(e))}}catch(e){r=!0,i=e}finally{try{n||null==s.return||s.return()}finally{if(r)throw i}}return t}_buildTokens(){let e=[],t=1;var n=!0,r=!1,i=void 0;try{for(var o,a=this._providers[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){let n=o.value,r=n.tokenPattern;void 0!==r&&(e.push(`(${r})`),this._owners.push({provider:n,group:t}),t+=m._groupCount(r)+1)}}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}return e.length>0?RegExp(e.join("|"),"g"):void 0}static _groupCount(e){return RegExp(`${e}|`).exec("").length-1}_parse(e){let t=[],n=this._tokens;if(void 0===n)return m._pushText(t,e),t;n.lastIndex=0;let r=0;for(let i=n.exec(e);null!==i;i=n.exec(e))m._pushText(t,e.substring(r,i.index)),t.push(this._restoreChip(i)),r=i.index+i[0].length;return m._pushText(t,e.substring(r)),t}static _pushText(e,t){if(""===t)return;let n=t.split("\n");for(let t=0;t<n.length;t++)t>0&&e.push(document.createElement("br")),""!==n[t]&&e.push(document.createTextNode(n[t]))}_restoreChip(e){let t=this._owners.find(t=>void 0!==e[t.group]),n=null==t?void 0:t.provider,r=(null==n?void 0:n.tokenPattern)===void 0?null:new RegExp(n.tokenPattern).exec(e[0]),i=(null==n?void 0:n.renderToken)&&r?n.renderToken(r):document.createTextNode(m._tokenText(null!=r?r:e));return m._chip(e[0],i)}static _tokenText(e){let t=e.slice(1).filter(e=>void 0!==e);return t.length>0?t[t.length-1]:e[0]}_chipFor(e,t){var n;let r=null==(n=e.renderer)?void 0:n.markup,i=r?r.call(e.renderer,t):document.createTextNode(e.caption(t));return m._chip(e.toMarkup(t),i)}static _chip(e,t){let n=document.createElement("span");return n.className="u2-msg-chip",n.setAttribute("contenteditable","false"),n.dataset.u2="msg-chip",n.dataset.token=e,n.append(t),n}_selection(){if("function"!=typeof window.getSelection)return null;let e=window.getSelection();if(!e||0===e.rangeCount)return null;let t=e.anchorNode;return t&&this._editor.contains(t)?{node:t,offset:e.anchorOffset}:null}_caretTo(e,t){if("function"!=typeof window.getSelection||"function"!=typeof document.createRange)return;let n=window.getSelection();if(!n)return;let r=document.createRange();r.setStart(e,t),r.collapse(!0),n.removeAllRanges(),n.addRange(r)}_insertAtCaret(...e){let t=this._selection(),n=this._editor,r=null;if(t&&3===t.node.nodeType){let e=t.node,i=null!=(l=e.textContent)?l:"";n=null!=(s=e.parentNode)?s:this._editor,e.textContent=i.substring(0,t.offset),r=e.nextSibling;let o=i.substring(t.offset);""!==o&&(r=n.insertBefore(document.createTextNode(o),r))}else t&&(r=null!=(u=(n=t.node).childNodes[t.offset])?u:null);var i=!0,o=!1,a=void 0;try{for(var l,s,u,d,c=e[Symbol.iterator]();!(i=(d=c.next()).done);i=!0){let e=d.value;n.insertBefore(e,r)}}catch(e){o=!0,a=e}finally{try{i||null==c.return||c.return()}finally{if(o)throw a}}let p=e[e.length-1];p&&this._caretTo(n,Array.from(n.childNodes).indexOf(p)+1)}_startSession(e,t){var n,o,s,u,d,c;let p=new i.HG,h=(0,r.vP)(m._queryText(t,e.trigger)),f=new a._(e.fetch,{debounceMs:e.debounceMs});p.own(()=>f.dispose());let g=f.state,v=(0,r.EW)(()=>{let e=g.value;return"ready"===e.kind?e.items:[]}),b=e.renderer,y=null!=(n=null==b||null==(d=b.listItem)?void 0:d.bind(b))?n:null==b||null==(c=b.markup)?void 0:c.bind(b),_=null!=(o=null!=(s=e.renderItem)?s:y)?o:t=>l.j.row("u2-msg-text",e.caption(t)),w=new l.j({prefix:"u2-msg",anchor:t,scope:p,items:v,view:g,text:h,minChars:null!=(u=e.minChars)?u:0,render:_,autoHighlight:!0,onPick:e=>this._pick(e),onDismiss:()=>this._closeSession(),onRetry:()=>f.retry()}),x={provider:e,span:t,scope:p,source:f,list:w,query:h,items:v};this._session=x,this._open.value=!0,w.open(),this._refreshQuery(x)}static _queryText(e,t){var n;return(null!=(n=e.textContent)?n:"").substring(t.length)}_refreshQuery(e){var t;let n=m._queryText(e.span,e.provider.trigger);e.query.value=n,n.length>=(null!=(t=e.provider.minChars)?t:0)&&e.source.query(n)}_endSession(){let e=this._session;if(void 0!==e)return this._session=void 0,this._open.value=!1,e.list.dismiss(),e.scope.dispose(),e}_closeSession(){let e=this._endSession(),t=null==e?void 0:e.span;if(t){if(t.isConnected){var n,r;let e=t.parentNode,i=document.createTextNode(null!=(n=t.textContent)?n:"");e.insertBefore(i,t),t.remove(),this._caretTo(i,(null!=(r=i.textContent)?r:"").length)}this._refreshEmpty()}}_pick(e){let t=this._session;if(void 0===t)return;let n=t.items.peek()[e];void 0!==n&&this._replaceQuery(t,n)}_replaceQuery(e,t){let n=e.provider,r=e.span;this._endSession();let i=r.parentNode;if(null===i)return;let o=document.createTextNode(" ");i.insertBefore(this._chipFor(n,t),r),i.insertBefore(o,r),r.remove(),this._caretTo(o,1),this._editor.focus(),this._afterEdit()}_maybeOpen(){let e=this._selection();if(!e||3!==e.node.nodeType)return;let t=(null!=(o=e.node.textContent)?o:"").substring(0,e.offset);var n=!0,r=!1,i=void 0;try{for(var o,a,l=this._providers[Symbol.iterator]();!(n=(a=l.next()).done);n=!0){let n=a.value,r=RegExp(`(?:^|\\s)(${m._escape(n.trigger)}\\w*)$`).exec(t);if(null!==r)return void this._wrapQuery(n,e.node,e.offset-r[1].length,e.offset)}}catch(e){r=!0,i=e}finally{try{n||null==l.return||l.return()}finally{if(r)throw i}}}static _escape(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}_wrapQuery(e,t,n,r){var i,o,a;let l=t.parentNode;if(null===l)return;let s=null!=(i=t.textContent)?i:"",u=document.createElement("span");u.className="u2-msg-query",u.textContent=s.substring(n,r),t.textContent=s.substring(0,n);let d=t.nextSibling;l.insertBefore(u,d);let c=s.substring(r);""!==c&&l.insertBefore(document.createTextNode(c),d),this._startSession(e,u),this._caretTo(null!=(o=u.firstChild)?o:u,(null!=(a=u.textContent)?a:"").length)}_onInput(){let e=this._session;e?this._refreshQuery(e):this._maybeOpen(),this._afterEdit()}_onKeyDown(e){let t=this._session;if(t)switch(e.key){case"ArrowDown":e.preventDefault(),t.list.move(1);return;case"ArrowUp":e.preventDefault(),t.list.move(-1);return;case"Escape":e.stopPropagation(),this._closeSession();return;case" ":0===t.items.peek().length&&"loading"!==t.source.state.peek().kind&&this._closeSession();return;case"Enter":if(t.list.activeIndex.peek()>=0){e.preventDefault(),e.stopPropagation(),this._pick(t.list.activeIndex.peek());return}}switch(e.key){case"Enter":this._onEnter(e);break;case"Backspace":this._onDelete(e,-1);break;case"Delete":this._onDelete(e,1)}}_onEnter(e){var t;e.preventDefault();let n=e.ctrlKey||e.metaKey;((null!=(t=this._options.sendOn)?t:"ctrlEnter")==="enter"?n||e.shiftKey:!n)?(this._insertAtCaret(document.createTextNode("\n")),this._afterEdit()):this.send()}_onDelete(e,t){let n=this._chipAtCaret(t);null!==n&&(e.preventDefault(),n.remove(),this._afterEdit())}_chipAtCaret(e){var t,n;let r,i=this._selection();if(null===i)return null;if(3===i.node.nodeType){let t=(null!=(n=i.node.textContent)?n:"").length;if(i.offset!==(e<0?0:t))return null;r=e<0?m._previous(i.node):i.node.nextSibling}else r=null!=(t=i.node.childNodes[e<0?i.offset-1:i.offset])?t:null;return null!==r&&1===r.nodeType&&r.classList.contains("u2-msg-chip")?r:null}static _previous(e){let t=e.parentNode;if(null===t)return null;let n=Array.from(t.childNodes).indexOf(e);return n>0?t.childNodes[n-1]:null}_afterEdit(){let e=this.value;this._refreshEmpty(e),this._saveDraft(e)}_refreshEmpty(e){let t=void 0===e?this.value:e;this._empty.value=""===t.trim(),this._editor.classList.toggle("u2-msg-editor-empty",""===t)}_saveDraft(e){let t=this._draftKey;if(void 0!==t)try{""===e?window.localStorage.removeItem(t):window.localStorage.setItem(t,e)}catch(e){return}}_restoreDraft(){let e=this._draftKey;if(void 0!==e)try{var t;return null!=(t=window.localStorage.getItem(e))?t:void 0}catch(e){return}}constructor(e){var t,n,i,o;let a=void 0===e?{}:e;super(),this._editor=document.createElement("div"),this._empty=(0,r.vP)(!0),this._open=(0,r.vP)(!1),this._owners=[],this._options=a,this._providers=null!=(t=a.mentions)?t:[],this._draftKey=void 0===a.draftKey?void 0:`u2-msg-draft-${a.draftKey}`,this.empty=this._empty,this.isMentionOpen=this._open,this._tokens=this._buildTokens(),this.root.classList.add("u2-msg"),this.root.dataset.u2="message-input";const l=this._editor;l.className="u2-msg-editor",l.setAttribute("contenteditable","true"),l.setAttribute("role","textbox"),l.setAttribute("aria-multiline","true"),l.dataset.placeholder=null!=(n=a.placeholder)?n:"",l.style.maxHeight=`${null!=(i=a.maxHeight)?i:160}px`,this.build(()=>{let e=document.createElement("div");e.className="u2-msg-tools";var t=!0,n=!1,r=void 0;try{for(var i,o,a=this._providers[Symbol.iterator]();!(t=(o=a.next()).done);t=!0){let t=o.value,n=(0,d.gb)(null!=(i=p[t.trigger])?i:"at",()=>this.openMentions(t),{tooltip:`Mention (${t.trigger})`});this.scope.listen(n,"mousedown",e=>e.preventDefault()),e.append(n)}}catch(e){n=!0,r=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw r}}let c=(0,s.x6)("Send",()=>this.send(),{primary:!0});c.classList.add("u2-msg-send");let h=document.createElement("div");h.className="u2-msg-toolbar",h.append(e,c),this.root.append(l,h),this.effect(()=>u.B.apply(c,this._empty.value?"Type a message first":null))}),this.scope.listen(l,"input",()=>this._onInput()),this.scope.listen(l,"keydown",e=>this._onKeyDown(e)),this.scope.listen(l,"blur",()=>this._closeSession()),this.own(()=>this._closeSession());const c=null!=(o=a.value)?o:this._restoreDraft();void 0!==c?this.value=c:this._refreshEmpty()}}},5363(e,t,n){n.d(t,{Q:()=>s});var r=n(7974),i=n(7115),o=n(9947);let a=/^-?\d+$/,l=/^-?(\d+\.?\d*|\.\d+)([eE][-+]?\d+)?$/;class s extends r.p{get min(){return this.options.min}set min(e){this._setBound("min",e)}get max(){return this.options.max}set max(e){this._setBound("max",e)}get step(){return this.options.step}set step(e){this._setBound("step",e)}_setBound(e,t){this.options[e]=null!=t?t:void 0;let n=this.options,r=n.min,i=n.max,o=n.step;null!==this._slider&&void 0!==r&&void 0!==i&&(this._slider.min=String(r),this._slider.max=String(i),this._slider.step=String(null!=o?o:this._int?1:(i-r)/100),this._syncSlider()),this.revalidate()}createEditor(){this._bad=(0,i.vP)(null),this._slider=null;let e=document.createElement("input");this._input=e,e.type="text",e.autocomplete="off",e.inputMode=this._int?"numeric":"decimal";let t=!1;this.effect(()=>{let n=this.value;t?t=!1:s._sameFloat32(this._parse(e.value),n)||(e.value=this._format(n)),this._syncSlider()}),this.scope.listen(e,"input",()=>{let n=this._parse(e.value);if(this._bad.value=void 0!==n?null:this._int&&l.test(e.value.trim())?"Must be a whole number":"Not a number",void 0===n||"change"===this.options.commitOn)return;let r=this.peek();this.value=n,t=!Object.is(this.peek(),r)}),this.scope.listen(e,"blur",()=>this._commit()),this.scope.listen(e,"keydown",e=>this._onKeyDown(e)),this.scope.listen(e,"wheel",t=>{document.activeElement===e&&(t.preventDefault(),this._step(t.deltaY<0?1:-1))},{passive:!1});let n=document.createElement("span");n.className="u2-number-box",n.append(e),this.options.spinner&&n.append(this._createSpinner());let r=document.createElement("div");r.className="u2-number",r.append(n),this.options.clicker&&(this.addRail(this._createClicker("minus",-1,"Decrease"),{edits:!0}),this.addRail(this._createClicker("plus",1,"Increase"),{edits:!0}));let o=this._createSlider();return null!==o&&r.append(o),this.addValidator(()=>this._bad.value),this.addValidator(e=>this._outOfRange(e)),r}get _int(){return"int"===this.options.mode}_createSpinner(){let e=document.createElement("span");return e.className="u2-number-spinner",e.append(this._createStep("▴",1,"Increase"),this._createStep("▾",-1,"Decrease")),this.scope.listen(e,"mousedown",e=>e.preventDefault()),e}_createStep(e,t,n){let r=document.createElement("button");return r.type="button",r.className="u2-number-spin",r.textContent=e,r.setAttribute("aria-label",n),this.scope.listen(r,"click",()=>this._step(t)),r}_createClicker(e,t,n){let r=this._createStep("",t,n);return r.className="u2-number-click",r.append((0,o.K)(e)),r}_createSlider(){let e=this.options,t=e.min,n=e.max,r=e.step;if(!0!==this.options.slider||void 0===t||void 0===n||n<=t)return null;let i=document.createElement("input");return i.type="range",i.className="u2-number-slider",i.min=String(t),i.max=String(n),i.step=String(null!=r?r:this._int?1:(n-t)/100),this.scope.listen(i,"input",()=>{let e=Number(i.value);this._set(this._int?Math.round(e):e)}),this._slider=i,this._syncSlider(),i}_syncSlider(){if(null===this._slider)return;let e=this.peek();this._slider.value=null==e?"":String(e)}_onKeyDown(e){if("Enter"===e.key)return void this._commit();let t="ArrowUp"===e.key?1:"ArrowDown"===e.key?-1:0;t&&(e.preventDefault(),this._step(t*(e.shiftKey?10:1)))}_step(e){var t;let n=this.peek();if(null==n||this.readOnly)return;let r=n+e*(null!=(t=this.options.step)?t:1),i=this._int?Math.round(r):Number(r.toPrecision(12));this._set(null===this._outOfRange(n)?this._clamp(i):i)}resetEditor(){this._bad.value=null,this._input.value=this._format(this.peek()),this._syncSlider()}get unreadable(){return null!==this._bad.value}_commit(){let e=this._parse(this._input.value);void 0!==e&&this._set(e)}_set(e){this._bad.value=null,this.value=e,this._input.value=this._format(this.peek()),this._syncSlider()}_parse(e){let t=e.trim();return t?(this._int?a:l).test(t)?Number(t):void 0:null}_clamp(e){let t=this.options,n=t.min,r=t.max;return void 0!==n&&e<n?n:void 0!==r&&e>r?r:e}_outOfRange(e){let t=this.options,n=t.min,r=t.max;return null==e?null:void 0!==n&&e<n?`Value must be at least ${n}`:void 0!==r&&e>r?`Value must be at most ${r}`:null}_format(e){if(null==e)return"";let t=this.options.format;if(void 0!==t)return t(e);if(this._int)return String(e);e=s._shortest(e);let n=this._decimals(e);if(n>0)return e.toFixed(n);let r=Number(e.toFixed(6));return String(0===r&&0!==e?e:r)}static _shortest(e){if(Math.fround(e)!==e)return e;for(let t=1;t<=9;t++){let n=Number(e.toPrecision(t));if(Math.fround(n)===e)return n}return e}static _sameFloat32(e,t){return null!=e&&null!=t&&Math.fround(e)===Math.fround(t)}_decimals(e){let t=this.options,n=t.min,r=t.max,i=t.step,o=s._decimalsOf(e);for(let e=0,t=[n,r,i];e<t.length;e++){let n=t[e];o=Math.max(o,s._decimalsOf(n))}return o}static _decimalsOf(e){if(null==e)return 0;let t=String(e);if(t.includes("e")||t.includes("E"))return 0;let n=t.lastIndexOf(".");return n<0?0:t.length-n-1}constructor(e){let t=void 0===e?{}:e;super(t,null),this.root.dataset.u2="number-input",this.liveOption("placeholder",t.placeholder,e=>this._input.placeholder=e)}}},2939(e,t,n){var r=n(7974);n(8609),n(108);r.p},1283(e,t,n){n.d(t,{C:()=>a});var r=n(7974),i=n(7115),o=n(1781);class a extends r.p{createEditor(){this._bad=(0,i.vP)(!1);let e=document.createElement("input");this._input=e,e.type="text",e.autocomplete="off";let t=!1;return this.effect(()=>{let n=this.value;t?t=!1:e.value=o.e.format(null!=n?n:null,this.options.format)}),this.scope.listen(e,"input",()=>{let e=this._parse();if(void 0===e||"change"===this.options.commitOn)return;let n=this.peek();this.value=e,t=!Object.is(this.peek(),n)}),this.scope.listen(e,"blur",()=>this._commit()),this.scope.listen(e,"keydown",e=>{"Enter"===e.key&&this._commit()}),this.addValidator(()=>this._bad.value?"Not a qualified number":null),e}get unreadable(){return this._bad.value}_commit(){var e;let t=this._parse();void 0!==t&&(this.value=t,this._input.value=o.e.format(null!=(e=this.peek())?e:null,this.options.format))}_parse(){let e=this._input.value.trim(),t=""===e?null:o.e.parse(e);return this._bad.value=""!==e&&null===t,this._bad.peek()?void 0:t}constructor(e){let t=void 0===e?{}:e;super(t,null),this.root.dataset.u2="qnum-input",this.liveOption("placeholder",t.placeholder,e=>this._input.placeholder=e)}}},5557(e,t,n){n.d(t,{A:()=>i});var r=n(7974);class i extends r.p{get items(){return this._items}set items(e){this.setItems(null!=e?e:[])}get itemTooltips(){return this.options.itemTooltips}set itemTooltips(e){this.options.itemTooltips=null!=e?e:void 0,this._fill(),this._apply(this.peek())}setItems(e){this._items=e,this._fill();let t=this.peek();this.value=null!=t&&e.includes(t)?t:null,this._apply(this.peek())}getItems(e){let t=this.peek();return r.p.itemsState(this._items.map((e,n)=>({key:e,label:e,index:n,checked:e===t,rendered:!0})),null==e?void 0:e.all)}displayText(){var e;return null!=(e=this.peek())?e:""}createEditor(){this._name=`u2-radio-${++i._seq}`,this._items=this.options.items;let e=document.createElement("div");return this._group=e,e.className="u2-radio",e.setAttribute("role","radiogroup"),this.options.buttons&&e.classList.add("u2-radio-buttons"),this._fill(),this.scope.listen(e,"change",()=>{let e=this._radios.find(e=>e.checked);this.value=e?e.value:null}),this.effect(()=>this._apply(this.value)),e}_fill(){let e=this.options.itemTooltips;this._group.textContent="",this._radios=[];var t=!0,n=!1,r=void 0;try{for(var i,o=this._items[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){let t=i.value,n=document.createElement("label");n.className="u2-radio-item",n.dataset.u2Item=t;let r=document.createElement("input");r.type="radio",r.name=this._name,r.value=t,r.dataset.value=t,r.className="u2-input-radio";let o=document.createElement("span");o.dataset.u2Part="item-label",o.textContent=t,n.append(r,o);let a=e?e[t]:void 0;a&&(n.title=a),this._group.append(n),this._radios.push(r)}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}this.refreshDisabled()}_apply(e){var t=!0,n=!1,r=void 0;try{for(var i,o=this._radios[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){let t=i.value;t.checked=t.value===e,t.parentElement.classList.toggle("u2-radio-pressed",t.checked)}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}}constructor(e){super(e,null),this.root.dataset.u2="radio-input"}}i._seq=0},9050(e,t,n){n.d(t,{F:()=>s});var r=n(7115),i=n(9701),o=n(1518),a=n(8609),l=n(4977);class s extends i.Ec{getState(){var e,t;let n=this.lo.peek(),r=this.hi.peek();return e=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},super.getState()),t=t={value:[n,r],text:`${this._format(n)} – ${this._format(r)}`},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}get min(){var e;return null!=(e=this.options.min)?e:0}set min(e){this.options.min=e,this._relayout()}get max(){var e;return null!=(e=this.options.max)?e:100}set max(e){this.options.max=e,this._relayout()}get step(){return this.options.step}set step(e){this.options.step=e,this._relayout()}get minRange(){var e;return null!=(e=this.options.minRange)?e:0}set minRange(e){this.options.minRange=e,this._relayout()}get vertical(){var e;return null!=(e=this.options.vertical)&&e}get label(){var e;return null!=(e=this.root.getAttribute("aria-label"))?e:""}set label(e){e?this.root.setAttribute("aria-label",e):this.root.removeAttribute("aria-label")}_relayout(){this._layout.value=this._layout.peek()+1}setValues(e,t){let n=Math.min(Math.max(e,this.min),this.max),i=Math.min(Math.max(Math.max(t,n+this.minRange),this.min),this.max);(0,r.vA)(()=>{this.lo.value=n,this.hi.value=i})}_format(e){return this.options.format?this.options.format(e):String(Math.round(100*e)/100)}_createHandle(e,t){let n=(0,a.y4)([],`u2-range-handle u2-range-handle-${e}`);return n.tabIndex=0,n.setAttribute("role","slider"),n.setAttribute("aria-label",t),this.vertical&&n.setAttribute("aria-orientation","vertical"),this.scope.listen(n,"keydown",t=>this._onKeyDown(t,e)),l.m.bind(n,()=>this._format(("lo"===e?this.lo:this.hi).peek()),{owner:this.scope}),n}_valueAt(e){let t=this._track.getBoundingClientRect(),n=this.vertical?t.height:t.width;if(0===n)return this.min;let r=this.vertical?(t.bottom-e.clientY)/n:(e.clientX-t.left)/n;return this.min+Math.min(Math.max(r,0),1)*(this.max-this.min)}_snap(e){let t=this.options.step;return t&&t>0?this.min+Math.round((e-this.min)/t)*t:e}_keyStep(){let e=this.options.step;return e&&e>0?e:this.max>this.min?(this.max-this.min)/100:1}_onKeyDown(e,t){let n,r=this._keyStep(),i="lo"===t?this.lo.peek():this.hi.peek();switch(e.key){case"ArrowRight":case"ArrowUp":n=i+r;break;case"ArrowLeft":case"ArrowDown":n=i-r;break;case"PageUp":n=i+10*r;break;case"PageDown":n=i-10*r;break;case"Home":n=this.min;break;case"End":n=this.max;break;default:return}e.preventDefault(),this._writeEnd(t,n),this._fire("input"),this._fire("change")}_writeEnd(e,t){"lo"===e?this.lo.value=Math.min(Math.max(t,this.min),this.hi.peek()-this.minRange):this.hi.value=Math.max(Math.min(t,this.max),this.lo.peek()+this.minRange)}_onPointerDown(e){let t,n=e.target,i=this._valueAt(e),o=this.lo.peek(),a=this.hi.peek(),s=!1;this._loHandle.contains(n)?(t="lo",s=!0):this._hiHandle.contains(n)?(t="hi",s=!0):t=n===this._band||i>o&&i<a?"band":i<=o?"lo":"hi";let u=s?("lo"===t?o:a)-i:0;e.preventDefault();let d=e=>{let n=this._valueAt(e);if("band"===t){let e=a-o,t=Math.min(Math.max(this._snap(o+n-i),this.min),this.max-e);(0,r.vA)(()=>{this.lo.value=t,this.hi.value=t+e}),l.m.show(`${this._format(t)} – ${this._format(t+e)}`,this._band)}else{this._writeEnd(t,this._snap(n+u));let e="lo"===t?this._loHandle:this._hiHandle;l.m.show(this._format("lo"===t?this.lo.peek():this.hi.peek()),e)}this._fire("input")},c=e=>d(e),p=()=>{window.removeEventListener("pointermove",c),window.removeEventListener("pointerup",h),this.scope.disown(p)},h=()=>{p(),l.m.hide(),this._fire("change")};window.addEventListener("pointermove",c),window.addEventListener("pointerup",h),this.scope.own(p),"band"===t||s||d(e)}_fire(e){this.root.dispatchEvent(new CustomEvent(e))}_render(){this._layout.value;let e=this.max-this.min,t=t=>e<=0?0:Math.min(Math.max((t-this.min)/e,0),1),n=this.lo.value,r=this.hi.value,i=t(n),o=Math.max(t(r),i),a=e=>`${100*e}%`;this.vertical?(this._band.style.bottom=a(i),this._band.style.height=a(o-i),this._loHandle.style.bottom=a(i),this._hiHandle.style.bottom=a(o)):(this._band.style.left=a(i),this._band.style.width=a(o-i),this._loHandle.style.left=a(i),this._hiHandle.style.left=a(o)),this._aria(this._loHandle,n,this.min,r-this.minRange),this._aria(this._hiHandle,r,n+this.minRange,this.max)}_aria(e,t,n,r){e.setAttribute("aria-valuenow",String(t)),e.setAttribute("aria-valuemin",String(n)),e.setAttribute("aria-valuemax",String(r)),e.setAttribute("aria-valuetext",this._format(t))}constructor(e){var t,n,i;let l=void 0===e?{}:e;super(),this._layout=(0,r.vP)(0),this._track=(0,a.y4)([],"u2-range-track"),this._band=(0,a.y4)([],"u2-range-band"),this.options=l,this.lo=l.lo instanceof r.HN?l.lo:(0,r.vP)(null!=(t=l.lo)?t:this.min),this.hi=l.hi instanceof r.HN?l.hi:(0,r.vP)(null!=(n=l.hi)?n:this.max),this.root.classList.add("u2-range-slider"),this.root.classList.toggle("u2-range-slider-vertical",this.vertical),this.root.dataset.u2="range-slider",this.root.setAttribute("role","group"),l.label&&this.root.setAttribute("aria-label",l.label),this._loHandle=this._createHandle("lo","Minimum"),this._hiHandle=this._createHandle("hi","Maximum"),this.root.append(this._track,this._band,this._loHandle,this._hiHandle),this.effect(()=>this._render());const s=l.onChanged&&(null!=(i=o.HG.ambient)?i:this.scope).bind(l.onChanged);let u=!0;this.effect(()=>{let e=this.lo.value,t=this.hi.value;u?u=!1:(0,r.O8)(()=>{null==s||s(e,t,this),this.fireEvent("change",[e,t])})}),this.scope.listen(this.root,"pointerdown",e=>this._onPointerDown(e))}}},6404(e,t,n){n.d(t,{$:()=>p});var r=n(7974),i=n(7115),o=n(8609),a=n(4860),l=n(9947),s=n(108),u=n(7036);function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}class p extends r.p{get records(){return this._rows.peek().map(e=>e.record)}get readOnly(){return super.readOnly}set readOnly(e){super.readOnly=e;var t=!0,n=!1,r=void 0;try{for(var i,o=this._cells()[Symbol.iterator]();!(t=(i=o.next()).done);t=!0)i.value.readOnly=e}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}}get disabled(){return super.disabled}set disabled(e){super.disabled=e;var t=!0,n=!1,r=void 0;try{for(var i,o=this._cells()[Symbol.iterator]();!(t=(i=o.next()).done);t=!0)i.value.disabled=e}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}}getItems(e){return r.p.itemsState(this._rows.peek().map((e,t)=>c({key:this._keyOf(e.record,t),label:p._text(e),index:t,rendered:!0},e.cells.some(e=>null!==e.validity.peek())?{invalid:!0}:{})),null==e?void 0:e.all)}add(e,t){var n,r,o;let a=void 0===e?null!=(n=null==(r=(o=this.options).newItem)?void 0:r.call(o))?n:{}:e,l=this._rows.peek().slice(),s={id:this._nextId++,record:a,cells:[]};l.splice(null!=t?t:l.length,0,s),this._rows.value=l,this._commit();let u=()=>{var e;return null==(e=s.cells[0])?void 0:e.focus()};s.cells.length>0?u():(0,i.vn)(this.scope.bind(u))}remove(e){let t=this._rows.peek().slice();t.splice(e,1),this._rows.value=t,this._commit()}move(e,t){this._place(e,t),this._commit()}displayText(){return this._rows.peek().map(p._text).join(", ")}createEditor(){let e=this.options;this._nextId=0,this._rows=(0,i.vP)([]),this._built=(0,i.vP)(0);let t=(0,o.y4)([],"u2-records");t.setAttribute("role","grid");let n=[e.orderable?"16px":null,...e.columns.map(e=>{var t;return null!=(t=e.width)?t:"1fr"}),!1===e.allowRemove?null:"24px"].filter(e=>null!==e).join(" ");t.style.setProperty("--u2-records-tracks",n);let r=(0,o.y4)([],"u2-records-row u2-records-head");r.setAttribute("role","row"),e.orderable&&r.append((0,o.Ln)(""));var s,u=!0,d=!1,c=void 0;try{for(var p,h,m=e.columns[Symbol.iterator]();!(u=(h=m.next()).done);u=!0){let e=h.value,t=(0,o.Ln)(null!=(p=e.header)?p:e.name,"u2-records-header");t.setAttribute("role","columnheader"),r.append(t)}}catch(e){d=!0,c=e}finally{try{u||null==m.return||m.return()}finally{if(d)throw c}}if(!1!==e.allowRemove&&r.append((0,o.Ln)("")),this._body=(0,o.y4)([],"u2-records-body"),t.append(r,this._body),this.effect(()=>{r.hidden=0===this._rows.value.length}),(0,a._)(this._body,this._rows,e=>String(e.id),e=>this._row(e)),!1!==e.allowAdd){let n=(0,o.nf)(null!=(s=e.addText)?s:"Add",()=>this.add());n.prepend((0,l.K)("plus",{cls:"u2-records-add-icon"})),n.classList.add("u2-records-add"),n.dataset.u2Part="add",t.append(n)}return this._problem=(0,i.EW)(()=>{this._built.value;let t=this._rows.value;for(let o=0;o<t.length;o++)for(let a=0;a<t[o].cells.length;a++){let l=t[o].cells[a].validity.value;if(null!==l){var n,r,i;let s=e.columns.length>1?`${null!=(n=e.columns[a].header)?n:e.columns[a].name}: `:"";return`${null!=(r=null==(i=e.rowName)?void 0:i.call(e,t[o].record,o))?r:`Row ${o+1}`}: ${s}${l}`}}return null}),this.addValidator(()=>this._problem.value),this.effect(()=>{var e;let t=null!=(e=this.value)?e:[],n=(0,i.O8)(()=>this._rows.value);(t.length!==n.length||t.some((e,t)=>e!==n[t].record))&&(0,i.O8)(()=>this._rows.value=t.map(e=>({id:this._nextId++,record:e,cells:[]})))}),t}resetEditor(){var e=!0,t=!1,n=void 0;try{for(var r,i=this._rows.peek()[Symbol.iterator]();!(e=(r=i.next()).done);e=!0){let e=r.value;var o=!0,a=!1,l=void 0;try{for(var s,u=e.cells[Symbol.iterator]();!(o=(s=u.next()).done);o=!0){let e=s.value;e.reset(e.peek())}}catch(e){a=!0,l=e}finally{try{o||null==u.return||u.return()}finally{if(a)throw l}}}}catch(e){t=!0,n=e}finally{try{e||null==i.return||i.return()}finally{if(t)throw n}}}_row(e){let t,n=this.options,r=e.el=(0,o.y4)([],"u2-records-row");if(r.setAttribute("role","row"),r.dataset.u2Item=this._keyOf(e.record,this._rows.peek().indexOf(e)),n.orderable&&(t=u._.handle(),r.append(t)),e.cells=n.columns.map(t=>{var n;let o=t.input(e.record[t.name],e.record);o.root.classList.add("u2-records-cell","u2-input-fill"),""===o.label&&(o.label=null!=(n=t.header)?n:t.name);let a=!0;return o.effect(()=>{var n,r;let l=o.value;if(a||Object.is(l,e.record[t.name])){a=!1;return}n=c({},e.record),r=r={[t.name]:l},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(r)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}),e.record=n,(0,i.O8)(()=>this._commit())}),this.readOnly&&(o.readOnly=!0),null!==this.disabled&&(o.disabled=this.disabled),r.append(o.root),o}),!1!==n.allowRemove){let t=(0,s.gb)("minus",()=>this.remove(this._rows.peek().indexOf(e)),{tooltip:"Remove"});t.classList.add("u2-records-remove"),r.append(t)}return void 0!==t&&u._.wire(r,t,()=>Array.from(this._body.children),(e,t)=>this._place(e,t),()=>this._commit()),this._built.value++,r}_cells(){var e,t;return null!=(e=null==(t=this._rows)?void 0:t.peek().flatMap(e=>e.cells))?e:[]}_place(e,t){var n;let r=this._rows.peek().slice(),i=(function(e){if(Array.isArray(e))return e}(n=r.splice(e,1))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var i=[],o=!0,a=!1;try{for(r=r.call(e);!(o=(t=r.next()).done)&&(i.push(t.value),1!==i.length);o=!0);}catch(e){a=!0,n=e}finally{try{o||null==r.return||r.return()}finally{if(a)throw n}}return i}}(n)||function(e){if(e){if("string"==typeof e)return d(e,1);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return d(e,1)}}(n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0];r.splice(t,0,i),this._rows.value=r}_commit(){var e;let t=this._rows.peek();for(let e=0;e<t.length;e++)void 0!==t[e].el&&(t[e].el.dataset.u2Item=this._keyOf(t[e].record,e));let n=this.records,r=null!=(e=this.peek())?e:[];(n.length!==r.length||n.some((e,t)=>e!==r[t]))&&(this.value=n)}_keyOf(e,t){var n,r,i,o;let a=null!=(n=null==(r=(i=this.options).keyOf)?void 0:r.call(i,e,t))?n:e[null==(o=this.options.columns[0])?void 0:o.name];return null==a||""===a?`#${t}`:String(a)}static _text(e){return e.cells.map(e=>{var t;return null!=(t=e.getState().text)?t:""}).filter(e=>""!==e).join(" ")}constructor(e){super(e,[]),this.root.dataset.u2="records-input"}}},7036(e,t,n){n.d(t,{_:()=>o});var r=n(8609),i=n(9947);class o{static handle(){let e=(0,i.K)("grip-vertical",{cls:"u2-reorder-grip"});return e.dataset.u2Part="handle",e}static wire(e,t,n,i,a){let l=t=>{let r=n(),o=r.indexOf(e),a=Math.max(0,Math.min(r.length-1,t(o,r.length)));return!(o<0)&&a!==o&&(i(o,a),!0)};(0,r.on)(e,"keydown",e=>{if(!e.altKey||e.defaultPrevented||"ArrowUp"!==e.key&&"ArrowDown"!==e.key)return;e.preventDefault();let t=document.activeElement;l(t=>t+("ArrowUp"===e.key?-1:1))&&a(),queueMicrotask(()=>{null!==t&&t!==document.activeElement&&t.isConnected&&t.focus()})});let s=!1;(0,r.on)(t,"pointerdown",n=>{var r;0===n.button&&(n.preventDefault(),null==(r=t.setPointerCapture)||r.call(t,n.pointerId),s=!0,e.classList.add("u2-reorder-dragging"))}),(0,r.on)(t,"pointermove",t=>{s&&l(()=>n().filter(n=>n!==e&&o._middle(n)<t.clientY).length)});let u=()=>{s&&(s=!1,e.classList.remove("u2-reorder-dragging"),a())};(0,r.on)(t,"pointerup",u),(0,r.on)(t,"pointercancel",u)}static _middle(e){let t=e.getBoundingClientRect();return t.top+t.height/2}}},2943(e,t,n){n.d(t,{C:()=>o});var r=n(7974),i=n(4977);class o extends r.p{get min(){return this.options.min}set min(e){this.options.min=null!=e?e:void 0,this._bounds()}get max(){return this.options.max}set max(e){this.options.max=null!=e?e:void 0,this._bounds()}get step(){return this.options.step}set step(e){this.options.step=null!=e?e:void 0,this._bounds()}createEditor(){let e=document.createElement("input");this._range=e,e.type="range",e.className="u2-slider-track",this._bounds();let t=!1;this.effect(()=>{var n;let r=this.value;t?t=!1:e.value=String(null!=(n=null!=r?r:this.options.min)?n:0)});let n=()=>{let n=this.peek();this.value=Number(e.value),t=!Object.is(this.peek(),n)};this.scope.listen(e,"input",()=>{"change"!==this.options.commitOn&&n(),i.m.show(this._format(Number(e.value)),e)}),"change"===this.options.commitOn&&this.scope.listen(e,"change",n),i.m.bind(e,()=>this.text,{owner:this.scope});let r=document.createElement("div");return r.className="u2-slider",r.append(e),r}_bounds(){var e,t,n,r;let i=null!=(e=this.options.min)?e:0,o=null!=(t=this.options.max)?t:100,a=this._range;a.min=String(i),a.max=String(o),a.step=String(null!=(n=this.options.step)?n:o>i?(o-i)/100:1),a.value=String(null!=(r=this.peek())?r:i)}get text(){let e=this.peek();return null==e?"":this._format(e)}_format(e){let t=this.options.format;return t?t(e):String(Math.round(100*e)/100)}constructor(e){super(void 0===e?{}:e,null),this.root.dataset.u2="slider-input"}}},476(e,t,n){n.d(t,{Z:()=>u});var r=n(7115),i=n(7974),o=n(8191),a=n(6090),l=n(2357);function s(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}class u extends i.p{getState(){var e,t;return e=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},super.getState()),t=t={open:this._list.isOpen.peek(),busy:"loading"===this._source.state.peek().kind},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}getItems(e){let t=this._list.isOpen.peek();return i.p.itemsState(this._items.peek().map((e,n)=>({key:e,label:e,index:n,rendered:t})),null==e?void 0:e.all)}revealItem(e){var t,n=this,r=()=>super.revealItem;return(t=function*(){this._list.clearActive(),this._source.query(""),this._list.open();for(let e=0;e<50&&"loading"===this._source.state.peek().kind;e++)yield new Promise(e=>setTimeout(e,20));return r().call(n,e)},function(){var e=this,n=arguments;return new Promise(function(r,i){var o=t.apply(e,n);function a(e){s(o,r,i,a,l,"next",e)}function l(e){s(o,r,i,a,l,"throw",e)}a(void 0)})}).call(this)}createEditor(){var e,t;let n=document.createElement("input");n.type="text",n.autocomplete="off",n.placeholder=null!=(e=this.options.placeholder)?e:"",n.setAttribute("role","combobox"),n.setAttribute("aria-autocomplete","list");let i=new a._(this.options.source,{debounceMs:this.options.debounceMs});return this._source=i,this.own(()=>i.dispose()),this.effect(()=>{"loading"===i.state.value.kind?this.root.setAttribute("aria-busy","true"):this.root.removeAttribute("aria-busy")}),this._items=(0,r.EW)(()=>{let e=i.state.value;return"ready"===e.kind?e.items:[]}),this._list=new l.j({prefix:"u2-typeahead",anchor:n,scope:this.scope,items:this._items,view:i.state,text:this.signal,minChars:null!=(t=this.options.minChars)?t:0,render:e=>{var t,n,r;return null!=(t=null==(n=(r=this.options).renderItem)?void 0:n.call(r,e))?t:l.j.row("u2-typeahead-text",e)},onPick:e=>{this._accept(e),n.focus()},onDismiss:()=>this._list.dismiss(),onRetry:()=>i.retry()}),this.scope.listen(n,"input",()=>this._typing=!0),(0,o.n)(n,this.signal,{owner:this.scope}),this.scope.listen(n,"focus",()=>this._anchorValue=this.peek()),this.scope.listen(n,"input",()=>this._onInput()),this.effect(()=>{let e=this.value;this._typing||(this._anchorValue=e)}),this.scope.listen(n,"keydown",e=>this._onKeyDown(e)),this.scope.listen(n,"blur",()=>this._list.dismiss()),this.options.openOnFocus&&(this.scope.listen(n,"focus",()=>this._showAll()),this.scope.listen(n,"click",()=>this._showAll())),this.effect(()=>n.setAttribute("aria-expanded",String(this._list.isOpen.value))),n}_onInput(){this._typing=!1,this._list.clearActive(),this._refresh(),this._list.open()}_showAll(){this._list.isOpen.peek()||(this._list.clearActive(),this._source.query(""),this._list.open())}_refresh(){var e;this.peek().length>=(null!=(e=this.options.minChars)?e:0)&&this._source.query(this.peek())}_accept(e){let t=this._items.peek()[e];return void 0!==t&&(this.value=t,this._anchorValue=t,this._list.dismiss(),!0)}_onKeyDown(e){switch(e.key){case"ArrowDown":e.preventDefault(),this._list.isOpen.peek()?this._list.move(1):(this._refresh(),this._list.open());break;case"ArrowUp":this._list.isOpen.peek()&&(e.preventDefault(),this._list.move(-1));break;case"Home":case"End":this._list.isOpen.peek()&&(e.preventDefault(),this._list.jump("Home"===e.key?0:this._list.rowCount-1));break;case"Enter":!e.ctrlKey&&!e.metaKey&&this._list.isOpen.peek()&&(e.preventDefault(),e.stopPropagation(),this._accept(this._list.activeIndex.peek())||this._list.dismiss());break;case" ":this.options.openOnFocus&&""===this.peek()&&(e.preventDefault(),this._showAll());break;case"Escape":this._list.isOpen.peek()?(e.stopPropagation(),this._list.dismiss()):this.peek()!==this._anchorValue&&(e.stopPropagation(),this.value=this._anchorValue);break;case"Tab":this._list.dismiss()}}constructor(e){super(e,""),this._typing=!1,this.isOpen=this._list.isOpen,this.root.classList.add("u2-suggest-input"),this.root.dataset.u2="suggest-input"}}},8075(e,t,n){n.d(t,{u:()=>c});var r=n(7115),i=n(7974),o=n(8191),a=n(4860),l=n(6090),s=n(2357),u=n(5315);function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}class c extends i.p{getState(){var e,t;return d((e=d({},super.getState()),t=t={open:this._list.isOpen.peek()},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e),this._source?{busy:"loading"===this._source.state.peek().kind}:{})}getItems(e){return i.p.itemsState(this.peek().map((e,t)=>{let n=this._itemText(e);return{key:n,label:n,index:t,rendered:!0}}),null==e?void 0:e.all)}createEditor(){var e,t,n,i,l,u,d,c;let p=this.options.renderer;this._itemText=null!=(e=this.options.itemText)?e:p?e=>p.caption(e):e=>String(e),this._markup=null==p||null==(d=p.markup)?void 0:d.bind(p);let h=null!=(t=null==p||null==(c=p.listItem)?void 0:c.bind(p))?t:this._markup;this._renderItem=null!=(n=null!=(i=this.options.renderItem)?i:h)?n:e=>s.j.row("u2-tags-text",this._itemText(e)),this._text=(0,r.vP)(""),this._buildView(),this._available=(0,r.EW)(()=>{let e=this._view.value;if("ready"!==e.kind)return[];let t=new Set(this.value.map(e=>this._itemText(e)));return e.items.filter(e=>!t.has(this._itemText(e)))});let m=document.createElement("div");m.className="u2-tags",this._chips=document.createElement("div"),this._chips.className="u2-tags-chips",this._chips.setAttribute("role","list");let f=document.createElement("input");return this._input=f,f.type="text",f.autocomplete="off",f.className="u2-tags-input",f.placeholder=null!=(l=this.options.placeholder)?l:"",f.setAttribute("role","combobox"),f.setAttribute("aria-autocomplete","list"),m.append(this._chips,f),this._list=new s.j({prefix:"u2-tags",anchor:f,scope:this.scope,items:this._available,view:this._view,text:this._text,minChars:null!=(u=this.options.minChars)?u:0,render:e=>this._renderItem(e),keyOf:e=>this._itemText(e),onPick:e=>{this._accept(e),f.focus()},onDismiss:()=>this._list.dismiss(),onRetry:()=>{var e;return null==(e=this._source)?void 0:e.retry()}}),(0,o.n)(f,this._text,{owner:this.scope}),this.scope.listen(f,"input",()=>this._onInput()),this.scope.listen(f,"keydown",e=>this._onKeyDown(e)),this.scope.listen(f,"blur",()=>this._list.dismiss()),this.scope.listen(m,"click",e=>{e.target.closest(".u2-tag-remove")||f.focus()}),this.effect(()=>f.setAttribute("aria-expanded",String(this._list.isOpen.value))),(0,a._)(this._chips,this.signal,e=>this._itemText(e),e=>this._chip(e)),m}_buildView(){var e;let t=this.options.source;if(t){let e=new l._(t,{debounceMs:this.options.debounceMs});this._source=e,this._view=e.state,this.own(()=>e.dispose()),this.effect(()=>{"loading"===e.state.value.kind?this.root.setAttribute("aria-busy","true"):this.root.removeAttribute("aria-busy")});return}let n=null!=(e=this.options.items)?e:[];this._view=(0,r.EW)(()=>{let e=this._text.value.trim().toLowerCase(),t=e?n.filter(t=>this._itemText(t).toLowerCase().includes(e)):n;return t.length>0?{kind:"ready",items:t}:{kind:"empty"}})}_onInput(){this._list.clearActive(),this._refresh(),this._list.open()}_refresh(){var e;this._source&&this._text.peek().length>=(null!=(e=this.options.minChars)?e:0)&&this._source.query(this._text.peek())}add(e){let t=this._itemText(e),n=this.peek();n.some(e=>this._itemText(e)===t)||(this.value=[...n,e]),this._text.value="",this._list.dismiss()}remove(e){let t=this._itemText(e);this.value=this.peek().filter(e=>this._itemText(e)!==t)}_accept(e){let t=this._available.peek()[e];return void 0!==t&&(this.add(t),!0)}_createFromText(){var e;let t=this._text.peek().trim();if(!this.options.allowNew||""===t)return!1;let n=null!=(e=this.options.createItem)?e:e=>e;return this.add(n(t)),!0}_removeLast(){let e=this.peek(),t=e[e.length-1];void 0!==t&&this._deletable(t)&&(this.value=e.slice(0,e.length-1))}_deletable(e){let t=this.options.deletable;return void 0===t||t(e)}_onKeyDown(e){switch(e.key){case"ArrowDown":e.preventDefault(),this._list.isOpen.peek()?this._list.move(1):(this._refresh(),this._list.open());break;case"ArrowUp":this._list.isOpen.peek()&&(e.preventDefault(),this._list.move(-1));break;case"Home":case"End":this._list.isOpen.peek()&&(e.preventDefault(),this._list.jump("Home"===e.key?0:this._list.rowCount-1));break;case"Enter":!e.ctrlKey&&!e.metaKey&&(this._accept(this._list.activeIndex.peek())||this._createFromText())&&(e.preventDefault(),e.stopPropagation());break;case"Escape":this._list.isOpen.peek()&&(e.stopPropagation(),this._list.dismiss());break;case"Tab":this._list.dismiss();break;case"Backspace":case"Delete":""===this._text.peek()&&this._removeLast()}}_chip(e){let t=(0,u.Tc)(this._itemText(e),this._deletable(e)?{onRemove:()=>this.remove(e)}:void 0);t.classList.add("u2-tags-chip"),t.setAttribute("role","listitem");let n=t.querySelector(".u2-tag-text"),r=this._markup?this._markup(e):n;return r!==n&&n.replaceWith(r),r.dataset.u2Part="item-label",t}constructor(e){super(void 0===e?{}:e,[]),this.isOpen=this._list.isOpen,this.root.dataset.u2="tags-input"}}},8049(e,t,n){n.d(t,{f:()=>s,k:()=>l});var r=n(7974),i=n(8191),o=n(9947);let a=e=>r.p.isEmpty(e)||"string"==typeof e&&""===e.trim();class l extends r.p{get placeholder(){return this._input.placeholder}set placeholder(e){var t;this._input.placeholder=e,null==(t=this._remeasure)||t.call(this)}isEmptyValue(e){return a(e)}createEditor(){let e=document.createElement("input");if(this._input=e,e.type=this.options.password?"password":"text",e.autocomplete="off",(0,i.n)(e,this.signal,{owner:this.scope,commitOn:this.options.commitOn}),this.options.autoResize&&this._autoResize(),this.options.password)return this._passwordEditor();if(!this.options.search)return e;let t=document.createElement("div");t.className="u2-input-search";let n=this.createClearButton(()=>{this.value="",e.focus()});return this.effect(()=>n.hidden=""===this.value),t.append(e,n),t}_passwordEditor(){let e=document.createElement("div");e.className="u2-input-password";let t=document.createElement("button");t.type="button",t.className="u2-input-eye",t.setAttribute("aria-label","Show password");let n=(0,o.K)("eye");return t.append(n),this.scope.listen(t,"click",()=>{let e="password"===this._input.type;this._input.type=e?"text":"password",n.classList.toggle("fa-eye",!e),n.classList.toggle("fa-eye-slash",e),t.setAttribute("aria-label",e?"Hide password":"Show password")}),e.append(this._input,t),e}_autoResize(){let e=document.createElement("span");e.className="u2-input-measure",e.setAttribute("aria-hidden","true"),this.root.append(e),this._remeasure=()=>{var t,n;let r=this.peek();e.textContent=""===r?this._input.placeholder:r;let i=null!=(t=this.options.minWidth)?t:100,o=null!=(n=this.options.maxWidth)?n:300;this._input.style.width=`${Math.min(Math.max(e.offsetWidth+10,i),o)}px`},this.effect(()=>{this.value,this._remeasure()})}constructor(e){let t=void 0===e?{}:e;super(t,""),this.root.dataset.u2="text-input",this.liveOption("placeholder",t.placeholder,e=>this.placeholder=e)}}class s extends r.p{get placeholder(){return this._area.placeholder}set placeholder(e){this._area.placeholder=e}isEmptyValue(e){return a(e)}get rows(){return this._area.rows}set rows(e){null==e?this._area.removeAttribute("rows"):this._area.rows=e}createEditor(){let e=document.createElement("textarea");return this._area=e,void 0!==this.options.rows&&(e.rows=this.options.rows),(0,i.n)(e,this.signal,{owner:this.scope,commitOn:this.options.commitOn}),this.options.autoGrow&&this.effect(()=>this._grow(this.value)),e}_grow(e){let t=this._area;t.isConnected&&(t.style.height="auto",t.style.height=e?`${t.scrollHeight}px`:"")}constructor(e){let t=void 0===e?{}:e;super(t,""),this.root.dataset.u2="text-area",this.liveOption("placeholder",t.placeholder,e=>this.placeholder=e)}}},8918(e,t,n){n.d(t,{o:()=>c});var r=n(7115),i=n(9701),o=n(7974),a=n(8191),l=n(6090),s=n(2357);function u(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}class c extends i.Ec{focus(){this._input.focus()}getState(){var e,t,n;let r=this._input.placeholder;return d((t=d({},super.getState()),n=n={value:null!=(e=i.Ec.jsonValue(this.selected.peek()))?e:null,text:this._input.value,open:this._list.isOpen.peek(),busy:"loading"===this._view.peek().kind},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t),r?{placeholder:r}:{})}getItems(e){var t;let n=this._options.source,r="function"==typeof n?this._lastItems():n,i=new Set(this._list.isOpen.peek()?this._items.peek():[]),a=null!=(t=this._options.keyOf)?t:this._itemText;return o.p.itemsState(r.map((e,t)=>({key:a(e),label:this._itemText(e),index:t,rendered:i.has(e)})),null==e?void 0:e.all)}revealItem(e){var t,n=this,r=()=>super.revealItem;return(t=function*(){this._all.value=!0,this._source&&this._source.query(""),this._openPopup();for(let e=0;e<50&&"loading"===this._view.peek().kind;e++)yield new Promise(e=>setTimeout(e,20));return r().call(n,e)},function(){var e=this,n=arguments;return new Promise(function(r,i){var o=t.apply(e,n);function a(e){u(o,r,i,a,l,"next",e)}function l(e){u(o,r,i,a,l,"throw",e)}a(void 0)})}).call(this)}accessibleLabel(){var e,t;return null!=(e=null!=(t=super.accessibleLabel())?t:i.Ec.labelOf(this._input))?e:this._input.placeholder||void 0}_lastItems(){let e=this._view.peek();return"ready"===e.kind?e.items:[]}_send(e){let t=this._machine.peek();switch(e.type){case"focus":"idle"===t&&(this._machine.value="focused"),this._openOnFocus&&(this._source&&null!==this.selected.peek()?this._source.query(""):this._refresh(),this._openPopup());break;case"blur":this._dismiss(),this._machine.value="idle",queueMicrotask(()=>{this.scope.isDisposed||this._pendingPick||null!==this.selected.peek()||""===this._text.peek()||this.resync()});break;case"input":this._refresh(),this._openPopup();break;case"arrowDown":if("open"===t){this._list.move(1);break}this._refresh(),this._openPopup();break;case"arrowUp":"open"===t&&this._list.move(-1);break;case"enter":if("open"!==t)break;null!==this.selected.peek()&&0>this._list.activeIndex.peek()?this._dismiss():"ready"===this._view.peek().kind?this._commit(this._list.activeIndex.peek()):this._pendingPick=!0;break;case"escape":"open"===t?this._dismiss():this._clear();break;case"tab":case"dismiss":this._dismiss();break;case"select":this._commit(e.index)}}open(){this._source&&null!==this.selected.peek()?this._source.query(""):this._refresh(),this._openPopup()}close(){this._send({type:"dismiss"})}get isPickPending(){return this._pendingPick}_onInput(){this._pendingPick=!1,this._all.value=!1,null!==this.selected.peek()&&(this._echo=!0,this.selected.value=null),this._send({type:"input"})}resync(){this._text.value=null===this.selected.peek()?"":this._itemText(this.selected.peek())}_syncText(){let e=this.selected.value;if(this._echo){this._echo=!1;return}this._text.value=null===e?"":this._itemText(e)}_clear(){this.selected.value=null,this._text.value=""}_openPopup(){this._list.isOpen.peek()||(this._machine.value="open",this._list.open())}_dismiss(){this._list.isOpen.peek()&&(this._all.value=!1,"open"===this._machine.peek()&&(this._machine.value="focused"),this._list.dismiss())}_refresh(){this._source&&this._text.peek().length>=this._minChars&&this._source.query(this._text.peek())}_commit(e,t){let n=this._items.peek()[e];void 0!==n&&(this.selected.value=n,this._dismiss(),(void 0===t||t)&&this._input.focus())}_onKeyDown(e){let t="Enter"===e.key?this._options.onEnter:"Escape"===e.key?this._options.onEscape:void 0;if(void 0!==t&&!this._list.isOpen.peek()&&!e.isComposing){e.preventDefault(),e.stopPropagation(),t(e,this);return}switch(e.key){case"ArrowDown":e.preventDefault(),this._send({type:"arrowDown"});break;case"ArrowUp":e.preventDefault(),this._send({type:"arrowUp"});break;case"Enter":this._list.isOpen.peek()&&e.preventDefault(),this._send({type:"enter"});break;case"Escape":this._send({type:"escape"});break;case"Tab":this._send({type:"tab"})}}constructor(e){var t,n,i,o,u,d,c,p,h;super(),this.selected=(0,r.vP)(null),this._input=document.createElement("input"),this._pendingPick=!1,this._text=(0,r.vP)(""),this._machine=(0,r.vP)("idle"),this._all=(0,r.vP)(!1),this._echo=!1,this._options=e,this.text=this._text,this.machineState=this._machine;const m=e.renderer,f=null!=(t=e.itemText)?t:e=>m.caption(e);this._itemText=f;const g=null!=(n=null==m||null==(p=m.listItem)?void 0:p.bind(m))?n:null==m||null==(h=m.markup)?void 0:h.bind(m),v=null!=(i=null!=(o=e.render)?o:g)?i:e=>s.j.row("u2-typeahead-text",f(e));this._minChars=null!=(u=e.minChars)?u:0,this._openOnFocus=!0===e.openOnFocus,this.root.classList.add("u2-typeahead"),this.root.dataset.u2="typeahead";const b=this._input;if(b.className="u2-typeahead-input",b.type="text",b.autocomplete="off",b.spellcheck=!1,b.placeholder=null!=(d=e.placeholder)?d:"",b.setAttribute("role","combobox"),b.setAttribute("aria-autocomplete","list"),b.setAttribute("aria-haspopup","listbox"),e.label&&b.setAttribute("aria-label",e.label),this.root.append(b),"function"==typeof e.source){const t=new l._(e.source,{debounceMs:e.debounceMs});this._source=t,this._view=t.state,this.own(()=>t.dispose()),this.effect(()=>{"loading"===t.state.value.kind?this.root.setAttribute("aria-busy","true"):this.root.removeAttribute("aria-busy")})}else{const t=e.source;this._view=(0,r.EW)(()=>{let e=this._all.value?"":this._text.value.toLowerCase(),n=e?t.filter(t=>f(t).toLowerCase().includes(e)):t;return n.length>0?{kind:"ready",items:n}:{kind:"empty"}})}this._items=(0,r.EW)(()=>{let e=this._view.value;return"ready"===e.kind?e.items:[]});const y=this._minChars,_=this._all,w=this.selected,x=this._openOnFocus;this._list=new s.j({prefix:"u2-typeahead",anchor:b,scope:this.scope,items:this._items,view:this._view,text:this._text,get minChars(){return _.value?0:y},render:v,keyOf:null!=(c=e.keyOf)?c:f,get autoHighlight(){return null===w.value&&(!x||"always")},onPick:e=>this._send({type:"select",index:e}),onDismiss:()=>this._send({type:"dismiss"}),onRetry:()=>{var e;return null==(e=this._source)?void 0:e.retry()},emptyText:e.emptyText,maxHeight:e.maxHeight,matchWidth:e.matchWidth,footer:e.footer,currentKey:()=>{var t;return null===w.value?null:(null!=(t=e.keyOf)?t:f)(w.value)}}),this.isOpen=this._list.isOpen,this.effect(()=>{let e=this._view.value;if(!this._pendingPick||"loading"===e.kind||"idle"===e.kind||(this._pendingPick=!1,"ready"!==e.kind))return;let t=this._text.peek().trim().toLowerCase(),n=e.items.findIndex(e=>f(e).toLowerCase()===t);this._commit(n>=0?n:0,document.activeElement===b)}),(0,a.n)(b,this._text,{owner:this.scope}),this.scope.listen(b,"input",()=>this._onInput()),this.scope.listen(b,"focus",()=>this._send({type:"focus"})),this.scope.listen(b,"blur",()=>this._send({type:"blur"})),this.scope.listen(b,"keydown",e=>this._onKeyDown(e)),this.effect(()=>b.setAttribute("aria-expanded",String(this._list.isOpen.value))),this.effect(()=>this._syncText());let k=!0;this.effect(()=>{let e=this.selected.value;k?k=!1:(0,r.O8)(()=>this.fireEvent("change",e))})}}},6922(e,t,n){n.d(t,{B:()=>o});var r=n(7115),i=n(9701);class o extends i.Ec{setItems(e){this._expanded=!1,this._items.value=e.slice()}getState(){let e=this._items.peek();return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},super.getState(),0===e.length?{}:{current:e[e.length-1]})}getItems(){let e=this._items.peek(),t=e.map((t,n)=>({key:t,label:t,index:n,current:n===e.length-1,rendered:!0}));return{count:t.length,list:t,truncated:!1}}_render(){let e=this._items.value,t=e.length-1,n=[];this._middle=[],this._ellipsis=[];for(let r=0;r<=t;r++){let i=r>0?this._separator():void 0;i&&n.push(i);let o=r===t?this._current(e[r]):this._segment(e[r],r);if(n.push(o),i&&r<t&&this._middle.push(i,o),0===r&&t>1){let e=this._segment("…",-1);e.classList.add("u2-breadcrumbs-ellipsis"),e.title="Show the full path",e.setAttribute("aria-label","Show the full path"),this._ellipsis.push(this._separator(),e),n.push(...this._ellipsis)}}this.root.replaceChildren(...n),this._layout()}_layout(){0!==this._ellipsis.length&&(this._collapse(!1),!this._expanded&&this.root.scrollWidth>this.root.clientWidth+1&&this._collapse(!0))}_collapse(e){var t=!0,n=!1,r=void 0;try{for(var i,o=this._middle[Symbol.iterator]();!(t=(i=o.next()).done);t=!0)i.value.style.display=e?"none":""}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}var a=!0,l=!1,s=void 0;try{for(var u,d=this._ellipsis[Symbol.iterator]();!(a=(u=d.next()).done);a=!0)u.value.style.display=e?"":"none"}catch(e){l=!0,s=e}finally{try{a||null==d.return||d.return()}finally{if(l)throw s}}}_segment(e,t){let n=document.createElement("button");return n.type="button",n.className="u2-breadcrumbs-item",n.dataset.index=String(t),t>=0&&(n.dataset.u2Item=e),n.textContent=e,n}_current(e){let t=document.createElement("span");return t.className="u2-breadcrumbs-current",t.dataset.u2Item=e,t.textContent=e,t.setAttribute("aria-current","page"),t}_separator(){let e=document.createElement("span");return e.className="u2-breadcrumbs-sep",e.textContent="›",e.setAttribute("aria-hidden","true"),e}_onRootClick(e){let t=e.target.closest(".u2-breadcrumbs-item");if(!t)return;let n=Number(t.dataset.index);n<0?(this._expanded=!0,this._collapse(!1)):this._onClick&&this._onClick(n,this._items.peek()[n],e,this)}constructor(e){super(document.createElement("nav")),this._expanded=!1,this._middle=[],this._ellipsis=[],this._items=(0,r.vP)(e.items.slice()),this.items=this._items,this._onClick=e.onClick,this.root.classList.add("u2-breadcrumbs"),this.root.dataset.u2="breadcrumbs",this.root.setAttribute("aria-label","breadcrumb"),this.scope.listen(this.root,"click",e=>this._onRootClick(e));const t=new ResizeObserver(()=>this._layout());t.observe(this.root),this.own(()=>t.disconnect()),this.effect(()=>this._render())}}},169(e,t,n){n.d(t,{W:()=>f});var r=n(949),i=n(7115),o=n(1518),a=n(317),l=n(9701),s=n(3830),u=n(5232),d=n(4977),c=n(9947);function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function h(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}class m extends l.Ec{get ambientAdoption(){return!1}getState(){return h(p({},super.getState()),{open:!0})}getItems(){let e=this._level,t=e.entries.filter(e=>"separator"!==e.node.kind).map((t,n)=>{var r,i;return h(p({key:t.path,label:t.node.label,index:n,disabled:null!==u.B.now(null==(r=t.node.options)?void 0:r.disabled)},(null==(i=t.node.options)?void 0:i.check)===void 0?{}:{checked:t.node.options.check},"group"===t.node.kind?{expanded:e.entries[e.openIndex]===t}:{}),{rendered:!0})});return{count:t.length,list:t,truncated:!1}}constructor(e){super(e.panel,e.scope),this._level=e}}class f{static popup(){return new f}item(e,t,n){return this._current.push({kind:"item",label:e,onClick:f._owned(t),options:n}),this}separator(){return this._current.push({kind:"separator",label:""}),this}group(e){let t=[];return this._current.push({kind:"group",label:e,children:t}),this._stack.push(t),this}endGroup(){return this._stack.length>1&&this._stack.pop(),this}show(e){this.close();let t=document.activeElement;this._returnFocus=t instanceof HTMLElement?t:void 0;let n=new o.HG(void 0,{label:"menu"});this._scope=n;let r=this._buildLevel(this._nodes,0,"");this._levels.push(r),this._open.value=!0,this._machine.value="open";let i="anchor"in e?e.anchor:f._point(r.panel,e.x,e.y,n);s.h.show(i,r.panel,{owner:n}),r.scope.listen(r.panel,s.B,()=>this.close()),r.panel.focus({preventScroll:!0})}close(){let e=this._scope;if(!e)return;for(this._scope=void 0,this._hoverCancel=void 0;this._levels.length>0;)f._disposeLevel(this._levels.pop());e.dispose(),this._open.value=!1,this._machine.value="closed";let t=this._returnFocus;this._returnFocus=void 0,t&&t.isConnected&&t.focus()}bindContext(e,t){let n,r=a.Q.scopeOf(null==t?void 0:t.owner,"Menu.bindContext()");r.listen(e,"contextmenu",e=>{e.preventDefault(),this.show({x:e.clientX,y:e.clientY}),n=this._scope}),r.own(()=>{void 0!==n&&this._scope===n&&this.close()})}get _current(){return this._stack[this._stack.length-1]}static _point(e,t,n,r){e.style.position="fixed",e.style.visibility="hidden",s.h.host.append(e);let i=e.offsetWidth;e.style.visibility="";let o=document.createElement("div");o.className="u2-menu-point";let a=t+i>window.innerWidth-4?Math.max(4,t-i):t;return o.style.cssText=`position: fixed; left: ${a}px; top: ${n}px; width: 0; height: 0;`,s.h.host.append(o),r.own(()=>o.remove()),o}_buildLevel(e,t,n){let r=document.createElement("div");r.className="u2-menu",r.dataset.u2="menu",r.tabIndex=-1,r.setAttribute("role","menu");let i={depth:t,panel:r,entries:[],active:-1,openIndex:-1,scope:this._scope.child("menu-level")},o=e.some(e=>{var t;return(null==(t=e.options)?void 0:t.detail)!==void 0});r.classList.toggle("u2-menu-detailed",o);var a=!0,l=!1,s=void 0;try{for(var u,d=e[Symbol.iterator]();!(a=(u=d.next()).done);a=!0){let e=u.value,a=""===n?e.label:`${n} > ${e.label}`,l=this._renderNode(e,t,i.entries.length,a,o,i.scope);i.entries.push({node:e,el:l,path:a}),r.append(l)}}catch(e){l=!0,s=e}finally{try{a||null==d.return||d.return()}finally{if(l)throw s}}new m(i);let c=i.scope;return c.listen(r,"keydown",e=>this._onKeyDown(i,e)),c.listen(r,"pointerover",e=>this._onPointerOver(i,e)),c.listen(r,"pointerdown",e=>e.preventDefault()),c.listen(r,"click",e=>this._onClick(i,e)),i}_renderNode(e,t,n,r,i,o){var a,l;if("separator"===e.kind){let e=document.createElement("div");return e.className="u2-menu-separator",e.setAttribute("role","separator"),e}let s=null!=(a=e.options)?a:{},p="group"===e.kind,h=document.createElement("div");h.className=p?"u2-menu-item u2-menu-item-sub":"u2-menu-item",h.id=`${this._id}-${t}-${n}`,h.dataset.index=String(n),h.dataset.u2Item=r,h.setAttribute("role",void 0===s.check?"menuitem":"menuitemcheckbox");let m=u.B.now(s.disabled);u.B.apply(h,m),null===m?h.setAttribute("aria-disabled","false"):d.m.bind(h,m,{owner:o}),void 0!==s.check&&h.setAttribute("aria-checked",String(s.check)),p&&(h.setAttribute("aria-haspopup","menu"),h.setAttribute("aria-expanded","false"));let f=document.createElement("span");f.className="u2-menu-icon",f.setAttribute("aria-hidden","true"),s.check?f.textContent="✓":s.icon&&f.append((0,c.K)(s.icon));let g=document.createElement("span");g.className="u2-menu-label",g.dataset.u2Part="item-label",g.textContent=e.label,g.id=`${h.id}-label`,h.setAttribute("aria-labelledby",g.id);let v=document.createElement("span");if(v.className=p?"u2-menu-arrow":"u2-menu-shortcut",v.textContent=p?"":null!=(l=s.shortcut)?l:"",h.append(f,g),g.classList.toggle("u2-menu-label-wide",i&&void 0===s.detail),void 0!==s.detail){let e=document.createElement("span");e.className="u2-menu-detail",e.dataset.u2Part="item-detail",e.textContent=s.detail,e.id=`${h.id}-detail`,null===m&&h.setAttribute("aria-describedby",e.id),h.append(e)}return h.append(v),h}_openSubmenu(e,t,n){let i=e.entries[t];if(!i||"group"!==i.node.kind)return;if(e.openIndex!==t){this._closeFrom(e.depth+1);let n=this._buildLevel(i.node.children,e.depth+1,i.path);this._levels.push(n),e.openIndex=t,i.el.setAttribute("aria-expanded","true"),i.el.classList.add("u2-menu-item-open"),n.panel.style.position="fixed",n.panel.style.left="0",n.panel.style.top="0",i.el.append(n.panel),n.scope.own((0,r.ll)(i.el,n.panel,()=>{(0,r.rD)(i.el,n.panel,{strategy:"fixed",placement:"right-start",middleware:[(0,r.cY)({mainAxis:-1,crossAxis:-3}),(0,r.UU)({fallbackPlacements:["left-start"]}),(0,r.BN)({padding:4})]}).then(e=>{let t=e.x,r=e.y;n.panel.style.left=`${t}px`,n.panel.style.top=`${r}px`})}))}let o=this._levels[e.depth+1];this._machine.value="submenu-open",n&&(o.panel.focus({preventScroll:!0}),o.active<0&&f._setActive(o,f._step(o,1)))}_closeFrom(e){for(;this._levels.length>e;)f._disposeLevel(this._levels.pop());let t=this._levels[this._levels.length-1];if(t&&t.openIndex>=0){let e=t.entries[t.openIndex].el;e.setAttribute("aria-expanded","false"),e.classList.remove("u2-menu-item-open"),t.openIndex=-1}this._machine.value=this._levels.length>1?"submenu-open":"open"}_activate(e,t){let n=e.entries[t];if(!n||!f._navigable(n.node))return;if("group"===n.node.kind)return void this._openSubmenu(e,t,!0);let r=n.node.onClick,i=n.node.options;if(null==i?void 0:i.keepOpen){void 0!==i.check&&f._check(n.el,i,!i.check),null==r||r();return}this.close(),r&&r()}static _check(e,t,n){t.check=n,e.setAttribute("aria-checked",String(n));let r=e.querySelector(".u2-menu-icon");r.textContent=n?"✓":"",!n&&t.icon&&r.append((0,c.K)(t.icon))}_onClick(e,t){let n=f._indexAt(e,t);n>=0&&this._activate(e,n)}_onPointerOver(e,t){var n,r;let i=f._indexAt(e,t);if(i<0)return;t.stopPropagation();let o=e.entries[i],a="group"===o.node.kind;f._navigable(o.node)&&f._setActive(e,i),null==(n=this._hoverCancel)||n.call(this),this._hoverCancel=void 0,(a?e.openIndex===i:e.openIndex<0)||(this._hoverCancel=null==(r=this._scope)?void 0:r.setTimeout(()=>{this._hoverCancel=void 0,a?this._openSubmenu(e,i,!1):this._closeFrom(e.depth+1)},200))}_onKeyDown(e,t){if(t.target===e.panel)switch(t.key){case"ArrowDown":t.preventDefault(),f._setActive(e,f._step(e,1));break;case"ArrowUp":t.preventDefault(),f._setActive(e,f._step(e,-1));break;case"Home":t.preventDefault(),f._setActive(e,f._edge(e,1));break;case"End":t.preventDefault(),f._setActive(e,f._edge(e,-1));break;case"ArrowRight":e.entries[e.active]&&"group"===e.entries[e.active].node.kind&&(t.preventDefault(),this._openSubmenu(e,e.active,!0));break;case"ArrowLeft":if(e.depth>0){t.preventDefault();let n=this._levels[e.depth-1];this._closeFrom(e.depth),n.panel.focus({preventScroll:!0})}break;case"Enter":t.preventDefault(),this._activate(e,e.active);break;case"Escape":t.preventDefault(),this.close();break;default:if(1===t.key.length&&!t.ctrlKey&&!t.altKey&&!t.metaKey){let n=f._jump(e,t.key.toLowerCase());n>=0&&(t.preventDefault(),f._setActive(e,n))}}}static _owned(e){let t=o.HG.ambient;return()=>void 0===t||t.isDisposed?(0,i.vA)(()=>o.HG.runWith(void 0,e)):t.run(e)}static _disposeLevel(e){e.scope.dispose(),e.panel.remove()}static _navigable(e){var t;return"separator"!==e.kind&&null===u.B.now(null==(t=e.options)?void 0:t.disabled)}static _indexAt(e,t){let n=t.target.closest(".u2-menu-item");return n&&n.parentElement===e.panel?Number(n.dataset.index):-1}static _setActive(e,t){e.active=t;for(let n=0;n<e.entries.length;n++)e.entries[n].el.classList.toggle("u2-menu-item-active",n===t);t<0?e.panel.removeAttribute("aria-activedescendant"):e.panel.setAttribute("aria-activedescendant",e.entries[t].el.id)}static _step(e,t){let n=e.entries.length;if(0===n)return -1;let r=e.active>=0?e.active:t>0?-1:0;for(let i=1;i<=n;i++){let o=((r+t*i)%n+n)%n;if(f._navigable(e.entries[o].node))return o}return -1}static _edge(e,t){let n=e.entries.length;for(let r=t>0?0:n-1;r>=0&&r<n;r+=t)if(f._navigable(e.entries[r].node))return r;return -1}static _jump(e,t){let n=e.entries.length;for(let r=1;r<=n;r++){let i=(e.active+r+n)%n,o=e.entries[i].node;if(f._navigable(o)&&o.label.toLowerCase().startsWith(t))return i}return -1}constructor(){this._id=`u2-menu-${++f._seq}`,this._nodes=[],this._stack=[],this._levels=[],this._open=(0,i.vP)(!1),this._machine=(0,i.vP)("closed"),this.isOpen=this._open,this.machineState=this._machine,this._stack.push(this._nodes)}}f._seq=0},4467(e,t,n){n.d(t,{M:()=>u});var r=n(1518),i=n(9701),o=n(4977),a=n(169),l=n(9947);let s="u2-toolbar-hidden";class u extends i.Ec{addButton(e,t,n){let r=this._button(e,n);return this.scope.listen(r,"click",()=>t()),this._add({kind:"button",el:r,label:e,hidden:!1,onClick:t})}addToggle(e,t,n){let r=this._button(e,n);return r.setAttribute("aria-pressed","false"),this.scope.listen(r,"click",()=>t.value=!t.peek()),this.effect(()=>{let e=t.value;r.classList.toggle("u2-toolbar-btn-pressed",e),r.setAttribute("aria-pressed",String(e))}),this._add({kind:"toggle",el:r,label:e,hidden:!1,bind:t})}addMenu(e,t){let n=this._button(e);n.classList.add("u2-toolbar-btn-menu"),n.setAttribute("aria-haspopup","menu"),n.setAttribute("aria-expanded","false");let r=document.createElement("span");return r.className="u2-toolbar-arrow",r.textContent="▾",n.append(r),this.scope.listen(n,"click",()=>this._toggleMenu(n,t)),this._add({kind:"menu",el:n,label:e,hidden:!1,build:t})}addSeparator(){let e=document.createElement("div");return e.className="u2-toolbar-sep",e.setAttribute("role","separator"),e.setAttribute("aria-orientation","vertical"),this._add({kind:"separator",el:e,label:"",hidden:!1})}add(e){let t=document.createElement("div");return t.className="u2-toolbar-slot",t.append(e),this._add({kind:"slot",el:t,label:"",hidden:!1})}getItems(){let e=this._items.filter(e=>"separator"!==e.kind&&"slot"!==e.kind).map((e,t)=>{var n,r;return n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({key:e.label,label:e.label,index:t,disabled:e.el.disabled},void 0===e.bind?{}:{selected:e.bind.peek()}),r=r={rendered:!e.hidden},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(r)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}),n});return{count:e.length,list:e,truncated:!1}}_button(e,t){let n=document.createElement("button");n.type="button",n.className="u2-toolbar-btn",n.dataset.u2Item=e,n.tabIndex=-1,t&&t.icon&&n.append((0,l.K)(t.icon,{cls:"u2-toolbar-icon"}));let r=document.createElement("span");return r.className="u2-toolbar-label",r.dataset.u2Part="item-label",r.textContent=e,n.append(r),t&&t.tooltip&&o.m.bind(n,t.tooltip,{owner:this.scope}),n}_add(e){return this._items.push(e),this.root.insertBefore(e.el,this._chevron),this._width=-1,this._layout(),this}_layout(){let e=this.root.clientWidth;if(e===this._width)return;this._width=e;var t=!0,n=!1,r=void 0;try{for(var i,o=this._items[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){let e=i.value;u._setHidden(e,!1)}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}if(this._chevron.classList.add(s),0===e||0===this._items.length)return void this._roving();let a=getComputedStyle(this.root),l=parseFloat(a.columnGap)||0,d=e-(parseFloat(a.paddingLeft)||0)-(parseFloat(a.paddingRight)||0),c=this._items.map(e=>e.el.offsetWidth),p=c.reduce((e,t)=>e+t,0)+l*(c.length-1);if(p<=d)return void this._roving();this._chevron.classList.remove(s);let h=d-this._chevron.offsetWidth-l,m=c.length;for(;m>0&&p>h;)p-=c[m-1]+l,m--;for(;m>0&&"separator"===this._items[m-1].kind;)m--;for(let e=m;e<this._items.length;e++)u._setHidden(this._items[e],!0);this._roving()}_roving(){let e=this._stops();this._active>=e.length&&(this._active=e.length-1),this._active<0&&(this._active=0);var t=!0,n=!1,r=void 0;try{for(var i,o=this._items[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){let e=i.value,t=u._target(e);t&&(t.tabIndex=-1)}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}this._chevron.tabIndex=-1,e.length>0&&(e[this._active].tabIndex=0)}_stops(){let e=[];var t=!0,n=!1,r=void 0;try{for(var i,o=this._items[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){let t=i.value,n=t.hidden?null:u._target(t);n&&e.push(n)}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}return this._chevron.classList.contains(s)||e.push(this._chevron),e}_onFocusIn(e){let t=this._stops().findIndex(t=>t===e.target||t.contains(e.target));t<0||(this._active=t,this._roving())}_onKeyDown(e){if("ArrowLeft"!==e.key&&"ArrowRight"!==e.key||e.target.matches("input:not([type=button]):not([type=checkbox]):not([type=radio]), textarea"))return;let t=this._stops();0!==t.length&&(e.preventDefault(),this._active=(this._active+("ArrowRight"===e.key?1:-1)+t.length)%t.length,this._roving(),t[this._active].focus())}_toggleMenu(e,t){let n=this._menuOwner!==e;if(this._closeMenu(),!n)return;let i=new a.W;t(i),this._menu=i,this._menuOwner=e,i.show({anchor:e});let o=new r.HG;o.effect(()=>{let t=i.isOpen.value;e.setAttribute("aria-expanded",String(t)),t||this._menu!==i||(this._menuOwner=void 0)}),this._menuWatch=o}_closeMenu(){this._menu&&this._menu.close(),this._menuWatch&&this._menuWatch.dispose(),this._menu=void 0,this._menuWatch=void 0,this._menuOwner=void 0}_buildOverflow(e){let t=[];var n=!0,r=!1,i=void 0;try{for(var o,a=this._items[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){let e=o.value;e.hidden&&"slot"!==e.kind&&("separator"!==e.kind||0!==t.length&&"separator"!==t[t.length-1].kind)&&t.push(e)}}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}for(;t.length>0&&"separator"===t[t.length-1].kind;)t.pop();var l=!0,s=!1,u=void 0;try{for(var d,c=t[Symbol.iterator]();!(l=(d=c.next()).done);l=!0){let t=d.value;"separator"===t.kind?e.separator():"button"===t.kind?e.item(t.label,t.onClick):"toggle"===t.kind?e.item(t.label,()=>t.bind.value=!t.bind.peek(),{check:t.bind.peek()}):(e.group(t.label),t.build(e),e.endGroup())}}catch(e){s=!0,u=e}finally{try{l||null==c.return||c.return()}finally{if(s)throw u}}}static _setHidden(e,t){e.hidden=t,e.el.classList.toggle(s,t)}static _target(e){return"separator"===e.kind?null:"slot"===e.kind?e.el.querySelector("input, button, select, textarea, a[href], [tabindex]"):e.el}constructor(e){super(),this._items=[],this._chevron=document.createElement("button"),this._active=0,this._width=-1,this.root.classList.add("u2-toolbar"),this.root.dataset.u2="toolbar",this.root.setAttribute("role","toolbar"),e&&e.ariaLabel&&this.root.setAttribute("aria-label",e.ariaLabel),this._chevron.type="button",this._chevron.className=`u2-toolbar-btn u2-toolbar-overflow ${s}`,this._chevron.append((0,l.K)(u.OVERFLOW_ICON,{cls:"u2-toolbar-icon"})),this._chevron.tabIndex=-1,this._chevron.setAttribute("aria-label",u.OVERFLOW_LABEL),this._chevron.setAttribute("aria-haspopup","menu"),this._chevron.setAttribute("aria-expanded","false"),this.root.append(this._chevron),this.scope.listen(this._chevron,"click",()=>this._toggleMenu(this._chevron,e=>this._buildOverflow(e))),this.scope.listen(this.root,"keydown",e=>this._onKeyDown(e)),this.scope.listen(this.root,"focusin",e=>this._onFocusIn(e));const t=new ResizeObserver(()=>this._layout());t.observe(this.root),this.own(()=>t.disconnect()),this.own(()=>this._closeMenu())}}u.OVERFLOW_ICON="ellipsis-h",u.OVERFLOW_LABEL="More actions"},7614(e,t,n){n.d(t,{v:()=>l});var r=n(4042);function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function a(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,i=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var o=[],a=!0,l=!1;try{for(i=i.call(e);!(a=(n=i.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==i.return||i.return()}finally{if(l)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}class l{static from(e){return new l(o({},e.can),o({},e.fields),!1,"hidden")}can(e){var t;return!1!==this._bound[e]&&(null!=(t=this._can[e])?t:this._unlistedCan)}narrow(e){let t={};var n=!0,r=!1,i=void 0;try{for(var s,u=Object.entries(e)[Symbol.iterator]();!(n=(s=u.next()).done);n=!0){let e=a(s.value,2),n=e[0],r=e[1];!1===r&&(t[n]=!1)}}catch(e){r=!0,i=e}finally{try{n||null==u.return||u.return()}finally{if(r)throw i}}return new l(o({},this._can,t),this._fields,this._unlistedCan,this._unlistedField,this._writes,o({},this._bound,t))}columnPolicy(){return new l({},this._fields,!0,this._unlistedField,this._writes)}field(e){var t;let n=null!=(t=this._fields[e])?t:this._unlistedField,r="immutable"===n?this.isDraft?"editable":"readonly":n;return"editable"!==r||this.can(this._writes)?r:"readonly"}get isDraft(){return"insert"===this._writes}forDraft(){return this.isDraft?this:new l(this._can,this._fields,this._unlistedCan,this._unlistedField,"insert",this._bound)}row(e){let t;if(null==e)return this;if("new"===e[r.S.STATE])return this.forDraft();let n=new Set([...Object.keys(this._can),...l.ROW_COLUMNS.map(e=>a(e,2)[1])]);var i=!0,s=!1,u=void 0;try{for(var d,c=n[Symbol.iterator]();!(i=(d=c.next()).done);i=!0){let n=d.value,r=e[`${l.ROW_PREFIX}${n}`];"boolean"==typeof r&&(null!=t||(t=o({},this._can)),t[n]=r)}}catch(e){s=!0,u=e}finally{try{i||null==c.return||c.return()}finally{if(s)throw u}}return void 0===t?this:new l(t,this._fields,this._unlistedCan,this._unlistedField,this._writes,this._bound)}constructor(e,t,n,r,i,o){this._can=e,this._fields=t,this._unlistedCan=n,this._unlistedField=r,this._writes=void 0===i?"edit":i,this._bound=void 0===o?{}:o}}l.ROW_COLUMNS=[["~can_edit","edit"],["~can_delete","delete"],["~can_share","share"]],l.ROW_PREFIX="~can_",l.full=Object.freeze(new l({},{},!0,"editable")),l.readOnly=Object.freeze(new l({view:!0},{},!1,"readonly"))},6090(e,t,n){n.d(t,{_:()=>a});var r=n(7115),i=n(317);function o(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}class a{query(e){this._query=e,this._cancel(),this._disposed||(this._state.value={kind:"loading"},this._timer=setTimeout(()=>this._run(),this._debounceMs))}retry(){this.query(this._query)}dispose(){var e;this._disposed=!0,this._cancel(),null==(e=this._release)||e.call(this)}_cancel(){clearTimeout(this._timer),this._timer=void 0,this._abort&&this._abort.abort(),this._abort=void 0}_run(){var e;return(e=function*(){let e=new AbortController;this._abort=e;try{let t=yield this._fetch(this._query,e.signal);if(e.signal.aborted||this._disposed)return;this._state.value=t.length>0?{kind:"ready",items:t}:{kind:"empty"}}catch(t){if(e.signal.aborted||this._disposed)return;this._state.value={kind:"error",message:t instanceof Error?t.message:String(t)}}},function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function l(e){o(a,r,i,l,s,"next",e)}function s(e){o(a,r,i,l,s,"throw",e)}l(void 0)})}).call(this)}constructor(e,t){var n;this._query="",this._disposed=!1,this._fetch=e,this._debounceMs=null!=(n=null==t?void 0:t.debounceMs)?n:150,this._state=(0,r.vP)({kind:"idle"}),this.state=this._state,this._release=i.Q.adopt(null==t?void 0:t.owner,()=>this.dispose())}}},4894(e,t,n){n.d(t,{C:()=>l});var r=n(7115),i=n(1518),o=n(317);function a(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}class l{get value(){return this.signal.value}peek(){return this.signal.peek()}refresh(){return(this._cancel(),this._disposed)?Promise.resolve():(this._state.value={kind:"loading"},this._run())}dispose(){var e;this._disposed=!0,this._cancel(),this._scope.dispose(),null==(e=this._release)||e.call(this)}_trigger(){this._cancel(),this._disposed||(this._state.value={kind:"loading"},this._timer=setTimeout(()=>this._run(),this._debounceMs))}_cancel(){clearTimeout(this._timer),this._timer=void 0,this._abort&&this._abort.abort(),this._abort=void 0}_run(){var e;return(e=function*(){let e=new AbortController;this._abort=e;try{let t=yield this._fetch(e.signal);if(e.signal.aborted||this._disposed)return;this._state.value={kind:"ready",value:t}}catch(t){if(e.signal.aborted||this._disposed)return;this._state.value={kind:"error",message:t instanceof Error?t.message:String(t)}}},function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function l(e){a(o,r,i,l,s,"next",e)}function s(e){a(o,r,i,l,s,"throw",e)}l(void 0)})}).call(this)}constructor(e,t){var n,a;if(this._scope=new i.HG,this._disposed=!1,this._fetch=e,this._debounceMs=null!=(n=null==t?void 0:t.debounceMs)?n:300,this._state=(0,r.vP)({kind:"idle"}),this.state=this._state,this.signal=(0,r.EW)(()=>{let e=this._state.value;return"ready"===e.kind?e.value:void 0}),this._release=o.Q.adopt(null==t?void 0:t.owner,()=>this.dispose()),null==(a=null==t?void 0:t.auto)||a){const e=null==t?void 0:t.deps;e?this._scope.effect(()=>{e(),this._trigger()}):(0,r.O8)(()=>void this.refresh())}}}},8191(e,t,n){n.d(t,{b:()=>o,n:()=>a});var r=n(317),i=n(9383);function o(e,t,n){r.Q.scopeOf(null==n?void 0:n.owner,"bindText()").effect(()=>{e.textContent=(0,i.Qq)(t.value)})}function a(e,t,n){var i;let o=r.Q.scopeOf(null==n?void 0:n.owner,"bindValue()"),a=null!=(i=null==n?void 0:n.commitOn)?i:"input",l=!1;o.effect(()=>{var n;let r=null!=(n=t.value)?n:"";l?l=!1:e.value=r}),o.listen(e,a,()=>{let n=t.peek();t.value=e.value,l=!Object.is(t.peek(),n)})}},9701(e,t,n){n.d(t,{Ec:()=>h,s9:()=>m,uA:()=>p}),n(8695);var r,i=n(3095);function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}let a=i.version,l=function(e){if(Array.isArray(e))return e}(r=(null!=a?a:"").split(".").map(Number))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var i=[],o=!0,a=!1;try{for(r=r.call(e);!(o=(t=r.next()).done)&&(i.push(t.value),2!==i.length);o=!0);}catch(e){a=!0,n=e}finally{try{o||null==r.return||r.return()}finally{if(a)throw n}}return i}}(r)||function(e){if(e){if("string"==typeof e)return o(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return o(e,2)}}(r)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),s=l[0],u=l[1],d=s>1||1===s&&u>=2?void 0:`u2 needs the u2 engine 1.2+; this platform has ${null!=a?a:"an older one"}: update the platform`,c=()=>{throw Error(d)},p=void 0===d?i.Component:class extends i.Component{constructor(e){c(),super(e)}},h=void 0===d?i.Control:class extends i.Control{static build(){return c()}constructor(e,t){c(),super(e,t)}},m=void 0===d?i.component:c},8255(e,t,n){n.d(t,{A:()=>r});class r{static isDateOnly(e){let t=e instanceof Date?e.getTime():new Date(e).getTime();return Number.isFinite(t)&&t%(r.MICROSECONDS_PER_DAY/1e3)==0}static isDateOnlyMicros(e){return!Number.isFinite(e)||!Number.isInteger(e)||e%r.MICROSECONDS_PER_DAY==0}static utcParts(e){return{year:e.getUTCFullYear(),month:e.getUTCMonth()+1,day:e.getUTCDate(),hours:e.getUTCHours(),minutes:e.getUTCMinutes()}}static fromUtcParts(e){var t,n;return new Date(Date.UTC(e.year,e.month-1,e.day,null!=(t=e.hours)?t:0,null!=(n=e.minutes)?n:0))}static firstDayOfWeek(e){var t,n;let i=void 0===e?null!=(t=null==(n=globalThis.navigator)?void 0:n.language)?t:"en-US":e,o=r._firstDays.get(i);return void 0===o&&r._firstDays.set(i,o=r._weekStart(i)),o}static _weekStart(e){try{var t,n,i;let o=new Intl.Locale(e),a=null!=(t=null==(i=o.getWeekInfo)?void 0:i.call(o))?t:o.weekInfo;if(void 0!==a)return a.firstDay%7;return+!r._SUNDAY_REGIONS.includes(null!=(n=o.maximize().region)?n:"")}catch(e){return 1}}}r.MICROSECONDS_PER_DAY=864e8,r._SUNDAY_REGIONS=["US","CA","MX","BR","JP","KR","TW","HK","IL","IN","PH","ZA"],r._firstDays=new Map},8609(e,t,n){n.d(t,{B1:()=>C,Ln:()=>x,Pf:()=>k,QZ:()=>E,_Q:()=>_,h1:()=>O,h3:()=>A,nd:()=>w,nf:()=>S,on:()=>P,x6:()=>j,y4:()=>b,yP:()=>y});var r=n(7115),i=n(1518),o=n(9701),a=n(317),l=n(8191);n(8255),n(4911);var s=n(4977),u=n(5232);function d(e){return e instanceof r.HN}function c(){let e=i.HG.ambient;return e||i._U.fail("owner-missing","a signal binding needs an owner — build under `owner.build(…)` or `component((self) => …)`; after an `await`, inside `owner.task(async (t) => … t.build(…))`"),e}function p(e,...t){let n=document.createElement(e),r=t.filter(e=>e).join(" ");return r&&(n.className=r),n}function h(e,t){return d(t)?(0,l.b)(e,t,{owner:c()}):e.textContent=t,e}function m(e,t){var n=!0,r=!1,i=void 0;try{for(var a,l=(null!=t?t:[])[Symbol.iterator]();!(n=(a=l.next()).done);n=!0){let t=a.value;e.append(d(t)?h(p("span"),t):o.Ec.is(t)?t.root:t)}}catch(e){r=!0,i=e}finally{try{n||null==l.return||l.return()}finally{if(r)throw i}}return e}let f=new i.HG(void 0,{label:"unowned",lazy:!0});function g(e,t,n){let o=i.HG.ambient;o?o.listen(e,t,n):e.addEventListener(t,e=>{try{(0,r.vA)(()=>n(e))}catch(e){f.reportError(e)}})}function v(e){return"object"!=typeof e?[e]:[void 0===e.gap?void 0:`u2-gap-${e.gap}`,e.cls]}function b(e,t){return m(p("div","u2-div",...v(t)),e)}function y(e,t){return m(p("div","u2-div","u2-div-v",...v(t)),e)}function _(e,t){return m(p("div","u2-div","u2-div-h",...v(t)),e)}function w(e){return m(p("div","u2-div","u2-panel"),e)}function x(e,t){return h(p("span",t),e)}function k(e,t){return h(p("label","u2-label",t),e)}function O(e){return h(p("h1"),e)}function A(e){return h(p("h3"),e)}function S(e,t){let n=h(p("a","u2-link"),e);return"string"==typeof t?(n.classList.add("u2-link-external"),n.href=t,n.target="_blank"):(n.tabIndex=0,g(n,"click",e=>t(e)),g(n,"keydown",e=>{"Enter"===e.key&&t(e)})),n}function P(e,t,n){return g(e,t,n),e}function E(e){c().effect(e)}function C(e,t){return a.Q.scopeOf(void 0,"subscribe()").subscribe(e,t)}function j(e,t,n){let r=u.B.focusable(p("button","u2-btn",(null==n?void 0:n.primary)?"u2-btn-primary":void 0));r.type="button",r.dataset.u2="button",e instanceof HTMLElement?r.append(e):h(r,e),g(r,"click",e=>t(e));let o=null==n?void 0:n.disabled;if(d(o)?c().effect(()=>u.B.apply(r,u.B.read(o))):u.B.apply(r,u.B.now(o)),void 0!==o||(null==n?void 0:n.tooltip)!==void 0){let e=()=>{var e,t;let r;return null!=(e=u.B.now(o))?e:null==(r=d(t=null==n?void 0:n.tooltip)?t.peek():t)?"":String(r)},t=i.HG.ambient;void 0===t?r.title=e():s.m.bind(r,e,{owner:t})}return r}},50(e,t,n){n.d(t,{Gw:()=>w,Gx:()=>y,fm:()=>p,gz:()=>_,ku:()=>c,m8:()=>b});var r=n(3095),i=n(6900),o=n(8614),a=n(4208),l=n(6248);function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function u(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}function d(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){u(o,r,i,a,l,"next",e)}function l(e){u(o,r,i,a,l,"throw",e)}a(void 0)})}}let c=-0x80000000,p=26789344063684636e-50,h=Math.fround(26789344063684636e-50),m=new AbortController().signal,f=e=>e===p||e===h||Number.isNaN(e),g=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),v={"=":(e,t)=>e===t,"!=":(e,t)=>e!==t,"<":(e,t)=>e<t,"<=":(e,t)=>e<=t,">":(e,t)=>e>t,">=":(e,t)=>e>=t};class b{static kindOf(e){return(0,o.I)({name:e.name,type:e.type})}static nulls(e){var t;let n=b.kindOf(e);if(n===i.Nd.BOOL)return new r.BitArray(e.length);if(n===i.Nd.BIG_INT||n===i.Nd.STRING_LIST)return r.BitArray.create(e.length,t=>null==e.get(t));let o=e.getRawData();if(n===i.Nd.INT)return r.BitArray.create(e.length,e=>o[e]===c);if(n===i.Nd.FLOAT||n===i.Nd.DATE_TIME)return r.BitArray.create(e.length,e=>f(o[e]));let a=null!=(t=e.categories)?t:[];return r.BitArray.create(e.length,e=>{var t;return(null!=(t=a[o[e]])?t:"")===""})}static where(e,t,n,o){let a=b.kindOf(e),l=a===i.Nd.BIG_INT||a===i.Nd.STRING_LIST?null:e.getRawData(),s=l instanceof Float32Array,u=e=>b._cell(e,a,n,s),d=Array.isArray(t.value)?t.value.map(u):u(t.value);switch(a){case i.Nd.BOOL:{let t=[o(!1,d),o(!0,d)];return r.BitArray.create(e.length,e=>t[l[e>>>5]>>>(31&e)&1])}case i.Nd.BIG_INT:return r.BitArray.create(e.length,t=>{let n=e.get(t);return null!=n&&o(BigInt(n),d)});case i.Nd.STRING_LIST:return r.BitArray.create(e.length,t=>{let n=e.get(t);return Array.isArray(n)&&o(n.join("\n"),d)});case i.Nd.INT:return r.BitArray.create(e.length,e=>l[e]!==c&&o(l[e],d));case i.Nd.FLOAT:case i.Nd.DATE_TIME:return r.BitArray.create(e.length,e=>!f(l[e])&&o(l[e],d));default:{var p;let t=(null!=(p=e.categories)?p:[]).map(e=>""!==e&&o(e,d));return r.BitArray.create(e.length,e=>!0===t[l[e]])}}}static compare(e,t,n){let o=v[n];if(void 0===o)throw new i.FH(`Operator "${n}" does not accept a column`);let a=b.cells(e),l=b.cells(t);return r.BitArray.create(e.length,e=>{let t=a(e),n=l(e);return null!==t&&null!==n&&o(t,n)})}static cells(e){let t=b.kindOf(e);if(t===i.Nd.BIG_INT)return t=>{let n=e.get(t);return null==n?null:BigInt(n)};if(t===i.Nd.STRING_LIST)return t=>{let n=e.get(t);return Array.isArray(n)?n.join("\n"):null};let n=e.getRawData();switch(t){case i.Nd.BOOL:return e=>(n[e>>>5]>>>(31&e)&1)==1;case i.Nd.INT:return e=>n[e]===c?null:n[e];case i.Nd.FLOAT:case i.Nd.DATE_TIME:return e=>f(n[e])?null:n[e];default:{var r;let t=null!=(r=e.categories)?r:[];return e=>{var r;let i=null!=(r=t[n[e]])?r:"";return""===i?null:i}}}}static likeRegExp(e){let t="";for(let n=0;n<e.length;n++){let r=e[n];"\\"===r&&n+1<e.length?t+=g(e[++n]):t+="%"===r?"[^]*":"_"===r?"[^]":g(r)}return RegExp(`^${t}$`,"i")}static _cell(e,t,n,r){switch(t){case i.Nd.INT:case i.Nd.FLOAT:{let t="number"==typeof e?e:Number(e);return r?Math.fround(t):t}case i.Nd.DATE_TIME:return 1e3*(e instanceof Date?e.getTime():(0,i.bl)(e)?(0,a.Ho)(e.span,n.now).getTime():"number"==typeof e?e:Date.parse(String(e)));case i.Nd.BIG_INT:return BigInt(e);case i.Nd.BOOL:return!0===e||"true"===e;default:return String((0,o.A)(e,n))}}}function y(e,t){let n=new Map;return{rowCount:e.length,column:a=>{let l=t.find(e=>e.name===a);if(void 0===l)return null;let s=n.get(a);return void 0===s&&n.set(a,s=function(e,t,n){let a=n.length,l=t=>{let r=n[t][e];return null==r||""===r?null:r},s=e=>{let t=l(e);return null===t?"":String(t)},u=(e,t)=>{let n=l(e);return null===n?t:Number(n)},d=(0,o.I)(t),h=(t,n)=>(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e})({name:e,type:d,length:a,getRawData:t},void 0===n?{}:n);switch(d){case i.Nd.INT:return h(()=>Int32Array.from(n,(e,t)=>u(t,c)));case i.Nd.FLOAT:return h(()=>Float64Array.from(n,(e,t)=>u(t,p)));case i.Nd.DATE_TIME:return h(()=>Float64Array.from(n,(e,t)=>{let n=l(t);return null===n?p:(n instanceof Date?n.getTime():Date.parse(String(n)))*1e3}));case i.Nd.BOOL:return h(()=>r.BitArray.create(a,e=>!0===l(e)).getBuffer());case i.Nd.BIG_INT:case i.Nd.STRING_LIST:return h(()=>new Int32Array(0),{get:l});default:{let e=[...new Set(n.map((e,t)=>s(t)))],t=new Map(e.map((e,t)=>[e,t]));return h(()=>Int32Array.from(n,(e,n)=>t.get(s(n))),{categories:e})}}}(a,l,e)),s}}}function _(e,t){return d(function*(e,t,n){var o,a;let l=void 0===n?{}:n,s={now:null!=(o=l.now)?o:new Date},u=null!=(a=l.signal)?a:m,c=t=>d(function*(){let n=null;var o=!0,a=!1,l=void 0;try{for(var d,p=t.nodes[Symbol.iterator]();!(o=(d=p.next()).done);o=!0){let r=d.value;u.throwIfAborted();let o=(0,i.IZ)(r)?yield c(r):yield k(e,r,s,u);n=null===n?o.clone():"and"===t.op?n.and(o):n.or(o)}}catch(e){a=!0,l=e}finally{try{o||null==p.return||p.return()}finally{if(a)throw l}}let h=null!=n?n:new r.BitArray(e.rowCount,!0);return!0===t.not?h.invert():h})();return c(t)}).apply(this,arguments)}function w(e,t){return d(function*(e,t,n){var o,a,l;let u=void 0===n?{}:n,c={now:null!=(o=u.now)?o:new Date},p=null!=(a=u.signal)?a:m,h=t=>{if("is null"===t.operator||"is not null"===t.operator)return new r.BitArray(e.rowCount);let n=b.nulls(x(e,t.property,t));return(0,i.eU)(t.value)?n.or(b.nulls(x(e,t.value.column,t))):n},f=t=>d(function*(){let n=null;var o=!0,a=!1,l=void 0;try{for(var s,u=t.nodes[Symbol.iterator]();!(o=(s=u.next()).done);o=!0){let r=s.value;p.throwIfAborted();let o=(0,i.IZ)(r)?yield f(r):[(yield k(e,r,c,p)).clone(),h(r)];if(null===n){n=o;continue}n="and"===t.op?[n[0].clone().and(o[0]),n[1].clone().or(o[1]).and(n[0].clone().or(n[1])).and(o[0].clone().or(o[1]))]:[n[0].clone().or(o[0]),n[1].clone().or(o[1]).andNot(n[0]).andNot(o[0])]}}catch(e){a=!0,l=e}finally{try{o||null==u.return||u.return()}finally{if(a)throw l}}let d=null!=n?n:[new r.BitArray(e.rowCount,!0),new r.BitArray(e.rowCount)];return!0===t.not?[d[0].clone().or(d[1]).invert(),d[1]]:d})(),g=function(e){if(Array.isArray(e))return e}(l=yield f(t))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var i=[],o=!0,a=!1;try{for(r=r.call(e);!(o=(t=r.next()).done)&&(i.push(t.value),2!==i.length);o=!0);}catch(e){a=!0,n=e}finally{try{o||null==r.return||r.return()}finally{if(a)throw n}}return i}}(l)||function(e){if(e){if("string"==typeof e)return s(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return s(e,2)}}(l)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),v=g[0],y=g[1];return v.or(y)}).apply(this,arguments)}function x(e,t,n){let r=e.column(t);if(!r){let e=`Unknown column "${t}"`;throw new i.FH(e,[{nodeId:n.id,code:"unknown-property",message:e}])}return r}function k(e,t,n,r){return d(function*(){let o=x(e,t.property,t),a=(Array.isArray(t.value)?t.value:[t.value]).find(i.Um);if(void 0!==a){let e=`Unbound parameter "$${a.param}"`;throw new i.FH(e,[{nodeId:t.id,code:"not-expressible",message:e}])}if((0,i.eU)(t.value))return b.compare(o,x(e,t.value.column,t),t.operator);let s=l.II.get(t.operator,{name:o.name,type:o.type,semType:o.semType}),u=(null==s?void 0:s.mask)?s.mask(o,t,n):(null==s?void 0:s.bitset)?yield s.bitset(o,t,r):null;if(null===u){let e=`"${t.property} ${t.operator}" cannot be evaluated on a DataFrame`;throw new i.FH(e,[{nodeId:t.id,code:"not-expressible",message:e}])}if(u.length!==e.rowCount){let n=`"${t.property} ${t.operator}" returned a mask of ${u.length} bits for ${e.rowCount} rows`;throw new i.FH(n,[{nodeId:t.id,code:"evaluation",message:n}])}return u})()}},7371(e,t,n){n.d(t,{I:()=>o.I,Nd:()=>i.Nd,i9:()=>i.i9,II:()=>a.II,Cu:()=>r,GP:()=>eb,MZ:()=>c,$y:()=>i.$y,bl:()=>i.bl});var r={};n.r(r),n.d(r,{CORE_OPERATORS:()=>a.g$,ColumnEvaluator:()=>ew.m8,FLOAT_NULL:()=>ew.fm,FilterError:()=>i.FH,INT_NULL:()=>ew.ku,KIND:()=>i.Nd,OperatorRegistry:()=>a.iN,applyTemplate:()=>g,bind:()=>ey,checkLocks:()=>f,clone:()=>i.o8,completionContext:()=>ee,cond:()=>i.j1,count:()=>i.U9,diff:()=>h,domainValue:()=>o.A,equals:()=>i.aI,escapeLike:()=>a.nN,find:()=>i.I6,flatten:()=>i.Bq,format:()=>eb,formatProperty:()=>ef,formatValue:()=>eg,fromDomainTree:()=>ep,fromJson:()=>i.Rf,fuzzyPair:()=>Y,group:()=>i.Os,hasPlaceholder:()=>i.Kc,insert:()=>i.Yr,isColumnRef:()=>i.eU,isCondition:()=>G,isFlat:()=>i.KF,isGroup:()=>i.IZ,isParam:()=>i.Um,isRef:()=>i.i9,isSpan:()=>i.bl,kindOf:()=>o.I,lockOf:()=>m,move:()=>i.Cy,negate:()=>Q,newId:()=>i.Si,operators:()=>a.II,optionsEquals:()=>i.Og,parentOf:()=>i.gN,parse:()=>e_,parseTree:()=>Z,property:()=>c,pruneInvalid:()=>x,queryPath:()=>function e(t,n){return"string"!=typeof n?(0,ex.EW)(()=>e(t,n.value)):""===n?t:`${t}?q=${encodeURIComponent(n)}`},recordsFrame:()=>ew.Gx,remove:()=>i.TF,replace:()=>i.HC,resetIds:()=>i.qD,resolveSpan:()=>v.Ho,schema:()=>d,spanOf:()=>v.ee,toCheckMask:()=>ew.Gw,toDomainTree:()=>eh,toJson:()=>i.aB,toMask:()=>ew.gz,update:()=>i.yo,validate:()=>w,valueEquals:()=>i.$y,walk:()=>i.GG});var i=n(6900),o=n(8614),a=n(6248);function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,i=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var o=[],a=!0,l=!1;try{for(i=i.call(e);!(a=(n=i.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==i.return||i.return()}finally{if(l)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}let u={none:0,value:1,all:2};function d(e,t){let n={properties:e.filter(e=>e.name).map(e=>{var t,n;return t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},e),n=n={name:e.name},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t})};return t&&(n.values=(e,n)=>{var r;let i=n.toLowerCase();return Promise.resolve((null!=(r=t[e.name])?r:[]).filter(e=>String(e).toLowerCase().includes(i)).map(e=>({value:e,label:String(e)})))}),n}function c(e,t){let n=t.split(".")[0],r=e.properties.find(e=>e.name===n);if(r)return r;let i=n.toLowerCase(),o=e.properties.filter(e=>e.name.toLowerCase()===i);return 1===o.length?o[0]:null}function p(e){let t=new Map;return(0,i.GG)(e,(e,n,r)=>t.set(e.id,{node:e,parent:n,index:r})),t}function h(e,t){let n=p(e),r=p(t),o={changed:[],added:[],removed:[],moved:[]},a=(e,t)=>e.nodes.filter(n=>{var r,i;return(null==(i=t.get(n.id))||null==(r=i.parent)?void 0:r.id)===e.id}).map(e=>e.id);var l=!0,u=!1,d=void 0;try{for(var c,h,m=r[Symbol.iterator]();!(l=(h=m.next()).done);l=!0){let e=s(h.value,2),t=e[0],l=e[1],u=l.node,d=l.parent,p=l.index,m=n.get(t);if(!m){d&&n.has(d.id)&&o.added.push({parentId:d.id,index:p,node:u});continue}if(d&&m.parent&&(d.id!==m.parent.id||a(d,n).indexOf(t)!==a(m.parent,r).indexOf(t))&&o.moved.push({id:t,from:{parentId:m.parent.id,index:m.index},to:{parentId:d.id,index:p}}),(0,i.IZ)(u)||(0,i.IZ)(m.node))continue;let f={id:t};u.property!==m.node.property&&(f.property=u.property),u.operator!==m.node.operator&&(f.operator=u.operator),(0,i.$y)(u.value,m.node.value)||(f.value=u.value),(0,i.Og)(u.options,m.node.options)||(f.options=null!=(c=u.options)?c:{}),Object.keys(f).length>1&&o.changed.push(f)}}catch(e){u=!0,d=e}finally{try{l||null==m.return||m.return()}finally{if(u)throw d}}var f=!0,g=!1,v=void 0;try{for(var b,y=n[Symbol.iterator]();!(f=(b=y.next()).done);f=!0){let e=s(b.value,2),t=e[0],n=e[1].parent;!r.has(t)&&n&&r.has(n.id)&&o.removed.push(t)}}catch(e){g=!0,v=e}finally{try{f||null==y.return||y.return()}finally{if(g)throw v}}return o}function m(e,t){let n="none",r=e=>{var t;e&&u[null!=(t=e.lock)?t:"none"]>u[n]&&(n=e.lock)};r((0,i.I6)(e,t));let o=new Set;for(let n=(0,i.gN)(e,t);n&&!o.has(n);n=(0,i.gN)(e,n.id))o.add(n),r(n);return n}function f(e,t){let n=[],r=(e,t)=>n.push({nodeId:e,code:"locked",message:t}),o=t=>{var n;if((0,i.IZ)(t))return null;let r=t.property.split(".")[0];if(e.allowedProperties&&!e.allowedProperties.includes(r))return`Property "${t.property}" is not offered here`;let o=null==(n=e.allowedOperators)?void 0:n[r];return o&&!o.includes(t.operator)?`Operator "${t.operator}" is not offered for "${t.property}"`:null},a=h(e.root,t),l=a.changed,s=a.added,u=a.removed,d=a.moved;var c=!0,p=!1,f=void 0;try{for(var g,v=l[Symbol.iterator]();!(c=(g=v.next()).done);c=!0){let n=g.value,a=m(e.root,n.id);if("all"===a||"value"===a&&(void 0!==n.property||void 0!==n.operator||void 0!==n.options))r(n.id,"all"===a?"This condition is locked":"Only the value of this condition may change");else{let e=o((0,i.I6)(t,n.id));e&&r(n.id,e)}}}catch(e){p=!0,f=e}finally{try{c||null==v.return||v.return()}finally{if(p)throw f}}var b=!0,y=!1,_=void 0;try{for(var w,x=s[Symbol.iterator]();!(b=(w=x.next()).done);b=!0){let t=w.value,n=t.parentId,i=t.node;if(!1===e.allowAdd||"none"!==m(e.root,n))r(i.id,"Conditions cannot be added here");else{let e=o(i);e&&r(i.id,e)}}}catch(e){y=!0,_=e}finally{try{b||null==x.return||x.return()}finally{if(y)throw _}}var k=!0,O=!1,A=void 0;try{for(var S,P=u[Symbol.iterator]();!(k=(S=P.next()).done);k=!0){let t=S.value;"none"!==m(e.root,t)&&r(t,"This condition cannot be removed")}}catch(e){O=!0,A=e}finally{try{k||null==P.return||P.return()}finally{if(O)throw A}}var E=!0,C=!1,j=void 0;try{for(var T,N=d[Symbol.iterator]();!(E=(T=N.next()).done);E=!0){let t=T.value,n=t.id,i=t.from,o=t.to;(!1===e.allowAdd&&i.parentId!==o.parentId||"none"!==m(e.root,n)||"none"!==m(e.root,o.parentId))&&r(n,"This condition cannot be moved")}}catch(e){C=!0,j=e}finally{try{E||null==N.return||N.return()}finally{if(C)throw j}}return(0,i.GG)(t,t=>{let n=(0,i.I6)(e.root,t.id);n&&(0,i.IZ)(t)&&(0,i.IZ)(n)&&"none"!==m(e.root,t.id)&&(t.op!==n.op||!0===t.not!=(!0===n.not))&&r(t.id,"This group is locked")}),!1!==e.allowAdvanced||(0,i.KF)(t)||r(t.id,"Groups are not allowed here"),n}function g(e){return(0,i.o8)(e.root)}var v=n(4208);let b=/^-?\d+$/,y=["=","!=","<","<=",">",">="],_=[i.Nd.INT,i.Nd.FLOAT,i.Nd.BIG_INT];function w(e,t,n,r){let l=[];return(0,i.GG)(e,e=>{(0,i.IZ)(e)||function(e,t,n,r){let l=(t,n)=>r.push({nodeId:e.id,code:t,message:n}),s=c(t,e.property);if(!s){let n=c(t,`${e.property.split(".")[0]}_id`);l("unknown-property",n&&n.ref?`Unknown property "${e.property}" — did you mean \`${n.name}.name\`?`:`Unknown property "${e.property}"`);return}if(e.property.includes("."))return;let u=a.II.for(s).find(t=>t.id===e.operator);if(!u)return l("operator-not-applicable",`Operator "${e.operator}" is not applicable to "${e.property}"`);let d=e.value,p=null==d||""===d;if(1===u.arity&&p||2===u.arity&&!(Array.isArray(d)&&2===d.length)||"n"===u.arity&&!(Array.isArray(d)&&d.length>0)){var h;let t=null!=(h=s.friendlyName)?h:e.property;l("missing-value",2===u.arity?`"${t}" needs two bounds`:"n"===u.arity?`"${t}" needs at least one value`:`"${t}" needs a value`);return}if(0!==u.arity){let e=(0,o.I)(s);var m=!0,f=!1,g=void 0;try{for(var w,x=(Array.isArray(d)?d:[d])[Symbol.iterator]();!(m=(w=x.next()).done);m=!0){let n=w.value,r=function(e,t,n,r,a){var l,s,u;let d=e=>`Expected ${e} for "${n.name}"`;if((0,i.Um)(e))return null;if((0,i.eU)(e)){let l=c(a,e.column);if(!l||e.column.includes(".")){let o=`Unknown column "${e.column}"`;return e.column.includes(".")?o:"under"===r.id?`${o} — under takes a ${null!=(u=n.ref)?u:"row"} — pick one from the list`:n.ref?`${o} — did you mean \`${n.name}.name ${r.id} "${e.column}"\`?`:t===i.Nd.STRING||t===i.Nd.STRING_LIST||void 0!==n.choices?`${o} — quote a text value`:o}return y.includes(r.id)?(0,o.I)(l)===t||_.includes(t)&&_.includes((0,o.I)(l))?null:`Cannot compare "${n.name}" with "${l.name}"`:`Operator "${r.id}" does not accept a column`}switch(t){case i.Nd.INT:if("number"!=typeof e||!Number.isInteger(e))return d("an integer");break;case i.Nd.FLOAT:if("number"!=typeof e||!Number.isFinite(e))return d("a number");break;case i.Nd.BIG_INT:if(!("number"==typeof e&&Number.isInteger(e))&&!("string"==typeof e&&b.test(e)))return d("an integer");break;case i.Nd.DATE_TIME:if(e instanceof Date?Number.isNaN(e.getTime()):(0,i.bl)(e)?!(0,v.Yw)(e.span):"string"!=typeof e||Number.isNaN(Date.parse(e)))return d("a date or a time span");break;case i.Nd.BOOL:if("boolean"!=typeof e)return d("true or false");break;case i.Nd.REF:if(!(0,i.i9)(e)&&"string"!=typeof e)return d("a reference");break;default:if("string"!=typeof e&&"number"!=typeof e)return d("a string")}if("number"==typeof e){if(void 0!==n.min&&e<n.min)return`"${n.name}" is at least ${n.min}`;if(void 0!==n.max&&e>n.max)return`"${n.name}" is at most ${n.max}`}return n.choices&&("="===r.id||"in"===r.id)&&!n.choices.includes(String(e))?`"${e}" is not one of the choices of "${n.name}"`:null!=(l=null==(s=r.check)?void 0:s.call(r,e))?l:null}(n,e,s,u,t);if(r)return void l("invalid-value",r)}}catch(e){f=!0,g=e}finally{try{m||null==x.return||x.return()}finally{if(f)throw g}}}("domain"===n?void 0!==u.domain||!0===u.host:"dataframe"!==n||void 0!==u.mask||void 0!==u.bitset)||l("not-expressible",`"${e.property} ${e.operator}" cannot be expressed for ${n}`)}(e,t,n,l)}),r&&l.push(...f(r,e)),l}function x(e,t,n,r){let o=new Set(w(e,t,n,r).map(e=>e.nodeId)),a=e=>{let t=[];var n,r,l=!0,s=!1,u=void 0;try{for(var d,c=e.nodes[Symbol.iterator]();!(l=(d=c.next()).done);l=!0){let e=d.value;if(o.has(e.id))continue;let n=(0,i.IZ)(e)?a(e):e;(!(0,i.IZ)(n)||n.nodes.length>0)&&t.push(n)}}catch(e){s=!0,u=e}finally{try{l||null==c.return||c.return()}finally{if(s)throw u}}return t.length===e.nodes.length&&t.every((t,n)=>t===e.nodes[n])?e:(n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},e),r=r={nodes:t},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(r)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}),n)};return a(e)}function k(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function O(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,i=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var o=[],a=!0,l=!1;try{for(i=i.call(e);!(a=(n=i.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==i.return||i.return()}finally{if(l)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return k(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return k(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}let A=/[\t\n\v\f\r \u0085\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]/,S=/[A-Za-z]/,P=/[A-Za-z0-9_]/,E=/[0-9]/,C=/^[0-9A-Fa-f]{4}/,j=/^-?(?:0|\d+)(?:\.\d+)?(?:[eE][-+]?\d+)?/,T=/^-?\d+$/,N={"\\":"\\","/":"/",'"':'"',"'":"'",b:"\b",f:"\f",n:"\n",r:"\r",t:" "},I=["!matches","!like","matches","starts","like","ends","!~","~=","!=",">=","<=","=","~",">","<"],D=["!matches","!like","!in","!~","~=","!=",">=","<=","&&","||","=","~",">","<","&","|"],L=[["kb",1024],["KB",1024],["MB",1048576],["GB",0x40000000],["TB",0x10000000000],["k",1e3],["K",1e3],["M",1e6]],z={"<":">",">":"<","<=":">=",">=":"<="},F={"=":"!=","!=":"=",">":"<=","<=":">","<":">=",">=":"<",like:"not like","not like":"like","~*":"!~*","!~*":"~*",is:"is not","is not":"is"},B=new Set(["true","false","null","now","@current"]),M=new Set(["=","!=","<","<=",">",">="]),R=new Set(["like","starts","ends","matches","fuzzy","in","between","under"]),q=new Set(["=","!=",">",">=","<","<=","~","~=","!~","!like","!matches","!in"]),H={"~":"matches","!~":"!matches","~=":"fuzzy","!in":"not in"},W=new Set(["and","or","&&","&","||","|"]),V=(e,t,n)=>({property:e,operator:t,value:n}),G=e=>"object"==typeof e&&!Array.isArray(e),U=e=>"object"==typeof e&&null!==e&&!(e instanceof Date),K=e=>Number.isInteger(e)&&1e21>Math.abs(e)?`${e}.0`:String(e);function Y(e){if(!Array.isArray(e)||3!==e.length||"or"!==e[1]||!G(e[0])||!G(e[2]))return null;let t=O(e,3),n=t[0],r=t[2];return"fuzzy"===n.operator&&"like"===r.operator&&n.property===r.property?{fuzzy:n,like:r}:null}function Q(e){return e.map(e=>{var t,n;if("and"===e)return"or";if("or"===e)return"and";if(Array.isArray(e)){let t=Y(e);return t?V(t.like.property,"not like",t.like.value):Q(e)}let r=F[e.operator];if(!r)throw new i.FH(`Cannot negate "${e.operator}"`);return t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},e),n=n={operator:r},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t})}class J{interpolate(e){return e instanceof Date?e.toISOString().replace("T"," "):"number"==typeof e?this.numberText:String(e)}fail(e,t){let n=void 0===t?this.pos:t;n>this.farthest&&(this.farthest=n,this.expected=[]),n!==this.farthest||this.expected.includes(e)||this.expected.push(e)}ws(){for(;this.pos<this.text.length&&A.test(this.text[this.pos]);)this.pos++}ch(e){var t;return null!=(t=this.text[this.pos+(void 0===e?0:e)])?t:""}literal(e){return!!this.text.startsWith(e,this.pos)&&(this.pos+=e.length,!0)}token(e){let t=this.pos;return(this.ws(),this.literal(e))?(this.ws(),!0):(this.pos=t,!1)}keyword(e){let t=this.pos;return(this.ws(),this.literal(e)&&!P.test(this.ch()))?(this.ws(),!0):(this.pos=t,!1)}start(){if(this.ws(),this.pos===this.text.length)return[];let e=this.conditions();if(void 0!==e)return this.ws(),this.pos===this.text.length?e:this.fail("end of input")}conditions(){let e=this.term();if(void 0===e)return;let t=[e];for(;;){let e=this.pos,n=this.connector(),r=this.term();if(void 0===r)return this.pos=e,t;t.push(n,r)}}connector(){return this.keyword("or")||this.token("||")||this.token("|")?"or":(this.keyword("and")||this.token("&&")||this.token("&"),"and")}term(){this.ws();let e=this.pos,t=this.condition();if(void 0!==t)return t;if(this.pos=e,this.keyword("not")&&this.token("(")){let e=this.conditions();if(void 0!==e&&this.token(")")){let t=Q(e);return 1===t.length?t[0]:t}void 0!==e&&this.fail('")"')}if(this.pos=e,this.token("(")){let e=this.conditions();if(void 0!==e&&this.token(")"))return e;void 0!==e&&this.fail('")"')}return this.pos=e,this.fail("a condition")}condition(){let e=this.pos,t=this.property();if(void 0!==t){let e=this.pos;for(let n=0,r=[this.hostCondition,this.fuzzyCondition,this.operatorCondition,this.inCondition,this.underCondition,this.betweenCondition];n<r.length;n++){let i=r[n].call(this,t);if(void 0!==i)return i;this.pos=e}}if(this.pos=e,this.keyword("not")){let e=this.property();if(void 0!==e)return V(e,"=",!1)}if(this.pos=e,this.ws(),this.literal("#")){let e=this.pos;for(;P.test(this.ch());)this.pos++;let t=this.text.slice(e,this.pos);return this.ws(),V("entityTags.tag","=",t)}this.pos=e}property(){this.ws();let e=this.pos;if(!this.nameSegment()){this.pos=e;return}for(;"."===this.ch();){let e=this.pos;if(this.pos++,!this.nameSegment()){this.pos=e;break}}let t=this.text.slice(e,this.pos);return this.ws(),t}nameSegment(){if(S.test(this.ch())){for(this.pos++;P.test(this.ch());)this.pos++;return!0}if("["!==this.ch())return!1;for(this.pos++;this.pos<this.text.length;){let e=this.ch();if("]"===e)return this.pos++,!0;if("\\"!==e)this.pos++;else if("]"===this.ch(1)||this.ch(1)in N)this.pos+=2;else if("u"===this.ch(1)&&C.test(this.text.slice(this.pos+2,this.pos+6)))this.pos+=6;else break}return!1}operator(){this.ws();var e=!0,t=!1,n=void 0;try{for(var r,i=I[Symbol.iterator]();!(e=(r=i.next()).done);e=!0){let e=r.value;if(this.literal(e))return this.ws(),e}}catch(e){t=!0,n=e}finally{try{e||null==i.return||i.return()}finally{if(t)throw n}}}fuzzyCondition(e){if(!this.keyword("fuzzy"))return;let t=null;if("("===this.ch()){let e=this.pos;this.pos++,this.ws();let n=this.number();this.ws(),void 0!==n&&this.literal(")")?t=n:this.pos=e}let n=this.value();if(void 0!==n)return[{property:e,operator:"fuzzy",threshold:t,value:n},"or",V(e,"like",U(n)?n:`%${this.interpolate(n)}%`)]}hostCondition(e){let t=a.II.hosted().find(e=>this.keyword(e.id)),n=void 0===t?void 0:this.value();return void 0===n?void 0:V(e,t.id,n)}operatorCondition(e){let t=this.operator();if(void 0===t)return this.fail("an operator");let n=this.pos,r=this.value();if(void 0!==r)return this.normalize(e,t,r);if(this.pos=n,!M.has(t))return;let i=this.columnRef();return void 0===i?void 0:V(e,t,{$column:i})}columnRef(){this.ws();let e=this.pos;if(!S.test(this.ch()))return;for(;P.test(this.ch());)this.pos++;let t=this.text.slice(e,this.pos);if(B.has(t)||"."===this.ch()||"("===this.ch()){this.pos=e;return}return this.ws(),t}normalize(e,t,n){let r=n instanceof Date?(0,v.ee)(n):void 0;if(void 0!==r&&n.getTime()>this.now.getTime()+1e3){var i;n=(0,v.uA)((0,v.Ho)(`-${r}`,this.now),`-${r}`),t=null!=(i=z[t])?i:t}let o=U(n),a=o?"":this.interpolate(n),l=e=>o?n:e;switch(t){case"like":return V(e,"like",l(`%${a}%`));case"starts":return V(e,"like",l(`${a}%`));case"ends":return V(e,"like",l(`%${a}`));case"!like":return V(e,"not like",l(`%${a}%`));case"matches":case"~":return V(e,"~*",n);case"!matches":case"!~":return V(e,"!~*",n);case"~=":return[{property:e,operator:"fuzzy",threshold:null,value:n},"or",V(e,"like",l(`%${a}%`))];default:return V(e,t,n)}}inCondition(e){let t=this.keyword("in")?"=":this.keyword("not in")||this.keyword("!in")?"!=":void 0;if(void 0===t)return;if(!this.token("("))return this.fail('"("');let n=[];for(;;){let r=this.value();if(void 0===r)return;if(n.push(r),this.token(")"))return V(e,t,n);if(!this.token(","))return this.fail('"," or ")"')}}underCondition(e){if(!this.keyword("under"))return;let t=this.value();return void 0===t?void 0:V(e,"under",t)}betweenCondition(e){if(!this.keyword("between"))return;let t=this.value();if(void 0===t)return;if(!this.keyword("and"))return this.fail('"and"');let n=this.value();if(void 0!==n)return[V(e,">=",t),"and",V(e,"<=",n)]}value(){this.ws();let e=this.pos,t=e=>(this.ws(),e);if(this.literal("true"))return t(!0);if(this.literal("false"))return t(!1);if(this.literal("null"))return t(null);if(this.literal("@current"))return t("@current");if(this.literal("$")){let e=this.pos;if(!S.test(this.ch()))return this.fail("a parameter name",e);for(;P.test(this.ch());)this.pos++;return t({$param:this.text.slice(e,this.pos)})}let n=j.exec(this.text.slice(e));if(n){var r;let i=null!=(r=this.text[e+n[0].length])?r:"";if("hwdmy".includes(i)&&""!==i){if(!T.test(n[0]))return this.fail("a whole number of h, d, w, m or y",e);this.pos=e+n[0].length+1;let r=`${n[0]}${i}`;return t((0,v.uA)((0,v.Ho)(r,this.now),r))}}if(this.literal("now"))return t((0,v.uA)(new Date(this.now.getTime()),"now"));if(n){this.pos=e+n[0].length;var i=!0,o=!1,a=void 0;try{for(var l,s=L[Symbol.iterator]();!(i=(l=s.next()).done);i=!0){let e=O(l.value,2),r=e[0],i=e[1];if(this.literal(r)){let e=Number(n[0])*i;return this.numberText=K(e),t(e)}}}catch(e){o=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(o)throw a}}let r=Number(n[0]);return this.numberText=n[0].includes(".")?K(r):String(r),t(0===r?0:r)}let u=this.string();return void 0===u?this.fail("a value",e):t(u)}number(){let e=j.exec(this.text.slice(this.pos));if(e)return this.pos+=e[0].length,Number(e[0])}string(){let e=this.ch();if('"'!==e&&"'"!==e)return;this.pos++;let t="";for(;;){if(this.pos>=this.text.length)return this.fail("a closing quote");let n=this.ch();if(n===e)return this.pos++,t;if("\\"!==n)t+=n,this.pos++;else if(this.ch(1)in N)t+=N[this.ch(1)],this.pos+=2;else{if(!("u"===this.ch(1)&&C.test(this.text.slice(this.pos+2,this.pos+6))))return this.fail("an escape");t+=String.fromCharCode(parseInt(this.text.slice(this.pos+2,this.pos+6),16)),this.pos+=6}}}constructor(e,t){this.text=e,this.now=t,this.pos=0,this.farthest=0,this.expected=[],this.numberText=""}}function Z(e,t){var n;let r=new J(e,null!=(n=null==t?void 0:t.now)?n:new Date),i=r.start();if(void 0!==i)return{tree:i,errors:[]};let o=r.farthest,a=X(e).find(e=>e.start<=o&&o<e.end),l=a?a.end:Math.min(o+1,e.length);return{tree:[],errors:[{nodeId:null,code:"syntax",message:`Expected ${r.expected.join(" or ")}`,position:{start:o,end:l}}]}}function X(e){let t=[],n=0,r=(r,i)=>t.push({type:r,text:e.slice(i,n),start:i,end:n}),i=()=>n+="\\"===e[n]?2:1;for(;n<e.length;){var o,a,l,s,u,d,c;let t=e[n],p=n;if(A.test(t))n++;else if('"'===t||"'"===t){for(n++;n<e.length&&e[n]!==t;)i();n=Math.min(n+1,e.length),r("string",p)}else if("#"===t||"@"===t){for(n++;P.test(null!=(a=e[n])?a:"");)n++;r("#"===t?"tag":"name",p)}else if(S.test(t)||"_"===t||"["===t){for(;;){if("["===e[n]){for(n++;n<e.length&&"]"!==e[n];)i();n=Math.min(n+1,e.length)}else for(;P.test(null!=(s=e[n])?s:"");)n++;if("."===e[n]&&(P.test(null!=(l=e[n+1])?l:"")||"["===e[n+1]))n++;else break}r("name",p)}else if(E.test(t)||"-"===t&&E.test(null!=(o=e[n+1])?o:"")){for(n+=j.exec(e.slice(n))[0].length;S.test(null!=(u=e[n])?u:"");)n++;r("number",p)}else"("===t||")"===t||","===t?(n++,r("punct",p)):(n+=null!=(d=null==(c=D.find(t=>e.startsWith(t,n)))?void 0:c.length)?d:1,r("symbol",p))}return t}function ee(e,t,n){let r,i,o=X(e),l=o.find(e=>"punct"!==e.type&&e.start<t&&t<=e.end&&!(t===e.end&&"string"===e.type&&e.end-e.start>1&&e.text.endsWith(e.text[0]))),s="property",u=!1,d=0,p=!1,h=!1,m=-1,f=0,g=0,v=e=>"string"===e.type||"number"===e.type||"name"===e.type&&B.has(e.text),b=e=>{var t;r=null!=(t=c(n,e.text))?t:void 0,i=void 0,f=e.end};var y=!0,_=!1,w=void 0;try{for(var x,k,O,A,S,E=o[Symbol.iterator]();!(y=(S=E.next()).done);y=!0){let n=S.value;if(n===l||n.end>t)break;if(n.start<g)continue;let o="name"===n.type?n.text:"";if("property"===s)"tag"===n.type?s="connector":"not"===o?h=!0:("name"!==n.type||B.has(o)||(b(n),s=h?"connector":"operator"),h=!1);else if("operator"===s){let r=a.II.hosted().find(r=>e.startsWith(r.id,n.start)&&n.start+r.id.length<t&&!P.test(e[n.start+r.id.length]));if(void 0!==r){i=r.id,s="value",m=g=n.start+r.id.length;continue}if("not"===o){h=!0;continue}let l=h&&"in"===o?"not in":n.text;h=!1,("symbol"===n.type&&q.has(n.text)||"name"===n.type&&R.has(o))&&(i=null!=(A=H[l])?A:l,u="in"===i||"not in"===i,d=+("between"===i),s="value",m=n.end)}else"value"===s?"punct"===n.type&&"("===n.text?"fuzzy"===i&&(p=!0):"punct"===n.type&&")"===n.text?p?p=!1:u&&(u=!1,s="connector"):1===d&&"and"===o?d=2:!v(n)||u||p||1===d||(d=0,s="connector"):("symbol"===n.type||"name"===n.type)&&W.has(n.text)||"not"===o?(s="property",h="not"===o,r=void 0,i=void 0):"name"!==n.type||B.has(o)?"tag"===n.type&&(s="connector"):(b(n),s="operator")}}catch(e){_=!0,w=e}finally{try{y||null==E.return||E.return()}finally{if(_)throw w}}let C="operator"===s?e.slice(f,t).trimStart():"",j=/\s/.test(C)&&a.II.hosted().some(e=>e.id.startsWith(C)),T={expect:s,prefix:j?C:l?e.slice(l.start+ +("string"===l.type),t):"",replace:{start:j?t-C.length:null!=(x=null==l?void 0:l.start)?x:t,end:null!=(k=null==l?void 0:l.end)?k:t}},N="value"!==s||(null==l?void 0:l.type)==="string"||u||p||0!==d?void 0:function(e,t,n,r){if(n<0)return;let i=t.find(e=>e.start>=n&&e.start>=r&&"name"===e.type&&W.has(e.text.toLowerCase())),o=void 0===i?e.length:i.start,a=n+(e.slice(n,o).length-e.slice(n,o).replace(/^\s+/,"").length);return a>o?void 0:{start:a,end:o-(e.slice(a,o).length-e.slice(a,o).replace(/\s+$/,"").length)}}(e,o,m,t);void 0!==N&&(T.valueSpan=N),r&&(T.property=r);let I=void 0===i?void 0:null!=(O=r&&a.II.get(i,r))?O:a.II.get(i);return I&&(T.operator=I),T}function et(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function en(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function er(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function ei(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,i=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var o=[],a=!0,l=!1;try{for(i=i.call(e);!(a=(n=i.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==i.return||i.return()}finally{if(l)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return et(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return et(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}let eo=/^[A-Za-z]\w*(\.[A-Za-z]\w*)*$/,ea={"\\":"\\\\",'"':'\\"',"'":"\\'","\n":"\\n","\r":"\\r"," ":"\\t","\b":"\\b","\f":"\\f"},el={"\\":"\\","]":"]","/":"/",'"':'"',"'":"'",b:"\b",f:"\f",n:"\n",r:"\r",t:" "};function es(e,t){let n=0;for(let r=t-1;r>=0&&"\\"===e[r];r--)n++;return n%2==0}function eu(e){if("object"==typeof e&&null!==e)return"string"==typeof e.$column?{column:e.$column}:"string"==typeof e.$param?{param:e.$param}:void 0}function ed(e,t){if(e instanceof Date){let t=(0,v.ee)(e);return void 0===t?e:{span:t}}let n=eu(e);if(void 0!==n)return n;if("string"!=typeof e||!t)return e;let r=(0,o.I)(t);return r===i.Nd.REF&&t.ref&&"@current"!==e?{type:t.ref,id:e}:r!==i.Nd.DATE_TIME||Number.isNaN(Date.parse(e))?e:new Date(e)}function ec(e,t){var n;let r=Object.getPrototypeOf(e);if(r!==Object.prototype&&null!==r)throw new i.FH("condition is not a plain object");if("string"!=typeof e.property)throw new i.FH("condition has no property");let o=(!(n=e.property).includes("[")?n:n.replace(/\[((?:[^\]\\]|\\.)*)\]/g,(e,t)=>t.replace(/\\(u[0-9A-Fa-f]{4}|.)/g,(e,t)=>{var n;return 5===t.length?String.fromCharCode(parseInt(t.slice(1),16)):null!=(n=el[t])?n:`\\${t}`}))).split("."),a=t?c(t,o[0]):null;a&&(o[0]=a.name);let l=o.join("."),s=1===o.length?a:null,u=e=>Array.isArray(e)?e.map(e=>ed(e,s)):ed(e,s),d=e.operator,p=e.value,h=()=>{var e;return null!=(e=eu(p))?e:String(p)};if("fuzzy"===d)return(0,i.j1)(l,"fuzzy",h(),null==e.threshold?void 0:{options:{threshold:e.threshold}});if(("="===d||"!="===d)&&Array.isArray(p))return(0,i.j1)(l,"="===d?"in":"not in",u(p));if(("="===d||"!="===d)&&null==p)return(0,i.j1)(l,"="===d?"is null":"is not null");if("is"===d||"is not"===d)return(0,i.j1)(l,"is"===d?"is null":"is not null");if("~*"===d||"!~*"===d)return(0,i.j1)(l,"~*"===d?"matches":"!matches",h());if(("like"===d||"not like"===d)&&void 0!==eu(p))return(0,i.j1)(l,"like"===d?"like":"!like",h());if("like"===d||"not like"===d){let e=String(p),t=e.startsWith("%"),n=e.length>+!!t&&e.endsWith("%")&&es(e,e.length-1),r=e.slice(+!!t,n?-1:void 0),o=function(e){for(let t=0;t<e.length;t++)if(("%"===e[t]||"_"===e[t])&&es(e,t))return!0;return!1}(r);return t&&n&&!o?(0,i.j1)(l,"like"===d?"like":"!like",r.replace(/\\([\\%_])/g,"$1")):"like"===d&&!o&&(t||n)?(0,i.j1)(l,n?"starts":"ends",r.replace(/\\([\\%_])/g,"$1")):(0,i.j1)(l,"like"===d?"like":"!like",e,{options:{raw:!0}})}return(0,i.j1)(l,d,u(p))}function ep(e,t){let n=function e(t,n){let r=[[]],o=!1,a=null,l=null;var s=!0,u=!1,d=void 0;try{for(var c,p,h=t[Symbol.iterator]();!(s=(p=h.next()).done);s=!0){let t,s=p.value;if("and"===s||"or"===s){a=s,o&&null===l&&(l=s);continue}if(G(s))t=ec(s,n);else if(!(t=function(e,t){let n=Y(e);if(n)return ec(n.fuzzy,t);if(3!==e.length||"and"!==e[1]||!G(e[0])||!G(e[2]))return null;let r=ei(e,3),i=r[0],o=r[2];return">="!==i.operator||"<="!==o.operator||i.property!==o.property?null:ec({property:i.property,operator:"between",value:[i.value,o.value]},t)}(s,n))){let r=e(s,n);t=0===r.nodes.length?null:1===r.nodes.length&&(0,i.IZ)(r.nodes[0])?r.nodes[0]:r}t&&(o&&(null!=(c=null!=l?l:a)?c:"and")==="or"?r.push([t]):r[r.length-1].push(t),o=!0,l=null)}}catch(e){u=!0,d=e}finally{try{s||null==h.return||h.return()}finally{if(u)throw d}}return 1===r.length?(0,i.Os)("and",r[0]):(0,i.Os)("or",r.map(e=>1===e.length?e[0]:(0,i.Os)("and",e)))}(Array.isArray(e)?e:[e],t);for(;1===n.nodes.length&&(0,i.IZ)(n.nodes[0]);)n=n.nodes[0];return n}function eh(e,t){var n;let r=null!=(n=null==t?void 0:t.now)?n:new Date,o=e=>{let n=[];var l=!0,s=!1,u=void 0;try{for(var d,p,h=e.nodes[Symbol.iterator]();!(l=(p=h.next()).done);l=!0){let l,s=p.value;if((0,i.IZ)(s)){let e=o(s);if(0===e.length)continue;l=1===e.length&&(Array.isArray(e[0])||!0===s.not)?e[0]:e}else{let e=(null==t?void 0:t.schema)?c(t.schema,s.property):null,n=null!=(d=a.II.get(s.operator,null!=e?e:void 0))?d:a.II.get(s.operator);if(!(null==n?void 0:n.domain))throw new i.FH(`Operator "${s.operator}" has no domain form`);l=n.domain(s,null!=e?e:{name:s.property},{now:r})}n.length>0&&n.push(e.op),n.push(l)}}catch(e){s=!0,u=e}finally{try{l||null==h.return||h.return()}finally{if(s)throw u}}return!0===e.not?Q(n):n};return o(e)}function em(e){return`"${e.replace(/[\\"'\n\r\t\b\f]|[\x00-\x1f]/g,e=>{var t;return null!=(t=ea[e])?t:`\\u${e.charCodeAt(0).toString(16).padStart(4,"0")}`})}"`}function ef(e){return eo.test(e)?e:`[${e.replace(/[\\\]]|[\x00-\x1f]/g,e=>"\\"===e||"]"===e?`\\${e}`:`\\u${e.charCodeAt(0).toString(16).padStart(4,"0")}`)}]`}function eg(e){var t;return void 0===e?"":Array.isArray(e)?`(${e.map(eg).join(", ")})`:null===e||"boolean"==typeof e||"number"==typeof e?String(e):e instanceof Date?null!=(t=(0,v.ee)(e))?t:em(e.toISOString()):(0,i.bl)(e)?e.span:(0,i.i9)(e)?em(e.id):(0,i.eU)(e)?ef(e.column):(0,i.Um)(e)?`$${e.param}`:"@current"===e?e:em(e)}function ev(e){var t,n,r;let o=ef(e.property);if((0,i.Kc)(e.value)&&"between"!==e.operator)return`${o} ${e.operator} ${eg(e.value)}`;switch(e.operator){case"is null":return`${o} = null`;case"is not null":return`${o} != null`;case"between":{let t=ei(Array.isArray(e.value)?e.value:[],2),n=t[0],r=t[1];return`${o} between ${eg(n)} and ${eg(r)}`}case"fuzzy":{let n=null==(t=e.options)?void 0:t.threshold;return`${o} fuzzy${"number"==typeof n?`(${n})`:""} ${eg(e.value)}`}case"like":case"!like":case"starts":case"ends":{let t=String(null!=(n=e.value)?n:"");if((null==(r=e.options)?void 0:r.raw)!==!0)return`${o} ${e.operator} ${em((0,a.nN)(t))}`;let i=("like"===e.operator||"!like"===e.operator)&&t.length>1&&t.startsWith("%")&&t.endsWith("%")&&es(t,t.length-1);return`${o} ${e.operator} ${em(i?t.slice(1,-1):t)}`}default:return`${o} ${e.operator} ${eg(e.value)}`.trimEnd()}}function eb(e){return(0,i.IZ)(e)?function e(t,n){let r=function(t){let n=[];var r=!0,o=!1,a=void 0;try{for(var l,s=t.nodes[Symbol.iterator]();!(r=(l=s.next()).done);r=!0){let t=l.value,r=(0,i.IZ)(t)?e(t,!0):ev(t);""!==r&&n.push(r)}}catch(e){o=!0,a=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw a}}return n}(t);if(0===r.length)return"";let o=1===r.length?r[0]:r.join(` ${t.op} `);return!0===t.not?`not (${1===r.length&&o.startsWith("(")?o.slice(1,-1):o})`:n&&(r.length>1||!o.startsWith("("))?`(${o})`:o}(e,!1):ev(e)}function ey(e,t,n){let r=(e,n)=>(0,i.Um)(e)&&void 0!==t[e.param]?ed(t[e.param],n):e,o=e=>{if((0,i.IZ)(e))return er(en({},e),{nodes:e.nodes.map(o)});if(void 0===e.value||!(0,i.Kc)(e.value))return e;let t=n?c(n,e.property):null;return er(en({},e),{value:Array.isArray(e.value)?e.value.map(e=>r(e,t)):r(e.value,t)})};return o(e)}function e_(e,t,n,r){let o=Z(e,r),a=o.tree,l=o.errors;if(l.length>0)return{root:(0,i.Os)("and"),problems:l};let s=ep(a,t);return{root:s,problems:t?w(s,t,n):[]}}var ew=n(50),ex=n(7115)},8614(e,t,n){n.d(t,{A:()=>s,I:()=>a});var r=n(3095),i=n(6900),o=n(4208);function a(e){var t;if(e.kind)return e.kind;if(e.ref)return i.Nd.REF;switch(null!=(t=e.propertyType)?t:e.type){case r.TYPE.INT:return i.Nd.INT;case r.TYPE.BIG_INT:return i.Nd.BIG_INT;case r.TYPE.FLOAT:case i.Nd.FLOAT:case r.TYPE.NUM:case r.TYPE.QNUM:return i.Nd.FLOAT;case r.TYPE.BOOL:return i.Nd.BOOL;case r.TYPE.DATE_TIME:return i.Nd.DATE_TIME;case r.TYPE.LIST:case r.TYPE.STRING_LIST:return i.Nd.STRING_LIST;default:return i.Nd.STRING}}function l(e,t){return e instanceof Date?e.toISOString():(0,i.bl)(e)?(0,o.Ho)(e.span,t).toISOString():(0,i.i9)(e)?e.id:(0,i.eU)(e)?{$column:e.column}:(0,i.Um)(e)?{$param:e.param}:e}function s(e,t){return Array.isArray(e)?e.map(e=>l(e,t.now)):l(e,t.now)}},6900(e,t,n){n.d(t,{$y:()=>E,Bq:()=>A,Cy:()=>k,FH:()=>l,GG:()=>v,HC:()=>O,I6:()=>f,IZ:()=>m,KF:()=>y,Kc:()=>L,Nd:()=>a,Og:()=>P,Os:()=>p,Rf:()=>j,Si:()=>d,TF:()=>x,U9:()=>b,Um:()=>D,Yr:()=>w,aB:()=>C,aI:()=>function e(t,n,r){var i,o,a,l;let s=void 0===r||r;return(!!s||t.id===n.id)&&(m(t)||m(n)?!!m(t)&&!!m(n)&&t.op===n.op&&!0===t.not==(!0===n.not)&&(null!=(a=t.lock)?a:"none")===(null!=(l=n.lock)?l:"none")&&t.nodes.length===n.nodes.length&&t.nodes.every((t,r)=>e(t,n.nodes[r],s)):t.property===n.property&&t.operator===n.operator&&(null!=(i=t.lock)?i:"none")===(null!=(o=n.lock)?o:"none")&&E(t.value,n.value)&&P(t.options,n.options))},bl:()=>N,eU:()=>I,gN:()=>g,i9:()=>T,j1:()=>h,o8:()=>S,qD:()=>c,yo:()=>_});var r=n(3095);function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function o(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}let a={STRING:r.TYPE.STRING,INT:r.TYPE.INT,FLOAT:"float",BIG_INT:r.TYPE.BIG_INT,DATE_TIME:r.TYPE.DATE_TIME,BOOL:r.TYPE.BOOL,STRING_LIST:r.TYPE.STRING_LIST,REF:"ref"};class l extends Error{constructor(e,t){super(e),this.problems=void 0===t?[]:t,this.name="FilterError"}}let s=Math.random().toString(36).slice(2,6),u=0;function d(){return`f${s}${++u}`}function c(e){s=void 0===e?"":e,u=0}function p(e,t,n){let r={id:d(),op:void 0===e?"and":e,nodes:void 0===t?[]:t};return(null==n?void 0:n.not)!==void 0&&(r.not=n.not),(null==n?void 0:n.lock)!==void 0&&(r.lock=n.lock),r}function h(e,t,n,r){let i={id:d(),property:e,operator:t};return void 0!==n&&(i.value=n),(null==r?void 0:r.options)!==void 0&&(i.options=r.options),(null==r?void 0:r.lock)!==void 0&&(i.lock=r.lock),i}function m(e){return"nodes"in e}function f(e,t){if(e.id===t)return e;var n=!0,r=!1,i=void 0;try{for(var o,a=e.nodes[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){let e=o.value,n=e.id===t?e:m(e)?f(e,t):null;if(n)return n}}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}return null}function g(e,t){var n=!0,r=!1,i=void 0;try{for(var o,a=e.nodes[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){let n=o.value;if(n.id===t)return e;let r=m(n)?g(n,t):null;if(r)return r}}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}return null}function v(e,t){t(e,null,-1),function e(t,n){t.nodes.forEach((r,i)=>{n(r,t,i),m(r)&&e(r,n)})}(e,t)}function b(e){let t=0;return v(e,e=>{!m(e)&&t++}),t}function y(e){return!0!==e.not&&e.nodes.every(e=>!m(e))}function _(e,t,n){return e.id===t?i({},e,n):z(e,t,e=>i({},e,n))}function w(e,t,n,r){let a=e=>{let t=e.nodes.slice();return t.splice(Math.min(Math.max(n,0),t.length),0,r),o(i({},e),{nodes:t})};return e.id===t?a(e):z(e,t,e=>m(e)?a(e):e)}function x(e,t){return z(e,t,()=>null)}function k(e,t,n,r){let i=f(e,t),o=g(e,t);if(!i||!o||t===n||m(i)&&f(i,n))return e;let a=x(e,t),l=f(a,n);if(!l||!m(l))return e;let s=Math.min(Math.max(r,0),l.nodes.length);return o.id===n&&o.nodes.indexOf(i)===s?e:w(a,n,s,i)}function O(e,t,n){return e.id===t?m(n)?n:e:z(e,t,()=>n)}function A(e){if(y(e))return e;if(!0===e.not)return null;let t=[],n=r=>{var i=!0,o=!1,a=void 0;try{for(var l,s=r.nodes[Symbol.iterator]();!(i=(l=s.next()).done);i=!0){let r=l.value;if(m(r)){if(!0===r.not||r.op!==e.op&&r.nodes.length>1||!n(r))return!1}else t.push(r)}}catch(e){o=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(o)throw a}}return!0};return n(e)?o(i({},e),{nodes:t}):null}function S(e,t){let n=void 0!==t&&t,r=e=>{let t=n?d():e.id;if(m(e))return o(i({},e),{id:t,nodes:e.nodes.map(r)});let a=o(i({},e),{id:t});return Array.isArray(e.value)&&(a.value=e.value.slice()),void 0!==e.options&&(a.options=i({},e.options)),a};return r(e)}function P(e,t){return function e(t,n){if(t===n)return!0;if("object"!=typeof t||"object"!=typeof n||null===t||null===n)return!1;if(Array.isArray(t)||Array.isArray(n))return Array.isArray(t)&&Array.isArray(n)&&t.length===n.length&&t.every((t,r)=>e(t,n[r]));let r=Object.keys(t);return r.length===Object.keys(n).length&&r.every(r=>e(t[r],n[r]))}(null!=e?e:{},null!=t?t:{})}function E(e,t){return Array.isArray(e)||Array.isArray(t)?Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every((e,n)=>E(e,t[n])):e instanceof Date||t instanceof Date?e instanceof Date&&t instanceof Date&&e.getTime()===t.getTime():T(e)||T(t)?T(e)&&T(t)&&e.type===t.type&&e.id===t.id:N(e)||N(t)?N(e)&&N(t)&&e.span===t.span:I(e)||I(t)?I(e)&&I(t)&&e.column===t.column:D(e)||D(t)?D(e)&&D(t)&&e.param===t.param:e===t}function C(e){let t=e=>N(e)?{span:e.span}:e instanceof Date?{date:e.toISOString()}:e,n=e=>{if(m(e))return o(i({},e),{nodes:e.nodes.map(n)});let r=i({},e);return void 0!==e.value&&(r.value=Array.isArray(e.value)?e.value.map(t):t(e.value)),r};return n(e)}function j(e){let t=e=>{let t="object"==typeof e&&null!==e?Object.getPrototypeOf(e):void 0;return t===Object.prototype||null===t},n=e=>{if(t(e)&&"string"==typeof e.date)return new Date(e.date);if(null===e||["string","number","boolean"].includes(typeof e)||T(e)||N(e)||I(e)||D(e))return e;throw new l(`Filter value ${JSON.stringify(e)} is not a scalar`)},r=e=>{if("none"!==e&&"value"!==e&&"all"!==e)throw new l(`Filter lock "${e}" is not none, value or all`);return e},o=e=>{if(!t(e))throw new l("Filter node is not a plain object");let a="string"==typeof e.id&&""!==e.id?e.id:d();if(Array.isArray(e.nodes)){if("and"!==e.op&&"or"!==e.op)throw new l(`Filter group connector "${e.op}" is not and/or`);let t={id:a,op:e.op,nodes:e.nodes.map(o)};return void 0!==e.not&&(t.not=!0===e.not),void 0!==e.lock&&(t.lock=r(e.lock)),t}if("string"!=typeof e.property||"string"!=typeof e.operator)throw new l("Filter condition has no property or operator");let s={id:a,property:e.property,operator:e.operator};return void 0!==e.value&&(s.value=Array.isArray(e.value)?e.value.map(n):n(e.value)),t(e.options)&&(s.options=i({},e.options)),void 0!==e.lock&&(s.lock=r(e.lock)),s},a=o(e);if(!m(a))throw new l("Filter root is not a group");return a}function T(e){return"object"==typeof e&&null!==e&&"string"==typeof e.id&&"string"==typeof e.type}function N(e){return"object"==typeof e&&null!==e&&"string"==typeof e.span}function I(e){return"object"==typeof e&&null!==e&&"string"==typeof e.column}function D(e){return"object"==typeof e&&null!==e&&"string"==typeof e.param}function L(e){return Array.isArray(e)?e.some(L):I(e)||D(e)}function z(e,t,n){let r=e.nodes;for(let a=0;a<r.length;a++){let l=r[a],s=l.id===t?n(l):m(l)?z(l,t,n):l;if(s===l)continue;let u=r.slice();return null===s?u.splice(a,1):u[a]=s,o(i({},e),{nodes:u})}return e}},6248(e,t,n){n.d(t,{II:()=>N,g$:()=>T,iN:()=>d,nN:()=>_});var r=n(6900),i=n(8614),o=n(3095),a=n(50);function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function s(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}function u(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,i=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var o=[],a=!0,l=!1;try{for(i=i.call(e);!(a=(n=i.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==i.return||i.return()}finally{if(l)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}class d{register(e){let t=Array.isArray(e)?e:[e];var n=!0,r=!1,i=void 0;try{for(var o,a=t[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){let e=o.value,t=this._ops.findIndex(t=>t.id===e.id&&t.semType===e.semType);t>=0?this._ops[t]=e:this._ops.push(e)}}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}return()=>{var e=!0,n=!1,r=void 0;try{for(var i,o=t[Symbol.iterator]();!(e=(i=o.next()).done);e=!0){let e=i.value,t=this._ops.indexOf(e);t>=0&&this._ops.splice(t,1)}}catch(e){n=!0,r=e}finally{try{e||null==o.return||o.return()}finally{if(n)throw r}}}}registerSet(e){let t=d.checkSet(e);if(t.length>0)throw new r.FH(`Bad operator set: ${t.join("; ")}`);return this.register(e.operators.map(t=>{var n,i;return{id:t.id,label:t.label,arity:t.arity,kinds:null!=(n=t.kinds)?n:[r.Nd.STRING],semType:e.semType,exclusive:!0===e.exclusive,editor:null!=(i=t.editor)?i:"default",bitset:(n,i,a)=>{var l;return(l=function*(){let l=yield t.bitset(n,i,a);try{return o.BitArray.fromBytes(l.bits,l.length)}catch(o){let n=`${e.semType} operator "${t.id}" returned a bad bitset: ${o.message}`;throw new r.FH(n,[{nodeId:i.id,code:"evaluation",message:n}])}},function(){var e=this,t=arguments;return new Promise(function(n,r){var i=l.apply(e,t);function o(e){s(i,n,r,o,a,"next",e)}function a(e){s(i,n,r,o,a,"throw",e)}o(void 0)})})()}}}))}static checkSet(e){if("object"!=typeof e||null===e)return["not an object"];let t=[];if(("string"!=typeof e.semType||""===e.semType)&&t.push("semType must be a non-empty string"),void 0!==e.exclusive&&"boolean"!=typeof e.exclusive&&t.push("exclusive must be a boolean"),!Array.isArray(e.operators)||0===e.operators.length)return[...t,"operators must be a non-empty array"];var n=!0,r=!1,i=void 0;try{for(var o,a=e.operators.entries()[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){let e=u(o.value,2),n=e[0],r=e[1],i=`operators[${n}]`;if("object"!=typeof r||null===r){t.push(`${i}: not an object`);continue}("string"!=typeof r.id||""===r.id)&&t.push(`${i}: id must be a non-empty string`),"string"!=typeof r.label&&t.push(`${i}: label must be a string`),m.includes(r.arity)||t.push(`${i}: arity must be 0, 1, 2 or 'n'`),void 0===r.kinds||Array.isArray(r.kinds)&&r.kinds.every(e=>h.includes(e))||t.push(`${i}: kinds must list ${h.join(", ")}`),void 0===r.editor||f.includes(r.editor)||t.push(`${i}: editor must be ${f.join(", ")}`),"function"!=typeof r.bitset&&t.push(`${i}: bitset must be a function`)}}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}return t}for(e){let t=(0,i.I)(e),n=e.semType?this._ops.filter(n=>n.semType===e.semType&&n.kinds.includes(t)):[],r=n.some(e=>!0===e.exclusive);return[...n,...this._ops.filter(e=>void 0===e.semType&&e.kinds.includes(t)&&(!r||c.includes(e.id)))]}hosted(){return this._ops.filter(e=>!0===e.host).sort((e,t)=>t.id.length-e.id.length)}get(e,t){var n;return t?this.for(t).find(t=>t.id===e):null!=(n=this._ops.find(t=>t.id===e&&void 0===t.semType))?n:this._ops.find(t=>t.id===e)}all(){return this._ops.slice()}constructor(){this._ops=[]}}let c=["is null","is not null"],p=[r.Nd.STRING,r.Nd.INT,r.Nd.FLOAT,r.Nd.BIG_INT,r.Nd.DATE_TIME,r.Nd.BOOL,r.Nd.REF],h=[...p,r.Nd.STRING_LIST],m=[0,1,2,"n"],f=["default","range","list","none"],g=[r.Nd.INT,r.Nd.FLOAT,r.Nd.BIG_INT,r.Nd.DATE_TIME],v=[r.Nd.STRING,r.Nd.INT,r.Nd.FLOAT,r.Nd.BIG_INT,r.Nd.REF],b=[r.Nd.STRING,r.Nd.STRING_LIST],y=[r.Nd.REF,r.Nd.STRING];function _(e){return e.replace(/\\/g,"\\\\").replace(/%/g,"\\%").replace(/_/g,"\\_")}function w(e,t){return(0,r.eU)(e.value)?{$column:e.value.column}:(0,r.Um)(e.value)?{$param:e.value.param}:t()}function x(e,t){return w(e,()=>{var n,r;return(null==(r=e.options)?void 0:r.raw)===!0?String(e.value):t(_(String(null!=(n=e.value)?n:"")))})}let k=(e,t,n)=>void 0===n?{property:e,operator:t}:{property:e,operator:t,value:n},O=e=>(t,n,r)=>a.m8.where(t,n,r,e),A=(e,t)=>{let n=void 0!==t&&t;return(t,r,i)=>{var o,l;let s=(null==(l=r.options)?void 0:l.raw)===!0?a.m8.likeRegExp(String(r.value)):null,u=String(null!=(o=r.value)?o:"").toLowerCase();return a.m8.where(t,r,i,t=>(s?s.test(String(t)):e(String(t).toLowerCase(),u))!==n)}};function S(e){try{return RegExp(e,"i")}catch(e){var t;return null!=(t=e.message.split(": ").pop())?t:String(e)}}let P=e=>(t,n,r)=>{let i=S(String(n.value));return a.m8.where(t,n,r,t=>"string"!=typeof i&&i.test(String(t))!==e)},E=e=>{let t="string"==typeof e?S(e):null;return"string"==typeof t?`"${e}" is not a regular expression: ${t}`:null},C=(e,t)=>({id:e,label:t,arity:1,kinds:g,editor:"default",domain:(t,n,r)=>k(t.property,e,(0,i.A)(t.value,r)),mask:O(">"===e?(e,t)=>e>t:">="===e?(e,t)=>e>=t:"<"===e?(e,t)=>e<t:(e,t)=>e<=t)}),j=(e,t,n,r,i,o)=>({id:e,label:t,arity:1,kinds:n,editor:"default",domain:e=>k(e.property,r,x(e,i)),mask:A(o)}),T=[{id:"=",label:"equals",arity:1,kinds:p,editor:"default",domain:(e,t,n)=>k(e.property,"=",(0,i.A)(e.value,n)),mask:O((e,t)=>e===t)},{id:"!=",label:"not equals",arity:1,kinds:p,editor:"default",domain:(e,t,n)=>k(e.property,"!=",(0,i.A)(e.value,n)),mask:O((e,t)=>e!==t)},C(">","greater than"),C(">=","at least"),C("<","less than"),C("<=","at most"),{id:"between",label:"between",arity:2,kinds:g,editor:"range",domain:(e,t,n)=>{let r=u((0,i.A)(e.value,n),2),o=r[0],a=r[1];return[k(e.property,">=",o),"and",k(e.property,"<=",a)]},mask:O((e,t)=>{let n=u(t,2),r=n[0],i=n[1];return e>=r&&e<=i})},{id:"in",label:"is one of",arity:"n",kinds:v,editor:"list",domain:(e,t,n)=>k(e.property,"=",(0,i.A)(e.value,n)),mask:O((e,t)=>t.includes(e))},{id:"not in",label:"is not one of",arity:"n",kinds:v,editor:"list",domain:(e,t,n)=>k(e.property,"!=",(0,i.A)(e.value,n)),mask:O((e,t)=>!t.includes(e))},{id:"under",label:"is under",arity:1,kinds:y,editor:"default",domain:(e,t,n)=>k(e.property,"under",(0,i.A)(e.value,n))},j("like","contains",b,"like",e=>`%${e}%`,(e,t)=>e.includes(t)),{id:"!like",label:"does not contain",arity:1,kinds:b,editor:"default",domain:e=>k(e.property,"not like",x(e,e=>`%${e}%`)),mask:A((e,t)=>e.includes(t),!0)},j("starts","starts with",[r.Nd.STRING],"like",e=>`${e}%`,(e,t)=>e.startsWith(t)),j("ends","ends with",[r.Nd.STRING],"like",e=>`%${e}`,(e,t)=>e.endsWith(t)),{id:"matches",label:"matches regex",arity:1,kinds:[r.Nd.STRING],editor:"default",domain:e=>k(e.property,"~*",w(e,()=>String(e.value))),mask:P(!1),check:E},{id:"!matches",label:"does not match",arity:1,kinds:[r.Nd.STRING],editor:"default",domain:e=>k(e.property,"!~*",w(e,()=>String(e.value))),mask:P(!0),check:E},{id:"fuzzy",label:"is similar to",arity:1,kinds:[r.Nd.STRING],editor:"default",domain:e=>{var t;let n=w(e,()=>String(e.value)),r="number"==typeof(null==(t=e.options)?void 0:t.threshold)?e.options.threshold:null;return[{property:e.property,operator:"fuzzy",threshold:r,value:n},"or",k(e.property,"like",w(e,()=>`%${String(e.value)}%`))]}},{id:"is null",label:"is empty",arity:0,kinds:[...p,r.Nd.STRING_LIST],editor:"none",domain:e=>k(e.property,"=",null),mask:e=>a.m8.nulls(e)},{id:"is not null",label:"is not empty",arity:0,kinds:[...p,r.Nd.STRING_LIST],editor:"none",domain:e=>k(e.property,"!=",null),mask:e=>a.m8.nulls(e).invert()}],N=new d;N.register(T)},4911(e,t,n){n.d(t,{y:()=>d});var r=n(6e3),i=n(8255);let o=["January","February","March","April","May","June","July","August","September","October","November","December"],a=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],l=(e,t)=>String(e).padStart(void 0===t?2:t,"0"),s=e=>e.hours%12||12,u={d:e=>String(e.day),dd:e=>l(e.day),ddd:e=>a[e.weekday].slice(0,3),dddd:e=>a[e.weekday],h:e=>String(s(e)),hh:e=>l(s(e)),H:e=>String(e.hours),HH:e=>l(e.hours),m:e=>String(e.minutes),mm:e=>l(e.minutes),M:e=>String(e.month),MM:e=>l(e.month),MMM:e=>o[e.month-1].slice(0,3),MMMM:e=>o[e.month-1],s:e=>String(e.seconds),ss:e=>l(e.seconds),f:e=>String(Math.floor(e.ms/100)),ff:e=>l(Math.floor(e.ms/10)),fff:e=>l(e.ms,3),tt:e=>e.hours>=12?"PM":"AM",yy:e=>l(e.year%100),yyyy:e=>String(e.year)};class d{static value(e,t){var n,i;let o=void 0===t?{}:t;if(null==e||"number"==typeof e&&isNaN(e))return"";if("string"==typeof e)return e;if("number"==typeof e)return o.format&&null!=(n=null==(i=r.S.format)?void 0:i.number(e,o.format))?n:String(e);if(e instanceof Date)return d.date(e,o);if(Array.isArray(e))return e.map(e=>d.value(e,o)).filter(e=>""!==e).join(", ");if("object"==typeof e){if("function"==typeof e.toDate)return d.date(e.toDate(),o);let t=Object.getPrototypeOf(e);if(t===Object.prototype||null===t)return""}return String(e)}static date(e,t){let n=void 0===t?{}:t;if(isNaN(e.getTime()))return"";let r=d._parts(e,!0===n.utcDates&&i.A.isDateOnly(e));return(n.format||d._pattern(r)).replace(/(.)\1*/g,e=>{var t,n;return null!=(t=null==(n=u[e])?void 0:n.call(u,r))?t:e})}static count(e){return e.toLocaleString()}static spelled(e,t){let n=void 0===t?{}:t;return e.toLocaleString(void 0,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({month:"short",day:"numeric",year:"numeric"},n.time?{hour:"2-digit",minute:"2-digit"}:{},n.utc?{timeZone:"UTC"}:{}))}static _pattern(e){var t;let n=(null==(t=r.S.format)?void 0:t.dateFormat())||d.DATE;return 0!==e.ms?`${n} HH:mm:ss.fff`:0!==e.seconds?`${n} HH:mm:ss`:0!==e.hours||0!==e.minutes?`${n} HH:mm`:n}static _parts(e,t){return t?{year:e.getUTCFullYear(),month:e.getUTCMonth()+1,day:e.getUTCDate(),weekday:e.getUTCDay(),hours:e.getUTCHours(),minutes:e.getUTCMinutes(),seconds:e.getUTCSeconds(),ms:e.getUTCMilliseconds()}:{year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate(),weekday:e.getDay(),hours:e.getHours(),minutes:e.getMinutes(),seconds:e.getSeconds(),ms:e.getMilliseconds()}}}d.DATE="M/d/yyyy"},7974(e,t,n){n.d(t,{Q:()=>g,p:()=>v});var r=n(7115),i=n(1518),o=n(2454),a=n(9701),l=n(8609),s=n(4977),u=n(9383),d=n(5232);function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function h(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}let m="u2-input-edit-option",f="u2-input-root";function g(e){return"string"==typeof e?e:void 0}class v extends a.Ec{static isEmpty(e){if((0,u.Im)(e)||Array.isArray(e)&&0===e.length)return!0;if("object"!=typeof e)return!1;let t=Object.getPrototypeOf(e);return(t===Object.prototype||null===t)&&0===Object.keys(e).length}static bindOwned(e,t){let n=i.HG.ambient,r=t.owner,o=r.bind(e);if(void 0===n||n===r)return o;let a=n.bind(e);return(...e)=>n.isDisposed?o(...e):a(...e)}static itemsState(e,t){let n=!t&&e.length>o.k;return{count:e.length,list:n?e.slice(0,o.k):e,truncated:n}}static specValue(e,t){return e instanceof r.HN?{bind:e,readOnly:null!=t?t:!(0,r.n$)(e)||void 0}:{value:e,readOnly:t}}_watchChanges(){if(this._watching)return;this._watching=!0;let e=!0;this.effect(()=>{let t=this.value,n=this._followed,i=this._system;if(this._followed=void 0,this._system=void 0,e)e=!1;else if(void 0===n||!Object.is(n.value,t)){let e=(void 0===i||!Object.is(i.value,t))&&this._byUser();(0,r.O8)(()=>{var n,r;null==(n=this._onChanged)||n.call(this,t,this),e&&(null==(r=this._onUserInput)||r.call(this,t,this)),this.fireEvent("change",t),e&&this.fireEvent("userInput",t)})}})}_byUser(){let e=globalThis.event;if(v.isSystemWrite||void 0===e||!(e.target instanceof Element))return!1;for(let n=e.target;null!==n;){var t;if(this.root.contains(n)||this._inputBox.contains(n))return!0;let e=null==(t=n.closest("[data-u2-owner-id]"))?void 0:t.dataset.u2OwnerId;if(void 0===e)break;if(e===this.root.id)return!0;n=document.getElementById(e)}return!1}onEvent(e){let t=void 0===e?null:e;return(null===t||"change"===t||"userInput"===t)&&this._watchChanges(),super.onEvent(t)}follow(e){return this.effect(()=>{let t=e();Object.is(t,this.peek())||(this._followed={value:t},v.system(()=>this.value=t))})}static system(e){v._systemWrites++;try{return e()}finally{v._systemWrites--}}systemWrite(e){this._system={value:e},v.system(()=>this.value=e)}static get isSystemWrite(){return v._systemWrites>0}get value(){return this.signal.value}set value(e){this.signal.value=e}peek(){return this.signal.peek()}get unreadable(){return!1}get nullable(){var e;return null==(e=this.options.nullable)||e}get label(){var e,t,n;return null!=(e=null!=(t=null==(n=this._labelEl)?void 0:n.textContent)?t:g(this.options.label))?e:""}set label(e){if(this._labelEl)this._labelEl.textContent=e;else if(this.options.inline)this.focusTarget.setAttribute("aria-label",e);else{this._labelEl=(0,l.Pf)(e,"u2-input-label"),this._labelEl.dataset.u2Part="label",this._labelEl.id=`${this.rootId}-label`;let t=this.focusTarget;t.matches("input, textarea, select, button")?this._labelEl.setAttribute("for",t.id):t.setAttribute("aria-labelledby",this._labelEl.id),this.root.prepend(this._labelEl),this._bindTooltip()}}get focusTarget(){var e;let t=this._editor;return t.matches("input, textarea, select")||t.hasAttribute("role")?t:null!=(e=t.querySelector('input, textarea, select, [role="combobox"], [role="listbox"], [role="slider"], [role="spinbutton"], [role="switch"], [contenteditable="true"], [tabindex]:not([tabindex="-1"])'))?e:t}getState(){var e;let t=this._validity.peek(),n=this._placeholder();return p(h(p({},super.getState()),{value:null!=(e=a.Ec.jsonValue(this.peek()))?e:null,text:this.displayText(),valid:null===t,error:this._error.textContent||null,readOnly:this._readOnly,required:!0===this._required.peek()}),n?{placeholder:n}:{})}get visible(){return super.visible}set visible(e){super.visible=e,this._shown.value=e}get validates(){return v._layoutVersion(),this._shown.value&&null===this._offReason.value&&null===this.root.closest("[hidden], [inert]")}static _layoutVersion(){if(void 0===v._layout){let e=v._layout=(0,r.vP)(0);"u">typeof MutationObserver&&"u">typeof document&&new MutationObserver(t=>{t.some(e=>v._holdsInput(e.target))&&e.value++}).observe(document,{attributes:!0,attributeFilter:["hidden","inert"],subtree:!0})}return v._layout.value}static _holdsInput(e){var t,n;return(null==(t=e.classList)?void 0:t.contains(f))===!0||(null==(n=e.querySelector)?void 0:n.call(e,`.${f}`))!=null}get loading(){return this._loading}set loading(e){var t;if(e!==this._loading){if(this._loading=e,null==(t=this._spinnerSoon)||t.call(this),this._spinnerSoon=void 0,!e){this.root.removeAttribute("aria-busy"),void 0!==this._spinner&&(this._spinner.hidden=!0);return}this.root.setAttribute("aria-busy","true"),this._spinnerSoon=this.scope.setTimeout(()=>{this._spinnerSoon=void 0,void 0===this._spinner&&(this._spinner=(0,l.Ln)("","u2-input-loading"),this._spinner.append((0,l.Ln)("","u2-loader-spinner")),this._inputBox.append(this._spinner)),this._spinner.hidden=!1},v.loadingGraceMs)}}get readOnly(){return this._readOnly}set readOnly(e){this._readOnly=e,this.root.classList.toggle("u2-input-readonly",e),e?this.focusTarget.setAttribute("aria-readonly","true"):this.focusTarget.removeAttribute("aria-readonly");var t=!0,n=!1,r=void 0;try{for(var i,o=this._optionsRail.querySelectorAll(`:scope > .${m}`)[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){let t=i.value;v._offWhileReadOnly(t,e)}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}var a=!0,l=!1,s=void 0;try{for(var u,d=this.root.querySelectorAll("input, textarea")[Symbol.iterator]();!(a=(u=d.next()).done);a=!0){let t=u.value;v._typed(t)&&(t.readOnly=e)}}catch(e){l=!0,s=e}finally{try{a||null==d.return||d.return()}finally{if(l)throw s}}if(e&&!this._guarded){this._guarded=!0;for(let e=0,t=["keydown","mousedown","click","input","change"];e<t.length;e++){let n=t[e];this.scope.listen(this.root,n,e=>this._guard(e),{capture:!0})}this.scope.listen(this.root,"wheel",e=>this._guard(e),{capture:!0,passive:!0})}}get required(){return!0===this._required.peek()}set required(e){this._required.value=e,this.root.classList.toggle("u2-input-required",e),e?this.focusTarget.setAttribute("aria-required","true"):this.focusTarget.removeAttribute("aria-required"),e&&this._wireTouch()}_wireTouch(){if(this._touchWired)return;this._touchWired=!0;for(let e=0,t=["input","change"];e<t.length;e++){let n=t[e];this.scope.listen(this.root,n,()=>this._touched.value=!0)}let e=!0;this.effect(()=>{this.value,e?e=!1:this._byUser()&&(this._touched.value=!0)});for(let e=0,t=["keydown","pointerdown"];e<t.length;e++){let n=t[e];this.scope.listen(this.root,n,()=>this._engaged=!0,{capture:!0})}this.scope.listen(this.root,"focusout",e=>{this._engaged&&this._touchLeavingFor(e.relatedTarget)})}_touchLeavingFor(e){let t=e instanceof Element?e.closest("button"):null;if(null===t){this._touched.value=!0;return}let n=()=>{t.removeEventListener("click",n),t.removeEventListener("blur",n),this._touched.value=!0};t.addEventListener("click",n),t.addEventListener("blur",n)}reset(e){this._touched.value=!1,this._engaged=!1,Object.is(e,this.peek())||(this._followed={value:e},v.system(()=>this.value=e)),this.resetEditor()}resetEditor(){}touch(){this._touched.value=!0}focus(e){var t;let n=this.focusTarget,r=n.matches(v._FOCUSABLE)?n:null!=(t=n.querySelector(v._FOCUSABLE))?t:n;r.focus(),(null==e?void 0:e.select)&&v._typed(r)&&r.select()}static _offWhileReadOnly(e,t){for(let n=0,r=[e,...e.querySelectorAll("button")];n<r.length;n++){let e=r[n];d.B.of(e)===(t?null:v.READ_ONLY)&&d.B.apply(e,t?v.READ_ONLY:null)}}static _typed(e){let t=null==e?void 0:e.tagName;return"TEXTAREA"===t||"INPUT"===t&&!v._UNTYPED.includes(e.type)}_guard(e){if(!this._readOnly||this._freeOption(e.target))return;let t=v._typed(e.target),n=e.key;("keydown"===e.type?"Tab"===n||"Escape"===n||"Enter"===n||t&&("ArrowUp"!==n&&"ArrowDown"!==n||"TEXTAREA"===e.target.tagName):t&&"wheel"!==e.type)||("wheel"!==e.type&&e.preventDefault(),e.stopImmediatePropagation())}_freeOption(e){var t;let n=null==e||null==(t=e.closest)?void 0:t.call(e,".u2-input-options > *");return null!=n&&n.parentElement.parentElement===this._inputBox&&!n.classList.contains(m)}displayText(){var e;let t=this.focusTarget;if("SELECT"===t.tagName){let e=[...t.querySelectorAll("option")].find(e=>e.value===t.value);return void 0===e?"":a.Ec.text(e)}return"INPUT"===t.tagName&&["checkbox","radio"].includes(t.type)?String(t.checked):"INPUT"===t.tagName||"TEXTAREA"===t.tagName?t.value:null!=(e=t.getAttribute("aria-checked"))?e:a.Ec.text(this._editor)}accessibleLabel(){return(void 0===this._labelEl?"":a.Ec.text(this._labelEl))||a.Ec.labelOf(this.focusTarget)||super.accessibleLabel()||this._placeholder()}_placeholder(){let e=this.focusTarget;return e.placeholder||e.getAttribute("placeholder")||void 0}getWidgetStatus(){let e=super.getWidgetStatus();return e.parts={editor:this._editor,error:this._error},this._labelEl&&(e.parts.label=this._labelEl),null!==this._optionsRail.parentElement&&(e.parts.options=this._optionsRail),e}get tooltipText(){return this._tooltip}set tooltipText(e){this._tooltip=null!=e?e:"",this._tooltip?this.focusTarget.setAttribute("aria-description",this._tooltip):this.focusTarget.removeAttribute("aria-description"),this._bindTooltip()}_bindTooltip(){var e;this._tooltip&&this._tip(null!=(e=this._labelEl)?e:this.root)}_tip(e){this._tooltipOn.has(e)||(this._tooltipOn.add(e),s.m.bind(e,()=>{var t;return null!=(t=this._offReason.peek())?t:e===this.root&&this._labelEl?"":this._tooltip},{owner:this.scope}))}get disabled(){return this._offReason.peek()}set disabled(e){let t=d.B.now(e);this._offReason.value=t,this.root.classList.toggle("u2-input-disabled",null!==t),d.B.apply(this.root,t),null!==t&&this._tip(this.root);let n=this.root.querySelectorAll("input, textarea, button, select");for(let e=0;e<n.length;e++)null===t?n[e].removeAttribute("disabled"):n[e].setAttribute("disabled","")}addValidator(e){this._validators.push(e),this._wireTouch(),(0,r.O8)(()=>{this._validate(this.peek()),this._validatorCount.value++})}revalidate(){(0,r.O8)(()=>this._validate(this.peek()))}get box(){return this._inputBox}liveOption(e,t,n){var i;if(void 0!==t){if(!(t instanceof r.HN))return void n(t);(null!=(i=this._liveBinds)?i:this._liveBinds=new Map).set(e,t),this.effect(()=>{let e=t.value;void 0!==e&&n(e)})}}bindStep(e){var t,n;return""===e||"value"===e?this.signal:null!=(t=null==(n=this._liveBinds)?void 0:n.get(e))?t:super.bindStep(e)}bindProps(){let e=super.bindProps(),t=null!=(u=null==(m=this.componentMeta)?void 0:m.props)?u:[],n=t.findIndex(e=>"value"===e.name);if(n>=0&&!e.some(e=>"value"===e.name)){let i=new Set(t.slice(n+1).map(e=>e.name)),o=e.findIndex(e=>i.has(e.name));e.splice(o<0?e.length:o,0,h(p({},t[n]),{writable:(0,r.n$)(this.signal),default:!0}))}var i=!0,a=!1,l=void 0;try{for(var s,u,d,m,f,g=(null!=(d=this._liveBinds)?d:[])[Symbol.iterator]();!(i=(f=g.next()).done);i=!0){let t=(s=f.value,function(e){if(Array.isArray(e))return e}(s)||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var i=[],o=!0,a=!1;try{for(r=r.call(e);!(o=(t=r.next()).done)&&(i.push(t.value),2!==i.length);o=!0);}catch(e){a=!0,n=e}finally{try{o||null==r.return||r.return()}finally{if(a)throw n}}return i}}(s)||function(e){if(e){if("string"==typeof e)return c(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return c(e,2)}}(s)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),n=t[0],r=t[1];e.some(e=>e.name===n)||e.push({name:n,type:(0,o.B)(r.peek()),writable:!1})}}catch(e){a=!0,l=e}finally{try{i||null==g.return||g.return()}finally{if(a)throw l}}return e}createClearButton(e,t){let n=document.createElement("button");return n.type="button",n.className="u2-input-clear",n.textContent="✕",n.setAttribute("aria-label",void 0===t?"Clear":t),this.scope.listen(n,"click",e),n}isEmptyValue(e){return!this.unreadable&&v.isEmpty(e)}get emptyMessage(){return u.wg}addOptions(e,t){this.addRail(e,t)}addRail(e,t){(null==t?void 0:t.edits)&&(e.classList.add(m),this._readOnly&&v._offWhileReadOnly(e,!0)),this._optionsRail.append(e),null===this._optionsRail.parentElement&&this._inputBox.append(this._optionsRail)}refreshDisabled(){let e=this._offReason.peek();null!==e&&(this.disabled=e),this._readOnly&&(this.readOnly=!0)}_validate(e){let t=this.isEmptyValue(e);if(this.root.classList.toggle("u2-input-empty",t),t&&(null!=(a=this._required.value)?a:!1===this.options.nullable)){this._validity.value=this.emptyMessage;return}let n=null;var r=!0,i=!1,o=void 0;try{for(var a,l,s=this._validators[Symbol.iterator]();!(r=(l=s.next()).done)&&!(n=(0,l.value)(e));r=!0);}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}this._validity.value=n||null}_showValidity(e){this._editor.classList.toggle("u2-invalid",null!==e),this._error.textContent=null!=e?e:"";let t=this.focusTarget;null===e?(this._editor.removeAttribute("title"),t.removeAttribute("aria-invalid"),t.removeAttribute("aria-describedby")):(this._editor.title=e,t.setAttribute("aria-invalid","true"),t.setAttribute("aria-describedby",this._error.id))}constructor(e,t){var n,o;super(),this._validators=[],this._validatorCount=(0,r.vP)(0),this._validity=(0,r.vP)(null),this._error=(0,l.Ln)("","u2-input-error"),this._tooltip="",this._tooltipOn=new Set,this._offReason=(0,r.vP)(null),this._shown=(0,r.vP)(!0),this._required=(0,r.vP)(void 0),this._touched=(0,r.vP)(!1),this._readOnly=!1,this._loading=!1,this._guarded=!1,this._touchWired=!1,this._engaged=!1,this._watching=!1,this.options=e,this.signal=null!=(n=e.bind)?n:(0,r.vP)(null!=(o=e.value)?o:t),this.validity=this._validity,this.touched=this._touched,this.error=(0,r.EW)(()=>this._touched.value?this._validity.value:null),void 0!==e.name?this.name=e.name:this.deriveName(g(e.label)),this.root.classList.add(f),e.inline&&this.root.classList.add("u2-input-inline"),e.fill&&this.root.classList.add("u2-input-fill"),this._inputBox=(0,l.y4)([],"u2-input-box"),this._optionsRail=(0,l.y4)([],"u2-input-options"),this._optionsRail.dataset.u2Part="options",this._error.dataset.u2Part="error",this._editor=this.build(()=>this.createEditor()),this._editor.classList.add("u2-input-editor"),this._editor.dataset.u2Part="editor",void 0!==e.width&&(this._editor.style.width="number"==typeof e.width?`${e.width}px`:e.width,this._editor.style.flex="0 1 auto",this._editor.style.minWidth="0",this._editor.style.maxWidth="none"),this._inputBox.prepend(this._editor),this.root.append(this._inputBox,this._error);const a=this.focusTarget;a.id||(a.id=`${this.rootId}-editor`),this._error.id=`${this.rootId}-error`,e.inline&&void 0!==e.name&&a.setAttribute("aria-label",e.name),this.liveOption("label",e.label,e=>this.label=e),this.liveOption("tooltipText",e.tooltipText,e=>this.tooltipText=e),this.liveOption("postfix",e.postfix,e=>{if(!this._postfixEl){if(!e)return;this.addRail(this._postfixEl=(0,l.Ln)("","u2-input-postfix"))}this._postfixEl.textContent=e}),this.liveOption("disabled",e.disabled,e=>{let t=d.B.now(e);(null!==t||null!==this._offReason.peek())&&(this.disabled=t)}),this.liveOption("visible",e.visible,e=>this.visible=e),this.liveOption("readOnly",e.readOnly,e=>this.readOnly=e),void 0!==e.readOnly||(0,r.n$)(this.signal)||(i._U.report("bind-readonly",`${this.constructor.name} is bound to a signal it cannot write (a computed): every edit would fail. Bind a \`signal\` or a \`lens(…)\` to edit it; to show the value, pass \`readOnly: true\`.`),this.readOnly=!0),this.liveOption("required",e.required,e=>this.required=e),this.liveOption("loading",e.loading,e=>this.loading=e),!1===e.nullable&&this._wireTouch(),this.effect(()=>{this._validatorCount.value,this._validate(this.value)}),this.effect(()=>this._showValidity(this.error.value)),e.onChanged&&(this._onChanged=v.bindOwned(e.onChanged,{owner:this.scope})),e.onInput&&(this._onUserInput=v.bindOwned(e.onInput,{owner:this.scope})),(e.onChanged||e.onInput)&&this._watchChanges();const s=e.onEnter,u=e.onEscape;if(s||u){const e={Enter:s&&v.bindOwned(s,{owner:this.scope}),Escape:u&&v.bindOwned(u,{owner:this.scope})};this.scope.listen(a,"keydown",t=>{let n=e[t.key];void 0===n||t.isComposing||!1===n(t,this)||(t.preventDefault(),t.stopPropagation())})}}}v._systemWrites=0,v.loadingGraceMs=150,v._FOCUSABLE="input, textarea, select, button, [tabindex]",v.READ_ONLY="Read-only",v._UNTYPED=["checkbox","radio","range","button","submit","reset","color","file","image"]},1269(){function e(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function t(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}let n={label:'[data-u2-part="label"]',editor:'[data-u2-part="editor"]',options:'[data-u2-part="options"]',error:'[data-u2-part="error"]'},r={input:["label","aria","placeholder"],action:["text","aria","title"],container:["title","aria"],collection:["aria"],navigation:["aria"],display:["text","aria"],overlay:["title","aria"],composite:["aria"]};function i(t,n,i,o){return e({kind:n,noun:i,family:t,nameFrom:r[t],parts:{},state:[],gestures:[]},void 0===o?{}:o)}function o(t,r,o,a,l,s){return i("input",t,r,e({focusRole:o,parts:n,state:["label",...a],gestures:l},void 0===s?{}:s))}function a(e,t,n,r){return{kind:e,noun:t,family:r,nameFrom:[],parts:{},state:[],gestures:[],partOf:n}}let l={role:"option",noun:"item",gestures:["pick"]},s=["value","text","placeholder","valid","error","readOnly","required"],u=["value","text","valid","error","readOnly","required"],d=["value","text","valid","error","readOnly","required"],c=[...d,"open"],p=["value","text","open","placeholder"],h={"--u2-row-base-bg":"a row at rest","--u2-row-hover-bg":"the tint over the row under the pointer","--u2-row-hover-stripe":"the stripe at the start of the row under the pointer","--u2-row-selected-bg":"a selected row","--u2-section-header-bg":"a group's header row"};o("text-input","text input","textbox",s,["type","clear"],{aliases:["text field","textbox"]}),o("text-area","text area","textbox",s,["type","clear"],{aliases:["textarea","multiline input"]}),o("number-input","number input","spinbutton",u,["type","clear"],{aliases:["numeric input","number field"]}),o("bigint-input","number input","spinbutton",u,["type","clear"]),o("qnum-input","number input","textbox",u,["type","clear"]),o("slider-input","slider","slider",d,["drag"],{aliases:["slider input"]}),o("range-slider","range slider","slider",["value","text"],["drag"],{aliases:["range input"]}),o("bool-input","checkbox","checkbox",[...d,"checked"],["toggle"],{aliases:["bool input","switch","toggle"]}),o("choice-input","choice input","combobox",[...d,"items","selection"],["open","pick"],{aliases:["dropdown","choice","select"],items:l}),o("radio-input","radio input","radiogroup",[...d,"items"],["pick"],{aliases:["radio group","radio"],items:{role:"radio",noun:"radio",gestures:["pick"]}}),o("multi-choice-input","multi choice input","group",[...d,"items","selection"],["toggle"],{aliases:["multi choice"],items:{role:"checkbox",noun:"checkbox",gestures:["toggle"],multi:!0}}),o("chips-input","chips input","group",[...d,"items","selection"],["toggle"],{items:{role:"button",noun:"chip",gestures:["toggle"],multi:!0}}),o("tags-input","tags input","textbox",[...c,"items"],["type","add","remove"],{aliases:["tags field"],items:{role:"listitem",noun:"tag",gestures:["remove"]}}),o("list-input","list input","textbox",[...d,"items"],["type","add","remove"],{items:{role:"listitem",noun:"tag",gestures:["remove"]}}),o("map-input","map input","grid",[...d,"items"],["add","remove","type"],{aliases:["key value input"],items:{role:"row",noun:"item",gestures:["remove"]}}),o("records-input","records input","grid",[...d,"items"],["add","remove","type","drag"],{aliases:["records editor","editable list"],parts:t(e({},n),{add:'[data-u2-part="add"]',handle:'[data-u2-part="handle"]'}),items:{role:"row",noun:"item",gestures:["remove","drag"]}}),o("checklist-input","checklist","list",[...d,"items","selection"],["toggle","drag"],{aliases:["checklist input","orderable checklist"],parts:t(e({},n),{handle:'[data-u2-part="handle"]'}),items:{role:"listitem",noun:"item",gestures:["toggle","drag"],multi:!0}}),o("color-input","color input","textbox",d,["type","pick"],{aliases:["color picker"]}),o("icon-input","icon input","button",c,["open","pick"],{aliases:["icon picker"]}),o("font-input","font input","textbox",[...c,"items","selection"],["open","pick"],{aliases:["font picker"],items:{role:"option",noun:"size",gestures:["pick"]}}),o("image-input","image input",void 0,d,["clear"],{aliases:["image picker"]}),o("date-input","date input","textbox",c,["type","open","pick"],{aliases:["date field","datetime input","date picker"]}),o("datetime-input","date input","textbox",c,["type","open","pick"]),o("combobox","combobox","combobox",[...p,"busy","items"],["type","open","pick"],{aliases:["combo box","editable choice"],items:l}),o("typeahead","suggest input","combobox",[...p,"busy","items"],["type","open","pick"],{aliases:["autocomplete","typeahead"],items:l}),o("pick-input","pick input","combobox",["value","text","valid","error","open","placeholder"],["type","open","pick"],{items:l}),o("suggest-input","suggest input","combobox",[...c,"placeholder","busy","items"],["type","open","pick"],{items:l}),o("multi-select","multi select","combobox",[...c,"items","selection"],["open","toggle"],{aliases:["multi select input"],items:{role:"option",noun:"item",gestures:["toggle"],multi:!0}}),o("access-grid","access grid","grid",[...d,"items"],["add","toggle","remove"],{items:{role:"row",noun:"table row",gestures:["toggle","remove"]}}),o("message-input","message input","textbox",["value","text","open","placeholder"],["type"],{aliases:["prompt input","chat input"]}),o("filter-builder","filter builder","group",["value","valid","error"],["add","remove","type"],{parts:t(e({},n),{mode:'[data-u2-part="mode"]',none:'[data-u2-part="none"]',flatten:'[data-u2-part="flatten"]',"hint mode":'[data-u2-part="hint-mode"]',hint:'[data-u2-part="hint"]',query:'[data-u2-part="query"]'}),items:{role:"row",noun:"filter row",gestures:["remove"]}}),o("filter-query-input","filter query","textbox",["value","valid","error"],["type"],{aliases:["filter query input"]}),o("ref-input","ref input","combobox",p,["type","open","pick"],{items:l}),o("column-combo","column input","combobox",[...c,"items","selection"],["open","pick"],{aliases:["column picker","column selector","column combobox"],items:l}),o("column-picker","column input","combobox",[...c,"items"],["open","pick"],{items:l}),o("columns-input","columns input","button",[...c,"items","selection"],["open","toggle"],{aliases:["columns picker"],items:{role:"option",noun:"item",gestures:["toggle"],multi:!0}}),o("columns-map-input","columns input","group",d,["open","toggle"]),o("aggregated-columns-input","columns input","group",d,["open","toggle"]),o("file-input","file input","group",[...d,"busy"],["pick"],{aliases:["file field","files input"]}),o("files-input","file input","group",d,["pick"]),o("function-input","function input","button",[...c,"placeholder"],["open","pick"],{aliases:["func input"]}),o("func-call-input","function input","button",c,["open","pick"]),o("rsa-input","rsa input","textbox",d,["type"],{aliases:["key input"]}),o("space-input","space input","combobox",c,["open","pick"],{aliases:["space picker"]}),o("dynamic-input","dynamic input",void 0,d,["type","pick"]),o("dart-input","dart input",void 0,d,["type"],{aliases:["bridged input"]}),i("input","readonly-field","read-only field",{nameFrom:["label"],parts:{label:".u2-input-label",value:'[data-u2-part="readonly-value"]'},state:["label","value","text","readOnly"]}),i("action","button","button",{role:"button",state:["label","busy","pressed"],gestures:["press"]}),i("action","icon-button","icon button",{role:"button",nameFrom:["aria","title"],state:["label","pressed"],gestures:["press"]}),i("action","dropdown-button","dropdown button",{aliases:["menu button","split button"],role:"button",state:["label","open"],gestures:["press","open","pick"]}),i("action","choice-chip","choice chip",{role:"button",nameFrom:["label","aria","text"],parts:{label:'[data-u2-part="label"]',value:'[data-u2-part="value"]'},state:["label","value","text","valid","error","open","items","selection"],items:{role:"menuitemcheckbox",noun:"menu item",gestures:["pick"]},gestures:["open","pick"]}),i("action","button-group","button group",{aliases:["segmented control"],role:"group",nameFrom:["aria"],state:["value","current","items"],items:{role:"button",noun:"button",gestures:["press"]},gestures:["pick"]}),i("action","row-actions","row actions",{aliases:["actions"],role:"toolbar",nameFrom:["aria"],state:["items"],items:{role:"button",noun:"button",gestures:["press"]},gestures:["press"]}),i("container","section","section",{aliases:["pane","accordion pane"],role:"group",parts:{title:':scope > [data-u2-part="header"] > [data-u2-part="title"]',header:':scope > [data-u2-part="header"]',body:':scope > [data-u2-part="body"]'},state:["label","expanded"],gestures:["expand","collapse"]}),i("container","accordion","accordion",{nameFrom:["aria"],state:["items"],items:{role:"button",noun:"accordion header",gestures:["expand","collapse"]},gestures:["expand","collapse"]}),i("container","tabs","tabs",{aliases:["tab strip","tab control"],nameFrom:["aria"],parts:{"close button":'[data-u2-part="close"]'},state:["current","items","selection"],items:{role:"tab",noun:"tab",gestures:["select"]},gestures:["select"]}),i("container","wizard","wizard",{nameFrom:["aria"],parts:{steps:':scope > [data-u2-part="steps"]',body:':scope > [data-u2-part="body"]',footer:':scope > [data-u2-part="footer"]',status:':scope > [data-u2-part="footer"] > * > [data-u2-part="status"]',reason:':scope > [data-u2-part="footer"] > * > [data-u2-part="reason"]',"error row":':scope > [data-u2-part="footer"] > * > [data-u2-part="error-row"]'},state:["current","busy","valid","error","items"],items:{role:"listitem",noun:"wizard step",gestures:["select"]},gestures:["select"]}),i("container","splitter","splitter",{aliases:["split panel"],nameFrom:["aria"],parts:{sash:'[data-u2-part="sash"]'},state:["extra"],gestures:["drag","resize"]}),i("container","card","card",{nameFrom:["title","text"],parts:{title:':scope > [data-u2-part="header"] > * > [data-u2-part="title"]',subtitle:':scope > [data-u2-part="header"] > * > [data-u2-part="subtitle"]',header:':scope > [data-u2-part="header"]',media:':scope > [data-u2-part="media"]',body:':scope > [data-u2-part="body"]',footer:':scope > [data-u2-part="footer"]',actions:':scope > [data-u2-part="header"] > [data-u2-part="actions"]'},state:["label","selected"],gestures:["press"]}),i("container","page","page",{nameFrom:["aria"],parts:{header:':scope > [data-u2-part="header"]',body:':scope > [data-u2-part="body"]',footer:':scope > [data-u2-part="footer"]',"section title":':scope > [data-u2-part="body"] > [data-u2-part="section"] > [data-u2-part="section-header"] > [data-u2-part="section-title"]'},styling:{"--u2-page-max-width":"the body's widest (a CSS length); its forms go as wide","--u2-page-padding-x":"the space left and right of the header, the body and the action row; 24px","--u2-page-padding-y":"the space above the header and the body; 12px","--u2-page-gap":"the space between the sections; 24px","--u2-page-section-indent":"how far a section's content sits in from its heading; 0"}}),i("container","form","form",{role:"form",nameFrom:["aria"],state:["valid","error","items"],styling:{"--u2-form-max-width":"the widest a form gets (a CSS length); 700px, or as wide as the page in a Page","--u2-form-section-gap":"the space between two sections of the form; 0"}}),i("container","object-form","object form",{role:"form",nameFrom:["aria"],state:["valid","error","items"]}),i("container","func-form","function form",{aliases:["func form"],role:"form",nameFrom:["aria"],state:["valid","error","busy","items"]}),i("container","panel","layout panel",{nameFrom:["aria"]}),i("container","div-v","vertical stack",{nameFrom:["aria"]}),i("container","div-h","horizontal stack",{nameFrom:["aria"]}),i("container","async-view","async view",{aliases:["loading view"],nameFrom:["aria"],state:["busy","error"]}),i("collection","list","list",{role:"listbox",state:["label","items","selection"],items:{role:"option",noun:"item",gestures:["select"]},gestures:["select","scroll"]}),i("collection","tree","tree",{role:"tree",state:["items","selection"],parts:{"item-label":'[data-u2-part="item-label"]'},items:{role:"treeitem",noun:"tree node",gestures:["select","expand","collapse","toggle"]},gestures:["select","expand","collapse"]}),i("collection","table","table",{role:"table",state:["items","selection"],parts:{"item-label":'[data-u2-part="item-label"]',section:'[data-u2-part="section"]'},items:{role:"row",noun:"table row",gestures:["select"]},gestures:["select","scroll"],styling:h}),i("collection","data-table","table",{role:"grid",state:["items","selection"],parts:{"item-label":'[data-u2-part="item-label"]'},items:{role:"row",noun:"table row",gestures:["select"]},gestures:["select","scroll"]}),i("collection","catalog-table","catalog table",{aliases:["records table"],nameFrom:["aria"],parts:{"item-label":'[data-u2-part="item-label"]',section:'[data-u2-part="section"]',footer:':scope > [data-u2-part="footer"]'},state:["items","busy","extra"],items:{role:"row",noun:"table row",gestures:["expand","collapse"]},gestures:["scroll"],styling:h}),i("collection","master-detail","master detail",{aliases:["list with details"],nameFrom:["aria"],parts:{list:'[data-u2-part="list"]',detail:'[data-u2-part="detail"]',reason:'[data-u2-part="reason"]'},state:["current","items","selection"],items:{role:"option",noun:"item",gestures:["select","toggle"]},gestures:["select","toggle"],styling:{"--u2-master-detail-height":"its height (a CSS length); it fills its host by default","--u2-row-selected-bg":"the current row"}}),i("collection","column-header","column header",{role:"columnheader",nameFrom:["text","aria"],gestures:["press"]}),i("collection","grid","grid",{aliases:["virtual grid","cell grid"],role:"listbox",state:["items","selection"],items:{role:"option",noun:"cell",gestures:["select","pick"]},gestures:["select","scroll"]}),i("collection","property-grid","property grid",{aliases:["property editor"],role:"grid",state:["items"],parts:{"item-label":'[data-u2-part="item-label"]',category:'[data-u2-part="category"]'},items:{role:"row",noun:"property",gestures:["type"]},gestures:["type"]}),i("collection","property-editor","property grid",{state:["items"],gestures:["type"]}),i("collection","functions-browser","functions browser",{state:["items","selection"],items:{role:"option",noun:"item",gestures:["select"]},gestures:["type","select"]}),i("collection","func-call-history-browser","history browser",{aliases:["func call history browser","run history"],state:["items","busy","error"],items:{role:"option",noun:"item",gestures:["select"]},gestures:["select"]}),i("collection","space-browser","space browser",{aliases:["open from space"],state:["items","selection"],items:{role:"option",noun:"item",gestures:["select"]},gestures:["type","select"]}),i("navigation","breadcrumbs","breadcrumbs",{aliases:["breadcrumb bar"],role:"navigation",state:["current","items"],items:{role:"listitem",noun:"breadcrumb",gestures:["press"]},gestures:["press"]}),i("navigation","menu","menu",{role:"menu",state:["open","items"],items:{role:"menuitem",noun:"menu item",gestures:["pick","hover"]},gestures:["pick","hover"]}),i("navigation","menu-bar","menu bar",{role:"menubar",state:["items"],items:{role:"menuitem",noun:"menu item",gestures:["open","pick"]},gestures:["open","pick"]}),i("navigation","toolbar","toolbar",{role:"toolbar",state:["items"],items:{role:"button",noun:"button",gestures:["press"]},gestures:["press"]}),i("navigation","ribbon-group","ribbon group",{aliases:["package ribbon"],role:"toolbar",parts:{"more button":'[data-u2-part="more"]'},state:["items","extra"],items:{role:"button",noun:"ribbon button",gestures:["press"]},gestures:["press"]}),i("overlay","dialog","dialog",{role:"dialog",parts:{title:':scope > .u2-dialog-title > [data-u2-part="title"]',"close button":':scope > .u2-dialog-title > [data-u2-part="close"]',body:':scope > [data-u2-part="body"]',footer:':scope > [data-u2-part="footer"]',"error row":':scope > [data-u2-part="error-row"]',spinner:':scope > [data-u2-part="footer"] > * > [data-u2-part="busy"]'},state:["label","open","busy","error","valid"],gestures:["close"]}),i("overlay","tooltip","tooltip",{role:"tooltip",nameFrom:["text"],state:["text"],gestures:["hover"]}),i("overlay","notify","notification",{aliases:["balloon","toast","message"],role:"status",nameFrom:["text"],state:["text","extra"],gestures:["close"]}),i("overlay","tour","tour",{role:"dialog",nameFrom:["title"],state:["current","items"],gestures:["press"]}),i("display","icon","icon",{nameFrom:["aria"],state:["label","extra"]}),i("display","badge","badge",{state:["text"]}),i("display","count-badge","badge",{state:["text"]}),i("display","dot","badge",{state:["text"]}),i("display","status-line","status line",{role:"status",nameFrom:["text"],state:["text"]}),i("display","empty-state","empty state",{role:"status",nameFrom:["text"],state:["text"]}),i("display","tag","tag",{nameFrom:["text"],state:["text","selected","pressed"]}),i("display","chip","chip",{nameFrom:["text"],state:["text","selected","pressed"]}),i("display","bind-chip","chip",{nameFrom:["text"],state:["text","selected","pressed"]}),i("display","msg-chip","chip",{nameFrom:["text"],state:["text","selected","pressed"]}),i("display","stat-card","stat card",{aliases:["stat"],nameFrom:["label","text"],parts:{label:'[data-u2-part="label"]',value:'[data-u2-part="value"]',delta:'[data-u2-part="delta"]'},state:["label","value","text","extra"]}),i("display","app-header","app header",{aliases:["app hero"],nameFrom:["label","aria"],parts:{icon:'[data-u2-part="icon"]',title:'[data-u2-part="title"]',subtitle:'[data-u2-part="subtitle"]',"learn more":'[data-u2-part="learn-more"]'},state:["label","items","extra"],items:{role:"listitem",noun:"header item",gestures:[]}}),i("display","progress-bar","progress bar",{aliases:["progress"],role:"progressbar",nameFrom:["label","aria"],parts:{label:'[data-u2-part="label"]',track:'[data-u2-part="track"]',percent:'[data-u2-part="percent"]'},state:["value","text","busy"]}),i("display","entity-card","entity card",{aliases:["entity"],nameFrom:["title","text"],parts:{title:'[data-u2-part="title"]'},state:["label"]}),i("composite","designer","designer",{state:["busy"]}),i("composite","palette","palette"),i("composite","tray","tray"),i("composite","filter-group","filter group",{parts:{connector:'[data-u2-part="connector"]',not:'[data-u2-part="not"]',add:'[data-u2-part="add"]',"add group":'[data-u2-part="add-group"]',rows:'[data-u2-part="rows"]',handle:'[data-u2-part="handle"]'},gestures:["add","remove","drag"]}),i("composite","filter-row","filter row",{parts:{property:'[data-u2-part="prop"]',operator:'[data-u2-part="op"]',value:'[data-u2-part="value"]',remove:'[data-u2-part="remove"]',handle:'[data-u2-part="handle"]'},gestures:["type","pick","remove","drag"]}),a("fb-search","search","functions-browser","collection"),a("fb-list","list","functions-browser","collection"),a("fb-status","status","functions-browser","collection"),a("fb-clear","clear button","functions-browser","collection"),a("fb-roles","roles","functions-browser","collection"),a("fb-tags","tags","functions-browser","collection"),a("fb-empty","empty message","functions-browser","collection"),a("fb-panes","panes","functions-browser","collection"),a("fb-role","role","functions-browser","collection"),a("fb-tag","tag","functions-browser","collection"),a("fch-list","list","func-call-history-browser","collection"),a("fch-retry","retry button","func-call-history-browser","collection"),a("fch-state","state","func-call-history-browser","collection"),a("ff-run","run button","func-form","container"),a("ff-history-icon","history icon","func-form","container")},3830(e,t,n){n.d(t,{B:()=>c,h:()=>f});var r,i,o,a=n(949),l=n(1518),s=n(9701),u=n(317);function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}let c="u2-overlay-close",p='input, textarea, select, button, [role="combobox"], [tabindex]:not([tabindex="-1"])',h=["listbox","menu","tree","grid","dialog"],m=null!=(r=(i=globalThis)[o=Symbol.for("u2.ids")])?r:i[o]={next:0};class f{static nextLayer(){return++f._layer}static nextDialogZ(){let e=2999;var t=!0,n=!1,r=void 0;try{for(var i,o=document.querySelectorAll(".d4-dialog, .d4-dialog-center-wrapper, .u2-dialog, .u2-dialog-backdrop")[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){let t=i.value,n=parseInt(t.style.zIndex,10);n>e&&(e=n)}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}return e+1}static get host(){if(!f._host||!f._host.isConnected){let e=document.createElement("div");e.className="u2-overlay",e.style.cssText="position: fixed; left: 0; top: 0; width: 0; height: 0; z-index: var(--dg-z-overlay);",document.body.append(e),new MutationObserver(()=>{e.isConnected&&0===e.childNodes.length&&e.remove()}).observe(e,{childList:!0}),f._host=e}return f._host}static show(e,t,n){var r;let i=void 0===n?{}:n,o=u.Q.scopeOf(i.owner,"Overlay.show()");if(!e.isConnected)return()=>{};let l=e.closest("[data-u2-name]");(null==l?void 0:l.dataset.u2Name)!==void 0?t.dataset.u2Owner=l.dataset.u2Name:delete t.dataset.u2Owner;let d=s.Ec.forElement(e);void 0!==d?t.dataset.u2OwnerId=d.rootId:delete t.dataset.u2OwnerId,t.id||(t.id=`u2-${++m.next}-popup`),t.dataset.u2Part="popup";let p=f._focusTarget(e),g=p.getAttribute("aria-controls");p.setAttribute("aria-controls",t.id),p.setAttribute("aria-expanded","true"),p.hasAttribute("aria-haspopup")||p.setAttribute("aria-haspopup",null!=(r=h.find(e=>t.getAttribute("role")===e))?r:"true"),t.style.position="fixed",t.style.left="0",t.style.top="0",t.style.zIndex=String(f.nextLayer()),f.host.append(t);let v=!1,b=()=>{},y=()=>{v||(v=!0,b(),f._remove(_),p.setAttribute("aria-expanded","false"),null===g?p.removeAttribute("aria-controls"):p.setAttribute("aria-controls",g),t.remove(),o.disown(y),t.dispatchEvent(new CustomEvent(c)))},_={content:t,close:y,anchor:e,focus:p};return f._push(_),b=(0,a.ll)(e,t,()=>{e.isConnected?(0,a.rD)(e,t,{strategy:"fixed",placement:"bottom-start",middleware:[(0,a.cY)(1),(0,a.UU)({padding:4}),(0,a.Ej)({padding:4,apply:e=>{let t=e.rects,n=e.availableHeight,r=e.elements;!1!==i.matchWidth&&(r.floating.style.minWidth=`${t.reference.width}px`);let o=`${Math.max(n,64)}px`,a=i.maxHeight;r.floating.style.maxHeight=void 0===a?o:`min(${o}, ${"number"==typeof a?`${a}px`:a})`}})]}).then(e=>{let n=e.x,r=e.y;t.style.left=`${n}px`,t.style.top=`${r}px`}):y()}),o.own(y),y}static pushDialog(e){let t={content:e.root,close:()=>e.close(),dialog:e};return f._push(t),()=>f._remove(t)}static raiseDialog(e){var t;let n=f._stack,r=n.findIndex(t=>t.dialog===e);if(r<0)return;let i=(function(e){if(Array.isArray(e))return e}(t=n.splice(r,1))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var i=[],o=!0,a=!1;try{for(r=r.call(e);!(o=(t=r.next()).done)&&(i.push(t.value),1!==i.length);o=!0);}catch(e){a=!0,n=e}finally{try{o||null==r.return||r.return()}finally{if(a)throw n}}return i}}(t)||function(e){if(e){if("string"==typeof e)return d(e,1);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return d(e,1)}}(t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0],o=n.length-1;for(;o>=0&&void 0===n[o].dialog;)o--;n.splice(o+1,0,i)}static platformDialogAbove(e){let t=parseInt(e.style.zIndex,10)||0;return[...document.querySelectorAll(".d4-dialog")].some(e=>(parseInt(e.style.zIndex,10)||0)>t)}static _push(e){if(f._stack.push(e),void 0!==f._listeners)return;let t=f._listeners=new l.HG(void 0,{label:"overlay"});l.Yz.markSingleton(t),t.listen(document,"keydown",e=>l.HG.runWith(void 0,()=>f._onKeyDown(e)),{capture:!0}),t.listen(document,"pointerdown",e=>l.HG.runWith(void 0,()=>f._onPointerDown(e)),{capture:!0}),t.listen(window,"resize",()=>l.HG.runWith(void 0,()=>f._closePopups()));let n=new MutationObserver(()=>f._sweep());n.observe(document.body,{childList:!0,subtree:!0}),t.own(()=>n.disconnect())}static _remove(e){let t=f._stack,n=t.indexOf(e);if(n<0)return;t.splice(n,1);let r=f._listeners;0===t.length&&void 0!==r&&(f._listeners=void 0,r.dispose())}static _onKeyDown(e){if("Escape"!==e.key||e.defaultPrevented)return;let t=f._stack[f._stack.length-1];if(void 0===t)return;let n=e.target instanceof Node?e.target:null,r=f._focusLost(n);if(void 0===t.dialog){if(!(null!==n&&(t.content.contains(n)||t.anchor.contains(n)))&&!r&&n instanceof Element&&null!==n.closest(".d4-dialog"))return;e.preventDefault(),e.stopPropagation();let i=document.activeElement,o=null!==i&&t.content.contains(i);t.close(),o&&t.focus.isConnected&&t.focus.focus();return}r&&t.dialog.modal&&!f.platformDialogAbove(t.dialog.root)&&(e.preventDefault(),e.stopPropagation(),t.dialog.cancelByKey())}static _onPointerDown(e){let t=e.target;var n=!0,r=!1,i=void 0;try{for(var o,a,l=[...f._stack].reverse()[Symbol.iterator]();!(n=(a=l.next()).done);n=!0){let e=a.value;if(e.content.contains(t)||(null==(o=e.anchor)?void 0:o.contains(t)))return;void 0===e.dialog&&e.close()}}catch(e){r=!0,i=e}finally{try{n||null==l.return||l.return()}finally{if(r)throw i}}}static _closePopups(){var e=!0,t=!1,n=void 0;try{for(var r,i=[...f._stack].reverse()[Symbol.iterator]();!(e=(r=i.next()).done);e=!0){let e=r.value;void 0===e.dialog&&e.close()}}catch(e){t=!0,n=e}finally{try{e||null==i.return||i.return()}finally{if(t)throw n}}}static _sweep(){for(let e=0,t=[...f._stack];e<t.length;e++){let n=t[e];n.content.isConnected&&(void 0===n.anchor||n.anchor.isConnected)||n.close()}}static _focusLost(e){return null===e||e===document.body||e===document.documentElement||e===document}static _focusTarget(e){var t,n;return e.hasAttribute("aria-haspopup")||e.matches(p)?e:null!=(t=null!=(n=e.querySelector("[aria-haspopup]"))?n:e.querySelector(p))?t:e}}f._layer=0,f._stack=[]},317(e,t,n){n.d(t,{Q:()=>i});var r=n(1518);class i{static scopeOf(e,t){let n=i._resolve(e);return void 0===n&&r._U.fail("owner-missing",`${t} needs an owner — pass one, or call it under \`owner.build(…)\` or \`component((self) => …)\`; after an \`await\`, inside \`owner.task(async (t) => … t.build(…))\``),n}static adopt(e,t){let n=i._resolve(e);return void 0===n?(r._U.report("owner-missing","built with no `owner` while nothing was building, so nothing will dispose it — pass `owner`, or build it under `owner.build(…)` or `component((self) => …)`; after an `await`, inside `owner.task(async (t) => … t.build(…))`; a new root on purpose, under `Scope.root('<what>')`"),()=>{}):(n.own(t),()=>n.disown(t))}static _resolve(e){return void 0===e?r.HG.ambient:e instanceof r.HG?e:e.scope}}},5445(e,t,n){n.d(t,{e:()=>l});var r=n(7115),i=n(317);function o(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}function a(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function l(e){o(a,r,i,l,s,"next",e)}function s(e){o(a,r,i,l,s,"throw",e)}l(void 0)})}}class l{loadMore(){let e=this._state.peek();this._disposed||"loading"===e||"done"===e||((0,r.vA)(()=>{this._state.value="loading",this._error.value=null}),this._load(this._abortSignal()))}reset(){this._cancel(),this._disposed||(this._page=0,(0,r.vA)(()=>{this._items.value=[],this._total.value=null,this._state.value="idle",this._error.value=null}),this._count&&this._recount(this._abortSignal()),this.loadMore())}dispose(){var e;this._disposed=!0,this._cancel(),null==(e=this._release)||e.call(this)}_abortSignal(){return this._abort||(this._abort=new AbortController),this._abort.signal}_cancel(){this._abort&&this._abort.abort(),this._abort=void 0}_load(e){return a(function*(){try{let t=yield this._fetchPage(this._page,e);if(e.aborted||this._disposed)return;this._page++,(0,r.vA)(()=>{this._items.value=this._items.peek().concat(t);let e=t.length<this._pageSize;this._state.value=e?"done":"idle",e&&null===this._total.peek()&&(this._total.value=this._items.peek().length)})}catch(t){if(e.aborted||this._disposed)return;(0,r.vA)(()=>{this._error.value=t instanceof Error?t.message:String(t),this._state.value="error"})}}).call(this)}_recount(e){return a(function*(){try{let t=yield this._count(e);e.aborted||this._disposed||(this._total.value=t)}catch(e){}}).call(this)}constructor(e){var t;this._error=(0,r.vP)(null),this._page=0,this._disposed=!1,this._fetchPage=e.fetchPage,this._count=e.count,this._pageSize=null!=(t=e.pageSize)?t:20,this._items=(0,r.vP)([]),this._state=(0,r.vP)("idle"),this._total=(0,r.vP)(null),this.items=this._items,this.state=this._state,this.total=this._total,this.error=this._error,this._release=i.Q.adopt(e.owner,()=>this.dispose())}}},1781(e,t,n){n.d(t,{e:()=>o});let r=new DataView(new ArrayBuffer(8)),i=/^[-+]?(\d+\.?\d*|\.\d+)([eE][-+]?\d+)?$/;class o{static create(e,t){let n=void 0===t?o.EXACT:t;return r.setFloat64(0,e),r.setUint8(7,252&r.getUint8(7)|n),r.getFloat64(0)}static less(e){return o.create(e,o.LESS)}static greater(e){return o.create(e,o.GREATER)}static getQ(e){return r.setFloat64(0,e),3&r.getUint8(7)}static getValue(e){return r.setFloat64(0,e),r.setUint8(7,252&r.getUint8(7)),r.getFloat64(0)}static qualifier(e){if(0===e||e===o.EXACT)return"";if(e===o.LESS)return"<";if(e===o.GREATER)return">";throw Error(`Unknown qualifier type: ${e}`)}static parse(e){let t=e.replace(/^ +/,"");if(""===t)return null;let n=t[0],r="<"===n?o.LESS:">"===n?o.GREATER:o.EXACT,a=(r===o.EXACT?t:t.substring(1)).trim();return i.test(a)?o.create(Number(a),r):null}static format(e,t){if(null===e)return"";let n=o.getValue(e);return o.qualifier(o.getQ(e))+(void 0===t?String(Number(n.toPrecision(15))):t(n))}}o.LESS=1,o.EXACT=2,o.GREATER=3},5232(e,t,n){n.d(t,{B:()=>l});var r=n(7115),i=n(317),o=n(1518);let a=e=>(!0===e&&o._U.report("reason-boolean","`disabled: true` says nothing to the user — pass the reason instead (`disabled: 'Pick a source file first'`), `null` while it is on."),!0===e?"Unavailable":!1===e||void 0===e||""===e?null:e),l={now:e=>a(e instanceof r.HN?e.peek():e),read:e=>a(e instanceof r.HN?e.value:e),follow(e,t,n){void 0!==e&&(e instanceof r.HN?i.Q.scopeOf(n,"a live `disabled` reason").effect(()=>t(a(e.value))):t(a(e)))},apply(e,t){t?(e.setAttribute("aria-disabled","true"),e.setAttribute("aria-description",t)):(e.removeAttribute("aria-disabled"),e.removeAttribute("aria-description"))},region(e,t){let n=a(t);e.classList.toggle("u2-region-off",null!==n),null===n?(e.removeAttribute("inert"),e.removeAttribute("aria-description")):(e.setAttribute("inert",""),e.setAttribute("aria-description",n))},of:e=>"true"===e.getAttribute("aria-disabled")?a(e.getAttribute("aria-description")):null,focusable:e=>(Object.defineProperty(e,"disabled",{configurable:!0,get:()=>"true"===e.getAttribute("aria-disabled")||e.hasAttribute("disabled"),set:t=>{t&&null===e.getAttribute("aria-description")&&o._U.report("reason-missing","`button.disabled = true` turns a u2 button off without saying why — `Reason.apply(button, '<why>')`, or build it with `{disabled: '<why>'}`."),t?e.setAttribute("aria-disabled","true"):e.removeAttribute("aria-disabled")}}),e.addEventListener("click",t=>{"true"===e.getAttribute("aria-disabled")&&(t.preventDefault(),t.stopImmediatePropagation())},!0),e)}},4860(e,t,n){n.d(t,{_:()=>s});var r=n(7115),i=n(1518);function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function a(e,t,n,r){let o=new i.HG(e,{label:t,lazy:!0});return{el:o.build(r),scope:o,item:n}}function l(e){e.scope.dispose(),e.el.remove()}function s(e,t,n,s,u){let d,c=void 0===u?{}:u,p=function(e){let t=i.HG.ambient;if(!t)throw Error(`u2: ${e}() needs an owner — build under \`owner.build(…)\` or \`component((self) => …)\`; after an \`await\`, inside \`owner.task(async (t) => … t.build(…))\``);return t}("each"),h=t instanceof r.HN?()=>t.value:t,m=new Map,f=new Set;p.effect(()=>{let t=h();(0,r.O8)(()=>(t=>{let r=new Map;for(let e=0;e<t.length;e++){let i=t[e],o=n(i,e);if(r.has(o)){f.has(o)||(f.add(o),console.warn(`u2: each(): duplicate key "${o}"`));let e=2;for(;r.has(`${o}#${e}`);)e++;o=`${o}#${e}`}let u=m.get(o);if(void 0!==u&&u.item!==i){let t=u;void 0!==c.update&&!1!==t.scope.build(()=>c.update(t.el,i,e))?t.item=i:(l(t),u=void 0)}void 0===u&&void 0===(u=a(p,"item",i,()=>s(i,e))).el.dataset.u2Item&&(u.el.dataset.u2Item=o),r.set(o,u)}var i=!0,u=!1,h=void 0;try{for(var g,v,b=m[Symbol.iterator]();!(i=(v=b.next()).done);i=!0){let e=(g=v.value,function(e){if(Array.isArray(e))return e}(g)||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var i=[],o=!0,a=!1;try{for(r=r.call(e);!(o=(t=r.next()).done)&&(i.push(t.value),2!==i.length);o=!0);}catch(e){a=!0,n=e}finally{try{o||null==r.return||r.return()}finally{if(a)throw n}}return i}}(g)||function(e){if(e){if("string"==typeof e)return o(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return o(e,2)}}(g)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),t=e[0],n=e[1];r.get(t)!==n&&l(n)}}catch(e){u=!0,h=e}finally{try{i||null==b.return||b.return()}finally{if(u)throw h}}m=r,t.length>0&&void 0!==d&&(l(d),d=void 0);let y=document.activeElement,_=e.firstChild;var w=!0,x=!1,k=void 0;try{for(var O,A=r.values()[Symbol.iterator]();!(w=(O=A.next()).done);w=!0){let t=O.value.el;if(t===_)_=_.nextSibling;else if(t.parentNode===e&&t.contains(y)){let n=t.nextSibling;for(;_!==t;){let t=_;_=t.nextSibling,e.insertBefore(t,n)}_=t.nextSibling}else e.insertBefore(t,_)}}catch(e){x=!0,k=e}finally{try{w||null==A.return||A.return()}finally{if(x)throw k}}0===t.length&&void 0===d&&void 0!==c.empty&&(d=a(p,"empty",void 0,c.empty),e.append(d.el))})(t))})}},1518(e,t,n){n.d(t,{HG:()=>r.Scope,Yz:()=>r.debug,_U:()=>r.Usage});var r=n(3095)},7115(e,t,n){n.d(t,{EW:()=>i.computed,HN:()=>i.Signal,O8:()=>i.untracked,n$:()=>i.isWritableSignal,vA:()=>i.batch,vP:()=>i.signal,vn:()=>i.afterFlush});var r,i=n(3095);let o=globalThis.DG;if((null==o||null==(r=o.U2)?void 0:r.Signal)!==void 0&&o.U2.Signal!==i.Signal)throw Error("u2: a second copy of the signal engine is bundled — build with @datagrok/build-config (it externalizes datagrok-api/u2core as DG.U2)")},4208(e,t,n){n.d(t,{Ho:()=>l,Yw:()=>a,ee:()=>u,uA:()=>s});var r=n(6900);let i=/^(-?\d+)([hdwmy])$/,o={h:36e5,d:864e5,w:6048e5,m:26784e5,y:31536e6};function a(e){return"now"===e||i.test(e)}function l(e,t){if("now"===e)return new Date(t.getTime());let n=i.exec(e);if(!n)throw new r.FH(`Bad time span "${e}"`);return new Date(t.getTime()+Number(n[1])*o[n[2]])}function s(e,t){return Object.defineProperty(e,"span",{value:t,enumerable:!1,configurable:!0}),e}function u(e){return e.span}},2357(e,t,n){n.d(t,{j:()=>a});var r=n(7115),i=n(4860),o=n(3830);class a{get rowCount(){return this._shown.peek().length}open(){this._open.peek()||(this._open.value=!0,this._closeOverlay=o.h.show(this._options.anchor,this.popup,{owner:this._options.scope,maxHeight:this._options.maxHeight,matchWidth:this._options.matchWidth}))}dismiss(){if(!this._open.peek())return;this._open.value=!1,this._active.value=-1;let e=this._closeOverlay;this._closeOverlay=void 0,e&&e()}clearActive(){this._active.value=-1}move(e){this.jump(this._active.peek()+e)}jump(e){let t=this._shown.peek().length;t>0&&(this._active.value=Math.min(Math.max(e,0),t-1))}static keyOf(e,t){if("string"==typeof e||"number"==typeof e)return String(e);for(let t=0,n=[null==e?void 0:e.text,null==e?void 0:e.name,null==e?void 0:e.id];t<n.length;t++){let e=n[t];if("string"==typeof e)return e}return`#${t}`}static row(e,t){let n=document.createElement("div");return n.className=e,n.textContent=t,n}_row(e,t){return a.row(`u2-suggest-${e} ${this._options.prefix}-${e}`,t)}_onPointerDown(e){let t=e.target,n=t.closest(`.${this._options.prefix}-option`);if(n){e.preventDefault(),this._options.onPick([...this._list.children].indexOf(n));return}t.closest(`.${this._options.prefix}-retry`)&&(e.preventDefault(),this._options.onRetry())}_renderStatus(){let e=this._status,t=this._options,n=t.view.value,r=t.text.value.length<t.minChars;if(e.textContent="",e.className="u2-suggest-status",e.hidden=!this._open.value||!r&&"ready"===n.kind&&t.items.value.length>0,e.hidden)return;let i=r?"hint":"error"===n.kind?"error":"loading"===n.kind||"idle"===n.kind?"loading":"empty";if(e.className=`u2-suggest-${i} ${t.prefix}-${i}`,"error"===i&&"error"===n.kind){e.textContent=n.message;let r=document.createElement("button");r.className=`u2-suggest-retry ${t.prefix}-retry`,r.type="button",r.textContent="Retry",e.append(r);return}let o=t.emptyText;e.textContent="hint"===i?`Type ${t.minChars} or more characters`:"loading"===i?"Loading…":"function"==typeof o?o(t.text.peek()):null!=o?o:"No matches"}_highlight(){let e=this._shown.value,t=this._options.text.value.length>0,n=this._options.autoHighlight;n&&e.length>0&&(this._active.value="always"===n||t?0:-1)}_option(e){var t;let n=document.createElement("div");n.className=`u2-suggest-option ${this._options.prefix}-option`,n.id=`${this._id}-opt-${++this._rowSeq}`,n.setAttribute("role","option"),n.setAttribute("aria-selected","false");let r=this._options.render(e);return null===r.querySelector('[data-u2-part="item-label"]')&&(null!=(t=r.dataset).u2Part||(t.u2Part="item-label")),n.append(r),n}_applyActive(){var e,t,n;let r=this._options.anchor,i=this._shown.value.length,o=this._list.children,a=this._active.value,l=this._shown.value,s=null!=(e=null==(t=(n=this._options).currentKey)?void 0:t.call(n))?e:null,u=this._options.keyOf;for(let e=0;e<i;e++)o[e].classList.toggle("u2-suggest-option-current",null!==s&&(null==u?void 0:u(l[e]))===s),o[e].classList.toggle("u2-suggest-option-active",e===a),o[e].classList.toggle(`${this._options.prefix}-option-active`,e===a),o[e].setAttribute("aria-selected",e===a?"true":"false");let d=a>=0&&a<i?o[a]:void 0;d?(r.setAttribute("aria-activedescendant",d.id),d.scrollIntoView({block:"nearest"})):r.removeAttribute("aria-activedescendant")}constructor(e){this.popup=document.createElement("div"),this._open=(0,r.vP)(!1),this._active=(0,r.vP)(-1),this._list=document.createElement("div"),this._status=document.createElement("div"),this._footer=document.createElement("div"),this._rowSeq=0,this._options=e,this.isOpen=this._open,this.activeIndex=this._active,this._id=`${e.prefix}-${++a._seq}`,this.popup.className=`u2-suggest-popup ${e.prefix}-popup`,this.popup.id=`${this._id}-listbox`,this.popup.setAttribute("role","listbox"),e.anchor.setAttribute("aria-controls",this.popup.id),this._list.className="u2-suggest-options",this._footer.className=`u2-suggest-footer ${e.prefix}-footer`,this._footer.hidden=!0,this.popup.append(this._list,this._status,this._footer),this._shown=(0,r.EW)(()=>{let t=e.view.value;return this._open.value&&e.text.value.length>=e.minChars&&"ready"===t.kind?e.items.value:[]}),e.scope.listen(this.popup,"pointerdown",e=>this._onPointerDown(e)),e.scope.listen(this.popup,o.B,()=>e.onDismiss());const t=e.keyOf;e.scope.build(()=>(0,i._)(this._list,this._shown,(e,n)=>t?t(e):a.keyOf(e,n),e=>this._option(e))),e.scope.effect(()=>this._renderStatus()),e.scope.effect(()=>{var t,n;let r=this._shown.value.length>0&&null!=(t=null==(n=e.footer)?void 0:n.call(e))?t:null;this._footer.textContent=null!=r?r:"",this._footer.hidden=null===r}),e.scope.effect(()=>this._highlight()),e.scope.effect(()=>this._applyActive())}}a._seq=0},9383(e,t,n){let r;n.d(t,{Hh:()=>d,Im:()=>l,LS:()=>s,Qq:()=>o,sc:()=>c,wg:()=>a});var i=n(4911);function o(e){return null==e?"":String(e)}let a="Value can't be empty";function l(e){return null==e||""===e}function s(e,t,n){return`${i.y.count(e)} ${1===e?t:n}`}let u=new Set(["and","or","than","if","but","so","as","that"]);function d(e){var t;return e===e.toUpperCase()||e.includes(" ")?e:(null!=(t=e.match(/[A-Z]+(?![a-z])|[A-Z]?[^A-Z]+/g))?t:[e]).map((e,t)=>{let n=u.has(e.toLowerCase())?e.toLowerCase():e;return 0===t?n.charAt(0).toUpperCase()+n.slice(1):n}).join(" ")}function c(e,t){var n,i,o;return(null!=r||(r=null!=(n=null==(i=(o=document.createElement("canvas")).getContext)?void 0:i.call(o,"2d"))?n:null),null===r)?0:(r.font=t,r.measureText(e).width)}},4977(e,t,n){n.d(t,{m:()=>l});var r=n(949),i=n(3830),o=n(317);let a=Symbol.for("u2.tooltip");class l{static get root(){if(!l._root||!l._root.isConnected){let e=document.createElement("div");e.className="u2-tooltip",e.dataset.u2="tooltip",e.id="u2-tooltip",e.setAttribute("role","tooltip"),e.style.cssText="position: fixed; left: 0; top: 0; display: none; pointer-events: none;",i.h.host.append(e),l._root=e}return l._root}static get isVisible(){return void 0!==l._anchor}static titleIfCut(e){let t=l._cutTitles.has(e);if(e.scrollWidth>e.clientWidth){var n;if(!t&&""!==e.title)return;e.title=(null!=(n=e.textContent)?n:"").trim(),l._cutTitles.add(e)}else t&&(e.removeAttribute("title"),l._cutTitles.delete(e))}static bind(e,t,n){let r=o.Q.scopeOf(null==n?void 0:n.owner,"Tooltip.bind()"),i=()=>{let n=()=>l.show("function"==typeof t?t():t,e);l.isVisible||Date.now()-l._hiddenAt<100||l.delay<=0?n():(window.clearTimeout(l._timer),l._pending=e,l._timer=window.setTimeout(n,l.delay))},s=()=>l.hide(),u=e=>{l._keyboardFocus(e.target)&&i()};e.addEventListener("pointerenter",i),e.addEventListener("pointerleave",s),e.addEventListener("pointerdown",s),e.addEventListener("focusin",u),e.addEventListener("focusout",s),e[a]=t,r.own(()=>{e[a]===t&&delete e[a],e.removeEventListener("pointerenter",i),e.removeEventListener("pointerleave",s),e.removeEventListener("pointerdown",s),e.removeEventListener("focusin",u),e.removeEventListener("focusout",s),(l._anchor===e||l._pending===e)&&l.hide()})}static show(e,t){if(window.clearTimeout(l._timer),l._pending=void 0,!t.isConnected||""===e)return;let n=l.root;n.textContent="","string"==typeof e?n.textContent=e:n.append(e),n.style.display="block",void 0!==l._anchor&&l._anchor!==t&&l._describe(l._anchor,!1),l._anchor=t,l._describe(t,!0),document.addEventListener("pointerdown",l._onPointerDown,!0),document.addEventListener("keydown",l._onKeyDown),document.addEventListener("scroll",l._onScroll,!0),(0,r.rD)(t,n,{strategy:"fixed",placement:"bottom-start",middleware:[(0,r.cY)(12),(0,r.UU)({padding:4}),(0,r.BN)({padding:4})]}).then(e=>{let r=e.x,i=e.y;l._anchor===t&&(n.style.left=`${r}px`,n.style.top=`${i}px`)})}static hide(){if(window.clearTimeout(l._timer),l._pending=void 0,!l.isVisible)return;l._describe(l._anchor,!1),l._anchor=void 0,l._hiddenAt=Date.now(),document.removeEventListener("pointerdown",l._onPointerDown,!0),document.removeEventListener("keydown",l._onKeyDown),document.removeEventListener("scroll",l._onScroll,!0);let e=l.root;e.style.display="none",e.textContent=""}static _describe(e,t){var n;let r=(null!=(n=e.getAttribute("aria-describedby"))?n:"").split(/\s+/).filter(e=>""!==e&&"u2-tooltip"!==e);t&&r.push("u2-tooltip"),r.length>0?e.setAttribute("aria-describedby",r.join(" ")):e.removeAttribute("aria-describedby")}static _keyboardFocus(e){try{var t;return null!=(t=null==e?void 0:e.matches(":focus-visible"))&&t}catch(e){return!1}}}l._timer=0,l._hiddenAt=0,l.delay=300,l._cutTitles=new WeakSet,l._onPointerDown=()=>l.hide(),l._onScroll=()=>l.hide(),l._onKeyDown=e=>{"Escape"===e.key&&l.hide()}},2454(e,t,n){n.d(t,{B:()=>i,k:()=>r.ITEMS_CAP});var r=n(3095);function i(e){return"string"==typeof e?"string":"number"==typeof e?Number.isInteger(e)?"int":"double":"boolean"==typeof e?"bool":Array.isArray(e)&&e.every(e=>"string"==typeof e)?"string_list":"object"}},348(e,t,n){n.d(t,{Az:()=>i,Pj:()=>o});var r=n(5445);function i(e,t){var n;let i=void 0===t?{}:t,o=null!=(n=i.pageSize)?n:20,a=()=>"function"==typeof i.filter?i.filter():i.filter,l=()=>void 0===i.order?e():e().order(i.order,i.desc);return new r.e({pageSize:o,fetchPage:e=>{let t=a();return l().list(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({pageSize:o,pageNumber:e},void 0===t?{}:{filter:t}))},count:()=>{let e=a();return(void 0===e?l():l().filter(e)).count()}})}function o(e){return e.replace(/["\\]/g,"").trim()}},6788(e,t,n){let r,i;n.d(t,{C_:()=>eD,Hc:()=>tA,eg:()=>tS,F8:()=>ix,Fg:()=>e3,OD:()=>P,Yt:()=>p,$t:()=>e$,VR:()=>eV,SZ:()=>tj});var o=n(6082),a=n(7974),l=n(5232),s=n(1518),u=n(4969),d=n(7115);class c extends a.p{get dgInput(){return this.options.dgInput}get disabled(){return super.disabled}set disabled(e){super.disabled=e;let t=this.options.dgInput;void 0!==t.enabled&&t.enabled!==(super.disabled===null)&&(t.enabled=super.disabled===null)}_followPlatform(){let e=this.options.dgInput.root.classList.contains("ui-input-disabled");e&&null===this.disabled?this.disabled=c.NOT_HERE:e||this.disabled!==c.NOT_HERE||(this.disabled=null)}get label(){return super.label||this.options.dgInput.caption}set label(e){super.label=e}createEditor(){return this._messages=(0,d.vP)(null),this.addValidator(()=>this._messages.value),this.options.dgInput.root}static _makeTabbable(e,t){if(t.tabIndex>=0||null!==t.querySelector("input, textarea, select, button, [tabindex]"))return;t.tabIndex=0;let n=e=>{let n=e.key;("Enter"===n||" "===n)&&(e.preventDefault(),t.click())};t.addEventListener("keydown",n),e.own(()=>t.removeEventListener("keydown",n))}static _same(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||"object"!=typeof t||null===e||null===t)return!1;if("dart"in e||"dart"in t)return e.dart===t.dart;let n=e.valueOf(),r=t.valueOf();if(n!==e||r!==t)return Object.is(n,r);if(Array.isArray(e)||Array.isArray(t))return Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every((e,n)=>c._same(e,t[n]));let i=Object.keys(e);return i.length===Object.keys(t).length&&i.every(n=>c._same(e[n],t[n]))}static _join(e){return null!=e&&e.length>0?e.join("\n"):null}constructor(e,t,n){super(function(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},void 0===n?{}:n),{dgInput:e,name:null!=t?t:e.caption}),e.value),this.root.dataset.u2="dart-input";const r=new MutationObserver(()=>this._followPlatform());r.observe(e.root,{attributes:!0,attributeFilter:["class"]}),this.own(()=>r.disconnect()),this._followPlatform();const i=e.root.querySelector(".ui-input-editor");i&&(e.root.classList.remove("u2-input-editor"),i.classList.add("u2-input-editor"),c._makeTabbable(this,i));const o=e.onChanged.subscribe(e=>this.value=e);this.own(()=>o.unsubscribe()),this.effect(()=>{let t=this.value;c._same(t,e.value)||(e.value=t)});const a=globalThis,l=a.grok_InputBase_Get_ValidationMessages,s=a.grok_InputBase_OnValidated;if(null==e.dart||"function"!=typeof l||"function"!=typeof s)return;this._messages.value=c._join(l(e.dart));const u=s(e.dart).subscribe(e=>this._messages.value=c._join(e));this.own(()=>u.unsubscribe());const d=this.root.querySelector(".u2-input-error");this.effect(()=>d.hidden=null!==this._messages.value)}}function p(e,t,n){let r=e.u2;return r instanceof a.p?r:new c(e,t,n)}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}c.NOT_HERE="Not available here";let m={"text-input":o.TYPE.STRING,"text-area":o.TYPE.STRING,"choice-input":o.TYPE.STRING,"number-input":o.TYPE.FLOAT,"slider-input":o.TYPE.FLOAT,"qnum-input":o.TYPE.QNUM,"bigint-input":o.TYPE.BIG_INT,"bool-input":o.TYPE.BOOL,"color-input":o.TYPE.STRING,"radio-input":o.TYPE.STRING,"multi-choice-input":o.TYPE.OBJECT,"list-input":o.TYPE.OBJECT,"map-input":o.TYPE.OBJECT,"file-input":o.TYPE.FILE,"files-input":"files","rsa-input":o.TYPE.STRING,"column-picker":o.TYPE.STRING,"columns-input":o.TYPE.OBJECT,"columns-map-input":o.TYPE.OBJECT,"aggregated-columns-input":o.TYPE.OBJECT};class f extends o.JsInputBase{get inputType(){return`u2-${this._id}`}setTooltip(e,t){return this._tip=e||null,super.setTooltip(e,void 0===t?null:t)}get dataType(){var e,t;return null!=(e=null!=(t=this._options.dataType)?t:m[this._id])?e:this._inferDataType()}get u2(){return this._input}getInput(){if(this._syncValidator(),null===this._editor){let e=this._boundProperty();this._attach(this._scope.build(()=>this._build(e))),f._dropPostfix(this._editor,e)}return this._mounted||(this._mounted=!0,o.Widget.registerCleanup(this._editor,()=>this.detach())),this._syncNullable(),this._editor}getValue(){return null!==this._input?this._input.peek():null===this._pending?null:this._pending[0]}setValue(e){if(null===this._input){this._pending=[e];return}this._programmatic=!0;try{this._input.value=e}finally{this._programmatic=!1}}getStringValue(){let e=this.getValue();return null==e?"":"object"==typeof e?JSON.stringify(e):String(e)}setStringValue(e){let t;try{t=this._parse(e)}catch(e){this._unparsed||console.warn(`u2 ${this._id}: ignored a string value that does not parse — ${e.message}`),this._unparsed=!0;return}this.setValue(t)}detach(){this._scope.dispose()}get _id(){var e,t;return null!=(e=null==(t=this._input)?void 0:t.root.dataset.u2)?e:"input"}_attach(e){this._input=e,this._editor=e.box,this.root.dataset.u2=this._id;let t=()=>{var t;return l.B.apply(e.box,this.root.classList.contains("ui-input-disabled")?null!=(t=this._tip)?t:f.NOT_HERE:null)},n=new MutationObserver(t);if(n.observe(this.root,{attributes:!0,attributeFilter:["class"]}),this._scope.own(()=>n.disconnect()),t(),null!==this._pending){var r;let e=(function(e){if(Array.isArray(e))return e}(r=this._pending)||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var i=[],o=!0,a=!1;try{for(r=r.call(e);!(o=(t=r.next()).done)&&(i.push(t.value),1!==i.length);o=!0);}catch(e){a=!0,n=e}finally{try{o||null==r.return||r.return()}finally{if(a)throw n}}return i}}(r)||function(e){if(e){if("string"==typeof e)return h(e,1);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return h(e,1)}}(r)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0];this._pending=null,this.setValue(e)}let i=!0;this._scope.effect(()=>{if(e.value,i){i=!1;return}this._notify(!this._programmatic&&!a.p.isSystemWrite)});let o=!1;this._scope.effect(()=>{e.validity.value,o&&this._notify(!1),o=!0}),this._scope.listen(e.box,"keydown",e=>{"Enter"!==e.key||e.isComposing||e.target instanceof HTMLTextAreaElement||null===e.target.closest(".d4-dialog")||e.preventDefault()}),e.own(()=>this._scope.dispose())}_syncNullable(){null!==this._input&&(this.nullable=""!==this.getStringValue()||null===this._input.validity.peek())}_notify(e){this._userEdit=this._userEdit||e,this._queued||(this._queued=!0,queueMicrotask(()=>{this._queued=!1;let e=this._userEdit;this._userEdit=!1,this._scope.isDisposed||(this._syncNullable(),e&&this.fireInput(),this.fireChanged())}))}_syncValidator(){let e=this.dart;e!==this._validated&&(this._validated=e,this.addValidator(()=>{var e,t;return null!=(e=null==(t=this._input)?void 0:t.validity.peek())?e:null}))}_boundProperty(){try{var e;return null!=(e=this.property)?e:null}catch(e){return null}}static _dropPostfix(e,t){if(!t||!t.units)return;let n=e.querySelector(".u2-input-postfix");if(null===n)return;let r=n.parentElement;n.remove(),0===r.children.length&&r.remove()}_inferDataType(){if(null===this._input)return o.TYPE.OBJECT;let e=this._input.peek();return"string"==typeof e?o.TYPE.STRING:"number"==typeof e?o.TYPE.FLOAT:"boolean"==typeof e?o.TYPE.BOOL:o.TYPE.OBJECT}_parse(e){var t;let n=this.dataType;if(n===o.TYPE.STRING)return e;let r=e.trim();if(n===o.TYPE.BOOL)return"true"===r.toLowerCase();if(""===r)return null;if(n===o.TYPE.BIG_INT)return null!=(t=u.G.parse(r))?t:null;if(n===o.TYPE.FLOAT||n===o.TYPE.INT||n===o.TYPE.QNUM){let e=Number(r);return isNaN(e)?null:e}return n===o.TYPE.OBJECT?JSON.parse(r):e}constructor(e,t){if(super(),this._scope=new s.HG(void 0,{label:"dart-input",lazy:!0}),this._input=null,this._editor=null,this._mounted=!1,this._pending=null,this._programmatic=!1,this._validated=null,this._queued=!1,this._userEdit=!1,this._unparsed=!1,this._tip=null,this._options=void 0===t?{}:t,this._build="function"==typeof e?e:null,this._syncValidator(),null===this._build){var n,r;this.caption=null!=(n=null==(r=e.root.querySelector(".u2-input-label"))?void 0:r.textContent)?n:"",this._attach(e)}}}f.NOT_HERE="Not available here";var g=n(4328),v=n(4653),b=n(8918),y=n(108),_=n(8609),w=n(9947);let x={[o.COLUMN_TYPE.STRING]:"font",[o.COLUMN_TYPE.INT]:"hashtag",[o.COLUMN_TYPE.FLOAT]:"hashtag",[o.COLUMN_TYPE.BIG_INT]:"hashtag",[o.COLUMN_TYPE.QNUM]:"hashtag",[o.COLUMN_TYPE.BOOL]:"check-square",[o.COLUMN_TYPE.DATE_TIME]:"calendar-alt",[o.COLUMN_TYPE.DATA_FRAME]:"table"};class k{column(e){return this._table.columns.contains(e)?this._table.columns.byName(e):null}caption(e){return e}icon(e){var t,n;let r=this.column(e);return(0,w.K)(null!=(t=x[null!=(n=null==r?void 0:r.type)?n:""])?t:"question-circle",{cls:"u2-column-glyph"})}listItem(e){var t;let n=null==(t=this.column(e))?void 0:t.semType,r=[this.icon(e),(0,_.Ln)(e,"u2-column-name")];return n&&r.push((0,_.Ln)(n,"u2-column-semtype")),(0,_._Q)(r,"u2-column-row")}markup(e){return(0,_._Q)([this.icon(e),(0,_.Ln)(e,"u2-column-name")],"u2-column-row")}tooltip(e){let t=this.column(e);return t?t.semType?`${e} \xb7 ${t.type} \xb7 ${t.semType}`:`${e} \xb7 ${t.type}`:e}constructor(e){this._table=e}}var O=n(3830),A=n(4335),S=n(8049);class P{static tableNames(){return[...new Set(g.shell.tableNames.filter(e=>P._named(e)))]}static sameTable(e,t){return e===t||null!=e&&null!=t&&(null!=e.dart&&null!=t.dart?e.dart===t.dart:e.name===t.name)}static isOpen(e){var t;return(null!=(t=g.shell.tables)?t:[]).some(t=>P.sameTable(t,e))}static listedColumns(e,t){return e.columns.toList().filter(e=>P._named(e.name)&&!e.name.startsWith("~")&&(void 0===t||t(e)))}static _named(e){return"string"==typeof e&&""!==e}}function E(e){let t=o.ColumnGrid;return null!=t&&"function"==typeof t[e]?t:null}class C extends a.p{get table(){return this._table}getState(){var e,t;return e=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},super.getState()),t=t={open:void 0!==this._popupScope},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}getItems(e){let t=this.peek();return a.p.itemsState(this.names().map((e,n)=>({key:e,label:e,index:n,selected:e===t,rendered:!1})),null==e?void 0:e.all)}names(){return null===this._table?[]:P.listedColumns(this._table,this._filter).map(e=>e.name)}changeTable(e,t){this._closePopup(),this._table=e,this._filter=t,this._reflectTable(),this._follow(),this.value=null}createEditor(){var e;this._table=null!=(e=this.options.table)?e:null,this._filter=this.options.filter;let t=document.createElement("div");return this._control=t,t.className="u2-columns",t.tabIndex=0,t.setAttribute("role","button"),t.setAttribute("aria-haspopup","listbox"),t.setAttribute("aria-expanded","false"),this._summary=(0,_.Ln)("","u2-columns-summary"),t.append(this._summary,(0,_.Ln)("","u2-columns-chevron")),this._reflectTable(),this.scope.listen(t,"click",()=>this._togglePopup()),this.scope.listen(t,"keydown",e=>this._onKeyDown(e)),this.effect(()=>this._renderSummary(this.value)),this._follow(),this.own(()=>{this._closePopup(),this._unfollow&&this._unfollow()}),t}_reflectTable(){let e=null===this._table;this._control.setAttribute("aria-disabled",String(e)),e?this.box.title="Select a table first":this.box.removeAttribute("title")}_renderSummary(e){var t;this._summary.textContent=null!=(t=null!=e?e:this.options.placeholder)?t:""}_follow(){if(this._unfollow&&this._unfollow(),null===this._table){this._unfollow=void 0;return}let e=[this._table.onColumnsChanged.subscribe(()=>this._prune()),D(this._table,(e,t)=>{this.peek()===e&&this.systemWrite(t)})];this._unfollow=()=>{var t=!0,n=!1,r=void 0;try{for(var i,o=e[Symbol.iterator]();!(t=(i=o.next()).done);t=!0)i.value.unsubscribe()}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}}}_prune(){let e=this.peek();null===e||this.names().includes(e)||this.systemWrite(null)}_commit(e){e!==this.peek()&&(this.value=e),this._control.dispatchEvent(new Event("change",{bubbles:!0}))}_step(e){let t=this.names();if(0===t.length)return;let n=this.peek(),r=null===n?-1:t.indexOf(n);if(e<0&&-1===r)return;let i=r+e;i<0||i>=t.length||this._commit(t[i])}_onKeyDown(e){if("Enter"===e.key||" "===e.key){e.preventDefault(),this._togglePopup();return}if(!this._popupScope){if("ArrowUp"===e.key||"ArrowLeft"===e.key||"ArrowDown"===e.key||"ArrowRight"===e.key){e.preventDefault(),this._step("ArrowUp"===e.key||"ArrowLeft"===e.key?-1:1);return}1!==e.key.length||e.ctrlKey||e.metaKey||e.altKey||(e.preventDefault(),this._openPopup(e.key))}}_togglePopup(){null===this.disabled&&null!==this._table&&(this._popupScope?this._closePopup():this._openPopup())}_openPopup(e){if(null!==this.disabled||null===this._table||this._popupScope)return;let t=new s.HG;this._popupScope=t,t.build(()=>{let n=E("popup");null!==n?this._openPlatform(t,n,e):this._openNative(t,e)}),this._control.setAttribute("aria-expanded","true")}_openPlatform(e,t,n){let r=t.popup(this._table,{addEmpty:!1!==this.options.nullable,filter:this._filter}),i=(0,_.y4)([],"u2-column-combo-host");i.append(r.root);let o=()=>this._closePopup(),a=e=>this._onPopupKey(e,r,i),l=e=>{"Escape"===e.key&&(e.stopPropagation(),this._closePopup(),this._control.focus())};i.addEventListener("keydown",l,!0),i.addEventListener("keydown",a),i.addEventListener(O.B,o),e.own(()=>{i.removeEventListener("keydown",l,!0),i.removeEventListener("keydown",a),i.removeEventListener(O.B,o),r.close()}),O.h.show(this.box,i,{owner:e});try{r.grid.props.backColor=0,r.grid.props.rowHeaderBackColor=0}catch(e){}r.grid.autoSize(400,document.documentElement.clientHeight-80);let s=this.box.getBoundingClientRect().width;r.grid.root.getBoundingClientRect().width<s&&(r.grid.root.style.width=`${s}px`);let u=this.peek();if(null!==u)try{r.dfColumns.selection.init(e=>r.nameCol.get(e)===u)}catch(e){}r.showSearch=!0;let d=r.dfColumns.onCurrentRowChanged.subscribe(()=>{var e,t;this._commit(null!=(e=null==(t=r.currentColumn)?void 0:t.name)?e:null),this._closePopup()});e.own(()=>d.unsubscribe());let c=i.querySelector("input");null!==c&&(void 0!==n&&(c.value=n,c.dispatchEvent(new Event("input",{bubbles:!0}))),c.focus())}_onPopupKey(e,t,n){var r,i;if("ArrowDown"===e.key||"ArrowUp"===e.key){e.preventDefault();let n=t.dfColumns;n.mouseOverRowIdx="ArrowDown"===e.key?n.filter.findNext(n.mouseOverRowIdx,!0):n.filter.findPrev(n.mouseOverRowIdx,!0);return}if("Enter"!==e.key)return;e.preventDefault();let o=t.dfColumns;if(o.mouseOverRowIdx>-1){o.currentRowIdx=o.mouseOverRowIdx;return}if(""===(null!=(r=null==(i=n.querySelector("input"))?void 0:i.value.trim())?r:""))return;let a=P.listedColumns(this._table,e=>t.passesFilter(e));1===a.length&&(this._commit(a[0].name),this._closePopup())}_openNative(e,t){var n;let r=new k(this._table),i=this.peek(),o=new S.k({placeholder:"Search…",search:!0,inline:!0}),a=()=>this.nullable?[null,...this.names()]:this.names(),l=e=>{let t=e.trim().toLowerCase();return t?a().filter(e=>null===e||e.toLowerCase().includes(t)):a()},s=new A.wj({itemHeight:24,render:(e,t,n)=>{n.classList.toggle("u2-columns-picked",null!==e&&e===i);let o=null===e?(0,_.y4)([],"u2-column-combo-none"):r.listItem(e);return(0,_.y4)([o],"u2-columns-option")}});s.root.classList.add("u2-columns-list");let u=e=>{let t=l(o.peek())[e];void 0!==t&&(this._commit(t),this._closePopup())},d=e=>{let t=e.target.closest(".u2-list-row");t&&u(Number(t.dataset.index))};s.root.addEventListener("click",d),e.own(()=>s.root.removeEventListener("click",d)),e.effect(()=>{s.setItems(l(o.value)),s.selectedIndex.value=-1});let c=null===i?-1:l(o.peek()).indexOf(i);c>=0&&(s.selectedIndex.value=c,s.scrollToIndex(c));let p=(0,_.yP)([o,s],"u2-columns-popup");p.classList.add("u2-column-combo-popup");let h=e=>{let t=e.key;if("Enter"===t){e.preventDefault();let t=s.selectedIndex.peek();if(t>=0)return void u(t);let n=l(o.peek()),r=n.filter(e=>null!==e);return void(1===r.length&&u(n.indexOf(r[0])))}s.root.contains(e.target)||("ArrowDown"===t||"ArrowUp"===t)&&(e.preventDefault(),(e=>{let t=l(o.peek()).length;if(0===t)return;let n=Math.min(Math.max(s.selectedIndex.peek()+e,0),t-1);s.selectedIndex.value=n,s.scrollToIndex(n)})("ArrowDown"===t?1:-1))},m=()=>this._closePopup();p.addEventListener("keydown",h),p.addEventListener(O.B,m),e.own(()=>{p.removeEventListener("keydown",h),p.removeEventListener(O.B,m)}),O.h.show(this.box,p,{owner:e}),void 0!==t&&(o.value=t),null==(n=o.root.querySelector("input"))||n.focus()}_closePopup(){let e=this._popupScope;this._popupScope=void 0,e&&(e.dispose(),this._control.setAttribute("aria-expanded","false"))}constructor(e){super(e,null),this.root.dataset.u2="column-combo"}}function j(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}function T(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){j(o,r,i,a,l,"next",e)}function l(e){j(o,r,i,a,l,"throw",e)}a(void 0)})}}function N(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function I(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function D(e,t){return e.onColumnNameChanged.subscribe(e=>t(e.args.oldName,e.args.newName))}let L=globalThis;class z extends v.o{get table(){var e;let t=this.value;if(null===t)return null;let n=this._held;return null!==n&&n.name===t&&P.isOpen(n)?n:null!=(e=g.shell.table(t))?e:null}set table(e){var t,n;let r=null===e||P.tableNames().includes(e.name)&&P.isOpen(e);r||s._U.report("table-not-offered","a table input holds one of the open tables it offers, and this one has no name or is not open: name it and open it (`grok.shell.addTable`) first"),this._held=r?e:null,this.value=null!=(t=null==(n=this._held)?void 0:n.name)?t:null}get actions(){return[...this._actions]}set actions(e){this._actions=[...e],this._renderActions()}_renderActions(){null==(i=this._actionsScope)||i.dispose();let e=new s.HG;this._actionsScope=e,null==(o=this.box.querySelector(".u2-input-options"))||o.replaceChildren();var t=!0,n=!1,r=void 0;try{for(var i,o,a,l=this._actions[Symbol.iterator]();!(t=(a=l.next()).done);t=!0){let t=a.value;this.addOptions(e.build(()=>(0,y.gb)(t.icon,()=>{let e=t.run(this);e instanceof Promise&&e.catch(e=>g.shell.error(String(e)))},{tooltip:t.tooltip})),{edits:!0})}}catch(e){n=!0,r=e}finally{try{t||null==l.return||l.return()}finally{if(n)throw r}}}static _defaults(){let e=[z._openFileAction()],t=L.grok_UI_PickTableFromFiles;"function"==typeof t&&e.push(z._pickAction("add-from-files","folder-tree","Add file from Files",t));let n=L.grok_UI_PickTableFromQuery;return"function"==typeof n&&e.push(z._pickAction("query-db","database","Query database",n)),e}static _openFileAction(){return{id:"open-file",icon:"folder-open",tooltip:"Open file",run:e=>T(function*(){let t=yield z._pickLocalFile(e);null===t||e.scope.isDisposed||(e.setItems(P.tableNames()),e.table=t)})()}}static _pickAction(e,t,n,r){return{id:e,icon:t,tooltip:n,run:e=>T(function*(){let t=yield r();null==t||e.scope.isDisposed||(g.shell.addTable(t),e.setItems(P.tableNames()),e.table=t)})()}}static _pickLocalFile(e){return new Promise(t=>{let n=document.createElement("input");n.type="file",n.hidden=!0;let r=e=>{var r;n.remove(),t(void 0===e?null:(r=e,T(function*(){let e=r.name.lastIndexOf("."),t=e<0?"":r.name.substring(e+1).toLowerCase();if("d42"!==t&&!F.includes(t))return g.shell.error(`File extension .${t} is not supported.`),null;try{let n="d42"===t?o.DataFrame.fromByteArray(new Uint8Array((yield r.arrayBuffer()))):g.data.parseCsv((yield r.text()));return n.name=e<0?r.name:r.name.substring(0,e),g.shell.addTable(n)}catch(e){return g.shell.error(`${r.name} could not be opened.`),null}})()))};n.addEventListener("change",()=>{var e,t;return r(null!=(e=null==(t=n.files)?void 0:t[0])?e:void 0)}),n.addEventListener("cancel",()=>r()),e.box.append(n),n.click()})}constructor(e){const t=e.actions;super(I(N({},function(e,t){if(null==e)return{};var n,r,i,o={};if("u">typeof Reflect&&Reflect.ownKeys){for(i=0,n=Reflect.ownKeys(Object(e));i<n.length;i++)r=n[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r]);return o}if(o=function(e,t){if(null==e)return{};var n,r,i={},o=Object.getOwnPropertyNames(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n]);return i}(e,t),Object.getOwnPropertySymbols)for(i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)r=n[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r]);return o}(e,["actions"])),{items:P.tableNames(),emptyText:"No open tables"})),this._held=null,function(e,t){let n=[g.events.onTableAdded,g.events.onTableRemoved].map(e=>e.subscribe(()=>t(P.tableNames())));e.own(()=>{var e=!0,t=!1,r=void 0;try{for(var i,o=n[Symbol.iterator]();!(e=(i=o.next()).done);e=!0)i.value.unsubscribe()}catch(e){t=!0,r=e}finally{try{e||null==o.return||o.return()}finally{if(t)throw r}}})}(this,e=>this.setItems(e)),this._actions=null!=t?t:z._defaults(),this._renderActions(),this.own(()=>{var e;return null==(e=this._actionsScope)?void 0:e.dispose()})}}a.p;let F=["csv","tsv","txt"];var B=n(9383),M=n(7614),R=n(8195),q=n(5363),H=n(1283),W=n(6050),V=n(8574),G=n(8255),U=n(4911),K=n(5557),Y=n(8321),Q=n(5143),J=n(1043),Z=n(7447),X=n(8075),ee=n(2943),et=n(2570),en=n(8752);class er{static register(e){return er._rules.push(e),()=>{let t=er._rules.indexOf(e);t>=0&&er._rules.splice(t,1)}}static resolve(e,t){var n=!0,r=!1,i=void 0;try{for(var o,a,l,s=er._rules[Symbol.iterator]();!(n=(l=s.next()).done);n=!0){let n=l.value;if(n.match(e))return n.create(e,t)}}catch(e){r=!0,i=e}finally{try{n||null==s.return||s.return()}finally{if(r)throw i}}return null!=(o=null==(a=er.byHint)?void 0:a.call(er,e,t))?o:null}}function ei(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function eo(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function ea(e,t){if(null==e)return{};var n,r,i,o={};if("u">typeof Reflect&&Reflect.ownKeys){for(i=0,n=Reflect.ownKeys(Object(e));i<n.length;i++)r=n[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r]);return o}if(o=function(e,t){if(null==e)return{};var n,r,i={},o=Object.getOwnPropertyNames(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n]);return i}(e,t),Object.getOwnPropertySymbols)for(i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)r=n[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r]);return o}er._rules=[],er.byHint=null;class el{static register(e,t){return el._factories[e]=t,()=>{el._factories[e]===t&&delete el._factories[e]}}static create(e,t,n){let r=el._factories[e];return r?r(t,n):null}}el._factories={};let es={Text:(e,t)=>new S.k(t),Search:(e,t)=>new S.k(eo(ei({},t),{search:!0})),TextArea:(e,t)=>new S.f(t),Int:(e,t)=>new q.Q(ei({},t,eb(e,"int",t))),Float:(e,t)=>new q.Q(ei({},t,eb(e,"float",t))),BigInt:(e,t)=>new u.G(t),QNum:(e,t)=>new H.C(eo(ei({},t),{format:eg(e)})),Slider:(e,t)=>ep(e,t),Bool:(e,t)=>new W.d(t),Switch:(e,t)=>new W.d(eo(ei({},t),{switch:!0})),Date:(e,t)=>new V.e(t),Color:(e,t)=>new Y.A(t),Font:(e,t)=>new Q.O(t),Image:(e,t)=>new Z.M(t),Icon:(e,t)=>new J._(t),Radio:(e,t)=>{var n;return new K.A(eo(ei({},t),{items:null!=(n=e.choices)?n:[]}))},Choice:(e,t)=>{var n;return new v.o(eo(ei({},t),{items:null!=(n=e.choices)?n:[]}))},MultiChoice:(e,t)=>{var n;return new v.F(eo(ei({},t),{items:null!=(n=e.choices)?n:[]}))},Tags:(e,t)=>{var n;return new X.u(eo(ei({},t),{items:null!=(n=e.choices)?n:void 0,allowNew:!0}))},List:(e,t)=>new et.Z(t),Map:(e,t)=>new en.h(t),File:(e,t)=>eh(e,t)},eu={textarea:(e,t)=>new S.f(t),password:(e,t)=>new S.k(eo(ei({},t),{password:!0})),switch:(e,t)=>new W.d(eo(ei({},t),{switch:!0})),slider:(e,t)=>ep(e,t)},ed={textarea:e=>"string"===e,password:e=>"string"===e,switch:e=>"bool"===e,slider:e=>"bool"!==e};function ec(e,t){var n;if(!e.set&&!(void 0!==t&&t))return"readonly";let r=null!=(n=e.propertyType)?n:e.type;if("list"===r||"string_list"===r)return"list";if("map"===r)return"map";if("file"===r||"blob"===r)return"file";if(null!=e.choices&&e.choices.length>0)return"choice";switch(r){case"string":return"string";case"datetime":return"datetime";case"int":return"int";case"bigint":return"bigint";case"qnum":return"qnum";case"double":case"float":case"num":return"float";case"bool":return"bool";default:return"readonly"}}function ep(e,t){var n,r;return new ee.C(eo(ei({},t),{min:null!=(n=ef(e.min))?n:0,max:null!=(r=ef(e.max))?r:100,step:ef(e.step)}))}function eh(e,t){var n;return null!=(n=el.create("file",e,t))?n:em(t)}function em(e){let t=new S.k(e);return t.disabled="A file is picked with the platform's file input, which is not here",t}function ef(e){return"number"==typeof e&&isFinite(e)?e:void 0}function eg(e){var t;let n=e.format,r=null==(t=globalThis.DG)?void 0:t.format;if(null!=n&&""!==n&&"function"==typeof r)return e=>r(e,n)}function ev(e){var t;let n=e.format;return(null!=(t=e.propertyType)?t:e.type)==="datetime"&&null!=n&&""!==n&&!/[Hhms]/.test(n)}function eb(e,t,n){var r,i,o;let a=ef(e.min),l=ef(e.max);return{mode:"int"===t?"int":"float",min:a,max:l,step:ef(e.step),slider:!0===e.showSlider||"float"===t,clicker:null!=(r=e.showPlusMinus)?r:"int"===t&&void 0!==a&&void 0!==l,format:eg(e),postfix:null!=(i=null!=(o=n.postfix)?o:e.units)?i:void 0}}function ey(e,t){var n,r;let i=void 0===t?{}:t,o=i.assumeWritable,a=ea(i,["assumeWritable"]);if(null==e)return new S.k(a);let l=ec(e,o),s=ei({nullable:e.nullable,tooltipText:null!=(n=e.description)?n:void 0},a);if("readonly"===l)return em(s);let d=er.resolve(e,s);if(null!=d)return d;switch(l){case"bool":return new W.d(s);case"choice":return new v.o(eo(ei({},s),{items:null!=(r=e.choices)?r:[]}));case"int":case"float":return new q.Q(ei({},s,eb(e,l,s)));case"bigint":return new u.G(s);case"qnum":return new H.C(eo(ei({},s),{format:eg(e)}));case"datetime":return ev(e)?new V.J(eo(ei({},s),{utcDates:!0})):new V.e(s);case"list":return null!=e.choices&&e.choices.length>0?new v.F(eo(ei({},s),{items:e.choices})):new et.Z(s);case"map":return new en.h(s);case"file":return eh(e,s);default:return new S.k(s)}}er.byHint=function(e,t){var n,r,i;let o=e.inputType?es[e.inputType]:void 0;if(o)return o(e,t);let a=null==(i=e.editor)?void 0:i.toLowerCase(),l=a?eu[a]:void 0;return l&&ed[a](null!=(n=e.propertyType)?n:e.type)?l(e,t):a||"description"!==e.name||(null!=(r=e.propertyType)?r:e.type)!=="string"?null:new S.f(t)};class e_ extends R.l{get properties(){return this._fields.map(e=>e.prop)}input(e){var t,n;return null!=(t=null==(n=this._fields.find(t=>t.prop.name===e))?void 0:n.input)?t:void 0}refresh(){this._reread(!1)}reset(){this._reread(!0)}_reread(e){this._refreshing=!0;try{(0,d.vA)(()=>{var t=!0,n=!1,r=void 0;try{for(var i,o=this._fields[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){let t=i.value;if(null===t.input){this._showText(t);continue}let n=this._read(t.prop,t.kind);!e&&null!==t.kind&&null!==t.input.validity.peek()&&e_.same(n,t.synced)||(e?t.input.reset(n):t.input.value=n,t.synced=n)}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}this._synced.value=this._synced.peek()+1})}finally{this._refreshing=!1}}getWidgetStatus(){return eo(ei({},super.getWidgetStatus()),{inputs:this._fields.map(e=>{var t,n,r,i,o,a,l;let s=e.input,u=null!=(t=null==s?void 0:s.validity.peek())?t:void 0;return{name:e.prop.name,caption:null!=(n=null==s?void 0:s.label)?n:e_._caption(e.prop),type:null!=(r=null!=(i=e.prop.propertyType)?i:e.prop.type)?r:"string",semType:null!=(o=e.prop.semType)?o:void 0,value:null!==s?s.peek():this._read(e.prop,"readonly"),choices:null!=(a=e.prop.choices)?a:void 0,required:!1===e.prop.nullable,valid:null==u,error:null!=u?u:void 0,description:null!=(l=e.prop.description)?l:void 0,access:e.access}})})}_addField(e,t){var n,r,i,o,l;let s=this._access.field(e.name);if("readonly"===s){let n=e_.readonlyField(null!=(o=(0,a.Q)(t.label))?o:e_._caption(e),e.name,""),r=n.row,i=n.value,u=null!=(l=(0,a.Q)(t.tooltipText))?l:e.description;u&&(r.title=u),this.addElement(r);let d={prop:e,kind:"readonly",input:null,access:s,text:i,emptyText:t.emptyText};this._showText(d),this._fields.push(d);return}let u=ec(e),d=t.input,c=ea(t,["input"]),p=ei({name:e.name,label:e_._caption(e),tooltipText:null!=(n=e.description)?n:void 0,nullable:e.nullable},c),h=d?null:this.build(()=>er.resolve(e,p)),m=(null!=d?d:h)!=null?null:e_.platformInput(this,e,this.target,this._auto),f=null!=(r=null!=(i=null!=d?d:h)?i:m)?r:this.build(()=>ey(e,p)),g=f===m,v={prop:e,kind:g?null:u,input:f,access:s};if(g||(f.value=v.synced=this._read(e,u),!1===e.nullable&&f.addValidator(e=>(0,B.Im)(e)?B.wg:null)),this.add(f),this._fields.push(v),g){let t=!0;this.effect(()=>{var n;let r=f.value;t?t=!1:this._refreshing||null==(n=this._onChanged)||n.call(this,e.name,r)});return}let b=e.set;"readonly"!==u&&b&&this.effect(()=>{var t;let n=f.value;null!==f.validity.value||e_.same(n,this._read(e,u))||(b(this.target,n),v.synced=this._read(e,u),this._synced.value=this._synced.peek()+1,null==(t=this._onChanged)||t.call(this,e.name,n))})}_showText(e){var t;let n=e_._display(e.prop,this._read(e.prop,null));e.text.textContent=n||(null!=(t=e.emptyText)?t:""),e.text.classList.toggle("u2-form-readonly-empty",""===n&&void 0!==e.emptyText)}static _display(e,t){if(null==t||""===t)return"";let n=eg(e);if("number"==typeof t&&void 0!==n)return n(t);if(ev(e)){let n=e_.coerce("datetime",t);if(null!==n){let t=G.A.utcParts(n),r=t.year,i=t.month,o=t.day;return U.y.date(new Date(Date.UTC(r,i-1,o)),{format:e.format,utcDates:!0})}}return(0,B.Qq)(t)}static readonlyField(e,t,n){let r=(0,_.Ln)("","u2-form-readonly-value");r.dataset.u2Part="readonly-value",r.append(n);let i=(0,_.y4)([(0,_.Ln)(e,"u2-input-label"),r],"u2-form-readonly");return i.dataset.u2="readonly-field",i.dataset.u2Name=t,{row:i,value:r}}static platformInput(e,t,n,r){let i=globalThis.DG;if(!r||null==i||null==t.dart)return null;try{let r=i.InputBase.forProperty(t,n);return null==r?null:e.build(()=>p(r,t.name))}catch(e){return null}}_read(e,t){let n=e.get?e.get(this.target):void 0;return null===t?n:e_.coerce(t,n)}static _select(e,t,n){let r=e;if(t.include){let n=new Map(e.map(e=>[e.name,e]));r=t.include.map(e=>n.get(e)).filter(e=>void 0!==e)}let i=t.exclude;return i&&(r=r.filter(e=>!i.includes(e.name))),r.filter(e=>"hidden"!==n.field(e.name))}static _caption(e){var t,n,r;return null!=(t=null!=(n=null!=(r=e.caption)?r:e.friendlyName)?n:e.name)?t:""}static coerce(e,t){switch(e){case"bool":return!0===t;case"int":case"float":case"qnum":{if("number"==typeof t)return t;let e=null==t||""===t?NaN:Number(t);return isFinite(e)?e:null}case"bigint":var n;return"bigint"==typeof t?t:null==t?null:null!=(n=u.G.parse(String(t)))?n:null;case"choice":return null==t?null:String(t);case"datetime":{if(null==t||""===t)return null;if(t instanceof Date)return t;let e="function"==typeof t.toDate?t.toDate():new Date(t);return isNaN(e.getTime())?null:e}case"list":return Array.isArray(t)?t:null==t||""===t?[]:et.Z.parse(String(t));case"map":return"object"!=typeof t||null===t||Array.isArray(t)?{}:t;case"file":return null!=t?t:null;default:return(0,B.Qq)(t)}}static same(e,t){if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((e,n)=>Object.is(e,t[n]));if(e_._isRecord(e)&&e_._isRecord(t)){let n=Object.keys(e);return n.length===Object.keys(t).length&&n.every(n=>Object.is(e[n],t[n]))}return Object.is(e,t)}static _isRecord(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&!(e instanceof Date)}static isEmpty(e){return(0,B.Im)(e)}constructor(e,t,n){let r=void 0===n?{}:n;super({layout:null!=(l=r.layout)?l:r.condensed?"tall":void 0,labelColumn:r.labelColumn}),this._fields=[],this._refreshing=!1,this._synced=(0,d.vP)(0),this.target=t,this.unwrittenValues=(0,d.EW)(()=>{this._synced.value;let e={};var t=!0,n=!1,r=void 0;try{for(var i,o=this._fields[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){let t=i.value;null!==t.input&&null!==t.kind&&(t.input.unreadable||!e_.same(t.input.value,t.synced))&&(e[t.prop.name]=t.input.value)}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}return e}),this.unwritten=(0,d.EW)(()=>Object.keys(this.unwrittenValues.value).length),this._onChanged=r.onChanged,this._auto="auto"===r.editors,this._access=null!=(s=r.access)?s:M.v.full,this.root.dataset.u2="object-form";var i=!0,o=!1,a=void 0;try{for(var l,s,u,c,p,h=e_._select(e,r,this._access)[Symbol.iterator]();!(i=(p=h.next()).done);i=!0){const e=p.value;this._addField(e,null!=(u=null==(c=r.overrides)?void 0:c[e.name])?u:{})}}catch(e){o=!0,a=e}finally{try{i||null==h.return||h.return()}finally{if(o)throw a}}}}var ew=n(9701);function ex(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function ek(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}let eO=["int","double","num","float"],eA=[{name:"name",type:"string",nullable:!1},{name:"type",type:"string",nullable:!1,choices:["string","int","double","num","bigint","qnum","bool","datetime","list","map","file"],description:'Property data type, such as "int" or "string".'},{name:"friendlyName",type:"string",caption:"Friendly name",description:"Custom field friendly name shown in [PropertyGrid]"},{name:"description",type:"string",editor:"TextArea",description:"Property description"},{name:"nullable",type:"bool",description:"Whether an empty value is allowed. This is used by validators."},{name:"semType",type:"string",caption:"Semantic type",description:"Semantic type"},{name:"inputType",type:"string",caption:"Input type",description:"Property input type"},{name:"editor",type:"string",description:"Custom editor (such as slider or text area)"},{name:"units",type:"string",description:"Units of measurement. See also: [postfix]"},{name:"format",type:"string",description:'Value format, such as "0.00"'},{name:"category",type:"string",description:"Corresponding category on the context panel"}],eS=[{name:"min",type:"double",applicableTo:"numerical",description:"Minimum value. Applicable to numerical properties only"},{name:"max",type:"double",applicableTo:"numerical",description:"Maximum value. Applicable to numerical properties only"},{name:"step",type:"double",applicableTo:"numerical",description:"Step to be used in a slider. Only applies to numerical properties."},{name:"showSlider",type:"bool",applicableTo:"numerical",caption:"Show slider",description:"Whether a slider appears next to the number input. Applies to numerical columns only."},{name:"showPlusMinus",type:"bool",applicableTo:"numerical",caption:"Show plus/minus",description:"Whether a plus/minus clicker appears next to the number input. Applies to numerical columns only."},{name:"choices",type:"list",applicableTo:"string",description:"List of choices. Applicable to string properties only"}],eP=["type","editor","inputType"];class eE extends ew.Ec{setTarget(e){this._record=ex({},e),this.options.value=ex({},this._record),this._rebuilding||(this._rebuilding=!0,queueMicrotask(()=>{this._rebuilding=!1,this.scope.isDisposed||this._render()}))}getItems(e){let t=[this._identityForm,this._typedForm].flatMap(e=>{var t;return null!=(t=null==e?void 0:e.getItems({all:!0}).list)?t:[]}).map((e,t)=>ek(ex({},e),{index:t}));return a.p.itemsState(t,null==e?void 0:e.all)}_render(){var e,t;null==(e=this._typedScope)||e.dispose(),null==(t=this._scope)||t.dispose();let n=new s.HG;this._scope=n,this.root.textContent="",n.build(()=>{this._identityForm=this._form(eA),this.root.append(this._identityForm.root,this._typed),this._renderTyped()})}_renderTyped(){var e,t;null==(t=this._typedScope)||t.dispose();let n=new s.HG;this._typedScope=n,this._typed.textContent="";let r=null!=(e=this._record.type)?e:"",i=eS.filter(e=>eE._applies(e,r));n.build(()=>{this._typedForm=this._form(i),this._typed.append(this._typedForm.root)})}_form(e){let t=(o=e.map(e=>eE._propertyFor(e)),new e_(o,this._record,{layout:this._layout,condensed:this._condensed,onChanged:e=>this._edited(e),overrides:{name:{commitOn:"change"}}}));var n=!0,r=!1,i=void 0;try{for(var o,a,l=e[Symbol.iterator]();!(n=(a=l.next()).done);n=!0){let e=a.value,n=this._validators[e.name];n&&t.input(e.name).addValidator(n)}}catch(e){r=!0,i=e}finally{try{n||null==l.return||l.return()}finally{if(r)throw i}}return t}_edited(e){var t;let n=ex({},this._record);this.options.value=n,null==(t=this._onChanged)||t.call(this,n),eP.includes(e)&&this._renderTyped()}static _applies(e,t){return void 0===e.applicableTo||("numerical"===e.applicableTo?eO.includes(t):e.applicableTo===t)}static _propertyFor(e){let t=e.name;return ek(ex({caption:eE._caption(t)},e),{get:e=>e[t],set:(e,n)=>e[t]=n})}static _caption(e){let t=e.replace(/([A-Z])/g," $1").toLowerCase();return t.charAt(0).toUpperCase()+t.slice(1)}constructor(e,t){var n;let r=void 0===t?{}:t;super(),this._typed=document.createElement("div"),this._record={},this._rebuilding=!1,this._onChanged=r.onChanged,this._layout=r.layout,this._condensed=r.condensed,this._validators=null!=(n=r.validators)?n:{},this._record=ex({},e),this.options=(0,d.vP)(ex({},this._record)),this.root.classList.add("u2-property-editor"),this.root.dataset.u2="property-editor",this._typed.className="u2-property-editor-typed",this.own(()=>{var e,t;null==(e=this._typedScope)||e.dispose(),null==(t=this._scope)||t.dispose()}),this._render()}}n(2939);var eC=n(348);function ej(e,t){let n=document.createElement("div");return n.className=e,void 0!==t&&(n.textContent=t),n}n(4977);class eT{handlerFor(e){return void 0===this._handler&&(this._handler=o.ObjectHandler.forEntity(e)),this._handler}caption(e){try{let t=this.handlerFor(e);return t?t.getCaption(e):String(e)}catch(t){return String(e)}}icon(e){return this._render(e,t=>t.renderIcon(e))}listItem(e){return this._render(e,t=>t.renderListItem(e))}markup(e){return this._render(e,t=>t.renderMarkup(e))}tooltip(e){return this._render(e,t=>t.renderTooltip(e))}card(e){return this._render(e,t=>t.renderCard(e))}_render(e,t){try{let n=this.handlerFor(e);if(n)return t(n)}catch(e){}let n=document.createElement("span");return n.textContent=this.caption(e),n}}function eN(){return new eT}function eI(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}function eD(e){var t;let n=void 0===e?{}:e,r=n.accept,i=new Set,o=e=>i.has(e.friendlyName)?`${e.friendlyName} (${e.id.slice(0,8)})`:e.friendlyName,a=new b.o({source:e=>{var t;return(t=function*(){let t=""===e?[]:yield g.dapi.groups.getGroupsLookup(e),n=void 0===r?t:t.filter(r);i.clear();let o=new Set;var a=!0,l=!1,s=void 0;try{for(var u,d=n[Symbol.iterator]();!(a=(u=d.next()).done);a=!0){let e=u.value;o.has(e.friendlyName)&&i.add(e.friendlyName),o.add(e.friendlyName)}}catch(e){l=!0,s=e}finally{try{a||null==d.return||d.return()}finally{if(l)throw s}}return n},function(){var e=this,n=arguments;return new Promise(function(r,i){var o=t.apply(e,n);function a(e){eI(o,r,i,a,l,"next",e)}function l(e){eI(o,r,i,a,l,"throw",e)}a(void 0)})})()},itemText:e=>e.friendlyName,keyOf:e=>e.id,render:e=>{var t,n;let r,i,a,l;return t=e,n=o(e),(r=document.createElement("div")).className="u2-typeahead-user",(i=document.createElement("div")).className="u2-typeahead-user-text",a=t.personal?"user":"group",(l=eL("u2-typeahead-user-name",t.friendlyName)).dataset.u2Part="item-label",i.append(l,eL("u2-typeahead-user-secondary",n===t.friendlyName?a:`${a} \xb7 ${t.id.slice(0,8)}`)),r.append(e$(t),i),r},placeholder:null!=(t=n.placeholder)?t:"Group or user…",minChars:1}),l=n.onPick;return void 0!==l&&a.effect(()=>{let e=a.selected.value;null!==e&&(l(e,o(e)),a.selected.value=null)}),a}function e$(e){if(e.personal){let r,i;var t,n=e.user;let o=n.picture;if(o instanceof HTMLElement){let e=ej("u2-avatar u2-avatar-picture");return e.append(o),e}return ej(`u2-avatar u2-avatar-${function(e){let t=0;for(let n=0;n<e.length;n++)t=(31*t+e.charCodeAt(n))%9973;return t%6+1}(n.login)}`,(i=(r=(t=n.friendlyName).includes("@")?t.substring(0,t.indexOf("@")):t).match(/[A-Z]/g))?i.slice(0,2).join(""):r.substring(0,2).toUpperCase())}let r=eL("u2-avatar u2-avatar-group","");return r.append((0,w.K)("user-friends")),r}function eL(e,t){let n=document.createElement("div");return n.className=e,n.textContent=t,n}ew.Ec,ew.Ec;var ez=n(9571);let eF=new Set(["int","float","double","num","qnum","bigint","bool","string","datetime","dynamic"]);function eB(e){let t=e.outputs;return 1===t.length&&eF.has(t[0].propertyType)}function eM(e){var t,n;let r,i,o=e.nqName,a=e.friendlyName||e.name,l=null!=(t=e.description)?t:"",s=(null!=(n=e.tags)?n:[]).map(e=>e.toLowerCase()),u=e.options.role,d=u?[...s,...u.split(",").map(e=>e.trim().toLowerCase()).filter(e=>""!==e)]:s;return{name:o,label:a,tags:s,roles:d,description:l,signature:(r=e.inputs.map(e=>e.name).join(", "),i=e.outputs.map(e=>e.propertyType).join(", "),`(${r}) : ${""===i?"void":i}`),search:`${o} ${a} ${l}`.toLowerCase(),data:e}}function eR(e){try{var t;let n=o.ObjectHandler.forEntity(e),r=n?n.renderIcon(e):null;return null!==r&&""===(null!=(t=r.textContent)?t:"").trim()?r:null}catch(e){return null}}var eq=n(5445);class eH extends ew.Ec{refresh(){this._pager.reset()}call(e){return this._pager.items.peek().find(t=>t.id===e)}bindStep(e){if("functionName"===e)return this.functionName;if("selected"===e)return null!=this._selectedId||(this._selectedId=(0,d.EW)(()=>{var e,t;return null!=(e=null==(t=this.selected.value)?void 0:t.id)?e:null})),this._selectedId;return super.bindStep(e)}bindProps(){let e=super.bindProps();return e.some(e=>"functionName"===e.name)||e.push({name:"functionName",type:"string",writable:!0}),e.push({name:"selected",type:"string",writable:!1}),e}static popup(e,t,n,r){let i=new s.HG,o=e=>{void 0!==e&&(i.dispose(),r(e))};return i.build(()=>{var r,a;let l=new eH((r=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({setCurrentObject:!1},n),a=a={onActivate:o},Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(a)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(a)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(a,e))}),r)),s=(0,_.y4)([l.root],t);s.addEventListener("click",e=>{var t,n;let r=null==(n=e.target)||null==(t=n.closest("[data-u2-funccall]"))?void 0:t.getAttribute("data-u2-funccall");r&&o(l.call(r))}),s.addEventListener(O.B,()=>i.dispose()),O.h.show(e,s,{owner:i})}),i}_fetchPage(e,t){var n;let r=this.functionName.peek();if(""===r)return Promise.resolve([]);let i=(0,eC.Pj)(null!=(n=r.split(":").pop())?n:r);return g.dapi.functions.calls.allPackageVersions().filter(`func.name="${i}"`).include("session.user,func.package,func.params,inputs,options").order("started",!0).list({pageSize:t,pageNumber:e})}_live(e,t){var n;if(!(e instanceof d.HN))return(0,d.vP)(null!=e?e:t);let r=(0,d.vP)(null!=(n=e.peek())?n:t);return this.effect(()=>{let t=e.value;void 0!==t&&(r.value=t)}),r}_activate(e){var t,n;void 0!==e&&(null==(t=(n=this.options).onActivate)||t.call(n,e),this.fireEvent("activate",e))}_renderRow(e,t){t.setAttribute("data-u2-funccall",e.id),t.setAttribute("aria-label",this._renderer.caption(e));let n=this.options.render;return n?n(e,t):(0,_.y4)([this._renderer.listItem(e)],"u2-fch-row")}constructor(e){var t,n;let r=void 0===e?{}:e;super(),this._renderer=eN(),this._selected=(0,d.vP)(null),this._lastItems=[],this._scrollPending=!1,this.options=r,this.root.classList.add("u2-fch"),this.root.dataset.u2="func-call-history-browser",this.functionName=this._live(r.functionName,"");const i=null!=(t=r.pageSize)?t:20;this._pager=new eq.e({pageSize:i,fetchPage:e=>this._fetchPage(e,i)}),this.own(()=>this._pager.dispose());const o=null!=(n=r.itemHeight)?n:36;this._list=this.build(()=>new A.wj({itemHeight:o,keyOf:e=>e.id,render:(e,t,n)=>this._renderRow(e,n)})),this._list.root.setAttribute("data-u2","fch-list"),this._list.setItems(this._pager.items);const a=()=>{let e=this._list.root;e.scrollTop+e.clientHeight>e.scrollHeight-5*o&&this._pager.loadMore()};this._list.root.addEventListener("scroll",a),this.own(()=>this._list.root.removeEventListener("scroll",a));const l=(0,_.Ln)("","u2-fch-empty-message"),s=this.build(()=>(0,_.x6)("Retry",()=>this._pager.loadMore()));s.dataset.u2="fch-retry";const u=(0,_.yP)([l,s],"u2-async-empty u2-fch-state");u.dataset.u2="fch-state",this.root.append((0,_.yP)([this._list,u],"u2-fch-main")),this.effect(()=>{let e=this._pager.state.value,t=0===this._pager.items.value.length,n=this.functionName.value;s.hidden="error"!==e,l.textContent="error"===e?"Could not load the runs.":t&&"loading"===e?"Loading runs…":t&&""===n?"Pick a function to see its runs.":t&&"done"===e?"No saved runs.":"",u.hidden=!(t||"error"===e),this._list.root.hidden=t}),this.selected=this._selected,this.effect(()=>{var e,t,n,r;let i=this._pager.items.value,o=this._list.selectedIndex.value,a=null!=(e=i[o])?e:null,l=null!=(t=null==a?void 0:a.id)?t:null,s=null!=(n=null==(r=this._selected.peek())?void 0:r.id)?n:null,u=i!==this._lastItems;if(this._lastItems=i,u&&l!==s){if(null!==s&&i.some(e=>e.id===s)){this._scrollPending=!0;return}this._selected.value=null,this._scrollPending=!1;return}this._selected.value=a,(u||this._scrollPending)&&o>=0&&this._list.scrollToIndex(o),this._scrollPending=!1}),this.effect(()=>{this.functionName.value,this._pager.reset()});let c=!0;this.effect(()=>{var e,t;let n=this.selected.value;if(c){c=!1;return}null!==n&&!1!==this.options.setCurrentObject&&(g.shell.o=n),null==(e=(t=this.options).onChanged)||e.call(t,n),this.fireEvent("change",n)}),this.scope.listen(this._list.root,"dblclick",e=>{let t=e.target,n=null==t?void 0:t.closest(".u2-list-row");n&&this._activate(this._pager.items.peek()[Number(n.dataset.index)])}),this.scope.listen(this._list.root,"keydown",e=>{var t;"Enter"===e.key&&this._activate(null!=(t=this.selected.peek())?t:void 0)})}}var eW=n(7389);function eV(e,t){let n=void 0===t?{}:t,r=n.name,i=n.value,o=function(e,t){if(null==e)return{};var n,r,i,o={};if("u">typeof Reflect&&Reflect.ownKeys){for(i=0,n=Reflect.ownKeys(Object(e));i<n.length;i++)r=n[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r]);return o}if(o=function(e,t){if(null==e)return{};var n,r,i={},o=Object.getOwnPropertyNames(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n]);return i}(e,t),Object.getOwnPropertySymbols)for(i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)r=n[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r]);return o}(n,["name","value"]);return p(eW.input.molecule(e,{value:null!=i?i:""}),r,o)}function eG(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}er.register({match:e=>"Molecule"===e.semType,create:(e,t)=>{var n;return eV(t.inline?"":null!=(n=(0,a.Q)(t.label))?n:e.name,{name:t.name,value:t.value,onChanged:t.onChanged,nullable:t.nullable,required:t.required})}});class eU extends a.p{getState(){var e,t;return e=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},super.getState()),t=t={open:void 0!==this._popup,placeholder:this._prompt},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}displayText(){var e;return""===this.peek()?"":null!=(e=this._name.textContent)?e:""}get _prompt(){var e;return null!=(e=this.options.placeholder)?e:"Pick a function…"}createEditor(){let e=(0,_.Ln)("","u2-function-input-icon"),t=this._name=(0,_.Ln)("","u2-function-input-name"),n=this._control=(0,_.y4)([e,t],"u2-function-input");n.tabIndex=0;for(let e=0,t=[["role","button"],["aria-haspopup","listbox"],["aria-expanded","false"]];e<t.length;e++){var r;let i=function(e){if(Array.isArray(e))return e}(r=t[e])||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var i=[],o=!0,a=!1;try{for(r=r.call(e);!(o=(t=r.next()).done)&&(i.push(t.value),2!==i.length);o=!0);}catch(e){a=!0,n=e}finally{try{o||null==r.return||r.return()}finally{if(a)throw n}}return i}}(r)||function(e){if(e){if("string"==typeof e)return eG(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return eG(e,2)}}(r)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),o=i[0],a=i[1];n.setAttribute(o,a)}return this.effect(()=>{let n=this.value,r=""===n?void 0:o.Func.find({}).find(e=>e.nqName===n),i=r?eR(r):null;e.replaceChildren(...i?[i]:[]),e.hidden=null===i,t.textContent=""===n?this._prompt:(null==r?void 0:r.friendlyName)||n,t.classList.toggle("u2-function-input-empty",""===n),t.title=n}),this.scope.listen(n,"click",()=>this._toggle()),this.scope.listen(n,"keydown",e=>{let t=e.key;if(("Backspace"===t||"Delete"===t)&&this.nullable)this.value="";else{if("Enter"!==t&&" "!==t)return;this._toggle()}e.preventDefault()}),this.own(()=>this._close()),n}_toggle(){if(null!==this.disabled)return;if(this._popup)return this._close();let e=this._popup=new s.HG;e.build(()=>{var t,n,r,i;let a,l,s,u,d,c,p,h=e=>{this.value=e,this._close()},m=(a={showTags:!1,showRunButton:!1,showSignature:!0,setCurrentObject:!1,filter:this.options.filter,scalarOnly:this.options.scalarOnly,ignorePackages:this.options.ignorePackages,onActivate:e=>h(e.name)},l=o.Func.find({}),(s=a.filter)&&(l=l.filter(s)),(u=null!=(n=a.ignorePackages)?n:[]).length>0&&(l=l.filter(e=>!u.some(t=>e.nqName.startsWith(`${t}:`)))),a.scalarOnly&&(l=l.filter(eB)),d=l.map(eM),c=new Intl.Collator("en",{ignorePunctuation:!0,numeric:!0}),d.sort((e,t)=>c.compare(e.label,t.label)),p=a.onChanged,new ez.GH((r=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},a),i=i={items:d,roles:o.functionRoles.map(e=>({role:e.role,description:e.description})),runAction:e=>e.data.prepare().edit(),icon:e=>eR(e.data),onChanged:e=>{null!==e&&!1!==a.setCurrentObject&&(g.shell.o=e.data),null==p||p(e)}},Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(i)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(i,e))}),r))),f=(0,_.y4)([m.root],"u2-function-input-popup");e.listen(f,"click",e=>{var t,n;let r=null==(n=e.target)||null==(t=n.closest("[data-u2-func]"))?void 0:t.getAttribute("data-u2-func");r&&h(r)}),e.listen(f,O.B,()=>this._close()),O.h.show(this._control,f,{owner:e}),this._control.setAttribute("aria-expanded","true"),null==(t=m.root.querySelector("input"))||t.focus()})}_close(){var e;null==(e=this._popup)||e.dispose(),this._popup=void 0,this._control.setAttribute("aria-expanded","false")}constructor(e){super(void 0===e?{}:e,""),this.root.dataset.u2="function-input"}}function eK(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function eY(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function eQ(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}er.register({match:e=>"FunctionName"===e.semType,create:(e,t)=>new eU(t)});class eJ extends a.p{getState(){return eQ(eY({},super.getState()),{open:void 0!==this._popup})}createEditor(){this._picked=(0,d.vP)(void 0),this._resolveGen=0;let e=(0,_.Ln)("","u2-func-call-input-name"),t=this._control=(0,_.y4)([e],"u2-func-call-input");t.tabIndex=0;for(let e=0,r=[["role","button"],["aria-haspopup","listbox"],["aria-expanded","false"]];e<r.length;e++){var n;let i=function(e){if(Array.isArray(e))return e}(n=r[e])||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var i=[],o=!0,a=!1;try{for(r=r.call(e);!(o=(t=r.next()).done)&&(i.push(t.value),2!==i.length);o=!0);}catch(e){a=!0,n=e}finally{try{o||null==r.return||r.return()}finally{if(a)throw n}}return i}}(n)||function(e){if(e){if("string"==typeof e)return eK(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return eK(e,2)}}(n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),o=i[0],a=i[1];t.setAttribute(o,a)}return this.effect(()=>{var t,n,r,i;let o,a,l=this.value,s=this._picked.value;""!==l&&(null==s?void 0:s.id)!==l&&this._resolve(l),e.textContent=""===l?null!=(t=this.options.placeholder)?t:"Pick a run…":(null==s?void 0:s.id)===l?(o=(null==(n=s.func)?void 0:n.friendlyName)||(null==(r=s.func)?void 0:r.name)||"Function call",""===(a=(null==(i=s.started)?void 0:i.isValid())?s.started.format("MMM D, YYYY HH:mm"):"")?o:`${o} — ${a}`):l,e.classList.toggle("u2-func-call-input-empty",""===l),e.title=l}),t.addEventListener("click",()=>this._toggle()),t.addEventListener("keydown",e=>{if(("Backspace"===e.key||"Delete"===e.key)&&this.nullable)this.value="";else{if("Enter"!==e.key&&" "!==e.key)return;this._toggle()}e.preventDefault()}),this.own(()=>this._close()),t}_toggle(){if(null===this.disabled){if(this._popup)return this._close();(this._popup=eH.popup(this._control,"u2-func-call-input-popup",{functionName:this.functionName},e=>{this._picked.value=e,this.value=e.id})).own(()=>{this._popup=void 0,this._control.setAttribute("aria-expanded","false")}),this._control.setAttribute("aria-expanded","true")}}_close(){var e;null==(e=this._popup)||e.dispose()}_resolve(e){let t=++this._resolveGen;g.dapi.functions.calls.allPackageVersions().include("func.package,func.params,inputs").find(e).then(n=>{null!=n&&t===this._resolveGen&&this.peek()===e&&(this._picked.value=n)}).catch(()=>{})}_followName(e){var t;let n=(0,d.vP)(null!=(t=e.peek())?t:"");return this.effect(()=>{let t=e.value;void 0!==t&&(n.value=t)}),n}constructor(e){let t=void 0===e?{}:e;super(t,""),this.root.dataset.u2="func-call-input";const n=t.functionName;this.functionName=n instanceof d.HN?this._followName(n):(0,d.vP)(null!=n?n:"")}}er.register({match:e=>"FuncCall"===e.semType,create:(e,t)=>{var n,r;return new eJ(eQ(eY({},t),{functionName:null!=(n=null==(r=e.options)?void 0:r.funcName)?n:""}))}}),n(5539);var eZ=n(6090);function eX(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}function e0(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){eX(o,r,i,a,l,"next",e)}function l(e){eX(o,r,i,a,l,"throw",e)}a(void 0)})}}function e2(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function e1(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}class e4 extends a.p{static qualify(e,t){if(""===e)return null;let n=e.endsWith("/")?e.substring(0,e.lastIndexOf("/")):e;return void 0===t||n.startsWith(t)||(n=`${t}${n.startsWith("/")?n:`/${n}`}`),n}getState(){return e1(e2({},super.getState()),{busy:this._busy.peek()})}createEditor(){var e;this._turn=0,this._queried=0,this._echo=!1,this._text=(0,d.vP)(""),this._busy=(0,d.vP)(!1),this.effect(()=>{this._busy.value?this.root.setAttribute("aria-busy","true"):this.root.removeAttribute("aria-busy")}),this._problem=(0,d.vP)(null),this._source=new eZ._(e=>this._resolve(e),{debounceMs:250}),this.own(()=>this._source.dispose()),this.own(()=>this._turn++);let t=document.createElement("input");this._field=t,t.type="text",t.autocomplete="off",t.className="u2-file-path",t.placeholder=null!=(e=this.options.placeholder)?e:"",this.effect(()=>this._show(this.value)),this.scope.listen(t,"input",()=>this._query(t.value));let n=document.createElement("div");n.className="u2-file",n.append(t);let r=this.options.connection;return void 0===r&&"folder"!==this.options.mode&&this._addPicker(n),"function"==typeof eW.pickFileFromFiles&&this.addOptions((0,y.gb)("folder-tree",()=>this._pickFromFiles().catch(e=>g.shell.error(String(e))),{tooltip:void 0===r?"Add file from Files":"Choose directory or file"}),{edits:!0}),this.own(e8(n,e=>this._drop(e))),this.effect(()=>this._onState(this._source.state.value)),this.addValidator(()=>this._check()),n}get _noun(){return"folder"===this.options.mode?"Folder":"File"}isEmptyValue(){return""===this._text.value}get emptyMessage(){return"Can't be empty."}_check(){let e=this._text.value;return""===e?null:this._busy.value?`${this._noun} ${e} is loading.`:this._problem.value}_onState(e){if("idle"===e.kind)return;if("loading"===e.kind){this._busy.value=!0;return}if(this._queried!==this._turn)return;if(this._busy.value=!1,"error"===e.kind){this._problem.value=e.message;return}if("empty"===e.kind){this._problem.value=`${this._noun} does not exist.`;return}this._problem.value=null;let t=e.items[0];null!==t&&this._publish(t)}_show(e){var t;let n=null===e?"":void 0!==this.options.connection?e.path?e.path:"/":null!=(t=e.fullPath)?t:e.fileName;this._field.value=n,this._text.value=n,this._echo||(this._turn++,this._busy.value=!1,this._problem.value=null)}_publish(e){this._echo=!0;try{this.value=e}finally{this._echo=!1}}_resolve(e){return e0(function*(){var t;let n=e4.qualify(e,null==(t=this.options.connection)?void 0:t.nqName);if(null===n||!(yield g.dapi.files.exists(n)))return[];let r=yield this._find(n);return null===r?this._isConnectionRoot(n)?[null]:[]:this._fits(r)?[r]:[]}).call(this)}_fits(e){var t;let n=null!=(t=this.options.mode)?t:"file";return!("file"===n&&!e.isFile||"folder"===n&&!e.isDirectory)}_query(e){this._queried=++this._turn,this._field.value!==e&&(this._field.value=e),this._text.value=e,""===e?this.value=null:this._source.query(e)}_pickFromFiles(){return e0(function*(){var e;let t=this.options.connection,n=null!=(e=this.options.mode)?e:"file",r=yield eW.pickFileFromFiles({connection:t,mode:"any"===n?"all":n});null==r||this.scope.isDisposed||(this._fits(r)?this.value=r:this._query(void 0===t?r.fullPath:r.path||"/"))}).call(this)}_isConnectionRoot(e){var t;let n=null==(t=this.options.connection)?void 0:t.nqName;return void 0!==n&&e.length===n.length+1}_find(e){return e0(function*(){var t,n;let r=e.lastIndexOf("/"),i=e.lastIndexOf("."),o=(null!=(t=this.options.mode)?t:"file")==="file"&&i>r?e.substring(i+1):null;return null!=(n=(yield g.dapi.files.list(r<0?"":e.substring(0,r+1),!1,o)).find(t=>t.fullPath===e))?n:null}).call(this)}_addPicker(e){let t=document.createElement("input");t.type="file",t.hidden=!0,this.scope.listen(t,"change",()=>{var e;let n=null==(e=t.files)?void 0:e[0];n&&this._accept(n)}),e.append(t),this.addOptions((0,y.gb)("folder-open",()=>t.click(),{tooltip:"Open file"}),{edits:!0})}_drop(e){e.length>1?g.shell.error("Multiple files are not supported."):this._accept(e[0])}_accept(e){return e0(function*(){let t=++this._turn;this._busy.value=!0,this._field.value=e.name,this._text.value=e.name;try{let n=new Uint8Array((yield e.arrayBuffer()));if(t!==this._turn)return;this._problem.value=null,this._publish(o.FileInfo.fromBytes(e.name,n))}catch(n){t===this._turn&&(this._problem.value=`${this._noun} ${e.name} could not be read.`)}finally{t===this._turn&&(this._busy.value=!1)}}).call(this)}constructor(e){super(void 0===e?{}:e,null),this.root.dataset.u2="file-input"}}function e3(e,t){return new e4(e1(e2({},void 0===t?{}:t),{label:e}))}function e8(e,t){let n=(t,n)=>{t.preventDefault(),t.stopPropagation(),e.classList.toggle("u2-file-dropping",n)},r={dragenter:e=>n(e,!0),dragover:e=>n(e,!0),dragleave:e=>n(e,!1),drop:e=>{var r;n(e,!1);let i=null==(r=e.dataTransfer)?void 0:r.files;i&&i.length>0&&t(i)}};for(let t in r)e.addEventListener(t,r[t]);return()=>{for(let t in r)e.removeEventListener(t,r[t])}}var e6=n(1831),e5=n(7373);function e9(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}function e7(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){e9(o,r,i,a,l,"next",e)}function l(e){e9(o,r,i,a,l,"throw",e)}a(void 0)})}}class te{get(e){var t;return null!=(t=this._byId.get(e))?t:null}path(e){let t=[];for(let n=this.get(e.id);null!==n;n=n.parent)t.unshift(n.project.friendlyName);return t.length>0?t:[e.friendlyName]}under(e){let t=this.get(e),n=[],r=e=>{n.push(e);var t=!0,i=!1,o=void 0;try{for(var a,l=e.children[Symbol.iterator]();!(t=(a=l.next()).done);t=!0){let e=a.value;r(e)}}catch(e){i=!0,o=e}finally{try{t||null==l.return||l.return()}finally{if(i)throw o}}};return null!==t&&r(t),n}add(e,t){let n=null===t?null:this.get(t.id),r={project:e,parent:n,children:[],readOnly:null},i=null===n?this.roots:n.children,o=i.findIndex(t=>e5.d.compare(t.project.friendlyName,e.friendlyName)>0);return i.splice(o<0?i.length:o,0,r),this._byId.set(e.id,r),r}all(){return this.roots.flatMap(e=>this.under(e.project.id))}static load(){return e7(function*(){var e,t;let n=null==(t=g.shell.user)||null==(e=t.project)?void 0:e.id,r=yield te._entries((yield g.dapi.spaces.list()).filter(e=>e.id!==n),null),i=r;for(;i.length>0;)i=(yield Promise.all(i.map(e=>e7(function*(){let t=(yield g.dapi.spaces.id(e.project.id).children.ofTypes("Project").list()).filter(e=>e instanceof o.Project&&e.isSpace);return e.children=yield te._entries(t,e),e.children})()))).flat();return new te(r)})()}static _entries(e,t){return e7(function*(){let n=yield Promise.all(e.map(e=>g.dapi.permissions.check(e,"Edit").catch(()=>!1)));return e.map((e,r)=>({project:e,parent:t,children:[],readOnly:n[r]?null:"You can view this space but not save to it"})).sort((e,t)=>e5.d.compare(e.project.friendlyName,t.project.friendlyName))})()}constructor(e){this._byId=new Map,this.roots=e;const t=e=>{var n=!0,r=!1,i=void 0;try{for(var o,a=e[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){let e=o.value;this._byId.set(e.project.id,e),t(e.children)}}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}};t(e)}}function tt(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}function tn(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){tt(o,r,i,a,l,"next",e)}function l(e){tt(o,r,i,a,l,"throw",e)}a(void 0)})}}let tr="New space";class ti extends a.p{get tree(){return this._tree}load(){var e;return null!=this._read||(this._read=(null!=(e=this.options.load)?e:te.load)().then(e=>(this.scope.isDisposed||(this._tree.value=e),e))),this._read}static describe(e,t){return null===e?"":null===t?e.friendlyName:t.path(e).join(" / ")}createEditor(){this._tree=(0,d.vP)(null),this._read=null,this._close=null;let e=(0,_.Ln)("","u2-space-text"),t=(0,w.K)("times",{cls:"u2-space-clear"});t.title="Clear";let n=(0,_.y4)([(0,w.K)("brackets-curly",{cls:"u2-space-icon"}),e,t,(0,w.K)("chevron-down",{cls:"u2-space-caret"})],"u2-space-box");return n.tabIndex=0,n.setAttribute("role","combobox"),n.setAttribute("aria-haspopup","tree"),this._box=n,this.scope.listen(n,"click",e=>{e.target.closest(".u2-space-clear")?this.value=null:null===this._close?this.open():this._close()}),this.scope.listen(n,"keydown",e=>{let t=e.key;("Enter"===t||"ArrowDown"===t||" "===t)&&(e.preventDefault(),this.open())}),this.effect(()=>{var r;let i=ti.describe(this.value,this.tree.value);e.textContent=""===i?null!=(r=this.options.placeholder)?r:"Not in a space":i,n.classList.toggle("u2-space-empty",""===i),t.hidden=""===i||!this.nullable}),n}open(){if(null!==this._close||this.disabled)return;let e=this.scope.child("space-popup"),t=e.build(()=>this._popup());(0,_.on)(t,O.B,()=>{this._close=null,this._box.classList.remove("u2-space-open"),this._box.setAttribute("aria-expanded","false"),e.dispose()}),this._box.classList.add("u2-space-open"),this._box.setAttribute("aria-expanded","true"),this._close=O.h.show(this._box,t,{owner:this.scope,maxHeight:420}),queueMicrotask(()=>{var e;return null==(e=t.querySelector(".u2-space-search input"))?void 0:e.focus()})}_pick(e){var t;this.value=e,null==(t=this._close)||t.call(this)}_popup(){var e;let t=(0,d.vP)(""),n=new S.k({inline:!0,search:!0,placeholder:"Search spaces",bind:t});n.root.classList.add("u2-space-search");let r=null,i=null,o=(0,_.y4)([],"u2-space-failed"),a=new e6.U({itemHeight:24,render:e=>{var t,n;let r=null!=(t=null==(n=e.data)?void 0:n.entry)?t:null,i=[(0,w.K)(null===r?"plus":"brackets-curly",{cls:"u2-space-node-icon"}),(0,_.Ln)(e.label)];if(null!==r&&null===r.readOnly&&!1!==this.options.allowNew){let e=(0,y.gb)("plus",()=>x(r.project).catch(()=>{}),{tooltip:`New space inside ${r.project.friendlyName}`});e.classList.add("u2-space-add"),i.push(e)}return(0,_._Q)(i,"u2-space-node")},onRename:(e,t)=>{null!==r&&e.id===r.id&&l(t.trim())}}),l=e=>{let t=this.tree.peek();if(null===r||null===t)return;let n=r.parent;if(r=null,null===e||""===e)return void f(t);let l=this.value;i=(null===n?g.dapi.spaces.createRootSpace(e):g.dapi.spaces.id(n.id).addSubspace(e)).then(e=>tn(function*(){let r=t.add(e,n);if(this.value===l&&(this.value=e),a.scope.isDisposed)return;f(t);let i=[];for(let e=r;null!==e;e=e.parent)i.unshift(e.project.id);yield a.expandPath(i)}).call(this)).catch(n=>{var r;o.textContent=`Could not create "${e}": ${null!=(r=null==n?void 0:n.message)?r:n}`,a.scope.isDisposed||f(t)}).finally(()=>i=null)};a.scope.listen(a.root,"keydown",e=>{let t=e.target.closest(".u2-tree-rename");null!==t&&"Enter"===e.key&&[tr,""].includes(t.value.trim())&&l(tr)},{capture:!0}),a.scope.listen(a.root,"blur",e=>{var t;let n=e.target.closest(".u2-tree-rename")?null==(t=a.nodeForRow(e.target))?void 0:t.id:void 0;void 0!==n&&queueMicrotask(()=>(null==r?void 0:r.id)===n&&l(null))},{capture:!0}),a.root.classList.add("u2-space-tree");let s=(0,_.y4)([],"u2-space-recents"),u=(0,_.y4)([(0,_.Ln)("Recent")],"u2-space-head"),c=e=>{let t=this.options.root;for(let n=e;null!==n;n=n.parent)if(void 0===t||n.project.id===t.id)return!0;return!1},p=(e,t,n)=>n.path(e.project).join(" / ").toLowerCase().includes(t),h=(e,t,n)=>{var i;let o=e.children.map(e=>h(e,t,n)).filter(e=>null!==e);return(null!==r&&(null==(i=r.parent)?void 0:i.id)===e.project.id&&o.push(m()),""===t||p(e,t,n)||0!==o.length)?{id:e.project.id,label:e.project.friendlyName,data:{entry:e},disabled:e.readOnly,children:o.length>0?o:void 0}:null},m=()=>({id:r.id,label:tr,data:{entry:null}}),f=e=>{let n=t.value.trim().toLowerCase(),i=(void 0===this.options.root?e.roots:[e.get(this.options.root.id)].filter(e=>null!==e)).map(t=>h(t,n,e)).filter(e=>null!==e);null!==r&&null===r.parent&&i.push(m()),a.setRoots(i);let o=new Set(a.expanded.peek());if(""!==n){var l=!0,d=!1,p=void 0;try{for(var f,v=e.all()[Symbol.iterator]();!(l=(f=v.next()).done);l=!0){let e=f.value;o.add(e.project.id)}}catch(e){d=!0,p=e}finally{try{l||null==v.return||v.return()}finally{if(d)throw p}}}let b=this.value;for(let t=null===b?null:e.get(b.id);null!==t;t=t.parent)o.add(t.project.id);(null==r?void 0:r.parent)&&o.add(r.parent.id),a.expanded.value=o;let y=(function(){try{var e;let t=JSON.parse(null!=(e=g.userSettings.getValue("u2-spaces","recent"))?e:"[]");return Array.isArray(t)?t.filter(e=>"string"==typeof e):[]}catch(e){return[]}})().map(t=>e.get(t)).filter(e=>null!==e&&null===e.readOnly&&c(e));s.replaceChildren(...y.map(t=>(0,_.on)((0,_._Q)([(0,w.K)("history",{cls:"u2-space-node-icon"}),(0,_.Ln)(t.project.friendlyName),(0,_.Ln)(e.path(t.project).slice(0,-1).join(" / "),"u2-space-dim")],"u2-space-recent"),"click",()=>this._pick(t.project)))),s.hidden=u.hidden=""!==n||0===y.length};a.effect(()=>{let e=this.tree.value;t.value,null!==e&&f(e)});let v=e=>{var t;null===r&&null!==e&&!e.disabled&&(null==(t=e.data)?void 0:t.entry)&&this._pick(e.data.entry.project)};(0,_.on)(a.root,"click",e=>{let t=e.target;t.closest(".u2-tree-twistie, .u2-tree-rename, .u2-space-add")||v(a.nodeForRow(t))}),(0,_.on)(a.root,"keydown",e=>{"Enter"!==e.key||e.target.closest(".u2-tree-rename")||v(a.selectedNode.peek())}),(0,_.on)(n.root,"keydown",e=>{if("ArrowDown"!==e.key)return;e.preventDefault();let n=t.peek().trim().toLowerCase(),r=this.tree.peek(),i=""===n||null===r?void 0:r.all().find(e=>null===e.readOnly&&c(e)&&p(e,n,r)),o=[];for(let e=null!=i?i:null;null!==e;e=e.parent)o.unshift(e.project.id);(o.length>0?a.expandPath(o):Promise.resolve()).then(()=>a.focusRows())});let b=(0,_.y4)([(0,_.Ln)("Loading spaces…")],"u2-space-status");a.effect(()=>b.hidden=null!==this.tree.value),this.load().catch(e=>{var t;return b.textContent=`Could not read the spaces: ${null!=(t=null==e?void 0:e.message)?t:e}`});let x=e=>tn(function*(){let n=yield this.load();yield i,a.root.isConnected&&null===r&&(r={id:`new:${Date.now()}`,parent:e},o.textContent="",t.value="",f(n),yield a.rename(r.id))}).call(this),k=null!=(e=this.options.root)?e:null,O=(0,_._Q)([(0,_.Ln)(null===k?"Spaces":k.friendlyName)],"u2-space-head");return!1!==this.options.allowNew&&O.append((0,y.gb)("plus",()=>x(k).catch(()=>{}),{tooltip:null===k?"New top-level space":`New space inside ${k.friendlyName}`})),(0,_.y4)([n.root,u,s,O,b,o,a.root],"u2-space-popup")}constructor(e){let t=void 0===e?{}:e;super(t,null),this.root.dataset.u2="space-input",t.value&&this.load().catch(()=>{})}}var to=n(8848);ew.Ec,n(4291),n(5315);var ta=n(8797);function tl(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}function ts(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){tl(o,r,i,a,l,"next",e)}function l(e){tl(o,r,i,a,l,"throw",e)}a(void 0)})}}class tu extends a.p{add(e){let t=[...this._items.peek()];for(let n=0;n<e.length;n++){let r=e[n];if(!this._accepts(r.name)){g.shell.warning(`${r.name} is not ${this.options.accept.join(" or ")}.`);continue}let i=t.findIndex(e=>e.key===r.name);i>=0&&this._drop(t[i],t,i);let o=this._item(r.name);t.push(o),this._load(r,o)}this._items.value=t}createEditor(){this._echo=!1,this._items=(0,d.vP)([]),this._progress=new ta.z({showPercent:!0}),this._progress.root.hidden=!0,this._summary=document.createElement("span"),this._summary.className="u2-files-summary",this._summary.hidden=!0,this._list=document.createElement("div"),this._list.className="u2-files-list";let e=document.createElement("div");return e.className="u2-files",e.append(this._summary,this._progress.root,this._list),this._addPicker(),this.own(e8(e,e=>this.add(e))),this.own(()=>{var e=!0,t=!1,n=void 0;try{for(var r,i=this._items.peek()[Symbol.iterator]();!(e=(r=i.next()).done);e=!0){let e=r.value;this._cancel(e)}}catch(e){t=!0,n=e}finally{try{e||null==i.return||i.return()}finally{if(t)throw n}}}),this.effect(()=>this._render(this._items.value)),this.effect(()=>this._adopt(this.value)),this.addValidator(()=>this._check()),e}isEmptyValue(){return 0===this._items.value.length}get emptyMessage(){return"At least one file is required."}_check(){let e=this._items.value;return e.some(e=>e.loading)?"Files are still loading.":e.some(e=>null!==e.error)?"Some files failed to load.":null}_accepts(e){let t=this.options.accept;return void 0===t||t.some(t=>e.toLowerCase().endsWith(t.toLowerCase()))}_render(e){this._list.replaceChildren(...e.map(e=>e.row));let t=e.filter(e=>e.loading).length,n=e.filter(e=>null!==e.error).length,r=e.length-t-n;this._progress.root.hidden=0===t,this._summary.hidden=t>0||0===e.length,this._summary.textContent=n>0?`${r} loaded, ${n} failed`:`${r} loaded`,t>0&&(this._progress.value=r/e.length),this.refreshDisabled()}_adopt(e){if(!this._echo){var t=!0,n=!1,r=void 0;try{for(var i,o=this._items.peek()[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){let e=i.value;this._cancel(e)}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}this._items.value=e.map(e=>{var t;return this._loaded(e,null!=(t=e.fileName)?t:e.path)})}}_loaded(e,t){let n=this._item(t);return n.info=e,n.loading=!1,n.status.textContent="",n}_pickFromFiles(){return ts(function*(){let e=yield eW.pickFileFromFiles({multiple:!0});if(null===e||this.scope.isDisposed)return;let t=[...this._items.peek()],n=!1;var r=!0,i=!1,o=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done);r=!0){let e=a.value;if(!e.isFile||!this._accepts(e.fileName)){g.shell.warning(e.isFile?`${e.fullPath} is not ${this.options.accept.join(" or ")}.`:`${e.fullPath} is a folder.`);continue}let r=t.findIndex(t=>t.key===e.fullPath);r>=0&&this._drop(t[r],t,r),t.push(this._loaded(e,e.fullPath)),n=!0}}catch(e){i=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}n&&(this._items.value=t,this._settle())}).call(this)}_item(e){let t=document.createElement("div");t.className="u2-files-row";let n=document.createElement("span");n.className="u2-files-name",n.textContent=e,n.title=e;let r=document.createElement("span");r.className="u2-files-status",r.textContent="0%";let i={key:e,row:t,status:r,info:null,error:null,loading:!0,cancelled:!1,cancel:()=>{}};return t.append(n,r,(0,y.gb)("times",()=>this._remove(i),{tooltip:"Remove"})),i}_load(e,t){return ts(function*(){var n,r;let i=e.stream().getReader();t.cancel=()=>void i.cancel().catch(()=>{});let a=[],l=0;try{for(;;){let n=yield i.read(),r=n.done,o=n.value;if(t.cancelled)return;if(r||void 0===o)break;a.push(o),l+=o.length,t.status.textContent=e.size>0?`${Math.round(l/e.size*100)}%`:""}t.info=o.FileInfo.fromBytes(e.name,tu._join(a,l))}catch(n){t.error=n instanceof Error?n.message:String(n),g.shell.error(`Failed to load ${e.name}`)}t.loading=!1,t.status.textContent=null!=(n=t.error)?n:"",t.row.classList.toggle("u2-files-failed",null!==t.error),t.row.title=null!=(r=t.error)?r:"",this._settle()}).call(this)}static _join(e,t){let n=new Uint8Array(t),r=0;var i=!0,o=!1,a=void 0;try{for(var l,s=e[Symbol.iterator]();!(i=(l=s.next()).done);i=!0){let e=l.value;n.set(e,r),r+=e.length}}catch(e){o=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(o)throw a}}return n}_remove(e){let t=[...this._items.peek()],n=t.indexOf(e);n<0||(this._drop(e,t,n),this._items.value=t,this._settle())}_drop(e,t,n){this._cancel(e),t.splice(n,1)}_cancel(e){e.cancelled=!0,e.cancel()}_settle(){let e=this._items.peek();if(this._items.value=[...e],!e.some(e=>e.loading)){this._echo=!0;try{this.value=e.map(e=>e.info).filter(e=>null!==e)}finally{this._echo=!1}}}_addPicker(){let e=document.createElement("input");e.type="file",e.multiple=!0,e.hidden=!0;let t=this.options.accept;void 0!==t&&(e.accept=t.join(","));let n=()=>{e.files&&this.add(e.files),e.value=""};e.addEventListener("change",n),this.own(()=>e.removeEventListener("change",n)),this.addRail(e,{edits:!0}),this.addOptions((0,y.gb)("folder-open",()=>e.click(),{tooltip:"Open files"}),{edits:!0}),"function"==typeof eW.pickFileFromFiles&&this.addOptions((0,y.gb)("folder-tree",()=>this._pickFromFiles().catch(e=>g.shell.error(String(e))),{tooltip:"Add file from Files"}),{edits:!0})}constructor(e){super(void 0===e?{}:e,[]),this.root.dataset.u2="files-input"}}function td(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}function tc(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){td(o,r,i,a,l,"next",e)}function l(e){td(o,r,i,a,l,"throw",e)}a(void 0)})}}class tp extends a.p{static content(e){let t=new TextDecoder().decode(e).trim();return t.startsWith(tp.PEM)?t:tp.base64(e)}static base64(e){let t="";for(let n=0;n<e.length;n+=32768)t+=String.fromCharCode.apply(null,[...e.subarray(n,n+32768)]);return btoa(t)}createEditor(){let e=document.createElement("input");this._picker=e,e.type="file",e.accept=this._accept,e.hidden=!0,this.scope.listen(e,"change",()=>{var t;let n=null==(t=e.files)?void 0:t[0];n&&this.accept(n)});let t=document.createElement("div");t.className="u2-rsa-upload",t.append(e,(0,y.SE)("Upload","paperclip",()=>e.click()),(0,_.Ln)(`or drop a ${this._accept} file`,"u2-rsa-hint"));let n=new S.k({password:!0,value:tp.PLACEHOLDER,inline:!0});n.root.querySelector("input").readOnly=!0;let r=document.createElement("div");r.className="u2-rsa-masked",r.append(n.root,(0,_.x6)("Change",()=>this._change()));let i=document.createElement("div");return i.className="u2-rsa",i.append(t,r),this.own(e8(i,e=>this._drop(e))),this._makeDroppable(i),this.effect(()=>{var e;let n=(null!=(e=this.value)?e:"")!=="";t.hidden=n,r.hidden=!n}),i}get emptyMessage(){return"Can't be empty."}accept(e){return tc(function*(){if(!this._accepts(e.name))return void g.shell.error(`Expected a ${this._accept} file.`);let t=tp.content(new Uint8Array((yield e.arrayBuffer())));this.scope.isDisposed||(this.value=t)}).call(this)}_drop(e){e.length>1?g.shell.error("Multiple files are not supported."):this.accept(e[0])}get _accept(){var e;return null!=(e=this.options.accept)?e:".pem,.der"}_accepts(e){return this._accept.split(",").some(t=>e.toLowerCase().endsWith(t.trim().toLowerCase()))}_change(){this.value=null,this._picker.value="",this._picker.click()}_makeDroppable(e){eW.makeDroppable(e,{acceptDrop:e=>this._isKeyFile(e),doDrop:e=>tc(function*(){let t=tp.dragged(e);if(!this._isKeyFile(t))return;let n=yield g.dapi.files.readAsText(t).catch(()=>null);this.scope.isDisposed||(null===n?g.shell.error("Could not read the key file."):n.startsWith(tp.PEM)?this.value=n:g.shell.error("Invalid key file"))}).call(this)})}static dragged(e){return null!==e&&"object"==typeof e&&"dragObject"in e?e.dragObject:e}_isKeyFile(e){return e instanceof o.FileInfo&&e.isFile&&tp._connected(e)&&this._accepts(e.fileName)}static _connected(e){try{return null!=e.connection}catch(e){return!0}}constructor(e){super(void 0===e?{}:e,null),this.root.dataset.u2="rsa-input"}}function th(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}tp.PLACEHOLDER="_____________",tp.PEM="-----BEGIN";let tm=[o.AGG.TOTAL_COUNT,o.AGG.VALUE_COUNT,o.AGG.UNIQUE_COUNT,o.AGG.MISSING_VALUE_COUNT],tf=[o.AGG.FIRST,...tm,o.AGG.MIN,o.AGG.MAX,o.AGG.SUM,o.AGG.MED,o.AGG.AVG,"geomean",o.AGG.STDEV,o.AGG.VARIANCE,o.AGG.SKEW,o.AGG.KURT,o.AGG.Q1,o.AGG.Q2,o.AGG.Q3],tg={[o.COLUMN_TYPE.INT]:tf,[o.COLUMN_TYPE.FLOAT]:tf,[o.COLUMN_TYPE.BIG_INT]:tf,[o.COLUMN_TYPE.QNUM]:tf,[o.COLUMN_TYPE.STRING]:tm,[o.COLUMN_TYPE.BOOL]:tm,[o.COLUMN_TYPE.DATE_TIME]:[...tm,"range"]};function tv(e){var t;return null!=(t=tg[e])?t:tm}function tb(e){let t=tv(e.type);return e.isNumerical&&t.includes(o.AGG.AVG)?o.AGG.AVG:t[0]}class ty extends a.p{get table(){return this._table}getState(){var e,t;return e=th({},super.getState()),t=t={open:void 0!==this._popupScope},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}getItems(e){let t=new Set(this.peek());return a.p.itemsState(this._names().map((e,n)=>({key:e,label:e,index:n,selected:t.has(e),rendered:!1})),null==e?void 0:e.all)}changeTable(e,t){this._closePopup(),this._table=e,this._filter=t,this._reflectTable(),this._follow(),this.value=[],this._renderSummary(this.peek())}createEditor(){var e;this._table=null!=(e=this.options.table)?e:null,this._filter=this.options.filter;let t=document.createElement("div");return this._control=t,t.className="u2-columns",t.tabIndex=0,t.setAttribute("role","button"),t.setAttribute("aria-haspopup","dialog"),t.setAttribute("aria-expanded","false"),this._summary=(0,_.Ln)("","u2-columns-summary"),t.append(this._summary,(0,_.Ln)("","u2-columns-chevron")),this._reflectTable(),this.scope.listen(t,"click",()=>this._togglePopup()),this.scope.listen(t,"keydown",e=>this._onKeyDown(e)),this.effect(()=>this._renderSummary(this.value)),this._follow(),this.own(()=>{this._closePopup(),this._unfollow&&this._unfollow()}),t}_reflectTable(){let e=null===this._table;this._control.setAttribute("aria-disabled",String(e)),e?this.box.title="Select a table first":this.box.removeAttribute("title")}_names(){return null===this._table?[]:P.listedColumns(this._table,this._filter).map(e=>e.name)}_renderSummary(e){let t=this._names().length;this._summary.textContent=0===e.length?"(0)":e.length===t?`(${e.length}) All`:`(${e.length}) ${e.join(", ")}`}_follow(){if(this._unfollow&&this._unfollow(),null===this._table){this._unfollow=void 0;return}let e=[this._table.onColumnsChanged.subscribe(()=>this._prune()),D(this._table,(e,t)=>this._rename(e,t))];this._unfollow=()=>{var t=!0,n=!1,r=void 0;try{for(var i,o=e[Symbol.iterator]();!(t=(i=o.next()).done);t=!0)i.value.unsubscribe()}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}}}_rename(e,t){let n=this.peek(),r=n.indexOf(e);if(r<0)return;let i=n.slice();i[r]=t,this.systemWrite(i)}_prune(){let e=this._names(),t=this.peek(),n=t.filter(t=>e.includes(t));n.length!==t.length?this.systemWrite(n):this._renderSummary(t)}_onKeyDown(e){("Enter"===e.key||" "===e.key)&&(e.preventDefault(),this._togglePopup())}_togglePopup(){null===this.disabled&&null!==this._table&&(this._popupScope?this._closePopup():this._openPopup())}_openPopup(){let e=new s.HG;this._popupScope=e,e.build(()=>{let t=E("columnSelector");null!==t?this._openPlatform(e,t):this._openNative(e)}),this._control.setAttribute("aria-expanded","true")}_openPlatform(e,t){let n=t.columnSelector(this._table,{filter:this._filter});n.setSelectedColumns(this.peek()),n.showSearch=!0;let r=()=>{let e=new Set(n.getCheckedColumnNames());this._commit(this._ordered().filter(t=>e.has(t))),this._closePopup()},i=(0,_.yP)([n.root,(0,_._Q)([(0,_.x6)("OK",r,{primary:!0}),(0,_.x6)("CANCEL",()=>this._closePopup())],"u2-columns-buttons")],"u2-columns-popup"),o=n.root.querySelector("input"),a=e=>{let t=e.key;"Escape"===t?(e.stopPropagation(),this._closePopup(),this._control.focus()):"Enter"===t&&e.target===o&&(e.preventDefault(),e.stopPropagation(),r())},l=()=>this._closePopup();i.addEventListener("keydown",a,!0),i.addEventListener(O.B,l),e.own(()=>{i.removeEventListener("keydown",a,!0),i.removeEventListener(O.B,l),n.close()}),i.setAttribute("role","dialog"),i.setAttribute("aria-label","Choose columns"),O.h.show(this._control,i,{owner:e}),n.grid.autoSize(600,300);let s=this._control.getBoundingClientRect().width;n.grid.root.getBoundingClientRect().width<s&&(n.grid.root.style.width=`${s}px`),null==o||o.focus()}_openNative(e){var t;let n=new Set(this.peek()),r=this._ordered(),i=new k(this._table),o=new S.k({placeholder:"Search…",search:!0,inline:!0}),a=e=>{let t=e.trim().toLowerCase();return t?r.filter(e=>e.toLowerCase().includes(t)):r},l=new A.wj({itemHeight:24,render:(e,t,r)=>{r.classList.toggle("u2-columns-picked",n.has(e));let o=document.createElement("input");return o.type="checkbox",o.className="u2-input-checkbox",o.checked=n.has(e),o.tabIndex=-1,o.setAttribute("aria-label",e),(0,_._Q)([o,i.listItem(e)],"u2-columns-option")}});l.root.classList.add("u2-columns-list");let s=(0,_.Ln)("","u2-columns-count"),u=e=>{let t=void 0===e?o.peek():e;l.setItems(a(t)),s.textContent=`${n.size} selected`},d=e=>{let t=a(o.peek())[e];void 0!==t&&(n.delete(t)||n.add(t),u(),l.refresh(t))},c=e=>{var t=!0,r=!1,i=void 0;try{for(var s,d=a(o.peek())[Symbol.iterator]();!(t=(s=d.next()).done);t=!0){let t=s.value;e?n.add(t):n.delete(t)}}catch(e){r=!0,i=e}finally{try{t||null==d.return||d.return()}finally{if(r)throw i}}u(),l.refresh()},p=()=>{this._commit(r.filter(e=>n.has(e))),this._closePopup()},h=e=>{let t=e.target.closest(".u2-list-row");t&&d(Number(t.dataset.index))},m=e=>{" "===e.key&&(e.preventDefault(),d(l.selectedIndex.peek()))};l.root.addEventListener("click",h),l.root.addEventListener("keydown",m),e.own(()=>{l.root.removeEventListener("click",h),l.root.removeEventListener("keydown",m)}),e.effect(()=>u(o.value));let f=(0,_.yP)([o,(0,_._Q)([(0,_.nf)("All",()=>c(!0)),(0,_.nf)("None",()=>c(!1)),s],"u2-columns-actions"),l,(0,_._Q)([(0,_.x6)("OK",p,{primary:!0}),(0,_.x6)("CANCEL",()=>this._closePopup())],"u2-columns-buttons")],"u2-columns-popup"),g=e=>{let t=e.key,n=e.target;if("BUTTON"!==n.tagName&&"A"!==n.tagName){if("Enter"===t){e.preventDefault(),p();return}if(!l.root.contains(n)){if("ArrowDown"===t||"ArrowUp"===t){e.preventDefault(),(e=>{let t=a(o.peek()).length;if(0===t)return;let n=Math.min(Math.max(l.selectedIndex.peek()+e,0),t-1);l.selectedIndex.value=n,l.scrollToIndex(n)})("ArrowDown"===t?1:-1);return}" "===t&&l.selectedIndex.peek()>=0&&(e.preventDefault(),d(l.selectedIndex.peek()))}}},v=()=>this._closePopup();f.addEventListener("keydown",g),f.addEventListener(O.B,v),e.own(()=>{f.removeEventListener("keydown",g),f.removeEventListener(O.B,v)}),f.setAttribute("role","dialog"),f.setAttribute("aria-label","Choose columns"),O.h.show(this._control,f,{owner:e}),null==(t=o.root.querySelector("input"))||t.focus()}_ordered(){let e=this._names(),t=this.peek().filter(t=>e.includes(t));return[...t,...e.filter(e=>!t.includes(e))]}_commit(e){let t=this.peek();(e.length!==t.length||e.some((e,n)=>e!==t[n]))&&(this.value=e)}_closePopup(){let e=this._popupScope;this._popupScope=void 0,e&&(e.dispose(),this._control.setAttribute("aria-expanded","false"))}constructor(e){super(e,[]),this.root.dataset.u2="columns-input"}}a.p;class t_ extends a.p{createEditor(){let e=document.createElement("div");this._body=e,e.className="u2-aggregations",this._rows=t_._copy(this.peek()),this._render(),this.effect(()=>{let e=this.value;t_._same(e,this._rows)||(this._rows=t_._copy(e),this._render())});let t=D(this.options.table,(e,t)=>{var n=!0,r=!1,i=void 0;try{for(var o,l=this._rows[Symbol.iterator]();!(n=(o=l.next()).done);n=!0){let n=o.value;n.column===e&&(n.column=t)}}catch(e){r=!0,i=e}finally{try{n||null==l.return||l.return()}finally{if(r)throw i}}this._render(),a.p.system(()=>this._commit())});return this.own(()=>{var e;t.unsubscribe(),null==(e=this._rowScope)||e.dispose()}),e}_render(){var e;null==(e=this._rowScope)||e.dispose();let t=new s.HG;this._rowScope=t,this._body.textContent="",t.build(()=>{0===this._rows.length&&this._body.append((0,_._Q)([this._addButton(0)],"u2-aggregations-row"));for(let e=0;e<this._rows.length;e++)this._body.append(this._row(e))}),this.refreshDisabled()}_row(e){let t=this._rows[e],n=new v.o({inline:!0,nullable:!1,items:tv(this._type(t.column)),value:t.aggregation,onChanged:e=>{t.aggregation=null!=e?e:t.aggregation,this._commit()}}),r=new v.o({inline:!0,nullable:!1,items:P.listedColumns(this.options.table).map(e=>e.name),value:t.column,onChanged:e=>this._onColumn(t,e,n)});return r.root.classList.add("u2-input-fill"),n.root.classList.add("u2-input-fill"),(0,_._Q)([r.root,n.root,this._addButton(e+1),(0,y.gb)("minus",()=>this._remove(e),{tooltip:"Remove aggregation"})],"u2-aggregations-row")}_addButton(e){return(0,y.gb)("plus",()=>this._add(e),{tooltip:"Add aggregation"})}_onColumn(e,t,n){e.column=t;let r=tv(this._type(t));r.includes(e.aggregation)||(e.aggregation=tb(this.options.table.columns.byName(t))),n.setItems(r),n.value=e.aggregation,this._commit()}_type(e){let t=this.options.table.columns;return t.contains(e)?t.byName(e).type:""}_add(e){let t=this._newRow();null!==t&&(this._rows.splice(e,0,t),this._render(),this._commit())}_remove(e){this._rows.splice(e,1),this._render(),this._commit()}_newRow(){var e;let t=P.listedColumns(this.options.table),n=null!=(e=t.find(e=>e.isNumerical))?e:t[0];return void 0===n?null:{column:n.name,aggregation:tb(n)}}_commit(){t_._same(this.peek(),this._rows)||(this.value=t_._copy(this._rows))}static _copy(e){return e.map(e=>th({},e))}static _same(e,t){return e.length===t.length&&e.every((e,n)=>e.column===t[n].column&&e.aggregation===t[n].aggregation)}constructor(e){super(e,[]),this.root.dataset.u2="aggregated-columns-input"}}var tw=n(317),tx=n(1426),tk=n(169),tO=n(4467);function tA(e){let t=e.root;return t.setAttribute("data-kill-on-close","true"),o.Widget.registerCleanup(t,()=>e.dispose()),t}function tS(e,t){return null!=e&&null!=t&&e.dart===t.dart}function tP(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function tE(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}class tC extends ew.Ec{refit(){var e;this._attach();let t=this._ribbon,n=null!=(e=this._options.fold)?e:"auto",r=this._actions.some(e=>e.shown.peek());"auto"!==n||void 0===t||0===t.clientWidth?this._setFolded("always"===n&&r):(this._setFolded(!1),this._setFolded(r&&t.scrollWidth>t.clientWidth+1),void 0!==this._panel&&!1!==this._options.pin&&this._panel.classList.toggle("u2-ribbon-overflow",t.scrollWidth>t.clientWidth+1))}getItems(e){let t=this._folded.peek(),n=[...this._actions.filter(e=>e.shown.peek()).map(e=>({key:tC._key(e.spec.name,e.spec.tooltip),label:e.spec.tooltip,rendered:!t})),...this._buttons.filter(e=>e.shown.peek()).map(e=>tP({key:tC._key(e.spec.name,e.spec.text),label:e.spec.text,rendered:!0},e.el.disabled?{disabled:!0}:{}))].map((e,t)=>tE(tP({},e),{index:t}));return a.p.itemsState(n,null==e?void 0:e.all)}getState(){return tE(tP({},super.getState()),{extra:{folded:this._folded.peek()}})}_build(){let e=this._options,t=(0,_.Ln)("","u2-ribbon-rule");t.setAttribute("aria-hidden","true");var n=!0,r=!1,i=void 0;try{for(var o,a,l,s=(null!=(o=e.actions)?o:[])[Symbol.iterator]();!(n=(l=s.next()).done);n=!0){let e=l.value,t=e.hint,n=(0,y.gb)(e.icon,()=>e.run(),{tooltip:void 0===t?e.tooltip:(0,d.EW)(()=>{var n;return null!=(n=t.value)?n:e.tooltip})});n.dataset.u2Item=tC._key(e.name,e.tooltip),void 0!==e.name&&(n.dataset.u2Name=e.name);let r={spec:e,el:n,shown:(0,d.vP)(!0)};this._live(e.visible,e=>{n.hidden=!e,r.shown.value=e}),void 0!==t&&this.effect(()=>{let e=t.value;if(n.classList.toggle("u2-ribbon-hinted",null!==e),null===e||this._folded.peek()||!n.isConnected)return;let r=eW.hints.addHintIndicator(n,!0,1e4);return()=>eW.hints.remove(r)}),this._icons.append(n),this._actions.push(r)}}catch(e){r=!0,i=e}finally{try{n||null==s.return||s.return()}finally{if(r)throw i}}let u=()=>this._actions.find(e=>{var t;return e.shown.value&&(null==(t=e.spec.hint)?void 0:t.value)!=null});this._more=(0,y.gb)(tO.M.OVERFLOW_ICON,()=>{},{tooltip:(0,d.EW)(()=>{var e;let t=u();return void 0===t?tO.M.OVERFLOW_LABEL:`${tO.M.OVERFLOW_LABEL} — ${null!=(e=t.spec.hintDetail)?e:t.spec.hint.peek()}`}),menu:()=>{let e=tk.W.popup();var t=!0,n=!1,r=void 0;try{for(var i,o,a,l,s,u=this._actions.filter(e=>e.shown.peek())[Symbol.iterator]();!(t=(s=u.next()).done);t=!0){let t=s.value,n=null!=(i=null==(l=t.spec.hint)?void 0:l.peek())?i:null;e.item(null!=(o=t.spec.text)?o:t.spec.tooltip,()=>t.spec.run(),tP({icon:t.spec.icon},null===n?{}:{detail:null!=(a=t.spec.hintDetail)?a:n}))}}catch(e){n=!0,r=e}finally{try{t||null==u.return||u.return()}finally{if(n)throw r}}return e}}),this._more.classList.add("u2-ribbon-more"),this._more.dataset.u2Part="more",this._more.hidden=!0;let c=(0,_.Ln)("","u2-ribbon-hint-dot");this._more.append(c),this.effect(()=>{c.hidden=void 0===u()}),this.root.append(t,this._icons,this._more);var p=!0,h=!1,m=void 0;try{for(var f,g,v=(null!=(a=e.buttons)?a:[])[Symbol.iterator]();!(p=(g=v.next()).done);p=!0){let e=g.value,t=(0,_.x6)(e.text,()=>e.run(),{primary:null==(f=e.primary)||f,disabled:e.disabled});t.dataset.u2Item=tC._key(e.name,e.text),void 0!==e.name&&(t.dataset.u2Name=e.name),void 0!==e.cls&&t.classList.add(e.cls);let n={spec:e,el:t,shown:(0,d.vP)(!0)};this._live(e.visible,e=>{t.hidden=!e,n.shown.value=e}),this.root.append(t),this._buttons.push(n)}}catch(e){h=!0,m=e}finally{try{p||null==v.return||v.return()}finally{if(h)throw m}}let b=e.status;void 0!==b&&(this._status=(0,_.y4)([b],"u2-ribbon-status"))}_place(){var e;let t=this.view;this._found={showSaveButton:t.showSaveButton,parentView:t.parentView,showParentCrumb:t.showParentCrumb},!0===this._options.hideSave&&(t.showSaveButton=!1),t.setRibbonPanels([[this.root]],!1);let n=this._options.breadcrumbs;void 0!==n&&(t.parentView=n.parent,t.showParentCrumb=!0),void 0!==this._status&&(t.statusBarPanels=[...null!=(e=t.statusBarPanels)?e:[],this._status]),this._queueRefit()}_remove(){var e;let t=this.view;if(![...g.shell.views].some(e=>tS(e,t)))return;let n=this.root,r=t.getRibbonPanels();r.some(e=>e.some(e=>e===n||e.contains(n)))&&t.setRibbonPanels(r.filter(e=>!e.some(e=>e===n||e.contains(n))));let i=this._found;void 0!==i&&!0===this._options.hideSave&&(t.showSaveButton=i.showSaveButton),void 0!==i&&void 0!==this._options.breadcrumbs&&(t.parentView=i.parentView,t.showParentCrumb=i.showParentCrumb),void 0!==this._status&&(t.statusBarPanels=(null!=(e=t.statusBarPanels)?e:[]).filter(e=>e!==this._status))}_queueRefit(){this._queued||this.scope.isDisposed||(this._queued=!0,this.scope.requestFrame(()=>{this._queued=!1,this.refit()}))}_attach(){var e,t,n,r;let i=null!=(e=this.root.closest(".d4-ribbon"))?e:void 0,o=e=>{var t,n;return null!=(t=null==e||null==(n=e.parentElement)?void 0:n.closest(".d4-ribbon"))?t:void 0};for(let e=o(i);void 0!==e;e=o(e))i=e;if(i!==this._ribbon&&(this._ribbonResize.disconnect(),this._ribbonTree.disconnect(),null==(n=this._unlistenCrumb)||n.call(this),this._ribbon=i,void 0!==i)){this._ribbonResize.observe(i),this._ribbonTree.observe(i,{childList:!0,subtree:!0});let e=null==(r=this._options.breadcrumbs)?void 0:r.onClick;if(void 0!==e){let t=!1,n=this.scope.listen(i,"click",e=>{var n,r;t=(null==(r=e.target)||null==(n=r.closest)?void 0:n.call(r,tC.PARENT_CRUMB))!=null},{capture:!0}),r=this.scope.listen(i,"click",()=>{t&&(t=!1,queueMicrotask(()=>{try{e()}catch(e){this.scope.reportError(e)}}))});this._unlistenCrumb=()=>{n(),r()}}}let a=null!=(t=this.root.closest(".d4-ribbon-panel"))?t:void 0;void 0!==a&&a!==this._panel&&!1!==this._options.pin&&(a.classList.add("u2-ribbon-pinned"),this._panel=a)}_setFolded(e){this._icons.hidden=e,this._more.hidden=!e,this._folded.peek()!==e&&(this._folded.value=e)}_live(e,t){e instanceof d.HN?this.effect(()=>{t(e.value),this._queueRefit()}):void 0!==e&&t(e)}static _key(e,t){return null!=e?e:t}constructor(e,t){var n;let r=void 0===t?{}:t;super(document.createElement("div")),this._folded=(0,d.vP)(!1),this._icons=(0,_.Ln)("","u2-ribbon-icons"),this._actions=[],this._buttons=[],this._queued=!1,this._ribbonResize=new ResizeObserver(()=>this._queueRefit()),this._ribbonTree=new MutationObserver(()=>{this._attach(),this._queueRefit()});const i=this.view=e.view;this._options=r,this.folded=this._folded;const o=this.root;o.className="u2-ribbon-group d4-ribbon-wrapper",o.dataset.u2="ribbon-group",o.setAttribute("role","toolbar"),o.setAttribute("aria-label",null!=(n=r.label)?n:"Actions"),void 0!==r.name&&(this.name=r.name),this.build(()=>this._build());const a=new ResizeObserver(()=>this._queueRefit());a.observe(o),this.own(()=>{a.disconnect(),this._ribbonResize.disconnect(),this._ribbonTree.disconnect()}),this.own(tw.Q.adopt(e,()=>this.dispose())),this.subscribe(g.events.onCurrentViewChanged,()=>{tS(g.shell.v,i)&&this._queueRefit()}),this.own(()=>this._remove()),this._place()}}tC.PARENT_CRUMB=".d4-view-ribbon > .d4-ribbon-name:not(.grok-ns-entity-name)";class tj extends ew.uA{static of(e){var t;return null!=(t=tj._hosts.get(tj._key(e)))?t:new tj()._attach(e)}static create(e){let t,n=new tj;try{t=n.build(()=>e.content(n))}catch(e){throw n.dispose(),e}let r=tj._isContent(t)?t:{root:t},i=r.root,a=ew.Ec.is(i)?i:n.build(()=>(0,ew.s9)(()=>i));n.own(()=>a.dispose()),a.own(()=>n.dispose()),void 0===a.name&&(a.name=e.name);let l=o.View.fromRoot(tA(a));return l.name=e.name,n._attach(l),n._chrome(l,r),n}get view(){var e;return null!=(e=this._view)?e:s._U.fail("view-not-ready","ViewHost.create() makes the view from its content once the content is built: use the host's view, ribbon, signals, show and dock after create() answers — in a handler or a `host.task`")}get signals(){var e;return null!=(e=this._signals)?e:this._signals=function(e,t){var n,r;let i="dataFrame"in e?e:null,o=(0,d.vP)(tS(g.shell.v,e)),a=(0,d.vP)(null!=(n=null==i?void 0:i.grid)?n:null),l=(0,d.vP)(null!=(r=null==i?void 0:i.dataFrame)?r:null);t.subscribe(g.events.onCurrentViewChanged,()=>o.value=tS(g.shell.v,e)),t.subscribe(g.events.onViewLayoutApplied,t=>{var n,r,o,s,u,d;null!==i&&tS(null==t?void 0:t.view,e)&&((null==(o=i.grid)?void 0:o.dart)!==(null==(s=a.peek())?void 0:s.dart)&&(a.value=null!=(n=i.grid)?n:null),(null==(u=i.dataFrame)?void 0:u.dart)!==(null==(d=l.peek())?void 0:d.dart)&&(l.value=null!=(r=i.dataFrame)?r:null))});let s=(0,d.EW)(()=>{var e;return null!=(e=l.value)?e:void 0}),u=(0,tx.p)(s,t);return{isCurrent:o,grid:a,dataFrame:l,currentRowIdx:u.bindStep("currentRowIdx"),selection:u.bindStep("selection"),filter:u.bindStep("filter"),columns:u.bindStep("columns"),rowCount:u.bindStep("rowCount")}}(this.view,this.scope.child("view-signals"))}ribbon(e){return new tC(this,void 0===e?{}:e)}show(e,t){var n,r;if(e.isOpen.peek())return e;let i=this.view,o=this.scope.child("view-pin"),a=(0,d.vP)(tS(g.shell.v,i));o.subscribe(g.events.onCurrentViewChanged,()=>a.value=tS(g.shell.v,i));let l=e.build(()=>e.on("close",()=>{l(),o.dispose()}));return e.show((n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},void 0===t?{}:t),r=r={visible:a,owner:o},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(r)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))}),n)),e.isOpen.peek()||(l(),o.dispose()),e}dock(e,t,n){var r;let i=void 0===n?{}:n,o=this.view,a="dockManager"in o?o.dockManager:g.shell.dockManager,l=tA(e),s=e=>e===l||e.contains(l);e.own(tw.Q.adopt(this,()=>e.dispose())),e.subscribe(a.onClosed,t=>{s(t)&&e.dispose()}),e.subscribe(a.onPanelHidden,t=>{s(t)&&null==a.findNode(l)&&e.dispose()}),e.own(()=>{null!=a.findNode(l)&&a.close(l)}),a.dock(l,t,null,i.title,null!=(r=i.ratio)?r:.5)}get ambientAdoption(){return!1}_attach(e){let t=tj._key(e);return this._view=e,tj._hosts.set(t,this),this.own(()=>{tj._hosts.get(t)===this&&tj._hosts.delete(t)}),this.subscribe(g.events.onViewRemoved,t=>{tS(t,e)&&this.dispose()}),this}_chrome(e,t){let n=e=>ew.Ec.is(e)?(this.own(()=>e.dispose()),e.root):e;if(t.ribbon){let s=t.ribbon.map(e=>e.map(n));e.setRibbonPanels(s);let u=()=>{var e=!0,t=!1,n=void 0;try{for(var r,i,o=s[Symbol.iterator]();!(e=(i=o.next()).done);e=!0){let e=i.value,t=null==(r=e[0])?void 0:r.closest(".d4-ribbon-panel");if(null==t)continue;t.style.display=e.every(e=>e.hidden)?"none":"";let n=t.previousElementSibling;n instanceof HTMLElement&&n.classList.contains("d4-ribbon-separator")&&(n.style.display=t.style.display)}}catch(e){t=!0,n=e}finally{try{e||null==o.return||o.return()}finally{if(t)throw n}}},d=new MutationObserver(u);var r=!0,i=!1,o=void 0;try{for(var a,l=s.flat()[Symbol.iterator]();!(r=(a=l.next()).done);r=!0){let e=a.value;d.observe(e,{attributes:!0,attributeFilter:["hidden"]})}}catch(e){i=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}this.own(()=>d.disconnect()),u()}t.toolbox&&(e.toolbox=n(t.toolbox));let s=t.status;if(s instanceof d.HN){let t=document.createElement("div");this.effect(()=>{t.textContent=s.value}),e.statusBarPanels=[t]}else null!=s&&(e.statusBarPanels=(Array.isArray(s)?s:[s]).map(e=>{let t=n(e);if(t instanceof HTMLDivElement)return t;let r=document.createElement("div");return r.append(t),r}));let u=t.path;"string"==typeof u?e.path=u:null!=u&&this.effect(()=>{e.path=u.value})}static _key(e){var t;return null!=(t=e.dart)?t:e}static _isContent(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&!(e instanceof HTMLElement)&&!ew.Ec.is(e)&&"root"in e}constructor(){super()}}tj.isRoot=!0,tj._hosts=new WeakMap;var tT=n(4535);let tN="u2-spec-error";class tI{parent(){return this.instance.parentOf(this.node)}built(){return this.instance.nodes().get(this.node)}element(){let e=this.built();return void 0===e?void 0:tT.R4.elementOf(e)}meta(){var e;let t=this.built();return null!=(e=ew.uA.is(t)?t.componentMeta:void 0)?e:this.instance.registry.get(this.node.tag)}error(){let e=this.built();return void 0===e||ew.uA.is(e)||!e.classList.contains(tN)?null:e.textContent}path(){let e=function(e){let t=new Map;var n=!0,r=!1,i=void 0;try{for(var o,a=e.nodes().keys()[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){let n=o.value;var l=!0,s=!1,u=void 0;try{for(var d,c=tz(e,n)[Symbol.iterator]();!(l=(d=c.next()).done);l=!0){let e=d.value;t.set(e,n)}}catch(e){s=!0,u=e}finally{try{l||null==c.return||c.return()}finally{if(s)throw u}}}}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}return t}(this.instance),t=[];for(let n=this.node;n;n=e.get(n))t.unshift(t$(n));return t.join(" › ")}constructor(e,t,n,r){this.instance=e,this.node=t,this.editor=n,this.actions=r}}class tD{constructor(e){this.refs=e}}function t$(e){var t;return null!=(t=e.name)?t:e.tag}function tL(e){var t,n;let r,i=new Map,o=(t,n)=>{i.set(t,n);let r=tz(e,t).map((e,t)=>o(e,`${n}.${t}`));return{id:n,label:t$(t),data:t,children:r.length>0?r:void 0}};return{roots:[(r=(t=e).spec).root,...null!=(n=r.components)?n:[]].filter(e=>t.nodes().has(e)).map((e,t)=>o(e,String(t))),ids:i}}function tz(e,t){var n;let r=e.nodes();return(null!=(n=t.children)?n:[]).filter(e=>r.has(e))}var tF=n(6163),tB=n(6588),tM=n(5113),tR=n(326),tq=n(30),tH=n(8109),tW=n(1965);function tV(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}let tG="loading";function tU(e){if(!(0,tW.P)(e))return null;let t=tY(e,"state"),n=tY(e,"rowCount"),r=tY(e,"total"),i=tY(e,"error");return void 0===t&&void 0===n&&void 0===r?null:{state:null==t?"":String(t),count:"number"==typeof n?n:"number"==typeof r?r:null,counts:"number"==typeof n?"rows":"entities",error:null==i?null:String(i)}}function tK(e){if(null!==e.error)return e.error;if("idle"===e.state)return"not run yet — use Refresh";let t=null===e.count?"":`${e.count} ${e.counts}`;return""===e.state||""===t?""===e.state?t:e.state:`${e.state} \xb7 ${t}`}function tY(e,t){let n=e.bindStep(t);return null===n||(0,tW.P)(n)?void 0:n.value}function tQ(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function tJ(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}function tZ(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function tX(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}let t0=["Delete","Move Up","Move Down","Duplicate"];var t2=function(e){if(Array.isArray(e))return e}(t0)||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var i=[],o=!0,a=!1;try{for(r=r.call(e);!(o=(t=r.next()).done)&&(i.push(t.value),4!==i.length);o=!0);}catch(e){a=!0,n=e}finally{try{o||null==r.return||r.return()}finally{if(a)throw n}}return i}}(t0)||function(e){if(e){if("string"==typeof e)return tQ(e,4);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return tQ(e,4)}}(t0)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();let t1=t2[0],t4=t2[1],t3=t2[2],t8=t2[3],t6={[t1]:"trash-alt",[t4]:"arrow-up",[t3]:"arrow-down",[t8]:"clone"};class t5{actions(){var e,t,n,r;let i=this._host.selected(),o=this._host.editor.peek(),a=this._host.instance();if(!i||!o||!a)return[];if(this._host.multi().length>1){let e=this.cover();return[{text:t1,icon:t6[t1],disabled:null!=(r=e.map(e=>o.canApply({op:"remove",node:e})).find(e=>null!==e))?r:null,run:()=>this._deleteMulti(e)},{text:t4,icon:t6[t4],disabled:t5.ONE_AT_A_TIME,run:()=>{}},{text:t3,icon:t6[t3],disabled:t5.ONE_AT_A_TIME,run:()=>{}},{text:t8,icon:t6[t8],disabled:t5.ONE_AT_A_TIME,run:()=>{}}]}let l=a.parentOf(i),s=null!=(e=null==l?void 0:l.children)?e:[],u=s.indexOf(i);return[{text:t1,icon:t6[t1],disabled:o.canApply(this._removalOf(i)),run:()=>this._delete(i)},{text:t4,icon:t6[t4],disabled:null===l?t5.NO_PARENT:u>0?null:"Already the first",run:()=>void this._host.apply({op:"move",node:i,parent:l,index:u-1})},{text:t3,icon:t6[t3],disabled:null===l?t5.NO_PARENT:u<s.length-1?null:"Already the last",run:()=>void this._host.apply({op:"move",node:i,parent:l,index:u+1})},{text:t8,icon:t6[t8],disabled:null===l?t5.NO_PARENT:null,run:()=>this._duplicate(i)},...this._refreshAction(i),...(null!=(t=null==(n=a.registry.get(i.tag))?void 0:n.designerActions)?t:[]).map(e=>{let t={text:e.text,icon:e.icon,run:()=>void this._designerAction(i,e)};return this._deferred.add(t),t})]}_refreshAction(e){return void 0===this._source(e)?[]:[{text:"Refresh",icon:"sync",run:()=>this.refresh(e)}]}refresh(e){var t,n,r;let i=this._source(e);i&&(n=null!=(t=e.name)?t:e.tag,(r=function*(){var e;let t,r=i.getFunctions().find(e=>"refresh"===e.name);if(void 0===r)return;yield r.apply({});let o=yield null===(t=tU(e=i))||t.state!==tG?Promise.resolve(t):new Promise(t=>{let n=new s.HG;n.effect(()=>{let r=tU(e);(null===r||r.state!==tG)&&(t(r),n.dispose())})});null===o?g.shell.info(`${n}: refreshed`):null!==o.error?g.shell.error(`${n}: ${o.error}`):g.shell.info(`${n}: ${tK(o)}`)},function(){var e=this,t=arguments;return new Promise(function(n,i){var o=r.apply(e,t);function a(e){tV(o,n,i,a,l,"next",e)}function l(e){tV(o,n,i,a,l,"throw",e)}a(void 0)})})())}_source(e){var t;let n=null==(t=this._host.instance())?void 0:t.nodes().get(e);return this._isComponent(e)&&ew.uA.is(n)&&n.getFunctions().some(e=>"refresh"===e.name)?n:void 0}_isComponent(e){var t,n;return(null==(n=this._host.instance())||null==(t=n.spec.components)?void 0:t.includes(e))===!0}_removalOf(e){return this._isComponent(e)?{op:"remove-component",node:e}:{op:"remove",node:e}}_designerAction(e,t){var n;return(n=function*(){let n=this._host.instance();if(n)try{var r;let i=yield t.produce(e,n.nodes().get(e)),o=this._host.editor.peek();if(null===i||!o)return;if("set-prop"===i.op)return void this._host.apply({op:"set-prop",node:e,name:i.name,value:i.value});let a=o.uniqueNames(),l=i.node.tag,s=(0,tH.I5)(n.registry.get(l),l,a((0,tH.VJ)(l)),a),u=tX(tZ({},s,i.node),{name:s.name}),d=tZ({},s.props,i.node.props);Object.keys(d).length>0&&(u.props=d),this._host.pending(u),this._host.apply({op:"add",parent:e,index:(null!=(r=e.children)?r:[]).length,node:u})}catch(e){g.shell.warning(`${t.text}: ${e instanceof Error?e.message:String(e)}`)}finally{this._host.refocus()}},function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(e){tJ(o,r,i,a,l,"next",e)}function l(e){tJ(o,r,i,a,l,"throw",e)}a(void 0)})}).call(this)}run(e){let t=this.actions().find(t=>t.text===e);t&&null===l.B.now(t.disabled)&&(t.run(),this._deferred.has(t)||this._host.refocus())}handBack(e){return e.map(e=>this._deferred.has(e)?e:tX(tZ({},e),{run:()=>{e.run(),this._host.refocus()}}))}_delete(e){let t=this._host.instance();this._host.pending(this._isComponent(e)?t.spec.root:t.parentOf(e)),this._host.apply(this._removalOf(e))}cover(){let e=this._host.multi();return e.filter(t=>!e.some(e=>e!==t&&tT.R4.contains(e,t)))}_deleteMulti(e){let t=this._host.editor.peek(),n=this._host.instance();if(!t||!n)return;var r=!0,i=!1,o=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done);r=!0){let e=a.value,n=t.canApply({op:"remove",node:e});if(n)return void g.shell.warning(n)}}catch(e){i=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}let s=this._host.selected(),u=e.find(e=>e===s||tT.R4.contains(e,s));this._host.pending(n.parentOf(u)),t.applyAll(e.map(e=>({op:"remove",node:e})))}_duplicate(e){var t;let n=this._host.instance().parentOf(e),r=this._host.editor.peek().duplicate(e),i=(null!=(t=n.children)?t:[]).indexOf(e)+1;this._host.pending(r),this._host.apply({op:"add",parent:n,index:i,node:r})}rowActions(e){let t=this._host.multi();return e.data&&!(t.length>1&&t.includes(e.data))&&this._host.select(e.data),this.handBack(this.actions())}onContextMenu(e,t){e.preventDefault(),e.stopPropagation();let n=this._host.multi();t&&!(n.length>1&&n.includes(t))&&this._host.select(t);let r=this.actions();0!==r.length&&(0,tq.l5)(this.handBack(r)).show({x:e.clientX,y:e.clientY})}constructor(e){this._host=e,this._deferred=new WeakSet}}t5.ONE_AT_A_TIME="Select one component for this",t5.NO_PARENT="It has no parent to move or copy it within";let t9=/^(INPUT|TEXTAREA|SELECT)$/;function t7(e,t){let n=e.target;if(n&&(t9.test(n.tagName)||n.isContentEditable))return;let r=t.editor.peek();if(!r)return;let i=e.ctrlKey||e.metaKey,o=ne(e,r);if(void 0!==o||"Delete"!==e.key||i){if(void 0===o&&"Escape"===e.key&&!t.inDrag())if(t.multi().length>1)o=()=>t.collapse();else{var a;let e=t.selected(),n=e?null==(a=t.instance())?void 0:a.parentOf(e):null;n&&(o=()=>t.select(n))}}else o=()=>t.run(t1);o&&(e.preventDefault(),e.stopPropagation(),o())}function ne(e,t){let n=e.ctrlKey||e.metaKey,r=e.key.toLowerCase();return n&&"z"===r&&!e.shiftKey?()=>t.undo():n&&("y"===r||"z"===r&&e.shiftKey)?()=>t.redo():void 0}var nt=n(6e3);function nn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function nr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function ni(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,i=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var o=[],a=!0,l=!1;try{for(i=i.call(e);!(a=(n=i.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==i.return||i.return()}finally{if(l)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return nn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nn(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}let no=[tR._w,"Misc","Description","Events"],na=new Set(["string","int","double","bool","string_list"]),nl="dataframe",ns="table",nu="Bind `table` to a data source (Bindings › table)";function nd(e,t){let n=void 0!==t&&t,r=e.node,i=e.meta(),o=i?i.props:(0,tT.W)(r.tag)?(0,tT.ix)(r.tag):[],a=new Map;var l=!0,s=!1,u=void 0;try{for(var d,c,p,h=o[Symbol.iterator]();!(l=(p=h.next()).done);l=!0){let e=p.value;if(nm(e)===nl)continue;let t=null!=(c=e.category)?c:"Properties",n=a.get(t);n?n.push(e):a.set(t,[e])}}catch(e){s=!0,u=e}finally{try{l||null==h.return||h.return()}finally{if(s)throw u}}let m=e.parent(),f=m?null==(d=e.instance.registry.get(m.tag))?void 0:d.childProps:void 0;void 0!==f&&f.length>0&&a.set(`Parent (${m.tag})`,f);let g=[];var v=!0,b=!1,y=void 0;try{for(var _,w=[...a].sort((e,t)=>nc(e[0])-nc(t[0]))[Symbol.iterator]();!(v=(_=w.next()).done);v=!0){let t=ni(_.value,2),i=t[0],o=t[1],a=()=>{let t=function(e){let t=e.built(),n={};if(ew.uA.is(t)){var r=!0,i=!1,o=void 0;try{for(var a,l,s=t.getProperties()[Symbol.iterator]();!(r=(l=s.next()).done);r=!0){let e=l.value;n[e.name]=null==(a=e.get)?void 0:a.call(e,t.propertyTarget)}}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}}return n}(e),i={};var a=!0,l=!1,s=void 0;try{for(var u,d,c,p,h,m=o[Symbol.iterator]();!(a=(h=m.next()).done);a=!0){let e=h.value,o=e.name,a=n?null==(c=r.bind)?void 0:c[o]:void 0;if(void 0!==a){i[o]=a;continue}let l=null!=(d=t[o])?d:null==(p=r.props)?void 0:p[o];i[o]=na.has(nm(e))?l:(u=l,void 0===u?"":JSON.stringify(u))}}catch(e){l=!0,s=e}finally{try{a||null==m.return||m.return()}finally{if(l)throw s}}return i};g.push({title:i,props:o.map(e=>(function(e,t){var n,r,i;let o=e.name,a=nm(e);return r=nr({},e),i=i={propertyType:void 0,type:"string_list"===a?"list":a,get:e=>e[o],set:(null==(n=t.bind)?void 0:n[o])===void 0&&na.has(a)?(e,t)=>e[o]=t:void 0},Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(i)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(i,e))}),r})(e,r)),values:a(),read:a})}}catch(e){b=!0,y=e}finally{try{v||null==w.return||w.return()}finally{if(b)throw y}}return g}let nc=e=>no.indexOf(e)+1;function np(e){let t=e.meta();return new Set(tR.s.filter(e=>void 0===t||t.props.includes(e)).map(e=>e.name))}function nh(e){var t,n,r;return(null==(t=e.error())?void 0:t.includes("needs a table"))===!0||(null==(n=e.node.bind)?void 0:n[ns])===void 0&&(null==(r=e.meta())?void 0:r.props.some(e=>e.name===ns&&nm(e)===nl))===!0}function nm(e){var t,n;return null!=(t=null!=(n=e.propertyType)?n:e.type)?t:"string"}function nf(e,t){return Object.keys(e).map(e=>({name:e,type:"string",description:t,get:t=>t[e],set:(t,n)=>t[e]=n}))}function ng(e){let t={};var n=!0,r=!1,i=void 0;try{for(var o,a=Object.keys(e)[Symbol.iterator]();!(n=(o=a.next()).done);n=!0)t[o.value]={commitOn:"change"}}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}return t}function nv(e){var t,n,r;let i=null==(t=e.instance.registry.get(e.node.tag))?void 0:t.props.find(e=>e.subBindable),o=null==(n=e.node.props)?void 0:n.func;if(void 0===i||"string"!=typeof o||""===o)return null;let a=null==(r=nt.S.funcRunner)?void 0:r.find(o);return a&&a.inputs.length>0?{prop:i.name,inputs:a.inputs}:null}function nb(e,t){var n;return nr({},null==(n=e.props)?void 0:n[t])}function ny(e){return nr({},e.node.bind)}function n_(e){var t,n,r,i,o;let a=null!=(t=null==(r=e.instance.registry.get(e.node.tag))?void 0:r.props)?t:(0,tT.W)(e.node.tag)?(0,tT.ix)(e.node.tag):[],l=e.parent(),s=l&&null!=(n=null==(i=e.instance.registry.get(l.tag))?void 0:i.childProps)?n:[],u=[];for(let t=0,n=[...a,...s];t<n.length;t++){let r=n[t];!0===r.subBindable||(null==(o=e.node.bind)?void 0:o[r.name])!==void 0||u.includes(r.name)||u.push(r.name)}return u}function nw(e){let t=null!=(a=e.node.on)?a:{},n={};var r=!0,i=!1,o=void 0;try{for(var a,l,s,u,d=(null!=(l=null==(s=e.meta())?void 0:s.events)?l:[])[Symbol.iterator]();!(r=(u=d.next()).done);r=!0){let e=u.value;n[e]=nx(t[e])}}catch(e){i=!0,o=e}finally{try{r||null==d.return||d.return()}finally{if(i)throw o}}var c=!0,p=!1,h=void 0;try{for(var m,f=Object.keys(t)[Symbol.iterator]();!(c=(m=f.next()).done);c=!0){let e=m.value;n[e]=nx(t[e])}}catch(e){p=!0,h=e}finally{try{c||null==f.return||f.return()}finally{if(p)throw h}}return n}function nx(e){return void 0===e?"":"string"==typeof e?e:e.cmd}function nk(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function nO(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,i=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var o=[],a=!0,l=!1;try{for(i=i.call(e);!(a=(n=i.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==i.return||i.return()}finally{if(l)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return nk(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nk(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}let nA=new WeakSet;function nS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}let nP=globalThis,nE=["input","select",".d4-column-selector"],nC={"u2-viewer-filters":new Set(["columnNames"])};function nj(){var e=!0,t=!1,n=void 0;try{for(var r,i=Array.from(document.body.querySelectorAll(".property-grid-item-editor-color-picker-host"))[Symbol.iterator]();!(e=(r=i.next()).done);e=!0)r.value.remove()}catch(e){t=!0,n=e}finally{try{e||null==i.return||i.return()}finally{if(t)throw n}}}var nT=n(199);function nN(e,t){let n=e.nodes().get(t);return void 0!==t.name&&ew.uA.is(n)&&(0,tW.P)(n)?n:void 0}function nI(e,t,n,r){let i=(0,nT.pQ)([t]);return void 0===n?{label:e,path:i,name:t,prop:r}:{label:e,path:n.bindProps().some(e=>!0===e.default)?i:null,name:t,prop:r,children:()=>(function e(t,n){let r=t.bindProps().map(r=>{let i=[...n,r.name];return!0!==r.walkable?{label:n$(r),path:(0,nT.pQ)(i),prop:r}:{label:n$(r),path:null,prop:r,children:()=>{let n=t.bindStep(r.name);return(0,tW.P)(n)?e(n,i):[]}}});return r.length>0?r:[{label:"nothing here yet — Refresh the source, or set designData to sample",path:null}]})(n,[t])}}function nD(e){let t=void 0===e.name?[]:[e];var n=!0,r=!1,i=void 0;try{for(var o,a,l=(null!=(o=e.children)?o:[])[Symbol.iterator]();!(n=(a=l.next()).done);n=!0){let e=a.value;t.push(...nD(e))}}catch(e){r=!0,i=e}finally{try{n||null==l.return||l.return()}finally{if(r)throw i}}return t}function n$(e){var t;let n=null!=(t=e.propertyType)?t:e.type,r=e.name;return null!=n&&""!==n&&(r+=` : ${n}`),null!=e.semType&&""!==e.semType&&(r+=` \xb7 ${e.semType}`),!0===e.writable?`${r} ⇄`:r}function nL(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function nz(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,i=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var o=[],a=!0,l=!1;try{for(i=i.call(e);!(a=(n=i.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==i.return||i.return()}finally{if(l)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return nL(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nL(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}let nF="App data",nB="Data sources",nM="Viewers",nR="Form controls",nq="Pick a value — a group has nothing to bind to on its own";function nH(e,t,n){let r=void 0===n?{}:n,i=new to.l(void 0===r.prop?"Bind to":`${r.prop} — bind to`);i.root.classList.add("u2-bind-picker");let o=function(e,t){let n=new Set;var r=!0,i=!1,o=void 0;try{for(var a,l,s=(null!=(a=e.spec.components)?a:[])[Symbol.iterator]();!(r=(l=s.next()).done);r=!0){let e=l.value;void 0!==e.name&&n.add(e.name)}}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}let u=new Set;var d=!0,c=!1,p=void 0;try{for(var h,m,f=nD(e.spec.root)[Symbol.iterator]();!(d=(m=f.next()).done);d=!0){let t=m.value;(null==(h=e.registry.get(t.tag))?void 0:h.category)===nM&&u.add(t.name)}}catch(e){c=!0,p=e}finally{try{d||null==f.return||f.return()}finally{if(c)throw p}}let g=new Set(Object.keys(e.ctx.data)),v=new Map([[nF,[]],[nB,[]],[nM,[]],[nR,[]]]);var b=!0,y=!1,_=void 0;try{for(var w,x,k=t[Symbol.iterator]();!(b=(x=k.next()).done);b=!0){let e=x.value,t=null!=(w=e.name)?w:"";v.get(n.has(t)?nB:g.has(t)?nF:u.has(t)?nM:nR).push(e)}}catch(e){y=!0,_=e}finally{try{b||null==k.return||k.return()}finally{if(y)throw _}}return[...v].filter(e=>nz(e,2)[1].length>0).map(e=>{let t=nz(e,2);return{title:t[0],nodes:t[1]}})}(e,function(e){let t=[];var n=!0,r=!1,i=void 0;try{for(var o,a,l=e.ctx.bindProps()[Symbol.iterator]();!(n=(a=l.next()).done);n=!0){let n=a.value,r=e.ctx.data[n.name];t.push(nI(n$(n),n.name,(0,tW.P)(r)?r:void 0,n))}}catch(e){r=!0,i=e}finally{try{n||null==l.return||l.return()}finally{if(r)throw i}}var s=!0,u=!1,d=void 0;try{for(var c,p=(null!=(o=e.spec.components)?o:[])[Symbol.iterator]();!(s=(c=p.next()).done);s=!0){let n=c.value,r=nN(e,n);void 0!==r&&t.push(nI(`${n.name} (${n.tag})`,n.name,r))}}catch(e){u=!0,d=e}finally{try{s||null==p.return||p.return()}finally{if(u)throw d}}var h=!0,m=!1,f=void 0;try{for(var g,v=nD(e.spec.root)[Symbol.iterator]();!(h=(g=v.next()).done);h=!0){let n=g.value,r=nN(e,n);void 0!==r&&r.bindProps().length>0&&t.push(nI(`${n.name} (${n.tag})`,n.name,r))}}catch(e){m=!0,f=e}finally{try{h||null==v.return||v.return()}finally{if(m)throw f}}return t}(e)),a=i.build(()=>new S.k({search:!0,inline:!0,placeholder:"Search bindings"})),l=i.build(()=>new e6.U),s=(0,_.Ln)("","u2-picker-empty");return l.expanded.value=new Set(o.map(e=>e.title)),i.effect(()=>{let e=a.value,t=[],n=[];var r=!0,i=!1,u=void 0;try{for(var d,c=o[Symbol.iterator]();!(r=(d=c.next()).done);r=!0){let r=d.value,i=function e(t,n,r,i){let o=void 0===r?"":r,a=void 0===i?3:i,l=n.trim().toLowerCase(),s=[],u=[];var d=!0,c=!1,p=void 0;try{for(var h,m=t[Symbol.iterator]();!(d=(h=m.next()).done);d=!0){let t=h.value,n=`${o}${t.label}`,r=t.children;if(""===l||t.label.toLowerCase().includes(l)){s.push({id:n,label:t.label,data:t,children:void 0===r?void 0:()=>Promise.resolve(e(r(),"",`${n}/`).rows)});continue}let i=a>0&&void 0!==r?e(r(),l,`${n}/`,a-1):void 0;void 0!==i&&0!==i.rows.length&&(u.push(n,...i.expand),s.push({id:n,label:t.label,data:t,children:i.rows}))}}catch(e){c=!0,p=e}finally{try{d||null==m.return||m.return()}finally{if(c)throw p}}return{rows:s,expand:u}}(r.nodes,e,`${r.title}/`);0!==i.rows.length&&(t.push({id:r.title,label:r.title,data:{label:r.title,path:null},children:i.rows}),n.push(...i.expand))}}catch(e){i=!0,u=e}finally{try{r||null==c.return||c.return()}finally{if(i)throw u}}l.setRoots(t),n.length>0&&(l.expanded.value=new Set([...l.expanded.peek(),...n]));let p=t.length>0;s.textContent=p?"":""===e.trim()?"Nothing to bind to yet — add a data source, or name a control.":`No bindings match "${e.trim()}".`,l.root.style.display=p?"":"none",s.style.display=p?"none":""}),i.add((0,_.yP)([a.root,l.root,s,(0,_.Ln)(`${nq}. App data comes from the app that opened the designer.`,"u2-bind-picker-hint")],"u2-bind-picker-body")),void 0!==r.current&&l.expandPath(function(e,t){let n=(0,nT.Rr)(t);if(null===n)return[];let r=e.find(e=>e.nodes.some(e=>e.name===n[0]));if(void 0===r)return[];let i=r.nodes.find(e=>e.name===n[0]),o=[r.title,`${r.title}/${i.label}`];var a=!0,l=!1,s=void 0;try{for(var u,d,c=n.slice(1)[Symbol.iterator]();!(a=(d=c.next()).done);a=!0){let e=d.value,t=null==(u=i.children)?void 0:u.call(i).find(t=>{var n;return(null==(n=t.prop)?void 0:n.name)===e});if(void 0===t)break;o.push(`${o[o.length-1]}/${t.label}`),i=t}}catch(e){l=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(l)throw s}}return o}(o,r.current)),i.onCancel(()=>i.dispose()),i.onOK(()=>{var e;let n=null==(e=l.selectedNode.peek())?void 0:e.data;return(null==n?void 0:n.path)==null?(g.shell.warning(nq),!1):!1!==t(n.path)&&void i.dispose()}),i.show({modal:!0,width:460})}function nW(e,t,n,r){let i=(0,y.gb)("ellipsis-h",n,{tooltip:void 0===r?"Pick a binding":r});i.dataset.u2BindPick=t,e.addOptions(i,{edits:!0})}class nV extends a.p{get clearButton(){return this._clear}createEditor(){let e=document.createElement("div");e.className="u2-bind-chip";let t=(0,_.Ln)("","u2-bind-chip-path");e.append(t),this.options.twoWay&&e.append((0,_.Ln)("⇄","u2-bind-chip-two-way")),this._clear=(0,y.gb)("times",this.options.onClear,{tooltip:"Remove binding"}),this._clear.classList.add("u2-bind-chip-clear"),e.append(this._clear);let n=e=>{this._clear.contains(e.target)||this.options.onPick()};return e.addEventListener("click",n),this.own(()=>e.removeEventListener("click",n)),this.effect(()=>{var e;return this.root.title=t.textContent=null!=(e=this.value)?e:""}),e}constructor(e){super(function(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},e),{value:e.path}),""),this.root.dataset.u2="bind-chip"}}function nG(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function nU(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function nK(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,i=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var o=[],a=!0,l=!1;try{for(i=i.call(e);!(a=(n=i.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==i.return||i.return()}finally{if(l)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return nG(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nG(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}let nY=/^[A-Za-z_$][A-Za-z0-9_$]*$/;function nQ(e,t,n){let r=void 0===n?{}:n;return e.map(e=>{var t,n,i,o;let a=e.name,l=null!=(t=null!=(n=e.caption)?n:e.friendlyName)?t:a,s=r[a];if(void 0!==s)return{name:a,caption:l,type:"string",description:`Bound to ${s}`,get:()=>s};let u=null!=(i=null!=(o=e.propertyType)?o:e.type)?i:"string";return{name:a,caption:l,type:"string_list"===u?"list":u,description:e.description,choices:e.choices,nullable:e.nullable,get:e=>e[a],set:(e,t)=>e[a]=t}})}function nJ(e){let t={};var n=!0,r=!1,i=void 0;try{for(var o,a=Object.entries(e)[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){let e=nK(o.value,2),n=e[0],r=e[1];null!=r&&""!==r&&(t[n]=r)}}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}return t}function nZ(e){var t,n,r;let i,a=new to.l(null!=(t=e.title)?t:"Pick a function");a.root.classList.add("u2-func-picker");let l=function(e){let t=e.filter(e=>nY.test(e.name)),n=new Map;var r=!0,i=!1,o=void 0;try{for(var a,l,s=t[Symbol.iterator]();!(r=(l=s.next()).done);r=!0){let e=l.value;n.set(e.name,(null!=(a=n.get(e.name))?a:0)+1)}}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}let u=t.map(e=>{var t,r,i,o;let a=null==(o=e.package)?void 0:o.name,l=a&&(null!=(t=n.get(e.name))?t:0)>1?`${a}:${e.name}`:e.name,s=null!=(r=e.friendlyName)?r:e.name,u=null!=(i=e.description)?i:"";return{name:l,label:s,description:u,search:`${l} ${s} ${u}`.toLowerCase(),func:e}});return u.sort((e,t)=>e.label.localeCompare(t.label)),u}(o.Func.find({})),u=eN(),d=a.build(()=>new S.k({search:!0,inline:!0,placeholder:"Search functions"})),c=(0,_.Ln)("","u2-picker-empty"),p=(0,_.y4)([],"u2-func-picker-params"),h=nU({},null==(n=e.pick)?void 0:n.args),m=nU({},null==(r=e.pick)?void 0:r.binds),f=l,g=new s.HG;a.own(()=>g.dispose());let v=()=>{if(g.dispose(),g=new s.HG,p.textContent="",void 0===i)return void p.append((0,_.Ln)("Pick a function to set its arguments.","u2-func-picker-hint"));let t=null!=(u=i.func.inputs)?u:[],n=new Set(t.map(e=>e.name));var r=!0,o=!1,l=void 0;try{for(var u,d,c=Object.keys(h)[Symbol.iterator]();!(r=(d=c.next()).done);r=!0){let e=d.value;n.has(e)||delete h[e]}}catch(e){o=!0,l=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw l}}var f=!0,b=!1,y=void 0;try{for(var w,x=Object.keys(m)[Symbol.iterator]();!(f=(w=x.next()).done);f=!0){let e=w.value;n.has(e)||delete m[e]}}catch(e){b=!0,y=e}finally{try{f||null==x.return||x.return()}finally{if(b)throw y}}if(0===t.length)return void p.append((0,_.Ln)(`${i.label} takes no arguments.`,"u2-func-picker-hint"));let k=g.build(()=>new e_(nQ(t,h,m),h,{condensed:!0}));var O=!0,A=!1,S=void 0;try{for(var P,E=t[Symbol.iterator]();!(O=(P=E.next()).done);O=!0){let t=P.value.name,n=k.input(t);void 0!==n&&(n.root.setAttribute("data-u2-prop",t),nW(n,t,()=>a.build(()=>nH(e.instance,e=>{m[t]=e,v()}))))}}catch(e){A=!0,S=e}finally{try{O||null==E.return||E.return()}finally{if(A)throw S}}p.append(k.root)},b=a.build(()=>new A.wj({itemHeight:28,keyOf:e=>e.name,render:(e,t,n)=>{var r,i;let o,a;return n.dataset.u2Func=e.name,r=e,o=[],""===(null!=(i=(a=u.icon(r.func)).textContent)?i:"").trim()&&o.push((0,_.y4)([a],"u2-func-row-icon")),o.push((0,_.Ln)(r.label,"u2-func-row-label")),r.name!==r.label&&o.push((0,_.Ln)(r.name,"u2-func-row-name")),""!==r.description&&o.push((0,_.Ln)(r.description,"u2-func-row-desc")),(0,_.y4)(o,"u2-func-row")}}));a.effect(()=>{let e,t=d.value;f=""===(e=t.trim().toLowerCase())?l:l.filter(t=>t.search.includes(e)),b.setItems(f);let n=f.length>0;c.textContent=n?"":""===t.trim()?"No functions are registered.":`No functions match "${t.trim()}".`,b.root.style.display=n?"":"none",c.style.display=n?"none":""}),a.effect(()=>{let e=f[b.selectedIndex.value];e!==i&&(i=e,v())});let y=void 0===e.pick?-1:f.findIndex(t=>t.name===e.pick.name);return y>=0&&(b.selectedIndex.value=y),a.add((0,_.yP)([d.root,b.root,c,p],"u2-func-picker-body")),a.onCancel(()=>a.dispose()),a.onOK(()=>{void 0!==i&&e.onPick({name:i.name,args:nU({},h),binds:nU({},m)}),a.dispose()}),a.show({modal:!0,width:560})}function nX(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function n0(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}let n2={name:"",type:"string_list"},n1="add-binding",n4=e=>e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/^./,e=>e.toUpperCase());function n3(e,t,n,r){let i=t.patch(n,r);return null===i||n6(e,i)}function n8(e,t,n){return!!n6(e,t)&&(n9(n),!0)}function n6(e,t){let n=e.canApply(t);return null===n?(e.apply(t),"set-event"===t.op&&void 0===t.command?g.shell.info(`${t.event}: command removed`):"set-bind"===t.op&&void 0===t.path&&g.shell.info(`${t.name}: binding removed`),!0):(g.shell.warning(n),!1)}function n5(){null==r||r.dispose(),r=void 0,i=void 0}function n9(e){(null==i?void 0:i.node)===e.node&&i.refresh(e)}class n7 extends o.ObjectHandler{get type(){return"u2-spec-node"}isApplicable(e){return e instanceof tI}getCaption(e){let t=e.node.name?`${e.node.name} (${e.node.tag})`:e.node.tag;return null===e.error()?t:`${t} — broken`}renderMarkup(e){return(0,_.Ln)(this.getCaption(e),"u2-designer-caption")}renderProperties(e){let t,n;n5();let a=e.editor,l=void 0===a?void 0:new s.HG;r=l,null==l||l.own(()=>null==t?void 0:t.dispose());let u=e=>(null==t||t.dispose(),t=void 0===l?void 0:new s.HG,[...n7._hint(e),...n7._status(e,t)]),d=this.renderMarkup(e),c=n7._identity(e),p=u(e),h=[d,(0,_.h3)("Node"),c,...p,...n7._verbs(e)],m=nw(e);void 0===a?h.push(...n7._tables(nd(e),m,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},e.node.bind),np(e))):(n=l.build(()=>(function(e,t,n,r){let i,a,l,u,d,c,p,h,m=e.node,f=s.HG.ambient,b=[],y=[],w=(e,n,r,i,o)=>{let a={values:n,read:r,patch:i};a.form=new e_(e,n,{condensed:!0,overrides:o,onChanged:(e,n)=>n3(t,a,e,n)});var l=!0,s=!1,u=void 0;try{for(var d,c,p=e[Symbol.iterator]();!(l=(c=p.next()).done);l=!0){let e=c.value;null==(d=a.form.input(e.name))||d.root.setAttribute("data-u2-prop",e.name)}}catch(e){s=!0,u=e}finally{try{l||null==p.return||p.return()}finally{if(s)throw u}}return b.push(a),a},x=(e,t,n)=>void 0===n?void y.push((0,_.h3)(e),t):(void 0===i&&(i=new tB.n,y.push(i.root)),i.addPane(e,t,n)),k=(h=e.built(),ew.uA.is(h)&&h.propertyTier);k&&(l=function(e,t,n){let r,i,a;if(void 0===nP.grok_PropertyGrid_Update||void 0===nP.grok_Viewer_Get_Look)return{root:(0,_.Ln)("The platform property grid is not available on this client","u2-designer-hint"),refresh:()=>{}};let l=new o.PropertyGrid;l.root.classList.add("u2-designer-look");let u=()=>{let t=e.built();if(t===r)return;null==i||i.dispose(),nj(),r=t;let u=l.root.querySelector(".property-grid-wrapper"),d=null!=(f=null==u?void 0:u.scrollTop)?f:0,c=l.root.contains(document.activeElement)?null==(g=document.activeElement.closest("tr[data-prop-name]"))?void 0:g.dataset.propName:document.activeElement===document.body?a:void 0;a=void 0,void 0===(i=t instanceof o.Viewer&&ew.uA.is(t)?function(e,t,n,r,i){var a,l,u,d;let c,p,h,m=new s.HG,f=(c=nC[t.node.tag],p=new Set((null!=(a=null==(l=t.meta())?void 0:l.props)?a:[]).filter(e=>nm(e)!==nl&&(null==c?void 0:c.has(e.name))!==!0).map(e=>e.name)),n.getProperties().filter(e=>p.has(e.name)));h=nP.grok_Viewer_Get_Look(n.dart),nP.grok_PropertyGrid_Update(e.dart,h,f.map(e=>o.toDart(e)),null!=(u=null==(d=n.dataFrame)?void 0:d.dart)?u:null);let g=nP.grok_Viewer_Get_Look(n.dart),v=new Map(f.map(e=>[e.name,e.get(g)])),b=new Map(n.getProperties().map(e=>[e.name,e])),y=new Map,_=n.onPropertyValueChanged.subscribe(e=>{var o,a,l;let s=null==e||null==(a=e.args)||null==(o=a.property)?void 0:o.name;if(void 0===s||nA.has(n)||!t.instance.designTime)return;i(s);let u=0===y.size;y.set(s,null==(l=b.get(s))?void 0:l.get(nP.grok_Viewer_Get_Look(n.dart))),u&&queueMicrotask(()=>r(function(e,t,n){let r=e.node,i=[],o=e.meta();var a=!0,l=!1,s=void 0;try{for(var u,d,c,p,h=t[Symbol.iterator]();!(a=(p=h.next()).done);a=!0){let e=(u=p.value,function(e){if(Array.isArray(e))return e}(u)||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var i=[],o=!0,a=!1;try{for(r=r.call(e);!(o=(t=r.next()).done)&&(i.push(t.value),2!==i.length);o=!0);}catch(e){a=!0,n=e}finally{try{o||null==r.return||r.return()}finally{if(a)throw n}}return i}}(u)||function(e){if(e){if("string"==typeof e)return nS(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return nS(e,2)}}(u)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),t=e[0],a=e[1],l=null==o?void 0:o.props.find(e=>e.name===t);if(!l||!na.has(nm(l))||(null==(d=r.bind)?void 0:d[t])!==void 0||n.has(t)&&ew.uA.sameValue(a,n.get(t)))continue;let s=null===a?void 0:a,h=null==(c=r.props)?void 0:c[t];ew.uA.sameValue(h,s)||void 0===h&&""===s||i.push({op:"set-prop",node:r,name:t,value:s})}}catch(e){l=!0,s=e}finally{try{a||null==h.return||h.return()}finally{if(l)throw s}}return t.clear(),i}(t,y,v)))});return m.own(()=>_.unsubscribe()),m}(l,e,t,n,e=>a=e):void 0)&&l.update({},[]),u&&(u.scrollTop=d);var p=!0,h=!1,m=void 0;try{for(var f,g,v,b,y=Array.from(l.root.querySelectorAll("tr[data-prop-name]"))[Symbol.iterator]();!(p=(b=y.next()).done);p=!0){let t=b.value;t.classList.toggle("u2-designer-look-set",(null==(v=e.node.props)?void 0:v[t.dataset.propName])!==void 0)}}catch(e){h=!0,m=e}finally{try{p||null==y.return||y.return()}finally{if(h)throw m}}void 0!==c&&function(e){if(null===e)return;let t=e.querySelector(nE.join(", "));null===t&&(e.tabIndex=-1),(null!=t?t:e).focus()}(l.root.querySelector(`tr[data-prop-name="${c}"]`))},d=t=>{let n=void 0===e.editor?void 0:ne(t,e.editor);void 0!==n&&(t.preventDefault(),t.stopPropagation(),n())};return l.root.addEventListener("keydown",d),t.own(()=>{var e;l.root.removeEventListener("keydown",d),null==i||i.dispose(),nj(),l.update({},[]),null==(e=nP.grok_Widget_Kill)||e.call(nP,l.root)}),u(),{root:l.root,refresh:u}}(e,r,e=>{try{let l=[];var n=!0,r=!1,i=void 0;try{for(var o,a=e[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){let e=o.value,n=t.canApply(e);null===n?l.push(e):g.shell.warning(n)}}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}t.applyAll(l)}catch(e){g.shell.error(e instanceof Error?e.message:String(e))}}),e.instance.designTime?y.push((0,_.h3)("Properties"),l.root):y.push((0,_.h3)("Properties (live)"),(0,_.Ln)("Edits here change the running view only and are not saved to the form — switch to Design to edit the form.","u2-designer-hint"),l.root));let O=(n,r)=>{let i=void 0===r?n:r;return()=>f.build(()=>{var r;return nH(e.instance,r=>n8(t,{op:"set-bind",node:m,name:n,path:r},e),{prop:i,current:null==(r=m.bind)?void 0:r[n]})})},A=n=>{let r;var i=!0,o=!1,a=void 0;try{for(var l,s,u,d,c=n[Symbol.iterator]();!(i=(d=c.next()).done);i=!0){let n=d.value,i=n.name,o=null==(u=m.bind)?void 0:u[i];if(void 0===o)continue;let a=new nV({path:o,label:null!=(l=null!=(s=n.caption)?s:n.friendlyName)?l:i,twoWay:!0===n.twoWay,onPick:O(i),onClear:()=>n8(t,{op:"set-bind",node:m,name:i,path:void 0},e)});a.clearButton.dataset.u2Unbind=i,(null!=r?r:r={})[i]={input:a}}}catch(e){o=!0,a=e}finally{try{i||null==c.return||c.return()}finally{if(o)throw a}}return r},S=(e,t)=>{var n=!0,r=!1,i=void 0;try{for(var o,a=t[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){let t=o.value;if(!0===t.subBindable&&!0!==t.bindable)continue;let n=e.form.input(t.name);void 0!==n&&nW(n,t.name,O(t.name))}}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}},P=np(e),E=[];r.own(()=>null==u?void 0:u.dispose());let C=new Map;if(!k){var j=!0,T=!1,N=void 0;try{for(var I,D=nd(e,!0)[Symbol.iterator]();!(j=(I=D.next()).done);j=!0){let e=I.value,t=(0,_.y4)([],"u2-designer-rows");if(C.set(e.title,t),e.title!==tR._w){x(e.title,t);continue}let n=e.props,r=()=>n.filter(e=>{var t,n;return P.has(e.name)&&((null==(t=m.props)?void 0:t[e.name])!==void 0||(null==(n=m.bind)?void 0:n[e.name])!==void 0)}).length,i=n.some(e=>!P.has(e.name)),o=x(e.title,t,r()>0||i);if(void 0!==o){let e=o.root.querySelector(".u2-accordion-title");(a=()=>{let t=r();e.textContent=t>0?`${tR._w} (${t})`:tR._w})()}}}catch(e){T=!0,N=e}finally{try{j||null==D.return||D.return()}finally{if(T)throw N}}}null!==nv(e)&&x("Parameters",d=(0,_.y4)([],"u2-designer-rows"));let L=()=>{var t=!0,n=!1,r=void 0;try{for(var i,o=E[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){let e=i.value;b.splice(b.indexOf(e),1)}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}E=[],null==u||u.dispose(),(u=new s.HG).build(()=>{if(!k){var t=!0,n=!1,r=void 0;try{for(var i,o=nd(e,!0)[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){let e=i.value,t=(e,t)=>{var n,r;if((null==(n=m.bind)?void 0:n[e])!==void 0)return null;let i=null==(r=m.props)?void 0:r[e];return P.has(e)&&(""===t||null===t)?void 0===i?null:{op:"set-prop",node:m,name:e,value:void 0}:tM.Y.same(n2,i,t)||""===t&&void 0===i?null:{op:"set-prop",node:m,name:e,value:t}},n=w(e.props,e.values,e.read,t,A(e.props));E.push(n),S(n,e.props),C.get(e.title).replaceChildren(n.form.root)}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}}let a=nv(e);if(null!==a){let e=nb(m,a.prop),t=w(nQ(a.inputs,e,function(e,t){let n={};var r=!0,i=!1,o=void 0;try{for(var a,l,s=Object.entries(null!=(a=e.bind)?a:{})[Symbol.iterator]();!(r=(l=s.next()).done);r=!0){let e=ni(l.value,2),r=e[0],i=e[1];r.startsWith(`${t}.`)&&(n[r.slice(t.length+1)]=i)}}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(m,a.prop)),e,()=>nb(m,a.prop),(e,t)=>{let n=nb(m,a.prop);return tM.Y.same(n2,n[e],t)||""===t&&void 0===n[e]?null:{op:"set-prop",node:m,name:a.prop,value:n0(nX({},n),{[e]:t})}});E.push(t);var l=!0,s=!1,u=void 0;try{for(var c,p=a.inputs[Symbol.iterator]();!(l=(c=p.next()).done);l=!0){let e=c.value,n=t.form.input(e.name),r=`${a.prop}.${e.name}`;void 0!==n&&nW(n,r,O(r,e.name))}}catch(e){s=!0,u=e}finally{try{l||null==p.return||p.return()}finally{if(s)throw u}}null==d||d.replaceChildren(t.form.root)}})};L();let z=()=>{let n=ny(e),r=Object.keys(n),i=n_(e),o=w(nf(n,"Bound context path").map(e=>{var t;let n;return n0(nX({},e),{caption:(n=(t=e.name).indexOf("."))<0?n4(t):`${n4(t.slice(0,n))} › ${t.slice(n+1)}`})}),n,()=>{let t=ny(e),n={};var i=!0,o=!1,a=void 0;try{for(var l,s,u=r[Symbol.iterator]();!(i=(s=u.next()).done);i=!0){let e=s.value;n[e]=null!=(l=t[e])?l:""}}catch(e){o=!0,a=e}finally{try{i||null==u.return||u.return()}finally{if(o)throw a}}return n},(e,t)=>{var n,r;return t===(null!=(n=null==(r=m.bind)?void 0:r[e])?n:"")?null:{op:"set-bind",node:m,name:e,path:""===t?void 0:t}},ng(n));var a=!0,l=!1,s=void 0;try{for(var u,d=r[Symbol.iterator]();!(a=(u=d.next()).done);a=!0){let n=u.value,r=o.form.input(n);void 0!==r&&nW(r,n,()=>f.build(()=>{var r;return nH(e.instance,e=>n3(t,o,n,e),{prop:n,current:null==(r=m.bind)?void 0:r[n]})}))}}catch(e){l=!0,s=e}finally{try{a||null==d.return||d.return()}finally{if(l)throw s}}if(k||i.length>0){let e=new v.o({label:"Add binding…",nullable:!0,items:i.map(e=>({value:e,label:n4(e)})),tooltipText:"The property to bind; … picks what it follows"});e.root.setAttribute("data-u2-prop",n1),o.form.add(e),nW(e,n1,()=>{let t=e.peek();null===t?g.shell.warning("Add binding: pick the property first"):O(t)()})}return o};r.own(()=>null==c?void 0:c.dispose());let F=(0,_.y4)([],"u2-designer-bindings"),B=()=>{void 0!==p&&b.splice(b.indexOf(p),1),null==c||c.dispose(),p=(c=new s.HG).build(z),F.replaceChildren(p.form.root)},M=Object.keys(ny(e)).length>0;if((M||k||null!==nv(e)||n_(e).length>0)&&(B(),x("Bindings",F,M||nh(e))),Object.keys(n).length>0){let r=w(nf(n,"The function this event calls — pick one with the … button, or type cmd: plus its name"),n,()=>nw(e),(e,t)=>{var n;return t===nx(null==(n=m.on)?void 0:n[e])?null:{op:"set-event",node:m,event:e,command:""===t?void 0:t}},ng(n));x("Events",r.form.root,!0);var R=!0,q=!1,H=void 0;try{for(var W,V=Object.keys(n)[Symbol.iterator]();!(R=(W=V.next()).done);R=!0){let n=W.value,i=r.form.input(n);void 0!==i&&nW(i,n,()=>f.build(()=>{var r;return nZ({title:`${n}: pick a function`,instance:e.instance,pick:function(e){let t=void 0===e?"":"string"==typeof e?e:e.cmd;if(!t.startsWith("cmd:"))return;let n=t.slice(4);if(""===n||n.startsWith("#")||n.includes(".")&&!n.includes(":"))return;let r={name:n,args:{},binds:{}},i="object"==typeof e&&null!=(s=e.args)?s:{};var o=!0,a=!1,l=void 0;try{for(var s,u,d=Object.entries(i)[Symbol.iterator]();!(o=(u=d.next()).done);o=!0){let e=nK(u.value,2),t=e[0],n=e[1];"string"==typeof n&&n.startsWith("$.")?r.binds[t]=n:r.args[t]="string"==typeof n&&n.startsWith("$$.")?n.slice(1):n}}catch(e){a=!0,l=e}finally{try{o||null==d.return||d.return()}finally{if(a)throw l}}return r}(null==(r=m.on)?void 0:r[n]),onPick:e=>n6(t,{op:"set-event",node:m,event:n,command:function(e){let t=nJ(e.args);var n=!0,r=!1,i=void 0;try{for(var o,a=Object.entries(t)[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){let e=nK(o.value,2),n=e[0],r=e[1];"string"==typeof r&&r.startsWith("$.")&&(t[n]=`$${r}`)}}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}return Object.assign(t,e.binds),0===Object.keys(t).length?`cmd:${e.name}`:{cmd:`cmd:${e.name}`,args:t}}(e)})})}),"Pick a function")}}catch(e){q=!0,H=e}finally{try{R||null==V.return||V.return()}finally{if(q)throw H}}}return r.effect(()=>{let n=t.onDidApply.value;if(null==l||l.refresh(),n&&!n.structural&&n.patches.some(t=>t.node===e.node)){n.patches.some(t=>t.node===e.node&&"set-bind"===t.op)&&L();var r=!0,i=!1,o=void 0;try{for(var s,u=b[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){let e=s.value;Object.assign(e.values,e.read()),e.form.refresh()}}catch(e){i=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(i)throw o}}null==a||a()}}),{sections:y,refresh:()=>{L(),B(),null==l||l.refresh()}}})(e,a,m,l)),h.push(...n.sections));let f=e=>{d.textContent=this.getCaption(e);let t=n7._identity(e);c.replaceWith(t),c=t;var n=!0,r=!1,i=void 0;try{for(var o,a=p[Symbol.iterator]();!(n=(o=a.next()).done);n=!0)o.value.remove()}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}p=u(e);let l=c.nextSibling;var s=!0,h=!1,m=void 0;try{for(var f,g=p[Symbol.iterator]();!(s=(f=g.next()).done);s=!0){let e=f.value;c.parentElement.insertBefore(e,l)}}catch(e){h=!0,m=e}finally{try{s||null==g.return||g.return()}finally{if(h)throw m}}};if(i={node:e.node,refresh:e=>{null==n||n.refresh(),f(e)}},void 0!==a){let t=a.onDidApply.peek();l.effect(()=>{let n=a.onDidApply.value;n!==t&&(null==n?void 0:n.patches.some(t=>t.node===e.node))&&null!==c.parentElement&&f(e)})}return(0,_.yP)(h,"u2-designer-properties")}static _identity(e){var t;let n={Tag:e.node.tag,Name:null!=(t=e.node.name)?t:"",Path:e.path()},r=e.error();return null!==r&&(n.Error=nh(e)?(0,_.yP)([(0,_.Ln)(r),(0,_.Ln)(nu,"u2-designer-hint")]):r),(0,tF.V)(n)}static _hint(e){return null===e.error()&&nh(e)?[(0,_.Ln)(nu,"u2-designer-hint")]:[]}static _verbs(e){var t,n,r,i;let o=new Set((null!=(t=null==(r=e.instance.registry.get(e.node.tag))?void 0:r.designerActions)?t:[]).map(e=>e.text)),a=(null!=(n=null==(i=e.actions)?void 0:i.call(e))?n:[]).filter(e=>o.has(e.text));return 0===a.length?[]:[(0,_._Q)(a.map(e=>(0,_.x6)(e.text,e.run)),"u2-designer-verbs")]}static _status(e,t){var n;let r=e.built();if(!ew.uA.is(r)||null===tU(r))return[];let i=(null==(n=e.meta())?void 0:n.props.some(e=>"designData"===e.name))===!0?null:"always live — this source has no design-time policy",o=(0,_.yP)([],"u2-designer-status"),a=()=>{let e=tU(r),t={};""!==e.state&&(t.State="idle"===e.state?"idle — not run yet; use Refresh":e.state),null!==e.count&&(t["rows"===e.counts?"Rows":"Entities"]=e.count),null!==e.error&&(t.Error=e.error),null!==i&&(t["Design data"]=i),o.textContent="",o.append((0,tF.V)(t))};return void 0===t?a():t.effect(a),[(0,_.h3)("Status"),o]}static _tables(e,t,n,r){let i=[];var o=!0,a=!1,l=void 0;try{for(var s,u=e[Symbol.iterator]();!(o=(s=u.next()).done);o=!0){let e=s.value,t={};var d=!0,c=!1,p=void 0;try{for(var h,m=e.props[Symbol.iterator]();!(d=(h=m.next()).done);d=!0){let n=h.value,i=e.values[n.name];r.has(n.name)&&(void 0===i||""===i)||(t[n.name]=(0,B.Qq)(i))}}catch(e){c=!0,p=e}finally{try{d||null==m.return||m.return()}finally{if(c)throw p}}Object.keys(t).length>0&&i.push((0,_.h3)(e.title),(0,tF.V)(t))}}catch(e){a=!0,l=e}finally{try{o||null==u.return||u.return()}finally{if(a)throw l}}return Object.keys(t).length>0&&i.push((0,_.h3)("Events"),(0,tF.V)(t)),Object.keys(n).length>0&&i.push((0,_.h3)("Bindings"),(0,tF.V)(n)),i}}function re(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}o.ObjectHandler;let rt=["Containers","Viewers","Inputs","Actions","Display","Data"],rn=new Map;class rr extends ew.Ec{_apply(e){let t=""!==e;var n=!0,r=!1,i=void 0;try{for(var o,a=this._groups[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){let n=o.value,r=0;var l=!0,s=!1,u=void 0;try{for(var d,c,p=n.items[Symbol.iterator]();!(l=(c=p.next()).done);l=!0){let n=c.value,i=t&&!n.text.includes(e);n.el.hidden=i,!i&&r++}}catch(e){s=!0,u=e}finally{try{l||null==p.return||p.return()}finally{if(s)throw u}}n.pane.root.hidden=t&&0===r,t&&r>0?n.pane.expanded.value=!0:t||(n.pane.expanded.value=null==(d=rn.get(n.category))||d)}}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}}static _grouped(e){let t=new Map;var n=!0,r=!1,i=void 0;try{for(var o,a,l,s=e.metas()[Symbol.iterator]();!(n=(l=s.next()).done);n=!0){let e=l.value,n=null!=(a=e.category)?a:"Other",r=t.get(n);r?r.push(e):t.set(n,[e])}}catch(e){r=!0,i=e}finally{try{n||null==s.return||s.return()}finally{if(r)throw i}}let u=e=>{let t=rt.indexOf(e);return -1===t?rt.length:t},d=new Map([...t].sort((e,t)=>u(e[0])-u(t[0])));return null==(o=d.get("Viewers"))||o.sort((e,t)=>rr._label(e).localeCompare(rr._label(t))),d}static _label(e){var t;return null!=(t=e.label)?t:e.tag.startsWith("u2-")?e.tag.slice(3):e.tag}static _item(e){var t,n;let r=(0,_.y4)([],"u2-palette-item"),i=null==(n=e.icon)?void 0:n.call(e);return i&&r.append((0,_.y4)([i],"u2-palette-item-icon")),r.append((0,_.Ln)(rr._label(e),"u2-palette-item-label")),r.title=null!=(t=e.usage)?t:e.description,r.dataset.u2Tag=e.tag,r}constructor(e){super(),this._groups=[],this.root.classList.add("u2-palette"),this.root.dataset.u2="palette",this.filter=this.build(()=>new S.k({search:!0,inline:!0,placeholder:"Filter"}));const t=this.build(()=>new tB.n);t.root.classList.add("u2-palette-list"),this.root.append(this.filter.root,t.root);var n=!0,r=!1,i=void 0;try{for(var o,a,l=rr._grouped(e)[Symbol.iterator]();!(n=(a=l.next()).done);n=!0){const e=function(e){return function(e){if(Array.isArray(e))return e}(e)||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var i=[],o=!0,a=!1;try{for(r=r.call(e);!(o=(t=r.next()).done)&&(i.push(t.value),2!==i.length);o=!0);}catch(e){a=!0,n=e}finally{try{o||null==r.return||r.return()}finally{if(a)throw n}}return i}}(e)||function(e){if(e){if("string"==typeof e)return re(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return re(e,2)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(a.value),n=e[0],r=e[1].map(e=>{var t;return{el:rr._item(e),text:`${e.tag} ${rr._label(e)} ${e.description} ${null!=(t=e.usage)?t:""}`.toLowerCase()}}),i=t.addPane(n,(0,_.y4)(r.map(e=>e.el)),null==(o=rn.get(n))||o);this._groups.push({category:n,pane:i,items:r}),this.effect(()=>{let e=i.expanded.value;""===this.filter.peek().trim()&&rn.set(n,e)})}}catch(e){r=!0,i=e}finally{try{n||null==l.return||l.return()}finally{if(r)throw i}}this.effect(()=>this._apply(this.filter.value.trim().toLowerCase()))}}var ri=n(8651);function ro(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}let ra="u2-func-source",rl="u2-table-source",rs="u2-entity-source",ru="u2-state";function rd(e,t,n,r,i){let o=(0,tH.I5)(e,t,n),a=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},o.props,r);return Object.keys(a).length>0&&(o.props=a),void 0!==i&&Object.keys(i).length>0&&(o.bind=i),o}class rc extends ew.Ec{update(e,t){this._instance=e,this._chips.clear(),null==(u=this._pulse)||u.dispose(),this._pulse=void 0,this.root.textContent="",this.root.append(this._plus);let n=null!=(l=null==e?void 0:e.spec.components)?l:[];if(0===n.length)return void this.root.append((0,_.y4)(["Data sources"],"u2-designer-tray-hint"));let r=new s.HG;this._pulse=r;var i=!0,o=!1,a=void 0;try{for(var l,u,d,c,p=n[Symbol.iterator]();!(i=(c=p.next()).done);i=!0){let n=c.value,i=(0,_.y4)([],"u2-designer-chip"),o=new tI(e,n);i.textContent=t$(n),i.title=null!=(d=o.error())?d:n.tag,void 0!==n.name&&(i.dataset.u2Name=n.name),i.classList.toggle("u2-designer-chip-broken",null!==o.error()),i.classList.toggle("u2-designer-chip-selected",n===t),this._chips.set(i,n),this.root.append(i),rc._pulseOf(r,i,o)}}catch(e){o=!0,a=e}finally{try{i||null==p.return||p.return()}finally{if(o)throw a}}}static _pulseOf(e,t,n){var r;let i=n.built();if(!ew.uA.is(i))return;let o=null!=(r=n.error())?r:n.node.tag;e.effect(()=>{let e=tU(i);t.classList.toggle("u2-designer-chip-loading",(null==e?void 0:e.state)==="loading"),t.classList.toggle("u2-designer-chip-error",(null==e?void 0:e.error)!=null),t.title=null===e?o:`${o} — ${tK(e)}`})}setDropTarget(e){this.root.classList.toggle("u2-designer-tray-drop",e)}_menu(){let e=this._instance;if(void 0===e)return;let t=new tk.W,n=null!=(a=null==(l=nt.S.workspace)?void 0:l.tableNames())?a:[];t.group("Open tables"),0===n.length&&t.item("No open tables",()=>{},{disabled:"Open a table in Datagrok to add it here"});var r=!0,i=!1,o=void 0;try{for(var a,l,s,u=n[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){let n=s.value;t.item(n,()=>this._addTable(e,n))}}catch(e){i=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(i)throw o}}t.endGroup(),t.item("Function or query…",()=>this._addFunc(e)),t.item("Entity collection…",()=>this._addEntities(e)),t.item("State variable",()=>this._insert(e,ru,(0,tH.VJ)(ru),{})),t.show({anchor:this._plus})}_addTable(e,t){this._insert(e,rl,rp(t,(0,tH.VJ)(rl)),{table:t}),g.shell.info(`${t} references the open table by name; prefer a query or project table for a durable form.`)}_addFunc(e){this.build(()=>nZ({title:"Data source: function or query",instance:e,onPick:t=>this._options.onAdd((0,tH.VJ)(ra),n=>(function(e,t,n){let r={func:n.name},i=nJ(n.args);Object.keys(i).length>0&&(r.params=i);let o={};var a=!0,l=!1,s=void 0;try{for(var u,d,c=Object.entries(n.binds)[Symbol.iterator]();!(a=(d=c.next()).done);a=!0){let e=(u=d.value,function(e){if(Array.isArray(e))return e}(u)||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var i=[],o=!0,a=!1;try{for(r=r.call(e);!(o=(t=r.next()).done)&&(i.push(t.value),2!==i.length);o=!0);}catch(e){a=!0,n=e}finally{try{o||null==r.return||r.return()}finally{if(a)throw n}}return i}}(u)||function(e){if(e){if("string"==typeof e)return ro(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return ro(e,2)}}(u)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),t=e[0],n=e[1];o[`params.${t}`]=n}}catch(e){l=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(l)throw s}}return rd(e,ra,t,r,o)})(e.registry.get(ra),n,t))}))}_addEntities(e){this.build(()=>{let t=new v.o({label:"Collection",items:ri.I,value:ri.I["0"]}),n=new S.k({label:"Filter",placeholder:"A smart-search filter"}),r=new q.Q({label:"Page size",mode:"int",value:20}),i=new to.l("Data source: entity collection");i.add(t).add(n).add(r).onOK(()=>{var o,a;let l={entity:null!=(o=t.peek())?o:ri.I["0"],pageSize:null!=(a=r.peek())?a:20},s=n.peek().trim();""!==s&&(l.filter=s),i.dispose(),this._insert(e,rs,(0,tH.VJ)(rs),l)}).onCancel(()=>i.dispose()).show({modal:!0,width:360})})}_insert(e,t,n,r){this._options.onAdd(n,n=>rd(e.registry.get(t),t,n,r))}constructor(e){super(),this._options=e,this._chips=new Map,this.own(()=>{var e;return null==(e=this._pulse)?void 0:e.dispose()}),this.root.classList.add("u2-designer-tray"),this.root.dataset.u2="tray",this._plus=(0,y.gb)("plus",()=>this._menu(),{tooltip:"Add a data source"}),this._plus.classList.add("u2-designer-tray-add");const t=e=>this._chips.get(e.target.closest(".u2-designer-chip"));this.scope.listen(this.root,"click",n=>{let r=t(n);r&&e.onSelect(r)}),this.scope.listen(this.root,"contextmenu",n=>{n.preventDefault(),n.stopPropagation();let r=t(n);r&&e.onContext(r,n.clientX,n.clientY)})}}function rp(e,t){let n=e.split(/[^A-Za-z0-9_$]+/).filter(e=>""!==e).map((e,t)=>0===t?e:e.charAt(0).toUpperCase()+e.slice(1)).join("");return""===n||/^\d/.test(n)?t:n}function rh(e,t,n){if(!n){t.style.display="none";return}let r=e.getBoundingClientRect();t.style.display="block",t.style.left=`${n.x-r.left+e.scrollLeft}px`,t.style.top=`${n.y-r.top+e.scrollTop}px`,t.style.width=`${n.width}px`,t.style.height=`${n.height}px`}function rm(e,t){let n=e.get(t.tag);return n?!0===n.acceptsChildren||void 0!==n.adopt||void 0!==n.createWithChildren:(0,tT.W)(t.tag)}function rf(e,t,n,r,i,o){var a;if(!o||e.parentOf(o)!==t)return{parent:t,index:n,kind:r,rect:i};let l=(null!=(a=t.children)?a:[]).indexOf(o),s=n>l?n-1:n;return s===l?null:{parent:t,index:s,kind:r,rect:i}}function rg(e,t){let n=new tI(e,t).element();if(!n)return null;let r=n.getBoundingClientRect();return{x:r.left,y:r.top,width:r.width,height:r.height}}let rv="u2-func-source",rb=["csv","tsv","txt","d42"];function ry(e){let t,n=[],r=[];var i=!0,a=!1,l=void 0;try{for(var s,u=(Array.isArray(e)?e:[e])[Symbol.iterator]();!(i=(s=u.next()).done);i=!0){let e=s.value;if(e instanceof o.FileInfo){null!=t||(t=function(){let e=new Set(rb);var t=!0,n=!1,r=void 0;try{for(var i,a=o.Func.find({meta:{role:"file-handler"}})[Symbol.iterator]();!(t=(i=a.next()).done);t=!0){let t=i.value;var l=!0,s=!1,u=void 0;try{for(var d,c,p=String(null!=(d=t.options.ext)?d:"").split(",")[Symbol.iterator]();!(l=(c=p.next()).done);l=!0){let t=c.value.trim().toLowerCase();""!==t&&e.add(t)}}catch(e){s=!0,u=e}finally{try{l||null==p.return||p.return()}finally{if(s)throw u}}}}catch(e){n=!0,r=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw r}}return e}());let i=function(e,t){let n=e.fileName;if(e.isDirectory)return`${n}: a folder is not a table — drop a file`;let r=e.extension.toLowerCase();return""===r?`${n}: nothing opens a file with no extension as a table`:t.has(r)?null:`${n}: nothing opens .${r} files as a table`}(e,t);null===i?n.push(function(e){let t=e.fileName,n=e.extension,r=""===n?t.length:t.length-n.length-1;return{kind:"file",ref:"OpenFile",params:{fullPath:e.fullPath},label:t.slice(0,r),runs:!0}}(e)):r.push(i)}else e instanceof o.Func&&n.push(function(e){var t;return{kind:"func",ref:o.Func.find({name:e.name}).length>1?e.nqName:e.name,params:{},label:null!=(t=e.friendlyName)?t:e.name,runs:!1}}(e))}}catch(e){a=!0,l=e}finally{try{i||null==u.return||u.return()}finally{if(a)throw l}}return{items:n,refused:r}}var r_=n(7119),rw=n(9271);class rx{get dragging(){return void 0!==this.drag||this.platformDrag}onPaneDown(e){if(0!==e.button)return;this.dragged=!1,this._host.refocus();let t=this._host.hit(e),n=this._host.instance();t&&n&&t!==n.spec.root&&(this.drag={node:t,label:t$(t),x:e.clientX,y:e.clientY,active:!1,target:null})}onPaletteDown(e){var t,n,r;if(0!==e.button)return;let i=e.target.closest(".u2-palette-item");if(!i)return;e.preventDefault();let o=i.dataset.u2Tag;this.drag={tag:o,label:null!=(t=i.textContent)?t:"",x:e.clientX,y:e.clientY,active:!1,target:null,tray:void 0!==o&&(null==(r=this._host.instance())||null==(n=r.registry.get(o))?void 0:n.visual)===!1}}onMove(e){let t=this.drag,n=this._host.instance();if(!t||!n)return;let r=this._host.root;if(!t.active){if(4>Math.abs(e.clientX-t.x)&&4>Math.abs(e.clientY-t.y))return;t.active=!0,this._ghost.textContent=t.label,r.append(this._ghost)}let i=r.getBoundingClientRect();if(this._ghost.style.left=`${e.clientX-i.left+r.scrollLeft+12}px`,this._ghost.style.top=`${e.clientY-i.top+r.scrollTop+12}px`,t.tray){let n=r.getBoundingClientRect();t.over=e.clientX>=n.left&&e.clientX<=n.right&&e.clientY>=n.top&&e.clientY<=n.bottom,this._host.tray.setDropTarget(t.over);return}let o=this._host.hit(e);t.target=null!==o||this._overPane(e)?function(e,t,n,r,i){var o,a,l,s;let u=e.registry;if(!t){let t=e.spec.root;if(!rm(u,t))return null;let n=rg(e,t);return n?rf(e,t,(null!=(l=t.children)?l:[]).length,"into",n,i):null}if(i&&(i===t||tT.R4.contains(i,t)))return null;if(rm(u,t)){let n=rg(e,t);return n?rf(e,t,(null!=(s=t.children)?s:[]).length,"into",n,i):null}let d=e.parentOf(t);if(!d||!rm(u,d))return null;let c=rg(e,t),p=new tI(e,d).element();if(!c||!p)return null;let h=(null!=(o=getComputedStyle(p).flexDirection)?o:"").startsWith("row"),m=h?n>c.x+c.width/2:r>c.y+c.height/2,f=(null!=(a=d.children)?a:[]).indexOf(t)+ +!!m;return rf(e,d,f,"line",h?{x:m?c.x+c.width:c.x,y:c.y,width:2,height:c.height}:{x:c.x,y:m?c.y+c.height:c.y,width:c.width,height:2},i)}(n,o,e.clientX,e.clientY,t.node):null,this.showDrop(t.target)}end(e){let t=this.drag;this.drag=void 0,!t||!t.active||(this._ghost.remove(),this.showDrop(null),this._host.tray.setDropTarget(!1),this.dragged=!0,this._host.refocus(),e&&(t.tray?this._dropComponent(t):t.target&&this.drop(t,t.target)))}_dropComponent(e){if(!0!==e.over)return;let t=e.tag;this.addComponent((0,tH.VJ)(t),(e,n)=>{var r;return(0,tH.I5)(null==(r=this._host.instance())?void 0:r.registry.get(t),t,e,n)})}addComponent(e,t){var n;let r=this._host.editor.peek(),i=this._host.instance();if(!r||!i)return;let o=r.uniqueNames(),a=t(o(e),o);this._host.pending(a),this._host.apply({op:"add-component",index:(null!=(n=i.spec.components)?n:[]).length,node:a})}dropSources(e){var t;e.refused.length>0&&g.shell.warning(e.refused.join("; "));let n=this._host.editor.peek(),r=this._host.instance();if(!n||!r||0===e.items.length)return;let i=n.uniqueNames(),o=e.items.map(e=>{var t;let n;return t=r.registry,n={func:e.ref},Object.keys(e.params).length>0&&(n.params=e.params),rd(t.get(rv),rv,i(rp(e.label,(0,tH.VJ)(rv))),n)}),a=(null!=(t=r.spec.components)?t:[]).length,l=o.map((e,t)=>({op:"add-component",index:a+t,node:e})),s=n.canApply(l[0]);if(s)return void g.shell.warning(s);this._host.pending(o[0]),n.applyAll(l);for(let t=0;t<o.length;t++)e.items[t].runs&&this._host.refresh(o[t])}drop(e,t){var n,r,i,o,a;let l,s,u=this._host.editor.peek();if(!u)return;if(e.node){this._host.pending(e.node),this._host.apply({op:"move",node:e.node,parent:t.parent,index:t.index});return}let d=e.tag,c=this._host.instance(),p=u.uniqueNames(),h=(0,tH.I5)(null==c?void 0:c.registry.get(d),d,p((0,tH.VJ)(d)),p),m=(void 0===c||(l=(null==(n=c.registry.get(h.tag))?void 0:n.props.some(e=>"table"===e.name&&nm(e)===nl))===!0,s=(null!=(i=c.spec.components)?i:[]).filter(e=>{var t;return(null==(t=nN(c,e))?void 0:t.bindProps().some(e=>{var t;return!0===e.default&&(null!=(t=e.propertyType)?t:e.type)==="dataframe"}))===!0}),l&&1===s.length&&(null==(r=h.bind)?void 0:r.table)===void 0&&(o=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},h.bind),a=a={table:(0,nT.pQ)([s[0].name])},Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(a)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(a)).forEach(function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(a,e))}),h.bind=o)),h);this._host.pending(m),this._host.apply({op:"add",parent:t.parent,index:t.index,node:m})}showDrop(e){rh(this._host.root,this.into,e&&"into"===e.kind?e.rect:null),rh(this._host.root,this.line,e&&"line"===e.kind?e.rect:null)}_overPane(e){return this._host.pane.isConnected&&document.elementsFromPoint(e.clientX,e.clientY).includes(this._host.pane)}constructor(e){this._host=e,this.into=(0,_.y4)([],"u2-designer-drop-into"),this.line=(0,_.y4)([],"u2-designer-drop-line"),this._ghost=(0,_.y4)([],"u2-designer-drag-ghost"),this.platformDrag=!1,this.dragged=!1}}var rk=n(4980);class rO{hit(e){let t=this._host.instance();if(!t)return null;var n=!0,r=!1,i=void 0;try{for(var o,a=document.elementsFromPoint(e.clientX,e.clientY)[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){let e=o.value;if(!this._host.surface.contains(e))continue;let n=t.nodeAt(e);if(n)return n}}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}return null}onCanvasClick(e){if(this._host.dragged())return;if(e.ctrlKey||e.metaKey){let t=this.hit(e);t&&this.toggleMulti(t);return}if(this._forwardHeader(e))return;let t=this.hit(e);t&&this.select(t)}toggleMulti(e){let t=this.multi.filter(t=>t!==e);if(t.length===this.multi.length)t.push(e);else if(0===t.length)return;1===t.length?this.select(t[0]):this.selectMulti(t,t.includes(e)?e:t[t.length-1])}_forwardHeader(e){var t,n,r;let i=this._host.instance();if(!i)return!1;let o=document.elementsFromPoint(e.clientX,e.clientY).find(e=>this._host.surface.contains(e));if(!o)return!1;let a=o.closest(".u2-tabs-tab"),l=null!=a?a:o.closest(".u2-accordion-header");if(!l)return!1;let s=i.nodeAt(l),u=s?i.nodes().get(s):void 0;if(a&&u instanceof rk.q&&void 0!==a.dataset.id){u.activeTab.value=a.dataset.id;let e=null==(t=s.children)?void 0:t[Number(a.dataset.id.slice(4))];return this.select(null!=e?e:s),!0}if(!a&&u instanceof tB.n){let e=Array.prototype.indexOf.call(u.root.children,l.parentElement),t=u.paneAt(e);return!!t&&(t.expanded.value=!t.expanded.peek(),t.expanded.peek()&&this.select(null!=(n=null==(r=s.children)?void 0:r[e])?n:s),!0)}return!1}select(e,t){var n;let r,i=this._host.instance();if(!i)return;this.selected=e,this.multi=[e],this._reveal(e),this.reposition(),this._host.tray.update(i,e),this._host.report(),this._host.touch(),g.shell.windows.showContextPanel=!0,this._issue(i,e);let o=null==(n=this._host.model())?void 0:n.ids.get(e);(void 0===t||t)&&void 0!==o&&this._host.tree.expandPath((r=o.split(".")).map((e,t)=>r.slice(0,t+1).join(".")))}_issue(e,t){let n=new tI(e,t,this._host.editor.peek(),()=>this._host.actions());this._shownBroken=null!==n.error(),g.shell.o=n}_issueMulti(e,t){g.shell.o=new tD(t.map(t=>new tI(e,t,this._host.editor.peek())))}reassert(){let e=this._host.instance();if(e&&this.selected){if(this.multi.length>1)return void this._issueMulti(e,this.multi);n9(new tI(e,this.selected)),this._issue(e,this.selected)}}followRerender(){let e=this._host.instance();e&&this.selected&&!(this.multi.length>1)&&null!==new tI(e,this.selected).error()!==this._shownBroken&&this.reassert()}onTreeSelection(e){e&&(e!==this.selected?this.select(e,!1):this.multi.length>1&&queueMicrotask(()=>{this.multi.length>1&&e===this.selected&&this._host.tree.selectedNodes.peek().length<=1&&this.select(e)}))}selectMulti(e,t){let n=this._host.instance();n&&!(e.length<2)&&(this.selected=t&&e.includes(t)?t:e[e.length-1],this.multi=e,this._reveal(this.selected),this.reposition(),this._host.tray.update(n,this.selected),this._host.report(),this._host.touch(),g.shell.windows.showContextPanel=!0,this._issueMulti(n,e))}collapse(){let e=this.selected;this.multi=[e],this._host.tree.clearSelection(),this.select(e)}_reveal(e){let t=this._host.instance();for(let r=e,i=t.parentOf(r);i;r=i,i=t.parentOf(r)){var n;let e=t.nodes().get(i),o=(null!=(n=i.children)?n:[]).indexOf(r);if(e instanceof rk.q)e.activeTab.value=`tab-${o}`;else if(e instanceof tB.n){let t=e.paneAt(o);t&&(t.expanded.value=!0)}}}setHovered(e){e!==this.hovered&&(this.hovered=e,this.reposition())}reposition(){var e;let t=this._host.pane.isConnected,n=t&&this.selected?this.multi:[];for(;this._adorners.length<n.length;){let e=(0,_.y4)([],"u2-designer-selected");this._adorners.push(e),this._host.root.append(e)}for(let t=0;t<this._adorners.length;t++)this._outline(this._adorners[t],null!=(e=n[t])?e:null);this._outline(this.hover,t&&this.hovered&&!n.includes(this.hovered)?this.hovered:null),this._observe(n.length>0?this._elementOf(n[0]):null)}_observe(e){e!==this._observed&&(this._observed&&this._resize.unobserve(this._observed),this._observed=e,e&&this._resize.observe(e))}_elementOf(e){var t;let n=this._host.instance();return null!=(t=e&&n?new tI(n,e).element():void 0)?t:null}_outline(e,t){let n=this._elementOf(t);rh(this._host.root,e,n&&n.isConnected?n.getBoundingClientRect():null)}constructor(e){this._host=e,this.box=(0,_.y4)([],"u2-designer-selected"),this._adorners=[this.box],this.hover=(0,_.y4)([],"u2-designer-hover"),this.selected=null,this.multi=[],this.hovered=null,this._shownBroken=!1,this._resize=new ResizeObserver(()=>this.reposition()),this._observed=null,e.own(()=>this._resize.disconnect())}}let rA=[{name:"Master–detail (grid + filters)",spec:{$schema:rw.QB,components:[{tag:"u2-func-source",name:"orders",props:{func:"demoOrders",params:{days:30},designData:"sample",debounce:50,sample:[{orderId:1001,customer:"Aspirin Labs",city:"Kyiv",total:1240},{orderId:1002,customer:"Bayer",city:"Lviv",total:380},{orderId:1003,customer:"Roche",city:"Basel",total:2150}]}}],root:{tag:"u2-splitter",name:"masterDetail",props:{sizes:[.25,.45,.3]},children:[{tag:"u2-viewer-filters",name:"filters",bind:{table:"$.orders"},props:{columnNames:["city","total"]}},{tag:"u2-viewer-grid",name:"grid",bind:{table:"$.orders"},props:{allowEdit:!1}},{tag:"u2-panel",name:"detailPane",children:[{tag:"u2-viewer-form",name:"form",bind:{table:"$.orders"}},{tag:"u2-form",name:"detailForm",children:[{tag:"u2-text-input",name:"customerField",props:{label:"Customer"},bind:{value:"$.orders.currentRow.customer"}},{tag:"u2-number-input",name:"rowIdx",props:{label:"Row",mode:"int"},bind:{value:"$.orders.currentRowIdx"}}]}]}]}}}],rS="u2.designer.gallery";function rP(){try{var e;return null!=(e=globalThis.localStorage)?e:null}catch(e){return null}}function rE(){try{var e;let t=null==(e=rP())?void 0:e.getItem(rS);if(!t)return{};let n=JSON.parse(t);return null===n||"object"!=typeof n||Array.isArray(n)?{}:n}catch(e){return{}}}let rC=[{name:"Blank",spec:{$schema:rw.QB,root:{tag:"u2-form",name:"form1"}}},{name:"Data entry",spec:{$schema:rw.QB,root:{tag:"u2-panel",name:"dataEntry",children:[{tag:"u2-form",name:"entryForm",children:[{tag:"u2-text-input",name:"nameInput",props:{label:"Name"}},{tag:"u2-number-input",name:"amountInput",props:{label:"Amount",value:1,min:0,max:100}},{tag:"u2-choice-input",name:"categoryInput",props:{label:"Category",items:["Reagent","Solvent","Catalyst"]}},{tag:"u2-bool-input",name:"activeInput",props:{label:"Active",value:!0}},{tag:"u2-text-area",name:"notesInput",props:{label:"Notes"}}]},{tag:"u2-div-h",name:"entryButtons",children:[{tag:"u2-button",name:"saveButton",props:{text:"Save",primary:!0}},{tag:"u2-button",name:"cancelButton",props:{text:"Cancel"}}]}]}}},{name:"Master–detail",spec:{$schema:rw.QB,root:{tag:"u2-splitter",name:"masterDetail",props:{sizes:[.3,.7]},children:[{tag:"u2-panel",name:"masterPane",children:[{tag:"u2-text-input",name:"searchInput",props:{label:"Search",search:!0,inline:!0}},{tag:"u2-multi-choice-input",name:"itemList",props:{label:"Items",items:["Aspirin","Ibuprofen","Paracetamol","Naproxen"]}}]},{tag:"u2-panel",name:"detailPane",children:[{tag:"h2",name:"detailTitle",props:{text:"Details"}},{tag:"u2-form",name:"detailForm",children:[{tag:"u2-text-input",name:"detailName",props:{label:"Name",value:"Aspirin"}},{tag:"u2-text-area",name:"detailNotes",props:{label:"Notes"}}]}]}]}}},{name:"Settings",spec:{$schema:rw.QB,root:{tag:"u2-tabs",name:"settingsTabs",children:[{tag:"u2-panel",name:"generalPane",props:{title:"General"},children:[{tag:"u2-form",name:"generalForm",children:[{tag:"u2-text-input",name:"titleInput",props:{label:"Title",value:"My dashboard"}},{tag:"u2-bool-input",name:"autoSaveInput",props:{label:"Auto-save",value:!0}}]}]},{tag:"u2-panel",name:"appearancePane",props:{title:"Appearance"},children:[{tag:"u2-form",name:"appearanceForm",children:[{tag:"u2-color-input",name:"accentInput",props:{label:"Accent",value:"#1f77b4"}},{tag:"u2-slider-input",name:"opacityInput",props:{label:"Opacity",value:80,min:0,max:100}}]}]},{tag:"u2-panel",name:"advancedPane",props:{title:"Advanced"},children:[{tag:"u2-form",name:"advancedForm",children:[{tag:"u2-number-input",name:"cacheInput",props:{label:"Cache size",value:100,min:0,max:1e3}},{tag:"u2-choice-input",name:"logLevelInput",props:{label:"Log level",items:["error","warning","info","debug"],value:"info"}}]}]}]}}},{name:"Dashboard",spec:{$schema:rw.QB,root:{tag:"u2-panel",name:"dashboard",children:[{tag:"u2-breadcrumbs",name:"crumbs",props:{items:["Home","Projects","Demo"]}},{tag:"h2",name:"dashboardTitle",props:{text:"Overview"}},{tag:"u2-div-h",name:"dashboardRow",children:[{tag:"u2-panel",name:"settingsCard",children:[{tag:"u2-property-grid",name:"settingsGrid",props:{properties:[{name:"Title",type:"string"},{name:"Rows",type:"int",min:0}],values:{Title:"Demo",Rows:20}}}]},{tag:"u2-panel",name:"logoCard",children:[{tag:"u2-image-input",name:"logoInput",props:{label:"Logo"}}]},{tag:"u2-panel",name:"summaryCard",children:[{tag:"u2-form",name:"summaryForm",children:[{tag:"u2-text-input",name:"ownerInput",props:{label:"Owner",value:"admin"}},{tag:"u2-number-input",name:"countInput",props:{label:"Items",value:3}}]}]}]}]}}}];class rj{build(){let e=this._host,t=(0,y.gb)("undo",()=>{var t;null==(t=e.editor.peek())||t.undo(),e.refocus()},{tooltip:"Undo"}),n=(0,y.gb)("redo",()=>{var t;null==(t=e.editor.peek())||t.redo(),e.refocus()},{tooltip:"Redo"});e.effect(()=>{var n;return l.B.apply(t,(null==(n=e.editor.value)?void 0:n.canUndo.value)===!0?null:"Nothing to undo")}),e.effect(()=>{var t;return l.B.apply(n,(null==(t=e.editor.value)?void 0:t.canRedo.value)===!0?null:"Nothing to redo")});let r=t0.map(t=>(0,y.gb)(t6[t],()=>e.run(t),{tooltip:t}));return e.effect(()=>{let t=e.revision()>=0?e.actions():[];for(let e=0;e<r.length;e++)l.B.apply(r[e],void 0===t[e]?"Select a component first":l.B.now(t[e].disabled))}),[e.mode,(0,y.gb)("file",()=>this.newForm(),{tooltip:"New form"}),(0,y.ey)("",e=>this._openMenu(e),{icon:"folder-open",tooltip:"Open"}),(0,y.gb)("copy",()=>{this._copy(),e.refocus()},{tooltip:"Copy spec"}),t,n,...r,(0,y.gb)("border-all",()=>e.refocus(),{toggle:e.outlines,tooltip:"Control bounds"})]}_load(e){var t;let n=()=>{this._host.open(e),this._host.refocus()};if((null==(t=this._host.editor.peek())?void 0:t.dirty.peek())!==!0)return void n();let r=new s.HG;r.build(()=>new to.l("Discard changes?")).add("The form has been modified. Discard the changes?").onOK(()=>{r.dispose(),n()}).onCancel(()=>{r.dispose(),this._host.refocus()}).show({modal:!0})}newForm(){this._load(rC["0"].spec)}_openMenu(e){e.group("Samples");for(let t=0,n=[...rC,...(null==(l=null==(a=this._host.instance())?void 0:a.registry)?void 0:l.get("u2-viewer-grid"))!==void 0?rA:[]];t<n.length;t++){let r=n[t];e.item(r.name,()=>this._load(r.spec))}e.endGroup();let t=rE(),n=Object.keys(t);if(n.length>0){e.group("Gallery");var r=!0,i=!1,o=void 0;try{for(var a,l,s,u=n[Symbol.iterator]();!(r=(s=u.next()).done);r=!0){let n=s.value;e.item(n,()=>this._load(t[n]))}}catch(e){i=!0,o=e}finally{try{r||null==u.return||u.return()}finally{if(i)throw o}}e.endGroup()}e.separator(),e.item("Open spec…",()=>this._openDialog()),e.item("Save to gallery…",()=>this.saveToGallery())}saveToGallery(){let e=this._host.dump();if(!e){g.shell.info("Nothing to save — the canvas is empty."),this._host.refocus();return}let t=new s.HG,n=t.build(()=>new S.k({label:"Name",placeholder:"My form"}));t.build(()=>new to.l("Save to gallery")).add(n).add("An entry that already carries this name is overwritten.").onOK(()=>{let r=n.peek().trim();if(t.dispose(),""===r){g.shell.warning("A gallery entry needs a name."),this._host.refocus();return}if(function(e,t){let n=rP();if(!n)return!1;let r=rE();r[e]=t;try{return n.setItem(rS,JSON.stringify(r)),!0}catch(e){return!1}}(r,e)){var i;g.shell.info(`Saved to the gallery as "${r}".`),null==(i=this._host.editor.peek())||i.markClean(),this._host.report()}else g.shell.warning(`Could not save "${r}" — storage is unavailable or full.`);this._host.refocus()}).onCancel(()=>{t.dispose(),this._host.refocus()}).show({modal:!0,width:360})}_openDialog(){let e=new s.HG,t=this._host.dump(),n=e.build(()=>new S.f({label:"Spec",value:t?JSON.stringify(t,null,2):"",placeholder:"Paste a dg-ui/1 spec"}));n.root.classList.add("u2-designer-spec-editor"),e.build(()=>new to.l("Open spec")).add(n).onOK(()=>{this._host.open(n.peek()),e.dispose(),this._host.refocus()}).onCancel(()=>{e.dispose(),this._host.refocus()}).show({modal:!0,width:560})}_copy(){let e=this._host.dump();e?navigator.clipboard.writeText(JSON.stringify(e,null,2)).then(()=>g.shell.info("Spec copied to the clipboard."),e=>g.shell.error(`Could not copy: ${e instanceof Error?e.message:String(e)}`)):g.shell.info("Nothing to copy — the canvas is empty.")}constructor(e){this._host=e}}function rT(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}class rN extends ew.Ec{ribbon(){return this.build(()=>this._ribbon.build())}open(e){var t,n;let r;try{r=(0,tT.F9)(e),"string"!=typeof e&&(r=JSON.parse(JSON.stringify(r)))}catch(e){g.shell.error(e instanceof Error?e.message:String(e));return}null==(t=this._instance)||t.dispose(),this._surface.textContent="",this._selection.selected=null,this._selection.multi=[],this._hovered=null,this._pendingSelect=null,this._instance=this.build(()=>(0,tT.UE)(r,this._ctx,this._registry,{designTime:"run"!==this._mode.selected.peek()[0]})),this._surface.append(this._instance.root),this._editor.value=new tH.lB(this._instance),this._model=tL(this._instance),this._tree.clearSelection(),this._tree.setRoots(this._model.roots),this._stampDesign(),this._tray.update(this._instance,null),this._report();let i=null==(n=this._model.roots[0])?void 0:n.data;i?this._select(i):this._selection.reposition()}dump(){return this._instance?this._instance.dump():null}get _drag(){return this._dragLayer.drag}set _drag(e){this._dragLayer.drag=e}get _dragging(){return this._dragLayer.dragging}get _selected(){return this._selection.selected}get _multi(){return this._selection.multi}get _hovered(){return this._selection.hovered}set _hovered(e){this._selection.hovered=e}_select(e){this._selection.select(e)}_endDrag(e){this._dragLayer.end(e)}_actions(){return this._verbs.actions()}_run(e){this._verbs.run(e)}_rowActions(e){return this._verbs.rowActions(e)}_afterPatch(e){e.structural?this._rebuildTree():this._selection.followRerender(),this._selection.reposition(),this._tray.update(this._instance,this._selected),this._report(),this._stampDesign(),this._touch()}_rebuildTree(){let e=this._instance;if(!e)return;this._model=tL(e),this._tree.clearSelection(),this._tree.setRoots(this._model.roots);let t=this._survivor(e);this._pendingSelect=null,t&&this._select(t)}_survivor(e){let t=e.nodes();return this._pendingSelect&&t.has(this._pendingSelect)?this._pendingSelect:this._selected&&t.has(this._selected)?this._selected:t.has(e.spec.root)?e.spec.root:null}_stampDesign(){let e=this._instance;if(e){var t=!0,n=!1,r=void 0;try{for(var i,o,a,l,s=e.nodes()[Symbol.iterator]();!(t=(l=s.next()).done);t=!0){let t=(i=l.value,function(e){if(Array.isArray(e))return e}(i)||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var i=[],o=!0,a=!1;try{for(r=r.call(e);!(o=(t=r.next()).done)&&(i.push(t.value),2!==i.length);o=!0);}catch(e){a=!0,n=e}finally{try{o||null==r.return||r.return()}finally{if(a)throw n}}return i}}(i)||function(e){if(e){if("string"==typeof e)return rT(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return rT(e,2)}}(i)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),n=t[0],r=t[1],s=tT.R4.elementOf(r);s&&(s.classList.add("u2-designer-node"),s.classList.toggle("u2-designer-root",n===e.spec.root),s.classList.toggle("u2-designer-empty",(null!=(o=null==(a=n.children)?void 0:a.length)?o:0)===0&&rm(e.registry,n)))}}catch(e){n=!0,r=e}finally{try{t||null==s.return||s.return()}finally{if(n)throw r}}}}_touch(){this._revision.value=this._revision.peek()+1}_refocus(){this.root.focus({preventScroll:!0})}_apply(e){let t=this._editor.peek();if(!t)return!1;let n=t.canApply(e);return n?(this._pendingSelect=null,g.shell.warning(n),!1):(t.apply(e),!0)}_rename(e,t){e.data&&(this._apply({op:"rename",node:e.data,name:t})||this._rebuildTree())}_setDesign(e){var t;e?this.root.append(this._pane):(this._pane.remove(),this._hovered=null),l.B.apply(this._surface,e?rN.DESIGNING:null),this.root.classList.toggle("u2-designer-running",!e);let n=void 0!==this._instance&&this._instance.designTime!==e;null==(t=this._instance)||t.setDesignTime(e),this._stampDesign(),this._tray.update(this._instance,this._selected),this._selection.reposition(),n&&this._selection.reassert()}_report(){var e;if(!this._instance){this._status.value="Nothing rendered";return}let t=this._instance.nodes().size,n=[this._multi.length>1?`${this._multi.length} selected`:this._selected?new tI(this._instance,this._selected).path():"No selection",`${t} node${1===t?"":"s"}`],r=function(e){let t=0;var n=!0,r=!1,i=void 0;try{for(var o,a=e.nodes().values()[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){let e=o.value;!ew.uA.is(e)&&e.classList.contains(tN)&&t++}}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}return t}(this._instance);r>0&&n.push(`${r} broken`),(null==(e=this._editor.peek())?void 0:e.dirty.peek())&&n.push("modified"),this._status.value=n.join(" \xb7 ")}constructor(e,t,n){super(),this._surface=(0,_.y4)([],"u2-designer-surface"),this._pane=(0,_.y4)([],"u2-designer-pane"),this._status=(0,d.vP)(""),this._outlines=(0,d.vP)(!0),this._editor=(0,d.vP)(void 0),this._revision=(0,d.vP)(0),this._pendingSelect=null,this.status=this._status,this._ctx=null!=t?t:new tT.VI,this._registry=null!=n?n:rw.u5,this.root.classList.add("u2-designer"),this.root.dataset.u2="designer",this.root.tabIndex=0,this._tray=this.build(()=>new rc({onSelect:e=>this._select(e),onContext:(e,t,n)=>{this._select(e),(0,tq.l5)(this._verbs.handBack(this._actions())).show({x:t,y:n})},onAdd:(e,t)=>this._dragLayer.addComponent(e,t)})),this._tree=this.build(()=>new e6.U({onRename:(e,t)=>this._rename(e,t),contextActions:e=>this._rowActions(e)})),this._mode=this.build(()=>new r_.e({items:[{id:"design",text:"Design"},{id:"run",text:"Run"}],toggle:"single",density:"ribbon"})),this._mode.selected.value=["design"];const r={root:this.root,surface:this._surface,pane:this._pane,tree:this._tree,tray:this._tray,mode:this._mode.root,outlines:this._outlines,editor:this._editor,instance:()=>this._instance,model:()=>this._model,selected:()=>this._selected,multi:()=>this._multi,revision:()=>this._revision.value,inDrag:()=>void 0!==this._drag,dragged:()=>this._dragLayer.dragged,hit:e=>this._selection.hit(e),select:e=>this._select(e),collapse:()=>this._selection.collapse(),endDrag:e=>this._endDrag(e),actions:()=>this._actions(),run:e=>this._run(e),pending:e=>this._pendingSelect=e,apply:e=>this._apply(e),refresh:e=>this._verbs.refresh(e),open:e=>this.open(e),dump:()=>this.dump(),effect:e=>this.effect(e),own:e=>this.own(e),report:()=>this._report(),touch:()=>this._touch(),refocus:()=>this._refocus()};this._selection=new rO(r),this._dragLayer=new rx(r),this._verbs=new t5(r),this._ribbon=new rj(r),this.root.append(this._surface,this._tray.root,this._selection.box,this._selection.hover,this._dragLayer.into,this._dragLayer.line),function(e){eW.makeDroppable(e.element,{dropIndication:!1,acceptDrag:t=>{var n;return e.active()&&((n=ry(t.dragObject)).items.length>0||n.refused.length>0)},onBeginDrag:()=>e.onDragActive(!0),onEndDrag:()=>e.onDragActive(!1),doDrop:t=>{e.onDragActive(!1),e.active()&&(t.handled=!0,e.onDrop(ry(t.dragObject)))}})}({element:this.root,active:()=>!this.scope.isDisposed&&this._pane.isConnected&&void 0===this._drag,onDragActive:e=>{this._dragLayer.platformDrag=e,this._tray.setDropTarget(e),e&&this._selection.setHovered(null)},onDrop:e=>this._dragLayer.dropSources(e)}),this.scope.listen(this._tree.root,"click",e=>{var t;if(e.ctrlKey||e.metaKey||e.shiftKey)return;let n=null==(t=this._tree.selectedNode.peek())?void 0:t.data;n&&this._select(n)}),this.scope.listen(this._pane,"click",e=>this._selection.onCanvasClick(e)),this.scope.listen(this._pane,"mousedown",e=>this._dragLayer.onPaneDown(e)),this.scope.listen(this._pane,"contextmenu",e=>this._verbs.onContextMenu(e,this._selection.hit(e))),this.scope.listen(this._pane,"mousemove",e=>this._selection.setHovered(this._dragging?null:this._selection.hit(e))),this.scope.listen(this._pane,"mouseleave",()=>this._selection.setHovered(null)),this.scope.listen(this._tree.root,"mouseover",e=>{var t,n;return this._selection.setHovered(this._dragging?null:null!=(t=null==(n=this._tree.nodeForRow(e.target))?void 0:n.data)?t:null)}),this.scope.listen(this._tree.root,"mouseleave",()=>this._selection.setHovered(null)),this.scope.listen(this.root,"contextmenu",e=>{this._pane.isConnected&&(e.preventDefault(),e.stopPropagation())}),this.scope.listen(this._surface,"scroll",()=>this._selection.reposition(),{capture:!0}),this.scope.listen(window,"resize",()=>this._selection.reposition()),this.scope.listen(document,"mousemove",e=>this._dragLayer.onMove(e)),this.scope.listen(document,"mouseup",()=>this._endDrag(!0)),this.scope.listen(document,"keydown",e=>{r.inDrag()&&"Escape"===e.key&&r.endDrag(!1)}),this.open(e),this._palette=this.build(()=>{var e,t;return new rr(null!=(e=null==(t=this._instance)?void 0:t.registry)?e:this._registry)}),this.toolbox=(0,_.yP)([(0,_.h3)("Palette"),this._palette.root,(0,_.h3)("Structure"),this._tree.root],"u2-designer-toolbox"),this.scope.listen(this._palette.root,"mousedown",e=>this._dragLayer.onPaletteDown(e)),this.scope.listen(this.toolbox,"contextmenu",e=>{e.preventDefault(),e.stopPropagation()}),this.scope.listen(this._mode.root,"click",()=>this._refocus()),this.scope.listen(this.root,"keydown",e=>t7(e,r)),this.scope.listen(this.toolbox,"keydown",e=>t7(e,r)),this.effect(()=>{var e,t;let n=this._tree.selectedNodes.value,r=null!=(e=null==(t=this._tree.selectedNode.value)?void 0:t.data)?e:null;n.length>1?this._selection.selectMulti(n.map(e=>e.data),r):this._selection.onTreeSelection(r)}),this.effect(()=>this._setDesign("run"!==this._mode.selected.value[0])),this.effect(()=>this.root.classList.toggle("u2-designer-outlines",this._outlines.value)),this.effect(()=>{var e;let t=null==(e=this._editor.value)?void 0:e.onDidApply.value;t&&this._afterPatch(t)}),this.own(n5)}}rN.DESIGNING="Switch to Run to use the controls";var rI=n(9793);function rD(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}function r$(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){rD(o,r,i,a,l,"next",e)}function l(e){rD(o,r,i,a,l,"throw",e)}a(void 0)})}}n(7371),n(50),rI.o.defaultEditors=(e,t)=>er.resolve(e,t);let rL={users:()=>g.dapi.users,groups:()=>g.dapi.groups,projects:()=>g.dapi.projects,queries:()=>g.dapi.queries,connections:()=>g.dapi.connections,scripts:()=>g.dapi.scripts,spaces:()=>g.dapi.spaces};function rz(e){let t=e.indexOf(":"),n=t<0?o.Func.find({name:e}):o.Func.find({package:e.slice(0,t),name:e.slice(t+1)});return n.length>0?n[0]:null}let rF=new Map;nt.S.funcRunner={find:e=>{let t=rz(e);return null===t?null:{name:e,kind:t instanceof o.TableQuery?"table-query":t instanceof o.DataQuery?"query":t instanceof o.Script?"script":"function",inputs:t.inputs,outputs:t.outputs}},run:(e,t,n,r)=>r$(function*(){let n=rz(e);if(null===n)throw Error(`"${e}" is not a known function`);let i=yield(d=null==r?void 0:r.maxRows,c=()=>n.prepare(t).call(),r$(function*(){if(void 0===d||!(n instanceof o.TableQuery))return c();let e=n.dart,t=rF.get(e);void 0===t&&(t={previous:n.limit,runs:0},rF.set(e,t)),t.runs++,n.limit=d;try{return yield c()}finally{0==--t.runs&&(rF.delete(e),n.limit=t.previous)}})()),a={};var l=!0,s=!1,u=void 0;try{for(var d,c,p,h=n.outputs[Symbol.iterator]();!(l=(p=h.next()).done);l=!0){let e=p.value;a[e.name]=i.outputs[e.name]}}catch(e){s=!0,u=e}finally{try{l||null==h.return||h.return()}finally{if(s)throw u}}return a})()},nt.S.dapi=e=>{let t=rL[e];return void 0===t?null:t()},nt.S.dapiFind=(e,t)=>r$(function*(){let n=rL[e];return void 0===n?null:n().find(t)})(),nt.S.workspace={table:e=>{var t;return null!=(t=g.shell.table(e))?t:null},tableNames:()=>P.tableNames(),onTablesChanged:{subscribe:e=>{let t=[g.events.onTableAdded,g.events.onTableRemoved].map(t=>t.subscribe(e));return{unsubscribe:()=>{var e=!0,n=!1,r=void 0;try{for(var i,o=t[Symbol.iterator]();!(e=(i=o.next()).done);e=!0)i.value.unsubscribe()}catch(e){n=!0,r=e}finally{try{e||null==o.return||o.return()}finally{if(n)throw r}}}}}}},nt.S.tableFromRows=e=>{var t;return null!=(t=o.DataFrame.fromObjects(e))?t:o.DataFrame.create(0)};let rB=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,rM=new Map;nt.S.principalIcon=e=>{if(""===e||e.includes('"'))return null;let t=rM.get(e);void 0===t&&rM.set(e,t=r$(function*(){var t;let n=rB.test(e)?"id":"friendlyName";return null!=(t=yield g.dapi.groups.filter(`${n} = "${e}"`).first())?t:null})().catch(()=>null));let n=document.createElement("div");return n.className="u2-avatar",t.then(e=>{null!==e&&n.replaceWith(e$(e))}),n},nt.S.format={dateFormat:()=>g.shell.settings.dateFormat,number:(e,t)=>o.format(e,t)};var rR=n(2127);let rq=".d4-balloon-container";class rH{static get available(){return"function"==typeof globalThis.grok_Balloon}static show(e,t,n,r){var i,o;if(!rH.available)return;let a=null!=(i=null==(o=document.querySelector(rq))?void 0:o.lastElementChild)?i:null,l="string"==typeof e&&"error"!==t?rH._text(e):e,s={autoHide:n.autoHide,copyText:n.copyText,timeout:Math.max(1,Math.round(n.timeout/1e3))};"error"===t?g.shell.error(l,s):"warning"===t?g.shell.warning(l,s):g.shell.info(l,s);let u=document.querySelector(rq),d=null==u?void 0:u.lastElementChild;if(null===u||!(d instanceof HTMLElement)||d===a)return r(),{root:document.createElement("div"),close:()=>{}};let c=new MutationObserver(()=>{d.isConnected||(c.disconnect(),r())});return c.observe(u,{childList:!0}),{root:d,close:()=>d.remove()}}static _text(e){let t=document.createElement("span");return t.textContent=e,t}}rR.m.presenter=(e,t,n,r)=>rH.show(e,t,n,r),n(1858);let rW=e=>(t,n)=>(function(e,t,n){let r={},i={},a=[];var l=!0,u=!1,c=void 0;try{for(var p,h=Object.entries(null!=n?n:{})[Symbol.iterator]();!(l=(p=h.next()).done);l=!0){let e=nO(p.value,2),t=e[0],n=e[1];r[t]=n instanceof d.HN?n.peek():n,n instanceof d.HN?a.push([t,n]):i[t]=n}}catch(e){u=!0,c=e}finally{try{l||null==h.return||h.return()}finally{if(u)throw c}}return function(e,t,n,r,i){var a;let l,u=t instanceof d.HN?t:(0,d.vP)(t),c=u.peek();n.filters;let p=function(e,t){if(null==e)return{};var n,r,i,o={};if("u">typeof Reflect&&Reflect.ownKeys){for(i=0,n=Reflect.ownKeys(Object(e));i<n.length;i++)r=n[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r]);return o}if(o=function(e,t){if(null==e)return{};var n,r,i={},o=Object.getOwnPropertyNames(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n]);return i}(e,t),Object.getOwnPropertySymbols)for(i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)r=n[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r]);return o}(n,["filters"]);try{l=e(null!=c?c:o.DataFrame.create(0),null==c?p:n)}catch(e){if(null!=c)throw e;throw Error("This viewer needs a table — bind `table` to a data source",{cause:e})}let h=l;return null==(a=s.HG.ambient)||a.own(()=>h.dispose()),h.root.classList.add("u2-viewer"),h.effect(()=>{var e;let t=u.value;if(null!=t&&(null==(e=h.dataFrame)?void 0:e.dart)!==t.dart){nA.add(h);try{h.dataFrame=t,h.setOptions(r)}finally{nA.delete(h)}}}),h.build(()=>{var e=!0,t=!1,n=void 0;try{for(var r,o=i[Symbol.iterator]();!(e=(r=o.next()).done);e=!0){let e=nO(r.value,2),t=e[0],n=e[1];!function(e,t,n){let r,i=()=>e.getProperties().some(e=>e.name===t),o=()=>e.build(()=>e.link(t,n,(0,d.n$)(n)));if(i())return o();let a=0,l=()=>{r=void 0,i()||++a>=40?o():r=setTimeout(l,25)};r=setTimeout(l,0),e.own(()=>clearTimeout(r))}(h,t,n)}}catch(e){t=!0,n=e}finally{try{e||null==o.return||o.return()}finally{if(t)throw n}}}),h}(e,t,r,i,a)})((t,n)=>o.Viewer.fromType(e,t,n),t,n);function rV(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function rG(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}function rU(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){rG(o,r,i,a,l,"next",e)}function l(e){rG(o,r,i,a,l,"throw",e)}a(void 0)})}}rW("Grid"),rW("Histogram"),rW("Bar chart"),rW("Confusion matrix"),rW("Roc curve"),rW("Heat map"),rW("Box plot"),rW("Filters"),rW("Scatter plot"),rW("Line chart"),rW("Network diagram"),rW("Calendar"),rW("Correlation plot"),rW("Density plot"),rW("Form"),rW("Markup"),rW("Matrix plot"),rW("PC Plot"),rW("Pie chart"),rW("3d scatter plot"),rW("Statistics"),rW("Tile Viewer"),rW("Tree map"),rW("Trellis plot"),rW("Pivot table"),n(6336);var rK=n(2357),rY=n(1573),rQ=n(476),rJ=n(4894);function rZ(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}class rX{set(e,t){("idle"!==t.kind||"idle"!==this._slots[e].peek().kind)&&(this._slots[e].value=t)}notice(e){this._notice.value=e}_render(){let e=this._slots.map(e=>e.value).find(e=>"error"===e.kind),t=this._notice.value,n=this.root;if(n.textContent="",n.className="u2-param-source",n.hidden=void 0===e&&null===t,n.hidden)return;if((null==e?void 0:e.kind)!=="error"){n.classList.add("u2-param-source-notice");let e=(0,_.Ln)(t,"u2-param-source-message");e.title=t,n.append(e);return}n.classList.add("u2-param-source-error");let r=(0,_.Ln)(e.message,"u2-param-source-message");r.title=e.message,n.append(r);let i=(0,_.x6)("Retry",e.retry);i.classList.add("u2-param-source-retry"),n.append(i)}constructor(){this.root=(0,_.Ln)("","u2-param-source"),this._slots=[(0,d.vP)({kind:"idle"}),(0,d.vP)({kind:"idle"})],this._notice=(0,d.vP)(null),this.busy=(0,d.EW)(()=>this._slots.some(e=>"loading"===e.value.kind&&!0!==e.value.refresh)),this.loading=(0,d.EW)(()=>this._slots.some(e=>"loading"===e.value.kind)),s.HG.ambient.effect(()=>this._render())}}class r0{start(){var e,t;let n=(e=this._av,t=this._scope,new Promise(n=>{let r=new s.HG,i=()=>{n(),r.dispose()};t.own(i),r.effect(()=>{let n=e.state.value.kind;("ready"===n||"error"===n)&&(t.disown(i),queueMicrotask(i))})}));return this._av.refresh(),n}retry(){this._av.refresh()}dispose(){this._disown(),this._dispose()}_dispose(){var e=!0,t=!1,n=void 0;try{for(var r,i=this._subs[Symbol.iterator]();!(e=(r=i.next()).done);e=!0)(0,r.value)()}catch(e){t=!0,n=e}finally{try{e||null==i.return||i.return()}finally{if(t)throw n}}this._subs.length=0,this._scope.dispose()}_eval(e){var t;return(t=function*(){for(;;){let t=new Map(this._changes),n=e=>[...e].some(e=>this._changes.get(e)!==t.get(e));try{let t=yield this._call.evalParamChoices(this._name);if(e.aborted||!n(t.dependsOn))return t}catch(t){if(e.aborted||null!==this._depNames||!n(this._changes.keys()))throw t}}},function(){var e=this,n=arguments;return new Promise(function(r,i){var o=t.apply(e,n);function a(e){rZ(o,r,i,a,l,"next",e)}function l(e){rZ(o,r,i,a,l,"throw",e)}a(void 0)})}).call(this)}_changed(e){var t;this._changes.set(e,(null!=(t=this._changes.get(e))?t:0)+1),(null===this._depNames?"error"===this._av.state.peek().kind:this._depNames.includes(e))&&(this._version.value=this._version.peek()+1)}_onState(e){"loading"===e.kind?this._state.set(0,{kind:"loading",refresh:null!==this._depNames}):"ready"===e.kind?(this._state.set(0,{kind:"idle"}),this._depNames=e.value.dependsOn,this._apply(e.value)):"error"===e.kind&&this._state.set(0,{kind:"error",message:"Couldn't load choices: "+e.message,retry:()=>this.retry()})}constructor(e,t,n,r){this._version=(0,d.vP)(0),this._scope=new s.HG,this._changes=new Map,this._subs=[],this._depNames=null,this._call=e,this._name=t,this._apply=n,this._state=r;const i=s.HG.ambient,o=()=>this._dispose();i.own(o),this._disown=()=>i.disown(o);var a=!0,l=!1,u=void 0;try{for(var c,p=e.inputParams.values()[Symbol.iterator]();!(a=(c=p.next()).done);a=!0){const e=c.value;if(e.name===t)continue;const n=e.onChanged.subscribe(()=>this._changed(e.name));this._subs.push(()=>n.unsubscribe())}}catch(e){l=!0,u=e}finally{try{a||null==p.return||p.return()}finally{if(l)throw u}}this._scope.build(()=>{this._av=new rJ.C(e=>this._eval(e),{deps:()=>{this._version.value},debounceMs:200}),this._scope.effect(()=>this._onState(this._av.state.value))})}}let r2=globalThis;function r1(e,t){let n=null==e?void 0:e.dart;if(null==n||"function"!=typeof r2.grok_Property_Get)return null;try{var r;return null!=(r=r2.grok_Property_Get(n,t))?r:null}catch(e){return null}}function r4(e){return null==e||"string"!=typeof e.name||"func"in e?null:e}function r3(e){return null!=r4(e)&&null!=e.columns?e:null}function r8(e){return"string"==typeof e?r6(e):r3(e)}function r6(e){var t;return null==e?null:null!=(t=g.shell.table(e))?t:null}function r5(e){return null==e?[]:"function"==typeof e.names?e.names():Array.isArray(e)?e.map(e=>{var t;return null==(t=r4(e))?void 0:t.name}).filter(e=>null!=e):[]}let r9="has missing values",r7="no missing values",ie={numerical:"numerical",numerical_no_datetime:"numerical",categorical:"categorical",datetime:"datetime",categorical_or_datetime:"categorical or datetime"},it=new Set(["structure","smiles","canonical_smiles","molecule"]),ir=o.StringUtils;function ii(e,t,n,r){var i;let o=P.listedColumns(e,r);if(0===o.length)return null;if(null!=n.semType&&""!==n.semType)return null!=(i=o.find(e=>it.has(e.name.toLowerCase())))?i:o[0];let a=t.toLowerCase(),l=1===a.length?ir.levenshteinDistance:ir.jaroWinklerDistance,s=o[0],u=l(a,s.name.toLowerCase());for(let e=1;e<o.length;e++){let t=l(a,o[e].name.toLowerCase());t<u&&(s=o[e],u=t)}return s}function io(e){if(!0!==e.userTouched){if(void 0===e.autoBadge){let t=(0,_.Ln)("auto","u2-param-auto");t.title="Chosen automatically",e.autoBadge=t;let n=()=>{e.userTouched=!0,t.remove(),e.input.root.removeEventListener("change",n)};e.input.root.addEventListener("change",n)}null===e.autoBadge.parentElement&&e.input.box.append(e.autoBadge)}}function ia(e){var t;null==(t=e.autoBadge)||t.remove()}class il{start(){let e=this._table();var t=!0,n=!1,r=void 0;try{for(var i,o=this._deps[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){let t=i.value;"columns"===t.kind?this._startColumns(t,e):this._startColumn(t,e),t.field.input.revalidate()}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}}dispose(){this._disown(),this._dispose()}_table(){let e=this._tableParam.value;return"string"==typeof e?this._tableOf(e):r3(e)}_startColumn(e,t){let n=e.field.input;(0,d.vA)(()=>{if(P.sameTable(n.table,t)||n.changeTable(t,e.filter),null!=e.field.param.value||null===t){var r,i;let t=null!=(r=null==(i=r4(e.field.param.value))?void 0:i.name)?r:null;t!==n.peek()&&a.p.system(()=>n.value=t),ia(e.field);return}let o=ii(t,e.field.param.name,e.field.param.property,e.filter);null===o?ia(e.field):(this._call.setParamValue(e.field.param.name,o),a.p.system(()=>n.value=o.name),io(e.field))})}_startColumns(e,t){let n=e.field.input;(0,d.vA)(()=>{P.sameTable(n.table,t)||n.changeTable(t,e.filter);let r=r5(e.field.param.value);e_.same(r,n.peek())||a.p.system(()=>n.value=r)})}_retargetAll(){let e=this._table();var t=!0,n=!1,r=void 0;try{for(var i,o=this._deps[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){let t=i.value;"columns"===t.kind?this._retargetColumns(t,e):this._retargetColumn(t,e),t.field.input.revalidate()}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}}_retargetColumns(e,t){let n=e.field.input,r=n.peek(),i=n.table;n.changeTable(t,e.filter),r.length>0&&null!=i&&this._notify(e,i.name)}_retargetColumn(e,t){let n=e.field.input,r=null===t?null:ii(t,e.field.param.name,e.field.param.property,e.filter),i=n.peek();(0,d.vA)(()=>{var i;n.changeTable(t,e.filter),n.value=null!=(i=null==r?void 0:r.name)?i:null}),null!==r&&n.peek()===i&&this._call.setParamValue(e.field.param.name,r),null!==r?io(e.field):ia(e.field)}_dispose(){var e;this._disposed||(this._disposed=!0,null==(e=this._tableSub)||e.unsubscribe(),this._tableSub=void 0)}constructor(e,t,n,r,i){this._disposed=!1,this._call=e,this._tableParam=t,this._tableOf=n,this._deps=r,this._notify=i;const o=s.HG.ambient,a=()=>this._dispose();o.own(a),this._disown=()=>o.disown(a);const l=t.onChanged.subscribe(()=>this._retargetAll());this._tableSub=l}}let is=globalThis;function iu(){return"function"==typeof is.grok_ScriptSync}class id{warn(e,t){this.warned.has(e)||(this.warned.add(e),console.warn(`u2 func-form: ${e} — ${t}`))}clear(){this.warned.clear()}constructor(){this.warned=new Set}}function ic(e,t,n,r,i){if(!iu())return i.warn(r,"grok_ScriptSync is not available — keeping the previous state"),n;try{return!1!==is.grok_ScriptSync(String(e),t)}catch(e){return i.warn(r,"expression failed: "+(e instanceof Error?e.message:String(e))),n}}function ip(e){return e.replace(/#\{[^}]*\}/g,"").replace(/\*\*/g,"").replace(/ {2,}/g," ").trim()}function ih(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}function im(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(e){ih(o,r,i,a,l,"next",e)}function l(e){ih(o,r,i,a,l,"throw",e)}a(void 0)})}}function ig(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function iv(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function ib(e,t){if(null==e)return{};var n,r,i,o={};if("u">typeof Reflect&&Reflect.ownKeys){for(i=0,n=Reflect.ownKeys(Object(e));i<n.length;i++)r=n[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r]);return o}if(o=function(e,t){if(null==e)return{};var n,r,i={},o=Object.getOwnPropertyNames(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n]);return i}(e,t),Object.getOwnPropertySymbols)for(i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)r=n[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r]);return o}let iy=new Set(["string","int","double","float","num","bigint","qnum","bool","datetime"]),i_=new Set(["textarea","password","switch","slider"]);class iw extends R.l{_buildRunButton(e){let t=this.build(()=>(0,_.x6)("Run",()=>void this._runAndSave(),{primary:!0}));t.dataset.u2="ff-run",this.addButtons(e=>e.append(t)),e instanceof d.HN?this.effect(()=>t.hidden=!1===e.value):t.hidden=!1===e,this.effect(()=>{let e=this.loadingFields.value,n=this.missingRequired.value,r=this.invalidFields.value,i=e.length>0?`Loading: ${e.join(", ")}`:n.length>0?`Missing: ${n.join(", ")}`:r.length>0?`Invalid: ${r.join(", ")}`:"";l.B.apply(t,i||(this._running.value?"Running…":null)),t.title=i})}_runAndSave(){return im(function*(){var e,t,n;if(!this._running.peek()){this._running.value=!0;try{this._call.call&&(yield this._call.call()),yield g.dapi.functions.calls.allPackageVersions().save(this._call),null==(e=(t=this._formOptions).onRun)||e.call(t,this._call)}catch(e){g.shell.error(String(null!=(n=null==e?void 0:e.message)?n:e))}finally{this._running.value=!1}}}).call(this)}_buildHistoryIcon(e){let t=this._historyIcon=this.build(()=>(0,y.gb)("history",()=>this._toggleHistory(),{tooltip:"Apply a previous run"}));t.dataset.u2="ff-history-icon",this.addButtons(e=>e.prepend(t)),e instanceof d.HN?this.effect(()=>t.hidden=!1===e.value):t.hidden=!1===e,this.own(()=>this._closeHistory())}_toggleHistory(){var e,t;if(this._historyPopup)return this._closeHistory();let n=null!=(e=null==(t=this._call.func)?void 0:t.nqName)?e:"";(this._historyPopup=eH.popup(this._historyIcon,"u2-func-form-history-popup",{functionName:n},e=>{var t;t=this,rU(function*(){let n=yield rU(function*(){let t=new Map;var n=!0,r=!1,i=void 0;try{for(var a,l=e.inputParams.values()[Symbol.iterator]();!(n=(a=l.next()).done);n=!0){let n=a.value,r=e.inputs[n.name];try{if("string"==typeof r){if(n.property.propertyType===o.TYPE.DATA_FRAME)r=yield g.dapi.tables.getTable(r);else if(n.property.propertyType===o.TYPE.FILE){let e=JSON.parse(r),t=e.id,n=e.name,i=o.FileInfo.fromBytes(n,(yield g.dapi.files.readAsBytes(t)));i.id=t,r=i}}t.set(n.name,r)}catch(e){}}}catch(e){r=!0,i=e}finally{try{n||null==l.return||l.return()}finally{if(r)throw i}}return t})(),r=new Set([...t.source.inputParams.values()].map(e=>e.name));var i=!0,a=!1,l=void 0;try{for(var s,u,d=n[Symbol.iterator]();!(i=(u=d.next()).done);i=!0){let e=(s=u.value,function(e){if(Array.isArray(e))return e}(s)||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var i=[],o=!0,a=!1;try{for(r=r.call(e);!(o=(t=r.next()).done)&&(i.push(t.value),2!==i.length);o=!0);}catch(e){a=!0,n=e}finally{try{o||null==r.return||r.return()}finally{if(a)throw n}}return i}}(s)||function(e){if(e){if("string"==typeof e)return rV(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return rV(e,2)}}(s)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),n=e[0],i=e[1];r.has(n)&&void 0!==i&&t.source.setParamValue(n,i)}}catch(e){a=!0,l=e}finally{try{i||null==d.return||d.return()}finally{if(a)throw l}}})()})).own(()=>this._historyPopup=void 0)}_closeHistory(){var e;null==(e=this._historyPopup)||e.dispose()}get settled(){return this._settled}get source(){return this._call}set source(e){this._call=e,this._generation++,this._genSig.value=this._genSig.peek()+1;var t=!0,n=!1,r=void 0;try{for(var i,o=this._paramSubs[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){let e=i.value;e(),this.scope.disown(e)}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}this._paramSubs=[];let a=new Map,l=[];this._unsupported.length=0;var s=!0,u=!1,c=void 0;try{for(var p,h=e.inputParams.values()[Symbol.iterator]();!(s=(p=h.next()).done);s=!0){let e=p.value;a.set(e.name,e);let t=iw._route(e.property);"table"===t&&l.push(e),"skip"===t||this._fields.some(t=>t.param.name===e.name)||this._unsupported.push(e.name)}}catch(e){u=!0,c=e}finally{try{s||null==h.return||h.return()}finally{if(u)throw c}}this._autoFill(l),this._refreshing=!0;try{(0,d.vA)(()=>{var e=!0,t=!1,n=void 0;try{for(var r,i=this._fields[Symbol.iterator]();!(e=(r=i.next()).done);e=!0){let e=r.value,t=a.get(e.param.name),n=void 0===t;n!==e.orphaned&&(e.orphaned=n,this._applyEnabled(e)),void 0!==t&&(e.param=t,e.input.value=this._show(e))}}catch(e){t=!0,n=e}finally{try{e||null==i.return||i.return()}finally{if(t)throw n}}})}finally{this._refreshing=!1}this._bind();var m=!0,f=!1,g=void 0;try{for(var v,b,y,_,w,x=this._fields[Symbol.iterator]();!(m=(w=x.next()).done);m=!0){let e=w.value;null==(v=e.state)||v.set(1,{kind:"idle"}),null==(b=e.noticeClear)||b.call(e),"table"===e.route&&(this._autoFilled.has(e.param.name)?io:ia)(e),("choices"===e.route||"multiChoices"===e.route)&&(e.orphaned?(null==(y=e.source)||y.dispose(),e.source=void 0,null==(_=e.state)||_.set(0,{kind:"idle"})):this._wireSource(e))}}catch(e){f=!0,g=e}finally{try{m||null==x.return||x.return()}finally{if(f)throw g}}this._bindTables(),this._armRules(),this._arm()}getInput(e){var t;return null==(t=this._fields.find(t=>t.param.name===e))?void 0:t.input}get isValid(){return this.inputs.every(e=>null===e.validity.peek())}validateInputs(){return this.isValid}get unsupported(){return this._unsupported}get problems(){return this._problems}_build(){let e=[...this._call.inputParams.values()],t=new Map,n=new Map;var r=!0,i=!1,o=void 0;try{for(var a,l,s,u,d=e[Symbol.iterator]();!(r=(u=d.next()).done);r=!0){let e=u.value,r=iw._route(e.property);t.set(e,r),"table"===r&&n.set(e.name,e)}}catch(e){i=!0,o=e}finally{try{r||null==d.return||d.return()}finally{if(i)throw o}}this._autoFill(n.values());let c=[];var p=!0,h=!1,m=void 0;try{for(var f,g,v,b=e[Symbol.iterator]();!(p=(v=b.next()).done);p=!0){let e,r=v.value,i=t.get(r);if("skip"===i)continue;if(("column"===i||"columns"===i)&&(e=n.get(null!=(g=function(e){var t;let n=r1(e,"parentTableParamName");if("string"==typeof n&&""!==n)return n;let r=null==(t=e.options)?void 0:t.table;return"string"==typeof r&&""!==r?r:null}(r.property))?g:""),void 0===e&&(i="unsupported")),"unsupported"===i){this._unsupported.push(r.name);continue}let o=null!=(f=r.property.category)?f:"Misc",a=c.find(e=>e.name===o);void 0===a&&(a={name:o,entries:[]},c.push(a)),a.entries.push({param:r,route:i,parent:e})}}catch(e){h=!0,m=e}finally{try{p||null==b.return||b.return()}finally{if(h)throw m}}let y=c.length>1||1===c.length&&"Misc"!==c[0].name;this._plan=[];let _=null,w=null==(s=this._call.func)||null==(l=s.options)?void 0:l.categoryGroups;if("string"==typeof w&&""!==w)try{_=function e(t,n){let r=[];if(null===t||"object"!=typeof t||Array.isArray(t))if(Array.isArray(t)){var i=!0,o=!1,a=void 0;try{for(var l,s=t[Symbol.iterator]();!(i=(l=s.next()).done);i=!0){let e=l.value;"string"==typeof e&&r.push({isHeader:!1,name:e,level:n})}}catch(e){o=!0,a=e}finally{try{i||null==s.return||s.return()}finally{if(o)throw a}}}else"string"==typeof t&&r.push({isHeader:!1,name:t,level:n});else{var u=!0,d=!1,c=void 0;try{for(var p,h=Object.keys(t)[Symbol.iterator]();!(u=(p=h.next()).done);u=!0){let i=p.value;r.push({isHeader:!0,name:i,level:n}),r.push(...e(t[i],n+1))}}catch(e){d=!0,c=e}finally{try{u||null==h.return||h.return()}finally{if(d)throw c}}}return r}(JSON.parse(w),1)}catch(e){console.warn("u2 func-form: malformed categoryGroups JSON — rendering flat: "+(e instanceof Error?e.message:String(e)))}let x=new Set,k=new Set(null!=(a=this._formOptions.collapsedCategories)?a:[]),O=(e,t,n)=>{let r=this.build(()=>new rY.w({title:e,collapsible:t,expanded:!(t&&k.has(e))}));return r.header.classList.add("u2-form-category"),void 0!==n&&r.header.classList.add(n),this.addElement(r.root),r},A=(e,t,n,r)=>{let i=this._fields.length;if(void 0!==r){x.add(r);var o=!0,a=!1,l=void 0;try{for(var s,u=r.entries[Symbol.iterator]();!(o=(s=u.next()).done);o=!0){let e=s.value,t=e.param,r=e.route,i=e.parent;this._addField(t,r,i,null==n?void 0:n.body)}}catch(e){a=!0,l=e}finally{try{o||null==u.return||u.return()}finally{if(a)throw l}}}this._plan.push({name:e,level:t,el:null==n?void 0:n.header,fields:this._fields.slice(i)})};var S=!0,P=!1,E=void 0;try{for(var C,j=(null!=_?_:[])[Symbol.iterator]();!(S=(C=j.next()).done);S=!0){let e=C.value,t=c.find(t=>t.name===e.name&&!x.has(t)),n=e.isHeader||y?O(e.name,void 0!==t,"u2-form-category-l"+Math.min(e.level,3)):void 0;A(e.name,e.level,n,t)}}catch(e){P=!0,E=e}finally{try{S||null==j.return||j.return()}finally{if(P)throw E}}var T=!0,N=!1,I=void 0;try{for(var D,L=c[Symbol.iterator]();!(T=(D=L.next()).done);T=!0){let e=D.value;x.has(e)||A(e.name,1,y?O(e.name,!0):void 0,e)}}catch(e){N=!0,I=e}finally{try{T||null==L.return||L.return()}finally{if(N)throw I}}this._updateHeaders();let z=new MutationObserver(()=>this._updateHeaders());var F=!0,B=!1,M=void 0;try{for(var R,q=this._fields[Symbol.iterator]();!(F=(R=q.next()).done);F=!0){let e=R.value;z.observe(e.input.root,{attributeFilter:["hidden"]})}}catch(e){B=!0,M=e}finally{try{F||null==q.return||q.return()}finally{if(B)throw M}}this.own(()=>z.disconnect())}_autoFill(e){if(this._autoFilled.clear(),!0!==this._formOptions.skipTableAutoFill){var t=!0,n=!1,r=void 0;try{for(var i,o=e[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){let e=i.value;if(null!=e.value)continue;let t=function(){var e,t;let n=P.tableNames(),r=g.shell.t;return null!=r&&n.includes(r.name)?r:null!=(e=(null!=(t=g.shell.tables)?t:[]).find(e=>n.includes(e.name)))?e:null}();null!=t&&(this._call.setParamValue(e.name,t),this._autoFilled.add(e.name))}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}}}static _route(e){var t,n,r,i;let o=e.options,a=null!=(t=null!=(n=null==o?void 0:o.editor)?n:e.editor)?t:null;if("none"===a)return"skip";if((null==o?void 0:o.editorParam)!=null)return"unsupported";let l=null!=(r=null!=(i=e.propertyType)?i:e.type)?r:"";if(null===a){if("dataframe"===l)return"table";if("column"===l)return"column";if("column_list"===l)return"columns"}return"string"===l&&(null==o?void 0:o.choices)!=null?"choices":"string"===l&&(null==o?void 0:o.suggestions)!=null?"suggestions":"list"===l&&(null==o?void 0:o.choices)!=null?"multiChoices":"list"===l?null!=e.choices&&e.choices.length>0?"field":"unsupported":"file"===l&&null===a||iy.has(l)&&(null===a||i_.has(String(a).toLowerCase()))?"field":"unsupported"}_addField(e,t,n,r){let i=iw._caption(e.property,e.name),o=[];try{this._buildField(e,t,i,o,n,r)}catch(f){let t=null==(d=this._formOptions.overrides)||null==(u=d[e.name])?void 0:u.input;var a=!0,l=!1,s=void 0;try{for(var u,d,c,p=o[Symbol.iterator]();!(a=(c=p.next()).done);a=!0){let e=c.value;this.remove(e),e!==t&&e.dispose()}}catch(e){l=!0,s=e}finally{try{a||null==p.return||p.return()}finally{if(l)throw s}}let n=this._fields.findIndex(t=>t.param===e);n>=0&&this._fields.splice(n,1);let h=f instanceof Error?f.message:String(f),m=e_.readonlyField(i,e.name,(0,_.Ln)(`Could not show ${i}: ${h}`,"u2-param-source-error")).row;void 0===r?this.addElement(m):r.append(m),this._problems.value=[...this._problems.peek(),{name:e.name,message:h}]}}_buildField(e,t,n,r,i,o){var l,s,u,c,p,h,m,f,g,b,y;let _,w,x,k,O,A,S=e.property,P=null!=(l=null==(u=this._formOptions.overrides)?void 0:u[e.name])?l:{},E=P.input,j=ib(P,["input"]),T=ig({name:e.name,label:n,tooltipText:null!=(s=S.description)?s:void 0,nullable:S.nullable,required:!1,postfix:S.units||(null==(c=S.options)?void 0:c.units)||void 0},j),D=E?null:this.build(()=>er.resolve(S,T)),L=(null!=E?E:D)!=null?"field":t,F="column"===L||"columns"===L?(x=S.semType,O="number"==typeof(k=r1(S,"maxCategories"))&&isFinite(k)?k:null,A=function(e){if(null==e||""===e)return()=>!0;if(e===r9||e===r7){let t=e===r9;return e=>{var n,r;return(null!=(n=null==(r=e.stats)?void 0:r.missingValueCount)?n:0)>0===t}}switch(e){case"numerical":return e=>!0===e.isNumerical;case"numerical_no_datetime":return e=>!0===e.isNumerical&&"datetime"!==e.type;case"categorical":return e=>!0===e.isCategorical;case"datetime":return e=>"datetime"===e.type;case"categorical_or_datetime":return e=>!0===e.isCategorical||"datetime"===e.type;default:return t=>t.type===e}}(null!=(y=S.columnTypeFilter)?y:null),e=>{var t,n;return A(e)&&(null==x||""===x||e.semType===x)&&(!0!==e.isCategorical||null===O||(null!=(t=null==(n=e.categories)?void 0:n.length)?t:0)<=O)}):void 0;if("choices"===L)_=this.build(()=>new v.o(iv(ig({},T),{items:[]}))),w="choice";else if("multiChoices"===L)_=this.build(()=>new v.F(iv(ig({},T),{items:[],showSummaryCheckbox:!0}))),w="list";else if("suggestions"===L)_=this._suggestInput(e.name,T),w="string";else if("table"===L){let t=T.label,n=ib(T,["label"]);_=this.build(()=>{var r;return r=null!=t?t:e.name,new z(I(N({},void 0===n?{}:n),{label:r}))}),w="string"}else if("column"===L)_=this.build(()=>new C(iv(ig({},T),{table:r3(null==i?void 0:i.value),filter:F}))),w="string";else if("columns"===L)_=this.build(()=>new ty(iv(ig({},T),{table:r3(null==i?void 0:i.value),filter:F}))),w="list";else{let e=(null!=E?E:D)!=null?null:e_.platformInput(this,S,this._call,"auto"===this._formOptions.editors);_=null!=(m=null!=(f=null!=E?E:D)?f:e)?m:this.build(()=>ey(S,iv(ig({},T),{assumeWritable:!0}))),w=null!==e&&_===e?null:ec(S,!0)}r.push(_);let B={param:e,input:_,kind:w,route:L,filter:F,orphaned:!1,propagate:"choices"===L&&(null==(p=S.options)?void 0:p.propagateChoice)==="all",applying:!1,exprVisible:!0,exprEnabled:!0,active:(0,d.vP)(!0)};if("table"===L)B.fromParam=e=>{var t,n;return null!=(t=null==(n=r4(e))?void 0:n.name)?t:null},B.toParam=()=>_.table;else if("column"===L||"columns"===L){B.parentName=i.name;let e=()=>{var e;return r8(null==(e=this._parentField(B))?void 0:e.param.value)};"column"===L?(B.fromParam=e=>{var t,n;return null!=(t=null==(n=r4(e))?void 0:n.name)?t:null},B.toParam=t=>{var n,r;return null==t?null:null!=(n=null==(r=e())?void 0:r.columns.byName(t))?n:null}):(B.fromParam=e=>r5(e),B.toParam=t=>{let n=e();return null==n?[]:t.map(e=>n.columns.byName(e)).filter(e=>null!=e)})}if(null!==w){_.value=this._show(B),!1===S.nullable&&_.addValidator(e=>B.active.peek()&&iw._empty(e)?this._requiredMessage(B):null);let t=null==(g=S.options)?void 0:g.validator;if(null!=t){let n=function(e){let t;if(e.length<2||!e.startsWith("/"))return null;let n=e.lastIndexOf("/");if(n<=0)return null;let r=e.slice(1,n),i=e.slice(n+1),o=`/${r}/${i}`;try{t=new RegExp(r,i.replace(/[^im]/g,""))}catch(t){let e=`Invalid validator ${o}: ${t.message.split(": ").pop()}`;return()=>e}return e=>"string"==typeof e&&t.test(e)?null:`Value doesn't match ${o}`}(String(t));_.addValidator(r=>!B.active.peek()||iw._empty(r)?null:null!==n?n(r):function(e,t,n,r){let i;if(!iu())return r.warn(n,"grok_ScriptSync is not available — skipping validation"),null;try{i=is.grok_ScriptSync(e,t)}catch(t){return`Error during validation: "${e}"`}return!1===i?e:"string"==typeof i?i:null}(String(t),this._variables(B,!1),e.name+":validator",this._warnings))}(null==(b=S.options)?void 0:b.validators)!=null&&(B.named=!0,B.namedRun=0,_.addValidator(()=>{var e;return B.active.peek()&&null!=(e=B.namedVerdict)?e:null}))}this.add(_,o);let M=Array.prototype.find.call(_.root.children,e=>e.classList.contains("u2-input-error"));void 0!==M&&this.effect(()=>{let e=_.validity.value,t=null===e?null:null!=B.namedDetail&&e===B.namedVerdict?B.namedDetail:e;null===t?M.removeAttribute("title"):M.title=t}),this._applyVisible(B),"table"===L&&this._autoFilled.has(e.name)&&io(B),this._fields.push(B),("choices"===L||"multiChoices"===L)&&this._wireSource(B);let R="choices"===L?null==(h=S.options)?void 0:h.descriptions:null;null!=R&&"object"==typeof R&&this.effect(()=>{var e,t;let n=_.value;_.box.title=null!=(e=null!=(t=null!=n?R[n]:void 0)?t:S.description)?e:""});let q=!0;this.effect(()=>{var t,n,r;let i=_.value;if(q){q=!1;return}if(!this._refreshing&&!B.orphaned){if(null==i&&void 0!==B.autoBadge&&ia(B),null!==B.kind){if(e_.same(i,this._read(B)))return;this._call.setParamValue(e.name,void 0!==B.toParam?B.toParam(i):iw._paramValue(B.kind,i)),!B.propagate||B.applying||a.p.isSystemWrite||!0===this._formOptions.skipDefaultInit||this._propagate(B,i),B.named&&this._runNamed(B)}null!=B.param.value&&(null==(t=B.state)||t.set(1,{kind:"idle"})),null==(n=(r=this._formOptions).onInputChanged)||n.call(r,e.name,i)}})}_suggestInput(e,t){let n={};return this.build(()=>new rQ.Z(iv(ig({},t),{minChars:1,source:(t,r)=>im(function*(){var i;let o=this._call;if("function"!=typeof o.evalParamSuggestions)throw Error("call does not support suggestion evaluation");let a=yield o.evalParamSuggestions(e,t);return r.aborted||(n=null!=(i=a.tooltips)?i:{}),a.items}).call(this),renderItem:e=>{let t=rK.j.row("u2-typeahead-text",e);return null!=n[e]&&(t.title=n[e]),t}})))}_wireSource(e){var t;let n=this._stateOf(e);(null==(t=e.source)||t.dispose(),e.source=void 0,"function"!=typeof this._call.evalParamChoices)?n.set(0,{kind:"error",message:"Couldn't load choices: call does not support choice evaluation",retry:()=>this._wireSource(e)}):e.source=this.build(()=>new r0(this._call,e.param.name,t=>this._applyItems(e,t),n))}_applyItems(e,t){e.lookup=t.lookup,e.applying=!0,e.input.setItems(t.items),queueMicrotask(()=>e.applying=!1)}_stateOf(e){let t=e.state;if(void 0===t){let n=this.build(()=>new rX);t=n,e.state=n,this._genSig.value=this._genSig.peek()+1,e.input.box.append(n.root),this.effect(()=>{n.busy.value,this._applyEnabled(e)}),this.effect(()=>e.input.loading=n.loading.value)}return t}_applyVisible(e){var t,n;let r=null==(n=this._formOptions.overrides)||null==(t=n[e.param.name])?void 0:t.visible,i=void 0===r||(r instanceof d.HN?r.peek():r);e.input.root.hidden=!i||!e.exprVisible||"table"===e.route&&!1===this._formOptions.showTableSelectors,this._updateHeaders()}_updateHeaders(){let e=this._plan,t=Array(e.length).fill(!1);for(let n=e.length-1;n>=0;n--){let r=e[n],i=r.fields.some(e=>!e.input.root.hidden);for(let o=n+1;o<e.length&&e[o].level>r.level;o++)if(t[o]){i=!0;break}t[n]=i,void 0!==r.el&&(r.el.hidden=!i)}}_applyEnabled(e){var t,n,r;let i=null==(t=e.param.property.options)?void 0:t.enabled,o="column"===e.route||"columns"===e.route;if(e.input.disabled=e.orphaned?o?"Its table is not on the form":"Gone from the function":e.exprEnabled?(null==(n=e.state)?void 0:n.busy.peek())?"Loading its choices…":null:`Enabled when: ${String(i)}`,null!==e.input.disabled){let t=null==(r=e.state)?void 0:r.root.querySelector(".u2-param-source-retry");null==t||t.removeAttribute("disabled")}}_propagate(e,t){let n=null==t||null==(a=e.lookup)?void 0:a[String(t)];if(null!=n){var r=!0,i=!1,o=void 0;try{for(var a,l,s=Object.keys(n)[Symbol.iterator]();!(r=(l=s.next()).done);r=!0){let t=l.value,r=this._fields.find(n=>n.param.name===t&&!n.orphaned&&n!==e);void 0!==r&&(r.input.value=null===r.kind?n[t]:e_.coerce(r.kind,n[t]))}}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}}}_armRules(){this._warnings.clear(),null==(i=this._rules)||i.dispose();let e=new s.HG;this._rules=e;var t=!0,n=!1,r=void 0;try{for(var i,o,a=this._fields[Symbol.iterator]();!(t=(o=a.next()).done);t=!0){let t=o.value,n=t.param.property.options,r=(null==n?void 0:n.visible)!=null,i=(null==n?void 0:n.enabled)!=null;(r||i)&&e.effect(()=>{let e=this._variables(t,!0);r&&(t.exprVisible=ic(n.visible,e,t.exprVisible,t.param.name+":visible",this._warnings)),i&&(t.exprEnabled=ic(n.enabled,e,t.exprEnabled,t.param.name+":enabled",this._warnings)),this._applyVisible(t),this._applyEnabled(t);let o=t.exprVisible&&t.exprEnabled;o!==t.active.peek()&&(t.active.value=o,t.input.revalidate(),t.named&&this._runNamed(t))}),(null==n?void 0:n.validator)!=null&&null!==t.kind&&e.effect(()=>{this._variables(t,!0),t.input.revalidate()})}}catch(e){n=!0,r=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw r}}this._namedStarts=[];var l=!0,u=!1,d=void 0;try{for(var c,p=this._fields[Symbol.iterator]();!(l=(c=p.next()).done);l=!0){let e=c.value;e.named&&!e.orphaned&&this._namedStarts.push(this._runNamed(e))}}catch(e){u=!0,d=e}finally{try{l||null==p.return||p.return()}finally{if(u)throw d}}}_variables(e,t){let n={};var r=!0,i=!1,o=void 0;try{for(var a,l=this._fields[Symbol.iterator]();!(r=(a=l.next()).done);r=!0){let e=a.value;e.orphaned||(n[e.param.name]=void 0!==e.toParam?e.param.value:t?e.input.value:e.input.peek())}}catch(e){i=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return n.value=void 0!==e.toParam?e.param.value:e.input.peek(),n}_runNamed(e){return im(function*(){let t=++e.namedRun,n=this._generation,r=(t,n)=>{e.namedDetail=n,e.namedVerdict!==t&&(e.namedVerdict=t,e.input.revalidate())},i=e.input.peek();if(!e.active.peek()||iw._empty(i))return void r(null);let o=this._call;if("function"!=typeof o.evalParamValidators){this._warnings.warn(e.param.name+":validators","call does not support validator evaluation"),r(null);return}try{let i=yield o.evalParamValidators(e.param.name);if(t!==e.namedRun||n!==this._generation||this.scope.isDisposed)return;let a=i.find(e=>!1!==e.isError),l=i.find(e=>!1===e.isError);this._stateOf(e).notice(null!=l?ip(l.message):null),r(null!=a?ip(a.message):null)}catch(u){var a,l;if(t!==e.namedRun||n!==this._generation||this.scope.isDisposed)return;let i=u instanceof Error?u.message:String(u);this._warnings.warn(e.param.name+":validators",i);let o=null==(l=e.param.property.options)?void 0:l.validators,s=Array.isArray(o)?null!=(a=o.find(e=>"string"==typeof e&&i.includes(String(e))))?a:1===o.length?o[0]:null:null;r(null!=s?`Couldn't validate (validator '${s}' is misconfigured)`:"Couldn't validate (a validator is misconfigured)",i)}}).call(this)}static _empty(e){return e_.isEmpty(e)||Array.isArray(e)&&0===e.length}_arm(){let e=[];var t=!0,n=!1,r=void 0;try{for(var i,o=this._fields[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){let t=i.value;void 0===t.source||t.orphaned||e.push(t.source.start())}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}this._settled=Promise.allSettled([this._initDefaults(),...e,...this._namedStarts]).then(()=>void 0)}_initDefaults(){if(!0===this._formOptions.skipDefaultInit)return Promise.resolve();let e=[];var t=!0,n=!1,r=void 0;try{for(var i,o,a=this._call.inputParams.values()[Symbol.iterator]();!(t=(o=a.next()).done);t=!0){let t=o.value;"skip"!==iw._route(t.property)&&(null==(i=t.property.options)?void 0:i.default)!=null&&null==t.value&&e.push(this._evalDefault(t.name))}}catch(e){n=!0,r=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw r}}return Promise.allSettled(e).then(()=>void 0)}_evalDefault(e,t){let n=void 0!==t&&t;return im(function*(){let t=this._call,r=this._generation,i=[...t.inputParams.values()].find(t=>t.name===e),o=this._fields.find(t=>t.param.name===e&&!t.orphaned),a=void 0!==o?this._stateOf(o):void 0;try{if("function"!=typeof t.evalParamDefault)throw Error("call does not support default evaluation");null==a||a.set(1,{kind:"loading",refresh:n});let o=yield t.evalParamDefault(e);if(this._generation!==r||this.scope.isDisposed)return;(null==i?void 0:i.value)==null&&t.setParamValue(e,o),null==a||a.set(1,{kind:"idle"})}catch(t){if(this._generation!==r||this.scope.isDisposed)return;null==a||a.set(1,{kind:"error",message:"Couldn't compute the default: "+(t instanceof Error?t.message:String(t)),retry:()=>void this._evalDefault(e,!0)})}}).call(this)}_bind(){if(!1!==this._formOptions.twoWayBinding){var e=!0,t=!1,n=void 0;try{for(var r,i=this._fields[Symbol.iterator]();!(e=(r=i.next()).done);e=!0){let e=r.value;if(e.orphaned)continue;let t=e.param.onChanged.subscribe(()=>this._refreshField(e)),n=()=>t.unsubscribe();this.own(n),this._paramSubs.push(n)}}catch(e){t=!0,n=e}finally{try{e||null==i.return||i.return()}finally{if(t)throw n}}}}_refreshField(e){var t;null!=e.param.value&&(null==(t=e.state)||t.set(1,{kind:"idle"})),this._refreshing=!0;try{let t=this._show(e);if(e_.same(t,e.input.peek()))return;e.input.value=t}finally{this._refreshing=!1}e.named&&this._runNamed(e)}_show(e){let t="table"===e.route?r3(e.param.value):null;return null!==t&&P.tableNames().includes(t.name)&&P.isOpen(t)&&(e.input.table=t),this._read(e)}_read(e){if(void 0!==e.fromParam)return e.fromParam(e.param.value);let t=e.param.value;return null===e.kind?t:e_.coerce(e.kind,t)}_requiredMessage(e){var t;if("column"!==e.route&&"columns"!==e.route)return"Value can't be empty";let n=r8(null==(t=this._parentField(e))?void 0:t.param.value);return null===n?null:P.listedColumns(n,e.filter).length>0?"Value can't be empty":function(e,t){var n,r;let i=e.semType;if(null!=i&&""!==i)return`No ${i} columns in '${t}'`;let o=null!=(n=e.columnTypeFilter)?n:null;return null==o||""===o?`No columns in '${t}'`:o===r9||o===r7?`No columns ${o===r9?"with":"without"} missing values in '${t}'`:`No ${null!=(r=ie[o])?r:o} columns in '${t}'`}(e.param.property,n.name)}_parentField(e){return this._fields.find(t=>t.param.name===e.parentName)}_bindTables(){var e=!0,t=!1,n=void 0;try{for(var r,i=this._tableBindings[Symbol.iterator]();!(e=(r=i.next()).done);e=!0)r.value.dispose()}catch(e){t=!0,n=e}finally{try{e||null==i.return||i.return()}finally{if(t)throw n}}this._tableBindings=[];let o=new Map;var a=!0,l=!1,s=void 0;try{for(var u,d,c=this._fields[Symbol.iterator]();!(a=(d=c.next()).done);a=!0){let e=d.value;if("column"!==e.route&&"columns"!==e.route)continue;let t=this._parentField(e),n=e.orphaned||void 0===t||t.orphaned;if(n!==e.orphaned&&(e.orphaned=n,this._applyEnabled(e)),n)continue;let r=null!=(u=o.get(t))?u:[];r.push({kind:e.route,field:e,filter:e.filter}),o.set(t,r)}}catch(e){l=!0,s=e}finally{try{a||null==c.return||c.return()}finally{if(l)throw s}}var p=!0,h=!1,m=void 0;try{for(var f,g=this._fields[Symbol.iterator]();!(p=(f=g.next()).done);p=!0){let e=f.value;if(e.orphaned||"table"!==e.route&&!o.has(e))continue;let t=this.build(()=>{var t;return new il(this._call,e.param,e=>r6(e),null!=(t=o.get(e))?t:[],(e,t)=>this._clearedNotice(e.field,t))});this._tableBindings.push(t),t.start()}}catch(e){h=!0,m=e}finally{try{p||null==g.return||g.return()}finally{if(h)throw m}}}_clearedNotice(e,t){let n=this._stateOf(e);if(n.notice(`Selection cleared — columns belonged to '${t}'`),void 0!==e.noticeClear)return;let r=e.input.root,i=()=>{n.notice(null),r.removeEventListener("pointerdown",i),r.removeEventListener("keydown",i),e.noticeClear=void 0};r.addEventListener("pointerdown",i),r.addEventListener("keydown",i),e.noticeClear=i}static _caption(e,t){let n=e.friendlyName;return(0,B.Hh)(null!=n&&""!==n?n:t)}static _paramValue(e,t){let n=globalThis.dayjs;return"datetime"===e&&t instanceof Date&&"function"==typeof n?n(t):t}constructor(e,t){var n;let r=void 0===t?{}:t;super({layout:null!=(n=r.layout)?n:r.condensed?"tall":void 0}),this._fields=[],this._unsupported=[],this._autoFilled=new Set,this._paramSubs=[],this._tableBindings=[],this._refreshing=!1,this._generation=0,this._settled=Promise.resolve(),this._plan=[],this._namedStarts=[],this._warnings=new id,this._running=(0,d.vP)(!1),this._genSig=(0,d.vP)(0),this._problems=(0,d.vP)([]),this._formOptions=r,this._call=e,this.root.dataset.u2="func-form",this.effect(()=>this.root.setAttribute("aria-busy",String(this._running.value))),this._build(),this.missingRequired=(0,d.EW)(()=>{this._genSig.value;let e=[];var t=!0,n=!1,r=void 0;try{for(var i,o=this._fields[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){let t=i.value;!t.orphaned&&!1===t.param.property.nullable&&t.active.value&&iw._empty(t.input.value)&&e.push(t.input.label||t.param.name)}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}return e}),this.invalidFields=(0,d.EW)(()=>{this._genSig.value;let e=[];var t=!0,n=!1,r=void 0;try{for(var i,o=this._fields[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){let t=i.value;!t.orphaned&&t.active.value&&null!==t.input.validity.value&&e.push(t.input.label||t.param.name)}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}return e}),this.loadingFields=(0,d.EW)(()=>{this._genSig.value;let e=[];var t=!0,n=!1,r=void 0;try{for(var i,o=this._fields[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){let t=i.value;!t.orphaned&&t.active.value&&void 0!==t.state&&t.state.loading.value&&e.push(t.input.label||t.param.name)}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}return e}),this._bind(),this._bindTables(),this._armRules(),this.own(()=>{var e;return null==(e=this._rules)?void 0:e.dispose()}),this._arm(),void 0!==r.showHistory&&this._buildHistoryIcon(r.showHistory),void 0!==r.showRun&&this._buildRunButton(r.showRun)}}function ix(e,t){return new iw(e,t)}new WeakSet,n(5361),eN();function ik(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}o.ObjectHandler,o.ObjectHandler;class iO{get restoring(){return 0!==this._restoring}restore(e){var t;return(t=function*(){this._restoring++;try{return yield e()}finally{this._restoring--}},function(){var e=this,n=arguments;return new Promise(function(r,i){var o=t.apply(e,n);function a(e){ik(o,r,i,a,l,"next",e)}function l(e){ik(o,r,i,a,l,"throw",e)}a(void 0)})}).call(this)}static _typed(e,t){return e.page===t.page&&e.entity===t.entity&&e.mode===t.mode}_moved(e,t){return e.page!==t.page||e.query!==t.query||e.search!==t.search||e.mode!==t.mode||e.entity!==t.entity&&e.entity!==this._host.draftEntity}_restoreFromUrl(){this._host.isCurrentView()&&this._host.owns(location.pathname)&&this._host.open(`${location.pathname}${location.search}`)}_arm(){this._disarm(),this._typing=setTimeout(()=>this._typing=void 0,iO.SETTLE_MS)}_disarm(){void 0!==this._typing&&clearTimeout(this._typing),this._typing=void 0}constructor(e,t){this._host=e,this._restoring=0;const n=t.owner,r=()=>this._restoreFromUrl();window.addEventListener("popstate",r),n.own(()=>window.removeEventListener("popstate",r));let i=e.state();n.effect(()=>{let t=e.path.value,n=i;if(i=e.state(),0===this._restoring&&"u">typeof history&&this._moved(n,i)){if(iO._typed(n,i)){void 0===this._typing?history.pushState(null,"",t):history.replaceState(null,"",t),this._arm();return}this._disarm(),history.pushState(null,"",t)}}),n.own(()=>this._disarm())}}iO.SETTLE_MS=600,el.register("file",(e,t)=>new e4(t))},9832(e,t,n){n.d(t,{xHQ:()=>Q.x,Lnh:()=>m.Ln,d52:()=>b.d,wn6:()=>j.w,on:()=>m.on,U5B:()=>x.U,BZS:()=>C.B,x6e:()=>m.x6,ZDJ:()=>E,yPk:()=>m.yP,zTF:()=>Y.z,Gwp:()=>q.G,p$C:()=>B.p$,YW0:()=>T.Y,vPA:()=>r.vP,B1Y:()=>m.B1,y4m:()=>m.y4,O8t:()=>r.O8,HGh:()=>i.HG,Q7x:()=>O.Q,Z9o:()=>et.Z,ksK:()=>v.k,jJZ:()=>en.j,oGE:()=>k.o,pde:()=>u.p,Cqk:()=>ee.C,J3s:()=>A.J,s9R:()=>o.s9,__1:()=>d._,LSg:()=>ea.LS,qVA:()=>B.qV,xBQ:()=>R.x,nfo:()=>m.nf,Bsq:()=>M.Bs,_Qr:()=>m._Q,Omf:()=>M.Om,vAk:()=>r.vA,lGe:()=>S.l,EWP:()=>r.EW,$Mz:()=>K.$,WXT:()=>J.W,gbS:()=>U.gb,lVW:()=>C.l,qjb:()=>F,EcF:()=>o.Ec});var r=n(7115),i=n(1518),o=n(9701);n(8695),n(2454);var a=n(8191),l=n(6090);n(5445);var s=n(3830);n(4335),n(2855),n(9378),n(30);var u=n(7974),d=n(4860);function c(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}class h extends o.Ec{get value(){return this.signal.value}set value(e){this.signal.value=e}peek(){return this.signal.peek()}bindStep(e){return""===e?this.signal:super.bindStep(e)}focus(){this._input.focus()}getState(){var e,t;let n=this._input.placeholder;return p((e=p({},super.getState()),t=t={value:this.peek(),text:this._input.value,open:this._open.peek(),busy:"loading"===this._view.peek().kind},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e),n?{placeholder:n}:{})}getItems(e){let t="function"==typeof this._options.items?this._lastItems():this._options.items,n=new Set(this._shown.peek());return u.p.itemsState(t.map((e,t)=>({key:e,label:e,index:t,selected:e===this.peek(),rendered:n.has(e)})),null==e?void 0:e.all)}revealItem(e){var t,n=this,r=()=>super.revealItem;return(t=function*(){this._all.value=!0,this._source&&this._source.query(""),this._openPopup();for(let e=0;e<50&&"loading"===this._view.peek().kind;e++)yield new Promise(e=>setTimeout(e,20));return r().call(n,e)},function(){var e=this,n=arguments;return new Promise(function(r,i){var o=t.apply(e,n);function a(e){c(o,r,i,a,l,"next",e)}function l(e){c(o,r,i,a,l,"throw",e)}a(void 0)})}).call(this)}accessibleLabel(){var e,t;return null!=(e=null!=(t=super.accessibleLabel())?t:o.Ec.labelOf(this._input))?e:this._input.placeholder||void 0}_lastItems(){let e=this._view.peek();return"ready"===e.kind?e.items:[]}_send(e){let t=this._machine.peek();switch(e.type){case"focus":"idle"===t&&(this._machine.value="focused");break;case"blur":this._dismiss(),this._machine.value="idle";break;case"input":this._activeIndex.value=-1,this._all.value=!1,this._refresh(),this._openPopup();break;case"arrowDown":if("open"===t){this._move(1);break}this._refresh(),this._openPopup();break;case"arrowUp":"open"===t&&this._move(-1);break;case"enter":"open"===t&&this._commit(this._activeIndex.peek());break;case"escape":"open"===t?this._dismiss():this.value="";break;case"tab":case"dismiss":this._dismiss();break;case"select":this._commit(e.index)}}_openPopup(){this._open.peek()||(this._machine.value="open",this._open.value=!0,this._closeOverlay=s.h.show(this._input,this._popup,{owner:this.scope}))}_dismiss(){if(!this._open.peek())return;this._open.value=!1,this._all.value=!1,this._activeIndex.value=-1,"open"===this._machine.peek()&&(this._machine.value="focused");let e=this._closeOverlay;this._closeOverlay=void 0,e&&e()}_refresh(){this._source&&this._source.query(this.peek())}_move(e){let t=this._shown.peek().length;0!==t&&(this._activeIndex.value=Math.min(Math.max(this._activeIndex.peek()+e,0),t-1))}_commit(e){let t=this._shown.peek();e<0||e>=t.length||(this.value=t[e],this._dismiss(),this._input.focus())}_onKeyDown(e){let t=this._open.peek(),n="Enter"===e.key?this._options.onEnter:"Escape"===e.key?this._options.onEscape:void 0;if(void 0!==n&&!t&&!e.isComposing){e.preventDefault(),e.stopPropagation(),n(e,this);return}switch(e.key){case"ArrowDown":e.preventDefault(),this._send({type:"arrowDown"});break;case"ArrowUp":e.preventDefault(),this._send({type:"arrowUp"});break;case"Enter":t&&e.preventDefault(),this._send({type:"enter"});break;case"Escape":this._send({type:"escape"});break;case"Tab":this._send({type:"tab"})}}_onPopupPointerDown(e){let t=e.target,n=t.closest(".u2-combobox-option");if(n){e.preventDefault(),this._send({type:"select",index:[...this._list.children].indexOf(n)});return}t.closest(".u2-combobox-retry")&&(e.preventDefault(),this._source&&this._source.retry())}_renderStatus(){let e=this._status,t=this._view.value;if(e.textContent="",e.className="u2-combobox-status",e.hidden=!this._open.value||"ready"===t.kind,e.hidden)return;if("error"===t.kind){e.className="u2-combobox-error",e.textContent=t.message;let n=document.createElement("button");n.className="u2-combobox-retry",n.type="button",n.textContent="Retry",e.append(n);return}let n="empty"===t.kind;e.className=n?"u2-combobox-empty":"u2-combobox-loading",e.textContent=n?"No matches":"Loading…"}_applyActive(){let e=this._shown.value.length,t=this._activeIndex.value,n=this._list.children;for(let r=0;r<e;r++)n[r].classList.toggle("u2-combobox-option-active",r===t),n[r].setAttribute("aria-selected",r===t?"true":"false");let r=t>=0&&t<e?n[t]:void 0;r?(this._input.setAttribute("aria-activedescendant",r.id),r.scrollIntoView({block:"nearest"})):this._input.removeAttribute("aria-activedescendant")}_option(e){let t=document.createElement("div");t.className="u2-combobox-option",t.id=`${this._id}-opt-${++this._optionSeq}`,t.setAttribute("role","option"),t.setAttribute("aria-selected","false");let n=document.createElement("span");return n.dataset.u2Part="item-label",n.textContent=e,t.append(n),t}constructor(e){var t;super(),this.signal=(0,r.vP)(""),this._id=`u2-combobox-${++h._seq}`,this._input=document.createElement("input"),this._popup=document.createElement("div"),this._list=document.createElement("div"),this._status=document.createElement("div"),this._open=(0,r.vP)(!1),this._all=(0,r.vP)(!1),this._machine=(0,r.vP)("idle"),this._activeIndex=(0,r.vP)(-1),this._optionSeq=0,this._options=e,this.isOpen=this._open,this.machineState=this._machine,this.root.classList.add("u2-combobox"),this.root.dataset.u2="combobox";const n=this._input;if(n.className="u2-combobox-input",n.type="text",n.autocomplete="off",n.placeholder=null!=(t=e.placeholder)?t:"",n.id=`${this._id}-input`,n.setAttribute("role","combobox"),n.setAttribute("aria-autocomplete","list"),n.setAttribute("aria-haspopup","listbox"),n.setAttribute("aria-controls",`${this._id}-listbox`),e.label&&n.setAttribute("aria-label",e.label),this.root.append(n),this._popup.className="u2-combobox-popup",this._popup.id=`${this._id}-listbox`,this._popup.setAttribute("role","listbox"),this._list.className="u2-combobox-options",this._popup.append(this._list,this._status),"function"==typeof e.items){const t=new l._(e.items);this._source=t,this._view=t.state,this.own(()=>t.dispose()),this.effect(()=>{"loading"===t.state.value.kind?this.root.setAttribute("aria-busy","true"):this.root.removeAttribute("aria-busy")})}else{const t=e.items;this._view=(0,r.EW)(()=>{let e=this._all.value?"":this.value.toLowerCase(),n=e?t.filter(t=>t.toLowerCase().includes(e)):t;return n.length>0?{kind:"ready",items:n}:{kind:"empty"}})}this._shown=(0,r.EW)(()=>{let e=this._view.value;return this._open.value&&"ready"===e.kind?e.items:[]}),(0,a.n)(n,this.signal,{owner:this.scope}),this.scope.listen(n,"input",()=>this._send({type:"input"})),this.scope.listen(n,"focus",()=>this._send({type:"focus"})),this.scope.listen(n,"blur",()=>this._send({type:"blur"})),this.scope.listen(n,"keydown",e=>this._onKeyDown(e)),this.scope.listen(this._popup,"pointerdown",e=>this._onPopupPointerDown(e)),this.scope.listen(this._popup,s.B,()=>this._send({type:"dismiss"})),this.effect(()=>n.setAttribute("aria-expanded",String(this._open.value))),this.build(()=>(0,d._)(this._list,this._shown,e=>e,e=>this._option(e))),this.effect(()=>this._renderStatus()),this.effect(()=>this._applyActive());let i=!0;this.effect(()=>{let e=this.value;i?i=!1:(0,r.O8)(()=>this.fireEvent("change",e))})}}h._seq=0;var m=n(8609);n(8255),n(4911);var f=n(5232),g=n(4977),v=n(8049),b=n(6050),y=n(4151);n(4980);var _=n(169);class w extends o.Ec{menu(e,t){return this._add({text:e,build:t}),this._roving(),this}setDisabled(e,t){let n=this._entries.findIndex(t=>t.item.text===e);if(n<0)return;let r=this._entries[n];w._apply(r,t||null),null!==r.off&&this._openIndex===n&&this._close(),this._roving()}getItems(){let e=this._entries.map((e,t)=>({key:e.item.text,label:e.item.text,index:t,disabled:null!==e.off,expanded:t===this._openIndex,rendered:!0}));return{count:e.length,list:e,truncated:!1}}static _apply(e,t){e.off=t,f.B.apply(e.el,t),null===t&&e.el.setAttribute("aria-disabled","false")}_add(e){let t=document.createElement("button");t.type="button",t.className="u2-menu-bar-item",t.tabIndex=-1,t.textContent=e.text,t.dataset.u2Item=e.text,t.setAttribute("role","menuitem"),t.setAttribute("aria-haspopup","menu"),t.setAttribute("aria-expanded","false");let n={item:e,el:t,off:null};w._apply(n,e.disabled||null),g.m.bind(t,()=>{var e;return null!=(e=n.off)?e:""},{owner:this.scope}),this.scope.listen(t,"click",()=>this._toggle(this._entries.indexOf(n))),this.scope.listen(t,"pointerenter",()=>this._hover(this._entries.indexOf(n))),this._entries.push(n),this.root.append(t)}_toggle(e){this._openIndex===e?this._close():this._show(e)}_show(e){let t=this._entries[e];if(!t||null!==t.off)return;this._close(),this._active=e,this._roving(),t.el.focus();let n=new _.W;t.item.build(n),this._menu=n,this._openIndex=e,this._open.value=t.item.text,n.show({anchor:t.el});let r=new i.HG(void 0,{label:"menu-bar-open"});r.listen(document,"keydown",e=>this._onOpenKeyDown(e)),r.effect(()=>{let e=n.isOpen.value;t.el.setAttribute("aria-expanded",String(e)),t.el.classList.toggle("u2-menu-bar-item-open",e),e||(this._menu===n&&(this._menu=void 0,this._watch=void 0,this._openIndex=-1,this._open.value=null),r.dispose())}),this._watch=r}_close(){this._menu&&this._menu.close(),this._watch&&this._watch.dispose(),this._menu=void 0,this._watch=void 0,this._openIndex=-1,this._open.value=null}_hover(e){this._openIndex>=0&&this._openIndex!==e&&this._show(e)}_move(e){!(e<0)&&(this._active=e,this._roving(),this._entries[e].el.focus(),this._openIndex>=0&&this._openIndex!==e&&this._show(e))}_roving(){(this._active>=this._entries.length||this._disabled(this._active))&&(this._active=this._edge(1));for(let e=0;e<this._entries.length;e++)this._entries[e].el.tabIndex=e===this._active?0:-1}_disabled(e){let t=this._entries[e];return!t||null!==t.off}_step(e,t){let n=this._entries.length;for(let r=1;r<=n;r++){let i=((e+t*r)%n+n)%n;if(!this._disabled(i))return i}return -1}_edge(e){let t=this._entries.length;for(let n=e>0?0:t-1;n>=0&&n<t;n+=e)if(!this._disabled(n))return n;return -1}_onFocusIn(e){let t=this._entries.findIndex(t=>t.el===e.target);t<0||(this._active=t,this._roving())}_onKeyDown(e){switch(e.key){case"ArrowLeft":case"ArrowRight":e.preventDefault(),this._move(this._step(this._active,"ArrowRight"===e.key?1:-1));break;case"Home":e.preventDefault(),this._move(this._edge(1));break;case"End":e.preventDefault(),this._move(this._edge(-1));break;case"ArrowDown":case"Enter":case" ":e.preventDefault(),this._openIndex!==this._active&&this._show(this._active);break;case"Escape":this._close()}}_onOpenKeyDown(e){e.defaultPrevented||this._openIndex<0||("ArrowLeft"===e.key||"ArrowRight"===e.key)&&(e.preventDefault(),this._move(this._step(this._active,"ArrowRight"===e.key?1:-1)))}constructor(e){super(),this._entries=[],this._open=(0,r.vP)(null),this._openIndex=-1,this._active=0,this.openMenu=this._open,this.root.classList.add("u2-menu-bar"),this.root.dataset.u2="menu-bar",this.root.setAttribute("role","menubar"),this.scope.listen(this.root,"keydown",e=>this._onKeyDown(e)),this.scope.listen(this.root,"focusin",e=>this._onFocusIn(e)),this.own(()=>this._close());var t=!0,n=!1,i=void 0;try{for(var o,a,l=(null!=(o=null==e?void 0:e.items)?o:[])[Symbol.iterator]();!(t=(a=l.next()).done);t=!0){const e=a.value;this._add(e)}}catch(e){n=!0,i=e}finally{try{t||null==l.return||l.return()}finally{if(n)throw i}}this._roving()}}var x=n(1831),k=n(4653);n(4291);var O=n(5363),A=n(8574),S=n(8848),P=n(9947);function E(e){return new Promise(t=>{var n,r;let i=(0,m.y4)([(0,m.Ln)(e.message,"u2-confirm-message")],"u2-confirm-text");void 0!==e.detail&&i.append((0,m.Ln)(e.detail,"u2-confirm-detail"));let o=(0,m.y4)(!0===e.destructive?[(0,P.K)("trash-alt",{cls:"u2-confirm-icon"}),i]:[i],"u2-confirm");null==(r=new S.l(e.title,{name:e.name}).add(o).onOK(t=>{var n;return null==(n=e.onConfirm)?void 0:n.call(e,t)},{text:null!=(n=e.confirmText)?n:"OK",primary:!0}).onClose(e=>t("ok"===e)).show({modal:e.modal}).getButton("CANCEL"))||r.focus()})}n(6588),n(6922),n(4467);var C=n(8195),j=n(1573),T=n(1019),N=n(317);function I(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function D(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function L(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function z(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,i=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var o=[],a=!0,l=!1;try{for(i=i.call(e);!(a=(n=i.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==i.return||i.return()}finally{if(l)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return I(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return I(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}class F extends o.Ec{getItems(e){let t=this.current.peek();return u.p.itemsState(this._items.peek().map((e,n)=>{let r=this._options.keyOf(e),i=this._rows.get(r);return L(D({key:r,label:void 0===i?r:o.Ec.text(i.label),index:n,selected:r===t},(null==i?void 0:i.check)===void 0?{}:{checked:i.check.peek()}),{rendered:void 0!==i})}),null==e?void 0:e.all)}getState(){var e;return L(D({},super.getState()),{current:null!=(e=this.current.peek())?e:void 0})}_show(e,t,n,r){let i=e.map(this._options.keyOf);var o=!0,a=!1,l=void 0;try{for(var s,u=this._panes[Symbol.iterator]();!(o=(s=u.next()).done);o=!0){let e=z(s.value,2),t=e[0],n=e[1];i.includes(t)||(n.scope.dispose(),n.el.remove(),this._panes.delete(t))}}catch(e){a=!0,l=e}finally{try{o||null==u.return||u.return()}finally{if(a)throw l}}if(r.hidden=i.length>0,(null===t||!i.includes(t))&&(this.current.value=null!=(h=i[0])?h:null,i.length>0))return;var d=!0,c=!1,p=void 0;try{for(var h,m,f=this._panes[Symbol.iterator]();!(d=(m=f.next()).done);d=!0){let e=z(m.value,2),n=e[0];e[1].el.hidden=n!==t}}catch(e){c=!0,p=e}finally{try{d||null==f.return||f.return()}finally{if(c)throw p}}null!==t&&i.includes(t)&&!this._panes.has(t)&&n.append(this._pane(e[i.indexOf(t)],t));let g=null===t?void 0:this._rows.get(t);void 0===g?this._list.removeAttribute("aria-activedescendant"):this._list.setAttribute("aria-activedescendant",g.el.id)}_row(e){let t=this._options.keyOf(e),n=this._options.row(e),r=(0,m.Ln)(n.label,"u2-master-detail-label");r.dataset.u2Part="item-label";let i=(0,m.y4)([],"u2-master-detail-row");i.setAttribute("role","option"),i.id=this._idOf(t),r.id=`${i.id}-label`;let o=n.check;if(void 0!==o){let e=document.createElement("input");e.type="checkbox",e.className="u2-input-checkbox u2-master-detail-check",e.tabIndex=-1,e.setAttribute("aria-hidden","true"),(0,m.on)(e,"change",()=>o.value=e.checked),void 0!==n.checkTooltip&&g.m.bind(e,n.checkTooltip),(0,m.QZ)(()=>{e.checked=o.value,i.setAttribute("aria-checked",String(o.value))}),i.append(e)}i.append(r),void 0!==n.hint&&i.append((0,m.Ln)(n.hint,"u2-master-detail-hint")),(0,m.on)(i,"click",()=>this.current.value=t),(0,m.QZ)(()=>{let e=this.current.value===t;i.classList.toggle("u2-master-detail-row-current",e),i.setAttribute("aria-selected",String(e))});let a={el:i,label:r,check:o};return this._rows.set(t,a),N.Q.scopeOf(void 0,"a MasterDetail row").own(()=>{this._rows.get(t)===a&&this._rows.delete(t)}),i}_pane(e,t){let n=this.scope.child("master-detail-pane"),r=n.build(()=>{var r,i,a;let l=this._options.detail(e),s=(0,m.y4)([o.Ec.is(l)?l.root:l],"u2-master-detail-content"),u=(0,m.Ln)("","u2-master-detail-reason");u.dataset.u2Part="reason";let d=(0,m.y4)([u,s],"u2-master-detail-pane");return d.setAttribute("role","region"),d.setAttribute("aria-labelledby",`${this._idOf(t)}-label`),f.B.follow(null!=(r=null==(i=(a=this._options).disabled)?void 0:i.call(a,e))?r:null,e=>{u.textContent=null!=e?e:"",u.hidden=null===e,f.B.region(s,e)},n),d});return this._panes.set(t,{el:r,scope:n}),r}_idOf(e){let t=this._ids.get(e);return void 0===t&&this._ids.set(e,t=`${this.rootId}-item-${this._ids.size}`),t}_onKeyDown(e){var t,n;let r=this._items.peek().map(this._options.keyOf),i=r.indexOf(null!=(t=this.current.peek())?t:""),o="ArrowDown"===e.key?Math.min(i+1,r.length-1):"ArrowUp"===e.key?Math.max(i-1,0):"Home"===e.key?0:"End"===e.key?r.length-1:-1;if(o>=0&&r.length>0){e.preventDefault(),this.current.value=r[o];return}let a=i<0||null==(n=this._rows.get(r[i]))?void 0:n.check;" "===e.key&&void 0!==a&&(e.preventDefault(),a.value=!a.peek())}constructor(e){var t,n,i;super(),this._rows=new Map,this._panes=new Map,this._ids=new Map,this._options=e;const o=e.items;this._items=o instanceof r.HN?o:(0,r.vP)(o),this.current=null!=(t=e.current)?t:(0,r.vP)(null);const a=this.root;a.classList.add("u2-master-detail"),a.dataset.u2="master-detail",void 0!==e.name&&(this.name=e.name);const l=this._list=(0,m.y4)([],"u2-master-detail-list");l.dataset.u2Part="list",l.setAttribute("role","listbox"),void 0!==e.label&&l.setAttribute("aria-label",e.label),l.tabIndex=0;const s=(0,m.Ln)(null!=(n=e.emptyText)?n:"Nothing to show","u2-master-detail-empty"),u=(0,m.y4)([s],"u2-master-detail-detail");u.dataset.u2Part="detail";const c=null!=(i=e.split)?i:.33,p=this.build(()=>((0,d._)(l,this._items,t=>e.keyOf(t),e=>this._row(e)),new y.O([l,u],{direction:"horizontal",sizes:[c,1-c],minSize:120})));a.append(p.root),this.effect(()=>{let e=this._items.value,t=this.current.value;(0,r.O8)(()=>this._show(e,t,u,s))}),this.scope.listen(l,"keydown",e=>this._onKeyDown(e))}}n(5113);var B=n(1600);n(8918),n(2939),n(2271);var M=n(5315);n(8797),n(6163);var R=n(9614),q=n(7373);function H(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}function W(e){return"string"==typeof e?e:e.value}function V(e){return"string"==typeof e?e:e.label}class G extends u.p{setItems(e){this._items.value=e;let t=new Set(this.peek()),n=e.filter(e=>t.has(W(e))).map(W);n.length!==t.size&&(this.value=n)}getState(){var e,t;return e=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},super.getState()),t=t={open:this._open.peek()},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}getItems(e){let t=new Set(this.peek()),n=new Set(this._rows.peek().map(W));return u.p.itemsState(this._items.peek().map((e,r)=>({key:W(e),label:V(e),index:r,selected:t.has(W(e)),rendered:n.has(W(e))})),null==e?void 0:e.all)}revealItem(e){var t,n=this,r=()=>super.revealItem;return(t=function*(){return this._openPopup(),this._filter.value="",r().call(n,e)},function(){var e=this,n=arguments;return new Promise(function(r,i){var o=t.apply(e,n);function a(e){H(o,r,i,a,l,"next",e)}function l(e){H(o,r,i,a,l,"throw",e)}a(void 0)})}).call(this)}displayText(){let e=new Map(this._items.peek().map(e=>[W(e),V(e)]));return this.peek().map(t=>{var n;return null!=(n=e.get(t))?n:t}).join(", ")}createEditor(){var e,t;this._id=`u2-multi-select-${++G._seq}`,this._items=(0,r.vP)(this.options.items),this._filter=(0,r.vP)(""),this._open=(0,r.vP)(!1),this._machine=(0,r.vP)("idle"),this._activeIndex=(0,r.vP)(-1),this._optionSeq=0,this._visible=(0,r.EW)(()=>{let e=this._filter.value.trim().toLowerCase(),t=this._items.value;return e?t.filter(t=>V(t).toLowerCase().includes(e)):t}),this._rows=(0,r.EW)(()=>this._open.value?this._visible.value:[]);let n=document.createElement("div");this._field=n,n.className="u2-multi-select-field",n.tabIndex=0,n.setAttribute("role","combobox"),n.setAttribute("aria-haspopup","listbox"),n.setAttribute("aria-controls",`${this._id}-listbox`),this._tagsBox=G._row("u2-multi-select-tags","");let i=G._row("u2-multi-select-chevron","");return n.append(this._tagsBox,i),this._popup=document.createElement("div"),this._popup.className="u2-multi-select-popup",this._popup.tabIndex=-1,this._focusEl=this._popup,(null!=(e=this.options.filterable)?e:!0===this.options.allowCustom||this.options.items.length>8)&&this._popup.append(this._buildFilter()),(null==(t=this.options.selectAll)||t)&&this._popup.append(this._buildSelectAll()),this._rowsBox=G._row("u2-multi-select-options",""),this._rowsBox.id=`${this._id}-listbox`,this._rowsBox.setAttribute("role","listbox"),this._rowsBox.setAttribute("aria-multiselectable","true"),this._popup.append(this._rowsBox),this.scope.listen(n,"click",e=>this._onFieldClick(e)),this.scope.listen(n,"keydown",e=>this._onFieldKeyDown(e)),this.scope.listen(n,"focus",()=>this._send({type:"focus"})),this.scope.listen(n,"blur",()=>this._send({type:"blur"})),this.scope.listen(this._popup,"keydown",e=>this._onPopupKeyDown(e)),this.scope.listen(this._popup,"pointerdown",e=>this._onPopupPointerDown(e)),this.scope.listen(this._popup,s.B,()=>this._send({type:"dismiss"})),this.effect(()=>{let e=this._open.value;n.setAttribute("aria-expanded",String(e)),n.classList.toggle("u2-multi-select-open",e)}),this.effect(()=>this._renderTags()),(0,d._)(this._rowsBox,this._rows,W,e=>this._option(e),{empty:()=>G._row("u2-multi-select-empty","No matches")}),this.effect(()=>this._applySelection()),this.effect(()=>this._applyActive()),n}_buildFilter(){let e=G._row("u2-multi-select-filter",""),t=document.createElement("input");return this._filterEl=t,this._focusEl=t,t.className="u2-multi-select-filter-input",t.type="text",t.autocomplete="off",t.placeholder=this.options.allowCustom?"Filter or add…":"Filter…",t.setAttribute("aria-label","Filter options"),t.setAttribute("aria-controls",`${this._id}-listbox`),(0,a.n)(t,this._filter,{owner:this.scope}),this.scope.listen(t,"input",()=>this._activeIndex.value=-1),e.append(t),e}_buildSelectAll(){let e=G._row("u2-multi-select-all","");return e.setAttribute("role","button"),this._allRow=e,this._allLabel=G._row("u2-multi-select-text","Select all"),e.append(G._row("u2-multi-select-check",""),this._allLabel),e}_send(e){let t=this._machine.peek();switch(e.type){case"focus":"idle"===t&&(this._machine.value="focused");break;case"blur":"open"!==t&&(this._machine.value="idle");break;case"open":this._openPopup();break;case"toggleOpen":"open"===t?this._dismiss(!0):this._openPopup();break;case"arrowDown":"open"===t?this._move(1):this._openPopup();break;case"arrowUp":"open"===t&&this._move(-1);break;case"space":this._toggleAt(this._activeIndex.peek());break;case"enter":this.options.allowCustom&&this._addCustom()||this._dismiss(!0);break;case"escape":case"tab":this._dismiss(!0);break;case"dismiss":this._dismiss(!1);break;case"toggle":this._toggleAt(e.index);break;case"toggleAll":this._toggleAll()}}_openPopup(){this._open.peek()||(this._filter.value="",this._activeIndex.value=-1,this._machine.value="open",this._open.value=!0,this._closeOverlay=s.h.show(this._field,this._popup,{owner:this.scope}),this._focusEl.focus())}_dismiss(e){if(!this._open.peek())return;this._open.value=!1,this._activeIndex.value=-1,this._machine.value=e?"focused":"idle";let t=this._closeOverlay;this._closeOverlay=void 0,t&&t(),e&&this._field.focus()}_move(e){let t=this._rows.peek().length;0!==t&&(this._activeIndex.value=Math.min(Math.max(this._activeIndex.peek()+e,0),t-1))}_toggleAt(e){let t=this._visible.peek();if(e<0||e>=t.length)return;let n=new Set(this.peek()),r=W(t[e]);n.delete(r)||n.add(r),this._commit(n)}_toggleAll(){let e=this._visible.peek(),t=new Set(this.peek()),n=e.length>0&&e.every(e=>t.has(W(e)));var r=!0,i=!1,o=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done);r=!0){let e=a.value;n?t.delete(W(e)):t.add(W(e))}}catch(e){i=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}this._commit(t)}_addCustom(){let e=this._filter.peek().trim();if(""===e)return!1;let t=this._items.peek(),n=e.toLowerCase(),r=t.find(e=>W(e).toLowerCase()===n||V(e).toLowerCase()===n);r||(this._items.value=[...t,e]);let i=new Set(this.peek());return i.add(r?W(r):e),this._commit(i),this._filter.value="",!0}_commit(e){this.value=this._items.peek().filter(t=>e.has(W(t))).map(W)}_onFieldClick(e){e.target.closest(".u2-tag-remove")||this._send({type:"toggleOpen"})}_remove(e){let t=new Set(this.peek());t.delete(e),this._commit(t)}_onFieldKeyDown(e){switch(e.key){case"ArrowDown":case"Enter":case" ":e.preventDefault(),this._send({type:"open"});break;case"Escape":this._send({type:"escape"})}}_onPopupKeyDown(e){switch(e.key){case"ArrowDown":e.preventDefault(),this._send({type:"arrowDown"});break;case"ArrowUp":e.preventDefault(),this._send({type:"arrowUp"});break;case" ":if(0>this._activeIndex.peek()&&this._filterEl)break;e.preventDefault(),this._send({type:"space"});break;case"Enter":e.preventDefault(),this._send({type:"enter"});break;case"Escape":this._send({type:"escape"});break;case"Tab":this._send({type:"tab"})}}_onPopupPointerDown(e){let t=e.target,n=t.closest(".u2-multi-select-option");if(n){e.preventDefault(),this._send({type:"toggle",index:[...this._rowsBox.children].indexOf(n)});return}t.closest(".u2-multi-select-all")&&(e.preventDefault(),this._send({type:"toggleAll"}))}_renderTags(){let e=this.value,t=new Map(this._items.value.map(e=>[W(e),V(e)])),n=this._tagsBox;if(n.textContent="",0===e.length){let e=this.options.placeholder;e&&n.append(G._row("u2-multi-select-placeholder",e));return}let r=null!=(l=this.options.maxTags)?l:3;var i=!0,o=!1,a=void 0;try{for(var l,s,u,d=e.slice(0,r)[Symbol.iterator]();!(i=(u=d.next()).done);i=!0){let e=u.value;n.append((0,M.Tc)(null!=(s=t.get(e))?s:e,{onRemove:()=>this._remove(e)}))}}catch(e){o=!0,a=e}finally{try{i||null==d.return||d.return()}finally{if(o)throw a}}e.length>r&&n.append(G._row("u2-multi-select-more",`+${e.length-r} more`))}_option(e){let t=G._row("u2-multi-select-option","");t.id=`${this._id}-opt-${++this._optionSeq}`,t.dataset.value=W(e),t.setAttribute("role","option"),t.setAttribute("aria-selected","false");let n=G._row("u2-multi-select-text",V(e));return n.dataset.u2Part="item-label",t.append(G._row("u2-multi-select-check",""),n),t}_applySelection(){let e=new Set(this.value),t=this._rows.value,n=this._rowsBox.children;for(let r=0;r<t.length;r++){let i=e.has(W(t[r]));n[r].setAttribute("aria-selected",String(i)),n[r].classList.toggle("u2-multi-select-selected",i)}if(!this._allRow||!this._allLabel)return;let r=t.length>0&&t.every(t=>e.has(W(t)));this._allRow.classList.toggle("u2-multi-select-selected",r),this._allLabel.textContent=r?"Select none":"Select all"}_applyActive(){let e=this._rows.value.length,t=this._rowsBox.children,n=this._activeIndex.value;for(let r=0;r<e;r++)t[r].classList.toggle("u2-multi-select-option-active",r===n);let r=n>=0&&n<e?t[n]:void 0;r?(this._focusEl.setAttribute("aria-activedescendant",r.id),r.scrollIntoView({block:"nearest"})):this._focusEl.removeAttribute("aria-activedescendant")}static _row(e,t){let n=document.createElement("div");return n.className=e,t&&(n.textContent=t),n}constructor(e){super(e,[]),this.isOpen=this._open,this.machineState=this._machine,this.root.dataset.u2="multi-select"}}G._seq=0,n(6002);var U=n(108);n(2943),n(9050),n(2127),n(5557),n(8321),n(1043),n(2570),n(8752);var K=n(6404),Y=n(8770);n(6205);var Q=n(5812);n(7119),n(1781),n(1283),n(4969);var J=n(5539);function Z(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}n(5143),n(7447),n(8075);class X{static measure(e,t){var n;return(n=function*(){let n=performance.now(),r=t(),i=performance.now()-n,o=0;if(!X._headless){let e=performance.now();document.body.append(r.root),yield new Promise(e=>requestAnimationFrame(()=>requestAnimationFrame(()=>e()))),o=performance.now()-e,r.root.remove()}r.dispose();let a={label:e,construct:i,paint:o,total:i+o};return X._entries.push(a),a},function(){var e=this,t=arguments;return new Promise(function(r,i){var o=n.apply(e,t);function a(e){Z(o,r,i,a,l,"next",e)}function l(e){Z(o,r,i,a,l,"throw",e)}a(void 0)})})()}static report(){return X._entries.slice()}static get _headless(){var e,t;return(null==(t=globalThis.process)||null==(e=t.versions)?void 0:e.node)!==void 0}}X._entries=[],n(9271),n(4535),n(6336),n(2136),n(8109);var ee=n(4894);n(1426),n(8989),n(7262),n(6087),n(1526),n(8651),n(7614),n(4042);var et=n(476);n(9178),n(3855);var en=n(2657),er=n(949);function ei(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}class eo{static run(e){let t=new eo(e);return t._start(),t}next(){this._active.value&&this._show(this._step.value+1)}skip(){this.finish("skipped")}finish(e){var t,n,r,i;this._active.value&&(this._active.value=!1,eo._current===this&&(eo._current=void 0),null==(t=this._stepScope)||t.dispose(),this._stepScope=void 0,this._scope.dispose(),this.overlay.remove(),this.popup.remove(),(null==(n=this._restore)?void 0:n.isConnected)&&this._restore.focus(),null==(r=(i=this._options).onFinish)||r.call(i,void 0===e?"done":e))}_start(){var e,t;null==(t=eo._current)||t.finish("skipped"),eo._current=this,this._restore=null!=(e=document.activeElement)?e:void 0,this.overlay.style.zIndex=String(s.h.nextLayer()),this.popup.style.zIndex=String(s.h.nextLayer()),s.h.host.append(this.overlay,this.popup),this._active.value=!0,this._scope.listen(document,"keydown",e=>this._onKeyDown(e),{capture:!0}),this._scope.own(()=>this._stopAutoUpdate()),this._show(0)}_show(e){var t,n;null==(n=this._stepScope)||n.dispose(),this._stepScope=void 0,this._stopAutoUpdate(),this._stopAutoUpdate=()=>{};let r=e;for(;r<this._steps.length&&!this._enterStep(r);)r++;if(r>=this._steps.length)return void this.finish("done");let o=this._steps[r],a=new i.HG(void 0,{label:"tour-step"});this._stepScope=a,this._step.value=r,this._content.replaceChildren(),"string"==typeof o.content?this._content.textContent=o.content:this._content.append("function"==typeof o.content?a.build(o.content):o.content);let l=this._steps.map((e,t)=>t===r||eo._renderable(this._element(e.target))),s=l.slice(0,r+1).filter(Boolean).length,u=l.filter(Boolean).length;this._counter.textContent=`${s} / ${u}`,this._next.textContent=s===u?this._doneLabel:this._nextLabel;let d=null!=(t=o.position)?t:"bottom";this._place(d),this._stopAutoUpdate=(0,er.ll)(this._target,this.popup,()=>this._place(d),{animationFrame:!0});let c=o.advanceOn;c instanceof Promise?c.then(()=>this._advance(a)):c&&a.effect(()=>{c.value&&this._advance(a)}),this._next.focus()}_advance(e){this._stepScope===e&&this.next()}_enterStep(e){let t=this._steps[e],n=this._element(t.target);if(!eo._renderable(n)){let n="string"==typeof t.target?t.target:`step ${e+1}`;return this._warned.has(n)||(this._warned.add(n),console.warn(`u2: tour target "${n}" not found — step skipped`)),!1}return this._target=n,this._extra=void 0===t.extra?null:this._element(t.extra),!0}_element(e){var t;return"function"==typeof e?e():"string"!=typeof e?e:(null!=(t=this._options.root)?t:document).querySelector(`[data-u2-name="${e}"]`)}_place(e){let t=this._target;t&&t.isConnected?(eo._setHole(this._hole,t),eo._setHole(this._extraHole,this._extra),(0,er.rD)(t,this.popup,{strategy:"fixed",placement:e,middleware:[(0,er.cY)(8),(0,er.UU)({padding:4}),(0,er.BN)({padding:4})]}).then(e=>{let t=e.x,n=e.y;this.popup.style.left=`${t}px`,this.popup.style.top=`${n}px`})):this.next()}_onKeyDown(e){let t=e.target;"Escape"===e.key?(e.preventDefault(),this.skip()):"Enter"!==e.key||eo._isTextEntry(t)?"Tab"===e.key&&t&&this.popup.contains(t)&&this._trapTab(e):(e.preventDefault(),this.next())}_trapTab(e){let t=eo._focusable(this.popup);if(0===t.length)return;let n=document.activeElement;e.shiftKey&&n===t[0]?(e.preventDefault(),t[t.length-1].focus()):e.shiftKey||n!==t[t.length-1]||(e.preventDefault(),t[0].focus())}static _focusable(e){return Array.from(e.querySelectorAll('a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')).filter(e=>null!==e.offsetParent)}static _isTextEntry(e){return!!e&&(/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName)||e.isContentEditable)}static _renderable(e){if(!e||!e.isConnected)return!1;let t=e.getBoundingClientRect();return t.width>0&&t.height>0}static _setHole(e,t){let n=t?t.getBoundingClientRect():new DOMRect,r=4*!!t;e.setAttribute("x",String(n.left-r)),e.setAttribute("y",String(n.top-r)),e.setAttribute("width",String(n.width+2*r)),e.setAttribute("height",String(n.height+2*r))}static _svg(e,t){let n=document.createElementNS("http://www.w3.org/2000/svg",e);for(let e in t)n.setAttribute(e,t[e]);return n}constructor(e){var t,n,o;this._scope=new i.HG,this._step=(0,r.vP)(0),this._active=(0,r.vP)(!1),this._content=(0,m.y4)([],"u2-tour-content"),this._counter=(0,m.Ln)("","u2-tour-counter"),this._warned=new Set,this._target=null,this._extra=null,this._stopAutoUpdate=()=>{},this._options=e,this._steps=e.steps,this.step=this._step,this.active=this._active;const a=`u2-tour-mask-${++eo._seq}`;this._hole=eo._svg("rect",{class:"u2-tour-hole",fill:"black",rx:String(4)}),this._extraHole=eo._svg("rect",{class:"u2-tour-hole",fill:"black",rx:String(4)});const l=eo._svg("mask",{id:a});l.append(eo._svg("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:"white"}),this._hole,this._extraHole);const s=eo._svg("defs",{});s.append(l);const u=eo._svg("rect",{x:"0",y:"0",width:"100%",height:"100%",mask:`url(#${a})`});u.style.fill="var(--dg-tour-dim, rgba(0, 0, 0, 0.6))";const d=eo._svg("svg",{});d.append(s,u),this.overlay=(0,m.y4)([],"u2-tour-overlay"),this.overlay.dataset.u2="tour",this.overlay.append(d);const c=null!=(t=e.buttons)?t:{};this._nextLabel=null!=(n=c.next)?n:"NEXT",this._doneLabel=null!=(o=c.done)?o:"DONE";const p=function(e){return function(e){if(Array.isArray(e))return e}(e)||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var i=[],o=!0,a=!1;try{for(r=r.call(e);!(o=(t=r.next()).done)&&(i.push(t.value),2!==i.length);o=!0);}catch(e){a=!0,n=e}finally{try{o||null==r.return||r.return()}finally{if(a)throw n}}return i}}(e)||function(e){if(e){if("string"==typeof e)return ei(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return ei(e,2)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(this._scope.build(()=>{var e;return[(0,m.x6)(null!=(e=c.skip)?e:"SKIP",()=>this.skip()),(0,m.x6)(this._nextLabel,()=>this.next(),{primary:!0})]})),h=p[0],f=p[1];h.classList.add("u2-tour-skip"),f.classList.add("u2-tour-next"),this._next=f,this.popup=(0,m.y4)([this._content,(0,m.y4)([h,this._counter,f],"u2-tour-footer")],"u2-tour-popup"),this.popup.setAttribute("role","dialog"),this.popup.tabIndex=-1}}eo._seq=0,n(5361),n(9571),n(7371),n(9793),n(2120),n(136);var ea=n(9383);n(1269)},1067(e,t,n){n.d(t,{E:()=>i});var r=n(7115);class i{step(e){return"state"===e?this._stateStep:"error"===e?this._errorStep:null}static props(e){return[{name:"state",type:"string",description:"idle, loading, ready or error"},{name:"error",type:"string",description:e}]}constructor(e,t,n,i){this.state=t?e.state:(0,r.EW)(()=>{let t=e.state.value;if("idle"!==t.kind||"sample"!==n)return t;let r=i();return void 0===r?t:{kind:"ready",value:r}}),this._stateStep=(0,r.EW)(()=>this.state.value.kind),this._errorStep=(0,r.EW)(()=>{let e=this.state.value;return"error"===e.kind?e.message:void 0})}}},6e3(e,t,n){n.d(t,{S:()=>r,i:()=>i});let r={};function i(e,t,n){if(void 0===t)throw e.dispose(),Error(`no platform backend for ${n}`);return t}},1426(e,t,n){n.d(t,{l:()=>r.DF_STEPS,p:()=>r.dfBindings});var r=n(3095)},1526(e,t,n){n.d(t,{H:()=>p});var r=n(7115),i=n(9701),o=n(4894),a=n(6e3),l=n(1067),s=n(9383),u=n(5587);function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function c(e,t,n,r,i,o,a){try{var l=e[o](a),s=l.value}catch(e){n(e);return}l.done?t(s):Promise.resolve(s).then(r,i)}class p extends i.uA{start(){let e=(0,u.K)(this._env,"id");null!==e&&this.effect(()=>this.id.value=(0,s.Qq)(e.value))}bindStep(e){let t=this._status.step(e);if(null!==t)return t;if("entity"===e||""===e)return this._entity;let n=this._leaves.get(e);return void 0===n&&(n=(0,r.EW)(()=>{var t;return null==(t=this._entity.value)?void 0:t[e]}),this._leaves.set(e,n)),n}bindProps(){let e=l.E.props("Why the last lookup failed");e.push({name:"entity",type:"object",description:"The entity itself",default:!0});let t=this._entity.peek();if(null!==t&&"object"==typeof t){var n=!0,r=!1,i=void 0;try{for(var o,a=p._readable(t)[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){let t=o.value;e.push({name:t})}}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}}return e}_find(e){var t;return(t=function*(){let t=this.id.peek();if(""===t)throw Error(`${this.entityType}: no id given`);let n=yield e(this.entityType,t);if(null==n)throw Error(`${this.entityType} "${t}" was not found`);return n},function(){var e=this,n=arguments;return new Promise(function(r,i){var o=t.apply(e,n);function a(e){c(o,r,i,a,l,"next",e)}function l(e){c(o,r,i,a,l,"throw",e)}a(void 0)})}).call(this)}static _readable(e){let t=new Set(Object.keys(e));for(let s=Object.getPrototypeOf(e);null!==s&&s!==Object.prototype;s=Object.getPrototypeOf(s)){var n=!0,r=!1,i=void 0;try{for(var o,a,l=Object.entries(Object.getOwnPropertyDescriptors(s))[Symbol.iterator]();!(n=(a=l.next()).done);n=!0){let e=(o=a.value,function(e){if(Array.isArray(e))return e}(o)||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var i=[],o=!0,a=!1;try{for(r=r.call(e);!(o=(t=r.next()).done)&&(i.push(t.value),2!==i.length);o=!0);}catch(e){a=!0,n=e}finally{try{o||null==r.return||r.return()}finally{if(a)throw n}}return i}}(o)||function(e){if(e){if("string"==typeof e)return d(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return d(e,2)}}(o)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),n=e[0],r=e[1];void 0!==r.get&&t.add(n)}}catch(e){r=!0,i=e}finally{try{n||null==l.return||l.return()}finally{if(r)throw i}}}return[...t].filter(e=>"dart"!==e&&!e.startsWith("_"))}constructor(e,t){var n,i,s;super(),this._leaves=new Map,this._env=t,this.entityType=null!=(n=e.entityType)?n:"users",this.id=(0,r.vP)(null!=(i=e.id)?i:""),this.designData=null!=(s=e.designData)?s:"live",this.sample=e.sample;const u=(0,a.i)(this,a.S.dapiFind,"server entities"),d=!t.designTime||"live"===this.designData;this._async=new o.C(()=>this._find(u),{auto:d,deps:()=>{this.id.value}}),this.own(()=>this._async.dispose()),this._status=new l.E(this._async,d,this.designData,()=>{var e,t,n;return null!=(e=null!=(t=this.sample)?t:null==(n=this.componentMeta)?void 0:n.designPreview)?e:void 0}),this._entity=(0,r.EW)(()=>{let e=this._status.state.value;return"ready"===e.kind?e.value:void 0}),this.registerFunction({name:"refresh",description:"Look the entity up again",inputs:[],apply:()=>this._async.refresh()})}}},7262(e,t,n){n.d(t,{N:()=>u});var r=n(7115),i=n(9701),o=n(348),a=n(6e3),l=n(9383),s=n(5587);class u extends i.uA{start(){let e=(0,s.K)(this._env,"filter");null!==e&&this.effect(()=>this.filter.value=(0,o.Pj)((0,l.Qq)(e.value))),this.effect(()=>{this.filter.value,this._pager.reset()})}bindStep(e){var t;return null!=(t=this._steps[""===e?"items":e])?t:null}bindProps(){return[{name:"items",type:"object",description:"The entities loaded so far",default:!0},{name:"names",type:"string_list",description:"Their names, for a choice input"},{name:"state",type:"string",description:"idle, loading, done or error"},{name:"total",type:"int"}]}static _label(e){var t,n;return null!=(t=null!=(n=null==e?void 0:e.friendlyName)?n:null==e?void 0:e.name)?t:String(e)}constructor(e,t){var n,i,l;super(),this._env=t,this.entity=null!=(n=e.entity)?n:"users",this.order=e.order,this.pageSize=null!=(i=e.pageSize)?i:20,this.filter=(0,r.vP)(null!=(l=e.filter)?l:"");const s=(0,a.i)(this,a.S.dapi,"server collections");this._pager=(0,o.Az)(()=>{let e=s(this.entity);if(null===e)throw Error(`unknown collection "${this.entity}"`);return e},{pageSize:this.pageSize,order:this.order,filter:()=>""===this.filter.peek()?void 0:this.filter.peek()}),this.own(()=>this._pager.dispose());const d=this._pager.items;this._steps={items:d,names:(0,r.EW)(()=>this._pager.items.value.map(u._label)),state:this._pager.state,total:this._pager.total},this.registerFunction({name:"refresh",description:"Load the collection again",inputs:[],apply:()=>this._pager.reset()}),this.registerFunction({name:"loadMore",description:"Append the next page",inputs:[],apply:()=>this._pager.loadMore()})}}},8989(e,t,n){n.d(t,{E:()=>h});var r=n(7115),i=n(9701),o=n(4894),a=n(6e3),l=n(1426),s=n(1067);function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,i=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var o=[],a=!0,l=!1;try{for(i=i.call(e);!(a=(n=i.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==i.return||i.return()}finally{if(l)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return u(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}let p="params.";class h extends i.uA{start(){let e=new Map;var t=!0,n=!1,r=void 0;try{for(var i,o=Object.entries(this._env.subBinds)[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){let t=c(i.value,2),n=t[0],r=t[1];if(!n.startsWith(p))continue;let o=this._env.resolve(r);null!==o&&e.set(n.slice(p.length),o)}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}e.size>0&&(this._bound.value=e)}bindStep(e){let t=this._status.step(e);if(null!==t)return t;let n=""===e?this._defaultOutput():e;if(null!==n&&this._declares(n))return this._isFrame(n)?this._frame(n):this._output(n);let r=this._defaultOutput();return""!==e&&null!==r&&this._isFrame(r)?this._frame(r).bindStep(e):null}bindProps(){let e=s.E.props("Why the last run failed"),t=null!=(o=null==(a=this._descriptor)?void 0:a.outputs)?o:[];if(1===t.length&&h._isFrameProp(t[0]))return e.concat(l.l);var n=!0,r=!1,i=void 0;try{for(var o,a,u,d,c=t[Symbol.iterator]();!(n=(d=c.next()).done);n=!0){let n=d.value;e.push({name:n.name,type:null!=(u=n.propertyType)?u:n.type,semType:n.semType,description:n.description,walkable:h._isFrameProp(n),default:1===t.length})}}catch(e){r=!0,i=e}finally{try{n||null==c.return||c.return()}finally{if(r)throw i}}return e}_run(e,t){if(null===this._descriptor)return Promise.reject(Error(`"${this.func}" is not a known function`));let n=d({},this.params);var r=!0,i=!1,o=void 0;try{for(var a,l=this._bound.peek()[Symbol.iterator]();!(r=(a=l.next()).done);r=!0){let e=c(a.value,2),t=e[0],r=e[1];n[t]=r.peek()}}catch(e){i=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return e.run(this.func,n,t,this._env.designTime?{maxRows:100}:void 0)}_deps(){var e=!0,t=!1,n=void 0;try{for(var r,i=this._bound.value.values()[Symbol.iterator]();!(e=(r=i.next()).done);e=!0)r.value.value}catch(e){t=!0,n=e}finally{try{e||null==i.return||i.return()}finally{if(t)throw n}}}_defaultOutput(){var e,t,n;let r=null!=(e=null==(n=this._descriptor)?void 0:n.outputs)?e:[];return 1===r.length&&null!=(t=r[0].name)?t:null}_declares(e){return null===this._descriptor||this._descriptor.outputs.some(t=>t.name===e)}_isFrame(e){var t;let n=null==(t=this._descriptor)?void 0:t.outputs.find(t=>t.name===e);return void 0!==n&&h._isFrameProp(n)}_output(e){let t=this._outputs.get(e);if(void 0===t){let n=this._status.state;t=(0,r.EW)(()=>{let t=n.value;return"ready"===t.kind?t.value[e]:void 0}),this._outputs.set(e,t)}return t}_frame(e){let t=this._frames.get(e);if(void 0===t){let n=this._output(e);t=(0,l.p)(n,this.scope),this._frames.set(e,t)}return t}_sample(){return void 0===this._sampleValue&&(this._sampleValue=this._sampleOutputs()),this._sampleValue}_sampleOutputs(){let e=null!=(l=this.sample)?l:null==(u=this.componentMeta)?void 0:u.designPreview;if(null==e)return{};let t=this._defaultOutput(),n=Array.isArray(e)?null===t?{}:{[t]:e}:e,r={};var i=!0,o=!1,a=void 0;try{for(var l,s,u,d,p=Object.entries(n)[Symbol.iterator]();!(i=(d=p.next()).done);i=!0){let e=c(d.value,2),t=e[0],n=e[1];r[t]=null!=(s=h._rows(n))?s:n}}catch(e){o=!0,a=e}finally{try{i||null==p.return||p.return()}finally{if(o)throw a}}return r}static _rows(e){let t=a.S.tableFromRows;return void 0!==t&&Array.isArray(e)&&e.length>0&&e.every(e=>"object"==typeof e&&null!==e)?t(e):void 0}static _isFrameProp(e){var t;return(null!=(t=e.propertyType)?t:e.type)==="dataframe"}constructor(e,t){var n,i,l,u,c;super(),this._bound=(0,r.vP)(new Map),this._outputs=new Map,this._frames=new Map,this._env=t,this.func=null!=(n=e.func)?n:"",this.params=d({},e.params),this.auto=null==(i=e.auto)||i,this.debounce=null!=(l=e.debounce)?l:300,this.sample=e.sample;const p=(0,a.i)(this,a.S.funcRunner,"functions");this._descriptor=""===this.func?null:p.find(this.func);const h=null==(c=this._descriptor)?void 0:c.kind;this.designData=null!=(u=e.designData)?u:"table-query"===h||"query"===h?"live":"schema";const m=!t.designTime||"live"===this.designData,f=this.auto&&m&&(!t.designTime||"table-query"===h);this._async=new o.C(e=>this._run(p,e),{auto:f,debounceMs:this.debounce,deps:()=>this._deps()}),this.own(()=>this._async.dispose()),this._status=new s.E(this._async,m,this.designData,()=>this._sample()),this.registerFunction({name:"refresh",description:"Run the function again",inputs:[],apply:()=>this._async.refresh()})}}},8651(e,t,n){n.d(t,{I:()=>r}),n(8989),n(7262),n(6087),n(1526),n(9271);let r=["users","groups","projects","queries","connections","scripts","spaces"]},4042(e,t,n){n.d(t,{S:()=>i}),n(7115);var r=n(3095);class i{static caption(e){return`${i.CAPTION_PREFIX}${e}`}static isService(e){return e.startsWith("~")}static isDraft(e){return("string"==typeof e?e:e.id).startsWith(i.DRAFT_PREFIX)}static isDeleted(e){return!0===e[i.DELETED]}static draftId(){return`${i.DRAFT_PREFIX}${(0,r.uuid4)()}`}static real(e,t){return"string"==typeof t&&Object.hasOwn(e,t)?e[t]:void 0}static unkeyed(e){return`~row:${e}`}}i.STATE="~state",i.DRAFT_PREFIX="~new:",i.DELETED="~is_deleted",i.CAPTION_PREFIX="~caption_"},2136(e,t,n){n.d(t,{h:()=>a});var r=n(7115),i=n(9701),o=n(4535);class a extends i.uA{get value(){return this.signal.value}set value(e){this.signal.value=e}peek(){return this.signal.peek()}bindStep(e){return"value"===e||""===e?this.signal:null}bindProps(){return[{name:"value",type:this.type,writable:!0,default:!0}]}static _empty(e){switch(e){case"int":case"double":return 0;case"bool":return!1;case"string_list":return[];case"object":return null;default:return""}}constructor(e){var t;let n=void 0===e?{}:e;super(),this.type=null!=(t=n.type)?t:"string";const i=void 0===n.initial?null:(0,o.ij)({name:"initial",type:this.type},n.initial);null!==i&&(0,o.eP)(`u2-state: ${i} — starting empty`),this.initial=null===i&&void 0!==n.initial?n.initial:a._empty(this.type),this.signal=(0,r.vP)(this.initial),this.registerFunction({name:"clear",description:"Back to the initial value",inputs:[],apply:()=>this.value=this.initial})}}},5587(e,t,n){n.d(t,{K:()=>r});function r(e,t){let n=e.subBinds[t];return void 0===n?null:e.resolve(n)}},6087(e,t,n){n.d(t,{q:()=>s});var r=n(7115),i=n(9701),o=n(4535),a=n(6e3),l=n(1426);class s extends i.uA{bindStep(e){return this._bindings.bindStep(e)}bindProps(){return this._bindings.bindProps()}constructor(e){var t;super(),this.table=null!=(t=(void 0===e?{}:e).table)?t:"";const n=(0,a.i)(this,a.S.workspace,"the workspace"),i=()=>{var e;return null!=(e=n.table(this.table))?e:void 0};this._df=(0,r.vP)(i());const s=n.onTablesChanged.subscribe(()=>this._df.value=i());this.own(()=>s.unsubscribe()),void 0===this._df.peek()&&(0,o.eP)(`u2-table-source: no open table named "${this.table}"`),this._bindings=(0,l.p)(this._df,this.scope)}}},326(e,t,n){n.d(t,{Fc:()=>s,_w:()=>o,o:()=>l,s:()=>a});var r=n(7115),i=n(9701);let o="Appearance",a=[{name:"color",type:"string",inputType:"Color",description:"Text color; inherits down the subtree."},{name:"backgroundColor",type:"string",inputType:"Color",description:"Background color."},{name:"font",type:"string",inputType:"Font",description:'CSS font shorthand ("bold 14px Roboto").'},{name:"opacity",type:"double",min:0,max:1,step:.05,description:"0 transparent to 1 opaque."},{name:"cursor",type:"string",nullable:!0,choices:["default","pointer","not-allowed","wait","help","text","move","grab"],description:"Mouse cursor over the node."},{name:"textAlign",type:"string",nullable:!0,choices:["left","center","right"],description:"Horizontal text alignment."},{name:"padding",type:"string",description:'CSS padding ("8px 12px").'},{name:"margin",type:"string",description:"CSS margin."},{name:"border",type:"string",description:'CSS border ("1px solid var(--dg-border)").'},{name:"borderRadius",type:"string",description:'Corner radius ("4px").'},{name:"width",type:"string",description:'CSS width ("200px", "50%").'},{name:"height",type:"string",description:"CSS height."},{name:"pointerEvents",type:"string",nullable:!0,choices:["auto","none"],description:'"none" makes the node click-through.'}].map(e=>{var t,n;return t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},e),n=n={category:o,bindable:!0},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t});function l(e){return a.filter(t=>!e.some(e=>e.name===t.name))}function s(e,t,n,o){let a=i.Ec.is(e)?e:void 0,l=(null!=(p=null==a?void 0:a.root)?p:e).style;var s=!0,d=!1,c=void 0;try{for(var p,h,m=n[Symbol.iterator]();!(s=(h=m.next()).done);s=!0){let n=h.value.name,i=t[n];if(void 0!==i)if(i instanceof r.HN){if(void 0===a){void 0!==o&&o.effect(()=>u(e.style,n,i.value));continue}n in a||(a[n]=i),a.effect(()=>u(a.root.style,n,i.value))}else u(l,n,i)}}catch(e){d=!0,c=e}finally{try{s||null==m.return||m.return()}finally{if(d)throw c}}}function u(e,t,n){e[t]=null==n||""===n?"":String(n)}},1965(e,t,n){n.d(t,{P:()=>r});function r(e){return"function"==typeof(null==e?void 0:e.bindStep)&&"function"==typeof(null==e?void 0:e.bindProps)}},8109(e,t,n){n.d(t,{I5:()=>c,VJ:()=>d,lB:()=>u});var r=n(7115),i=n(4535),o=n(199);function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,i=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var o=[],a=!0,l=!1;try{for(i=i.call(e);!(a=(n=i.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==i.return||i.return()}finally{if(l)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}let s=/^[A-Za-z_$][A-Za-z0-9_$]*$/;class u{markClean(){this._mark=this._topSerial(),this._version.value++}_topSerial(){return this._undo.length>0?this._undo[this._undo.length-1].serial:0}canApply(e){var t,n,r;switch(e.op){case"add":{let n=this.instance.registry.get(e.node.tag);if((null==n?void 0:n.visual)===!1)return`${e.node.tag} is a data source — it belongs on the components tray`;return null!=(t=this._checkParent(e.parent))?t:this._checkIndex(e.parent,e.index,!1)}case"add-component":{let t=this._components();if(t.includes(e.node))return`"${m(e.node)}" is already on the tray`;let n=this.instance.registry.get(e.node.tag);if(n&&!1!==n.visual)return`${e.node.tag} is a visual component — it belongs in the form`;return Number.isInteger(e.index)&&e.index>=0&&e.index<=t.length?null:`index ${e.index} is out of range for the tray (0..${t.length})`}case"remove-component":return this._components().includes(e.node)?null:`"${m(e.node)}" is not on the tray`;case"remove":return this._checkStructural(e.node);case"move":{let t=null!=(n=null!=(r=this._checkStructural(e.node))?r:this._checkParent(e.parent))?n:this._checkIndex(e.parent,e.index,this.instance.parentOf(e.node)===e.parent);if(t)return t;return e.node===e.parent||i.R4.contains(e.node,e.parent)?`"${m(e.node)}" cannot move into itself`:null}case"set-prop":{let t=this._prop(e.node,e.name);if(!t)return`${e.node.tag} has no prop "${e.name}"`;if(!this._rendered(t.own?e.node:this.instance.parentOf(e.node)))return`"${m(e.node)}" is not rendered`;return void 0===e.value?null:(0,i.ij)(t.prop,e.value)}case"set-bind":{if(!this._rendered(e.node))return`"${m(e.node)}" is not rendered`;if(void 0===e.path)return null;let t=e.name.indexOf(".");if(t>=0){let n=e.name.slice(0,t),r=this._prop(e.node,n);if(!r)return`${e.node.tag} has no prop "${n}"`;if(!r.prop.subBindable)return`prop "${n}" does not take sub-binds`}else{let t=this._prop(e.node,e.name);if(!t)return`${e.node.tag} has no prop "${e.name}"`;if(t.prop.subBindable&&!t.prop.bindable)return`prop "${e.name}" takes sub-binds only`}if(!e.path.startsWith("$."))return`a bind path must start with "$." — got "${e.path}"`;if(null===(0,o.Rr)(e.path))return`"${e.path}" is not a valid bind path`;return this._checkCycle(e.node,e.name,e.path)}case"set-event":if(!this._rendered(e.node))return`"${m(e.node)}" is not rendered`;return void 0===e.command?null:u._checkEvent(e.command);case"rename":{if(!this._rendered(e.node))return`"${m(e.node)}" is not rendered`;if(void 0===e.name)return null;if(!s.test(e.name))return`"${e.name}" is not a valid name: letters, digits, _ and $, not starting with a digit`;let t=this._named().get(e.name);if(void 0!==t&&t!==e.node)return`"${e.name}" is already taken`;return u._inContext(this.instance,e.name)?`"${e.name}" is already a context data key or command`:null}}}apply(e){let t=this.canApply(e);if(t)throw Error(`u2 editor: ${t}`);let n=this._inverse(e),r=this._undo[this._undo.length-1];r&&"apply"===r.origin&&1===r.patches.length&&u._mergeable(r.patches[0],e)?(r.patches=[e],r.serial=++this._serial):(this._undo.push({patches:[e],inverses:[n],origin:"apply",serial:++this._serial}),this._undo.length>200&&this._undo.shift()),this._redo.length=0,this._execute(e),this._publish([e],"apply")}applyAll(e){if(0===e.length)return;let t=[],n=[];var r=!0,i=!1,o=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done);r=!0){let e=a.value,r=this.canApply(e);if(r)throw this._unwind(n),Error(`u2 editor: ${r}`);n.push(this._inverse(e));try{this._execute(e)}catch(e){throw this._unwind(n),e}t.push(e)}}catch(e){i=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}this._undo.push({patches:t,inverses:n,origin:"apply",serial:++this._serial}),this._undo.length>200&&this._undo.shift(),this._redo.length=0,this._publish(t,"apply")}_unwind(e){for(let t=e.length-1;t>=0;t--)this._execute(e[t])}undo(){let e=this._undo.pop();if(void 0===e)return!1;let t=[];for(let n=e.inverses.length-1;n>=0;n--)this._execute(e.inverses[n]),t.push(e.inverses[n]);return this._redo.push(e),this._publish(t,"undo"),!0}redo(){let e=this._redo.pop();if(void 0===e)return!1;var t,n,r=!0,i=!1,o=void 0;try{for(var a,l=e.patches[Symbol.iterator]();!(r=(a=l.next()).done);r=!0){let e=a.value;this._execute(e)}}catch(e){i=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}return this._undo.push((t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},e),n=n={origin:"redo"},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t)),this._publish(e.patches,"redo"),!0}nodePath(e){let t=[],n=r=>{var i;if(r===e)return!0;let o=null!=(i=r.children)?i:[];for(let e=0;e<o.length;e++){if(t.push(e),n(o[e]))return!0;t.pop()}return!1};return n(this.instance.spec.root)?t:null}nodeAt(e){let t=this.instance.spec.root;var n=!0,r=!1,i=void 0;try{for(var o,a,l=e[Symbol.iterator]();!(n=(a=l.next()).done);n=!0){let e=a.value,n=null==(o=t.children)?void 0:o[e];if(void 0===n)return null;t=n}}catch(e){r=!0,i=e}finally{try{n||null==l.return||l.return()}finally{if(r)throw i}}return t}uniqueName(e){return this.uniqueNames()(e)}uniqueNames(){let e=new Set(this._named().keys());return t=>{let n=u._free(t,e);return e.add(n),n}}duplicate(e){let t=JSON.parse(JSON.stringify(e)),n=this._named(),r=e=>{void 0!==e.name&&(e.name=u._free(e.name.replace(/\d+$/,""),n),n.set(e.name,e));var t=!0,i=!1,o=void 0;try{for(var a,l,s=(null!=(a=e.children)?a:[])[Symbol.iterator]();!(t=(l=s.next()).done);t=!0){let e=l.value;r(e)}}catch(e){i=!0,o=e}finally{try{t||null==s.return||s.return()}finally{if(i)throw o}}};return r(t),t}_execute(e){let t=this._targets(e);t.push(...this._mutate(e)),void 0!==e.node.name&&t.push(...(0,o.CL)(this.instance.spec,e.node.name)),this.instance.rerenderAll(t)}_components(){var e;return null!=(e=this.instance.spec.components)?e:[]}_targets(e){switch(e.op){case"add":return[e.parent];case"add-component":case"remove-component":return[];case"remove":return[this.instance.parentOf(e.node)];case"move":return[this.instance.parentOf(e.node),e.parent];case"set-prop":return[this._prop(e.node,e.name).own?e.node:this.instance.parentOf(e.node)];default:return[e.node]}}_publish(e,t){this._version.value++,this._lastApplied.value={patches:e,origin:t,structural:e.some(e=>"set-prop"!==e.op&&"set-bind"!==e.op&&"set-event"!==e.op)}}_inverse(e){var t,n,r,i;switch(e.op){case"add":return{op:"remove",node:e.node};case"add-component":return{op:"remove-component",node:e.node};case"remove-component":return{op:"add-component",index:this._components().indexOf(e.node),node:e.node};case"remove":case"move":{let n=this.instance.parentOf(e.node),r=(null!=(t=n.children)?t:[]).indexOf(e.node);return"remove"===e.op?{op:"add",parent:n,index:r,node:e.node}:{op:"move",node:e.node,parent:n,index:r}}case"set-prop":return{op:"set-prop",node:e.node,name:e.name,value:null==(n=e.node.props)?void 0:n[e.name]};case"set-bind":return{op:"set-bind",node:e.node,name:e.name,path:null==(r=e.node.bind)?void 0:r[e.name]};case"set-event":return{op:"set-event",node:e.node,event:e.event,command:null==(i=e.node.on)?void 0:i[e.event]};case"rename":return{op:"rename",node:e.node,name:e.node.name}}}_checkCycle(e,t,n){var r,i;if(void 0===e.name)return null;let a=Object.prototype.hasOwnProperty.call(null!=(r=e.bind)?r:{},t),l=null==(i=e.bind)?void 0:i[t];u._entry(e,"bind",t,n);let s=(0,o.$G)(this.instance.spec);return u._entry(e,"bind",t,a?l:void 0),null!==s&&s.includes(e.name)?`binding "${n}" would create a cycle: ${s.join(" → ")}`:null}static _checkEvent(e){let t="string"==typeof e?e:null==e?void 0:e.cmd;return"string"==typeof t&&t.startsWith("cmd:")?"string"!=typeof e&&void 0!==e.args&&("object"!=typeof e.args||null===e.args||Array.isArray(e.args))?"event args must be a plain object of argument values":null:`an event must name a command as 'cmd:' followed by the command name — got '${"string"==typeof t?t:JSON.stringify(e)}'`}_checkStructural(e){if(e===this.instance.spec.root)return"the root node cannot be removed or moved";if(this._components().includes(e))return`"${m(e)}" is a component — the tray has its own add and remove`;let t=this.instance.parentOf(e);return null===t?`"${m(e)}" is not in the spec`:this._rendered(t)?null:`"${m(t)}" is not rendered`}_checkParent(e){let t=this.instance.registry.get(e.tag);return(t?!0===t.acceptsChildren||void 0!==t.adopt||void 0!==t.createWithChildren:(0,i.W)(e.tag))?this._rendered(e)?null:`"${m(e)}" is not rendered`:`${e.tag} takes no children`}_checkIndex(e,t,n){var r;let i=(null!=(r=e.children)?r:[]).length-!!n;return Number.isInteger(t)&&t>=0&&t<=i?null:`index ${t} is out of range for ${e.tag} (0..${i})`}_prop(e,t){var n,r;let o=this.instance.registry.get(e.tag),a=o?o.props.find(e=>e.name===t):(0,i.W)(e.tag)?(0,i.ix)(e.tag).find(e=>e.name===t):void 0;if(a)return{prop:a,own:!0};let l=this.instance.parentOf(e),s=l?null==(r=this.instance.registry.get(l.tag))||null==(n=r.childProps)?void 0:n.find(e=>e.name===t):void 0;return s?{prop:s,own:!1}:null}_rendered(e){return this.instance.nodes().has(e)}static _inContext(e,t){let n=Object.prototype.hasOwnProperty;return n.call(e.ctx.data,t)||n.call(e.ctx.commands,t)}_named(){let e=new Map,t=n=>{void 0===n.name||e.has(n.name)||e.set(n.name,n);var r=!0,i=!1,o=void 0;try{for(var a,l,s=(null!=(a=n.children)?a:[])[Symbol.iterator]();!(r=(l=s.next()).done);r=!0){let e=l.value;t(e)}}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}};t(this.instance.spec.root);var n=!0,r=!1,i=void 0;try{for(var o,a=this._components()[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){let e=o.value;t(e)}}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}return e}static _free(e,t){for(let n=1;;n++){let r=`${e}${n}`;if(!t.has(r))return r}}_mutate(e){switch(e.op){case"add":return u._insert(e.parent,e.index,e.node),[];case"add-component":{let t=this.instance.spec;return t.components?t.components.splice(e.index,0,e.node):t.components=[e.node],this.instance.mountComponent(e.node),[]}case"remove-component":{let t=this.instance.spec.components;return this.instance.unmountComponent(e.node),t.splice(t.indexOf(e.node),1),0===t.length&&delete this.instance.spec.components,[]}case"remove":return u._detach(this.instance.parentOf(e.node),e.node),[];case"move":return u._detach(this.instance.parentOf(e.node),e.node),u._insert(e.parent,e.index,e.node),[];case"set-prop":return u._entry(e.node,"props",e.name,e.value),[];case"set-bind":return u._entry(e.node,"bind",e.name,e.path),[];case"set-event":return u._entry(e.node,"on",e.event,e.command),[];case"rename":{let l=e.node.name,s=[];if(void 0!==l&&void 0!==e.name){s.push(...p(this.instance.spec.root,l,e.name));var t=!0,n=!1,r=void 0;try{for(var i,o,a=(null!=(i=this.instance.spec.components)?i:[])[Symbol.iterator]();!(t=(o=a.next()).done);t=!0){let t=o.value;s.push(...p(t,l,e.name))}}catch(e){n=!0,r=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw r}}}return void 0===e.name?delete e.node.name:e.node.name=e.name,s.filter(e=>this._rendered(e))}}}static _insert(e,t,n){e.children?e.children.splice(t,0,n):e.children=[n]}static _detach(e,t){let n=e.children;n.splice(n.indexOf(t),1),0===n.length&&delete e.children}static _entry(e,t,n,r){let i=e[t];void 0!==r?i?i[n]=r:e[t]={[n]:r}:i&&(delete i[n],0===Object.keys(i).length&&delete e[t])}static _mergeable(e,t){return e.op===t.op&&e.node===t.node&&("set-prop"===e.op&&"set-prop"===t.op||"set-bind"===e.op&&"set-bind"===t.op?e.name===t.name:"set-event"===e.op&&"set-event"===t.op&&e.event===t.event)}constructor(e){this.instance=e,this._undo=[],this._redo=[],this._version=(0,r.vP)(0),this._lastApplied=(0,r.vP)(null),this._serial=0,this._mark=0,this.canUndo=(0,r.EW)(()=>this._version.value>=0&&this._undo.length>0),this.canRedo=(0,r.EW)(()=>this._version.value>=0&&this._redo.length>0),this.dirty=(0,r.EW)(()=>this._version.value>=0&&this._topSerial()!==this._mark),this.onDidApply=this._lastApplied}}function d(e){let t=e.startsWith("u2-")?e.slice(3).split("-"):[e];return t[0]+t.slice(1).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join("")}function c(e,t,n,r){let i,o={tag:t,name:n},a=(null==e?void 0:e.defaults)?JSON.parse(JSON.stringify(e.defaults)):{};return(null==e?void 0:e.props.some(e=>"label"===e.name))&&void 0===a.label&&(a.label=(i=n.replace(/([A-Z])/g," $1").replace(/(\d+)$/," $1").toLowerCase()).charAt(0).toUpperCase()+i.slice(1)),Object.keys(a).length>0&&(o.props=a),(null==e?void 0:e.defaultChildren)&&r&&(o.children=e.defaultChildren.map(e=>(function e(t,n){t.name=n(d(t.tag));var r=!0,i=!1,o=void 0;try{for(var a,l,s=(null!=(a=t.children)?a:[])[Symbol.iterator]();!(r=(l=s.next()).done);r=!0){let t=l.value;e(t,n)}}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return t})(JSON.parse(JSON.stringify(e)),r))),o}function p(e,t,n){let r=[],i=e=>e.startsWith(`cmd:${t}.`)?`cmd:${n}.${e.slice(t.length+5)}`:null,o=e=>{let a=!1;var s=!0,u=!1,d=void 0;try{for(var c,p,m,f,g=Object.entries(null!=(c=e.bind)?c:{})[Symbol.iterator]();!(s=(f=g.next()).done);s=!0){let r=l(f.value,2),i=r[0],o=r[1],s=h(o,t,n);null!==s&&(e.bind[i]=s,a=!0)}}catch(e){u=!0,d=e}finally{try{s||null==g.return||g.return()}finally{if(u)throw d}}var v=!0,b=!1,y=void 0;try{for(var _,w=Object.entries(null!=(p=e.on)?p:{})[Symbol.iterator]();!(v=(_=w.next()).done);v=!0){let r=l(_.value,2),o=r[0],s=r[1];if("string"==typeof s){let t=i(s);null!==t&&(e.on[o]=t,a=!0);continue}let u=i(s.cmd);null!==u&&(s.cmd=u,a=!0);var x=!0,k=!1,O=void 0;try{for(var A,S,P=Object.entries(null!=(A=s.args)?A:{})[Symbol.iterator]();!(x=(S=P.next()).done);x=!0){let e=l(S.value,2),r=e[0],i=e[1],o="string"==typeof i?h(i,t,n):null;null!==o&&(s.args[r]=o,a=!0)}}catch(e){k=!0,O=e}finally{try{x||null==P.return||P.return()}finally{if(k)throw O}}}}catch(e){b=!0,y=e}finally{try{v||null==w.return||w.return()}finally{if(b)throw y}}a&&r.push(e);var E=!0,C=!1,j=void 0;try{for(var T,N=(null!=(m=e.children)?m:[])[Symbol.iterator]();!(E=(T=N.next()).done);E=!0){let e=T.value;o(e)}}catch(e){C=!0,j=e}finally{try{E||null==N.return||N.return()}finally{if(C)throw j}}};return o(e),r}function h(e,t,n){return(0,o._I)(e,t)?`$.${n}${e.slice(t.length+2)}`:null}function m(e){var t;return null!=(t=e.name)?t:e.tag}},199(e,t,n){function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}n.d(t,{$G:()=>c,CL:()=>d,EK:()=>u,Rr:()=>a,_I:()=>s,pQ:()=>l});let i=/^[A-Za-z_$][A-Za-z0-9_$]*$/,o=/[A-Za-z0-9_$]/;function a(e){if(!e.startsWith("$."))return null;let t=[],n=2,r=()=>{let r=n;for(;r<e.length&&o.test(e[r]);)r++;return r!==n&&!!i.test(e.slice(n,r))&&(t.push(e.slice(n,r)),n=r,!0)};if(!r())return null;for(;n<e.length;)if("."===e[n]){if(n++,!r())return null}else{if("["!==e[n]||"'"!==e[n+1])return null;n+=2;let r="";for(;;){if(n>=e.length)return null;let t=e[n];if("\\"===t){let t=e[n+1];if("'"!==t&&"\\"!==t)return null;r+=t,n+=2}else if("'"===t){n++;break}else r+=t,n++}if("]"!==e[n])return null;n++,t.push(r)}return t}function l(e){let t=`$.${e[0]}`;var n=!0,r=!1,o=void 0;try{for(var a,l=e.slice(1)[Symbol.iterator]();!(n=(a=l.next()).done);n=!0){let e=a.value;t+=i.test(e)?`.${e}`:`['${e.replace(/\\/g,"\\\\").replace(/'/g,"\\'")}']`}}catch(e){r=!0,o=e}finally{try{n||null==l.return||l.return()}finally{if(r)throw o}}return t}function s(e,t){let n=`$.${t}`;if(!e.startsWith(n))return!1;let r=e.slice(n.length);return""===r||"."===r[0]||"["===r[0]}function u(e){return Array.isArray(e.children)?e.children.filter(e=>null!==e&&"object"==typeof e):[]}function d(e,t){let n=[],r=e=>{(function(e,t){var n=!0,r=!1,i=void 0;try{for(var o,a,l,u=Object.values(null!=(o=e.bind)?o:{})[Symbol.iterator]();!(n=(l=u.next()).done);n=!0){let e=l.value;if("string"==typeof e&&s(e,t))return!0}}catch(e){r=!0,i=e}finally{try{n||null==u.return||u.return()}finally{if(r)throw i}}var d=!0,c=!1,p=void 0;try{for(var h,m=Object.values(null!=(a=e.on)?a:{})[Symbol.iterator]();!(d=(h=m.next()).done);d=!0){let e=h.value,n="string"==typeof e?e:null==e?void 0:e.cmd;if("string"==typeof n&&n.startsWith(`cmd:${t}.`))return!0;if("string"!=typeof e){var f=!0,g=!1,v=void 0;try{for(var b,y,_=Object.values(null!=(b=null==e?void 0:e.args)?b:{})[Symbol.iterator]();!(f=(y=_.next()).done);f=!0){let e=y.value;if("string"==typeof e&&s(e,t))return!0}}catch(e){g=!0,v=e}finally{try{f||null==_.return||_.return()}finally{if(g)throw v}}}}}catch(e){c=!0,p=e}finally{try{d||null==m.return||m.return()}finally{if(c)throw p}}return!1})(e,t)&&n.push(e);var i=!0,o=!1,a=void 0;try{for(var l,d=u(e)[Symbol.iterator]();!(i=(l=d.next()).done);i=!0){let e=l.value;r(e)}}catch(e){o=!0,a=e}finally{try{i||null==d.return||d.return()}finally{if(o)throw a}}};r(e.root);var i=!0,o=!1,a=void 0;try{for(var l,d,c=(null!=(l=e.components)?l:[])[Symbol.iterator]();!(i=(d=c.next()).done);i=!0){let e=d.value;r(e)}}catch(e){o=!0,a=e}finally{try{i||null==c.return||c.return()}finally{if(o)throw a}}return n}function c(e){let t=new Map,n=e=>{void 0===e.name||t.has(e.name)||t.set(e.name,e);var r=!0,i=!1,o=void 0;try{for(var a,l=u(e)[Symbol.iterator]();!(r=(a=l.next()).done);r=!0){let e=a.value;n(e)}}catch(e){i=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}};n(e.root);var i=!0,o=!1,l=void 0;try{for(var s,d,c=(null!=(s=e.components)?s:[])[Symbol.iterator]();!(i=(d=c.next()).done);i=!0){let e=d.value;n(e)}}catch(e){o=!0,l=e}finally{try{i||null==c.return||c.return()}finally{if(o)throw l}}let p=new Map;var h=!0,m=!1,f=void 0;try{for(var g,v=t[Symbol.iterator]();!(h=(g=v.next()).done);h=!0){let e=(w=g.value,function(e){if(Array.isArray(e))return e}(w)||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var i=[],o=!0,a=!1;try{for(r=r.call(e);!(o=(t=r.next()).done)&&(i.push(t.value),2!==i.length);o=!0);}catch(e){a=!0,n=e}finally{try{o||null==r.return||r.return()}finally{if(a)throw n}}return i}}(w)||function(e){if(e){if("string"==typeof e)return r(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return r(e,2)}}(w)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),n=e[0],i=e[1],o=[];var b=!0,y=!1,_=void 0;try{for(var w,x,k,O,A=Object.values(null!=(x=i.bind)?x:{})[Symbol.iterator]();!(b=(O=A.next()).done);b=!0){let e=O.value,n="string"==typeof e?null==(k=a(e))?void 0:k[0]:void 0;void 0!==n&&t.has(n)&&!o.includes(n)&&o.push(n)}}catch(e){y=!0,_=e}finally{try{b||null==A.return||A.return()}finally{if(y)throw _}}p.set(n,o)}}catch(e){m=!0,f=e}finally{try{h||null==v.return||v.return()}finally{if(m)throw f}}let S=new Map,P=[],E=e=>{S.set(e,"visiting"),P.push(e);var t=!0,n=!1,r=void 0;try{for(var i,o,a=(null!=(i=p.get(e))?i:[])[Symbol.iterator]();!(t=(o=a.next()).done);t=!0){let e=o.value;if("visiting"===S.get(e))return[...P.slice(P.indexOf(e)),e];if(!S.has(e)){let t=E(e);if(t)return t}}}catch(e){n=!0,r=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw r}}return P.pop(),S.set(e,"done"),null};var C=!0,j=!1,T=void 0;try{for(var N,I=t.keys()[Symbol.iterator]();!(C=(N=I.next()).done);C=!0){let e=N.value;if(!S.has(e)){let t=E(e);if(t)return t}}}catch(e){j=!0,T=e}finally{try{C||null==I.return||I.return()}finally{if(j)throw T}}return null}},6336(e,t,n){n(7115),n(1518);var r=n(9701),i=n(8609);n(9947),n(7974),n(8049),n(6050),n(5363),n(4653),n(2943),n(9050),n(5557),n(8321),n(2570),n(8752),n(6404),n(8770),n(6205),n(5812);var o=n(1781);n(1283),n(5143),n(7447),n(1043),n(8195),n(1573),n(1019),n(4291),n(4151),n(6588),n(9178),n(3855),n(2657),n(9378),n(7373),n(4980),n(2271),n(5113),n(6922),n(9793),n(2120),n(7371),n(2136),n(8651),n(9271),n(4535);function a(e,...t){return[{name:"label",type:"string",bindable:!0},{name:"name",type:"string",description:"Stable key for forms and dumps; defaults to the label."},{name:"value",type:e,bindable:!0,twoWay:!0},{name:"inline",type:"bool",structural:!0,description:"Compact one-row variant without a label."},{name:"postfix",type:"string",bindable:!0,description:"Units or a short suffix shown after the editor."},{name:"tooltipText",type:"string",bindable:!0},{name:"disabled",type:"string",bindable:!0,description:"Why the input is off — greyed out, edits blocked, the reason as its tooltip; empty while on."},{name:"readOnly",type:"bool",bindable:!0,description:"Shows the value, selectable, but blocks edits."},{name:"required",type:"bool",bindable:!0,description:"An empty value is invalid once the input was edited, left or its form validated."},...t]}r.Ec;class l extends r.Ec{get cls(){var e;return(null!=(e=this._cls)?e:[]).join(" ")}set cls(e){var t;this.root.classList.remove(...null!=(t=this._cls)?t:[]),this._cls=String(null!=e?e:"").split(/\s+/).filter(e=>e),this.root.classList.add(...this._cls)}get gap(){var e;return null!=(e=this._gap)?e:""}set gap(e){this._gap&&this.root.classList.remove(`u2-gap-${this._gap}`),this._gap=null!=e?e:"",this._gap&&this.root.classList.add(`u2-gap-${this._gap}`)}}function s(e,t,n){return{tag:e,category:"Containers",create:e=>{var n,r;let i=new l(t());return i.cls=null!=(n=e.cls)?n:"",i.gap=null!=(r=e.gap)?r:"",i},description:n,props:[{name:"cls",type:"string",description:"Extra layout class."},{name:"gap",type:"string",choices:["xs","s","m","l","xl","xxl"],description:"Space between the children on the token scale: 2, 4, 8, 12, 16 or 24px."}],acceptsChildren:!0,example:{tag:e,children:[{tag:"u2-text-input",props:{label:"Name"}}]}}}r.Ec,a("string",{name:"placeholder",type:"string",bindable:!0},{name:"search",type:"bool",structural:!0,description:"Magnifier affordance plus a clear button."},{name:"password",type:"bool",structural:!0,description:"Masked field with an eye toggle."},{name:"autoResize",type:"bool",structural:!0,description:"Width follows the text between 100 and 300px."}),a("string",{name:"placeholder",type:"string",bindable:!0},{name:"autoGrow",type:"bool",structural:!0,description:"Grows with the text instead of scrolling."},{name:"rows",type:"int",description:"Visible text lines."}),a("bool",{name:"switch",type:"bool",structural:!0,description:"Compact toggle instead of a checkbox."},{name:"captionAfter",type:"bool",structural:!0,description:"Checklist row: the box, then its caption."}),a("double",{name:"mode",type:"string",choices:["int","float"],structural:!0,description:'"int" or "float" (default).'},{name:"min",type:"double"},{name:"max",type:"double"},{name:"step",type:"double",description:"Spinner, clicker and arrow-key increment; 1 by default."},{name:"slider",type:"bool",structural:!0,description:"Range control under the box, revealed on hover; needs both bounds."},{name:"clicker",type:"bool",structural:!0,description:"− / + buttons on the options rail, revealed on hover."},{name:"spinner",type:"bool",structural:!0,description:"Hover spinner inside the field."},{name:"placeholder",type:"string",bindable:!0}),a("string",{name:"items",type:"string_list",bindable:!0},{name:"nullable",type:"bool",structural:!0,description:"Offers an empty option; true by default."}),a("string_list",{name:"items",type:"string_list",bindable:!0},{name:"emptyText",type:"string",description:"Stands in for an empty list; 'No items' by default."},{name:"showSummaryCheckbox",type:"bool",structural:!0,description:'Tri-state "<N> of <M>" summary row that toggles all/none; the list collapses on click.'}),s("u2-panel",()=>{let e=(0,i.nd)();return e.dataset.u2="panel",e},"Padded vertical container."),s("u2-div-v",()=>{let e=(0,i.yP)();return e.dataset.u2="div-v",e},"Vertical stack."),s("u2-div-h",()=>{let e=(0,i._Q)();return e.dataset.u2="div-h",e},"Horizontal row."),a("double",{name:"min",type:"double"},{name:"max",type:"double"},{name:"step",type:"double",description:"(max - min) / 100 by default."}),a("string",{name:"items",type:"string_list"},{name:"buttons",type:"bool",structural:!0,description:"Raised-button variant instead of radio dots."},{name:"itemTooltips",type:"object",description:"Hover text per item."}),a("string",{name:"swatchOnly",type:"bool",structural:!0,description:"Swatch alone, no hex field."}),a("string").map(e=>{var t,n;return"value"===e.name?(t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},e),n=(n={inputType:"Icon"},n),Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t):e}),a("string_list",{name:"placeholder",type:"string",bindable:!0}),a("object"),a("object",{name:"fields",type:"string_list",structural:!0,description:"The columns: text fields, in order."},{name:"addText",type:"string",structural:!0,description:"The add link's text; Add by default."},{name:"orderable",type:"bool",structural:!0,description:"Rows move by a handle or Alt+↑/↓."}),a("string_list",{name:"items",type:"string_list",bindable:!0},{name:"orderable",type:"bool",structural:!0,description:"Rows move by a handle or Alt+↑/↓."}),a("string_list",{name:"items",type:"string_list",bindable:!0},{name:"emptyText",type:"string",description:"Stands in for an empty list; 'No items' by default."}),a("object",{name:"capabilities",type:"string_list",structural:!0,description:"The columns, in order."},{name:"principals",type:"string_list",bindable:!0,description:"What the add picker offers."},{name:"principalLabel",type:"string",description:"The first column's header; Group by default."},{name:"addText",type:"string",description:"The picker's placeholder."}),a("double",{name:"placeholder",type:"string",bindable:!0}),o.e.less(5.2),a("string",{name:"families",type:"string_list",structural:!0,description:"Families on offer; four defaults otherwise."},{name:"sizes",type:"object",structural:!0,description:"Sizes in the popup under the size box."}),a("string",{name:"alt",type:"string",description:"Alternative text."}),a("object",{name:"schema",type:"object",structural:!0,description:"`{properties: IProperty[], values?: {<name>: scalar[]}}` — what can be filtered on."},{name:"mode",type:"string",choices:["simple","advanced"],bindable:!0,twoWay:!0,description:"simple: one flat and/or group; advanced: nested groups, not, drag handles."},{name:"orientation",type:"string",choices:["vertical","horizontal"],structural:!0,description:"horizontal lays the rows out inline with a connector chip between them."},{name:"template",type:"object",structural:!0,description:"`{root, allowedProperties?, allowedOperators?, allowAdvanced?, allowAdd?}` — locks and limits: `allowAdvanced: false` keeps the builder simple, `allowAdd: false` fixes the rows."},{name:"showQuery",type:"bool",structural:!0,description:"Footer line with the canonical query string; off by default."},{name:"target",type:"string",choices:["domain","dataframe"],structural:!0,description:"What the tree must be expressible for; validation only."},{name:"query",type:"string",bindable:!0,description:"The canonical query string (read-only)."}),a("object",{name:"schema",type:"object",structural:!0,description:"`{properties: IProperty[], values?: {<name>: scalar[]}}` — what can be filtered on."},{name:"placeholder",type:"string"},{name:"target",type:"string",choices:["domain","dataframe"],structural:!0,description:"What the tree must be expressible for; validation only."},{name:"query",type:"string",bindable:!0,description:"The draft text (per keystroke, may be unparsable; read-only)."})},9271(e,t,n){n.d(t,{QB:()=>i,u5:()=>s});var r=n(326);let i="dg-ui/1",o={name:"visible",type:"bool",description:"false hides the node; true by default."},a={"u2-domain-":"@datagrok-libraries/ems — call installEms()","u2-manifest-":"@datagrok-libraries/ems — call installEms()"};class l{use(e){let t=this._plugins.find(t=>t.plugin.name===e.name);if(void 0!==t)return t.plugin!==e&&console.warn(`u2 registry: "${e.name}" is installed already, from another copy — that one stays`),t.uninstall;let n=new Set(this._metas.keys());e.register(this);let r=[...this._metas.keys()].filter(e=>!n.has(e)),i={plugin:e,uninstall:()=>{let e=this._plugins.indexOf(i);if(!(e<0)){this._plugins.splice(e,1);var t=!0,n=!1,o=void 0;try{for(var a,l=r[Symbol.iterator]();!(t=(a=l.next()).done);t=!0){let e=a.value;this._metas.delete(e)}}catch(e){n=!0,o=e}finally{try{t||null==l.return||l.return()}finally{if(n)throw o}}}}};return this._plugins.push(i),i.uninstall}plugins(){return this._plugins.map(e=>e.plugin)}missingTagHint(e){let t=this._plugins.find(t=>{var n;return null==(n=t.plugin.tagPrefixes)?void 0:n.some(t=>e.startsWith(t))});if(void 0!==t)return`${t.plugin.name} is installed and registers no such tag`;let n=Object.keys(a).find(t=>e.startsWith(t));return void 0!==n?`it comes with ${a[n]}`:e.startsWith("u2-")&&!this.builtins?"u2's components are not registered in this registry — call registerAll() first":null}register(e){var t,n;if(this._metas.has(e.tag))throw Error(`u2 registry: "${e.tag}" is already registered`);let i=e.create,a=e.createWithChildren,s=e.createComponent;if(!1===e.visual?void 0===s:void 0===i&&void 0===a)throw Error(`u2 registry: "${e.tag}" needs ${!1===e.visual?"createComponent":"create or createWithChildren"}`);let u=!1!==e.visual&&!1!==e.appearance,d=u?(0,r.o)(e.props):[],c=u&&!e.props.some(e=>e.name===o.name)?[o]:[],p=(e,t)=>(l._stamp(e,h,t),(0,r.Fc)(e,t,d),c.length>0&&"boolean"==typeof t.visible&&(e.visible=t.visible),e),h=(t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},e),n=n={props:[...e.props,...c,...d],create:i?e=>p(i(e),e):void 0,createWithChildren:a?(e,t,n)=>p(a(e,t,n),e):void 0,createComponent:s?(e,t)=>l._stamp(s(e,t),h,e):void 0},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t);this._metas.set(e.tag,h)}get(e){return this._metas.get(e)}metas(){return[...this._metas.values()]}manifest(){let e=[];var t=!0,n=!1,o=void 0;try{for(var a,l=this._metas.values()[Symbol.iterator]();!(t=(a=l.next()).done);t=!0){let t=a.value;t.create,t.createWithChildren,t.createComponent,t.adopt,t.carry,t.setChildProp,t.designerActions,t.icon;let n=function(e,t){if(null==e)return{};var n,r,i,o={};if("u">typeof Reflect&&Reflect.ownKeys){for(i=0,n=Reflect.ownKeys(Object(e));i<n.length;i++)r=n[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r]);return o}if(o=function(e,t){if(null==e)return{};var n,r,i={},o=Object.getOwnPropertyNames(e);for(r=0;r<o.length;r++)n=o[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n]);return i}(e,t),Object.getOwnPropertySymbols)for(i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)r=n[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r]);return o}(t,["create","createWithChildren","createComponent","adopt","carry","setChildProp","designerActions","icon"]);n.props=n.props.filter(e=>!r.s.includes(e)),e.push(n)}}catch(e){n=!0,o=e}finally{try{t||null==l.return||l.return()}finally{if(n)throw o}}return{schema:i,recipes:"docs/recipes/",binding:'Every declared prop accepts a "bind" entry and follows it live, except props marked structural, which read a bind once. A bind on an undeclared prop is an error.',appearance:r.s,components:e}}static _stamp(e,t,n){return e.componentMeta=t,e.specProps=n,e}constructor(){this._metas=new Map,this._plugins=[],this.builtins=!1}}let s=new l},4535(e,t,n){n.d(t,{F9:()=>P,Q5:()=>g,R4:()=>w,UE:()=>C,VI:()=>_,W:()=>A,eP:()=>k,ij:()=>O,ix:()=>S});var r,i=n(7115),o=n(2454),a=n(1518),l=n(9701),s=n(9271),u=n(199),d=n(1965),c=n(326);function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function m(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,i=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var o=[],a=!0,l=!1;try{for(i=i.call(e);!(a=(n=i.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==i.return||i.return()}finally{if(l)throw r}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return p(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return p(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}let f=new WeakMap;function g(e,t){var n,r,i;let o=e?null==(r=f.get(e))||null==(n=r[t])?void 0:n.value:void 0;return void 0!==o?o:null==e||null==(i=e.props)?void 0:i[t]}let v=new Set(["div","span","p","h1","h2","h3","a","img"]),b=new Set(["text","cls","href","src"]),y=new Set(["object","string","number","boolean"]);class _{bindProps(){return Object.entries(this.data).map(e=>{let t=m(e,2),n=t[0],r=t[1];return r instanceof i.HN?{name:n,type:(0,o.B)(r.peek()),writable:(0,i.n$)(r)}:{name:n,walkable:!0}})}constructor(e){let t=void 0===e?{}:e;this.data={};const n=null!=(l=t.data)?l:{};var r=!0,o=!1,a=void 0;try{for(var l,s,u,c=Object.keys(n)[Symbol.iterator]();!(r=(u=c.next()).done);r=!0){const e=u.value,t=n[e];this.data[e]=t instanceof i.HN||(0,d.P)(t)?t:(0,i.vP)(t)}}catch(e){o=!0,a=e}finally{try{r||null==c.return||c.return()}finally{if(o)throw a}}this.commands=null!=(s=t.commands)?s:{},this.callFunction=t.callFunction}}class w extends l.Ec{_ambient(e){let t=e,n=this._registry.plugins();for(let e=n.length-1;e>=0;e--){let r=n[e].specAmbient;if(void 0!==r){let e=t;t=()=>r(this,e)}}return t()}dispose(){super.dispose(),this._nodes.clear(),this._named.clear(),this._elements.clear(),this._mounts.clear(),this._deferred.length=0}get spec(){return this._spec}get registry(){return this._registry}setDesignTime(e){var t;e!==this._designTime&&(this._designTime=e,this.rerenderAll(null!=(t=this._spec.components)?t:[]))}get designTime(){return this._designTime}dump(){var e;let t=null!=(e=this._spec.components)?e:[],n={$schema:s.QB};return t.length>0&&(n.components=t.map(e=>this._dump(e))),n.root=this._dump(this._spec.root),n}nodes(){return this._nodes}node(e){return this._named.get(e)}static elementOf(e){return l.Ec.is(e)?e.root:l.uA.is(e)?void 0:e}nodeAt(e){for(let t=e;t;t=t.parentElement){let e=this._elements.get(t);if(e)return e}return null}parentOf(e){return e===this._spec.root?null:w._parentOf(this._spec.root,e)}static contains(e,t){return null!==w._parentOf(e,t)}resolveBinding(e){let t=(0,u.Rr)(e);if(null===t)throw Error(`"${e}" is not a valid bind path`);let n=this._firstStep(t[0],e);var r=!0,o=!1,a=void 0;try{for(var l,s=t.slice(1)[Symbol.iterator]();!(r=(l=s.next()).done);r=!0){let t=l.value;if(n instanceof i.HN)throw Error(`"${e}": cannot walk into "${t}" — the path continues past a signal`);let r=n.bindStep(t);if(null===r)throw Error(`"${e}": no binding step "${t}"`);n=r}}catch(e){o=!0,a=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw a}}for(let t=3;!(n instanceof i.HN);t--){let r=n,i=t>0?r.bindStep(""):null;if(null===i){let t=r.bindProps().map(e=>e.name).join(", ");throw Error(`"${e}" needs one more step — one of: ${t}`)}n=i}return{signal:n,writable:(0,i.n$)(n)}}_firstStep(e,t){var n;let r=null==(n=this._spec.components)?void 0:n.find(t=>t.name===e);if(r){let t=this._nodes.get(r);if(void 0!==t&&(0,d.P)(t))return t;throw Error(`component "${e}" is not built`)}let i=this._named.get(e);if(void 0!==i){if((0,d.P)(i))return i;if(w._isPlaceholder(i))throw Error(`component "${e}" is declared but not built`);throw Error(`"${e}" is not a bind source`)}let o=this.ctx.data[e];if(void 0!==o)return o;if(w._declared(this._spec.root,e))throw Error(`component "${e}" is declared but not built`);throw Error(`nothing bound at "${t}"`)}static _eachName(e,t){void 0!==e.name&&t(e.name);var n=!0,r=!1,i=void 0;try{for(var o,a=(0,u.EK)(e)[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){let e=o.value;w._eachName(e,t)}}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}}static _declared(e,t){return e.name===t||(0,u.EK)(e).some(e=>w._declared(e,t))}_forwardRef(e){var t,n;let r=null==(n=(0,u.Rr)(e))?void 0:n[0];return void 0!==r&&!this._named.has(r)&&void 0===this.ctx.data[r]&&!(null!=(t=this._spec.components)?t:[]).some(e=>e.name===r)&&w._declared(this._spec.root,r)}_flushLinks(){var e=!0,t=!1,n=void 0;try{for(var r,i=this._deferred.splice(0)[Symbol.iterator]();!(e=(r=i.next()).done);e=!0){let e=r.value,t=this._mounts.get(e.node);if(void 0!==t&&!t.scope.isDisposed&&this._nodes.get(e.node)===e.built)try{let n=this.resolveBinding(e.path),r=n.signal,i=n.writable;if("apply"===e.kind){t.scope.build(()=>e.apply(r));continue}e.twoWay&&!i&&this._warn(`bind "${e.path}" is read-only — edits will not flow back`),t.scope.build(()=>w._link(e.built,e.name,e.proxy,r,e.twoWay&&i))}catch(t){this._warn(`${e.node.tag}: ${t instanceof Error?t.message:String(t)}`)}}}catch(e){t=!0,n=e}finally{try{e||null==i.return||i.return()}finally{if(t)throw n}}}static _link(e,t,n,r,o){if(e.bindStep(t)instanceof i.HN)return void e.link(t,r,o);let s=a.HG.ambient;s.effect(()=>{let e=r.value;l.uA.sameValue(n.peek(),e)||(n.value=e)}),o&&s.effect(()=>{let e=n.value;l.uA.sameValue(r.peek(),e)||(r.value=e)})}rerender(e){let t=this._nodes.get(e);if(void 0===t)throw Error("u2 spec: rerender of a node that is not rendered");if(this._cycle=(0,u.$G)(this._spec),this._isComponent(e)){this._unmount(e),this._mountComponent(e),this._pending.includes(e)||this._pending.push(e),this._batching||this._flushStarts();return}let n=w.elementOf(t),r=this.parentOf(e),i=this._carried(e);this._unmount(e);let o=r?this._mounts.get(r).scope:this.scope,a=r?this._registry.get(r.tag):void 0,l=o.build(()=>this._render(e,a));var s=!0,d=!1,c=void 0;try{for(var p,h=i[Symbol.iterator]();!(s=(p=h.next()).done);s=!0){let e=m(p.value,3),t=e[0],n=e[1],r=e[2],i=this._nodes.get(t);void 0!==i&&n(t,r,i)}}catch(e){d=!0,c=e}finally{try{s||null==h.return||h.return()}finally{if(d)throw c}}n.replaceWith(w._element(l)),this._batching||this._flushStarts()}_carried(e){let t=[],n=e=>{let r=null==(s=this._registry.get(e.tag))?void 0:s.carry,i=this._nodes.get(e);void 0!==r&&void 0!==i&&t.push([e,r,i]);var o=!0,a=!1,l=void 0;try{for(var s,d,c=(0,u.EK)(e)[Symbol.iterator]();!(o=(d=c.next()).done);o=!0){let e=d.value;n(e)}}catch(e){a=!0,l=e}finally{try{o||null==c.return||c.return()}finally{if(a)throw l}}};return n(e),t}rerenderAll(e){let t=[],n=e=>{if(!this._nodes.has(e))return;let n=this.renderRootOf(e);t.includes(n)||t.push(n)};var r=!0,i=!1,o=void 0;try{for(var a,l=e[Symbol.iterator]();!(r=(a=l.next()).done);r=!0){let e=a.value;n(e)}}catch(e){i=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}let s=new Set;for(let e=0;e<t.length;e++)w._eachName(t[e],e=>{if(!s.has(e)){s.add(e);var t=!0,r=!1,i=void 0;try{for(var o,a=(0,u.CL)(this._spec,e)[Symbol.iterator]();!(t=(o=a.next()).done);t=!0){let e=o.value;n(e)}}catch(e){r=!0,i=e}finally{try{t||null==a.return||a.return()}finally{if(r)throw i}}}});this._batching=!0;try{let e=t.filter((e,n)=>!t.some((t,r)=>r!==n&&w.contains(t,e)));var d=!0,c=!1,p=void 0;try{for(var h,m=e.sort((e,t)=>Number(this._isComponent(t))-Number(this._isComponent(e)))[Symbol.iterator]();!(d=(h=m.next()).done);d=!0){let e=h.value;this.rerender(e)}}catch(e){c=!0,p=e}finally{try{d||null==m.return||m.return()}finally{if(c)throw p}}}finally{this._batching=!1}this._flushStarts()}renderRootOf(e){let t=e;for(;;){let e=this.parentOf(t),n=e?this._registry.get(e.tag):void 0;if(!e||!n||void 0===n.adopt&&void 0===n.createWithChildren)return t;t=e}}mountComponent(e){this._cycle=(0,u.$G)(this._spec),this._mountComponent(e),this._pending.push(e)}unmountComponent(e){this._unmount(e)}_isComponent(e){var t;return(null==(t=this._spec.components)?void 0:t.includes(e))===!0}_mountComponent(e){this._mount(e,this.scope).build(()=>this._ambient(()=>{let t=this._buildComponent(e);this._nodes.set(e,t),void 0===e.name?this._warn(`${e.tag}: a component without a name cannot be bound to`):this._name(e,t)}))}_flushStarts(){this._flushLinks();let e=this._pending.splice(0);var t=!0,n=!1,r=void 0;try{for(var i,o=e[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){let e=i.value;this._nodes.has(e)&&this._start(e)}}catch(e){n=!0,r=e}finally{try{t||null==o.return||o.return()}finally{if(n)throw r}}}_start(e){let t=this._nodes.get(e);if("function"==typeof(null==t?void 0:t.start))try{t.start()}catch(t){this._warn(`${e.tag}: ${t instanceof Error?t.message:String(t)}`)}}_buildComponent(e){try{let s=this._registry.get(e.tag);if(void 0===s){let t=this._unknownTag(e.tag,"is not a registered component");throw this._warn(`${e.tag}: ${t}`),Error(t)}if(!s.createComponent)throw Error("is a visual component — it belongs in the form");w._shape(e),this._children(e,s,!1),this._noCycle(e);let u=this._props(e,s),d=[],c=[];var t=!0,n=!1,r=void 0;try{for(var i,o,a,l=Object.entries(null!=(i=e.bind)?i:{})[Symbol.iterator]();!(t=(a=l.next()).done);t=!0){let t=m(a.value,2),n=t[0],r=t[1],i=n.indexOf(".");if(i>=0){if(!(null==(o=w._prop(s,n.slice(0,i)))?void 0:o.subBindable))throw Error(`prop "${n.slice(0,i)}" does not take sub-binds`);continue}let l=w._prop(s,n);if(!l)throw Error(`has no prop "${n}" to bind`);l.bindable||l.subBindable||this._bindOnce(e,l,r,u,d,c)}}catch(e){n=!0,r=e}finally{try{t||null==l.return||l.return()}finally{if(n)throw r}}let p=s.createComponent(u,{designTime:this._designTime,subBinds:h({},e.bind),resolve:t=>{try{return this.resolveBinding(t).signal}catch(t){return this._warn(`${e.tag}: ${t instanceof Error?t.message:String(t)}`),null}}});return this._followProps(e,p,this._mounts.get(e).scope,d,c),p}catch(t){return w._placeholder(`${e.tag}: ${t instanceof Error?t.message:String(t)}`)}}_unknownTag(e,t){let n=this._registry.missingTagHint(e);return null===n?t:`${t}; ${n}`}_render(e,t){return this._mount(e).build(()=>{let n=this._build(e,t),r=w._element(n);return this._nodes.set(e,n),this._elements.set(r,e),void 0!==e.name&&(r.dataset.u2Name=e.name,this._name(e,n)),n})}_mount(e,t){let n=void 0===t?null!=(r=a.HG.ambient)?r:this.scope:t,i=new a.HG,o=()=>i.dispose();return n.own(o),this._mounts.set(e,{scope:i,release:()=>{i.dispose(),n.disown(o)}}),i}_name(e,t){this._named.has(e.name)?this._warn(`${e.tag}: duplicate name "${e.name}"`):this._named.set(e.name,t)}_unmount(e){this._mounts.get(e).release();let t=new Set;var n=!0,r=!1,i=void 0;try{for(var o,a=Array.from(this._mounts)[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){let e=m(o.value,2),n=e[0];if(!e[1].scope.isDisposed)continue;let r=this._nodes.get(n);if(void 0!==r){t.add(r),this._nodes.delete(n);let e=w.elementOf(r);e&&this._elements.delete(e)}this._mounts.delete(n)}}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}var l=!0,s=!1,u=void 0;try{for(var d,c=Array.from(this._named)[Symbol.iterator]();!(l=(d=c.next()).done);l=!0){let e=m(d.value,2),n=e[0],r=e[1];t.has(r)&&this._named.delete(n)}}catch(e){s=!0,u=e}finally{try{l||null==c.return||c.return()}finally{if(s)throw u}}}_build(e,t){try{w._shape(e);let l=w._commands(e),s=this._registry.get(e.tag),u=s?this._component(e,s,t):this._html(e,t);var n=!0,r=!1,i=void 0;try{for(var o,a=l[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){let t=m(o.value,2),n=t[0],r=t[1];this._listen(e,u,n,r)}}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}return u}catch(t){return w._placeholder(`${e.tag}: ${t instanceof Error?t.message:String(t)}`)}}_component(e,t,n){if(!1===t.visual)throw Error("is a data source — it belongs on the components tray");this._noCycle(e);let r=this._props(e,t,n);f.delete(e);let o=[],l=[],s=[],u=[];var d=!0,c=!1,p=void 0;try{for(var h,g,v,b,y=Object.entries(null!=(h=e.bind)?h:{})[Symbol.iterator]();!(d=(b=y.next()).done);d=!0){let a=m(b.value,2),d=a[0],c=a[1],p=d.indexOf(".");if(p>=0&&(null==(v=w._prop(t,d.slice(0,p)))?void 0:v.subBindable))continue;let h=w._prop(t,d,n);if(!h)throw Error(`has no prop "${d}" to bind`);if(h.bindable){if(this._forwardRef(c)){let e=(0,i.vP)(void 0);r[d]=e,l.push([d,c,!0===h.twoWay,e]);continue}let e=this.resolveBinding(c),t=e.signal,n=e.writable;r[d]=t,h.twoWay&&(n||this._warn(`bind "${c}" is read-only — edits will not flow back`),o.push([d,t,n]))}else w._childProp(n,d)===h?this._childBind(e,h,c):this._bindOnce(e,h,c,r,s,u)}}catch(e){c=!0,p=e}finally{try{d||null==y.return||y.return()}finally{if(c)throw p}}let _=t.createWithChildren?t.createWithChildren(r,this._children(e,t,!0),null!=(g=e.children)?g:[]):this._adopt(e,t,t.create(r));var x=!0,k=!1,O=void 0;try{for(var A,S=o[Symbol.iterator]();!(x=(A=S.next()).done);x=!0){let e=m(A.value,3),t=e[0],n=e[1],r=e[2];_.link(t,n,r)}}catch(e){k=!0,O=e}finally{try{x||null==S.return||S.return()}finally{if(k)throw O}}var P=!0,E=!1,C=void 0;try{for(var j,T=l[Symbol.iterator]();!(P=(j=T.next()).done);P=!0){let t=m(j.value,4),n=t[0],r=t[1],i=t[2],o=t[3];this._deferred.push({node:e,built:_,kind:"link",name:n,path:r,twoWay:i,proxy:o})}}catch(e){E=!0,C=e}finally{try{P||null==T.return||T.return()}finally{if(E)throw C}}let N=a.HG.ambient;return this._followProps(e,_,N,s,u),this._followChildren(e,t,_,N),_}_bindOnce(e,t,n,r,i,o){let a=t.name;if(this._forwardRef(n))return void(t.structural?this._warn(`${e.tag}.${a} is structural — "${n}" names a node declared later, so it is not read`):o.push([a,n]));let l=this.resolveBinding(n).signal;r[a]=l.peek(),t.structural?this._warn(`${e.tag}.${a} is structural — a bind is read once`):i.push([a,l])}_followProps(e,t,n,r,i){var o=!0,a=!1,l=void 0;try{for(var s,u=r[Symbol.iterator]();!(o=(s=u.next()).done);o=!0){let r=m(s.value,2),i=r[0],o=r[1],a=this._setter(e,t,i);null!==a&&w._follow(n,o,a,!1)}}catch(e){a=!0,l=e}finally{try{o||null==u.return||u.return()}finally{if(a)throw l}}var d=!0,c=!1,p=void 0;try{for(var h,f=i[Symbol.iterator]();!(d=(h=f.next()).done);d=!0){let r=m(h.value,2),i=r[0],o=r[1],a=this._setter(e,t,i);null!==a&&this._deferred.push({node:e,built:t,kind:"apply",name:i,path:o,twoWay:!1,apply:e=>w._follow(n,e,a,!0)})}}catch(e){c=!0,p=e}finally{try{d||null==f.return||f.return()}finally{if(c)throw p}}}_setter(e,t,n){var r;let i=null==(r=t.getProperties().find(e=>e.name===n))?void 0:r.set;return null==i?(this._warn(`${e.tag}.${n} has no live setter — a bind is read once`),null):e=>i(t.propertyTarget,e)}static _follow(e,t,n,r){let o=!r;e.effect(()=>{let e=t.value;if(o){o=!1;return}(0,i.O8)(()=>n(e))})}_childBind(e,t,n){var r,i,o,a;let l={},s=[],u=[];this._bindOnce(e,t,n,l,s,u);let d={value:l[t.name],source:null==(r=s[0])?void 0:r[1],path:null==(i=u[0])?void 0:i[1]};f.set(e,(o=h({},f.get(e)),a=a={[t.name]:d},Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(a)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(a)).forEach(function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(a,e))}),o))}_followChildren(e,t,n,r){var i=!0,o=!1,a=void 0;try{for(var l,s,u=(null!=(l=e.children)?l:[]).entries()[Symbol.iterator]();!(i=(s=u.next()).done);i=!0){let i=m(s.value,2),o=i[0],a=i[1];var d=!0,c=!1,p=void 0;try{for(var h,g,v=Object.entries(null!=(h=f.get(a))?h:{})[Symbol.iterator]();!(d=(g=v.next()).done);d=!0){let i=m(g.value,2),a=i[0],l=i[1];if(void 0===l.source&&void 0===l.path)continue;let s=t.setChildProp;if(void 0===s){this._warn(`${t.tag}: child prop "${a}" has no live setter — a bind is read once`);continue}let u=e=>s(n,o,a,e);void 0!==l.source?w._follow(r,l.source,u,!1):this._deferred.push({node:e,built:n,kind:"apply",name:a,path:l.path,twoWay:!1,apply:e=>w._follow(r,e,u,!0)})}}catch(e){c=!0,p=e}finally{try{d||null==v.return||v.return()}finally{if(c)throw p}}}}catch(e){o=!0,a=e}finally{try{i||null==u.return||u.return()}finally{if(o)throw a}}}_props(e,t,n){let r={};var i=!0,o=!1,a=void 0;try{for(var l,s,u=Object.entries(null!=(l=e.props)?l:{})[Symbol.iterator]();!(i=(s=u.next()).done);i=!0){let i=m(s.value,2),o=i[0],a=i[1],l=w._prop(t,o,n);l||this._warn(`${e.tag}: unknown prop "${o}"`),r[o]=l?w._checked(l,a):a}}catch(e){o=!0,a=e}finally{try{i||null==u.return||u.return()}finally{if(o)throw a}}return r}_noCycle(e){if(void 0!==e.name&&null!==this._cycle&&this._cycle.includes(e.name))throw Error(`binding cycle: ${this._cycle.join(" → ")}`)}static _shape(e){var t=!0,n=!1,r=void 0;try{for(var i,o,a=Object.entries(null!=(i=e.bind)?i:{})[Symbol.iterator]();!(t=(o=a.next()).done);t=!0){let e=m(o.value,2),t=e[0],n=e[1];if("string"!=typeof n)throw Error(`bind "${t}" must be a "$." path string`)}}catch(e){n=!0,r=e}finally{try{t||null==a.return||a.return()}finally{if(n)throw r}}let l=e.children;if(void 0!==l){if(!Array.isArray(l))throw Error('"children" must be an array of nodes');var s=!0,u=!1,d=void 0;try{for(var c,p=l.entries()[Symbol.iterator]();!(s=(c=p.next()).done);s=!0){let e=m(c.value,2),t=e[0],n=e[1];if(null===n||"object"!=typeof n||"string"!=typeof n.tag)throw Error(`children[${t}] is not a node with a "tag"`)}}catch(e){u=!0,d=e}finally{try{s||null==p.return||p.return()}finally{if(u)throw d}}}}_html(e,t){if(!v.has(e.tag))throw Error(this._unknownTag(e.tag,"neither a registered component nor a supported HTML tag"));let n=document.createElement(e.tag),r=[],i=(e,t)=>{"text"===e?n.textContent=null==t?"":String(t):"cls"===e?(n.classList.remove(...r),r=String(null!=t?t:"").split(/\s+/).filter(e=>e),n.classList.add(...r)):null==t||""===t?n.removeAttribute(e):n.setAttribute(e,String(t))},o={};var l=!0,s=!1,u=void 0;try{for(var d,p,h,g=Object.entries(null!=(d=e.props)?d:{})[Symbol.iterator]();!(l=(h=g.next()).done);l=!0){let n=m(h.value,2),r=n[0],a=n[1];if(!b.has(r)){let n=c.s.find(e=>e.name===r);if(n){o[r]=w._checked(n,a);continue}w._childProp(t,r)||this._warn(`${e.tag}: unknown prop "${r}"`);continue}if("string"!=typeof a)throw Error(`prop "${r}" expects string`);i(r,a)}}catch(e){s=!0,u=e}finally{try{l||null==g.return||g.return()}finally{if(s)throw u}}f.delete(e);let y=a.HG.ambient;(0,c.Fc)(n,o,c.s,y);let _=S(e.tag),x=(e,t)=>{c.s.some(t=>t.name===e)?(0,c.Fc)(n,{[e]:t},c.s,y):y.effect(()=>i(e,t.value))};var k=!0,O=!1,A=void 0;try{for(var P,E=Object.entries(null!=(p=e.bind)?p:{})[Symbol.iterator]();!(k=(P=E.next()).done);k=!0){let r=m(P.value,2),i=r[0],o=r[1],a=_.some(e=>e.name===i),l=w._childProp(t,i);if(!a&&!l)throw Error(`has no prop "${i}" to bind`);if(!a){this._childBind(e,l,o);continue}if(this._forwardRef(o)){this._deferred.push({node:e,built:n,kind:"apply",name:i,path:o,twoWay:!1,apply:e=>x(i,e)});continue}x(i,this.resolveBinding(o).signal)}}catch(e){O=!0,A=e}finally{try{k||null==E.return||E.return()}finally{if(O)throw A}}var C=!0,j=!1,T=void 0;try{for(var N,I=this._children(e,void 0,!0)[Symbol.iterator]();!(C=(N=I.next()).done);C=!0){let e=N.value;n.append(w._element(e))}}catch(e){j=!0,T=e}finally{try{C||null==I.return||I.return()}finally{if(j)throw T}}return n}_adopt(e,t,n){let r=!0===t.acceptsChildren||void 0!==t.adopt,i=this._children(e,t,r);for(let e=0;e<i.length;e++)t.adopt?t.adopt(n,i[e],e):n.root.append(w._element(i[e]));return n}_children(e,t,n){var r;let i=null!=(r=e.children)?r:[];return i.length>0&&!n?(this._warn(`${e.tag}: takes no children — ${i.length} dropped`),[]):i.map(e=>this._render(e,t))}_listen(e,t,n,r){var i;let o=()=>this._fire(e,r),s=null!=(i=a.HG.ambient)?i:this.scope;if(l.Ec.is(t)){let e=t.onEvent(n).subscribe(o);s.own(()=>e.unsubscribe());return}s.listen(t,n,o)}_fire(e,t){let n,r=("string"==typeof t?t:t.cmd).slice(4);try{n="string"==typeof t?{}:this._args(t.args)}catch(t){this._warn(`${e.tag}: ${t instanceof Error?t.message:String(t)}`);return}if(r.startsWith("#"))return void this._warn(`${e.tag}: "cmd:${r}" is reserved — code-behind commands arrive with dg-form`);if(r.includes(":"))return void(this.ctx.callFunction?this.ctx.callFunction(r,n):this._warn(`${e.tag}: no function runner for "${r}"`));if(r.includes(".")){let t=r.indexOf("."),i=r.slice(0,t),o=r.slice(t+1),a=this._named.get(i),s=l.uA.is(a)?a.getFunctions().find(e=>e.name===o):void 0;s?s.apply(n):this._warn(`${e.tag}: no function "${o}" on "${i}"`);return}let i=this.ctx.commands[r];"function"==typeof i?i():this.ctx.callFunction?this.ctx.callFunction(r,n):this._warn(`${e.tag}: no command "${r}"`)}_args(e){let t={};var n=!0,r=!1,i=void 0;try{for(var o,a=Object.entries(null!=e?e:{})[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){let e=m(o.value,2),n=e[0],r=e[1];t[n]="string"!=typeof r?r:r.startsWith("$.")?this.resolveBinding(r).signal.peek():r.startsWith("$$.")?r.slice(1):r}}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}return t}_dump(e){let t={tag:e.tag};return void 0!==e.name&&(t.name=e.name),e.props&&(t.props=w._copy(e.props)),e.bind&&(t.bind=w._copy(e.bind)),e.on&&(t.on=w._copy(e.on)),e.children&&(t.children=Array.isArray(e.children)?e.children.map(e=>null!==e&&"object"==typeof e?this._dump(e):e):e.children),t}static _copy(e,t){let n=void 0===t?new Map:t;if(null===e||"object"!=typeof e)return e;let r=Object.getPrototypeOf(e);if(!Array.isArray(e)&&r!==Object.prototype&&null!==r)return e;if(n.has(e))return n.get(e);let i=Array.isArray(e)?[]:{};n.set(e,i);var o=!0,a=!1,l=void 0;try{for(var s,u=Object.entries(e)[Symbol.iterator]();!(o=(s=u.next()).done);o=!0){let e=m(s.value,2),t=e[0],r=e[1];i[t]=w._copy(r,n)}}catch(e){a=!0,l=e}finally{try{o||null==u.return||u.return()}finally{if(a)throw l}}return i}_warn(e){this._warned.has(e)||(this._warned.add(e),console.warn(`u2 spec: ${e}`))}static _commands(e){let t=[];var n=!0,r=!1,i=void 0;try{for(var o,a,l=Object.entries(null!=(o=e.on)?o:{})[Symbol.iterator]();!(n=(a=l.next()).done);n=!0){let e=m(a.value,2),n=e[0],r=e[1],i="string"==typeof r?r:null==r?void 0:r.cmd;if("string"!=typeof i||!i.startsWith("cmd:"))throw Error(`on.${n} must be 'cmd:' followed by a command name — a spec never carries code`);t.push([n,r])}}catch(e){r=!0,i=e}finally{try{n||null==l.return||l.return()}finally{if(r)throw i}}return t}static _prop(e,t,n){var r;return null!=(r=e.props.find(e=>e.name===t))?r:w._childProp(n,t)}static _childProp(e,t){var n;return null==e||null==(n=e.childProps)?void 0:n.find(e=>e.name===t)}static _element(e){return l.Ec.is(e)?e.root:e}static _checked(e,t){let n=O(e,t);if(n)throw Error(n);return t}static _parentOf(e,t){var n=!0,r=!1,i=void 0;try{for(var o,a=(0,u.EK)(e)[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){let n=o.value;if(n===t)return e;let r=w._parentOf(n,t);if(r)return r}}catch(e){r=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}return null}static _placeholder(e){let t=document.createElement("div");return t.className="u2-spec-error",t.textContent=e,t}static _isPlaceholder(e){return!l.uA.is(e)&&e.classList.contains("u2-spec-error")}constructor(e,t,n,r){var i;let o=void 0===n?s.u5:n;super(),this._nodes=new Map,this._named=new Map,this._elements=new Map,this._mounts=new Map,this._warned=new Set,this._pending=[],this._deferred=[],this._batching=!1,this._spec=e,this.ctx=t,this._registry=o,this._designTime=null!=(i=(void 0===r?{}:r).designTime)&&i,this._cycle=(0,u.$G)(e),this.root.classList.add("u2-spec"),this.build(()=>{var t=!0,n=!1,r=void 0;try{for(var i,o,a,l=(null!=(i=e.components)?i:[])[Symbol.iterator]();!(t=(a=l.next()).done);t=!0){let e=a.value;this._mountComponent(e)}}catch(e){n=!0,r=e}finally{try{t||null==l.return||l.return()}finally{if(n)throw r}}this.root.append(w._element(this._render(e.root))),this._flushLinks();var s=!0,u=!1,d=void 0;try{for(var c,p=(null!=(o=e.components)?o:[])[Symbol.iterator]();!(s=(c=p.next()).done);s=!0){let e=c.value;this._start(e)}}catch(e){u=!0,d=e}finally{try{s||null==p.return||p.return()}finally{if(u)throw d}}})}}let x=new Set;function k(e){x.has(e)||(x.add(e),console.warn(`u2 spec: ${e}`))}function O(e,t){var n;let r=null!=(n=e.propertyType)?n:e.type;if(!function(e,t){switch(e){case"string":return"string"==typeof t;case"int":return"number"==typeof t&&Number.isInteger(t);case"double":return"number"==typeof t&&isFinite(t);case"bool":return"boolean"==typeof t;case"string_list":return Array.isArray(t)&&t.every(e=>"string"==typeof e);case"object":var n=t;if(!y.has(typeof n))return!1;try{return JSON.stringify(n,(e,t)=>{if(void 0===t||"function"==typeof t)throw Error("not JSON");return t}),!0}catch(e){return!1}default:return!1}}(r,t))return`prop "${e.name}" expects ${r}`;let i=e.choices;return i&&i.length>0&&"string_list"!==r&&"object"!==r&&!i.includes(t)?`prop "${e.name}" must be one of ${i.map(e=>`"${e}"`).join(", ")}`:null}function A(e){return v.has(e)}function S(e){let t=[{name:"text",type:"string",bindable:!0,description:"Text content"},{name:"cls",type:"string",bindable:!0,description:"Space-separated CSS classes"}];return"a"===e&&t.push({name:"href",type:"string",bindable:!0,description:"Link target"}),"img"===e&&t.push({name:"src",type:"string",bindable:!0,description:"Image source"}),t.push(...c.s),t}function P(e){var t;let n="string"==typeof e?JSON.parse(e):e;if(!n||"object"!=typeof n)throw Error("u2 spec: expected a spec object or a JSON string");if(n.$schema!==s.QB)throw Error(`u2 spec: $schema must be "${s.QB}", got ${JSON.stringify(n.$schema)}`);if(!n.root||"object"!=typeof n.root||"string"!=typeof n.root.tag)throw Error('u2 spec: "root" must be a node with a "tag"');if(void 0!==n.components){if(!Array.isArray(n.components))throw Error('u2 spec: "components" must be an array of nodes');var r=!0,i=!1,o=void 0;try{for(var a,l=n.components[Symbol.iterator]();!(r=(a=l.next()).done);r=!0){let e=a.value;if(!e||"object"!=typeof e||"string"!=typeof e.tag)throw Error('u2 spec: every entry of "components" must be a node with a "tag"')}}catch(e){i=!0,o=e}finally{try{r||null==l.return||l.return()}finally{if(i)throw o}}}let d=e=>{var t=!0,n=!1,r=void 0;try{for(var i,o,a,l=Object.entries(E)[Symbol.iterator]();!(t=(a=l.next()).done);t=!0){let t=m(a.value,2),n=t[0],r=t[1];if((null==(i=e.props)?void 0:i[n])!==void 0||(null==(o=e.bind)?void 0:o[n])!==void 0)throw Error(`u2 spec: ${e.tag}${e.name?` "${e.name}"`:""}: prop "${n}" is now ${r}`)}}catch(e){n=!0,r=e}finally{try{t||null==l.return||l.return()}finally{if(n)throw r}}var s=!0,c=!1,p=void 0;try{for(var h,f=(0,u.EK)(e)[Symbol.iterator]();!(s=(h=f.next()).done);s=!0){let e=h.value;d(e)}}catch(e){c=!0,p=e}finally{try{s||null==f.return||f.return()}finally{if(c)throw p}}};for(let e=0,r=[n.root,...null!=(t=n.components)?t:[]];e<r.length;e++)d(r[e]);return n}let E={enabled:'"disabled": the reason the user reads while the input is off, empty while it is on'};function C(e,t,n,r){return new w(P(e),null!=t?t:new _,n,r)}},8695(){let e="3069a2ac22e9",t="style[data-u2-styles]",n=!1,r=!1;class i{static install(o,a,l){let s=void 0===a?65:a,u=void 0===l?e:l,d=globalThis.document;if((null==d?void 0:d.head)===void 0||null===d.head||null!==d.querySelector('meta[name="u2-styles"][content="linked"]'))return null;!r&&i.legacyCopies(d)>0&&(r=!0,console.warn(`u2: a package built before stylesheet revisions injects its own copy of the u2 CSS, which overrides revision ${s}; republish the packages that bundle u2.`));let c=d.head.querySelector(t);if(null===c)(c=d.createElement("style")).setAttribute("data-u2-styles",""),d.head.insertBefore(c,i._packageZone(d.head));else{let e=Number(c.getAttribute("data-revision"));if(e>s||e===s&&c.getAttribute("data-hash")===u)return i.installed();if(e===s)return n||console.warn(`u2: two copies of stylesheet revision ${s} differ (${c.getAttribute("data-hash")} vs ${u}) — a package was built from uncommitted u2 CSS; rebuild it.`),n=!0,i.installed()}return c.textContent=void 0===o?":root {\n--dg-steel-1: var(--steel-1, #ECEFF2);\n--dg-steel-2: var(--steel-2, #D7DFE7);\n--dg-steel-3: var(--steel-3, #B3BFCC);\n--dg-steel-4: var(--steel-4, #7990A5);\n--dg-steel-5: var(--steel-5, #40607F);\n--dg-grey-1: var(--grey-1, #F2F2F5);\n--dg-grey-2: var(--grey-2, #DBDCDF);\n--dg-grey-3: var(--grey-3, #B8BAC0);\n--dg-grey-4: var(--grey-4, #9497A0);\n--dg-grey-5: var(--grey-5, #717581);\n--dg-grey-6: var(--grey-6, #4D5261);\n--dg-warm-grey-1: var(--warm-grey-1, #F7F6F4);\n--dg-warm-grey-2: var(--warm-grey-2, #DEDDDC);\n--dg-warm-grey-3: var(--warm-grey-3, #949492);\n--dg-warm-grey-4: var(--warm-grey-4, #4A4A49);\n--dg-red-1: var(--red-1, #FBE1E1);\n--dg-red-3: var(--red-3, #EB6767);\n--dg-red-4: var(--red-4, #763434);\n--dg-green-1: var(--green-1, #DCF3E7);\n--dg-green-2: var(--green-2, #3CB173);\n--dg-green-3: var(--green-3, #286344);\n--dg-orange-1: var(--orange-1, #FFECDB);\n--dg-orange-2: var(--orange-2, #FFA24A);\n--dg-orange-3: var(--orange-3, #805125);\n--dg-beige-1: var(--beige-1, #FDFFE5);\n--dg-beige-2: var(--beige-2, #E4E6CE);\n--dg-blue-1: var(--blue-1, #2083D5);\n--dg-blue-2: var(--blue-2, #50A9C5);\n--dg-white: var(--white, #FFFFFF);\n--dg-text-color: var(--text-color, var(--dg-grey-6));\n--dg-text-color-light: var(--text-color-light, var(--dg-grey-4));\n--dg-text-color-disabled: var(--dg-grey-3);\n--dg-bg: var(--dg-white);\n--dg-bg-secondary: var(--dg-grey-1);\n--dg-accent: var(--dg-blue-1);\n--dg-accent-secondary: var(--dg-blue-2);\n--dg-success: var(--success, #006400);\n--dg-failure: var(--failure, #8B0000);\n--dg-error: var(--dg-red-3);\n--dg-hover: var(--dg-steel-1);\n--dg-hover-subtle: var(--dg-grey-1);\n--dg-selection-bg: #DCEAF8;\n--dg-selection-text: var(--dg-accent);\n--dg-grid-current-row: rgba(0, 255, 0, 0.196);\n--dg-grid-selected-row: rgba(220, 220, 80, 0.196);\n--dg-grid-mouse-over-row: rgba(184, 211, 237, 0.196);\n--dg-grid-mouse-over-stripe: #48A6F2;\n--u2-row-base-bg: var(--dg-bg);\n--u2-row-hover-bg: var(--dg-grid-mouse-over-row);\n--u2-row-hover-stripe: var(--dg-grid-mouse-over-stripe);\n--u2-row-current-bg: var(--dg-grid-current-row);\n--u2-row-selected-bg: var(--dg-selection-bg);\n--u2-section-header-bg: var(--dg-bg-secondary);\n--dg-border: var(--dg-grey-2);\n--dg-border-subtle: var(--dg-grey-1);\n--dg-focus: var(--dg-blue-1);\n--dg-focus-ring-width: 2px;\n--dg-focus-ring: var(--dg-focus-ring-width) solid var(--dg-focus);\n--dg-font-family: 'Roboto', 'Roboto Local', sans-serif;\n--dg-font-family-mono: 'Roboto Mono', 'Roboto Mono Local', monospace;\n--dg-font-size: 13px;\n--dg-font-size-small: 12px;\n--dg-font-size-xs: 10px;\n--dg-font-size-h1: 16px;\n--dg-font-size-h2: 14px;\n--dg-font-size-h3: 13px;\n--dg-font-weight-light: var(--font-weight-light, 300);\n--dg-font-weight-regular: var(--font-weight-regular, 400);\n--dg-font-weight-medium: var(--font-weight-medium, 500);\n--dg-font-weight-bold: var(--font-weight-bold, 700);\n--dg-line-height: 1.4;\n--dg-space-xs: 2px;\n--dg-space-s: 4px;\n--dg-space-m: 8px;\n--dg-space-l: 12px;\n--dg-space-xl: 16px;\n--dg-space-xxl: 24px;\n--dg-control-height: 28px;\n--dg-form-min-editor-width: 150px;\n--dg-button-height: 24px;\n--dg-inline-control-height: 22px;\n--dg-border-width: 1px;\n--dg-radius: 4px;\n--dg-radius-l: 6px;\n--dg-input-border: var(--dg-border-width) solid var(--dg-border);\n--dg-input-border-focus: var(--dg-border-width) solid var(--dg-focus);\n--dg-backdrop: color-mix(in srgb, var(--dg-steel-5) 80%, transparent);\n--dg-tour-dim: rgba(0, 0, 0, 0.6);\n--dg-shadow-1: 0 2px 8px rgba(0, 0, 0, 0.14);\n--dg-shadow-2: 0 4px 14px rgba(0, 0, 0, 0.16), 0 0 2px rgba(0, 0, 0, 0.10);\n--dg-shadow-3: 0 0 5px var(--dg-grey-6);\n--dg-overlay-border: var(--dg-border-width) solid var(--dg-border);\n--dg-z-dialog: 3000;\n--dg-z-overlay: 6000;\n}\n[data-dg-density='compact'] {\n--dg-control-height: 24px;\n--dg-button-height: 22px;\n--dg-inline-control-height: 20px;\n--dg-space-m: 6px;\n--dg-space-l: 8px;\n--dg-space-xl: 12px;\n}\n.u2-component[hidden] {\ndisplay: none !important;\n}\n.u2-icon {\ncolor: currentColor;\n}\n.u2-icon-small {\nfont-size: 12px;\n}\n.u2-icon-medium {\nfont-size: 16px;\n}\n.u2-icon-large {\nfont-size: 20px;\n}\n.u2-icon-action {\ncolor: var(--dg-text-color-light);\ncursor: pointer;\n}\n.u2-icon-action:hover {\ncolor: var(--dg-accent);\n}\n.u2-div-v {\ndisplay: flex;\nflex-direction: column;\n}\n.u2-div-h {\ndisplay: flex;\nflex-direction: row;\nalign-items: center;\n}\n.d4-ribbon-panel.u2-ribbon-pinned.u2-ribbon-overflow::before,\n.u2-catalog-overflow .u2-table .u2-table-pin-end::before {\ncontent: '';\nposition: absolute;\ntop: 0;\nbottom: 0;\nleft: -10px;\nwidth: 10px;\npointer-events: none;\nbackground: linear-gradient(to left, color-mix(in srgb, var(--dg-steel-4) 40%, transparent), transparent);\n}\n.u2-gap-xs {\ngap: var(--dg-space-xs);\n}\n.u2-gap-s {\ngap: var(--dg-space-s);\n}\n.u2-gap-m {\ngap: var(--dg-space-m);\n}\n.u2-gap-l {\ngap: var(--dg-space-l);\n}\n.u2-gap-xl {\ngap: var(--dg-space-xl);\n}\n.u2-gap-xxl {\ngap: var(--dg-space-xxl);\n}\n.u2-region-off {\nopacity: 0.5;\n}\n.u2-panel {\nbox-sizing: border-box;\npadding: var(--dg-space-l);\n}\n.u2-btn {\nbox-sizing: border-box;\ndisplay: inline-flex;\nalign-items: center;\njustify-content: center;\nflex-shrink: 0;\ngap: var(--dg-space-s);\nheight: var(--dg-control-height);\npadding: 0 var(--dg-space-m);\nfont-family: var(--dg-font-family);\nfont-size: var(--dg-font-size);\nfont-weight: var(--dg-font-weight-bold);\ntext-transform: uppercase;\nwhite-space: nowrap;\ncolor: var(--dg-accent);\nbackground: transparent;\nborder: none;\nborder-radius: var(--dg-radius);\ncursor: pointer;\nuser-select: none;\n}\n.u2-btn:hover:not(:disabled, [aria-disabled='true']) {\nbackground: var(--dg-hover-subtle);\n}\n.u2-btn:active:not(:disabled, [aria-disabled='true']) {\nbackground: var(--dg-hover);\n}\n.u2-btn:focus-visible {\noutline: var(--dg-focus-ring);\noutline-offset: 1px;\n}\n.u2-btn:is(:disabled, [aria-disabled='true']) {\ncolor: var(--dg-text-color-disabled);\ncursor: default;\npointer-events: auto;\n}\n.u2-btn-primary {\nfont-weight: var(--dg-font-weight-regular);\ncolor: var(--dg-white);\nbackground: var(--dg-accent);\n}\n.u2-btn-primary:hover:not(:disabled, [aria-disabled='true']) {\ncolor: var(--dg-white);\nbackground: var(--dg-accent);\nfilter: contrast(90%) brightness(110%);\n}\n.u2-btn-primary:active:not(:disabled, [aria-disabled='true']) {\ncolor: var(--dg-white);\nbackground: var(--dg-accent);\nfilter: brightness(85%);\n}\n.u2-btn-primary:is(:disabled, [aria-disabled='true']) {\ncolor: var(--dg-grey-4);\nbackground: var(--dg-steel-2);\n}\n.u2-link {\ncolor: var(--dg-accent);\ntext-decoration: none;\ncursor: pointer;\n}\n.u2-link:hover {\ntext-decoration: underline;\n}\n.u2-link:focus-visible {\noutline: var(--dg-focus-ring);\noutline-offset: var(--dg-space-xs);\n}\n.u2-timestamp {\nfont-size: var(--dg-font-size-small);\ncolor: var(--dg-text-color-light);\nwhite-space: nowrap;\n}\n.u2-input-root {\nposition: relative;\nbox-sizing: border-box;\ndisplay: flex;\nflex-direction: row;\nflex-wrap: wrap;\nalign-items: flex-start;\nflex-shrink: 0;\npadding: var(--dg-space-s) 0;\nfont-family: var(--dg-font-family);\nfont-size: var(--dg-font-size);\nline-height: var(--dg-line-height);\ncolor: var(--dg-text-color);\n}\n.u2-input-label {\nbox-sizing: border-box;\ndisplay: inline-flex;\nflex-direction: column;\njustify-content: center;\nflex-shrink: 0;\nmin-width: 100px;\nheight: var(--dg-control-height);\nmargin-right: var(--dg-space-m);\noverflow: hidden;\nwhite-space: nowrap;\ntext-overflow: ellipsis;\n}\n.u2-input-required > .u2-input-label {\nflex-direction: row;\nalign-items: center;\n}\n.u2-input-required > .u2-input-label::after {\ncontent: '*';\nmargin-left: var(--dg-space-xs);\ncolor: var(--dg-error);\n}\n.u2-form:not(.u2-form-captions-left):not(.u2-form-tall) .u2-input-required > .u2-input-label,\n.u2-dialog-content > .u2-input-required > .u2-input-label {\nposition: relative;\njustify-content: flex-end;\noverflow: visible;\n}\n.u2-form:not(.u2-form-captions-left):not(.u2-form-tall) .u2-input-required > .u2-input-label::after,\n.u2-dialog-content > .u2-input-required > .u2-input-label::after {\nposition: absolute;\nleft: 100%;\nmargin-left: 1px;\n}\n.u2-input-editor {\nbox-sizing: border-box;\nheight: var(--dg-control-height);\npadding: 0 var(--dg-space-s);\nfont-family: inherit;\nfont-size: inherit;\ncolor: var(--dg-text-color);\nbackground: var(--dg-bg);\nborder: none;\nborder-radius: 0;\noutline: none;\n}\ninput.u2-input-editor,\ntextarea.u2-input-editor,\n.u2-input-editor.u2-input-search {\nborder-bottom: var(--dg-input-border);\n}\n.u2-input-inline[data-u2='text-input'] > .u2-input-box > input.u2-input-editor,\n.u2-input-inline[data-u2='text-input'] > .u2-input-box > .u2-input-editor.u2-input-password,\n.u2-input-inline[data-u2='suggest-input'] > .u2-input-box > input.u2-input-editor {\nwidth: 100px;\nmin-width: 0;\n}\n.u2-input-root:not(.u2-input-inline)[data-u2='text-input'] > .u2-input-box,\n.u2-input-root:not(.u2-input-inline)[data-u2='suggest-input'] > .u2-input-box,\n.u2-input-root:not(.u2-input-inline)[data-u2='text-area'] > .u2-input-box {\nflex-grow: 1;\nmin-width: 60px;\nmax-width: none;\n}\n.u2-input-root:not(.u2-input-inline)[data-u2='text-area'] > .u2-input-box > textarea.u2-input-editor {\nflex-grow: 1;\nmin-width: 0;\n}\n.u2-input-root:not(.u2-input-inline)[data-u2='text-input'] > .u2-input-box > .u2-input-editor,\n.u2-input-root:not(.u2-input-inline)[data-u2='suggest-input'] > .u2-input-box > .u2-input-editor {\nflex-grow: 1;\nmin-width: 0;\n}\n.u2-input-root[data-u2='bigint-input'] > .u2-input-box > input.u2-input-editor,\n.u2-input-root[data-u2='qnum-input'] > .u2-input-box > input.u2-input-editor {\nwidth: 140px;\nmax-width: 150px;\nmin-width: 0;\n}\n.u2-input-root.u2-input-fill > .u2-input-box {\nflex-grow: 1;\nmin-width: 0;\nmax-width: none;\n}\n.u2-input-root.u2-input-fill > .u2-input-box > .u2-input-editor,\n.u2-input-root.u2-input-fill > .u2-input-box > input.u2-input-editor {\nflex-grow: 1;\nwidth: auto;\nmax-width: none;\nmin-width: 0;\n}\n.u2-input-readonly .u2-input-options > .u2-input-edit-option,\n.u2-input-readonly .u2-input-clear {\npointer-events: none;\n}\n.u2-input-caption-after > .u2-input-label {\norder: 1;\nmin-width: 0;\nmargin-right: 0;\ncursor: pointer;\n}\n.u2-input-caption-after > .u2-input-error {\norder: 2;\n}\ninput.u2-input-editor:focus,\ntextarea.u2-input-editor:focus,\n.u2-input-editor.u2-input-search:focus-within {\nborder-bottom: var(--dg-input-border-focus);\n}\n.u2-input-editor::placeholder,\n.u2-input-search > input::placeholder {\ncolor: var(--dg-text-color-light);\n}\ntextarea.u2-input-editor {\nheight: auto;\nmin-height: calc(var(--dg-control-height) * 2);\nmax-height: calc(var(--dg-control-height) * 12);\npadding: var(--dg-space-xs) var(--dg-space-s);\nline-height: var(--dg-line-height);\nresize: vertical;\n}\n.u2-input-disabled textarea,\n.u2-input-readonly textarea {\nresize: none;\n}\n.u2-input-editor.u2-invalid,\n.u2-input-editor.u2-invalid:focus,\n.u2-input-editor.u2-invalid:focus-within,\n.u2-input-editor.u2-list.u2-invalid,\n.u2-input-editor.u2-list.u2-invalid:focus-within,\n.u2-input-editor.u2-input-password.u2-invalid,\n.u2-input-editor.u2-input-password.u2-invalid:focus-within,\n.u2-input-editor.u2-columns.u2-invalid,\n.u2-input-editor.u2-columns.u2-invalid:focus {\nborder-bottom: var(--dg-border-width) solid var(--dg-error);\n}\n.u2-input-editor.u2-radio.u2-invalid,\n.u2-input-editor.u2-multi-choice.u2-invalid {\nborder-bottom: none;\n}\n.u2-input-root[data-u2='dart-input'] .u2-input-editor.d4-input-molecule-canvas {\nflex: none;\nwidth: 100px;\nheight: 70px;\npadding: 0;\n}\n.u2-input-root[data-u2='dart-input'] > .u2-input-box {\nflex: 0 1 auto;\n}\n.u2-input-root.u2-input-fill[data-u2='dart-input'] > .u2-input-box,\n.u2-input-root.u2-input-fill[data-u2='dart-input'] > .u2-input-box > .ui-input-root {\nflex: 1 1 auto;\nmin-width: 0;\n}\n.u2-input-required[data-u2='dart-input'] .ui-input-label::after {\ncontent: '*';\nmargin-left: var(--dg-space-xs);\ncolor: var(--dg-error);\n}\n.u2-form:not(.u2-form-captions-left):not(.u2-form-tall) .u2-input-required[data-u2='dart-input'] .ui-input-label {\nposition: relative;\noverflow: visible;\n}\n.u2-form:not(.u2-form-captions-left):not(.u2-form-tall) .u2-input-required[data-u2='dart-input'] .ui-input-label::after {\nposition: absolute;\nleft: 100%;\nmargin-left: 1px;\n}\n.u2-input-root[data-u2='dart-input'] .d4-input-molecule-canvas-hint {\ncolor: var(--dg-text-color-light);\n}\n.u2-input-error {\nbox-sizing: border-box;\nflex: 1 0 100%;\nmin-width: 0;\ndisplay: -webkit-box;\n-webkit-box-orient: vertical;\n-webkit-line-clamp: 3;\noverflow: hidden;\nfont-size: var(--dg-font-size-small);\ncolor: var(--dg-error);\n}\n.u2-input-error:empty {\ndisplay: none;\n}\n:where(.u2-input-root:not(.u2-input-caption-after):not(.u2-input-inline) > .u2-input-label:not(:empty)) ~ .u2-input-error {\npadding-left: calc(100px + var(--dg-space-m));\n}\n.u2-input-box {\ndisplay: inline-flex;\nalign-items: center;\nmin-width: 0;\n}\n.u2-input-loading {\ndisplay: inline-flex;\nflex-shrink: 0;\nmargin-left: var(--dg-space-s);\n}\n.u2-input-loading[hidden] {\ndisplay: none;\n}\n:where(.u2-input-root:not(.u2-input-caption-after):not([data-u2='filter-builder']):not([data-u2='filter-query-input']) > .u2-input-label) + .u2-input-box {\nflex: 1 1 0;\nmin-width: 60px;\nmax-width: max-content;\n}\n.u2-input-options {\nbox-sizing: border-box;\ndisplay: flex;\nalign-items: center;\nalign-self: flex-end;\nheight: var(--dg-control-height);\nfont-size: calc(var(--dg-font-size) / 1.2);\ncolor: var(--dg-accent);\ncursor: pointer;\n}\n.u2-input-options > * {\nmargin-left: var(--dg-space-m);\n}\n.u2-input-options > .u2-btn.u2-icon-btn {\nflex-shrink: 0;\nwidth: 16px;\nmin-width: 16px;\nheight: var(--dg-control-height);\ncolor: var(--dg-accent);\nborder-radius: 0;\n}\n.u2-input-options .u2-btn .u2-icon,\n.u2-input-eye > .u2-icon {\ndisplay: flex;\nalign-items: center;\njustify-content: center;\nwidth: 16px;\nmin-width: 16px;\nheight: var(--dg-control-height);\nmargin: 0;\nfont-size: inherit;\n}\n.u2-input-box > .u2-input-editor + .u2-input-options {\nborder-bottom: var(--dg-input-border);\n}\n.u2-input-box:focus-within > .u2-input-editor + .u2-input-options {\nborder-bottom: var(--dg-input-border-focus);\n}\n.u2-input-box > .u2-input-editor.u2-invalid + .u2-input-options {\nborder-bottom: var(--dg-border-width) solid var(--dg-error);\n}\n.u2-input-root[data-u2='bool-input'] .u2-input-options,\n.u2-input-root[data-u2='radio-input'] .u2-input-options,\n.u2-input-root[data-u2='multi-choice-input'] .u2-input-options,\n.u2-input-root[data-u2='slider-input'] .u2-input-options,\n.u2-input-root[data-u2='tags-input'] .u2-input-options,\n.u2-input-root[data-u2='multi-select'] .u2-input-options {\nalign-self: center;\nborder-bottom: none;\n}\n.u2-input-root[data-u2='bool-input'] .u2-input-postfix {\npadding-left: var(--dg-space-s);\n}\n.u2-input-postfix {\noverflow: hidden;\norder: -1;\ncolor: var(--dg-text-color-light);\nline-height: normal;\nwhite-space: nowrap;\ntext-overflow: ellipsis;\n}\n.u2-input-inline {\npadding: 0;\n}\n.u2-input-inline .u2-input-editor {\nheight: var(--dg-inline-control-height);\n}\n.u2-input-disabled,\n.u2-input-disabled .u2-input-editor {\ncolor: var(--dg-text-color-light);\n}\n.u2-input-disabled input.u2-input-editor,\n.u2-input-disabled select.u2-input-editor,\n.u2-input-disabled textarea.u2-input-editor,\n.u2-input-disabled .u2-input-editor.u2-columns {\nbackground-color: color-mix(in srgb, var(--dg-grey-1) 40%, var(--dg-bg));\n}\n.u2-input-disabled > * {\npointer-events: none;\n}\n.u2-input-disabled .u2-input-switch {\nfilter: grayscale(1);\n}\n.u2-input-disabled .u2-input-options,\n.u2-input-disabled .u2-input-options > .u2-btn.u2-icon-btn {\ncolor: var(--dg-text-color-light);\n}\n.u2-input-editor.u2-input-search {\nposition: relative;\ndisplay: inline-flex;\nalign-items: center;\ngap: var(--dg-space-xs);\npadding: 0 var(--dg-space-xs);\n}\n.u2-input-search::before {\ncontent: '';\nflex-shrink: 0;\nwidth: 12px;\nheight: 12px;\nbackground-color: var(--dg-text-color-light);\n-webkit-mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='6.8' cy='6.8' r='4.6'/%3E%3Cpath d='M10.2 10.2 14 14'/%3E%3C/svg%3E\") no-repeat center / 12px;\nmask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='6.8' cy='6.8' r='4.6'/%3E%3Cpath d='M10.2 10.2 14 14'/%3E%3C/svg%3E\") no-repeat center / 12px;\n}\n.u2-input-search > input {\nflex: 1;\nmin-width: 0;\nheight: 100%;\npadding: 0 18px 0 var(--dg-space-xs);\nfont: inherit;\ncolor: inherit;\nbackground: none;\nborder: none;\noutline: none;\n}\n.u2-input-clear {\nposition: absolute;\nright: 2px;\nflex-shrink: 0;\nwidth: 16px;\nheight: 16px;\npadding: 0;\nfont-size: var(--dg-font-size-xs);\nline-height: 1;\ncolor: var(--dg-accent);\nvisibility: hidden;\nbackground: none;\nborder: none;\nborder-radius: var(--dg-radius);\ncursor: pointer;\n}\n.u2-input-root:not(.u2-input-disabled):hover .u2-input-clear,\n:not(.u2-input-disabled) > .u2-input-box:hover .u2-input-clear {\nvisibility: visible;\n}\n.u2-input-clear:hover {\ncolor: var(--dg-accent-secondary);\n}\n.u2-input-clear[hidden] {\ndisplay: none;\n}\n.u2-input-box > .u2-input-editor.u2-input-bool {\ndisplay: inline-flex;\nalign-items: center;\nflex: none;\npadding: 0 var(--dg-space-s);\n}\n.u2-input-checkbox {\nwidth: 13px;\nheight: 13px;\nmargin: 0;\nborder: none;\naccent-color: var(--dg-accent);\ncursor: pointer;\n}\n.u2-input-switch {\ndisplay: inline-flex;\nalign-items: center;\nwidth: 22px;\nheight: 4px;\nborder: var(--dg-border-width) solid var(--dg-border);\nborder-radius: 9px;\noutline: none;\ncursor: pointer;\n}\n.u2-input-switch:hover {\nborder-color: var(--dg-grey-3);\n}\n.u2-input-switch:focus-visible {\noutline: var(--dg-focus-ring);\noutline-offset: var(--dg-space-s);\n}\n.u2-input-switch-thumb {\nposition: relative;\nleft: -4px;\nwidth: 12px;\nheight: 12px;\nmargin: 2px;\nbackground: var(--dg-grey-2);\nborder: var(--dg-border-width) solid var(--dg-grey-2);\nborder-radius: 50%;\ntransition: left 0.2s;\n}\n.u2-input-switch:hover .u2-input-switch-thumb {\nborder-color: var(--dg-grey-3);\n}\n.u2-input-switch-on {\nbackground: var(--dg-steel-2);\nborder-color: var(--dg-steel-2);\n}\n.u2-input-switch-on .u2-input-switch-thumb {\nleft: 8px;\nbackground: var(--dg-accent);\nborder-color: var(--dg-accent);\n}\n.u2-input-editor.u2-list {\nposition: static;\ndisplay: inline-flex;\nalign-items: flex-start;\nheight: auto;\npadding: 0;\noverflow: visible;\nborder: none;\nborder-bottom: var(--dg-input-border);\n}\n.u2-input-editor.u2-list:focus-within {\nborder-bottom: var(--dg-input-border-focus);\n}\n.u2-list-text {\nflex: 1 1 auto;\nmin-width: 0;\nheight: var(--dg-control-height);\npadding: 0 var(--dg-space-s);\nfont: inherit;\ncolor: inherit;\ntext-overflow: ellipsis;\nbackground: none;\nborder: none;\noutline: none;\n}\n.u2-list-text[hidden] {\ndisplay: none;\n}\ntextarea.u2-list-area {\nmin-height: calc(var(--dg-control-height) * 3);\npadding: var(--dg-space-xs);\nline-height: var(--dg-line-height);\nresize: vertical;\n}\n.u2-input-editor.u2-map {\ndisplay: flex;\nflex: 1;\nflex-direction: column;\nmin-width: 0;\nheight: auto;\npadding: 0;\n}\n.u2-input-root:not(.u2-input-inline)[data-u2='map-input'] > .u2-input-box {\nflex: 1 1 0;\nmin-width: var(--dg-form-min-editor-width);\nmax-width: none;\n}\n.u2-input-root:not(.u2-input-inline)[data-u2='map-input'] .u2-map-key,\n.u2-input-root:not(.u2-input-inline)[data-u2='map-input'] .u2-map-value {\nwidth: 0;\n}\n.u2-map-row {\ndisplay: flex;\nalign-items: center;\nheight: var(--dg-control-height);\ngap: var(--dg-space-m);\n}\n.u2-map-actions {\ndisplay: flex;\nalign-items: center;\nflex-shrink: 0;\n}\n.u2-map-key,\n.u2-map-value {\nbox-sizing: border-box;\nflex: 1 1 0;\nmin-width: 0;\nheight: var(--dg-control-height);\npadding: 0 var(--dg-space-s);\nfont: inherit;\ncolor: inherit;\nbackground: none;\nborder: none;\nborder-bottom: var(--dg-input-border);\noutline: none;\n}\n.u2-map-key:focus,\n.u2-map-value:focus {\nborder-bottom: var(--dg-input-border-focus);\n}\n.u2-map-key.u2-invalid {\nborder-bottom: var(--dg-border-width) solid var(--dg-error);\n}\n.u2-map-btn {\ndisplay: inline-flex;\nalign-items: center;\njustify-content: center;\nflex-shrink: 0;\nheight: var(--dg-control-height);\npadding: 0 var(--dg-space-m);\nfont-size: var(--dg-font-size);\nline-height: 1;\ncolor: var(--dg-accent);\nbackground: none;\nborder: none;\nborder-radius: var(--dg-radius);\ncursor: pointer;\n}\n.u2-map-btn > .u2-icon {\nmin-width: 16px;\n}\n.u2-map-btn:hover {\nbackground: var(--dg-hover-subtle);\n}\n.u2-input-editor.u2-dynamic {\ndisplay: flex;\nalign-items: center;\nheight: auto;\nmin-height: var(--dg-control-height);\npadding: 0 var(--dg-space-s);\n}\n.u2-input-null {\ncolor: var(--dg-text-color-light);\n}\n.u2-input-editor.u2-input-password {\nposition: relative;\ndisplay: inline-flex;\nalign-items: center;\npadding: 0;\nborder-bottom: var(--dg-input-border);\n}\n.u2-input-editor.u2-input-password:focus-within {\nborder-bottom: var(--dg-input-border-focus);\n}\n.u2-input-password > input {\nflex: 1;\nmin-width: 0;\nheight: 100%;\npadding: 0 calc(18px + var(--dg-space-xs)) 0 var(--dg-space-s);\nfont: inherit;\ncolor: inherit;\nbackground: none;\nborder: none;\noutline: none;\n}\n.u2-input-eye {\nposition: absolute;\nright: 2px;\ndisplay: flex;\nalign-items: center;\njustify-content: center;\nflex-shrink: 0;\nwidth: 16px;\nheight: var(--dg-control-height);\npadding: 0;\ncolor: var(--dg-text-color);\nbackground: none;\nborder: none;\ncursor: pointer;\n}\n.u2-input-measure {\nposition: absolute;\nvisibility: hidden;\nfont: inherit;\nwhite-space: pre;\n}\n.u2-input-root[data-u2='image-input'] > .u2-input-box {\nflex: 1 1 0;\nmin-width: 0;\n}\n.u2-input-editor.u2-image {\nposition: relative;\ndisplay: inline-flex;\nalign-items: center;\nmax-width: 100%;\nheight: auto;\npadding: 0;\n}\n.u2-form-wide .u2-input-root[data-u2='image-input'] .u2-input-editor.u2-image {\nflex: 0 1 auto;\n}\n.u2-image-preview {\nwidth: 300px;\nmax-width: 100%;\nheight: auto;\naspect-ratio: 3 / 2;\n}\n.u2-image-preview[hidden] {\ndisplay: none;\n}\n.u2-input-disabled .u2-image-preview {\nopacity: 0.5;\n}\n.u2-image-remove {\nposition: absolute;\ntop: 10px;\nright: 10px;\npadding: 0;\nfont-family: var(--dg-font-family);\nfont-size: var(--dg-font-size);\ncolor: var(--dg-accent);\nvisibility: hidden;\nbackground: none;\nborder: none;\ncursor: pointer;\n}\n.u2-image:hover .u2-image-remove {\nvisibility: visible;\n}\n.u2-image-remove:hover {\ntext-decoration: underline;\n}\n.u2-image-remove[hidden] {\ndisplay: none;\n}\n.u2-column-row {\ndisplay: flex;\nalign-items: center;\ngap: var(--dg-space-s);\nmin-width: 0;\n}\n.u2-column-glyph {\nflex-shrink: 0;\ncolor: var(--dg-text-color-light);\n}\n.u2-column-name {\noverflow: hidden;\nwhite-space: nowrap;\ntext-overflow: ellipsis;\n}\n.u2-column-semtype {\nmargin-left: auto;\npadding-left: var(--dg-space-m);\nfont-size: var(--dg-font-size-small);\ncolor: var(--dg-text-color-light);\n}\n.u2-input-editor.u2-columns {\ndisplay: flex;\nalign-items: center;\ngap: var(--dg-space-s);\nmin-width: 100px;\nborder-bottom: var(--dg-input-border);\ncursor: pointer;\n}\n.u2-input-editor.u2-columns:focus {\nborder-bottom: var(--dg-input-border-focus);\n}\n.u2-columns-summary {\noverflow: hidden;\nwhite-space: nowrap;\ntext-overflow: ellipsis;\n}\n.u2-columns-chevron {\nflex-shrink: 0;\nalign-self: stretch;\nwidth: 16px;\nheight: auto;\nmargin: 0 calc(-1 * var(--dg-space-s)) 0 auto;\nborder: none;\nbackground-image:\nlinear-gradient(to top right, transparent calc(50% - 0.8px), currentColor calc(50% - 0.8px),\ncurrentColor calc(50% + 0.8px), transparent calc(50% + 0.8px)),\nlinear-gradient(to bottom right, transparent calc(50% - 0.8px), currentColor calc(50% - 0.8px),\ncurrentColor calc(50% + 0.8px), transparent calc(50% + 0.8px));\nbackground-repeat: no-repeat;\nbackground-position: right 8px top 55%, right 3.5px top 55%;\nbackground-size: 4.5px 4.5px, 4.5px 4.5px;\n}\n.u2-input-editor.u2-columns[aria-disabled='true'] {\ncursor: default;\n}\n.u2-columns[aria-disabled='true'] .u2-columns-summary,\n.u2-columns[aria-disabled='true'] .u2-columns-chevron {\ncolor: var(--dg-text-color-disabled);\n}\n.u2-columns.u2-invalid .u2-columns-summary,\n.u2-columns.u2-invalid .u2-columns-chevron {\ncolor: var(--dg-error);\n}\n.u2-columns-popup {\nbox-sizing: border-box;\npadding: var(--dg-space-xs) var(--dg-space-m);\noverflow: hidden;\nfont-family: var(--dg-font-family);\nfont-size: var(--dg-font-size);\nline-height: var(--dg-line-height);\ncolor: var(--dg-text-color);\nbackground: var(--dg-bg);\nborder: var(--dg-overlay-border);\nborder-radius: var(--dg-radius-l);\nbox-shadow: var(--dg-shadow-2);\n}\n.u2-columns-buttons {\nflex-shrink: 0;\njustify-content: flex-end;\ngap: var(--dg-space-s);\npadding-top: var(--dg-space-xs);\n}\n.u2-columns-popup > .d4-column-grid {\nflex: 0 1 auto;\nmin-height: 0;\noverflow: hidden;\n}\n.u2-columns-actions {\ndisplay: flex;\nalign-items: center;\ngap: var(--dg-space-m);\npadding: var(--dg-space-xs) 0;\n}\n.u2-columns-count {\nmargin-left: auto;\ncolor: var(--dg-text-color-light);\nfont-size: var(--dg-font-size-small);\n}\n.u2-columns-list {\nflex: 0 1 auto;\nmin-width: 240px;\nmin-height: 0;\nheight: 192px;\n}\n.u2-columns-option {\npadding: 0 var(--dg-space-s);\n}\n.u2-list-row.u2-columns-picked {\nbackground: var(--dg-selection-bg);\ncolor: var(--dg-selection-text);\n}\n.u2-column-combo-host {\noverflow: hidden;\nbackground: var(--dg-bg);\nborder: var(--dg-overlay-border);\nborder-radius: var(--dg-radius-l);\nbox-shadow: var(--dg-shadow-2);\n}\n.u2-column-combo-none {\nflex: 1;\nmin-height: 100%;\n}\n.u2-input-editor.u2-columns-map,\n.u2-input-editor.u2-aggregations {\ndisplay: flex;\nflex-direction: column;\ngap: var(--dg-space-xs);\nheight: auto;\npadding: 0 var(--dg-space-s);\n}\n.u2-columns-map > .u2-input-root:first-child {\npadding-top: 0;\n}\n.u2-input-editor.u2-columns-map .u2-input-label {\nmin-width: 0;\n}\n.u2-aggregations-row {\ndisplay: flex;\nflex-wrap: wrap;\nalign-items: center;\ngap: var(--dg-space-s);\n}\n.u2-aggregations-row > .u2-input-root {\nflex: 1 1 96px;\nmin-width: 0;\n}\n.u2-aggregations-row > .u2-input-root:nth-child(2) {\nflex: 0 0 72px;\n}\n.u2-property-editor {\ndisplay: flex;\nflex-direction: column;\ngap: var(--dg-space-s);\n}\n.u2-property-editor-typed:has(.u2-input-root) {\npadding-top: var(--dg-space-s);\nborder-top: var(--dg-border-width) solid var(--dg-border-subtle);\n}\n.u2-input-root[hidden] {\ndisplay: none;\n}\n.u2-suggest-popup {\nbox-sizing: border-box;\noverflow-y: auto;\npadding: var(--dg-space-xs) 0;\nfont-family: var(--dg-font-family);\nfont-size: var(--dg-font-size);\nline-height: var(--dg-line-height);\ncolor: var(--dg-text-color);\nbackground: var(--dg-bg);\nborder: var(--dg-overlay-border);\nborder-radius: var(--dg-radius-l);\nbox-shadow: var(--dg-shadow-2);\n}\n.u2-suggest-option {\npadding: var(--dg-space-xs) var(--dg-space-m);\ncursor: pointer;\n}\n.u2-suggest-option:hover {\nbackground: var(--dg-hover-subtle);\n}\n.u2-suggest-option-active {\nbackground: var(--dg-selection-bg);\n}\n.u2-suggest-option-current {\nfont-weight: var(--dg-font-weight-bold);\n}\n.u2-suggest-loading,\n.u2-suggest-empty,\n.u2-suggest-error,\n.u2-suggest-hint {\ndisplay: flex;\nalign-items: center;\ngap: var(--dg-space-m);\npadding: var(--dg-space-xs) var(--dg-space-m);\ncolor: var(--dg-text-color-light);\n}\n.u2-suggest-footer {\nposition: sticky;\nbottom: 0;\npadding: var(--dg-space-xs) var(--dg-space-m);\nfont-size: var(--dg-font-size-small);\ncolor: var(--dg-text-color-light);\nbackground: var(--dg-bg);\nborder-top: var(--dg-border-width) solid var(--dg-border-subtle);\n}\n.u2-suggest-footer[hidden] {\ndisplay: none;\n}\n.u2-suggest-retry {\nheight: var(--dg-inline-control-height);\npadding: 0 var(--dg-space-m);\nfont-family: var(--dg-font-family);\nfont-size: var(--dg-font-size-small);\ncolor: var(--dg-text-color);\nbackground: var(--dg-bg-secondary);\nborder: var(--dg-border-width) solid var(--dg-border);\nborder-radius: var(--dg-radius);\ncursor: pointer;\n}\n.u2-suggest-retry:hover {\nbackground: var(--dg-hover);\n}\n.u2-quiet {\n--dg-input-border: var(--dg-border-width) solid transparent;\n}\n.u2-quiet :is(.u2-input-editor, .u2-map-key, .u2-map-value) {\nbackground-color: transparent;\n}\n.u2-quiet :is(input.u2-input-editor, .u2-map-key, .u2-map-value):not(:focus) {\ntext-overflow: ellipsis;\n}\n.u2-quiet .u2-input-root:not([data-u2='map-input']):hover,\n.u2-quiet .u2-input-root.u2-input-empty,\n.u2-quiet .u2-map-row:hover,\n.u2-quiet :is(input, textarea):placeholder-shown {\n--dg-input-border: var(--dg-border-width) solid var(--dg-border);\n}\n.u2-quiet .u2-map-row:not(:hover):not(:focus-within):not(:last-child) > .u2-map-actions {\nvisibility: hidden;\n}\n.u2-input-editor.u2-number {\nposition: relative;\ndisplay: flex;\nflex-direction: column;\nwidth: 140px;\nmax-width: 150px;\nmin-width: 0;\npadding: 0;\n}\n.u2-input-editor.u2-number,\n.u2-input-editor.u2-number.u2-invalid {\nborder-bottom: none;\n}\n.u2-number-box {\nposition: relative;\ndisplay: inline-flex;\nalign-items: center;\nheight: 100%;\nborder-bottom: var(--dg-input-border);\n}\n.u2-number-box:focus-within {\nborder-bottom: var(--dg-input-border-focus);\n}\n.u2-number.u2-invalid .u2-number-box,\n.u2-number.u2-invalid .u2-number-box:focus-within {\nborder-bottom: var(--dg-border-width) solid var(--dg-error);\n}\n.u2-number-box > input {\nflex: 1;\nmin-width: 0;\nheight: 100%;\npadding: 0 var(--dg-space-s);\nfont: inherit;\ncolor: inherit;\nbackground: none;\nborder: none;\noutline: none;\n}\n.u2-number-box > input::placeholder {\ncolor: var(--dg-text-color-light);\n}\n.u2-number-box:has(> .u2-number-spinner) > input {\npadding-right: var(--dg-space-xl);\n}\n.u2-number-spinner {\nposition: absolute;\ntop: 0;\nright: var(--dg-space-xs);\nbottom: 0;\ndisplay: flex;\nflex-direction: column;\njustify-content: center;\nvisibility: hidden;\n}\n.u2-number-box:hover .u2-number-spinner,\n.u2-number-box:focus-within .u2-number-spinner {\nvisibility: visible;\n}\n.u2-number-spin {\ndisplay: block;\nwidth: 12px;\nheight: 9px;\npadding: 0;\nfont-size: var(--dg-font-size-xs);\nline-height: 9px;\ncolor: var(--dg-text-color-light);\nbackground: none;\nborder: none;\nborder-radius: var(--dg-radius);\ncursor: pointer;\n}\n.u2-number-spin:hover {\ncolor: var(--dg-accent);\nbackground: var(--dg-hover-subtle);\n}\n.u2-number-click > .u2-icon {\nwidth: 100%;\nmin-width: 100%;\nheight: 100%;\nmargin: 0;\nfont-size: inherit;\n}\n.u2-number-click {\nflex-shrink: 0;\ndisplay: flex;\nalign-items: center;\njustify-content: center;\norder: -2;\nwidth: 20px;\nheight: 20px;\npadding: 0;\nfont-size: var(--dg-font-size-small);\nline-height: 1;\ncolor: var(--dg-accent);\nvisibility: hidden;\nbackground: none;\nborder: none;\nborder-radius: 2px;\ncursor: pointer;\n}\n.u2-number-click:hover {\nbackground: var(--dg-selection-bg);\n}\n.u2-number-click:active {\nfilter: brightness(90%) contrast(90%);\n}\n.u2-input-box:has(> .u2-input-editor.u2-number > .u2-number-slider) {\npadding-bottom: 9px;\n}\n.u2-number-slider {\nposition: absolute;\nright: 0;\nbottom: -9px;\nwidth: 100%;\nheight: 18px;\nmargin: 0;\nz-index: 2;\nvisibility: hidden;\naccent-color: var(--dg-accent);\noutline: none;\ncursor: pointer;\n}\n.u2-input-root:not(.u2-input-disabled):hover .u2-number-slider,\n.u2-input-root:not(.u2-input-disabled):hover .u2-number-click,\n:not(.u2-input-disabled) > .u2-input-box:hover .u2-number-slider,\n:not(.u2-input-disabled) > .u2-input-box:hover .u2-number-click {\nvisibility: visible;\n}\n.u2-number-slider:focus-visible {\noutline: var(--dg-focus-ring);\noutline-offset: var(--dg-space-s);\n}\n.u2-input-editor.u2-slider {\ndisplay: inline-flex;\nalign-items: center;\nmax-width: 300px;\npadding: 0;\nborder: none;\n}\n.u2-slider-track {\nflex: 1;\nmin-width: 0;\nheight: var(--dg-space-s);\nmargin: 0;\npadding: 0;\naccent-color: var(--dg-accent);\nbackground: var(--dg-border);\nborder: none;\nborder-radius: var(--dg-radius);\noutline: none;\ncursor: pointer;\n}\n.u2-slider-track:focus-visible {\noutline: var(--dg-focus-ring);\noutline-offset: var(--dg-space-s);\n}\n.u2-range-slider {\nposition: relative;\nwidth: calc(100% - 12px);\nmin-width: 60px;\nheight: 16px;\nmargin: 0 6px;\ntouch-action: none;\ncursor: pointer;\n}\n.u2-range-slider-vertical {\nwidth: 16px;\nheight: calc(100% - 12px);\nmin-height: 60px;\nmargin: 6px 0;\n}\n.u2-range-track {\nposition: absolute;\nleft: 0;\nright: 0;\ntop: 50%;\nheight: var(--dg-space-s);\ntransform: translateY(-50%);\nbackground: var(--dg-border);\nborder-radius: var(--dg-radius);\n}\n.u2-range-band {\nposition: absolute;\ntop: 50%;\nheight: var(--dg-space-s);\ntransform: translateY(-50%);\nbackground: var(--dg-accent);\nborder-radius: var(--dg-radius);\ncursor: grab;\n}\n.u2-range-handle {\nposition: absolute;\ntop: 50%;\nwidth: 12px;\nheight: 12px;\ntransform: translate(-50%, -50%);\nbackground: var(--dg-white);\nborder: var(--dg-border-width) solid var(--dg-accent);\nborder-radius: 50%;\nbox-shadow: var(--dg-shadow-1);\ncursor: ew-resize;\n}\n.u2-range-handle:focus-visible {\noutline: var(--dg-focus-ring);\noutline-offset: var(--dg-space-xs);\n}\n.u2-range-slider-vertical .u2-range-track {\nleft: 50%;\nright: auto;\ntop: 0;\nbottom: 0;\nheight: auto;\nwidth: var(--dg-space-s);\ntransform: translateX(-50%);\n}\n.u2-range-slider-vertical .u2-range-band {\nleft: 50%;\ntop: auto;\nheight: auto;\nwidth: var(--dg-space-s);\ntransform: translateX(-50%);\n}\n.u2-range-slider-vertical .u2-range-handle {\nleft: 50%;\ntop: auto;\ntransform: translate(-50%, 50%);\ncursor: ns-resize;\n}\n.u2-input-editor.u2-radio {\ndisplay: inline-flex;\nflex-direction: column;\nalign-items: flex-start;\nheight: auto;\nmin-height: var(--dg-control-height);\npadding: 0;\n}\n.u2-radio-item {\ndisplay: inline-flex;\nalign-items: center;\nheight: 20px;\nmargin-right: var(--dg-space-m);\ncursor: pointer;\n}\n.u2-radio-item > .u2-input-radio {\nmargin: 0 var(--dg-space-m) 0 var(--dg-space-s);\n}\n.u2-input-radio {\nwidth: 13px;\nheight: 13px;\nmargin: 0;\nborder: none;\naccent-color: var(--dg-accent);\ncursor: pointer;\n}\n.u2-radio-buttons,\n.u2-input-editor.u2-radio.u2-radio-buttons {\nflex-direction: row;\nalign-items: center;\npadding: var(--dg-space-xs) 0;\n}\n.u2-radio-buttons .u2-radio-item {\nheight: var(--dg-button-height);\nmargin: 0 var(--dg-space-s);\npadding: 0 var(--dg-space-m);\ncolor: var(--dg-accent-secondary);\nbackground: var(--dg-bg-secondary);\nborder: var(--dg-border-width) solid var(--dg-border);\nborder-radius: var(--dg-radius);\n}\n.u2-radio-buttons .u2-radio-item:hover {\nbackground: var(--dg-hover);\n}\n.u2-radio-buttons .u2-input-radio {\nposition: absolute;\nwidth: 1px;\nheight: 1px;\nmargin: -1px;\noverflow: hidden;\nclip-path: inset(50%);\n}\n.u2-radio-buttons .u2-radio-pressed {\ncolor: var(--dg-white);\nbackground: var(--dg-accent);\nborder-color: var(--dg-accent);\n}\n.u2-radio-buttons .u2-radio-item:focus-within {\noutline: var(--dg-focus-ring);\noutline-offset: var(--dg-space-xs);\n}\ninput.u2-input-editor.u2-color-text {\nwidth: 100px;\nmax-width: 100px;\nmin-width: 0;\npadding: 0 var(--dg-space-s);\nmargin-right: -18px;\ntext-transform: lowercase;\n}\n.u2-color-text[hidden] {\ndisplay: none;\n}\n.u2-input-options > .u2-color-box {\nmargin-left: 0;\n}\n.u2-color-box {\nposition: relative;\ndisplay: inline-flex;\nalign-items: center;\njustify-content: center;\nmin-width: 18px;\n}\n.u2-color-swatch {\nbox-sizing: content-box;\nflex-shrink: 0;\nwidth: 12px;\nheight: 12px;\npadding: 0;\ncolor: inherit;\nborder: var(--dg-border-width) solid var(--dg-grey-2);\nborder-radius: 0;\ncursor: pointer;\n}\n.u2-color-swatch:hover {\nborder-color: var(--dg-grey-3);\n}\n.u2-color-swatch:focus-visible {\noutline: var(--dg-focus-ring);\noutline-offset: var(--dg-space-xs);\n}\n.u2-color-picker {\nposition: absolute;\nright: 0;\nwidth: 14px;\nheight: 14px;\npadding: 0;\nborder: none;\nopacity: 0;\npointer-events: none;\n}\n.u2-color-box-only .u2-input-box > .u2-input-editor + .u2-input-options {\nmargin-left: var(--dg-space-s);\nborder-bottom: none;\n}\n.u2-color-box-only .u2-color-swatch {\nwidth: 24px;\nheight: 18px;\n}\n.u2-input-editor.u2-date {\nposition: relative;\ndisplay: inline-flex;\nalign-items: center;\nwidth: 140px;\nmax-width: 140px;\nmin-width: 0;\npadding: 0;\n}\n.u2-input-editor.u2-date:not(.u2-invalid) {\nborder-bottom: var(--dg-input-border);\n}\n.u2-input-editor.u2-date:not(.u2-invalid):focus-within,\n.u2-input-editor.u2-date:not(.u2-invalid).u2-date-open {\nborder-bottom: var(--dg-input-border-focus);\n}\n.u2-date > input {\nflex: 1;\nmin-width: 110px;\nheight: 100%;\npadding: 0 var(--dg-space-s);\nfont: inherit;\ncolor: inherit;\nbackground: none;\nborder: none;\noutline: none;\n}\n.u2-date > input::placeholder {\ncolor: var(--dg-text-color-light);\n}\n.u2-input-root[data-u2='date-input'] .u2-input-box > .u2-input-editor + .u2-input-options,\n.u2-input-root[data-u2='datetime-input'] .u2-input-box > .u2-input-editor + .u2-input-options {\nalign-self: flex-start;\nborder-bottom: none;\n}\n.u2-date-popup {\nbox-sizing: border-box;\ndisplay: flex;\nflex-direction: column;\npadding: var(--dg-space-s);\nfont-family: var(--dg-font-family);\nfont-size: var(--dg-font-size);\nline-height: var(--dg-line-height);\ncolor: var(--dg-text-color);\nbackground: var(--dg-bg);\nborder: var(--dg-overlay-border);\nborder-radius: var(--dg-radius-l);\noutline: none;\nbox-shadow: var(--dg-shadow-2);\n}\n.u2-date-header {\ndisplay: flex;\nalign-items: center;\ngap: var(--dg-space-xs);\npadding-bottom: var(--dg-space-s);\n}\n.u2-date-title {\nflex: 1;\ntext-align: center;\nwhite-space: nowrap;\nfont-weight: var(--dg-font-weight-medium);\n}\n.u2-date-header .u2-btn:not(.u2-icon-btn) {\nheight: var(--dg-inline-control-height);\npadding: 0 var(--dg-space-m);\n}\n.u2-date-weekdays,\n.u2-date-week {\ndisplay: flex;\n}\n.u2-date-weekday {\ndisplay: flex;\nalign-items: center;\njustify-content: center;\nwidth: var(--dg-inline-control-height);\nheight: var(--dg-inline-control-height);\nfont-size: var(--dg-font-size-xs);\ncolor: var(--dg-text-color-light);\n}\n.u2-date-day {\nbox-sizing: border-box;\ndisplay: flex;\nalign-items: center;\njustify-content: center;\nwidth: var(--dg-inline-control-height);\nheight: var(--dg-inline-control-height);\nborder: var(--dg-border-width) solid transparent;\nborder-radius: var(--dg-radius);\noutline: none;\ncursor: pointer;\n}\n.u2-date-day:hover {\nbackground: var(--dg-hover-subtle);\n}\n.u2-date-day:focus-visible {\nborder-color: var(--dg-focus);\n}\n.u2-date-adjacent {\ncolor: var(--dg-text-color-disabled);\n}\n.u2-date-today {\nborder-color: var(--dg-accent);\n}\n.u2-date-selected {\ncolor: var(--dg-selection-text);\nbackground: var(--dg-selection-bg);\nfont-weight: var(--dg-font-weight-medium);\n}\n.u2-date-day-disabled,\n.u2-date-day-disabled:hover {\ncolor: var(--dg-text-color-disabled);\nbackground: none;\ncursor: default;\n}\n.u2-date-time {\ndisplay: flex;\nalign-items: center;\ngap: var(--dg-space-xs);\nmargin-top: var(--dg-space-s);\npadding-top: var(--dg-space-s);\nborder-top: var(--dg-border-width) solid var(--dg-border-subtle);\n}\n.u2-date-time-label {\nflex: 1;\ncolor: var(--dg-text-color-light);\n}\n.u2-date-time-sep {\ncolor: var(--dg-text-color-light);\n}\n.u2-date-time-seg {\nbox-sizing: border-box;\nwidth: 26px;\nheight: var(--dg-inline-control-height);\npadding: 0;\nfont-family: inherit;\nfont-size: inherit;\ntext-align: center;\ncolor: var(--dg-text-color);\nbackground: var(--dg-bg);\nborder: none;\nborder-bottom: var(--dg-input-border);\nborder-radius: 0;\noutline: none;\n}\n.u2-date-time-seg:focus {\nborder-bottom: var(--dg-input-border-focus);\n}\n.u2-input-editor.u2-font {\ndisplay: inline-flex;\nalign-items: center;\npadding: 0;\nfont-size: 11px;\n}\n.u2-font-size {\nbox-sizing: border-box;\nwidth: 27px;\nheight: 16px;\npadding: 0 3px;\nfont-family: inherit;\nfont-size: inherit;\ncolor: inherit;\nline-height: 14px;\ntext-align: left;\nbackground: var(--dg-bg);\nborder: var(--dg-border-width) solid transparent;\nborder-radius: 2px;\noutline: none;\n}\n.u2-font-size:focus {\nborder-color: var(--dg-steel-4);\n}\n.u2-font-step {\ndisplay: inline-flex;\nalign-items: center;\njustify-content: center;\nflex-shrink: 0;\nwidth: 16px;\nheight: 16px;\nmargin-left: var(--dg-space-xs);\npadding: 0;\nfont-size: inherit;\ncolor: var(--dg-accent);\nbackground: none;\nborder: none;\nborder-radius: 2px;\ncursor: pointer;\n}\n.u2-font-step > .u2-icon {\ndisplay: flex;\nalign-items: center;\njustify-content: center;\nwidth: 16px;\nmin-width: 16px;\nheight: 16px;\nmargin: 0;\nfont-size: inherit;\n}\n.u2-font-step:hover {\nbackground: var(--dg-steel-1);\n}\n.u2-font-family {\nbox-sizing: border-box;\nwidth: 80px;\nmin-width: 0;\nheight: 18px;\nmargin-left: var(--dg-space-s);\npadding: 0 12px 0 3px;\nfont-family: inherit;\nfont-size: inherit;\ncolor: inherit;\noverflow: hidden;\nwhite-space: nowrap;\ntext-overflow: ellipsis;\n-webkit-appearance: none;\n-moz-appearance: none;\nappearance: none;\nbackground-color: var(--dg-bg);\nbackground-image:\nlinear-gradient(45deg, transparent 50%, var(--dg-steel-5) 50%),\nlinear-gradient(135deg, var(--dg-steel-5) 50%, transparent 50%);\nbackground-repeat: no-repeat;\nbackground-position: right 6px center, right 2px center;\nbackground-size: 4px 4px, 4px 4px;\nborder: var(--dg-border-width) solid transparent;\nborder-radius: 2px;\noutline: none;\n}\n.u2-font-family:focus {\nborder-color: var(--dg-steel-4);\n}\n.u2-font-toggle {\nflex-shrink: 0;\nwidth: 14px;\nheight: 14px;\nmargin-left: var(--dg-space-s);\npadding: 0;\nfont-family: var(--dg-font-family);\nfont-size: var(--dg-font-size);\nline-height: 14px;\ncolor: var(--dg-text-color);\nbackground: none;\nborder: var(--dg-border-width) solid transparent;\nborder-radius: 2px;\ncursor: pointer;\n}\n.u2-font-bold {\nfont-weight: var(--dg-font-weight-bold);\n}\n.u2-font-italic {\nfont-family: 'Times New Roman', Georgia, serif;\nfont-weight: 600;\nfont-style: italic;\n}\n.u2-font-toggle:hover:not(.u2-font-toggle-active) {\nbackground: var(--dg-grey-1);\nborder-color: var(--dg-steel-4);\n}\n.u2-font-toggle-active {\nbackground: var(--dg-grey-2);\nborder-color: var(--dg-grey-2);\nbox-shadow: var(--dg-shadow-1);\n}\n.u2-font-toggle:focus-visible {\noutline: var(--dg-focus-ring);\noutline-offset: var(--dg-space-xs);\n}\n.u2-font-sizes {\nbox-sizing: border-box;\noverflow-y: auto;\npadding: var(--dg-space-xs) 0;\nfont-family: var(--dg-font-family);\nfont-size: var(--dg-font-size);\nline-height: var(--dg-line-height);\ncolor: var(--dg-text-color);\ntext-align: right;\nbackground: var(--dg-bg);\nborder: var(--dg-overlay-border);\nborder-radius: var(--dg-radius-l);\nbox-shadow: var(--dg-shadow-2);\n}\n.u2-font-size-option {\npadding: var(--dg-space-xs) var(--dg-space-m);\ncursor: pointer;\n}\n.u2-font-size-option:hover {\nbackground: var(--dg-hover-subtle);\n}\n.u2-input-editor.u2-tags {\ndisplay: flex;\nflex-wrap: wrap;\nalign-items: center;\ngap: var(--dg-space-s);\nheight: auto;\nmin-height: var(--dg-control-height);\npadding: var(--dg-space-xs) var(--dg-space-s);\nborder-bottom: var(--dg-input-border);\ncursor: text;\n}\n.u2-input-editor.u2-tags:focus-within {\nborder-bottom: var(--dg-input-border-focus);\n}\n.u2-tags-chips {\ndisplay: flex;\nflex-wrap: wrap;\ngap: var(--dg-space-s);\n}\n.u2-tags-chips:empty {\ndisplay: none;\n}\n.u2-tags-input {\nflex: 1;\nmin-width: 80px;\nheight: var(--dg-inline-control-height);\npadding: 0 var(--dg-space-xs);\nfont: inherit;\ncolor: inherit;\nbackground: none;\nborder: none;\noutline: none;\n}\n.u2-tags-input::placeholder {\ncolor: var(--dg-text-color-light);\n}\n.u2-tags-option-active .u2-tags-text {\ncolor: var(--dg-accent);\n}\n.u2-tags-text {\noverflow: hidden;\nwhite-space: nowrap;\ntext-overflow: ellipsis;\n}\n.u2-input-editor.u2-chips {\ndisplay: flex;\nflex-wrap: wrap;\ngap: var(--dg-space-s);\nmin-height: var(--dg-control-height);\nalign-items: center;\n}\n.u2-chips-chip {\ndisplay: inline-flex;\nbox-sizing: border-box;\nalign-items: center;\nheight: var(--dg-inline-control-height);\npadding: 0 var(--dg-space-m);\nfont-family: var(--dg-font-family);\nfont-size: var(--dg-font-size-small);\nline-height: 1;\ncolor: var(--dg-text-color);\nwhite-space: nowrap;\nbackground: var(--dg-bg-secondary);\nborder: var(--dg-border-width) solid var(--dg-border);\nborder-radius: 11px;\ncursor: pointer;\n}\n.u2-chips-chip:hover {\nbackground: var(--dg-hover);\n}\n.u2-chips-chip:focus-visible {\noutline: var(--dg-focus-ring);\noutline-offset: 1px;\n}\n.u2-chips-chip-on {\ncolor: var(--dg-white);\nbackground: var(--dg-accent);\nborder-color: var(--dg-accent);\n}\n.u2-chips-chip-on:hover {\nbackground: var(--dg-accent);\n}\n.u2-chips-chip:disabled {\ncolor: var(--dg-text-color-disabled);\ncursor: default;\n}\n.u2-chips-empty {\ncolor: var(--dg-text-color-light);\nfont-size: var(--dg-font-size-small);\n}\nselect.u2-input-editor {\n-webkit-appearance: none;\n-moz-appearance: none;\nappearance: none;\nwidth: 200px;\nmin-width: 0;\npadding: 0 20px 0 0;\nborder-bottom: var(--dg-input-border);\ncursor: pointer;\nbackground-image:\nlinear-gradient(to top right, transparent calc(50% - 0.8px), var(--dg-text-color) calc(50% - 0.8px),\nvar(--dg-text-color) calc(50% + 0.8px), transparent calc(50% + 0.8px)),\nlinear-gradient(to bottom right, transparent calc(50% - 0.8px), var(--dg-text-color) calc(50% - 0.8px),\nvar(--dg-text-color) calc(50% + 0.8px), transparent calc(50% + 0.8px));\nbackground-repeat: no-repeat;\nbackground-position: right 8px top 55%, right 3.5px top 55%;\nbackground-size: 4.5px 4.5px, 4.5px 4.5px;\n}\n.u2-form select.u2-input-editor,\n.u2-dialog-content > .u2-input-root select.u2-input-editor {\npadding-left: var(--dg-space-s);\n}\n:where([data-u2='choice-input'] > .u2-input-box) > select.u2-input-editor {\nwidth: var(--u2-choice-width, 200px);\n}\nselect.u2-input-editor:focus {\nborder-bottom: var(--dg-input-border-focus);\n}\nselect.u2-input-editor.u2-invalid,\nselect.u2-input-editor.u2-invalid:focus {\nborder-bottom: var(--dg-border-width) solid var(--dg-error);\n}\n.u2-input-disabled select.u2-input-editor,\n.u2-input-readonly select.u2-input-editor {\nbackground-image: none;\ncursor: default;\n}\ndiv.u2-input-editor.u2-multi-choice {\ndisplay: flex;\nflex-direction: column;\nmin-width: 150px;\nheight: auto;\npadding: var(--dg-space-s) 0;\nborder: none;\n}\n.u2-multi-choice-item {\ndisplay: flex;\nalign-items: center;\nheight: 20px;\npadding: 0;\nwhite-space: nowrap;\ncursor: pointer;\n}\n.u2-multi-choice-item > .u2-input-checkbox,\n.u2-multi-choice-summary > .u2-input-checkbox {\nmargin: 0 var(--dg-space-m) 0 var(--dg-space-s);\n}\n.u2-multi-choice-summary {\ndisplay: flex;\nalign-items: center;\nheight: 20px;\nwhite-space: nowrap;\n}\n.u2-multi-choice-summary:hover {\nbackground: var(--dg-hover-subtle);\n}\n.u2-multi-choice-summary-toggle {\ndisplay: flex;\nalign-items: center;\ngap: var(--dg-space-s);\ncursor: pointer;\nuser-select: none;\n}\n.u2-multi-choice-summary-toggle:focus-visible {\noutline: var(--dg-focus-ring);\n}\n.u2-multi-choice-chevron {\ndisplay: flex;\nalign-items: center;\nfont-size: var(--dg-font-size-small);\ncolor: var(--dg-text-color-light);\ntransition: transform 100ms ease;\n}\n.u2-multi-choice-summary-toggle[aria-expanded='false'] .u2-multi-choice-chevron {\ntransform: rotate(-90deg);\n}\n.u2-multi-choice-item:hover {\nbackground: var(--dg-hover-subtle);\n}\n.u2-multi-choice-empty {\ndisplay: flex;\nalign-items: center;\nheight: 20px;\npadding: 0 var(--dg-space-s);\ncolor: var(--dg-text-color-light);\nwhite-space: nowrap;\n}\n.u2-choice-chip {\ndisplay: inline-flex;\nalign-items: center;\ngap: 5px;\nbox-sizing: border-box;\nmin-width: 64px;\nheight: var(--dg-button-height);\npadding: 0 8px 0 10px;\nfont: inherit;\ncolor: var(--dg-grey-6);\nbackground: var(--dg-grey-1);\nborder: var(--dg-border-width) solid transparent;\nborder-radius: 12px;\ncursor: pointer;\n}\n.u2-choice-chip:hover {\nbackground: var(--dg-grey-2);\n}\n.u2-choice-chip:focus-visible {\noutline: var(--dg-border-width) solid var(--dg-blue-1);\n}\n.u2-choice-chip[aria-expanded='true'],\n.u2-choice-chip-active {\nbackground: var(--dg-bg);\nborder-color: var(--dg-blue-1);\n}\n.u2-choice-chip-label {\nfont-size: var(--dg-font-size-small);\ncolor: var(--dg-grey-4);\n}\n.u2-choice-chip-value {\nfont-weight: var(--dg-font-weight-medium);\n}\n.u2-choice-chip > .u2-choice-chip-caret {\nmargin-left: auto;\nfont-size: 9px;\ncolor: var(--dg-grey-4);\ntransition: transform 100ms ease;\n}\n.u2-choice-chip[aria-expanded='true'] > .u2-choice-chip-caret {\ntransform: rotate(180deg);\n}\n.u2-choice-chip-invalid,\n.u2-choice-chip-invalid:hover {\nbackground: var(--dg-red-1);\n}\n.u2-choice-chip-invalid[aria-expanded='true'],\n.u2-choice-chip-invalid.u2-choice-chip-active {\nborder-color: var(--dg-red-3);\n}\n.u2-choice-chip-invalid > .u2-choice-chip-value {\ncolor: var(--dg-red-3);\n}\n.u2-choice-chip[aria-disabled='true'],\n.u2-choice-chip[aria-disabled='true']:hover {\ncolor: var(--dg-text-color-disabled);\nbackground: var(--dg-grey-1);\ncursor: default;\n}\n.u2-input-root[data-u2='multi-select'] {\nalign-items: flex-start;\n}\ndiv.u2-input-editor.u2-multi-select-field {\ndisplay: flex;\nalign-items: center;\nmin-width: 160px;\nheight: auto;\nmin-height: var(--dg-control-height);\npadding: 0 var(--dg-space-s);\nborder-bottom: var(--dg-input-border);\noutline: none;\ncursor: pointer;\n}\n.u2-input-inline div.u2-input-editor.u2-multi-select-field {\nmin-height: var(--dg-inline-control-height);\n}\ndiv.u2-input-editor.u2-multi-select-field:focus,\ndiv.u2-input-editor.u2-multi-select-field.u2-multi-select-open {\nborder-bottom: var(--dg-input-border-focus);\n}\ndiv.u2-input-editor.u2-multi-select-field.u2-invalid {\nborder-bottom-color: var(--dg-error);\n}\n.u2-multi-select-tags {\ndisplay: flex;\nflex: 1;\nflex-wrap: wrap;\nalign-items: center;\ngap: var(--dg-space-s);\nmin-width: 0;\npadding: var(--dg-space-xs) 0;\n}\n.u2-multi-select-placeholder {\ncolor: var(--dg-text-color-light);\n}\n.u2-multi-select-chevron {\nflex-shrink: 0;\nwidth: 0;\nheight: 0;\nmargin-left: var(--dg-space-s);\nborder-right: 4px solid transparent;\nborder-left: 4px solid transparent;\nborder-top: 5px solid var(--dg-text-color-light);\n}\n.u2-multi-select-open .u2-multi-select-chevron {\ntransform: rotate(180deg);\n}\n.u2-multi-select-tags .u2-tag {\nmax-width: 160px;\n}\n.u2-multi-select-tags .u2-tag-text {\noverflow: hidden;\nwhite-space: nowrap;\ntext-overflow: ellipsis;\n}\n.u2-multi-select-more {\nfont-size: var(--dg-font-size-small);\ncolor: var(--dg-text-color-light);\n}\n.u2-multi-select-popup {\nbox-sizing: border-box;\ndisplay: flex;\nflex-direction: column;\nmin-width: 180px;\npadding: var(--dg-space-xs) 0;\nfont-family: var(--dg-font-family);\nfont-size: var(--dg-font-size);\nline-height: var(--dg-line-height);\ncolor: var(--dg-text-color);\nbackground: var(--dg-bg);\nborder: var(--dg-overlay-border);\nborder-radius: var(--dg-radius-l);\noutline: none;\nbox-shadow: var(--dg-shadow-2);\n}\n.u2-multi-select-filter {\npadding: var(--dg-space-xs) var(--dg-space-m);\n}\n.u2-multi-select-filter-input {\nbox-sizing: border-box;\nwidth: 100%;\nheight: var(--dg-inline-control-height);\npadding: 0 var(--dg-space-xs);\nfont-family: var(--dg-font-family);\nfont-size: var(--dg-font-size);\ncolor: var(--dg-text-color);\nbackground: var(--dg-bg);\nborder: none;\nborder-bottom: var(--dg-input-border);\nborder-radius: 0;\noutline: none;\n}\n.u2-multi-select-filter-input:focus {\nborder-bottom: var(--dg-input-border-focus);\n}\n.u2-multi-select-filter-input::placeholder {\ncolor: var(--dg-text-color-light);\n}\n.u2-multi-select-options {\nflex: 1;\nmin-height: 0;\noverflow-y: auto;\n}\n.u2-multi-select-all,\n.u2-multi-select-option {\ndisplay: flex;\nalign-items: center;\ngap: var(--dg-space-m);\npadding: var(--dg-space-xs) var(--dg-space-m);\ncursor: pointer;\n}\n.u2-multi-select-all {\nmargin-bottom: var(--dg-space-xs);\npadding-bottom: var(--dg-space-s);\ncolor: var(--dg-text-color-light);\nborder-bottom: var(--dg-border-width) solid var(--dg-border-subtle);\n}\n.u2-multi-select-all:hover,\n.u2-multi-select-option:hover {\nbackground: var(--dg-hover-subtle);\n}\n.u2-multi-select-option-active {\nbackground: var(--dg-selection-bg);\n}\n.u2-multi-select-check {\nposition: relative;\nbox-sizing: border-box;\nflex-shrink: 0;\nwidth: 13px;\nheight: 13px;\nbackground: var(--dg-bg);\nborder: var(--dg-border-width) solid var(--dg-grey-3);\nborder-radius: var(--dg-radius);\n}\n.u2-multi-select-selected > .u2-multi-select-check {\nbackground: var(--dg-accent);\nborder-color: var(--dg-accent);\n}\n.u2-multi-select-selected > .u2-multi-select-check::after {\ncontent: '';\nposition: absolute;\ntop: 0;\nleft: 3px;\nwidth: 4px;\nheight: 8px;\nborder: solid var(--dg-white);\nborder-width: 0 2px 2px 0;\ntransform: rotate(45deg);\n}\n.u2-multi-select-text {\noverflow: hidden;\nwhite-space: nowrap;\ntext-overflow: ellipsis;\n}\n.u2-multi-select-empty {\npadding: var(--dg-space-xs) var(--dg-space-m);\ncolor: var(--dg-text-color-light);\n}\n.u2-combobox {\ndisplay: inline-block;\n}\n.u2-combobox-input {\nbox-sizing: border-box;\nwidth: 100%;\nheight: var(--dg-control-height);\npadding: 0 var(--dg-space-xs);\nfont: inherit;\nfont-family: var(--dg-font-family);\nfont-size: var(--dg-font-size);\ncolor: var(--dg-text-color);\nbackground: var(--dg-bg);\nborder: none;\nborder-bottom: var(--dg-input-border);\nborder-radius: 0;\noutline: none;\n}\n.u2-combobox-input:focus {\nborder-bottom: var(--dg-input-border-focus);\n}\n.u2-combobox-input::placeholder {\ncolor: var(--dg-text-color-light);\n}\n.u2-combobox-popup {\nbox-sizing: border-box;\noverflow-y: auto;\npadding: var(--dg-space-xs) 0;\nfont-family: var(--dg-font-family);\nfont-size: var(--dg-font-size);\nline-height: var(--dg-line-height);\ncolor: var(--dg-text-color);\nbackground: var(--dg-bg);\nborder: var(--dg-overlay-border);\nborder-radius: var(--dg-radius-l);\nbox-shadow: var(--dg-shadow-2);\n}\n.u2-combobox-option {\npadding: var(--dg-space-xs) var(--dg-space-m);\noverflow: hidden;\nwhite-space: nowrap;\ntext-overflow: ellipsis;\ncursor: pointer;\n}\n.u2-combobox-option:hover {\nbackground: var(--dg-hover-subtle);\n}\n.u2-combobox-option-active {\ncolor: var(--dg-selection-text);\nbackground: var(--dg-selection-bg);\n}\n.u2-combobox-loading,\n.u2-combobox-empty,\n.u2-combobox-error {\ndisplay: flex;\nalign-items: center;\ngap: var(--dg-space-m);\npadding: var(--dg-space-xs) var(--dg-space-m);\ncolor: var(--dg-text-color-light);\n}\n.u2-combobox-retry {\nheight: var(--dg-inline-control-height);\npadding: 0 var(--dg-space-m);\nfont-family: var(--dg-font-family);\nfont-size: var(--dg-font-size-small);\ncolor: var(--dg-text-color);\nbackground: var(--dg-bg-secondary);\nborder: var(--dg-border-width) solid var(--dg-border);\nborder-radius: var(--dg-radius);\ncursor: pointer;\n}\n.u2-combobox-retry:hover {\nbackground: var(--dg-hover);\n}\n.u2-list {\nposition: relative;\noverflow-y: auto;\nborder: var(--dg-border-width) solid var(--dg-border);\nbackground: var(--dg-bg);\nfont-family: var(--dg-font-family);\nfont-size: var(--dg-font-size);\nline-height: var(--dg-line-height);\ncolor: var(--dg-text-color);\noutline: none;\n}\n.u2-list:focus-visible:not(:has(.u2-list-row-current)) {\noutline: var(--dg-focus-ring);\noutline-offset: calc(-1 * var(--dg-focus-ring-width));\n}\n.u2-list:focus-visible .u2-list-row-current {\noutline: var(--dg-focus-ring);\noutline-offset: calc(-1 * var(--dg-focus-ring-width));\n}\n.u2-list.u2-list-no-ring:focus-visible,\n.u2-list.u2-list-no-ring:focus-visible .u2-list-row-current {\noutline: none;\n}\n.u2-list-frame {\nborder: var(--dg-border-width) solid var(--dg-border);\nbackground: var(--dg-bg);\n}\n.u2-list-content {\nposition: relative;\n}\n.u2-list-row {\nposition: absolute;\nleft: 0;\nright: 0;\ndisplay: flex;\nalign-items: center;\nbox-sizing: border-box;\npadding: 0 var(--dg-space-m);\nwhite-space: nowrap;\noverflow: hidden;\ntext-overflow: ellipsis;\ncursor: pointer;\n--u2-list-row-base: var(--dg-bg);\n--u2-list-row-state: transparent;\n--u2-list-row-current: transparent;\n--u2-list-row-over: transparent;\n--u2-list-row-stripe: transparent;\n--u2-list-row-selected: transparent;\n--u2-row-bg: linear-gradient(var(--u2-list-row-state), var(--u2-list-row-state)),\nlinear-gradient(var(--u2-list-row-selected), var(--u2-list-row-selected)),\nlinear-gradient(var(--u2-list-row-over), var(--u2-list-row-over)),\nlinear-gradient(var(--u2-list-row-current), var(--u2-list-row-current)), var(--u2-list-row-base);\nbackground: linear-gradient(var(--u2-list-row-state), var(--u2-list-row-state)),\nlinear-gradient(var(--u2-list-row-selected), var(--u2-list-row-selected)),\nlinear-gradient(to right, var(--u2-list-row-stripe) 4px, transparent 4px),\nlinear-gradient(var(--u2-list-row-over), var(--u2-list-row-over)),\nlinear-gradient(var(--u2-list-row-current), var(--u2-list-row-current)), var(--u2-list-row-base);\n}\n.u2-list-row-current {\n--u2-list-row-current: var(--dg-grid-current-row);\n}\n.u2-list-row:hover {\n--u2-list-row-over: var(--dg-grid-mouse-over-row);\n--u2-list-row-stripe: var(--dg-grid-mouse-over-stripe);\n}\n.u2-list-row-selected {\n--u2-list-row-selected: var(--dg-grid-selected-row);\n}\n.u2-list-seeded .u2-list-row-selected {\n--u2-list-row-selected: transparent;\n}\n.u2-list-seeded .u2-list-row-current {\n--u2-list-row-current: transparent;\n}\n.u2-row-actions {\ndisplay: flex;\nalign-items: center;\ngap: var(--dg-space-s);\nmargin-left: auto;\nopacity: 0;\npointer-events: none;\n}\n.u2-list-row .u2-row-actions {\nposition: absolute;\ntop: 0;\nright: 0;\nbottom: 0;\npadding: 0 var(--dg-space-m) 0 var(--dg-space-s);\nbackground: var(--u2-row-bg, var(--dg-hover-subtle));\n}\n.u2-row-actions .u2-btn.u2-icon-btn.u2-row-action-destructive {\ncolor: var(--dg-error);\n}\n.u2-list-row:hover .u2-row-actions,\n.u2-row:hover .u2-row-actions,\n.u2-row-actions:focus-within {\nopacity: 1;\npointer-events: auto;\n}\n.u2-functions-browser {\ndisplay: flex;\nflex-direction: column;\nmin-height: 0;\nbackground: var(--dg-bg);\nfont-family: var(--dg-font-family);\nfont-size: var(--dg-font-size);\nline-height: var(--dg-line-height);\ncolor: var(--dg-text-color);\n}\n.u2-functions-browser [hidden] {\ndisplay: none !important;\n}\n.u2-fb-search {\ndisplay: flex;\nalign-items: center;\ngap: var(--dg-space-s);\npadding: var(--dg-space-s) var(--dg-space-m);\n}\n.u2-fb-search .u2-input-root {\nflex: 1 1 auto;\n}\n.u2-fb-search .u2-input-box {\nwidth: 100%;\n}\n.u2-fb-search .u2-input-editor.u2-input-search {\nwidth: 100%;\n}\n.u2-fb-body {\ndisplay: flex;\nflex: 1 1 auto;\nmin-height: 0;\nalign-items: stretch;\n}\n.u2-fb-panes {\nflex: none;\nwidth: 170px;\nmax-width: 45%;\nmin-width: 0;\nbox-sizing: border-box;\noverflow-y: auto;\noverflow-x: hidden;\npadding: var(--dg-space-s) var(--dg-space-m);\nborder-right: var(--dg-border-width) solid var(--dg-border);\n}\n.u2-fb-pane {\nmargin-bottom: var(--dg-space-l);\n}\n.u2-fb-pane-header {\nmargin-bottom: var(--dg-space-xs);\ncolor: var(--dg-text-color-light);\nfont-size: var(--dg-font-size-small);\nfont-weight: bold;\n}\n.u2-fb-pane-row {\ndisplay: flex;\nalign-items: center;\ngap: var(--dg-space-s);\npadding: var(--dg-space-xs) 0;\ncursor: pointer;\n}\n.u2-fb-pane-label {\noverflow: hidden;\nwhite-space: nowrap;\ntext-overflow: ellipsis;\ncursor: pointer;\n}\n.u2-fb-count {\nmargin-left: auto;\ncolor: var(--dg-text-color-light);\nfont-size: var(--dg-font-size-small);\n}\n.u2-fb-main {\ndisplay: flex;\nflex-direction: column;\nflex: 1 1 auto;\nmin-width: 120px;\nmin-height: 0;\n}\n.u2-fb-main .u2-list {\nflex: 1 1 auto;\nmin-height: 0;\n}\n.u2-fb-empty {\nflex: 1 1 auto;\nalign-items: center;\ngap: var(--dg-space-m);\n}\n.u2-fb-status {\nflex: none;\npadding: var(--dg-space-xs) var(--dg-space-m);\ncolor: var(--dg-text-color-light);\nfont-size: var(--dg-font-size-small);\n}\n.u2-fb-row {\ndisplay: flex;\nalign-items: center;\nheight: 100%;\nmin-width: 0;\ngap: var(--dg-space-s);\noverflow: hidden;\n}\n.u2-fb-run {\nflex: none;\n}\n.u2-fb-run .grok-icon {\ncolor: var(--dg-success);\n}\n.u2-fb-icon {\ndisplay: flex;\nflex: none;\nalign-items: center;\njustify-content: center;\nwidth: 16px;\nheight: 16px;\noverflow: hidden;\n}\n.u2-fb-icon img,\n.u2-fb-icon svg,\n.u2-fb-icon i {\nmax-width: 16px;\nmax-height: 16px;\nfont-size: var(--dg-font-size-small);\n}\n.u2-fb-label {\nflex: 0 1 auto;\noverflow: hidden;\nwhite-space: nowrap;\ntext-overflow: ellipsis;\n}\n.u2-fb-sig {\nflex: 1 1 auto;\noverflow: hidden;\nwhite-space: nowrap;\ntext-overflow: ellipsis;\ncolor: var(--dg-text-color-light);\nfont-size: var(--dg-font-size-small);\n}\n.u2-fb-no-signature .u2-fb-sig {\ndisplay: none;\n}\n.u2-fb-no-run .u2-fb-run {\ndisplay: none;\n}\n.u2-grid {\nposition: relative;\noverflow-x: hidden;\noverflow-y: auto;\nborder: var(--dg-border-width) solid var(--dg-border);\nbackground: var(--dg-bg);\nfont-family: var(--dg-font-family);\nfont-size: var(--dg-font-size);\ncolor: var(--dg-text-color);\noutline: none;\n}\n.u2-grid:focus-visible {\noutline: var(--dg-focus-ring);\noutline-offset: calc(-1 * var(--dg-focus-ring-width));\n}\n.u2-grid-content {\nposition: relative;\n}\n.u2-grid-cell {\nposition: absolute;\ndisplay: flex;\nalign-items: center;\njustify-content: center;\nbox-sizing: border-box;\nborder-radius: var(--dg-radius);\ncursor: pointer;\n}\n.u2-grid-cell:hover {\nbackground: var(--dg-hover);\n}\n.u2-grid-cell-selected,\n.u2-grid-cell-selected:hover {\nbackground: var(--dg-selection-bg);\ncolor: var(--dg-selection-text);\n}\n.u2-data-table {\nposition: relative;\noverflow-y: auto;\nborder: var(--dg-border-width) solid var(--dg-border);\nbackground: var(--dg-bg);\nfont-family: var(--dg-font-family);\nfont-size: var(--dg-font-size);\nline-height: var(--dg-line-height);\ncolor: var(--dg-text-color);\noutline: none;\nscroll-snap-type: y proximity;\nscroll-padding-top: var(--u2-data-table-header-height, 0px);\n}\n.u2-data-table:focus-visible {\noutline: var(--dg-focus-ring);\noutline-offset: calc(-1 * var(--dg-focus-ring-width));\n}\n.u2-data-table:focus-visible .u2-data-table-row-selected {\noutline: var(--dg-focus-ring);\noutline-offset: calc(-1 * var(--dg-focus-ring-width));\n}\n.u2-data-table-header {\nposition: sticky;\ntop: 0;\nz-index: 1;\ndisplay: grid;\nalign-items: center;\nbox-sizing: border-box;\nbackground: var(--dg-bg);\nborder-bottom: var(--dg-border-width) solid var(--dg-border);\n}\n.u2-data-table-head {\nposition: relative;\ndisplay: flex;\nalign-items: center;\ngap: var(--dg-space-xs);\nheight: 100%;\ncolor: var(--dg-text-color);\nfont-weight: var(--dg-font-weight-bold);\n}\n.u2-data-table-head.u2-data-table-align-right {\nflex-direction: row-reverse;\n}\n.u2-data-table-head.u2-data-table-align-center {\njustify-content: center;\n}\n.u2-data-table-head-label {\nmin-width: 0;\noverflow: hidden;\ntext-overflow: ellipsis;\n}\n.u2-data-table-sortable > .u2-data-table-head {\ncursor: pointer;\n}\n.u2-data-table-sort {\nflex: none;\ncolor: var(--dg-accent);\n}\n.u2-data-table-resize {\nposition: absolute;\ntop: 0;\nright: 0;\nbottom: 0;\nwidth: var(--dg-space-s);\ncursor: col-resize;\n}\n.u2-data-table-resize:hover {\nborder-right: var(--dg-border-width) solid var(--dg-border);\n}\n.u2-data-table-content {\nposition: relative;\n}\n.u2-data-table-row {\nscroll-snap-align: start;\nposition: absolute;\nleft: 0;\nright: 0;\ndisplay: grid;\nalign-items: center;\nbox-sizing: border-box;\nborder-bottom: var(--dg-border-width) solid var(--dg-border-subtle);\ncursor: pointer;\n}\n.u2-data-table-cell {\nbox-sizing: border-box;\npadding: 0 var(--dg-space-m);\nwhite-space: nowrap;\noverflow: hidden;\ntext-overflow: ellipsis;\n}\n.u2-data-table-align-right {\ntext-align: right;\n}\n.u2-data-table-align-center {\ntext-align: center;\n}\n.u2-data-table-align-left {\ntext-align: left;\n}\n.u2-data-table-row:hover {\nbackground: var(--dg-hover-subtle);\n}\n.u2-data-table-row-selected,\n.u2-data-table-row-selected:hover {\nbackground: var(--dg-selection-bg);\ncolor: var(--dg-selection-text);\n}\n.u2-data-table-row .u2-cell-changed {\nbackground: var(--dg-orange-1);\n}\n.u2-data-table-row .u2-cell-error {\nbackground: var(--dg-red-1);\ncolor: var(--dg-error);\n}\n.u2-data-table-row .u2-timestamp {\ncolor: inherit;\n}\n.u2-data-table-row .u2-cell-readonly {\ncolor: var(--dg-text-color-light);\n}\n.u2-data-table-row .u2-data-table-cell > .u2-input-root {\nflex: 1 1 auto;\nwidth: 100%;\nmin-width: 0;\n}\n.u2-data-table-row .u2-data-table-cell > .u2-input-root > .u2-input-box {\nflex: 1 1 auto;\nmin-width: 0;\n}\n.u2-data-table-row .u2-data-table-cell > .u2-input-root .u2-input-editor {\nwidth: 100%;\n}\n.u2-data-table-cell > .u2-input-root > .u2-input-error {\ndisplay: none;\n}\n.u2-input-editor.u2-icon-input {\ndisplay: flex;\nalign-items: center;\ngap: var(--dg-space-s);\nborder-bottom: var(--dg-input-border);\ncursor: pointer;\n}\n.u2-input-editor.u2-icon-input:focus {\nborder-bottom: var(--dg-input-border-focus);\n}\n.u2-icon-input-preview {\ndisplay: inline-flex;\nwidth: var(--dg-space-xl);\njustify-content: center;\nflex-shrink: 0;\n}\n.u2-icon-input-name {\noverflow: hidden;\nwhite-space: nowrap;\ntext-overflow: ellipsis;\n}\n.u2-icon-input-popup {\nbox-sizing: border-box;\nwidth: 296px;\npadding: var(--dg-space-s);\ngap: var(--dg-space-s);\nborder: var(--dg-overlay-border);\nborder-radius: var(--dg-radius-l);\nbackground: var(--dg-bg);\nbox-shadow: var(--dg-shadow-2);\n}\n.u2-icon-input-popup .u2-grid {\nheight: 224px;\nborder: none;\n}\n.u2-icon-input-popup .u2-grid-cell {\nfont-size: var(--dg-font-size-h1);\n}\n.u2-input-editor.u2-function-input {\ndisplay: flex;\nalign-items: center;\ngap: var(--dg-space-s);\nborder-bottom: var(--dg-input-border);\ncursor: pointer;\n}\n.u2-input-editor.u2-function-input:focus {\nborder-bottom: var(--dg-input-border-focus);\n}\n.u2-function-input-icon {\ndisplay: inline-flex;\nwidth: var(--dg-space-xl);\njustify-content: center;\nflex-shrink: 0;\n}\n.u2-function-input-name {\noverflow: hidden;\nwhite-space: nowrap;\ntext-overflow: ellipsis;\n}\n.u2-function-input-name.u2-function-input-empty {\ncolor: var(--dg-text-color-light);\n}\n.u2-function-input-popup {\ndisplay: flex;\nbox-sizing: border-box;\nwidth: 420px;\nheight: 320px;\npadding: var(--dg-space-s);\nborder: var(--dg-overlay-border);\nborder-radius: var(--dg-radius-l);\nbackground: var(--dg-bg);\nbox-shadow: var(--dg-shadow-2);\n}\n.u2-function-input-popup .u2-functions-browser {\nflex: 1;\nmin-width: 0;\n}\n.u2-fch {\ndisplay: flex;\nflex-direction: column;\nmin-height: 0;\nbackground: var(--dg-bg);\nfont-family: var(--dg-font-family);\nfont-size: var(--dg-font-size);\nline-height: var(--dg-line-height);\ncolor: var(--dg-text-color);\n}\n.u2-fch [hidden] {\ndisplay: none !important;\n}\n.u2-fch-main {\ndisplay: flex;\nflex-direction: column;\nflex: 1 1 auto;\nalign-items: stretch;\nmin-height: 0;\n}\n.u2-fch-main .u2-list {\nflex: 1 1 auto;\nmin-height: 0;\n}\n.u2-fch-state {\nflex: 1 1 auto;\nalign-items: center;\ngap: var(--dg-space-m);\n}\n.u2-fch-row {\ndisplay: flex;\nalign-items: center;\nheight: 100%;\nmin-width: 0;\npadding: 0 var(--dg-space-m);\ngap: var(--dg-space-s);\noverflow: hidden;\n}\n.u2-fch-row .grok-funccall-list-item {\noverflow: hidden;\nwhite-space: nowrap;\ntext-overflow: ellipsis;\n}\n.u2-input-editor.u2-func-call-input {\ndisplay: flex;\nalign-items: center;\ngap: var(--dg-space-s);\nborder-bottom: var(--dg-input-border);\ncursor: pointer;\n}\n.u2-input-editor.u2-func-call-input:focus {\nborder-bottom: var(--dg-input-border-focus);\n}\n.u2-input-editor.u2-func-call-input.u2-invalid,\n.u2-input-editor.u2-func-call-input.u2-invalid:focus {\nborder-bottom: var(--dg-border-width) solid var(--dg-error);\n}\n.u2-func-call-input-name {\noverflow: hidden;\nwhite-space: nowrap;\ntext-overflow: ellipsis;\n}\n.u2-func-call-input-name.u2-func-call-input-empty {\ncolor: var(--dg-text-color-light);\n}\n.u2-func-call-input-popup {\ndisplay: flex;\nbox-sizing: border-box;\nwidth: 420px;\nheight: 320px;\npadding: var(--dg-space-s);\nborder: var(--dg-overlay-border);\nborder-radius: var(--dg-radius-l);\nbackground: var(--dg-bg);\nbox-shadow: var(--dg-shadow-2);\n}\n.u2-func-call-input-popup .u2-fch {\nflex: 1;\nmin-width: 0;\n}\n.u2-msg {\ndisplay: flex;\nbox-sizing: border-box;\nflex-direction: column;\nfont-family: var(--dg-font-family);\nfont-size: var(--dg-font-size);\ncolor: var(--dg-text-color);\nbackground: var(--dg-bg);\nborder: var(--dg-border-width) solid var(--dg-border);\nborder-radius: var(--dg-radius);\n}\n.u2-msg:focus-within {\nborder-color: var(--dg-accent-secondary);\n}\n.u2-msg-editor {\nmin-height: calc(2 * var(--dg-line-height) * var(--dg-font-size));\npadding: var(--dg-space-m);\noverflow-y: auto;\nline-height: var(--dg-line-height);\nwhite-space: pre-wrap;\noverflow-wrap: break-word;\noutline: none;\n}\n.u2-msg-editor:empty::before,\n.u2-msg-editor-empty::before {\ncontent: attr(data-placeholder);\ncolor: var(--dg-text-color-light);\npointer-events: none;\n}\n.u2-msg-chip {\ndisplay: inline-flex;\nalign-items: center;\npadding: 0 var(--dg-space-s);\ncolor: var(--dg-selection-text);\nwhite-space: nowrap;\nbackground: var(--dg-bg-secondary);\nborder-radius: var(--dg-radius);\nuser-select: none;\n}\n.u2-msg-query {\ncolor: var(--dg-accent-secondary);\n}\n.u2-msg-toolbar {\ndisplay: flex;\nalign-items: center;\njustify-content: space-between;\ngap: var(--dg-space-m);\npadding: var(--dg-space-s);\nborder-top: var(--dg-border-width) solid var(--dg-border-subtle);\n}\n.u2-msg-tools {\ndisplay: flex;\nalign-items: center;\ngap: var(--dg-space-xs);\n}\n.u2-msg-send:is(:disabled, [aria-disabled='true']) {\ncursor: default;\nopacity: 0.5;\n}\n.u2-msg-popup {\nmin-width: 240px;\n}\n.u2-msg-text {\noverflow: hidden;\nwhite-space: nowrap;\ntext-overflow: ellipsis;\n}\n.u2-input-editor.u2-file {\ndisplay: inline-flex;\nalign-items: center;\ngap: var(--dg-space-s);\npadding: 0;\nborder-bottom: var(--dg-input-border);\n}\n.u2-input-editor.u2-file:focus-within {\nborder-bottom: var(--dg-input-border-focus);\n}\n.u2-input-editor.u2-file.u2-invalid,\n.u2-input-editor.u2-file.u2-invalid:focus-within {\nborder-bottom: var(--dg-border-width) solid var(--dg-error);\n}\n.u2-file-path {\nflex: 1;\nmin-width: 0;\nheight: 100%;\npadding: 0 var(--dg-space-s);\nfont: inherit;\ncolor: inherit;\nbackground: none;\nborder: none;\noutline: none;\n}\n.u2-input-root[data-u2='files-input'] .u2-input-box > .u2-input-editor + .u2-input-options {\nalign-self: flex-start;\nborder-bottom: none;\n}\n.u2-rsa-upload > .u2-btn > .u2-icon {\ncolor: var(--dg-accent);\n}\n.u2-file-dropping {\nbackground: var(--dg-selection-bg);\noutline: var(--dg-focus-ring);\n}\n.u2-input-editor.u2-files,\n.u2-input-editor.u2-rsa {\ndisplay: flex;\nflex-direction: column;\nalign-items: flex-start;\ngap: var(--dg-space-s);\nheight: auto;\nmin-height: var(--dg-control-height);\npadding: var(--dg-space-xs) var(--dg-space-s);\n}\n.u2-files-summary {\ncolor: var(--dg-text-color-light);\nfont-size: var(--dg-font-size-small);\n}\n.u2-files-list {\ndisplay: flex;\nflex-direction: column;\ngap: var(--dg-space-xs);\nwidth: 100%;\n}\n.u2-files-row {\ndisplay: flex;\nalign-items: center;\ngap: var(--dg-space-s);\n}\n.u2-files-name {\nflex: 1;\nmin-width: 0;\noverflow: hidden;\nwhite-space: nowrap;\ntext-overflow: ellipsis;\n}\n.u2-files-status {\nflex-shrink: 0;\ncolor: var(--dg-text-color-light);\nfont-size: var(--dg-font-size-small);\n}\n.u2-files-failed .u2-files-name,\n.u2-files-failed .u2-files-status {\ncolor: var(--dg-failure);\n}\n.u2-rsa-upload,\n.u2-rsa-masked {\ndisplay: flex;\nalign-items: center;\ngap: var(--dg-space-m);\nwidth: 100%;\n}\n.u2-rsa-hint {\ncolor: var(--dg-text-color-light);\nfont-size: var(--dg-font-size-small);\n}\n.u2-rsa-masked .u2-input-root {\nflex: 1;\nmin-width: 0;\npadding: 0;\n}\n.u2-space-box {\ndisplay: flex;\nalign-items: center;\ngap: var(--dg-space-s);\nbox-sizing: border-box;\nflex: 1 1 auto;\nmin-width: 0;\nheight: var(--dg-control-height);\npadding: 0 var(--dg-space-xs);\nborder-bottom: var(--dg-input-border);\ncolor: var(--dg-text-color);\ncursor: pointer;\noutline: none;\n}\n.u2-space-box:focus-visible,\n.u2-space-open {\nborder-bottom: var(--dg-input-border-focus);\n}\n.u2-space-text {\nflex: 1 1 auto;\nmin-width: 0;\noverflow: hidden;\nwhite-space: nowrap;\ntext-overflow: ellipsis;\n}\n.u2-space-empty .u2-space-text {\ncolor: var(--dg-text-color-light);\n}\n.u2-space-icon,\n.u2-space-node-icon,\n.u2-space-caret,\n.u2-space-clear,\n.u2-space-add {\nflex: none;\nwidth: 16px;\ntext-align: center;\ncolor: var(--dg-text-color-light);\n}\n.u2-space-box:hover .u2-space-caret,\n.u2-space-open .u2-space-caret,\n.u2-space-clear:hover,\n.u2-space-add:hover {\ncolor: var(--dg-text-color);\n}\n.u2-space-clear,\n.u2-space-add {\ncursor: pointer;\n}\n.u2-space-add {\nmargin-left: auto;\nvisibility: hidden;\n}\n.u2-list-row:hover .u2-space-add,\n.u2-list-row[aria-selected=\"true\"] .u2-space-add {\nvisibility: visible;\n}\n.u2-space-popup {\ndisplay: flex;\nflex-direction: column;\nbox-sizing: border-box;\nwidth: 320px;\noverflow: hidden;\nfont-family: var(--dg-font-family);\nfont-size: var(--dg-font-size);\nline-height: var(--dg-line-height);\ncolor: var(--dg-text-color);\nbackground: var(--dg-bg);\nborder: var(--dg-overlay-border);\nborder-radius: var(--dg-radius-l);\nbox-shadow: var(--dg-shadow-2);\n}\n.u2-space-popup [hidden],\n.u2-space-browser [hidden] {\ndisplay: none !important;\n}\n.u2-space-search {\npadding: var(--dg-space-s) var(--dg-space-m) var(--dg-space-xs);\n}\n.u2-space-search.u2-input-inline > .u2-input-box,\n.u2-space-search.u2-input-inline > .u2-input-box > .u2-input-editor {\nwidth: 100%;\n}\n.u2-space-head {\nalign-items: center;\njustify-content: space-between;\npadding: var(--dg-space-s) var(--dg-space-m) 2px;\nfont-size: var(--dg-font-size-small);\nletter-spacing: .06em;\ntext-transform: uppercase;\ncolor: var(--dg-text-color-light);\n}\n.u2-space-recent {\nalign-items: center;\ngap: var(--dg-space-s);\npadding: 3px var(--dg-space-m);\nwhite-space: nowrap;\ncursor: pointer;\n}\n.u2-space-recent:hover {\nbackground: var(--dg-hover-subtle);\n}\n.u2-space-dim {\noverflow: hidden;\nmargin-left: auto;\nfont-size: var(--dg-font-size-small);\nwhite-space: nowrap;\ntext-overflow: ellipsis;\ncolor: var(--dg-text-color-light);\n}\n.u2-space-tree {\nflex: none;\nheight: 200px;\n}\n.u2-space-node {\nflex: 1 1 auto;\nalign-items: center;\ngap: var(--dg-space-s);\nmin-width: 0;\n}\n.u2-space-status {\npadding: var(--dg-space-m);\ncolor: var(--dg-text-color-light);\n}\n.u2-space-failed {\npadding: var(--dg-space-xs) var(--dg-space-m);\ncolor: var(--dg-error);\n}\n.u2-space-failed:empty,\n.u2-space-clash:empty {\ndisplay: none;\n}\n.u2-space-clash {\ncolor: var(--dg-error);\n}\n.u2-space-browser {\ndisplay: flex;\nheight: 100%;\nmin-height: 0;\nborder: 1px solid var(--dg-border-subtle);\n}\n.u2-space-browser-left {\ndisplay: flex;\nflex: none;\nwidth: 220px;\nborder-right: 1px solid var(--dg-border-subtle);\n}\n.u2-space-browser-tree {\nflex: 1 1 auto;\nmin-height: 0;\n}\n.u2-space-browser-middle {\ndisplay: flex;\nflex: 1 1 auto;\nflex-direction: column;\nmin-width: 0;\n}\n.u2-space-browser-middle .u2-space-search {\npadding: var(--dg-space-s) var(--dg-space-m);\nborder-bottom: 1px solid var(--dg-border-subtle);\n}\n.u2-space-items {\nflex: 1 1 auto;\nmin-height: 0;\n}\n.u2-space-item {\nalign-items: center;\ngap: var(--dg-space-s);\nbox-sizing: border-box;\nwidth: 100%;\nmin-width: 0;\npadding: 0 var(--dg-space-m);\n}\n.u2-space-item-icon {\nflex: none;\nwidth: 20px;\n}\n.u2-space-item-text {\ndisplay: flex;\nflex: 1 1 auto;\nflex-direction: column;\nmin-width: 0;\n}\n.u2-space-item-text .u2-space-dim {\nmargin-left: 0;\n}\n.u2-space-item-name {\noverflow: hidden;\nwhite-space: nowrap;\ntext-overflow: ellipsis;\n}\n.u2-space-item-title {\nalign-items: center;\ngap: var(--dg-space-xs);\nmin-width: 0;\n}\n.u2-space-item-link {\nflex: none;\ncolor: var(--text-color-light);\n}\n.u2-space-preview-details {\npadding: var(--dg-space-s);\nborder: 1px solid var(--dg-border-subtle);\nborder-radius: var(--dg-radius);\n}\n.u2-space-empty-state {\npadding: 24px var(--dg-space-m);\ntext-align: center;\ncolor: var(--dg-text-color-light);\n}\n.u2-space-preview {\ndisplay: flex;\nflex: none;\nflex-direction: column;\nwidth: 240px;\npadding: var(--dg-space-m);\noverflow: auto;\nborder-left: 1px solid var(--dg-border-subtle);\n}\n.u2-progress {\ndisplay: flex;\nflex-direction: column;\ngap: var(--dg-space-xs);\nfont-family: var(--dg-font-family);\n}\n.u2-progress-row {\ndisplay: flex;\nalign-items: center;\ngap: var(--dg-space-m);\n}\n.u2-progress-track {\nflex: 1;\nmin-width: 0;\nheight: 4px;\noverflow: hidden;\nbackground: var(--dg-grey-2);\nborder-radius: var(--dg-radius);\n}\n.u2-progress-fill {\nwidth: 0;\nheight: 100%;\nbackground: var(--dg-accent);\nborder-radius: inherit;\ntransition: width 0.15s linear;\n}\n.u2-progress-percent {\nflex-shrink: 0;\nmin-width: 34px;\nfont-size: var(--dg-font-size-small);\ncolor: var(--dg-text-color-light);\ntext-align: right;\n}\n.u2-progress-description {\nfont-size: var(--dg-font-size-small);\ncolor: var(--dg-text-color-light);\n}\n.u2-progress-indeterminate .u2-progress-fill {\nwidth: 40%;\ntransition: none;\nanimation: u2-progress-slide 1.2s ease-in-out infinite;\n}\n@keyframes u2-progress-slide {\nfrom {\ntransform: translateX(-100%);\n}\nto {\ntransform: translateX(250%);\n}\n}\n@media (prefers-reduced-motion: reduce) {\n.u2-progress-fill {\ntransition: none;\n}\n.u2-progress-indeterminate .u2-progress-fill {\nwidth: 100%;\nanimation: u2-progress-pulse 1.6s ease-in-out infinite;\n}\n@keyframes u2-progress-pulse {\n50% {\nopacity: 0.35;\n}\n}\n}\n.u2-spec-error {\nbackground: var(--dg-red-1);\ncolor: var(--dg-red-4);\nborder-radius: var(--dg-radius);\npadding: var(--dg-space-s) var(--dg-space-m);\nfont-size: var(--dg-font-size-small);\n}\n.u2-wizard {\nbox-sizing: border-box;\ndisplay: flex;\nflex-direction: column;\nmin-height: 0;\nfont-family: var(--dg-font-family);\nfont-size: var(--dg-font-size);\nline-height: var(--dg-line-height);\ncolor: var(--dg-text-color);\n}\n.u2-dialog-content > .u2-wizard {\nheight: 100%;\n}\n.u2-dialog-content:has(> .u2-wizard) {\npadding: 0;\n}\n.u2-wizard-steps {\ndisplay: flex;\nalign-items: center;\nflex-shrink: 0;\nmargin: 0;\npadding: var(--dg-space-l) var(--dg-space-l) 0;\nlist-style: none;\n}\n.u2-wizard-step {\ndisplay: flex;\nalign-items: center;\ngap: var(--dg-space-s);\nmargin: 0;\nfont-size: var(--dg-font-size-small);\ncolor: var(--dg-text-color-light);\noutline: none;\nuser-select: none;\n}\n.u2-wizard-step + .u2-wizard-step {\nflex: 1;\n}\n.u2-wizard-step + .u2-wizard-step::before {\ncontent: '';\nflex: 1;\nmin-width: var(--dg-space-l);\nheight: var(--dg-border-width);\nmargin: 0 var(--dg-space-s);\nbackground: var(--dg-border);\n}\n.u2-wizard-step:focus-visible .u2-wizard-marker {\noutline: var(--dg-focus-ring);\noutline-offset: 0;\n}\n.u2-wizard-marker {\nbox-sizing: border-box;\ndisplay: flex;\nalign-items: center;\njustify-content: center;\nflex-shrink: 0;\nwidth: 20px;\nheight: 20px;\nfont-size: var(--dg-font-size-xs);\ncolor: var(--dg-text-color-light);\nbackground: var(--dg-bg);\nborder: var(--dg-border-width) solid var(--dg-border);\nborder-radius: 50%;\n}\n.u2-wizard-title {\noverflow: hidden;\nwhite-space: nowrap;\ntext-overflow: ellipsis;\n}\n.u2-wizard-step-done {\ncolor: var(--dg-text-color);\ncursor: pointer;\n}\n.u2-wizard-step-done[aria-disabled='true'] {\ncursor: default;\n}\n.u2-wizard-step-done .u2-wizard-marker {\ncolor: var(--dg-accent);\nbackground: var(--dg-bg);\nborder-color: var(--dg-accent);\n}\n.u2-wizard-step-current {\ncolor: var(--dg-text-color);\nfont-weight: var(--dg-font-weight-medium);\n}\n.u2-wizard-step-current .u2-wizard-marker {\ncolor: var(--dg-white);\nbackground: var(--dg-accent);\nborder-color: var(--dg-accent);\n}\n.u2-wizard-step-failed .u2-wizard-marker {\ncolor: var(--dg-white);\nbackground: var(--dg-error);\nborder-color: var(--dg-error);\n}\n.u2-wizard-busy .u2-wizard-steps {\npointer-events: none;\ncolor: var(--dg-text-color-disabled);\n}\n.u2-wizard-content {\nflex: 1 1 auto;\nmin-height: 0;\noverflow: auto;\npadding: var(--dg-space-l);\noverflow-wrap: anywhere;\n}\n.u2-wizard-buttons {\ndisplay: flex;\nalign-items: center;\njustify-content: flex-end;\nflex-shrink: 0;\ngap: var(--dg-space-m);\npadding: var(--dg-space-m) var(--dg-space-l);\nborder-top: var(--dg-border-width) solid var(--dg-border-subtle);\n}\n.u2-wizard-cancel {\nmargin-right: var(--dg-space-l);\n}\n.u2-wizard-left {\ndisplay: flex;\nflex: 1 1 auto;\nalign-items: center;\njustify-content: center;\ngap: var(--dg-space-m);\nmin-width: 0;\ntext-align: center;\nfont-size: var(--dg-font-size-small);\ncolor: var(--dg-text-color-light);\n}\n.u2-wizard-status {\ndisplay: flex;\nalign-items: center;\ngap: var(--dg-space-s);\nmin-width: 0;\n}\n.u2-wizard-status-error,\n.u2-wizard-error {\ncolor: var(--dg-error);\n}\n.u2-wizard-reason:not(.u2-status-line-problem),\n.u2-wizard-status:empty {\ndisplay: none;\n}\n.u2-tree {\ndisplay: flex;\nflex-direction: column;\n}\n.u2-tree > .u2-list {\nflex: 1 1 auto;\nmin-height: 0;\n}\n.u2-tree-row {\ndisplay: flex;\nalign-items: center;\nflex: 1 1 auto;\nmin-width: 0;\nheight: 100%;\nbox-sizing: border-box;\npadding-left: var(--u2-tree-indent, 0px);\nbackground-image: repeating-linear-gradient(to right,\nvar(--dg-border-subtle) 0 var(--dg-border-width), transparent var(--dg-border-width) 20px);\nbackground-size: var(--u2-tree-indent, 0px) 100%;\nbackground-repeat: no-repeat;\n}\n.u2-tree-row > .u2-tree-twistie {\ndisplay: inline-flex;\nflex: 0 0 auto;\nalign-items: center;\njustify-content: center;\nwidth: 20px;\ncolor: var(--dg-text-color-light);\ncursor: pointer;\nuser-select: none;\n}\n.u2-tree-twistie-hidden {\nvisibility: hidden;\ncursor: default;\n}\n.u2-tree-label,\n.u2-tree-loading,\n.u2-tree-error {\noverflow: hidden;\nwhite-space: nowrap;\ntext-overflow: ellipsis;\n}\n.u2-tree-loading {\ncolor: var(--dg-text-color-light);\nfont-style: italic;\n}\n.u2-tree-error {\ncolor: var(--dg-error);\n}\n.u2-tree-rename {\nflex: 1 1 auto;\nmin-width: 0;\nfont: inherit;\ncolor: var(--dg-text-color);\nbackground: var(--dg-bg);\nborder: none;\nborder-bottom: var(--dg-input-border-focus);\nborder-radius: 0;\noutline: none;\npadding: 0;\n}\n.u2-tree-check {\nflex: 0 0 auto;\nwidth: 13px;\nheight: 13px;\nmargin: 0 var(--dg-space-s) 0 0;\naccent-color: var(--dg-accent);\ncursor: pointer;\n}\n.u2-tree-check:disabled {\ncursor: default;\nopacity: 0.5;\n}\n.u2-tree-check[aria-disabled='true'] {\ncursor: default;\n}\n.u2-tree-row-disabled .u2-tree-label {\ncolor: var(--dg-text-color-light);\n}\n.u2-tree .u2-list-row:hover,\n.u2-tree .u2-list-row-current {\n--u2-list-row-over: var(--dg-hover-subtle);\n--u2-list-row-stripe: transparent;\n--u2-list-row-current: var(--dg-hover-subtle);\n}\n.u2-tree .u2-list-row-selected,\n.u2-tree .u2-list-row-selected:hover {\nbackground: var(--dg-grey-1);\ncolor: var(--dg-text-color);\n}\n.u2-tabs {\ndisplay: flex;\nflex-direction: column;\nmin-height: 0;\n}\n.u2-tabs-header {\nposition: relative;\ndisplay: flex;\nbox-sizing: border-box;\nflex-shrink: 0;\nalign-items: stretch;\nheight: var(--dg-button-height);\nbackground: var(--dg-bg);\nbox-shadow: inset 0 calc(-1 * var(--dg-border-width)) 0 var(--dg-border);\n}\n.u2-tabs-scroller {\ndisplay: flex;\nflex: 1;\nmin-width: 0;\noverflow-x: auto;\noverflow-y: hidden;\nscrollbar-width: none;\n}\n.u2-tabs-scroller::-webkit-scrollbar {\ndisplay: none;\n}\n.u2-tabs-tab {\ndisplay: flex;\nbox-sizing: border-box;\nflex-shrink: 0;\nalign-items: center;\ngap: var(--dg-space-s);\nmax-width: 180px;\npadding: 0 var(--dg-space-m);\nfont-family: var(--dg-font-family);\nfont-size: var(--dg-font-size);\ncolor: var(--dg-accent);\nborder-bottom: 2px solid transparent;\ncursor: pointer;\noutline: none;\nuser-select: none;\n}\n.u2-tabs-tab-active {\nborder-bottom-color: var(--dg-accent);\ncursor: default;\n}\n.u2-tabs:not(.u2-tabs-document):not(.u2-tabs-vertical) > .u2-tabs-header {\nheight: 34px;\nbox-shadow: none;\n}\n.u2-tabs:not(.u2-tabs-document):not(.u2-tabs-vertical) > .u2-tabs-header .u2-tabs-tab {\npadding: var(--dg-space-m) var(--dg-space-xl);\n}\n.u2-tabs:not(.u2-tabs-document):not(.u2-tabs-vertical) > .u2-tabs-header .u2-tabs-tab-active {\nmargin-bottom: 7px;\npadding-bottom: 1px;\n}\n.u2-tabs-tab:focus-visible {\noutline: var(--dg-focus-ring);\noutline-offset: calc(-1 * var(--dg-focus-ring-width) - var(--dg-border-width));\n}\n.u2-tabs-icon {\ndisplay: flex;\nflex-shrink: 0;\nalign-items: center;\njustify-content: center;\n}\n.u2-tabs-label {\noverflow: hidden;\nwhite-space: nowrap;\ntext-overflow: ellipsis;\n}\n.u2-tabs-label:empty {\ndisplay: none;\n}\n.u2-tabs-close,\n.u2-tabs-mark {\ndisplay: flex;\nflex-shrink: 0;\nalign-items: center;\njustify-content: center;\nwidth: 14px;\nheight: 14px;\nfont-size: var(--dg-font-size-xs);\ncolor: var(--dg-text-color-light);\nborder-radius: var(--dg-radius);\n}\n.u2-tabs-mark:not(.u2-tabs-dirty) {\ndisplay: none;\n}\n.u2-tabs-close::before {\ncontent: '✕';\nvisibility: hidden;\n}\n.u2-tabs-tab:hover .u2-tabs-close::before,\n.u2-tabs-tab-active .u2-tabs-close::before {\nvisibility: visible;\n}\n.u2-tabs-close:hover {\ncolor: var(--dg-text-color);\nbackground: var(--dg-hover);\n}\n.u2-tabs-close.u2-tabs-dirty::before,\n.u2-tabs-mark.u2-tabs-dirty::before {\ncontent: '●';\nfont-size: var(--dg-font-size-small);\ncolor: var(--dg-accent);\nvisibility: visible;\n}\n.u2-tabs-tab.u2-tabs-invalid,\n.u2-tabs-tab.u2-tabs-invalid:hover {\ncolor: var(--dg-error);\n}\n.u2-tabs-tab.u2-tabs-invalid .u2-tabs-mark:not(.u2-tabs-dirty) {\ndisplay: inline-flex;\n}\n.u2-tabs-tab.u2-tabs-invalid .u2-tabs-mark:not(.u2-tabs-dirty)::before {\ncontent: '●';\nfont-size: var(--dg-font-size-small);\ncolor: var(--dg-error);\n}\n.u2-tabs-tab:hover .u2-tabs-close.u2-tabs-dirty::before {\ncontent: '✕';\nfont-size: var(--dg-font-size-xs);\ncolor: var(--dg-text-color-light);\n}\n.u2-tabs-overflow {\ndisplay: none;\nbox-sizing: border-box;\nflex-shrink: 0;\nalign-items: center;\njustify-content: center;\nwidth: var(--dg-button-height);\npadding: 0;\nfont-family: var(--dg-font-family);\nfont-size: var(--dg-font-size);\ncolor: var(--dg-text-color-light);\nbackground: var(--dg-bg);\nborder: none;\ncursor: pointer;\n}\n.u2-tabs-overflow-visible {\ndisplay: flex;\n}\n.u2-tabs-overflow:hover {\ncolor: var(--dg-text-color);\nbackground: var(--dg-hover);\n}\n.u2-tabs-overflow-menu {\nposition: absolute;\ntop: 100%;\nright: 0;\nz-index: var(--dg-z-overlay);\ndisplay: none;\nbox-sizing: border-box;\nmin-width: 160px;\nmax-height: 320px;\noverflow-y: auto;\npadding: var(--dg-space-xs) 0;\nfont-family: var(--dg-font-family);\nfont-size: var(--dg-font-size);\nline-height: var(--dg-line-height);\ncolor: var(--dg-text-color);\nbackground: var(--dg-bg);\nborder: var(--dg-overlay-border);\nborder-radius: var(--dg-radius-l);\nbox-shadow: var(--dg-shadow-2);\n}\n.u2-tabs-overflow-menu-open {\ndisplay: block;\n}\n.u2-tabs-overflow-item {\ndisplay: flex;\nalign-items: center;\ngap: var(--dg-space-s);\npadding: var(--dg-space-xs) var(--dg-space-m);\nwhite-space: nowrap;\ncursor: pointer;\n}\n.u2-tabs-overflow-item:hover {\nbackground: var(--dg-hover-subtle);\n}\n.u2-tabs-overflow-item-active {\ncolor: var(--dg-selection-text);\nbackground: var(--dg-selection-bg);\n}\n.u2-tabs-content {\nflex: 1;\nmin-width: 0;\nmin-height: 0;\noverflow: auto;\npadding: var(--dg-space-m);\nbackground: var(--dg-bg);\n}\n.u2-tabs-document .u2-tabs-header,\n.u2-tabs-document .u2-tabs-overflow {\nbackground: var(--dg-bg-secondary);\n}\n.u2-tabs-document .u2-tabs-tab {\ncolor: var(--dg-text-color-light);\nbackground: var(--dg-bg-secondary);\nborder-top: 2px solid transparent;\nborder-right: var(--dg-border-width) solid var(--dg-border);\nborder-bottom: var(--dg-border-width) solid var(--dg-border);\n}\n.u2-tabs-document .u2-tabs-tab:hover {\nbackground: var(--dg-hover-subtle);\n}\n.u2-tabs-document .u2-tabs-tab-active {\ncolor: var(--dg-text-color);\nbackground: var(--dg-bg);\nborder-top-color: var(--dg-accent);\nborder-bottom-color: var(--dg-bg);\n}\n.u2-tabs-document .u2-tabs-overflow {\nborder-left: var(--dg-border-width) solid var(--dg-border);\nborder-bottom: var(--dg-border-width) solid var(--dg-border);\n}\n.u2-tabs-vertical {\nflex-direction: row;\n}\n.u2-tabs-vertical .u2-tabs-header {\nflex-direction: column;\nheight: auto;\nbox-shadow: inset calc(-1 * var(--dg-border-width)) 0 0 var(--dg-border);\n}\n.u2-tabs-vertical .u2-tabs-scroller {\nflex-direction: column;\nmin-height: 0;\noverflow-x: hidden;\noverflow-y: auto;\n}\n.u2-tabs-vertical .u2-tabs-tab {\njustify-content: flex-end;\nmin-height: var(--dg-button-height);\npadding: var(--dg-space-m);\ntext-align: right;\nborder-right: 4px solid transparent;\nborder-bottom: none;\n}\n.u2-tabs-vertical .u2-tabs-tab-active {\ncolor: var(--dg-text-color);\nborder-right-color: var(--dg-accent);\n}\n.u2-tabs-vertical .u2-tabs-overflow {\nwidth: auto;\nheight: var(--dg-button-height);\n}\n.u2-tabs-vertical .u2-tabs-overflow-menu {\nright: auto;\nleft: 0;\n}\n.u2-tabs.u2-tabs-flush:not(.u2-tabs-vertical) > .u2-tabs-header .u2-tabs-tab:first-child {\npadding-left: 0;\n}\n.u2-tabs-flush > .u2-tabs-content {\npadding-left: 0;\npadding-right: 0;\n}\n.u2-tabs-flush > .u2-tabs-content > .u2-tabs-panel {\nheight: 100%;\n}\n.u2-splitter {\nposition: relative;\ndisplay: flex;\nwidth: 100%;\nheight: 100%;\noverflow: hidden;\n}\n.u2-splitter-horizontal {\nflex-direction: row;\n}\n.u2-splitter-vertical {\nflex-direction: column;\n}\n.u2-splitter-panel {\nposition: relative;\nflex-grow: 0;\nflex-shrink: 0;\nmin-width: 0;\nmin-height: 0;\noverflow: hidden;\n}\n.u2-sash {\nposition: absolute;\nz-index: 1;\noutline: none;\ntouch-action: none;\n}\n.u2-sash::before {\ncontent: '';\nposition: absolute;\nbackground: var(--dg-border);\n}\n.u2-splitter-horizontal > .u2-sash {\ntop: 0;\nbottom: 0;\nwidth: 4px;\ncursor: col-resize;\n}\n.u2-splitter-horizontal > .u2-sash::before {\ntop: 0;\nbottom: 0;\nleft: 50%;\nwidth: var(--dg-border-width);\ntransform: translateX(-50%);\n}\n.u2-splitter-vertical > .u2-sash {\nleft: 0;\nright: 0;\nheight: 4px;\ncursor: row-resize;\n}\n.u2-splitter-vertical > .u2-sash::before {\nleft: 0;\nright: 0;\ntop: 50%;\nheight: var(--dg-border-width);\ntransform: translateY(-50%);\n}\n.u2-sash-hover::before,\n.u2-sash-active::before,\n.u2-sash:focus-visible::before {\nbackground: var(--dg-accent);\n}\n.u2-sash:focus-visible {\noutline: var(--dg-focus-ring);\n}\n.u2-splitter-dragging {\nuser-select: none;\n}\n.u2-splitter-horizontal.u2-splitter-dragging {\ncursor: col-resize;\n}\n.u2-splitter-vertical.u2-splitter-dragging {\ncursor: row-resize;\n}\n.u2-accordion {\ndisplay: flex;\nflex-direction: column;\nfont-family: var(--dg-font-family);\nfont-size: var(--dg-font-size);\nline-height: var(--dg-line-height);\ncolor: var(--dg-text-color);\nbackground: var(--dg-bg);\n}\n.u2-accordion-header {\nposition: relative;\ndisplay: flex;\nbox-sizing: border-box;\nalign-items: center;\ngap: var(--dg-space-s);\nheight: var(--dg-control-height);\npadding: 0 0 0 var(--dg-space-xxl);\ncursor: pointer;\noutline: none;\nuser-select: none;\n}\n.u2-accordion-header:hover {\nbackground: var(--dg-hover-subtle);\n}\n.u2-accordion-header:focus-visible {\noutline: var(--dg-focus-ring);\noutline-offset: calc(-1 * var(--dg-focus-ring-width) - var(--dg-border-width));\n}\n.u2-accordion-chevron {\nposition: absolute;\ntop: 0;\nbottom: 0;\nleft: 3px;\ndisplay: flex;\nalign-items: center;\njustify-content: center;\nwidth: var(--dg-space-xl);\nfont-size: var(--dg-font-size-small);\ncolor: var(--dg-text-color-light);\ntransform: rotate(-90deg);\ntransition: transform 100ms ease;\n}\n.u2-accordion-header[aria-expanded='true'] .u2-accordion-chevron {\ntransform: rotate(0);\n}\n.u2-accordion-icon {\ndisplay: flex;\nflex-shrink: 0;\nalign-items: center;\njustify-content: center;\ncolor: var(--dg-text-color-light);\n}\n.u2-accordion-title {\noverflow: hidden;\nwhite-space: nowrap;\ntext-overflow: ellipsis;\n}\n.u2-accordion-content {\npadding: 2px 0 10px 20px;\ncolor: var(--dg-grey-5);\n}\n.u2-accordion-hint {\nflex-shrink: 100;\nmin-width: 0;\nmargin-left: var(--dg-space-s);\noverflow: hidden;\nfont-size: var(--dg-font-size-small);\ncolor: var(--dg-text-color-light);\nwhite-space: nowrap;\ntext-overflow: ellipsis;\n}\n.u2-accordion-hint > [hidden] {\ndisplay: none !important;\n}\n.u2-accordion-hint:empty,\n.u2-accordion-header[aria-expanded='true'] > .u2-accordion-hint {\ndisplay: none;\n}\n.u2-accordion-pane-invalid > .u2-accordion-header > .u2-accordion-title,\n.u2-accordion-pane-invalid > .u2-accordion-header > .u2-accordion-hint {\ncolor: var(--dg-error);\n}\n.u2-accordion-flush > .u2-accordion-pane > .u2-accordion-header {\npadding: 0 var(--dg-space-xxl) 0 0;\n}\n.u2-accordion-flush > .u2-accordion-pane > .u2-accordion-header > .u2-accordion-chevron {\nleft: auto;\nright: 3px;\ntransform: none;\n}\n.u2-accordion-flush > .u2-accordion-pane > .u2-accordion-header[aria-expanded='true'] > .u2-accordion-chevron {\ntransform: rotate(180deg);\n}\n.u2-accordion-flush > .u2-accordion-pane > .u2-accordion-content {\npadding: 0 0 var(--dg-space-m);\ncolor: inherit;\n}\n.u2-breadcrumbs {\ndisplay: flex;\nbox-sizing: border-box;\nalign-items: center;\nmin-width: 0;\nmin-height: var(--dg-inline-control-height);\noverflow: hidden;\nfont-family: var(--dg-font-family);\nfont-size: var(--dg-font-size);\nline-height: var(--dg-line-height);\nwhite-space: nowrap;\n}\n.u2-breadcrumbs-item,\n.u2-breadcrumbs-current {\nbox-sizing: border-box;\nflex-shrink: 0;\nmax-width: 220px;\nheight: var(--dg-inline-control-height);\npadding: 0 var(--dg-space-xs);\noverflow: hidden;\nfont: inherit;\nwhite-space: nowrap;\ntext-overflow: ellipsis;\n}\n.u2-breadcrumbs-item {\ncolor: var(--dg-accent);\nbackground: none;\nborder: none;\nborder-radius: var(--dg-radius);\ncursor: pointer;\n}\n.u2-breadcrumbs-item:hover {\ntext-decoration: underline;\n}\n.u2-breadcrumbs-item:focus-visible {\noutline: var(--dg-focus-ring);\noutline-offset: calc(-1 * var(--dg-focus-ring-width));\n}\n.u2-breadcrumbs-ellipsis {\ncolor: var(--dg-text-color-light);\n}\n.u2-breadcrumbs-current {\ndisplay: inline-flex;\nalign-items: center;\ncolor: var(--dg-text-color);\n}\n.u2-breadcrumbs-sep {\nflex-shrink: 0;\npadding: 0 var(--dg-space-s);\ncolor: var(--dg-text-color-light);\n}\n.u2-toolbar {\n--u2-toolbar-height: calc(var(--dg-button-height) + 2 * var(--dg-space-xs));\nbox-sizing: border-box;\ndisplay: flex;\nflex: 1 1 0;\nflex-wrap: nowrap;\nalign-items: center;\ngap: var(--dg-space-xs);\nmin-width: 0;\nheight: var(--u2-toolbar-height);\nmin-height: var(--u2-toolbar-height);\nmax-height: var(--u2-toolbar-height);\npadding: var(--dg-space-xs) var(--dg-space-s);\noverflow: hidden;\nfont-family: var(--dg-font-family);\nfont-size: var(--dg-font-size);\nline-height: var(--dg-line-height);\ncolor: var(--dg-text-color);\nbackground: var(--dg-bg);\n}\n.u2-toolbar > .u2-toolbar-hidden {\ndisplay: none;\n}\n.u2-toolbar-btn {\ndisplay: inline-flex;\nbox-sizing: border-box;\nflex-shrink: 0;\nalign-items: center;\ngap: var(--dg-space-s);\nheight: var(--dg-button-height);\npadding: 0 var(--dg-space-s);\nfont: inherit;\ncolor: var(--dg-text-color);\nwhite-space: nowrap;\nbackground: none;\nborder: var(--dg-border-width) solid transparent;\nborder-radius: var(--dg-radius);\ncursor: pointer;\noutline: none;\nuser-select: none;\n}\n.u2-toolbar-btn:hover {\nbackground: var(--dg-hover-subtle);\n}\n.u2-toolbar-btn:active,\n.u2-toolbar-btn-pressed {\ncolor: var(--dg-text-color);\nbackground: var(--dg-steel-1);\nborder-color: var(--dg-border);\n}\n.u2-toolbar-btn:focus-visible {\nborder-color: var(--dg-focus);\n}\n.u2-toolbar-icon {\nfont-size: var(--dg-font-size-small);\n}\n.u2-toolbar-arrow {\nfont-size: var(--dg-font-size-xs);\ncolor: var(--dg-text-color-light);\n}\n.u2-toolbar-btn-menu .u2-toolbar-arrow {\nmargin-left: calc(-1 * var(--dg-space-xs));\n}\n.u2-toolbar-sep {\nflex-shrink: 0;\nwidth: var(--dg-border-width);\nheight: calc(var(--dg-button-height) - 2 * var(--dg-space-xs));\nmargin: 0 var(--dg-space-xs);\nbackground: var(--dg-border);\n}\n.u2-toolbar-slot {\ndisplay: flex;\nflex-shrink: 0;\nalign-items: center;\nmin-width: 0;\n}\n.u2-toolbar-overflow {\nmargin-left: auto;\npadding: 0 var(--dg-space-xs);\ncolor: var(--dg-text-color-light);\n}\n.u2-menu {\nbox-sizing: border-box;\nmin-width: 160px;\npadding: 5px 0;\nfont-family: var(--dg-font-family);\nfont-size: var(--dg-font-size);\nline-height: var(--dg-line-height);\ncolor: var(--dg-steel-5);\nbackground: var(--dg-steel-1);\nborder: none;\nborder-radius: 0;\nbox-shadow: 0 0 2px var(--dg-steel-5);\noutline: none;\n}\n.u2-menu-item {\ndisplay: grid;\ngrid-template-columns: 16px 1fr auto;\nalign-items: center;\ngap: var(--dg-space-s);\nheight: 24px;\npadding: 0 var(--dg-space-m) 0 6px;\ncursor: pointer;\nuser-select: none;\n}\n.u2-menu-item-active,\n.u2-menu-item-open {\ncolor: var(--dg-steel-5);\nbackground: var(--dg-steel-2);\n}\n.u2-menu-item[aria-disabled='true'],\n.u2-menu-item[aria-disabled='true'] .u2-menu-shortcut {\ncolor: var(--dg-text-color-disabled);\ncursor: default;\n}\n.u2-menu-item[aria-disabled='true'].u2-menu-item-active {\nbackground: none;\n}\n.u2-menu-icon {\nfont-size: var(--dg-font-size-small);\ntext-align: center;\n}\n.u2-menu-label {\noverflow: hidden;\nwhite-space: nowrap;\ntext-overflow: ellipsis;\n}\n.u2-menu-shortcut {\ncolor: var(--dg-steel-4);\nfont-size: var(--dg-font-size);\ntext-align: right;\n}\n.u2-menu-shortcut:not(:empty) {\nmargin-left: var(--dg-space-xl);\n}\n.u2-menu-arrow::after {\ncontent: '';\ndisplay: block;\nwidth: 5px;\nheight: 5px;\nmargin-right: var(--dg-space-xs);\nborder: solid var(--dg-steel-4);\nborder-width: 0 var(--dg-border-width) var(--dg-border-width) 0;\ntransform: rotate(-45deg);\n}\n.u2-menu-separator {\nheight: var(--dg-border-width);\nmargin: 5px 0;\nbackground: var(--dg-steel-3);\n}\n.u2-menu.u2-menu-detailed {\ndisplay: grid;\ngrid-template-columns: 16px auto minmax(0, 1fr) auto;\ncolumn-gap: var(--dg-space-s);\n}\n.u2-menu-detailed > .u2-menu-item {\ngrid-column: 1 / -1;\ngrid-template-columns: subgrid;\n}\n.u2-menu-detailed > .u2-menu-separator {\ngrid-column: 1 / -1;\n}\n.u2-menu-detailed .u2-menu-label-wide {\ngrid-column: 2 / 4;\n}\n.u2-menu-detail {\noverflow: hidden;\nwhite-space: nowrap;\ntext-overflow: ellipsis;\nfont-size: var(--dg-font-size-small);\ncolor: var(--dg-text-color-light);\n}\n.u2-menu-detail:not(:empty) {\npadding-left: var(--dg-space-m);\n}\n.u2-menu-bar {\ndisplay: flex;\nflex-wrap: nowrap;\nalign-items: center;\nmin-width: 0;\nfont-family: var(--dg-font-family);\nfont-size: var(--dg-font-size);\nline-height: var(--dg-line-height);\ncolor: var(--dg-text-color);\nbackground: none;\n}\n.u2-menu-bar-item {\ndisplay: inline-flex;\nbox-sizing: border-box;\nflex-shrink: 0;\nalign-items: center;\nheight: var(--dg-button-height);\npadding: 0 var(--dg-space-m);\nfont: inherit;\ncolor: inherit;\nwhite-space: nowrap;\nbackground: none;\nborder: var(--dg-border-width) solid transparent;\nborder-radius: var(--dg-radius);\ncursor: pointer;\noutline: none;\nuser-select: none;\n}\n.u2-menu-bar-item:hover {\nbackground: var(--dg-hover-subtle);\n}\n.u2-menu-bar-item-open {\ncolor: var(--dg-selection-text);\nbackground: var(--dg-selection-bg);\n}\n.u2-menu-bar-item:focus-visible {\nborder-color: var(--dg-focus);\n}\n.u2-menu-bar-item[aria-disabled='true'] {\ncolor: var(--dg-text-color-disabled);\ncursor: default;\n}\n.u2-menu-bar-item[aria-disabled='true']:hover {\nbackground: none;\n}\n.u2-dialog {\nbox-sizing: border-box;\nposition: fixed;\ndisplay: flex;\nflex-direction: column;\nmax-width: 100vw;\nmax-height: 100vh;\nfont-family: var(--dg-font-family);\nfont-size: var(--dg-font-size);\nline-height: var(--dg-line-height);\ncolor: var(--dg-text-color);\nbackground: var(--dg-bg);\nborder: var(--dg-border-width) solid var(--dg-border-subtle);\nborder-radius: 0;\nbox-shadow: var(--dg-shadow-3);\noutline: none;\n}\n.u2-dialog-backdrop {\nposition: fixed;\ninset: 0;\nbackground: var(--dg-backdrop);\n}\n.u2-dialog[hidden],\n.u2-dialog-backdrop[hidden] {\ndisplay: none;\n}\n.u2-dialog-resizable {\nmin-width: 240px;\nmin-height: 160px;\noverflow: hidden;\nresize: both;\n}\n.u2-dialog-title {\ndisplay: flex;\nalign-items: center;\nflex-shrink: 0;\ngap: 0;\nheight: 34px;\npadding: 0 10px;\nfont-size: 18px;\nfont-weight: var(--dg-font-weight-regular);\nwhite-space: nowrap;\noverflow: hidden;\ncursor: move;\nuser-select: none;\n}\n.u2-dialog-title:hover {\nbackground: var(--dg-steel-1);\n}\n.u2-dialog-title-text {\nmargin-right: auto;\npadding-right: var(--dg-space-m);\noverflow: hidden;\ntext-overflow: ellipsis;\n}\n.u2-dialog-help,\n.u2-dialog-close {\ndisplay: flex;\nalign-items: center;\njustify-content: center;\nflex-shrink: 0;\nwidth: 18px;\nheight: 18px;\npadding: 0;\nfont-size: 16px;\ncolor: var(--dg-grey-3);\nbackground: transparent;\nborder: none;\nopacity: 0;\ncursor: pointer;\n}\n.u2-dialog:hover .u2-dialog-help,\n.u2-dialog:hover .u2-dialog-close,\n.u2-dialog-help:focus-visible,\n.u2-dialog-close:focus-visible {\nopacity: 1;\n}\n.u2-dialog-help:hover,\n.u2-dialog-close:hover {\ncolor: var(--dg-text-color);\n}\n.u2-dialog-content {\nflex: 1 1 auto;\nmin-height: 0;\nmax-height: 80vh;\npadding: var(--dg-space-l);\noverflow: auto;\n}\n.u2-dialog-sized > .u2-dialog-content {\nmax-height: none;\n}\n.u2-dialog-content > .u2-input-root > .u2-input-label {\ndisplay: block;\nwidth: var(--u2-dialog-label-width, 140px);\nmin-width: 0;\nmax-width: 200px;\nline-height: var(--dg-control-height);\ncolor: var(--dg-text-color-light);\ntext-align: right;\n}\n.u2-dialog-content > .u2-input-required > .u2-input-label {\njustify-content: flex-end;\n}\n.u2-dialog-content > .u2-input-root:not(.u2-input-inline) > .u2-input-error {\npadding-left: calc(var(--u2-dialog-label-width, 140px) + var(--dg-space-m));\n}\n.u2-dialog-error {\nflex-shrink: 0;\ncontain: inline-size;\nmax-height: 25vh;\nmargin: 0 var(--dg-space-l) var(--dg-space-m);\noverflow: auto;\nfont-size: var(--dg-font-size-small);\ncolor: var(--dg-error);\nwhite-space: pre-wrap;\n}\n.u2-dialog-error[hidden] {\ndisplay: none;\n}\n.u2-dialog-buttons {\ndisplay: flex;\nalign-items: center;\njustify-content: flex-end;\nflex-shrink: 0;\ngap: var(--dg-space-m);\npadding: var(--dg-space-m) var(--dg-space-l);\nborder-top: var(--dg-border-width) solid var(--dg-border-subtle);\n}\n.u2-dialog-buttons:empty {\ndisplay: none;\n}\n.u2-dialog-reason {\nflex: 1 1 auto;\njustify-content: center;\ntext-align: center;\n}\n.u2-dialog-reason:not(.u2-status-line-problem):not(.u2-dialog-status) {\ndisplay: none;\n}\n.u2-dialog-reason.u2-dialog-status {\njustify-content: flex-start;\ntext-align: left;\n}\n.u2-dialog-start + :not(.u2-dialog-start):not(.u2-dialog-reason) {\nmargin-left: auto;\n}\n.u2-dialog-busy {\nbox-sizing: border-box;\ndisplay: inline-block;\nflex-shrink: 0;\nwidth: 12px;\nheight: 12px;\nmargin-left: var(--dg-space-s);\nborder: 2px solid currentColor;\nborder-top-color: transparent;\nborder-radius: 50%;\nvertical-align: middle;\nanimation: u2-dialog-spin 0.8s linear infinite;\n}\n@keyframes u2-dialog-spin {\nto {\ntransform: rotate(360deg);\n}\n}\n.u2-confirm {\ndisplay: flex;\ngap: 14px;\nmax-width: 440px;\n}\n.u2-confirm-icon {\nflex-shrink: 0;\nfont-size: 22px;\ncolor: var(--dg-error);\n}\n.u2-confirm-text {\ndisplay: flex;\nflex-direction: column;\ngap: 6px;\n}\n.u2-confirm-detail {\ncolor: var(--dg-text-color-light);\n}\n.u2-tooltip {\nbox-sizing: border-box;\nmax-width: 600px;\npadding: 5px;\nfont-family: var(--dg-font-family);\nfont-size: calc(var(--dg-font-size) * 0.9);\nline-height: var(--dg-line-height);\ncolor: var(--dg-warm-grey-4);\nbackground: color-mix(in srgb, var(--dg-beige-1) 88%, transparent);\nborder: var(--dg-border-width) solid var(--dg-beige-2);\nborder-radius: 2px;\nbox-shadow: 0 0 5px var(--dg-beige-2);\n}\n.u2-notify-container {\nposition: fixed;\ntop: 60px;\nright: 10px;\nwidth: 300px;\nmax-height: calc(100vh - 80px);\noverflow-y: auto;\ndisplay: flex;\nflex-direction: column;\ngap: var(--dg-space-m);\npointer-events: none;\nfont-family: var(--dg-font-family);\nfont-size: var(--dg-font-size);\nline-height: var(--dg-line-height);\n}\n.u2-notify {\npointer-events: auto;\nposition: relative;\ndisplay: flex;\nalign-items: flex-start;\ngap: var(--dg-space-m);\npadding: var(--dg-space-l) 52px var(--dg-space-l) var(--dg-space-l);\nborder-radius: var(--dg-radius);\nborder: var(--dg-border-width) solid;\nbox-shadow: var(--dg-shadow-2);\nwhite-space: pre-wrap;\n}\n.u2-notify-info {\ncolor: var(--dg-green-3);\nborder-color: var(--dg-green-2);\nbackground: var(--dg-green-1);\n}\n.u2-notify-warning {\ncolor: var(--dg-orange-3);\nborder-color: var(--dg-orange-2);\nbackground: var(--dg-orange-1);\n}\n.u2-notify-error {\ncolor: var(--dg-red-4);\nborder-color: var(--dg-red-3);\nbackground: var(--dg-red-1);\n}\n.u2-notify-type-icon {\nflex-shrink: 0;\nfont-size: var(--dg-font-size-h1);\n}\n.u2-notify-info .u2-notify-type-icon { color: var(--dg-green-2); }\n.u2-notify-warning .u2-notify-type-icon { color: var(--dg-orange-2); }\n.u2-notify-error .u2-notify-type-icon { color: var(--dg-red-3); }\n.u2-notify-content {\nflex: 1;\nmin-width: 0;\noverflow-wrap: anywhere;\n}\n.u2-notify-icons {\nposition: absolute;\ntop: var(--dg-space-m);\nright: var(--dg-space-m);\ndisplay: flex;\ngap: var(--dg-space-xs);\nopacity: 0;\n}\n.u2-notify:hover .u2-notify-icons,\n.u2-notify-icons:focus-within {\nopacity: 1;\n}\n.u2-notify-icons .u2-icon-btn {\ncolor: inherit;\n}\n.u2-notify-timer {\nposition: absolute;\nleft: 0;\nbottom: 0;\nheight: 2px;\nwidth: 100%;\nbackground: currentColor;\nanimation: u2-notify-countdown linear forwards;\n}\n.u2-notify:hover .u2-notify-timer {\nanimation-play-state: paused;\n}\n@keyframes u2-notify-countdown {\n0% { width: 100%; }\n100% { width: 0; }\n}\n.u2-tour-overlay {\nposition: fixed;\ninset: 0;\npointer-events: none;\n}\n.u2-tour-overlay svg {\nwidth: 100%;\nheight: 100%;\n}\n.u2-tour-popup {\nbox-sizing: border-box;\nposition: fixed;\nleft: 0;\ntop: 0;\ndisplay: flex;\nflex-direction: column;\ngap: var(--dg-space-m);\nmax-width: 360px;\npadding: var(--dg-space-l);\npointer-events: auto;\nfont-family: var(--dg-font-family);\nfont-size: var(--dg-font-size);\nline-height: var(--dg-line-height);\ncolor: var(--dg-text-color);\nbackground: var(--dg-bg);\nborder: var(--dg-border-width) solid var(--dg-border);\nborder-radius: var(--dg-radius);\nbox-shadow: var(--dg-shadow-2);\noutline: none;\n}\n.u2-tour-content {\noverflow-wrap: anywhere;\n}\n.u2-tour-footer {\ndisplay: flex;\nalign-items: center;\ngap: var(--dg-space-m);\n}\n.u2-tour-counter {\nmargin-left: auto;\ncolor: var(--dg-text-color-light);\nfont-size: var(--dg-font-size-small);\n}\n.u2-form {\nbox-sizing: border-box;\ndisplay: flex;\nflex-direction: column;\nmax-width: var(--u2-form-max-width, 700px);\nfont-family: var(--dg-font-family);\nfont-size: var(--dg-font-size);\nline-height: var(--dg-line-height);\ncolor: var(--dg-text-color);\n}\n.u2-form-rows {\ndisplay: flex;\nflex-direction: column;\ngap: 0;\n}\n.u2-form .u2-input-label,\n.u2-form .ui-input-label {\nmin-width: var(--u2-form-label-width, 100px);\ncolor: var(--dg-text-color-light);\ntext-align: right;\n}\n.u2-form.u2-form-measuring .u2-input-label,\n.u2-form.u2-form-measuring .ui-input-label {\nflex-basis: auto !important;\nwidth: max-content !important;\nmin-width: 0 !important;\n}\n.u2-form-captions-left .u2-input-label,\n.u2-form-captions-left .ui-input-label {\ntext-align: left;\n}\n.u2-form-rows > .u2-section + .u2-section {\nmargin-top: var(--u2-form-section-gap, 0);\n}\n.u2-form-rows > :not(.u2-input-root):not(.u2-section) {\npadding: var(--dg-space-s) 0;\n}\n.u2-form-readonly {\ndisplay: flex;\nflex-wrap: wrap;\nalign-items: center;\n}\n.u2-form-readonly-value {\ndisplay: flex;\nalign-items: center;\nmin-height: var(--dg-control-height);\npadding: 0 var(--dg-space-s);\nline-height: var(--dg-line-height);\ncolor: var(--dg-text-color);\nwhite-space: pre-wrap;\n}\n.u2-form-readonly-empty {\ncolor: var(--dg-text-color-light);\n}\n.u2-form:not(.u2-form-tall) .u2-input-error {\npadding-left: calc(var(--u2-form-label-width, 100px) + var(--dg-space-m));\n}\n.u2-form-tall .u2-input-error {\npadding-left: 0;\n}\n.u2-form:not(.u2-form-tall) .u2-form-note {\npadding-left: calc(var(--u2-form-label-width, 100px) + var(--dg-space-m));\n}\n.u2-form-note {\ncolor: var(--dg-text-color-light);\nfont-size: var(--dg-font-size-small);\n}\n.u2-form input.u2-input-editor,\n.u2-form textarea.u2-input-editor,\n.u2-form .u2-input-editor.u2-input-search,\n.ui-form .ui-input-root > .u2-input-box > input.u2-input-editor,\n.ui-form .ui-input-root > .u2-input-box > textarea.u2-input-editor,\n.ui-form .ui-input-root > .u2-input-box > .u2-input-editor.u2-input-search {\nflex: 1;\nmin-width: 0;\n}\n.u2-form .u2-input-box:has(> input.u2-input-editor),\n.u2-form .u2-input-box:has(> textarea.u2-input-editor),\n.u2-form .u2-input-box:has(> .u2-input-editor.u2-input-search),\n.ui-form .ui-input-root > .u2-input-box:has(> input.u2-input-editor),\n.ui-form .ui-input-root > .u2-input-box:has(> textarea.u2-input-editor),\n.ui-form .ui-input-root > .u2-input-box:has(> .u2-input-editor.u2-input-search) {\nflex: 1;\nmin-width: 0;\nmax-width: none;\n}\n.u2-form .u2-input-box:has(> div.u2-input-editor:not(.u2-multi-choice):not(.u2-radio):not(.u2-image)),\n.u2-dialog-content > .u2-input-root > .u2-input-box:has(> div.u2-input-editor:not(.u2-multi-choice):not(.u2-radio):not(.u2-image)) {\nflex-grow: 1;\nmax-width: none;\n}\n.u2-form .u2-input-box > div.u2-input-editor:not(.u2-multi-choice):not(.u2-radio):not(.u2-image),\n.u2-dialog-content > .u2-input-root > .u2-input-box > div.u2-input-editor:not(.u2-multi-choice):not(.u2-radio):not(.u2-image) {\nflex-grow: 1;\n}\n.u2-form-category {\nmargin-top: var(--dg-space-m);\nfont-size: var(--dg-font-size);\nfont-weight: var(--dg-font-weight-bold);\ncolor: var(--dg-text-color);\n}\n.u2-form-rows > .u2-section:first-child .u2-form-category {\nmargin-top: 0;\n}\n.u2-form-wide {\nmax-width: var(--u2-form-max-width, none);\n}\n.u2-form-wide .u2-input-box {\nflex: 1;\nmin-width: 0;\nmax-width: none;\n}\n.u2-form-wide .u2-input-editor {\nflex: 1;\nwidth: auto;\nmax-width: none;\nmin-width: 0;\n}\n.u2-form:not(.u2-form-wide):not(.u2-form-tall) .u2-input-root:not(.u2-input-fill)[data-u2='choice-input'] select.u2-input-editor,\n.u2-form-auto.u2-form-wide .u2-input-root:not(.u2-input-fill)[data-u2='choice-input'] select.u2-input-editor {\nflex: 0 1 auto;\nwidth: var(--u2-choice-width, 200px);\nmax-width: none;\n}\n.u2-form:not(.u2-form-wide):not(.u2-form-tall) .u2-input-root:not(.u2-input-fill) .u2-input-editor.u2-number,\n.u2-form-auto.u2-form-wide .u2-input-root:not(.u2-input-fill) .u2-input-editor.u2-number {\nflex: 0 1 auto;\nwidth: 150px;\nmax-width: 150px;\n}\n.u2-form:not(.u2-form-wide):not(.u2-form-tall) .u2-input-root:not(.u2-input-fill) .u2-input-editor.u2-date,\n.u2-form-auto.u2-form-wide .u2-input-root:not(.u2-input-fill) .u2-input-editor.u2-date {\nflex: 0 1 auto;\nwidth: 140px;\nmax-width: 140px;\n}\n.u2-form:not(.u2-form-wide):not(.u2-form-tall) .u2-input-root:not(.u2-input-fill)[data-u2='datetime-input'] .u2-input-editor.u2-date,\n.u2-form-auto.u2-form-wide .u2-input-root:not(.u2-input-fill)[data-u2='datetime-input'] .u2-input-editor.u2-date {\nwidth: 170px;\nmax-width: 170px;\n}\n.u2-form-auto.u2-form-wide .u2-input-root:not(.u2-input-fill)[data-u2='bigint-input'] > .u2-input-box > input.u2-input-editor,\n.u2-form-auto.u2-form-wide .u2-input-root:not(.u2-input-fill)[data-u2='qnum-input'] > .u2-input-box > input.u2-input-editor {\nmax-width: 150px;\n}\n.u2-form-fill .u2-form-auto.u2-form-wide .u2-input-root .u2-input-box:has(> .u2-input-editor:is(.u2-number, .u2-date)),\n.u2-form-fill .u2-form-auto.u2-form-wide .u2-input-root[data-u2='choice-input'] .u2-input-box {\nflex: 1;\nmax-width: none;\n}\n.u2-form-fill .u2-form-auto.u2-form-wide .u2-input-root:not(.u2-input-fill)[data-u2] .u2-input-editor:is(.u2-number, .u2-date),\n.u2-form-fill .u2-form-auto.u2-form-wide .u2-input-root:not(.u2-input-fill)[data-u2='choice-input'] select.u2-input-editor {\nflex: 1;\nwidth: auto;\nmax-width: none;\n}\n.u2-form .u2-input-caption-after > .u2-input-label {\nmin-width: 0;\n}\n.u2-form-wide .u2-input-root[data-u2='bool-input'] .u2-input-editor,\n.u2-form-wide .u2-input-root[data-u2='radio-input'] .u2-input-editor,\n.u2-form-wide .u2-input-root[data-u2='multi-choice-input'] .u2-input-editor {\nflex: none;\nwidth: auto;\n}\n.u2-form-wide .u2-input-root[data-u2='bigint-input'] > .u2-input-box > input.u2-input-editor,\n.u2-form-wide .u2-input-root[data-u2='qnum-input'] > .u2-input-box > input.u2-input-editor,\n.u2-form-tall .u2-input-root[data-u2='bigint-input'] > .u2-input-box > input.u2-input-editor,\n.u2-form-tall .u2-input-root[data-u2='qnum-input'] > .u2-input-box > input.u2-input-editor {\nmax-width: none;\n}\n.u2-form-tall .u2-input-root {\nflex-wrap: wrap;\npadding-top: var(--dg-space-m);\n}\n.u2-form-tall .u2-input-label {\nflex-basis: 100%;\nmin-width: 0;\nmax-width: none;\nheight: auto;\nmargin: 0;\nfont-size: var(--dg-font-size-small);\ncolor: var(--dg-text-color-light);\ntext-align: left;\n}\n.u2-form.u2-form-tall .u2-input-root .u2-input-box {\nflex: 1 1 100%;\nwidth: auto;\nmax-width: none;\nmin-width: 0;\n}\n.u2-form-tall .u2-input-editor {\nflex: 1;\nwidth: auto;\nmax-width: none;\nmin-width: 0;\n}\n.u2-form-tall .u2-input-root[data-u2='bool-input'] {\nflex-wrap: nowrap;\n}\n.u2-form-tall .u2-input-root[data-u2='bool-input'] > .u2-input-label {\nflex-basis: auto;\nfont-size: var(--dg-font-size);\nmargin-right: var(--dg-space-m);\n}\n.u2-form.u2-form-tall .u2-input-root[data-u2='bool-input'] .u2-input-box,\n.u2-form.u2-form-tall .u2-input-root[data-u2='bool-input'] .u2-input-editor {\nflex: none;\nwidth: auto;\n}\n.u2-form-group {\ndisplay: flex;\nalign-items: flex-start;\n}\n.u2-form-group > .u2-form-group-label {\nflex: none;\n}\n.u2-form-group-items {\ndisplay: flex;\nflex: 1;\nflex-wrap: wrap;\nalign-items: center;\ncolumn-gap: var(--dg-space-xl);\nmin-width: 0;\n}\n.u2-form .u2-form-group-items > .u2-input-root {\nflex: none;\npadding: 0;\n}\n.u2-form .u2-form-group-items .u2-input-label {\nmin-width: 0;\n}\n.u2-form .u2-form-group-items > .u2-input-caption-after > .u2-input-label {\nmargin-left: var(--dg-space-s);\ncolor: var(--dg-text-color);\ntext-align: left;\n}\n.u2-form .u2-form-group-items .u2-input-error {\npadding-left: 0;\n}\n.u2-form-tall .u2-form-group {\nflex-wrap: wrap;\npadding-top: var(--dg-space-m);\n}\n.u2-form.u2-form-tall .u2-form-group-items .u2-input-root {\nflex-wrap: nowrap;\npadding-top: 0;\n}\n.u2-form.u2-form-tall .u2-form-group-items .u2-input-label {\nflex-basis: auto;\nfont-size: var(--dg-font-size);\n}\n.u2-form.u2-form-tall .u2-form-group-items .u2-input-root .u2-input-box {\nflex: none;\n}\n.u2-form-buttons {\ndisplay: flex;\njustify-content: flex-end;\nalign-items: center;\ngap: var(--dg-space-m);\nmargin-top: var(--dg-space-l);\n}\n.u2-form-buttons.u2-form-buttons-start {\njustify-content: flex-start;\n}\n.u2-form-buttons.u2-form-buttons-editors {\njustify-content: flex-start;\npadding-left: calc(var(--u2-form-label-width, 100px) + var(--dg-space-m));\n}\n.u2-form-tall .u2-form-buttons.u2-form-buttons-editors {\npadding-left: 0;\n}\n.u2-form .u2-btn-primary:not(:disabled, [aria-disabled='true']),\n.u2-form .u2-btn-primary:hover:not(:disabled, [aria-disabled='true']),\n.u2-form .u2-btn-primary:active:not(:disabled, [aria-disabled='true']),\n.u2-form-buttons .u2-btn-primary:not(:disabled, [aria-disabled='true']),\n.u2-form-buttons .u2-btn-primary:hover:not(:disabled, [aria-disabled='true']),\n.u2-form-buttons .u2-btn-primary:active:not(:disabled, [aria-disabled='true']) {\nbackground: var(--dg-blue-2);\n}\n.u2-form .u2-btn-primary,\n.u2-form-buttons .u2-btn-primary {\npadding: 0 12px;\n}\n.u2-param-source {\ndisplay: inline-flex;\nalign-items: center;\ngap: var(--dg-space-s);\nfont-size: var(--dg-font-size-small);\n}\n.u2-param-source[hidden] {\ndisplay: none;\n}\n.u2-input-disabled .u2-param-source {\npointer-events: auto;\n}\n.u2-param-source-error {\ncolor: var(--dg-error);\nmax-width: 260px;\n}\n.u2-param-source-notice {\ncolor: var(--dg-text-color-light);\nmax-width: 260px;\n}\n.u2-input-box:has(> .u2-param-source-error),\n.u2-input-box:has(> .u2-param-source-notice) {\nflex-wrap: wrap;\n}\n.u2-input-box > .u2-param-source-error,\n.u2-input-box > .u2-param-source-notice {\nflex: 1 0 100%;\nmax-width: none;\n}\n.u2-param-source-error .u2-param-source-message,\n.u2-param-source-notice .u2-param-source-message {\nmin-width: 0;\ndisplay: -webkit-box;\n-webkit-box-orient: vertical;\n-webkit-line-clamp: 3;\noverflow: hidden;\n}\n.u2-param-auto {\nalign-self: center;\nmargin-left: var(--dg-space-s);\nfont-size: var(--dg-font-size-small);\ncolor: var(--dg-text-color-light);\nuser-select: none;\n}\n.u2-form-category.u2-form-category-l1 {\nfont-size: var(--dg-font-size-h1);\n}\n.u2-form-category.u2-form-category-l3 {\nmargin-left: var(--dg-space-m);\nfont-size: var(--dg-font-size-small);\nfont-weight: var(--dg-font-weight-regular);\ncolor: var(--dg-text-color-light);\n}\n.u2-form-buttons > [data-u2='ff-history-icon'] {\nmargin-right: auto;\n}\n.u2-form-buttons > [data-u2='ff-history-icon'][hidden] {\ndisplay: none;\n}\n.u2-func-form-history-popup {\ndisplay: flex;\nbox-sizing: border-box;\nwidth: 420px;\nheight: 320px;\npadding: var(--dg-space-s);\nborder: var(--dg-overlay-border);\nborder-radius: var(--dg-radius-l);\nbackground: var(--dg-bg);\nbox-shadow: var(--dg-shadow-2);\n}\n.u2-func-form-history-popup .u2-fch {\nflex: 1;\nmin-width: 0;\n}\n.u2-form-columns {\n--u2-form-column-gap: var(--dg-space-xxl);\ndisplay: grid;\ngrid-template-columns: repeat(auto-fill, minmax(min(100%, max(var(--u2-form-column-min, 200px),\n(100% - (var(--u2-form-columns, 2) - 1) * var(--u2-form-column-gap)) / var(--u2-form-columns, 2))), 1fr));\ncolumn-gap: var(--u2-form-column-gap);\nalign-items: start;\n}\n.u2-form-rows > .u2-form-columns {\npadding: 0;\n}\n.u2-form-columns > .u2-input-root {\nmin-width: 0;\n}\n.u2-form.u2-form .u2-form-columns[data-u2-part='columns'] > .u2-input-root:not(.u2-input-fill) > .u2-input-box {\nflex: 1 1 0;\nmin-width: 0;\nmax-width: none;\n}\n.u2-form.u2-form .u2-form-columns[data-u2-part='columns'] > .u2-input-root:not(.u2-input-fill):is([data-u2='text-input'],\n[data-u2='choice-input'], [data-u2='number-input'], [data-u2='date-input'], [data-u2='suggest-input']) > .u2-input-box > .u2-input-editor {\nflex: 1 1 auto;\nwidth: auto;\nmin-width: 0;\nmax-width: none;\n}\n.u2-section {\nfont-family: var(--dg-font-family);\nfont-size: var(--dg-font-size);\nline-height: var(--dg-line-height);\ncolor: var(--dg-text-color);\n}\n.u2-section-header {\nposition: relative;\ndisplay: flex;\nalign-items: center;\nfont-weight: var(--dg-font-weight-bold);\noutline: none;\n}\n.u2-section-header[hidden] {\ndisplay: none;\n}\n.u2-section-header[role='button'] {\ncursor: pointer;\nuser-select: none;\n}\n.u2-section-header:focus-visible {\noutline: var(--dg-focus-ring);\noutline-offset: calc(-1 * var(--dg-focus-ring-width));\n}\n.u2-section-chevron {\nposition: absolute;\ntop: 0;\nbottom: 0;\nleft: calc(-1 * var(--dg-space-xl));\ndisplay: flex;\nalign-items: center;\njustify-content: center;\nwidth: var(--dg-space-xl);\nfont-size: var(--dg-font-size-small);\ncolor: var(--dg-text-color-light);\nopacity: 0;\ntransition: transform 100ms ease, opacity 100ms ease;\n}\n.u2-section-header:hover .u2-section-chevron,\n.u2-section-header:focus-visible .u2-section-chevron {\nopacity: 1;\n}\n.u2-section-header[aria-expanded='false'] .u2-section-chevron {\nopacity: 1;\ntransform: rotate(-90deg);\n}\n.u2-section-title {\nflex: none;\nmax-width: 100%;\noverflow: hidden;\nwhite-space: nowrap;\ntext-overflow: ellipsis;\n}\n.u2-section-hint {\nmin-width: 0;\nmargin-left: var(--dg-space-m);\noverflow: hidden;\nfont-weight: var(--dg-font-weight-regular);\ncolor: var(--dg-text-color-light);\nwhite-space: nowrap;\ntext-overflow: ellipsis;\n}\n.u2-section-hint:empty {\ndisplay: none;\n}\n.u2-section-header[aria-expanded='true'] > .u2-section-hint {\ndisplay: none;\n}\n.u2-section-invalid > .u2-section-header > .u2-section-title,\n.u2-section-invalid > .u2-section-header > .u2-section-hint,\n.u2-section-header[aria-invalid='true'] > .u2-section-title,\n.u2-section-header[aria-invalid='true'] > .u2-section-hint {\ncolor: var(--dg-error);\n}\n.u2-section-hint > [hidden] {\ndisplay: none !important;\n}\n.u2-section-actions {\ndisplay: inline-flex;\nflex: none;\nalign-items: center;\ngap: var(--dg-space-xs);\nmargin-left: var(--dg-space-m);\nfont-weight: var(--dg-font-weight-regular);\n}\n.u2-section-reason {\nmin-width: 0;\nmargin-left: var(--dg-space-m);\noverflow: hidden;\nfont-weight: var(--dg-font-weight-regular);\ncolor: var(--dg-text-color-light);\nwhite-space: nowrap;\ntext-overflow: ellipsis;\n}\n.u2-section-reason:empty {\ndisplay: none;\n}\n.u2-section-header.u2-section-chevron-end > .u2-section-chevron {\nposition: static;\nflex: none;\nwidth: auto;\nmargin-left: var(--dg-space-s);\nopacity: 1;\ntransform: none;\n}\n.u2-section-header.u2-section-chevron-end[aria-expanded='true'] > .u2-section-chevron {\ntransform: rotate(180deg);\n}\n.u2-section-body {\ndisplay: flex;\nflex-direction: column;\n}\n.u2-splitter-panel:has(> .u2-section) {\ndisplay: flex;\nflex-direction: column;\n}\n.u2-splitter-panel > .u2-section {\ndisplay: flex;\nflex: 1;\nflex-direction: column;\nmin-height: 0;\n}\n.u2-splitter-panel > .u2-section > .u2-section-body {\nflex: 1;\nmin-height: 0;\n}\n.u2-page {\ndisplay: flex;\nflex-direction: column;\nbox-sizing: border-box;\nheight: 100%;\nmin-height: 0;\nfont-family: var(--dg-font-family);\nfont-size: var(--dg-font-size);\nline-height: var(--dg-line-height);\ncolor: var(--dg-text-color);\n}\n.u2-page-header {\nflex: none;\npadding: var(--u2-page-padding-y, var(--dg-space-l)) var(--u2-page-padding-x, var(--dg-space-xxl)) 0;\n}\n.u2-page-body {\n--u2-form-max-width: var(--u2-page-max-width, 700px);\ndisplay: flex;\nflex: 1 1 auto;\nflex-direction: column;\ngap: var(--u2-page-gap, var(--dg-space-xxl));\nbox-sizing: border-box;\nmin-height: 0;\npadding: var(--u2-page-padding-y, var(--dg-space-l)) var(--u2-page-padding-x, var(--dg-space-xxl));\noverflow: auto;\n}\n.u2-page-body > * {\nflex: none;\nmax-width: var(--u2-page-max-width, none);\n}\n.u2-page-section {\ndisplay: flex;\nflex-direction: column;\ngap: var(--dg-space-m);\nmin-width: 0;\n}\n.u2-page-section-header {\ndisplay: flex;\nalign-items: center;\ngap: var(--dg-space-xs);\nmin-width: 0;\n}\n.u2-page-section-title {\nmargin: 0 6px 0 0;\n}\n.u2-page-section-content {\nmin-width: 0;\npadding-left: var(--u2-page-section-indent, 0);\n}\n.u2-page-footer {\ndisplay: flex;\nflex: none;\nalign-items: center;\njustify-content: flex-end;\ngap: var(--dg-space-m);\npadding: var(--dg-space-l) var(--u2-page-padding-x, var(--dg-space-xxl));\nborder-top: var(--dg-border-width) solid var(--dg-border);\n}\n.u2-page-footer:empty {\ndisplay: none;\n}\n.u2-page-footer > .u2-status-line {\nflex: 1 1 auto;\nmin-width: 0;\n}\n.u2-page-footer > .u2-form-buttons {\nflex: 1 1 auto;\nmargin-top: 0;\n}\n.u2-page-footer > .u2-form-buttons > .u2-status-line {\nflex: 1 1 auto;\nmin-width: 0;\n}\n.u2-master-detail {\nbox-sizing: border-box;\nheight: var(--u2-master-detail-height, 100%);\nmin-height: 0;\nfont-family: var(--dg-font-family);\nfont-size: var(--dg-font-size);\nline-height: var(--dg-line-height);\ncolor: var(--dg-text-color);\nborder: var(--dg-border-width) solid var(--dg-border);\nborder-radius: var(--dg-radius);\noverflow: hidden;\n}\n.u2-master-detail-list {\nbox-sizing: border-box;\nheight: 100%;\npadding: var(--dg-space-s) 0;\noverflow-y: auto;\noutline: none;\n}\n.u2-master-detail-list:focus-visible {\noutline: var(--dg-focus-ring);\noutline-offset: calc(-1 * var(--dg-focus-ring-width));\n}\n.u2-master-detail-row {\ndisplay: flex;\nalign-items: center;\ngap: 6px;\nheight: var(--dg-control-height);\npadding: 0 var(--dg-space-m);\ncursor: pointer;\n}\n.u2-master-detail-row:hover {\nbackground: var(--dg-hover-subtle);\n}\n.u2-master-detail-row-current,\n.u2-master-detail-row-current:hover {\nbackground: var(--u2-row-selected-bg);\n}\n.u2-master-detail-check {\nflex: none;\nmargin: 0;\n}\n.u2-master-detail-label {\nflex: 1;\nmin-width: 0;\noverflow: hidden;\nwhite-space: nowrap;\ntext-overflow: ellipsis;\n}\n.u2-master-detail-hint,\n.u2-master-detail-reason,\n.u2-master-detail-empty {\nfont-size: var(--dg-font-size-small);\ncolor: var(--dg-grey-4);\n}\n.u2-master-detail-detail {\nbox-sizing: border-box;\nheight: 100%;\nmin-width: 0;\noverflow: hidden;\n}\n.u2-master-detail-empty {\ndisplay: block;\npadding: var(--dg-space-m) var(--dg-space-l);\n}\n.u2-master-detail-pane {\ndisplay: flex;\nflex-direction: column;\ngap: var(--dg-space-s);\nbox-sizing: border-box;\nheight: 100%;\npadding: var(--dg-space-s) var(--dg-space-l);\noverflow-y: auto;\n}\n.u2-master-detail-pane[hidden],\n.u2-master-detail-reason[hidden],\n.u2-master-detail-empty[hidden] {\ndisplay: none;\n}\n.u2-master-detail-content {\ndisplay: flex;\nflex: 1 1 auto;\nflex-direction: column;\ngap: var(--dg-space-s);\nmin-height: 0;\n}\n.u2-master-detail-content > :is(.u2-div-v, .u2-list, .u2-tree, .u2-data-table),\n.u2-master-detail-content > .u2-div-v > :is(.u2-list, .u2-tree, .u2-data-table) {\nflex: 1 1 auto;\nmin-height: 0;\n}\n.u2-card {\ndisplay: flex;\nbox-sizing: border-box;\nflex-direction: column;\ngap: var(--dg-space-m);\npadding: var(--dg-space-l);\nfont-family: var(--dg-font-family);\nfont-size: var(--dg-font-size);\ncolor: var(--dg-text-color);\nbackground: var(--dg-bg);\nborder: var(--dg-border-width) solid var(--dg-border);\nborder-radius: var(--dg-radius-l);\n}\n.u2-card-header {\ndisplay: flex;\nalign-items: center;\ngap: var(--dg-space-m);\n}\n.u2-card-icon {\nflex-shrink: 0;\ncolor: var(--dg-text-color-light);\n}\n.u2-card-titles {\ndisplay: flex;\nmin-width: 0;\nflex-direction: column;\ngap: var(--dg-space-xs);\n}\n.u2-card-title {\noverflow: hidden;\nfont-size: var(--dg-font-size-h2);\nfont-weight: var(--dg-font-weight-medium);\ntext-overflow: ellipsis;\nwhite-space: nowrap;\n}\n.u2-card-subtitle {\nfont-size: var(--dg-font-size-small);\ncolor: var(--dg-text-color-light);\n}\n.u2-card-actions {\ndisplay: flex;\nalign-items: center;\ngap: var(--dg-space-s);\nmargin-left: auto;\n}\n.u2-card-media {\noverflow: hidden;\nborder-radius: var(--dg-radius);\n}\n.u2-card-media-img {\ndisplay: block;\nwidth: 100%;\nobject-fit: cover;\n}\n.u2-card-body {\nmin-width: 0;\noverflow-wrap: break-word;\n}\n.u2-card-footer {\ndisplay: flex;\nalign-items: center;\ngap: var(--dg-space-m);\npadding-top: var(--dg-space-m);\nborder-top: var(--dg-border-width) solid var(--dg-border-subtle);\n}\n.u2-card-clickable {\ncursor: pointer;\n}\n.u2-card-clickable:hover {\nbackground: var(--dg-hover);\n}\n.u2-card-clickable:focus-visible,\n.u2-card-selectable:focus-visible {\noutline: var(--dg-focus-ring);\noutline-offset: calc(-1 * var(--dg-focus-ring-width));\n}\n.u2-card-selectable {\ncursor: pointer;\n}\n.u2-card-selected {\noutline: 2px solid var(--dg-accent-secondary);\noutline-offset: calc(-1 * var(--dg-border-width));\n}\n.u2-card-compact {\ngap: var(--dg-space-s);\npadding: var(--dg-space-m);\n}\n.u2-card-compact .u2-card-title {\nfont-size: var(--dg-font-size);\n}\n.u2-stat-card {\nposition: relative;\ngap: var(--dg-space-xs);\n}\n.u2-stat-value {\nfont-size: calc(var(--dg-font-size-h1) * 1.75);\nfont-weight: var(--dg-font-weight-medium);\nline-height: 1.2;\ncolor: var(--dg-text-color);\noverflow-wrap: anywhere;\n}\n.u2-stat-card:has(> .u2-stat-icon) .u2-stat-value {\npadding-right: calc(var(--dg-font-size) + var(--dg-space-m));\n}\n.u2-stat-value .u2-skeleton {\npadding: 0;\n}\n.u2-stat-value .u2-skeleton-line {\nheight: var(--dg-space-xl);\n}\n.u2-stat-label {\nfont-size: var(--dg-font-size-small);\ncolor: var(--dg-text-color-light);\n}\n.u2-stat-delta {\ndisplay: flex;\nalign-items: center;\ngap: var(--dg-space-xs);\nfont-size: var(--dg-font-size-small);\ncolor: var(--dg-text-color-light);\n}\n.u2-stat-delta-up {\ncolor: var(--dg-success);\n}\n.u2-stat-delta-down {\ncolor: var(--dg-failure);\n}\n.u2-stat-icon {\nposition: absolute;\ntop: var(--dg-space-l);\nright: var(--dg-space-l);\ncolor: var(--dg-text-color-light);\n}\n.u2-stat-error {\nfont-size: var(--dg-font-size-small);\nline-height: var(--dg-line-height);\ncolor: var(--dg-error);\n}\n.u2-app-header {\ndisplay: flex;\nbox-sizing: border-box;\ngap: 30px;\npadding: var(--dg-space-l);\nfont-family: var(--dg-font-family);\nfont-size: var(--dg-font-size);\ncolor: var(--dg-text-color);\n}\n.u2-app-header-named {\ngap: 60px;\n}\n.u2-app-header-rule {\nborder-bottom: var(--dg-border-width) solid var(--dg-border);\n}\n.u2-app-header-lead {\ndisplay: flex;\nmin-width: 0;\nalign-items: flex-start;\ngap: 20px;\n}\n.u2-app-header-icon {\n--u2-app-header-icon: var(--u2-app-header-icon-size);\ndisplay: block;\nmin-width: 0;\nwidth: var(--u2-app-header-icon);\nheight: var(--u2-app-header-icon);\nobject-fit: contain;\nbackground-repeat: no-repeat;\nbackground-position: center;\nbackground-size: contain;\n}\ni.u2-app-header-icon {\nfont-size: calc(var(--u2-app-header-icon) * 0.8);\nline-height: var(--u2-app-header-icon);\ntext-align: center;\n}\n.u2-app-header-names {\ndisplay: flex;\nflex-direction: column;\ngap: 10px;\nmargin-top: 10px;\n}\n.u2-app-header-title {\nfont-size: 20px;\nfont-weight: var(--dg-font-weight-bold);\n}\n.u2-app-header-body {\ndisplay: flex;\nmin-width: 0;\nflex-direction: column;\ngap: 10px;\nmargin: 10px 0;\npadding: var(--dg-space-l);\n}\n.u2-app-header-items {\nmargin: 0;\npadding-left: 15px;\nlist-style: disc;\n}\n.u2-app-header-item + .u2-app-header-item {\nmargin-top: 6px;\n}\n.u2-app-header-learn-more {\nalign-self: flex-start;\nmargin-left: 15px;\n}\n.u2-app-header-body:not(:has(> .u2-app-header-learn-more))::after {\ncontent: '';\n}\n.u2-app-header-external {\nmargin: 0 0.2em;\nfont-size: 0.8em;\n}\n.u2-app-header-compact .u2-app-header-icon {\n--u2-app-header-icon: min(var(--u2-app-header-icon-size), 96px);\n}\n.u2-app-header.u2-app-header-narrow {\nflex-direction: column;\ngap: var(--dg-space-m);\npadding-left: 0;\n}\n.u2-app-header-narrow .u2-app-header-icon {\n--u2-app-header-icon: min(var(--u2-app-header-icon-size), 64px);\n}\n.u2-propgrid {\ndisplay: flex;\nflex-direction: column;\nbox-sizing: border-box;\nfont-family: var(--dg-font-family);\nfont-size: var(--dg-font-size);\nline-height: var(--dg-line-height);\ncolor: var(--dg-text-color);\nbackground: var(--dg-bg);\n}\n.u2-propgrid-row {\ndisplay: grid;\ngrid-template-columns: minmax(80px, 40%) 1fr;\nalign-items: center;\nbox-sizing: border-box;\nmin-height: var(--dg-inline-control-height);\ncolumn-gap: var(--dg-space-m);\npadding: 0 var(--dg-space-m);\n}\n.u2-propgrid-row:hover {\nbackground: var(--dg-hover-subtle);\n}\n.u2-propgrid-name {\noverflow: hidden;\ncolor: var(--dg-text-color-light);\nwhite-space: nowrap;\ntext-overflow: ellipsis;\n}\n.u2-propgrid-editor {\nmin-width: 0;\n}\n.u2-propgrid-value {\ndisplay: block;\noverflow: hidden;\npadding: 0 var(--dg-space-s);\nwhite-space: nowrap;\ntext-overflow: ellipsis;\n}\n.u2-propgrid-editor > .u2-input-root {\nwidth: 100%;\n}\n.u2-propgrid-editor input.u2-input-editor,\n.u2-propgrid-editor select.u2-input-editor,\n.u2-propgrid-editor .u2-input-editor.u2-number {\nflex: 1;\nmin-width: 0;\n}\n.u2-propgrid-editor .u2-input-editor.u2-number {\nmax-width: none;\n}\n.u2-propgrid-editor > .u2-input-root > .u2-input-box {\nflex: 1 1 0;\nmin-width: 60px;\nmax-width: none;\n}\n.u2-propgrid-category {\ndisplay: flex;\nbox-sizing: border-box;\nalign-items: center;\ngap: var(--dg-space-s);\nheight: var(--dg-inline-control-height);\npadding: 0 var(--dg-space-s);\nfont-weight: var(--dg-font-weight-bold);\nbackground: var(--dg-bg-secondary);\nborder-top: var(--dg-border-width) solid var(--dg-border-subtle);\ncursor: pointer;\noutline: none;\nuser-select: none;\n}\n.u2-propgrid-category:hover {\nbackground: var(--dg-hover);\n}\n.u2-propgrid-category:focus-visible {\noutline: var(--dg-focus-ring);\noutline-offset: calc(-1 * var(--dg-focus-ring-width) - var(--dg-border-width));\n}\n.u2-propgrid-chevron {\ndisplay: flex;\nflex-shrink: 0;\nalign-items: center;\njustify-content: center;\nwidth: 12px;\nfont-size: var(--dg-font-size-xs);\ncolor: var(--dg-text-color-light);\ntransition: transform 100ms ease;\n}\n.u2-propgrid-category[aria-expanded='true'] .u2-propgrid-chevron {\ntransform: rotate(90deg);\n}\n.u2-propgrid-category-title {\noverflow: hidden;\nwhite-space: nowrap;\ntext-overflow: ellipsis;\n}\n.u2-input-editor.u2-access-grid {\nwidth: 100%;\nborder-collapse: collapse;\nfont-family: var(--dg-font-family);\nfont-size: var(--dg-font-size);\ncolor: var(--dg-text-color);\n}\n.u2-access-grid th {\nheight: var(--dg-control-height);\npadding: 0 var(--dg-space-m);\nfont-size: var(--dg-font-size-small);\nfont-weight: var(--dg-font-weight-regular);\ncolor: var(--dg-text-color-light);\ntext-align: left;\nwhite-space: nowrap;\nborder-bottom: var(--dg-border-width) solid var(--dg-border);\n}\n.u2-access-grid td {\nheight: var(--dg-control-height);\npadding: var(--dg-space-xs) var(--dg-space-m);\nborder-bottom: var(--dg-border-width) solid var(--dg-border-subtle);\n}\n.u2-access-grid th.u2-access-grid-cap,\n.u2-access-grid td.u2-access-grid-cap {\nwidth: 56px;\ntext-align: center;\n}\n.u2-access-grid th.u2-access-grid-action,\n.u2-access-grid td.u2-access-grid-action {\nwidth: var(--dg-inline-control-height);\npadding: 0;\ntext-align: center;\n}\n.u2-access-grid-icon {\ndisplay: inline-flex;\nmargin-right: var(--dg-space-m);\nvertical-align: middle;\n}\n.u2-access-grid-principal {\nvertical-align: middle;\n}\n.u2-access-grid-inherited .u2-access-grid-principal {\ncolor: var(--dg-text-color-light);\n}\n.u2-access-grid-from {\nmargin-left: var(--dg-space-s);\nfont-size: var(--dg-font-size-small);\ncolor: var(--dg-text-color-light);\n}\n.u2-access-grid-remove {\nwidth: var(--dg-inline-control-height);\nheight: var(--dg-inline-control-height);\npadding: 0;\nfont: inherit;\nfont-size: var(--dg-font-size-small);\ncolor: var(--dg-text-color-light);\nbackground: none;\nborder: none;\nborder-radius: var(--dg-radius);\ncursor: pointer;\n}\n.u2-access-grid-remove:hover {\ncolor: var(--dg-text-color);\nbackground: var(--dg-hover);\n}\n.u2-access-grid tfoot td {\npadding-top: var(--dg-space-s);\nborder-bottom: none;\n}\n.u2-access-grid-add {\nwidth: 100%;\nheight: var(--dg-inline-control-height);\nfont: inherit;\nfont-size: var(--dg-font-size-small);\ncolor: var(--dg-accent);\nbackground: none;\nborder: none;\ncursor: pointer;\n}\n.u2-input-editor.u2-records {\ndisplay: flex;\nflex: 1;\nflex-direction: column;\nmin-width: 0;\nheight: auto;\npadding: 0;\n}\n.u2-input-root:not(.u2-input-inline)[data-u2='records-input'] > .u2-input-box {\nflex: 1 1 0;\nmin-width: var(--dg-form-min-editor-width);\nmax-width: none;\n}\n.u2-records-row {\ndisplay: grid;\ngrid-template-columns: var(--u2-records-tracks);\nalign-items: center;\ncolumn-gap: var(--dg-space-m);\nmin-height: var(--dg-control-height);\n}\n.u2-records-head {\nmin-height: 20px;\nfont-size: var(--dg-font-size-small);\ncolor: var(--dg-text-color-light);\n}\n.u2-records-head[hidden] {\ndisplay: none;\n}\n.u2-records-header {\noverflow: hidden;\nwhite-space: nowrap;\ntext-overflow: ellipsis;\n}\n.u2-records-cell {\nmin-width: 0;\n}\n.u2-records-cell > .u2-input-box {\nwidth: 100%;\n}\n.u2-records-row .u2-records-cell .u2-input-editor {\nwidth: 100%;\nmin-width: 0;\n}\n.u2-records-cell > .u2-input-error {\ndisplay: none;\n}\n.u2-input-editor.u2-records.u2-invalid,\n.u2-input-editor.u2-records.u2-invalid:focus-within {\nborder-bottom: none;\n}\n.u2-records-add {\ndisplay: inline-flex;\nalign-items: center;\nalign-self: flex-start;\ngap: var(--dg-space-s);\nheight: var(--dg-control-height);\n}\n.u2-records-add-icon {\nfont-size: 11px;\n}\n.u2-input-disabled .u2-records-add,\n.u2-input-readonly .u2-records-add,\n.u2-input-disabled .u2-records-remove,\n.u2-input-readonly .u2-records-remove {\nvisibility: hidden;\n}\ndiv.u2-input-editor.u2-checklist {\ndisplay: flex;\nflex-direction: column;\nmin-width: 150px;\nheight: auto;\npadding: var(--dg-space-s) 0;\nborder: none;\n}\ndiv.u2-input-editor.u2-checklist.u2-invalid,\ndiv.u2-input-editor.u2-checklist.u2-invalid:focus-within {\nborder-bottom: none;\n}\n.u2-checklist-item {\ndisplay: flex;\nalign-items: center;\nmin-height: 20px;\nwhite-space: nowrap;\n}\n.u2-checklist-label {\ndisplay: flex;\nflex: 1 1 auto;\nalign-items: center;\nmin-width: 0;\ncursor: pointer;\n}\n.u2-checklist-label > .u2-input-checkbox {\nmargin: 0 var(--dg-space-m) 0 var(--dg-space-s);\n}\n.u2-checklist-empty {\ndisplay: flex;\nalign-items: center;\nheight: 20px;\npadding: 0 var(--dg-space-s);\ncolor: var(--dg-text-color-light);\nwhite-space: nowrap;\n}\n.u2-reorder-grip {\nflex-shrink: 0;\ncolor: var(--dg-grey-3);\ncursor: grab;\ntouch-action: none;\n}\n.u2-input-disabled .u2-reorder-grip,\n.u2-input-readonly .u2-reorder-grip {\nvisibility: hidden;\n}\n.u2-reorder-dragging {\nbackground: var(--dg-hover-subtle);\n}\n.u2-loader {\ndisplay: inline-flex;\nalign-items: center;\ngap: var(--dg-space-m);\nfont-family: var(--dg-font-family);\nfont-size: var(--dg-font-size);\ncolor: var(--dg-text-color-light);\n}\n.u2-loader-spinner {\nbox-sizing: border-box;\nflex-shrink: 0;\nwidth: 16px;\nheight: 16px;\nborder: 2px solid var(--dg-border);\nborder-top-color: var(--dg-accent);\nborder-radius: 50%;\nanimation: u2-loader-spin 0.8s linear infinite;\n}\n@keyframes u2-loader-spin {\nto {\ntransform: rotate(360deg);\n}\n}\n.u2-skeleton {\ndisplay: flex;\nflex-direction: column;\ngap: var(--dg-space-m);\npadding: var(--dg-space-m) 0;\n}\n.u2-skeleton-line {\nheight: var(--dg-space-l);\nbackground: var(--dg-bg-secondary);\nborder-radius: var(--dg-radius);\nanimation: u2-skeleton-pulse 1.4s ease-in-out infinite;\n}\n.u2-skeleton-line:last-child {\nwidth: 60%;\n}\n@keyframes u2-skeleton-pulse {\n50% {\nbackground: var(--dg-border);\n}\n}\n.u2-async-stale > * {\nopacity: 0.6;\n}\n.u2-async-empty {\npadding: var(--dg-space-xl);\ntext-align: center;\ncolor: var(--dg-text-color-light);\n}\n.u2-empty-state {\ndisplay: flex;\nflex-direction: column;\nalign-items: center;\njustify-content: center;\ngap: var(--dg-space-m);\npadding: var(--dg-space-xl);\ntext-align: center;\nfont-family: var(--dg-font-family);\n}\n.u2-empty-state-icon {\nfont-size: 24px;\ncolor: var(--dg-grey-3);\n}\n.u2-empty-state-text {\nmax-width: 480px;\nfont-size: var(--dg-font-size-h2);\ncolor: var(--dg-text-color);\n}\n.u2-empty-state-error .u2-empty-state-icon,\n.u2-empty-state-error .u2-empty-state-text {\ncolor: var(--dg-error);\n}\n.u2-empty-state-actions {\ndisplay: flex;\nalign-items: center;\ngap: var(--dg-space-m);\n}\n.u2-async-error {\ndisplay: flex;\nalign-items: center;\ngap: var(--dg-space-m);\npadding: var(--dg-space-m) 0;\n}\n.u2-async-error-message {\ncolor: var(--dg-error);\n}\n.u2-async-quiet .u2-async-error {\npadding: var(--dg-space-s) 0;\n}\n.u2-async-quiet .u2-async-error-message {\ncolor: var(--dg-text-color-light);\n}\n@media (prefers-reduced-motion: reduce) {\n.u2-loader-spinner {\nwidth: auto;\nheight: auto;\nborder: none;\nborder-radius: 0;\ncolor: var(--dg-accent);\nanimation: none;\n}\n.u2-loader-spinner::after {\ncontent: '•••';\n}\n.u2-skeleton-line {\nanimation: none;\n}\n}\n.u2-typeahead {\ndisplay: inline-block;\n}\n.u2-typeahead-input {\nbox-sizing: border-box;\nwidth: 100%;\nheight: var(--dg-control-height);\npadding: 0 var(--dg-space-xs);\nfont: inherit;\nfont-family: var(--dg-font-family);\nfont-size: var(--dg-font-size);\ncolor: var(--dg-text-color);\nbackground: var(--dg-bg);\nborder: none;\nborder-bottom: var(--dg-input-border);\nborder-radius: 0;\noutline: none;\n}\n.u2-typeahead-input:focus {\nborder-bottom: var(--dg-input-border-focus);\n}\n.u2-typeahead-input::placeholder {\ncolor: var(--dg-text-color-light);\n}\n.u2-typeahead-popup {\nmin-width: 240px;\nmax-width: 480px;\n}\n.u2-input-root:has(.u2-typeahead-input[aria-expanded='true']) > .u2-input-error {\nvisibility: hidden;\n}\n.u2-typeahead-option-active .u2-typeahead-text,\n.u2-typeahead-option-active .u2-typeahead-user-name {\ncolor: var(--dg-accent);\n}\n.u2-typeahead-text {\noverflow: hidden;\nwhite-space: nowrap;\ntext-overflow: ellipsis;\n}\n.u2-typeahead-user {\ndisplay: flex;\nalign-items: center;\ngap: var(--dg-space-m);\nmin-width: 0;\n}\n.u2-typeahead-user-text {\nmin-width: 0;\n}\n.u2-typeahead-user-name,\n.u2-typeahead-user-secondary {\noverflow: hidden;\nwhite-space: nowrap;\ntext-overflow: ellipsis;\n}\n.u2-typeahead-user-secondary {\nfont-size: var(--dg-font-size-small);\ncolor: var(--dg-text-color-light);\n}\n.u2-typeahead-user-secondary:empty::before {\ncontent: '\\00a0';\n}\n.u2-avatar {\nbox-sizing: border-box;\ndisplay: flex;\nflex-shrink: 0;\nalign-items: center;\njustify-content: center;\nwidth: 20px;\nheight: 20px;\noverflow: hidden;\nfont-size: var(--dg-font-size-xs);\nfont-weight: var(--dg-font-weight-medium);\nline-height: 1;\ncolor: var(--dg-white);\nborder-radius: 50%;\n}\n.u2-avatar-picture > * {\nwidth: 100%;\nheight: 100%;\n}\n.u2-avatar-group {\nfont-size: var(--dg-font-size);\ncolor: var(--dg-text-color-light);\n}\n.u2-avatar-1 { background: var(--dg-steel-4); }\n.u2-avatar-2 { background: var(--dg-blue-1); }\n.u2-avatar-3 { background: var(--dg-green-2); }\n.u2-avatar-4 { background: var(--dg-orange-3); }\n.u2-avatar-5 { background: var(--dg-steel-5); }\n.u2-avatar-6 { background: var(--dg-grey-5); }\n.u2-pick-box {\nposition: relative;\ndisplay: flex;\nalign-items: center;\nflex: 1;\nmin-width: 0;\n}\n.u2-pick-box.u2-input-editor {\npadding: 0;\n}\n.u2-pick-box.u2-input-editor.u2-invalid {\nborder-bottom: none;\n}\n.u2-pick-box.u2-invalid .u2-typeahead-input {\nborder-bottom-color: var(--dg-error);\n}\n.u2-pick-box::before {\ncontent: '';\nposition: absolute;\nright: var(--dg-space-s);\nvisibility: hidden;\nwidth: 12px;\nheight: 12px;\npointer-events: none;\nbackground-color: var(--dg-text-color-light);\n-webkit-mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='6.8' cy='6.8' r='4.6'/%3E%3Cpath d='M10.2 10.2 14 14'/%3E%3C/svg%3E\") no-repeat center / 12px;\nmask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='6.8' cy='6.8' r='4.6'/%3E%3Cpath d='M10.2 10.2 14 14'/%3E%3C/svg%3E\") no-repeat center / 12px;\n}\n.u2-pick-box > .u2-typeahead {\nflex: 1;\nmin-width: 0;\n}\n.u2-input-root:not(.u2-input-disabled) .u2-pick-box:is(:hover, :focus-within):has(> .u2-input-clear[hidden])::before {\nvisibility: visible;\n}\n.u2-pick-box .u2-typeahead-input {\npadding: 0 20px 0 var(--dg-space-s);\n}\n.u2-pick-box-open .u2-typeahead-input {\npadding-right: 40px;\n}\n.u2-btn.u2-icon-btn.u2-pick-open {\nposition: absolute;\nright: 20px;\nwidth: 16px;\nmin-width: 16px;\nheight: 16px;\nfont-size: var(--dg-font-size-xs);\nvisibility: hidden;\n}\n.u2-input-root:not(.u2-input-disabled):hover .u2-pick-open,\n.u2-pick-box:focus-within .u2-pick-open {\nvisibility: visible;\n}\n.u2-pick-open[hidden] {\ndisplay: none;\n}\n.u2-pick-hint {\nflex: 1 0 100%;\nmin-width: 0;\nfont-size: var(--dg-font-size-small);\ncolor: var(--dg-text-color-light);\n}\n.u2-pick-dropdown .u2-typeahead-input {\ncursor: pointer;\n}\n.u2-pick-dropdown .u2-pick-box::before {\nvisibility: visible;\n-webkit-mask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E\") no-repeat center / 12px;\nmask: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E\") no-repeat center / 12px;\n}\n.u2-pick-dropdown:hover .u2-pick-box:has(> .u2-input-clear:not([hidden]))::before {\nvisibility: hidden;\n}\n.u2-chip {\ndisplay: inline-flex;\ngap: var(--dg-space-xs);\nalign-items: center;\nmax-width: 100%;\nheight: var(--dg-inline-control-height);\npadding: 0 var(--dg-space-s);\noverflow: hidden;\nfont-family: var(--dg-font-family);\nfont-size: var(--dg-font-size);\ncolor: var(--dg-text-color);\nwhite-space: nowrap;\ntext-overflow: ellipsis;\nvertical-align: middle;\ncursor: pointer;\nbackground: var(--dg-bg-secondary);\nborder: var(--dg-border-width) solid var(--dg-border);\nborder-radius: var(--dg-radius);\n}\n.u2-chip:hover {\nbackground: var(--dg-hover);\n}\n.u2-chip:has(canvas, img) {\nheight: auto;\npadding: var(--dg-space-xs);\n}\n.u2-chip > span {\ndisplay: inline-flex;\nalign-items: center;\ngap: var(--dg-space-xs);\nmin-width: 0;\n}\n.u2-entity-card {\ndisplay: inline-block;\ncursor: pointer;\nborder: var(--dg-border-width) solid var(--dg-border);\nborder-radius: var(--dg-radius);\noverflow: hidden;\n}\n.u2-entity-card:hover {\nborder-color: var(--dg-accent);\n}\n.u2-badge {\ndisplay: inline-flex;\nbox-sizing: border-box;\nalign-items: center;\nheight: 16px;\npadding: 0 var(--dg-space-s);\nfont-family: var(--dg-font-family);\nfont-size: var(--dg-font-size-xs);\nfont-weight: var(--dg-font-weight-medium);\nline-height: 1;\ncolor: var(--dg-grey-6);\nwhite-space: nowrap;\nbackground: var(--dg-grey-1);\nborder-radius: var(--dg-radius);\n}\n.u2-badge-accent {\ncolor: var(--dg-white);\nbackground: var(--dg-blue-1);\n}\n.u2-badge-success {\ncolor: var(--dg-green-3);\nbackground: var(--dg-green-1);\n}\n.u2-badge-warning {\ncolor: var(--dg-orange-3);\nbackground: var(--dg-orange-1);\n}\n.u2-badge-error {\ncolor: var(--dg-red-4);\nbackground: var(--dg-red-1);\n}\n.u2-count-badge {\ndisplay: inline-flex;\nbox-sizing: border-box;\nalign-items: center;\njustify-content: center;\nmin-width: 16px;\nheight: 16px;\npadding: 0 var(--dg-space-s);\nfont-family: var(--dg-font-family);\nfont-size: var(--dg-font-size-xs);\nfont-weight: var(--dg-font-weight-medium);\nline-height: 1;\ncolor: var(--dg-white);\nbackground: var(--dg-accent);\nborder-radius: 8px;\n}\n.u2-dot {\ndisplay: inline-block;\nflex-shrink: 0;\nwidth: 8px;\nheight: 8px;\nbackground: var(--dg-grey-4);\nborder-radius: 50%;\n}\n.u2-dot-accent {\nbackground: var(--dg-blue-1);\n}\n.u2-dot-success {\nbackground: var(--dg-green-2);\n}\n.u2-dot-warning {\nbackground: var(--dg-orange-2);\n}\n.u2-dot-error {\nbackground: var(--dg-red-3);\n}\n.u2-tag {\ndisplay: inline-flex;\nbox-sizing: border-box;\nalign-items: center;\ngap: var(--dg-space-xs);\nheight: var(--dg-inline-control-height);\npadding: 0 var(--dg-space-s);\nfont-family: var(--dg-font-family);\nfont-size: var(--dg-font-size-small);\ncolor: var(--dg-text-color);\nwhite-space: nowrap;\nbackground: var(--dg-bg-secondary);\nborder: var(--dg-border-width) solid var(--dg-border);\nborder-radius: var(--dg-radius);\n}\n.u2-tag-remove {\ndisplay: inline-flex;\nbox-sizing: border-box;\nalign-items: center;\njustify-content: center;\nwidth: 14px;\nheight: 14px;\npadding: 0;\nfont: inherit;\nfont-size: var(--dg-font-size-xs);\nline-height: 1;\ncolor: var(--dg-text-color-light);\nbackground: none;\nborder: none;\nborder-radius: var(--dg-radius);\ncursor: pointer;\n}\n.u2-tag-remove:hover {\ncolor: var(--dg-text-color);\nbackground: var(--dg-hover);\n}\n.u2-tag-remove:focus-visible {\noutline: var(--dg-focus-ring);\noutline-offset: calc(-1 * var(--dg-focus-ring-width));\n}\n.u2-status-line {\ndisplay: flex;\nalign-items: baseline;\ngap: var(--dg-space-s);\nmin-width: 0;\nfont-family: var(--dg-font-family);\nfont-size: var(--dg-font-size-small);\nline-height: var(--dg-line-height);\ncolor: var(--dg-text-color-light);\n}\n.u2-status-line-text {\nmin-width: 0;\ndisplay: -webkit-box;\n-webkit-box-orient: vertical;\n-webkit-line-clamp: 2;\noverflow: hidden;\noverflow-wrap: anywhere;\n}\n.u2-status-line-problem {\ncolor: var(--dg-error);\n}\n.u2-status-line-warning.u2-status-line-problem {\ncolor: var(--dg-orange-3);\n}\n.u2-status-line-mark {\nflex: none;\n}\n.u2-status-line-mark[hidden] {\ndisplay: none;\n}\n.u2-table {\nborder-collapse: collapse;\nfont-family: var(--dg-font-family);\nfont-size: var(--dg-font-size);\nline-height: var(--dg-line-height);\ncolor: var(--dg-text-color);\noutline: none;\n}\n.u2-table:focus-visible {\noutline: var(--dg-focus-ring);\noutline-offset: calc(-1 * var(--dg-focus-ring-width));\n}\n.u2-table-fixed {\ntable-layout: fixed;\nwidth: 100%;\n}\n.u2-table th,\n.u2-table td {\nheight: var(--dg-inline-control-height);\npadding: 0 0 0 var(--dg-space-l);\nborder-bottom: none;\ntext-align: left;\nvertical-align: middle;\nwhite-space: nowrap;\noverflow: hidden;\ntext-overflow: ellipsis;\n}\n.u2-table th {\ncolor: var(--dg-text-color);\nfont-size: var(--dg-font-size);\nfont-weight: var(--dg-font-weight-bold);\n}\n.u2-table thead th {\nposition: sticky;\ntop: 0;\nz-index: 1;\nbackground: var(--dg-bg);\n}\n.u2-table .u2-table-align-right {\ntext-align: right;\n}\n.u2-table .u2-table-align-center {\ntext-align: center;\n}\n.u2-table .u2-table-align-left {\ntext-align: left;\n}\n.u2-table-interactive .u2-table-row {\ncursor: pointer;\n}\n.u2-table-row:hover,\n.u2-table-row:hover > .u2-table-pin-start,\n.u2-table-row:hover > .u2-table-pin-end {\nbackground: linear-gradient(var(--u2-row-hover-bg), var(--u2-row-hover-bg)), var(--u2-row-base-bg);\n}\n.u2-table-row:hover > :first-child {\nbox-shadow: inset 4px 0 0 var(--u2-row-hover-stripe);\n}\n.u2-table-row-selected,\n.u2-table-row-selected:hover {\nbackground: var(--u2-row-selected-bg);\ncolor: var(--dg-selection-text);\n}\n.u2-table-control th,\n.u2-table-control td {\nheight: var(--dg-control-height);\n}\n.u2-table th.u2-table-sortable {\ncursor: pointer;\nuser-select: none;\n}\n.u2-table th.u2-table-sortable:focus-visible {\noutline: var(--dg-focus-ring);\noutline-offset: calc(-1 * var(--dg-focus-ring-width));\n}\n.u2-table th.u2-table-sorted {\ncolor: var(--dg-accent);\n}\n.u2-table .u2-table-sort {\nmargin-left: var(--dg-space-s);\nfont-size: var(--dg-font-size-xs);\n}\n.u2-table .u2-table-pin-start,\n.u2-table .u2-table-pin-end {\nposition: sticky;\nz-index: 1;\nbackground: var(--u2-row-base-bg);\n}\n.u2-table .u2-table-pin-start {\nleft: 0;\n}\n.u2-table .u2-table-pin-end {\nright: 0;\n}\n.u2-table thead .u2-table-pin-start,\n.u2-table thead .u2-table-pin-end {\nz-index: 2;\n}\n.u2-table-row-selected > .u2-table-pin-start,\n.u2-table-row-selected > .u2-table-pin-end,\n.u2-table-row-selected:hover > .u2-table-pin-start,\n.u2-table-row-selected:hover > .u2-table-pin-end {\nbackground: var(--u2-row-selected-bg);\n}\n.u2-table .u2-table-section th {\ncolor: var(--dg-text-color);\nfont-weight: var(--dg-font-weight-bold);\nbackground: var(--u2-section-header-bg);\n}\n.u2-table .u2-table-section-foldable th {\ncursor: pointer;\nuser-select: none;\n}\n.u2-table .u2-table-section-foldable th:focus-visible {\noutline: var(--dg-focus-ring);\noutline-offset: calc(-1 * var(--dg-focus-ring-width));\n}\n.u2-table .u2-table-chevron {\nwidth: 10px;\nmargin-right: var(--dg-space-m);\ncolor: var(--dg-grey-5);\nfont-size: var(--dg-font-size-xs);\n}\n.u2-table .u2-table-section .u2-badge {\nmargin-left: var(--dg-space-m);\n}\n.u2-table-map td {\nborder-bottom: none;\nvertical-align: top;\n}\n.u2-table-map td:not(.u2-table-key) {\nheight: auto;\noverflow: visible;\nwhite-space: normal;\noverflow-wrap: anywhere;\n}\n.u2-table-map .u2-table-row:hover {\nbackground: none;\n}\n.u2-table-map .u2-table-key {\npadding-right: var(--dg-space-l);\ncolor: var(--dg-text-color-light);\n}\n.u2-catalog {\ndisplay: flex;\nflex-direction: column;\nalign-items: flex-start;\nmin-width: 0;\nmax-width: 100%;\n}\n.u2-catalog-body {\nmax-width: 100%;\n}\n.u2-catalog-scroll {\nmax-width: 100%;\noverflow-x: auto;\n}\n.u2-catalog .u2-skeleton {\nwidth: 860px;\nmax-width: 100%;\n}\n.u2-catalog .u2-empty-state {\nmax-width: 720px;\n}\n.u2-catalog-footer {\npadding-top: var(--dg-space-s);\ncolor: var(--dg-text-color-light);\nfont-size: var(--dg-font-size-small);\n}\n.u2-catalog-actions .u2-row-actions {\ngap: 0;\nmargin-left: 0;\n}\n.u2-catalog .u2-table .u2-table-pin-end {\npadding-left: var(--dg-space-m);\n}\n.u2-catalog-actions-pending {\nvisibility: hidden;\n}\n.u2-catalog-view-only {\nwidth: var(--dg-button-height);\ncolor: var(--dg-grey-3);\ntext-align: center;\n}\n.u2-catalog-actions-always .u2-row-actions {\nopacity: 1;\npointer-events: auto;\n}\n.u2-catalog-actions-always .u2-row-actions .u2-btn.u2-icon-btn {\ncolor: var(--dg-grey-4);\n}\n.u2-catalog-actions-always .u2-table-row:hover .u2-row-actions .u2-btn.u2-icon-btn {\ncolor: var(--dg-accent);\n}\n.u2-catalog-actions-always .u2-row-actions .u2-btn.u2-icon-btn.u2-row-action-destructive:hover {\ncolor: var(--dg-error);\n}\n.u2-catalog-overflow .u2-table .u2-table-pin-end {\noverflow: visible;\n}\n.u2-catalog-refreshing .u2-icon {\nanimation: u2-catalog-spin 0.8s linear infinite;\n}\n@keyframes u2-catalog-spin {\nto {\ntransform: rotate(360deg);\n}\n}\n@media (prefers-reduced-motion: reduce) {\n.u2-catalog-refreshing .u2-icon {\nanimation: none;\n}\n}\n.u2-adaptive {\ncontainer-type: inline-size;\n}\n@container (max-width: 420px) {\n.u2-p2 {\ndisplay: none;\n}\n}\n@container (max-width: 340px) {\n.u2-p1 {\ndisplay: none;\n}\n}\n.u2-btn .u2-icon {\nflex-shrink: 0;\nwidth: 12px;\nheight: 12px;\nfont-size: 12px;\nline-height: 1;\ntext-align: center;\n}\n.u2-btn .u2-btn-label {\nline-height: 1;\n}\n.u2-btn.u2-icon-btn {\nwidth: var(--dg-button-height);\nmin-width: var(--dg-button-height);\nheight: var(--dg-button-height);\npadding: 0;\ncolor: var(--dg-accent);\nbackground: none;\nborder: var(--dg-border-width) solid transparent;\n}\n.u2-btn.u2-icon-btn:hover:not(:disabled, [aria-disabled='true']),\n.u2-btn.u2-icon-btn:active:not(:disabled, [aria-disabled='true']) {\nbackground: none;\nfilter: contrast(80%) brightness(120%);\n}\n.u2-btn.u2-icon-btn:is(:disabled, [aria-disabled='true']) {\ncolor: var(--dg-text-color-disabled);\n}\n.u2-btn.u2-icon-btn-pressed {\ncolor: var(--dg-accent);\nbackground: var(--dg-steel-1);\nborder-color: var(--dg-border);\n}\n.u2-btn.u2-icon-btn:focus-visible {\nborder-color: var(--dg-focus);\noutline: none;\n}\n.u2-toolbar .u2-btn {\nheight: var(--dg-button-height);\n}\n.u2-toolbar .u2-btn.u2-icon-btn {\nwidth: var(--dg-inline-control-height);\nmin-width: var(--dg-inline-control-height);\nheight: var(--dg-inline-control-height);\n}\n.d4-ribbon-item .u2-btn.u2-btn-primary {\nheight: var(--dg-inline-control-height);\npadding: 0 10px;\nfont-size: var(--dg-font-size-xs);\nletter-spacing: 1px;\n}\n.d4-ribbon-item .u2-btn.u2-btn-primary:not(:disabled, [aria-disabled='true']) {\nbackground: var(--dg-accent-secondary);\n}\n.d4-ribbon-item > .u2-btn:is(:disabled, [aria-disabled='true']):hover {\ncursor: default;\ncolor: var(--dg-text-color-disabled);\nbackground-color: transparent;\n}\n.d4-ribbon-item > .u2-btn.u2-btn-primary:is(:disabled, [aria-disabled='true']):hover {\ncolor: var(--dg-grey-4);\nbackground-color: var(--dg-steel-2);\n}\n.d4-toolbox .u2-btn:not(.u2-icon-btn) {\nheight: var(--dg-button-height);\npadding: 0 11px;\nfont-size: var(--dg-font-size-xs);\nfont-weight: 600;\nletter-spacing: 0.04em;\n}\n.d4-toolbox .u2-btn.u2-btn-primary {\nfont-weight: var(--dg-font-weight-regular);\n}\n.d4-toolbox .u2-btn.u2-btn-primary:not(:disabled, [aria-disabled='true']) {\nbackground: var(--dg-accent-secondary);\n}\n.u2-btn-group {\ndisplay: inline-flex;\nbox-sizing: border-box;\nflex-shrink: 0;\nalign-items: center;\n}\n.u2-btn-group-item {\ndisplay: inline-flex;\nbox-sizing: border-box;\nflex-shrink: 0;\nalign-items: center;\njustify-content: center;\ngap: var(--dg-space-s);\nheight: var(--dg-button-height);\nmargin: 0;\npadding: 0 var(--dg-space-m);\nfont-family: var(--dg-font-family);\nfont-size: var(--dg-font-size-small);\ncolor: var(--dg-text-color);\nwhite-space: nowrap;\nbackground: var(--dg-bg);\nborder: var(--dg-border-width) solid var(--dg-border);\nborder-radius: 0;\ncursor: pointer;\noutline: none;\nuser-select: none;\n}\n.u2-btn-group-item .u2-icon {\nflex-shrink: 0;\nwidth: 12px;\nheight: 12px;\nfont-size: 12px;\nline-height: 1;\ntext-align: center;\n}\n.u2-btn-group-item + .u2-btn-group-item {\nmargin-left: calc(-1 * var(--dg-border-width));\n}\n.u2-btn-group-item:first-child {\nborder-top-left-radius: var(--dg-radius);\nborder-bottom-left-radius: var(--dg-radius);\n}\n.u2-btn-group-item:last-child {\nborder-top-right-radius: var(--dg-radius);\nborder-bottom-right-radius: var(--dg-radius);\n}\n.u2-btn-group-item:hover:not(:disabled, [aria-disabled='true']) {\nbackground: var(--dg-hover-subtle);\n}\n.u2-btn-group-item:active:not(:disabled, [aria-disabled='true']) {\nbackground: var(--dg-steel-1);\n}\n.u2-btn-group-item.u2-btn-group-selected {\nposition: relative;\nz-index: 1;\ncolor: var(--dg-selection-text);\nbackground: var(--dg-selection-bg);\nborder-color: var(--dg-steel-3);\n}\n.u2-btn-group-item:focus-visible {\nposition: relative;\nz-index: 2;\nborder-color: var(--dg-focus);\n}\n.u2-btn-group-item:is(:disabled, [aria-disabled='true']) {\ncolor: var(--dg-text-color-disabled);\nbackground: var(--dg-bg);\ncursor: default;\n}\n.u2-btn-group-icons .u2-btn-group-item {\nwidth: var(--dg-button-height);\npadding: 0;\n}\n.u2-btn-group-toolbar .u2-btn-group-item,\n.u2-btn-group-ribbon .u2-btn-group-item {\nheight: var(--dg-inline-control-height);\nbackground: none;\nborder-color: transparent;\n}\n.u2-btn-group-toolbar .u2-btn-group-item + .u2-btn-group-item,\n.u2-btn-group-ribbon .u2-btn-group-item + .u2-btn-group-item {\nborder-left-color: var(--dg-border-subtle);\n}\n.u2-btn-group-toolbar:hover .u2-btn-group-item,\n.u2-btn-group-ribbon:hover .u2-btn-group-item {\nborder-color: var(--dg-border);\n}\n.u2-btn-group-toolbar.u2-btn-group-icons .u2-btn-group-item,\n.u2-btn-group-ribbon.u2-btn-group-icons .u2-btn-group-item {\nwidth: var(--dg-inline-control-height);\n}\n.u2-btn-group-toolbar .u2-btn-group-item.u2-btn-group-selected,\n.u2-btn-group-ribbon .u2-btn-group-item.u2-btn-group-selected {\nbackground: var(--dg-selection-bg);\nborder-color: var(--dg-border);\n}\n.u2-btn-group-ribbon .u2-btn-group-item {\ngap: var(--dg-space-xs);\npadding: 0 var(--dg-space-s);\n}\n.u2-btn .u2-dropdown-chevron {\nwidth: 10px;\nheight: 10px;\nfont-size: 10px;\ncolor: var(--dg-text-color-light);\n}\n.u2-btn-primary .u2-dropdown-chevron {\ncolor: inherit;\n}\n.u2-dropdown-split {\ndisplay: inline-flex;\nbox-sizing: border-box;\nflex-shrink: 0;\nalign-items: center;\n}\n.u2-dropdown-split .u2-btn {\nborder-radius: 0;\n}\n.u2-dropdown-split .u2-btn:first-child {\nborder-top-left-radius: var(--dg-radius);\nborder-bottom-left-radius: var(--dg-radius);\n}\n.u2-dropdown-split .u2-btn:last-child {\nborder-top-right-radius: var(--dg-radius);\nborder-bottom-right-radius: var(--dg-radius);\n}\n.u2-dropdown-arrow {\npadding: 0 var(--dg-space-s);\nborder-left: var(--dg-border-width) solid var(--dg-border);\n}\n.u2-dropdown-arrow.u2-btn-primary {\nborder-left-color: var(--dg-accent);\n}\n.u2-ribbon-group {\ndisplay: flex;\nalign-items: center;\ngap: var(--dg-space-s);\nheight: 100%;\n}\n.d4-ribbon-panel.u2-ribbon-pinned {\nposition: sticky;\nright: 0;\nz-index: 2;\nbackground: var(--dg-bg);\n}\n.u2-ribbon-rule {\nflex-shrink: 0;\nwidth: 1px;\nheight: 18px;\nbackground: var(--dg-grey-2);\n}\n.u2-ribbon-icons {\ndisplay: flex;\nalign-items: center;\n}\n.u2-ribbon-icons[hidden],\n.u2-ribbon-group > .u2-btn[hidden],\n.u2-ribbon-icons > .u2-btn[hidden] {\ndisplay: none;\n}\n.d4-ribbon-item .u2-ribbon-group .u2-btn.u2-icon-btn {\nwidth: 24px;\nmin-width: 24px;\nheight: 24px;\ncolor: var(--dg-steel-5);\n}\n.d4-ribbon-item .u2-ribbon-group .u2-btn.u2-icon-btn .u2-icon {\nwidth: 16px;\nheight: 16px;\nfont-size: 16px;\n}\n.d4-ribbon-item:hover .u2-ribbon-group .u2-icon-btn .u2-icon {\ncolor: inherit;\n}\n.u2-ribbon-more {\nposition: relative;\n}\n.u2-ribbon-hint-dot {\nposition: absolute;\ntop: 1px;\nright: 1px;\nwidth: 7px;\nheight: 7px;\nborder-radius: 50%;\nbackground: var(--dg-orange-2);\n}\n.u2-ribbon-hint-dot[hidden] {\ndisplay: none;\n}\n.u2-designer {\nposition: relative;\ndisplay: flex;\nflex-direction: column;\nheight: 100%;\noverflow: auto;\n}\n.u2-designer-surface {\ndisplay: flex;\nflex: 1 0 auto;\nflex-direction: column;\nbox-sizing: border-box;\npadding: var(--dg-space-m);\n}\n.u2-designer-surface > .u2-spec {\ndisplay: flex;\nflex: 1 0 auto;\nflex-direction: column;\n}\n.u2-designer-surface > .u2-spec > .u2-designer-root {\nflex: 1 0 auto;\n}\n.u2-designer-pane {\nposition: absolute;\ninset: 0;\nz-index: 2;\ncursor: default;\n}\n.u2-designer-selected,\n.u2-designer-hover {\nposition: absolute;\ndisplay: none;\nz-index: 3;\nbox-sizing: border-box;\npointer-events: none;\n}\n.u2-designer-selected {\noutline: 2px solid var(--dg-accent);\noutline-offset: 1px;\n}\n.u2-designer-hover {\noutline: var(--dg-border-width) dashed var(--dg-accent-secondary);\noutline-offset: 1px;\n}\n.u2-designer-drop-into,\n.u2-designer-drop-line {\nposition: absolute;\ndisplay: none;\nz-index: 4;\nbox-sizing: border-box;\npointer-events: none;\n}\n.u2-designer-drop-into {\noutline: 2px dashed var(--dg-accent);\noutline-offset: -1px;\nbackground: var(--dg-selection-bg);\n}\n.u2-designer-drop-line {\nbackground: var(--dg-accent);\n}\n.u2-designer-drag-ghost {\nposition: absolute;\nz-index: 5;\npointer-events: none;\npadding: var(--dg-space-xs) var(--dg-space-s);\nborder: var(--dg-border-width) solid var(--dg-border);\nborder-radius: var(--dg-radius);\nbackground: var(--dg-bg);\ncolor: var(--dg-text-color-light);\nfont-size: var(--dg-font-size-small);\nbox-shadow: var(--dg-shadow-1);\n}\n.u2-designer:not(.u2-designer-running) .u2-designer-root {\noutline: 1px solid var(--dg-border);\noutline-offset: -1px;\n}\n.u2-designer.u2-designer-outlines:not(.u2-designer-running) .u2-designer-node:not(.u2-designer-root) {\noutline: 1px dashed var(--dg-border);\n}\n.u2-designer:not(.u2-designer-running) .u2-designer-empty {\nmin-height: 64px;\nborder: var(--dg-border-width) dashed var(--dg-border);\nborder-radius: var(--dg-radius);\n}\n.u2-designer:not(.u2-designer-running) .u2-designer-empty::after {\ncontent: 'Drop here';\ndisplay: block;\npadding: var(--dg-space-xs) var(--dg-space-s);\ncolor: var(--dg-text-color-light);\nfont-size: var(--dg-font-size-small);\n}\n.u2-designer-tray {\nposition: sticky;\nbottom: 0;\nz-index: 6;\ndisplay: flex;\nflex: none;\nflex-wrap: wrap;\nalign-items: center;\ngap: var(--dg-space-xs);\npadding: var(--dg-space-xs) var(--dg-space-s);\nborder-top: var(--dg-border-width) solid var(--dg-border);\nbackground: var(--dg-bg-secondary);\n}\n.u2-designer.u2-designer-running .u2-designer-tray {\ndisplay: none;\n}\n.u2-designer-tray-drop {\noutline: 2px dashed var(--dg-accent);\noutline-offset: -2px;\nbackground: var(--dg-selection-bg);\n}\n.u2-designer-tray-hint {\ncolor: var(--dg-text-color-light);\nfont-size: var(--dg-font-size-small);\n}\n.u2-designer-tray-add {\nflex: none;\n}\n.u2-designer-chip {\npadding: var(--dg-space-xs) var(--dg-space-s);\nborder: var(--dg-border-width) solid var(--dg-border);\nborder-radius: var(--dg-radius);\nbackground: var(--dg-bg);\nfont-size: var(--dg-font-size-small);\ncursor: pointer;\nuser-select: none;\n}\n.u2-designer-chip-selected {\nborder-color: var(--dg-accent);\nbackground: var(--dg-selection-bg);\ncolor: var(--dg-selection-text);\n}\n.u2-designer-chip-broken,\n.u2-designer-chip-error {\nborder-color: var(--dg-red-3);\nbackground: var(--dg-red-1);\ncolor: var(--dg-red-4);\n}\n.u2-designer-chip-loading {\nborder-style: dashed;\ncolor: var(--dg-text-color-light);\n}\n.u2-designer-toolbox {\ndisplay: flex;\nflex-direction: column;\nbox-sizing: border-box;\nheight: 100%;\nmin-height: 200px;\npadding: var(--dg-space-m);\ngap: var(--dg-space-s);\n}\n.u2-designer-toolbox > .u2-tree {\nflex: 1 1 auto;\nmin-height: 0;\n}\n.u2-designer-toolbox > .u2-palette {\nflex: 0 0 auto;\nmax-height: 40%;\n}\n.u2-palette {\ndisplay: flex;\nflex-direction: column;\nmin-height: 0;\ngap: var(--dg-space-s);\n}\n.u2-palette-list {\noverflow: auto;\n}\n.u2-palette-list.u2-accordion {\nbackground: none;\n}\n.u2-palette .u2-accordion-header {\nheight: auto;\npadding: var(--dg-space-xs) var(--dg-space-s) var(--dg-space-xs) var(--dg-space-xxl);\n}\n.u2-palette .u2-accordion-chevron {\nfont-size: var(--dg-font-size-xs);\n}\n.u2-palette .u2-accordion-title {\ncolor: var(--dg-text-color-light);\nfont-size: var(--dg-font-size-xs);\nfont-weight: var(--dg-font-weight-medium);\ntext-transform: uppercase;\n}\n.u2-palette .u2-accordion-content {\npadding: 0 0 var(--dg-space-xs);\n}\n.u2-palette-item {\ndisplay: flex;\nalign-items: center;\ngap: var(--dg-space-xs);\npadding: var(--dg-space-xs) var(--dg-space-s);\nborder-radius: var(--dg-radius);\ncursor: grab;\nuser-select: none;\n}\n.u2-palette-item-icon {\ndisplay: flex;\nflex: none;\nalign-items: center;\njustify-content: center;\nwidth: 16px;\nheight: 16px;\noverflow: hidden;\n}\n.u2-palette-item-icon img,\n.u2-palette-item-icon svg,\n.u2-palette-item-icon i {\nmax-width: 16px;\nmax-height: 16px;\nfont-size: var(--dg-font-size-small);\n}\n.u2-palette-item-label {\noverflow: hidden;\nwhite-space: nowrap;\ntext-overflow: ellipsis;\n}\n.u2-palette-item:hover {\nbackground: var(--dg-hover);\n}\n.u2-designer-properties {\ngap: var(--dg-space-s);\npadding: var(--dg-space-m);\n}\n.u2-designer-caption {\nfont-family: var(--dg-font-family-mono);\nfont-size: var(--dg-font-size-small);\n}\n.u2-designer-hint {\ncolor: var(--dg-text-color-light);\nfont-size: var(--dg-font-size-small);\n}\n.u2-designer-properties > .u2-designer-caption {\nfont-size: var(--dg-font-size-h2);\nfont-weight: var(--dg-font-weight-medium);\ncolor: var(--dg-text-color);\n}\n.u2-designer-spec-editor textarea {\nwidth: 520px;\nheight: 320px;\nfont-family: var(--dg-font-family-mono);\nfont-size: var(--dg-font-size-small);\n}\n.u2-bind-picker-body {\ngap: var(--dg-space-s);\nmin-width: 380px;\n}\n.u2-bind-picker .u2-tree {\nheight: 280px;\nborder: var(--dg-border-width) solid var(--dg-border);\n}\n.u2-bind-picker-hint {\ncolor: var(--dg-text-color-light);\nfont-size: var(--dg-font-size-small);\n}\n.u2-func-picker-body {\ngap: var(--dg-space-s);\nmin-width: 420px;\n}\n.u2-func-picker .u2-list {\nheight: 240px;\nborder: var(--dg-border-width) solid var(--dg-border);\n}\n.u2-func-picker-params {\nmax-height: 240px;\noverflow-y: auto;\n}\n.u2-func-picker-hint {\ncolor: var(--dg-text-color-light);\nfont-size: var(--dg-font-size-small);\n}\n.u2-func-row {\ndisplay: flex;\nalign-items: center;\nbox-sizing: border-box;\nheight: 100%;\npadding: 0 var(--dg-space-xs);\noverflow: hidden;\ngap: var(--dg-space-s);\nline-height: normal;\n}\n.u2-func-row-icon {\ndisplay: flex;\nflex: none;\nalign-items: center;\njustify-content: center;\nwidth: 16px;\nheight: 16px;\noverflow: hidden;\n}\n.u2-func-row-icon img,\n.u2-func-row-icon svg,\n.u2-func-row-icon i {\nmax-width: 16px;\nmax-height: 16px;\nfont-size: var(--dg-font-size-small);\n}\n.u2-func-row-label {\nflex: 0 1 auto;\noverflow: hidden;\nwhite-space: nowrap;\ntext-overflow: ellipsis;\n}\n.u2-func-row-name,\n.u2-func-row-desc {\ncolor: var(--dg-text-color-light);\nfont-size: var(--dg-font-size-small);\nwhite-space: nowrap;\n}\n.u2-func-row-name {\nflex: none;\nfont-family: var(--dg-font-family-mono);\n}\n.u2-func-row-desc {\nflex: 1 1 auto;\noverflow: hidden;\ntext-overflow: ellipsis;\n}\n.u2-picker-empty {\ndisplay: flex;\nalign-items: center;\njustify-content: center;\nbox-sizing: border-box;\npadding: var(--dg-space-m);\nborder: var(--dg-border-width) solid var(--dg-border);\ncolor: var(--dg-text-color-light);\nfont-size: var(--dg-font-size-small);\ntext-align: center;\n}\n.u2-bind-picker .u2-picker-empty {\nheight: 280px;\n}\n.u2-func-picker .u2-picker-empty {\nheight: 240px;\n}\n.u2-designer-look {\nwidth: 100%;\n}\n.u2-designer-look .property-grid-category td {\nfont-size: var(--dg-font-size);\nfont-weight: var(--dg-font-weight-medium);\n}\n.u2-designer-look .property-grid td:first-child {\nwidth: 55%;\n}\n.u2-designer-look-set td:first-child {\nfont-weight: var(--dg-font-weight-medium);\n}\n.u2-designer-look tr[data-prop-name]:focus {\noutline: none;\n}\n.u2-designer-verbs {\nflex-wrap: wrap;\ngap: var(--dg-space-xs);\n}\n.u2-bind-chip {\ndisplay: inline-flex;\nalign-items: center;\ngap: var(--dg-space-xs);\nmax-width: 100%;\npadding: 0 var(--dg-space-xs);\nfont-size: var(--dg-font-size-small);\nborder: var(--dg-border-width) solid var(--dg-border);\nborder-radius: var(--dg-radius);\nbackground: var(--dg-bg-secondary);\ncursor: pointer;\n}\n.u2-bind-chip:hover {\nbackground: var(--dg-hover);\n}\n.u2-bind-chip-path {\noverflow: hidden;\ntext-overflow: ellipsis;\nwhite-space: nowrap;\nfont-family: var(--dg-font-family-mono);\ncolor: var(--dg-accent);\n}\n.u2-bind-chip-two-way {\ncolor: var(--dg-text-color-light);\n}\n.u2-bind-chip-clear {\nmargin-left: auto;\n}\n.u2-viewer {\nbox-sizing: border-box;\nwidth: 100%;\nheight: 100%;\nmin-height: var(--u2-viewer-min-height, 200px);\n}\n.u2-input-root[data-u2='filter-builder'] {\nalign-items: flex-start;\n}\n.u2-input-root[data-u2='filter-builder'] > .u2-input-box {\nflex: 1 1 0;\nmin-width: var(--dg-form-min-editor-width);\n}\n.u2-input-editor.u2-fb {\nposition: relative;\ndisplay: flex;\nflex: 1 1 auto;\nflex-direction: column;\ngap: var(--dg-space-s);\nmin-width: 0;\nheight: auto;\npadding: 0;\n}\n.u2-input-root[data-u2='filter-builder'].u2-input-inline > .u2-input-box > .u2-input-editor {\nheight: auto;\n}\n.u2-input-root[data-u2='filter-builder']:not(.u2-fb-blank) > .u2-input-error {\ndisplay: none;\n}\n.u2-input-root[data-u2='filter-builder'].u2-fb-blank > .u2-input-error:not(:empty) {\ndisplay: -webkit-box;\n}\n.u2-input-disabled .u2-fb .u2-btn.u2-icon-btn,\n.u2-input-disabled .u2-fb .u2-fb-mode,\n.u2-input-disabled .u2-fb .u2-fb-none-add {\ncolor: var(--dg-text-color-light);\n}\n.u2-input-root[data-u2='filter-builder'].u2-input-readonly .u2-fb-add,\n.u2-input-root[data-u2='filter-builder'].u2-input-readonly .u2-fb-add-group,\n.u2-input-root[data-u2='filter-builder'].u2-input-readonly .u2-fb-remove,\n.u2-input-root[data-u2='filter-builder'].u2-input-readonly .u2-fb-handle,\n.u2-input-root[data-u2='filter-builder'].u2-input-readonly .u2-fb-mode,\n.u2-input-root[data-u2='filter-builder'].u2-input-readonly .u2-fb-none-add {\ndisplay: none;\n}\n.u2-input-editor.u2-fb.u2-invalid {\nborder-bottom: none;\n}\n.u2-fb [hidden] {\ndisplay: none !important;\n}\n.u2-fb-root,\n.u2-fb-group {\ndisplay: flex;\nflex-direction: column;\ngap: var(--dg-space-s);\nmin-width: 0;\n}\n.u2-fb-header,\n.u2-fb-group-header {\ndisplay: flex;\nalign-items: center;\ngap: var(--dg-space-m);\n}\n.u2-fb-mode {\nmargin-left: auto;\nfont-size: var(--dg-font-size-small);\n}\n.u2-fb-group {\npadding-left: var(--dg-space-m);\nborder-left: 2px solid var(--dg-border);\n}\n.u2-fb-group-header {\nmin-height: var(--dg-control-height);\n}\n.u2-fb-group-rows {\ndisplay: flex;\nflex-direction: column;\ngap: var(--dg-space-xs);\nmin-width: 0;\n}\n.u2-fb-group.u2-fb-negated {\nborder-left-color: var(--dg-accent);\n}\n.u2-btn.u2-fb-not {\nheight: var(--dg-inline-control-height);\npadding: 0 var(--dg-space-m);\nfont-size: var(--dg-font-size-small);\nfont-weight: var(--dg-font-weight-medium);\nletter-spacing: 0.04em;\ntext-transform: uppercase;\ncolor: var(--dg-text-color);\n}\n.u2-btn.u2-fb-not-on {\ncolor: var(--dg-selection-text);\nbackground: var(--dg-selection-bg);\nborder-color: var(--dg-selection-bg);\n}\n.u2-fb-handle {\ndisplay: inline-flex;\nalign-items: center;\nalign-self: stretch;\npadding: 0 var(--dg-space-xs);\ncolor: var(--dg-text-color-light);\ncursor: grab;\ntouch-action: none;\nuser-select: none;\n}\n.u2-fb-handle:hover {\ncolor: var(--dg-text-color);\n}\n.u2-fb-dragging {\nopacity: 0.5;\n}\n.u2-fb-drop {\nposition: absolute;\nz-index: 1;\nbox-sizing: border-box;\npointer-events: none;\n}\n.u2-fb-drop-line {\nbackground: var(--dg-accent);\n}\n.u2-fb-drop-into {\noutline: 2px dashed var(--dg-accent);\noutline-offset: -1px;\nbackground: var(--dg-selection-bg);\nopacity: 0.5;\n}\n.u2-fb-connector .u2-btn-group-item {\npadding: 0 var(--dg-space-m);\nfont-size: var(--dg-font-size-small);\nfont-weight: var(--dg-font-weight-medium);\nletter-spacing: 0.04em;\ntext-transform: uppercase;\n}\n.u2-fb-rows {\ndisplay: flex;\nflex-direction: column;\ngap: var(--dg-space-l);\nmin-width: 0;\n}\n.u2-fb-cond {\ndisplay: flex;\nflex-wrap: wrap;\nalign-items: center;\ngap: var(--dg-space-xs) var(--dg-space-m);\nmin-height: var(--dg-control-height);\npadding: 0 var(--dg-space-s);\nborder-radius: var(--dg-radius);\n}\n.u2-fb-cond:hover {\nbackground: var(--dg-hover-subtle);\n}\n.u2-fb-cond .u2-input-root {\nflex-wrap: nowrap;\npadding: 0;\n}\n.u2-fb-cond .u2-input-error {\ndisplay: none;\n}\n.u2-fb-cond > .u2-fb-prop,\n.u2-fb-cond > .u2-fb-op {\nflex: 0 1 120px;\nmin-width: 60px;\n}\n.u2-fb-cond > .u2-fb-op {\nflex-shrink: 3;\n}\n.u2-fb-cond > .u2-fb-prop > .u2-input-box,\n.u2-fb-cond > .u2-fb-op > .u2-input-box {\nflex: 1 1 auto;\nmin-width: 0;\n}\n.u2-fb-prop select.u2-input-editor,\n.u2-fb-op select.u2-input-editor {\nwidth: 100%;\nmin-width: 0;\n}\n.u2-fb-prop-text,\n.u2-fb-op-text {\nwhite-space: nowrap;\n}\n.u2-fb-op-text {\ncolor: var(--dg-text-color-light);\n}\n.u2-fb-values {\ndisplay: flex;\nflex: 1 1 auto;\nflex-wrap: wrap;\nalign-items: center;\ngap: var(--dg-space-xs) var(--dg-space-s);\nmin-width: 0;\n}\n.u2-fb-values > * {\nflex-shrink: 1;\nmin-width: 0;\n}\n.u2-fb-values > .u2-input-root {\nflex: 1 1 auto;\n}\n.u2-fb-values .u2-input-box {\nflex: 1 1 auto;\nmin-width: 0;\n}\n.u2-fb-values .u2-input-editor {\nmin-width: 0;\nmax-width: 100%;\n}\n.u2-fb-cond .u2-fb-values .u2-input-root[data-u2='text-input'] > .u2-input-box > input.u2-input-editor,\n.u2-fb-cond .u2-fb-values .u2-input-root[data-u2='suggest-input'] > .u2-input-box > input.u2-input-editor {\nflex: 1 1 auto;\nwidth: auto;\n}\n.u2-fb-cond > .u2-fb-remove {\nmargin-left: auto;\n}\n.u2-fb-problem {\nflex: 1 0 100%;\nfont-size: var(--dg-font-size-small);\ncolor: var(--dg-error);\n}\n.u2-fb-and {\nfont-size: var(--dg-font-size-small);\ncolor: var(--dg-text-color-light);\n}\n.u2-fb-invalid {\nbox-shadow: inset 2px 0 0 var(--dg-error);\n}\n.u2-fb-missing .u2-fb-values .u2-input-editor {\nborder-bottom-color: var(--dg-error);\n}\n.u2-fb-nested-text {\nfont-family: var(--dg-font-family-mono);\nfont-size: var(--dg-font-size-small);\ncolor: var(--dg-text-color-light);\n}\n.u2-fb-none {\ngap: var(--dg-space-m);\npadding: 0 var(--dg-space-s);\nfont-size: var(--dg-font-size-small);\nline-height: var(--dg-control-height);\ncolor: var(--dg-text-color-light);\n}\n.u2-fb-hint {\ndisplay: flex;\ngap: var(--dg-space-s);\npadding: var(--dg-space-xs) var(--dg-space-s);\nfont-size: var(--dg-font-size-small);\ncolor: var(--dg-text-color-light);\n}\n.u2-fb-query {\npadding: var(--dg-space-xs) var(--dg-space-s);\nfont-family: var(--dg-font-family-mono);\nfont-size: var(--dg-font-size-small);\ncolor: var(--dg-text-color-light);\nwhite-space: pre-wrap;\nword-break: break-word;\n}\n.u2-fb-advanced .u2-fb-rows,\n.u2-fb-advanced .u2-fb-group-rows {\ngap: 0;\n}\n.u2-fb-advanced .u2-fb-cond,\n.u2-fb-advanced .u2-fb-group {\npadding-top: calc(var(--dg-space-xs) / 2);\npadding-bottom: calc(var(--dg-space-xs) / 2);\n}\n.u2-fb-horizontal .u2-fb-rows {\nflex-direction: row;\nflex-wrap: wrap;\nalign-items: center;\ngap: var(--dg-space-s);\n}\n.u2-fb-horizontal .u2-fb-cond {\nflex-wrap: nowrap;\ngap: var(--dg-space-s);\nmax-width: 100%;\nmin-width: 0;\nbackground: var(--dg-bg);\nborder: var(--dg-border-width) solid var(--dg-border);\n}\n.u2-fb-horizontal .u2-fb-cond > .u2-fb-prop,\n.u2-fb-horizontal .u2-fb-cond > .u2-fb-op {\nflex-basis: auto;\n}\n.u2-fb-horizontal .u2-fb-problem {\nflex: 0 1 auto;\nmin-width: 0;\noverflow: hidden;\nwhite-space: nowrap;\ntext-overflow: ellipsis;\n}\n.u2-fb-horizontal .u2-fb-cond:hover {\nbackground: var(--dg-hover-subtle);\n}\n.u2-btn.u2-fb-join {\nheight: var(--dg-inline-control-height);\npadding: 0 var(--dg-space-m);\nfont-weight: var(--dg-font-weight-medium);\ncolor: var(--dg-selection-text);\nbackground: var(--dg-selection-bg);\nborder-radius: 999px;\n}\n.u2-btn.u2-fb-join:hover:not(:disabled, [aria-disabled='true']) {\nbackground: var(--dg-hover);\n}\n.u2-fb-narrow .u2-fb-rows,\n.u2-fb-narrow .u2-fb-group-rows {\ngap: 0;\n}\n.u2-fb-narrow .u2-fb-cond:not(.u2-fb-nested) {\ndisplay: grid;\ngrid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;\ngrid-template-areas: 'prop op remove' 'value value value';\nalign-items: center;\ngap: var(--dg-space-xs) var(--dg-space-s);\npadding: var(--dg-space-s);\nbackground: var(--dg-bg-secondary);\nbackground-clip: padding-box;\nborder-bottom: var(--dg-space-s) solid transparent;\n}\n.u2-fb-narrow .u2-fb-advanced .u2-fb-cond:not(.u2-fb-nested) {\ngrid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr) auto;\ngrid-template-areas: 'handle prop op remove' 'handle value value value';\n}\n.u2-fb-narrow .u2-fb-group {\nbackground-clip: padding-box;\nborder-bottom: var(--dg-space-s) solid transparent;\n}\n.u2-fb-narrow .u2-fb-group .u2-fb-cond:not(.u2-fb-nested) {\nbackground: var(--dg-bg);\n}\n.u2-fb-narrow .u2-fb-group .u2-fb-group .u2-fb-cond:not(.u2-fb-nested) {\nbackground: var(--dg-bg-secondary);\n}\n.u2-fb-narrow .u2-fb-cond > .u2-fb-handle {\ngrid-area: handle;\n}\n.u2-fb-narrow .u2-fb-cond > .u2-fb-prop,\n.u2-fb-narrow .u2-fb-cond > .u2-fb-prop-text {\ngrid-area: prop;\n}\n.u2-fb-narrow .u2-fb-cond > .u2-fb-op,\n.u2-fb-narrow .u2-fb-cond > .u2-fb-op-text {\ngrid-area: op;\n}\n.u2-fb-narrow .u2-fb-cond > .u2-fb-values {\ngrid-area: value;\n}\n.u2-fb-narrow .u2-fb-cond > .u2-fb-remove {\ngrid-area: remove;\n}\n.u2-input-root[data-u2='filter-query-input'] > .u2-input-box {\nflex: 1 1 auto;\nmin-width: 120px;\n}\n.u2-input-root[data-u2='filter-query-input'] > .u2-input-box > .u2-input-editor {\nflex: 1 1 auto;\nwidth: 100%;\nmin-width: 0;\n}\n.u2-fq-search::before {\n-webkit-mask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpath d='M2 3h12l-4.6 5.4V13l-2.8 1.2V8.4z'/%3E%3C/svg%3E\");\nmask-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpath d='M2 3h12l-4.6 5.4V13l-2.8 1.2V8.4z'/%3E%3C/svg%3E\");\n}\n.u2-fq-option-active .u2-fq-text,\n.u2-fq-option-active .u2-fq-code {\ncolor: var(--dg-accent);\n}\n.u2-fq-row {\ndisplay: flex;\nalign-items: center;\ngap: var(--dg-space-m);\nmin-width: 0;\n}\n.u2-fq-icon {\nflex-shrink: 0;\nwidth: 1em;\ncolor: var(--dg-text-color-light);\ntext-align: center;\n}\n.u2-fq-text,\n.u2-fq-code {\noverflow: hidden;\nwhite-space: nowrap;\ntext-overflow: ellipsis;\n}\n.u2-suggest-popup.u2-fq-popup {\nmin-width: 160px;\nmax-width: 320px;\nborder-radius: 0;\nbox-shadow: var(--dg-shadow-1);\n}\n.u2-fq-info {\ncolor: var(--dg-text-color-light);\n}\n.u2-fq-secondary {\nmargin-left: auto;\noverflow: hidden;\nfont-size: var(--dg-font-size-small);\ncolor: var(--dg-text-color-light);\nwhite-space: nowrap;\ntext-overflow: ellipsis;\n}\n@media (prefers-reduced-motion: reduce) {\n.u2-dialog-busy {\nanimation: none;\n}\n.u2-notify-timer {\ndisplay: none;\n}\n.u2-section-chevron,\n.u2-accordion-chevron,\n.u2-multi-choice-chevron,\n.u2-choice-chip > .u2-choice-chip-caret,\n.u2-propgrid-chevron,\n.u2-input-switch-thumb {\ntransition: none;\n}\n}":o,c.setAttribute("data-revision",String(s)),c.setAttribute("data-hash",u),i.installed()}static _packageZone(e){var t;let n=Array.from(e.children),r=n.findIndex(e=>"LINK"===e.tagName&&"stylesheet"===e.getAttribute("rel"));return r<0?null:null!=(t=n.slice(r+1).find(e=>"STYLE"===e.tagName))?t:null}static legacyCopies(e){return Array.from((void 0===e?globalThis.document:e).head.querySelectorAll("style")).filter(e=>{var t;return!e.hasAttribute("data-u2-styles")&&/(^|}|\*\/)\s*\.u2-input-root\s*\{/.test(null!=(t=e.textContent)?t:"")}).length}static installed(){var e,n,r,i;let o=null!=(e=null==(i=globalThis.document)||null==(r=i.head)?void 0:r.querySelector(t))?e:null;return null===o?null:{revision:Number(o.getAttribute("data-revision")),hash:null!=(n=o.getAttribute("data-hash"))?n:"",element:o}}}i.revision=65,i.hash=e,i.install()}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={id:r,exports:{}};return e[r](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nc=void 0,hittriage=n(9446)})();
431
676
  //# sourceMappingURL=package.js.map