diff --git a/themes/intotheeast/css-compiled/post-form.css b/themes/intotheeast/css-compiled/post-form.css index 8822a6c..17c5992 100644 --- a/themes/intotheeast/css-compiled/post-form.css +++ b/themes/intotheeast/css-compiled/post-form.css @@ -1,4 +1,4 @@ -.CodeMirror{font-family:monospace;height:300px;color:#000;direction:ltr}.CodeMirror-lines{padding:4px 0}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{padding:0 4px}.CodeMirror-gutter-filler,.CodeMirror-scrollbar-filler{background-color:#fff}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:#000}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid #000;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0!important;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-fat-cursor .CodeMirror-line::selection,.cm-fat-cursor .CodeMirror-line>span::selection,.cm-fat-cursor .CodeMirror-line>span>span::selection{background:0 0}.cm-fat-cursor .CodeMirror-line::-moz-selection,.cm-fat-cursor .CodeMirror-line>span::-moz-selection,.cm-fat-cursor .CodeMirror-line>span>span::-moz-selection{background:0 0}.cm-fat-cursor{caret-color:transparent}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-rulers{position:absolute;inset:-50px 0 0;overflow:hidden}.CodeMirror-ruler{border-left:1px solid #ccc;top:0;bottom:0;position:absolute}.cm-s-default .cm-header{color:#00f}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-type,.cm-s-default .cm-variable-3{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta,.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-s-default .cm-error,.cm-invalidchar{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0b0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#a22}.CodeMirror-matchingtag{background:#ff96004d}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:#fff}.CodeMirror-scroll{overflow:scroll!important;margin-bottom:-50px;margin-right:-50px;padding-bottom:50px;height:100%;outline:0;position:relative;z-index:0}.CodeMirror-sizer{position:relative;border-right:50px solid transparent}.CodeMirror-gutter-filler,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-vscrollbar{position:absolute;z-index:6;display:none;outline:0}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;min-height:100%;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-50px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:0 0!important;border:none!important}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-gutter-wrapper ::selection{background-color:transparent}.CodeMirror-gutter-wrapper ::-moz-selection{background-color:transparent}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:0 0;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent;-webkit-font-variant-ligatures:contextual;font-variant-ligatures:contextual}.CodeMirror-wrap pre.CodeMirror-line,.CodeMirror-wrap pre.CodeMirror-line-like{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;inset:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;padding:.1px}.CodeMirror-code{outline:0}.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber,.CodeMirror-scroll,.CodeMirror-sizer{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute;pointer-events:none}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}div.CodeMirror-dragcursors,.CodeMirror-focused div.CodeMirror-cursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background-color:#ffa;background-color:#ff06}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:""}span.CodeMirror-selectedtext{background:0 0}.EasyMDEContainer{display:block}.CodeMirror-rtl pre{direction:rtl}.EasyMDEContainer.sided--no-fullscreen{display:flex;flex-direction:row;flex-wrap:wrap}.EasyMDEContainer .CodeMirror{box-sizing:border-box;height:auto;border:1px solid #ced4da;border-bottom-left-radius:4px;border-bottom-right-radius:4px;padding:10px;font:inherit;z-index:0;word-wrap:break-word}.EasyMDEContainer .CodeMirror-scroll{cursor:text}.EasyMDEContainer .CodeMirror-fullscreen{background:#fff;position:fixed!important;inset:50px 0 0;height:auto;z-index:8;border-right:none!important;border-bottom-right-radius:0!important}.EasyMDEContainer .CodeMirror-sided{width:50%!important}.EasyMDEContainer.sided--no-fullscreen .CodeMirror-sided{border-right:none!important;border-bottom-right-radius:0;position:relative;flex:1 1 auto}.EasyMDEContainer .CodeMirror-placeholder{opacity:.5}.EasyMDEContainer .CodeMirror-focused .CodeMirror-selected{background:#d9d9d9}.editor-toolbar{position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;padding:9px 10px;border-top:1px solid #ced4da;border-left:1px solid #ced4da;border-right:1px solid #ced4da;border-top-left-radius:4px;border-top-right-radius:4px}.editor-toolbar.fullscreen{width:100%;height:50px;padding-top:10px;padding-bottom:10px;box-sizing:border-box;background:#fff;border:0;position:fixed;top:0;left:0;opacity:1;z-index:9}.editor-toolbar.fullscreen:before{width:20px;height:50px;background:-moz-linear-gradient(left,#fff 0,rgba(255,255,255,0) 100%);background:-webkit-gradient(linear,left top,right top,color-stop(0,#fff),color-stop(100%,rgba(255,255,255,0)));background:-webkit-linear-gradient(left,#fff 0,rgba(255,255,255,0) 100%);background:-o-linear-gradient(left,#fff 0,rgba(255,255,255,0) 100%);background:-ms-linear-gradient(left,#fff 0,rgba(255,255,255,0) 100%);background:linear-gradient(to right,#fff 0,#fff0);position:fixed;top:0;left:0;margin:0;padding:0}.editor-toolbar.fullscreen:after{width:20px;height:50px;background:-moz-linear-gradient(left,rgba(255,255,255,0) 0,#fff 100%);background:-webkit-gradient(linear,left top,right top,color-stop(0,rgba(255,255,255,0)),color-stop(100%,#fff));background:-webkit-linear-gradient(left,rgba(255,255,255,0) 0,#fff 100%);background:-o-linear-gradient(left,rgba(255,255,255,0) 0,#fff 100%);background:-ms-linear-gradient(left,rgba(255,255,255,0) 0,#fff 100%);background:linear-gradient(to right,#fff0 0,#fff);position:fixed;top:0;right:0;margin:0;padding:0}.EasyMDEContainer.sided--no-fullscreen .editor-toolbar{width:100%}.editor-toolbar .easymde-dropdown,.editor-toolbar button{background:0 0;display:inline-block;text-align:center;text-decoration:none!important;height:30px;margin:0;padding:0;border:1px solid transparent;border-radius:3px;cursor:pointer}.editor-toolbar button{font-weight:700;min-width:30px;padding:0 6px;white-space:nowrap}.editor-toolbar button.active,.editor-toolbar button:hover{background:#fcfcfc;border-color:#95a5a6}.editor-toolbar i.separator{display:inline-block;width:0;border-left:1px solid #d9d9d9;border-right:1px solid #fff;color:transparent;text-indent:-10px;margin:0 6px}.editor-toolbar button:after{font-family:Arial,Helvetica Neue,Helvetica,sans-serif;font-size:65%;vertical-align:text-bottom;position:relative;top:2px}.editor-toolbar button.heading-1:after{content:"1"}.editor-toolbar button.heading-2:after{content:"2"}.editor-toolbar button.heading-3:after{content:"3"}.editor-toolbar button.heading-bigger:after{content:"\25b2"}.editor-toolbar button.heading-smaller:after{content:"\25bc"}.editor-toolbar.disabled-for-preview button:not(.no-disable){opacity:.6;pointer-events:none}@media only screen and (max-width:700px){.editor-toolbar i.no-mobile{display:none}}.editor-statusbar{padding:8px 10px;font-size:12px;color:#959694;text-align:right}.EasyMDEContainer.sided--no-fullscreen .editor-statusbar{width:100%}.editor-statusbar span{display:inline-block;min-width:4em;margin-left:1em}.editor-statusbar .lines:before{content:"lines: "}.editor-statusbar .words:before{content:"words: "}.editor-statusbar .characters:before{content:"characters: "}.editor-preview-full{position:absolute;width:100%;height:100%;top:0;left:0;z-index:7;overflow:auto;display:none;box-sizing:border-box}.editor-preview-side{position:fixed;bottom:0;width:50%;top:50px;right:0;z-index:9;overflow:auto;display:none;box-sizing:border-box;border:1px solid #ddd;word-wrap:break-word}.editor-preview-active-side{display:block}.EasyMDEContainer.sided--no-fullscreen .editor-preview-active-side{flex:1 1 auto;height:auto;position:static}.editor-preview-active{display:block}.editor-preview{padding:10px;background:#fafafa}.editor-preview>p{margin-top:0}.editor-preview pre{background:#eee;margin-bottom:10px}.editor-preview table td,.editor-preview table th{border:1px solid #ddd;padding:5px}.cm-s-easymde .cm-tag{color:#63a35c}.cm-s-easymde .cm-attribute{color:#795da3}.cm-s-easymde .cm-string{color:#183691}.cm-s-easymde .cm-header-1{font-size:calc(1.375rem + 1.5vw)}.cm-s-easymde .cm-header-2{font-size:calc(1.325rem + .9vw)}.cm-s-easymde .cm-header-3{font-size:calc(1.3rem + .6vw)}.cm-s-easymde .cm-header-4{font-size:calc(1.275rem + .3vw)}.cm-s-easymde .cm-header-5{font-size:1.25rem}.cm-s-easymde .cm-header-6{font-size:1rem}.cm-s-easymde .cm-header-1,.cm-s-easymde .cm-header-2,.cm-s-easymde .cm-header-3,.cm-s-easymde .cm-header-4,.cm-s-easymde .cm-header-5,.cm-s-easymde .cm-header-6{margin-bottom:.5rem;line-height:1.2}.cm-s-easymde .cm-comment{background:#0000000d;border-radius:2px}.cm-s-easymde .cm-link{color:#7f8c8d}.cm-s-easymde .cm-url{color:#aab2b3}.cm-s-easymde .cm-quote{color:#7f8c8d;font-style:italic}.editor-toolbar .easymde-dropdown{position:relative;background:linear-gradient(to bottom right,#fff 0 84%,#333 50% 100%);border-radius:0;border:1px solid #fff}.editor-toolbar .easymde-dropdown:hover{background:linear-gradient(to bottom right,#fff 0 84%,#333 50% 100%)}.easymde-dropdown-content{display:block;visibility:hidden;position:absolute;background-color:#f9f9f9;box-shadow:0 8px 16px #0003;padding:8px;z-index:2;top:30px}.easymde-dropdown:active .easymde-dropdown-content,.easymde-dropdown:focus .easymde-dropdown-content,.easymde-dropdown:focus-within .easymde-dropdown-content{visibility:visible}.easymde-dropdown-content button{display:block}span[data-img-src]:after{content:"";background-image:var(--bg-image);display:block;max-height:100%;max-width:100%;background-size:contain;height:0;padding-top:var(--height);width:var(--width);background-repeat:no-repeat}.CodeMirror .cm-spell-error:not(.cm-url):not(.cm-comment):not(.cm-tag):not(.cm-word){background:#ff000026}.post-edit-error{margin:1rem 0;padding:.75rem 1rem;border:1px solid #E5786A;border-radius:8px;background:#e5786a1f;color:#e5786a;font-size:.9rem;line-height:1.4}.editor-toolbar .mde-btn:before{font-style:normal;font-weight:400;font-family:inherit}.editor-toolbar .mde-bold:before{content:"B";font-weight:700}.editor-toolbar .mde-italic:before{content:"I";font-style:italic}.editor-toolbar .mde-ul:before{content:"\2022\2002\2014"}.editor-toolbar .mde-link:before{content:"\1f517"}.editor-toolbar .mde-preview:before{content:"\1f441"}.EasyMDEContainer .CodeMirror{min-height:180px}.photo-convert-status:empty{display:none}.photo-convert-status{font-size:var(--text-sm);margin-top:var(--space-2)}.photo-reauth-hint{display:none;font-size:var(--text-sm);color:var(--color-ink-muted);margin-top:var(--space-2)}.photo-reauth-hint.is-shown{display:block}.post-form-wrap select{width:100%;font-family:var(--font-ui);font-size:var(--text-base);padding:.875rem 2.5rem .875rem 1rem;min-height:44px;border:1px solid var(--color-border);border-radius:var(--radius-md);background:var(--color-canvas);color:var(--color-ink);-webkit-appearance:none;appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2390887E' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 1rem center}.post-form-wrap select:focus{outline:2px solid var(--color-accent);outline-offset:1px;border-color:var(--color-accent)}.post-form-wrap input[type=number]{width:100%;font-family:var(--font-ui);font-size:var(--text-base);padding:.875rem 1rem;min-height:44px;border:1px solid var(--color-border);border-radius:var(--radius-md);background:var(--color-canvas);color:var(--color-ink);-webkit-appearance:none;appearance:none}.post-form-wrap input[type=number]:focus{outline:2px solid var(--color-accent);outline-offset:1px;border-color:var(--color-accent)}.more-options{margin-bottom:var(--space-5);border:1px solid var(--color-border);border-radius:var(--radius-md);background:var(--color-canvas)}.more-options__summary{cursor:pointer;padding:.875rem 1rem;min-height:44px;display:flex;align-items:center;font-family:var(--font-ui);font-size:var(--text-sm);font-weight:600;color:var(--color-ink);list-style:none;user-select:none}.more-options__summary::-webkit-details-marker{display:none}.more-options__summary:before{content:"\25b8";margin-right:var(--space-2);color:var(--color-ink-muted);transition:transform .15s}.more-options[open] .more-options__summary:before{transform:rotate(90deg)}.more-options[open] .more-options__summary{border-bottom:1px solid var(--color-border)}.more-options>.form-field{padding:0 1rem}.more-options>.form-field:first-of-type{padding-top:var(--space-4)}.more-options>.form-field:last-child{padding-bottom:var(--space-4);margin-bottom:0}.btn-action.is-loading{position:relative;color:transparent;pointer-events:none}.btn-action.is-loading:after{content:"";position:absolute;top:50%;left:50%;width:16px;height:16px;margin:-8px 0 0 -8px;border:2px solid var(--color-ink-muted);border-top-color:var(--color-accent);border-radius:50%;animation:post-spin .7s linear infinite}.btn-action[disabled]{opacity:.5;cursor:not-allowed}@keyframes post-spin{to{transform:rotate(360deg)}}.post-form-wrap .notices{padding:1rem 1.1rem;border-radius:var(--radius-md);font-size:var(--text-base);margin:0 0 var(--space-5);background:var(--color-canvas);color:var(--color-ink);border-left:4px solid var(--color-accent)}.post-form-wrap .notices p{margin:0}.post-form-wrap .notices.error,.post-form-wrap .notices.red{border-left-color:var(--color-error)}.post-form-wrap .notices.success,.post-form-wrap .notices.green{border-left-color:var(--color-accent)}.post-success{margin:0 0 var(--space-5);padding:1.1rem;border-radius:var(--radius-md);background:var(--color-accent-light);border:1px solid var(--color-accent)}.post-success__title{font-family:var(--font-ui);font-size:var(--text-md);font-weight:600;color:var(--color-ink);margin:0 0 var(--space-3)}.post-success__actions{display:flex;flex-wrap:wrap;gap:var(--space-3)}.post-success__view{flex:1;min-width:140px;text-align:center;padding:.8rem 1rem;min-height:44px;border-radius:var(--radius-md);background:var(--color-accent);color:var(--color-accent-on);font-weight:600;text-decoration:none}.post-success__again{flex:1;min-width:140px;text-align:center;padding:.8rem 1rem;min-height:44px;border-radius:var(--radius-md);background:transparent;color:var(--color-ink);border:1px solid var(--color-border);font-weight:600;text-decoration:none}.filepond--credits{display:none!important}.filepond--root{font-family:var(--font-ui);font-size:var(--text-base)}.filepond--panel-root{background-color:var(--color-canvas);border:1px solid var(--color-border);border-radius:var(--radius-md)}.filepond--drop-label,.filepond--drop-label label{color:var(--color-ink-muted)}.filepond--label-action{color:var(--color-accent);text-decoration-color:var(--color-accent)}.filepond--item-panel{background-color:var(--color-surface-raised);border-radius:var(--radius-md)}.filepond--drip-blob{background-color:var(--color-accent)}.filepond--file{color:var(--color-ink)}.filepond--file-action-button{color:var(--color-ink);background-color:#00000073}.filepond--file-action-button:hover{background-color:#000000a6}.filepond--image-preview-overlay{display:none!important}.filepond--item[data-filepond-item-state=processing-complete] .filepond--file-info,.filepond--item[data-filepond-item-state=processing-complete] .filepond--file-status{opacity:0}.filepond--item[data-filepond-item-state=processing-complete]:after{content:"\2713";position:absolute;top:8px;right:8px;z-index:5;width:24px;height:24px;line-height:24px;text-align:center;border-radius:50%;background:var(--color-accent);color:#fff;font-size:15px;font-weight:700;box-shadow:0 1px 3px #00000059;pointer-events:none}.photos-collapse{margin-bottom:var(--space-5);border:1px solid var(--color-border);border-radius:var(--radius-md);background:var(--color-canvas)}.photos-collapse__summary{cursor:pointer;padding:.875rem 1rem;min-height:44px;display:flex;align-items:center;font-family:var(--font-ui);font-size:var(--text-sm);font-weight:600;color:var(--color-ink);list-style:none;user-select:none}.photos-collapse__summary::-webkit-details-marker{display:none}.photos-collapse__summary:before{content:"\25b8";margin-right:var(--space-2);color:var(--color-ink-muted);transition:transform .15s}.photos-collapse[open] .photos-collapse__summary:before{transform:rotate(90deg)}.photos-collapse[open] .photos-collapse__summary{border-bottom:1px solid var(--color-border)}.photos-collapse>:not(summary){padding-left:1rem;padding-right:1rem}.photos-collapse[open] .filepond--root,.photos-collapse[open] .filepond-root{margin:var(--space-4) 0}.photos-collapse[open]>.photo-convert-status:last-child,.photos-collapse[open]>.photo-reauth-hint:last-child{padding-bottom:var(--space-4)}.EasyMDEContainer .CodeMirror{background:var(--color-canvas);color:var(--color-ink);border:1px solid var(--color-border);border-radius:0 0 var(--radius-md) var(--radius-md);font-family:var(--font-ui);font-size:var(--text-base);line-height:var(--leading-normal);padding:var(--space-1)}.EasyMDEContainer .CodeMirror-cursor{border-color:var(--color-ink)}.EasyMDEContainer .CodeMirror-selected{background:var(--color-accent-light)!important}.EasyMDEContainer .editor-toolbar{background:var(--color-surface-raised);border:1px solid var(--color-border);border-bottom:none;border-radius:var(--radius-md) var(--radius-md) 0 0;opacity:1}.EasyMDEContainer .editor-toolbar button{color:var(--color-ink)!important;min-width:34px;height:34px}.EasyMDEContainer .editor-toolbar button:hover,.EasyMDEContainer .editor-toolbar button.active{background:var(--color-accent-light);border-color:var(--color-border)}.EasyMDEContainer .editor-toolbar i.separator{border-color:var(--color-border)}.EasyMDEContainer .editor-preview,.EasyMDEContainer .editor-preview-side{background:var(--color-canvas);color:var(--color-ink)}.EasyMDEContainer .editor-preview a{color:var(--color-accent)} +.CodeMirror{font-family:monospace;height:300px;color:#000;direction:ltr}.CodeMirror-lines{padding:4px 0}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{padding:0 4px}.CodeMirror-gutter-filler,.CodeMirror-scrollbar-filler{background-color:#fff}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:#000}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid #000;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0!important;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-fat-cursor .CodeMirror-line::selection,.cm-fat-cursor .CodeMirror-line>span::selection,.cm-fat-cursor .CodeMirror-line>span>span::selection{background:0 0}.cm-fat-cursor .CodeMirror-line::-moz-selection,.cm-fat-cursor .CodeMirror-line>span::-moz-selection,.cm-fat-cursor .CodeMirror-line>span>span::-moz-selection{background:0 0}.cm-fat-cursor{caret-color:transparent}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-rulers{position:absolute;inset:-50px 0 0;overflow:hidden}.CodeMirror-ruler{border-left:1px solid #ccc;top:0;bottom:0;position:absolute}.cm-s-default .cm-header{color:#00f}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-type,.cm-s-default .cm-variable-3{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta,.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-s-default .cm-error,.cm-invalidchar{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0b0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#a22}.CodeMirror-matchingtag{background:#ff96004d}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:#fff}.CodeMirror-scroll{overflow:scroll!important;margin-bottom:-50px;margin-right:-50px;padding-bottom:50px;height:100%;outline:0;position:relative;z-index:0}.CodeMirror-sizer{position:relative;border-right:50px solid transparent}.CodeMirror-gutter-filler,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-vscrollbar{position:absolute;z-index:6;display:none;outline:0}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;min-height:100%;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-50px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:0 0!important;border:none!important}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-gutter-wrapper ::selection{background-color:transparent}.CodeMirror-gutter-wrapper ::-moz-selection{background-color:transparent}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:0 0;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent;-webkit-font-variant-ligatures:contextual;font-variant-ligatures:contextual}.CodeMirror-wrap pre.CodeMirror-line,.CodeMirror-wrap pre.CodeMirror-line-like{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;inset:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;padding:.1px}.CodeMirror-code{outline:0}.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber,.CodeMirror-scroll,.CodeMirror-sizer{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute;pointer-events:none}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}div.CodeMirror-dragcursors,.CodeMirror-focused div.CodeMirror-cursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background-color:#ffa;background-color:#ff06}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:""}span.CodeMirror-selectedtext{background:0 0}.EasyMDEContainer{display:block}.CodeMirror-rtl pre{direction:rtl}.EasyMDEContainer.sided--no-fullscreen{display:flex;flex-direction:row;flex-wrap:wrap}.EasyMDEContainer .CodeMirror{box-sizing:border-box;height:auto;border:1px solid #ced4da;border-bottom-left-radius:4px;border-bottom-right-radius:4px;padding:10px;font:inherit;z-index:0;word-wrap:break-word}.EasyMDEContainer .CodeMirror-scroll{cursor:text}.EasyMDEContainer .CodeMirror-fullscreen{background:#fff;position:fixed!important;inset:50px 0 0;height:auto;z-index:8;border-right:none!important;border-bottom-right-radius:0!important}.EasyMDEContainer .CodeMirror-sided{width:50%!important}.EasyMDEContainer.sided--no-fullscreen .CodeMirror-sided{border-right:none!important;border-bottom-right-radius:0;position:relative;flex:1 1 auto}.EasyMDEContainer .CodeMirror-placeholder{opacity:.5}.EasyMDEContainer .CodeMirror-focused .CodeMirror-selected{background:#d9d9d9}.editor-toolbar{position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;padding:9px 10px;border-top:1px solid #ced4da;border-left:1px solid #ced4da;border-right:1px solid #ced4da;border-top-left-radius:4px;border-top-right-radius:4px}.editor-toolbar.fullscreen{width:100%;height:50px;padding-top:10px;padding-bottom:10px;box-sizing:border-box;background:#fff;border:0;position:fixed;top:0;left:0;opacity:1;z-index:9}.editor-toolbar.fullscreen:before{width:20px;height:50px;background:-moz-linear-gradient(left,#fff 0,rgba(255,255,255,0) 100%);background:-webkit-gradient(linear,left top,right top,color-stop(0,#fff),color-stop(100%,rgba(255,255,255,0)));background:-webkit-linear-gradient(left,#fff 0,rgba(255,255,255,0) 100%);background:-o-linear-gradient(left,#fff 0,rgba(255,255,255,0) 100%);background:-ms-linear-gradient(left,#fff 0,rgba(255,255,255,0) 100%);background:linear-gradient(to right,#fff 0,#fff0);position:fixed;top:0;left:0;margin:0;padding:0}.editor-toolbar.fullscreen:after{width:20px;height:50px;background:-moz-linear-gradient(left,rgba(255,255,255,0) 0,#fff 100%);background:-webkit-gradient(linear,left top,right top,color-stop(0,rgba(255,255,255,0)),color-stop(100%,#fff));background:-webkit-linear-gradient(left,rgba(255,255,255,0) 0,#fff 100%);background:-o-linear-gradient(left,rgba(255,255,255,0) 0,#fff 100%);background:-ms-linear-gradient(left,rgba(255,255,255,0) 0,#fff 100%);background:linear-gradient(to right,#fff0 0,#fff);position:fixed;top:0;right:0;margin:0;padding:0}.EasyMDEContainer.sided--no-fullscreen .editor-toolbar{width:100%}.editor-toolbar .easymde-dropdown,.editor-toolbar button{background:0 0;display:inline-block;text-align:center;text-decoration:none!important;height:30px;margin:0;padding:0;border:1px solid transparent;border-radius:3px;cursor:pointer}.editor-toolbar button{font-weight:700;min-width:30px;padding:0 6px;white-space:nowrap}.editor-toolbar button.active,.editor-toolbar button:hover{background:#fcfcfc;border-color:#95a5a6}.editor-toolbar i.separator{display:inline-block;width:0;border-left:1px solid #d9d9d9;border-right:1px solid #fff;color:transparent;text-indent:-10px;margin:0 6px}.editor-toolbar button:after{font-family:Arial,Helvetica Neue,Helvetica,sans-serif;font-size:65%;vertical-align:text-bottom;position:relative;top:2px}.editor-toolbar button.heading-1:after{content:"1"}.editor-toolbar button.heading-2:after{content:"2"}.editor-toolbar button.heading-3:after{content:"3"}.editor-toolbar button.heading-bigger:after{content:"\25b2"}.editor-toolbar button.heading-smaller:after{content:"\25bc"}.editor-toolbar.disabled-for-preview button:not(.no-disable){opacity:.6;pointer-events:none}@media only screen and (max-width:700px){.editor-toolbar i.no-mobile{display:none}}.editor-statusbar{padding:8px 10px;font-size:12px;color:#959694;text-align:right}.EasyMDEContainer.sided--no-fullscreen .editor-statusbar{width:100%}.editor-statusbar span{display:inline-block;min-width:4em;margin-left:1em}.editor-statusbar .lines:before{content:"lines: "}.editor-statusbar .words:before{content:"words: "}.editor-statusbar .characters:before{content:"characters: "}.editor-preview-full{position:absolute;width:100%;height:100%;top:0;left:0;z-index:7;overflow:auto;display:none;box-sizing:border-box}.editor-preview-side{position:fixed;bottom:0;width:50%;top:50px;right:0;z-index:9;overflow:auto;display:none;box-sizing:border-box;border:1px solid #ddd;word-wrap:break-word}.editor-preview-active-side{display:block}.EasyMDEContainer.sided--no-fullscreen .editor-preview-active-side{flex:1 1 auto;height:auto;position:static}.editor-preview-active{display:block}.editor-preview{padding:10px;background:#fafafa}.editor-preview>p{margin-top:0}.editor-preview pre{background:#eee;margin-bottom:10px}.editor-preview table td,.editor-preview table th{border:1px solid #ddd;padding:5px}.cm-s-easymde .cm-tag{color:#63a35c}.cm-s-easymde .cm-attribute{color:#795da3}.cm-s-easymde .cm-string{color:#183691}.cm-s-easymde .cm-header-1{font-size:calc(1.375rem + 1.5vw)}.cm-s-easymde .cm-header-2{font-size:calc(1.325rem + .9vw)}.cm-s-easymde .cm-header-3{font-size:calc(1.3rem + .6vw)}.cm-s-easymde .cm-header-4{font-size:calc(1.275rem + .3vw)}.cm-s-easymde .cm-header-5{font-size:1.25rem}.cm-s-easymde .cm-header-6{font-size:1rem}.cm-s-easymde .cm-header-1,.cm-s-easymde .cm-header-2,.cm-s-easymde .cm-header-3,.cm-s-easymde .cm-header-4,.cm-s-easymde .cm-header-5,.cm-s-easymde .cm-header-6{margin-bottom:.5rem;line-height:1.2}.cm-s-easymde .cm-comment{background:#0000000d;border-radius:2px}.cm-s-easymde .cm-link{color:#7f8c8d}.cm-s-easymde .cm-url{color:#aab2b3}.cm-s-easymde .cm-quote{color:#7f8c8d;font-style:italic}.editor-toolbar .easymde-dropdown{position:relative;background:linear-gradient(to bottom right,#fff 0 84%,#333 50% 100%);border-radius:0;border:1px solid #fff}.editor-toolbar .easymde-dropdown:hover{background:linear-gradient(to bottom right,#fff 0 84%,#333 50% 100%)}.easymde-dropdown-content{display:block;visibility:hidden;position:absolute;background-color:#f9f9f9;box-shadow:0 8px 16px #0003;padding:8px;z-index:2;top:30px}.easymde-dropdown:active .easymde-dropdown-content,.easymde-dropdown:focus .easymde-dropdown-content,.easymde-dropdown:focus-within .easymde-dropdown-content{visibility:visible}.easymde-dropdown-content button{display:block}span[data-img-src]:after{content:"";background-image:var(--bg-image);display:block;max-height:100%;max-width:100%;background-size:contain;height:0;padding-top:var(--height);width:var(--width);background-repeat:no-repeat}.CodeMirror .cm-spell-error:not(.cm-url):not(.cm-comment):not(.cm-tag):not(.cm-word){background:#ff000026}.post-edit-error{margin:1rem 0;padding:.75rem 1rem;border:1px solid #E5786A;border-radius:8px;background:#e5786a1f;color:#e5786a;font-size:.9rem;line-height:1.4}.editor-toolbar .mde-btn:before{font-style:normal;font-weight:400;font-family:inherit}.editor-toolbar .mde-bold:before{content:"B";font-weight:700}.editor-toolbar .mde-italic:before{content:"I";font-style:italic}.editor-toolbar .mde-ul:before{content:"\2022\2002\2014"}.editor-toolbar .mde-link:before{content:"\1f517"}.editor-toolbar .mde-preview:before{content:"\1f441"}.EasyMDEContainer .CodeMirror{min-height:180px}.photo-convert-status:empty{display:none}.photo-convert-status{font-size:var(--text-sm);margin-top:var(--space-2)}.photo-reauth-hint{display:none;font-size:var(--text-sm);color:var(--color-ink-muted);margin-top:var(--space-2)}.photo-reauth-hint.is-shown{display:block}.post-form-wrap select{width:100%;font-family:var(--font-ui);font-size:var(--text-base);padding:.875rem 2.5rem .875rem 1rem;min-height:44px;border:1px solid var(--color-border);border-radius:var(--radius-md);background:var(--color-canvas);color:var(--color-ink);-webkit-appearance:none;appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2390887E' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 1rem center}.post-form-wrap select:focus{outline:2px solid var(--color-accent);outline-offset:1px;border-color:var(--color-accent)}.post-form-wrap input[type=number]{width:100%;font-family:var(--font-ui);font-size:var(--text-base);padding:.875rem 1rem;min-height:44px;border:1px solid var(--color-border);border-radius:var(--radius-md);background:var(--color-canvas);color:var(--color-ink);-webkit-appearance:none;appearance:none}.post-form-wrap input[type=number]:focus{outline:2px solid var(--color-accent);outline-offset:1px;border-color:var(--color-accent)}.more-options{margin-bottom:var(--space-5);border:1px solid var(--color-border);border-radius:var(--radius-md);background:var(--color-canvas)}.more-options__summary{cursor:pointer;padding:.875rem 1rem;min-height:44px;display:flex;align-items:center;font-family:var(--font-ui);font-size:var(--text-sm);font-weight:600;color:var(--color-ink);list-style:none;user-select:none}.more-options__summary::-webkit-details-marker{display:none}.more-options__summary:before{content:"\25b8";margin-right:var(--space-2);color:var(--color-ink-muted);transition:transform .15s}.more-options[open] .more-options__summary:before{transform:rotate(90deg)}.more-options[open] .more-options__summary{border-bottom:1px solid var(--color-border)}.more-options>.form-field{padding:0 1rem}.more-options>.form-field:first-of-type{padding-top:var(--space-4)}.more-options>.form-field:last-child{padding-bottom:var(--space-4);margin-bottom:0}.btn-action.is-loading{position:relative;color:transparent;pointer-events:none}.btn-action.is-loading:after{content:"";position:absolute;top:50%;left:50%;width:16px;height:16px;margin:-8px 0 0 -8px;border:2px solid var(--color-ink-muted);border-top-color:var(--color-accent);border-radius:50%;animation:post-spin .7s linear infinite}.btn-action[disabled]{opacity:.5;cursor:not-allowed}@keyframes post-spin{to{transform:rotate(360deg)}}.post-form-wrap .notices{padding:1rem 1.1rem;border-radius:var(--radius-md);font-size:var(--text-base);margin:0 0 var(--space-5);background:var(--color-canvas);color:var(--color-ink);border-left:4px solid var(--color-accent)}.post-form-wrap .notices p{margin:0}.post-form-wrap .notices.error,.post-form-wrap .notices.red{border-left-color:var(--color-error)}.post-form-wrap .notices.success,.post-form-wrap .notices.green{border-left-color:var(--color-accent)}.post-success{margin:0 0 var(--space-5);padding:1.1rem;border-radius:var(--radius-md);background:var(--color-accent-light);border:1px solid var(--color-accent)}.post-success__title{font-family:var(--font-ui);font-size:var(--text-md);font-weight:600;color:var(--color-ink);margin:0 0 var(--space-3)}.post-success__actions{display:flex;flex-wrap:wrap;gap:var(--space-3)}.post-success__view{flex:1;min-width:140px;text-align:center;padding:.8rem 1rem;min-height:44px;border-radius:var(--radius-md);background:var(--color-accent);color:var(--color-accent-on);font-weight:600;text-decoration:none}.post-success__again{flex:1;min-width:140px;text-align:center;padding:.8rem 1rem;min-height:44px;border-radius:var(--radius-md);background:transparent;color:var(--color-ink);border:1px solid var(--color-border);font-weight:600;text-decoration:none}.filepond--credits{display:none!important}.filepond--root{font-family:var(--font-ui);font-size:var(--text-base)}.filepond--panel-root{background-color:var(--color-canvas);border:1px solid var(--color-border);border-radius:var(--radius-md)}.filepond--drop-label,.filepond--drop-label label{color:var(--color-ink-muted)}.filepond--label-action{color:var(--color-accent);text-decoration-color:var(--color-accent)}.filepond--item-panel{background-color:var(--color-surface-raised);border-radius:var(--radius-md)}.filepond--drip-blob{background-color:var(--color-accent)}.filepond--file{color:var(--color-ink)}.filepond--file-action-button{color:var(--color-ink);background-color:#00000073}.filepond--file-action-button:hover{background-color:#000000a6}.filepond--image-preview-overlay{display:none!important}.filepond--item[data-filepond-item-state=processing-complete] .filepond--file-info,.filepond--item[data-filepond-item-state=processing-complete] .filepond--file-status{opacity:0}.filepond--item[data-filepond-item-state=processing-complete]:after{content:"\2713";position:absolute;top:8px;right:8px;z-index:5;width:24px;height:24px;line-height:24px;text-align:center;border-radius:50%;background:var(--color-accent);color:#fff;font-size:15px;font-weight:700;box-shadow:0 1px 3px #00000059;pointer-events:none}.photos-collapse{margin-bottom:var(--space-5);border:1px solid var(--color-border);border-radius:var(--radius-md);background:var(--color-canvas)}.photos-collapse__summary{cursor:pointer;padding:.875rem 1rem;min-height:44px;display:flex;align-items:center;font-family:var(--font-ui);font-size:var(--text-sm);font-weight:600;color:var(--color-ink);list-style:none;user-select:none}.photos-collapse__summary::-webkit-details-marker{display:none}.photos-collapse__summary:before{content:"\25b8";margin-right:var(--space-2);color:var(--color-ink-muted);transition:transform .15s}.photos-collapse[open] .photos-collapse__summary:before{transform:rotate(90deg)}.photos-collapse[open] .photos-collapse__summary{border-bottom:1px solid var(--color-border)}.photos-collapse>:not(summary){padding-left:1rem;padding-right:1rem}.photos-collapse[open] .filepond--root,.photos-collapse[open] .filepond-root{margin:var(--space-4) 0}.photos-collapse[open]>.photo-convert-status:last-child,.photos-collapse[open]>.photo-reauth-hint:last-child{padding-bottom:var(--space-4)}.EasyMDEContainer .CodeMirror{background:var(--color-canvas);color:var(--color-ink);border:1px solid var(--color-border);border-radius:0 0 var(--radius-md) var(--radius-md);font-family:var(--font-ui);font-size:var(--text-base);line-height:var(--leading-normal);padding:var(--space-1)}.EasyMDEContainer .CodeMirror-cursor{border-color:var(--color-ink)}.EasyMDEContainer .CodeMirror-selected{background:var(--color-accent-light)!important}.EasyMDEContainer .editor-toolbar{background:var(--color-surface-raised);border:1px solid var(--color-border);border-bottom:none;border-radius:var(--radius-md) var(--radius-md) 0 0;opacity:1}.EasyMDEContainer .editor-toolbar button{color:var(--color-ink)!important;min-width:34px;height:34px}.EasyMDEContainer .editor-toolbar button:hover,.EasyMDEContainer .editor-toolbar button.active{background:var(--color-accent-light);border-color:var(--color-border)}.EasyMDEContainer .editor-toolbar i.separator{border-color:var(--color-border)}.EasyMDEContainer .editor-preview,.EasyMDEContainer .editor-preview-side{background:var(--color-canvas);color:var(--color-ink)}.EasyMDEContainer .editor-preview a{color:var(--color-accent)}.photo-editor{margin-bottom:var(--space-5)}.photo-editor__head{display:flex;align-items:center;justify-content:space-between;gap:var(--space-3);margin-bottom:var(--space-2)}.photo-editor__label{font-family:var(--font-ui);font-size:var(--text-base);font-weight:600;color:var(--color-ink)}.photo-editor__add{font-family:var(--font-ui);font-size:var(--text-sm);background:var(--color-accent);color:#fff;border:none;border-radius:var(--radius-sm);padding:var(--space-2) var(--space-4);cursor:pointer}.photo-editor__add:disabled{opacity:.5;cursor:default}.photo-editor__status{font-size:var(--text-sm);color:var(--color-ink-muted);min-height:1.2em;margin:0 0 var(--space-2)}.photo-editor__status.error{color:var(--color-error)}.photo-editor__grid{display:grid;grid-template-columns:repeat(3,1fr);gap:var(--space-2)}@media (min-width: 600px){.photo-editor__grid{grid-template-columns:repeat(4,1fr)}}.photo-editor__loading,.photo-editor__empty{grid-column:1 / -1;color:var(--color-ink-muted);font-size:var(--text-sm);padding:var(--space-4) 0}.photo-editor__cell{position:relative;aspect-ratio:1 / 1;border-radius:var(--radius-sm);overflow:hidden;background:var(--color-surface-raised);cursor:grab;touch-action:none}.photo-editor__cell:active{cursor:grabbing}.photo-editor__img{width:100%;height:100%;object-fit:cover;display:block;-webkit-user-drag:none;user-select:none;pointer-events:none}.photo-editor__cell:first-child:after{content:"Cover";position:absolute;left:var(--space-1);bottom:var(--space-1);font-family:var(--font-ui);font-size:var(--text-xs, .7rem);font-weight:600;color:#fff;background:var(--color-accent);padding:1px 6px;border-radius:var(--radius-sm);pointer-events:none}.photo-editor__del{position:absolute;top:var(--space-1);right:var(--space-1);width:24px;height:24px;line-height:1;display:flex;align-items:center;justify-content:center;border:none;border-radius:50%;background:#0000008c;color:#fff;font-size:.85rem;cursor:pointer}.photo-editor__del:hover{background:#000000bf}.photo-editor__del:disabled{opacity:.4;cursor:default}.photo-editor__confirm{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--space-1);padding:var(--space-2);background:#000000b8;text-align:center}.photo-editor__confirm-q{color:#fff;font-family:var(--font-ui);font-size:var(--text-sm)}.photo-editor__confirm button{font-family:var(--font-ui);font-size:var(--text-xs, .72rem);border:none;border-radius:var(--radius-sm);padding:3px 10px;cursor:pointer}.photo-editor__confirm-yes{background:var(--color-error);color:#fff}.photo-editor__confirm-no{background:#fff;color:var(--color-ink)}.photo-editor__confirm button:disabled{opacity:.5;cursor:default}.photo-editor__cell.sortable-ghost{opacity:.4}.photo-editor__cell.sortable-chosen{outline:2px solid var(--color-accent)} /*! Bundled license information: easymde/dist/easymde.min.css: diff --git a/themes/intotheeast/js/post/post-form.js b/themes/intotheeast/js/post/post-form.js index a5ea44e..07a2ff4 100644 --- a/themes/intotheeast/js/post/post-form.js +++ b/themes/intotheeast/js/post/post-form.js @@ -1,87 +1,87 @@ -import{a as Ds,b as Ye,c as Xc}from"./chunk-ZWRDP37E.js";var ct=Ye((Xo,Yo)=>{(function(o,f){typeof Xo=="object"&&typeof Yo<"u"?Yo.exports=f():typeof define=="function"&&define.amd?define(f):(o=o||self,o.CodeMirror=f())})(Xo,function(){"use strict";var o=navigator.userAgent,f=navigator.platform,c=/gecko\/\d/i.test(o),l=/MSIE \d/.test(o),s=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(o),g=/Edge\/(\d+)/.exec(o),d=l||s||g,p=d&&(l?document.documentMode||6:+(g||s)[1]),y=!g&&/WebKit\//.test(o),w=y&&/Qt\/\d+\.\d+/.test(o),D=!g&&/Chrome\/(\d+)/.exec(o),S=D&&+D[1],F=/Opera\//.test(o),T=/Apple Computer/.test(navigator.vendor),z=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(o),N=/PhantomJS/.test(o),A=T&&(/Mobile\/\w+/.test(o)||navigator.maxTouchPoints>2),B=/Android/.test(o),I=A||B||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(o),R=A||/Mac/.test(f),H=/\bCrOS\b/.test(o),_=/win/i.test(f),X=F&&o.match(/Version\/(\d*\.\d*)/);X&&(X=Number(X[1])),X&&X>=15&&(F=!1,y=!0);var K=R&&(w||F&&(X==null||X<12.11)),ge=c||d&&p>=9;function G(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var ue=function(e,t){var i=e.className,r=G(t).exec(i);if(r){var n=i.slice(r.index+r[0].length);e.className=i.slice(0,r.index)+(n?r[1]+n:"")}};function ae(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function de(e,t){return ae(e).appendChild(t)}function L(e,t,i,r){var n=document.createElement(e);if(i&&(n.className=i),r&&(n.style.cssText=r),typeof t=="string")n.appendChild(document.createTextNode(t));else if(t)for(var a=0;a=t)return u+(t-a);u+=h-a,u+=i-u%i,a=h+1}}var Je=function(){this.id=null,this.f=null,this.time=0,this.handler=tt(this.onTimeout,this)};Je.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Je.prototype.set=function(e,t){this.f=t;var i=+new Date+e;(!this.id||i=t)return r+Math.min(u,t-n);if(n+=a-r,n+=i-n%i,r=a+1,n>=t)return r}}var bt=[""];function qt(e){for(;bt.length<=e;)bt.push(me(bt)+" ");return bt[e]}function me(e){return e[e.length-1]}function xt(e,t){for(var i=[],r=0;r"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Iu.test(e))}function Ei(e,t){return t?t.source.indexOf("\\w")>-1&&Hn(e)?!0:t.test(e):Hn(e)}function ga(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var zu=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function Rn(e){return e.charCodeAt(0)>=768&&zu.test(e)}function va(e,t,i){for(;(i<0?t>0:ti?-1:1;;){if(t==i)return t;var n=(t+i)/2,a=r<0?Math.ceil(n):Math.floor(n);if(a==t)return e(a)?t:i;e(a)?i=a:t=a+r}}function Ou(e,t,i,r){if(!e)return r(t,i,"ltr",0);for(var n=!1,a=0;at||t==i&&u.to==t)&&(r(Math.max(u.from,t),Math.min(u.to,i),u.level==1?"rtl":"ltr",a),n=!0)}n||r(t,i,"ltr")}var Kr=null;function Xr(e,t,i){var r;Kr=null;for(var n=0;nt)return n;a.to==t&&(a.from!=a.to&&i=="before"?r=n:Kr=n),a.from==t&&(a.from!=a.to&&i!="before"?r=n:Kr=n)}return r??Kr}var Hu=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function i(m){return m<=247?e.charAt(m):1424<=m&&m<=1524?"R":1536<=m&&m<=1785?t.charAt(m-1536):1774<=m&&m<=2220?"r":8192<=m&&m<=8203?"w":m==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,n=/[stwN]/,a=/[LRr]/,u=/[Lb1n]/,h=/[1n]/;function v(m,x,C){this.level=m,this.from=x,this.to=C}return function(m,x){var C=x=="ltr"?"L":"R";if(m.length==0||x=="ltr"&&!r.test(m))return!1;for(var M=m.length,E=[],O=0;O-1&&(r[t]=n.slice(0,a).concat(n.slice(a+1)))}}}function Ie(e,t){var i=Pn(e,t);if(i.length)for(var r=Array.prototype.slice.call(arguments,2),n=0;n0}function yr(e){e.prototype.on=function(t,i){oe(this,t,i)},e.prototype.off=function(t,i){ht(this,t,i)}}function it(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ba(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function _n(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function Yr(e){it(e),ba(e)}function Wn(e){return e.target||e.srcElement}function xa(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),R&&e.ctrlKey&&t==1&&(t=3),t}var Ru=function(){if(d&&p<9)return!1;var e=L("div");return"draggable"in e||"dragDrop"in e}(),qn;function Pu(e){if(qn==null){var t=L("span","\u200B");de(e,L("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(qn=t.offsetWidth<=1&&t.offsetHeight>2&&!(d&&p<8))}var i=qn?L("span","\u200B"):L("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}var Un;function _u(e){if(Un!=null)return Un;var t=de(e,document.createTextNode("A\u062EA")),i=W(t,0,1).getBoundingClientRect(),r=W(t,1,2).getBoundingClientRect();return ae(e),!i||i.left==i.right?!1:Un=r.right-i.right<3}var jn=` +import{a as Ku,b as at,c as Gh}from"./chunk-ZWRDP37E.js";var Et=at((rl,nl)=>{(function(o,l){typeof rl=="object"&&typeof nl<"u"?nl.exports=l():typeof define=="function"&&define.amd?define(l):(o=o||self,o.CodeMirror=l())})(rl,function(){"use strict";var o=navigator.userAgent,l=navigator.platform,s=/gecko\/\d/i.test(o),a=/MSIE \d/.test(o),f=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(o),p=/Edge\/(\d+)/.exec(o),c=a||f||p,h=c&&(a?document.documentMode||6:+(p||f)[1]),b=!p&&/WebKit\//.test(o),y=b&&/Qt\/\d+\.\d+/.test(o),x=!p&&/Chrome\/(\d+)/.exec(o),C=x&&+x[1],S=/Opera\//.test(o),F=/Apple Computer/.test(navigator.vendor),_=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(o),L=/PhantomJS/.test(o),T=F&&(/Mobile\/\w+/.test(o)||navigator.maxTouchPoints>2),O=/Android/.test(o),N=T||O||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(o),P=T||/Mac/.test(l),I=/\bCrOS\b/.test(o),q=/win/i.test(l),j=S&&o.match(/Version\/(\d*\.\d*)/);j&&(j=Number(j[1])),j&&j>=15&&(S=!1,b=!0);var X=P&&(y||S&&(j==null||j<12.11)),me=s||c&&h>=9;function U(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var le=function(e,t){var n=e.className,r=U(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function ie(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function K(e,t){return ie(e).appendChild(t)}function E(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),typeof t=="string")i.appendChild(document.createTextNode(t));else if(t)for(var u=0;u=t)return d+(t-u);d+=g-u,d+=n-d%n,u=g+1}}var ft=function(){this.id=null,this.f=null,this.time=0,this.handler=gt(this.onTimeout,this)};ft.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},ft.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n=t)return r+Math.min(d,t-i);if(i+=u-r,i+=n-i%n,r=u+1,i>=t)return r}}var zt=[""];function pr(e){for(;zt.length<=e;)zt.push(we(zt)+" ");return zt[e]}function we(e){return e[e.length-1]}function Ht(e,t){for(var n=[],r=0;r"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Bc.test(e))}function wi(e,t){return t?t.source.indexOf("\\w")>-1&&Ko(e)?!0:t.test(e):Ko(e)}function Wl(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Nc=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function Yo(e){return e.charCodeAt(0)>=768&&Nc.test(e)}function ql(e,t,n){for(;(n<0?t>0:tn?-1:1;;){if(t==n)return t;var i=(t+n)/2,u=r<0?Math.ceil(i):Math.floor(i);if(u==t)return e(u)?t:n;e(u)?n=u:t=u+r}}function Oc(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,u=0;ut||t==n&&d.to==t)&&(r(Math.max(d.from,t),Math.min(d.to,n),d.level==1?"rtl":"ltr",u),i=!0)}i||r(t,n,"ltr")}var Mn=null;function _n(e,t,n){var r;Mn=null;for(var i=0;it)return i;u.to==t&&(u.from!=u.to&&n=="before"?r=i:Mn=i),u.from==t&&(u.from!=u.to&&n!="before"?r=i:Mn=i)}return r??Mn}var Ic=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(m){return m<=247?e.charAt(m):1424<=m&&m<=1524?"R":1536<=m&&m<=1785?t.charAt(m-1536):1774<=m&&m<=2220?"r":8192<=m&&m<=8203?"w":m==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,u=/[LRr]/,d=/[Lb1n]/,g=/[1n]/;function v(m,w,k){this.level=m,this.from=w,this.to=k}return function(m,w){var k=w=="ltr"?"L":"R";if(m.length==0||w=="ltr"&&!r.test(m))return!1;for(var B=m.length,M=[],H=0;H-1&&(r[t]=i.slice(0,u).concat(i.slice(u+1)))}}}function je(e,t){var n=Zo(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i0}function Qr(e){e.prototype.on=function(t,n){fe(this,t,n)},e.prototype.off=function(t,n){Lt(this,t,n)}}function mt(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Gl(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Qo(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function Bn(e){mt(e),Gl(e)}function Jo(e){return e.target||e.srcElement}function Xl(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),P&&e.ctrlKey&&t==1&&(t=3),t}var Pc=function(){if(c&&h<9)return!1;var e=E("div");return"draggable"in e||"dragDrop"in e}(),$o;function zc(e){if($o==null){var t=E("span","\u200B");K(e,E("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&($o=t.offsetWidth<=1&&t.offsetHeight>2&&!(c&&h<8))}var n=$o?E("span","\u200B"):E("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}var Vo;function Hc(e){if(Vo!=null)return Vo;var t=K(e,document.createTextNode("A\u062EA")),n=R(t,0,1).getBoundingClientRect(),r=R(t,1,2).getBoundingClientRect();return ie(e),!n||n.left==n.right?!1:Vo=r.right-n.right<3}var ea=` -b`.split(/\n/).length!=3?function(e){for(var t=0,i=[],r=e.length;t<=r;){var n=e.indexOf(` -`,t);n==-1&&(n=e.length);var a=e.slice(t,e.charAt(n-1)=="\r"?n-1:n),u=a.indexOf("\r");u!=-1?(i.push(a.slice(0,u)),t+=u+1):(i.push(a),t=n+1)}return i}:function(e){return e.split(/\r\n?|\n/)},Wu=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch{return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch{}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},qu=function(){var e=L("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Gn=null;function Uu(e){if(Gn!=null)return Gn;var t=de(e,L("span","x")),i=t.getBoundingClientRect(),r=W(t,0,1).getBoundingClientRect();return Gn=Math.abs(i.left-r.left)>1}var Kn={},br={};function ju(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Kn[e]=t}function Gu(e,t){br[e]=t}function Ai(e){if(typeof e=="string"&&br.hasOwnProperty(e))e=br[e];else if(e&&typeof e.name=="string"&&br.hasOwnProperty(e.name)){var t=br[e.name];typeof t=="string"&&(t={name:t}),e=pa(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ai("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ai("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Xn(e,t){t=Ai(t);var i=Kn[t.name];if(!i)return Xn(e,"text/plain");var r=i(e,t);if(xr.hasOwnProperty(t.name)){var n=xr[t.name];for(var a in n)n.hasOwnProperty(a)&&(r.hasOwnProperty(a)&&(r["_"+a]=r[a]),r[a]=n[a])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var u in t.modeProps)r[u]=t.modeProps[u];return r}var xr={};function Ku(e,t){var i=xr.hasOwnProperty(e)?xr[e]:xr[e]={};dt(t,i)}function tr(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var i={};for(var r in t){var n=t[r];n instanceof Array&&(n=n.concat([])),i[r]=n}return i}function Yn(e,t){for(var i;e.innerMode&&(i=e.innerMode(t),!(!i||i.mode==e));)t=i.state,e=i.mode;return i||{mode:e,state:t}}function Da(e,t,i){return e.startState?e.startState(t,i):!0}var ze=function(e,t,i){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=i};ze.prototype.eol=function(){return this.pos>=this.string.length},ze.prototype.sol=function(){return this.pos==this.lineStart},ze.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},ze.prototype.next=function(){if(this.post},ze.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},ze.prototype.skipToEnd=function(){this.pos=this.string.length},ze.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},ze.prototype.backUp=function(e){this.pos-=e},ze.prototype.column=function(){return this.lastColumnPos0?null:(a&&t!==!1&&(this.pos+=a[0].length),a)}},ze.prototype.current=function(){return this.string.slice(this.start,this.pos)},ze.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},ze.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},ze.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function re(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var i=e;!i.lines;)for(var r=0;;++r){var n=i.children[r],a=n.chunkSize();if(t=e.first&&ti?q(i,re(e,i).text.length):Xu(t,re(e,t.line).text.length)}function Xu(e,t){var i=e.ch;return i==null||i>t?q(e.line,t):i<0?q(e.line,0):e}function Ca(e,t){for(var i=[],r=0;rthis.maxLookAhead&&(this.maxLookAhead=e),t},At.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},At.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},At.fromSaved=function(e,t,i){return t instanceof Mi?new At(e,tr(e.mode,t.state),i,t.lookAhead):new At(e,tr(e.mode,t),i)},At.prototype.save=function(e){var t=e!==!1?tr(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Mi(t,this.maxLookAhead):t};function ka(e,t,i,r){var n=[e.state.modeGen],a={};Ta(e,t.text,e.doc.mode,i,function(m,x){return n.push(m,x)},a,r);for(var u=i.state,h=function(m){i.baseTokens=n;var x=e.state.overlays[m],C=1,M=0;i.state=!0,Ta(e,t.text,x.mode,i,function(E,O){for(var P=C;ME&&n.splice(C,1,E,n[C+1],j),C+=2,M=Math.min(E,j)}if(O)if(x.opaque)n.splice(P,C-P,E,"overlay "+O),C=P+2;else for(;Pe.options.maxHighlightLength&&tr(e.doc.mode,r.state),a=ka(e,t,r);n&&(r.state=n),t.stateAfter=r.save(!n),t.styles=a.styles,a.classes?t.styleClasses=a.classes:t.styleClasses&&(t.styleClasses=null),i===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Qr(e,t,i){var r=e.doc,n=e.display;if(!r.mode.startState)return new At(r,!0,t);var a=Yu(e,t,i),u=a>r.first&&re(r,a-1).stateAfter,h=u?At.fromSaved(r,u,a):new At(r,Da(r.mode),a);return r.iter(a,t,function(v){Vn(e,v.text,h);var m=h.line;v.stateAfter=m==t-1||m%5==0||m>=n.viewFrom&&mt.start)return a}throw new Error("Mode "+e.name+" failed to advance stream.")}var Ea=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function Aa(e,t,i,r){var n=e.doc,a=n.mode,u;t=ce(n,t);var h=re(n,t.line),v=Qr(e,t.line,i),m=new ze(h.text,e.options.tabSize,v),x;for(r&&(x=[]);(r||m.pose.options.maxHighlightLength?(h=!1,u&&Vn(e,t,r,x.pos),x.pos=t.length,C=null):C=La(eo(i,x,r.state,M),a),M){var E=M[0].name;E&&(C="m-"+(C?E+" "+C:E))}if(!h||m!=C){for(;vu;--h){if(h<=a.first)return a.first;var v=re(a,h-1),m=v.stateAfter;if(m&&(!i||h+(m instanceof Mi?m.lookAhead:0)<=a.modeFrontier))return h;var x=Re(v.text,null,e.options.tabSize);(n==null||r>x)&&(n=h-1,r=x)}return n}function Zu(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontieri;r--){var n=re(e,r).stateAfter;if(n&&(!(n instanceof Mi)||r+n.lookAhead=t:a.to>t);(r||(r=[])).push(new Bi(u,a.from,v?null:a.to))}}return r}function tf(e,t,i){var r;if(e)for(var n=0;n=t:a.to>t);if(h||a.from==t&&u.type=="bookmark"&&(!i||a.marker.insertLeft)){var v=a.from==null||(u.inclusiveLeft?a.from<=t:a.from0&&h)for(var $=0;$0)){var x=[v,1],C=fe(m.from,h.from),M=fe(m.to,h.to);(C<0||!u.inclusiveLeft&&!C)&&x.push({from:m.from,to:h.from}),(M>0||!u.inclusiveRight&&!M)&&x.push({from:h.to,to:m.to}),n.splice.apply(n,x),v+=x.length-3}}return n}function Na(e){var t=e.markedSpans;if(t){for(var i=0;it)&&(!r||ro(r,a.marker)<0)&&(r=a.marker)}return r}function Ha(e,t,i,r,n){var a=re(e,t),u=Nt&&a.markedSpans;if(u)for(var h=0;h=0&&C<=0||x<=0&&C>=0)&&(x<=0&&(v.marker.inclusiveRight&&n.inclusiveLeft?fe(m.to,i)>=0:fe(m.to,i)>0)||x>=0&&(v.marker.inclusiveRight&&n.inclusiveLeft?fe(m.from,r)<=0:fe(m.from,r)<0)))return!0}}}function Dt(e){for(var t;t=Oa(e);)e=t.find(-1,!0).line;return e}function of(e){for(var t;t=zi(e);)e=t.find(1,!0).line;return e}function af(e){for(var t,i;t=zi(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function io(e,t){var i=re(e,t),r=Dt(i);return i==r?t:xe(r)}function Ra(e,t){if(t>e.lastLine())return t;var i=re(e,t),r;if(!jt(e,i))return t;for(;r=zi(i);)i=r.find(1,!0).line;return xe(i)+1}function jt(e,t){var i=Nt&&t.markedSpans;if(i){for(var r=void 0,n=0;nt.maxLineLength&&(t.maxLineLength=n,t.maxLine=r)})}var Dr=function(e,t,i){this.text=e,Ia(this,t),this.height=i?i(this):1};Dr.prototype.lineNo=function(){return xe(this)},yr(Dr);function lf(e,t,i,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Na(e),Ia(e,i);var n=r?r(e):1;n!=e.height&&Et(e,n)}function sf(e){e.parent=null,Na(e)}var uf={},ff={};function Pa(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?ff:uf;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function _a(e,t){var i=U("span",null,null,y?"padding-right: .1px":null),r={pre:U("pre",[i],"CodeMirror-line"),content:i,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var n=0;n<=(t.rest?t.rest.length:0);n++){var a=n?t.rest[n-1]:t.line,u=void 0;r.pos=0,r.addToken=df,_u(e.display.measure)&&(u=Bt(a,e.doc.direction))&&(r.addToken=pf(r.addToken,u)),r.map=[];var h=t!=e.display.externalMeasured&&xe(a);gf(a,r,Sa(e,a,h)),a.styleClasses&&(a.styleClasses.bgClass&&(r.bgClass=mt(a.styleClasses.bgClass,r.bgClass||"")),a.styleClasses.textClass&&(r.textClass=mt(a.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(Pu(e.display.measure))),n==0?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(y){var v=r.content.lastChild;(/\bcm-tab\b/.test(v.className)||v.querySelector&&v.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return Ie(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=mt(r.pre.className,r.textClass||"")),r}function cf(e){var t=L("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function df(e,t,i,r,n,a,u){if(t){var h=e.splitSpaces?hf(t,e.trailingSpace):t,v=e.cm.state.specialChars,m=!1,x;if(!v.test(t))e.col+=t.length,x=document.createTextNode(h),e.map.push(e.pos,e.pos+t.length,x),d&&p<9&&(m=!0),e.pos+=t.length;else{x=document.createDocumentFragment();for(var C=0;;){v.lastIndex=C;var M=v.exec(t),E=M?M.index-C:t.length-C;if(E){var O=document.createTextNode(h.slice(C,C+E));d&&p<9?x.appendChild(L("span",[O])):x.appendChild(O),e.map.push(e.pos,e.pos+E,O),e.col+=E,e.pos+=E}if(!M)break;C+=E+1;var P=void 0;if(M[0]==" "){var j=e.cm.options.tabSize,Y=j-e.col%j;P=x.appendChild(L("span",qt(Y),"cm-tab")),P.setAttribute("role","presentation"),P.setAttribute("cm-text"," "),e.col+=Y}else M[0]=="\r"||M[0]==` -`?(P=x.appendChild(L("span",M[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),P.setAttribute("cm-text",M[0]),e.col+=1):(P=e.cm.options.specialCharPlaceholder(M[0]),P.setAttribute("cm-text",M[0]),d&&p<9?x.appendChild(L("span",[P])):x.appendChild(P),e.col+=1);e.map.push(e.pos,e.pos+1,P),e.pos++}}if(e.trailingSpace=h.charCodeAt(t.length-1)==32,i||r||n||m||a||u){var Q=i||"";r&&(Q+=r),n&&(Q+=n);var Z=L("span",[x],Q,a);if(u)for(var $ in u)u.hasOwnProperty($)&&$!="style"&&$!="class"&&Z.setAttribute($,u[$]);return e.content.appendChild(Z)}e.content.appendChild(x)}}function hf(e,t){if(e.length>1&&!/ /.test(e))return e;for(var i=t,r="",n=0;nm&&C.from<=m));M++);if(C.to>=x)return e(i,r,n,a,u,h,v);e(i,r.slice(0,C.to-m),n,a,null,h,v),a=null,r=r.slice(C.to-m),m=C.to}}}function Wa(e,t,i,r){var n=!r&&i.widgetNode;n&&e.map.push(e.pos,e.pos+t,n),!r&&e.cm.display.input.needsContentAttribute&&(n||(n=e.content.appendChild(document.createElement("span"))),n.setAttribute("cm-marker",i.id)),n&&(e.cm.display.input.setUneditable(n),e.content.appendChild(n)),e.pos+=t,e.trailingSpace=!1}function gf(e,t,i){var r=e.markedSpans,n=e.text,a=0;if(!r){for(var u=1;uv||pe.collapsed&&ie.to==v&&ie.from==v)){if(ie.to!=null&&ie.to!=v&&E>ie.to&&(E=ie.to,P=""),pe.className&&(O+=" "+pe.className),pe.css&&(M=(M?M+";":"")+pe.css),pe.startStyle&&ie.from==v&&(j+=" "+pe.startStyle),pe.endStyle&&ie.to==E&&($||($=[])).push(pe.endStyle,ie.to),pe.title&&((Q||(Q={})).title=pe.title),pe.attributes)for(var we in pe.attributes)(Q||(Q={}))[we]=pe.attributes[we];pe.collapsed&&(!Y||ro(Y.marker,pe)<0)&&(Y=ie)}else ie.from>v&&E>ie.from&&(E=ie.from)}if($)for(var Ge=0;Ge<$.length;Ge+=2)$[Ge+1]==E&&(P+=" "+$[Ge]);if(!Y||Y.from==v)for(var Le=0;Le=h)break;for(var ft=Math.min(h,E);;){if(x){var at=v+x.length;if(!Y){var Oe=at>ft?x.slice(0,ft-v):x;t.addToken(t,Oe,C?C+O:O,j,v+Oe.length==E?P:"",M,Q)}if(at>=ft){x=x.slice(ft-v),v=ft;break}v=at,j=""}x=n.slice(a,a=i[m++]),C=Pa(i[m++],t.cm.options)}}}function qa(e,t,i){this.line=t,this.rest=af(t),this.size=this.rest?xe(me(this.rest))-i+1:1,this.node=this.text=null,this.hidden=jt(e,t)}function Hi(e,t,i){for(var r=[],n,a=t;a2&&a.push((v.bottom+m.top)/2-i.top)}}a.push(i.bottom-i.top)}}function Za(e,t,i){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var r=0;ri)return{map:e.measure.maps[n],cache:e.measure.caches[n],before:!0}}}function Ff(e,t){t=Dt(t);var i=xe(t),r=e.display.externalMeasured=new qa(e.doc,t,i);r.lineN=i;var n=r.built=_a(e,r);return r.text=n.pre,de(e.display.lineMeasure,n.pre),r}function Qa(e,t,i,r){return Tt(e,Cr(e,t),i,r)}function uo(e,t){if(t>=e.display.viewFrom&&t=i.lineN&&tt)&&(a=v-h,n=a-1,t>=v&&(u="right")),n!=null){if(r=e[m+2],h==v&&i==(r.insertLeft?"left":"right")&&(u=i),i=="left"&&n==0)for(;m&&e[m-2]==e[m-3]&&e[m-1].insertLeft;)r=e[(m-=3)+2],u="left";if(i=="right"&&n==v-h)for(;m=0&&(i=e[n]).left==i.right;n--);return i}function Af(e,t,i,r){var n=$a(t.map,i,r),a=n.node,u=n.start,h=n.end,v=n.collapse,m;if(a.nodeType==3){for(var x=0;x<4;x++){for(;u&&Rn(t.line.text.charAt(n.coverStart+u));)--u;for(;n.coverStart+h0&&(v=r="right");var C;e.options.lineWrapping&&(C=a.getClientRects()).length>1?m=C[r=="right"?C.length-1:0]:m=a.getBoundingClientRect()}if(d&&p<9&&!u&&(!m||!m.left&&!m.right)){var M=a.parentNode.getClientRects()[0];M?m={left:M.left,right:M.left+Sr(e.display),top:M.top,bottom:M.bottom}:m=Ja}for(var E=m.top-t.rect.top,O=m.bottom-t.rect.top,P=(E+O)/2,j=t.view.measure.heights,Y=0;Y=r.text.length?(v=r.text.length,m="before"):v<=0&&(v=0,m="after"),!h)return u(m=="before"?v-1:v,m=="before");function x(O,P,j){var Y=h[P],Q=Y.level==1;return u(j?O-1:O,Q!=j)}var C=Xr(h,v,m),M=Kr,E=x(v,C,m=="before");return M!=null&&(E.other=x(v,M,m!="before")),E}function nl(e,t){var i=0;t=ce(e.doc,t),e.options.lineWrapping||(i=Sr(e.display)*t.ch);var r=re(e.doc,t.line),n=It(r)+Ri(e.display);return{left:i,right:i,top:n,bottom:n+r.height}}function co(e,t,i,r,n){var a=q(e,t,i);return a.xRel=n,r&&(a.outside=r),a}function ho(e,t,i){var r=e.doc;if(i+=e.display.viewOffset,i<0)return co(r.first,0,null,-1,-1);var n=ir(r,i),a=r.first+r.size-1;if(n>a)return co(r.first+r.size-1,re(r,a).text.length,null,1,1);t<0&&(t=0);for(var u=re(r,n);;){var h=Tf(e,u,n,t,i),v=nf(u,h.ch+(h.xRel>0||h.outside>0?1:0));if(!v)return h;var m=v.find(1);if(m.line==n)return m;u=re(r,n=m.line)}}function ol(e,t,i,r){r-=fo(t);var n=t.text.length,a=Gr(function(u){return Tt(e,i,u-1).bottom<=r},n,0);return n=Gr(function(u){return Tt(e,i,u).top>r},a,n),{begin:a,end:n}}function al(e,t,i,r){i||(i=Cr(e,t));var n=Pi(e,t,Tt(e,i,r),"line").top;return ol(e,t,i,n)}function po(e,t,i,r){return e.bottom<=i?!1:e.top>i?!0:(r?e.left:e.right)>t}function Tf(e,t,i,r,n){n-=It(t);var a=Cr(e,t),u=fo(t),h=0,v=t.text.length,m=!0,x=Bt(t,e.doc.direction);if(x){var C=(e.options.lineWrapping?Bf:Mf)(e,t,i,a,x,r,n);m=C.level!=1,h=m?C.from:C.to-1,v=m?C.to:C.from-1}var M=null,E=null,O=Gr(function(ne){var ie=Tt(e,a,ne);return ie.top+=u,ie.bottom+=u,po(ie,r,n,!1)?(ie.top<=n&&ie.left<=r&&(M=ne,E=ie),!0):!1},h,v),P,j,Y=!1;if(E){var Q=r-E.left=$.bottom?1:0}return O=va(t.text,O,1),co(i,O,j,Y,r-P)}function Mf(e,t,i,r,n,a,u){var h=Gr(function(C){var M=n[C],E=M.level!=1;return po(wt(e,q(i,E?M.to:M.from,E?"before":"after"),"line",t,r),a,u,!0)},0,n.length-1),v=n[h];if(h>0){var m=v.level!=1,x=wt(e,q(i,m?v.from:v.to,m?"after":"before"),"line",t,r);po(x,a,u,!0)&&x.top>u&&(v=n[h-1])}return v}function Bf(e,t,i,r,n,a,u){var h=ol(e,t,r,u),v=h.begin,m=h.end;/\s/.test(t.text.charAt(m-1))&&m--;for(var x=null,C=null,M=0;M=m||E.to<=v)){var O=E.level!=1,P=Tt(e,r,O?Math.min(m,E.to)-1:Math.max(v,E.from)).right,j=Pj)&&(x=E,C=j)}}return x||(x=n[n.length-1]),x.fromm&&(x={from:x.from,to:m,level:x.level}),x}var or;function kr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(or==null){or=L("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)or.appendChild(document.createTextNode("x")),or.appendChild(L("br"));or.appendChild(document.createTextNode("x"))}de(e.measure,or);var i=or.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),ae(e.measure),i||1}function Sr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=L("span","xxxxxxxxxx"),i=L("pre",[t],"CodeMirror-line-like");de(e.measure,i);var r=t.getBoundingClientRect(),n=(r.right-r.left)/10;return n>2&&(e.cachedCharWidth=n),n||10}function go(e){for(var t=e.display,i={},r={},n=t.gutters.clientLeft,a=t.gutters.firstChild,u=0;a;a=a.nextSibling,++u){var h=e.display.gutterSpecs[u].className;i[h]=a.offsetLeft+a.clientLeft+n,r[h]=a.clientWidth}return{fixedPos:vo(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function vo(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function ll(e){var t=kr(e.display),i=e.options.lineWrapping,r=i&&Math.max(5,e.display.scroller.clientWidth/Sr(e.display)-3);return function(n){if(jt(e.doc,n))return 0;var a=0;if(n.widgets)for(var u=0;u0&&(m=re(e.doc,v.line).text).length==v.ch){var x=Re(m,m.length,e.options.tabSize)-m.length;v=q(v.line,Math.max(0,Math.round((a-Ya(e.display).left)/Sr(e.display))-x))}return v}function lr(e,t){if(t>=e.display.viewTo||(t-=e.display.viewFrom,t<0))return null;for(var i=e.display.view,r=0;rt)&&(n.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=n.viewTo)Nt&&io(e.doc,t)n.viewFrom?Kt(e):(n.viewFrom+=r,n.viewTo+=r);else if(t<=n.viewFrom&&i>=n.viewTo)Kt(e);else if(t<=n.viewFrom){var a=Wi(e,i,i+r,1);a?(n.view=n.view.slice(a.index),n.viewFrom=a.lineN,n.viewTo+=r):Kt(e)}else if(i>=n.viewTo){var u=Wi(e,t,t,-1);u?(n.view=n.view.slice(0,u.index),n.viewTo=u.lineN):Kt(e)}else{var h=Wi(e,t,t,-1),v=Wi(e,i,i+r,1);h&&v?(n.view=n.view.slice(0,h.index).concat(Hi(e,h.lineN,v.lineN)).concat(n.view.slice(v.index)),n.viewTo+=r):Kt(e)}var m=n.externalMeasured;m&&(i=n.lineN&&t=r.viewTo)){var a=r.view[lr(e,t)];if(a.node!=null){var u=a.changes||(a.changes=[]);Fe(u,i)==-1&&u.push(i)}}}function Kt(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Wi(e,t,i,r){var n=lr(e,t),a,u=e.display.view;if(!Nt||i==e.doc.first+e.doc.size)return{index:n,lineN:i};for(var h=e.display.viewFrom,v=0;v0){if(n==u.length-1)return null;a=h+u[n].size-t,n++}else a=h-t;t+=a,i+=a}for(;io(e.doc,i)!=i;){if(n==(r<0?0:u.length-1))return null;i+=r*u[n-(r<0?1:0)].size,n+=r}return{index:n,lineN:i}}function Nf(e,t,i){var r=e.display,n=r.view;n.length==0||t>=r.viewTo||i<=r.viewFrom?(r.view=Hi(e,t,i),r.viewFrom=t):(r.viewFrom>t?r.view=Hi(e,t,r.viewFrom).concat(r.view):r.viewFromi&&(r.view=r.view.slice(0,lr(e,i)))),r.viewTo=i}function sl(e){for(var t=e.display.view,i=0,r=0;r=e.display.viewTo||v.to().line0?u:e.defaultCharWidth())+"px"}if(r.other){var h=i.appendChild(L("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));h.style.display="",h.style.left=r.other.left+"px",h.style.top=r.other.top+"px",h.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function qi(e,t){return e.top-t.top||e.left-t.left}function If(e,t,i){var r=e.display,n=e.doc,a=document.createDocumentFragment(),u=Ya(e.display),h=u.left,v=Math.max(r.sizerWidth,nr(e)-r.sizer.offsetLeft)-u.right,m=n.direction=="ltr";function x(Z,$,ne,ie){$<0&&($=0),$=Math.round($),ie=Math.round(ie),a.appendChild(L("div",null,"CodeMirror-selected","position: absolute; left: "+Z+`px; - top: `+$+"px; width: "+(ne??v-Z)+`px; - height: `+(ie-$)+"px"))}function C(Z,$,ne){var ie=re(n,Z),pe=ie.text.length,we,Ge;function Le(Oe,lt){return _i(e,q(Z,Oe),"div",ie,lt)}function ft(Oe,lt,Xe){var _e=al(e,ie,null,Oe),He=lt=="ltr"==(Xe=="after")?"left":"right",Be=Xe=="after"?_e.begin:_e.end-(/\s/.test(ie.text.charAt(_e.end-1))?2:1);return Le(Be,He)[He]}var at=Bt(ie,n.direction);return Ou(at,$||0,ne??pe,function(Oe,lt,Xe,_e){var He=Xe=="ltr",Be=Le(Oe,He?"left":"right"),st=Le(lt-1,He?"right":"left"),Rr=$==null&&Oe==0,$t=ne==null&<==pe,Qe=_e==0,Mt=!at||_e==at.length-1;if(st.top-Be.top<=3){var Ke=(m?Rr:$t)&&Qe,Go=(m?$t:Rr)&&Mt,Rt=Ke?h:(He?Be:st).left,dr=Go?v:(He?st:Be).right;x(Rt,Be.top,dr-Rt,Be.bottom)}else{var hr,Ve,Pr,Ko;He?(hr=m&&Rr&&Qe?h:Be.left,Ve=m?v:ft(Oe,Xe,"before"),Pr=m?h:ft(lt,Xe,"after"),Ko=m&&$t&&Mt?v:st.right):(hr=m?ft(Oe,Xe,"before"):h,Ve=!m&&Rr&&Qe?v:Be.right,Pr=!m&&$t&&Mt?h:st.left,Ko=m?ft(lt,Xe,"after"):v),x(hr,Be.top,Ve-hr,Be.bottom),Be.bottom0?t.blinker=setInterval(function(){e.hasFocus()||Fr(e),t.cursorDiv.style.visibility=(i=!i)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function fl(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||Do(e))}function xo(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&Fr(e))},100)}function Do(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!="nocursor"&&(e.state.focused||(Ie(e,"focus",e,t),e.state.focused=!0,Te(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),y&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),bo(e))}function Fr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(Ie(e,"blur",e,t),e.state.focused=!1,ue(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function Ui(e){for(var t=e.display,i=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),n=t.lineDiv.getBoundingClientRect().top,a=0,u=0;u.005||E<-.005)&&(ne.display.sizerWidth){var P=Math.ceil(x/Sr(e.display));P>e.display.maxLineLength&&(e.display.maxLineLength=P,e.display.maxLine=h.line,e.display.maxLineChanged=!0)}}}Math.abs(a)>2&&(t.scroller.scrollTop+=a)}function cl(e){if(e.widgets)for(var t=0;t=u&&(a=ir(t,It(re(t,v))-e.wrapper.clientHeight),u=v)}return{from:a,to:Math.max(u,a+1)}}function zf(e,t){if(!We(e,"scrollCursorIntoView")){var i=e.display,r=i.sizer.getBoundingClientRect(),n=null,a=i.wrapper.ownerDocument;if(t.top+r.top<0?n=!0:t.bottom+r.top>(a.defaultView.innerHeight||a.documentElement.clientHeight)&&(n=!1),n!=null&&!N){var u=L("div","\u200B",null,`position: absolute; - top: `+(t.top-i.viewOffset-Ri(e.display))+`px; - height: `+(t.bottom-t.top+Lt(e)+i.barHeight)+`px; - left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(u),u.scrollIntoView(n),e.display.lineSpace.removeChild(u)}}}function Of(e,t,i,r){r==null&&(r=0);var n;!e.options.lineWrapping&&t==i&&(i=t.sticky=="before"?q(t.line,t.ch+1,"before"):t,t=t.ch?q(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t);for(var a=0;a<5;a++){var u=!1,h=wt(e,t),v=!i||i==t?h:wt(e,i);n={left:Math.min(h.left,v.left),top:Math.min(h.top,v.top)-r,right:Math.max(h.left,v.left),bottom:Math.max(h.bottom,v.bottom)+r};var m=wo(e,n),x=e.doc.scrollTop,C=e.doc.scrollLeft;if(m.scrollTop!=null&&(ni(e,m.scrollTop),Math.abs(e.doc.scrollTop-x)>1&&(u=!0)),m.scrollLeft!=null&&(sr(e,m.scrollLeft),Math.abs(e.doc.scrollLeft-C)>1&&(u=!0)),!u)break}return n}function Hf(e,t){var i=wo(e,t);i.scrollTop!=null&&ni(e,i.scrollTop),i.scrollLeft!=null&&sr(e,i.scrollLeft)}function wo(e,t){var i=e.display,r=kr(e.display);t.top<0&&(t.top=0);var n=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:i.scroller.scrollTop,a=so(e),u={};t.bottom-t.top>a&&(t.bottom=t.top+a);var h=e.doc.height+lo(i),v=t.toph-r;if(t.topn+a){var x=Math.min(t.top,(m?h:t.bottom)-a);x!=n&&(u.scrollTop=x)}var C=e.options.fixedGutter?0:i.gutters.offsetWidth,M=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-C,E=nr(e)-i.gutters.offsetWidth,O=t.right-t.left>E;return O&&(t.right=t.left+E),t.left<10?u.scrollLeft=0:t.leftE+M-3&&(u.scrollLeft=t.right+(O?0:10)-E),u}function Co(e,t){t!=null&&(Gi(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Er(e){Gi(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function ii(e,t,i){(t!=null||i!=null)&&Gi(e),t!=null&&(e.curOp.scrollLeft=t),i!=null&&(e.curOp.scrollTop=i)}function Rf(e,t){Gi(e),e.curOp.scrollToPos=t}function Gi(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var i=nl(e,t.from),r=nl(e,t.to);dl(e,i,r,t.margin)}}function dl(e,t,i,r){var n=wo(e,{left:Math.min(t.left,i.left),top:Math.min(t.top,i.top)-r,right:Math.max(t.right,i.right),bottom:Math.max(t.bottom,i.bottom)+r});ii(e,n.scrollLeft,n.scrollTop)}function ni(e,t){Math.abs(e.doc.scrollTop-t)<2||(c||So(e,{top:t}),hl(e,t,!0),c&&So(e),li(e,100))}function hl(e,t,i){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),!(e.display.scroller.scrollTop==t&&!i)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function sr(e,t,i,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),!((i?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)&&(e.doc.scrollLeft=t,yl(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function oi(e){var t=e.display,i=t.gutters.offsetWidth,r=Math.round(e.doc.height+lo(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?i:0,docHeight:r,scrollHeight:r+Lt(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var ur=function(e,t,i){this.cm=i;var r=this.vert=L("div",[L("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),n=this.horiz=L("div",[L("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=n.tabIndex=-1,e(r),e(n),oe(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),oe(n,"scroll",function(){n.clientWidth&&t(n.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,d&&p<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};ur.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,i=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(i){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var n=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+n)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=i?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var a=e.viewWidth-e.barLeft-(i?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+a)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:i?r:0,bottom:t?r:0}},ur.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},ur.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},ur.prototype.zeroWidthHack=function(){var e=R&&!z?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new Je,this.disableVert=new Je},ur.prototype.enableZeroWidthBar=function(e,t,i){e.style.visibility="";function r(){var n=e.getBoundingClientRect(),a=i=="vert"?document.elementFromPoint(n.right-1,(n.top+n.bottom)/2):document.elementFromPoint((n.right+n.left)/2,n.bottom-1);a!=e?e.style.visibility="hidden":t.set(1e3,r)}t.set(1e3,r)},ur.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var ai=function(){};ai.prototype.update=function(){return{bottom:0,right:0}},ai.prototype.setScrollLeft=function(){},ai.prototype.setScrollTop=function(){},ai.prototype.clear=function(){};function Ar(e,t){t||(t=oi(e));var i=e.display.barWidth,r=e.display.barHeight;pl(e,t);for(var n=0;n<4&&i!=e.display.barWidth||r!=e.display.barHeight;n++)i!=e.display.barWidth&&e.options.lineWrapping&&Ui(e),pl(e,oi(e)),i=e.display.barWidth,r=e.display.barHeight}function pl(e,t){var i=e.display,r=i.scrollbars.update(t);i.sizer.style.paddingRight=(i.barWidth=r.right)+"px",i.sizer.style.paddingBottom=(i.barHeight=r.bottom)+"px",i.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(i.scrollbarFiller.style.display="block",i.scrollbarFiller.style.height=r.bottom+"px",i.scrollbarFiller.style.width=r.right+"px"):i.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(i.gutterFiller.style.display="block",i.gutterFiller.style.height=r.bottom+"px",i.gutterFiller.style.width=t.gutterWidth+"px"):i.gutterFiller.style.display=""}var gl={native:ur,null:ai};function vl(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&ue(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new gl[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),oe(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,i){i=="horizontal"?sr(e,t):ni(e,t)},e),e.display.scrollbars.addClass&&Te(e.display.wrapper,e.display.scrollbars.addClass)}var Pf=0;function fr(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Pf,markArrays:null},vf(e.curOp)}function cr(e){var t=e.curOp;t&&yf(t,function(i){for(var r=0;r=i.viewTo)||i.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Ki(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function qf(e){e.updatedDisplay=e.mustUpdate&&ko(e.cm,e.update)}function Uf(e){var t=e.cm,i=t.display;e.updatedDisplay&&Ui(t),e.barMeasure=oi(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Qa(t,i.maxLine,i.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(i.scroller.clientWidth,i.sizer.offsetLeft+e.adjustWidthTo+Lt(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-nr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}function jf(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)){var i=+new Date+e.options.workTime,r=Qr(e,t.highlightFrontier),n=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(a){if(r.line>=e.display.viewFrom){var u=a.styles,h=a.text.length>e.options.maxHighlightLength?tr(t.mode,r.state):null,v=ka(e,a,r,!0);h&&(r.state=h),a.styles=v.styles;var m=a.styleClasses,x=v.classes;x?a.styleClasses=x:m&&(a.styleClasses=null);for(var C=!u||u.length!=a.styles.length||m!=x&&(!m||!x||m.bgClass!=x.bgClass||m.textClass!=x.textClass),M=0;!C&&Mi)return li(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),n.length&&ut(e,function(){for(var a=0;a=i.viewFrom&&t.visible.to<=i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&sl(e)==0)return!1;bl(e)&&(Kt(e),t.dims=go(e));var n=r.first+r.size,a=Math.max(t.visible.from-e.options.viewportMargin,r.first),u=Math.min(n,t.visible.to+e.options.viewportMargin);i.viewFromu&&i.viewTo-u<20&&(u=Math.min(n,i.viewTo)),Nt&&(a=io(e.doc,a),u=Ra(e.doc,u));var h=a!=i.viewFrom||u!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;Nf(e,a,u),i.viewOffset=It(re(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var v=sl(e);if(!h&&v==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var m=Yf(e);return v>4&&(i.lineDiv.style.display="none"),Qf(e,i.updateLineNumbers,t.dims),v>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,Zf(m),ae(i.cursorDiv),ae(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,h&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,li(e,400)),i.updateLineNumbers=null,!0}function ml(e,t){for(var i=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==nr(e)){if(i&&i.top!=null&&(i={top:Math.min(e.doc.height+lo(e.display)-so(e),i.top)}),t.visible=ji(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=ji(e.display,e.doc,i));if(!ko(e,t))break;Ui(e);var n=oi(e);ri(e),Ar(e,n),Eo(e,n),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function So(e,t){var i=new Ki(e,t);if(ko(e,i)){Ui(e),ml(e,i);var r=oi(e);ri(e),Ar(e,r),Eo(e,r),i.finish()}}function Qf(e,t,i){var r=e.display,n=e.options.lineNumbers,a=r.lineDiv,u=a.firstChild;function h(O){var P=O.nextSibling;return y&&R&&e.display.currentWheelTarget==O?O.style.display="none":O.parentNode.removeChild(O),P}for(var v=r.view,m=r.viewFrom,x=0;x-1&&(E=!1),Ua(e,C,m,i)),E&&(ae(C.lineNumber),C.lineNumber.appendChild(document.createTextNode(Qn(e.options,m)))),u=C.node.nextSibling}m+=C.size}for(;u;)u=h(u)}function Fo(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",qe(e,"gutterChanged",e)}function Eo(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Lt(e)+"px"}function yl(e){var t=e.display,i=t.view;if(!(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))){for(var r=vo(t)-t.scroller.scrollLeft+e.doc.scrollLeft,n=t.gutters.offsetWidth,a=r+"px",u=0;uh.clientWidth,m=h.scrollHeight>h.clientHeight;if(r&&v||n&&m){if(n&&R&&y){e:for(var x=t.target,C=u.view;x!=h;x=x.parentNode)for(var M=0;M=0&&fe(e,r.to())<=0)return i}return-1};var be=function(e,t){this.anchor=e,this.head=t};be.prototype.from=function(){return Ti(this.anchor,this.head)},be.prototype.to=function(){return Li(this.anchor,this.head)},be.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Ct(e,t,i){var r=e&&e.options.selectionsMayTouch,n=t[i];t.sort(function(M,E){return fe(M.from(),E.from())}),i=Fe(t,n);for(var a=1;a0:v>=0){var m=Ti(h.from(),u.from()),x=Li(h.to(),u.to()),C=h.empty()?u.from()==u.head:h.from()==h.head;a<=i&&--i,t.splice(--a,2,new be(C?x:m,C?m:x))}}return new pt(t,i)}function Xt(e,t){return new pt([new be(e,t||e)],0)}function Yt(e){return e.text?q(e.from.line+e.text.length-1,me(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Cl(e,t){if(fe(e,t.from)<0)return e;if(fe(e,t.to)<=0)return Yt(t);var i=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=Yt(t).ch-t.to.ch),q(i,r)}function Lo(e,t){for(var i=[],r=0;r1&&e.remove(h.line+1,O-1),e.insert(h.line+1,Y)}qe(e,"change",e,t)}function Zt(e,t,i){function r(n,a,u){if(n.linked)for(var h=0;h1&&!e.done[e.done.length-2].ranges)return e.done.pop(),me(e.done)}function Ll(e,t,i,r){var n=e.history;n.undone.length=0;var a=+new Date,u,h;if((n.lastOp==r||n.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&n.lastModTime>a-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(u=tc(n,n.lastOp==r)))h=me(u.changes),fe(t.from,t.to)==0&&fe(t.from,h.to)==0?h.to=Yt(t):u.changes.push(Bo(e,t));else{var v=me(n.done);for((!v||!v.ranges)&&Zi(e.sel,n.done),u={changes:[Bo(e,t)],generation:n.generation},n.done.push(u);n.done.length>n.undoDepth;)n.done.shift(),n.done[0].ranges||n.done.shift()}n.done.push(i),n.generation=++n.maxGeneration,n.lastModTime=n.lastSelTime=a,n.lastOp=n.lastSelOp=r,n.lastOrigin=n.lastSelOrigin=t.origin,h||Ie(e,"historyAdded")}function rc(e,t,i,r){var n=t.charAt(0);return n=="*"||n=="+"&&i.ranges.length==r.ranges.length&&i.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function ic(e,t,i,r){var n=e.history,a=r&&r.origin;i==n.lastSelOp||a&&n.lastSelOrigin==a&&(n.lastModTime==n.lastSelTime&&n.lastOrigin==a||rc(e,a,me(n.done),t))?n.done[n.done.length-1]=t:Zi(t,n.done),n.lastSelTime=+new Date,n.lastSelOrigin=a,n.lastSelOp=i,r&&r.clearRedo!==!1&&Al(n.undone)}function Zi(e,t){var i=me(t);i&&i.ranges&&i.equals(e)||t.push(e)}function Tl(e,t,i,r){var n=t["spans_"+e.id],a=0;e.iter(Math.max(e.first,i),Math.min(e.first+e.size,r),function(u){u.markedSpans&&((n||(n=t["spans_"+e.id]={}))[a]=u.markedSpans),++a})}function nc(e){if(!e)return null;for(var t,i=0;i-1&&(me(h)[C]=m[C],delete m[C])}}return r}function No(e,t,i,r){if(r){var n=e.anchor;if(i){var a=fe(t,n)<0;a!=fe(i,n)<0?(n=t,t=i):a!=fe(t,i)<0&&(t=i)}return new be(n,t)}else return new be(i||t,t)}function Qi(e,t,i,r,n){n==null&&(n=e.cm&&(e.cm.display.shift||e.extend)),Ze(e,new pt([No(e.sel.primary(),t,i,n)],0),r)}function Bl(e,t,i){for(var r=[],n=e.cm&&(e.cm.display.shift||e.extend),a=0;a=t.ch:h.to>t.ch))){if(n&&(Ie(v,"beforeCursorEnter"),v.explicitlyCleared))if(a.markedSpans){--u;continue}else break;if(!v.atomic)continue;if(i){var C=v.find(r<0?1:-1),M=void 0;if((r<0?x:m)&&(C=Rl(e,C,-r,C&&C.line==t.line?a:null)),C&&C.line==t.line&&(M=fe(C,i))&&(r<0?M<0:M>0))return Tr(e,C,t,r,n)}var E=v.find(r<0?-1:1);return(r<0?m:x)&&(E=Rl(e,E,r,E.line==t.line?a:null)),E?Tr(e,E,t,r,n):null}}return t}function $i(e,t,i,r,n){var a=r||1,u=Tr(e,t,i,a,n)||!n&&Tr(e,t,i,a,!0)||Tr(e,t,i,-a,n)||!n&&Tr(e,t,i,-a,!0);return u||(e.cantEdit=!0,q(e.first,0))}function Rl(e,t,i,r){return i<0&&t.ch==0?t.line>e.first?ce(e,q(t.line-1)):null:i>0&&t.ch==(r||re(e,t.line)).text.length?t.line=0;--n)Wl(e,{from:r[n].from,to:r[n].to,text:n?[""]:t.text,origin:t.origin});else Wl(e,t)}}function Wl(e,t){if(!(t.text.length==1&&t.text[0]==""&&fe(t.from,t.to)==0)){var i=Lo(e,t);Ll(e,t,i,e.cm?e.cm.curOp.id:NaN),fi(e,t,i,to(e,t));var r=[];Zt(e,function(n,a){!a&&Fe(r,n.history)==-1&&(Gl(n.history,t),r.push(n.history)),fi(n,t,null,to(n,t))})}}function Vi(e,t,i){var r=e.cm&&e.cm.state.suppressEdits;if(!(r&&!i)){for(var n=e.history,a,u=e.sel,h=t=="undo"?n.done:n.undone,v=t=="undo"?n.undone:n.done,m=0;m=0;--E){var O=M(E);if(O)return O.v}}}}function ql(e,t){if(t!=0&&(e.first+=t,e.sel=new pt(xt(e.sel.ranges,function(n){return new be(q(n.anchor.line+t,n.anchor.ch),q(n.head.line+t,n.head.ch))}),e.sel.primIndex),e.cm)){nt(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,r=i.viewFrom;re.lastLine())){if(t.from.linea&&(t={from:t.from,to:q(a,re(e,a).text.length),text:[t.text[0]],origin:t.origin}),t.removed=rr(e,t.from,t.to),i||(i=Lo(e,t)),e.cm?lc(e.cm,t,r):Mo(e,t,r),Ji(e,i,rt),e.cantEdit&&$i(e,q(e.firstLine(),0))&&(e.cantEdit=!1)}}function lc(e,t,i){var r=e.doc,n=e.display,a=t.from,u=t.to,h=!1,v=a.line;e.options.lineWrapping||(v=xe(Dt(re(r,a.line))),r.iter(v,u.line+1,function(E){if(E==n.maxLine)return h=!0,!0})),r.sel.contains(t.from,t.to)>-1&&ya(e),Mo(r,t,i,ll(e)),e.options.lineWrapping||(r.iter(v,a.line+t.text.length,function(E){var O=Oi(E);O>n.maxLineLength&&(n.maxLine=E,n.maxLineLength=O,n.maxLineChanged=!0,h=!1)}),h&&(e.curOp.updateMaxLine=!0)),Zu(r,a.line),li(e,400);var m=t.text.length-(u.line-a.line)-1;t.full?nt(e):a.line==u.line&&t.text.length==1&&!Sl(e.doc,t)?Gt(e,a.line,"text"):nt(e,a.line,u.line+1,m);var x=yt(e,"changes"),C=yt(e,"change");if(C||x){var M={from:a,to:u,text:t.text,removed:t.removed,origin:t.origin};C&&qe(e,"change",e,M),x&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(M)}e.display.selForContextMenu=null}function Br(e,t,i,r,n){var a;r||(r=i),fe(r,i)<0&&(a=[r,i],i=a[0],r=a[1]),typeof t=="string"&&(t=e.splitLines(t)),Mr(e,{from:i,to:r,text:t,origin:n})}function Ul(e,t,i,r){i1||!(this.children[0]instanceof di))){var h=[];this.collapse(h),this.children=[new di(h)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var u=n.lines.length%25+25,h=u;h10);e.parent.maybeSpill()}},iterN:function(e,t,i){for(var r=0;re.display.maxLineLength&&(e.display.maxLine=m,e.display.maxLineLength=x,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&nt(e,r,n+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Ol(e.doc)),e&&qe(e,"markerCleared",e,this,r,n),t&&cr(e),this.parent&&this.parent.clear()}},Qt.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var i,r,n=0;n0||u==0&&a.clearWhenEmpty!==!1)return a;if(a.replacedWith&&(a.collapsed=!0,a.widgetNode=U("span",[a.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||a.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(a.widgetNode.insertLeft=!0)),a.collapsed){if(Ha(e,t.line,t,i,a)||t.line!=i.line&&Ha(e,i.line,t,i,a))throw new Error("Inserting collapsed marker partially overlapping an existing one");Ju()}a.addToHistory&&Ll(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var h=t.line,v=e.cm,m;if(e.iter(h,i.line+1,function(C){v&&a.collapsed&&!v.options.lineWrapping&&Dt(C)==v.display.maxLine&&(m=!0),a.collapsed&&h!=t.line&&Et(C,0),Vu(C,new Bi(a,h==t.line?t.ch:null,h==i.line?i.ch:null),e.cm&&e.cm.curOp),++h}),a.collapsed&&e.iter(t.line,i.line+1,function(C){jt(e,C)&&Et(C,0)}),a.clearOnEnter&&oe(a,"beforeCursorEnter",function(){return a.clear()}),a.readOnly&&(Qu(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),a.collapsed&&(a.id=++Xl,a.atomic=!0),v){if(m&&(v.curOp.updateMaxLine=!0),a.collapsed)nt(v,t.line,i.line+1);else if(a.className||a.startStyle||a.endStyle||a.css||a.attributes||a.title)for(var x=t.line;x<=i.line;x++)Gt(v,x,"text");a.atomic&&Ol(v.doc),qe(v,"markerAdded",v,a)}return a}var gi=function(e,t){this.markers=e,this.primary=t;for(var i=0;i=0;v--)Mr(this,r[v]);h?Il(this,h):this.cm&&Er(this.cm)}),undo:je(function(){Vi(this,"undo")}),redo:je(function(){Vi(this,"redo")}),undoSelection:je(function(){Vi(this,"undo",!0)}),redoSelection:je(function(){Vi(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,i=0,r=0;r=e.ch)&&t.push(n.marker.parent||n.marker)}return t},findMarks:function(e,t,i){e=ce(this,e),t=ce(this,t);var r=[],n=e.line;return this.iter(e.line,t.line+1,function(a){var u=a.markedSpans;if(u)for(var h=0;h=v.to||v.from==null&&n!=e.line||v.from!=null&&n==t.line&&v.from>=t.ch)&&(!i||i(v.marker))&&r.push(v.marker.parent||v.marker)}++n}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var i=t.markedSpans;if(i)for(var r=0;re)return t=e,!0;e-=a,++i}),ce(this,q(i,t))},indexFromPos:function(e){e=ce(this,e);var t=e.ch;if(e.linet&&(t=e.from),e.to!=null&&e.to-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var x=e.dataTransfer.getData("Text");if(x){var C;if(t.state.draggingText&&!t.state.draggingText.copy&&(C=t.listSelections()),Ji(t.doc,Xt(i,i)),C)for(var M=0;M=0;h--)Br(e.doc,"",r[h].from,r[h].to,"+delete");Er(e)})}function zo(e,t,i){var r=va(e.text,t+i,i);return r<0||r>e.text.length?null:r}function Oo(e,t,i){var r=zo(e,t.ch,i);return r==null?null:new q(t.line,r,i<0?"after":"before")}function Ho(e,t,i,r,n){if(e){t.doc.direction=="rtl"&&(n=-n);var a=Bt(i,t.doc.direction);if(a){var u=n<0?me(a):a[0],h=n<0==(u.level==1),v=h?"after":"before",m;if(u.level>0||t.doc.direction=="rtl"){var x=Cr(t,i);m=n<0?i.text.length-1:0;var C=Tt(t,x,m).top;m=Gr(function(M){return Tt(t,x,M).top==C},n<0==(u.level==1)?u.from:u.to-1,m),v=="before"&&(m=zo(i,m,1))}else m=n<0?u.to:u.from;return new q(r,m,v)}}return new q(r,n<0?i.text.length:0,n<0?"before":"after")}function Dc(e,t,i,r){var n=Bt(t,e.doc.direction);if(!n)return Oo(t,i,r);i.ch>=t.text.length?(i.ch=t.text.length,i.sticky="before"):i.ch<=0&&(i.ch=0,i.sticky="after");var a=Xr(n,i.ch,i.sticky),u=n[a];if(e.doc.direction=="ltr"&&u.level%2==0&&(r>0?u.to>i.ch:u.from=u.from&&M>=x.begin)){var E=C?"before":"after";return new q(i.line,M,E)}}var O=function(Y,Q,Z){for(var $=function(we,Ge){return Ge?new q(i.line,h(we,1),"before"):new q(i.line,we,"after")};Y>=0&&Y0==(ne.level!=1),pe=ie?Z.begin:h(Z.end,-1);if(ne.from<=pe&&pe0?x.end:h(x.begin,-1);return j!=null&&!(r>0&&j==t.text.length)&&(P=O(r>0?0:n.length-1,r,m(j)),P)?P:null}var yi={selectAll:Pl,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),rt)},killLine:function(e){return zr(e,function(t){if(t.empty()){var i=re(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line0)n=new q(n.line,n.ch+1),e.replaceRange(a.charAt(n.ch-1)+a.charAt(n.ch-2),q(n.line,n.ch-2),n,"+transpose");else if(n.line>e.doc.first){var u=re(e.doc,n.line-1).text;u&&(n=new q(n.line,1),e.replaceRange(a.charAt(0)+e.doc.lineSeparator()+u.charAt(u.length-1),q(n.line-1,u.length-1),n,"+transpose"))}}i.push(new be(n,n))}e.setSelections(i)})},newlineAndIndent:function(e){return ut(e,function(){for(var t=e.listSelections(),i=t.length-1;i>=0;i--)e.replaceRange(e.doc.lineSeparator(),t[i].anchor,t[i].head,"+input");t=e.listSelections();for(var r=0;re&&fe(t,this.pos)==0&&i==this.button};var xi,Di;function Ac(e,t){var i=+new Date;return Di&&Di.compare(i,e,t)?(xi=Di=null,"triple"):xi&&xi.compare(i,e,t)?(Di=new Po(i,e,t),xi=null,"double"):(xi=new Po(i,e,t),Di=null,"single")}function us(e){var t=this,i=t.display;if(!(We(t,e)||i.activeTouch&&i.input.supportsTouch())){if(i.input.ensurePolled(),i.shift=e.shiftKey,zt(i,e)){y||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(!_o(t,e)){var r=ar(t,e),n=xa(e),a=r?Ac(r,n):"single";he(t).focus(),n==1&&t.state.selectingText&&t.state.selectingText(e),!(r&&Lc(t,n,r,a,e))&&(n==1?r?Mc(t,r,a,e):Wn(e)==i.scroller&&it(e):n==2?(r&&Qi(t.doc,r),setTimeout(function(){return i.input.focus()},20)):n==3&&(ge?t.display.input.onContextMenu(e):xo(t)))}}}function Lc(e,t,i,r,n){var a="Click";return r=="double"?a="Double"+a:r=="triple"&&(a="Triple"+a),a=(t==1?"Left":t==2?"Middle":"Right")+a,bi(e,es(a,n),n,function(u){if(typeof u=="string"&&(u=yi[u]),!u)return!1;var h=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),h=u(e,i)!=Pe}finally{e.state.suppressEdits=!1}return h})}function Tc(e,t,i){var r=e.getOption("configureMouse"),n=r?r(e,t,i):{};if(n.unit==null){var a=H?i.shiftKey&&i.metaKey:i.altKey;n.unit=a?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(n.extend==null||e.doc.extend)&&(n.extend=e.doc.extend||i.shiftKey),n.addNew==null&&(n.addNew=R?i.metaKey:i.ctrlKey),n.moveOnDrag==null&&(n.moveOnDrag=!(R?i.altKey:i.ctrlKey)),n}function Mc(e,t,i,r){d?setTimeout(tt(fl,e),0):e.curOp.focus=ve(ee(e));var n=Tc(e,i,r),a=e.doc.sel,u;e.options.dragDrop&&Ru&&!e.isReadOnly()&&i=="single"&&(u=a.contains(t))>-1&&(fe((u=a.ranges[u]).from(),t)<0||t.xRel>0)&&(fe(u.to(),t)>0||t.xRel<0)?Bc(e,r,t,n):Nc(e,r,t,n)}function Bc(e,t,i,r){var n=e.display,a=!1,u=Ue(e,function(m){y&&(n.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:xo(e)),ht(n.wrapper.ownerDocument,"mouseup",u),ht(n.wrapper.ownerDocument,"mousemove",h),ht(n.scroller,"dragstart",v),ht(n.scroller,"drop",u),a||(it(m),r.addNew||Qi(e.doc,i,null,null,r.extend),y&&!T||d&&p==9?setTimeout(function(){n.wrapper.ownerDocument.body.focus({preventScroll:!0}),n.input.focus()},20):n.input.focus())}),h=function(m){a=a||Math.abs(t.clientX-m.clientX)+Math.abs(t.clientY-m.clientY)>=10},v=function(){return a=!0};y&&(n.scroller.draggable=!0),e.state.draggingText=u,u.copy=!r.moveOnDrag,oe(n.wrapper.ownerDocument,"mouseup",u),oe(n.wrapper.ownerDocument,"mousemove",h),oe(n.scroller,"dragstart",v),oe(n.scroller,"drop",u),e.state.delayingBlurEvent=!0,setTimeout(function(){return n.input.focus()},20),n.scroller.dragDrop&&n.scroller.dragDrop()}function fs(e,t,i){if(i=="char")return new be(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new be(q(t.line,0),ce(e.doc,q(t.line+1,0)));var r=i(e,t);return new be(r.from,r.to)}function Nc(e,t,i,r){d&&xo(e);var n=e.display,a=e.doc;it(t);var u,h,v=a.sel,m=v.ranges;if(r.addNew&&!r.extend?(h=a.sel.contains(i),h>-1?u=m[h]:u=new be(i,i)):(u=a.sel.primary(),h=a.sel.primIndex),r.unit=="rectangle")r.addNew||(u=new be(i,i)),i=ar(e,t,!0,!0),h=-1;else{var x=fs(e,i,r.unit);r.extend?u=No(u,x.anchor,x.head,r.extend):u=x}r.addNew?h==-1?(h=m.length,Ze(a,Ct(e,m.concat([u]),h),{scroll:!1,origin:"*mouse"})):m.length>1&&m[h].empty()&&r.unit=="char"&&!r.extend?(Ze(a,Ct(e,m.slice(0,h).concat(m.slice(h+1)),0),{scroll:!1,origin:"*mouse"}),v=a.sel):Io(a,h,u,jr):(h=0,Ze(a,new pt([u],0),jr),v=a.sel);var C=i;function M(Z){if(fe(C,Z)!=0)if(C=Z,r.unit=="rectangle"){for(var $=[],ne=e.options.tabSize,ie=Re(re(a,i.line).text,i.ch,ne),pe=Re(re(a,Z.line).text,Z.ch,ne),we=Math.min(ie,pe),Ge=Math.max(ie,pe),Le=Math.min(i.line,Z.line),ft=Math.min(e.lastLine(),Math.max(i.line,Z.line));Le<=ft;Le++){var at=re(a,Le).text,Oe=Ft(at,we,ne);we==Ge?$.push(new be(q(Le,Oe),q(Le,Oe))):at.length>Oe&&$.push(new be(q(Le,Oe),q(Le,Ft(at,Ge,ne))))}$.length||$.push(new be(i,i)),Ze(a,Ct(e,v.ranges.slice(0,h).concat($),h),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Z)}else{var lt=u,Xe=fs(e,Z,r.unit),_e=lt.anchor,He;fe(Xe.anchor,_e)>0?(He=Xe.head,_e=Ti(lt.from(),Xe.anchor)):(He=Xe.anchor,_e=Li(lt.to(),Xe.head));var Be=v.ranges.slice(0);Be[h]=Ic(e,new be(ce(a,_e),He)),Ze(a,Ct(e,Be,h),jr)}}var E=n.wrapper.getBoundingClientRect(),O=0;function P(Z){var $=++O,ne=ar(e,Z,!0,r.unit=="rectangle");if(ne)if(fe(ne,C)!=0){e.curOp.focus=ve(ee(e)),M(ne);var ie=ji(n,a);(ne.line>=ie.to||ne.lineE.bottom?20:0;pe&&setTimeout(Ue(e,function(){O==$&&(n.scroller.scrollTop+=pe,P(Z))}),50)}}function j(Z){e.state.selectingText=!1,O=1/0,Z&&(it(Z),n.input.focus()),ht(n.wrapper.ownerDocument,"mousemove",Y),ht(n.wrapper.ownerDocument,"mouseup",Q),a.history.lastSelOrigin=null}var Y=Ue(e,function(Z){Z.buttons===0||!xa(Z)?j(Z):P(Z)}),Q=Ue(e,j);e.state.selectingText=Q,oe(n.wrapper.ownerDocument,"mousemove",Y),oe(n.wrapper.ownerDocument,"mouseup",Q)}function Ic(e,t){var i=t.anchor,r=t.head,n=re(e.doc,i.line);if(fe(i,r)==0&&i.sticky==r.sticky)return t;var a=Bt(n);if(!a)return t;var u=Xr(a,i.ch,i.sticky),h=a[u];if(h.from!=i.ch&&h.to!=i.ch)return t;var v=u+(h.from==i.ch==(h.level!=1)?0:1);if(v==0||v==a.length)return t;var m;if(r.line!=i.line)m=(r.line-i.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var x=Xr(a,r.ch,r.sticky),C=x-u||(r.ch-i.ch)*(h.level==1?-1:1);x==v-1||x==v?m=C<0:m=C>0}var M=a[v+(m?-1:0)],E=m==(M.level==1),O=E?M.from:M.to,P=E?"after":"before";return i.ch==O&&i.sticky==P?t:new be(new q(i.line,O,P),r)}function cs(e,t,i,r){var n,a;if(t.touches)n=t.touches[0].clientX,a=t.touches[0].clientY;else try{n=t.clientX,a=t.clientY}catch{return!1}if(n>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&it(t);var u=e.display,h=u.lineDiv.getBoundingClientRect();if(a>h.bottom||!yt(e,i))return _n(t);a-=h.top-u.viewOffset;for(var v=0;v=n){var x=ir(e.doc,a),C=e.display.gutterSpecs[v];return Ie(e,i,e,x,C.className,t),_n(t)}}}function _o(e,t){return cs(e,t,"gutterClick",!0)}function ds(e,t){zt(e.display,t)||zc(e,t)||We(e,t,"contextmenu")||ge||e.display.input.onContextMenu(t)}function zc(e,t){return yt(e,"gutterContextMenu")?cs(e,t,"gutterContextMenu",!1):!1}function hs(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),ti(e)}var Or={toString:function(){return"CodeMirror.Init"}},ps={},nn={};function Oc(e){var t=e.optionHandlers;function i(r,n,a,u){e.defaults[r]=n,a&&(t[r]=u?function(h,v,m){m!=Or&&a(h,v,m)}:a)}e.defineOption=i,e.Init=Or,i("value","",function(r,n){return r.setValue(n)},!0),i("mode",null,function(r,n){r.doc.modeOption=n,To(r)},!0),i("indentUnit",2,To,!0),i("indentWithTabs",!1),i("smartIndent",!0),i("tabSize",4,function(r){ui(r),ti(r),nt(r)},!0),i("lineSeparator",null,function(r,n){if(r.doc.lineSep=n,!!n){var a=[],u=r.doc.first;r.doc.iter(function(v){for(var m=0;;){var x=v.text.indexOf(n,m);if(x==-1)break;m=x+n.length,a.push(q(u,x))}u++});for(var h=a.length-1;h>=0;h--)Br(r.doc,n,a[h],q(a[h].line,a[h].ch+n.length))}}),i("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(r,n,a){r.state.specialChars=new RegExp(n.source+(n.test(" ")?"":"| "),"g"),a!=Or&&r.refresh()}),i("specialCharPlaceholder",cf,function(r){return r.refresh()},!0),i("electricChars",!0),i("inputStyle",I?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),i("spellcheck",!1,function(r,n){return r.getInputField().spellcheck=n},!0),i("autocorrect",!1,function(r,n){return r.getInputField().autocorrect=n},!0),i("autocapitalize",!1,function(r,n){return r.getInputField().autocapitalize=n},!0),i("rtlMoveVisually",!_),i("wholeLineUpdateBefore",!0),i("theme","default",function(r){hs(r),si(r)},!0),i("keyMap","default",function(r,n,a){var u=tn(n),h=a!=Or&&tn(a);h&&h.detach&&h.detach(r,u),u.attach&&u.attach(r,h||null)}),i("extraKeys",null),i("configureMouse",null),i("lineWrapping",!1,Rc,!0),i("gutters",[],function(r,n){r.display.gutterSpecs=Ao(n,r.options.lineNumbers),si(r)},!0),i("fixedGutter",!0,function(r,n){r.display.gutters.style.left=n?vo(r.display)+"px":"0",r.refresh()},!0),i("coverGutterNextToScrollbar",!1,function(r){return Ar(r)},!0),i("scrollbarStyle","native",function(r){vl(r),Ar(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),i("lineNumbers",!1,function(r,n){r.display.gutterSpecs=Ao(r.options.gutters,n),si(r)},!0),i("firstLineNumber",1,si,!0),i("lineNumberFormatter",function(r){return r},si,!0),i("showCursorWhenSelecting",!1,ri,!0),i("resetSelectionOnContextMenu",!0),i("lineWiseCopyCut",!0),i("pasteLinesPerSelection",!0),i("selectionsMayTouch",!1),i("readOnly",!1,function(r,n){n=="nocursor"&&(Fr(r),r.display.input.blur()),r.display.input.readOnlyChanged(n)}),i("screenReaderLabel",null,function(r,n){n=n===""?null:n,r.display.input.screenReaderLabelChanged(n)}),i("disableInput",!1,function(r,n){n||r.display.input.reset()},!0),i("dragDrop",!0,Hc),i("allowDropFileTypes",null),i("cursorBlinkRate",530),i("cursorScrollMargin",0),i("cursorHeight",1,ri,!0),i("singleCursorHeightPerLine",!0,ri,!0),i("workTime",100),i("workDelay",100),i("flattenSpans",!0,ui,!0),i("addModeClass",!1,ui,!0),i("pollInterval",100),i("undoDepth",200,function(r,n){return r.doc.history.undoDepth=n}),i("historyEventDelay",1250),i("viewportMargin",10,function(r){return r.refresh()},!0),i("maxHighlightLength",1e4,ui,!0),i("moveInputWithCursor",!0,function(r,n){n||r.display.input.resetPosition()}),i("tabindex",null,function(r,n){return r.display.input.getField().tabIndex=n||""}),i("autofocus",null),i("direction","ltr",function(r,n){return r.doc.setDirection(n)},!0),i("phrases",null)}function Hc(e,t,i){var r=i&&i!=Or;if(!t!=!r){var n=e.display.dragFunctions,a=t?oe:ht;a(e.display.scroller,"dragstart",n.start),a(e.display.scroller,"dragenter",n.enter),a(e.display.scroller,"dragover",n.over),a(e.display.scroller,"dragleave",n.leave),a(e.display.scroller,"drop",n.drop)}}function Rc(e){e.options.lineWrapping?(Te(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(ue(e.display.wrapper,"CodeMirror-wrap"),oo(e)),mo(e),nt(e),ti(e),setTimeout(function(){return Ar(e)},100)}function Ee(e,t){var i=this;if(!(this instanceof Ee))return new Ee(e,t);this.options=t=t?dt(t):{},dt(ps,t,!1);var r=t.value;typeof r=="string"?r=new ot(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var n=new Ee.inputStyles[t.inputStyle](this),a=this.display=new Jf(e,r,n,t);a.wrapper.CodeMirror=this,hs(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),vl(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new Je,keySeq:null,specialChars:null},t.autofocus&&!I&&a.input.focus(),d&&p<11&&setTimeout(function(){return i.display.input.reset(!0)},20),Pc(this),vc(),fr(this),this.curOp.forceUpdate=!0,Fl(this,r),t.autofocus&&!I||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&Do(i)},20):Fr(this);for(var u in nn)nn.hasOwnProperty(u)&&nn[u](this,t[u],Or);bl(this),t.finishInit&&t.finishInit(this);for(var h=0;h20*20}oe(t.scroller,"touchstart",function(v){if(!We(e,v)&&!a(v)&&!_o(e,v)){t.input.ensurePolled(),clearTimeout(i);var m=+new Date;t.activeTouch={start:m,moved:!1,prev:m-r.end<=300?r:null},v.touches.length==1&&(t.activeTouch.left=v.touches[0].pageX,t.activeTouch.top=v.touches[0].pageY)}}),oe(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),oe(t.scroller,"touchend",function(v){var m=t.activeTouch;if(m&&!zt(t,v)&&m.left!=null&&!m.moved&&new Date-m.start<300){var x=e.coordsChar(t.activeTouch,"page"),C;!m.prev||u(m,m.prev)?C=new be(x,x):!m.prev.prev||u(m,m.prev.prev)?C=e.findWordAt(x):C=new be(q(x.line,0),ce(e.doc,q(x.line+1,0))),e.setSelection(C.anchor,C.head),e.focus(),it(v)}n()}),oe(t.scroller,"touchcancel",n),oe(t.scroller,"scroll",function(){t.scroller.clientHeight&&(ni(e,t.scroller.scrollTop),sr(e,t.scroller.scrollLeft,!0),Ie(e,"scroll",e))}),oe(t.scroller,"mousewheel",function(v){return wl(e,v)}),oe(t.scroller,"DOMMouseScroll",function(v){return wl(e,v)}),oe(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(v){We(e,v)||Yr(v)},over:function(v){We(e,v)||(gc(e,v),Yr(v))},start:function(v){return pc(e,v)},drop:Ue(e,hc),leave:function(v){We(e,v)||Ql(e)}};var h=t.input.getField();oe(h,"keyup",function(v){return ls.call(e,v)}),oe(h,"keydown",Ue(e,as)),oe(h,"keypress",Ue(e,ss)),oe(h,"focus",function(v){return Do(e,v)}),oe(h,"blur",function(v){return Fr(e,v)})}var Wo=[];Ee.defineInitHook=function(e){return Wo.push(e)};function wi(e,t,i,r){var n=e.doc,a;i==null&&(i="add"),i=="smart"&&(n.mode.indent?a=Qr(e,t).state:i="prev");var u=e.options.tabSize,h=re(n,t),v=Re(h.text,null,u);h.stateAfter&&(h.stateAfter=null);var m=h.text.match(/^\s*/)[0],x;if(!r&&!/\S/.test(h.text))x=0,i="not";else if(i=="smart"&&(x=n.mode.indent(a,h.text.slice(m.length),h.text),x==Pe||x>150)){if(!r)return;i="prev"}i=="prev"?t>n.first?x=Re(re(n,t-1).text,null,u):x=0:i=="add"?x=v+e.options.indentUnit:i=="subtract"?x=v-e.options.indentUnit:typeof i=="number"&&(x=v+i),x=Math.max(0,x);var C="",M=0;if(e.options.indentWithTabs)for(var E=Math.floor(x/u);E;--E)M+=u,C+=" ";if(Mu,v=jn(t),m=null;if(h&&r.ranges.length>1)if(kt&&kt.text.join(` -`)==t){if(r.ranges.length%kt.text.length==0){m=[];for(var x=0;x=0;M--){var E=r.ranges[M],O=E.from(),P=E.to();E.empty()&&(i&&i>0?O=q(O.line,O.ch-i):e.state.overwrite&&!h?P=q(P.line,Math.min(re(a,P.line).text.length,P.ch+me(v).length)):h&&kt&&kt.lineWise&&kt.text.join(` +b`.split(/\n/).length!=3?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf(` +`,t);i==-1&&(i=e.length);var u=e.slice(t,e.charAt(i-1)=="\r"?i-1:i),d=u.indexOf("\r");d!=-1?(n.push(u.slice(0,d)),t+=d+1):(n.push(u),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},Rc=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch{return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch{}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Wc=function(){var e=E("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),ta=null;function qc(e){if(ta!=null)return ta;var t=K(e,E("span","x")),n=t.getBoundingClientRect(),r=R(t,0,1).getBoundingClientRect();return ta=Math.abs(n.left-r.left)>1}var ra={},Jr={};function Uc(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),ra[e]=t}function jc(e,t){Jr[e]=t}function Ci(e){if(typeof e=="string"&&Jr.hasOwnProperty(e))e=Jr[e];else if(e&&typeof e.name=="string"&&Jr.hasOwnProperty(e.name)){var t=Jr[e.name];typeof t=="string"&&(t={name:t}),e=Rl(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ci("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ci("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function na(e,t){t=Ci(t);var n=ra[t.name];if(!n)return na(e,"text/plain");var r=n(e,t);if($r.hasOwnProperty(t.name)){var i=$r[t.name];for(var u in i)i.hasOwnProperty(u)&&(r.hasOwnProperty(u)&&(r["_"+u]=r[u]),r[u]=i[u])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var d in t.modeProps)r[d]=t.modeProps[d];return r}var $r={};function Gc(e,t){var n=$r.hasOwnProperty(e)?$r[e]:$r[e]={};Tt(t,n)}function Lr(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function ia(e,t){for(var n;e.innerMode&&(n=e.innerMode(t),!(!n||n.mode==e));)t=n.state,e=n.mode;return n||{mode:e,state:t}}function Kl(e,t,n){return e.startState?e.startState(t,n):!0}var Ge=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};Ge.prototype.eol=function(){return this.pos>=this.string.length},Ge.prototype.sol=function(){return this.pos==this.lineStart},Ge.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ge.prototype.next=function(){if(this.post},Ge.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ge.prototype.skipToEnd=function(){this.pos=this.string.length},Ge.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ge.prototype.backUp=function(e){this.pos-=e},Ge.prototype.column=function(){return this.lastColumnPos0?null:(u&&t!==!1&&(this.pos+=u[0].length),u)}},Ge.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ge.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ge.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ge.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function oe(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],u=i.chunkSize();if(t=e.first&&tn?G(n,oe(e,n).text.length):Xc(t,oe(e,t.line).text.length)}function Xc(e,t){var n=e.ch;return n==null||n>t?G(e.line,t):n<0?G(e.line,0):e}function Zl(e,t){for(var n=[],r=0;rthis.maxLookAhead&&(this.maxLookAhead=e),t},Zt.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},Zt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Zt.fromSaved=function(e,t,n){return t instanceof Ei?new Zt(e,Lr(e.mode,t.state),n,t.lookAhead):new Zt(e,Lr(e.mode,t),n)},Zt.prototype.save=function(e){var t=e!==!1?Lr(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Ei(t,this.maxLookAhead):t};function Ql(e,t,n,r){var i=[e.state.modeGen],u={};rs(e,t.text,e.doc.mode,n,function(m,w){return i.push(m,w)},u,r);for(var d=n.state,g=function(m){n.baseTokens=i;var w=e.state.overlays[m],k=1,B=0;n.state=!0,rs(e,t.text,w.mode,n,function(M,H){for(var W=k;BM&&i.splice(k,1,M,i[k+1],Y),k+=2,B=Math.min(M,Y)}if(H)if(w.opaque)i.splice(W,k-W,M,"overlay "+H),k=W+2;else for(;We.options.maxHighlightLength&&Lr(e.doc.mode,r.state),u=Ql(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=u.styles,u.classes?t.styleClasses=u.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function On(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new Zt(r,!0,t);var u=Kc(e,t,n),d=u>r.first&&oe(r,u-1).stateAfter,g=d?Zt.fromSaved(r,d,u):new Zt(r,Kl(r.mode),u);return r.iter(u,t,function(v){ua(e,v.text,g);var m=g.line;v.stateAfter=m==t-1||m%5==0||m>=i.viewFrom&&mt.start)return u}throw new Error("Mode "+e.name+" failed to advance stream.")}var Vl=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function es(e,t,n,r){var i=e.doc,u=i.mode,d;t=ve(i,t);var g=oe(i,t.line),v=On(e,t.line,n),m=new Ge(g.text,e.options.tabSize,v),w;for(r&&(w=[]);(r||m.pose.options.maxHighlightLength?(g=!1,d&&ua(e,t,r,w.pos),w.pos=t.length,k=null):k=ts(fa(n,w,r.state,B),u),B){var M=B[0].name;M&&(k="m-"+(k?M+" "+k:M))}if(!g||m!=k){for(;vd;--g){if(g<=u.first)return u.first;var v=oe(u,g-1),m=v.stateAfter;if(m&&(!n||g+(m instanceof Ei?m.lookAhead:0)<=u.modeFrontier))return g;var w=Ye(v.text,null,e.options.tabSize);(i==null||r>w)&&(i=g-1,r=w)}return i}function Yc(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontiern;r--){var i=oe(e,r).stateAfter;if(i&&(!(i instanceof Ei)||r+i.lookAhead=t:u.to>t);(r||(r=[])).push(new Ai(d,u.from,v?null:u.to))}}return r}function ed(e,t,n){var r;if(e)for(var i=0;i=t:u.to>t);if(g||u.from==t&&d.type=="bookmark"&&(!n||u.marker.insertLeft)){var v=u.from==null||(d.inclusiveLeft?u.from<=t:u.from0&&g)for(var re=0;re0)){var w=[v,1],k=ge(m.from,g.from),B=ge(m.to,g.to);(k<0||!d.inclusiveLeft&&!k)&&w.push({from:m.from,to:g.from}),(B>0||!d.inclusiveRight&&!B)&&w.push({from:g.to,to:m.to}),i.splice.apply(i,w),v+=w.length-3}}return i}function os(e){var t=e.markedSpans;if(t){for(var n=0;nt)&&(!r||da(r,u.marker)<0)&&(r=u.marker)}return r}function us(e,t,n,r,i){var u=oe(e,t),d=rr&&u.markedSpans;if(d)for(var g=0;g=0&&k<=0||w<=0&&k>=0)&&(w<=0&&(v.marker.inclusiveRight&&i.inclusiveLeft?ge(m.to,n)>=0:ge(m.to,n)>0)||w>=0&&(v.marker.inclusiveRight&&i.inclusiveLeft?ge(m.from,r)<=0:ge(m.from,r)<0)))return!0}}}function Rt(e){for(var t;t=ss(e);)e=t.find(-1,!0).line;return e}function nd(e){for(var t;t=Li(e);)e=t.find(1,!0).line;return e}function id(e){for(var t,n;t=Li(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function ha(e,t){var n=oe(e,t),r=Rt(n);return n==r?t:Ae(r)}function fs(e,t){if(t>e.lastLine())return t;var n=oe(e,t),r;if(!vr(e,n))return t;for(;r=Li(n);)n=r.find(1,!0).line;return Ae(n)+1}function vr(e,t){var n=rr&&t.markedSpans;if(n){for(var r=void 0,i=0;it.maxLineLength&&(t.maxLineLength=i,t.maxLine=r)})}var Vr=function(e,t,n){this.text=e,as(this,t),this.height=n?n(this):1};Vr.prototype.lineNo=function(){return Ae(this)},Qr(Vr);function od(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),os(e),as(e,n);var i=r?r(e):1;i!=e.height&&Yt(e,i)}function ad(e){e.parent=null,os(e)}var ld={},sd={};function cs(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?sd:ld;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function ds(e,t){var n=z("span",null,null,b?"padding-right: .1px":null),r={pre:z("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var u=i?t.rest[i-1]:t.line,d=void 0;r.pos=0,r.addToken=fd,Hc(e.display.measure)&&(d=tr(u,e.doc.direction))&&(r.addToken=dd(r.addToken,d)),r.map=[];var g=t!=e.display.externalMeasured&&Ae(u);hd(u,r,Jl(e,u,g)),u.styleClasses&&(u.styleClasses.bgClass&&(r.bgClass=Ue(u.styleClasses.bgClass,r.bgClass||"")),u.styleClasses.textClass&&(r.textClass=Ue(u.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(zc(e.display.measure))),i==0?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(b){var v=r.content.lastChild;(/\bcm-tab\b/.test(v.className)||v.querySelector&&v.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return je(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=Ue(r.pre.className,r.textClass||"")),r}function ud(e){var t=E("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function fd(e,t,n,r,i,u,d){if(t){var g=e.splitSpaces?cd(t,e.trailingSpace):t,v=e.cm.state.specialChars,m=!1,w;if(!v.test(t))e.col+=t.length,w=document.createTextNode(g),e.map.push(e.pos,e.pos+t.length,w),c&&h<9&&(m=!0),e.pos+=t.length;else{w=document.createDocumentFragment();for(var k=0;;){v.lastIndex=k;var B=v.exec(t),M=B?B.index-k:t.length-k;if(M){var H=document.createTextNode(g.slice(k,k+M));c&&h<9?w.appendChild(E("span",[H])):w.appendChild(H),e.map.push(e.pos,e.pos+M,H),e.col+=M,e.pos+=M}if(!B)break;k+=M+1;var W=void 0;if(B[0]==" "){var Y=e.cm.options.tabSize,Q=Y-e.col%Y;W=w.appendChild(E("span",pr(Q),"cm-tab")),W.setAttribute("role","presentation"),W.setAttribute("cm-text"," "),e.col+=Q}else B[0]=="\r"||B[0]==` +`?(W=w.appendChild(E("span",B[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),W.setAttribute("cm-text",B[0]),e.col+=1):(W=e.cm.options.specialCharPlaceholder(B[0]),W.setAttribute("cm-text",B[0]),c&&h<9?w.appendChild(E("span",[W])):w.appendChild(W),e.col+=1);e.map.push(e.pos,e.pos+1,W),e.pos++}}if(e.trailingSpace=g.charCodeAt(t.length-1)==32,n||r||i||m||u||d){var V=n||"";r&&(V+=r),i&&(V+=i);var J=E("span",[w],V,u);if(d)for(var re in d)d.hasOwnProperty(re)&&re!="style"&&re!="class"&&J.setAttribute(re,d[re]);return e.content.appendChild(J)}e.content.appendChild(w)}}function cd(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;im&&k.from<=m));B++);if(k.to>=w)return e(n,r,i,u,d,g,v);e(n,r.slice(0,k.to-m),i,u,null,g,v),u=null,r=r.slice(k.to-m),m=k.to}}}function hs(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function hd(e,t,n){var r=e.markedSpans,i=e.text,u=0;if(!r){for(var d=1;dv||xe.collapsed&&ae.to==v&&ae.from==v)){if(ae.to!=null&&ae.to!=v&&M>ae.to&&(M=ae.to,W=""),xe.className&&(H+=" "+xe.className),xe.css&&(B=(B?B+";":"")+xe.css),xe.startStyle&&ae.from==v&&(Y+=" "+xe.startStyle),xe.endStyle&&ae.to==M&&(re||(re=[])).push(xe.endStyle,ae.to),xe.title&&((V||(V={})).title=xe.title),xe.attributes)for(var Te in xe.attributes)(V||(V={}))[Te]=xe.attributes[Te];xe.collapsed&&(!Q||da(Q.marker,xe)<0)&&(Q=ae)}else ae.from>v&&M>ae.from&&(M=ae.from)}if(re)for(var nt=0;nt=g)break;for(var St=Math.min(g,M);;){if(w){var xt=v+w.length;if(!Q){var Xe=xt>St?w.slice(0,St-v):w;t.addToken(t,Xe,k?k+H:H,Y,v+Xe.length==M?W:"",B,V)}if(xt>=St){w=w.slice(St-v),v=St;break}v=xt,Y=""}w=i.slice(u,u=n[m++]),k=cs(n[m++],t.cm.options)}}}function ps(e,t,n){this.line=t,this.rest=id(t),this.size=this.rest?Ae(we(this.rest))-n+1:1,this.node=this.text=null,this.hidden=vr(e,t)}function _i(e,t,n){for(var r=[],i,u=t;u2&&u.push((v.bottom+m.top)/2-n.top)}}u.push(n.bottom-n.top)}}function Ds(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var r=0;rn)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}}function kd(e,t){t=Rt(t);var n=Ae(t),r=e.display.externalMeasured=new ps(e.doc,t,n);r.lineN=n;var i=r.built=ds(e,r);return r.text=i.pre,K(e.display.lineMeasure,i.pre),r}function ws(e,t,n,r){return Jt(e,tn(e,t),n,r)}function ya(e,t){if(t>=e.display.viewFrom&&t=n.lineN&&tt)&&(u=v-g,i=u-1,t>=v&&(d="right")),i!=null){if(r=e[m+2],g==v&&n==(r.insertLeft?"left":"right")&&(d=n),n=="left"&&i==0)for(;m&&e[m-2]==e[m-3]&&e[m-1].insertLeft;)r=e[(m-=3)+2],d="left";if(n=="right"&&i==v-g)for(;m=0&&(n=e[i]).left==n.right;i--);return n}function Ed(e,t,n,r){var i=ks(t.map,n,r),u=i.node,d=i.start,g=i.end,v=i.collapse,m;if(u.nodeType==3){for(var w=0;w<4;w++){for(;d&&Yo(t.line.text.charAt(i.coverStart+d));)--d;for(;i.coverStart+g0&&(v=r="right");var k;e.options.lineWrapping&&(k=u.getClientRects()).length>1?m=k[r=="right"?k.length-1:0]:m=u.getBoundingClientRect()}if(c&&h<9&&!d&&(!m||!m.left&&!m.right)){var B=u.parentNode.getClientRects()[0];B?m={left:B.left,right:B.left+nn(e.display),top:B.top,bottom:B.bottom}:m=Cs}for(var M=m.top-t.rect.top,H=m.bottom-t.rect.top,W=(M+H)/2,Y=t.view.measure.heights,Q=0;Q=r.text.length?(v=r.text.length,m="before"):v<=0&&(v=0,m="after"),!g)return d(m=="before"?v-1:v,m=="before");function w(H,W,Y){var Q=g[W],V=Q.level==1;return d(Y?H-1:H,V!=Y)}var k=_n(g,v,m),B=Mn,M=w(v,k,m=="before");return B!=null&&(M.other=w(v,B,m!="before")),M}function Ls(e,t){var n=0;t=ve(e.doc,t),e.options.lineWrapping||(n=nn(e.display)*t.ch);var r=oe(e.doc,t.line),i=nr(r)+Bi(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Da(e,t,n,r,i){var u=G(e,t,n);return u.xRel=i,r&&(u.outside=r),u}function wa(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,n<0)return Da(r.first,0,null,-1,-1);var i=_r(r,n),u=r.first+r.size-1;if(i>u)return Da(r.first+r.size-1,oe(r,u).text.length,null,1,1);t<0&&(t=0);for(var d=oe(r,i);;){var g=Fd(e,d,i,t,n),v=rd(d,g.ch+(g.xRel>0||g.outside>0?1:0));if(!v)return g;var m=v.find(1);if(m.line==i)return m;d=oe(r,i=m.line)}}function Ms(e,t,n,r){r-=xa(t);var i=t.text.length,u=Ln(function(d){return Jt(e,n,d-1).bottom<=r},i,0);return i=Ln(function(d){return Jt(e,n,d).top>r},u,i),{begin:u,end:i}}function _s(e,t,n,r){n||(n=tn(e,t));var i=Ni(e,t,Jt(e,n,r),"line").top;return Ms(e,t,n,i)}function Ca(e,t,n,r){return e.bottom<=n?!1:e.top>n?!0:(r?e.left:e.right)>t}function Fd(e,t,n,r,i){i-=nr(t);var u=tn(e,t),d=xa(t),g=0,v=t.text.length,m=!0,w=tr(t,e.doc.direction);if(w){var k=(e.options.lineWrapping?Ld:Td)(e,t,n,u,w,r,i);m=k.level!=1,g=m?k.from:k.to-1,v=m?k.to:k.from-1}var B=null,M=null,H=Ln(function(se){var ae=Jt(e,u,se);return ae.top+=d,ae.bottom+=d,Ca(ae,r,i,!1)?(ae.top<=i&&ae.left<=r&&(B=se,M=ae),!0):!1},g,v),W,Y,Q=!1;if(M){var V=r-M.left=re.bottom?1:0}return H=ql(t.text,H,1),Da(n,H,Y,Q,r-W)}function Td(e,t,n,r,i,u,d){var g=Ln(function(k){var B=i[k],M=B.level!=1;return Ca(Wt(e,G(n,M?B.to:B.from,M?"before":"after"),"line",t,r),u,d,!0)},0,i.length-1),v=i[g];if(g>0){var m=v.level!=1,w=Wt(e,G(n,m?v.from:v.to,m?"after":"before"),"line",t,r);Ca(w,u,d,!0)&&w.top>d&&(v=i[g-1])}return v}function Ld(e,t,n,r,i,u,d){var g=Ms(e,t,r,d),v=g.begin,m=g.end;/\s/.test(t.text.charAt(m-1))&&m--;for(var w=null,k=null,B=0;B=m||M.to<=v)){var H=M.level!=1,W=Jt(e,r,H?Math.min(m,M.to)-1:Math.max(v,M.from)).right,Y=WY)&&(w=M,k=Y)}}return w||(w=i[i.length-1]),w.fromm&&(w={from:w.from,to:m,level:w.level}),w}var Nr;function rn(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Nr==null){Nr=E("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Nr.appendChild(document.createTextNode("x")),Nr.appendChild(E("br"));Nr.appendChild(document.createTextNode("x"))}K(e.measure,Nr);var n=Nr.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),ie(e.measure),n||1}function nn(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=E("span","xxxxxxxxxx"),n=E("pre",[t],"CodeMirror-line-like");K(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function ka(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,u=t.gutters.firstChild,d=0;u;u=u.nextSibling,++d){var g=e.display.gutterSpecs[d].className;n[g]=u.offsetLeft+u.clientLeft+i,r[g]=u.clientWidth}return{fixedPos:Sa(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Sa(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Bs(e){var t=rn(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/nn(e.display)-3);return function(i){if(vr(e.doc,i))return 0;var u=0;if(i.widgets)for(var d=0;d0&&(m=oe(e.doc,v.line).text).length==v.ch){var w=Ye(m,m.length,e.options.tabSize)-m.length;v=G(v.line,Math.max(0,Math.round((u-xs(e.display).left)/nn(e.display))-w))}return v}function Ir(e,t){if(t>=e.display.viewTo||(t-=e.display.viewFrom,t<0))return null;for(var n=e.display.view,r=0;rt)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)rr&&ha(e.doc,t)i.viewFrom?br(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)br(e);else if(t<=i.viewFrom){var u=Ii(e,n,n+r,1);u?(i.view=i.view.slice(u.index),i.viewFrom=u.lineN,i.viewTo+=r):br(e)}else if(n>=i.viewTo){var d=Ii(e,t,t,-1);d?(i.view=i.view.slice(0,d.index),i.viewTo=d.lineN):br(e)}else{var g=Ii(e,t,t,-1),v=Ii(e,n,n+r,1);g&&v?(i.view=i.view.slice(0,g.index).concat(_i(e,g.lineN,v.lineN)).concat(i.view.slice(v.index)),i.viewTo+=r):br(e)}var m=i.externalMeasured;m&&(n=i.lineN&&t=r.viewTo)){var u=r.view[Ir(e,t)];if(u.node!=null){var d=u.changes||(u.changes=[]);Be(d,n)==-1&&d.push(n)}}}function br(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Ii(e,t,n,r){var i=Ir(e,t),u,d=e.display.view;if(!rr||n==e.doc.first+e.doc.size)return{index:i,lineN:n};for(var g=e.display.viewFrom,v=0;v0){if(i==d.length-1)return null;u=g+d[i].size-t,i++}else u=g-t;t+=u,n+=u}for(;ha(e.doc,n)!=n;){if(i==(r<0?0:d.length-1))return null;n+=r*d[i-(r<0?1:0)].size,i+=r}return{index:i,lineN:n}}function Md(e,t,n){var r=e.display,i=r.view;i.length==0||t>=r.viewTo||n<=r.viewFrom?(r.view=_i(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=_i(e,t,r.viewFrom).concat(r.view):r.viewFromn&&(r.view=r.view.slice(0,Ir(e,n)))),r.viewTo=n}function Ns(e){for(var t=e.display.view,n=0,r=0;r=e.display.viewTo||v.to().line0?d:e.defaultCharWidth())+"px"}if(r.other){var g=n.appendChild(E("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));g.style.display="",g.style.left=r.other.left+"px",g.style.top=r.other.top+"px",g.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function Pi(e,t){return e.top-t.top||e.left-t.left}function _d(e,t,n){var r=e.display,i=e.doc,u=document.createDocumentFragment(),d=xs(e.display),g=d.left,v=Math.max(r.sizerWidth,Br(e)-r.sizer.offsetLeft)-d.right,m=i.direction=="ltr";function w(J,re,se,ae){re<0&&(re=0),re=Math.round(re),ae=Math.round(ae),u.appendChild(E("div",null,"CodeMirror-selected","position: absolute; left: "+J+`px; + top: `+re+"px; width: "+(se??v-J)+`px; + height: `+(ae-re)+"px"))}function k(J,re,se){var ae=oe(i,J),xe=ae.text.length,Te,nt;function Ie(Xe,Dt){return Oi(e,G(J,Xe),"div",ae,Dt)}function St(Xe,Dt,ot){var Qe=_s(e,ae,null,Xe),Ke=Dt=="ltr"==(ot=="after")?"left":"right",He=ot=="after"?Qe.begin:Qe.end-(/\s/.test(ae.text.charAt(Qe.end-1))?2:1);return Ie(He,Ke)[Ke]}var xt=tr(ae,i.direction);return Oc(xt,re||0,se??xe,function(Xe,Dt,ot,Qe){var Ke=ot=="ltr",He=Ie(Xe,Ke?"left":"right"),wt=Ie(Dt-1,Ke?"right":"left"),mn=re==null&&Xe==0,kr=se==null&&Dt==xe,st=Qe==0,$t=!xt||Qe==xt.length-1;if(wt.top-He.top<=3){var it=(m?mn:kr)&&st,el=(m?kr:mn)&&$t,lr=it?g:(Ke?He:wt).left,Wr=el?v:(Ke?wt:He).right;w(lr,He.top,Wr-lr,He.bottom)}else{var qr,dt,bn,tl;Ke?(qr=m&&mn&&st?g:He.left,dt=m?v:St(Xe,ot,"before"),bn=m?g:St(Dt,ot,"after"),tl=m&&kr&&$t?v:wt.right):(qr=m?St(Xe,ot,"before"):g,dt=!m&&mn&&st?v:He.right,bn=!m&&kr&&$t?g:wt.left,tl=m?St(Dt,ot,"after"):v),w(qr,He.top,dt-qr,He.bottom),He.bottom0?t.blinker=setInterval(function(){e.hasFocus()||on(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Is(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||La(e))}function Ta(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&on(e))},100)}function La(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!="nocursor"&&(e.state.focused||(je(e,"focus",e,t),e.state.focused=!0,De(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),b&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Fa(e))}function on(e,t){e.state.delayingBlurEvent||(e.state.focused&&(je(e,"blur",e,t),e.state.focused=!1,le(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function zi(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),i=t.lineDiv.getBoundingClientRect().top,u=0,d=0;d.005||M<-.005)&&(ie.display.sizerWidth){var W=Math.ceil(w/nn(e.display));W>e.display.maxLineLength&&(e.display.maxLineLength=W,e.display.maxLine=g.line,e.display.maxLineChanged=!0)}}}Math.abs(u)>2&&(t.scroller.scrollTop+=u)}function Ps(e){if(e.widgets)for(var t=0;t=d&&(u=_r(t,nr(oe(t,v))-e.wrapper.clientHeight),d=v)}return{from:u,to:Math.max(d,u+1)}}function Bd(e,t){if(!Ve(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null,u=n.wrapper.ownerDocument;if(t.top+r.top<0?i=!0:t.bottom+r.top>(u.defaultView.innerHeight||u.documentElement.clientHeight)&&(i=!1),i!=null&&!L){var d=E("div","\u200B",null,`position: absolute; + top: `+(t.top-n.viewOffset-Bi(e.display))+`px; + height: `+(t.bottom-t.top+Qt(e)+n.barHeight)+`px; + left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(d),d.scrollIntoView(i),e.display.lineSpace.removeChild(d)}}}function Nd(e,t,n,r){r==null&&(r=0);var i;!e.options.lineWrapping&&t==n&&(n=t.sticky=="before"?G(t.line,t.ch+1,"before"):t,t=t.ch?G(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t);for(var u=0;u<5;u++){var d=!1,g=Wt(e,t),v=!n||n==t?g:Wt(e,n);i={left:Math.min(g.left,v.left),top:Math.min(g.top,v.top)-r,right:Math.max(g.left,v.left),bottom:Math.max(g.bottom,v.bottom)+r};var m=Ma(e,i),w=e.doc.scrollTop,k=e.doc.scrollLeft;if(m.scrollTop!=null&&(Un(e,m.scrollTop),Math.abs(e.doc.scrollTop-w)>1&&(d=!0)),m.scrollLeft!=null&&(Pr(e,m.scrollLeft),Math.abs(e.doc.scrollLeft-k)>1&&(d=!0)),!d)break}return i}function Od(e,t){var n=Ma(e,t);n.scrollTop!=null&&Un(e,n.scrollTop),n.scrollLeft!=null&&Pr(e,n.scrollLeft)}function Ma(e,t){var n=e.display,r=rn(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:n.scroller.scrollTop,u=ba(e),d={};t.bottom-t.top>u&&(t.bottom=t.top+u);var g=e.doc.height+ma(n),v=t.topg-r;if(t.topi+u){var w=Math.min(t.top,(m?g:t.bottom)-u);w!=i&&(d.scrollTop=w)}var k=e.options.fixedGutter?0:n.gutters.offsetWidth,B=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:n.scroller.scrollLeft-k,M=Br(e)-n.gutters.offsetWidth,H=t.right-t.left>M;return H&&(t.right=t.left+M),t.left<10?d.scrollLeft=0:t.leftM+B-3&&(d.scrollLeft=t.right+(H?0:10)-M),d}function _a(e,t){t!=null&&(Ri(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function an(e){Ri(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function qn(e,t,n){(t!=null||n!=null)&&Ri(e),t!=null&&(e.curOp.scrollLeft=t),n!=null&&(e.curOp.scrollTop=n)}function Id(e,t){Ri(e),e.curOp.scrollToPos=t}function Ri(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=Ls(e,t.from),r=Ls(e,t.to);zs(e,n,r,t.margin)}}function zs(e,t,n,r){var i=Ma(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});qn(e,i.scrollLeft,i.scrollTop)}function Un(e,t){Math.abs(e.doc.scrollTop-t)<2||(s||Na(e,{top:t}),Hs(e,t,!0),s&&Na(e),Xn(e,100))}function Hs(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),!(e.display.scroller.scrollTop==t&&!n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Pr(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),!((n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)&&(e.doc.scrollLeft=t,js(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function jn(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+ma(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Qt(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var zr=function(e,t,n){this.cm=n;var r=this.vert=E("div",[E("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=E("div",[E("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),fe(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),fe(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,c&&h<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};zr.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var u=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+u)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},zr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},zr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},zr.prototype.zeroWidthHack=function(){var e=P&&!_?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new ft,this.disableVert=new ft},zr.prototype.enableZeroWidthBar=function(e,t,n){e.style.visibility="";function r(){var i=e.getBoundingClientRect(),u=n=="vert"?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1);u!=e?e.style.visibility="hidden":t.set(1e3,r)}t.set(1e3,r)},zr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Gn=function(){};Gn.prototype.update=function(){return{bottom:0,right:0}},Gn.prototype.setScrollLeft=function(){},Gn.prototype.setScrollTop=function(){},Gn.prototype.clear=function(){};function ln(e,t){t||(t=jn(e));var n=e.display.barWidth,r=e.display.barHeight;Rs(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&zi(e),Rs(e,jn(e)),n=e.display.barWidth,r=e.display.barHeight}function Rs(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}var Ws={native:zr,null:Gn};function qs(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&le(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Ws[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),fe(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,n){n=="horizontal"?Pr(e,t):Un(e,t)},e),e.display.scrollbars.addClass&&De(e.display.wrapper,e.display.scrollbars.addClass)}var Pd=0;function Hr(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Pd,markArrays:null},pd(e.curOp)}function Rr(e){var t=e.curOp;t&&vd(t,function(n){for(var r=0;r=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Wi(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Rd(e){e.updatedDisplay=e.mustUpdate&&Ba(e.cm,e.update)}function Wd(e){var t=e.cm,n=t.display;e.updatedDisplay&&zi(t),e.barMeasure=jn(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=ws(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Qt(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Br(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function qd(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)){var n=+new Date+e.options.workTime,r=On(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(u){if(r.line>=e.display.viewFrom){var d=u.styles,g=u.text.length>e.options.maxHighlightLength?Lr(t.mode,r.state):null,v=Ql(e,u,r,!0);g&&(r.state=g),u.styles=v.styles;var m=u.styleClasses,w=v.classes;w?u.styleClasses=w:m&&(u.styleClasses=null);for(var k=!d||d.length!=u.styles.length||m!=w&&(!m||!w||m.bgClass!=w.bgClass||m.textClass!=w.textClass),B=0;!k&&Bn)return Xn(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&kt(e,function(){for(var u=0;u=n.viewFrom&&t.visible.to<=n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&Ns(e)==0)return!1;Gs(e)&&(br(e),t.dims=ka(e));var i=r.first+r.size,u=Math.max(t.visible.from-e.options.viewportMargin,r.first),d=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFromd&&n.viewTo-d<20&&(d=Math.min(i,n.viewTo)),rr&&(u=ha(e.doc,u),d=fs(e.doc,d));var g=u!=n.viewFrom||d!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Md(e,u,d),n.viewOffset=nr(oe(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var v=Ns(e);if(!g&&v==0&&!t.force&&n.renderedView==n.view&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo))return!1;var m=Xd(e);return v>4&&(n.lineDiv.style.display="none"),Yd(e,n.updateLineNumbers,t.dims),v>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,Kd(m),ie(n.cursorDiv),ie(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,g&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,Xn(e,400)),n.updateLineNumbers=null,!0}function Us(e,t){for(var n=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==Br(e)){if(n&&n.top!=null&&(n={top:Math.min(e.doc.height+ma(e.display)-ba(e),n.top)}),t.visible=Hi(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=Hi(e.display,e.doc,n));if(!Ba(e,t))break;zi(e);var i=jn(e);Wn(e),ln(e,i),Ia(e,i),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Na(e,t){var n=new Wi(e,t);if(Ba(e,n)){zi(e),Us(e,n);var r=jn(e);Wn(e),ln(e,r),Ia(e,r),n.finish()}}function Yd(e,t,n){var r=e.display,i=e.options.lineNumbers,u=r.lineDiv,d=u.firstChild;function g(H){var W=H.nextSibling;return b&&P&&e.display.currentWheelTarget==H?H.style.display="none":H.parentNode.removeChild(H),W}for(var v=r.view,m=r.viewFrom,w=0;w-1&&(M=!1),gs(e,k,m,n)),M&&(ie(k.lineNumber),k.lineNumber.appendChild(document.createTextNode(aa(e.options,m)))),d=k.node.nextSibling}m+=k.size}for(;d;)d=g(d)}function Oa(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",et(e,"gutterChanged",e)}function Ia(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Qt(e)+"px"}function js(e){var t=e.display,n=t.view;if(!(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))){for(var r=Sa(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,u=r+"px",d=0;dg.clientWidth,m=g.scrollHeight>g.clientHeight;if(r&&v||i&&m){if(i&&P&&b){e:for(var w=t.target,k=d.view;w!=g;w=w.parentNode)for(var B=0;B=0&&ge(e,r.to())<=0)return n}return-1};var Ee=function(e,t){this.anchor=e,this.head=t};Ee.prototype.from=function(){return Si(this.anchor,this.head)},Ee.prototype.to=function(){return ki(this.anchor,this.head)},Ee.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function qt(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort(function(B,M){return ge(B.from(),M.from())}),n=Be(t,i);for(var u=1;u0:v>=0){var m=Si(g.from(),d.from()),w=ki(g.to(),d.to()),k=g.empty()?d.from()==d.head:g.from()==g.head;u<=n&&--n,t.splice(--u,2,new Ee(k?w:m,k?m:w))}}return new Mt(t,n)}function yr(e,t){return new Mt([new Ee(e,t||e)],0)}function xr(e){return e.text?G(e.from.line+e.text.length-1,we(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Zs(e,t){if(ge(e,t.from)<0)return e;if(ge(e,t.to)<=0)return xr(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=xr(t).ch-t.to.ch),G(n,r)}function za(e,t){for(var n=[],r=0;r1&&e.remove(g.line+1,H-1),e.insert(g.line+1,Q)}et(e,"change",e,t)}function Dr(e,t,n){function r(i,u,d){if(i.linked)for(var g=0;g1&&!e.done[e.done.length-2].ranges)return e.done.pop(),we(e.done)}function tu(e,t,n,r){var i=e.history;i.undone.length=0;var u=+new Date,d,g;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&i.lastModTime>u-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(d=Vd(i,i.lastOp==r)))g=we(d.changes),ge(t.from,t.to)==0&&ge(t.from,g.to)==0?g.to=xr(t):d.changes.push(Wa(e,t));else{var v=we(i.done);for((!v||!v.ranges)&&ji(e.sel,i.done),d={changes:[Wa(e,t)],generation:i.generation},i.done.push(d);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=u,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,g||je(e,"historyAdded")}function eh(e,t,n,r){var i=t.charAt(0);return i=="*"||i=="+"&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function th(e,t,n,r){var i=e.history,u=r&&r.origin;n==i.lastSelOp||u&&i.lastSelOrigin==u&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==u||eh(e,u,we(i.done),t))?i.done[i.done.length-1]=t:ji(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=u,i.lastSelOp=n,r&&r.clearRedo!==!1&&eu(i.undone)}function ji(e,t){var n=we(t);n&&n.ranges&&n.equals(e)||t.push(e)}function ru(e,t,n,r){var i=t["spans_"+e.id],u=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(d){d.markedSpans&&((i||(i=t["spans_"+e.id]={}))[u]=d.markedSpans),++u})}function rh(e){if(!e)return null;for(var t,n=0;n-1&&(we(g)[k]=m[k],delete m[k])}}return r}function qa(e,t,n,r){if(r){var i=e.anchor;if(n){var u=ge(t,i)<0;u!=ge(n,i)<0?(i=t,t=n):u!=ge(t,n)<0&&(t=n)}return new Ee(i,t)}else return new Ee(n||t,t)}function Gi(e,t,n,r,i){i==null&&(i=e.cm&&(e.cm.display.shift||e.extend)),lt(e,new Mt([qa(e.sel.primary(),t,n,i)],0),r)}function iu(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),u=0;u=t.ch:g.to>t.ch))){if(i&&(je(v,"beforeCursorEnter"),v.explicitlyCleared))if(u.markedSpans){--d;continue}else break;if(!v.atomic)continue;if(n){var k=v.find(r<0?1:-1),B=void 0;if((r<0?w:m)&&(k=fu(e,k,-r,k&&k.line==t.line?u:null)),k&&k.line==t.line&&(B=ge(k,n))&&(r<0?B<0:B>0))return un(e,k,t,r,i)}var M=v.find(r<0?-1:1);return(r<0?m:w)&&(M=fu(e,M,r,M.line==t.line?u:null)),M?un(e,M,t,r,i):null}}return t}function Ki(e,t,n,r,i){var u=r||1,d=un(e,t,n,u,i)||!i&&un(e,t,n,u,!0)||un(e,t,n,-u,i)||!i&&un(e,t,n,-u,!0);return d||(e.cantEdit=!0,G(e.first,0))}function fu(e,t,n,r){return n<0&&t.ch==0?t.line>e.first?ve(e,G(t.line-1)):null:n>0&&t.ch==(r||oe(e,t.line)).text.length?t.line=0;--i)hu(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else hu(e,t)}}function hu(e,t){if(!(t.text.length==1&&t.text[0]==""&&ge(t.from,t.to)==0)){var n=za(e,t);tu(e,t,n,e.cm?e.cm.curOp.id:NaN),Zn(e,t,n,ca(e,t));var r=[];Dr(e,function(i,u){!u&&Be(r,i.history)==-1&&(mu(i.history,t),r.push(i.history)),Zn(i,t,null,ca(i,t))})}}function Yi(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!(r&&!n)){for(var i=e.history,u,d=e.sel,g=t=="undo"?i.done:i.undone,v=t=="undo"?i.undone:i.done,m=0;m=0;--M){var H=B(M);if(H)return H.v}}}}function pu(e,t){if(t!=0&&(e.first+=t,e.sel=new Mt(Ht(e.sel.ranges,function(i){return new Ee(G(i.anchor.line+t,i.anchor.ch),G(i.head.line+t,i.head.ch))}),e.sel.primIndex),e.cm)){bt(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;re.lastLine())){if(t.from.lineu&&(t={from:t.from,to:G(u,oe(e,u).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Mr(e,t.from,t.to),n||(n=za(e,t)),e.cm?oh(e.cm,t,r):Ra(e,t,r),Xi(e,n,vt),e.cantEdit&&Ki(e,G(e.firstLine(),0))&&(e.cantEdit=!1)}}function oh(e,t,n){var r=e.doc,i=e.display,u=t.from,d=t.to,g=!1,v=u.line;e.options.lineWrapping||(v=Ae(Rt(oe(r,u.line))),r.iter(v,d.line+1,function(M){if(M==i.maxLine)return g=!0,!0})),r.sel.contains(t.from,t.to)>-1&&jl(e),Ra(r,t,n,Bs(e)),e.options.lineWrapping||(r.iter(v,u.line+t.text.length,function(M){var H=Mi(M);H>i.maxLineLength&&(i.maxLine=M,i.maxLineLength=H,i.maxLineChanged=!0,g=!1)}),g&&(e.curOp.updateMaxLine=!0)),Yc(r,u.line),Xn(e,400);var m=t.text.length-(d.line-u.line)-1;t.full?bt(e):u.line==d.line&&t.text.length==1&&!Js(e.doc,t)?mr(e,u.line,"text"):bt(e,u.line,d.line+1,m);var w=It(e,"changes"),k=It(e,"change");if(k||w){var B={from:u,to:d,text:t.text,removed:t.removed,origin:t.origin};k&&et(e,"change",e,B),w&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(B)}e.display.selForContextMenu=null}function cn(e,t,n,r,i){var u;r||(r=n),ge(r,n)<0&&(u=[r,n],n=u[0],r=u[1]),typeof t=="string"&&(t=e.splitLines(t)),fn(e,{from:n,to:r,text:t,origin:i})}function gu(e,t,n,r){n1||!(this.children[0]instanceof Jn))){var g=[];this.collapse(g),this.children=[new Jn(g)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var d=i.lines.length%25+25,g=d;g10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;re.display.maxLineLength&&(e.display.maxLine=m,e.display.maxLineLength=w,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&bt(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&su(e.doc)),e&&et(e,"markerCleared",e,this,r,i),t&&Rr(e),this.parent&&this.parent.clear()}},wr.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var n,r,i=0;i0||d==0&&u.clearWhenEmpty!==!1)return u;if(u.replacedWith&&(u.collapsed=!0,u.widgetNode=z("span",[u.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||u.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(u.widgetNode.insertLeft=!0)),u.collapsed){if(us(e,t.line,t,n,u)||t.line!=n.line&&us(e,n.line,t,n,u))throw new Error("Inserting collapsed marker partially overlapping an existing one");Qc()}u.addToHistory&&tu(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var g=t.line,v=e.cm,m;if(e.iter(g,n.line+1,function(k){v&&u.collapsed&&!v.options.lineWrapping&&Rt(k)==v.display.maxLine&&(m=!0),u.collapsed&&g!=t.line&&Yt(k,0),$c(k,new Ai(u,g==t.line?t.ch:null,g==n.line?n.ch:null),e.cm&&e.cm.curOp),++g}),u.collapsed&&e.iter(t.line,n.line+1,function(k){vr(e,k)&&Yt(k,0)}),u.clearOnEnter&&fe(u,"beforeCursorEnter",function(){return u.clear()}),u.readOnly&&(Zc(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),u.collapsed&&(u.id=++yu,u.atomic=!0),v){if(m&&(v.curOp.updateMaxLine=!0),u.collapsed)bt(v,t.line,n.line+1);else if(u.className||u.startStyle||u.endStyle||u.css||u.attributes||u.title)for(var w=t.line;w<=n.line;w++)mr(v,w,"text");u.atomic&&su(v.doc),et(v,"markerAdded",v,u)}return u}var ei=function(e,t){this.markers=e,this.primary=t;for(var n=0;n=0;v--)fn(this,r[v]);g?au(this,g):this.cm&&an(this.cm)}),undo:rt(function(){Yi(this,"undo")}),redo:rt(function(){Yi(this,"redo")}),undoSelection:rt(function(){Yi(this,"undo",!0)}),redoSelection:rt(function(){Yi(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=ve(this,e),t=ve(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(u){var d=u.markedSpans;if(d)for(var g=0;g=v.to||v.from==null&&i!=e.line||v.from!=null&&i==t.line&&v.from>=t.ch)&&(!n||n(v.marker))&&r.push(v.marker.parent||v.marker)}++i}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;re)return t=e,!0;e-=u,++n}),ve(this,G(n,t))},indexFromPos:function(e){e=ve(this,e);var t=e.ch;if(e.linet&&(t=e.from),e.to!=null&&e.to-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var w=e.dataTransfer.getData("Text");if(w){var k;if(t.state.draggingText&&!t.state.draggingText.copy&&(k=t.listSelections()),Xi(t.doc,yr(n,n)),k)for(var B=0;B=0;g--)cn(e.doc,"",r[g].from,r[g].to,"+delete");an(e)})}function ja(e,t,n){var r=ql(e.text,t+n,n);return r<0||r>e.text.length?null:r}function Ga(e,t,n){var r=ja(e,t.ch,n);return r==null?null:new G(t.line,r,n<0?"after":"before")}function Xa(e,t,n,r,i){if(e){t.doc.direction=="rtl"&&(i=-i);var u=tr(n,t.doc.direction);if(u){var d=i<0?we(u):u[0],g=i<0==(d.level==1),v=g?"after":"before",m;if(d.level>0||t.doc.direction=="rtl"){var w=tn(t,n);m=i<0?n.text.length-1:0;var k=Jt(t,w,m).top;m=Ln(function(B){return Jt(t,w,B).top==k},i<0==(d.level==1)?d.from:d.to-1,m),v=="before"&&(m=ja(n,m,1))}else m=i<0?d.to:d.from;return new G(r,m,v)}}return new G(r,i<0?n.text.length:0,i<0?"before":"after")}function yh(e,t,n,r){var i=tr(t,e.doc.direction);if(!i)return Ga(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var u=_n(i,n.ch,n.sticky),d=i[u];if(e.doc.direction=="ltr"&&d.level%2==0&&(r>0?d.to>n.ch:d.from=d.from&&B>=w.begin)){var M=k?"before":"after";return new G(n.line,B,M)}}var H=function(Q,V,J){for(var re=function(Te,nt){return nt?new G(n.line,g(Te,1),"before"):new G(n.line,Te,"after")};Q>=0&&Q0==(se.level!=1),xe=ae?J.begin:g(J.end,-1);if(se.from<=xe&&xe0?w.end:g(w.begin,-1);return Y!=null&&!(r>0&&Y==t.text.length)&&(W=H(r>0?0:i.length-1,r,m(Y)),W)?W:null}var ni={selectAll:cu,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),vt)},killLine:function(e){return pn(e,function(t){if(t.empty()){var n=oe(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line0)i=new G(i.line,i.ch+1),e.replaceRange(u.charAt(i.ch-1)+u.charAt(i.ch-2),G(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var d=oe(e.doc,i.line-1).text;d&&(i=new G(i.line,1),e.replaceRange(u.charAt(0)+e.doc.lineSeparator()+d.charAt(d.length-1),G(i.line-1,d.length-1),i,"+transpose"))}}n.push(new Ee(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){return kt(e,function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;re&&ge(t,this.pos)==0&&n==this.button};var oi,ai;function Eh(e,t){var n=+new Date;return ai&&ai.compare(n,e,t)?(oi=ai=null,"triple"):oi&&oi.compare(n,e,t)?(ai=new Ya(n,e,t),oi=null,"double"):(oi=new Ya(n,e,t),ai=null,"single")}function Ou(e){var t=this,n=t.display;if(!(Ve(t,e)||n.activeTouch&&n.input.supportsTouch())){if(n.input.ensurePolled(),n.shift=e.shiftKey,ir(n,e)){b||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));return}if(!Za(t,e)){var r=Or(t,e),i=Xl(e),u=r?Eh(r,i):"single";ye(t).focus(),i==1&&t.state.selectingText&&t.state.selectingText(e),!(r&&Ah(t,i,r,u,e))&&(i==1?r?Th(t,r,u,e):Jo(e)==n.scroller&&mt(e):i==2?(r&&Gi(t.doc,r),setTimeout(function(){return n.input.focus()},20)):i==3&&(me?t.display.input.onContextMenu(e):Ta(t)))}}}function Ah(e,t,n,r,i){var u="Click";return r=="double"?u="Double"+u:r=="triple"&&(u="Triple"+u),u=(t==1?"Left":t==2?"Middle":"Right")+u,ii(e,Eu(u,i),i,function(d){if(typeof d=="string"&&(d=ni[d]),!d)return!1;var g=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),g=d(e,n)!=Ze}finally{e.state.suppressEdits=!1}return g})}function Fh(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(i.unit==null){var u=I?n.shiftKey&&n.metaKey:n.altKey;i.unit=u?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(i.extend==null||e.doc.extend)&&(i.extend=e.doc.extend||n.shiftKey),i.addNew==null&&(i.addNew=P?n.metaKey:n.ctrlKey),i.moveOnDrag==null&&(i.moveOnDrag=!(P?n.altKey:n.ctrlKey)),i}function Th(e,t,n,r){c?setTimeout(gt(Is,e),0):e.curOp.focus=ue(ee(e));var i=Fh(e,n,r),u=e.doc.sel,d;e.options.dragDrop&&Pc&&!e.isReadOnly()&&n=="single"&&(d=u.contains(t))>-1&&(ge((d=u.ranges[d]).from(),t)<0||t.xRel>0)&&(ge(d.to(),t)>0||t.xRel<0)?Lh(e,r,t,i):Mh(e,r,t,i)}function Lh(e,t,n,r){var i=e.display,u=!1,d=tt(e,function(m){b&&(i.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:Ta(e)),Lt(i.wrapper.ownerDocument,"mouseup",d),Lt(i.wrapper.ownerDocument,"mousemove",g),Lt(i.scroller,"dragstart",v),Lt(i.scroller,"drop",d),u||(mt(m),r.addNew||Gi(e.doc,n,null,null,r.extend),b&&!F||c&&h==9?setTimeout(function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()},20):i.input.focus())}),g=function(m){u=u||Math.abs(t.clientX-m.clientX)+Math.abs(t.clientY-m.clientY)>=10},v=function(){return u=!0};b&&(i.scroller.draggable=!0),e.state.draggingText=d,d.copy=!r.moveOnDrag,fe(i.wrapper.ownerDocument,"mouseup",d),fe(i.wrapper.ownerDocument,"mousemove",g),fe(i.scroller,"dragstart",v),fe(i.scroller,"drop",d),e.state.delayingBlurEvent=!0,setTimeout(function(){return i.input.focus()},20),i.scroller.dragDrop&&i.scroller.dragDrop()}function Iu(e,t,n){if(n=="char")return new Ee(t,t);if(n=="word")return e.findWordAt(t);if(n=="line")return new Ee(G(t.line,0),ve(e.doc,G(t.line+1,0)));var r=n(e,t);return new Ee(r.from,r.to)}function Mh(e,t,n,r){c&&Ta(e);var i=e.display,u=e.doc;mt(t);var d,g,v=u.sel,m=v.ranges;if(r.addNew&&!r.extend?(g=u.sel.contains(n),g>-1?d=m[g]:d=new Ee(n,n)):(d=u.sel.primary(),g=u.sel.primIndex),r.unit=="rectangle")r.addNew||(d=new Ee(n,n)),n=Or(e,t,!0,!0),g=-1;else{var w=Iu(e,n,r.unit);r.extend?d=qa(d,w.anchor,w.head,r.extend):d=w}r.addNew?g==-1?(g=m.length,lt(u,qt(e,m.concat([d]),g),{scroll:!1,origin:"*mouse"})):m.length>1&&m[g].empty()&&r.unit=="char"&&!r.extend?(lt(u,qt(e,m.slice(0,g).concat(m.slice(g+1)),0),{scroll:!1,origin:"*mouse"}),v=u.sel):Ua(u,g,d,Tn):(g=0,lt(u,new Mt([d],0),Tn),v=u.sel);var k=n;function B(J){if(ge(k,J)!=0)if(k=J,r.unit=="rectangle"){for(var re=[],se=e.options.tabSize,ae=Ye(oe(u,n.line).text,n.ch,se),xe=Ye(oe(u,J.line).text,J.ch,se),Te=Math.min(ae,xe),nt=Math.max(ae,xe),Ie=Math.min(n.line,J.line),St=Math.min(e.lastLine(),Math.max(n.line,J.line));Ie<=St;Ie++){var xt=oe(u,Ie).text,Xe=Kt(xt,Te,se);Te==nt?re.push(new Ee(G(Ie,Xe),G(Ie,Xe))):xt.length>Xe&&re.push(new Ee(G(Ie,Xe),G(Ie,Kt(xt,nt,se))))}re.length||re.push(new Ee(n,n)),lt(u,qt(e,v.ranges.slice(0,g).concat(re),g),{origin:"*mouse",scroll:!1}),e.scrollIntoView(J)}else{var Dt=d,ot=Iu(e,J,r.unit),Qe=Dt.anchor,Ke;ge(ot.anchor,Qe)>0?(Ke=ot.head,Qe=Si(Dt.from(),ot.anchor)):(Ke=ot.anchor,Qe=ki(Dt.to(),ot.head));var He=v.ranges.slice(0);He[g]=_h(e,new Ee(ve(u,Qe),Ke)),lt(u,qt(e,He,g),Tn)}}var M=i.wrapper.getBoundingClientRect(),H=0;function W(J){var re=++H,se=Or(e,J,!0,r.unit=="rectangle");if(se)if(ge(se,k)!=0){e.curOp.focus=ue(ee(e)),B(se);var ae=Hi(i,u);(se.line>=ae.to||se.lineM.bottom?20:0;xe&&setTimeout(tt(e,function(){H==re&&(i.scroller.scrollTop+=xe,W(J))}),50)}}function Y(J){e.state.selectingText=!1,H=1/0,J&&(mt(J),i.input.focus()),Lt(i.wrapper.ownerDocument,"mousemove",Q),Lt(i.wrapper.ownerDocument,"mouseup",V),u.history.lastSelOrigin=null}var Q=tt(e,function(J){J.buttons===0||!Xl(J)?Y(J):W(J)}),V=tt(e,Y);e.state.selectingText=V,fe(i.wrapper.ownerDocument,"mousemove",Q),fe(i.wrapper.ownerDocument,"mouseup",V)}function _h(e,t){var n=t.anchor,r=t.head,i=oe(e.doc,n.line);if(ge(n,r)==0&&n.sticky==r.sticky)return t;var u=tr(i);if(!u)return t;var d=_n(u,n.ch,n.sticky),g=u[d];if(g.from!=n.ch&&g.to!=n.ch)return t;var v=d+(g.from==n.ch==(g.level!=1)?0:1);if(v==0||v==u.length)return t;var m;if(r.line!=n.line)m=(r.line-n.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var w=_n(u,r.ch,r.sticky),k=w-d||(r.ch-n.ch)*(g.level==1?-1:1);w==v-1||w==v?m=k<0:m=k>0}var B=u[v+(m?-1:0)],M=m==(B.level==1),H=M?B.from:B.to,W=M?"after":"before";return n.ch==H&&n.sticky==W?t:new Ee(new G(n.line,H,W),r)}function Pu(e,t,n,r){var i,u;if(t.touches)i=t.touches[0].clientX,u=t.touches[0].clientY;else try{i=t.clientX,u=t.clientY}catch{return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&mt(t);var d=e.display,g=d.lineDiv.getBoundingClientRect();if(u>g.bottom||!It(e,n))return Qo(t);u-=g.top-d.viewOffset;for(var v=0;v=i){var w=_r(e.doc,u),k=e.display.gutterSpecs[v];return je(e,n,e,w,k.className,t),Qo(t)}}}function Za(e,t){return Pu(e,t,"gutterClick",!0)}function zu(e,t){ir(e.display,t)||Bh(e,t)||Ve(e,t,"contextmenu")||me||e.display.input.onContextMenu(t)}function Bh(e,t){return It(e,"gutterContextMenu")?Pu(e,t,"gutterContextMenu",!1):!1}function Hu(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Rn(e)}var gn={toString:function(){return"CodeMirror.Init"}},Ru={},$i={};function Nh(e){var t=e.optionHandlers;function n(r,i,u,d){e.defaults[r]=i,u&&(t[r]=d?function(g,v,m){m!=gn&&u(g,v,m)}:u)}e.defineOption=n,e.Init=gn,n("value","",function(r,i){return r.setValue(i)},!0),n("mode",null,function(r,i){r.doc.modeOption=i,Ha(r)},!0),n("indentUnit",2,Ha,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,function(r){Yn(r),Rn(r),bt(r)},!0),n("lineSeparator",null,function(r,i){if(r.doc.lineSep=i,!!i){var u=[],d=r.doc.first;r.doc.iter(function(v){for(var m=0;;){var w=v.text.indexOf(i,m);if(w==-1)break;m=w+i.length,u.push(G(d,w))}d++});for(var g=u.length-1;g>=0;g--)cn(r.doc,i,u[g],G(u[g].line,u[g].ch+i.length))}}),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(r,i,u){r.state.specialChars=new RegExp(i.source+(i.test(" ")?"":"| "),"g"),u!=gn&&r.refresh()}),n("specialCharPlaceholder",ud,function(r){return r.refresh()},!0),n("electricChars",!0),n("inputStyle",N?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),n("spellcheck",!1,function(r,i){return r.getInputField().spellcheck=i},!0),n("autocorrect",!1,function(r,i){return r.getInputField().autocorrect=i},!0),n("autocapitalize",!1,function(r,i){return r.getInputField().autocapitalize=i},!0),n("rtlMoveVisually",!q),n("wholeLineUpdateBefore",!0),n("theme","default",function(r){Hu(r),Kn(r)},!0),n("keyMap","default",function(r,i,u){var d=Qi(i),g=u!=gn&&Qi(u);g&&g.detach&&g.detach(r,d),d.attach&&d.attach(r,g||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Ih,!0),n("gutters",[],function(r,i){r.display.gutterSpecs=Pa(i,r.options.lineNumbers),Kn(r)},!0),n("fixedGutter",!0,function(r,i){r.display.gutters.style.left=i?Sa(r.display)+"px":"0",r.refresh()},!0),n("coverGutterNextToScrollbar",!1,function(r){return ln(r)},!0),n("scrollbarStyle","native",function(r){qs(r),ln(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),n("lineNumbers",!1,function(r,i){r.display.gutterSpecs=Pa(r.options.gutters,i),Kn(r)},!0),n("firstLineNumber",1,Kn,!0),n("lineNumberFormatter",function(r){return r},Kn,!0),n("showCursorWhenSelecting",!1,Wn,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,function(r,i){i=="nocursor"&&(on(r),r.display.input.blur()),r.display.input.readOnlyChanged(i)}),n("screenReaderLabel",null,function(r,i){i=i===""?null:i,r.display.input.screenReaderLabelChanged(i)}),n("disableInput",!1,function(r,i){i||r.display.input.reset()},!0),n("dragDrop",!0,Oh),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,Wn,!0),n("singleCursorHeightPerLine",!0,Wn,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,Yn,!0),n("addModeClass",!1,Yn,!0),n("pollInterval",100),n("undoDepth",200,function(r,i){return r.doc.history.undoDepth=i}),n("historyEventDelay",1250),n("viewportMargin",10,function(r){return r.refresh()},!0),n("maxHighlightLength",1e4,Yn,!0),n("moveInputWithCursor",!0,function(r,i){i||r.display.input.resetPosition()}),n("tabindex",null,function(r,i){return r.display.input.getField().tabIndex=i||""}),n("autofocus",null),n("direction","ltr",function(r,i){return r.doc.setDirection(i)},!0),n("phrases",null)}function Oh(e,t,n){var r=n&&n!=gn;if(!t!=!r){var i=e.display.dragFunctions,u=t?fe:Lt;u(e.display.scroller,"dragstart",i.start),u(e.display.scroller,"dragenter",i.enter),u(e.display.scroller,"dragover",i.over),u(e.display.scroller,"dragleave",i.leave),u(e.display.scroller,"drop",i.drop)}}function Ih(e){e.options.lineWrapping?(De(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(le(e.display.wrapper,"CodeMirror-wrap"),ga(e)),Ea(e),bt(e),Rn(e),setTimeout(function(){return ln(e)},100)}function Ne(e,t){var n=this;if(!(this instanceof Ne))return new Ne(e,t);this.options=t=t?Tt(t):{},Tt(Ru,t,!1);var r=t.value;typeof r=="string"?r=new yt(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new Ne.inputStyles[t.inputStyle](this),u=this.display=new Zd(e,r,i,t);u.wrapper.CodeMirror=this,Hu(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),qs(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new ft,keySeq:null,specialChars:null},t.autofocus&&!N&&u.input.focus(),c&&h<11&&setTimeout(function(){return n.display.input.reset(!0)},20),Ph(this),ph(),Hr(this),this.curOp.forceUpdate=!0,$s(this,r),t.autofocus&&!N||this.hasFocus()?setTimeout(function(){n.hasFocus()&&!n.state.focused&&La(n)},20):on(this);for(var d in $i)$i.hasOwnProperty(d)&&$i[d](this,t[d],gn);Gs(this),t.finishInit&&t.finishInit(this);for(var g=0;g20*20}fe(t.scroller,"touchstart",function(v){if(!Ve(e,v)&&!u(v)&&!Za(e,v)){t.input.ensurePolled(),clearTimeout(n);var m=+new Date;t.activeTouch={start:m,moved:!1,prev:m-r.end<=300?r:null},v.touches.length==1&&(t.activeTouch.left=v.touches[0].pageX,t.activeTouch.top=v.touches[0].pageY)}}),fe(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),fe(t.scroller,"touchend",function(v){var m=t.activeTouch;if(m&&!ir(t,v)&&m.left!=null&&!m.moved&&new Date-m.start<300){var w=e.coordsChar(t.activeTouch,"page"),k;!m.prev||d(m,m.prev)?k=new Ee(w,w):!m.prev.prev||d(m,m.prev.prev)?k=e.findWordAt(w):k=new Ee(G(w.line,0),ve(e.doc,G(w.line+1,0))),e.setSelection(k.anchor,k.head),e.focus(),mt(v)}i()}),fe(t.scroller,"touchcancel",i),fe(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Un(e,t.scroller.scrollTop),Pr(e,t.scroller.scrollLeft,!0),je(e,"scroll",e))}),fe(t.scroller,"mousewheel",function(v){return Ys(e,v)}),fe(t.scroller,"DOMMouseScroll",function(v){return Ys(e,v)}),fe(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(v){Ve(e,v)||Bn(v)},over:function(v){Ve(e,v)||(hh(e,v),Bn(v))},start:function(v){return dh(e,v)},drop:tt(e,ch),leave:function(v){Ve(e,v)||wu(e)}};var g=t.input.getField();fe(g,"keyup",function(v){return Bu.call(e,v)}),fe(g,"keydown",tt(e,_u)),fe(g,"keypress",tt(e,Nu)),fe(g,"focus",function(v){return La(e,v)}),fe(g,"blur",function(v){return on(e,v)})}var Qa=[];Ne.defineInitHook=function(e){return Qa.push(e)};function li(e,t,n,r){var i=e.doc,u;n==null&&(n="add"),n=="smart"&&(i.mode.indent?u=On(e,t).state:n="prev");var d=e.options.tabSize,g=oe(i,t),v=Ye(g.text,null,d);g.stateAfter&&(g.stateAfter=null);var m=g.text.match(/^\s*/)[0],w;if(!r&&!/\S/.test(g.text))w=0,n="not";else if(n=="smart"&&(w=i.mode.indent(u,g.text.slice(m.length),g.text),w==Ze||w>150)){if(!r)return;n="prev"}n=="prev"?t>i.first?w=Ye(oe(i,t-1).text,null,d):w=0:n=="add"?w=v+e.options.indentUnit:n=="subtract"?w=v-e.options.indentUnit:typeof n=="number"&&(w=v+n),w=Math.max(0,w);var k="",B=0;if(e.options.indentWithTabs)for(var M=Math.floor(w/d);M;--M)B+=d,k+=" ";if(Bd,v=ea(t),m=null;if(g&&r.ranges.length>1)if(Ut&&Ut.text.join(` +`)==t){if(r.ranges.length%Ut.text.length==0){m=[];for(var w=0;w=0;B--){var M=r.ranges[B],H=M.from(),W=M.to();M.empty()&&(n&&n>0?H=G(H.line,H.ch-n):e.state.overwrite&&!g?W=G(W.line,Math.min(oe(u,W.line).text.length,W.ch+we(v).length)):g&&Ut&&Ut.lineWise&&Ut.text.join(` `)==v.join(` -`)&&(O=P=q(O.line,0)));var j={from:O,to:P,text:m?m[M%m.length]:v,origin:n||(h?"paste":e.state.cutIncoming>u?"cut":"+input")};Mr(e.doc,j),qe(e,"inputRead",e,j)}t&&!h&&vs(e,t),Er(e),e.curOp.updateInput<2&&(e.curOp.updateInput=C),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function gs(e,t){var i=e.clipboardData&&e.clipboardData.getData("Text");if(i)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()&&ut(t,function(){return qo(t,i,0,null,"paste")}),!0}function vs(e,t){if(!(!e.options.electricChars||!e.options.smartIndent))for(var i=e.doc.sel,r=i.ranges.length-1;r>=0;r--){var n=i.ranges[r];if(!(n.head.ch>100||r&&i.ranges[r-1].head.line==n.head.line)){var a=e.getModeAt(n.head),u=!1;if(a.electricChars){for(var h=0;h-1){u=wi(e,n.head.line,"smart");break}}else a.electricInput&&a.electricInput.test(re(e.doc,n.head.line).text.slice(0,n.head.ch))&&(u=wi(e,n.head.line,"smart"));u&&qe(e,"electricInput",e,n.head.line)}}}function ms(e){for(var t=[],i=[],r=0;ra&&(wi(this,h.head.line,r,!0),a=h.head.line,u==this.doc.sel.primIndex&&Er(this));else{var v=h.from(),m=h.to(),x=Math.max(a,v.line);a=Math.min(this.lastLine(),m.line-(m.ch?0:1))+1;for(var C=x;C0&&Io(this.doc,u,new be(v,M[u].to()),rt)}}}),getTokenAt:function(r,n){return Aa(this,r,n)},getLineTokens:function(r,n){return Aa(this,q(r),n,!0)},getTokenTypeAt:function(r){r=ce(this.doc,r);var n=Sa(this,re(this.doc,r.line)),a=0,u=(n.length-1)/2,h=r.ch,v;if(h==0)v=n[2];else for(;;){var m=a+u>>1;if((m?n[m*2-1]:0)>=h)u=m;else if(n[m*2+1]v&&(r=v,u=!0),h=re(this.doc,r)}else h=r;return Pi(this,h,{top:0,left:0},n||"page",a||u).top+(u?this.doc.height-It(h):0)},defaultTextHeight:function(){return kr(this.display)},defaultCharWidth:function(){return Sr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,n,a,u,h){var v=this.display;r=wt(this,ce(this.doc,r));var m=r.bottom,x=r.left;if(n.style.position="absolute",n.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(n),v.sizer.appendChild(n),u=="over")m=r.top;else if(u=="above"||u=="near"){var C=Math.max(v.wrapper.clientHeight,this.doc.height),M=Math.max(v.sizer.clientWidth,v.lineSpace.clientWidth);(u=="above"||r.bottom+n.offsetHeight>C)&&r.top>n.offsetHeight?m=r.top-n.offsetHeight:r.bottom+n.offsetHeight<=C&&(m=r.bottom),x+n.offsetWidth>M&&(x=M-n.offsetWidth)}n.style.top=m+"px",n.style.left=n.style.right="",h=="right"?(x=v.sizer.clientWidth-n.offsetWidth,n.style.right="0px"):(h=="left"?x=0:h=="middle"&&(x=(v.sizer.clientWidth-n.offsetWidth)/2),n.style.left=x+"px"),a&&Hf(this,{left:x,top:m,right:x+n.offsetWidth,bottom:m+n.offsetHeight})},triggerOnKeyDown:$e(as),triggerOnKeyPress:$e(ss),triggerOnKeyUp:ls,triggerOnMouseDown:$e(us),execCommand:function(r){if(yi.hasOwnProperty(r))return yi[r].call(null,this)},triggerElectric:$e(function(r){vs(this,r)}),findPosH:function(r,n,a,u){var h=1;n<0&&(h=-1,n=-n);for(var v=ce(this.doc,r),m=0;m0&&x(a.charAt(u-1));)--u;for(;h.5||this.options.lineWrapping)&&mo(this),Ie(this,"refresh",this)}),swapDoc:$e(function(r){var n=this.doc;return n.cm=null,this.state.selectingText&&this.state.selectingText(),Fl(this,r),ti(this),this.display.input.reset(),ii(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,qe(this,"swapDoc",this,n),n}),phrase:function(r){var n=this.options.phrases;return n&&Object.prototype.hasOwnProperty.call(n,r)?n[r]:r},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},yr(e),e.registerHelper=function(r,n,a){i.hasOwnProperty(r)||(i[r]=e[r]={_global:[]}),i[r][n]=a},e.registerGlobalHelper=function(r,n,a,u){e.registerHelper(r,n,u),i[r]._global.push({pred:a,val:u})}}function jo(e,t,i,r,n){var a=t,u=i,h=re(e,t.line),v=n&&e.direction=="rtl"?-i:i;function m(){var Q=t.line+v;return Q=e.first+e.size?!1:(t=new q(Q,t.ch,t.sticky),h=re(e,Q))}function x(Q){var Z;if(r=="codepoint"){var $=h.text.charCodeAt(t.ch+(i>0?0:-1));if(isNaN($))Z=null;else{var ne=i>0?$>=55296&&$<56320:$>=56320&&$<57343;Z=new q(t.line,Math.max(0,Math.min(h.text.length,t.ch+i*(ne?2:1))),-i)}}else n?Z=Dc(e.cm,h,t,i):Z=Oo(h,t,i);if(Z==null)if(!Q&&m())t=Ho(n,e.cm,h,t.line,v);else return!1;else t=Z;return!0}if(r=="char"||r=="codepoint")x();else if(r=="column")x(!0);else if(r=="word"||r=="group")for(var C=null,M=r=="group",E=e.cm&&e.cm.getHelper(t,"wordChars"),O=!0;!(i<0&&!x(!O));O=!1){var P=h.text.charAt(t.ch)||` -`,j=Ei(P,E)?"w":M&&P==` -`?"n":!M||/\s/.test(P)?null:"p";if(M&&!O&&!j&&(j="s"),C&&C!=j){i<0&&(i=1,x(),t.sticky="after");break}if(j&&(C=j),i>0&&!x(!O))break}var Y=$i(e,t,a,u,!0);return Jn(a,Y)&&(Y.hitSide=!0),Y}function bs(e,t,i,r){var n=e.doc,a=t.left,u;if(r=="page"){var h=Math.min(e.display.wrapper.clientHeight,he(e).innerHeight||n(e).documentElement.clientHeight),v=Math.max(h-.5*kr(e.display),3);u=(i>0?t.bottom:t.top)+i*v}else r=="line"&&(u=i>0?t.bottom+3:t.top-3);for(var m;m=ho(e,a,u),!!m.outside;){if(i<0?u<=0:u>=n.height){m.hitSide=!0;break}u+=i*5}return m}var De=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Je,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};De.prototype.init=function(e){var t=this,i=this,r=i.cm,n=i.div=e.lineDiv;n.contentEditable=!0,Uo(n,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function a(h){for(var v=h.target;v;v=v.parentNode){if(v==n)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(v.className))break}return!1}oe(n,"paste",function(h){!a(h)||We(r,h)||gs(h,r)||p<=11&&setTimeout(Ue(r,function(){return t.updateFromDOM()}),20)}),oe(n,"compositionstart",function(h){t.composing={data:h.data,done:!1}}),oe(n,"compositionupdate",function(h){t.composing||(t.composing={data:h.data,done:!1})}),oe(n,"compositionend",function(h){t.composing&&(h.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),oe(n,"touchstart",function(){return i.forceCompositionEnd()}),oe(n,"input",function(){t.composing||t.readFromDOMSoon()});function u(h){if(!(!a(h)||We(r,h))){if(r.somethingSelected())on({lineWise:!1,text:r.getSelections()}),h.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var v=ms(r);on({lineWise:!0,text:v.text}),h.type=="cut"&&r.operation(function(){r.setSelections(v.ranges,0,rt),r.replaceSelection("",null,"cut")})}else return;if(h.clipboardData){h.clipboardData.clearData();var m=kt.text.join(` -`);if(h.clipboardData.setData("Text",m),h.clipboardData.getData("Text")==m){h.preventDefault();return}}var x=ys(),C=x.firstChild;Uo(C),r.display.lineSpace.insertBefore(x,r.display.lineSpace.firstChild),C.value=kt.text.join(` -`);var M=ve(ye(n));k(C),setTimeout(function(){r.display.lineSpace.removeChild(x),M.focus(),M==n&&i.showPrimarySelection()},50)}}oe(n,"copy",u),oe(n,"cut",u)},De.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},De.prototype.prepareSelection=function(){var e=ul(this.cm,!1);return e.focus=ve(ye(this.div))==this.div,e},De.prototype.showSelection=function(e,t){!e||!this.cm.display.view.length||((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},De.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},De.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,i=t.doc.sel.primary(),r=i.from(),n=i.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||n.line=t.display.viewFrom&&xs(t,r)||{node:h[0].measure.map[2],offset:0},m=n.linee.firstLine()&&(r=q(r.line-1,re(e.doc,r.line-1).length)),n.ch==re(e.doc,n.line).text.length&&n.linet.viewTo-1)return!1;var a,u,h;r.line==t.viewFrom||(a=lr(e,r.line))==0?(u=xe(t.view[0].line),h=t.view[0].node):(u=xe(t.view[a].line),h=t.view[a-1].node.nextSibling);var v=lr(e,n.line),m,x;if(v==t.view.length-1?(m=t.viewTo-1,x=t.lineDiv.lastChild):(m=xe(t.view[v+1].line)-1,x=t.view[v+1].node.previousSibling),!h)return!1;for(var C=e.doc.splitLines(qc(e,h,x,u,m)),M=rr(e.doc,q(u,0),q(m,re(e.doc,m).text.length));C.length>1&&M.length>1;)if(me(C)==me(M))C.pop(),M.pop(),m--;else if(C[0]==M[0])C.shift(),M.shift(),u++;else break;for(var E=0,O=0,P=C[0],j=M[0],Y=Math.min(P.length,j.length);Er.ch&&Q.charCodeAt(Q.length-O-1)==Z.charCodeAt(Z.length-O-1);)E--,O++;C[C.length-1]=Q.slice(0,Q.length-O).replace(/^\u200b+/,""),C[0]=C[0].slice(E).replace(/\u200b+$/,"");var ne=q(u,E),ie=q(m,M.length?me(M).length-O:0);if(C.length>1||C[0]||fe(ne,ie))return Br(e.doc,C,ne,ie,"+input"),!0},De.prototype.ensurePolled=function(){this.forceCompositionEnd()},De.prototype.reset=function(){this.forceCompositionEnd()},De.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},De.prototype.readFromDOMSoon=function(){var e=this;this.readDOMTimeout==null&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80))},De.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&ut(this.cm,function(){return nt(e.cm)})},De.prototype.setUneditable=function(e){e.contentEditable="false"},De.prototype.onKeyPress=function(e){e.charCode==0||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Ue(this.cm,qo)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0))},De.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},De.prototype.onContextMenu=function(){},De.prototype.resetPosition=function(){},De.prototype.needsContentAttribute=!0;function xs(e,t){var i=uo(e,t.line);if(!i||i.hidden)return null;var r=re(e.doc,t.line),n=Za(i,r,t.line),a=Bt(r,e.doc.direction),u="left";if(a){var h=Xr(a,t.ch);u=h%2?"right":"left"}var v=$a(n.map,t.ch,u);return v.offset=v.collapse=="right"?v.end:v.start,v}function Wc(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Hr(e,t){return t&&(e.bad=!0),e}function qc(e,t,i,r,n){var a="",u=!1,h=e.doc.lineSeparator(),v=!1;function m(E){return function(O){return O.id==E}}function x(){u&&(a+=h,v&&(a+=h),u=v=!1)}function C(E){E&&(x(),a+=E)}function M(E){if(E.nodeType==1){var O=E.getAttribute("cm-text");if(O){C(O);return}var P=E.getAttribute("cm-marker"),j;if(P){var Y=e.findMarks(q(r,0),q(n+1,0),m(+P));Y.length&&(j=Y[0].find(0))&&C(rr(e.doc,j.from,j.to).join(h));return}if(E.getAttribute("contenteditable")=="false")return;var Q=/^(pre|div|p|li|table|br)$/i.test(E.nodeName);if(!/^br$/i.test(E.nodeName)&&E.textContent.length==0)return;Q&&x();for(var Z=0;Z=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),oe(n,"paste",function(u){We(r,u)||gs(u,r)||(r.state.pasteIncoming=+new Date,i.fastPoll())});function a(u){if(!We(r,u)){if(r.somethingSelected())on({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var h=ms(r);on({lineWise:!0,text:h.text}),u.type=="cut"?r.setSelections(h.ranges,null,rt):(i.prevInput="",n.value=h.text.join(` -`),k(n))}else return;u.type=="cut"&&(r.state.cutIncoming=+new Date)}}oe(n,"cut",a),oe(n,"copy",a),oe(e.scroller,"paste",function(u){if(!(zt(e,u)||We(r,u))){if(!n.dispatchEvent){r.state.pasteIncoming=+new Date,i.focus();return}var h=new Event("paste");h.clipboardData=u.clipboardData,n.dispatchEvent(h)}}),oe(e.lineSpace,"selectstart",function(u){zt(e,u)||it(u)}),oe(n,"compositionstart",function(){var u=r.getCursor("from");i.composing&&i.composing.range.clear(),i.composing={start:u,range:r.markText(u,r.getCursor("to"),{className:"CodeMirror-composing"})}}),oe(n,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},Ne.prototype.createField=function(e){this.wrapper=ys(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;Uo(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},Ne.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Ne.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,r=ul(e);if(e.options.moveInputWithCursor){var n=wt(e,i.sel.primary().head,"div"),a=t.wrapper.getBoundingClientRect(),u=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,n.top+u.top-a.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,n.left+u.left-a.left))}return r},Ne.prototype.showSelection=function(e){var t=this.cm,i=t.display;de(i.cursorDiv,e.cursors),de(i.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Ne.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing&&e)){var t=this.cm;if(this.resetting=!0,t.somethingSelected()){this.prevInput="";var i=t.getSelection();this.textarea.value=i,t.state.focused&&k(this.textarea),d&&p>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",d&&p>=9&&(this.hasSelection=null));this.resetting=!1}},Ne.prototype.getField=function(){return this.textarea},Ne.prototype.supportsTouch=function(){return!1},Ne.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!I||ve(ye(this.textarea))!=this.textarea))try{this.textarea.focus()}catch{}},Ne.prototype.blur=function(){this.textarea.blur()},Ne.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Ne.prototype.receivedFocus=function(){this.slowPoll()},Ne.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},Ne.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function i(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,i)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,i)},Ne.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,r=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||Wu(i)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var n=i.value;if(n==r&&!t.somethingSelected())return!1;if(d&&p>=9&&this.hasSelection===n||R&&/[\uf700-\uf7ff]/.test(n))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var a=n.charCodeAt(0);if(a==8203&&!r&&(r="\u200B"),a==8666)return this.reset(),this.cm.execCommand("undo")}for(var u=0,h=Math.min(r.length,n.length);u1e3||n.indexOf(` -`)>-1?i.value=e.prevInput="":e.prevInput=n,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Ne.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Ne.prototype.onKeyPress=function(){d&&p>=9&&(this.hasSelection=null),this.fastPoll()},Ne.prototype.onContextMenu=function(e){var t=this,i=t.cm,r=i.display,n=t.textarea;t.contextMenuPending&&t.contextMenuPending();var a=ar(i,e),u=r.scroller.scrollTop;if(!a||F)return;var h=i.options.resetSelectionOnContextMenu;h&&i.doc.sel.contains(a)==-1&&Ue(i,Ze)(i.doc,Xt(a),rt);var v=n.style.cssText,m=t.wrapper.style.cssText,x=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",n.style.cssText=`position: absolute; width: 30px; height: 30px; - top: `+(e.clientY-x.top-5)+"px; left: "+(e.clientX-x.left-5)+`px; - z-index: 1000; background: `+(d?"rgba(255, 255, 255, .05)":"transparent")+`; - outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var C;y&&(C=n.ownerDocument.defaultView.scrollY),r.input.focus(),y&&n.ownerDocument.defaultView.scrollTo(null,C),r.input.reset(),i.somethingSelected()||(n.value=t.prevInput=" "),t.contextMenuPending=E,r.selForContextMenu=i.doc.sel,clearTimeout(r.detectingSelectAll);function M(){if(n.selectionStart!=null){var P=i.somethingSelected(),j="\u200B"+(P?n.value:"");n.value="\u21DA",n.value=j,t.prevInput=P?"":"\u200B",n.selectionStart=1,n.selectionEnd=j.length,r.selForContextMenu=i.doc.sel}}function E(){if(t.contextMenuPending==E&&(t.contextMenuPending=!1,t.wrapper.style.cssText=m,n.style.cssText=v,d&&p<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=u),n.selectionStart!=null)){(!d||d&&p<9)&&M();var P=0,j=function(){r.selForContextMenu==i.doc.sel&&n.selectionStart==0&&n.selectionEnd>0&&t.prevInput=="\u200B"?Ue(i,Pl)(i):P++<10?r.detectingSelectAll=setTimeout(j,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(j,200)}}if(d&&p>=9&&M(),ge){Yr(e);var O=function(){ht(window,"mouseup",O),setTimeout(E,20)};oe(window,"mouseup",O)}else setTimeout(E,50)},Ne.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Ne.prototype.setUneditable=function(){},Ne.prototype.needsContentAttribute=!1;function jc(e,t){if(t=t?dt(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var i=ve(ye(e));t.autofocus=i==e||e.getAttribute("autofocus")!=null&&i==document.body}function r(){e.value=h.getValue()}var n;if(e.form&&(oe(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var a=e.form;n=a.submit;try{var u=a.submit=function(){r(),a.submit=n,a.submit(),a.submit=u}}catch{}}t.finishInit=function(v){v.save=r,v.getTextArea=function(){return e},v.toTextArea=function(){v.toTextArea=isNaN,r(),e.parentNode.removeChild(v.getWrapperElement()),e.style.display="",e.form&&(ht(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=n))}},e.style.display="none";var h=Ee(function(v){return e.parentNode.insertBefore(v,e.nextSibling)},t);return h}function Gc(e){e.off=ht,e.on=oe,e.wheelEventPixels=$f,e.Doc=ot,e.splitLines=jn,e.countColumn=Re,e.findColumn=Ft,e.isWordChar=Hn,e.Pass=Pe,e.signal=Ie,e.Line=Dr,e.changeEnd=Yt,e.scrollbarModel=gl,e.Pos=q,e.cmpPos=fe,e.modes=Kn,e.mimeModes=br,e.resolveMode=Ai,e.getMode=Xn,e.modeExtensions=xr,e.extendMode=Ku,e.copyState=tr,e.startState=Da,e.innerMode=Yn,e.commands=yi,e.keyMap=Ht,e.keyName=ts,e.isModifierKey=Vl,e.lookupKey=Ir,e.normalizeKeyMap=xc,e.StringStream=ze,e.SharedTextMarker=gi,e.TextMarker=Qt,e.LineWidget=pi,e.e_preventDefault=it,e.e_stopPropagation=ba,e.e_stop=Yr,e.addClass=Te,e.contains=V,e.rmClass=ue,e.keyNames=Jt}Oc(Ee),_c(Ee);var Kc="iter insert remove copy getEditor constructor".split(" ");for(var ln in ot.prototype)ot.prototype.hasOwnProperty(ln)&&Fe(Kc,ln)<0&&(Ee.prototype[ln]=function(e){return function(){return e.apply(this.doc,arguments)}}(ot.prototype[ln]));return yr(ot),Ee.inputStyles={textarea:Ne,contenteditable:De},Ee.defineMode=function(e){!Ee.defaults.mode&&e!="null"&&(Ee.defaults.mode=e),ju.apply(this,arguments)},Ee.defineMIME=Gu,Ee.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Ee.defineMIME("text/plain","null"),Ee.defineExtension=function(e,t){Ee.prototype[e]=t},Ee.defineDocExtension=function(e,t){ot.prototype[e]=t},Ee.fromTextArea=jc,Gc(Ee),Ee.version="5.65.21",Ee})});var ks=Ye((ws,Cs)=>{(function(o){typeof ws=="object"&&typeof Cs=="object"?o(ct()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";var f=/^(\s*)(>[> ]*|[*+-] \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/,c=/^(\s*)(>[> ]*|[*+-] \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/,l=/[*+-]\s/;o.commands.newlineAndIndentContinueMarkdownList=function(g){if(g.getOption("disableInput"))return o.Pass;for(var d=g.listSelections(),p=[],y=0;y\s*$/.test(z),I=!/>\s*$/.test(z);(B||I)&&g.replaceRange("",{line:w.line,ch:0},{line:w.line,ch:w.ch+1}),p[y]=` -`}else{var R=N[1],H=N[5],_=!(l.test(N[2])||N[2].indexOf(">")>=0),X=_?parseInt(N[3],10)+1+N[4]:N[2].replace("x"," ");p[y]=` -`+R+X+H,_&&s(g,w)}}g.replaceSelections(p)};function s(g,d){var p=d.line,y=0,w=0,D=f.exec(g.getLine(p)),S=D[1];do{y+=1;var F=p+y,T=g.getLine(F),z=f.exec(T);if(z){var N=z[1],A=parseInt(D[3],10)+y-w,B=parseInt(z[3],10),I=B;if(S===N&&!isNaN(B))A===B&&(I=B+1),A>B&&(I=A+1),g.replaceRange(T.replace(f,N+I+z[4]+z[5]),{line:F,ch:0},{line:F,ch:T.length});else{if(S.length>N.length||S.length{var Ss=ct();Ss.commands.tabAndIndentMarkdownList=function(o){var f=o.listSelections(),c=f[0].head,l=o.getStateAfter(c.line),s=l.list!==!1;if(s){o.execCommand("indentMore");return}if(o.options.indentWithTabs)o.execCommand("insertTab");else{var g=Array(o.options.tabSize+1).join(" ");o.replaceSelection(g)}};Ss.commands.shiftTabAndUnindentMarkdownList=function(o){var f=o.listSelections(),c=f[0].head,l=o.getStateAfter(c.line),s=l.list!==!1;if(s){o.execCommand("indentLess");return}if(o.options.indentWithTabs)o.execCommand("insertTab");else{var g=Array(o.options.tabSize+1).join(" ");o.replaceSelection(g)}}});var Ls=Ye((Es,As)=>{(function(o){typeof Es=="object"&&typeof As=="object"?o(ct()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";o.defineOption("fullScreen",!1,function(l,s,g){g==o.Init&&(g=!1),!g!=!s&&(s?f(l):c(l))});function f(l){var s=l.getWrapperElement();l.state.fullScreenRestore={scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,width:s.style.width,height:s.style.height},s.style.width="",s.style.height="auto",s.className+=" CodeMirror-fullscreen",document.documentElement.style.overflow="hidden",l.refresh()}function c(l){var s=l.getWrapperElement();s.className=s.className.replace(/\s*CodeMirror-fullscreen\b/,""),document.documentElement.style.overflow="";var g=l.state.fullScreenRestore;s.style.width=g.width,s.style.height=g.height,window.scrollTo(g.scrollLeft,g.scrollTop),l.refresh()}})});var Zo=Ye((Ts,Ms)=>{(function(o){typeof Ts=="object"&&typeof Ms=="object"?o(ct()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";var f={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},c={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};o.defineMode("xml",function(l,s){var g=l.indentUnit,d={},p=s.htmlMode?f:c;for(var y in p)d[y]=p[y];for(var y in s)d[y]=s[y];var w,D;function S(L,U){function W(Te){return U.tokenize=Te,Te(L,U)}var V=L.next();if(V=="<")return L.eat("!")?L.eat("[")?L.match("CDATA[")?W(z("atom","]]>")):null:L.match("--")?W(z("comment","-->")):L.match("DOCTYPE",!0,!0)?(L.eatWhile(/[\w\._\-]/),W(N(1))):null:L.eat("?")?(L.eatWhile(/[\w\._\-]/),U.tokenize=z("meta","?>"),"meta"):(w=L.eat("/")?"closeTag":"openTag",U.tokenize=F,"tag bracket");if(V=="&"){var ve;return L.eat("#")?L.eat("x")?ve=L.eatWhile(/[a-fA-F\d]/)&&L.eat(";"):ve=L.eatWhile(/[\d]/)&&L.eat(";"):ve=L.eatWhile(/[\w\.\-:]/)&&L.eat(";"),ve?"atom":"error"}else return L.eatWhile(/[^&<]/),null}S.isInText=!0;function F(L,U){var W=L.next();if(W==">"||W=="/"&&L.eat(">"))return U.tokenize=S,w=W==">"?"endTag":"selfcloseTag","tag bracket";if(W=="=")return w="equals",null;if(W=="<"){U.tokenize=S,U.state=H,U.tagName=U.tagStart=null;var V=U.tokenize(L,U);return V?V+" tag error":"tag error"}else return/[\'\"]/.test(W)?(U.tokenize=T(W),U.stringStartCol=L.column(),U.tokenize(L,U)):(L.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function T(L){var U=function(W,V){for(;!W.eol();)if(W.next()==L){V.tokenize=F;break}return"string"};return U.isInAttribute=!0,U}function z(L,U){return function(W,V){for(;!W.eol();){if(W.match(U)){V.tokenize=S;break}W.next()}return L}}function N(L){return function(U,W){for(var V;(V=U.next())!=null;){if(V=="<")return W.tokenize=N(L+1),W.tokenize(U,W);if(V==">")if(L==1){W.tokenize=S;break}else return W.tokenize=N(L-1),W.tokenize(U,W)}return"meta"}}function A(L){return L&&L.toLowerCase()}function B(L,U,W){this.prev=L.context,this.tagName=U||"",this.indent=L.indented,this.startOfLine=W,(d.doNotIndent.hasOwnProperty(U)||L.context&&L.context.noIndent)&&(this.noIndent=!0)}function I(L){L.context&&(L.context=L.context.prev)}function R(L,U){for(var W;;){if(!L.context||(W=L.context.tagName,!d.contextGrabbers.hasOwnProperty(A(W))||!d.contextGrabbers[A(W)].hasOwnProperty(A(U))))return;I(L)}}function H(L,U,W){return L=="openTag"?(W.tagStart=U.column(),_):L=="closeTag"?X:H}function _(L,U,W){return L=="word"?(W.tagName=U.current(),D="tag",G):d.allowMissingTagName&&L=="endTag"?(D="tag bracket",G(L,U,W)):(D="error",_)}function X(L,U,W){if(L=="word"){var V=U.current();return W.context&&W.context.tagName!=V&&d.implicitlyClosed.hasOwnProperty(A(W.context.tagName))&&I(W),W.context&&W.context.tagName==V||d.matchClosing===!1?(D="tag",K):(D="tag error",ge)}else return d.allowMissingTagName&&L=="endTag"?(D="tag bracket",K(L,U,W)):(D="error",ge)}function K(L,U,W){return L!="endTag"?(D="error",K):(I(W),H)}function ge(L,U,W){return D="error",K(L,U,W)}function G(L,U,W){if(L=="word")return D="attribute",ue;if(L=="endTag"||L=="selfcloseTag"){var V=W.tagName,ve=W.tagStart;return W.tagName=W.tagStart=null,L=="selfcloseTag"||d.autoSelfClosers.hasOwnProperty(A(V))?R(W,V):(R(W,V),W.context=new B(W,V,ve==W.indented)),H}return D="error",G}function ue(L,U,W){return L=="equals"?ae:(d.allowMissing||(D="error"),G(L,U,W))}function ae(L,U,W){return L=="string"?de:L=="word"&&d.allowUnquoted?(D="string",G):(D="error",G(L,U,W))}function de(L,U,W){return L=="string"?de:G(L,U,W)}return{startState:function(L){var U={tokenize:S,state:H,indented:L||0,tagName:null,tagStart:null,context:null};return L!=null&&(U.baseIndent=L),U},token:function(L,U){if(!U.tagName&&L.sol()&&(U.indented=L.indentation()),L.eatSpace())return null;w=null;var W=U.tokenize(L,U);return(W||w)&&W!="comment"&&(D=null,U.state=U.state(w||W,L,U),D&&(W=D=="error"?W+" error":D)),W},indent:function(L,U,W){var V=L.context;if(L.tokenize.isInAttribute)return L.tagStart==L.indented?L.stringStartCol+1:L.indented+g;if(V&&V.noIndent)return o.Pass;if(L.tokenize!=F&&L.tokenize!=S)return W?W.match(/^(\s*)/)[0].length:0;if(L.tagName)return d.multilineTagIndentPastTag!==!1?L.tagStart+L.tagName.length+2:L.tagStart+g*(d.multilineTagIndentFactor||1);if(d.alignCDATA&&/$/,blockCommentStart:"",configuration:d.htmlMode?"html":"xml",helperType:d.htmlMode?"html":"xml",skipAttribute:function(L){L.state==ae&&(L.state=G)},xmlCurrentTag:function(L){return L.tagName?{name:L.tagName,close:L.type=="closeTag"}:null},xmlCurrentContext:function(L){for(var U=[],W=L.context;W;W=W.prev)U.push(W.tagName);return U.reverse()}}}),o.defineMIME("text/xml","xml"),o.defineMIME("application/xml","xml"),o.mimeModes.hasOwnProperty("text/html")||o.defineMIME("text/html",{name:"xml",htmlMode:!0})})});var Is=Ye((Bs,Ns)=>{(function(o){typeof Bs=="object"&&typeof Ns=="object"?o(ct()):typeof define=="function"&&define.amd?define(["../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";o.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy","cbl"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded JavaScript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"],alias:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var f=0;f-1&&l.substring(d+1,l.length);if(p)return o.findModeByExtension(p)},o.findModeByName=function(l){l=l.toLowerCase();for(var s=0;s{(function(o){typeof zs=="object"&&typeof Os=="object"?o(ct(),Zo(),Is()):typeof define=="function"&&define.amd?define(["../../lib/codemirror","../xml/xml","../meta"],o):o(CodeMirror)})(function(o){"use strict";o.defineMode("markdown",function(f,c){var l=o.getMode(f,"text/html"),s=l.name=="null";function g(k){if(o.findModeByName){var b=o.findModeByName(k);b&&(k=b.mime||b.mimes[0])}var ee=o.getMode(f,k);return ee.name=="null"?null:ee}c.highlightFormatting===void 0&&(c.highlightFormatting=!1),c.maxBlockquoteDepth===void 0&&(c.maxBlockquoteDepth=0),c.taskLists===void 0&&(c.taskLists=!1),c.strikethrough===void 0&&(c.strikethrough=!1),c.emoji===void 0&&(c.emoji=!1),c.fencedCodeBlockHighlighting===void 0&&(c.fencedCodeBlockHighlighting=!0),c.fencedCodeBlockDefaultMode===void 0&&(c.fencedCodeBlockDefaultMode="text/plain"),c.xml===void 0&&(c.xml=!0),c.tokenTypeOverrides===void 0&&(c.tokenTypeOverrides={});var d={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var p in d)d.hasOwnProperty(p)&&c.tokenTypeOverrides[p]&&(d[p]=c.tokenTypeOverrides[p]);var y=/^([*\-_])(?:\s*\1){2,}\s*$/,w=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,D=/^\[(x| )\](?=\s)/i,S=c.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,F=/^ {0,3}(?:\={1,}|-{2,})\s*$/,T=/^[^#!\[\]*_\\<>` "'(~:]+/,z=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,N=/^\s*\[[^\]]+?\]:.*$/,A=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,B=" ";function I(k,b,ee){return b.f=b.inline=ee,ee(k,b)}function R(k,b,ee){return b.f=b.block=ee,ee(k,b)}function H(k){return!k||!/\S/.test(k.string)}function _(k){if(k.linkTitle=!1,k.linkHref=!1,k.linkText=!1,k.em=!1,k.strong=!1,k.strikethrough=!1,k.quote=0,k.indentedCode=!1,k.f==K){var b=s;if(!b){var ee=o.innerMode(l,k.htmlState);b=ee.mode.name=="xml"&&ee.state.tagStart===null&&!ee.state.context&&ee.state.tokenize.isInText}b&&(k.f=ae,k.block=X,k.htmlState=null)}return k.trailingSpace=0,k.trailingSpaceNewLine=!1,k.prevLine=k.thisLine,k.thisLine={stream:null},null}function X(k,b){var ee=k.column()===b.indentation,ye=H(b.prevLine.stream),he=b.indentedCode,tt=b.prevLine.hr,dt=b.list!==!1,Re=(b.listStack[b.listStack.length-1]||0)+3;b.indentedCode=!1;var Je=b.indentation;if(b.indentationDiff===null&&(b.indentationDiff=b.indentation,dt)){for(b.list=null;Je=4&&(he||b.prevLine.fencedCodeEnd||b.prevLine.header||ye))return k.skipToEnd(),b.indentedCode=!0,d.code;if(k.eatSpace())return null;if(ee&&b.indentation<=Re&&(Pe=k.match(S))&&Pe[1].length<=6)return b.quote=0,b.header=Pe[1].length,b.thisLine.header=!0,c.highlightFormatting&&(b.formatting="header"),b.f=b.inline,G(b);if(b.indentation<=Re&&k.eat(">"))return b.quote=ee?1:b.quote+1,c.highlightFormatting&&(b.formatting="quote"),k.eatSpace(),G(b);if(!Me&&!b.setext&&ee&&b.indentation<=Re&&(Pe=k.match(w))){var rt=Pe[1]?"ol":"ul";return b.indentation=Je+k.current().length,b.list=!0,b.quote=0,b.listStack.push(b.indentation),b.em=!1,b.strong=!1,b.code=!1,b.strikethrough=!1,c.taskLists&&k.match(D,!1)&&(b.taskList=!0),b.f=b.inline,c.highlightFormatting&&(b.formatting=["list","list-"+rt]),G(b)}else{if(ee&&b.indentation<=Re&&(Pe=k.match(z,!0)))return b.quote=0,b.fencedEndRE=new RegExp(Pe[1]+"+ *$"),b.localMode=c.fencedCodeBlockHighlighting&&g(Pe[2]||c.fencedCodeBlockDefaultMode),b.localMode&&(b.localState=o.startState(b.localMode)),b.f=b.block=ge,c.highlightFormatting&&(b.formatting="code-block"),b.code=-1,G(b);if(b.setext||(!Fe||!dt)&&!b.quote&&b.list===!1&&!b.code&&!Me&&!N.test(k.string)&&(Pe=k.lookAhead(1))&&(Pe=Pe.match(F)))return b.setext?(b.header=b.setext,b.setext=0,k.skipToEnd(),c.highlightFormatting&&(b.formatting="header")):(b.header=Pe[0].charAt(0)=="="?1:2,b.setext=b.header),b.thisLine.header=!0,b.f=b.inline,G(b);if(Me)return k.skipToEnd(),b.hr=!0,b.thisLine.hr=!0,d.hr;if(k.peek()==="[")return I(k,b,V)}return I(k,b,b.inline)}function K(k,b){var ee=l.token(k,b.htmlState);if(!s){var ye=o.innerMode(l,b.htmlState);(ye.mode.name=="xml"&&ye.state.tagStart===null&&!ye.state.context&&ye.state.tokenize.isInText||b.md_inside&&k.current().indexOf(">")>-1)&&(b.f=ae,b.block=X,b.htmlState=null)}return ee}function ge(k,b){var ee=b.listStack[b.listStack.length-1]||0,ye=b.indentation=k.quote?b.push(d.formatting+"-"+k.formatting[ee]+"-"+k.quote):b.push("error"))}if(k.taskOpen)return b.push("meta"),b.length?b.join(" "):null;if(k.taskClosed)return b.push("property"),b.length?b.join(" "):null;if(k.linkHref?b.push(d.linkHref,"url"):(k.strong&&b.push(d.strong),k.em&&b.push(d.em),k.strikethrough&&b.push(d.strikethrough),k.emoji&&b.push(d.emoji),k.linkText&&b.push(d.linkText),k.code&&b.push(d.code),k.image&&b.push(d.image),k.imageAltText&&b.push(d.imageAltText,"link"),k.imageMarker&&b.push(d.imageMarker)),k.header&&b.push(d.header,d.header+"-"+k.header),k.quote&&(b.push(d.quote),!c.maxBlockquoteDepth||c.maxBlockquoteDepth>=k.quote?b.push(d.quote+"-"+k.quote):b.push(d.quote+"-"+c.maxBlockquoteDepth)),k.list!==!1){var ye=(k.listStack.length-1)%3;ye?ye===1?b.push(d.list2):b.push(d.list3):b.push(d.list1)}return k.trailingSpaceNewLine?b.push("trailing-space-new-line"):k.trailingSpace&&b.push("trailing-space-"+(k.trailingSpace%2?"a":"b")),b.length?b.join(" "):null}function ue(k,b){if(k.match(T,!0))return G(b)}function ae(k,b){var ee=b.text(k,b);if(typeof ee<"u")return ee;if(b.list)return b.list=null,G(b);if(b.taskList){var ye=k.match(D,!0)[1]===" ";return ye?b.taskOpen=!0:b.taskClosed=!0,c.highlightFormatting&&(b.formatting="task"),b.taskList=!1,G(b)}if(b.taskOpen=!1,b.taskClosed=!1,b.header&&k.match(/^#+$/,!0))return c.highlightFormatting&&(b.formatting="header"),G(b);var he=k.next();if(b.linkTitle){b.linkTitle=!1;var tt=he;he==="("&&(tt=")"),tt=(tt+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var dt="^\\s*(?:[^"+tt+"\\\\]+|\\\\\\\\|\\\\.)"+tt;if(k.match(new RegExp(dt),!0))return d.linkHref}if(he==="`"){var Re=b.formatting;c.highlightFormatting&&(b.formatting="code"),k.eatWhile("`");var Je=k.current().length;if(b.code==0&&(!b.quote||Je==1))return b.code=Je,G(b);if(Je==b.code){var Fe=G(b);return b.code=0,Fe}else return b.formatting=Re,G(b)}else if(b.code)return G(b);if(he==="\\"&&(k.next(),c.highlightFormatting)){var Me=G(b),Pe=d.formatting+"-escape";return Me?Me+" "+Pe:Pe}if(he==="!"&&k.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return b.imageMarker=!0,b.image=!0,c.highlightFormatting&&(b.formatting="image"),G(b);if(he==="["&&b.imageMarker&&k.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return b.imageMarker=!1,b.imageAltText=!0,c.highlightFormatting&&(b.formatting="image"),G(b);if(he==="]"&&b.imageAltText){c.highlightFormatting&&(b.formatting="image");var Me=G(b);return b.imageAltText=!1,b.image=!1,b.inline=b.f=L,Me}if(he==="["&&!b.image)return b.linkText&&k.match(/^.*?\]/)||(b.linkText=!0,c.highlightFormatting&&(b.formatting="link")),G(b);if(he==="]"&&b.linkText){c.highlightFormatting&&(b.formatting="link");var Me=G(b);return b.linkText=!1,b.inline=b.f=k.match(/\(.*?\)| ?\[.*?\]/,!1)?L:ae,Me}if(he==="<"&&k.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){b.f=b.inline=de,c.highlightFormatting&&(b.formatting="link");var Me=G(b);return Me?Me+=" ":Me="",Me+d.linkInline}if(he==="<"&&k.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){b.f=b.inline=de,c.highlightFormatting&&(b.formatting="link");var Me=G(b);return Me?Me+=" ":Me="",Me+d.linkEmail}if(c.xml&&he==="<"&&k.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var rt=k.string.indexOf(">",k.pos);if(rt!=-1){var jr=k.string.substring(k.start,rt);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(jr)&&(b.md_inside=!0)}return k.backUp(1),b.htmlState=o.startState(l),R(k,b,K)}if(c.xml&&he==="<"&&k.match(/^\/\w*?>/))return b.md_inside=!1,"tag";if(he==="*"||he==="_"){for(var St=1,Ft=k.pos==1?" ":k.string.charAt(k.pos-2);St<3&&k.eat(he);)St++;var bt=k.peek()||" ",qt=!/\s/.test(bt)&&(!A.test(bt)||/\s/.test(Ft)||A.test(Ft)),me=!/\s/.test(Ft)&&(!A.test(Ft)||/\s/.test(bt)||A.test(bt)),xt=null,Ut=null;if(St%2&&(!b.em&&qt&&(he==="*"||!me||A.test(Ft))?xt=!0:b.em==he&&me&&(he==="*"||!qt||A.test(bt))&&(xt=!1)),St>1&&(!b.strong&&qt&&(he==="*"||!me||A.test(Ft))?Ut=!0:b.strong==he&&me&&(he==="*"||!qt||A.test(bt))&&(Ut=!1)),Ut!=null||xt!=null){c.highlightFormatting&&(b.formatting=xt==null?"strong":Ut==null?"em":"strong em"),xt===!0&&(b.em=he),Ut===!0&&(b.strong=he);var Fe=G(b);return xt===!1&&(b.em=!1),Ut===!1&&(b.strong=!1),Fe}}else if(he===" "&&(k.eat("*")||k.eat("_"))){if(k.peek()===" ")return G(b);k.backUp(1)}if(c.strikethrough){if(he==="~"&&k.eatWhile(he)){if(b.strikethrough){c.highlightFormatting&&(b.formatting="strikethrough");var Fe=G(b);return b.strikethrough=!1,Fe}else if(k.match(/^[^\s]/,!1))return b.strikethrough=!0,c.highlightFormatting&&(b.formatting="strikethrough"),G(b)}else if(he===" "&&k.match("~~",!0)){if(k.peek()===" ")return G(b);k.backUp(2)}}if(c.emoji&&he===":"&&k.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){b.emoji=!0,c.highlightFormatting&&(b.formatting="emoji");var Fi=G(b);return b.emoji=!1,Fi}return he===" "&&(k.match(/^ +$/,!1)?b.trailingSpace++:b.trailingSpace&&(b.trailingSpaceNewLine=!0)),G(b)}function de(k,b){var ee=k.next();if(ee===">"){b.f=b.inline=ae,c.highlightFormatting&&(b.formatting="link");var ye=G(b);return ye?ye+=" ":ye="",ye+d.linkInline}return k.match(/^[^>]+/,!0),d.linkInline}function L(k,b){if(k.eatSpace())return null;var ee=k.next();return ee==="("||ee==="["?(b.f=b.inline=W(ee==="("?")":"]"),c.highlightFormatting&&(b.formatting="link-string"),b.linkHref=!0,G(b)):"error"}var U={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function W(k){return function(b,ee){var ye=b.next();if(ye===k){ee.f=ee.inline=ae,c.highlightFormatting&&(ee.formatting="link-string");var he=G(ee);return ee.linkHref=!1,he}return b.match(U[k]),ee.linkHref=!0,G(ee)}}function V(k,b){return k.match(/^([^\]\\]|\\.)*\]:/,!1)?(b.f=ve,k.next(),c.highlightFormatting&&(b.formatting="link"),b.linkText=!0,G(b)):I(k,b,ae)}function ve(k,b){if(k.match("]:",!0)){b.f=b.inline=Te,c.highlightFormatting&&(b.formatting="link");var ee=G(b);return b.linkText=!1,ee}return k.match(/^([^\]\\]|\\.)+/,!0),d.linkText}function Te(k,b){return k.eatSpace()?null:(k.match(/^[^\s]+/,!0),k.peek()===void 0?b.linkTitle=!0:k.match(/^(?:\s+(?:"(?:[^"\\]|\\.)+"|'(?:[^'\\]|\\.)+'|\((?:[^)\\]|\\.)+\)))?/,!0),b.f=b.inline=ae,d.linkHref+" url")}var mt={startState:function(){return{f:X,prevLine:{stream:null},thisLine:{stream:null},block:X,htmlState:null,indentation:0,inline:ae,text:ue,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(k){return{f:k.f,prevLine:k.prevLine,thisLine:k.thisLine,block:k.block,htmlState:k.htmlState&&o.copyState(l,k.htmlState),indentation:k.indentation,localMode:k.localMode,localState:k.localMode?o.copyState(k.localMode,k.localState):null,inline:k.inline,text:k.text,formatting:!1,linkText:k.linkText,linkTitle:k.linkTitle,linkHref:k.linkHref,code:k.code,em:k.em,strong:k.strong,strikethrough:k.strikethrough,emoji:k.emoji,header:k.header,setext:k.setext,hr:k.hr,taskList:k.taskList,list:k.list,listStack:k.listStack.slice(0),quote:k.quote,indentedCode:k.indentedCode,trailingSpace:k.trailingSpace,trailingSpaceNewLine:k.trailingSpaceNewLine,md_inside:k.md_inside,fencedEndRE:k.fencedEndRE}},token:function(k,b){if(b.formatting=!1,k!=b.thisLine.stream){if(b.header=0,b.hr=!1,k.match(/^\s*$/,!0))return _(b),null;if(b.prevLine=b.thisLine,b.thisLine={stream:k},b.taskList=!1,b.trailingSpace=0,b.trailingSpaceNewLine=!1,!b.localState&&(b.f=b.block,b.f!=K)){var ee=k.match(/^\s*/,!0)[0].replace(/\t/g,B).length;if(b.indentation=ee,b.indentationDiff=null,ee>0)return null}}return b.f(k,b)},innerMode:function(k){return k.block==K?{state:k.htmlState,mode:l}:k.localState?{state:k.localState,mode:k.localMode}:{state:k,mode:mt}},indent:function(k,b,ee){return k.block==K&&l.indent?l.indent(k.htmlState,b,ee):k.localState&&k.localMode.indent?k.localMode.indent(k.localState,b,ee):o.Pass},blankLine:_,getType:G,blockCommentStart:"",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return mt},"xml"),o.defineMIME("text/markdown","markdown"),o.defineMIME("text/x-markdown","markdown")})});var Jo=Ye((Hs,Rs)=>{(function(o){typeof Hs=="object"&&typeof Rs=="object"?o(ct()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";o.overlayMode=function(f,c,l){return{startState:function(){return{base:o.startState(f),overlay:o.startState(c),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(s){return{base:o.copyState(f,s.base),overlay:o.copyState(c,s.overlay),basePos:s.basePos,baseCur:null,overlayPos:s.overlayPos,overlayCur:null}},token:function(s,g){return(s!=g.streamSeen||Math.min(g.basePos,g.overlayPos){(function(o){typeof Ps=="object"&&typeof _s=="object"?o(ct()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){o.defineOption("placeholder","",function(p,y,w){var D=w&&w!=o.Init;if(y&&!D)p.on("blur",s),p.on("change",g),p.on("swapDoc",g),o.on(p.getInputField(),"compositionupdate",p.state.placeholderCompose=function(){l(p)}),g(p);else if(!y&&D){p.off("blur",s),p.off("change",g),p.off("swapDoc",g),o.off(p.getInputField(),"compositionupdate",p.state.placeholderCompose),f(p);var S=p.getWrapperElement();S.className=S.className.replace(" CodeMirror-empty","")}y&&!p.hasFocus()&&s(p)});function f(p){p.state.placeholder&&(p.state.placeholder.parentNode.removeChild(p.state.placeholder),p.state.placeholder=null)}function c(p){f(p);var y=p.state.placeholder=document.createElement("pre");y.style.cssText="height: 0; overflow: visible",y.style.direction=p.getOption("direction"),y.className="CodeMirror-placeholder CodeMirror-line-like";var w=p.getOption("placeholder");typeof w=="string"&&(w=document.createTextNode(w)),y.appendChild(w),p.display.lineSpace.insertBefore(y,p.display.lineSpace.firstChild)}function l(p){setTimeout(function(){var y=!1;if(p.lineCount()==1){var w=p.getInputField();y=w.nodeName=="TEXTAREA"?!p.getLine(0).length:!/[^\u200b]/.test(w.querySelector(".CodeMirror-line").textContent)}y?c(p):f(p)},20)}function s(p){d(p)&&c(p)}function g(p){var y=p.getWrapperElement(),w=d(p);y.className=y.className.replace(" CodeMirror-empty","")+(w?" CodeMirror-empty":""),w?c(p):f(p)}function d(p){return p.lineCount()===1&&p.getLine(0)===""}})});var js=Ye((qs,Us)=>{(function(o){typeof qs=="object"&&typeof Us=="object"?o(ct()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";o.defineOption("autoRefresh",!1,function(l,s){l.state.autoRefresh&&(c(l,l.state.autoRefresh),l.state.autoRefresh=null),s&&l.display.wrapper.offsetHeight==0&&f(l,l.state.autoRefresh={delay:s.delay||250})});function f(l,s){function g(){l.display.wrapper.offsetHeight?(c(l,s),l.display.lastWrapHeight!=l.display.wrapper.clientHeight&&l.refresh()):s.timeout=setTimeout(g,s.delay)}s.timeout=setTimeout(g,s.delay),s.hurry=function(){clearTimeout(s.timeout),s.timeout=setTimeout(g,50)},o.on(window,"mouseup",s.hurry),o.on(window,"keyup",s.hurry)}function c(l,s){clearTimeout(s.timeout),o.off(window,"mouseup",s.hurry),o.off(window,"keyup",s.hurry)}})});var Xs=Ye((Gs,Ks)=>{(function(o){typeof Gs=="object"&&typeof Ks=="object"?o(ct()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";o.defineOption("styleSelectedText",!1,function(D,S,F){var T=F&&F!=o.Init;S&&!T?(D.state.markedSelection=[],D.state.markedSelectionStyle=typeof S=="string"?S:"CodeMirror-selectedtext",y(D),D.on("cursorActivity",f),D.on("change",c)):!S&&T&&(D.off("cursorActivity",f),D.off("change",c),p(D),D.state.markedSelection=D.state.markedSelectionStyle=null)});function f(D){D.state.markedSelection&&D.operation(function(){w(D)})}function c(D){D.state.markedSelection&&D.state.markedSelection.length&&D.operation(function(){p(D)})}var l=8,s=o.Pos,g=o.cmpPos;function d(D,S,F,T){if(g(S,F)!=0)for(var z=D.state.markedSelection,N=D.state.markedSelectionStyle,A=S.line;;){var B=A==S.line?S:s(A,0),I=A+l,R=I>=F.line,H=R?F:s(I,0),_=D.markText(B,H,{className:N});if(T==null?z.push(_):z.splice(T++,0,_),R)break;A=I}}function p(D){for(var S=D.state.markedSelection,F=0;F1)return y(D);var S=D.getCursor("start"),F=D.getCursor("end"),T=D.state.markedSelection;if(!T.length)return d(D,S,F);var z=T[0].find(),N=T[T.length-1].find();if(!z||!N||F.line-S.line<=l||g(S,N.to)>=0||g(F,z.from)<=0)return y(D);for(;g(S,z.from)>0;)T.shift().clear(),z=T[0].find();for(g(S,z.from)<0&&(z.to.line-S.line0&&(F.line-N.from.line{(function(o){typeof Ys=="object"&&typeof Zs=="object"?o(ct()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";var f=o.Pos;function c(A){var B=A.flags;return B??(A.ignoreCase?"i":"")+(A.global?"g":"")+(A.multiline?"m":"")}function l(A,B){for(var I=c(A),R=I,H=0;HX);K++){var ge=A.getLine(_++);R=R==null?ge:R+` -`+ge}H=H*2,B.lastIndex=I.ch;var G=B.exec(R);if(G){var ue=R.slice(0,G.index).split(` -`),ae=G[0].split(` -`),de=I.line+ue.length-1,L=ue[ue.length-1].length;return{from:f(de,L),to:f(de+ae.length-1,ae.length==1?L+ae[0].length:ae[ae.length-1].length),match:G}}}}function p(A,B,I){for(var R,H=0;H<=A.length;){B.lastIndex=H;var _=B.exec(A);if(!_)break;var X=_.index+_[0].length;if(X>A.length-I)break;(!R||X>R.index+R[0].length)&&(R=_),H=_.index+1}return R}function y(A,B,I){B=l(B,"g");for(var R=I.line,H=I.ch,_=A.firstLine();R>=_;R--,H=-1){var X=A.getLine(R),K=p(X,B,H<0?0:X.length-H);if(K)return{from:f(R,K.index),to:f(R,K.index+K[0].length),match:K}}}function w(A,B,I){if(!s(B))return y(A,B,I);B=l(B,"gm");for(var R,H=1,_=A.getLine(I.line).length-I.ch,X=I.line,K=A.firstLine();X>=K;){for(var ge=0;ge=K;ge++){var G=A.getLine(X--);R=R==null?G:G+` -`+R}H*=2;var ue=p(R,B,_);if(ue){var ae=R.slice(0,ue.index).split(` -`),de=ue[0].split(` -`),L=X+ae.length,U=ae[ae.length-1].length;return{from:f(L,U),to:f(L+de.length-1,de.length==1?U+de[0].length:de[de.length-1].length),match:ue}}}}var D,S;String.prototype.normalize?(D=function(A){return A.normalize("NFD").toLowerCase()},S=function(A){return A.normalize("NFD")}):(D=function(A){return A.toLowerCase()},S=function(A){return A});function F(A,B,I,R){if(A.length==B.length)return I;for(var H=0,_=I+Math.max(0,A.length-B.length);;){if(H==_)return H;var X=H+_>>1,K=R(A.slice(0,X)).length;if(K==I)return X;K>I?_=X:H=X+1}}function T(A,B,I,R){if(!B.length)return null;var H=R?D:S,_=H(B).split(/\r|\n\r?/);e:for(var X=I.line,K=I.ch,ge=A.lastLine()+1-_.length;X<=ge;X++,K=0){var G=A.getLine(X).slice(K),ue=H(G);if(_.length==1){var ae=ue.indexOf(_[0]);if(ae==-1)continue e;var I=F(G,ue,ae,H)+K;return{from:f(X,F(G,ue,ae,H)+K),to:f(X,F(G,ue,ae+_[0].length,H)+K)}}else{var de=ue.length-_[0].length;if(ue.slice(de)!=_[0])continue e;for(var L=1;L<_.length-1;L++)if(H(A.getLine(X+L))!=_[L])continue e;var U=A.getLine(X+_.length-1),W=H(U),V=_[_.length-1];if(W.slice(0,V.length)!=V)continue e;return{from:f(X,F(G,ue,de,H)+K),to:f(X+_.length-1,F(U,W,V.length,H))}}}}function z(A,B,I,R){if(!B.length)return null;var H=R?D:S,_=H(B).split(/\r|\n\r?/);e:for(var X=I.line,K=I.ch,ge=A.firstLine()-1+_.length;X>=ge;X--,K=-1){var G=A.getLine(X);K>-1&&(G=G.slice(0,K));var ue=H(G);if(_.length==1){var ae=ue.lastIndexOf(_[0]);if(ae==-1)continue e;return{from:f(X,F(G,ue,ae,H)),to:f(X,F(G,ue,ae+_[0].length,H))}}else{var de=_[_.length-1];if(ue.slice(0,de.length)!=de)continue e;for(var L=1,I=X-_.length+1;L<_.length-1;L++)if(H(A.getLine(I+L))!=_[L])continue e;var U=A.getLine(X+1-_.length),W=H(U);if(W.slice(W.length-_[0].length)!=_[0])continue e;return{from:f(X+1-_.length,F(U,W,U.length-_[0].length,H)),to:f(X,F(G,ue,de.length,H))}}}}function N(A,B,I,R){this.atOccurrence=!1,this.afterEmptyMatch=!1,this.doc=A,I=I?A.clipPos(I):f(0,0),this.pos={from:I,to:I};var H;typeof R=="object"?H=R.caseFold:(H=R,R=null),typeof B=="string"?(H==null&&(H=!1),this.matches=function(_,X){return(_?z:T)(A,B,X,H)}):(B=l(B,"gm"),!R||R.multiline!==!1?this.matches=function(_,X){return(_?w:d)(A,B,X)}:this.matches=function(_,X){return(_?y:g)(A,B,X)})}N.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(A){var B=this.doc.clipPos(A?this.pos.from:this.pos.to);if(this.afterEmptyMatch&&this.atOccurrence&&(B=f(B.line,B.ch),A?(B.ch--,B.ch<0&&(B.line--,B.ch=(this.doc.getLine(B.line)||"").length)):(B.ch++,B.ch>(this.doc.getLine(B.line)||"").length&&(B.ch=0,B.line++)),o.cmpPos(B,this.doc.clipPos(B))!=0))return this.atOccurrence=!1;var I=this.matches(A,B);if(this.afterEmptyMatch=I&&o.cmpPos(I.from,I.to)==0,I)return this.pos=I,this.atOccurrence=!0,this.pos.match||!0;var R=f(A?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:R,to:R},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(A,B){if(this.atOccurrence){var I=o.splitLines(A);this.doc.replaceRange(I,this.pos.from,this.pos.to,B),this.pos.to=f(this.pos.from.line+I.length-1,I[I.length-1].length+(I.length==1?this.pos.from.ch:0))}}},o.defineExtension("getSearchCursor",function(A,B,I){return new N(this.doc,A,B,I)}),o.defineDocExtension("getSearchCursor",function(A,B,I){return new N(this,A,B,I)}),o.defineExtension("selectMatches",function(A,B){for(var I=[],R=this.getSearchCursor(A,this.getCursor("from"),B);R.findNext()&&!(o.cmpPos(R.to(),this.getCursor("to"))>0);)I.push({anchor:R.from(),head:R.to()});I.length&&this.setSelections(I,0)})})});var Vs=Ye((Js,$s)=>{(function(o){typeof Js=="object"&&typeof $s=="object"?o(ct(),Qo(),Jo()):typeof define=="function"&&define.amd?define(["../../lib/codemirror","../markdown/markdown","../../addon/mode/overlay"],o):o(CodeMirror)})(function(o){"use strict";var f=/^((?:(?:aaas?|about|acap|adiumxtra|af[ps]|aim|apt|attachment|aw|beshare|bitcoin|bolo|callto|cap|chrome(?:-extension)?|cid|coap|com-eventbrite-attendee|content|crid|cvs|data|dav|dict|dlna-(?:playcontainer|playsingle)|dns|doi|dtn|dvb|ed2k|facetime|feed|file|finger|fish|ftp|geo|gg|git|gizmoproject|go|gopher|gtalk|h323|hcp|https?|iax|icap|icon|im|imap|info|ipn|ipp|irc[6s]?|iris(?:\.beep|\.lwz|\.xpc|\.xpcs)?|itms|jar|javascript|jms|keyparc|lastfm|ldaps?|magnet|mailto|maps|market|message|mid|mms|ms-help|msnim|msrps?|mtqp|mumble|mupdate|mvn|news|nfs|nih?|nntp|notes|oid|opaquelocktoken|palm|paparazzi|platform|pop|pres|proxy|psyc|query|res(?:ource)?|rmi|rsync|rtmp|rtsp|secondlife|service|session|sftp|sgn|shttp|sieve|sips?|skype|sm[bs]|snmp|soap\.beeps?|soldat|spotify|ssh|steam|svn|tag|teamspeak|tel(?:net)?|tftp|things|thismessage|tip|tn3270|tv|udp|unreal|urn|ut2004|vemmi|ventrilo|view-source|webcal|wss?|wtai|wyciwyg|xcon(?:-userid)?|xfire|xmlrpc\.beeps?|xmpp|xri|ymsgr|z39\.50[rs]?):(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i;o.defineMode("gfm",function(c,l){var s=0;function g(w){return w.code=!1,null}var d={startState:function(){return{code:!1,codeBlock:!1,ateSpace:!1}},copyState:function(w){return{code:w.code,codeBlock:w.codeBlock,ateSpace:w.ateSpace}},token:function(w,D){if(D.combineTokens=null,D.codeBlock)return w.match(/^```+/)?(D.codeBlock=!1,null):(w.skipToEnd(),null);if(w.sol()&&(D.code=!1),w.sol()&&w.match(/^```+/))return w.skipToEnd(),D.codeBlock=!0,null;if(w.peek()==="`"){w.next();var S=w.pos;w.eatWhile("`");var F=1+w.pos-S;return D.code?F===s&&(D.code=!1):(s=F,D.code=!0),null}else if(D.code)return w.next(),null;if(w.eatSpace())return D.ateSpace=!0,null;if((w.sol()||D.ateSpace)&&(D.ateSpace=!1,l.gitHubSpice!==!1)){if(w.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?=.{0,6}\d)(?:[a-f0-9]{7,40}\b)/))return D.combineTokens=!0,"link";if(w.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/))return D.combineTokens=!0,"link"}return w.match(f)&&w.string.slice(w.start-2,w.start)!="]("&&(w.start==0||/\W/.test(w.string.charAt(w.start-1)))?(D.combineTokens=!0,"link"):(w.next(),null)},blankLine:g},p={taskLists:!0,strikethrough:!0,emoji:!0};for(var y in l)p[y]=l[y];return p.name="markdown",o.overlayMode(o.getMode(c,p),d)},"markdown"),o.defineMIME("text/x-gfm","gfm")})});var eu=Ye(()=>{});var tu=Ye((sh,Vo)=>{var $o;(function(){"use strict";$o=function(o,f,c,l){l=l||{},this.dictionary=null,this.rules={},this.dictionaryTable=new Map,this.compoundRules=[],this.compoundRuleCodes={},this.replacementTable=[],this.flags=l.flags||{},this.memoized={},this.loaded=!1;var s=this,g,d,p,y,w;o&&(s.dictionary=o,f&&c?T():(typeof window<"u"?(l.dictionaryPath?g=l.dictionaryPath:g="typo/dictionaries",window.chrome&&window.chrome.runtime&&window.chrome.runtime.getURL?g=window.chrome.runtime.getURL(g):window.browser&&window.browser.runtime&&window.browser.runtime.getURL&&(g=window.browser.runtime.getURL(g))):typeof __dirname<"u"?g=__dirname+"/dictionaries":g="./dictionaries",f||D(g+"/"+o+"/"+o+".aff",S),c||D(g+"/"+o+"/"+o+".dic",F)));function D(z,N){var A=s._readFile(z,null,l?.asyncLoad);l?.asyncLoad?A.then(function(B){N(B)}):N(A)}function S(z){f=z,c&&T()}function F(z){c=z,f&&T()}function T(){for(s.rules=s._parseAFF(f),s.compoundRuleCodes={},d=0,y=s.compoundRules.length;d0&&(_.continuationClasses=R),H!=="."&&(F==="SFX"?_.match=new RegExp(H+"$"):_.match=new RegExp("^"+H)),A!="0"&&(F==="SFX"?_.remove=new RegExp(A+"$"):_.remove=A),N.push(_)}f[T]={type:F,combineable:z==="Y",entries:N},d+=s}else if(F==="COMPOUNDRULE"){for(s=parseInt(S[1],10),p=d+1,w=d+1+s;p0&&(c.get(ue)===null&&c.set(ue,[]),c.get(ue).push(ae))}for(var s=1,g=f.length;s1){var D=this.parseRuleCodes(y[1]);(!("NEEDAFFIX"in this.flags)||D.indexOf(this.flags.NEEDAFFIX)===-1)&&l(w,D);for(var S=0,F=D.length;S"u"){if("COMPOUNDMIN"in this.flags&&o.length>=this.flags.COMPOUNDMIN){for(c=0,l=this.compoundRules.length;c"u"&&(c=Array.prototype.concat.apply([],this.dictionaryTable.get(o))),c&&c.indexOf(this.flags[f])!==-1))},alphabet:"",suggest:function(o,f){if(!this.loaded)throw"Dictionary not loaded.";if(f=f||5,this.memoized.hasOwnProperty(o)){var c=this.memoized[o].limit;if(f<=c||this.memoized[o].suggestions.length1&&K[1][1]!==K[1][0]&&(H=K[0]+K[1][1]+K[1][0]+K[1].substring(2),(!T||w.check(H))&&(H in z?z[H]+=1:z[H]=1)),K[1]){var ge=K[1].substring(0,1).toUpperCase()===K[1].substring(0,1)?"uppercase":"lowercase";for(A=0;A<_;A++){var G=w.alphabet[A];ge==="uppercase"&&(G=G.toUpperCase()),G!=K[1].substring(0,1)&&(H=K[0]+G+K[1].substring(1),(!T||w.check(H))&&(H in z?z[H]+=1:z[H]=1))}}if(K[1])for(A=0;A<_;A++){var ge=K[0].substring(-1).toUpperCase()===K[0].substring(-1)&&K[1].substring(0,1).toUpperCase()===K[1].substring(0,1)?"uppercase":"lowercase",G=w.alphabet[A];ge==="uppercase"&&(G=G.toUpperCase()),H=K[0]+G+K[1],(!T||w.check(H))&&(H in z?z[H]+=1:z[H]=1)}}return z}function S(F){var T,z=D((T={},T[F]=!0,T)),N=D(z,!0),A=N;for(var B in z)w.check(B)&&(B in A?A[B]+=z[B]:A[B]=z[B]);var I,R,H=[];for(I in A)A.hasOwnProperty(I)&&(w.hasFlag(I,"PRIORITYSUGGEST")&&(A[I]+=1e3),H.push([I,A[I]]));function _(G,ue){var ae=G[1],de=ue[1];return aede?1:ue[0].localeCompare(G[0])}H.sort(_).reverse();var X=[],K="lowercase";F.toUpperCase()===F?K="uppercase":F.substr(0,1).toUpperCase()+F.substr(1).toLowerCase()===F&&(K="capitalized");var ge=f;for(I=0;I{"use strict";var ru=tu();function Ae(o){if(o=o||{},typeof o.codeMirrorInstance!="function"||typeof o.codeMirrorInstance.defineMode!="function"){console.log("CodeMirror Spell Checker: You must provide an instance of CodeMirror via the option `codeMirrorInstance`");return}String.prototype.includes||(String.prototype.includes=function(){"use strict";return String.prototype.indexOf.apply(this,arguments)!==-1}),o.codeMirrorInstance.defineMode("spell-checker",function(f){if(!Ae.aff_loading){Ae.aff_loading=!0;var c=new XMLHttpRequest;c.open("GET","https://cdn.jsdelivr.net/codemirror.spell-checker/latest/en_US.aff",!0),c.onload=function(){c.readyState===4&&c.status===200&&(Ae.aff_data=c.responseText,Ae.num_loaded++,Ae.num_loaded==2&&(Ae.typo=new ru("en_US",Ae.aff_data,Ae.dic_data,{platform:"any"})))},c.send(null)}if(!Ae.dic_loading){Ae.dic_loading=!0;var l=new XMLHttpRequest;l.open("GET","https://cdn.jsdelivr.net/codemirror.spell-checker/latest/en_US.dic",!0),l.onload=function(){l.readyState===4&&l.status===200&&(Ae.dic_data=l.responseText,Ae.num_loaded++,Ae.num_loaded==2&&(Ae.typo=new ru("en_US",Ae.aff_data,Ae.dic_data,{platform:"any"})))},l.send(null)}var s='!"#$%&()*+,-./:;<=>?@[\\]^_`{|}~ ',g={token:function(p){var y=p.peek(),w="";if(s.includes(y))return p.next(),null;for(;(y=p.peek())!=null&&!s.includes(y);)w+=y,p.next();return Ae.typo&&!Ae.typo.check(w)?"spell-error":null}},d=o.codeMirrorInstance.getMode(f,f.backdrop||"text/plain");return o.codeMirrorInstance.overlayMode(d,g,!0)})}Ae.num_loaded=0;Ae.aff_loading=!1;Ae.dic_loading=!1;Ae.aff_data="";Ae.dic_data="";Ae.typo;iu.exports=Ae});var mu=Ye(Se=>{"use strict";function ou(o,f){for(var c=0;co.length)&&(f=o.length);for(var c=0,l=new Array(f);c=o.length?{done:!0}:{done:!1,value:o[l++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Qc(o,f){if(typeof o!="object"||o===null)return o;var c=o[Symbol.toPrimitive];if(c!==void 0){var l=c.call(o,f||"default");if(typeof l!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(f==="string"?String:Number)(o)}function Jc(o){var f=Qc(o,"string");return typeof f=="symbol"?f:String(f)}function ea(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}Se.defaults=ea();function $c(o){Se.defaults=o}var hu=/[&<>"']/,Vc=new RegExp(hu.source,"g"),pu=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,ed=new RegExp(pu.source,"g"),td={"&":"&","<":"<",">":">",'"':""","'":"'"},lu=function(f){return td[f]};function et(o,f){if(f){if(hu.test(o))return o.replace(Vc,lu)}else if(pu.test(o))return o.replace(ed,lu);return o}var rd=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function gu(o){return o.replace(rd,function(f,c){return c=c.toLowerCase(),c==="colon"?":":c.charAt(0)==="#"?c.charAt(1)==="x"?String.fromCharCode(parseInt(c.substring(2),16)):String.fromCharCode(+c.substring(1)):""})}var id=/(^|[^\[])\^/g;function Ce(o,f){o=typeof o=="string"?o:o.source,f=f||"";var c={replace:function(s,g){return g=g.source||g,g=g.replace(id,"$1"),o=o.replace(s,g),c},getRegex:function(){return new RegExp(o,f)}};return c}var nd=/[^\w:]/g,od=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function su(o,f,c){if(o){var l;try{l=decodeURIComponent(gu(c)).replace(nd,"").toLowerCase()}catch{return null}if(l.indexOf("javascript:")===0||l.indexOf("vbscript:")===0||l.indexOf("data:")===0)return null}f&&!od.test(c)&&(c=ud(f,c));try{c=encodeURI(c).replace(/%25/g,"%")}catch{return null}return c}var un={},ad=/^[^:]+:\/*[^/]*$/,ld=/^([^:]+:)[\s\S]*$/,sd=/^([^:]+:\/*[^/]*)[\s\S]*$/;function ud(o,f){un[" "+o]||(ad.test(o)?un[" "+o]=o+"/":un[" "+o]=fn(o,"/",!0)),o=un[" "+o];var c=o.indexOf(":")===-1;return f.substring(0,2)==="//"?c?f:o.replace(ld,"$1")+f:f.charAt(0)==="/"?c?f:o.replace(sd,"$1")+f:o+f}var cn={exec:function(){}};function uu(o,f){var c=o.replace(/\|/g,function(g,d,p){for(var y=!1,w=d;--w>=0&&p[w]==="\\";)y=!y;return y?"|":" |"}),l=c.split(/ \|/),s=0;if(l[0].trim()||l.shift(),l.length>0&&!l[l.length-1].trim()&&l.pop(),l.length>f)l.splice(f);else for(;l.length1;)f&1&&(c+=o),f>>=1,o+=o;return c+o}function cu(o,f,c,l){var s=f.href,g=f.title?et(f.title):null,d=o[1].replace(/\\([\[\]])/g,"$1");if(o[0].charAt(0)!=="!"){l.state.inLink=!0;var p={type:"link",raw:c,href:s,title:g,text:d,tokens:l.inlineTokens(d)};return l.state.inLink=!1,p}return{type:"image",raw:c,href:s,title:g,text:et(d)}}function dd(o,f){var c=o.match(/^(\s+)(?:```)/);if(c===null)return f;var l=c[1];return f.split(` -`).map(function(s){var g=s.match(/^\s+/);if(g===null)return s;var d=g[0];return d.length>=l.length?s.slice(l.length):s}).join(` -`)}var dn=function(){function o(c){this.options=c||Se.defaults}var f=o.prototype;return f.space=function(l){var s=this.rules.block.newline.exec(l);if(s&&s[0].length>0)return{type:"space",raw:s[0]}},f.code=function(l){var s=this.rules.block.code.exec(l);if(s){var g=s[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:s[0],codeBlockStyle:"indented",text:this.options.pedantic?g:fn(g,` -`)}}},f.fences=function(l){var s=this.rules.block.fences.exec(l);if(s){var g=s[0],d=dd(g,s[3]||"");return{type:"code",raw:g,lang:s[2]?s[2].trim().replace(this.rules.inline._escapes,"$1"):s[2],text:d}}},f.heading=function(l){var s=this.rules.block.heading.exec(l);if(s){var g=s[2].trim();if(/#$/.test(g)){var d=fn(g,"#");(this.options.pedantic||!d||/ $/.test(d))&&(g=d.trim())}return{type:"heading",raw:s[0],depth:s[1].length,text:g,tokens:this.lexer.inline(g)}}},f.hr=function(l){var s=this.rules.block.hr.exec(l);if(s)return{type:"hr",raw:s[0]}},f.blockquote=function(l){var s=this.rules.block.blockquote.exec(l);if(s){var g=s[0].replace(/^ *>[ \t]?/gm,""),d=this.lexer.state.top;this.lexer.state.top=!0;var p=this.lexer.blockTokens(g);return this.lexer.state.top=d,{type:"blockquote",raw:s[0],tokens:p,text:g}}},f.list=function(l){var s=this.rules.block.list.exec(l);if(s){var g,d,p,y,w,D,S,F,T,z,N,A,B=s[1].trim(),I=B.length>1,R={type:"list",raw:"",ordered:I,start:I?+B.slice(0,-1):"",loose:!1,items:[]};B=I?"\\d{1,9}\\"+B.slice(-1):"\\"+B,this.options.pedantic&&(B=I?B:"[*+-]");for(var H=new RegExp("^( {0,3}"+B+")((?:[ ][^\\n]*)?(?:\\n|$))");l&&(A=!1,!(!(s=H.exec(l))||this.rules.block.hr.test(l)));){if(g=s[0],l=l.substring(g.length),F=s[2].split(` -`,1)[0].replace(/^\t+/,function(de){return" ".repeat(3*de.length)}),T=l.split(` -`,1)[0],this.options.pedantic?(y=2,N=F.trimLeft()):(y=s[2].search(/[^ ]/),y=y>4?1:y,N=F.slice(y),y+=s[1].length),D=!1,!F&&/^ *$/.test(T)&&(g+=T+` -`,l=l.substring(T.length+1),A=!0),!A)for(var _=new RegExp("^ {0,"+Math.min(3,y-1)+"}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))"),X=new RegExp("^ {0,"+Math.min(3,y-1)+"}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)"),K=new RegExp("^ {0,"+Math.min(3,y-1)+"}(?:```|~~~)"),ge=new RegExp("^ {0,"+Math.min(3,y-1)+"}#");l&&(z=l.split(` -`,1)[0],T=z,this.options.pedantic&&(T=T.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(K.test(T)||ge.test(T)||_.test(T)||X.test(l)));){if(T.search(/[^ ]/)>=y||!T.trim())N+=` -`+T.slice(y);else{if(D||F.search(/[^ ]/)>=4||K.test(F)||ge.test(F)||X.test(F))break;N+=` -`+T}!D&&!T.trim()&&(D=!0),g+=z+` -`,l=l.substring(z.length+1),F=T.slice(y)}R.loose||(S?R.loose=!0:/\n *\n *$/.test(g)&&(S=!0)),this.options.gfm&&(d=/^\[[ xX]\] /.exec(N),d&&(p=d[0]!=="[ ] ",N=N.replace(/^\[[ xX]\] +/,""))),R.items.push({type:"list_item",raw:g,task:!!d,checked:p,loose:!1,text:N}),R.raw+=g}R.items[R.items.length-1].raw=g.trimRight(),R.items[R.items.length-1].text=N.trimRight(),R.raw=R.raw.trimRight();var G=R.items.length;for(w=0;w0&&ue.some(function(de){return/\n.*\n/.test(de.raw)});R.loose=ae}if(R.loose)for(w=0;w$/,"$1").replace(this.rules.inline._escapes,"$1"):"",p=s[3]?s[3].substring(1,s[3].length-1).replace(this.rules.inline._escapes,"$1"):s[3];return{type:"def",tag:g,raw:s[0],href:d,title:p}}},f.table=function(l){var s=this.rules.block.table.exec(l);if(s){var g={type:"table",header:uu(s[1]).map(function(S){return{text:S}}),align:s[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:s[3]&&s[3].trim()?s[3].replace(/\n[ \t]*$/,"").split(` -`):[]};if(g.header.length===g.align.length){g.raw=s[0];var d=g.align.length,p,y,w,D;for(p=0;p/i.test(s[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(s[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(s[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:s[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(s[0]):et(s[0]):s[0]}},f.link=function(l){var s=this.rules.inline.link.exec(l);if(s){var g=s[2].trim();if(!this.options.pedantic&&/^$/.test(g))return;var d=fn(g.slice(0,-1),"\\");if((g.length-d.length)%2===0)return}else{var p=fd(s[2],"()");if(p>-1){var y=s[0].indexOf("!")===0?5:4,w=y+s[1].length+p;s[2]=s[2].substring(0,p),s[0]=s[0].substring(0,w).trim(),s[3]=""}}var D=s[2],S="";if(this.options.pedantic){var F=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(D);F&&(D=F[1],S=F[3])}else S=s[3]?s[3].slice(1,-1):"";return D=D.trim(),/^$/.test(g)?D=D.slice(1):D=D.slice(1,-1)),cu(s,{href:D&&D.replace(this.rules.inline._escapes,"$1"),title:S&&S.replace(this.rules.inline._escapes,"$1")},s[0],this.lexer)}},f.reflink=function(l,s){var g;if((g=this.rules.inline.reflink.exec(l))||(g=this.rules.inline.nolink.exec(l))){var d=(g[2]||g[1]).replace(/\s+/g," ");if(d=s[d.toLowerCase()],!d){var p=g[0].charAt(0);return{type:"text",raw:p,text:p}}return cu(g,d,g[0],this.lexer)}},f.emStrong=function(l,s,g){g===void 0&&(g="");var d=this.rules.inline.emStrong.lDelim.exec(l);if(d&&!(d[3]&&g.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDF70-\uDF81\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDE70-\uDEBE\uDEC0-\uDEC9\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var p=d[1]||d[2]||"";if(!p||p&&(g===""||this.rules.inline.punctuation.exec(g))){var y=d[0].length-1,w,D,S=y,F=0,T=d[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(T.lastIndex=0,s=s.slice(-1*l.length+y);(d=T.exec(s))!=null;)if(w=d[1]||d[2]||d[3]||d[4]||d[5]||d[6],!!w){if(D=w.length,d[3]||d[4]){S+=D;continue}else if((d[5]||d[6])&&y%3&&!((y+D)%3)){F+=D;continue}if(S-=D,!(S>0)){D=Math.min(D,D+S+F);var z=l.slice(0,y+d.index+(d[0].length-w.length)+D);if(Math.min(y,D)%2){var N=z.slice(1,-1);return{type:"em",raw:z,text:N,tokens:this.lexer.inlineTokens(N)}}var A=z.slice(2,-2);return{type:"strong",raw:z,text:A,tokens:this.lexer.inlineTokens(A)}}}}}},f.codespan=function(l){var s=this.rules.inline.code.exec(l);if(s){var g=s[2].replace(/\n/g," "),d=/[^ ]/.test(g),p=/^ /.test(g)&&/ $/.test(g);return d&&p&&(g=g.substring(1,g.length-1)),g=et(g,!0),{type:"codespan",raw:s[0],text:g}}},f.br=function(l){var s=this.rules.inline.br.exec(l);if(s)return{type:"br",raw:s[0]}},f.del=function(l){var s=this.rules.inline.del.exec(l);if(s)return{type:"del",raw:s[0],text:s[2],tokens:this.lexer.inlineTokens(s[2])}},f.autolink=function(l,s){var g=this.rules.inline.autolink.exec(l);if(g){var d,p;return g[2]==="@"?(d=et(this.options.mangle?s(g[1]):g[1]),p="mailto:"+d):(d=et(g[1]),p=d),{type:"link",raw:g[0],text:d,href:p,tokens:[{type:"text",raw:d,text:d}]}}},f.url=function(l,s){var g;if(g=this.rules.inline.url.exec(l)){var d,p;if(g[2]==="@")d=et(this.options.mangle?s(g[0]):g[0]),p="mailto:"+d;else{var y;do y=g[0],g[0]=this.rules.inline._backpedal.exec(g[0])[0];while(y!==g[0]);d=et(g[0]),g[1]==="www."?p="http://"+g[0]:p=g[0]}return{type:"link",raw:g[0],text:d,href:p,tokens:[{type:"text",raw:d,text:d}]}}},f.inlineText=function(l,s){var g=this.rules.inline.text.exec(l);if(g){var d;return this.lexer.state.inRawBlock?d=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(g[0]):et(g[0]):g[0]:d=et(this.options.smartypants?s(g[0]):g[0]),{type:"text",raw:g[0],text:d}}},o}(),se={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:cn,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};se._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/;se._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;se.def=Ce(se.def).replace("label",se._label).replace("title",se._title).getRegex();se.bullet=/(?:[*+-]|\d{1,9}[.)])/;se.listItemStart=Ce(/^( *)(bull) */).replace("bull",se.bullet).getRegex();se.list=Ce(se.list).replace(/bull/g,se.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+se.def.source+")").getRegex();se._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";se._comment=/|$)/;se.html=Ce(se.html,"i").replace("comment",se._comment).replace("tag",se._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();se.paragraph=Ce(se._paragraph).replace("hr",se.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",se._tag).getRegex();se.blockquote=Ce(se.blockquote).replace("paragraph",se.paragraph).getRegex();se.normal=gt({},se);se.gfm=gt({},se.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"});se.gfm.table=Ce(se.gfm.table).replace("hr",se.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",se._tag).getRegex();se.gfm.paragraph=Ce(se._paragraph).replace("hr",se.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",se.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",se._tag).getRegex();se.pedantic=gt({},se.normal,{html:Ce(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",se._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:cn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ce(se.normal._paragraph).replace("hr",se.hr).replace("heading",` *#{1,6} *[^ -]`).replace("lheading",se.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var te={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:cn,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/,rDelimUnd:/^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:cn,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~";te.punctuation=Ce(te.punctuation).replace(/punctuation/g,te._punctuation).getRegex();te.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;te.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g;te._comment=Ce(se._comment).replace("(?:-->|$)","-->").getRegex();te.emStrong.lDelim=Ce(te.emStrong.lDelim).replace(/punct/g,te._punctuation).getRegex();te.emStrong.rDelimAst=Ce(te.emStrong.rDelimAst,"g").replace(/punct/g,te._punctuation).getRegex();te.emStrong.rDelimUnd=Ce(te.emStrong.rDelimUnd,"g").replace(/punct/g,te._punctuation).getRegex();te._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;te._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;te._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;te.autolink=Ce(te.autolink).replace("scheme",te._scheme).replace("email",te._email).getRegex();te._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;te.tag=Ce(te.tag).replace("comment",te._comment).replace("attribute",te._attribute).getRegex();te._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;te._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;te._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;te.link=Ce(te.link).replace("label",te._label).replace("href",te._href).replace("title",te._title).getRegex();te.reflink=Ce(te.reflink).replace("label",te._label).replace("ref",se._label).getRegex();te.nolink=Ce(te.nolink).replace("ref",se._label).getRegex();te.reflinkSearch=Ce(te.reflinkSearch,"g").replace("reflink",te.reflink).replace("nolink",te.nolink).getRegex();te.normal=gt({},te);te.pedantic=gt({},te.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Ce(/^!?\[(label)\]\((.*?)\)/).replace("label",te._label).getRegex(),reflink:Ce(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",te._label).getRegex()});te.gfm=gt({},te.normal,{escape:Ce(te.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(l="x"+l.toString(16)),f+="&#"+l+";";return f}var _r=function(){function o(c){this.tokens=[],this.tokens.links=Object.create(null),this.options=c||Se.defaults,this.options.tokenizer=this.options.tokenizer||new dn,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};var l={block:se.normal,inline:te.normal};this.options.pedantic?(l.block=se.pedantic,l.inline=te.pedantic):this.options.gfm&&(l.block=se.gfm,this.options.breaks?l.inline=te.breaks:l.inline=te.gfm),this.tokenizer.rules=l}o.lex=function(l,s){var g=new o(s);return g.lex(l)},o.lexInline=function(l,s){var g=new o(s);return g.inlineTokens(l)};var f=o.prototype;return f.lex=function(l){l=l.replace(/\r\n|\r/g,` -`),this.blockTokens(l,this.tokens);for(var s;s=this.inlineQueue.shift();)this.inlineTokens(s.src,s.tokens);return this.tokens},f.blockTokens=function(l,s){var g=this;s===void 0&&(s=[]),this.options.pedantic?l=l.replace(/\t/g," ").replace(/^ +$/gm,""):l=l.replace(/^( *)(\t+)/gm,function(S,F,T){return F+" ".repeat(T.length)});for(var d,p,y,w;l;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(S){return(d=S.call({lexer:g},l,s))?(l=l.substring(d.raw.length),s.push(d),!0):!1}))){if(d=this.tokenizer.space(l)){l=l.substring(d.raw.length),d.raw.length===1&&s.length>0?s[s.length-1].raw+=` -`:s.push(d);continue}if(d=this.tokenizer.code(l)){l=l.substring(d.raw.length),p=s[s.length-1],p&&(p.type==="paragraph"||p.type==="text")?(p.raw+=` -`+d.raw,p.text+=` -`+d.text,this.inlineQueue[this.inlineQueue.length-1].src=p.text):s.push(d);continue}if(d=this.tokenizer.fences(l)){l=l.substring(d.raw.length),s.push(d);continue}if(d=this.tokenizer.heading(l)){l=l.substring(d.raw.length),s.push(d);continue}if(d=this.tokenizer.hr(l)){l=l.substring(d.raw.length),s.push(d);continue}if(d=this.tokenizer.blockquote(l)){l=l.substring(d.raw.length),s.push(d);continue}if(d=this.tokenizer.list(l)){l=l.substring(d.raw.length),s.push(d);continue}if(d=this.tokenizer.html(l)){l=l.substring(d.raw.length),s.push(d);continue}if(d=this.tokenizer.def(l)){l=l.substring(d.raw.length),p=s[s.length-1],p&&(p.type==="paragraph"||p.type==="text")?(p.raw+=` -`+d.raw,p.text+=` -`+d.raw,this.inlineQueue[this.inlineQueue.length-1].src=p.text):this.tokens.links[d.tag]||(this.tokens.links[d.tag]={href:d.href,title:d.title});continue}if(d=this.tokenizer.table(l)){l=l.substring(d.raw.length),s.push(d);continue}if(d=this.tokenizer.lheading(l)){l=l.substring(d.raw.length),s.push(d);continue}if(y=l,this.options.extensions&&this.options.extensions.startBlock&&function(){var S=1/0,F=l.slice(1),T=void 0;g.options.extensions.startBlock.forEach(function(z){T=z.call({lexer:this},F),typeof T=="number"&&T>=0&&(S=Math.min(S,T))}),S<1/0&&S>=0&&(y=l.substring(0,S+1))}(),this.state.top&&(d=this.tokenizer.paragraph(y))){p=s[s.length-1],w&&p.type==="paragraph"?(p.raw+=` -`+d.raw,p.text+=` -`+d.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=p.text):s.push(d),w=y.length!==l.length,l=l.substring(d.raw.length);continue}if(d=this.tokenizer.text(l)){l=l.substring(d.raw.length),p=s[s.length-1],p&&p.type==="text"?(p.raw+=` -`+d.raw,p.text+=` -`+d.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=p.text):s.push(d);continue}if(l){var D="Infinite loop on byte: "+l.charCodeAt(0);if(this.options.silent){console.error(D);break}else throw new Error(D)}}return this.state.top=!0,s},f.inline=function(l,s){return s===void 0&&(s=[]),this.inlineQueue.push({src:l,tokens:s}),s},f.inlineTokens=function(l,s){var g=this;s===void 0&&(s=[]);var d,p,y,w=l,D,S,F;if(this.tokens.links){var T=Object.keys(this.tokens.links);if(T.length>0)for(;(D=this.tokenizer.rules.inline.reflinkSearch.exec(w))!=null;)T.includes(D[0].slice(D[0].lastIndexOf("[")+1,-1))&&(w=w.slice(0,D.index)+"["+fu("a",D[0].length-2)+"]"+w.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(D=this.tokenizer.rules.inline.blockSkip.exec(w))!=null;)w=w.slice(0,D.index)+"["+fu("a",D[0].length-2)+"]"+w.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(D=this.tokenizer.rules.inline.escapedEmSt.exec(w))!=null;)w=w.slice(0,D.index+D[0].length-2)+"++"+w.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;l;)if(S||(F=""),S=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(N){return(d=N.call({lexer:g},l,s))?(l=l.substring(d.raw.length),s.push(d),!0):!1}))){if(d=this.tokenizer.escape(l)){l=l.substring(d.raw.length),s.push(d);continue}if(d=this.tokenizer.tag(l)){l=l.substring(d.raw.length),p=s[s.length-1],p&&d.type==="text"&&p.type==="text"?(p.raw+=d.raw,p.text+=d.text):s.push(d);continue}if(d=this.tokenizer.link(l)){l=l.substring(d.raw.length),s.push(d);continue}if(d=this.tokenizer.reflink(l,this.tokens.links)){l=l.substring(d.raw.length),p=s[s.length-1],p&&d.type==="text"&&p.type==="text"?(p.raw+=d.raw,p.text+=d.text):s.push(d);continue}if(d=this.tokenizer.emStrong(l,w,F)){l=l.substring(d.raw.length),s.push(d);continue}if(d=this.tokenizer.codespan(l)){l=l.substring(d.raw.length),s.push(d);continue}if(d=this.tokenizer.br(l)){l=l.substring(d.raw.length),s.push(d);continue}if(d=this.tokenizer.del(l)){l=l.substring(d.raw.length),s.push(d);continue}if(d=this.tokenizer.autolink(l,du)){l=l.substring(d.raw.length),s.push(d);continue}if(!this.state.inLink&&(d=this.tokenizer.url(l,du))){l=l.substring(d.raw.length),s.push(d);continue}if(y=l,this.options.extensions&&this.options.extensions.startInline&&function(){var N=1/0,A=l.slice(1),B=void 0;g.options.extensions.startInline.forEach(function(I){B=I.call({lexer:this},A),typeof B=="number"&&B>=0&&(N=Math.min(N,B))}),N<1/0&&N>=0&&(y=l.substring(0,N+1))}(),d=this.tokenizer.inlineText(y,hd)){l=l.substring(d.raw.length),d.raw.slice(-1)!=="_"&&(F=d.raw.slice(-1)),S=!0,p=s[s.length-1],p&&p.type==="text"?(p.raw+=d.raw,p.text+=d.text):s.push(d);continue}if(l){var z="Infinite loop on byte: "+l.charCodeAt(0);if(this.options.silent){console.error(z);break}else throw new Error(z)}}return s},Yc(o,null,[{key:"rules",get:function(){return{block:se,inline:te}}}]),o}(),hn=function(){function o(c){this.options=c||Se.defaults}var f=o.prototype;return f.code=function(l,s,g){var d=(s||"").match(/\S*/)[0];if(this.options.highlight){var p=this.options.highlight(l,d);p!=null&&p!==l&&(g=!0,l=p)}return l=l.replace(/\n$/,"")+` -`,d?'
'+(g?l:et(l,!0))+`
-`:"
"+(g?l:et(l,!0))+`
-`},f.blockquote=function(l){return`
-`+l+`
-`},f.html=function(l){return l},f.heading=function(l,s,g,d){if(this.options.headerIds){var p=this.options.headerPrefix+d.slug(g);return"'+l+" -`}return""+l+" -`},f.hr=function(){return this.options.xhtml?`
+`)&&(H=W=G(H.line,0)));var Y={from:H,to:W,text:m?m[B%m.length]:v,origin:i||(g?"paste":e.state.cutIncoming>d?"cut":"+input")};fn(e.doc,Y),et(e,"inputRead",e,Y)}t&&!g&&qu(e,t),an(e),e.curOp.updateInput<2&&(e.curOp.updateInput=k),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Wu(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()&&kt(t,function(){return Ja(t,n,0,null,"paste")}),!0}function qu(e,t){if(!(!e.options.electricChars||!e.options.smartIndent))for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var u=e.getModeAt(i.head),d=!1;if(u.electricChars){for(var g=0;g-1){d=li(e,i.head.line,"smart");break}}else u.electricInput&&u.electricInput.test(oe(e.doc,i.head.line).text.slice(0,i.head.ch))&&(d=li(e,i.head.line,"smart"));d&&et(e,"electricInput",e,i.head.line)}}}function Uu(e){for(var t=[],n=[],r=0;ru&&(li(this,g.head.line,r,!0),u=g.head.line,d==this.doc.sel.primIndex&&an(this));else{var v=g.from(),m=g.to(),w=Math.max(u,v.line);u=Math.min(this.lastLine(),m.line-(m.ch?0:1))+1;for(var k=w;k0&&Ua(this.doc,d,new Ee(v,B[d].to()),vt)}}}),getTokenAt:function(r,i){return es(this,r,i)},getLineTokens:function(r,i){return es(this,G(r),i,!0)},getTokenTypeAt:function(r){r=ve(this.doc,r);var i=Jl(this,oe(this.doc,r.line)),u=0,d=(i.length-1)/2,g=r.ch,v;if(g==0)v=i[2];else for(;;){var m=u+d>>1;if((m?i[m*2-1]:0)>=g)d=m;else if(i[m*2+1]v&&(r=v,d=!0),g=oe(this.doc,r)}else g=r;return Ni(this,g,{top:0,left:0},i||"page",u||d).top+(d?this.doc.height-nr(g):0)},defaultTextHeight:function(){return rn(this.display)},defaultCharWidth:function(){return nn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,i,u,d,g){var v=this.display;r=Wt(this,ve(this.doc,r));var m=r.bottom,w=r.left;if(i.style.position="absolute",i.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(i),v.sizer.appendChild(i),d=="over")m=r.top;else if(d=="above"||d=="near"){var k=Math.max(v.wrapper.clientHeight,this.doc.height),B=Math.max(v.sizer.clientWidth,v.lineSpace.clientWidth);(d=="above"||r.bottom+i.offsetHeight>k)&&r.top>i.offsetHeight?m=r.top-i.offsetHeight:r.bottom+i.offsetHeight<=k&&(m=r.bottom),w+i.offsetWidth>B&&(w=B-i.offsetWidth)}i.style.top=m+"px",i.style.left=i.style.right="",g=="right"?(w=v.sizer.clientWidth-i.offsetWidth,i.style.right="0px"):(g=="left"?w=0:g=="middle"&&(w=(v.sizer.clientWidth-i.offsetWidth)/2),i.style.left=w+"px"),u&&Od(this,{left:w,top:m,right:w+i.offsetWidth,bottom:m+i.offsetHeight})},triggerOnKeyDown:ct(_u),triggerOnKeyPress:ct(Nu),triggerOnKeyUp:Bu,triggerOnMouseDown:ct(Ou),execCommand:function(r){if(ni.hasOwnProperty(r))return ni[r].call(null,this)},triggerElectric:ct(function(r){qu(this,r)}),findPosH:function(r,i,u,d){var g=1;i<0&&(g=-1,i=-i);for(var v=ve(this.doc,r),m=0;m0&&w(u.charAt(d-1));)--d;for(;g.5||this.options.lineWrapping)&&Ea(this),je(this,"refresh",this)}),swapDoc:ct(function(r){var i=this.doc;return i.cm=null,this.state.selectingText&&this.state.selectingText(),$s(this,r),Rn(this),this.display.input.reset(),qn(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,et(this,"swapDoc",this,i),i}),phrase:function(r){var i=this.options.phrases;return i&&Object.prototype.hasOwnProperty.call(i,r)?i[r]:r},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Qr(e),e.registerHelper=function(r,i,u){n.hasOwnProperty(r)||(n[r]=e[r]={_global:[]}),n[r][i]=u},e.registerGlobalHelper=function(r,i,u,d){e.registerHelper(r,i,d),n[r]._global.push({pred:u,val:d})}}function Va(e,t,n,r,i){var u=t,d=n,g=oe(e,t.line),v=i&&e.direction=="rtl"?-n:n;function m(){var V=t.line+v;return V=e.first+e.size?!1:(t=new G(V,t.ch,t.sticky),g=oe(e,V))}function w(V){var J;if(r=="codepoint"){var re=g.text.charCodeAt(t.ch+(n>0?0:-1));if(isNaN(re))J=null;else{var se=n>0?re>=55296&&re<56320:re>=56320&&re<57343;J=new G(t.line,Math.max(0,Math.min(g.text.length,t.ch+n*(se?2:1))),-n)}}else i?J=yh(e.cm,g,t,n):J=Ga(g,t,n);if(J==null)if(!V&&m())t=Xa(i,e.cm,g,t.line,v);else return!1;else t=J;return!0}if(r=="char"||r=="codepoint")w();else if(r=="column")w(!0);else if(r=="word"||r=="group")for(var k=null,B=r=="group",M=e.cm&&e.cm.getHelper(t,"wordChars"),H=!0;!(n<0&&!w(!H));H=!1){var W=g.text.charAt(t.ch)||` +`,Y=wi(W,M)?"w":B&&W==` +`?"n":!B||/\s/.test(W)?null:"p";if(B&&!H&&!Y&&(Y="s"),k&&k!=Y){n<0&&(n=1,w(),t.sticky="after");break}if(Y&&(k=Y),n>0&&!w(!H))break}var Q=Ki(e,t,u,d,!0);return la(u,Q)&&(Q.hitSide=!0),Q}function Gu(e,t,n,r){var i=e.doc,u=t.left,d;if(r=="page"){var g=Math.min(e.display.wrapper.clientHeight,ye(e).innerHeight||i(e).documentElement.clientHeight),v=Math.max(g-.5*rn(e.display),3);d=(n>0?t.bottom:t.top)+n*v}else r=="line"&&(d=n>0?t.bottom+3:t.top-3);for(var m;m=wa(e,u,d),!!m.outside;){if(n<0?d<=0:d>=i.height){m.hitSide=!0;break}d+=n*5}return m}var Fe=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new ft,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Fe.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;i.contentEditable=!0,$a(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function u(g){for(var v=g.target;v;v=v.parentNode){if(v==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(v.className))break}return!1}fe(i,"paste",function(g){!u(g)||Ve(r,g)||Wu(g,r)||h<=11&&setTimeout(tt(r,function(){return t.updateFromDOM()}),20)}),fe(i,"compositionstart",function(g){t.composing={data:g.data,done:!1}}),fe(i,"compositionupdate",function(g){t.composing||(t.composing={data:g.data,done:!1})}),fe(i,"compositionend",function(g){t.composing&&(g.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),fe(i,"touchstart",function(){return n.forceCompositionEnd()}),fe(i,"input",function(){t.composing||t.readFromDOMSoon()});function d(g){if(!(!u(g)||Ve(r,g))){if(r.somethingSelected())Vi({lineWise:!1,text:r.getSelections()}),g.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var v=Uu(r);Vi({lineWise:!0,text:v.text}),g.type=="cut"&&r.operation(function(){r.setSelections(v.ranges,0,vt),r.replaceSelection("",null,"cut")})}else return;if(g.clipboardData){g.clipboardData.clearData();var m=Ut.text.join(` +`);if(g.clipboardData.setData("Text",m),g.clipboardData.getData("Text")==m){g.preventDefault();return}}var w=ju(),k=w.firstChild;$a(k),r.display.lineSpace.insertBefore(w,r.display.lineSpace.firstChild),k.value=Ut.text.join(` +`);var B=ue(Se(i));A(k),setTimeout(function(){r.display.lineSpace.removeChild(w),B.focus(),B==i&&n.showPrimarySelection()},50)}}fe(i,"copy",d),fe(i,"cut",d)},Fe.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Fe.prototype.prepareSelection=function(){var e=Os(this.cm,!1);return e.focus=ue(Se(this.div))==this.div,e},Fe.prototype.showSelection=function(e,t){!e||!this.cm.display.view.length||((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Fe.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Fe.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,n=t.doc.sel.primary(),r=n.from(),i=n.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||i.line=t.display.viewFrom&&Xu(t,r)||{node:g[0].measure.map[2],offset:0},m=i.linee.firstLine()&&(r=G(r.line-1,oe(e.doc,r.line-1).length)),i.ch==oe(e.doc,i.line).text.length&&i.linet.viewTo-1)return!1;var u,d,g;r.line==t.viewFrom||(u=Ir(e,r.line))==0?(d=Ae(t.view[0].line),g=t.view[0].node):(d=Ae(t.view[u].line),g=t.view[u-1].node.nextSibling);var v=Ir(e,i.line),m,w;if(v==t.view.length-1?(m=t.viewTo-1,w=t.lineDiv.lastChild):(m=Ae(t.view[v+1].line)-1,w=t.view[v+1].node.previousSibling),!g)return!1;for(var k=e.doc.splitLines(Rh(e,g,w,d,m)),B=Mr(e.doc,G(d,0),G(m,oe(e.doc,m).text.length));k.length>1&&B.length>1;)if(we(k)==we(B))k.pop(),B.pop(),m--;else if(k[0]==B[0])k.shift(),B.shift(),d++;else break;for(var M=0,H=0,W=k[0],Y=B[0],Q=Math.min(W.length,Y.length);Mr.ch&&V.charCodeAt(V.length-H-1)==J.charCodeAt(J.length-H-1);)M--,H++;k[k.length-1]=V.slice(0,V.length-H).replace(/^\u200b+/,""),k[0]=k[0].slice(M).replace(/\u200b+$/,"");var se=G(d,M),ae=G(m,B.length?we(B).length-H:0);if(k.length>1||k[0]||ge(se,ae))return cn(e.doc,k,se,ae,"+input"),!0},Fe.prototype.ensurePolled=function(){this.forceCompositionEnd()},Fe.prototype.reset=function(){this.forceCompositionEnd()},Fe.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Fe.prototype.readFromDOMSoon=function(){var e=this;this.readDOMTimeout==null&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80))},Fe.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&kt(this.cm,function(){return bt(e.cm)})},Fe.prototype.setUneditable=function(e){e.contentEditable="false"},Fe.prototype.onKeyPress=function(e){e.charCode==0||this.composing||(e.preventDefault(),this.cm.isReadOnly()||tt(this.cm,Ja)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0))},Fe.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Fe.prototype.onContextMenu=function(){},Fe.prototype.resetPosition=function(){},Fe.prototype.needsContentAttribute=!0;function Xu(e,t){var n=ya(e,t.line);if(!n||n.hidden)return null;var r=oe(e.doc,t.line),i=Ds(n,r,t.line),u=tr(r,e.doc.direction),d="left";if(u){var g=_n(u,t.ch);d=g%2?"right":"left"}var v=ks(i.map,t.ch,d);return v.offset=v.collapse=="right"?v.end:v.start,v}function Hh(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function vn(e,t){return t&&(e.bad=!0),e}function Rh(e,t,n,r,i){var u="",d=!1,g=e.doc.lineSeparator(),v=!1;function m(M){return function(H){return H.id==M}}function w(){d&&(u+=g,v&&(u+=g),d=v=!1)}function k(M){M&&(w(),u+=M)}function B(M){if(M.nodeType==1){var H=M.getAttribute("cm-text");if(H){k(H);return}var W=M.getAttribute("cm-marker"),Y;if(W){var Q=e.findMarks(G(r,0),G(i+1,0),m(+W));Q.length&&(Y=Q[0].find(0))&&k(Mr(e.doc,Y.from,Y.to).join(g));return}if(M.getAttribute("contenteditable")=="false")return;var V=/^(pre|div|p|li|table|br)$/i.test(M.nodeName);if(!/^br$/i.test(M.nodeName)&&M.textContent.length==0)return;V&&w();for(var J=0;J=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),fe(i,"paste",function(d){Ve(r,d)||Wu(d,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())});function u(d){if(!Ve(r,d)){if(r.somethingSelected())Vi({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var g=Uu(r);Vi({lineWise:!0,text:g.text}),d.type=="cut"?r.setSelections(g.ranges,null,vt):(n.prevInput="",i.value=g.text.join(` +`),A(i))}else return;d.type=="cut"&&(r.state.cutIncoming=+new Date)}}fe(i,"cut",u),fe(i,"copy",u),fe(e.scroller,"paste",function(d){if(!(ir(e,d)||Ve(r,d))){if(!i.dispatchEvent){r.state.pasteIncoming=+new Date,n.focus();return}var g=new Event("paste");g.clipboardData=d.clipboardData,i.dispatchEvent(g)}}),fe(e.lineSpace,"selectstart",function(d){ir(e,d)||mt(d)}),fe(i,"compositionstart",function(){var d=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:d,range:r.markText(d,r.getCursor("to"),{className:"CodeMirror-composing"})}}),fe(i,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},We.prototype.createField=function(e){this.wrapper=ju(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;$a(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},We.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},We.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=Os(e);if(e.options.moveInputWithCursor){var i=Wt(e,n.sel.primary().head,"div"),u=t.wrapper.getBoundingClientRect(),d=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+d.top-u.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+d.left-u.left))}return r},We.prototype.showSelection=function(e){var t=this.cm,n=t.display;K(n.cursorDiv,e.cursors),K(n.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},We.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing&&e)){var t=this.cm;if(this.resetting=!0,t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&A(this.textarea),c&&h>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",c&&h>=9&&(this.hasSelection=null));this.resetting=!1}},We.prototype.getField=function(){return this.textarea},We.prototype.supportsTouch=function(){return!1},We.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!N||ue(Se(this.textarea))!=this.textarea))try{this.textarea.focus()}catch{}},We.prototype.blur=function(){this.textarea.blur()},We.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},We.prototype.receivedFocus=function(){this.slowPoll()},We.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},We.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function n(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,n)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,n)},We.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||Rc(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(c&&h>=9&&this.hasSelection===i||P&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var u=i.charCodeAt(0);if(u==8203&&!r&&(r="\u200B"),u==8666)return this.reset(),this.cm.execCommand("undo")}for(var d=0,g=Math.min(r.length,i.length);d1e3||i.indexOf(` +`)>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},We.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},We.prototype.onKeyPress=function(){c&&h>=9&&(this.hasSelection=null),this.fastPoll()},We.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var u=Or(n,e),d=r.scroller.scrollTop;if(!u||S)return;var g=n.options.resetSelectionOnContextMenu;g&&n.doc.sel.contains(u)==-1&&tt(n,lt)(n.doc,yr(u),vt);var v=i.style.cssText,m=t.wrapper.style.cssText,w=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",i.style.cssText=`position: absolute; width: 30px; height: 30px; + top: `+(e.clientY-w.top-5)+"px; left: "+(e.clientX-w.left-5)+`px; + z-index: 1000; background: `+(c?"rgba(255, 255, 255, .05)":"transparent")+`; + outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var k;b&&(k=i.ownerDocument.defaultView.scrollY),r.input.focus(),b&&i.ownerDocument.defaultView.scrollTo(null,k),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=M,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll);function B(){if(i.selectionStart!=null){var W=n.somethingSelected(),Y="\u200B"+(W?i.value:"");i.value="\u21DA",i.value=Y,t.prevInput=W?"":"\u200B",i.selectionStart=1,i.selectionEnd=Y.length,r.selForContextMenu=n.doc.sel}}function M(){if(t.contextMenuPending==M&&(t.contextMenuPending=!1,t.wrapper.style.cssText=m,i.style.cssText=v,c&&h<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=d),i.selectionStart!=null)){(!c||c&&h<9)&&B();var W=0,Y=function(){r.selForContextMenu==n.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput=="\u200B"?tt(n,cu)(n):W++<10?r.detectingSelectAll=setTimeout(Y,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(Y,200)}}if(c&&h>=9&&B(),me){Bn(e);var H=function(){Lt(window,"mouseup",H),setTimeout(M,20)};fe(window,"mouseup",H)}else setTimeout(M,50)},We.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},We.prototype.setUneditable=function(){},We.prototype.needsContentAttribute=!1;function qh(e,t){if(t=t?Tt(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var n=ue(Se(e));t.autofocus=n==e||e.getAttribute("autofocus")!=null&&n==document.body}function r(){e.value=g.getValue()}var i;if(e.form&&(fe(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var u=e.form;i=u.submit;try{var d=u.submit=function(){r(),u.submit=i,u.submit(),u.submit=d}}catch{}}t.finishInit=function(v){v.save=r,v.getTextArea=function(){return e},v.toTextArea=function(){v.toTextArea=isNaN,r(),e.parentNode.removeChild(v.getWrapperElement()),e.style.display="",e.form&&(Lt(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=i))}},e.style.display="none";var g=Ne(function(v){return e.parentNode.insertBefore(v,e.nextSibling)},t);return g}function Uh(e){e.off=Lt,e.on=fe,e.wheelEventPixels=Qd,e.Doc=yt,e.splitLines=ea,e.countColumn=Ye,e.findColumn=Kt,e.isWordChar=Ko,e.Pass=Ze,e.signal=je,e.Line=Vr,e.changeEnd=xr,e.scrollbarModel=Ws,e.Pos=G,e.cmpPos=ge,e.modes=ra,e.mimeModes=Jr,e.resolveMode=Ci,e.getMode=na,e.modeExtensions=$r,e.extendMode=Gc,e.copyState=Lr,e.startState=Kl,e.innerMode=ia,e.commands=ni,e.keyMap=ar,e.keyName=Au,e.isModifierKey=Su,e.lookupKey=hn,e.normalizeKeyMap=bh,e.StringStream=Ge,e.SharedTextMarker=ei,e.TextMarker=wr,e.LineWidget=Vn,e.e_preventDefault=mt,e.e_stopPropagation=Gl,e.e_stop=Bn,e.addClass=De,e.contains=Z,e.rmClass=le,e.keyNames=Cr}Nh(Ne),zh(Ne);var jh="iter insert remove copy getEditor constructor".split(" ");for(var to in yt.prototype)yt.prototype.hasOwnProperty(to)&&Be(jh,to)<0&&(Ne.prototype[to]=function(e){return function(){return e.apply(this.doc,arguments)}}(yt.prototype[to]));return Qr(yt),Ne.inputStyles={textarea:We,contenteditable:Fe},Ne.defineMode=function(e){!Ne.defaults.mode&&e!="null"&&(Ne.defaults.mode=e),Uc.apply(this,arguments)},Ne.defineMIME=jc,Ne.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Ne.defineMIME("text/plain","null"),Ne.defineExtension=function(e,t){Ne.prototype[e]=t},Ne.defineDocExtension=function(e,t){yt.prototype[e]=t},Ne.fromTextArea=qh,Uh(Ne),Ne.version="5.65.21",Ne})});var Qu=at((Yu,Zu)=>{(function(o){typeof Yu=="object"&&typeof Zu=="object"?o(Et()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";var l=/^(\s*)(>[> ]*|[*+-] \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/,s=/^(\s*)(>[> ]*|[*+-] \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/,a=/[*+-]\s/;o.commands.newlineAndIndentContinueMarkdownList=function(p){if(p.getOption("disableInput"))return o.Pass;for(var c=p.listSelections(),h=[],b=0;b\s*$/.test(_),N=!/>\s*$/.test(_);(O||N)&&p.replaceRange("",{line:y.line,ch:0},{line:y.line,ch:y.ch+1}),h[b]=` +`}else{var P=L[1],I=L[5],q=!(a.test(L[2])||L[2].indexOf(">")>=0),j=q?parseInt(L[3],10)+1+L[4]:L[2].replace("x"," ");h[b]=` +`+P+j+I,q&&f(p,y)}}p.replaceSelections(h)};function f(p,c){var h=c.line,b=0,y=0,x=l.exec(p.getLine(h)),C=x[1];do{b+=1;var S=h+b,F=p.getLine(S),_=l.exec(F);if(_){var L=_[1],T=parseInt(x[3],10)+b-y,O=parseInt(_[3],10),N=O;if(C===L&&!isNaN(O))T===O&&(N=O+1),T>O&&(N=T+1),p.replaceRange(F.replace(l,L+N+_[4]+_[5]),{line:S,ch:0},{line:S,ch:F.length});else{if(C.length>L.length||C.length{var Ju=Et();Ju.commands.tabAndIndentMarkdownList=function(o){var l=o.listSelections(),s=l[0].head,a=o.getStateAfter(s.line),f=a.list!==!1;if(f){o.execCommand("indentMore");return}if(o.options.indentWithTabs)o.execCommand("insertTab");else{var p=Array(o.options.tabSize+1).join(" ");o.replaceSelection(p)}};Ju.commands.shiftTabAndUnindentMarkdownList=function(o){var l=o.listSelections(),s=l[0].head,a=o.getStateAfter(s.line),f=a.list!==!1;if(f){o.execCommand("indentLess");return}if(o.options.indentWithTabs)o.execCommand("insertTab");else{var p=Array(o.options.tabSize+1).join(" ");o.replaceSelection(p)}}});var tf=at((Vu,ef)=>{(function(o){typeof Vu=="object"&&typeof ef=="object"?o(Et()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";o.defineOption("fullScreen",!1,function(a,f,p){p==o.Init&&(p=!1),!p!=!f&&(f?l(a):s(a))});function l(a){var f=a.getWrapperElement();a.state.fullScreenRestore={scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,width:f.style.width,height:f.style.height},f.style.width="",f.style.height="auto",f.className+=" CodeMirror-fullscreen",document.documentElement.style.overflow="hidden",a.refresh()}function s(a){var f=a.getWrapperElement();f.className=f.className.replace(/\s*CodeMirror-fullscreen\b/,""),document.documentElement.style.overflow="";var p=a.state.fullScreenRestore;f.style.width=p.width,f.style.height=p.height,window.scrollTo(p.scrollLeft,p.scrollTop),a.refresh()}})});var il=at((rf,nf)=>{(function(o){typeof rf=="object"&&typeof nf=="object"?o(Et()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";var l={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},s={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};o.defineMode("xml",function(a,f){var p=a.indentUnit,c={},h=f.htmlMode?l:s;for(var b in h)c[b]=h[b];for(var b in f)c[b]=f[b];var y,x;function C(E,z){function R(De){return z.tokenize=De,De(E,z)}var Z=E.next();if(Z=="<")return E.eat("!")?E.eat("[")?E.match("CDATA[")?R(_("atom","]]>")):null:E.match("--")?R(_("comment","-->")):E.match("DOCTYPE",!0,!0)?(E.eatWhile(/[\w\._\-]/),R(L(1))):null:E.eat("?")?(E.eatWhile(/[\w\._\-]/),z.tokenize=_("meta","?>"),"meta"):(y=E.eat("/")?"closeTag":"openTag",z.tokenize=S,"tag bracket");if(Z=="&"){var ue;return E.eat("#")?E.eat("x")?ue=E.eatWhile(/[a-fA-F\d]/)&&E.eat(";"):ue=E.eatWhile(/[\d]/)&&E.eat(";"):ue=E.eatWhile(/[\w\.\-:]/)&&E.eat(";"),ue?"atom":"error"}else return E.eatWhile(/[^&<]/),null}C.isInText=!0;function S(E,z){var R=E.next();if(R==">"||R=="/"&&E.eat(">"))return z.tokenize=C,y=R==">"?"endTag":"selfcloseTag","tag bracket";if(R=="=")return y="equals",null;if(R=="<"){z.tokenize=C,z.state=I,z.tagName=z.tagStart=null;var Z=z.tokenize(E,z);return Z?Z+" tag error":"tag error"}else return/[\'\"]/.test(R)?(z.tokenize=F(R),z.stringStartCol=E.column(),z.tokenize(E,z)):(E.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function F(E){var z=function(R,Z){for(;!R.eol();)if(R.next()==E){Z.tokenize=S;break}return"string"};return z.isInAttribute=!0,z}function _(E,z){return function(R,Z){for(;!R.eol();){if(R.match(z)){Z.tokenize=C;break}R.next()}return E}}function L(E){return function(z,R){for(var Z;(Z=z.next())!=null;){if(Z=="<")return R.tokenize=L(E+1),R.tokenize(z,R);if(Z==">")if(E==1){R.tokenize=C;break}else return R.tokenize=L(E-1),R.tokenize(z,R)}return"meta"}}function T(E){return E&&E.toLowerCase()}function O(E,z,R){this.prev=E.context,this.tagName=z||"",this.indent=E.indented,this.startOfLine=R,(c.doNotIndent.hasOwnProperty(z)||E.context&&E.context.noIndent)&&(this.noIndent=!0)}function N(E){E.context&&(E.context=E.context.prev)}function P(E,z){for(var R;;){if(!E.context||(R=E.context.tagName,!c.contextGrabbers.hasOwnProperty(T(R))||!c.contextGrabbers[T(R)].hasOwnProperty(T(z))))return;N(E)}}function I(E,z,R){return E=="openTag"?(R.tagStart=z.column(),q):E=="closeTag"?j:I}function q(E,z,R){return E=="word"?(R.tagName=z.current(),x="tag",U):c.allowMissingTagName&&E=="endTag"?(x="tag bracket",U(E,z,R)):(x="error",q)}function j(E,z,R){if(E=="word"){var Z=z.current();return R.context&&R.context.tagName!=Z&&c.implicitlyClosed.hasOwnProperty(T(R.context.tagName))&&N(R),R.context&&R.context.tagName==Z||c.matchClosing===!1?(x="tag",X):(x="tag error",me)}else return c.allowMissingTagName&&E=="endTag"?(x="tag bracket",X(E,z,R)):(x="error",me)}function X(E,z,R){return E!="endTag"?(x="error",X):(N(R),I)}function me(E,z,R){return x="error",X(E,z,R)}function U(E,z,R){if(E=="word")return x="attribute",le;if(E=="endTag"||E=="selfcloseTag"){var Z=R.tagName,ue=R.tagStart;return R.tagName=R.tagStart=null,E=="selfcloseTag"||c.autoSelfClosers.hasOwnProperty(T(Z))?P(R,Z):(P(R,Z),R.context=new O(R,Z,ue==R.indented)),I}return x="error",U}function le(E,z,R){return E=="equals"?ie:(c.allowMissing||(x="error"),U(E,z,R))}function ie(E,z,R){return E=="string"?K:E=="word"&&c.allowUnquoted?(x="string",U):(x="error",U(E,z,R))}function K(E,z,R){return E=="string"?K:U(E,z,R)}return{startState:function(E){var z={tokenize:C,state:I,indented:E||0,tagName:null,tagStart:null,context:null};return E!=null&&(z.baseIndent=E),z},token:function(E,z){if(!z.tagName&&E.sol()&&(z.indented=E.indentation()),E.eatSpace())return null;y=null;var R=z.tokenize(E,z);return(R||y)&&R!="comment"&&(x=null,z.state=z.state(y||R,E,z),x&&(R=x=="error"?R+" error":x)),R},indent:function(E,z,R){var Z=E.context;if(E.tokenize.isInAttribute)return E.tagStart==E.indented?E.stringStartCol+1:E.indented+p;if(Z&&Z.noIndent)return o.Pass;if(E.tokenize!=S&&E.tokenize!=C)return R?R.match(/^(\s*)/)[0].length:0;if(E.tagName)return c.multilineTagIndentPastTag!==!1?E.tagStart+E.tagName.length+2:E.tagStart+p*(c.multilineTagIndentFactor||1);if(c.alignCDATA&&/$/,blockCommentStart:"",configuration:c.htmlMode?"html":"xml",helperType:c.htmlMode?"html":"xml",skipAttribute:function(E){E.state==ie&&(E.state=U)},xmlCurrentTag:function(E){return E.tagName?{name:E.tagName,close:E.type=="closeTag"}:null},xmlCurrentContext:function(E){for(var z=[],R=E.context;R;R=R.prev)z.push(R.tagName);return z.reverse()}}}),o.defineMIME("text/xml","xml"),o.defineMIME("application/xml","xml"),o.mimeModes.hasOwnProperty("text/html")||o.defineMIME("text/html",{name:"xml",htmlMode:!0})})});var lf=at((of,af)=>{(function(o){typeof of=="object"&&typeof af=="object"?o(Et()):typeof define=="function"&&define.amd?define(["../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";o.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy","cbl"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded JavaScript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"],alias:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var l=0;l-1&&a.substring(c+1,a.length);if(h)return o.findModeByExtension(h)},o.findModeByName=function(a){a=a.toLowerCase();for(var f=0;f{(function(o){typeof sf=="object"&&typeof uf=="object"?o(Et(),il(),lf()):typeof define=="function"&&define.amd?define(["../../lib/codemirror","../xml/xml","../meta"],o):o(CodeMirror)})(function(o){"use strict";o.defineMode("markdown",function(l,s){var a=o.getMode(l,"text/html"),f=a.name=="null";function p(A){if(o.findModeByName){var D=o.findModeByName(A);D&&(A=D.mime||D.mimes[0])}var ee=o.getMode(l,A);return ee.name=="null"?null:ee}s.highlightFormatting===void 0&&(s.highlightFormatting=!1),s.maxBlockquoteDepth===void 0&&(s.maxBlockquoteDepth=0),s.taskLists===void 0&&(s.taskLists=!1),s.strikethrough===void 0&&(s.strikethrough=!1),s.emoji===void 0&&(s.emoji=!1),s.fencedCodeBlockHighlighting===void 0&&(s.fencedCodeBlockHighlighting=!0),s.fencedCodeBlockDefaultMode===void 0&&(s.fencedCodeBlockDefaultMode="text/plain"),s.xml===void 0&&(s.xml=!0),s.tokenTypeOverrides===void 0&&(s.tokenTypeOverrides={});var c={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var h in c)c.hasOwnProperty(h)&&s.tokenTypeOverrides[h]&&(c[h]=s.tokenTypeOverrides[h]);var b=/^([*\-_])(?:\s*\1){2,}\s*$/,y=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,x=/^\[(x| )\](?=\s)/i,C=s.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,S=/^ {0,3}(?:\={1,}|-{2,})\s*$/,F=/^[^#!\[\]*_\\<>` "'(~:]+/,_=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,L=/^\s*\[[^\]]+?\]:.*$/,T=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,O=" ";function N(A,D,ee){return D.f=D.inline=ee,ee(A,D)}function P(A,D,ee){return D.f=D.block=ee,ee(A,D)}function I(A){return!A||!/\S/.test(A.string)}function q(A){if(A.linkTitle=!1,A.linkHref=!1,A.linkText=!1,A.em=!1,A.strong=!1,A.strikethrough=!1,A.quote=0,A.indentedCode=!1,A.f==X){var D=f;if(!D){var ee=o.innerMode(a,A.htmlState);D=ee.mode.name=="xml"&&ee.state.tagStart===null&&!ee.state.context&&ee.state.tokenize.isInText}D&&(A.f=ie,A.block=j,A.htmlState=null)}return A.trailingSpace=0,A.trailingSpaceNewLine=!1,A.prevLine=A.thisLine,A.thisLine={stream:null},null}function j(A,D){var ee=A.column()===D.indentation,Se=I(D.prevLine.stream),ye=D.indentedCode,gt=D.prevLine.hr,Tt=D.list!==!1,Ye=(D.listStack[D.listStack.length-1]||0)+3;D.indentedCode=!1;var ft=D.indentation;if(D.indentationDiff===null&&(D.indentationDiff=D.indentation,Tt)){for(D.list=null;ft=4&&(ye||D.prevLine.fencedCodeEnd||D.prevLine.header||Se))return A.skipToEnd(),D.indentedCode=!0,c.code;if(A.eatSpace())return null;if(ee&&D.indentation<=Ye&&(Ze=A.match(C))&&Ze[1].length<=6)return D.quote=0,D.header=Ze[1].length,D.thisLine.header=!0,s.highlightFormatting&&(D.formatting="header"),D.f=D.inline,U(D);if(D.indentation<=Ye&&A.eat(">"))return D.quote=ee?1:D.quote+1,s.highlightFormatting&&(D.formatting="quote"),A.eatSpace(),U(D);if(!ze&&!D.setext&&ee&&D.indentation<=Ye&&(Ze=A.match(y))){var vt=Ze[1]?"ol":"ul";return D.indentation=ft+A.current().length,D.list=!0,D.quote=0,D.listStack.push(D.indentation),D.em=!1,D.strong=!1,D.code=!1,D.strikethrough=!1,s.taskLists&&A.match(x,!1)&&(D.taskList=!0),D.f=D.inline,s.highlightFormatting&&(D.formatting=["list","list-"+vt]),U(D)}else{if(ee&&D.indentation<=Ye&&(Ze=A.match(_,!0)))return D.quote=0,D.fencedEndRE=new RegExp(Ze[1]+"+ *$"),D.localMode=s.fencedCodeBlockHighlighting&&p(Ze[2]||s.fencedCodeBlockDefaultMode),D.localMode&&(D.localState=o.startState(D.localMode)),D.f=D.block=me,s.highlightFormatting&&(D.formatting="code-block"),D.code=-1,U(D);if(D.setext||(!Be||!Tt)&&!D.quote&&D.list===!1&&!D.code&&!ze&&!L.test(A.string)&&(Ze=A.lookAhead(1))&&(Ze=Ze.match(S)))return D.setext?(D.header=D.setext,D.setext=0,A.skipToEnd(),s.highlightFormatting&&(D.formatting="header")):(D.header=Ze[0].charAt(0)=="="?1:2,D.setext=D.header),D.thisLine.header=!0,D.f=D.inline,U(D);if(ze)return A.skipToEnd(),D.hr=!0,D.thisLine.hr=!0,c.hr;if(A.peek()==="[")return N(A,D,Z)}return N(A,D,D.inline)}function X(A,D){var ee=a.token(A,D.htmlState);if(!f){var Se=o.innerMode(a,D.htmlState);(Se.mode.name=="xml"&&Se.state.tagStart===null&&!Se.state.context&&Se.state.tokenize.isInText||D.md_inside&&A.current().indexOf(">")>-1)&&(D.f=ie,D.block=j,D.htmlState=null)}return ee}function me(A,D){var ee=D.listStack[D.listStack.length-1]||0,Se=D.indentation=A.quote?D.push(c.formatting+"-"+A.formatting[ee]+"-"+A.quote):D.push("error"))}if(A.taskOpen)return D.push("meta"),D.length?D.join(" "):null;if(A.taskClosed)return D.push("property"),D.length?D.join(" "):null;if(A.linkHref?D.push(c.linkHref,"url"):(A.strong&&D.push(c.strong),A.em&&D.push(c.em),A.strikethrough&&D.push(c.strikethrough),A.emoji&&D.push(c.emoji),A.linkText&&D.push(c.linkText),A.code&&D.push(c.code),A.image&&D.push(c.image),A.imageAltText&&D.push(c.imageAltText,"link"),A.imageMarker&&D.push(c.imageMarker)),A.header&&D.push(c.header,c.header+"-"+A.header),A.quote&&(D.push(c.quote),!s.maxBlockquoteDepth||s.maxBlockquoteDepth>=A.quote?D.push(c.quote+"-"+A.quote):D.push(c.quote+"-"+s.maxBlockquoteDepth)),A.list!==!1){var Se=(A.listStack.length-1)%3;Se?Se===1?D.push(c.list2):D.push(c.list3):D.push(c.list1)}return A.trailingSpaceNewLine?D.push("trailing-space-new-line"):A.trailingSpace&&D.push("trailing-space-"+(A.trailingSpace%2?"a":"b")),D.length?D.join(" "):null}function le(A,D){if(A.match(F,!0))return U(D)}function ie(A,D){var ee=D.text(A,D);if(typeof ee<"u")return ee;if(D.list)return D.list=null,U(D);if(D.taskList){var Se=A.match(x,!0)[1]===" ";return Se?D.taskOpen=!0:D.taskClosed=!0,s.highlightFormatting&&(D.formatting="task"),D.taskList=!1,U(D)}if(D.taskOpen=!1,D.taskClosed=!1,D.header&&A.match(/^#+$/,!0))return s.highlightFormatting&&(D.formatting="header"),U(D);var ye=A.next();if(D.linkTitle){D.linkTitle=!1;var gt=ye;ye==="("&&(gt=")"),gt=(gt+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Tt="^\\s*(?:[^"+gt+"\\\\]+|\\\\\\\\|\\\\.)"+gt;if(A.match(new RegExp(Tt),!0))return c.linkHref}if(ye==="`"){var Ye=D.formatting;s.highlightFormatting&&(D.formatting="code"),A.eatWhile("`");var ft=A.current().length;if(D.code==0&&(!D.quote||ft==1))return D.code=ft,U(D);if(ft==D.code){var Be=U(D);return D.code=0,Be}else return D.formatting=Ye,U(D)}else if(D.code)return U(D);if(ye==="\\"&&(A.next(),s.highlightFormatting)){var ze=U(D),Ze=c.formatting+"-escape";return ze?ze+" "+Ze:Ze}if(ye==="!"&&A.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return D.imageMarker=!0,D.image=!0,s.highlightFormatting&&(D.formatting="image"),U(D);if(ye==="["&&D.imageMarker&&A.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return D.imageMarker=!1,D.imageAltText=!0,s.highlightFormatting&&(D.formatting="image"),U(D);if(ye==="]"&&D.imageAltText){s.highlightFormatting&&(D.formatting="image");var ze=U(D);return D.imageAltText=!1,D.image=!1,D.inline=D.f=E,ze}if(ye==="["&&!D.image)return D.linkText&&A.match(/^.*?\]/)||(D.linkText=!0,s.highlightFormatting&&(D.formatting="link")),U(D);if(ye==="]"&&D.linkText){s.highlightFormatting&&(D.formatting="link");var ze=U(D);return D.linkText=!1,D.inline=D.f=A.match(/\(.*?\)| ?\[.*?\]/,!1)?E:ie,ze}if(ye==="<"&&A.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){D.f=D.inline=K,s.highlightFormatting&&(D.formatting="link");var ze=U(D);return ze?ze+=" ":ze="",ze+c.linkInline}if(ye==="<"&&A.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){D.f=D.inline=K,s.highlightFormatting&&(D.formatting="link");var ze=U(D);return ze?ze+=" ":ze="",ze+c.linkEmail}if(s.xml&&ye==="<"&&A.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var vt=A.string.indexOf(">",A.pos);if(vt!=-1){var Tn=A.string.substring(A.start,vt);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Tn)&&(D.md_inside=!0)}return A.backUp(1),D.htmlState=o.startState(a),P(A,D,X)}if(s.xml&&ye==="<"&&A.match(/^\/\w*?>/))return D.md_inside=!1,"tag";if(ye==="*"||ye==="_"){for(var Xt=1,Kt=A.pos==1?" ":A.string.charAt(A.pos-2);Xt<3&&A.eat(ye);)Xt++;var zt=A.peek()||" ",pr=!/\s/.test(zt)&&(!T.test(zt)||/\s/.test(Kt)||T.test(Kt)),we=!/\s/.test(Kt)&&(!T.test(Kt)||/\s/.test(zt)||T.test(zt)),Ht=null,gr=null;if(Xt%2&&(!D.em&&pr&&(ye==="*"||!we||T.test(Kt))?Ht=!0:D.em==ye&&we&&(ye==="*"||!pr||T.test(zt))&&(Ht=!1)),Xt>1&&(!D.strong&&pr&&(ye==="*"||!we||T.test(Kt))?gr=!0:D.strong==ye&&we&&(ye==="*"||!pr||T.test(zt))&&(gr=!1)),gr!=null||Ht!=null){s.highlightFormatting&&(D.formatting=Ht==null?"strong":gr==null?"em":"strong em"),Ht===!0&&(D.em=ye),gr===!0&&(D.strong=ye);var Be=U(D);return Ht===!1&&(D.em=!1),gr===!1&&(D.strong=!1),Be}}else if(ye===" "&&(A.eat("*")||A.eat("_"))){if(A.peek()===" ")return U(D);A.backUp(1)}if(s.strikethrough){if(ye==="~"&&A.eatWhile(ye)){if(D.strikethrough){s.highlightFormatting&&(D.formatting="strikethrough");var Be=U(D);return D.strikethrough=!1,Be}else if(A.match(/^[^\s]/,!1))return D.strikethrough=!0,s.highlightFormatting&&(D.formatting="strikethrough"),U(D)}else if(ye===" "&&A.match("~~",!0)){if(A.peek()===" ")return U(D);A.backUp(2)}}if(s.emoji&&ye===":"&&A.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){D.emoji=!0,s.highlightFormatting&&(D.formatting="emoji");var Di=U(D);return D.emoji=!1,Di}return ye===" "&&(A.match(/^ +$/,!1)?D.trailingSpace++:D.trailingSpace&&(D.trailingSpaceNewLine=!0)),U(D)}function K(A,D){var ee=A.next();if(ee===">"){D.f=D.inline=ie,s.highlightFormatting&&(D.formatting="link");var Se=U(D);return Se?Se+=" ":Se="",Se+c.linkInline}return A.match(/^[^>]+/,!0),c.linkInline}function E(A,D){if(A.eatSpace())return null;var ee=A.next();return ee==="("||ee==="["?(D.f=D.inline=R(ee==="("?")":"]"),s.highlightFormatting&&(D.formatting="link-string"),D.linkHref=!0,U(D)):"error"}var z={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function R(A){return function(D,ee){var Se=D.next();if(Se===A){ee.f=ee.inline=ie,s.highlightFormatting&&(ee.formatting="link-string");var ye=U(ee);return ee.linkHref=!1,ye}return D.match(z[A]),ee.linkHref=!0,U(ee)}}function Z(A,D){return A.match(/^([^\]\\]|\\.)*\]:/,!1)?(D.f=ue,A.next(),s.highlightFormatting&&(D.formatting="link"),D.linkText=!0,U(D)):N(A,D,ie)}function ue(A,D){if(A.match("]:",!0)){D.f=D.inline=De,s.highlightFormatting&&(D.formatting="link");var ee=U(D);return D.linkText=!1,ee}return A.match(/^([^\]\\]|\\.)+/,!0),c.linkText}function De(A,D){return A.eatSpace()?null:(A.match(/^[^\s]+/,!0),A.peek()===void 0?D.linkTitle=!0:A.match(/^(?:\s+(?:"(?:[^"\\]|\\.)+"|'(?:[^'\\]|\\.)+'|\((?:[^)\\]|\\.)+\)))?/,!0),D.f=D.inline=ie,c.linkHref+" url")}var Ue={startState:function(){return{f:j,prevLine:{stream:null},thisLine:{stream:null},block:j,htmlState:null,indentation:0,inline:ie,text:le,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(A){return{f:A.f,prevLine:A.prevLine,thisLine:A.thisLine,block:A.block,htmlState:A.htmlState&&o.copyState(a,A.htmlState),indentation:A.indentation,localMode:A.localMode,localState:A.localMode?o.copyState(A.localMode,A.localState):null,inline:A.inline,text:A.text,formatting:!1,linkText:A.linkText,linkTitle:A.linkTitle,linkHref:A.linkHref,code:A.code,em:A.em,strong:A.strong,strikethrough:A.strikethrough,emoji:A.emoji,header:A.header,setext:A.setext,hr:A.hr,taskList:A.taskList,list:A.list,listStack:A.listStack.slice(0),quote:A.quote,indentedCode:A.indentedCode,trailingSpace:A.trailingSpace,trailingSpaceNewLine:A.trailingSpaceNewLine,md_inside:A.md_inside,fencedEndRE:A.fencedEndRE}},token:function(A,D){if(D.formatting=!1,A!=D.thisLine.stream){if(D.header=0,D.hr=!1,A.match(/^\s*$/,!0))return q(D),null;if(D.prevLine=D.thisLine,D.thisLine={stream:A},D.taskList=!1,D.trailingSpace=0,D.trailingSpaceNewLine=!1,!D.localState&&(D.f=D.block,D.f!=X)){var ee=A.match(/^\s*/,!0)[0].replace(/\t/g,O).length;if(D.indentation=ee,D.indentationDiff=null,ee>0)return null}}return D.f(A,D)},innerMode:function(A){return A.block==X?{state:A.htmlState,mode:a}:A.localState?{state:A.localState,mode:A.localMode}:{state:A,mode:Ue}},indent:function(A,D,ee){return A.block==X&&a.indent?a.indent(A.htmlState,D,ee):A.localState&&A.localMode.indent?A.localMode.indent(A.localState,D,ee):o.Pass},blankLine:q,getType:U,blockCommentStart:"",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return Ue},"xml"),o.defineMIME("text/markdown","markdown"),o.defineMIME("text/x-markdown","markdown")})});var al=at((ff,cf)=>{(function(o){typeof ff=="object"&&typeof cf=="object"?o(Et()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";o.overlayMode=function(l,s,a){return{startState:function(){return{base:o.startState(l),overlay:o.startState(s),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(f){return{base:o.copyState(l,f.base),overlay:o.copyState(s,f.overlay),basePos:f.basePos,baseCur:null,overlayPos:f.overlayPos,overlayCur:null}},token:function(f,p){return(f!=p.streamSeen||Math.min(p.basePos,p.overlayPos){(function(o){typeof df=="object"&&typeof hf=="object"?o(Et()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){o.defineOption("placeholder","",function(h,b,y){var x=y&&y!=o.Init;if(b&&!x)h.on("blur",f),h.on("change",p),h.on("swapDoc",p),o.on(h.getInputField(),"compositionupdate",h.state.placeholderCompose=function(){a(h)}),p(h);else if(!b&&x){h.off("blur",f),h.off("change",p),h.off("swapDoc",p),o.off(h.getInputField(),"compositionupdate",h.state.placeholderCompose),l(h);var C=h.getWrapperElement();C.className=C.className.replace(" CodeMirror-empty","")}b&&!h.hasFocus()&&f(h)});function l(h){h.state.placeholder&&(h.state.placeholder.parentNode.removeChild(h.state.placeholder),h.state.placeholder=null)}function s(h){l(h);var b=h.state.placeholder=document.createElement("pre");b.style.cssText="height: 0; overflow: visible",b.style.direction=h.getOption("direction"),b.className="CodeMirror-placeholder CodeMirror-line-like";var y=h.getOption("placeholder");typeof y=="string"&&(y=document.createTextNode(y)),b.appendChild(y),h.display.lineSpace.insertBefore(b,h.display.lineSpace.firstChild)}function a(h){setTimeout(function(){var b=!1;if(h.lineCount()==1){var y=h.getInputField();b=y.nodeName=="TEXTAREA"?!h.getLine(0).length:!/[^\u200b]/.test(y.querySelector(".CodeMirror-line").textContent)}b?s(h):l(h)},20)}function f(h){c(h)&&s(h)}function p(h){var b=h.getWrapperElement(),y=c(h);b.className=b.className.replace(" CodeMirror-empty","")+(y?" CodeMirror-empty":""),y?s(h):l(h)}function c(h){return h.lineCount()===1&&h.getLine(0)===""}})});var mf=at((gf,vf)=>{(function(o){typeof gf=="object"&&typeof vf=="object"?o(Et()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";o.defineOption("autoRefresh",!1,function(a,f){a.state.autoRefresh&&(s(a,a.state.autoRefresh),a.state.autoRefresh=null),f&&a.display.wrapper.offsetHeight==0&&l(a,a.state.autoRefresh={delay:f.delay||250})});function l(a,f){function p(){a.display.wrapper.offsetHeight?(s(a,f),a.display.lastWrapHeight!=a.display.wrapper.clientHeight&&a.refresh()):f.timeout=setTimeout(p,f.delay)}f.timeout=setTimeout(p,f.delay),f.hurry=function(){clearTimeout(f.timeout),f.timeout=setTimeout(p,50)},o.on(window,"mouseup",f.hurry),o.on(window,"keyup",f.hurry)}function s(a,f){clearTimeout(f.timeout),o.off(window,"mouseup",f.hurry),o.off(window,"keyup",f.hurry)}})});var xf=at((bf,yf)=>{(function(o){typeof bf=="object"&&typeof yf=="object"?o(Et()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";o.defineOption("styleSelectedText",!1,function(x,C,S){var F=S&&S!=o.Init;C&&!F?(x.state.markedSelection=[],x.state.markedSelectionStyle=typeof C=="string"?C:"CodeMirror-selectedtext",b(x),x.on("cursorActivity",l),x.on("change",s)):!C&&F&&(x.off("cursorActivity",l),x.off("change",s),h(x),x.state.markedSelection=x.state.markedSelectionStyle=null)});function l(x){x.state.markedSelection&&x.operation(function(){y(x)})}function s(x){x.state.markedSelection&&x.state.markedSelection.length&&x.operation(function(){h(x)})}var a=8,f=o.Pos,p=o.cmpPos;function c(x,C,S,F){if(p(C,S)!=0)for(var _=x.state.markedSelection,L=x.state.markedSelectionStyle,T=C.line;;){var O=T==C.line?C:f(T,0),N=T+a,P=N>=S.line,I=P?S:f(N,0),q=x.markText(O,I,{className:L});if(F==null?_.push(q):_.splice(F++,0,q),P)break;T=N}}function h(x){for(var C=x.state.markedSelection,S=0;S1)return b(x);var C=x.getCursor("start"),S=x.getCursor("end"),F=x.state.markedSelection;if(!F.length)return c(x,C,S);var _=F[0].find(),L=F[F.length-1].find();if(!_||!L||S.line-C.line<=a||p(C,L.to)>=0||p(S,_.from)<=0)return b(x);for(;p(C,_.from)>0;)F.shift().clear(),_=F[0].find();for(p(C,_.from)<0&&(_.to.line-C.line0&&(S.line-L.from.line{(function(o){typeof Df=="object"&&typeof wf=="object"?o(Et()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";var l=o.Pos;function s(T){var O=T.flags;return O??(T.ignoreCase?"i":"")+(T.global?"g":"")+(T.multiline?"m":"")}function a(T,O){for(var N=s(T),P=N,I=0;Ij);X++){var me=T.getLine(q++);P=P==null?me:P+` +`+me}I=I*2,O.lastIndex=N.ch;var U=O.exec(P);if(U){var le=P.slice(0,U.index).split(` +`),ie=U[0].split(` +`),K=N.line+le.length-1,E=le[le.length-1].length;return{from:l(K,E),to:l(K+ie.length-1,ie.length==1?E+ie[0].length:ie[ie.length-1].length),match:U}}}}function h(T,O,N){for(var P,I=0;I<=T.length;){O.lastIndex=I;var q=O.exec(T);if(!q)break;var j=q.index+q[0].length;if(j>T.length-N)break;(!P||j>P.index+P[0].length)&&(P=q),I=q.index+1}return P}function b(T,O,N){O=a(O,"g");for(var P=N.line,I=N.ch,q=T.firstLine();P>=q;P--,I=-1){var j=T.getLine(P),X=h(j,O,I<0?0:j.length-I);if(X)return{from:l(P,X.index),to:l(P,X.index+X[0].length),match:X}}}function y(T,O,N){if(!f(O))return b(T,O,N);O=a(O,"gm");for(var P,I=1,q=T.getLine(N.line).length-N.ch,j=N.line,X=T.firstLine();j>=X;){for(var me=0;me=X;me++){var U=T.getLine(j--);P=P==null?U:U+` +`+P}I*=2;var le=h(P,O,q);if(le){var ie=P.slice(0,le.index).split(` +`),K=le[0].split(` +`),E=j+ie.length,z=ie[ie.length-1].length;return{from:l(E,z),to:l(E+K.length-1,K.length==1?z+K[0].length:K[K.length-1].length),match:le}}}}var x,C;String.prototype.normalize?(x=function(T){return T.normalize("NFD").toLowerCase()},C=function(T){return T.normalize("NFD")}):(x=function(T){return T.toLowerCase()},C=function(T){return T});function S(T,O,N,P){if(T.length==O.length)return N;for(var I=0,q=N+Math.max(0,T.length-O.length);;){if(I==q)return I;var j=I+q>>1,X=P(T.slice(0,j)).length;if(X==N)return j;X>N?q=j:I=j+1}}function F(T,O,N,P){if(!O.length)return null;var I=P?x:C,q=I(O).split(/\r|\n\r?/);e:for(var j=N.line,X=N.ch,me=T.lastLine()+1-q.length;j<=me;j++,X=0){var U=T.getLine(j).slice(X),le=I(U);if(q.length==1){var ie=le.indexOf(q[0]);if(ie==-1)continue e;var N=S(U,le,ie,I)+X;return{from:l(j,S(U,le,ie,I)+X),to:l(j,S(U,le,ie+q[0].length,I)+X)}}else{var K=le.length-q[0].length;if(le.slice(K)!=q[0])continue e;for(var E=1;E=me;j--,X=-1){var U=T.getLine(j);X>-1&&(U=U.slice(0,X));var le=I(U);if(q.length==1){var ie=le.lastIndexOf(q[0]);if(ie==-1)continue e;return{from:l(j,S(U,le,ie,I)),to:l(j,S(U,le,ie+q[0].length,I))}}else{var K=q[q.length-1];if(le.slice(0,K.length)!=K)continue e;for(var E=1,N=j-q.length+1;E(this.doc.getLine(O.line)||"").length&&(O.ch=0,O.line++)),o.cmpPos(O,this.doc.clipPos(O))!=0))return this.atOccurrence=!1;var N=this.matches(T,O);if(this.afterEmptyMatch=N&&o.cmpPos(N.from,N.to)==0,N)return this.pos=N,this.atOccurrence=!0,this.pos.match||!0;var P=l(T?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:P,to:P},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(T,O){if(this.atOccurrence){var N=o.splitLines(T);this.doc.replaceRange(N,this.pos.from,this.pos.to,O),this.pos.to=l(this.pos.from.line+N.length-1,N[N.length-1].length+(N.length==1?this.pos.from.ch:0))}}},o.defineExtension("getSearchCursor",function(T,O,N){return new L(this.doc,T,O,N)}),o.defineDocExtension("getSearchCursor",function(T,O,N){return new L(this,T,O,N)}),o.defineExtension("selectMatches",function(T,O){for(var N=[],P=this.getSearchCursor(T,this.getCursor("from"),O);P.findNext()&&!(o.cmpPos(P.to(),this.getCursor("to"))>0);)N.push({anchor:P.from(),head:P.to()});N.length&&this.setSelections(N,0)})})});var Ef=at((kf,Sf)=>{(function(o){typeof kf=="object"&&typeof Sf=="object"?o(Et(),ol(),al()):typeof define=="function"&&define.amd?define(["../../lib/codemirror","../markdown/markdown","../../addon/mode/overlay"],o):o(CodeMirror)})(function(o){"use strict";var l=/^((?:(?:aaas?|about|acap|adiumxtra|af[ps]|aim|apt|attachment|aw|beshare|bitcoin|bolo|callto|cap|chrome(?:-extension)?|cid|coap|com-eventbrite-attendee|content|crid|cvs|data|dav|dict|dlna-(?:playcontainer|playsingle)|dns|doi|dtn|dvb|ed2k|facetime|feed|file|finger|fish|ftp|geo|gg|git|gizmoproject|go|gopher|gtalk|h323|hcp|https?|iax|icap|icon|im|imap|info|ipn|ipp|irc[6s]?|iris(?:\.beep|\.lwz|\.xpc|\.xpcs)?|itms|jar|javascript|jms|keyparc|lastfm|ldaps?|magnet|mailto|maps|market|message|mid|mms|ms-help|msnim|msrps?|mtqp|mumble|mupdate|mvn|news|nfs|nih?|nntp|notes|oid|opaquelocktoken|palm|paparazzi|platform|pop|pres|proxy|psyc|query|res(?:ource)?|rmi|rsync|rtmp|rtsp|secondlife|service|session|sftp|sgn|shttp|sieve|sips?|skype|sm[bs]|snmp|soap\.beeps?|soldat|spotify|ssh|steam|svn|tag|teamspeak|tel(?:net)?|tftp|things|thismessage|tip|tn3270|tv|udp|unreal|urn|ut2004|vemmi|ventrilo|view-source|webcal|wss?|wtai|wyciwyg|xcon(?:-userid)?|xfire|xmlrpc\.beeps?|xmpp|xri|ymsgr|z39\.50[rs]?):(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i;o.defineMode("gfm",function(s,a){var f=0;function p(y){return y.code=!1,null}var c={startState:function(){return{code:!1,codeBlock:!1,ateSpace:!1}},copyState:function(y){return{code:y.code,codeBlock:y.codeBlock,ateSpace:y.ateSpace}},token:function(y,x){if(x.combineTokens=null,x.codeBlock)return y.match(/^```+/)?(x.codeBlock=!1,null):(y.skipToEnd(),null);if(y.sol()&&(x.code=!1),y.sol()&&y.match(/^```+/))return y.skipToEnd(),x.codeBlock=!0,null;if(y.peek()==="`"){y.next();var C=y.pos;y.eatWhile("`");var S=1+y.pos-C;return x.code?S===f&&(x.code=!1):(f=S,x.code=!0),null}else if(x.code)return y.next(),null;if(y.eatSpace())return x.ateSpace=!0,null;if((y.sol()||x.ateSpace)&&(x.ateSpace=!1,a.gitHubSpice!==!1)){if(y.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?=.{0,6}\d)(?:[a-f0-9]{7,40}\b)/))return x.combineTokens=!0,"link";if(y.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/))return x.combineTokens=!0,"link"}return y.match(l)&&y.string.slice(y.start-2,y.start)!="]("&&(y.start==0||/\W/.test(y.string.charAt(y.start-1)))?(x.combineTokens=!0,"link"):(y.next(),null)},blankLine:p},h={taskLists:!0,strikethrough:!0,emoji:!0};for(var b in a)h[b]=a[b];return h.name="markdown",o.overlayMode(o.getMode(s,h),c)},"markdown"),o.defineMIME("text/x-gfm","gfm")})});var Af=at(()=>{});var Ff=at((Ng,sl)=>{var ll;(function(){"use strict";ll=function(o,l,s,a){a=a||{},this.dictionary=null,this.rules={},this.dictionaryTable=new Map,this.compoundRules=[],this.compoundRuleCodes={},this.replacementTable=[],this.flags=a.flags||{},this.memoized={},this.loaded=!1;var f=this,p,c,h,b,y;o&&(f.dictionary=o,l&&s?F():(typeof window<"u"?(a.dictionaryPath?p=a.dictionaryPath:p="typo/dictionaries",window.chrome&&window.chrome.runtime&&window.chrome.runtime.getURL?p=window.chrome.runtime.getURL(p):window.browser&&window.browser.runtime&&window.browser.runtime.getURL&&(p=window.browser.runtime.getURL(p))):typeof __dirname<"u"?p=__dirname+"/dictionaries":p="./dictionaries",l||x(p+"/"+o+"/"+o+".aff",C),s||x(p+"/"+o+"/"+o+".dic",S)));function x(_,L){var T=f._readFile(_,null,a?.asyncLoad);a?.asyncLoad?T.then(function(O){L(O)}):L(T)}function C(_){l=_,s&&F()}function S(_){s=_,l&&F()}function F(){for(f.rules=f._parseAFF(l),f.compoundRuleCodes={},c=0,b=f.compoundRules.length;c0&&(q.continuationClasses=P),I!=="."&&(S==="SFX"?q.match=new RegExp(I+"$"):q.match=new RegExp("^"+I)),T!="0"&&(S==="SFX"?q.remove=new RegExp(T+"$"):q.remove=T),L.push(q)}l[F]={type:S,combineable:_==="Y",entries:L},c+=f}else if(S==="COMPOUNDRULE"){for(f=parseInt(C[1],10),h=c+1,y=c+1+f;h0&&(s.get(le)===null&&s.set(le,[]),s.get(le).push(ie))}for(var f=1,p=l.length;f1){var x=this.parseRuleCodes(b[1]);(!("NEEDAFFIX"in this.flags)||x.indexOf(this.flags.NEEDAFFIX)===-1)&&a(y,x);for(var C=0,S=x.length;C"u"){if("COMPOUNDMIN"in this.flags&&o.length>=this.flags.COMPOUNDMIN){for(s=0,a=this.compoundRules.length;s"u"&&(s=Array.prototype.concat.apply([],this.dictionaryTable.get(o))),s&&s.indexOf(this.flags[l])!==-1))},alphabet:"",suggest:function(o,l){if(!this.loaded)throw"Dictionary not loaded.";if(l=l||5,this.memoized.hasOwnProperty(o)){var s=this.memoized[o].limit;if(l<=s||this.memoized[o].suggestions.length1&&X[1][1]!==X[1][0]&&(I=X[0]+X[1][1]+X[1][0]+X[1].substring(2),(!F||y.check(I))&&(I in _?_[I]+=1:_[I]=1)),X[1]){var me=X[1].substring(0,1).toUpperCase()===X[1].substring(0,1)?"uppercase":"lowercase";for(T=0;TK?1:le[0].localeCompare(U[0])}I.sort(q).reverse();var j=[],X="lowercase";S.toUpperCase()===S?X="uppercase":S.substr(0,1).toUpperCase()+S.substr(1).toLowerCase()===S&&(X="capitalized");var me=l;for(N=0;N{"use strict";var Tf=Ff();function Oe(o){if(o=o||{},typeof o.codeMirrorInstance!="function"||typeof o.codeMirrorInstance.defineMode!="function"){console.log("CodeMirror Spell Checker: You must provide an instance of CodeMirror via the option `codeMirrorInstance`");return}String.prototype.includes||(String.prototype.includes=function(){"use strict";return String.prototype.indexOf.apply(this,arguments)!==-1}),o.codeMirrorInstance.defineMode("spell-checker",function(l){if(!Oe.aff_loading){Oe.aff_loading=!0;var s=new XMLHttpRequest;s.open("GET","https://cdn.jsdelivr.net/codemirror.spell-checker/latest/en_US.aff",!0),s.onload=function(){s.readyState===4&&s.status===200&&(Oe.aff_data=s.responseText,Oe.num_loaded++,Oe.num_loaded==2&&(Oe.typo=new Tf("en_US",Oe.aff_data,Oe.dic_data,{platform:"any"})))},s.send(null)}if(!Oe.dic_loading){Oe.dic_loading=!0;var a=new XMLHttpRequest;a.open("GET","https://cdn.jsdelivr.net/codemirror.spell-checker/latest/en_US.dic",!0),a.onload=function(){a.readyState===4&&a.status===200&&(Oe.dic_data=a.responseText,Oe.num_loaded++,Oe.num_loaded==2&&(Oe.typo=new Tf("en_US",Oe.aff_data,Oe.dic_data,{platform:"any"})))},a.send(null)}var f='!"#$%&()*+,-./:;<=>?@[\\]^_`{|}~ ',p={token:function(h){var b=h.peek(),y="";if(f.includes(b))return h.next(),null;for(;(b=h.peek())!=null&&!f.includes(b);)y+=b,h.next();return Oe.typo&&!Oe.typo.check(y)?"spell-error":null}},c=o.codeMirrorInstance.getMode(l,l.backdrop||"text/plain");return o.codeMirrorInstance.overlayMode(c,p,!0)})}Oe.num_loaded=0;Oe.aff_loading=!1;Oe.dic_loading=!1;Oe.aff_data="";Oe.dic_data="";Oe.typo;Lf.exports=Oe});var jf=at(_e=>{"use strict";function _f(o,l){for(var s=0;so.length)&&(l=o.length);for(var s=0,a=new Array(l);s=o.length?{done:!0}:{done:!1,value:o[a++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Yh(o,l){if(typeof o!="object"||o===null)return o;var s=o[Symbol.toPrimitive];if(s!==void 0){var a=s.call(o,l||"default");if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(l==="string"?String:Number)(o)}function Zh(o){var l=Yh(o,"string");return typeof l=="symbol"?l:String(l)}function ul(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}_e.defaults=ul();function Qh(o){_e.defaults=o}var Rf=/[&<>"']/,Jh=new RegExp(Rf.source,"g"),Wf=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,$h=new RegExp(Wf.source,"g"),Vh={"&":"&","<":"<",">":">",'"':""","'":"'"},Nf=function(l){return Vh[l]};function ht(o,l){if(l){if(Rf.test(o))return o.replace(Jh,Nf)}else if(Wf.test(o))return o.replace($h,Nf);return o}var ep=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function qf(o){return o.replace(ep,function(l,s){return s=s.toLowerCase(),s==="colon"?":":s.charAt(0)==="#"?s.charAt(1)==="x"?String.fromCharCode(parseInt(s.substring(2),16)):String.fromCharCode(+s.substring(1)):""})}var tp=/(^|[^\[])\^/g;function Le(o,l){o=typeof o=="string"?o:o.source,l=l||"";var s={replace:function(f,p){return p=p.source||p,p=p.replace(tp,"$1"),o=o.replace(f,p),s},getRegex:function(){return new RegExp(o,l)}};return s}var rp=/[^\w:]/g,np=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function Of(o,l,s){if(o){var a;try{a=decodeURIComponent(qf(s)).replace(rp,"").toLowerCase()}catch{return null}if(a.indexOf("javascript:")===0||a.indexOf("vbscript:")===0||a.indexOf("data:")===0)return null}l&&!np.test(s)&&(s=lp(l,s));try{s=encodeURI(s).replace(/%25/g,"%")}catch{return null}return s}var no={},ip=/^[^:]+:\/*[^/]*$/,op=/^([^:]+:)[\s\S]*$/,ap=/^([^:]+:\/*[^/]*)[\s\S]*$/;function lp(o,l){no[" "+o]||(ip.test(o)?no[" "+o]=o+"/":no[" "+o]=io(o,"/",!0)),o=no[" "+o];var s=o.indexOf(":")===-1;return l.substring(0,2)==="//"?s?l:o.replace(op,"$1")+l:l.charAt(0)==="/"?s?l:o.replace(ap,"$1")+l:o+l}var oo={exec:function(){}};function If(o,l){var s=o.replace(/\|/g,function(p,c,h){for(var b=!1,y=c;--y>=0&&h[y]==="\\";)b=!b;return b?"|":" |"}),a=s.split(/ \|/),f=0;if(a[0].trim()||a.shift(),a.length>0&&!a[a.length-1].trim()&&a.pop(),a.length>l)a.splice(l);else for(;a.length1;)l&1&&(s+=o),l>>=1,o+=o;return s+o}function zf(o,l,s,a){var f=l.href,p=l.title?ht(l.title):null,c=o[1].replace(/\\([\[\]])/g,"$1");if(o[0].charAt(0)!=="!"){a.state.inLink=!0;var h={type:"link",raw:s,href:f,title:p,text:c,tokens:a.inlineTokens(c)};return a.state.inLink=!1,h}return{type:"image",raw:s,href:f,title:p,text:ht(c)}}function fp(o,l){var s=o.match(/^(\s+)(?:```)/);if(s===null)return l;var a=s[1];return l.split(` +`).map(function(f){var p=f.match(/^\s+/);if(p===null)return f;var c=p[0];return c.length>=a.length?f.slice(a.length):f}).join(` +`)}var ao=function(){function o(s){this.options=s||_e.defaults}var l=o.prototype;return l.space=function(a){var f=this.rules.block.newline.exec(a);if(f&&f[0].length>0)return{type:"space",raw:f[0]}},l.code=function(a){var f=this.rules.block.code.exec(a);if(f){var p=f[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:f[0],codeBlockStyle:"indented",text:this.options.pedantic?p:io(p,` +`)}}},l.fences=function(a){var f=this.rules.block.fences.exec(a);if(f){var p=f[0],c=fp(p,f[3]||"");return{type:"code",raw:p,lang:f[2]?f[2].trim().replace(this.rules.inline._escapes,"$1"):f[2],text:c}}},l.heading=function(a){var f=this.rules.block.heading.exec(a);if(f){var p=f[2].trim();if(/#$/.test(p)){var c=io(p,"#");(this.options.pedantic||!c||/ $/.test(c))&&(p=c.trim())}return{type:"heading",raw:f[0],depth:f[1].length,text:p,tokens:this.lexer.inline(p)}}},l.hr=function(a){var f=this.rules.block.hr.exec(a);if(f)return{type:"hr",raw:f[0]}},l.blockquote=function(a){var f=this.rules.block.blockquote.exec(a);if(f){var p=f[0].replace(/^ *>[ \t]?/gm,""),c=this.lexer.state.top;this.lexer.state.top=!0;var h=this.lexer.blockTokens(p);return this.lexer.state.top=c,{type:"blockquote",raw:f[0],tokens:h,text:p}}},l.list=function(a){var f=this.rules.block.list.exec(a);if(f){var p,c,h,b,y,x,C,S,F,_,L,T,O=f[1].trim(),N=O.length>1,P={type:"list",raw:"",ordered:N,start:N?+O.slice(0,-1):"",loose:!1,items:[]};O=N?"\\d{1,9}\\"+O.slice(-1):"\\"+O,this.options.pedantic&&(O=N?O:"[*+-]");for(var I=new RegExp("^( {0,3}"+O+")((?:[ ][^\\n]*)?(?:\\n|$))");a&&(T=!1,!(!(f=I.exec(a))||this.rules.block.hr.test(a)));){if(p=f[0],a=a.substring(p.length),S=f[2].split(` +`,1)[0].replace(/^\t+/,function(K){return" ".repeat(3*K.length)}),F=a.split(` +`,1)[0],this.options.pedantic?(b=2,L=S.trimLeft()):(b=f[2].search(/[^ ]/),b=b>4?1:b,L=S.slice(b),b+=f[1].length),x=!1,!S&&/^ *$/.test(F)&&(p+=F+` +`,a=a.substring(F.length+1),T=!0),!T)for(var q=new RegExp("^ {0,"+Math.min(3,b-1)+"}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))"),j=new RegExp("^ {0,"+Math.min(3,b-1)+"}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)"),X=new RegExp("^ {0,"+Math.min(3,b-1)+"}(?:```|~~~)"),me=new RegExp("^ {0,"+Math.min(3,b-1)+"}#");a&&(_=a.split(` +`,1)[0],F=_,this.options.pedantic&&(F=F.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(X.test(F)||me.test(F)||q.test(F)||j.test(a)));){if(F.search(/[^ ]/)>=b||!F.trim())L+=` +`+F.slice(b);else{if(x||S.search(/[^ ]/)>=4||X.test(S)||me.test(S)||j.test(S))break;L+=` +`+F}!x&&!F.trim()&&(x=!0),p+=_+` +`,a=a.substring(_.length+1),S=F.slice(b)}P.loose||(C?P.loose=!0:/\n *\n *$/.test(p)&&(C=!0)),this.options.gfm&&(c=/^\[[ xX]\] /.exec(L),c&&(h=c[0]!=="[ ] ",L=L.replace(/^\[[ xX]\] +/,""))),P.items.push({type:"list_item",raw:p,task:!!c,checked:h,loose:!1,text:L}),P.raw+=p}P.items[P.items.length-1].raw=p.trimRight(),P.items[P.items.length-1].text=L.trimRight(),P.raw=P.raw.trimRight();var U=P.items.length;for(y=0;y0&&le.some(function(K){return/\n.*\n/.test(K.raw)});P.loose=ie}if(P.loose)for(y=0;y$/,"$1").replace(this.rules.inline._escapes,"$1"):"",h=f[3]?f[3].substring(1,f[3].length-1).replace(this.rules.inline._escapes,"$1"):f[3];return{type:"def",tag:p,raw:f[0],href:c,title:h}}},l.table=function(a){var f=this.rules.block.table.exec(a);if(f){var p={type:"table",header:If(f[1]).map(function(C){return{text:C}}),align:f[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:f[3]&&f[3].trim()?f[3].replace(/\n[ \t]*$/,"").split(` +`):[]};if(p.header.length===p.align.length){p.raw=f[0];var c=p.align.length,h,b,y,x;for(h=0;h/i.test(f[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(f[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(f[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:f[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(f[0]):ht(f[0]):f[0]}},l.link=function(a){var f=this.rules.inline.link.exec(a);if(f){var p=f[2].trim();if(!this.options.pedantic&&/^$/.test(p))return;var c=io(p.slice(0,-1),"\\");if((p.length-c.length)%2===0)return}else{var h=sp(f[2],"()");if(h>-1){var b=f[0].indexOf("!")===0?5:4,y=b+f[1].length+h;f[2]=f[2].substring(0,h),f[0]=f[0].substring(0,y).trim(),f[3]=""}}var x=f[2],C="";if(this.options.pedantic){var S=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(x);S&&(x=S[1],C=S[3])}else C=f[3]?f[3].slice(1,-1):"";return x=x.trim(),/^$/.test(p)?x=x.slice(1):x=x.slice(1,-1)),zf(f,{href:x&&x.replace(this.rules.inline._escapes,"$1"),title:C&&C.replace(this.rules.inline._escapes,"$1")},f[0],this.lexer)}},l.reflink=function(a,f){var p;if((p=this.rules.inline.reflink.exec(a))||(p=this.rules.inline.nolink.exec(a))){var c=(p[2]||p[1]).replace(/\s+/g," ");if(c=f[c.toLowerCase()],!c){var h=p[0].charAt(0);return{type:"text",raw:h,text:h}}return zf(p,c,p[0],this.lexer)}},l.emStrong=function(a,f,p){p===void 0&&(p="");var c=this.rules.inline.emStrong.lDelim.exec(a);if(c&&!(c[3]&&p.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDF70-\uDF81\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDE70-\uDEBE\uDEC0-\uDEC9\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var h=c[1]||c[2]||"";if(!h||h&&(p===""||this.rules.inline.punctuation.exec(p))){var b=c[0].length-1,y,x,C=b,S=0,F=c[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(F.lastIndex=0,f=f.slice(-1*a.length+b);(c=F.exec(f))!=null;)if(y=c[1]||c[2]||c[3]||c[4]||c[5]||c[6],!!y){if(x=y.length,c[3]||c[4]){C+=x;continue}else if((c[5]||c[6])&&b%3&&!((b+x)%3)){S+=x;continue}if(C-=x,!(C>0)){x=Math.min(x,x+C+S);var _=a.slice(0,b+c.index+(c[0].length-y.length)+x);if(Math.min(b,x)%2){var L=_.slice(1,-1);return{type:"em",raw:_,text:L,tokens:this.lexer.inlineTokens(L)}}var T=_.slice(2,-2);return{type:"strong",raw:_,text:T,tokens:this.lexer.inlineTokens(T)}}}}}},l.codespan=function(a){var f=this.rules.inline.code.exec(a);if(f){var p=f[2].replace(/\n/g," "),c=/[^ ]/.test(p),h=/^ /.test(p)&&/ $/.test(p);return c&&h&&(p=p.substring(1,p.length-1)),p=ht(p,!0),{type:"codespan",raw:f[0],text:p}}},l.br=function(a){var f=this.rules.inline.br.exec(a);if(f)return{type:"br",raw:f[0]}},l.del=function(a){var f=this.rules.inline.del.exec(a);if(f)return{type:"del",raw:f[0],text:f[2],tokens:this.lexer.inlineTokens(f[2])}},l.autolink=function(a,f){var p=this.rules.inline.autolink.exec(a);if(p){var c,h;return p[2]==="@"?(c=ht(this.options.mangle?f(p[1]):p[1]),h="mailto:"+c):(c=ht(p[1]),h=c),{type:"link",raw:p[0],text:c,href:h,tokens:[{type:"text",raw:c,text:c}]}}},l.url=function(a,f){var p;if(p=this.rules.inline.url.exec(a)){var c,h;if(p[2]==="@")c=ht(this.options.mangle?f(p[0]):p[0]),h="mailto:"+c;else{var b;do b=p[0],p[0]=this.rules.inline._backpedal.exec(p[0])[0];while(b!==p[0]);c=ht(p[0]),p[1]==="www."?h="http://"+p[0]:h=p[0]}return{type:"link",raw:p[0],text:c,href:h,tokens:[{type:"text",raw:c,text:c}]}}},l.inlineText=function(a,f){var p=this.rules.inline.text.exec(a);if(p){var c;return this.lexer.state.inRawBlock?c=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(p[0]):ht(p[0]):p[0]:c=ht(this.options.smartypants?f(p[0]):p[0]),{type:"text",raw:p[0],text:c}}},o}(),de={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:oo,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};de._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/;de._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;de.def=Le(de.def).replace("label",de._label).replace("title",de._title).getRegex();de.bullet=/(?:[*+-]|\d{1,9}[.)])/;de.listItemStart=Le(/^( *)(bull) */).replace("bull",de.bullet).getRegex();de.list=Le(de.list).replace(/bull/g,de.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+de.def.source+")").getRegex();de._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";de._comment=/|$)/;de.html=Le(de.html,"i").replace("comment",de._comment).replace("tag",de._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();de.paragraph=Le(de._paragraph).replace("hr",de.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",de._tag).getRegex();de.blockquote=Le(de.blockquote).replace("paragraph",de.paragraph).getRegex();de.normal=_t({},de);de.gfm=_t({},de.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"});de.gfm.table=Le(de.gfm.table).replace("hr",de.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",de._tag).getRegex();de.gfm.paragraph=Le(de._paragraph).replace("hr",de.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",de.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",de._tag).getRegex();de.pedantic=_t({},de.normal,{html:Le(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",de._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:oo,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Le(de.normal._paragraph).replace("hr",de.hr).replace("heading",` *#{1,6} *[^ +]`).replace("lheading",de.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ne={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:oo,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/,rDelimUnd:/^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:oo,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~";ne.punctuation=Le(ne.punctuation).replace(/punctuation/g,ne._punctuation).getRegex();ne.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;ne.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g;ne._comment=Le(de._comment).replace("(?:-->|$)","-->").getRegex();ne.emStrong.lDelim=Le(ne.emStrong.lDelim).replace(/punct/g,ne._punctuation).getRegex();ne.emStrong.rDelimAst=Le(ne.emStrong.rDelimAst,"g").replace(/punct/g,ne._punctuation).getRegex();ne.emStrong.rDelimUnd=Le(ne.emStrong.rDelimUnd,"g").replace(/punct/g,ne._punctuation).getRegex();ne._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;ne._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;ne._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;ne.autolink=Le(ne.autolink).replace("scheme",ne._scheme).replace("email",ne._email).getRegex();ne._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;ne.tag=Le(ne.tag).replace("comment",ne._comment).replace("attribute",ne._attribute).getRegex();ne._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;ne._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;ne._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;ne.link=Le(ne.link).replace("label",ne._label).replace("href",ne._href).replace("title",ne._title).getRegex();ne.reflink=Le(ne.reflink).replace("label",ne._label).replace("ref",de._label).getRegex();ne.nolink=Le(ne.nolink).replace("ref",de._label).getRegex();ne.reflinkSearch=Le(ne.reflinkSearch,"g").replace("reflink",ne.reflink).replace("nolink",ne.nolink).getRegex();ne.normal=_t({},ne);ne.pedantic=_t({},ne.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Le(/^!?\[(label)\]\((.*?)\)/).replace("label",ne._label).getRegex(),reflink:Le(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ne._label).getRegex()});ne.gfm=_t({},ne.normal,{escape:Le(ne.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\.5&&(a="x"+a.toString(16)),l+="&#"+a+";";return l}var yn=function(){function o(s){this.tokens=[],this.tokens.links=Object.create(null),this.options=s||_e.defaults,this.options.tokenizer=this.options.tokenizer||new ao,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};var a={block:de.normal,inline:ne.normal};this.options.pedantic?(a.block=de.pedantic,a.inline=ne.pedantic):this.options.gfm&&(a.block=de.gfm,this.options.breaks?a.inline=ne.breaks:a.inline=ne.gfm),this.tokenizer.rules=a}o.lex=function(a,f){var p=new o(f);return p.lex(a)},o.lexInline=function(a,f){var p=new o(f);return p.inlineTokens(a)};var l=o.prototype;return l.lex=function(a){a=a.replace(/\r\n|\r/g,` +`),this.blockTokens(a,this.tokens);for(var f;f=this.inlineQueue.shift();)this.inlineTokens(f.src,f.tokens);return this.tokens},l.blockTokens=function(a,f){var p=this;f===void 0&&(f=[]),this.options.pedantic?a=a.replace(/\t/g," ").replace(/^ +$/gm,""):a=a.replace(/^( *)(\t+)/gm,function(C,S,F){return S+" ".repeat(F.length)});for(var c,h,b,y;a;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(C){return(c=C.call({lexer:p},a,f))?(a=a.substring(c.raw.length),f.push(c),!0):!1}))){if(c=this.tokenizer.space(a)){a=a.substring(c.raw.length),c.raw.length===1&&f.length>0?f[f.length-1].raw+=` +`:f.push(c);continue}if(c=this.tokenizer.code(a)){a=a.substring(c.raw.length),h=f[f.length-1],h&&(h.type==="paragraph"||h.type==="text")?(h.raw+=` +`+c.raw,h.text+=` +`+c.text,this.inlineQueue[this.inlineQueue.length-1].src=h.text):f.push(c);continue}if(c=this.tokenizer.fences(a)){a=a.substring(c.raw.length),f.push(c);continue}if(c=this.tokenizer.heading(a)){a=a.substring(c.raw.length),f.push(c);continue}if(c=this.tokenizer.hr(a)){a=a.substring(c.raw.length),f.push(c);continue}if(c=this.tokenizer.blockquote(a)){a=a.substring(c.raw.length),f.push(c);continue}if(c=this.tokenizer.list(a)){a=a.substring(c.raw.length),f.push(c);continue}if(c=this.tokenizer.html(a)){a=a.substring(c.raw.length),f.push(c);continue}if(c=this.tokenizer.def(a)){a=a.substring(c.raw.length),h=f[f.length-1],h&&(h.type==="paragraph"||h.type==="text")?(h.raw+=` +`+c.raw,h.text+=` +`+c.raw,this.inlineQueue[this.inlineQueue.length-1].src=h.text):this.tokens.links[c.tag]||(this.tokens.links[c.tag]={href:c.href,title:c.title});continue}if(c=this.tokenizer.table(a)){a=a.substring(c.raw.length),f.push(c);continue}if(c=this.tokenizer.lheading(a)){a=a.substring(c.raw.length),f.push(c);continue}if(b=a,this.options.extensions&&this.options.extensions.startBlock&&function(){var C=1/0,S=a.slice(1),F=void 0;p.options.extensions.startBlock.forEach(function(_){F=_.call({lexer:this},S),typeof F=="number"&&F>=0&&(C=Math.min(C,F))}),C<1/0&&C>=0&&(b=a.substring(0,C+1))}(),this.state.top&&(c=this.tokenizer.paragraph(b))){h=f[f.length-1],y&&h.type==="paragraph"?(h.raw+=` +`+c.raw,h.text+=` +`+c.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=h.text):f.push(c),y=b.length!==a.length,a=a.substring(c.raw.length);continue}if(c=this.tokenizer.text(a)){a=a.substring(c.raw.length),h=f[f.length-1],h&&h.type==="text"?(h.raw+=` +`+c.raw,h.text+=` +`+c.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=h.text):f.push(c);continue}if(a){var x="Infinite loop on byte: "+a.charCodeAt(0);if(this.options.silent){console.error(x);break}else throw new Error(x)}}return this.state.top=!0,f},l.inline=function(a,f){return f===void 0&&(f=[]),this.inlineQueue.push({src:a,tokens:f}),f},l.inlineTokens=function(a,f){var p=this;f===void 0&&(f=[]);var c,h,b,y=a,x,C,S;if(this.tokens.links){var F=Object.keys(this.tokens.links);if(F.length>0)for(;(x=this.tokenizer.rules.inline.reflinkSearch.exec(y))!=null;)F.includes(x[0].slice(x[0].lastIndexOf("[")+1,-1))&&(y=y.slice(0,x.index)+"["+Pf("a",x[0].length-2)+"]"+y.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(x=this.tokenizer.rules.inline.blockSkip.exec(y))!=null;)y=y.slice(0,x.index)+"["+Pf("a",x[0].length-2)+"]"+y.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(x=this.tokenizer.rules.inline.escapedEmSt.exec(y))!=null;)y=y.slice(0,x.index+x[0].length-2)+"++"+y.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;a;)if(C||(S=""),C=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(L){return(c=L.call({lexer:p},a,f))?(a=a.substring(c.raw.length),f.push(c),!0):!1}))){if(c=this.tokenizer.escape(a)){a=a.substring(c.raw.length),f.push(c);continue}if(c=this.tokenizer.tag(a)){a=a.substring(c.raw.length),h=f[f.length-1],h&&c.type==="text"&&h.type==="text"?(h.raw+=c.raw,h.text+=c.text):f.push(c);continue}if(c=this.tokenizer.link(a)){a=a.substring(c.raw.length),f.push(c);continue}if(c=this.tokenizer.reflink(a,this.tokens.links)){a=a.substring(c.raw.length),h=f[f.length-1],h&&c.type==="text"&&h.type==="text"?(h.raw+=c.raw,h.text+=c.text):f.push(c);continue}if(c=this.tokenizer.emStrong(a,y,S)){a=a.substring(c.raw.length),f.push(c);continue}if(c=this.tokenizer.codespan(a)){a=a.substring(c.raw.length),f.push(c);continue}if(c=this.tokenizer.br(a)){a=a.substring(c.raw.length),f.push(c);continue}if(c=this.tokenizer.del(a)){a=a.substring(c.raw.length),f.push(c);continue}if(c=this.tokenizer.autolink(a,Hf)){a=a.substring(c.raw.length),f.push(c);continue}if(!this.state.inLink&&(c=this.tokenizer.url(a,Hf))){a=a.substring(c.raw.length),f.push(c);continue}if(b=a,this.options.extensions&&this.options.extensions.startInline&&function(){var L=1/0,T=a.slice(1),O=void 0;p.options.extensions.startInline.forEach(function(N){O=N.call({lexer:this},T),typeof O=="number"&&O>=0&&(L=Math.min(L,O))}),L<1/0&&L>=0&&(b=a.substring(0,L+1))}(),c=this.tokenizer.inlineText(b,cp)){a=a.substring(c.raw.length),c.raw.slice(-1)!=="_"&&(S=c.raw.slice(-1)),C=!0,h=f[f.length-1],h&&h.type==="text"?(h.raw+=c.raw,h.text+=c.text):f.push(c);continue}if(a){var _="Infinite loop on byte: "+a.charCodeAt(0);if(this.options.silent){console.error(_);break}else throw new Error(_)}}return f},Xh(o,null,[{key:"rules",get:function(){return{block:de,inline:ne}}}]),o}(),lo=function(){function o(s){this.options=s||_e.defaults}var l=o.prototype;return l.code=function(a,f,p){var c=(f||"").match(/\S*/)[0];if(this.options.highlight){var h=this.options.highlight(a,c);h!=null&&h!==a&&(p=!0,a=h)}return a=a.replace(/\n$/,"")+` +`,c?'
'+(p?a:ht(a,!0))+`
+`:"
"+(p?a:ht(a,!0))+`
+`},l.blockquote=function(a){return`
+`+a+`
+`},l.html=function(a){return a},l.heading=function(a,f,p,c){if(this.options.headerIds){var h=this.options.headerPrefix+c.slug(p);return"'+a+" +`}return""+a+" +`},l.hr=function(){return this.options.xhtml?`
`:`
-`},f.list=function(l,s,g){var d=s?"ol":"ul",p=s&&g!==1?' start="'+g+'"':"";return"<"+d+p+`> -`+l+" -`},f.listitem=function(l){return"
  • "+l+`
  • -`},f.checkbox=function(l){return" "},f.paragraph=function(l){return"

    "+l+`

    -`},f.table=function(l,s){return s&&(s=""+s+""),` +`},l.list=function(a,f,p){var c=f?"ol":"ul",h=f&&p!==1?' start="'+p+'"':"";return"<"+c+h+`> +`+a+" +`},l.listitem=function(a){return"
  • "+a+`
  • +`},l.checkbox=function(a){return" "},l.paragraph=function(a){return"

    "+a+`

    +`},l.table=function(a,f){return f&&(f=""+f+""),`
    -`+l+` -`+s+`
    -`},f.tablerow=function(l){return` -`+l+` -`},f.tablecell=function(l,s){var g=s.header?"th":"td",d=s.align?"<"+g+' align="'+s.align+'">':"<"+g+">";return d+l+(" -`)},f.strong=function(l){return""+l+""},f.em=function(l){return""+l+""},f.codespan=function(l){return""+l+""},f.br=function(){return this.options.xhtml?"
    ":"
    "},f.del=function(l){return""+l+""},f.link=function(l,s,g){if(l=su(this.options.sanitize,this.options.baseUrl,l),l===null)return g;var d='",d},f.image=function(l,s,g){if(l=su(this.options.sanitize,this.options.baseUrl,l),l===null)return g;var d=''+g+'":">",d},f.text=function(l){return l},o}(),ta=function(){function o(){}var f=o.prototype;return f.strong=function(l){return l},f.em=function(l){return l},f.codespan=function(l){return l},f.del=function(l){return l},f.html=function(l){return l},f.text=function(l){return l},f.link=function(l,s,g){return""+g},f.image=function(l,s,g){return""+g},f.br=function(){return""},o}(),ra=function(){function o(){this.seen={}}var f=o.prototype;return f.serialize=function(l){return l.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},f.getNextSafeSlug=function(l,s){var g=l,d=0;if(this.seen.hasOwnProperty(g)){d=this.seen[l];do d++,g=l+"-"+d;while(this.seen.hasOwnProperty(g))}return s||(this.seen[l]=d,this.seen[g]=0),g},f.slug=function(l,s){s===void 0&&(s={});var g=this.serialize(l);return this.getNextSafeSlug(g,s.dryrun)},o}(),Wr=function(){function o(c){this.options=c||Se.defaults,this.options.renderer=this.options.renderer||new hn,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ta,this.slugger=new ra}o.parse=function(l,s){var g=new o(s);return g.parse(l)},o.parseInline=function(l,s){var g=new o(s);return g.parseInline(l)};var f=o.prototype;return f.parse=function(l,s){s===void 0&&(s=!0);var g="",d,p,y,w,D,S,F,T,z,N,A,B,I,R,H,_,X,K,ge,G=l.length;for(d=0;d0&&H.tokens[0].type==="paragraph"?(H.tokens[0].text=K+" "+H.tokens[0].text,H.tokens[0].tokens&&H.tokens[0].tokens.length>0&&H.tokens[0].tokens[0].type==="text"&&(H.tokens[0].tokens[0].text=K+" "+H.tokens[0].tokens[0].text)):H.tokens.unshift({type:"text",text:K}):R+=K),R+=this.parse(H.tokens,I),z+=this.renderer.listitem(R,X,_);g+=this.renderer.list(z,A,B);continue}case"html":{g+=this.renderer.html(N.text);continue}case"paragraph":{g+=this.renderer.paragraph(this.parseInline(N.tokens));continue}case"text":{for(z=N.tokens?this.parseInline(N.tokens):N.text;d+1";if(f)return Promise.resolve(s);if(c){c(null,s);return}return s}if(f)return Promise.reject(l);if(c){c(l);return}throw l}}function vu(o,f){return function(c,l,s){typeof l=="function"&&(s=l,l=null);var g=gt({},l);l=gt({},le.defaults,g);var d=pd(l.silent,l.async,s);if(typeof c>"u"||c===null)return d(new Error("marked(): input parameter is undefined or null"));if(typeof c!="string")return d(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(c)+", string expected"));if(cd(l),l.hooks&&(l.hooks.options=l),s){var p=l.highlight,y;try{l.hooks&&(c=l.hooks.preprocess(c)),y=o(c,l)}catch(T){return d(T)}var w=function(z){var N;if(!z)try{l.walkTokens&&le.walkTokens(y,l.walkTokens),N=f(y,l),l.hooks&&(N=l.hooks.postprocess(N))}catch(A){z=A}return l.highlight=p,z?d(z):s(null,N)};if(!p||p.length<3||(delete l.highlight,!y.length))return w();var D=0;le.walkTokens(y,function(T){T.type==="code"&&(D++,setTimeout(function(){p(T.text,T.lang,function(z,N){if(z)return w(z);N!=null&&N!==T.text&&(T.text=N,T.escaped=!0),D--,D===0&&w()})},0))}),D===0&&w();return}if(l.async)return Promise.resolve(l.hooks?l.hooks.preprocess(c):c).then(function(T){return o(T,l)}).then(function(T){return l.walkTokens?Promise.all(le.walkTokens(T,l.walkTokens)).then(function(){return T}):T}).then(function(T){return f(T,l)}).then(function(T){return l.hooks?l.hooks.postprocess(T):T}).catch(d);try{l.hooks&&(c=l.hooks.preprocess(c));var S=o(c,l);l.walkTokens&&le.walkTokens(S,l.walkTokens);var F=f(S,l);return l.hooks&&(F=l.hooks.postprocess(F)),F}catch(T){return d(T)}}}function le(o,f,c){return vu(_r.lex,Wr.parse)(o,f,c)}le.options=le.setOptions=function(o){return le.defaults=gt({},le.defaults,o),$c(le.defaults),le};le.getDefaults=ea;le.defaults=Se.defaults;le.use=function(){for(var o=le.defaults.extensions||{renderers:{},childTokens:{}},f=arguments.length,c=new Array(f),l=0;l{"use strict";var qr=ct();ks();Fs();Ls();Qo();Jo();Ws();js();Xs();Qs();Vs();Zo();var Cd=nu(),ia=mu().marked,xu=/Mac/.test(navigator.platform),kd=new RegExp(/()+?/g),ki={toggleBold:vn,toggleItalic:mn,drawLink:Ln,toggleHeadingSmaller:Si,toggleHeadingBigger:Dn,drawImage:Tn,toggleBlockquote:xn,toggleOrderedList:Fn,toggleUnorderedList:Sn,toggleCheckList:En,toggleCodeBlock:bn,togglePreview:zn,toggleStrikethrough:yn,toggleHeading1:wn,toggleHeading2:Cn,toggleHeading3:kn,toggleHeading4:oa,toggleHeading5:aa,toggleHeading6:la,cleanBlock:An,drawTable:Mn,drawHorizontalRule:Bn,undo:Nn,redo:In,toggleSideBySide:Ur,toggleFullScreen:gr},Sd={toggleBold:"Cmd-B",toggleItalic:"Cmd-I",drawLink:"Cmd-K",toggleHeadingSmaller:"Cmd-H",toggleHeadingBigger:"Shift-Cmd-H",toggleHeading1:"Ctrl+Alt+1",toggleHeading2:"Ctrl+Alt+2",toggleHeading3:"Ctrl+Alt+3",toggleHeading4:"Ctrl+Alt+4",toggleHeading5:"Ctrl+Alt+5",toggleHeading6:"Ctrl+Alt+6",cleanBlock:"Cmd-E",drawImage:"Cmd-Alt-I",toggleBlockquote:"Cmd-'",toggleOrderedList:"Cmd-Alt-L",toggleUnorderedList:"Cmd-L",toggleCheckList:"Shift-Cmd-L",toggleCodeBlock:"Cmd-Alt-C",togglePreview:"Cmd-P",toggleSideBySide:"F9",toggleFullScreen:"F11"},Fd=function(o){for(var f in ki)if(ki[f]===o)return f;return null},na=function(){var o=!1;return function(f){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(f)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(f.substr(0,4)))&&(o=!0)}(navigator.userAgent||navigator.vendor||window.opera),o};function Ed(o){for(var f;(f=kd.exec(o))!==null;){var c=f[0];if(c.indexOf("target=")===-1){var l=c.replace(/>$/,' target="_blank">');o=o.replace(c,l)}}return o}function Ad(o){for(var f=new DOMParser,c=f.parseFromString(o,"text/html"),l=c.getElementsByTagName("li"),s=0;s0){for(var T=document.createElement("i"),z=0;z +`+f+` +`},l.tablerow=function(a){return` +`+a+` +`},l.tablecell=function(a,f){var p=f.header?"th":"td",c=f.align?"<"+p+' align="'+f.align+'">':"<"+p+">";return c+a+(" +`)},l.strong=function(a){return""+a+""},l.em=function(a){return""+a+""},l.codespan=function(a){return""+a+""},l.br=function(){return this.options.xhtml?"
    ":"
    "},l.del=function(a){return""+a+""},l.link=function(a,f,p){if(a=Of(this.options.sanitize,this.options.baseUrl,a),a===null)return p;var c='
    ",c},l.image=function(a,f,p){if(a=Of(this.options.sanitize,this.options.baseUrl,a),a===null)return p;var c=''+p+'":">",c},l.text=function(a){return a},o}(),fl=function(){function o(){}var l=o.prototype;return l.strong=function(a){return a},l.em=function(a){return a},l.codespan=function(a){return a},l.del=function(a){return a},l.html=function(a){return a},l.text=function(a){return a},l.link=function(a,f,p){return""+p},l.image=function(a,f,p){return""+p},l.br=function(){return""},o}(),cl=function(){function o(){this.seen={}}var l=o.prototype;return l.serialize=function(a){return a.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},l.getNextSafeSlug=function(a,f){var p=a,c=0;if(this.seen.hasOwnProperty(p)){c=this.seen[a];do c++,p=a+"-"+c;while(this.seen.hasOwnProperty(p))}return f||(this.seen[a]=c,this.seen[p]=0),p},l.slug=function(a,f){f===void 0&&(f={});var p=this.serialize(a);return this.getNextSafeSlug(p,f.dryrun)},o}(),xn=function(){function o(s){this.options=s||_e.defaults,this.options.renderer=this.options.renderer||new lo,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new fl,this.slugger=new cl}o.parse=function(a,f){var p=new o(f);return p.parse(a)},o.parseInline=function(a,f){var p=new o(f);return p.parseInline(a)};var l=o.prototype;return l.parse=function(a,f){f===void 0&&(f=!0);var p="",c,h,b,y,x,C,S,F,_,L,T,O,N,P,I,q,j,X,me,U=a.length;for(c=0;c0&&I.tokens[0].type==="paragraph"?(I.tokens[0].text=X+" "+I.tokens[0].text,I.tokens[0].tokens&&I.tokens[0].tokens.length>0&&I.tokens[0].tokens[0].type==="text"&&(I.tokens[0].tokens[0].text=X+" "+I.tokens[0].tokens[0].text)):I.tokens.unshift({type:"text",text:X}):P+=X),P+=this.parse(I.tokens,N),_+=this.renderer.listitem(P,j,q);p+=this.renderer.list(_,T,O);continue}case"html":{p+=this.renderer.html(L.text);continue}case"paragraph":{p+=this.renderer.paragraph(this.parseInline(L.tokens));continue}case"text":{for(_=L.tokens?this.parseInline(L.tokens):L.text;c+1";if(l)return Promise.resolve(f);if(s){s(null,f);return}return f}if(l)return Promise.reject(a);if(s){s(a);return}throw a}}function Uf(o,l){return function(s,a,f){typeof a=="function"&&(f=a,a=null);var p=_t({},a);a=_t({},ce.defaults,p);var c=dp(a.silent,a.async,f);if(typeof s>"u"||s===null)return c(new Error("marked(): input parameter is undefined or null"));if(typeof s!="string")return c(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(s)+", string expected"));if(up(a),a.hooks&&(a.hooks.options=a),f){var h=a.highlight,b;try{a.hooks&&(s=a.hooks.preprocess(s)),b=o(s,a)}catch(F){return c(F)}var y=function(_){var L;if(!_)try{a.walkTokens&&ce.walkTokens(b,a.walkTokens),L=l(b,a),a.hooks&&(L=a.hooks.postprocess(L))}catch(T){_=T}return a.highlight=h,_?c(_):f(null,L)};if(!h||h.length<3||(delete a.highlight,!b.length))return y();var x=0;ce.walkTokens(b,function(F){F.type==="code"&&(x++,setTimeout(function(){h(F.text,F.lang,function(_,L){if(_)return y(_);L!=null&&L!==F.text&&(F.text=L,F.escaped=!0),x--,x===0&&y()})},0))}),x===0&&y();return}if(a.async)return Promise.resolve(a.hooks?a.hooks.preprocess(s):s).then(function(F){return o(F,a)}).then(function(F){return a.walkTokens?Promise.all(ce.walkTokens(F,a.walkTokens)).then(function(){return F}):F}).then(function(F){return l(F,a)}).then(function(F){return a.hooks?a.hooks.postprocess(F):F}).catch(c);try{a.hooks&&(s=a.hooks.preprocess(s));var C=o(s,a);a.walkTokens&&ce.walkTokens(C,a.walkTokens);var S=l(C,a);return a.hooks&&(S=a.hooks.postprocess(S)),S}catch(F){return c(F)}}}function ce(o,l,s){return Uf(yn.lex,xn.parse)(o,l,s)}ce.options=ce.setOptions=function(o){return ce.defaults=_t({},ce.defaults,o),Qh(ce.defaults),ce};ce.getDefaults=ul;ce.defaults=_e.defaults;ce.use=function(){for(var o=ce.defaults.extensions||{renderers:{},childTokens:{}},l=arguments.length,s=new Array(l),a=0;a{"use strict";var Dn=Et();Qu();$u();tf();ol();al();pf();mf();xf();Cf();Ef();il();var Dp=Mf(),dl=jf().marked,Kf=/Mac/.test(navigator.platform),wp=new RegExp(/()+?/g),ui={toggleBold:fo,toggleItalic:co,drawLink:ko,toggleHeadingSmaller:fi,toggleHeadingBigger:vo,drawImage:So,toggleBlockquote:go,toggleOrderedList:Do,toggleUnorderedList:xo,toggleCheckList:wo,toggleCodeBlock:po,togglePreview:Lo,toggleStrikethrough:ho,toggleHeading1:mo,toggleHeading2:bo,toggleHeading3:yo,toggleHeading4:pl,toggleHeading5:gl,toggleHeading6:vl,cleanBlock:Co,drawTable:Eo,drawHorizontalRule:Ao,undo:Fo,redo:To,toggleSideBySide:wn,toggleFullScreen:jr},Cp={toggleBold:"Cmd-B",toggleItalic:"Cmd-I",drawLink:"Cmd-K",toggleHeadingSmaller:"Cmd-H",toggleHeadingBigger:"Shift-Cmd-H",toggleHeading1:"Ctrl+Alt+1",toggleHeading2:"Ctrl+Alt+2",toggleHeading3:"Ctrl+Alt+3",toggleHeading4:"Ctrl+Alt+4",toggleHeading5:"Ctrl+Alt+5",toggleHeading6:"Ctrl+Alt+6",cleanBlock:"Cmd-E",drawImage:"Cmd-Alt-I",toggleBlockquote:"Cmd-'",toggleOrderedList:"Cmd-Alt-L",toggleUnorderedList:"Cmd-L",toggleCheckList:"Shift-Cmd-L",toggleCodeBlock:"Cmd-Alt-C",togglePreview:"Cmd-P",toggleSideBySide:"F9",toggleFullScreen:"F11"},kp=function(o){for(var l in ui)if(ui[l]===o)return l;return null},hl=function(){var o=!1;return function(l){(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(l)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(l.substr(0,4)))&&(o=!0)}(navigator.userAgent||navigator.vendor||window.opera),o};function Sp(o){for(var l;(l=wp.exec(o))!==null;){var s=l[0];if(s.indexOf("target=")===-1){var a=s.replace(/>$/,' target="_blank">');o=o.replace(s,a)}}return o}function Ep(o){for(var l=new DOMParser,s=l.parseFromString(o,"text/html"),a=s.getElementsByTagName("li"),f=0;f0){for(var F=document.createElement("i"),_=0;_=0&&(D=d.getLineHandle(F),!c(D));F--);var B=d.getTokenAt({line:F,ch:1}),I=l(B).fencedChars,R,H,_,X;c(d.getLineHandle(p.line))?(R="",H=p.line):c(d.getLineHandle(p.line-1))?(R="",H=p.line-1):(R=I+` -`,H=p.line),c(d.getLineHandle(y.line))?(_="",X=y.line,y.ch===0&&(X+=1)):y.ch!==0&&c(d.getLineHandle(y.line+1))?(_="",X=y.line+1):(_=I+` -`,X=y.line+1),y.ch===0&&(X-=1),d.operation(function(){d.replaceRange(_,{line:X,ch:0},{line:X+(_?0:1),ch:0}),d.replaceRange(R,{line:H,ch:0},{line:H+(R?0:1),ch:0})}),d.setSelection({line:H+(R?1:0),ch:0},{line:X+(R?1:-1),ch:0}),d.focus()}else{var K=p.line;if(c(d.getLineHandle(p.line))&&(s(d,p.line+1)==="fenced"?(F=p.line,K=p.line+1):(T=p.line,K=p.line-1)),F===void 0)for(F=K;F>=0&&(D=d.getLineHandle(F),!c(D));F--);if(T===void 0)for(z=d.lineCount(),T=K;T=0;F--)if(D=d.getLineHandle(F),!D.text.match(/^\s*$/)&&s(d,F,D)!=="indented"){F+=1;break}for(z=d.lineCount(),T=p.line;T\s+/,"unordered-list":l,"ordered-list":l,"check-list":/^(\s*)(- \[[ xX]])(\s+)/},w=function(B,I){var R={quote:">","unordered-list":c,"ordered-list":"%%i.","check-list":"- [ ]"};return R[B].replace("%%i",I)},D=function(B,I){var R={quote:">","unordered-list":"\\"+c,"ordered-list":"\\d+.","check-list":"- \\[[ xX]]"},H=new RegExp(R[B]);return I&&H.test(I)},S=function(B,I,R){var H=l.exec(I),_=w(B,F);return H!==null?(D(B,H[2])&&(_=""),I=H[1]+_+H[3]+I.replace(s,"").replace(y[B],"$1")):R==!1&&(I=_+" "+I),I},F=1,T=["unordered-list","ordered-list","check-list"],z=Object.keys(g)[0];if(!T.includes(z)){var N=o.getLine(d.line);/^\s*- \[[ xX]]\s/.test(N)?z="check-list":/^\s*\d+\.\s/.test(N)?z="ordered-list":/^\s*[*\-+]\s/.test(N)&&(z="unordered-list")}for(var A=d.line;A<=p.line;A++)(function(B){var I=o.getLine(B);g[f]?I=I.replace(y[f],"$1"):T.includes(z)&&T.includes(f)?(I=I.replace(y[z],"$1"),I=S(f,I,!1),F+=1):(I=S(f,I,!1),F+=1),o.replaceRange(I,{line:B,ch:0},{line:B,ch:99999999999999})})(A);o.focus()}}function ku(o,f,c,l){if(!(!o.codemirror||o.isPreviewActive())){var s=o.codemirror,g=Vt(s),d=g[f];if(!d){vr(s,d,c,l);return}var p=s.getCursor("start"),y=s.getCursor("end"),w=s.getLine(p.line),D=w.slice(0,p.ch),S=w.slice(p.ch);f=="link"?D=D.replace(/(.*)[^!]\[/,"$1"):f=="image"&&(D=D.replace(/(.*)!\[$/,"$1")),S=S.replace(/]\(.*?\)/,""),s.replaceRange(D+S,{line:p.line,ch:0},{line:p.line,ch:99999999999999}),p.ch-=c[0].length,p!==y&&(y.ch-=c[0].length),s.setSelection(p,y),s.focus()}}function ua(o,f,c,l){if(!(!o.codemirror||o.isPreviewActive())){l=typeof l>"u"?c:l;var s=o.codemirror,g=Vt(s),d,p=c,y=l,w=s.getCursor("start"),D=s.getCursor("end");g[f]?(d=s.getLine(w.line),p=d.slice(0,w.ch),y=d.slice(w.ch),f=="bold"?(p=p.replace(/(\*\*|__)(?![\s\S]*(\*\*|__))/,""),y=y.replace(/(\*\*|__)/,"")):f=="italic"?(p=p.replace(/(\*|_)(?![\s\S]*(\*|_))/,""),y=y.replace(/(\*|_)/,"")):f=="strikethrough"&&(p=p.replace(/(\*\*|~~)(?![\s\S]*(\*\*|~~))/,""),y=y.replace(/(\*\*|~~)/,"")),s.replaceRange(p+y,{line:w.line,ch:0},{line:w.line,ch:99999999999999}),f=="bold"||f=="strikethrough"?(w.ch-=2,w!==D&&(D.ch-=2)):f=="italic"&&(w.ch-=1,w!==D&&(D.ch-=1))):(d=s.getSelection(),f=="bold"?(d=d.split("**").join(""),d=d.split("__").join("")):f=="italic"?(d=d.split("*").join(""),d=d.split("_").join("")):f=="strikethrough"&&(d=d.split("~~").join("")),s.replaceSelection(p+d+y),w.ch+=c.length,D.ch=w.ch+d.length),s.setSelection(w,D),s.focus()}}function Bd(o){if(!o.getWrapperElement().lastChild.classList.contains("editor-preview-active"))for(var f=o.getCursor("start"),c=o.getCursor("end"),l,s=f.line;s<=c.line;s++)l=o.getLine(s),l=l.replace(/^[ ]*([# ]+|\*|-|[> ]+|[0-9]+(.|\)))[ ]*/,""),o.replaceRange(l,{line:s,ch:0},{line:s,ch:99999999999999})}function gn(o,f){if(Math.abs(o)<1024)return""+o+f[0];var c=0;do o/=1024,++c;while(Math.abs(o)>=1024&&c=19968?l+=c[s].length:l+=1;return l}var ke={bold:"fa fa-bold",italic:"fa fa-italic",strikethrough:"fa fa-strikethrough",heading:"fa fa-header fa-heading","heading-smaller":"fa fa-header fa-heading header-smaller","heading-bigger":"fa fa-header fa-heading header-bigger","heading-1":"fa fa-header fa-heading header-1","heading-2":"fa fa-header fa-heading header-2","heading-3":"fa fa-header fa-heading header-3",code:"fa fa-code",quote:"fa fa-quote-left","ordered-list":"fa fa-list-ol","unordered-list":"fa fa-list-ul","check-list":"fa fa-check-square-o","clean-block":"fa fa-eraser",link:"fa fa-link",image:"fa fa-image","upload-image":"fa fa-image",table:"fa fa-table","horizontal-rule":"fa fa-minus",preview:"fa fa-eye","side-by-side":"fa fa-columns",fullscreen:"fa fa-arrows-alt",guide:"fa fa-question-circle",undo:"fa fa-undo",redo:"fa fa-repeat fa-redo"},pr={bold:{name:"bold",action:vn,className:ke.bold,title:"Bold",default:!0},italic:{name:"italic",action:mn,className:ke.italic,title:"Italic",default:!0},strikethrough:{name:"strikethrough",action:yn,className:ke.strikethrough,title:"Strikethrough"},heading:{name:"heading",action:Si,className:ke.heading,title:"Heading",default:!0},"heading-smaller":{name:"heading-smaller",action:Si,className:ke["heading-smaller"],title:"Smaller Heading"},"heading-bigger":{name:"heading-bigger",action:Dn,className:ke["heading-bigger"],title:"Bigger Heading"},"heading-1":{name:"heading-1",action:wn,className:ke["heading-1"],title:"Big Heading"},"heading-2":{name:"heading-2",action:Cn,className:ke["heading-2"],title:"Medium Heading"},"heading-3":{name:"heading-3",action:kn,className:ke["heading-3"],title:"Small Heading"},"separator-1":{name:"separator-1"},code:{name:"code",action:bn,className:ke.code,title:"Code"},quote:{name:"quote",action:xn,className:ke.quote,title:"Quote",default:!0},"unordered-list":{name:"unordered-list",action:Sn,className:ke["unordered-list"],title:"Generic List",default:!0},"ordered-list":{name:"ordered-list",action:Fn,className:ke["ordered-list"],title:"Numbered List",default:!0},"check-list":{name:"check-list",action:En,className:ke["check-list"],title:"Check List",default:!0},"clean-block":{name:"clean-block",action:An,className:ke["clean-block"],title:"Clean block"},"separator-2":{name:"separator-2"},link:{name:"link",action:Ln,className:ke.link,title:"Create Link",default:!0},image:{name:"image",action:Tn,className:ke.image,title:"Insert Image",default:!0},"upload-image":{name:"upload-image",action:sa,className:ke["upload-image"],title:"Import an image"},table:{name:"table",action:Mn,className:ke.table,title:"Insert Table"},"horizontal-rule":{name:"horizontal-rule",action:Bn,className:ke["horizontal-rule"],title:"Insert Horizontal Line"},"separator-3":{name:"separator-3"},preview:{name:"preview",action:zn,className:ke.preview,noDisable:!0,title:"Toggle Preview",default:!0},"side-by-side":{name:"side-by-side",action:Ur,className:ke["side-by-side"],noDisable:!0,noMobile:!0,title:"Toggle Side by Side",default:!0},fullscreen:{name:"fullscreen",action:gr,className:ke.fullscreen,noDisable:!0,noMobile:!0,title:"Toggle Fullscreen",default:!0},"separator-4":{name:"separator-4"},guide:{name:"guide",action:"https://www.markdownguide.org/basic-syntax/",className:ke.guide,noDisable:!0,title:"Markdown Guide",default:!0},"separator-5":{name:"separator-5"},undo:{name:"undo",action:Nn,className:ke.undo,noDisable:!0,title:"Undo"},redo:{name:"redo",action:In,className:ke.redo,noDisable:!0,title:"Redo"}},Nd={link:["[","](#url#)"],image:["![","](#url#)"],uploadedImage:["![](#url#)",""],table:["",` +`+ue;A&&Ue++,A&&Z.ch===0&&(ee=ue+` +`,Ue--),Gr(z,!1,[D,ee]),z.setSelection({line:De,ch:0},{line:Ue,ch:0})}var c=o.codemirror,h=c.getCursor("start"),b=c.getCursor("end"),y=c.getTokenAt({line:h.line,ch:h.ch||1}),x=c.getLineHandle(h.line),C=f(c,h.line,x,y),S,F,_;if(C==="single"){var L=x.text.slice(0,h.ch).replace("`",""),T=x.text.slice(h.ch).replace("`","");c.replaceRange(L+T,{line:h.line,ch:0},{line:h.line,ch:99999999999999}),h.ch--,h!==b&&b.ch--,c.setSelection(h,b),c.focus()}else if(C==="fenced")if(h.line!==b.line||h.ch!==b.ch){for(S=h.line;S>=0&&(x=c.getLineHandle(S),!s(x));S--);var O=c.getTokenAt({line:S,ch:1}),N=a(O).fencedChars,P,I,q,j;s(c.getLineHandle(h.line))?(P="",I=h.line):s(c.getLineHandle(h.line-1))?(P="",I=h.line-1):(P=N+` +`,I=h.line),s(c.getLineHandle(b.line))?(q="",j=b.line,b.ch===0&&(j+=1)):b.ch!==0&&s(c.getLineHandle(b.line+1))?(q="",j=b.line+1):(q=N+` +`,j=b.line+1),b.ch===0&&(j-=1),c.operation(function(){c.replaceRange(q,{line:j,ch:0},{line:j+(q?0:1),ch:0}),c.replaceRange(P,{line:I,ch:0},{line:I+(P?0:1),ch:0})}),c.setSelection({line:I+(P?1:0),ch:0},{line:j+(P?1:-1),ch:0}),c.focus()}else{var X=h.line;if(s(c.getLineHandle(h.line))&&(f(c,h.line+1)==="fenced"?(S=h.line,X=h.line+1):(F=h.line,X=h.line-1)),S===void 0)for(S=X;S>=0&&(x=c.getLineHandle(S),!s(x));S--);if(F===void 0)for(_=c.lineCount(),F=X;F<_&&(x=c.getLineHandle(F),!s(x));F++);c.operation(function(){c.replaceRange("",{line:S,ch:0},{line:S+1,ch:0}),c.replaceRange("",{line:F-1,ch:0},{line:F,ch:0})}),c.focus()}else if(C==="indented"){if(h.line!==b.line||h.ch!==b.ch)S=h.line,F=b.line,b.ch===0&&F--;else{for(S=h.line;S>=0;S--)if(x=c.getLineHandle(S),!x.text.match(/^\s*$/)&&f(c,S,x)!=="indented"){S+=1;break}for(_=c.lineCount(),F=h.line;F<_;F++)if(x=c.getLineHandle(F),!x.text.match(/^\s*$/)&&f(c,F,x)!=="indented"){F-=1;break}}var me=c.getLineHandle(F+1),U=me&&c.getTokenAt({line:F+1,ch:me.text.length-1}),le=U&&a(U).indentedCode;le&&c.replaceRange(` +`,{line:F+1,ch:0});for(var ie=S;ie<=F;ie++)c.indentLine(ie,"subtract");c.focus()}else{var K=h.line===b.line&&h.ch===b.ch&&h.ch===0,E=h.line!==b.line;K||E?p(c,h,b,l):Gr(c,!1,["`","`"])}}function go(o){Mo(o.codemirror,"quote")}function fi(o){Er(o.codemirror,"smaller")}function vo(o){Er(o.codemirror,"bigger")}function mo(o){Er(o.codemirror,void 0,1)}function bo(o){Er(o.codemirror,void 0,2)}function yo(o){Er(o.codemirror,void 0,3)}function pl(o){Er(o.codemirror,void 0,4)}function gl(o){Er(o.codemirror,void 0,5)}function vl(o){Er(o.codemirror,void 0,6)}function xo(o){var l=o.codemirror,s="*";["-","+","*"].includes(o.options.unorderedListStyle)&&(s=o.options.unorderedListStyle),Mo(l,"unordered-list",s)}function Do(o){Mo(o.codemirror,"ordered-list")}function wo(o){Mo(o.codemirror,"check-list")}function Co(o){Lp(o.codemirror)}function ko(o){var l=o.options,s="https://";if(l.promptURLs){var a=prompt(l.promptTexts.link,s);if(!a)return!1;s=Zf(a)}Jf(o,"link",l.insertTexts.link,s)}function So(o){var l=o.options,s="https://";if(l.promptURLs){var a=prompt(l.promptTexts.image,s);if(!a)return!1;s=Zf(a)}Jf(o,"image",l.insertTexts.image,s)}function Zf(o){return encodeURI(o).replace(/([\\()])/g,"\\$1")}function ml(o){o.openBrowseFileWindow()}function Qf(o,l){var s=o.codemirror,a=Sr(s),f=o.options,p=l.substr(l.lastIndexOf("/")+1),c=p.substring(p.lastIndexOf(".")+1).replace(/\?.*$/,"").toLowerCase();if(["png","jpg","jpeg","gif","svg","apng","avif","webp"].includes(c))Gr(s,a.image,f.insertTexts.uploadedImage,l);else{var h=f.insertTexts.link;h[0]="["+p,Gr(s,a.link,h,l)}o.updateStatusBar("upload-image",o.options.imageTexts.sbOnUploaded.replace("#image_name#",p)),setTimeout(function(){o.updateStatusBar("upload-image",o.options.imageTexts.sbInit)},1e3)}function Eo(o){var l=o.codemirror,s=Sr(l),a=o.options;Gr(l,s.table,a.insertTexts.table)}function Ao(o){var l=o.codemirror,s=Sr(l),a=o.options;Gr(l,s.image,a.insertTexts.horizontalRule)}function Fo(o){var l=o.codemirror;l.undo(),l.focus()}function To(o){var l=o.codemirror;l.redo(),l.focus()}function wn(o){var l=o.codemirror,s=l.getWrapperElement(),a=s.nextSibling,f=o.toolbarElements&&o.toolbarElements["side-by-side"],p=!1,c=s.parentNode;a.classList.contains("editor-preview-active-side")?(o.options.sideBySideFullscreen===!1&&c.classList.remove("sided--no-fullscreen"),a.classList.remove("editor-preview-active-side"),f&&f.classList.remove("active"),s.classList.remove("CodeMirror-sided")):(setTimeout(function(){l.getOption("fullScreen")||(o.options.sideBySideFullscreen===!1?c.classList.add("sided--no-fullscreen"):jr(o)),a.classList.add("editor-preview-active-side")},1),f&&f.classList.add("active"),s.classList.add("CodeMirror-sided"),p=!0);var h=s.lastChild;if(h.classList.contains("editor-preview-active")){h.classList.remove("editor-preview-active");var b=o.toolbarElements.preview,y=o.toolbar_div;b.classList.remove("active"),y.classList.remove("disabled-for-preview")}var x=function(){var S=o.options.previewRender(o.value(),a);S!=null&&(a.innerHTML=S)};if(l.sideBySideRenderingFunction||(l.sideBySideRenderingFunction=x),p){var C=o.options.previewRender(o.value(),a);C!=null&&(a.innerHTML=C),l.on("update",l.sideBySideRenderingFunction)}else l.off("update",l.sideBySideRenderingFunction);l.refresh()}function Lo(o){var l=o.codemirror,s=l.getWrapperElement(),a=o.toolbar_div,f=o.options.toolbar?o.toolbarElements.preview:!1,p=s.lastChild,c=l.getWrapperElement().nextSibling;if(c.classList.contains("editor-preview-active-side")&&wn(o),!p||!p.classList.contains("editor-preview-full")){if(p=document.createElement("div"),p.className="editor-preview-full",o.options.previewClass)if(Array.isArray(o.options.previewClass))for(var h=0;h\s+/,"unordered-list":a,"ordered-list":a,"check-list":/^(\s*)(- \[[ xX]])(\s+)/},y=function(O,N){var P={quote:">","unordered-list":s,"ordered-list":"%%i.","check-list":"- [ ]"};return P[O].replace("%%i",N)},x=function(O,N){var P={quote:">","unordered-list":"\\"+s,"ordered-list":"\\d+.","check-list":"- \\[[ xX]]"},I=new RegExp(P[O]);return N&&I.test(N)},C=function(O,N,P){var I=a.exec(N),q=y(O,S);return I!==null?(x(O,I[2])&&(q=""),N=I[1]+q+I[3]+N.replace(f,"").replace(b[O],"$1")):P==!1&&(N=q+" "+N),N},S=1,F=["unordered-list","ordered-list","check-list"],_=Object.keys(p)[0];if(!F.includes(_)){var L=o.getLine(c.line);/^\s*- \[[ xX]]\s/.test(L)?_="check-list":/^\s*\d+\.\s/.test(L)?_="ordered-list":/^\s*[*\-+]\s/.test(L)&&(_="unordered-list")}for(var T=c.line;T<=h.line;T++)(function(O){var N=o.getLine(O);p[l]?N=N.replace(b[l],"$1"):F.includes(_)&&F.includes(l)?(N=N.replace(b[_],"$1"),N=C(l,N,!1),S+=1):(N=C(l,N,!1),S+=1),o.replaceRange(N,{line:O,ch:0},{line:O,ch:99999999999999})})(T);o.focus()}}function Jf(o,l,s,a){if(!(!o.codemirror||o.isPreviewActive())){var f=o.codemirror,p=Sr(f),c=p[l];if(!c){Gr(f,c,s,a);return}var h=f.getCursor("start"),b=f.getCursor("end"),y=f.getLine(h.line),x=y.slice(0,h.ch),C=y.slice(h.ch);l=="link"?x=x.replace(/(.*)[^!]\[/,"$1"):l=="image"&&(x=x.replace(/(.*)!\[$/,"$1")),C=C.replace(/]\(.*?\)/,""),f.replaceRange(x+C,{line:h.line,ch:0},{line:h.line,ch:99999999999999}),h.ch-=s[0].length,h!==b&&(b.ch-=s[0].length),f.setSelection(h,b),f.focus()}}function bl(o,l,s,a){if(!(!o.codemirror||o.isPreviewActive())){a=typeof a>"u"?s:a;var f=o.codemirror,p=Sr(f),c,h=s,b=a,y=f.getCursor("start"),x=f.getCursor("end");p[l]?(c=f.getLine(y.line),h=c.slice(0,y.ch),b=c.slice(y.ch),l=="bold"?(h=h.replace(/(\*\*|__)(?![\s\S]*(\*\*|__))/,""),b=b.replace(/(\*\*|__)/,"")):l=="italic"?(h=h.replace(/(\*|_)(?![\s\S]*(\*|_))/,""),b=b.replace(/(\*|_)/,"")):l=="strikethrough"&&(h=h.replace(/(\*\*|~~)(?![\s\S]*(\*\*|~~))/,""),b=b.replace(/(\*\*|~~)/,"")),f.replaceRange(h+b,{line:y.line,ch:0},{line:y.line,ch:99999999999999}),l=="bold"||l=="strikethrough"?(y.ch-=2,y!==x&&(x.ch-=2)):l=="italic"&&(y.ch-=1,y!==x&&(x.ch-=1))):(c=f.getSelection(),l=="bold"?(c=c.split("**").join(""),c=c.split("__").join("")):l=="italic"?(c=c.split("*").join(""),c=c.split("_").join("")):l=="strikethrough"&&(c=c.split("~~").join("")),f.replaceSelection(h+c+b),y.ch+=s.length,x.ch=y.ch+c.length),f.setSelection(y,x),f.focus()}}function Lp(o){if(!o.getWrapperElement().lastChild.classList.contains("editor-preview-active"))for(var l=o.getCursor("start"),s=o.getCursor("end"),a,f=l.line;f<=s.line;f++)a=o.getLine(f),a=a.replace(/^[ ]*([# ]+|\*|-|[> ]+|[0-9]+(.|\)))[ ]*/,""),o.replaceRange(a,{line:f,ch:0},{line:f,ch:99999999999999})}function uo(o,l){if(Math.abs(o)<1024)return""+o+l[0];var s=0;do o/=1024,++s;while(Math.abs(o)>=1024&&s=19968?a+=s[f].length:a+=1;return a}var Me={bold:"fa fa-bold",italic:"fa fa-italic",strikethrough:"fa fa-strikethrough",heading:"fa fa-header fa-heading","heading-smaller":"fa fa-header fa-heading header-smaller","heading-bigger":"fa fa-header fa-heading header-bigger","heading-1":"fa fa-header fa-heading header-1","heading-2":"fa fa-header fa-heading header-2","heading-3":"fa fa-header fa-heading header-3",code:"fa fa-code",quote:"fa fa-quote-left","ordered-list":"fa fa-list-ol","unordered-list":"fa fa-list-ul","check-list":"fa fa-check-square-o","clean-block":"fa fa-eraser",link:"fa fa-link",image:"fa fa-image","upload-image":"fa fa-image",table:"fa fa-table","horizontal-rule":"fa fa-minus",preview:"fa fa-eye","side-by-side":"fa fa-columns",fullscreen:"fa fa-arrows-alt",guide:"fa fa-question-circle",undo:"fa fa-undo",redo:"fa fa-repeat fa-redo"},Ur={bold:{name:"bold",action:fo,className:Me.bold,title:"Bold",default:!0},italic:{name:"italic",action:co,className:Me.italic,title:"Italic",default:!0},strikethrough:{name:"strikethrough",action:ho,className:Me.strikethrough,title:"Strikethrough"},heading:{name:"heading",action:fi,className:Me.heading,title:"Heading",default:!0},"heading-smaller":{name:"heading-smaller",action:fi,className:Me["heading-smaller"],title:"Smaller Heading"},"heading-bigger":{name:"heading-bigger",action:vo,className:Me["heading-bigger"],title:"Bigger Heading"},"heading-1":{name:"heading-1",action:mo,className:Me["heading-1"],title:"Big Heading"},"heading-2":{name:"heading-2",action:bo,className:Me["heading-2"],title:"Medium Heading"},"heading-3":{name:"heading-3",action:yo,className:Me["heading-3"],title:"Small Heading"},"separator-1":{name:"separator-1"},code:{name:"code",action:po,className:Me.code,title:"Code"},quote:{name:"quote",action:go,className:Me.quote,title:"Quote",default:!0},"unordered-list":{name:"unordered-list",action:xo,className:Me["unordered-list"],title:"Generic List",default:!0},"ordered-list":{name:"ordered-list",action:Do,className:Me["ordered-list"],title:"Numbered List",default:!0},"check-list":{name:"check-list",action:wo,className:Me["check-list"],title:"Check List",default:!0},"clean-block":{name:"clean-block",action:Co,className:Me["clean-block"],title:"Clean block"},"separator-2":{name:"separator-2"},link:{name:"link",action:ko,className:Me.link,title:"Create Link",default:!0},image:{name:"image",action:So,className:Me.image,title:"Insert Image",default:!0},"upload-image":{name:"upload-image",action:ml,className:Me["upload-image"],title:"Import an image"},table:{name:"table",action:Eo,className:Me.table,title:"Insert Table"},"horizontal-rule":{name:"horizontal-rule",action:Ao,className:Me["horizontal-rule"],title:"Insert Horizontal Line"},"separator-3":{name:"separator-3"},preview:{name:"preview",action:Lo,className:Me.preview,noDisable:!0,title:"Toggle Preview",default:!0},"side-by-side":{name:"side-by-side",action:wn,className:Me["side-by-side"],noDisable:!0,noMobile:!0,title:"Toggle Side by Side",default:!0},fullscreen:{name:"fullscreen",action:jr,className:Me.fullscreen,noDisable:!0,noMobile:!0,title:"Toggle Fullscreen",default:!0},"separator-4":{name:"separator-4"},guide:{name:"guide",action:"https://www.markdownguide.org/basic-syntax/",className:Me.guide,noDisable:!0,title:"Markdown Guide",default:!0},"separator-5":{name:"separator-5"},undo:{name:"undo",action:Fo,className:Me.undo,noDisable:!0,title:"Undo"},redo:{name:"redo",action:To,className:Me.redo,noDisable:!0,title:"Redo"}},Mp={link:["[","](#url#)"],image:["![","](#url#)"],uploadedImage:["![](#url#)",""],table:["",` | Column 1 | Column 2 | Column 3 | | -------- | -------- | -------- | @@ -91,5 +91,15 @@ Please report this to https://github.com/markedjs/marked.`,o){var s="

    An error ----- -`]},Id={link:"URL for the link:",image:"URL of the image:"},zd={locale:"en-US",format:{hour:"2-digit",minute:"2-digit"}},Od={bold:"**",code:"```",italic:"*"},Hd={sbInit:"Attach files by drag and dropping or pasting from clipboard.",sbOnDragEnter:"Drop image to upload it.",sbOnDrop:"Uploading image #images_names#...",sbProgress:"Uploading #file_name#: #progress#%",sbOnUploaded:"Uploaded #image_name#",sizeUnits:" B, KB, MB"},Rd={noFileGiven:"You must select a file.",typeNotAllowed:"This image type is not allowed.",fileTooLarge:`Image #image_name# is too big (#image_size#). -Maximum file size is #image_max_size#.`,importError:"Something went wrong when uploading the image #image_name#."};function J(o){o=o||{},o.parent=this;var f=!0;if(o.autoDownloadFontAwesome===!1&&(f=!1),o.autoDownloadFontAwesome!==!0)for(var c=document.styleSheets,l=0;l-1&&(f=!1);if(f){var s=document.createElement("link");s.rel="stylesheet",s.href="https://maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css",document.getElementsByTagName("head")[0].appendChild(s)}if(o.element)this.element=o.element;else if(o.element===null){console.log("EasyMDE: Error. No element was found.");return}if(o.toolbar===void 0){o.toolbar=[];for(var g in pr)Object.prototype.hasOwnProperty.call(pr,g)&&(g.indexOf("separator-")!=-1&&o.toolbar.push("|"),(pr[g].default===!0||o.showIcons&&o.showIcons.constructor===Array&&o.showIcons.indexOf(g)!=-1)&&o.toolbar.push(g))}if(Object.prototype.hasOwnProperty.call(o,"previewClass")||(o.previewClass="editor-preview"),Object.prototype.hasOwnProperty.call(o,"status")||(o.status=["autosave","lines","words","cursor"],o.uploadImage&&o.status.unshift("upload-image")),o.previewRender||(o.previewRender=function(p){return this.parent.markdown(p)}),o.parsingConfig=Pt({highlightFormatting:!0},o.parsingConfig||{}),o.insertTexts=Pt({},Nd,o.insertTexts||{}),o.promptTexts=Pt({},Id,o.promptTexts||{}),o.blockStyles=Pt({},Od,o.blockStyles||{}),o.autosave!=null&&(o.autosave.timeFormat=Pt({},zd,o.autosave.timeFormat||{})),o.iconClassMap=Pt({},ke,o.iconClassMap||{}),o.shortcuts=Pt({},Sd,o.shortcuts||{}),o.maxHeight=o.maxHeight||void 0,o.direction=o.direction||"ltr",typeof o.maxHeight<"u"?o.minHeight=o.maxHeight:o.minHeight=o.minHeight||"300px",o.errorCallback=o.errorCallback||function(p){alert(p)},o.uploadImage=o.uploadImage||!1,o.imageMaxSize=o.imageMaxSize||2097152,o.imageAccept=o.imageAccept||"image/png, image/jpeg, image/gif, image/avif",o.imageTexts=Pt({},Hd,o.imageTexts||{}),o.errorMessages=Pt({},Rd,o.errorMessages||{}),o.imagePathAbsolute=o.imagePathAbsolute||!1,o.imageCSRFName=o.imageCSRFName||"csrfmiddlewaretoken",o.imageCSRFHeader=o.imageCSRFHeader||!1,o.imageInputName=o.imageInputName||"image",o.autosave!=null&&o.autosave.unique_id!=null&&o.autosave.unique_id!=""&&(o.autosave.uniqueId=o.autosave.unique_id),o.overlayMode&&o.overlayMode.combine===void 0&&(o.overlayMode.combine=!0),this.options=o,this.render(),o.initialValue&&(!this.options.autosave||this.options.autosave.foundSavedValue!==!0)&&this.value(o.initialValue),o.uploadImage){var d=this;this.codemirror.on("dragenter",function(p,y){d.updateStatusBar("upload-image",d.options.imageTexts.sbOnDragEnter),y.stopPropagation(),y.preventDefault()}),this.codemirror.on("dragend",function(p,y){d.updateStatusBar("upload-image",d.options.imageTexts.sbInit),y.stopPropagation(),y.preventDefault()}),this.codemirror.on("dragleave",function(p,y){d.updateStatusBar("upload-image",d.options.imageTexts.sbInit),y.stopPropagation(),y.preventDefault()}),this.codemirror.on("dragover",function(p,y){d.updateStatusBar("upload-image",d.options.imageTexts.sbOnDragEnter),y.stopPropagation(),y.preventDefault()}),this.codemirror.on("drop",function(p,y){y.stopPropagation(),y.preventDefault(),o.imageUploadFunction?d.uploadImagesUsingCustomFunction(o.imageUploadFunction,y.dataTransfer.files):d.uploadImages(y.dataTransfer.files)}),this.codemirror.on("paste",function(p,y){o.imageUploadFunction?d.uploadImagesUsingCustomFunction(o.imageUploadFunction,y.clipboardData.files):d.uploadImages(y.clipboardData.files)})}}J.prototype.uploadImages=function(o,f,c){if(o.length!==0){for(var l=[],s=0;s=2){var R=I[1];if(f.imagesPreviewHandler){var H=f.imagesPreviewHandler(I[1]);typeof H=="string"&&(R=H)}if(window.EMDEimagesCache[R])T(B,window.EMDEimagesCache[R]);else{window.EMDEimagesCache[R]={};var _=document.createElement("img");_.onload=function(){window.EMDEimagesCache[R]={naturalWidth:_.naturalWidth,naturalHeight:_.naturalHeight,url:R},T(B,window.EMDEimagesCache[R])},_.src=R}}}})}this.codemirror.on("update",function(){z()}),this.gui.sideBySide=this.createSideBySide(),this._rendered=this.element,(f.autofocus===!0||o.autofocus)&&this.codemirror.focus();var N=this.codemirror;setTimeout(function(){N.refresh()}.bind(N),0)};J.prototype.cleanup=function(){document.removeEventListener("keydown",this.documentOnKeyDown)};function Fu(){if(typeof localStorage=="object")try{localStorage.setItem("smde_localStorage",1),localStorage.removeItem("smde_localStorage")}catch{return!1}else return!1;return!0}J.prototype.autosave=function(){if(Fu()){var o=this;if(this.options.autosave.uniqueId==null||this.options.autosave.uniqueId==""){console.log("EasyMDE: You must set a uniqueId to use the autosave feature");return}this.options.autosave.binded!==!0&&(o.element.form!=null&&o.element.form!=null&&o.element.form.addEventListener("submit",function(){clearTimeout(o.autosaveTimeoutId),o.autosaveTimeoutId=void 0,localStorage.removeItem("smde_"+o.options.autosave.uniqueId)}),this.options.autosave.binded=!0),this.options.autosave.loaded!==!0&&(typeof localStorage.getItem("smde_"+this.options.autosave.uniqueId)=="string"&&localStorage.getItem("smde_"+this.options.autosave.uniqueId)!=""&&(this.codemirror.setValue(localStorage.getItem("smde_"+this.options.autosave.uniqueId)),this.options.autosave.foundSavedValue=!0),this.options.autosave.loaded=!0);var f=o.value();f!==""?localStorage.setItem("smde_"+this.options.autosave.uniqueId,f):localStorage.removeItem("smde_"+this.options.autosave.uniqueId);var c=document.getElementById("autosaved");if(c!=null&&c!=null&&c!=""){var l=new Date,s=new Intl.DateTimeFormat([this.options.autosave.timeFormat.locale,"en-US"],this.options.autosave.timeFormat.format).format(l),g=this.options.autosave.text==null?"Autosaved: ":this.options.autosave.text;c.innerHTML=g+s}}else console.log("EasyMDE: localStorage not available, cannot autosave")};J.prototype.clearAutosavedValue=function(){if(Fu()){if(this.options.autosave==null||this.options.autosave.uniqueId==null||this.options.autosave.uniqueId==""){console.log("EasyMDE: You must set a uniqueId to clear the autosave value");return}localStorage.removeItem("smde_"+this.options.autosave.uniqueId)}else console.log("EasyMDE: localStorage not available, cannot autosave")};J.prototype.openBrowseFileWindow=function(o,f){var c=this,l=this.gui.toolbar.getElementsByClassName("imageInput")[0];l.click();function s(g){c.options.imageUploadFunction?c.uploadImagesUsingCustomFunction(c.options.imageUploadFunction,g.target.files):c.uploadImages(g.target.files,o,f),l.removeEventListener("change",s)}l.addEventListener("change",s)};J.prototype.uploadImage=function(o,f,c){var l=this;f=f||function(w){Cu(l,w)};function s(y){l.updateStatusBar("upload-image",y),setTimeout(function(){l.updateStatusBar("upload-image",l.options.imageTexts.sbInit)},1e4),c&&typeof c=="function"&&c(y),l.options.errorCallback(y)}function g(y){var w=l.options.imageTexts.sizeUnits.split(",");return y.replace("#image_name#",o.name).replace("#image_size#",gn(o.size,w)).replace("#image_max_size#",gn(l.options.imageMaxSize,w))}if(o.size>this.options.imageMaxSize){s(g(this.options.errorMessages.fileTooLarge));return}var d=new FormData;d.append("image",o),l.options.imageCSRFToken&&!l.options.imageCSRFHeader&&d.append(l.options.imageCSRFName,l.options.imageCSRFToken);var p=new XMLHttpRequest;p.upload.onprogress=function(y){if(y.lengthComputable){var w=""+Math.round(y.loaded*100/y.total);l.updateStatusBar("upload-image",l.options.imageTexts.sbProgress.replace("#file_name#",o.name).replace("#progress#",w))}},p.open("POST",this.options.imageUploadEndpoint),l.options.imageCSRFToken&&l.options.imageCSRFHeader&&p.setRequestHeader(l.options.imageCSRFName,l.options.imageCSRFToken),p.onload=function(){try{var y=JSON.parse(this.responseText)}catch{console.error("EasyMDE: The server did not return a valid json."),s(g(l.options.errorMessages.importError));return}this.status===200&&y&&!y.error&&y.data&&y.data.filePath?f((l.options.imagePathAbsolute?"":window.location.origin+"/")+y.data.filePath):y.error&&y.error in l.options.errorMessages?s(g(l.options.errorMessages[y.error])):y.error?s(g(y.error)):(console.error("EasyMDE: Received an unexpected response after uploading the image."+this.status+" ("+this.statusText+")"),s(g(l.options.errorMessages.importError)))},p.onerror=function(y){console.error("EasyMDE: An unexpected error occurred when trying to upload the image."+y.target.status+" ("+y.target.statusText+")"),s(l.options.errorMessages.importError)},p.send(d)};J.prototype.uploadImageUsingCustomFunction=function(o,f){var c=this;function l(d){Cu(c,d)}function s(d){var p=g(d);c.updateStatusBar("upload-image",p),setTimeout(function(){c.updateStatusBar("upload-image",c.options.imageTexts.sbInit)},1e4),c.options.errorCallback(p)}function g(d){var p=c.options.imageTexts.sizeUnits.split(",");return d.replace("#image_name#",f.name).replace("#image_size#",gn(f.size,p)).replace("#image_max_size#",gn(c.options.imageMaxSize,p))}o.apply(this,[f,l,s])};J.prototype.setPreviewMaxHeight=function(){var o=this.codemirror,f=o.getWrapperElement(),c=f.nextSibling,l=parseInt(window.getComputedStyle(f).paddingTop),s=parseInt(window.getComputedStyle(f).borderTopWidth),g=parseInt(this.options.maxHeight),d=g+l*2+s*2,p=d.toString()+"px";c.style.height=p};J.prototype.createSideBySide=function(){var o=this.codemirror,f=o.getWrapperElement(),c=f.nextSibling;if(!c||!c.classList.contains("editor-preview-side")){if(c=document.createElement("div"),c.className="editor-preview-side",this.options.previewClass)if(Array.isArray(this.options.previewClass))for(var l=0;l0||S>0&&F0?"Converting "+f+" photo"+(f>1?"s":"")+"\u2026":"Uploading "+S+" photo"+(S>1?"s":"")+"\u2026",c.details.open=!0):S>0?(c.summary.textContent="\u2713 "+S+" photo"+(S>1?"s":"")+" ready \u2014 tap to review",c.details.open=!1):(c.summary.textContent="Photos (1\u20136)",c.details.open=!0)}}function d(){g(),setTimeout(g,150),setTimeout(g,500)}function p(){var D=o.querySelector('button[type="submit"], input[type="submit"]');if(D&&(D.disabled=f>0),f>0)s("Converting "+f+" photo"+(f>1?"s":"")+"\u2026");else{var S=Lu();S&&/Converting/.test(S.textContent)&&s("")}g()}o.addEventListener("submit",function(D){f>0&&(D.preventDefault(),s("Hang on \u2014 a photo is still converting.","err"))},!0);function y(D){return function(S){var F=S&&S.file;return F?Wd(F).then(function(T){return T?(f++,p(),import("./heic-to-CN7JBE7H.js").then(function(z){var N=z.heicTo||z.default&&z.default.heicTo;return N({blob:F,type:"image/jpeg",quality:.85})}).then(function(z){var N=new File([z],qd(F.name),{type:"image/jpeg"});D.addFile(N)}).catch(function(){s("A photo couldn\u2019t be converted and was skipped \u2014 the others are fine.","err")}).then(function(){f--,p()}),!1):!0}):!0}}var w=0;(function D(){var S=window.GravFilePond&&window.GravFilePond.getInstances?window.GravFilePond.getInstances():[];if(!S.length){w++<120&&setTimeout(D,50);return}S.forEach(function(F){F&&!F._heicHooked&&(F._heicHooked=!0,F.setOptions({beforeAddFile:y(F),allowReorder:!0,itemInsertLocation:"after"}),l=F,["addfile","processfile","processfiles","removefile","error"].forEach(function(T){try{F.on(T,d)}catch{}}),g())})})()}function vt(o){return document.querySelector('[name="data['+o+']"]')}function Gd(){var o=Array.prototype.slice.call(document.querySelectorAll(".advanced-field"));if(o.length){var f=[];if(o.forEach(function(g){var d=g.closest(".form-field");d&&f.indexOf(d)===-1&&f.push(d)}),!!f.length){var c=document.createElement("details");c.className="more-options";var l=document.createElement("summary");l.className="more-options__summary",l.textContent="More options",c.appendChild(l),f[0].parentNode.insertBefore(c,f[0]),f.forEach(function(g){c.appendChild(g)});var s=f.some(function(g){var d=g.querySelector('input[type="text"]');if(d&&d.value.trim())return!0;var p=g.querySelector('input[type="radio"]:checked');return!!(p&&p.value&&p.value!=="0")});s&&(c.open=!0)}}}var Kd={0:"Sunny",1:"Partly cloudy",2:"Partly cloudy",3:"Cloudy",45:"Foggy",48:"Foggy",51:"Drizzle",53:"Drizzle",55:"Drizzle",56:"Drizzle",57:"Drizzle",61:"Rain",63:"Rain",65:"Rain",66:"Rain",67:"Rain",80:"Rain",81:"Rain",82:"Rain",71:"Snow",73:"Snow",75:"Snow",77:"Snow",85:"Snow",86:"Snow",95:"Thunderstorm",96:"Thunderstorm",99:"Thunderstorm"};function _t(o,f,c){o&&(o.className="form-status"+(c?" form-status--"+c:""),o.textContent=f||"")}function Xd(){var o=document.getElementById("get-location"),f=document.getElementById("get-weather");if(!o&&!f)return;var c=document.getElementById("location-status"),l=document.getElementById("weather-status");function s(){var p=vt("lat"),y=vt("lng"),w=p?p.value.trim():"",D=y?y.value.trim():"";return w&&D?{lat:w,lng:D}:null}function g(){if(f){var p=!!s();f.disabled=!p,f.title=p?"":"Get location first"}}g();function d(p,y){var w=vt("location_city"),D=vt("location_country");if(!((!w||w.value.trim())&&(!D||D.value.trim()))){var S="https://api.bigdatacloud.net/data/reverse-geocode-client?latitude="+encodeURIComponent(p)+"&longitude="+encodeURIComponent(y)+"&localityLanguage=en";fetch(S).then(function(F){return F.json()}).then(function(F){var T=(F.city||F.locality||"").trim(),z=(F.countryName||"").trim();w&&!w.value.trim()&&T&&(w.value=T),D&&!D.value.trim()&&z&&(D.value=z);var N=[T,z].filter(Boolean).join(", ");N&&_t(c,"\u2713 Location captured \xB7 "+N,"ok")}).catch(function(){})}}o&&o.addEventListener("click",function(){if(!navigator.geolocation){_t(c,"Geolocation is not supported on this device.","err");return}o.classList.add("is-loading"),o.disabled=!0,_t(c,"Getting location\u2026"),navigator.geolocation.getCurrentPosition(function(p){var y=p.coords.latitude.toFixed(6),w=p.coords.longitude.toFixed(6),D=vt("lat"),S=vt("lng");D&&(D.value=y),S&&(S.value=w),o.classList.remove("is-loading"),o.disabled=!1,_t(c,"\u2713 Location captured \xB7 "+y+", "+w,"ok"),g(),d(y,w)},function(p){o.classList.remove("is-loading"),o.disabled=!1,_t(c,"\u2717 "+(p&&p.message?p.message:"Could not get location")+" \u2014 enter coordinates manually if needed.","err")},{enableHighAccuracy:!0,timeout:15e3})}),f&&f.addEventListener("click",function(){var p=s();if(!p){_t(l,"Get location first, then fetch weather.","err");return}f.classList.add("is-loading"),f.disabled=!0,_t(l,"Fetching weather\u2026");var y="https://api.open-meteo.com/v1/forecast?latitude="+p.lat+"&longitude="+p.lng+"¤t=temperature_2m,weather_code&temperature_unit=celsius";fetch(y).then(function(w){return w.json()}).then(function(w){var D=Math.round(w.current.temperature_2m),S=Kd[w.current.weather_code]||"Cloudy",F=vt("weather_temp_c"),T=vt("weather_desc");F&&(F.value=D),T&&(T.value=S),f.classList.remove("is-loading"),g(),_t(l,"\u2713 Weather set \xB7 "+S+" \xB7 "+D+"\xB0C (edit above if needed)","ok")}).catch(function(){f.classList.remove("is-loading"),g(),_t(l,"\u2717 Could not fetch weather \u2014 set it manually above.","err")})})}function Yd(){var o=new Date;return o.setSeconds(0,0),o.setMinutes(o.getMinutes()-o.getTimezoneOffset()),o.toISOString().slice(0,16)}function Zd(){var o={title:"Title",date:"Date & time",content:"Content"},f=document.querySelector('form[name="new-entry"]');if(!f)return;var c=vt("date");c&&!String(c.value).trim()&&(c.value=Yd());function l(){f.querySelectorAll(".field-error").forEach(function(d){d.remove()}),f.querySelectorAll(".field-invalid").forEach(function(d){d.classList.remove("field-invalid")})}function s(d,p){d.classList.add("field-invalid");var y=document.createElement("span");y.className="field-error",y.textContent=p,d.parentNode.insertBefore(y,d.nextSibling)}function g(d){var p=f.querySelector(".photos-collapse"),y,w;if(p?(p.open=!0,w=p.querySelector(".photos-collapse__summary"),y=p):(y=document.querySelector(".filepond-root, .form-input-file"),w=y),!w)return y||null;var D=document.createElement("span");return D.className="field-error",D.textContent=d,w.insertAdjacentElement("afterend",D),y||w}f.addEventListener("submit",function(d){l();var p=null;!ha&&document.querySelectorAll(".filepond--item").length<1&&(p=g("Add at least one photo.")),Object.keys(o).forEach(function(y){var w=vt(y);w&&!String(w.value).trim()&&(s(w,o[y]+" is required."),p||(p=w))}),p&&(d.preventDefault(),typeof p.focus=="function"&&p.focus(),p.scrollIntoView({behavior:"smooth",block:"center"}))})}var fa="intotheeast:new-entry-draft";function Qd(o){return Array.prototype.slice.call(o.querySelectorAll('[name^="data["]')).filter(function(f){if(f.type==="file")return!1;var c=f.name;return c.indexOf("data[_json")!==0&&c.indexOf("data[photos")!==0})}function Jd(){var o=document.querySelector(".filepond-root, .form-input-file");if(!(!o||!o.parentNode)&&!o.parentNode.querySelector(".photo-reauth-hint")){var f=document.createElement("p");f.className="photo-reauth-hint is-shown",f.textContent="Your text was restored \u2014 photos need re-selecting (they can\u2019t be saved in a draft).",o.parentNode.insertBefore(f,o.nextSibling)}}function $d(){var o=document.querySelector('form[name="new-entry"]');if(!o||ha)return;if(document.querySelector(".notices.success")){try{localStorage.removeItem(fa)}catch{}return}function f(){var g={};Qd(o).forEach(function(d){d.type==="radio"?d.checked&&(g[d.name]=d.value):g[d.name]=d.value});try{localStorage.setItem(fa,JSON.stringify(g))}catch{}}var c=null;try{c=localStorage.getItem(fa)}catch{c=null}if(c){var l=null;try{l=JSON.parse(c)}catch{l=null}if(l){var s=!1;Object.keys(l).forEach(function(g){var d=l[g];if(d!=null&&String(d).trim()&&(s=!0),g!=="data[content]"){var p=o.querySelectorAll('input[type="radio"][name="'+g+'"]');if(p.length){p.forEach(function(w){w.checked=w.value===d});return}var y=o.querySelector('[name="'+g+'"]');y&&y.type!=="file"&&(y.value=d)}}),window.postFormEditor&&l["data[content]"]!=null&&window.postFormEditor.value(l["data[content]"]),s&&Jd()}}o.addEventListener("input",f),o.addEventListener("change",f),window.postFormEditor&&window.postFormEditor.codemirror.on("change",f)}function Vd(){var o=document.querySelector(".post-form-wrap"),f=document.querySelector(".post-form-wrap .notices.success, .post-form-wrap .notices.green");if(!(!o||!f)){var c=document.createElement("div");c.className="post-success";var l=document.createElement("p");l.className="post-success__title",l.textContent="\u2713 Saved to your journal.",c.appendChild(l);var s=document.createElement("div");s.className="post-success__actions";var g=o.getAttribute("data-trip-url");if(g){var d=document.createElement("a");d.className="post-success__view",d.href=g,d.textContent="View your journal \u2192",s.appendChild(d)}var p=document.createElement("a");p.className="post-success__again",p.href=window.location.pathname,p.textContent="Post another",s.appendChild(p),c.appendChild(s),f.parentNode.insertBefore(c,f.nextSibling),["form",".form-action-row","#location-status","#weather-status"].forEach(function(y){var w=o.querySelector(y);w&&(w.style.display="none")}),f.scrollIntoView({behavior:"smooth",block:"start"})}}var ha=!1;function Tu(o){return new URLSearchParams(window.location.search).get(o)}function Wt(o,f){var c=vt(o);c&&(c.value=f==null?"":String(f))}function ca(o,f){var c=f?"1":"0",l=document.querySelectorAll('[name="data['+o+']"]');Array.prototype.forEach.call(l,function(s){s.checked=String(s.value)===c})}function eh(o){var f=o==null?"":String(o);if(window.postFormEditor&&typeof window.postFormEditor.value=="function")window.postFormEditor.value(f);else{var c=vt("content");c&&(c.value=f)}}function Mu(o,f){var c=o.querySelectorAll("input, textarea, select, button");Array.prototype.forEach.call(c,function(l){l.type==="file"||l.name&&l.name.indexOf("data[photos")===0||(l.disabled=f)}),window.postFormEditor&&window.postFormEditor.codemirror&&window.postFormEditor.codemirror.setOption("readOnly",f?"nocursor":!1)}function da(o,f){o&&(o.tagName==="INPUT"?o.value=f:o.textContent=f)}function th(o,f){var c=o.querySelector(".post-edit-error");if(c){c.textContent=f;return}var l=document.createElement("div");l.className="post-edit-error",l.setAttribute("role","alert"),l.textContent=f;var s=o.querySelector("h1");s?s.insertAdjacentElement("afterend",l):o.insertBefore(l,o.firstChild)}function Nu(o,f){f=f||0;var c=window.GravFilePond&&window.GravFilePond.getInstances?window.GravFilePond.getInstances():[];if(c.length&&c[0]){o(c[0]);return}f<120&&setTimeout(function(){Nu(o,f+1)},50)}function rh(o){fetch("/api/v1/pages"+o+"/media",{credentials:"include",headers:{Accept:"application/json"}}).then(function(f){return f.ok?f.json():{data:[]}}).then(function(f){var c=f&&f.data||[],l=c.filter(function(s){return s&&typeof s.filename=="string"&&/\.(jpe?g|png|gif|webp|heic|heif)$/i.test(s.filename)}).sort(function(s,g){return s.filenameg.filename?1:0});Nu(function(s){try{s.setOptions({allowBrowse:!0,allowDrop:!0,allowReorder:!0})}catch{}Promise.all(l.map(function(g){return fetch(o+"/"+g.filename,{credentials:"include"}).then(function(d){return d.ok?d.blob():null}).then(function(d){return d?new File([d],g.filename,{type:d.type||"image/jpeg"}):null}).catch(function(){return null})})).then(function(g){g.forEach(function(d,p){if(d)try{var y=s.addFile(d,{type:"local",index:p});y&&typeof y.catch=="function"&&y.catch(function(){})}catch{}})})})}).catch(function(){})}function ih(){var o=document.querySelector('form[name="new-entry"]'),f=document.querySelector(".post-form-wrap");if(!(!o||!f)){var c=Tu("edit");if(c){ha=!0;var l=f.querySelector("h1");l&&(l.textContent="Edit entry");var s=o.querySelector('button[type="submit"], input[type="submit"]'),g=s?s.tagName==="INPUT"?s.value:s.textContent:"Save changes";Mu(o,!0),da(s,"Loading entry\u2026");var d=Tu("return")||f.getAttribute("data-trip-url")||"";o.setAttribute("action","/post?edit="+encodeURIComponent(c)+(d?"&return="+encodeURIComponent(d):"")),fetch("/api/v1/pages"+c,{credentials:"include",headers:{Accept:"application/json"}}).then(function(p){if(!p.ok){var y=new Error("HTTP "+p.status);throw y.status=p.status,y}return p.json()}).then(function(p){var y=p&&p.data||{},w=y.header||{};Wt("title",w.title!=null?w.title:y.title),Wt("date",w.date?String(w.date).replace(" ","T"):""),eh(y.content),Wt("lat",w.lat),Wt("lng",w.lng),Wt("location_city",w.location_city),Wt("location_country",w.location_country),Wt("weather_desc",w.weather_desc),Wt("weather_temp_c",w.weather_temp_c),Wt("transport_mode",w.transport_mode),ca("featured",w.featured),ca("force_connect",w.force_connect),ca("published",w.published!==void 0?w.published:y.published);var D=vt("edit_path");D&&(D.value=c+"/entry.md"),Mu(o,!1),da(s,"Save changes");var S=o.querySelector(".more-options");S&&(S.open=!0),rh(c)}).catch(function(p){var y=p&&p.status===404?"This entry no longer exists \u2014 it may have been deleted. Head back to the journal.":"Sorry \u2014 this entry couldn\u2019t be loaded for editing. Check your connection and try again.";th(f,y),da(s,g)})}}}function Bu(){window.postFormEditor=Pd(),Vd(),ih(),$d(),jd(),Gd(),Xd(),Zd()}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Bu):Bu(); +`]},_p={link:"URL for the link:",image:"URL of the image:"},Bp={locale:"en-US",format:{hour:"2-digit",minute:"2-digit"}},Np={bold:"**",code:"```",italic:"*"},Op={sbInit:"Attach files by drag and dropping or pasting from clipboard.",sbOnDragEnter:"Drop image to upload it.",sbOnDrop:"Uploading image #images_names#...",sbProgress:"Uploading #file_name#: #progress#%",sbOnUploaded:"Uploaded #image_name#",sizeUnits:" B, KB, MB"},Ip={noFileGiven:"You must select a file.",typeNotAllowed:"This image type is not allowed.",fileTooLarge:`Image #image_name# is too big (#image_size#). +Maximum file size is #image_max_size#.`,importError:"Something went wrong when uploading the image #image_name#."};function te(o){o=o||{},o.parent=this;var l=!0;if(o.autoDownloadFontAwesome===!1&&(l=!1),o.autoDownloadFontAwesome!==!0)for(var s=document.styleSheets,a=0;a-1&&(l=!1);if(l){var f=document.createElement("link");f.rel="stylesheet",f.href="https://maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css",document.getElementsByTagName("head")[0].appendChild(f)}if(o.element)this.element=o.element;else if(o.element===null){console.log("EasyMDE: Error. No element was found.");return}if(o.toolbar===void 0){o.toolbar=[];for(var p in Ur)Object.prototype.hasOwnProperty.call(Ur,p)&&(p.indexOf("separator-")!=-1&&o.toolbar.push("|"),(Ur[p].default===!0||o.showIcons&&o.showIcons.constructor===Array&&o.showIcons.indexOf(p)!=-1)&&o.toolbar.push(p))}if(Object.prototype.hasOwnProperty.call(o,"previewClass")||(o.previewClass="editor-preview"),Object.prototype.hasOwnProperty.call(o,"status")||(o.status=["autosave","lines","words","cursor"],o.uploadImage&&o.status.unshift("upload-image")),o.previewRender||(o.previewRender=function(h){return this.parent.markdown(h)}),o.parsingConfig=sr({highlightFormatting:!0},o.parsingConfig||{}),o.insertTexts=sr({},Mp,o.insertTexts||{}),o.promptTexts=sr({},_p,o.promptTexts||{}),o.blockStyles=sr({},Np,o.blockStyles||{}),o.autosave!=null&&(o.autosave.timeFormat=sr({},Bp,o.autosave.timeFormat||{})),o.iconClassMap=sr({},Me,o.iconClassMap||{}),o.shortcuts=sr({},Cp,o.shortcuts||{}),o.maxHeight=o.maxHeight||void 0,o.direction=o.direction||"ltr",typeof o.maxHeight<"u"?o.minHeight=o.maxHeight:o.minHeight=o.minHeight||"300px",o.errorCallback=o.errorCallback||function(h){alert(h)},o.uploadImage=o.uploadImage||!1,o.imageMaxSize=o.imageMaxSize||2097152,o.imageAccept=o.imageAccept||"image/png, image/jpeg, image/gif, image/avif",o.imageTexts=sr({},Op,o.imageTexts||{}),o.errorMessages=sr({},Ip,o.errorMessages||{}),o.imagePathAbsolute=o.imagePathAbsolute||!1,o.imageCSRFName=o.imageCSRFName||"csrfmiddlewaretoken",o.imageCSRFHeader=o.imageCSRFHeader||!1,o.imageInputName=o.imageInputName||"image",o.autosave!=null&&o.autosave.unique_id!=null&&o.autosave.unique_id!=""&&(o.autosave.uniqueId=o.autosave.unique_id),o.overlayMode&&o.overlayMode.combine===void 0&&(o.overlayMode.combine=!0),this.options=o,this.render(),o.initialValue&&(!this.options.autosave||this.options.autosave.foundSavedValue!==!0)&&this.value(o.initialValue),o.uploadImage){var c=this;this.codemirror.on("dragenter",function(h,b){c.updateStatusBar("upload-image",c.options.imageTexts.sbOnDragEnter),b.stopPropagation(),b.preventDefault()}),this.codemirror.on("dragend",function(h,b){c.updateStatusBar("upload-image",c.options.imageTexts.sbInit),b.stopPropagation(),b.preventDefault()}),this.codemirror.on("dragleave",function(h,b){c.updateStatusBar("upload-image",c.options.imageTexts.sbInit),b.stopPropagation(),b.preventDefault()}),this.codemirror.on("dragover",function(h,b){c.updateStatusBar("upload-image",c.options.imageTexts.sbOnDragEnter),b.stopPropagation(),b.preventDefault()}),this.codemirror.on("drop",function(h,b){b.stopPropagation(),b.preventDefault(),o.imageUploadFunction?c.uploadImagesUsingCustomFunction(o.imageUploadFunction,b.dataTransfer.files):c.uploadImages(b.dataTransfer.files)}),this.codemirror.on("paste",function(h,b){o.imageUploadFunction?c.uploadImagesUsingCustomFunction(o.imageUploadFunction,b.clipboardData.files):c.uploadImages(b.clipboardData.files)})}}te.prototype.uploadImages=function(o,l,s){if(o.length!==0){for(var a=[],f=0;f=2){var P=N[1];if(l.imagesPreviewHandler){var I=l.imagesPreviewHandler(N[1]);typeof I=="string"&&(P=I)}if(window.EMDEimagesCache[P])F(O,window.EMDEimagesCache[P]);else{window.EMDEimagesCache[P]={};var q=document.createElement("img");q.onload=function(){window.EMDEimagesCache[P]={naturalWidth:q.naturalWidth,naturalHeight:q.naturalHeight,url:P},F(O,window.EMDEimagesCache[P])},q.src=P}}}})}this.codemirror.on("update",function(){_()}),this.gui.sideBySide=this.createSideBySide(),this._rendered=this.element,(l.autofocus===!0||o.autofocus)&&this.codemirror.focus();var L=this.codemirror;setTimeout(function(){L.refresh()}.bind(L),0)};te.prototype.cleanup=function(){document.removeEventListener("keydown",this.documentOnKeyDown)};function Vf(){if(typeof localStorage=="object")try{localStorage.setItem("smde_localStorage",1),localStorage.removeItem("smde_localStorage")}catch{return!1}else return!1;return!0}te.prototype.autosave=function(){if(Vf()){var o=this;if(this.options.autosave.uniqueId==null||this.options.autosave.uniqueId==""){console.log("EasyMDE: You must set a uniqueId to use the autosave feature");return}this.options.autosave.binded!==!0&&(o.element.form!=null&&o.element.form!=null&&o.element.form.addEventListener("submit",function(){clearTimeout(o.autosaveTimeoutId),o.autosaveTimeoutId=void 0,localStorage.removeItem("smde_"+o.options.autosave.uniqueId)}),this.options.autosave.binded=!0),this.options.autosave.loaded!==!0&&(typeof localStorage.getItem("smde_"+this.options.autosave.uniqueId)=="string"&&localStorage.getItem("smde_"+this.options.autosave.uniqueId)!=""&&(this.codemirror.setValue(localStorage.getItem("smde_"+this.options.autosave.uniqueId)),this.options.autosave.foundSavedValue=!0),this.options.autosave.loaded=!0);var l=o.value();l!==""?localStorage.setItem("smde_"+this.options.autosave.uniqueId,l):localStorage.removeItem("smde_"+this.options.autosave.uniqueId);var s=document.getElementById("autosaved");if(s!=null&&s!=null&&s!=""){var a=new Date,f=new Intl.DateTimeFormat([this.options.autosave.timeFormat.locale,"en-US"],this.options.autosave.timeFormat.format).format(a),p=this.options.autosave.text==null?"Autosaved: ":this.options.autosave.text;s.innerHTML=p+f}}else console.log("EasyMDE: localStorage not available, cannot autosave")};te.prototype.clearAutosavedValue=function(){if(Vf()){if(this.options.autosave==null||this.options.autosave.uniqueId==null||this.options.autosave.uniqueId==""){console.log("EasyMDE: You must set a uniqueId to clear the autosave value");return}localStorage.removeItem("smde_"+this.options.autosave.uniqueId)}else console.log("EasyMDE: localStorage not available, cannot autosave")};te.prototype.openBrowseFileWindow=function(o,l){var s=this,a=this.gui.toolbar.getElementsByClassName("imageInput")[0];a.click();function f(p){s.options.imageUploadFunction?s.uploadImagesUsingCustomFunction(s.options.imageUploadFunction,p.target.files):s.uploadImages(p.target.files,o,l),a.removeEventListener("change",f)}a.addEventListener("change",f)};te.prototype.uploadImage=function(o,l,s){var a=this;l=l||function(y){Qf(a,y)};function f(b){a.updateStatusBar("upload-image",b),setTimeout(function(){a.updateStatusBar("upload-image",a.options.imageTexts.sbInit)},1e4),s&&typeof s=="function"&&s(b),a.options.errorCallback(b)}function p(b){var y=a.options.imageTexts.sizeUnits.split(",");return b.replace("#image_name#",o.name).replace("#image_size#",uo(o.size,y)).replace("#image_max_size#",uo(a.options.imageMaxSize,y))}if(o.size>this.options.imageMaxSize){f(p(this.options.errorMessages.fileTooLarge));return}var c=new FormData;c.append("image",o),a.options.imageCSRFToken&&!a.options.imageCSRFHeader&&c.append(a.options.imageCSRFName,a.options.imageCSRFToken);var h=new XMLHttpRequest;h.upload.onprogress=function(b){if(b.lengthComputable){var y=""+Math.round(b.loaded*100/b.total);a.updateStatusBar("upload-image",a.options.imageTexts.sbProgress.replace("#file_name#",o.name).replace("#progress#",y))}},h.open("POST",this.options.imageUploadEndpoint),a.options.imageCSRFToken&&a.options.imageCSRFHeader&&h.setRequestHeader(a.options.imageCSRFName,a.options.imageCSRFToken),h.onload=function(){try{var b=JSON.parse(this.responseText)}catch{console.error("EasyMDE: The server did not return a valid json."),f(p(a.options.errorMessages.importError));return}this.status===200&&b&&!b.error&&b.data&&b.data.filePath?l((a.options.imagePathAbsolute?"":window.location.origin+"/")+b.data.filePath):b.error&&b.error in a.options.errorMessages?f(p(a.options.errorMessages[b.error])):b.error?f(p(b.error)):(console.error("EasyMDE: Received an unexpected response after uploading the image."+this.status+" ("+this.statusText+")"),f(p(a.options.errorMessages.importError)))},h.onerror=function(b){console.error("EasyMDE: An unexpected error occurred when trying to upload the image."+b.target.status+" ("+b.target.statusText+")"),f(a.options.errorMessages.importError)},h.send(c)};te.prototype.uploadImageUsingCustomFunction=function(o,l){var s=this;function a(c){Qf(s,c)}function f(c){var h=p(c);s.updateStatusBar("upload-image",h),setTimeout(function(){s.updateStatusBar("upload-image",s.options.imageTexts.sbInit)},1e4),s.options.errorCallback(h)}function p(c){var h=s.options.imageTexts.sizeUnits.split(",");return c.replace("#image_name#",l.name).replace("#image_size#",uo(l.size,h)).replace("#image_max_size#",uo(s.options.imageMaxSize,h))}o.apply(this,[l,a,f])};te.prototype.setPreviewMaxHeight=function(){var o=this.codemirror,l=o.getWrapperElement(),s=l.nextSibling,a=parseInt(window.getComputedStyle(l).paddingTop),f=parseInt(window.getComputedStyle(l).borderTopWidth),p=parseInt(this.options.maxHeight),c=p+a*2+f*2,h=c.toString()+"px";s.style.height=h};te.prototype.createSideBySide=function(){var o=this.codemirror,l=o.getWrapperElement(),s=l.nextSibling;if(!s||!s.classList.contains("editor-preview-side")){if(s=document.createElement("div"),s.className="editor-preview-side",this.options.previewClass)if(Array.isArray(this.options.previewClass))for(var a=0;a"&&(l=l.substring(1)),o)try{if(o.matches)return o.matches(l);if(o.msMatchesSelector)return o.msMatchesSelector(l);if(o.webkitMatchesSelector)return o.webkitMatchesSelector(l)}catch{return!1}return!1}}function hc(o){return o.host&&o!==document&&o.host.nodeType&&o.host!==o?o.host:o.parentNode}function Gt(o,l,s,a){if(o){s=s||document;do{if(l!=null&&(l[0]===">"?o.parentNode===s&&Ro(o,l):Ro(o,l))||a&&o===s)return o;if(o===s)break}while(o=hc(o))}return null}var ic=/\s+/g;function Bt(o,l,s){if(o&&l)if(o.classList)o.classList[s?"add":"remove"](l);else{var a=(" "+o.className+" ").replace(ic," ").replace(" "+l+" "," ");o.className=(a+(s?" "+l:"")).replace(ic," ")}}function he(o,l,s){var a=o&&o.style;if(a){if(s===void 0)return document.defaultView&&document.defaultView.getComputedStyle?s=document.defaultView.getComputedStyle(o,""):o.currentStyle&&(s=o.currentStyle),l===void 0?s:s[l];!(l in a)&&l.indexOf("webkit")===-1&&(l="-webkit-"+l),a[l]=s+(typeof s=="string"?"":"px")}}function An(o,l){var s="";if(typeof o=="string")s=o;else do{var a=he(o,"transform");a&&a!=="none"&&(s=a+" "+s)}while(!l&&(o=o.parentNode));var f=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return f&&new f(s)}function pc(o,l,s){if(o){var a=o.getElementsByTagName(l),f=0,p=a.length;if(s)for(;f=p:c=f<=p,!c)return a;if(a===Vt())break;a=Tr(a,!1)}return!1}function Fn(o,l,s,a){for(var f=0,p=0,c=o.children;p2&&arguments[2]!==void 0?arguments[2]:{},f=a.evt,p=zp(a,Qp);xi.pluginEvent.bind(pe)(l,s,er({dragEl:$,parentEl:qe,ghostEl:be,rootEl:Pe,nextEl:Yr,lastDownEl:Io,cloneEl:Re,cloneHidden:Fr,dragStarted:ci,putSortable:ut,activeSortable:pe.active,originalEvent:f,oldIndex:En,oldDraggableIndex:vi,newIndex:Nt,newDraggableIndex:Ar,hideGhostForTarget:wc,unhideGhostForTarget:Cc,cloneNowHidden:function(){Fr=!0},cloneNowShown:function(){Fr=!1},dispatchSortableEvent:function(h){Ct({sortable:s,name:h,originalEvent:f})}},p))};function Ct(o){Zp(er({putSortable:ut,cloneEl:Re,targetEl:$,rootEl:Pe,oldIndex:En,oldDraggableIndex:vi,newIndex:Nt,newDraggableIndex:Ar},o))}var $,qe,be,Pe,Yr,Io,Re,Fr,En,Nt,vi,Ar,_o,ut,Sn=!1,Wo=!1,qo=[],Xr,jt,Dl,wl,lc,sc,ci,kn,mi,bi=!1,Bo=!1,Po,pt,Cl=[],Tl=!1,Uo=[],Go=typeof document<"u",No=Bl,uc=yi||cr?"cssFloat":"float",Jp=Go&&!cc&&!Bl&&"draggable"in document.createElement("div"),yc=function(){if(Go){if(cr)return!1;var o=document.createElement("x");return o.style.cssText="pointer-events:auto",o.style.pointerEvents==="auto"}}(),xc=function(l,s){var a=he(l),f=parseInt(a.width)-parseInt(a.paddingLeft)-parseInt(a.paddingRight)-parseInt(a.borderLeftWidth)-parseInt(a.borderRightWidth),p=Fn(l,0,s),c=Fn(l,1,s),h=p&&he(p),b=c&&he(c),y=h&&parseInt(h.marginLeft)+parseInt(h.marginRight)+$e(p).width,x=b&&parseInt(b.marginLeft)+parseInt(b.marginRight)+$e(c).width;if(a.display==="flex")return a.flexDirection==="column"||a.flexDirection==="column-reverse"?"vertical":"horizontal";if(a.display==="grid")return a.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(p&&h.float&&h.float!=="none"){var C=h.float==="left"?"left":"right";return c&&(b.clear==="both"||b.clear===C)?"vertical":"horizontal"}return p&&(h.display==="block"||h.display==="flex"||h.display==="table"||h.display==="grid"||y>=f&&a[uc]==="none"||c&&a[uc]==="none"&&y+x>f)?"vertical":"horizontal"},$p=function(l,s,a){var f=a?l.left:l.top,p=a?l.right:l.bottom,c=a?l.width:l.height,h=a?s.left:s.top,b=a?s.right:s.bottom,y=a?s.width:s.height;return f===h||p===b||f+c/2===h+y/2},Vp=function(l,s){var a;return qo.some(function(f){var p=f[Ft].options.emptyInsertThreshold;if(!(!p||Nl(f))){var c=$e(f),h=l>=c.left-p&&l<=c.right+p,b=s>=c.top-p&&s<=c.bottom+p;if(h&&b)return a=f}}),a},Dc=function(l){function s(p,c){return function(h,b,y,x){var C=h.options.group.name&&b.options.group.name&&h.options.group.name===b.options.group.name;if(p==null&&(c||C))return!0;if(p==null||p===!1)return!1;if(c&&p==="clone")return p;if(typeof p=="function")return s(p(h,b,y,x),c)(h,b,y,x);var S=(c?h:b).options.group.name;return p===!0||typeof p=="string"&&p===S||p.join&&p.indexOf(S)>-1}}var a={},f=l.group;(!f||Fl(f)!="object")&&(f={name:f}),a.name=f.name,a.checkPull=s(f.pull,!0),a.checkPut=s(f.put),a.revertClone=f.revertClone,l.group=a},wc=function(){!yc&&be&&he(be,"display","none")},Cc=function(){!yc&&be&&he(be,"display","")};Go&&!cc&&document.addEventListener("click",function(o){if(Wo)return o.preventDefault(),o.stopPropagation&&o.stopPropagation(),o.stopImmediatePropagation&&o.stopImmediatePropagation(),Wo=!1,!1},!0);var Kr=function(l){if($){l=l.touches?l.touches[0]:l;var s=Vp(l.clientX,l.clientY);if(s){var a={};for(var f in l)l.hasOwnProperty(f)&&(a[f]=l[f]);a.target=a.rootEl=s,a.preventDefault=void 0,a.stopPropagation=void 0,s[Ft]._onDragOver(a)}}},eg=function(l){$&&$.parentNode[Ft]._isOutsideThisEl(l.target)};function pe(o,l){if(!(o&&o.nodeType&&o.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(o));this.el=o,this.options=l=fr({},l),o[Ft]=this;var s={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(o.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return xc(o,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(c,h){c.setData("Text",h.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:pe.supportPointer!==!1&&"PointerEvent"in window&&(!pi||Bl),emptyInsertThreshold:5};xi.initializePlugins(this,o,s);for(var a in s)!(a in l)&&(l[a]=s[a]);Dc(l);for(var f in this)f.charAt(0)==="_"&&typeof this[f]=="function"&&(this[f]=this[f].bind(this));this.nativeDraggable=l.forceFallback?!1:Jp,this.nativeDraggable&&(this.options.touchStartThreshold=1),l.supportPointer?ke(o,"pointerdown",this._onTapStart):(ke(o,"mousedown",this._onTapStart),ke(o,"touchstart",this._onTapStart)),this.nativeDraggable&&(ke(o,"dragover",this),ke(o,"dragenter",this)),qo.push(this.el),l.store&&l.store.get&&this.sort(l.store.get(this)||[]),fr(this,Xp())}pe.prototype={constructor:pe,_isOutsideThisEl:function(l){!this.el.contains(l)&&l!==this.el&&(kn=null)},_getDirection:function(l,s){return typeof this.options.direction=="function"?this.options.direction.call(this,l,s,$):this.options.direction},_onTapStart:function(l){if(l.cancelable){var s=this,a=this.el,f=this.options,p=f.preventOnFilter,c=l.type,h=l.touches&&l.touches[0]||l.pointerType&&l.pointerType==="touch"&&l,b=(h||l).target,y=l.target.shadowRoot&&(l.path&&l.path[0]||l.composedPath&&l.composedPath()[0])||b,x=f.filter;if(sg(a),!$&&!(/mousedown|pointerdown/.test(c)&&l.button!==0||f.disabled)&&!y.isContentEditable&&!(!this.nativeDraggable&&pi&&b&&b.tagName.toUpperCase()==="SELECT")&&(b=Gt(b,f.draggable,a,!1),!(b&&b.animated)&&Io!==b)){if(En=Pt(b),vi=Pt(b,f.draggable),typeof x=="function"){if(x.call(this,l,b,this)){Ct({sortable:s,rootEl:y,name:"filter",targetEl:b,toEl:a,fromEl:a}),At("filter",s,{evt:l}),p&&l.preventDefault();return}}else if(x&&(x=x.split(",").some(function(C){if(C=Gt(y,C.trim(),a,!1),C)return Ct({sortable:s,rootEl:C,name:"filter",targetEl:b,fromEl:a,toEl:a}),At("filter",s,{evt:l}),!0}),x)){p&&l.preventDefault();return}f.handle&&!Gt(y,f.handle,a,!1)||this._prepareDragStart(l,h,b)}}},_prepareDragStart:function(l,s,a){var f=this,p=f.el,c=f.options,h=p.ownerDocument,b;if(a&&!$&&a.parentNode===p){var y=$e(a);if(Pe=p,$=a,qe=$.parentNode,Yr=$.nextSibling,Io=a,_o=c.group,pe.dragged=$,Xr={target:$,clientX:(s||l).clientX,clientY:(s||l).clientY},lc=Xr.clientX-y.left,sc=Xr.clientY-y.top,this._lastX=(s||l).clientX,this._lastY=(s||l).clientY,$.style["will-change"]="all",b=function(){if(At("delayEnded",f,{evt:l}),pe.eventCanceled){f._onDrop();return}f._disableDelayedDragEvents(),!nc&&f.nativeDraggable&&($.draggable=!0),f._triggerDragStart(l,s),Ct({sortable:f,name:"choose",originalEvent:l}),Bt($,c.chosenClass,!0)},c.ignore.split(",").forEach(function(x){pc($,x.trim(),kl)}),ke(h,"dragover",Kr),ke(h,"mousemove",Kr),ke(h,"touchmove",Kr),c.supportPointer?(ke(h,"pointerup",f._onDrop),!this.nativeDraggable&&ke(h,"pointercancel",f._onDrop)):(ke(h,"mouseup",f._onDrop),ke(h,"touchend",f._onDrop),ke(h,"touchcancel",f._onDrop)),nc&&this.nativeDraggable&&(this.options.touchStartThreshold=4,$.draggable=!0),At("delayStart",this,{evt:l}),c.delay&&(!c.delayOnTouchOnly||s)&&(!this.nativeDraggable||!(yi||cr))){if(pe.eventCanceled){this._onDrop();return}c.supportPointer?(ke(h,"pointerup",f._disableDelayedDrag),ke(h,"pointercancel",f._disableDelayedDrag)):(ke(h,"mouseup",f._disableDelayedDrag),ke(h,"touchend",f._disableDelayedDrag),ke(h,"touchcancel",f._disableDelayedDrag)),ke(h,"mousemove",f._delayedDragTouchMoveHandler),ke(h,"touchmove",f._delayedDragTouchMoveHandler),c.supportPointer&&ke(h,"pointermove",f._delayedDragTouchMoveHandler),f._dragStartTimer=setTimeout(b,c.delay)}else b()}},_delayedDragTouchMoveHandler:function(l){var s=l.touches?l.touches[0]:l;Math.max(Math.abs(s.clientX-this._lastX),Math.abs(s.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){$&&kl($),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var l=this.el.ownerDocument;Ce(l,"mouseup",this._disableDelayedDrag),Ce(l,"touchend",this._disableDelayedDrag),Ce(l,"touchcancel",this._disableDelayedDrag),Ce(l,"pointerup",this._disableDelayedDrag),Ce(l,"pointercancel",this._disableDelayedDrag),Ce(l,"mousemove",this._delayedDragTouchMoveHandler),Ce(l,"touchmove",this._delayedDragTouchMoveHandler),Ce(l,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(l,s){s=s||l.pointerType=="touch"&&l,!this.nativeDraggable||s?this.options.supportPointer?ke(document,"pointermove",this._onTouchMove):s?ke(document,"touchmove",this._onTouchMove):ke(document,"mousemove",this._onTouchMove):(ke($,"dragend",this),ke(Pe,"dragstart",this._onDragStart));try{document.selection?zo(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(l,s){if(Sn=!1,Pe&&$){At("dragStarted",this,{evt:s}),this.nativeDraggable&&ke(document,"dragover",eg);var a=this.options;!l&&Bt($,a.dragClass,!1),Bt($,a.ghostClass,!0),pe.active=this,l&&this._appendGhost(),Ct({sortable:this,name:"start",originalEvent:s})}else this._nulling()},_emulateDragOver:function(){if(jt){this._lastX=jt.clientX,this._lastY=jt.clientY,wc();for(var l=document.elementFromPoint(jt.clientX,jt.clientY),s=l;l&&l.shadowRoot&&(l=l.shadowRoot.elementFromPoint(jt.clientX,jt.clientY),l!==s);)s=l;if($.parentNode[Ft]._isOutsideThisEl(l),s)do{if(s[Ft]){var a=void 0;if(a=s[Ft]._onDragOver({clientX:jt.clientX,clientY:jt.clientY,target:l,rootEl:s}),a&&!this.options.dragoverBubble)break}l=s}while(s=hc(s));Cc()}},_onTouchMove:function(l){if(Xr){var s=this.options,a=s.fallbackTolerance,f=s.fallbackOffset,p=l.touches?l.touches[0]:l,c=be&&An(be,!0),h=be&&c&&c.a,b=be&&c&&c.d,y=No&&pt&&ac(pt),x=(p.clientX-Xr.clientX+f.x)/(h||1)+(y?y[0]-Cl[0]:0)/(h||1),C=(p.clientY-Xr.clientY+f.y)/(b||1)+(y?y[1]-Cl[1]:0)/(b||1);if(!pe.active&&!Sn){if(a&&Math.max(Math.abs(p.clientX-this._lastX),Math.abs(p.clientY-this._lastY))=0&&(Ct({rootEl:qe,name:"add",toEl:qe,fromEl:Pe,originalEvent:l}),Ct({sortable:this,name:"remove",toEl:qe,originalEvent:l}),Ct({rootEl:qe,name:"sort",toEl:qe,fromEl:Pe,originalEvent:l}),Ct({sortable:this,name:"sort",toEl:qe,originalEvent:l})),ut&&ut.save()):Nt!==En&&Nt>=0&&(Ct({sortable:this,name:"update",toEl:qe,originalEvent:l}),Ct({sortable:this,name:"sort",toEl:qe,originalEvent:l})),pe.active&&((Nt==null||Nt===-1)&&(Nt=En,Ar=vi),Ct({sortable:this,name:"end",toEl:qe,originalEvent:l}),this.save()))),this._nulling()},_nulling:function(){At("nulling",this),Pe=$=qe=be=Yr=Re=Io=Fr=Xr=jt=ci=Nt=Ar=En=vi=kn=mi=ut=_o=pe.dragged=pe.ghost=pe.clone=pe.active=null;var l=this.el;Uo.forEach(function(s){l.contains(s)&&(s.checked=!0)}),Uo.length=Dl=wl=0},handleEvent:function(l){switch(l.type){case"drop":case"dragend":this._onDrop(l);break;case"dragenter":case"dragover":$&&(this._onDragOver(l),tg(l));break;case"selectstart":l.preventDefault();break}},toArray:function(){for(var l=[],s,a=this.el.children,f=0,p=a.length,c=this.options;ff.right+p||o.clientY>a.bottom&&o.clientX>a.left:o.clientY>f.bottom+p||o.clientX>a.right&&o.clientY>a.top}function og(o,l,s,a,f,p,c,h){var b=a?o.clientY:o.clientX,y=a?s.height:s.width,x=a?s.top:s.left,C=a?s.bottom:s.right,S=!1;if(!c){if(h&&Pox+y*p/2:bC-Po)return-mi}else if(b>x+y*(1-f)/2&&bC-y*p/2)?b>x+y/2?1:-1:0}function ag(o){return Pt($)0||C>0&&S0?"Converting "+l+" photo"+(l>1?"s":"")+"\u2026":"Uploading "+C+" photo"+(C>1?"s":"")+"\u2026",s.details.open=!0):C>0?(s.summary.textContent="\u2713 "+C+" photo"+(C>1?"s":"")+" ready \u2014 tap to review",s.details.open=!1):(s.summary.textContent="Photos (1\u20136)",s.details.open=!0)}}function c(){p(),setTimeout(p,150),setTimeout(p,500)}function h(){var x=o.querySelector('button[type="submit"], input[type="submit"]');if(x&&(x.disabled=l>0),l>0)f("Converting "+l+" photo"+(l>1?"s":"")+"\u2026");else{var C=Ec();C&&/Converting/.test(C.textContent)&&f("")}p()}o.addEventListener("submit",function(x){l>0&&(x.preventDefault(),f("Hang on \u2014 a photo is still converting.","err"))},!0);function b(x){return function(C){var S=C&&C.file;return S?_c(S).then(function(F){return F?(l++,h(),import("./heic-to-CN7JBE7H.js").then(function(_){var L=_.heicTo||_.default&&_.default.heicTo;return L({blob:S,type:"image/jpeg",quality:.85})}).then(function(_){var L=new File([_],dg(S.name),{type:"image/jpeg"});x.addFile(L)}).catch(function(){f("A photo couldn\u2019t be converted and was skipped \u2014 the others are fine.","err")}).then(function(){l--,h()}),!1):!0}):!0}}var y=0;(function x(){var C=window.GravFilePond&&window.GravFilePond.getInstances?window.GravFilePond.getInstances():[];if(!C.length){y++<120&&setTimeout(x,50);return}C.forEach(function(S){S&&!S._heicHooked&&(S._heicHooked=!0,S.setOptions({beforeAddFile:b(S),allowReorder:!0,itemInsertLocation:"after"}),a=S,["addfile","processfile","processfiles","removefile","error"].forEach(function(F){try{S.on(F,c)}catch{}}),p())})})()}function Ot(o){return document.querySelector('[name="data['+o+']"]')}function gg(){var o=Array.prototype.slice.call(document.querySelectorAll(".advanced-field"));if(o.length){var l=[];if(o.forEach(function(p){var c=p.closest(".form-field");c&&l.indexOf(c)===-1&&l.push(c)}),!!l.length){var s=document.createElement("details");s.className="more-options";var a=document.createElement("summary");a.className="more-options__summary",a.textContent="More options",s.appendChild(a),l[0].parentNode.insertBefore(s,l[0]),l.forEach(function(p){s.appendChild(p)});var f=l.some(function(p){var c=p.querySelector('input[type="text"]');if(c&&c.value.trim())return!0;var h=p.querySelector('input[type="radio"]:checked');return!!(h&&h.value&&h.value!=="0")});f&&(s.open=!0)}}}var vg={0:"Sunny",1:"Partly cloudy",2:"Partly cloudy",3:"Cloudy",45:"Foggy",48:"Foggy",51:"Drizzle",53:"Drizzle",55:"Drizzle",56:"Drizzle",57:"Drizzle",61:"Rain",63:"Rain",65:"Rain",66:"Rain",67:"Rain",80:"Rain",81:"Rain",82:"Rain",71:"Snow",73:"Snow",75:"Snow",77:"Snow",85:"Snow",86:"Snow",95:"Thunderstorm",96:"Thunderstorm",99:"Thunderstorm"};function dr(o,l,s){o&&(o.className="form-status"+(s?" form-status--"+s:""),o.textContent=l||"")}function mg(){var o=document.getElementById("get-location"),l=document.getElementById("get-weather");if(!o&&!l)return;var s=document.getElementById("location-status"),a=document.getElementById("weather-status");function f(){var h=Ot("lat"),b=Ot("lng"),y=h?h.value.trim():"",x=b?b.value.trim():"";return y&&x?{lat:y,lng:x}:null}function p(){if(l){var h=!!f();l.disabled=!h,l.title=h?"":"Get location first"}}p();function c(h,b){var y=Ot("location_city"),x=Ot("location_country");if(!((!y||y.value.trim())&&(!x||x.value.trim()))){var C="https://api.bigdatacloud.net/data/reverse-geocode-client?latitude="+encodeURIComponent(h)+"&longitude="+encodeURIComponent(b)+"&localityLanguage=en";fetch(C).then(function(S){return S.json()}).then(function(S){var F=(S.city||S.locality||"").trim(),_=(S.countryName||"").trim();y&&!y.value.trim()&&F&&(y.value=F),x&&!x.value.trim()&&_&&(x.value=_);var L=[F,_].filter(Boolean).join(", ");L&&dr(s,"\u2713 Location captured \xB7 "+L,"ok")}).catch(function(){})}}o&&o.addEventListener("click",function(){if(!navigator.geolocation){dr(s,"Geolocation is not supported on this device.","err");return}o.classList.add("is-loading"),o.disabled=!0,dr(s,"Getting location\u2026"),navigator.geolocation.getCurrentPosition(function(h){var b=h.coords.latitude.toFixed(6),y=h.coords.longitude.toFixed(6),x=Ot("lat"),C=Ot("lng");x&&(x.value=b),C&&(C.value=y),o.classList.remove("is-loading"),o.disabled=!1,dr(s,"\u2713 Location captured \xB7 "+b+", "+y,"ok"),p(),c(b,y)},function(h){o.classList.remove("is-loading"),o.disabled=!1,dr(s,"\u2717 "+(h&&h.message?h.message:"Could not get location")+" \u2014 enter coordinates manually if needed.","err")},{enableHighAccuracy:!0,timeout:15e3})}),l&&l.addEventListener("click",function(){var h=f();if(!h){dr(a,"Get location first, then fetch weather.","err");return}l.classList.add("is-loading"),l.disabled=!0,dr(a,"Fetching weather\u2026");var b="https://api.open-meteo.com/v1/forecast?latitude="+h.lat+"&longitude="+h.lng+"¤t=temperature_2m,weather_code&temperature_unit=celsius";fetch(b).then(function(y){return y.json()}).then(function(y){var x=Math.round(y.current.temperature_2m),C=vg[y.current.weather_code]||"Cloudy",S=Ot("weather_temp_c"),F=Ot("weather_desc");S&&(S.value=x),F&&(F.value=C),l.classList.remove("is-loading"),p(),dr(a,"\u2713 Weather set \xB7 "+C+" \xB7 "+x+"\xB0C (edit above if needed)","ok")}).catch(function(){l.classList.remove("is-loading"),p(),dr(a,"\u2717 Could not fetch weather \u2014 set it manually above.","err")})})}function bg(){var o=new Date;return o.setSeconds(0,0),o.setMinutes(o.getMinutes()-o.getTimezoneOffset()),o.toISOString().slice(0,16)}function yg(){var o={title:"Title",date:"Date & time",content:"Content"},l=document.querySelector('form[name="new-entry"]');if(!l)return;var s=Ot("date");s&&!String(s.value).trim()&&(s.value=bg());function a(){l.querySelectorAll(".field-error").forEach(function(c){c.remove()}),l.querySelectorAll(".field-invalid").forEach(function(c){c.classList.remove("field-invalid")})}function f(c,h){c.classList.add("field-invalid");var b=document.createElement("span");b.className="field-error",b.textContent=h,c.parentNode.insertBefore(b,c.nextSibling)}function p(c){var h=l.querySelector(".photos-collapse"),b,y;if(h?(h.open=!0,y=h.querySelector(".photos-collapse__summary"),b=h):(b=document.querySelector(".filepond-root, .form-input-file"),y=b),!y)return b||null;var x=document.createElement("span");return x.className="field-error",x.textContent=c,y.insertAdjacentElement("afterend",x),b||y}l.addEventListener("submit",function(c){a();var h=null;!Xo&&document.querySelectorAll(".filepond--item").length<1&&(h=p("Add at least one photo.")),Object.keys(o).forEach(function(b){var y=Ot(b);y&&!String(y.value).trim()&&(f(y,o[b]+" is required."),h||(h=y))}),h&&(c.preventDefault(),typeof h.focus=="function"&&h.focus(),h.scrollIntoView({behavior:"smooth",block:"center"}))})}var Pl="intotheeast:new-entry-draft";function xg(o){return Array.prototype.slice.call(o.querySelectorAll('[name^="data["]')).filter(function(l){if(l.type==="file")return!1;var s=l.name;return s.indexOf("data[_json")!==0&&s.indexOf("data[photos")!==0})}function Dg(){var o=document.querySelector(".filepond-root, .form-input-file");if(!(!o||!o.parentNode)&&!o.parentNode.querySelector(".photo-reauth-hint")){var l=document.createElement("p");l.className="photo-reauth-hint is-shown",l.textContent="Your text was restored \u2014 photos need re-selecting (they can\u2019t be saved in a draft).",o.parentNode.insertBefore(l,o.nextSibling)}}function wg(){var o=document.querySelector('form[name="new-entry"]');if(!o||Xo)return;if(document.querySelector(".notices.success")){try{localStorage.removeItem(Pl)}catch{}return}function l(){var p={};xg(o).forEach(function(c){c.type==="radio"?c.checked&&(p[c.name]=c.value):p[c.name]=c.value});try{localStorage.setItem(Pl,JSON.stringify(p))}catch{}}var s=null;try{s=localStorage.getItem(Pl)}catch{s=null}if(s){var a=null;try{a=JSON.parse(s)}catch{a=null}if(a){var f=!1;Object.keys(a).forEach(function(p){var c=a[p];if(c!=null&&String(c).trim()&&(f=!0),p!=="data[content]"){var h=o.querySelectorAll('input[type="radio"][name="'+p+'"]');if(h.length){h.forEach(function(y){y.checked=y.value===c});return}var b=o.querySelector('[name="'+p+'"]');b&&b.type!=="file"&&(b.value=c)}}),window.postFormEditor&&a["data[content]"]!=null&&window.postFormEditor.value(a["data[content]"]),f&&Dg()}}o.addEventListener("input",l),o.addEventListener("change",l),window.postFormEditor&&window.postFormEditor.codemirror.on("change",l)}function Cg(){var o=document.querySelector(".post-form-wrap"),l=document.querySelector(".post-form-wrap .notices.success, .post-form-wrap .notices.green");if(!(!o||!l)){var s=document.createElement("div");s.className="post-success";var a=document.createElement("p");a.className="post-success__title",a.textContent="\u2713 Saved to your journal.",s.appendChild(a);var f=document.createElement("div");f.className="post-success__actions";var p=o.getAttribute("data-trip-url");if(p){var c=document.createElement("a");c.className="post-success__view",c.href=p,c.textContent="View your journal \u2192",f.appendChild(c)}var h=document.createElement("a");h.className="post-success__again",h.href=window.location.pathname,h.textContent="Post another",f.appendChild(h),s.appendChild(f),l.parentNode.insertBefore(s,l.nextSibling),["form",".form-action-row","#location-status","#weather-status"].forEach(function(b){var y=o.querySelector(b);y&&(y.style.display="none")}),l.scrollIntoView({behavior:"smooth",block:"start"})}}var Xo=!1;function Ac(o){return new URLSearchParams(window.location.search).get(o)}function hr(o,l){var s=Ot(o);s&&(s.value=l==null?"":String(l))}function zl(o,l){var s=l?"1":"0",a=document.querySelectorAll('[name="data['+o+']"]');Array.prototype.forEach.call(a,function(f){f.checked=String(f.value)===s})}function kg(o){var l=o==null?"":String(o);if(window.postFormEditor&&typeof window.postFormEditor.value=="function")window.postFormEditor.value(l);else{var s=Ot("content");s&&(s.value=l)}}function Fc(o,l){var s=o.querySelectorAll("input, textarea, select, button");Array.prototype.forEach.call(s,function(a){a.type==="file"||a.name&&a.name.indexOf("data[photos")===0||(a.disabled=l)}),window.postFormEditor&&window.postFormEditor.codemirror&&window.postFormEditor.codemirror.setOption("readOnly",l?"nocursor":!1)}function Hl(o,l){o&&(o.tagName==="INPUT"?o.value=l:o.textContent=l)}function Sg(o,l){var s=o.querySelector(".post-edit-error");if(s){s.textContent=l;return}var a=document.createElement("div");a.className="post-edit-error",a.setAttribute("role","alert"),a.textContent=l;var f=o.querySelector("h1");f?f.insertAdjacentElement("afterend",a):o.insertBefore(a,o.firstChild)}var Eg=/\.(jpe?g|png|webp|heic|heif|gif)$/i;function Tc(o){var l=/(?:^|\/)photo-0*(\d+)\./i.exec(o);return l?parseInt(l[1],10):Number.MAX_SAFE_INTEGER}function Ag(o,l){var s=Tc(o),a=Tc(l);return s!==a?s-a:ol?1:0}function Lc(o,l){var s=String(o||"photo"),a=s.lastIndexOf("."),f=(a>0?s.slice(0,a):s).toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"photo",p=l?".jpg":a>0?s.slice(a).toLowerCase():".jpg",c=Date.now().toString(36)+Math.random().toString(36).slice(2,6);return f+"-"+c+p}function Fg(o){var l=document.querySelector('form[name="new-entry"]');if(!l||!o)return;var s=o.split("/").filter(Boolean).pop();if(!s)return;var a=document.querySelector(".filepond-root, .form-input-file"),f=a?a.closest(".form-field"):null;f&&(f.style.display="none");var p=l.querySelector(".photos-collapse");p&&(p.style.display="none");var c=document.createElement("div");c.className="photo-editor",c.innerHTML='

    Photos

    ',f&&f.parentNode?f.parentNode.insertBefore(c,f):l.insertBefore(c,l.firstElementChild);var h=c.querySelector(".photo-editor__grid"),b=c.querySelector(".photo-editor__status"),y=c.querySelector(".photo-editor__add"),x=c.querySelector(".photo-editor__input"),C=[],S=null,F=!1,_=0;function L(K,E){b.textContent=K||"",b.className="photo-editor__status gpx-status"+(E?" error":"")}function T(K){F=K,y.disabled=K,Array.prototype.forEach.call(h.querySelectorAll(".photo-editor__del, .photo-editor__confirm-yes, .photo-editor__confirm-no"),function(E){E.disabled=K}),S&&S.option("disabled",K)}function O(K,E){return fetch(K,Object.assign({credentials:"include"},E)).then(function(z){return z.ok||z.status===204})}function N(){return fetch("/api/v1/pages"+o+"/media",{credentials:"include",headers:{Accept:"application/json"}}).then(function(K){if(!K.ok)throw new Error("HTTP "+K.status);return K.json()}).then(function(K){return(K&&K.data||[]).filter(function(E){return E&&typeof E.filename=="string"&&Eg.test(E.filename)}).map(function(E){return E.filename}).sort(Ag)})}function P(K){return O("/api/v1/entry/"+encodeURIComponent(s)+"/photos/order",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({order:K})}).then(function(E){if(!E)throw new Error("reorder failed")})}function I(K){if(C=(K||[]).slice(),S&&(S.destroy(),S=null),h.innerHTML="",!C.length){h.innerHTML='

    No photos yet \u2014 add some.

    ';return}var E=++_;C.forEach(function(z){var R=document.createElement("div");R.className="photo-editor__cell",R.setAttribute("data-filename",z);var Z=document.createElement("img");Z.className="photo-editor__img",Z.loading="lazy",Z.alt=z,Z.src=o+"/"+encodeURIComponent(z)+"?v="+E;var ue=document.createElement("button");ue.type="button",ue.className="photo-editor__del",ue.setAttribute("aria-label","Delete "+z),ue.textContent="\u2715",ue.addEventListener("click",function(){me(R,z)}),R.appendChild(Z),R.appendChild(ue),h.appendChild(R)}),C.length>1&&(S=new Sc(h,{animation:150,draggable:".photo-editor__cell",filter:".photo-editor__confirm",onEnd:X}))}function q(){return Array.prototype.map.call(h.querySelectorAll(".photo-editor__cell"),function(K){return K.getAttribute("data-filename")})}function j(K,E){if(K.length!==E.length)return!1;for(var z=0;zDelete?',K.appendChild(z),K.classList.add("is-confirming"),z.querySelector(".photo-editor__confirm-no").addEventListener("click",function(){K.classList.remove("is-confirming"),z.remove()}),z.querySelector(".photo-editor__confirm-yes").addEventListener("click",function(){z.querySelector(".photo-editor__confirm-yes").disabled=!0,z.querySelector(".photo-editor__confirm-no").disabled=!0,U(E)})}}function U(K){var E=C.slice();T(!0),L("Deleting\u2026"),O("/api/v1/pages"+o+"/media/"+encodeURIComponent(K),{method:"DELETE"}).then(function(z){if(!z)throw new Error("delete failed");var R=C.filter(function(Z){return Z!==K});return(R.length?P(R):Promise.resolve()).then(N)}).then(function(z){L(""),I(z)}).catch(function(){L("Couldn\u2019t delete that photo. Try again.",!0),I(E)}).then(function(){T(!1)})}function le(K){return _c(K).then(function(E){return E?import("./heic-to-CN7JBE7H.js").then(function(z){var R=z.heicTo||z.default&&z.default.heicTo;return R({blob:K,type:"image/jpeg",quality:.85})}).then(function(z){return{blob:z,name:Lc(K.name,!0)}}):{blob:K,name:Lc(K.name,!1)}})}y.addEventListener("click",function(){F||x.click()}),x.addEventListener("change",function(){var K=Array.prototype.slice.call(x.files||[]);x.value="",K.length&&ie(K)});function ie(K){T(!0);var E=K.length,z=0,R=0,Z=C.slice(),ue=Promise.resolve();K.forEach(function(De){ue=ue.then(function(){return z++,L("Uploading "+z+" of "+E+"\u2026"),le(De).then(function(Ue){var A=new FormData;return A.append("file",Ue.blob,Ue.name),O("/api/v1/pages"+o+"/media",{method:"POST",body:A})}).then(function(Ue){Ue||R++},function(){R++})})}),ue.then(function(){return L("Finishing\u2026"),N()}).then(function(De){var Ue=Z.filter(function(ee){return De.indexOf(ee)!==-1}),A=De.filter(function(ee){return Z.indexOf(ee)===-1}),D=Ue.concat(A);return D.length?P(D).catch(function(){return P(D)}).catch(function(){return Promise.all(A.map(function(ee){return O("/api/v1/pages"+o+"/media/"+encodeURIComponent(ee),{method:"DELETE"}).catch(function(){})})).then(function(){var ee=new Error("reorder failed");throw ee.rolledBack=!0,ee})}).then(N):(I([]),null)}).then(function(De){De&&I(De),L(R?R+" photo"+(R>1?"s":"")+" couldn\u2019t be added.":"",!!R)}).catch(function(De){return L(De&&De.rolledBack?"Couldn\u2019t finish adding photos \u2014 changes were rolled back. Try again.":"Couldn\u2019t add photos. Please try again.",!0),N().then(I,function(){I(Z)})}).then(function(){T(!1)})}h.innerHTML='

    Loading photos\u2026

    ',N().then(I).catch(function(){L("Couldn\u2019t load photos.",!0),I([])})}function Tg(){var o=document.querySelector('form[name="new-entry"]'),l=document.querySelector(".post-form-wrap");if(!(!o||!l)){var s=Ac("edit");if(s){Xo=!0;var a=l.querySelector("h1");a&&(a.textContent="Edit entry");var f=o.querySelector('button[type="submit"], input[type="submit"]'),p=f?f.tagName==="INPUT"?f.value:f.textContent:"Save changes";Fc(o,!0),Hl(f,"Loading entry\u2026");var c=Ac("return")||l.getAttribute("data-trip-url")||"";o.setAttribute("action","/post?edit="+encodeURIComponent(s)+(c?"&return="+encodeURIComponent(c):"")),fetch("/api/v1/pages"+s,{credentials:"include",headers:{Accept:"application/json"}}).then(function(h){if(!h.ok){var b=new Error("HTTP "+h.status);throw b.status=h.status,b}return h.json()}).then(function(h){var b=h&&h.data||{},y=b.header||{};hr("title",y.title!=null?y.title:b.title),hr("date",y.date?String(y.date).replace(" ","T"):""),kg(b.content),hr("lat",y.lat),hr("lng",y.lng),hr("location_city",y.location_city),hr("location_country",y.location_country),hr("weather_desc",y.weather_desc),hr("weather_temp_c",y.weather_temp_c),hr("transport_mode",y.transport_mode),zl("featured",y.featured),zl("force_connect",y.force_connect),zl("published",y.published!==void 0?y.published:b.published);var x=Ot("edit_path");x&&(x.value=s+"/entry.md"),Fc(o,!1),Hl(f,"Save changes");var C=o.querySelector(".more-options");C&&(C.open=!0),Fg(s)}).catch(function(h){var b=h&&h.status===404?"This entry no longer exists \u2014 it may have been deleted. Head back to the journal.":"Sorry \u2014 this entry couldn\u2019t be loaded for editing. Check your connection and try again.";Sg(l,b),Hl(f,p)})}}}function Mc(){window.postFormEditor=fg(),Cg(),Tg(),wg(),pg(),gg(),mg(),yg()}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Mc):Mc(); +/*! Bundled license information: + +sortablejs/modular/sortable.esm.js: + (**! + * Sortable 1.15.7 + * @author RubaXa + * @author owenm + * @license MIT + *) +*/ diff --git a/themes/intotheeast/js/src/post-form.css b/themes/intotheeast/js/src/post-form.css index 8d145a2..fa7e6e8 100644 --- a/themes/intotheeast/js/src/post-form.css +++ b/themes/intotheeast/js/src/post-form.css @@ -336,3 +336,146 @@ color: var(--color-ink); } .EasyMDEContainer .editor-preview a { color: var(--color-accent); } + +/* ── Photo editor (edit mode only) ──────────────────────────────────────── + Own thumbnail grid that talks straight to the media API (add/delete/reorder + live), replacing the FilePond photo path when editing. */ +.photo-editor { + margin-bottom: var(--space-5); +} +.photo-editor__head { + display: flex; + align-items: center; + justify-content: space-between; + gap: var(--space-3); + margin-bottom: var(--space-2); +} +.photo-editor__label { + font-family: var(--font-ui); + font-size: var(--text-base); + font-weight: 600; + color: var(--color-ink); +} +.photo-editor__add { + font-family: var(--font-ui); + font-size: var(--text-sm); + background: var(--color-accent); + color: #fff; + border: none; + border-radius: var(--radius-sm); + padding: var(--space-2) var(--space-4); + cursor: pointer; +} +.photo-editor__add:disabled { opacity: 0.5; cursor: default; } + +.photo-editor__status { + font-size: var(--text-sm); + color: var(--color-ink-muted); + min-height: 1.2em; + margin: 0 0 var(--space-2); +} +.photo-editor__status.error { color: var(--color-error); } + +.photo-editor__grid { + display: grid; + grid-template-columns: repeat(3, 1fr); + gap: var(--space-2); +} +@media (min-width: 600px) { + .photo-editor__grid { grid-template-columns: repeat(4, 1fr); } +} +.photo-editor__loading, +.photo-editor__empty { + grid-column: 1 / -1; + color: var(--color-ink-muted); + font-size: var(--text-sm); + padding: var(--space-4) 0; +} + +.photo-editor__cell { + position: relative; + aspect-ratio: 1 / 1; + border-radius: var(--radius-sm); + overflow: hidden; + background: var(--color-surface-raised); + cursor: grab; + touch-action: none; /* let SortableJS own the touch-drag gesture */ +} +.photo-editor__cell:active { cursor: grabbing; } +.photo-editor__img { + width: 100%; + height: 100%; + object-fit: cover; + display: block; + -webkit-user-drag: none; + user-select: none; + pointer-events: none; /* the cell, not the image, is the drag handle */ +} +/* First thumbnail is the feed cover. */ +.photo-editor__cell:first-child::after { + content: 'Cover'; + position: absolute; + left: var(--space-1); + bottom: var(--space-1); + font-family: var(--font-ui); + font-size: var(--text-xs, 0.7rem); + font-weight: 600; + color: #fff; + background: var(--color-accent); + padding: 1px 6px; + border-radius: var(--radius-sm); + pointer-events: none; +} +.photo-editor__del { + position: absolute; + top: var(--space-1); + right: var(--space-1); + width: 24px; + height: 24px; + line-height: 1; + display: flex; + align-items: center; + justify-content: center; + border: none; + border-radius: 50%; + background: rgba(0, 0, 0, 0.55); + color: #fff; + font-size: 0.85rem; + cursor: pointer; +} +.photo-editor__del:hover { background: rgba(0, 0, 0, 0.75); } +.photo-editor__del:disabled { opacity: 0.4; cursor: default; } + +/* Inline delete confirm — covers the cell (option a: live delete, deliberate step). */ +.photo-editor__confirm { + position: absolute; + inset: 0; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + gap: var(--space-1); + padding: var(--space-2); + background: rgba(0, 0, 0, 0.72); + text-align: center; +} +.photo-editor__confirm-q { + color: #fff; + font-family: var(--font-ui); + font-size: var(--text-sm); +} +.photo-editor__confirm button { + font-family: var(--font-ui); + font-size: var(--text-xs, 0.72rem); + border: none; + border-radius: var(--radius-sm); + padding: 3px 10px; + cursor: pointer; +} +.photo-editor__confirm-yes { background: var(--color-error); color: #fff; } +.photo-editor__confirm-no { background: #fff; color: var(--color-ink); } +.photo-editor__confirm button:disabled { opacity: 0.5; cursor: default; } + +/* SortableJS drag feedback. */ +.photo-editor__cell.sortable-ghost { opacity: 0.4; } +.photo-editor__cell.sortable-chosen { outline: 2px solid var(--color-accent); } diff --git a/themes/intotheeast/js/src/post-form.js b/themes/intotheeast/js/src/post-form.js index d96a769..459d41a 100644 --- a/themes/intotheeast/js/src/post-form.js +++ b/themes/intotheeast/js/src/post-form.js @@ -8,6 +8,7 @@ * initTripStats pattern, so this is a no-op if an element is absent. */ import EasyMDE from 'easymde'; +import Sortable from 'sortablejs'; import 'easymde/dist/easymde.min.css'; import './post-form.css'; @@ -135,6 +136,15 @@ function initPhotoConversion() { var form = document.querySelector('form[name="new-entry"]'); if (!form) return; + // Edit mode runs its OWN live photo editor (initPhotoEditor) against the media + // API and decommissions FilePond entirely — no collapse, no HEIC-into-FilePond + // hooks, and crucially no `photo_order` submit handler. A stale photo_order + // posted on text Save would drive cache-on-save.reconcilePhotos() → + // deleteUnlistedImages() and silently delete any photo added live after the + // page opened. Skipping the wiring here (FilePond left unpopulated) means no + // manifest is posted, so the live-managed folder is left untouched on Save. + if (EDIT_MODE) return; + var converting = 0; // HEIC conversions in flight (before FilePond) — gates Submit var collapse = buildPhotoCollapse(); var orderPond = null; // set when the managed FilePond instance is found @@ -696,13 +706,11 @@ function initSuccessState() { * overwrite_mode:edit server-side), and switch the chrome to "Edit entry" / * "Save changes" (D6). * - * Photos (M2/U7): the entry's existing images are loaded into FilePond as LOCAL - * items (already on the server — not re-uploaded on save) so the owner can drop, - * add and reorder them. On submit their filenames ride the same `photo_order` - * manifest as new uploads; cache-on-save reconciles the entry folder to match - * (delete dropped, renumber survivors photo-1..N, first = cover — U8). The - * >=1-photo rule stays relaxed in edit mode so an owner may leave a text-only - * entry after removing every photo. + * Photos: FilePond is decommissioned in edit mode (see initPhotoConversion's + * EDIT_MODE guard). Instead initPhotoEditor renders our own thumbnail grid from + * the media API and persists add/delete/reorder LIVE — decoupled from this form's + * text-field Save. The >=1-photo rule stays relaxed in edit mode so an owner may + * leave a text-only entry after removing every photo. */ var EDIT_MODE = false; @@ -768,67 +776,303 @@ function editShowError(wrap, msg) { if (h1) h1.insertAdjacentElement('afterend', banner); else wrap.insertBefore(banner, wrap.firstChild); } -// Poll for the managed FilePond instance (created by the form plugin's handler on -// DOMContentLoaded) — the same instance initPhotoConversion hooks — then run cb. -function editWaitForPond(cb, tries) { - tries = tries || 0; - var ponds = (window.GravFilePond && window.GravFilePond.getInstances) - ? window.GravFilePond.getInstances() : []; - if (ponds.length && ponds[0]) { cb(ponds[0]); return; } - if (tries < 120) setTimeout(function () { editWaitForPond(cb, tries + 1); }, 50); +/* ── Photo editor (edit mode): live add / delete / reorder via the media API ─── + * Replaces the FilePond photo path in edit mode with our own thumbnail grid (the + * gpx-manager pattern): add + delete hit the STOCK media API and reorder hits the + * custom /entry/{slug}/photos/order route; each op persists IMMEDIATELY, decoupled + * from the form's text-field Save. SortableJS provides the drag FilePond couldn't + * do reliably here. After every mutation the entry is renumbered photo-01..NN + * server-side so the feed cover (media.images|first) follows the arranged order. + * + * Every op's failure path shows an inline error and never lets the shown grid + * disagree with disk without saying so: a failed reorder reverts the SortableJS + * move to the last-known-good order; a failed add rolls its uploads back. + */ + +var PHOTO_EXT_RE = /\.(jpe?g|png|webp|heic|heif|gif)$/i; + +// Numeric index behind a photo-NN filename (zero-padding tolerant); non-photo +// names (freshly stock-uploaded, not yet renumbered) sort last, then by name. +function photoIndexOf(name) { + var m = /(?:^|\/)photo-0*(\d+)\./i.exec(name); + return m ? parseInt(m[1], 10) : Number.MAX_SAFE_INTEGER; +} +function byPhotoOrder(a, b) { + var ia = photoIndexOf(a), ib = photoIndexOf(b); + if (ia !== ib) return ia - ib; + return a < b ? -1 : (a > b ? 1 : 0); } -// U7/R9: load the entry's current photos into FilePond as LOCAL items (already on -// the server — shown for reorder/removal, never re-uploaded). Adding new photos on -// edit is enabled (allowBrowse/allowDrop): on submit, existing filenames + any new -// uploads ride the `photo_order` manifest and cache-on-save reconciles the folder -// (delete dropped, renumber survivors photo-1..N, first = cover). A broken media -// URL is skipped, never aborting the rest. -// -// Add-on-edit depends on a local patch to add-page-by-form (stock GPM plugin's -// edit-mode file merge fatals on Grav 2.0's Header object — see the patch note in -// add-page-by-form.php). That patch is git-ignored, so it must be re-applied on a -// fresh plugin install until upstream is forked. -function editLoadPhotos(route) { - fetch('/api/v1/pages' + route + '/media', { credentials: 'include', headers: { Accept: 'application/json' } }) - .then(function (r) { return r.ok ? r.json() : { data: [] }; }) - .then(function (json) { - var media = (json && json.data) || []; - var images = media.filter(function (m) { - return m && typeof m.filename === 'string' && /\.(jpe?g|png|gif|webp|heic|heif)$/i.test(m.filename); - }).sort(function (a, b) { - return a.filename < b.filename ? -1 : (a.filename > b.filename ? 1 : 0); +// A throwaway, collision-proof upload name. The file is renumbered to photo-NN +// immediately after the batch, so this name only has to be unique enough not to +// clobber an existing photo-NN or a same-named sibling in the same add batch. +function uploadName(origName, forceJpeg) { + var s = String(origName || 'photo'); + var dot = s.lastIndexOf('.'); + var base = (dot > 0 ? s.slice(0, dot) : s).toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '') || 'photo'; + var ext = forceJpeg ? '.jpg' : (dot > 0 ? s.slice(dot).toLowerCase() : '.jpg'); + var uniq = Date.now().toString(36) + Math.random().toString(36).slice(2, 6); + return base + '-' + uniq + ext; +} + +function initPhotoEditor(route) { + var form = document.querySelector('form[name="new-entry"]'); + if (!form || !route) return; + // The reorder route keys on the entry's folder segment (last path segment). + var slug = route.split('/').filter(Boolean).pop(); + if (!slug) return; + + // Decommission the (hidden, unpopulated) FilePond section entirely. + var fpRoot = document.querySelector('.filepond-root, .form-input-file'); + var fpField = fpRoot ? fpRoot.closest('.form-field') : null; + if (fpField) fpField.style.display = 'none'; + var legacyCollapse = form.querySelector('.photos-collapse'); + if (legacyCollapse) legacyCollapse.style.display = 'none'; + + // Build the editor and place it at the top of the form (photos come first). + var host = document.createElement('div'); + host.className = 'photo-editor'; + host.innerHTML = + '
    ' + + 'Photos' + + '' + + '
    ' + + '

    ' + + '
    ' + + // SVG intentionally excluded (server-side block is a documented fast-follow). + ''; + if (fpField && fpField.parentNode) fpField.parentNode.insertBefore(host, fpField); + else form.insertBefore(host, form.firstElementChild); + + var grid = host.querySelector('.photo-editor__grid'); + var statusEl = host.querySelector('.photo-editor__status'); + var addBtn = host.querySelector('.photo-editor__add'); + var fileInput = host.querySelector('.photo-editor__input'); + + var photos = []; // current filenames, in display order + var sortable = null; + var busy = false; + var renderNonce = 0; // cache-buster: photo-NN URLs are reused across reorders + + function setStatus(msg, isError) { + statusEl.textContent = msg || ''; + statusEl.className = 'photo-editor__status gpx-status' + (isError ? ' error' : ''); + } + + function setBusy(b) { + busy = b; + addBtn.disabled = b; + Array.prototype.forEach.call( + grid.querySelectorAll('.photo-editor__del, .photo-editor__confirm-yes, .photo-editor__confirm-no'), + function (el) { el.disabled = b; } + ); + if (sortable) sortable.option('disabled', b); + } + + // Boolean-ok fetch (204 counts as ok for DELETE). Cookies auto-included. + function apiOk(url, opts) { + return fetch(url, Object.assign({ credentials: 'include' }, opts)) + .then(function (r) { return r.ok || r.status === 204; }); + } + + function mediaList() { + return fetch('/api/v1/pages' + route + '/media', { credentials: 'include', headers: { Accept: 'application/json' } }) + .then(function (r) { if (!r.ok) throw new Error('HTTP ' + r.status); return r.json(); }) + .then(function (j) { + return ((j && j.data) || []) + .filter(function (m) { return m && typeof m.filename === 'string' && PHOTO_EXT_RE.test(m.filename); }) + .map(function (m) { return m.filename; }) + .sort(byPhotoOrder); }); - editWaitForPond(function (pond) { - try { pond.setOptions({ allowBrowse: true, allowDrop: true, allowReorder: true }); } catch (e) { /* older API */ } - // Fetch each image as a real Blob and add it as a File. Passing a - // plain URL to addFile({type:'local'}) routes through the form - // plugin's FilePond server.load, which returns HTML here (not the - // image bytes) — so the image-preview plugin had nothing to render - // and items showed as a bare filename. A real File gives FilePond - // the image data → thumbnail renders. type:'local' still means it - // is never re-uploaded; its filename rides the photo_order manifest. - Promise.all(images.map(function (m) { - return fetch(route + '/' + m.filename, { credentials: 'include' }) - .then(function (r) { return r.ok ? r.blob() : null; }) - .then(function (blob) { - return blob ? new File([blob], m.filename, { type: blob.type || 'image/jpeg' }) : null; - }) - .catch(function () { return null; }); - })).then(function (files) { - // Add in the sorted (cover) order; index keeps FilePond's list - // ordered even though the fetches resolve concurrently. - files.forEach(function (file, i) { - if (!file) return; - try { - var p = pond.addFile(file, { type: 'local', index: i }); - if (p && typeof p.catch === 'function') p.catch(function () { /* skip */ }); - } catch (e) { /* older FilePond API — skip */ } - }); - }); + } + + function reorder(order) { + return apiOk('/api/v1/entry/' + encodeURIComponent(slug) + '/photos/order', { + method: 'POST', + headers: { 'Content-Type': 'application/json', Accept: 'application/json' }, + body: JSON.stringify({ order: order }) + }).then(function (ok) { if (!ok) throw new Error('reorder failed'); }); + } + + function render(list) { + photos = (list || []).slice(); + if (sortable) { sortable.destroy(); sortable = null; } + grid.innerHTML = ''; + if (!photos.length) { + grid.innerHTML = '

    No photos yet — add some.

    '; + return; + } + var v = ++renderNonce; + photos.forEach(function (name) { + var cell = document.createElement('div'); + cell.className = 'photo-editor__cell'; + cell.setAttribute('data-filename', name); + var img = document.createElement('img'); + img.className = 'photo-editor__img'; + img.loading = 'lazy'; + img.alt = name; + // Reorder reuses photo-NN URLs for different bytes; bust the cache. + img.src = route + '/' + encodeURIComponent(name) + '?v=' + v; + var del = document.createElement('button'); + del.type = 'button'; + del.className = 'photo-editor__del'; + del.setAttribute('aria-label', 'Delete ' + name); + del.textContent = '✕'; + del.addEventListener('click', function () { confirmDelete(cell, name); }); + cell.appendChild(img); + cell.appendChild(del); + grid.appendChild(cell); + }); + if (photos.length > 1) { + sortable = new Sortable(grid, { + animation: 150, + draggable: '.photo-editor__cell', + filter: '.photo-editor__confirm', + onEnd: applyReorder }); - }) - .catch(function () { /* no existing photos loaded — owner can still save */ }); + } + } + + function currentDomOrder() { + return Array.prototype.map.call(grid.querySelectorAll('.photo-editor__cell'), + function (c) { return c.getAttribute('data-filename'); }); + } + + function sameOrder(a, b) { + if (a.length !== b.length) return false; + for (var i = 0; i < a.length; i++) { if (a[i] !== b[i]) return false; } + return true; + } + + function applyReorder() { + var next = currentDomOrder(); + if (sameOrder(next, photos)) return; // dropped in place + var lastGood = photos.slice(); + setBusy(true); + setStatus('Saving order…'); + reorder(next) + .then(function () { return mediaList(); }) + .then(function (list) { setStatus(''); render(list); }) + .catch(function () { + setStatus('Couldn’t save the new order — reverted. Try again.', true); + render(lastGood); // revert the SortableJS move to last-known-good + }) + .then(function () { setBusy(false); }); + } + + // ✕ swaps the cell to an inline "Delete? [Confirm] [Cancel]" (option a). + function confirmDelete(cell, name) { + if (busy || cell.querySelector('.photo-editor__confirm')) return; + var overlay = document.createElement('div'); + overlay.className = 'photo-editor__confirm'; + overlay.innerHTML = + 'Delete?' + + '' + + ''; + cell.appendChild(overlay); + cell.classList.add('is-confirming'); + overlay.querySelector('.photo-editor__confirm-no').addEventListener('click', function () { + cell.classList.remove('is-confirming'); + overlay.remove(); + }); + overlay.querySelector('.photo-editor__confirm-yes').addEventListener('click', function () { + overlay.querySelector('.photo-editor__confirm-yes').disabled = true; + overlay.querySelector('.photo-editor__confirm-no').disabled = true; + doDelete(name); + }); + } + + function doDelete(name) { + var lastGood = photos.slice(); + setBusy(true); + setStatus('Deleting…'); + apiOk('/api/v1/pages' + route + '/media/' + encodeURIComponent(name), { method: 'DELETE' }) + .then(function (ok) { + if (!ok) throw new Error('delete failed'); + // Renumber the survivors so cover=first stays correct (idempotent). + var remaining = photos.filter(function (p) { return p !== name; }); + return (remaining.length ? reorder(remaining) : Promise.resolve()).then(mediaList); + }) + .then(function (list) { setStatus(''); render(list); }) + .catch(function () { + setStatus('Couldn’t delete that photo. Try again.', true); + render(lastGood); + }) + .then(function () { setBusy(false); }); + } + + // HEIC→JPEG (reusing the sniff + lazy heic-to converter) else pass through. + function toWebSafe(file) { + return looksLikeHeic(file).then(function (isHeic) { + if (!isHeic) return { blob: file, name: uploadName(file.name, false) }; + return import('heic-to').then(function (mod) { + var heicTo = mod.heicTo || (mod.default && mod.default.heicTo); + return heicTo({ blob: file, type: 'image/jpeg', quality: 0.85 }); + }).then(function (jpeg) { return { blob: jpeg, name: uploadName(file.name, true) }; }); + }); + } + + addBtn.addEventListener('click', function () { if (!busy) fileInput.click(); }); + fileInput.addEventListener('change', function () { + var files = Array.prototype.slice.call(fileInput.files || []); + fileInput.value = ''; + if (files.length) addFiles(files); + }); + + function addFiles(files) { + setBusy(true); + var total = files.length, done = 0, failed = 0; + var before = photos.slice(); + var seq = Promise.resolve(); + files.forEach(function (file) { + seq = seq.then(function () { + done++; + setStatus('Uploading ' + done + ' of ' + total + '…'); + return toWebSafe(file).then(function (prep) { + var fd = new FormData(); + fd.append('file', prep.blob, prep.name); + return apiOk('/api/v1/pages' + route + '/media', { method: 'POST', body: fd }); + }).then(function (ok) { if (!ok) failed++; }, function () { failed++; }); + }); + }); + seq.then(function () { + setStatus('Finishing…'); + return mediaList(); // authoritative set (includes new stock-named files) + }).then(function (current) { + var kept = before.filter(function (n) { return current.indexOf(n) !== -1; }); + var added = current.filter(function (n) { return before.indexOf(n) === -1; }); + var order = kept.concat(added); + if (!order.length) { render([]); return null; } + // One renumber pass after the whole batch. If it fails, auto-retry + // (idempotent — renumber skips files not on disk); if it still fails, + // roll the just-added files back so no orphan stock-named image breaks + // cover=first, then surface a single error. + return reorder(order) + .catch(function () { return reorder(order); }) + .catch(function () { + return Promise.all(added.map(function (n) { + return apiOk('/api/v1/pages' + route + '/media/' + encodeURIComponent(n), { method: 'DELETE' }).catch(function () {}); + })).then(function () { var e = new Error('reorder failed'); e.rolledBack = true; throw e; }); + }) + .then(mediaList); + }).then(function (list) { + if (list) render(list); + setStatus(failed ? (failed + ' photo' + (failed > 1 ? 's' : '') + ' couldn’t be added.') : '', !!failed); + }).catch(function (err) { + setStatus(err && err.rolledBack + ? 'Couldn’t finish adding photos — changes were rolled back. Try again.' + : 'Couldn’t add photos. Please try again.', true); + return mediaList().then(render, function () { render(before); }); + }).then(function () { setBusy(false); }); + } + + // Initial load. + grid.innerHTML = '

    Loading photos…

    '; + mediaList().then(render).catch(function () { + setStatus('Couldn’t load photos.', true); + render([]); + }); } function initEditMode() { @@ -887,7 +1131,7 @@ function initEditMode() { var more = form.querySelector('.more-options'); if (more) more.open = true; // reveal Published/Featured/Connector - editLoadPhotos(route); // U7: pull the entry's existing photos into FilePond + initPhotoEditor(route); // live add/delete/reorder via the media API }) .catch(function (err) { // D7: inline error between heading and first field; keep the form diff --git a/themes/intotheeast/package-lock.json b/themes/intotheeast/package-lock.json index 95d8d17..5f7b5e4 100644 --- a/themes/intotheeast/package-lock.json +++ b/themes/intotheeast/package-lock.json @@ -12,7 +12,8 @@ "heic-to": "^1", "maplibre-gl": "^4", "photoswipe": "^5", - "scrollama": "^3" + "scrollama": "^3", + "sortablejs": "^1.15.7" }, "devDependencies": { "esbuild": "^0.21", @@ -984,6 +985,12 @@ "integrity": "sha512-PIPwB1kYBnbw/ezvPBJa5dCN5qEwokfpAkI3BmpZWAwcVID4nDf1qH6WV16A2fQaJmsKx0un5S/zhxN+PQeKDQ==", "license": "MIT" }, + "node_modules/sortablejs": { + "version": "1.15.7", + "resolved": "https://registry.npmjs.org/sortablejs/-/sortablejs-1.15.7.tgz", + "integrity": "sha512-Kk8wLQPlS+yi1ZEf48a4+fzHa4yxjC30M/Sr2AnQu+f/MPwvvX9XjZ6OWejiz8crBsLwSq8GHqaxaET7u6ux0A==", + "license": "MIT" + }, "node_modules/string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", diff --git a/themes/intotheeast/package.json b/themes/intotheeast/package.json index 9c856c6..6680083 100644 --- a/themes/intotheeast/package.json +++ b/themes/intotheeast/package.json @@ -11,7 +11,8 @@ "heic-to": "^1", "maplibre-gl": "^4", "photoswipe": "^5", - "scrollama": "^3" + "scrollama": "^3", + "sortablejs": "^1.15.7" }, "devDependencies": { "esbuild": "^0.21",