~evanj/cms

68c151793784838764aea443c6fd85d640fa57b3 — Evan M Jones 1 year, 5 months ago d2718d9
Fix(ref clear+modal scroll): Fixing css on nested modal scroll dismisal.
Improving clear button behavior on ref list.
4 files changed, 14 insertions(+), 2 deletions(-)

M TODO
M internal/s/tmpl/css/main.css
M internal/s/tmpl/js/content.js
M internal/s/tmpl/tmpls_embed.go
M TODO => TODO +1 -0
@@ 2,3 2,4 @@ Cache listicles.
Allow updating of space.
Fullscreen takeover for html/markdown editors.
Sidebar nav for desktop
X scrollable modal becomes unscrollable when nested modal is dismissed.

M internal/s/tmpl/css/main.css => internal/s/tmpl/css/main.css +3 -0
@@ 58,3 58,6 @@ a:not(:hover) {
  overflow: initial !important;
}

.modal { 
  overflow-y: auto;
}

M internal/s/tmpl/js/content.js => internal/s/tmpl/js/content.js +8 -0
@@ 157,6 157,10 @@
            data = data.filter(function(item) { return item.ContentID != {{ .Content.ID }}; });
            {{ end }}

            if (isList) {
              data = data.filter(function(item) { return chosenContentIDs.indexOf(item.ContentID) === -1; });
            }

            for (i = 0; i < data.length; i++) { // This response is paged, don't worry about O^2. Max of 20 items.

              for (j = 0; j < data[i].ContentValues.length; j++) {


@@ 203,6 207,10 @@
      })

      clear.addEventListener('click', function() { 
        inputCT.value = '';
        inputC.value = '';
        inputC.disabled = true;
        inputCT.focus();
        output.value = '';
        btn.value = 'Open';
        chosenContentTypeID = void 0;

M internal/s/tmpl/tmpls_embed.go => internal/s/tmpl/tmpls_embed.go +2 -2
@@ 14,7 14,7 @@ func tostring(in string) string {
func init() {
	tmpls = make(map[string]string)

	tmpls["css/main.css"] = tostring("LyogQVVUT0NPTVBMRVRFICovCgpib2R5IC5hYS1kcm9wZG93bi1tZW51IHsKICBjb2xvcjogIzQ5NTA1NzsKICBiYWNrZ3JvdW5kLWNvbG9yOiAjZmZmOwogIC8qCiAgYm9yZGVyLWNvbG9yOiAjOGJiYWZlOwogIGJveC1zaGFkb3c6IDAgMCAwIDAuMnJlbSByZ2JhKDE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ICAgICAgICAgIDxzZWxlY3QgY2xhc3M9InctMTAwIGZvcm0tY29udHJvbCIgcmVhZG9ubHk9InJlYWRvbmx5IiByZXF1aXJlZCBuYW1lPSJmaWVsZF90eXBlXzEiPgogICAgICAgICAgICAgICAgICAgICAgICA8b3B0aW9uIGRpc2FibGVkIHZhbHVlPkZpZWxkIFR5cGU8L29wdGlvbj4KICAgICAgICAgICAgICAgICAgICAgICAgPG9wdGlvbiBzZWxlY3RlZCB2YWx1ZT0iU3RyaW5nU21hbGwiPlN0cmluZyBTbWFsbDwvb3B0aW9uPgogICAgICAgICAgICAgICAgICAgICAgICA8b3B0aW9uIGRpc2FibGVkIHZhbHVlPSJTdHJpbmdCaWciPlN0cmluZyBCaWc8L29wdGlvbj4KICAgICAgICAgICAgICAgICAgICAgICAgPG9wdGlvbiBkaXNhYmxlZCB2YWx1ZT0iSW5wdXRIVE1MIj5IVE1MPC9vcHRpb24+CiAgICAgICAgICAgICAgICAgICAgICAgIDxvcHRpb24gZGlzYWJsZWQgdmFsdWU9IklucHV0TWFya2Rvd24iPk1hcmtkb3duPC9vcHRpb24+CiAgICAgICAgICAgICAgICAgICAgICAgIDxvcHRpb24gZGlzYWJsZWQgdmFsdWU9IkZpbGUiPkZpbGU8L29wdGlvbj4KICAgICAgICAgICAgICAgICAgICAgICAgPG9wdGlvbiBkaXNhYmxlZCB2YWx1ZT0iRGF0ZSI+RGF0ZTwvb3B0aW9uPgogICAgICAgICAgICAgICAgICAgICAgICA8b3B0aW9uIGRpc2FibGVkIHZhbHVlPSJSZWZlcmVuY2UiPlJlZmVyZW5jZTwvb3B0aW9uPgogICAgICAgICAgICAgICAgICAgICAgICA8b3B0aW9uIGRpc2FibGVkIHZhbHVlPSJSZWZlcmVuY2VMaXN0Ij5SZWZlcmVuY2VMaXN0PC9vcHRpb24+CiAgICAgICAgICAgICAgICAgICAgICA8L3NlbGVjdD4KICAgICAgICAgICAgICAgICAgICA8L2Rpdj4KICAgICAgICAgICAgICAgICAgIC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GxoLTEyNSBib3JkZXItYm90dG9tIGJvcmRlci1ncmF5Ij4KICAgICAgICAgICAgICAgICAgICA8c3Ryb25nIGNsYXNzPSJkLWJsb2NrIHRleHQtZ3JheS1kYXJrIj57eyAuTmFtZSB9fTwvc3Ryb25nPgogICAgICAgICAgICAgICAgICA8L2E+CiAgICAgICAgICAgICAgICA8L2Rpdj4KICAgICAgICAgICAgICAgIHt7IGVuZCB9fQogICAgICAgICAgICAgICAgPHNtYWxsIGNsYXNzPSJkLWJsb2NrIHRleHQtcmlnaHQgbXQtMyI+CiAgICAgICAgICAgICAgICAgIDxhIGhyZWY9IiMiPkxvYWQgbW9yZTwvYT4KICAgICAgICAgICAgICAgIDwvc21hbGw+CiAgICAgICAgICAgICAge3sgZWxzZSB9fQogICAgICAgICAgICAgICAgPGRpdiBjbGFzcz0ibXQtMyBhbGVydCBhbGVydC1wcmltYXJ5IiByb2xlPSJhbGVydCI+CiAgICAgICAgICAgICAgICAgIFlvdSBoYXZlbid0IGNyZWF0ZWQgYW55IGNvbnRlbnQgdHlwZXMgeWV0LiAKICAgICAgICAgICAgICAgIDwvZGl2PgogICAgICAgICAgICAgIHt7IGVuZCB9fQogICAgICAgICAgICA8L2Rpdj4KICAgICAgICAgIDwvZGl2PgogICAgICAgICAgPGRpdiBjbGFzcz0nY29sLWxnLTYnPgogICAgICAgICAgICA8ZGl2IGNsYXNzPSJteS0zIHAtMyBiZy13aGl0ZSByb3VuZGVkIHNoYWRvdy1zbSI+CiAgICAgICAgICAgICAgICA8c21hbGwgY2xhc3M9ImQtYmxvY2sgdGV4dC1yaWdodCBmbG9hdC1yaWdodCIgZGF0YS10b2dnbGU9Im1vZGFsIiBkYXRhLXRhcmdldD0iI2hvb2tNb2RhbCI+CiAgICAgICAgICAgICAgICAgIDxhIGhyZWY9IiMiPkNyZWF0ZSBhIG5ldyB3ZWJob29rPC9hPgogICAgICAgICAgICAgICAgPC9zbWFsbD4KICAgICAgICAgICAgICA8aDYgY2xhc3M9ImJvcmRlci1ib3R0b20gYm9yZGVyLWdyYXkgcGItMiBtYi0wIj5Zb3VyIHdlYmhvb2tzPC9oNj4KICAgICAgICAgICAgICB7eyBpZiAuSG9va3MgfX0KICAgICAgICAgICAgICAgIHt7IHJhbmdlIC5Ib29rcyB9fQogICAgICAgICAgICAgICAgPGRpdiBjbGFzcz0ibWVkaWEgdGV4dC1tdXRlZCBwdC0zIj4KICAgICAgICAgICAgICAgICAgPGEgaHJlZj0nL2hvb2sve3sgJC5TcGFjZS5JRCB9fS97eyAuSUQgfX0nICBjbGFzcz0iZC1ibG9jayBtZWRpYS1ib2R5IHBiLTMgbWItMCBzbWFsbCBsaC0xMjUgYm9yZGVyLWJvdHRvbSBib3JkZXItZ3JheSI+CiAgICAgICAgICAgICAgICAgICAgPHN0cm9uZyBjbGFzcz0iZC1ibG9jayB0ZXh0LWdyYXktZGFyayI+e3sgLlVSTCB9fTwvc3Ryb25nPgogICAgICAgICAgICAgICAgICA8L2E+CiAgICAgICAgICAgICAgICA8L2Rpdj4KICAgICAgICAgICAgICAgIHt7IGVuZCB9fQogICAgICAgICAgICAgICAgPHNtYWxsIGNsYXNzPSJkLWJsb2NrIHRleHQtcmlnaHQgbXQtMyI+CiAgICAgICAgICAgICAgICAgIDxhIGhyZWY9IiMiPkxvYWQgbW9yZTwvYT4KICAgICAgICAgICAgICAgIDwvc21hbGw+CiAgICAgICAgICAgICAge3sgZWxzZSB9fQogICAgICAgICAgICAgICAgPGRpdiBjbGFzcz0ibXQtMyBhbGVydCBhbGVydC1wcmltYXJ5IiByb2xlPSJhbGVydCI+CiAgICAgICAgICAgICAgICAgIFlvdSBoYXZlbid0IGNyZWF0ZWQgYW55IHdlYmhvb2tzIHlldC4gCiAgICAgICAgICAgICAgICA8L2Rpdj4KICAgICAgICAgICAgICB7eyBlbmQgfX0KICAgICAgICAgICAgPC9kaXY+CiAgICAgICAgICA8L2Rpdj4KICAgICAgICA8L2Rpdj4KICAgICAgPC9kaXY+CgogICAgPC9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9ybSwgZGlzcGxheUtleSkgeyAKICAgICAgICAgIHZhciBjb250ZW50dHlwZUFib3J0ID0gZnVuY3Rpb24oKSB7fQogICAgICAgICAgcmV0dXJuIHsKICAgICAgICAgICAgZGlzcGxheUtleTogZGlzcGxheUtleSwKICAgICAgICAgICAgc291cmNlOiBmdW5jdGlvbihxdWVyeSwgY2IpIHsgCiAgICAgICAgICAgICAgY2IoW10pCiAgICAgICAgICAgICAgY29udGVudHR5cGVBYm9ydCgpCiAgICAgICAgICAgICAgdmFyIHJlcSA9IG5ldyBYTUxIdHRwUmVxdWVzdCgpCiAgICAgICAgICAgICAgY29udGVudHR5cGVBYm9ydCA9IGZ1bmN0aW9uKCkgeyByZXEuYWJvcnQoKSB9IAogICAgICAgICAgICAgIHJlcS5vbnJlYWR5c3RhdGVjaGFuZ2UgPSBmdW5jdGlvbigpIHsKICAgICAgICAgICAgICAgIGlmICh0aGlzLnJlYWR5U3RhdGUgIT0gNCkgewogICAgICAgICAgICAgICAgICByZXR1cm4KICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICBpZiAodGhpcy5zdGF0dXMgIT0gMjAwKSB7CiAgICAgICAgICAgICAgICAgIGlmICh0aGlzLnJlc3BvbnNlVGV4dCAhPSAiIikgewogICAgICAgICAgICAgICAgICAgIGFsZXJ0KHRoaXMucmVzcG9uc2VUZXh0KQogICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgIGNiKFtdKQogICAgICAgICAgICAgICAgICByZXR1cm4KICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICB0cnkgeyAKICAgICAgICAgICAgICAgICAgY2IodHJhbnNmb3JtKEpTT04ucGFyc2UodGhpcy5yZXNwb25zZVRleHQpKSkKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGNhdGNoKGUpIHsgCiAgICAgICAgICAgICAgICAgIHZhciBtc2cgPSBlLnRvU3RyaW5nKCkKICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coe2UsbXNnfSkKICAgICAgICAgICAgICAgICAgaWYgKG1zZyAhPSAiIikgeyAvLyBDYW5jZWxsZWQgcmVxdWVzdHMgaGl0IHRoaXMuCiAgICAgICAgICAgICAgICAgICAgYWxlcnQobXNnKQogICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgfQogICAgICAgICAgICAgIHJlcS5vcGVuKCdHRVQnLCB1cmwoKSArIHF1ZXJ5LCB0cnVlKQogICAgICAgICAgICAgIHJlcS5zZW5kKCkKICAgICAgICAgICAgfQogICAgICAgICAgfQogICAgICAgIH0KCiAgICAgICAgdmFyIGNvbnRlbnR0eXBlT3B0cyA9IGdldG9wdHMoCiAgICAgICAgICBmdW5jdGlvbigpIHsgcmV0dXJuICcvY29udGVudHR5cGUvc2VhcmNoP3NwYWNlPXt7IC5TcGFjZS5JRCB9fSZxdWVyeT0nOyB9LCAKICAgICAgICAgIGZ1bmN0aW9uKGRhdGEpIHsgcmV0dXJuIGRhdGEgfSwKICAgICAgICAgICdDb250ZW50VHlwZU5hbWUnCiAgICAgICAgKQoKICAgICAgICBhdXRvQ1QgPSB3aW5kb3cuYXV0b2NvbXBsZXRlKGNvbnRlbnR0eXBlLCBvcHRzLCBbY29udGVudHR5cGVPcHRzXSkub24oJ2F1dG9jb21wbGV0ZTpzZWxlY3RlZCcsIG9uQ29udGVudFR5cGVTZWxlY3RlZCkKICAgICAgICBmdW5jdGlvbiBvbkNvbnRlbnRUeXBlU2VsZWN0ZWQoZSwgaXRlbSwgZGF0YXNldCwgY3R4KSB7CiAgICAgICAgICBjaG9zZW5Db250ZW50VHlwZUlEID0gaXRlbS5Db250ZW50VHlwZUlECiAgICAgICAgICBjb250ZW50LmRpc2FibGVkID0gZmFsc2UKICAgICAgICAgIGNvbnRlbnQuZm9jdXMoKQogICAgICAgIH0KCiAgICAgICAgdmFyIGNvbnRlbnRPcHRzID0gZ2V0b3B0cygKICAgICAgICAgIGZ1bmN0aW9uKCk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AgICAgICAgICAgICAuam9pbignLCAnKQogICAgICAgICAgfQogICAgICAgICAgZWxzZSB7CiAgICAgICAgICAgIG91dHB1dC52YWx1ZSA9IGl0ZW0uQ29udGVudElECiAgICAgICAgICAgIGJ0bi52YWx1ZSA9IGl0ZW0uRmllbGRWYWx1ZQogICAgICAgICAgICBib290c3RyYXAuTW9kYWwuZ2V0SW5zdGFuY2UobW9kYWwpLmhpZGUoKQogICAgICAgICAgfQogICAgICAgIH0KICAgICAgfSkKCiAgICAgIG1vZGFsLmFkZEV2ZW50TGlzdGVuZXIoJ2hpZGRlbi5icy5tb2RhbCcsIGZ1bmN0aW9uKCkgeyAKICAgICAgICBpbnB1dENULnZhbHVlID0gJycKICAgICAgICBhdXRvQ1QuYXV0b2NvbXBsZXRlLmRlc3Ryb3koKQogICAgICAgIGF1dG9DVCA9IGZhbHNlOwogICAgICAgIGlucHV0Qy52YWx1ZSA9ICcnCiAgICAgICAgaW5wdXRDLmRpc2FibGVkID0gdHJ1ZQogICAgICAgIGF1dG9DLmF1dG9jb21wbGV0ZS5kZXN0cm95KCkKICAgICAgICBhdXRvQyA9IGZhbHNlOwogICAgICB9KQoKICAgICAgY2xlYXIuYWRkRXZlbnRMaXN0ZW5lcignY2xpY2snLCBmdW5jdGlvbigpIHsgCiAgICAgICAgb3V0cHV0LnZhbHVlID0gJyc7CiAgICAgICAgYnRuLnZhbHVlID0gJ09wZW4nOwogICAgICAgIGNob3NlbkNvbnRlbnRUeXBlSUQgPSB2b2lkIDA7CiAgICAgICAgY2hvc2VuQ29udGVudElEcyA9IFtdOwogICAgICAgIGNob3NlbkNvbnRlbnROYW1lcyA9IFtdOwogICAgICB9KQoKICAgIH0pKHJlZiwgb3V0cHV0LCBidG4sIGlucHV0Q1QsIGlucHV0QywgbW9kYWwsIGNsZWFyKTsKICB9Cgp9KSgpOwo=")
	tmpls["js/content.js"] = tostring("Ly8gU2V0dXAgaW5wdXRzIGZvciBjb250ZW50IGNyZWF0ZS91cGRhdGU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OmZ1bmN0aW9uKCl7fX19OwogICAgICB2YXIgaXNMaXN0ID0gcmVmLmNsYXNzTmFtZS5pbmRleE9mKCdyZWYtbGlzdCcpICE9IC0xOwoKICAgICAgdmFyIGNob3NlbkNvbnRlbnRUeXBlSUQgLy8gdXNlZCBieSBib3RoCiAgICAgIHZhciBjaG9zZW5Db250ZW50SURzID0gW10gLy8gb25seSB1c2VkIGJlIHJlZiBsaXN0CiAgICAgIHZhciBjaG9zZW5Db250ZW50TmFtZXMgPSBbXSAvLyBvbmx5IHVzZWQgYmUgcmVmIGxpc3QKCiAgICAgIG1vZGFsLmFkZEV2ZW50TGlzdGVuZXIoJ3Nob3duLmJzLm1vZGFsJywgZnVuY3Rpb24oKSB7IAogICAgICAgIHZhciBvcHRzID0gewogICAgICAgICAgYXV0b3NlbGVjdDogdHJ1ZSwKICAgICAgICAgIGF1dG9zZWxlY3RPbkJsdXI6IHRydWUsIAogICAgICAgICAgdGFiQXV0b2NvbXBsZXRlOiB0cnVlLAogICAgICAgICAgLy8gY2xlYXJPblNlbGVjdGVkOiB0cnVlLAogICAgICAgICAgaGludDogZmFsc2UsCiAgICAgICAgICAvLyBkZWJ1ZzogdHJ1ZQogICAgICAgIH0KCiAgICAgICAgZnVuY3Rpb24gZ2V0b3B0cyh1cmwsIHRyYW5zZm9ybSwgZGlzcGxheUtleSkgeyAKICAgICAgICAgIHZhciBjb250ZW50dHlwZUFib3J0ID0gZnVuY3Rpb24oKSB7fQogICAgICAgICAgcmV0dXJuIHsKICAgICAgICAgICAgZGlzcGxheUtleTogZGlzcGxheUtleSwKICAgICAgICAgICAgc291cmNlOiBmdW5jdGlvbihxdWVyeSwgY2IpIHsgCiAgICAgICAgICAgICAgY2IoW10pCiAgICAgICAgICAgICAgY29udGVudHR5cGVBYm9ydCgpCiAgICAgICAgICAgICAgdmFyIHJlcSA9IG5ldyBYTUxIdHRwUmVxdWVzdCgpCiAgICAgICAgICAgICAgY29udGVudHR5cGVBYm9ydCA9IGZ1bmN0aW9uKCkgeyByZXEuYWJvcnQoKSB9IAogICAgICAgICAgICAgIHJlcS5vbnJlYWR5c3RhdGVjaGFuZ2UgPSBmdW5jdGlvbigpIHsKICAgICAgICAgICAgICAgIGlmICh0aGlzLnJlYWR5U3RhdGUgIT0gNCkgewogICAgICAgICAgICAgICAgICByZXR1cm4KICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICBpZiAodGhpcy5zdGF0dXMgIT0gMjAwKSB7CiAgICAgICAgICAgICAgICAgIGlmICh0aGlzLnJlc3BvbnNlVGV4dCAhPSAiIikgewogICAgICAgICAgICAgICAgICAgIGFsZXJ0KHRoaXMucmVzcG9uc2VUZXh0KQogICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgIGNiKFtdKQogICAgICAgICAgICAgICAgICByZXR1cm4KICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICB0cnkgeyAKICAgICAgICAgICAgICAgICAgY2IodHJhbnNmb3JtKEpTT04ucGFyc2UodGhpcy5yZXNwb25zZVRleHQpKSkKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIGNhdGNoKGUpIHsgCiAgICAgICAgICAgICAgICAgIHZhciBtc2cgPSBlLnRvU3RyaW5nKCkKICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coe2UsbXNnfSkKICAgICAgICAgICAgICAgICAgaWYgKG1zZyAhPSAiIikgeyAvLyBDYW5jZWxsZWQgcmVxdWVzdHMgaGl0IHRoaXMuCiAgICAgICAgICAgICAgICAgICAgYWxlcnQobXNnKQogICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgfQogICAgICAgICAgICAgIHJlcS5vcGVuKCdHRVQnLCB1cmwoKSArIHF1ZXJ5LCB0cnVlKQogICAgICAgICAgICAgIHJlcS5zZW5kKCkKICAgICAgICAgICAgfQogICAgICAgICAgfQogICAgICAgIH0KCiAgICAgICAgdmFyIGNvbnRlbnR0eXBlT3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BiZSBkb25lIG9uIHRoZSBzZXJ2ZXIuCiAgICAgICAgICAgIHt7IGlmIC5Db250ZW50IH19CiAgICAgICAgICAgIGRhdGEgPSBkYXRhLmZpbHRlcihmdW5jdGlvbihpdGVtKSB7IHJldHVybiBpdGVtLkNvbnRlbnRJRCAhPSB7eyAuQ29udGVudC5JRCB9fTsgfSk7CiAgICAgICAgICAgIHt7IGVuZCB9fQoKICAgICAgICAgICAgaWYgKGlzTGlzdCkgewogICAgICAgICAgICAgIGRhdGEgPSBkYXRhLmZpbHRlcihmdW5jdGlvbihpdGVtKSB7IHJldHVybiBjaG9zZW5Db250ZW50SURzLmluZGV4T2YoaXRlbS5Db250ZW50SUQpID09PSAtMTsgfSk7CiAgICAgICAgICAgIH0KCiAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBkYXRhLmxlbmd0aDsgaSsrKSB7IC8vIFRoaXMgcmVzcG9uc2UgaXMgcGFnZWQsIGRvbid0IHdvcnJ5IGFib3V0IE9eMi4gTWF4IG9mIDIwIGl0ZW1zLgoKICAgICAgICAgICAgICBmb3IgKGogPSAwOyBqIDwgZGF0YVtpXS5Db250ZW50VmFsdWVzLmxlbmd0aDsgaisrKSB7CiAgICAgICAgICAgICAgICBpZiAoZGF0YVtpXS5Db250ZW50VmFsdWVzW2pdLkZpZWxkTmFtZSA9PSAibmFtZSIpIHsgLy8gV2UncmUgZ3VhcmFudGVlZCB0byBoYXZlIHRoaXMuCiAgICAgICAgICAgICAgICAgIE9iamVjdC5hc3NpZ24oZGF0YVtpXSwgZGF0YVtpXS5Db250ZW50VmFsdWVzW2pdKQogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgICAgICByZXR1cm4gZGF0YQogICAgICAgICAgfSwKICAgICAgICAgICdGaWVsZFZhbHVlJwogICAgICAgICkKCiAgICAgICAgLy8gVE9ETzogV2VpcmQgYmVoYXZpb3IgaGVyZSwgd2h5IGRvIEkgaGF2ZSB0byBpbmxpbmUgdGhpcyBjbGVhciBvbgogICAgICAgIC8vIHNlbGVjdGVkPyBXaHkgY2FuJ3QgaXQgZXhpc3RzIGluIGNvbnRlbnRPcHRzPwogICAgICAgIGF1dG9DID0gd2luZG93LmF1dG9jb21wbGV0ZShjb250ZW50LCBPYmplY3QuYXNzaWduKHt9LCBvcHRzLCB7Y2xlYXJPblNlbGVjdGVkOnRydWV9KSwgW2NvbnRlbnRPcHRzXSkub24oJ2F1dG9jb21wbGV0ZTpzZWxlY3RlZCcsIG9uQ29udGVudFNlbGVjdGVkKQogICAgICAgIGZ1bmN0aW9uIG9uQ29udGVudFNlbGVjdGVkKGUsIGl0ZW0sIGRhdGFzZXQsIGN0eCkgewogICAgICAgICAgaWYgKGlzTGlzdCkgewogICAgICAgICAgICBjaG9zZW5Db250ZW50SURzLnB1c2goaXRlbS5Db250ZW50SUQpCiAgICAgICAgICAgIGNob3NlbkNvbnRlbnROYW1lcy5wdXNoKGl0ZW0uRmllbGRWYWx1ZSkKICAgICAgICAgICAgb3V0cHV0LnZhbHVlID0gY2hvc2VuQ29udGVudElEcwogICAgICAgICAgICAgIC5maWx0ZXIoZnVuY3Rpb24odmFsLCBpLCBzZWxmKSB7IHJldHVybiBzZWxmLmluZGV4T2YodmFsKSA9PT0gaSB9KQogICAgICAgICAgICAgIC5qb2luKCctJykKICAgICAgICAgICAgYnRuLnZhbHVlID0gY2hvc2VuQ29udGVudE5hbWVzCiAgICAgICAgICAgICAgLmZpbHRlcihmdW5jdGlvbih2YWwsIGksIHNlbGYpIHsgcmV0dXJuIHNlbGYuaW5kZXhPZih2YWwpID09PSBpIH0pCiAgICAgICAgICAgICAgLmpvaW4oJywgJykKICAgICAgICAgIH0KICAgICAgICAgIGVsc2UgewogICAgICAgICAgICBvdXRwdXQudmFsdWUgPSBpdGVtLkNvbnRlbnRJRAogICAgICAgICAgICBidG4udmFsdWUgPSBpdGVtLkZpZWxkVmFsdWUKICAgICAgICAgICAgYm9vdHN0cmFwLk1vZGFsLmdldEluc3RhbmNlKG1vZGFsKS5oaWRlKCkKICAgICAgICAgIH0KICAgICAgICB9CiAgICAgIH0pCgogICAgICBtb2RhbC5hZGRFdmVudExpc3RlbmVyKCdoaWRkZW4uYnMubW9kYWwnLCBmdW5jdGlvbigpIHsgCiAgICAgICAgaW5wdXRDVC52YWx1ZSA9ICcnCiAgICAgICAgYXV0b0NULmF1dG9jb21wbGV0ZS5kZXN0cm95KCkKICAgICAgICBhdXRvQ1QgPSBmYWxzZTsKICAgICAgICBpbnB1dEMudmFsdWUgPSAnJwogICAgICAgIGlucHV0Qy5kaXNhYmxlZCA9IHRydWUKICAgICAgICBhdXRvQy5hdXRvY29tcGxldGUuZGVzdHJveSgpCiAgICAgICAgYXV0b0MgPSBmYWxzZTsKICAgICAgfSkKCiAgICAgIGNsZWFyLmFkZEV2ZW50TGlzdGVuZXIoJ2NsaWNrJywgZnVuY3Rpb24oKSB7IAogICAgICAgIGlucHV0Q1QudmFsdWUgPSAnJzsKICAgICAgICBpbnB1dEMudmFsdWUgPSAnJzsKICAgICAgICBpbnB1dEMuZGlzYWJsZWQgPSB0cnVlOwogICAgICAgIGlucHV0Q1QuZm9jdXMoKTsKICAgICAgICBvdXRwdXQudmFsdWUgPSAnJzsKICAgICAgICBidG4udmFsdWUgPSAnT3Blbic7CiAgICAgICAgY2hvc2VuQ29udGVudFR5cGVJRCA9IHZvaWQgMDsKICAgICAgICBjaG9zZW5Db250ZW50SURzID0gW107CiAgICAgICAgY2hvc2VuQ29udGVudE5hbWVzID0gW107CiAgICAgIH0pCgogICAgfSkocmVmLCBvdXRwdXQsIGJ0biwgaW5wdXRDVCwgaW5wdXRDLCBtb2RhbCwgY2xlYXIpOwogIH0KCn0pKCk7Cg==")

	tmpls["js/main.js"] = tostring("Ly8gT24gbW9kYWwgb3BlbiBhbHdheXMgZm9jdXMgZmlyc3QgaW5wdXQgb3IgY2xvc2UgYnV0dG9uLiBBbHNvLCBmaXggYm9vdHN0cmFwIAovLy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