diff --git a/passbook/static/static/dist/main.js b/passbook/static/static/dist/main.js index d11cd3eec..50621d5be 100644 --- a/passbook/static/static/dist/main.js +++ b/passbook/static/static/dist/main.js @@ -12,7 +12,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ -function t(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}document.querySelectorAll("input[type=search]").forEach((t=>{t.addEventListener("search",(e=>{""===t.value&&t.parentElement.submit()}))})),document.querySelectorAll("[data-pb-fetch-fill]").forEach((t=>{const e=t.dataset.pbFetchFill,n=t.dataset.pbFetchKey;fetch(e).then((t=>t.json())).then((e=>{t.textContent=e[n],t.value=e[n]}))})),document.querySelectorAll("[data-target='modal']").forEach((t=>{t.addEventListener("click",(t=>{const e=t.target.closest('[data-target="modal"]').attributes["data-modal"].value;document.querySelector("#"+e).removeAttribute("hidden")}))})),document.querySelectorAll(".pf-c-modal-box [data-modal-close]").forEach((t=>{t.addEventListener("click",(t=>{t.target.closest(".pf-c-backdrop").setAttribute("hidden",!0)}))})),document.querySelectorAll(".pf-c-check__label").forEach((t=>{t.addEventListener("click",(t=>{const e=t.target.parentElement.querySelector("input[type=checkbox]");e.checked=!e.checked}))})),document.querySelectorAll(".pf-c-page__header-brand-toggle>button").forEach((t=>{t.addEventListener("click",(t=>{const e=document.querySelector(".pf-c-page__sidebar");e.classList.contains("pf-m-expanded")?(e.classList.remove("pf-m-expanded"),e.style.zIndex=0):(e.classList.add("pf-m-expanded"),e.style.zIndex=200)}))})),document.querySelectorAll(".pf-m-expandable>.pf-c-nav__link").forEach((t=>{t.addEventListener("click",(e=>{e.preventDefault(),t.parentElement.classList.toggle("pf-m-expanded")}))})); +function t(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(o<3?i(a):o>3?i(e,n,a):i(e,n))||a);return o>3&&a&&Object.defineProperty(e,n,a),a}document.querySelectorAll("[data-pb-fetch-fill]").forEach((t=>{const e=t.dataset.pbFetchFill,n=t.dataset.pbFetchKey;fetch(e).then((t=>t.json())).then((e=>{t.textContent=e[n],t.value=e[n]}))})),document.querySelectorAll("[data-target='modal']").forEach((t=>{t.addEventListener("click",(t=>{const e=t.target.closest('[data-target="modal"]').attributes["data-modal"].value;document.querySelector("#"+e).removeAttribute("hidden")}))})),document.querySelectorAll(".pf-c-modal-box [data-modal-close]").forEach((t=>{t.addEventListener("click",(t=>{t.target.closest(".pf-c-backdrop").setAttribute("hidden",!0)}))})),document.querySelectorAll(".pf-c-check__label").forEach((t=>{t.addEventListener("click",(t=>{const e=t.target.parentElement.querySelector("input[type=checkbox]");e.checked=!e.checked}))})),document.querySelectorAll(".pf-c-page__header-brand-toggle>button").forEach((t=>{t.addEventListener("click",(t=>{const e=document.querySelector(".pf-c-page__sidebar");e.classList.contains("pf-m-expanded")?(e.classList.remove("pf-m-expanded"),e.style.zIndex=0):(e.classList.add("pf-m-expanded"),e.style.zIndex=200)}))})),document.querySelectorAll(".pf-m-expandable>.pf-c-nav__link").forEach((t=>{t.addEventListener("click",(e=>{e.preventDefault(),t.parentElement.classList.toggle("pf-m-expanded")}))})); /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. @@ -184,7 +184,7 @@ found at http://polymer.github.io/PATENTS.txt * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ -(window.litElementVersions||(window.litElementVersions=[])).push("2.4.0");const et={};class nt extends q{static getStyles(){return this.styles}static _getUniqueStyles(){if(this.hasOwnProperty(JSCompiler_renameProperty("_styles",this)))return;const t=this.getStyles();if(Array.isArray(t)){const e=(t,n)=>t.reduceRight(((t,n)=>Array.isArray(n)?e(n,t):(t.add(n),t)),n),n=e(t,new Set),r=[];n.forEach((t=>r.unshift(t))),this._styles=r}else this._styles=void 0===t?[]:[t];this._styles=this._styles.map((t=>{if(t instanceof CSSStyleSheet&&!X){const e=Array.prototype.slice.call(t.cssRules).reduce(((t,e)=>t+e.cssText),"");return new Q(String(e),J)}return t}))}initialize(){super.initialize(),this.constructor._getUniqueStyles(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow({mode:"open"})}adoptStyles(){const t=this.constructor._styles;0!==t.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?X?this.renderRoot.adoptedStyleSheets=t.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(t.map((t=>t.cssText)),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}update(t){const e=this.render();super.update(t),e!==et&&this.constructor.render(e,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach((t=>{const e=document.createElement("style");e.textContent=t.cssText,this.renderRoot.appendChild(e)})))}render(){return et}}nt.finalized=!0,nt.render=(t,e,r)=>{if(!r||"object"!=typeof r||!r.scopeName)throw new Error("The `scopeName` option is required.");const i=r.scopeName,o=I.has(e),a=z&&11===e.nodeType&&!!e.host,s=a&&!V.has(i),l=s?document.createDocumentFragment():e;if(((t,e,r)=>{let i=I.get(e);void 0===i&&(n(e,e.firstChild),I.set(e,i=new C(Object.assign({templateFactory:N},r))),i.appendInto(e)),i.setValue(t),i.commit()})(t,l,Object.assign({templateFactory:H(i)},r)),s){const t=I.get(l);I.delete(l);const r=t.value instanceof y?t.value.template:void 0;Y(i,l,r),n(e,e.firstChild),e.appendChild(l),I.set(e,t)}!o&&a&&window.ShadyCSS.styleElement(e.host)};const rt={error:"fas fa-exclamation-circle",warning:"fas fa-exclamation-triangle",success:"fas fa-check-circle",info:"fas fa-info"};function it(){(null===document||void 0===document?void 0:document.querySelector("pb-messages")).fetchMessages()}let ot=class extends nt{constructor(){super(...arguments),this.url="",this.messages=[]}createRenderRoot(){return this}firstUpdated(){this.fetchMessages()}fetchMessages(){return fetch(this.url).then((t=>t.json())).then((t=>this.messages=t)).then((t=>{const e=this.querySelector(".pf-c-alert-group");t.forEach((t=>{const n=this.renderMessage(t);e.appendChild(n)}))}))}renderMessage(t){const e="pb-message"+Math.random().toString(36).substr(2,9);const n=document.createElement("template");return n.innerHTML=`
  • \n
    \n
    \n \n
    \n

    \n ${t.message}\n

    \n
    \n
  • `,setTimeout((()=>{var t;null===(t=this.querySelector("#"+e))||void 0===t||t.remove()}),1500),n.content.firstChild}render(){return W``}};t([Z()],ot.prototype,"url",void 0),t([Z()],ot.prototype,"messages",void 0),ot=t([$("pb-messages")],ot);const at=["pf-m-progress","pf-m-in-progress"];let st=class extends nt{constructor(){var t;super(),this.url="",this.isRunning=!1,null===(t=this.querySelector("button"))||void 0===t||t.addEventListener("click",(t=>this.callAction()))}setLoading(){this.isRunning=!0,this.classList.add(...at)}setDone(t){this.isRunning=!1,this.classList.remove(...at),this.classList.replace("pf-m-primary",t),it(),setTimeout((()=>{this.classList.replace(t,"pf-m-primary")}),1e3)}callAction(){if(!0===this.isRunning)return;this.setLoading();const t=function(t){let e=null;if(document.cookie&&""!==document.cookie){const n=document.cookie.split(";");for(let r=0;rt.json())).then((t=>{this.setDone("pf-m-success")})).catch((()=>{this.setDone("pf-m-danger")}))}render(){return W``}};t([Z()],st.prototype,"url",void 0),st=t([$("pb-action-button")],st);let lt=class extends nt{constructor(){super(),this.paths=[],this.activePath=window.location.hash.slice(1,1/0),window.addEventListener("hashchange",(t=>{this.activePath=window.location.hash.slice(1,1/0)})),this.querySelectorAll(".pf-c-nav__link").forEach((t=>{var e;let n=null===(e=t.attributes.getNamedItem("pb-url-prefix"))||void 0===e?void 0:e.value;if(!n){const e=new URL(t.href);if(""===e.hash)return void console.log("Ignoring "+t);n=`^${e.hash.slice(1,1/0)}$`}const r=RegExp(n);this.paths.push({anchor:t,match:r})}))}render(){return this.paths.forEach((t=>{t.match.exec(this.activePath)?t.anchor.classList.add("pf-m-current"):t.anchor.classList.remove("pf-m-current")})),W``}};t([Z()],lt.prototype,"activePath",void 0),lt=t([$("pb-admin-sidebar")],lt);"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function ut(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}function ct(t,e){return t(e={exports:{}},e.exports),e.exports}var dt=ct((function(t,e){t.exports=function(){var t=navigator.userAgent,e=navigator.platform,n=/gecko\/\d/i.test(t),r=/MSIE \d/.test(t),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(t),o=/Edge\/(\d+)/.exec(t),a=r||i||o,s=a&&(r?document.documentMode||6:+(o||i)[1]),l=!o&&/WebKit\//.test(t),u=l&&/Qt\/\d+\.\d+/.test(t),c=!o&&/Chrome\//.test(t),d=/Opera\//.test(t),h=/Apple Computer/.test(navigator.vendor),f=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(t),p=/PhantomJS/.test(t),g=!o&&/AppleWebKit/.test(t)&&/Mobile\/\w+/.test(t),m=/Android/.test(t),v=g||m||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(t),y=g||/Mac/.test(e),b=/\bCrOS\b/.test(t),x=/win/i.test(e),w=d&&t.match(/Version\/(\d*\.\d*)/);w&&(w=Number(w[1])),w&&w>=15&&(d=!1,l=!0);var _=y&&(u||d&&(null==w||w<12.11)),k=n||a&&s>=9;function S(t){return new RegExp("(^|\\s)"+t+"(?:$|\\s)\\s*")}var M,C=function(t,e){var n=t.className,r=S(e).exec(n);if(r){var i=n.slice(r.index+r[0].length);t.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function T(t){for(var e=t.childNodes.length;e>0;--e)t.removeChild(t.firstChild);return t}function D(t,e){return T(t).appendChild(e)}function L(t,e,n,r){var i=document.createElement(t);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof e)i.appendChild(document.createTextNode(e));else if(e)for(var o=0;o=e)return a+(e-o);a+=s-o,a+=n-a%n,o=s+1}}g?I=function(t){t.selectionStart=0,t.selectionEnd=t.value.length}:a&&(I=function(t){try{t.select()}catch(t){}});var z=function(){this.id=null,this.f=null,this.time=0,this.handler=R(this.onTimeout,this)};function H(t,e){for(var n=0;n=e)return r+Math.min(a,e-i);if(i+=o-r,r=o+1,(i+=n-i%n)>=e)return r}}var q=[""];function $(t){for(;q.length<=t;)q.push(K(q)+" ");return q[t]}function K(t){return t[t.length-1]}function Z(t,e){for(var n=[],r=0;r"€"&&(t.toUpperCase()!=t.toLowerCase()||tt.test(t))}function nt(t,e){return e?!!(e.source.indexOf("\\w")>-1&&et(t))||e.test(t):et(t)}function rt(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e])return!1;return!0}var it=/[\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 ot(t){return t.charCodeAt(0)>=768&&it.test(t)}function at(t,e,n){for(;(n<0?e>0:en?-1:1;;){if(e==n)return e;var i=(e+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==e)return t(o)?e:n;t(o)?n=o:e=o+r}}function lt(t,e,n,r){if(!t)return r(e,n,"ltr",0);for(var i=!1,o=0;oe||e==n&&a.to==e)&&(r(Math.max(a.from,e),Math.min(a.to,n),1==a.level?"rtl":"ltr",o),i=!0)}i||r(e,n,"ltr")}var ut=null;function ct(t,e,n){var r;ut=null;for(var i=0;ie)return i;o.to==e&&(o.from!=o.to&&"before"==n?r=i:ut=i),o.from==e&&(o.from!=o.to&&"before"!=n?r=i:ut=i)}return null!=r?r:ut}var dt=function(){var t="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",e="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(n){return n<=247?t.charAt(n):1424<=n&&n<=1524?"R":1536<=n&&n<=1785?e.charAt(n-1536):1774<=n&&n<=2220?"r":8192<=n&&n<=8203?"w":8204==n?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,o=/[LRr]/,a=/[Lb1n]/,s=/[1n]/;function l(t,e,n){this.level=t,this.from=e,this.to=n}return function(t,e){var u="ltr"==e?"L":"R";if(0==t.length||"ltr"==e&&!r.test(t))return!1;for(var c=t.length,d=[],h=0;h-1&&(r[e]=i.slice(0,o).concat(i.slice(o+1)))}}}function vt(t,e){var n=gt(t,e);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i0}function wt(t){t.prototype.on=function(t,e){pt(this,t,e)},t.prototype.off=function(t,e){mt(this,t,e)}}function _t(t){t.preventDefault?t.preventDefault():t.returnValue=!1}function kt(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0}function St(t){return null!=t.defaultPrevented?t.defaultPrevented:0==t.returnValue}function Mt(t){_t(t),kt(t)}function Ct(t){return t.target||t.srcElement}function Tt(t){var e=t.which;return null==e&&(1&t.button?e=1:2&t.button?e=3:4&t.button&&(e=2)),y&&t.ctrlKey&&1==e&&(e=3),e}var Dt,Lt,Pt=function(){if(a&&s<9)return!1;var t=L("div");return"draggable"in t||"dragDrop"in t}();function At(t){if(null==Dt){var e=L("span","​");D(t,L("span",[e,document.createTextNode("x")])),0!=t.firstChild.offsetHeight&&(Dt=e.offsetWidth<=1&&e.offsetHeight>2&&!(a&&s<8))}var n=Dt?L("span","​"):L("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Ot(t){if(null!=Lt)return Lt;var e=D(t,document.createTextNode("AخA")),n=M(e,0,1).getBoundingClientRect(),r=M(e,1,2).getBoundingClientRect();return T(t),!(!n||n.left==n.right)&&(Lt=r.right-n.right<3)}var Nt,Ft=3!="\n\nb".split(/\n/).length?function(t){for(var e=0,n=[],r=t.length;e<=r;){var i=t.indexOf("\n",e);-1==i&&(i=t.length);var o=t.slice(e,"\r"==t.charAt(i-1)?i-1:i),a=o.indexOf("\r");-1!=a?(n.push(o.slice(0,a)),e+=a+1):(n.push(o),e=i+1)}return n}:function(t){return t.split(/\r\n?|\n/)},It=window.getSelection?function(t){try{return t.selectionStart!=t.selectionEnd}catch(t){return!1}}:function(t){var e;try{e=t.ownerDocument.selection.createRange()}catch(t){}return!(!e||e.parentElement()!=t)&&0!=e.compareEndPoints("StartToEnd",e)},Rt="oncopy"in(Nt=L("div"))||(Nt.setAttribute("oncopy","return;"),"function"==typeof Nt.oncopy),Wt=null;function Et(t){if(null!=Wt)return Wt;var e=D(t,L("span","x")),n=e.getBoundingClientRect(),r=M(e,0,1).getBoundingClientRect();return Wt=Math.abs(n.left-r.left)>1}var zt={},Ht={};function Bt(t,e){arguments.length>2&&(e.dependencies=Array.prototype.slice.call(arguments,2)),zt[t]=e}function Vt(t,e){Ht[t]=e}function Yt(t){if("string"==typeof t&&Ht.hasOwnProperty(t))t=Ht[t];else if(t&&"string"==typeof t.name&&Ht.hasOwnProperty(t.name)){var e=Ht[t.name];"string"==typeof e&&(e={name:e}),(t=Q(e,t)).name=e.name}else{if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return Yt("application/xml");if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+json$/.test(t))return Yt("application/json")}return"string"==typeof t?{name:t}:t||{name:"null"}}function Ut(t,e){e=Yt(e);var n=zt[e.name];if(!n)return Ut(t,"text/plain");var r=n(t,e);if(jt.hasOwnProperty(e.name)){var i=jt[e.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=e.name,e.helperType&&(r.helperType=e.helperType),e.modeProps)for(var a in e.modeProps)r[a]=e.modeProps[a];return r}var jt={};function Gt(t,e){W(e,jt.hasOwnProperty(t)?jt[t]:jt[t]={})}function qt(t,e){if(!0===e)return e;if(t.copyState)return t.copyState(e);var n={};for(var r in e){var i=e[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function $t(t,e){for(var n;t.innerMode&&(n=t.innerMode(e))&&n.mode!=t;)e=n.state,t=n.mode;return n||{mode:t,state:e}}function Kt(t,e,n){return!t.startState||t.startState(e,n)}var Zt=function(t,e,n){this.pos=this.start=0,this.string=t,this.tabSize=e||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};function Xt(t,e){if((e-=t.first)<0||e>=t.size)throw new Error("There is no line "+(e+t.first)+" in the document.");for(var n=t;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(e=t.first&&en?oe(n,Xt(t,n).text.length):fe(e,Xt(t,e.line).text.length)}function fe(t,e){var n=t.ch;return null==n||n>e?oe(t.line,e):n<0?oe(t.line,0):t}function pe(t,e){for(var n=[],r=0;r=this.string.length},Zt.prototype.sol=function(){return this.pos==this.lineStart},Zt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Zt.prototype.next=function(){if(this.pose},Zt.prototype.eatSpace=function(){for(var t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t},Zt.prototype.skipToEnd=function(){this.pos=this.string.length},Zt.prototype.skipTo=function(t){var e=this.string.indexOf(t,this.pos);if(e>-1)return this.pos=e,!0},Zt.prototype.backUp=function(t){this.pos-=t},Zt.prototype.column=function(){return this.lastColumnPos0?null:(r&&!1!==e&&(this.pos+=r[0].length),r)}var i=function(t){return n?t.toLowerCase():t};if(i(this.string.substr(this.pos,t.length))==i(t))return!1!==e&&(this.pos+=t.length),!0},Zt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Zt.prototype.hideFirstChars=function(t,e){this.lineStart+=t;try{return e()}finally{this.lineStart-=t}},Zt.prototype.lookAhead=function(t){var e=this.lineOracle;return e&&e.lookAhead(t)},Zt.prototype.baseToken=function(){var t=this.lineOracle;return t&&t.baseToken(this.pos)};var ge=function(t,e){this.state=t,this.lookAhead=e},me=function(t,e,n,r){this.state=e,this.doc=t,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};function ve(t,e,n,r){var i=[t.state.modeGen],o={};Ce(t,e.text,t.doc.mode,n,(function(t,e){return i.push(t,e)}),o,r);for(var a=n.state,s=function(r){n.baseTokens=i;var s=t.state.overlays[r],l=1,u=0;n.state=!0,Ce(t,e.text,s.mode,n,(function(t,e){for(var n=l;ut&&i.splice(l,1,t,i[l+1],r),l+=2,u=Math.min(t,r)}if(e)if(s.opaque)i.splice(n,l-n,t,"overlay "+e),l=n+2;else for(;nt.options.maxHighlightLength&&qt(t.doc.mode,r.state),o=ve(t,e,r);i&&(r.state=i),e.stateAfter=r.save(!i),e.styles=o.styles,o.classes?e.styleClasses=o.classes:e.styleClasses&&(e.styleClasses=null),n===t.doc.highlightFrontier&&(t.doc.modeFrontier=Math.max(t.doc.modeFrontier,++t.doc.highlightFrontier))}return e.styles}function be(t,e,n){var r=t.doc,i=t.display;if(!r.mode.startState)return new me(r,!0,e);var o=Te(t,e,n),a=o>r.first&&Xt(r,o-1).stateAfter,s=a?me.fromSaved(r,a,o):new me(r,Kt(r.mode),o);return r.iter(o,e,(function(n){xe(t,n.text,s);var r=s.line;n.stateAfter=r==e-1||r%5==0||r>=i.viewFrom&&re.start)return o}throw new Error("Mode "+t.name+" failed to advance stream.")}me.prototype.lookAhead=function(t){var e=this.doc.getLine(this.line+t);return null!=e&&t>this.maxLookAhead&&(this.maxLookAhead=t),e},me.prototype.baseToken=function(t){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=t;)this.baseTokenPos+=2;var e=this.baseTokens[this.baseTokenPos+1];return{type:e&&e.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-t}},me.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},me.fromSaved=function(t,e,n){return e instanceof ge?new me(t,qt(t.mode,e.state),n,e.lookAhead):new me(t,qt(t.mode,e),n)},me.prototype.save=function(t){var e=!1!==t?qt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ge(e,this.maxLookAhead):e};var ke=function(t,e,n){this.start=t.start,this.end=t.pos,this.string=t.current(),this.type=e||null,this.state=n};function Se(t,e,n,r){var i,o,a=t.doc,s=a.mode,l=Xt(a,(e=he(a,e)).line),u=be(t,e.line,n),c=new Zt(l.text,t.options.tabSize,u);for(r&&(o=[]);(r||c.post.options.maxHighlightLength?(s=!1,a&&xe(t,e,r,d.pos),d.pos=e.length,l=null):l=Me(_e(n,d,r.state,h),o),h){var f=h[0].name;f&&(l="m-"+(l?f+" "+l:f))}if(!s||c!=l){for(;ua;--s){if(s<=o.first)return o.first;var l=Xt(o,s-1),u=l.stateAfter;if(u&&(!n||s+(u instanceof ge?u.lookAhead:0)<=o.modeFrontier))return s;var c=E(l.text,null,t.options.tabSize);(null==i||r>c)&&(i=s-1,r=c)}return i}function De(t,e){if(t.modeFrontier=Math.min(t.modeFrontier,e),!(t.highlightFrontiern;r--){var i=Xt(t,r).stateAfter;if(i&&(!(i instanceof ge)||r+i.lookAhead=e:o.to>e);(r||(r=[])).push(new Ne(a,o.from,s?null:o.to))}}return r}function Ee(t,e,n){var r;if(t)for(var i=0;i=e:o.to>e)||o.from==e&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=e:o.from0&&s)for(var b=0;b0)){var c=[l,1],d=ae(u.from,s.from),h=ae(u.to,s.to);(d<0||!a.inclusiveLeft&&!d)&&c.push({from:u.from,to:s.from}),(h>0||!a.inclusiveRight&&!h)&&c.push({from:s.to,to:u.to}),i.splice.apply(i,c),l+=c.length-3}}return i}function Ve(t){var e=t.markedSpans;if(e){for(var n=0;ne)&&(!n||Ge(n,o.marker)<0)&&(n=o.marker)}return n}function Xe(t,e,n,r,i){var o=Xt(t,e),a=Pe&&o.markedSpans;if(a)for(var s=0;s=0&&d<=0||c<=0&&d>=0)&&(c<=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?ae(u.to,n)>=0:ae(u.to,n)>0)||c>=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?ae(u.from,r)<=0:ae(u.from,r)<0)))return!0}}}function Je(t){for(var e;e=$e(t);)t=e.find(-1,!0).line;return t}function Qe(t){for(var e;e=Ke(t);)t=e.find(1,!0).line;return t}function tn(t){for(var e,n;e=Ke(t);)t=e.find(1,!0).line,(n||(n=[])).push(t);return n}function en(t,e){var n=Xt(t,e),r=Je(n);return n==r?e:ee(r)}function nn(t,e){if(e>t.lastLine())return e;var n,r=Xt(t,e);if(!rn(t,r))return e;for(;n=Ke(r);)r=n.find(1,!0).line;return ee(r)+1}function rn(t,e){var n=Pe&&e.markedSpans;if(n)for(var r=void 0,i=0;ie.maxLineLength&&(e.maxLineLength=n,e.maxLine=t)}))}var un=function(t,e,n){this.text=t,Ye(this,e),this.height=n?n(this):1};function cn(t,e,n,r){t.text=e,t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null),null!=t.order&&(t.order=null),Ve(t),Ye(t,n);var i=r?r(t):1;i!=t.height&&te(t,i)}function dn(t){t.parent=null,Ve(t)}un.prototype.lineNo=function(){return ee(this)},wt(un);var hn={},fn={};function pn(t,e){if(!t||/^\s*$/.test(t))return null;var n=e.addModeClass?fn:hn;return n[t]||(n[t]=t.replace(/\S+/g,"cm-$&"))}function gn(t,e){var n=P("span",null,null,l?"padding-right: .1px":null),r={pre:P("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:t,trailingSpace:!1,splitSpaces:t.getOption("lineWrapping")};e.measure={};for(var i=0;i<=(e.rest?e.rest.length:0);i++){var o=i?e.rest[i-1]:e.line,a=void 0;r.pos=0,r.addToken=vn,Ot(t.display.measure)&&(a=ht(o,t.doc.direction))&&(r.addToken=bn(r.addToken,a)),r.map=[],wn(o,r,ye(t,o,e!=t.display.externalMeasured&&ee(o))),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=F(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=F(o.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(At(t.display.measure))),0==i?(e.measure.map=r.map,e.measure.cache={}):((e.measure.maps||(e.measure.maps=[])).push(r.map),(e.measure.caches||(e.measure.caches=[])).push({}))}if(l){var s=r.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return vt(t,"renderLine",t,e.line,r.pre),r.pre.className&&(r.textClass=F(r.pre.className,r.textClass||"")),r}function mn(t){var e=L("span","•","cm-invalidchar");return e.title="\\u"+t.charCodeAt(0).toString(16),e.setAttribute("aria-label",e.title),e}function vn(t,e,n,r,i,o,l){if(e){var u,c=t.splitSpaces?yn(e,t.trailingSpace):e,d=t.cm.state.specialChars,h=!1;if(d.test(e)){u=document.createDocumentFragment();for(var f=0;;){d.lastIndex=f;var p=d.exec(e),g=p?p.index-f:e.length-f;if(g){var m=document.createTextNode(c.slice(f,f+g));a&&s<9?u.appendChild(L("span",[m])):u.appendChild(m),t.map.push(t.pos,t.pos+g,m),t.col+=g,t.pos+=g}if(!p)break;f+=g+1;var v=void 0;if("\t"==p[0]){var y=t.cm.options.tabSize,b=y-t.col%y;(v=u.appendChild(L("span",$(b),"cm-tab"))).setAttribute("role","presentation"),v.setAttribute("cm-text","\t"),t.col+=b}else"\r"==p[0]||"\n"==p[0]?((v=u.appendChild(L("span","\r"==p[0]?"␍":"␤","cm-invalidchar"))).setAttribute("cm-text",p[0]),t.col+=1):((v=t.cm.options.specialCharPlaceholder(p[0])).setAttribute("cm-text",p[0]),a&&s<9?u.appendChild(L("span",[v])):u.appendChild(v),t.col+=1);t.map.push(t.pos,t.pos+1,v),t.pos++}}else t.col+=e.length,u=document.createTextNode(c),t.map.push(t.pos,t.pos+e.length,u),a&&s<9&&(h=!0),t.pos+=e.length;if(t.trailingSpace=32==c.charCodeAt(e.length-1),n||r||i||h||o||l){var x=n||"";r&&(x+=r),i&&(x+=i);var w=L("span",[u],x,o);if(l)for(var _ in l)l.hasOwnProperty(_)&&"style"!=_&&"class"!=_&&w.setAttribute(_,l[_]);return t.content.appendChild(w)}t.content.appendChild(u)}}function yn(t,e){if(t.length>1&&!/ /.test(t))return t;for(var n=e,r="",i=0;iu&&d.from<=u);h++);if(d.to>=c)return t(n,r,i,o,a,s,l);t(n,r.slice(0,d.to-u),i,o,null,s,l),o=null,r=r.slice(d.to-u),u=d.to}}}function xn(t,e,n,r){var i=!r&&n.widgetNode;i&&t.map.push(t.pos,t.pos+e,i),!r&&t.cm.display.input.needsContentAttribute&&(i||(i=t.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(t.cm.display.input.setUneditable(i),t.content.appendChild(i)),t.pos+=e,t.trailingSpace=!1}function wn(t,e,n){var r=t.markedSpans,i=t.text,o=0;if(r)for(var a,s,l,u,c,d,h,f=i.length,p=0,g=1,m="",v=0;;){if(v==p){l=u=c=s="",h=null,d=null,v=1/0;for(var y=[],b=void 0,x=0;xp||_.collapsed&&w.to==p&&w.from==p)){if(null!=w.to&&w.to!=p&&v>w.to&&(v=w.to,u=""),_.className&&(l+=" "+_.className),_.css&&(s=(s?s+";":"")+_.css),_.startStyle&&w.from==p&&(c+=" "+_.startStyle),_.endStyle&&w.to==v&&(b||(b=[])).push(_.endStyle,w.to),_.title&&((h||(h={})).title=_.title),_.attributes)for(var k in _.attributes)(h||(h={}))[k]=_.attributes[k];_.collapsed&&(!d||Ge(d.marker,_)<0)&&(d=w)}else w.from>p&&v>w.from&&(v=w.from)}if(b)for(var S=0;S=f)break;for(var C=Math.min(f,v);;){if(m){var T=p+m.length;if(!d){var D=T>C?m.slice(0,C-p):m;e.addToken(e,D,a?a+l:l,c,p+D.length==v?u:"",s,h)}if(T>=C){m=m.slice(C-p),p=C;break}p=T,c=""}m=i.slice(o,o=n[g++]),a=pn(n[g++],e.cm.options)}}else for(var L=1;L2&&o.push((l.bottom+u.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Jn(t,e,n){if(t.line==e)return{map:t.measure.map,cache:t.measure.cache};for(var r=0;rn)return{map:t.measure.maps[i],cache:t.measure.caches[i],before:!0}}function Qn(t,e){var n=ee(e=Je(e)),r=t.display.externalMeasured=new _n(t.doc,e,n);r.lineN=n;var i=r.built=gn(t,r);return r.text=i.pre,D(t.display.lineMeasure,i.pre),r}function tr(t,e,n,r){return rr(t,nr(t,e),n,r)}function er(t,e){if(e>=t.display.viewFrom&&e=n.lineN&&ee)&&(i=(o=l-s)-1,e>=l&&(a="right")),null!=i){if(r=t[u+2],s==l&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==i)for(;u&&t[u-2]==t[u-3]&&t[u-1].insertLeft;)r=t[2+(u-=3)],a="left";if("right"==n&&i==l-s)for(;u=0&&(n=t[i]).left==n.right;i--);return n}function lr(t,e,n,r){var i,o=ar(e.map,n,r),l=o.node,u=o.start,c=o.end,d=o.collapse;if(3==l.nodeType){for(var h=0;h<4;h++){for(;u&&ot(e.line.text.charAt(o.coverStart+u));)--u;for(;o.coverStart+c0&&(d=r="right"),i=t.options.lineWrapping&&(f=l.getClientRects()).length>1?f["right"==r?f.length-1:0]:l.getBoundingClientRect()}if(a&&s<9&&!u&&(!i||!i.left&&!i.right)){var p=l.parentNode.getClientRects()[0];i=p?{left:p.left,right:p.left+Pr(t.display),top:p.top,bottom:p.bottom}:or}for(var g=i.top-e.rect.top,m=i.bottom-e.rect.top,v=(g+m)/2,y=e.view.measure.heights,b=0;b=r.text.length?(l=r.text.length,u="before"):l<=0&&(l=0,u="after"),!s)return a("before"==u?l-1:l,"before"==u);function c(t,e,n){return a(n?t-1:t,1==s[e].level!=n)}var d=ct(s,l,u),h=ut,f=c(l,d,"before"==u);return null!=h&&(f.other=c(l,h,"before"!=u)),f}function xr(t,e){var n=0;e=he(t.doc,e),t.options.lineWrapping||(n=Pr(t.display)*e.ch);var r=Xt(t.doc,e.line),i=an(r)+jn(t.display);return{left:n,right:n,top:i,bottom:i+r.height}}function wr(t,e,n,r,i){var o=oe(t,e,n);return o.xRel=i,r&&(o.outside=r),o}function _r(t,e,n){var r=t.doc;if((n+=t.display.viewOffset)<0)return wr(r.first,0,null,-1,-1);var i=ne(r,n),o=r.first+r.size-1;if(i>o)return wr(r.first+r.size-1,Xt(r,o).text.length,null,1,1);e<0&&(e=0);for(var a=Xt(r,i);;){var s=Cr(t,a,i,e,n),l=Ze(a,s.ch+(s.xRel>0||s.outside>0?1:0));if(!l)return s;var u=l.find(1);if(u.line==i)return u;a=Xt(r,i=u.line)}}function kr(t,e,n,r){r-=gr(e);var i=e.text.length,o=st((function(e){return rr(t,n,e-1).bottom<=r}),i,0);return{begin:o,end:i=st((function(e){return rr(t,n,e).top>r}),o,i)}}function Sr(t,e,n,r){return n||(n=nr(t,e)),kr(t,e,n,mr(t,e,rr(t,n,r),"line").top)}function Mr(t,e,n,r){return!(t.bottom<=n)&&(t.top>n||(r?t.left:t.right)>e)}function Cr(t,e,n,r,i){i-=an(e);var o=nr(t,e),a=gr(e),s=0,l=e.text.length,u=!0,c=ht(e,t.doc.direction);if(c){var d=(t.options.lineWrapping?Dr:Tr)(t,e,n,o,c,r,i);s=(u=1!=d.level)?d.from:d.to-1,l=u?d.to:d.from-1}var h,f,p=null,g=null,m=st((function(e){var n=rr(t,o,e);return n.top+=a,n.bottom+=a,!!Mr(n,r,i,!1)&&(n.top<=i&&n.left<=r&&(p=e,g=n),!0)}),s,l),v=!1;if(g){var y=r-g.left=x.bottom?1:0}return wr(n,m=at(e.text,m,1),f,v,r-h)}function Tr(t,e,n,r,i,o,a){var s=st((function(s){var l=i[s],u=1!=l.level;return Mr(br(t,oe(n,u?l.to:l.from,u?"before":"after"),"line",e,r),o,a,!0)}),0,i.length-1),l=i[s];if(s>0){var u=1!=l.level,c=br(t,oe(n,u?l.from:l.to,u?"after":"before"),"line",e,r);Mr(c,o,a,!0)&&c.top>a&&(l=i[s-1])}return l}function Dr(t,e,n,r,i,o,a){var s=kr(t,e,r,a),l=s.begin,u=s.end;/\s/.test(e.text.charAt(u-1))&&u--;for(var c=null,d=null,h=0;h=u||f.to<=l)){var p=rr(t,r,1!=f.level?Math.min(u,f.to)-1:Math.max(l,f.from)).right,g=pg)&&(c=f,d=g)}}return c||(c=i[i.length-1]),c.fromu&&(c={from:c.from,to:u,level:c.level}),c}function Lr(t){if(null!=t.cachedTextHeight)return t.cachedTextHeight;if(null==ir){ir=L("pre",null,"CodeMirror-line-like");for(var e=0;e<49;++e)ir.appendChild(document.createTextNode("x")),ir.appendChild(L("br"));ir.appendChild(document.createTextNode("x"))}D(t.measure,ir);var n=ir.offsetHeight/50;return n>3&&(t.cachedTextHeight=n),T(t.measure),n||1}function Pr(t){if(null!=t.cachedCharWidth)return t.cachedCharWidth;var e=L("span","xxxxxxxxxx"),n=L("pre",[e],"CodeMirror-line-like");D(t.measure,n);var r=e.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(t.cachedCharWidth=i),i||10}function Ar(t){for(var e=t.display,n={},r={},i=e.gutters.clientLeft,o=e.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var s=t.display.gutterSpecs[a].className;n[s]=o.offsetLeft+o.clientLeft+i,r[s]=o.clientWidth}return{fixedPos:Or(e),gutterTotalWidth:e.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:e.wrapper.clientWidth}}function Or(t){return t.scroller.getBoundingClientRect().left-t.sizer.getBoundingClientRect().left}function Nr(t){var e=Lr(t.display),n=t.options.lineWrapping,r=n&&Math.max(5,t.display.scroller.clientWidth/Pr(t.display)-3);return function(i){if(rn(t.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a0&&(l=Xt(t.doc,u.line).text).length==u.ch){var c=E(l,l.length,t.options.tabSize)-l.length;u=oe(u.line,Math.max(0,Math.round((o-qn(t.display).left)/Pr(t.display))-c))}return u}function Rr(t,e){if(e>=t.display.viewTo)return null;if((e-=t.display.viewFrom)<0)return null;for(var n=t.display.view,r=0;re)&&(i.updateLineNumbers=e),t.curOp.viewChanged=!0,e>=i.viewTo)Pe&&en(t.doc,e)i.viewFrom?zr(t):(i.viewFrom+=r,i.viewTo+=r);else if(e<=i.viewFrom&&n>=i.viewTo)zr(t);else if(e<=i.viewFrom){var o=Hr(t,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):zr(t)}else if(n>=i.viewTo){var a=Hr(t,e,e,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):zr(t)}else{var s=Hr(t,e,e,-1),l=Hr(t,n,n+r,1);s&&l?(i.view=i.view.slice(0,s.index).concat(kn(t,s.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=r):zr(t)}var u=i.externalMeasured;u&&(n=i.lineN&&e=r.viewTo)){var o=r.view[Rr(t,e)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==H(a,n)&&a.push(n)}}}function zr(t){t.display.viewFrom=t.display.viewTo=t.doc.first,t.display.view=[],t.display.viewOffset=0}function Hr(t,e,n,r){var i,o=Rr(t,e),a=t.display.view;if(!Pe||n==t.doc.first+t.doc.size)return{index:o,lineN:n};for(var s=t.display.viewFrom,l=0;l0){if(o==a.length-1)return null;i=s+a[o].size-e,o++}else i=s-e;e+=i,n+=i}for(;en(t.doc,n)!=n;){if(o==(r<0?0:a.length-1))return null;n+=r*a[o-(r<0?1:0)].size,o+=r}return{index:o,lineN:n}}function Br(t,e,n){var r=t.display;0==r.view.length||e>=r.viewTo||n<=r.viewFrom?(r.view=kn(t,e,n),r.viewFrom=e):(r.viewFrom>e?r.view=kn(t,e,r.viewFrom).concat(r.view):r.viewFromn&&(r.view=r.view.slice(0,Rr(t,n)))),r.viewTo=n}function Vr(t){for(var e=t.display.view,n=0,r=0;r=t.display.viewTo||s.to().line0?e.blinker=setInterval((function(){t.hasFocus()||Jr(t),e.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),t.options.cursorBlinkRate):t.options.cursorBlinkRate<0&&(e.cursorDiv.style.visibility="hidden")}}function Kr(t){t.hasFocus()||(t.display.input.focus(),t.state.focused||Xr(t))}function Zr(t){t.state.delayingBlurEvent=!0,setTimeout((function(){t.state.delayingBlurEvent&&(t.state.delayingBlurEvent=!1,t.state.focused&&Jr(t))}),100)}function Xr(t,e){t.state.delayingBlurEvent&&!t.state.draggingText&&(t.state.delayingBlurEvent=!1),"nocursor"!=t.options.readOnly&&(t.state.focused||(vt(t,"focus",t,e),t.state.focused=!0,N(t.display.wrapper,"CodeMirror-focused"),t.curOp||t.display.selForContextMenu==t.doc.sel||(t.display.input.reset(),l&&setTimeout((function(){return t.display.input.reset(!0)}),20)),t.display.input.receivedFocus()),$r(t))}function Jr(t,e){t.state.delayingBlurEvent||(t.state.focused&&(vt(t,"blur",t,e),t.state.focused=!1,C(t.display.wrapper,"CodeMirror-focused")),clearInterval(t.display.blinker),setTimeout((function(){t.state.focused||(t.display.shift=!1)}),150))}function Qr(t){for(var e=t.display,n=e.lineDiv.offsetTop,r=0;r.005||h<-.005)&&(te(i.line,l),ti(i.line),i.rest))for(var f=0;ft.display.sizerWidth){var p=Math.ceil(u/Pr(t.display));p>t.display.maxLineLength&&(t.display.maxLineLength=p,t.display.maxLine=i.line,t.display.maxLineChanged=!0)}}}}function ti(t){if(t.widgets)for(var e=0;e=a&&(o=ne(e,an(Xt(e,l))-t.wrapper.clientHeight),a=l)}return{from:o,to:Math.max(a,o+1)}}function ni(t,e){if(!yt(t,"scrollCursorIntoView")){var n=t.display,r=n.sizer.getBoundingClientRect(),i=null;if(e.top+r.top<0?i=!0:e.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!p){var o=L("div","​",null,"position: absolute;\n top: "+(e.top-n.viewOffset-jn(t.display))+"px;\n height: "+(e.bottom-e.top+$n(t)+n.barHeight)+"px;\n left: "+e.left+"px; width: "+Math.max(2,e.right-e.left)+"px;");t.display.lineSpace.appendChild(o),o.scrollIntoView(i),t.display.lineSpace.removeChild(o)}}}function ri(t,e,n,r){var i;null==r&&(r=0),t.options.lineWrapping||e!=n||(n="before"==(e=e.ch?oe(e.line,"before"==e.sticky?e.ch-1:e.ch,"after"):e).sticky?oe(e.line,e.ch+1,"before"):e);for(var o=0;o<5;o++){var a=!1,s=br(t,e),l=n&&n!=e?br(t,n):s,u=oi(t,i={left:Math.min(s.left,l.left),top:Math.min(s.top,l.top)-r,right:Math.max(s.left,l.left),bottom:Math.max(s.bottom,l.bottom)+r}),c=t.doc.scrollTop,d=t.doc.scrollLeft;if(null!=u.scrollTop&&(hi(t,u.scrollTop),Math.abs(t.doc.scrollTop-c)>1&&(a=!0)),null!=u.scrollLeft&&(pi(t,u.scrollLeft),Math.abs(t.doc.scrollLeft-d)>1&&(a=!0)),!a)break}return i}function ii(t,e){var n=oi(t,e);null!=n.scrollTop&&hi(t,n.scrollTop),null!=n.scrollLeft&&pi(t,n.scrollLeft)}function oi(t,e){var n=t.display,r=Lr(t.display);e.top<0&&(e.top=0);var i=t.curOp&&null!=t.curOp.scrollTop?t.curOp.scrollTop:n.scroller.scrollTop,o=Zn(t),a={};e.bottom-e.top>o&&(e.bottom=e.top+o);var s=t.doc.height+Gn(n),l=e.tops-r;if(e.topi+o){var c=Math.min(e.top,(u?s:e.bottom)-o);c!=i&&(a.scrollTop=c)}var d=t.options.fixedGutter?0:n.gutters.offsetWidth,h=t.curOp&&null!=t.curOp.scrollLeft?t.curOp.scrollLeft:n.scroller.scrollLeft-d,f=Kn(t)-n.gutters.offsetWidth,p=e.right-e.left>f;return p&&(e.right=e.left+f),e.left<10?a.scrollLeft=0:e.leftf+h-3&&(a.scrollLeft=e.right+(p?0:10)-f),a}function ai(t,e){null!=e&&(ci(t),t.curOp.scrollTop=(null==t.curOp.scrollTop?t.doc.scrollTop:t.curOp.scrollTop)+e)}function si(t){ci(t);var e=t.getCursor();t.curOp.scrollToPos={from:e,to:e,margin:t.options.cursorScrollMargin}}function li(t,e,n){null==e&&null==n||ci(t),null!=e&&(t.curOp.scrollLeft=e),null!=n&&(t.curOp.scrollTop=n)}function ui(t,e){ci(t),t.curOp.scrollToPos=e}function ci(t){var e=t.curOp.scrollToPos;e&&(t.curOp.scrollToPos=null,di(t,xr(t,e.from),xr(t,e.to),e.margin))}function di(t,e,n,r){var i=oi(t,{left:Math.min(e.left,n.left),top:Math.min(e.top,n.top)-r,right:Math.max(e.right,n.right),bottom:Math.max(e.bottom,n.bottom)+r});li(t,i.scrollLeft,i.scrollTop)}function hi(t,e){Math.abs(t.doc.scrollTop-e)<2||(n||Yi(t,{top:e}),fi(t,e,!0),n&&Yi(t),Ii(t,100))}function fi(t,e,n){e=Math.max(0,Math.min(t.display.scroller.scrollHeight-t.display.scroller.clientHeight,e)),(t.display.scroller.scrollTop!=e||n)&&(t.doc.scrollTop=e,t.display.scrollbars.setScrollTop(e),t.display.scroller.scrollTop!=e&&(t.display.scroller.scrollTop=e))}function pi(t,e,n,r){e=Math.max(0,Math.min(e,t.display.scroller.scrollWidth-t.display.scroller.clientWidth)),(n?e==t.doc.scrollLeft:Math.abs(t.doc.scrollLeft-e)<2)&&!r||(t.doc.scrollLeft=e,qi(t),t.display.scroller.scrollLeft!=e&&(t.display.scroller.scrollLeft=e),t.display.scrollbars.setScrollLeft(e))}function gi(t){var e=t.display,n=e.gutters.offsetWidth,r=Math.round(t.doc.height+Gn(t.display));return{clientHeight:e.scroller.clientHeight,viewHeight:e.wrapper.clientHeight,scrollWidth:e.scroller.scrollWidth,clientWidth:e.scroller.clientWidth,viewWidth:e.wrapper.clientWidth,barLeft:t.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+$n(t)+e.barHeight,nativeBarWidth:e.nativeBarWidth,gutterWidth:n}}var mi=function(t,e,n){this.cm=n;var r=this.vert=L("div",[L("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=L("div",[L("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,t(r),t(i),pt(r,"scroll",(function(){r.clientHeight&&e(r.scrollTop,"vertical")})),pt(i,"scroll",(function(){i.clientWidth&&e(i.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,a&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};mi.prototype.update=function(t){var e=t.scrollWidth>t.clientWidth+1,n=t.scrollHeight>t.clientHeight+1,r=t.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=e?r+"px":"0";var i=t.viewHeight-(e?r:0);this.vert.firstChild.style.height=Math.max(0,t.scrollHeight-t.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(e){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=t.barLeft+"px";var o=t.viewWidth-t.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,t.scrollWidth-t.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&t.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:e?r:0}},mi.prototype.setScrollLeft=function(t){this.horiz.scrollLeft!=t&&(this.horiz.scrollLeft=t),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},mi.prototype.setScrollTop=function(t){this.vert.scrollTop!=t&&(this.vert.scrollTop=t),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},mi.prototype.zeroWidthHack=function(){var t=y&&!f?"12px":"18px";this.horiz.style.height=this.vert.style.width=t,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new z,this.disableVert=new z},mi.prototype.enableZeroWidthBar=function(t,e,n){function r(){var i=t.getBoundingClientRect();("vert"==n?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))!=t?t.style.pointerEvents="none":e.set(1e3,r)}t.style.pointerEvents="auto",e.set(1e3,r)},mi.prototype.clear=function(){var t=this.horiz.parentNode;t.removeChild(this.horiz),t.removeChild(this.vert)};var vi=function(){};function yi(t,e){e||(e=gi(t));var n=t.display.barWidth,r=t.display.barHeight;bi(t,e);for(var i=0;i<4&&n!=t.display.barWidth||r!=t.display.barHeight;i++)n!=t.display.barWidth&&t.options.lineWrapping&&Qr(t),bi(t,gi(t)),n=t.display.barWidth,r=t.display.barHeight}function bi(t,e){var n=t.display,r=n.scrollbars.update(e);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&&t.options.coverGutterNextToScrollbar&&t.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=e.gutterWidth+"px"):n.gutterFiller.style.display=""}vi.prototype.update=function(){return{bottom:0,right:0}},vi.prototype.setScrollLeft=function(){},vi.prototype.setScrollTop=function(){},vi.prototype.clear=function(){};var xi={native:mi,null:vi};function wi(t){t.display.scrollbars&&(t.display.scrollbars.clear(),t.display.scrollbars.addClass&&C(t.display.wrapper,t.display.scrollbars.addClass)),t.display.scrollbars=new xi[t.options.scrollbarStyle]((function(e){t.display.wrapper.insertBefore(e,t.display.scrollbarFiller),pt(e,"mousedown",(function(){t.state.focused&&setTimeout((function(){return t.display.input.focus()}),0)})),e.setAttribute("cm-not-content","true")}),(function(e,n){"horizontal"==n?pi(t,e):hi(t,e)}),t),t.display.scrollbars.addClass&&N(t.display.wrapper,t.display.scrollbars.addClass)}var _i=0;function ki(t){t.curOp={cm:t,viewChanged:!1,startHeight:t.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:++_i},Mn(t.curOp)}function Si(t){var e=t.curOp;e&&Tn(e,(function(t){for(var e=0;e=n.viewTo)||n.maxLineChanged&&e.options.lineWrapping,t.update=t.mustUpdate&&new Wi(e,t.mustUpdate&&{top:t.scrollTop,ensure:t.scrollToPos},t.forceUpdate)}function Ti(t){t.updatedDisplay=t.mustUpdate&&Bi(t.cm,t.update)}function Di(t){var e=t.cm,n=e.display;t.updatedDisplay&&Qr(e),t.barMeasure=gi(e),n.maxLineChanged&&!e.options.lineWrapping&&(t.adjustWidthTo=tr(e,n.maxLine,n.maxLine.text.length).left+3,e.display.sizerWidth=t.adjustWidthTo,t.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+t.adjustWidthTo+$n(e)+e.display.barWidth),t.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+t.adjustWidthTo-Kn(e))),(t.updatedDisplay||t.selectionChanged)&&(t.preparedSelection=n.input.prepareSelection())}function Li(t){var e=t.cm;null!=t.adjustWidthTo&&(e.display.sizer.style.minWidth=t.adjustWidthTo+"px",t.maxScrollLeft=t.display.viewTo)){var n=+new Date+t.options.workTime,r=be(t,e.highlightFrontier),i=[];e.iter(r.line,Math.min(e.first+e.size,t.display.viewTo+500),(function(o){if(r.line>=t.display.viewFrom){var a=o.styles,s=o.text.length>t.options.maxHighlightLength?qt(e.mode,r.state):null,l=ve(t,o,r,!0);s&&(r.state=s),o.styles=l.styles;var u=o.styleClasses,c=l.classes;c?o.styleClasses=c:u&&(o.styleClasses=null);for(var d=!a||a.length!=o.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass),h=0;!d&&hn)return Ii(t,t.options.workDelay),!0})),e.highlightFrontier=r.line,e.modeFrontier=Math.max(e.modeFrontier,r.line),i.length&&Ai(t,(function(){for(var e=0;e=n.viewFrom&&e.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==Vr(t))return!1;$i(t)&&(zr(t),e.dims=Ar(t));var i=r.first+r.size,o=Math.max(e.visible.from-t.options.viewportMargin,r.first),a=Math.min(i,e.visible.to+t.options.viewportMargin);n.viewFroma&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo)),Pe&&(o=en(t.doc,o),a=nn(t.doc,a));var s=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=e.wrapperHeight||n.lastWrapWidth!=e.wrapperWidth;Br(t,o,a),n.viewOffset=an(Xt(t.doc,n.viewFrom)),t.display.mover.style.top=n.viewOffset+"px";var l=Vr(t);if(!s&&0==l&&!e.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var u=zi(t);return l>4&&(n.lineDiv.style.display="none"),Ui(t,n.updateLineNumbers,e.dims),l>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,Hi(u),T(n.cursorDiv),T(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=e.wrapperHeight,n.lastWrapWidth=e.wrapperWidth,Ii(t,400)),n.updateLineNumbers=null,!0}function Vi(t,e){for(var n=e.viewport,r=!0;;r=!1){if(r&&t.options.lineWrapping&&e.oldDisplayWidth!=Kn(t))r&&(e.visible=ei(t.display,t.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(t.doc.height+Gn(t.display)-Zn(t),n.top)}),e.visible=ei(t.display,t.doc,n),e.visible.from>=t.display.viewFrom&&e.visible.to<=t.display.viewTo)break;if(!Bi(t,e))break;Qr(t);var i=gi(t);Yr(t),yi(t,i),Gi(t,i),e.force=!1}e.signal(t,"update",t),t.display.viewFrom==t.display.reportedViewFrom&&t.display.viewTo==t.display.reportedViewTo||(e.signal(t,"viewportChange",t,t.display.viewFrom,t.display.viewTo),t.display.reportedViewFrom=t.display.viewFrom,t.display.reportedViewTo=t.display.viewTo)}function Yi(t,e){var n=new Wi(t,e);if(Bi(t,n)){Qr(t),Vi(t,n);var r=gi(t);Yr(t),yi(t,r),Gi(t,r),n.finish()}}function Ui(t,e,n){var r=t.display,i=t.options.lineNumbers,o=r.lineDiv,a=o.firstChild;function s(e){var n=e.nextSibling;return l&&y&&t.display.currentWheelTarget==e?e.style.display="none":e.parentNode.removeChild(e),n}for(var u=r.view,c=r.viewFrom,d=0;d-1&&(f=!1),An(t,h,c,n)),f&&(T(h.lineNumber),h.lineNumber.appendChild(document.createTextNode(ie(t.options,c)))),a=h.node.nextSibling}else{var p=zn(t,h,c,n);o.insertBefore(p,a)}c+=h.size}for(;a;)a=s(a)}function ji(t){var e=t.gutters.offsetWidth;t.sizer.style.marginLeft=e+"px"}function Gi(t,e){t.display.sizer.style.minHeight=e.docHeight+"px",t.display.heightForcer.style.top=e.docHeight+"px",t.display.gutters.style.height=e.docHeight+t.display.barHeight+$n(t)+"px"}function qi(t){var e=t.display,n=e.view;if(e.alignWidgets||e.gutters.firstChild&&t.options.fixedGutter){for(var r=Or(e)-e.scroller.scrollLeft+t.doc.scrollLeft,i=e.gutters.offsetWidth,o=r+"px",a=0;as.clientWidth,c=s.scrollHeight>s.clientHeight;if(i&&u||o&&c){if(o&&y&&l)t:for(var h=e.target,f=a.view;h!=s;h=h.parentNode)for(var p=0;p=0&&ae(t,r.to())<=0)return n}return-1};var oo=function(t,e){this.anchor=t,this.head=e};function ao(t,e,n){var r=t&&t.options.selectionsMayTouch,i=e[n];e.sort((function(t,e){return ae(t.from(),e.from())})),n=H(e,i);for(var o=1;o0:l>=0){var u=ce(s.from(),a.from()),c=ue(s.to(),a.to()),d=s.empty()?a.from()==a.head:s.from()==s.head;o<=n&&--n,e.splice(--o,2,new oo(d?c:u,d?u:c))}}return new io(e,n)}function so(t,e){return new io([new oo(t,e||t)],0)}function lo(t){return t.text?oe(t.from.line+t.text.length-1,K(t.text).length+(1==t.text.length?t.from.ch:0)):t.to}function uo(t,e){if(ae(t,e.from)<0)return t;if(ae(t,e.to)<=0)return lo(e);var n=t.line+e.text.length-(e.to.line-e.from.line)-1,r=t.ch;return t.line==e.to.line&&(r+=lo(e).ch-e.to.ch),oe(n,r)}function co(t,e){for(var n=[],r=0;r1&&t.remove(s.line+1,p-1),t.insert(s.line+1,v)}Ln(t,"change",t,e)}function yo(t,e,n){function r(t,i,o){if(t.linked)for(var a=0;a1&&!t.done[t.done.length-2].ranges?(t.done.pop(),K(t.done)):void 0}function Co(t,e,n,r){var i=t.history;i.undone.length=0;var o,a,s=+new Date;if((i.lastOp==r||i.lastOrigin==e.origin&&e.origin&&("+"==e.origin.charAt(0)&&i.lastModTime>s-(t.cm?t.cm.options.historyEventDelay:500)||"*"==e.origin.charAt(0)))&&(o=Mo(i,i.lastOp==r)))a=K(o.changes),0==ae(e.from,e.to)&&0==ae(e.from,a.to)?a.to=lo(e):o.changes.push(ko(t,e));else{var l=K(i.done);for(l&&l.ranges||Lo(t.sel,i.done),o={changes:[ko(t,e)],generation:i.generation},i.done.push(o);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=s,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=e.origin,a||vt(t,"historyAdded")}function To(t,e,n,r){var i=e.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-t.history.lastSelTime<=(t.cm?t.cm.options.historyEventDelay:500)}function Do(t,e,n,r){var i=t.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||To(t,o,K(i.done),e))?i.done[i.done.length-1]=e:Lo(e,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&!1!==r.clearRedo&&So(i.undone)}function Lo(t,e){var n=K(e);n&&n.ranges&&n.equals(t)||e.push(t)}function Po(t,e,n,r){var i=e["spans_"+t.id],o=0;t.iter(Math.max(t.first,n),Math.min(t.first+t.size,r),(function(n){n.markedSpans&&((i||(i=e["spans_"+t.id]={}))[o]=n.markedSpans),++o}))}function Ao(t){if(!t)return null;for(var e,n=0;n-1&&(K(s)[d]=u[d],delete u[d])}}}return r}function Io(t,e,n,r){if(r){var i=t.anchor;if(n){var o=ae(e,i)<0;o!=ae(n,i)<0?(i=e,e=n):o!=ae(e,n)<0&&(e=n)}return new oo(i,e)}return new oo(n||e,e)}function Ro(t,e,n,r,i){null==i&&(i=t.cm&&(t.cm.display.shift||t.extend)),Vo(t,new io([Io(t.sel.primary(),e,n,i)],0),r)}function Wo(t,e,n){for(var r=[],i=t.cm&&(t.cm.display.shift||t.extend),o=0;o=e.ch:s.to>e.ch))){if(i&&(vt(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!l.atomic)continue;if(n){var d=l.find(r<0?1:-1),h=void 0;if((r<0?c:u)&&(d=Ko(t,d,-r,d&&d.line==e.line?o:null)),d&&d.line==e.line&&(h=ae(d,n))&&(r<0?h<0:h>0))return qo(t,d,e,r,i)}var f=l.find(r<0?-1:1);return(r<0?u:c)&&(f=Ko(t,f,r,f.line==e.line?o:null)),f?qo(t,f,e,r,i):null}}return e}function $o(t,e,n,r,i){var o=r||1,a=qo(t,e,n,o,i)||!i&&qo(t,e,n,o,!0)||qo(t,e,n,-o,i)||!i&&qo(t,e,n,-o,!0);return a||(t.cantEdit=!0,oe(t.first,0))}function Ko(t,e,n,r){return n<0&&0==e.ch?e.line>t.first?he(t,oe(e.line-1)):null:n>0&&e.ch==(r||Xt(t,e.line)).text.length?e.line=0;--i)Qo(t,{from:r[i].from,to:r[i].to,text:i?[""]:e.text,origin:e.origin});else Qo(t,e)}}function Qo(t,e){if(1!=e.text.length||""!=e.text[0]||0!=ae(e.from,e.to)){var n=co(t,e);Co(t,e,n,t.cm?t.cm.curOp.id:NaN),na(t,e,n,ze(t,e));var r=[];yo(t,(function(t,n){n||-1!=H(r,t.history)||(sa(t.history,e),r.push(t.history)),na(t,e,null,ze(t,e))}))}}function ta(t,e,n){var r=t.cm&&t.cm.state.suppressEdits;if(!r||n){for(var i,o=t.history,a=t.sel,s="undo"==e?o.done:o.undone,l="undo"==e?o.undone:o.done,u=0;u=0;--f){var p=h(f);if(p)return p.v}}}}function ea(t,e){if(0!=e&&(t.first+=e,t.sel=new io(Z(t.sel.ranges,(function(t){return new oo(oe(t.anchor.line+e,t.anchor.ch),oe(t.head.line+e,t.head.ch))})),t.sel.primIndex),t.cm)){Wr(t.cm,t.first,t.first-e,e);for(var n=t.cm.display,r=n.viewFrom;rt.lastLine())){if(e.from.lineo&&(e={from:e.from,to:oe(o,Xt(t,o).text.length),text:[e.text[0]],origin:e.origin}),e.removed=Jt(t,e.from,e.to),n||(n=co(t,e)),t.cm?ra(t.cm,e,r):vo(t,e,r),Yo(t,n,Y),t.cantEdit&&$o(t,oe(t.firstLine(),0))&&(t.cantEdit=!1)}}function ra(t,e,n){var r=t.doc,i=t.display,o=e.from,a=e.to,s=!1,l=o.line;t.options.lineWrapping||(l=ee(Je(Xt(r,o.line))),r.iter(l,a.line+1,(function(t){if(t==i.maxLine)return s=!0,!0}))),r.sel.contains(e.from,e.to)>-1&&bt(t),vo(r,e,n,Nr(t)),t.options.lineWrapping||(r.iter(l,o.line+e.text.length,(function(t){var e=sn(t);e>i.maxLineLength&&(i.maxLine=t,i.maxLineLength=e,i.maxLineChanged=!0,s=!1)})),s&&(t.curOp.updateMaxLine=!0)),De(r,o.line),Ii(t,400);var u=e.text.length-(a.line-o.line)-1;e.full?Wr(t):o.line!=a.line||1!=e.text.length||mo(t.doc,e)?Wr(t,o.line,a.line+1,u):Er(t,o.line,"text");var c=xt(t,"changes"),d=xt(t,"change");if(d||c){var h={from:o,to:a,text:e.text,removed:e.removed,origin:e.origin};d&&Ln(t,"change",t,h),c&&(t.curOp.changeObjs||(t.curOp.changeObjs=[])).push(h)}t.display.selForContextMenu=null}function ia(t,e,n,r,i){var o;r||(r=n),ae(r,n)<0&&(n=(o=[r,n])[0],r=o[1]),"string"==typeof e&&(e=t.splitLines(e)),Jo(t,{from:n,to:r,text:e,origin:i})}function oa(t,e,n,r){n1||!(this.children[0]instanceof ua))){var s=[];this.collapse(s),this.children=[new ua(s)],this.children[0].parent=this}},collapse:function(t){for(var e=0;e50){for(var a=i.lines.length%25+25,s=a;s10);t.parent.maybeSpill()}},iterN:function(t,e,n){for(var r=0;r0||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=P("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Xe(t,e.line,e,n,o)||e.line!=n.line&&Xe(t,n.line,e,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Oe()}o.addToHistory&&Co(t,{from:e,to:n,origin:"markText"},t.sel,NaN);var s,l=e.line,u=t.cm;if(t.iter(l,n.line+1,(function(t){u&&o.collapsed&&!u.options.lineWrapping&&Je(t)==u.display.maxLine&&(s=!0),o.collapsed&&l!=e.line&&te(t,0),Re(t,new Ne(o,l==e.line?e.ch:null,l==n.line?n.ch:null)),++l})),o.collapsed&&t.iter(e.line,n.line+1,(function(e){rn(t,e)&&te(e,0)})),o.clearOnEnter&&pt(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(Ae(),(t.history.done.length||t.history.undone.length)&&t.clearHistory()),o.collapsed&&(o.id=++pa,o.atomic=!0),u){if(s&&(u.curOp.updateMaxLine=!0),o.collapsed)Wr(u,e.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var c=e.line;c<=n.line;c++)Er(u,c,"text");o.atomic&&jo(u.doc),Ln(u,"markerAdded",u,o)}return o}ga.prototype.clear=function(){if(!this.explicitlyCleared){var t=this.doc.cm,e=t&&!t.curOp;if(e&&ki(t),xt(this,"clear")){var n=this.find();n&&Ln(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;ot.display.maxLineLength&&(t.display.maxLine=u,t.display.maxLineLength=c,t.display.maxLineChanged=!0)}null!=r&&t&&this.collapsed&&Wr(t,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&jo(t.doc)),t&&Ln(t,"markerCleared",t,this,r,i),e&&Si(t),this.parent&&this.parent.clear()}},ga.prototype.find=function(t,e){var n,r;null==t&&"bookmark"==this.type&&(t=1);for(var i=0;i=0;l--)Jo(this,r[l]);s?Bo(this,s):this.cm&&si(this.cm)})),undo:Fi((function(){ta(this,"undo")})),redo:Fi((function(){ta(this,"redo")})),undoSelection:Fi((function(){ta(this,"undo",!0)})),redoSelection:Fi((function(){ta(this,"redo",!0)})),setExtending:function(t){this.extend=t},getExtending:function(){return this.extend},historySize:function(){for(var t=this.history,e=0,n=0,r=0;r=t.ch)&&e.push(i.marker.parent||i.marker)}return e},findMarks:function(t,e,n){t=he(this,t),e=he(this,e);var r=[],i=t.line;return this.iter(t.line,e.line+1,(function(o){var a=o.markedSpans;if(a)for(var s=0;s=l.to||null==l.from&&i!=t.line||null!=l.from&&i==e.line&&l.from>=e.ch||n&&!n(l.marker)||r.push(l.marker.parent||l.marker)}++i})),r},getAllMarks:function(){var t=[];return this.iter((function(e){var n=e.markedSpans;if(n)for(var r=0;rt)return e=t,!0;t-=o,++n})),he(this,oe(n,e))},indexFromPos:function(t){var e=(t=he(this,t)).ch;if(t.linee&&(e=t.from),null!=t.to&&t.to-1)return e.state.draggingText(t),void setTimeout((function(){return e.display.input.focus()}),20);try{var d=t.dataTransfer.getData("Text");if(d){var h;if(e.state.draggingText&&!e.state.draggingText.copy&&(h=e.listSelections()),Yo(e.doc,so(n,n)),h)for(var f=0;f=0;e--)ia(t.doc,"",r[e].from,r[e].to,"+delete");si(t)}))}function qa(t,e,n){var r=at(t.text,e+n,n);return r<0||r>t.text.length?null:r}function $a(t,e,n){var r=qa(t,e.ch,n);return null==r?null:new oe(e.line,r,n<0?"after":"before")}function Ka(t,e,n,r,i){if(t){"rtl"==e.doc.direction&&(i=-i);var o=ht(n,e.doc.direction);if(o){var a,s=i<0?K(o):o[0],l=i<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==e.doc.direction){var u=nr(e,n);a=i<0?n.text.length-1:0;var c=rr(e,u,a).top;a=st((function(t){return rr(e,u,t).top==c}),i<0==(1==s.level)?s.from:s.to-1,a),"before"==l&&(a=qa(n,a,1))}else a=i<0?s.to:s.from;return new oe(r,a,l)}}return new oe(r,i<0?n.text.length:0,i<0?"before":"after")}function Za(t,e,n,r){var i=ht(e,t.doc.direction);if(!i)return $a(e,n,r);n.ch>=e.text.length?(n.ch=e.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=ct(i,n.ch,n.sticky),a=i[o];if("ltr"==t.doc.direction&&a.level%2==0&&(r>0?a.to>n.ch:a.from=a.from&&h>=c.begin)){var f=d?"before":"after";return new oe(n.line,h,f)}}var p=function(t,e,r){for(var o=function(t,e){return e?new oe(n.line,l(t,1),"before"):new oe(n.line,t,"after")};t>=0&&t0==(1!=a.level),u=s?r.begin:l(r.end,-1);if(a.from<=u&&u0?c.end:l(c.begin,-1);return null==m||r>0&&m==e.text.length||!(g=p(r>0?0:i.length-1,r,u(m)))?null:g}Ea.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Ea.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Ea.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Ea.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Ea.default=y?Ea.macDefault:Ea.pcDefault;var Xa={selectAll:Zo,singleSelection:function(t){return t.setSelection(t.getCursor("anchor"),t.getCursor("head"),Y)},killLine:function(t){return Ga(t,(function(e){if(e.empty()){var n=Xt(t.doc,e.head.line).text.length;return e.head.ch==n&&e.head.line0)i=new oe(i.line,i.ch+1),t.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),oe(i.line,i.ch-2),i,"+transpose");else if(i.line>t.doc.first){var a=Xt(t.doc,i.line-1).text;a&&(i=new oe(i.line,1),t.replaceRange(o.charAt(0)+t.doc.lineSeparator()+a.charAt(a.length-1),oe(i.line-1,a.length-1),i,"+transpose"))}n.push(new oo(i,i))}t.setSelections(n)}))},newlineAndIndent:function(t){return Ai(t,(function(){for(var e=t.listSelections(),n=e.length-1;n>=0;n--)t.replaceRange(t.doc.lineSeparator(),e[n].anchor,e[n].head,"+input");e=t.listSelections();for(var r=0;r-1&&(ae((i=s.ranges[i]).from(),e)<0||e.xRel>0)&&(ae(i.to(),e)>0||e.xRel<0)?_s(t,r,e,o):Ss(t,r,e,o)}function _s(t,e,n,r){var i=t.display,o=!1,u=Oi(t,(function(e){l&&(i.scroller.draggable=!1),t.state.draggingText=!1,t.state.delayingBlurEvent&&(t.hasFocus()?t.state.delayingBlurEvent=!1:Zr(t)),mt(i.wrapper.ownerDocument,"mouseup",u),mt(i.wrapper.ownerDocument,"mousemove",c),mt(i.scroller,"dragstart",d),mt(i.scroller,"drop",u),o||(_t(e),r.addNew||Ro(t.doc,n,null,null,r.extend),l&&!h||a&&9==s?setTimeout((function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()}),20):i.input.focus())})),c=function(t){o=o||Math.abs(e.clientX-t.clientX)+Math.abs(e.clientY-t.clientY)>=10},d=function(){return o=!0};l&&(i.scroller.draggable=!0),t.state.draggingText=u,u.copy=!r.moveOnDrag,pt(i.wrapper.ownerDocument,"mouseup",u),pt(i.wrapper.ownerDocument,"mousemove",c),pt(i.scroller,"dragstart",d),pt(i.scroller,"drop",u),t.state.delayingBlurEvent=!0,setTimeout((function(){return i.input.focus()}),20),i.scroller.dragDrop&&i.scroller.dragDrop()}function ks(t,e,n){if("char"==n)return new oo(e,e);if("word"==n)return t.findWordAt(e);if("line"==n)return new oo(oe(e.line,0),he(t.doc,oe(e.line+1,0)));var r=n(t,e);return new oo(r.from,r.to)}function Ss(t,e,n,r){a&&Zr(t);var i=t.display,o=t.doc;_t(e);var s,l,u=o.sel,c=u.ranges;if(r.addNew&&!r.extend?(l=o.sel.contains(n),s=l>-1?c[l]:new oo(n,n)):(s=o.sel.primary(),l=o.sel.primIndex),"rectangle"==r.unit)r.addNew||(s=new oo(n,n)),n=Ir(t,e,!0,!0),l=-1;else{var d=ks(t,n,r.unit);s=r.extend?Io(s,d.anchor,d.head,r.extend):d}r.addNew?-1==l?(l=c.length,Vo(o,ao(t,c.concat([s]),l),{scroll:!1,origin:"*mouse"})):c.length>1&&c[l].empty()&&"char"==r.unit&&!r.extend?(Vo(o,ao(t,c.slice(0,l).concat(c.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),u=o.sel):Eo(o,l,s,U):(l=0,Vo(o,new io([s],0),U),u=o.sel);var h=n;function f(e){if(0!=ae(h,e))if(h=e,"rectangle"==r.unit){for(var i=[],a=t.options.tabSize,c=E(Xt(o,n.line).text,n.ch,a),d=E(Xt(o,e.line).text,e.ch,a),f=Math.min(c,d),p=Math.max(c,d),g=Math.min(n.line,e.line),m=Math.min(t.lastLine(),Math.max(n.line,e.line));g<=m;g++){var v=Xt(o,g).text,y=G(v,f,a);f==p?i.push(new oo(oe(g,y),oe(g,y))):v.length>y&&i.push(new oo(oe(g,y),oe(g,G(v,p,a))))}i.length||i.push(new oo(n,n)),Vo(o,ao(t,u.ranges.slice(0,l).concat(i),l),{origin:"*mouse",scroll:!1}),t.scrollIntoView(e)}else{var b,x=s,w=ks(t,e,r.unit),_=x.anchor;ae(w.anchor,_)>0?(b=w.head,_=ce(x.from(),w.anchor)):(b=w.anchor,_=ue(x.to(),w.head));var k=u.ranges.slice(0);k[l]=Ms(t,new oo(he(o,_),b)),Vo(o,ao(t,k,l),U)}}var p=i.wrapper.getBoundingClientRect(),g=0;function m(e){var n=++g,a=Ir(t,e,!0,"rectangle"==r.unit);if(a)if(0!=ae(a,h)){t.curOp.focus=O(),f(a);var s=ei(i,o);(a.line>=s.to||a.linep.bottom?20:0;l&&setTimeout(Oi(t,(function(){g==n&&(i.scroller.scrollTop+=l,m(e))})),50)}}function v(e){t.state.selectingText=!1,g=1/0,e&&(_t(e),i.input.focus()),mt(i.wrapper.ownerDocument,"mousemove",y),mt(i.wrapper.ownerDocument,"mouseup",b),o.history.lastSelOrigin=null}var y=Oi(t,(function(t){0!==t.buttons&&Tt(t)?m(t):v(t)})),b=Oi(t,v);t.state.selectingText=b,pt(i.wrapper.ownerDocument,"mousemove",y),pt(i.wrapper.ownerDocument,"mouseup",b)}function Ms(t,e){var n=e.anchor,r=e.head,i=Xt(t.doc,n.line);if(0==ae(n,r)&&n.sticky==r.sticky)return e;var o=ht(i);if(!o)return e;var a=ct(o,n.ch,n.sticky),s=o[a];if(s.from!=n.ch&&s.to!=n.ch)return e;var l,u=a+(s.from==n.ch==(1!=s.level)?0:1);if(0==u||u==o.length)return e;if(r.line!=n.line)l=(r.line-n.line)*("ltr"==t.doc.direction?1:-1)>0;else{var c=ct(o,r.ch,r.sticky),d=c-a||(r.ch-n.ch)*(1==s.level?-1:1);l=c==u-1||c==u?d<0:d>0}var h=o[u+(l?-1:0)],f=l==(1==h.level),p=f?h.from:h.to,g=f?"after":"before";return n.ch==p&&n.sticky==g?e:new oo(new oe(n.line,p,g),r)}function Cs(t,e,n,r){var i,o;if(e.touches)i=e.touches[0].clientX,o=e.touches[0].clientY;else try{i=e.clientX,o=e.clientY}catch(t){return!1}if(i>=Math.floor(t.display.gutters.getBoundingClientRect().right))return!1;r&&_t(e);var a=t.display,s=a.lineDiv.getBoundingClientRect();if(o>s.bottom||!xt(t,n))return St(e);o-=s.top-a.viewOffset;for(var l=0;l=i)return vt(t,n,t,ne(t.doc,o),t.display.gutterSpecs[l].className,e),St(e)}}function Ts(t,e){return Cs(t,e,"gutterClick",!0)}function Ds(t,e){Un(t.display,e)||Ls(t,e)||yt(t,e,"contextmenu")||k||t.display.input.onContextMenu(e)}function Ls(t,e){return!!xt(t,"gutterContextMenu")&&Cs(t,e,"gutterContextMenu",!1)}function Ps(t){t.display.wrapper.className=t.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+t.options.theme.replace(/(^|\s)\s*/g," cm-s-"),hr(t)}ms.prototype.compare=function(t,e,n){return this.time+gs>t&&0==ae(e,this.pos)&&n==this.button};var As={toString:function(){return"CodeMirror.Init"}},Os={},Ns={};function Fs(t){var e=t.optionHandlers;function n(n,r,i,o){t.defaults[n]=r,i&&(e[n]=o?function(t,e,n){n!=As&&i(t,e,n)}:i)}t.defineOption=n,t.Init=As,n("value","",(function(t,e){return t.setValue(e)}),!0),n("mode",null,(function(t,e){t.doc.modeOption=e,po(t)}),!0),n("indentUnit",2,po,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(t){go(t),hr(t),Wr(t)}),!0),n("lineSeparator",null,(function(t,e){if(t.doc.lineSep=e,e){var n=[],r=t.doc.first;t.doc.iter((function(t){for(var i=0;;){var o=t.text.indexOf(e,i);if(-1==o)break;i=o+e.length,n.push(oe(r,o))}r++}));for(var i=n.length-1;i>=0;i--)ia(t.doc,e,n[i],oe(n[i].line,n[i].ch+e.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(t,e,n){t.state.specialChars=new RegExp(e.source+(e.test("\t")?"":"|\t"),"g"),n!=As&&t.refresh()})),n("specialCharPlaceholder",mn,(function(t){return t.refresh()}),!0),n("electricChars",!0),n("inputStyle",v?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),n("spellcheck",!1,(function(t,e){return t.getInputField().spellcheck=e}),!0),n("autocorrect",!1,(function(t,e){return t.getInputField().autocorrect=e}),!0),n("autocapitalize",!1,(function(t,e){return t.getInputField().autocapitalize=e}),!0),n("rtlMoveVisually",!x),n("wholeLineUpdateBefore",!0),n("theme","default",(function(t){Ps(t),Xi(t)}),!0),n("keyMap","default",(function(t,e,n){var r=ja(e),i=n!=As&&ja(n);i&&i.detach&&i.detach(t,r),r.attach&&r.attach(t,i||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Rs,!0),n("gutters",[],(function(t,e){t.display.gutterSpecs=Ki(e,t.options.lineNumbers),Xi(t)}),!0),n("fixedGutter",!0,(function(t,e){t.display.gutters.style.left=e?Or(t.display)+"px":"0",t.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(t){return yi(t)}),!0),n("scrollbarStyle","native",(function(t){wi(t),yi(t),t.display.scrollbars.setScrollTop(t.doc.scrollTop),t.display.scrollbars.setScrollLeft(t.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(t,e){t.display.gutterSpecs=Ki(t.options.gutters,e),Xi(t)}),!0),n("firstLineNumber",1,Xi,!0),n("lineNumberFormatter",(function(t){return t}),Xi,!0),n("showCursorWhenSelecting",!1,Yr,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(t,e){"nocursor"==e&&(Jr(t),t.display.input.blur()),t.display.input.readOnlyChanged(e)})),n("screenReaderLabel",null,(function(t,e){e=""===e?null:e,t.display.input.screenReaderLabelChanged(e)})),n("disableInput",!1,(function(t,e){e||t.display.input.reset()}),!0),n("dragDrop",!0,Is),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,Yr,!0),n("singleCursorHeightPerLine",!0,Yr,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,go,!0),n("addModeClass",!1,go,!0),n("pollInterval",100),n("undoDepth",200,(function(t,e){return t.doc.history.undoDepth=e})),n("historyEventDelay",1250),n("viewportMargin",10,(function(t){return t.refresh()}),!0),n("maxHighlightLength",1e4,go,!0),n("moveInputWithCursor",!0,(function(t,e){e||t.display.input.resetPosition()})),n("tabindex",null,(function(t,e){return t.display.input.getField().tabIndex=e||""})),n("autofocus",null),n("direction","ltr",(function(t,e){return t.doc.setDirection(e)}),!0),n("phrases",null)}function Is(t,e,n){if(!e!=!(n&&n!=As)){var r=t.display.dragFunctions,i=e?pt:mt;i(t.display.scroller,"dragstart",r.start),i(t.display.scroller,"dragenter",r.enter),i(t.display.scroller,"dragover",r.over),i(t.display.scroller,"dragleave",r.leave),i(t.display.scroller,"drop",r.drop)}}function Rs(t){t.options.lineWrapping?(N(t.display.wrapper,"CodeMirror-wrap"),t.display.sizer.style.minWidth="",t.display.sizerWidth=null):(C(t.display.wrapper,"CodeMirror-wrap"),ln(t)),Fr(t),Wr(t),hr(t),setTimeout((function(){return yi(t)}),100)}function Ws(t,e){var n=this;if(!(this instanceof Ws))return new Ws(t,e);this.options=e=e?W(e):{},W(Os,e,!1);var r=e.value;"string"==typeof r?r=new ka(r,e.mode,null,e.lineSeparator,e.direction):e.mode&&(r.modeOption=e.mode),this.doc=r;var i=new Ws.inputStyles[e.inputStyle](this),o=this.display=new Ji(t,r,i,e);for(var u in o.wrapper.CodeMirror=this,Ps(this),e.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),wi(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 z,keySeq:null,specialChars:null},e.autofocus&&!v&&o.input.focus(),a&&s<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),Es(this),Aa(),ki(this),this.curOp.forceUpdate=!0,bo(this,r),e.autofocus&&!v||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&Xr(n)}),20):Jr(this),Ns)Ns.hasOwnProperty(u)&&Ns[u](this,e[u],As);$i(this),e.finishInit&&e.finishInit(this);for(var c=0;c400}pt(e.scroller,"touchstart",(function(i){if(!yt(t,i)&&!o(i)&&!Ts(t,i)){e.input.ensurePolled(),clearTimeout(n);var a=+new Date;e.activeTouch={start:a,moved:!1,prev:a-r.end<=300?r:null},1==i.touches.length&&(e.activeTouch.left=i.touches[0].pageX,e.activeTouch.top=i.touches[0].pageY)}})),pt(e.scroller,"touchmove",(function(){e.activeTouch&&(e.activeTouch.moved=!0)})),pt(e.scroller,"touchend",(function(n){var r=e.activeTouch;if(r&&!Un(e,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var o,a=t.coordsChar(e.activeTouch,"page");o=!r.prev||l(r,r.prev)?new oo(a,a):!r.prev.prev||l(r,r.prev.prev)?t.findWordAt(a):new oo(oe(a.line,0),he(t.doc,oe(a.line+1,0))),t.setSelection(o.anchor,o.head),t.focus(),_t(n)}i()})),pt(e.scroller,"touchcancel",i),pt(e.scroller,"scroll",(function(){e.scroller.clientHeight&&(hi(t,e.scroller.scrollTop),pi(t,e.scroller.scrollLeft,!0),vt(t,"scroll",t))})),pt(e.scroller,"mousewheel",(function(e){return ro(t,e)})),pt(e.scroller,"DOMMouseScroll",(function(e){return ro(t,e)})),pt(e.wrapper,"scroll",(function(){return e.wrapper.scrollTop=e.wrapper.scrollLeft=0})),e.dragFunctions={enter:function(e){yt(t,e)||Mt(e)},over:function(e){yt(t,e)||(Ta(t,e),Mt(e))},start:function(e){return Ca(t,e)},drop:Oi(t,Ma),leave:function(e){yt(t,e)||Da(t)}};var u=e.input.getField();pt(u,"keyup",(function(e){return ds.call(t,e)})),pt(u,"keydown",Oi(t,us)),pt(u,"keypress",Oi(t,hs)),pt(u,"focus",(function(e){return Xr(t,e)})),pt(u,"blur",(function(e){return Jr(t,e)}))}Ws.defaults=Os,Ws.optionHandlers=Ns;var zs=[];function Hs(t,e,n,r){var i,o=t.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=be(t,e).state:n="prev");var a=t.options.tabSize,s=Xt(o,e),l=E(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var u,c=s.text.match(/^\s*/)[0];if(r||/\S/.test(s.text)){if("smart"==n&&((u=o.mode.indent(i,s.text.slice(c.length),s.text))==V||u>150)){if(!r)return;n="prev"}}else u=0,n="not";"prev"==n?u=e>o.first?E(Xt(o,e-1).text,null,a):0:"add"==n?u=l+t.options.indentUnit:"subtract"==n?u=l-t.options.indentUnit:"number"==typeof n&&(u=l+n),u=Math.max(0,u);var d="",h=0;if(t.options.indentWithTabs)for(var f=Math.floor(u/a);f;--f)h+=a,d+="\t";if(ha,l=Ft(e),u=null;if(s&&r.ranges.length>1)if(Bs&&Bs.text.join("\n")==e){if(r.ranges.length%Bs.text.length==0){u=[];for(var c=0;c=0;h--){var f=r.ranges[h],p=f.from(),g=f.to();f.empty()&&(n&&n>0?p=oe(p.line,p.ch-n):t.state.overwrite&&!s?g=oe(g.line,Math.min(Xt(o,g.line).text.length,g.ch+K(l).length)):s&&Bs&&Bs.lineWise&&Bs.text.join("\n")==l.join("\n")&&(p=g=oe(p.line,0)));var m={from:p,to:g,text:u?u[h%u.length]:l,origin:i||(s?"paste":t.state.cutIncoming>a?"cut":"+input")};Jo(t.doc,m),Ln(t,"inputRead",t,m)}e&&!s&&js(t,e),si(t),t.curOp.updateInput<2&&(t.curOp.updateInput=d),t.curOp.typing=!0,t.state.pasteIncoming=t.state.cutIncoming=-1}function Us(t,e){var n=t.clipboardData&&t.clipboardData.getData("Text");if(n)return t.preventDefault(),e.isReadOnly()||e.options.disableInput||Ai(e,(function(){return Ys(e,n,0,null,"paste")})),!0}function js(t,e){if(t.options.electricChars&&t.options.smartIndent)for(var n=t.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 o=t.getModeAt(i.head),a=!1;if(o.electricChars){for(var s=0;s-1){a=Hs(t,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Xt(t.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Hs(t,i.head.line,"smart"));a&&Ln(t,"electricInput",t,i.head.line)}}}function Gs(t){for(var e=[],n=[],r=0;rn&&(Hs(this,i.head.line,t,!0),n=i.head.line,r==this.doc.sel.primIndex&&si(this));else{var o=i.from(),a=i.to(),s=Math.max(n,o.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var l=s;l0&&Eo(this.doc,r,new oo(o,u[r].to()),Y)}}})),getTokenAt:function(t,e){return Se(this,t,e)},getLineTokens:function(t,e){return Se(this,oe(t),e,!0)},getTokenTypeAt:function(t){t=he(this.doc,t);var e,n=ye(this,Xt(this.doc,t.line)),r=0,i=(n.length-1)/2,o=t.ch;if(0==o)e=n[2];else for(;;){var a=r+i>>1;if((a?n[2*a-1]:0)>=o)i=a;else{if(!(n[2*a+1]o&&(t=o,i=!0),r=Xt(this.doc,t)}else r=t;return mr(this,r,{top:0,left:0},e||"page",n||i).top+(i?this.doc.height-an(r):0)},defaultTextHeight:function(){return Lr(this.display)},defaultCharWidth:function(){return Pr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(t,e,n,r,i){var o=this.display,a=(t=br(this,he(this.doc,t))).bottom,s=t.left;if(e.style.position="absolute",e.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(e),o.sizer.appendChild(e),"over"==r)a=t.top;else if("above"==r||"near"==r){var l=Math.max(o.wrapper.clientHeight,this.doc.height),u=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==r||t.bottom+e.offsetHeight>l)&&t.top>e.offsetHeight?a=t.top-e.offsetHeight:t.bottom+e.offsetHeight<=l&&(a=t.bottom),s+e.offsetWidth>u&&(s=u-e.offsetWidth)}e.style.top=a+"px",e.style.left=e.style.right="","right"==i?(s=o.sizer.clientWidth-e.offsetWidth,e.style.right="0px"):("left"==i?s=0:"middle"==i&&(s=(o.sizer.clientWidth-e.offsetWidth)/2),e.style.left=s+"px"),n&&ii(this,{left:s,top:a,right:s+e.offsetWidth,bottom:a+e.offsetHeight})},triggerOnKeyDown:Ni(us),triggerOnKeyPress:Ni(hs),triggerOnKeyUp:ds,triggerOnMouseDown:Ni(ys),execCommand:function(t){if(Xa.hasOwnProperty(t))return Xa[t].call(null,this)},triggerElectric:Ni((function(t){js(this,t)})),findPosH:function(t,e,n,r){var i=1;e<0&&(i=-1,e=-e);for(var o=he(this.doc,t),a=0;a0&&a(e.charAt(n-1));)--n;for(;r.5||this.options.lineWrapping)&&Fr(this),vt(this,"refresh",this)})),swapDoc:Ni((function(t){var e=this.doc;return e.cm=null,this.state.selectingText&&this.state.selectingText(),bo(this,t),hr(this),this.display.input.reset(),li(this,t.scrollLeft,t.scrollTop),this.curOp.forceScroll=!0,Ln(this,"swapDoc",this,e),e})),phrase:function(t){var e=this.options.phrases;return e&&Object.prototype.hasOwnProperty.call(e,t)?e[t]:t},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}},wt(t),t.registerHelper=function(e,r,i){n.hasOwnProperty(e)||(n[e]=t[e]={_global:[]}),n[e][r]=i},t.registerGlobalHelper=function(e,r,i,o){t.registerHelper(e,r,o),n[e]._global.push({pred:i,val:o})}}function Zs(t,e,n,r,i){var o=e,a=n,s=Xt(t,e.line),l=i&&"rtl"==t.direction?-n:n;function u(){var n=e.line+l;return!(n=t.first+t.size)&&(e=new oe(n,e.ch,e.sticky),s=Xt(t,n))}function c(o){var a;if("codepoint"==r){var c=s.text.charCodeAt(e.ch+(r>0?0:-1));a=isNaN(c)?null:new oe(e.line,Math.max(0,Math.min(s.text.length,e.ch+n*(c>=55296&&c<56320?2:1))),-n)}else a=i?Za(t.cm,s,e,n):$a(s,e,n);if(null==a){if(o||!u())return!1;e=Ka(i,t.cm,s,e.line,l)}else e=a;return!0}if("char"==r||"codepoint"==r)c();else if("column"==r)c(!0);else if("word"==r||"group"==r)for(var d=null,h="group"==r,f=t.cm&&t.cm.getHelper(e,"wordChars"),p=!0;!(n<0)||c(!p);p=!1){var g=s.text.charAt(e.ch)||"\n",m=nt(g,f)?"w":h&&"\n"==g?"n":!h||/\s/.test(g)?null:"p";if(!h||p||m||(m="s"),d&&d!=m){n<0&&(n=1,c(),e.sticky="after");break}if(m&&(d=m),n>0&&!c(!p))break}var v=$o(t,e,o,a,!0);return se(o,v)&&(v.hitSide=!0),v}function Xs(t,e,n,r){var i,o,a=t.doc,s=e.left;if("page"==r){var l=Math.min(t.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),u=Math.max(l-.5*Lr(t.display),3);i=(n>0?e.bottom:e.top)+n*u}else"line"==r&&(i=n>0?e.bottom+3:e.top-3);for(;(o=_r(t,s,i)).outside;){if(n<0?i<=0:i>=a.height){o.hitSide=!0;break}i+=5*n}return o}var Js=function(t){this.cm=t,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new z,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Qs(t,e){var n=er(t,e.line);if(!n||n.hidden)return null;var r=Xt(t.doc,e.line),i=Jn(n,r,e.line),o=ht(r,t.doc.direction),a="left";o&&(a=ct(o,e.ch)%2?"right":"left");var s=ar(i.map,e.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function tl(t){for(var e=t;e;e=e.parentNode)if(/CodeMirror-gutter-wrapper/.test(e.className))return!0;return!1}function el(t,e){return e&&(t.bad=!0),t}function nl(t,e,n,r,i){var o="",a=!1,s=t.doc.lineSeparator(),l=!1;function u(t){return function(e){return e.id==t}}function c(){a&&(o+=s,l&&(o+=s),a=l=!1)}function d(t){t&&(c(),o+=t)}function h(e){if(1==e.nodeType){var n=e.getAttribute("cm-text");if(n)return void d(n);var o,f=e.getAttribute("cm-marker");if(f){var p=t.findMarks(oe(r,0),oe(i+1,0),u(+f));return void(p.length&&(o=p[0].find(0))&&d(Jt(t.doc,o.from,o.to).join(s)))}if("false"==e.getAttribute("contenteditable"))return;var g=/^(pre|div|p|li|table|br)$/i.test(e.nodeName);if(!/^br$/i.test(e.nodeName)&&0==e.textContent.length)return;g&&c();for(var m=0;m=e.display.viewTo||o.line=e.display.viewFrom&&Qs(e,i)||{node:l[0].measure.map[2],offset:0},c=o.liner.firstLine()&&(a=oe(a.line-1,Xt(r.doc,a.line-1).length)),s.ch==Xt(r.doc,s.line).text.length&&s.linei.viewTo-1)return!1;a.line==i.viewFrom||0==(t=Rr(r,a.line))?(e=ee(i.view[0].line),n=i.view[0].node):(e=ee(i.view[t].line),n=i.view[t-1].node.nextSibling);var l,u,c=Rr(r,s.line);if(c==i.view.length-1?(l=i.viewTo-1,u=i.lineDiv.lastChild):(l=ee(i.view[c+1].line)-1,u=i.view[c+1].node.previousSibling),!n)return!1;for(var d=r.doc.splitLines(nl(r,n,u,e,l)),h=Jt(r.doc,oe(e,0),oe(l,Xt(r.doc,l).text.length));d.length>1&&h.length>1;)if(K(d)==K(h))d.pop(),h.pop(),l--;else{if(d[0]!=h[0])break;d.shift(),h.shift(),e++}for(var f=0,p=0,g=d[0],m=h[0],v=Math.min(g.length,m.length);fa.ch&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)f--,p++;d[d.length-1]=y.slice(0,y.length-p).replace(/^\u200b+/,""),d[0]=d[0].slice(f).replace(/\u200b+$/,"");var w=oe(e,f),_=oe(l,h.length?K(h).length-p:0);return d.length>1||d[0]||ae(w,_)?(ia(r.doc,d,w,_,"+input"),!0):void 0},Js.prototype.ensurePolled=function(){this.forceCompositionEnd()},Js.prototype.reset=function(){this.forceCompositionEnd()},Js.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Js.prototype.readFromDOMSoon=function(){var t=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(t.readDOMTimeout=null,t.composing){if(!t.composing.done)return;t.composing=null}t.updateFromDOM()}),80))},Js.prototype.updateFromDOM=function(){var t=this;!this.cm.isReadOnly()&&this.pollContent()||Ai(this.cm,(function(){return Wr(t.cm)}))},Js.prototype.setUneditable=function(t){t.contentEditable="false"},Js.prototype.onKeyPress=function(t){0==t.charCode||this.composing||(t.preventDefault(),this.cm.isReadOnly()||Oi(this.cm,Ys)(this.cm,String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),0))},Js.prototype.readOnlyChanged=function(t){this.div.contentEditable=String("nocursor"!=t)},Js.prototype.onContextMenu=function(){},Js.prototype.resetPosition=function(){},Js.prototype.needsContentAttribute=!0;var ol=function(t){this.cm=t,this.prevInput="",this.pollingFast=!1,this.polling=new z,this.hasSelection=!1,this.composing=null};function al(t,e){if((e=e?W(e):{}).value=t.value,!e.tabindex&&t.tabIndex&&(e.tabindex=t.tabIndex),!e.placeholder&&t.placeholder&&(e.placeholder=t.placeholder),null==e.autofocus){var n=O();e.autofocus=n==t||null!=t.getAttribute("autofocus")&&n==document.body}function r(){t.value=s.getValue()}var i;if(t.form&&(pt(t.form,"submit",r),!e.leaveSubmitMethodAlone)){var o=t.form;i=o.submit;try{var a=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=a}}catch(t){}}e.finishInit=function(n){n.save=r,n.getTextArea=function(){return t},n.toTextArea=function(){n.toTextArea=isNaN,r(),t.parentNode.removeChild(n.getWrapperElement()),t.style.display="",t.form&&(mt(t.form,"submit",r),e.leaveSubmitMethodAlone||"function"!=typeof t.form.submit||(t.form.submit=i))}},t.style.display="none";var s=Ws((function(e){return t.parentNode.insertBefore(e,t.nextSibling)}),e);return s}function sl(t){t.off=mt,t.on=pt,t.wheelEventPixels=no,t.Doc=ka,t.splitLines=Ft,t.countColumn=E,t.findColumn=G,t.isWordChar=et,t.Pass=V,t.signal=vt,t.Line=un,t.changeEnd=lo,t.scrollbarModel=xi,t.Pos=oe,t.cmpPos=ae,t.modes=zt,t.mimeModes=Ht,t.resolveMode=Yt,t.getMode=Ut,t.modeExtensions=jt,t.extendMode=Gt,t.copyState=qt,t.startState=Kt,t.innerMode=$t,t.commands=Xa,t.keyMap=Ea,t.keyName=Ua,t.isModifierKey=Va,t.lookupKey=Ba,t.normalizeKeyMap=Ha,t.StringStream=Zt,t.SharedTextMarker=va,t.TextMarker=ga,t.LineWidget=da,t.e_preventDefault=_t,t.e_stopPropagation=kt,t.e_stop=Mt,t.addClass=N,t.contains=A,t.rmClass=C,t.keyNames=Fa}ol.prototype.init=function(t){var e=this,n=this,r=this.cm;this.createField(t);var i=this.textarea;function o(t){if(!yt(r,t)){if(r.somethingSelected())Vs({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var e=Gs(r);Vs({lineWise:!0,text:e.text}),"cut"==t.type?r.setSelections(e.ranges,null,Y):(n.prevInput="",i.value=e.text.join("\n"),I(i))}"cut"==t.type&&(r.state.cutIncoming=+new Date)}}t.wrapper.insertBefore(this.wrapper,t.wrapper.firstChild),g&&(i.style.width="0px"),pt(i,"input",(function(){a&&s>=9&&e.hasSelection&&(e.hasSelection=null),n.poll()})),pt(i,"paste",(function(t){yt(r,t)||Us(t,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())})),pt(i,"cut",o),pt(i,"copy",o),pt(t.scroller,"paste",(function(e){if(!Un(t,e)&&!yt(r,e)){if(!i.dispatchEvent)return r.state.pasteIncoming=+new Date,void n.focus();var o=new Event("paste");o.clipboardData=e.clipboardData,i.dispatchEvent(o)}})),pt(t.lineSpace,"selectstart",(function(e){Un(t,e)||_t(e)})),pt(i,"compositionstart",(function(){var t=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:t,range:r.markText(t,r.getCursor("to"),{className:"CodeMirror-composing"})}})),pt(i,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},ol.prototype.createField=function(t){this.wrapper=$s(),this.textarea=this.wrapper.firstChild},ol.prototype.screenReaderLabelChanged=function(t){t?this.textarea.setAttribute("aria-label",t):this.textarea.removeAttribute("aria-label")},ol.prototype.prepareSelection=function(){var t=this.cm,e=t.display,n=t.doc,r=Ur(t);if(t.options.moveInputWithCursor){var i=br(t,n.sel.primary().head,"div"),o=e.wrapper.getBoundingClientRect(),a=e.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(e.wrapper.clientHeight-10,i.top+a.top-o.top)),r.teLeft=Math.max(0,Math.min(e.wrapper.clientWidth-10,i.left+a.left-o.left))}return r},ol.prototype.showSelection=function(t){var e=this.cm.display;D(e.cursorDiv,t.cursors),D(e.selectionDiv,t.selection),null!=t.teTop&&(this.wrapper.style.top=t.teTop+"px",this.wrapper.style.left=t.teLeft+"px")},ol.prototype.reset=function(t){if(!this.contextMenuPending&&!this.composing){var e=this.cm;if(e.somethingSelected()){this.prevInput="";var n=e.getSelection();this.textarea.value=n,e.state.focused&&I(this.textarea),a&&s>=9&&(this.hasSelection=n)}else t||(this.prevInput=this.textarea.value="",a&&s>=9&&(this.hasSelection=null))}},ol.prototype.getField=function(){return this.textarea},ol.prototype.supportsTouch=function(){return!1},ol.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!v||O()!=this.textarea))try{this.textarea.focus()}catch(t){}},ol.prototype.blur=function(){this.textarea.blur()},ol.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},ol.prototype.receivedFocus=function(){this.slowPoll()},ol.prototype.slowPoll=function(){var t=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){t.poll(),t.cm.state.focused&&t.slowPoll()}))},ol.prototype.fastPoll=function(){var t=!1,e=this;function n(){e.poll()||t?(e.pollingFast=!1,e.slowPoll()):(t=!0,e.polling.set(60,n))}e.pollingFast=!0,e.polling.set(20,n)},ol.prototype.poll=function(){var t=this,e=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!e.state.focused||It(n)&&!r&&!this.composing||e.isReadOnly()||e.options.disableInput||e.state.keySeq)return!1;var i=n.value;if(i==r&&!e.somethingSelected())return!1;if(a&&s>=9&&this.hasSelection===i||y&&/[\uf700-\uf7ff]/.test(i))return e.display.input.reset(),!1;if(e.doc.sel==e.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||r||(r="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var l=0,u=Math.min(r.length,i.length);l1e3||i.indexOf("\n")>-1?n.value=t.prevInput="":t.prevInput=i,t.composing&&(t.composing.range.clear(),t.composing.range=e.markText(t.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},ol.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},ol.prototype.onKeyPress=function(){a&&s>=9&&(this.hasSelection=null),this.fastPoll()},ol.prototype.onContextMenu=function(t){var e=this,n=e.cm,r=n.display,i=e.textarea;e.contextMenuPending&&e.contextMenuPending();var o=Ir(n,t),u=r.scroller.scrollTop;if(o&&!d){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(o)&&Oi(n,Vo)(n.doc,so(o),Y);var c,h=i.style.cssText,f=e.wrapper.style.cssText,p=e.wrapper.offsetParent.getBoundingClientRect();if(e.wrapper.style.cssText="position: static",i.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(t.clientY-p.top-5)+"px; left: "+(t.clientX-p.left-5)+"px;\n z-index: 1000; background: "+(a?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",l&&(c=window.scrollY),r.input.focus(),l&&window.scrollTo(null,c),r.input.reset(),n.somethingSelected()||(i.value=e.prevInput=" "),e.contextMenuPending=v,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),a&&s>=9&&m(),k){Mt(t);var g=function(){mt(window,"mouseup",g),setTimeout(v,20)};pt(window,"mouseup",g)}else setTimeout(v,50)}function m(){if(null!=i.selectionStart){var t=n.somethingSelected(),o="​"+(t?i.value:"");i.value="⇚",i.value=o,e.prevInput=t?"":"​",i.selectionStart=1,i.selectionEnd=o.length,r.selForContextMenu=n.doc.sel}}function v(){if(e.contextMenuPending==v&&(e.contextMenuPending=!1,e.wrapper.style.cssText=f,i.style.cssText=h,a&&s<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=u),null!=i.selectionStart)){(!a||a&&s<9)&&m();var t=0,o=function(){r.selForContextMenu==n.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&"​"==e.prevInput?Oi(n,Zo)(n):t++<10?r.detectingSelectAll=setTimeout(o,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(o,200)}}},ol.prototype.readOnlyChanged=function(t){t||this.reset(),this.textarea.disabled="nocursor"==t,this.textarea.readOnly=!!t},ol.prototype.setUneditable=function(){},ol.prototype.needsContentAttribute=!1,Fs(Ws),Ks(Ws);var ll="iter insert remove copy getEditor constructor".split(" ");for(var ul in ka.prototype)ka.prototype.hasOwnProperty(ul)&&H(ll,ul)<0&&(Ws.prototype[ul]=function(t){return function(){return t.apply(this.doc,arguments)}}(ka.prototype[ul]));return wt(ka),Ws.inputStyles={textarea:ol,contenteditable:Js},Ws.defineMode=function(t){Ws.defaults.mode||"null"==t||(Ws.defaults.mode=t),Bt.apply(this,arguments)},Ws.defineMIME=Vt,Ws.defineMode("null",(function(){return{token:function(t){return t.skipToEnd()}}})),Ws.defineMIME("text/plain","null"),Ws.defineExtension=function(t,e){Ws.prototype[t]=e},Ws.defineDocExtension=function(t,e){ka.prototype[t]=e},Ws.fromTextArea=al,sl(Ws),Ws.version="5.58.3",Ws}()}));ct((function(t,e){!function(t){function e(e,r){function i(){e.display.wrapper.offsetHeight?(n(e,r),e.display.lastWrapHeight!=e.display.wrapper.clientHeight&&e.refresh()):r.timeout=setTimeout(i,r.delay)}r.timeout=setTimeout(i,r.delay),r.hurry=function(){clearTimeout(r.timeout),r.timeout=setTimeout(i,50)},t.on(window,"mouseup",r.hurry),t.on(window,"keyup",r.hurry)}function n(e,n){clearTimeout(n.timeout),t.off(window,"mouseup",n.hurry),t.off(window,"keyup",n.hurry)}t.defineOption("autoRefresh",!1,(function(t,r){t.state.autoRefresh&&(n(t,t.state.autoRefresh),t.state.autoRefresh=null),r&&0==t.display.wrapper.offsetHeight&&e(t,t.state.autoRefresh={delay:r.delay||250})}))}(dt)})),ct((function(t,e){var n,r,i;r={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},i={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1},(n=dt).defineMode("xml",(function(t,e){var o,a,s=t.indentUnit,l={},u=e.htmlMode?r:i;for(var c in u)l[c]=u[c];for(var c in e)l[c]=e[c];function d(t,e){function n(n){return e.tokenize=n,n(t,e)}var r=t.next();return"<"==r?t.eat("!")?t.eat("[")?t.match("CDATA[")?n(p("atom","]]>")):null:t.match("--")?n(p("comment","--\x3e")):t.match("DOCTYPE",!0,!0)?(t.eatWhile(/[\w\._\-]/),n(g(1))):null:t.eat("?")?(t.eatWhile(/[\w\._\-]/),e.tokenize=p("meta","?>"),"meta"):(o=t.eat("/")?"closeTag":"openTag",e.tokenize=h,"tag bracket"):"&"==r?(t.eat("#")?t.eat("x")?t.eatWhile(/[a-fA-F\d]/)&&t.eat(";"):t.eatWhile(/[\d]/)&&t.eat(";"):t.eatWhile(/[\w\.\-:]/)&&t.eat(";"))?"atom":"error":(t.eatWhile(/[^&<]/),null)}function h(t,e){var n=t.next();if(">"==n||"/"==n&&t.eat(">"))return e.tokenize=d,o=">"==n?"endTag":"selfcloseTag","tag bracket";if("="==n)return o="equals",null;if("<"==n){e.tokenize=d,e.state=b,e.tagName=e.tagStart=null;var r=e.tokenize(t,e);return r?r+" tag error":"tag error"}return/[\'\"]/.test(n)?(e.tokenize=f(n),e.stringStartCol=t.column(),e.tokenize(t,e)):(t.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function f(t){var e=function(e,n){for(;!e.eol();)if(e.next()==t){n.tokenize=h;break}return"string"};return e.isInAttribute=!0,e}function p(t,e){return function(n,r){for(;!n.eol();){if(n.match(e)){r.tokenize=d;break}n.next()}return t}}function g(t){return function(e,n){for(var r;null!=(r=e.next());){if("<"==r)return n.tokenize=g(t+1),n.tokenize(e,n);if(">"==r){if(1==t){n.tokenize=d;break}return n.tokenize=g(t-1),n.tokenize(e,n)}}return"meta"}}function m(t,e,n){this.prev=t.context,this.tagName=e||"",this.indent=t.indented,this.startOfLine=n,(l.doNotIndent.hasOwnProperty(e)||t.context&&t.context.noIndent)&&(this.noIndent=!0)}function v(t){t.context&&(t.context=t.context.prev)}function y(t,e){for(var n;;){if(!t.context)return;if(n=t.context.tagName,!l.contextGrabbers.hasOwnProperty(n)||!l.contextGrabbers[n].hasOwnProperty(e))return;v(t)}}function b(t,e,n){return"openTag"==t?(n.tagStart=e.column(),x):"closeTag"==t?w:b}function x(t,e,n){return"word"==t?(n.tagName=e.current(),a="tag",S):l.allowMissingTagName&&"endTag"==t?(a="tag bracket",S(t,e,n)):(a="error",x)}function w(t,e,n){if("word"==t){var r=e.current();return n.context&&n.context.tagName!=r&&l.implicitlyClosed.hasOwnProperty(n.context.tagName)&&v(n),n.context&&n.context.tagName==r||!1===l.matchClosing?(a="tag",_):(a="tag error",k)}return l.allowMissingTagName&&"endTag"==t?(a="tag bracket",_(t,e,n)):(a="error",k)}function _(t,e,n){return"endTag"!=t?(a="error",_):(v(n),b)}function k(t,e,n){return a="error",_(t,e,n)}function S(t,e,n){if("word"==t)return a="attribute",M;if("endTag"==t||"selfcloseTag"==t){var r=n.tagName,i=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==t||l.autoSelfClosers.hasOwnProperty(r)?y(n,r):(y(n,r),n.context=new m(n,r,i==n.indented)),b}return a="error",S}function M(t,e,n){return"equals"==t?C:(l.allowMissing||(a="error"),S(t,e,n))}function C(t,e,n){return"string"==t?T:"word"==t&&l.allowUnquoted?(a="string",S):(a="error",S(t,e,n))}function T(t,e,n){return"string"==t?T:S(t,e,n)}return d.isInText=!0,{startState:function(t){var e={tokenize:d,state:b,indented:t||0,tagName:null,tagStart:null,context:null};return null!=t&&(e.baseIndent=t),e},token:function(t,e){if(!e.tagName&&t.sol()&&(e.indented=t.indentation()),t.eatSpace())return null;o=null;var n=e.tokenize(t,e);return(n||o)&&"comment"!=n&&(a=null,e.state=e.state(o||n,t,e),a&&(n="error"==a?n+" error":a)),n},indent:function(t,e,r){var i=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+s;if(i&&i.noIndent)return n.Pass;if(t.tokenize!=h&&t.tokenize!=d)return r?r.match(/^(\s*)/)[0].length:0;if(t.tagName)return!1!==l.multilineTagIndentPastTag?t.tagStart+t.tagName.length+2:t.tagStart+s*(l.multilineTagIndentFactor||1);if(l.alignCDATA&&/$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:l.htmlMode?"html":"xml",helperType:l.htmlMode?"html":"xml",skipAttribute:function(t){t.state==C&&(t.state=S)},xmlCurrentTag:function(t){return t.tagName?{name:t.tagName,close:"closeTag"==t.type}:null},xmlCurrentContext:function(t){for(var e=[],n=t.context;n;n=n.prev)e.push(n.tagName);return e.reverse()}}})),n.defineMIME("text/xml","xml"),n.defineMIME("application/xml","xml"),n.mimeModes.hasOwnProperty("text/html")||n.defineMIME("text/html",{name:"xml",htmlMode:!0})})),ct((function(t,e){var n;(n=dt).defineMode("yaml",(function(){var t=new RegExp("\\b(("+["true","false","on","off","yes","no"].join(")|(")+"))$","i");return{token:function(e,n){var r=e.peek(),i=n.escaped;if(n.escaped=!1,"#"==r&&(0==e.pos||/\s/.test(e.string.charAt(e.pos-1))))return e.skipToEnd(),"comment";if(e.match(/^('([^']|\\.)*'?|"([^"]|\\.)*"?)/))return"string";if(n.literal&&e.indentation()>n.keyCol)return e.skipToEnd(),"string";if(n.literal&&(n.literal=!1),e.sol()){if(n.keyCol=0,n.pair=!1,n.pairStart=!1,e.match(/---/))return"def";if(e.match(/\.\.\./))return"def";if(e.match(/\s*-\s+/))return"meta"}if(e.match(/^(\{|\}|\[|\])/))return"{"==r?n.inlinePairs++:"}"==r?n.inlinePairs--:"["==r?n.inlineList++:n.inlineList--,"meta";if(n.inlineList>0&&!i&&","==r)return e.next(),"meta";if(n.inlinePairs>0&&!i&&","==r)return n.keyCol=0,n.pair=!1,n.pairStart=!1,e.next(),"meta";if(n.pairStart){if(e.match(/^\s*(\||\>)\s*/))return n.literal=!0,"meta";if(e.match(/^\s*(\&|\*)[a-z0-9\._-]+\b/i))return"variable-2";if(0==n.inlinePairs&&e.match(/^\s*-?[0-9\.\,]+\s?$/))return"number";if(n.inlinePairs>0&&e.match(/^\s*-?[0-9\.\,]+\s?(?=(,|}))/))return"number";if(e.match(t))return"keyword"}return!n.pair&&e.match(/^\s*(?:[,\[\]{}&*!|>'"%@`][^\s'":]|[^,\[\]{}#&*!|>'"%@`])[^#]*?(?=\s*:($|\s))/)?(n.pair=!0,n.keyCol=e.indentation(),"atom"):n.pair&&e.match(/^:\s*/)?(n.pairStart=!0,"meta"):(n.pairStart=!1,n.escaped="\\"==r,e.next(),null)},startState:function(){return{pair:!1,pairStart:!1,keyCol:0,inlinePairs:0,inlineList:0,literal:!1,escaped:!1}},lineComment:"#",fold:"indent"}})),n.defineMIME("text/x-yaml","yaml"),n.defineMIME("text/yaml","yaml")})),ct((function(t,e){!function(t){function e(t){return new RegExp("^(("+t.join(")|(")+"))\\b")}var n=e(["and","or","not","is"]),r=["as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","lambda","pass","raise","return","try","while","with","yield","in"],i=["abs","all","any","bin","bool","bytearray","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip","__import__","NotImplemented","Ellipsis","__debug__"];function o(t){return t.scopes[t.scopes.length-1]}t.registerHelper("hintWords","python",r.concat(i)),t.defineMode("python",(function(a,s){for(var l="error",u=s.delimiters||s.singleDelimiters||/^[\(\)\[\]\{\}@,:`=;\.\\]/,c=[s.singleOperators,s.doubleOperators,s.doubleDelimiters,s.tripleDelimiters,s.operators||/^([-+*/%\/&|^]=?|[<>=]+|\/\/=?|\*\*=?|!=|[~!@]|\.\.\.)/],d=0;dr?S(e):i0&&C(t,e)&&(a+=" "+l),a}return w(t,e)}function w(t,e,r){if(t.eatSpace())return null;if(!r&&t.match(/^#.*/))return"comment";if(t.match(/^[0-9\.]/,!1)){var i=!1;if(t.match(/^[\d_]*\.\d+(e[\+\-]?\d+)?/i)&&(i=!0),t.match(/^[\d_]+\.\d*/)&&(i=!0),t.match(/^\.\d+/)&&(i=!0),i)return t.eat(/J/i),"number";var o=!1;if(t.match(/^0x[0-9a-f_]+/i)&&(o=!0),t.match(/^0b[01_]+/i)&&(o=!0),t.match(/^0o[0-7_]+/i)&&(o=!0),t.match(/^[1-9][\d_]*(e[\+\-]?[\d_]+)?/)&&(t.eat(/J/i),o=!0),t.match(/^0(?![\dx])/i)&&(o=!0),o)return t.eat(/L/i),"number"}if(t.match(v))return-1!==t.current().toLowerCase().indexOf("f")?(e.tokenize=_(t.current(),e.tokenize),e.tokenize(t,e)):(e.tokenize=k(t.current(),e.tokenize),e.tokenize(t,e));for(var a=0;a=0;)t=t.substr(1);var n=1==t.length,r="string";function i(t){return function(e,n){var r=w(e,n,!0);return"punctuation"==r&&("{"==e.current()?n.tokenize=i(t+1):"}"==e.current()&&(n.tokenize=t>1?i(t-1):o)),r}}function o(o,a){for(;!o.eol();)if(o.eatWhile(/[^'"\{\}\\]/),o.eat("\\")){if(o.next(),n&&o.eol())return r}else{if(o.match(t))return a.tokenize=e,r;if(o.match("{{"))return r;if(o.match("{",!1))return a.tokenize=i(0),o.current()?r:a.tokenize(o,a);if(o.match("}}"))return r;if(o.match("}"))return l;o.eat(/['"]/)}if(n){if(s.singleLineStringErrors)return l;a.tokenize=e}return r}return o.isString=!0,o}function k(t,e){for(;"rubf".indexOf(t.charAt(0).toLowerCase())>=0;)t=t.substr(1);var n=1==t.length,r="string";function i(i,o){for(;!i.eol();)if(i.eatWhile(/[^'"\\]/),i.eat("\\")){if(i.next(),n&&i.eol())return r}else{if(i.match(t))return o.tokenize=e,r;i.eat(/['"]/)}if(n){if(s.singleLineStringErrors)return l;o.tokenize=e}return r}return i.isString=!0,i}function S(t){for(;"py"!=o(t).type;)t.scopes.pop();t.scopes.push({offset:o(t).offset+a.indentUnit,type:"py",align:null})}function M(t,e,n){var r=t.match(/^([\s\[\{\(]|#.*)*$/,!1)?null:t.column()+1;e.scopes.push({offset:e.indent+h,type:n,align:r})}function C(t,e){for(var n=t.indentation();e.scopes.length>1&&o(e).offset>n;){if("py"!=o(e).type)return!0;e.scopes.pop()}return o(e).offset!=n}function T(t,e){t.sol()&&(e.beginningOfLine=!0);var n=e.tokenize(t,e),r=t.current();if(e.beginningOfLine&&"@"==r)return t.match(m,!1)?"meta":g?"operator":l;if(/\S/.test(r)&&(e.beginningOfLine=!1),"variable"!=n&&"builtin"!=n||"meta"!=e.lastToken||(n="meta"),"pass"!=r&&"return"!=r||(e.dedent+=1),"lambda"==r&&(e.lambda=!0),":"!=r||e.lambda||"py"!=o(e).type||S(e),1==r.length&&!/string|comment/.test(n)){var i="[({".indexOf(r);if(-1!=i&&M(t,e,"])}".slice(i,i+1)),-1!=(i="])}".indexOf(r))){if(o(e).type!=r)return l;e.indent=e.scopes.pop().offset-h}}return e.dedent>0&&t.eol()&&"py"==o(e).type&&(e.scopes.length>1&&e.scopes.pop(),e.dedent-=1),n}return{startState:function(t){return{tokenize:x,scopes:[{offset:t||0,type:"py",align:null}],indent:t||0,lastToken:null,lambda:!1,dedent:0}},token:function(t,e){var n=e.errorToken;n&&(e.errorToken=!1);var r=T(t,e);return r&&"comment"!=r&&(e.lastToken="keyword"==r||"punctuation"==r?t.current():r),"punctuation"==r&&(r=null),t.eol()&&e.lambda&&(e.lambda=!1),n?r+" "+l:r},indent:function(e,n){if(e.tokenize!=x)return e.tokenize.isString?t.Pass:0;var r=o(e),i=r.type==n.charAt(0);return null!=r.align?r.align-(i?1:0):r.offset-(i?h:0)},electricInput:/^\s*[\}\]\)]$/,closeBrackets:{triples:"'\""},lineComment:"#",fold:"indent"}})),t.defineMIME("text/x-python","python");var a=function(t){return t.split(" ")};t.defineMIME("text/x-cython",{name:"python",extra_keywords:a("by cdef cimport cpdef ctypedef enum except extern gil include nogil property public readonly struct union DEF IF ELIF ELSE")})}(dt)}));let ht=class extends nt{constructor(){super(...arguments),this.readOnly=!1,this.mode="yaml"}createRenderRoot(){return this}firstUpdated(){const t=this.querySelector("textarea");t&&(this.editor=dt.fromTextArea(t,{mode:this.mode,theme:"monokai",lineNumbers:!1,readOnly:this.readOnly,autoRefresh:!0}),this.editor.on("blur",(t=>{var e;null===(e=this.editor)||void 0===e||e.save()})))}};t([Z()],ht.prototype,"readOnly",void 0),t([Z()],ht.prototype,"mode",void 0),ht=t([$("pb-codemirror")],ht);let ft=class extends nt{constructor(){super();const t=this.querySelector(".pf-c-dropdown__menu");this.querySelectorAll("button").forEach((e=>{e.addEventListener("click",(e=>{t.hidden=!t.hidden}))}))}render(){return W``}};ft=t([$("pb-dropdown")],ft);let pt=class extends nt{constructor(){super(...arguments),this.url="",this.key="",this.value=""}comparison(t){let e={"<":function(t,e){return t":function(t,e){return t>e},">=":function(t,e){return t>=e},"<=":function(t,e){return t<=e},"==":function(t,e){return t==e},"!=":function(t,e){return t!=e},"===":function(t,e){return t===e},"!==":function(t,e){return t!==e}};const n=t.split(" ");if(n.length<3)throw new Error("nah");let r=n[0];r="value"===r?this.value:parseInt(r,10);let i=n[2];i="value"===i?this.value:parseInt(i,10);const o=n[1];if(!(o in e))throw new Error("Invalid comparison");return e[o](r,i)}firstUpdated(){fetch(this.url).then((t=>t.json())).then((t=>t[this.key])).then((t=>this.value=t))}render(){if(void 0===this.value)return W``;let t="";return this.querySelectorAll("[slot]").forEach((e=>{const n=e.getAttribute("slot");this.comparison(n)&&(t=n)})),this.querySelectorAll("[data-value]").forEach((t=>{t.textContent=this.value})),W``}};t([Z()],pt.prototype,"url",void 0),t([Z()],pt.prototype,"key",void 0),t([Z()],pt.prototype,"value",void 0),pt=t([$("fetch-fill-slot")],pt);const gt=new CSSStyleSheet;gt.replaceSync(".pf-c-modal-box {\n --pf-c-modal-box--BackgroundColor: var(--pf-global--BackgroundColor--100);\n --pf-c-modal-box--BoxShadow: var(--pf-global--BoxShadow--xl);\n --pf-c-modal-box--ZIndex: var(--pf-global--ZIndex--xl);\n --pf-c-modal-box--Width: 100%;\n --pf-c-modal-box--MaxWidth: calc(100% - var(--pf-global--spacer--xl));\n --pf-c-modal-box--m-sm--sm--MaxWidth: 35rem;\n --pf-c-modal-box--m-md--Width: 52.5rem;\n --pf-c-modal-box--m-lg--lg--MaxWidth: 70rem;\n --pf-c-modal-box--MaxHeight: calc(100% - var(--pf-global--spacer--2xl));\n --pf-c-modal-box--m-align-top--spacer: var(--pf-global--spacer--sm);\n --pf-c-modal-box--m-align-top--xl--spacer: var(--pf-global--spacer--xl);\n --pf-c-modal-box--m-align-top--MarginTop: var(--pf-c-modal-box--m-align-top--spacer);\n --pf-c-modal-box--m-align-top--MaxHeight: calc(100% - min(var(--pf-c-modal-box--m-align-top--spacer), var(--pf-global--spacer--2xl)) - var(--pf-c-modal-box--m-align-top--spacer));\n --pf-c-modal-box--m-align-top--MaxWidth: calc(100% - min(var(--pf-c-modal-box--m-align-top--spacer) * 2, var(--pf-global--spacer--xl)));\n --pf-c-modal-box--m-danger__title-icon--Color: var(--pf-global--danger-color--100);\n --pf-c-modal-box--m-warning__title-icon--Color: var(--pf-global--warning-color--100);\n --pf-c-modal-box--m-success__title-icon--Color: var(--pf-global--success-color--100);\n --pf-c-modal-box--m-info__title-icon--Color: var(--pf-global--info-color--100);\n --pf-c-modal-box--m-default__title-icon--Color: var(--pf-global--default-color--200);\n --pf-c-modal-box__header--PaddingTop: var(--pf-global--spacer--lg);\n --pf-c-modal-box__header--PaddingRight: var(--pf-global--spacer--lg);\n --pf-c-modal-box__header--PaddingLeft: var(--pf-global--spacer--lg);\n --pf-c-modal-box__header--last-child--PaddingBottom: var(--pf-global--spacer--lg);\n --pf-c-modal-box__title--LineHeight: var(--pf-global--LineHeight--sm);\n --pf-c-modal-box__title--FontFamily: var(--pf-global--FontFamily--heading--sans-serif);\n --pf-c-modal-box__title--FontSize: var(--pf-global--FontSize--2xl);\n --pf-c-modal-box__title-icon--MarginRight: var(--pf-global--spacer--sm);\n --pf-c-modal-box__title-icon--Color: var(--pf-global--Color--100);\n --pf-c-modal-box__description--PaddingTop: var(--pf-global--spacer--xs);\n --pf-c-modal-box__body--MinHeight: calc(var(--pf-global--FontSize--md) * var(--pf-global--LineHeight--md));\n --pf-c-modal-box__body--PaddingTop: var(--pf-global--spacer--lg);\n --pf-c-modal-box__body--PaddingRight: var(--pf-global--spacer--lg);\n --pf-c-modal-box__body--PaddingLeft: var(--pf-global--spacer--lg);\n --pf-c-modal-box__body--last-child--PaddingBottom: var(--pf-global--spacer--lg);\n --pf-c-modal-box__header--body--PaddingTop: var(--pf-global--spacer--md);\n --pf-c-modal-box--c-button--Top: calc(var(--pf-global--spacer--lg));\n --pf-c-modal-box--c-button--Right: var(--pf-global--spacer--md);\n --pf-c-modal-box--c-button--sibling--MarginRight: calc(var(--pf-global--spacer--xl) + var(--pf-global--spacer--sm));\n --pf-c-modal-box__footer--PaddingTop: var(--pf-global--spacer--lg);\n --pf-c-modal-box__footer--PaddingRight: var(--pf-global--spacer--lg);\n --pf-c-modal-box__footer--PaddingBottom: var(--pf-global--spacer--lg);\n --pf-c-modal-box__footer--PaddingLeft: var(--pf-global--spacer--lg);\n --pf-c-modal-box__footer--c-button--MarginRight: var(--pf-global--spacer--md);\n --pf-c-modal-box__footer--c-button--sm--MarginRight: calc(var(--pf-c-modal-box__footer--c-button--MarginRight) / 2);\n position: relative;\n z-index: var(--pf-c-modal-box--ZIndex);\n display: flex;\n flex-direction: column;\n width: var(--pf-c-modal-box--Width);\n max-width: var(--pf-c-modal-box--MaxWidth);\n max-height: var(--pf-c-modal-box--MaxHeight);\n background-color: var(--pf-c-modal-box--BackgroundColor);\n box-shadow: var(--pf-c-modal-box--BoxShadow); }\n @media (min-width: 1200px) {\n .pf-c-modal-box {\n --pf-c-modal-box--m-align-top--spacer: var(--pf-c-modal-box--m-align-top--xl--spacer); } }\n .pf-c-modal-box.pf-m-sm {\n --pf-c-modal-box--Width: var(--pf-c-modal-box--m-sm--sm--MaxWidth); }\n .pf-c-modal-box.pf-m-md {\n --pf-c-modal-box--Width: var(--pf-c-modal-box--m-md--Width); }\n .pf-c-modal-box.pf-m-lg {\n --pf-c-modal-box--Width: var(--pf-c-modal-box--m-lg--lg--MaxWidth); }\n .pf-c-modal-box.pf-m-align-top {\n top: var(--pf-c-modal-box--m-align-top--MarginTop);\n align-self: flex-start;\n max-width: var(--pf-c-modal-box--m-align-top--MaxWidth);\n max-height: var(--pf-c-modal-box--m-align-top--MaxHeight); }\n .pf-c-modal-box.pf-m-danger {\n --pf-c-modal-box__title-icon--Color: var(--pf-c-modal-box--m-danger__title-icon--Color); }\n .pf-c-modal-box.pf-m-warning {\n --pf-c-modal-box__title-icon--Color: var(--pf-c-modal-box--m-warning__title-icon--Color); }\n .pf-c-modal-box.pf-m-success {\n --pf-c-modal-box__title-icon--Color: var(--pf-c-modal-box--m-success__title-icon--Color); }\n .pf-c-modal-box.pf-m-default {\n --pf-c-modal-box__title-icon--Color: var(--pf-c-modal-box--m-default__title-icon--Color); }\n .pf-c-modal-box.pf-m-info {\n --pf-c-modal-box__title-icon--Color: var(--pf-c-modal-box--m-info__title-icon--Color); }\n .pf-c-modal-box > .pf-c-button {\n position: absolute;\n top: var(--pf-c-modal-box--c-button--Top);\n right: var(--pf-c-modal-box--c-button--Right); }\n .pf-c-modal-box > .pf-c-button + * {\n margin-right: var(--pf-c-modal-box--c-button--sibling--MarginRight); }\n\n.pf-c-modal-box__header {\n display: flex;\n flex-direction: column;\n padding-top: var(--pf-c-modal-box__header--PaddingTop);\n padding-right: var(--pf-c-modal-box__header--PaddingRight);\n padding-left: var(--pf-c-modal-box__header--PaddingLeft); }\n .pf-c-modal-box__header.pf-m-help {\n display: flex;\n flex-direction: row; }\n .pf-c-modal-box__header:last-child {\n padding-bottom: var(--pf-c-modal-box__header--last-child--PaddingBottom); }\n .pf-c-modal-box__header + .pf-c-modal-box__body {\n --pf-c-modal-box__body--PaddingTop: var(--pf-c-modal-box__header--body--PaddingTop); }\n\n.pf-c-modal-box__header-main {\n flex-grow: 1;\n min-width: 0; }\n\n.pf-c-modal-box__title,\n.pf-c-modal-box__title-text {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap; }\n\n.pf-c-modal-box__title {\n flex: 0 0 auto;\n font-family: var(--pf-c-modal-box__title--FontFamily);\n font-size: var(--pf-c-modal-box__title--FontSize);\n line-height: var(--pf-c-modal-box__title--LineHeight); }\n .pf-c-modal-box__title.pf-m-icon {\n display: flex; }\n\n.pf-c-modal-box__title-icon {\n margin-right: var(--pf-c-modal-box__title-icon--MarginRight);\n color: var(--pf-c-modal-box__title-icon--Color); }\n\n.pf-c-modal-box__description {\n padding-top: var(--pf-c-modal-box__description--PaddingTop); }\n\n.pf-c-modal-box__body {\n flex: 1 1 auto;\n min-height: var(--pf-c-modal-box__body--MinHeight);\n padding-top: var(--pf-c-modal-box__body--PaddingTop);\n padding-right: var(--pf-c-modal-box__body--PaddingRight);\n padding-left: var(--pf-c-modal-box__body--PaddingLeft);\n overflow-x: hidden;\n overflow-y: auto;\n overscroll-behavior: contain;\n word-break: break-word;\n -webkit-overflow-scrolling: touch; }\n .pf-c-modal-box__body:last-child {\n padding-bottom: var(--pf-c-modal-box__body--last-child--PaddingBottom); }\n\n.pf-c-modal-box__footer {\n display: flex;\n flex: 0 0 auto;\n align-items: center;\n padding-top: var(--pf-c-modal-box__footer--PaddingTop);\n padding-right: var(--pf-c-modal-box__footer--PaddingRight);\n padding-bottom: var(--pf-c-modal-box__footer--PaddingBottom);\n padding-left: var(--pf-c-modal-box__footer--PaddingLeft); }\n .pf-c-modal-box__footer > .pf-c-button:not(:last-child) {\n margin-right: var(--pf-c-modal-box__footer--c-button--MarginRight); }\n @media screen and (min-width: 576px) {\n .pf-c-modal-box__footer > .pf-c-button:not(:last-child) {\n --pf-c-modal-box__footer--c-button--MarginRight: var(--pf-c-modal-box__footer--c-button--sm--MarginRight); } }\n");const mt=new CSSStyleSheet;mt.replaceSync(".pf-l-bullseye {\n --pf-l-bullseye--Padding: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n padding: var(--pf-l-bullseye--Padding);\n margin: 0; }\n");const vt=new CSSStyleSheet;vt.replaceSync(".pf-c-backdrop {\n --pf-c-backdrop--ZIndex: var(--pf-global--ZIndex--lg);\n --pf-c-backdrop--BackgroundColor: var(--pf-global--BackgroundColor--dark-transparent-100);\n position: fixed;\n top: 0;\n left: 0;\n z-index: var(--pf-c-backdrop--ZIndex);\n width: 100%;\n height: 100%;\n background-color: var(--pf-c-backdrop--BackgroundColor); }\n\n.pf-c-backdrop__open {\n overflow: hidden; }\n");let yt=class extends nt{constructor(){super(),this.href="",this.open=!1,window.addEventListener("keyup",(t=>{"Escape"===t.code&&(this.open=!1)}))}static get styles(){return[gt,mt,vt]}setContent(t){this.querySelector("[slot=modal]").innerHTML=t,this.querySelectorAll("[slot=modal] a").forEach((t=>{t.addEventListener("click",(t=>{t.preventDefault(),this.open=!1}))})),this.querySelectorAll("input[name=name]").forEach((t=>{t.addEventListener("input",(e=>{const n=t.closest("form");if(null===n)return;const r=n.querySelector("input[name=slug]");r&&(r.value=t.value.toLowerCase().replace(/ /g,"-").replace(/[^\w-]+/g,""))}))})),this.querySelectorAll("[slot=modal] form").forEach((t=>{t.addEventListener("submit",(e=>{e.preventDefault();let n=new FormData(t);fetch(t.action===window.location.toString()?this.href:t.action,{method:t.method,body:n}).then((t=>t.text())).then((t=>{-1!==t.indexOf("csrfmiddlewaretoken")?this.setContent(t):(this.open=!1,this.dispatchEvent(new CustomEvent("hashchange",{bubbles:!0})),it())})).catch((t=>{console.error(t)}))}))}))}onClick(t){const e=new Request(this.href);fetch(e,{mode:"same-origin"}).then((t=>t.text())).then((t=>{this.setContent(t),this.open=!0})).catch((t=>{console.error(t)}))}renderModal(){return W`
    `}render(){return W`${this.open?this.renderModal():""}`}};t([Z()],yt.prototype,"href",void 0),t([Z()],yt.prototype,"open",void 0),yt=t([$("pb-modal-button")],yt);let bt=class extends nt{constructor(){super(...arguments),this._currentPage="",this._firstPage=""}get currentPage(){return this._currentPage}set currentPage(t){var e,n;try{null===(e=this.querySelector(`.pf-c-tab-content[tab-name='${t}']`))||void 0===e||e.removeAttribute("hidden"),null===(n=this.querySelector(`.pf-c-tabs__item[tab-name='${t}']`))||void 0===n||n.classList.add("pf-m-current"),this.querySelectorAll(`.pf-c-tab-content:not([tab-name='${t}'])`).forEach((t=>{t.setAttribute("hidden","")})),this.querySelectorAll(`.pf-c-tabs__item:not([tab-name='${t}'])`).forEach((t=>{t.classList.remove("pf-m-current")})),window.location.hash="#"+t,this._currentPage=t}catch(t){this.currentPage=this._firstPage}}createRenderRoot(){return this}firstUpdated(){var t;this._firstPage=null===(t=this.querySelector(".pf-c-tab-content"))||void 0===t?void 0:t.getAttribute("tab-name"),window.location.hash?this.currentPage=window.location.hash:this.currentPage=this._firstPage,this.querySelectorAll(".pf-c-tabs__item > button").forEach((t=>{t.addEventListener("click",(e=>{var n;let r=null===(n=t.parentElement)||void 0===n?void 0:n.getAttribute("tab-name");this.currentPage=r}))}))}};bt=t([$("pb-tabs")],bt);const xt=new CSSStyleSheet;xt.replaceSync('.pf-c-spinner {\n --pf-c-spinner--AnimationDuration: 1.5s;\n --pf-c-spinner--AnimationTimingFunction: cubic-bezier(.77, .005, .315, 1);\n --pf-c-spinner--diameter: var(--pf-global--icon--FontSize--xl);\n --pf-c-spinner--stroke-width-multiplier: .1;\n --pf-c-spinner--stroke-width: calc(var(--pf-c-spinner--diameter) * var(--pf-c-spinner--stroke-width-multiplier));\n --pf-c-spinner--Width: var(--pf-c-spinner--diameter);\n --pf-c-spinner--Height: var(--pf-c-spinner--diameter);\n --pf-c-spinner--Color: var(--pf-global--primary-color--100);\n --pf-c-spinner--m-sm--diameter: var(--pf-global--icon--FontSize--sm);\n --pf-c-spinner--m-md--diameter: var(--pf-global--icon--FontSize--md);\n --pf-c-spinner--m-lg--diameter: var(--pf-global--icon--FontSize--lg);\n --pf-c-spinner--m-xl--diameter: var(--pf-global--icon--FontSize--xl);\n --pf-c-spinner__clipper--Width: var(--pf-c-spinner--diameter);\n --pf-c-spinner__clipper--Height: var(--pf-c-spinner--diameter);\n --pf-c-spinner__clipper--after--BoxShadowColor: var(--pf-c-spinner--Color);\n --pf-c-spinner__clipper--after--Width: var(--pf-c-spinner--diameter);\n --pf-c-spinner__clipper--after--Height: var(--pf-c-spinner--diameter);\n --pf-c-spinner__clipper--after--BoxShadowSpreadRadius: var(--pf-c-spinner--stroke-width);\n --pf-c-spinner__lead-ball--after--BackgroundColor: var(--pf-c-spinner--Color);\n --pf-c-spinner__ball--after--Width: var(--pf-c-spinner--stroke-width);\n --pf-c-spinner__ball--after--Height: var(--pf-c-spinner--stroke-width);\n --pf-c-spinner__tail-ball--after--BackgroundColor: var(--pf-c-spinner--Color);\n position: relative;\n display: inline-block;\n width: var(--pf-c-spinner--Width);\n height: var(--pf-c-spinner--Height);\n text-align: left;\n animation: pf-animation-spinner-parent calc(var(--pf-c-spinner--AnimationDuration) * 2) var(--pf-c-spinner--AnimationTimingFunction) infinite; }\n .pf-c-spinner.pf-m-sm {\n --pf-c-spinner--diameter: var(--pf-c-spinner--m-sm--diameter); }\n .pf-c-spinner.pf-m-md {\n --pf-c-spinner--diameter: var(--pf-c-spinner--m-md--diameter); }\n .pf-c-spinner.pf-m-lg {\n --pf-c-spinner--diameter: var(--pf-c-spinner--m-lg--diameter); }\n .pf-c-spinner.pf-m-xl {\n --pf-c-spinner--diameter: var(--pf-c-spinner--m-xl--diameter); }\n\n@keyframes pf-animation-spinner-parent {\n 0% {\n transform: rotate(0deg); }\n 50% {\n transform: rotate(-540deg); }\n 100% {\n transform: rotate(-1080deg); } }\n\n.pf-c-spinner__clipper {\n position: absolute;\n width: var(--pf-c-spinner__clipper--Width);\n height: var(--pf-c-spinner__clipper--Height);\n clip-path: inset(0 0 50% 50%);\n animation: pf-animation-spinner__clipper var(--pf-c-spinner--AnimationDuration) linear infinite; }\n\n@keyframes pf-animation-spinner__clipper {\n 0% {\n transform: rotate(0deg); }\n 100% {\n transform: rotate(-270deg); } }\n\n.pf-c-spinner__clipper::after {\n position: absolute;\n width: var(--pf-c-spinner__clipper--after--Width);\n height: var(--pf-c-spinner__clipper--after--Height);\n clip-path: inset(0 0 0 50%);\n content: "";\n border-radius: 50%;\n box-shadow: inset 0 0 0 var(--pf-c-spinner__clipper--after--BoxShadowSpreadRadius) var(--pf-c-spinner__clipper--after--BoxShadowColor);\n animation: pf-animation-spinner__clipper-after var(--pf-c-spinner--AnimationDuration) linear infinite; }\n\n@keyframes pf-animation-spinner__clipper-after {\n 0% {\n transform: rotate(90deg); }\n 100% {\n transform: rotate(-180deg); } }\n\n.pf-c-spinner__lead-ball {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n animation: pf-animation-spinner__lead-ball var(--pf-c-spinner--AnimationDuration) linear infinite; }\n .pf-c-spinner__lead-ball::after {\n position: absolute;\n top: calc(50% - (var(--pf-c-spinner__ball--after--Height) / 2));\n right: 0;\n width: var(--pf-c-spinner__ball--after--Width);\n height: var(--pf-c-spinner__ball--after--Height);\n content: "";\n background-color: var(--pf-c-spinner__lead-ball--after--BackgroundColor);\n border-radius: 50%;\n transform-origin: top right; }\n\n@keyframes pf-animation-spinner__lead-ball {\n 0% {\n transform: rotate(0deg); }\n 34% {\n transform: rotate(-180deg); }\n 100% {\n transform: rotate(-360deg); } }\n\n.pf-c-spinner__tail-ball {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n animation: pf-animation-spinner__tail-ball var(--pf-c-spinner--AnimationDuration) linear infinite; }\n .pf-c-spinner__tail-ball::after {\n position: absolute;\n top: calc(50% - (var(--pf-c-spinner__ball--after--Height) / 2));\n right: 0;\n width: var(--pf-c-spinner__ball--after--Width);\n height: var(--pf-c-spinner__ball--after--Height);\n content: "";\n background-color: var(--pf-c-spinner__tail-ball--after--BackgroundColor);\n border-radius: 50%;\n transform-origin: top right; }\n\n@keyframes pf-animation-spinner__tail-ball {\n 0% {\n transform: rotate(0deg); }\n 67.5% {\n transform: rotate(-180deg); }\n 100% {\n transform: rotate(-360deg); } }\n');let wt=class extends nt{constructor(){super(),this.loading=!1,this.loadContent(),window.addEventListener("hashchange",(t=>this.loadContent()))}set defaultUrl(t){""===window.location.hash&&void 0!==t&&(window.location.hash="#"+t)}static get styles(){return[tt`:host{position:relative}:host .pf-l-bullseye{position:absolute;height:100%;width:100%;top:0;left:0;z-index:2000}`,mt,xt]}loadContent(){let t=window.location.hash.slice(1,1/0);""!==t&&(this.loading=!0,fetch(t).then((t=>t.text())).then((t=>{this.querySelector("[slot=body]").innerHTML=t})).then((()=>{this.querySelectorAll("a:not(.pb-root-link)").forEach((t=>{if(""!==t.href)try{const e=new URL(t.href),n=e.search||"";t.href=`#${e.pathname}${n}`}catch(e){t.href="#"+t.href}})),this.querySelectorAll("[role=pb-refresh]").forEach((t=>{t.addEventListener("click",(t=>{this.loadContent()}))})),setTimeout((()=>{this.loading=!1}),100)})))}render(){return W`${this.loading?W`
    `:""}`}};var _t;t([Z()],wt.prototype,"defaultUrl",null),t([Z()],wt.prototype,"loading",void 0),wt=t([$("pb-admin-shell")],wt),function(t){t.redirect="redirect",t.template="template"}(_t||(_t={}));let kt=class extends nt{constructor(){super(...arguments),this.flowBodyUrl=""}createRenderRoot(){return this}firstUpdated(){fetch(this.flowBodyUrl).then((t=>{if(!t.ok)throw Error(t.statusText);return t})).then((t=>t.json())).then((t=>{this.updateCard(t)})).catch((t=>{this.errorMessage(t)}))}async updateCard(t){switch(t.type){case _t.redirect:window.location.assign(t.to);break;case _t.template:this.flowBody=t.body,await this.requestUpdate(),this.checkAutofocus(),it(),this.loadFormCode(),this.setFormSubmitHandlers();default:console.log("passbook/flows: unexpected data type "+t.type)}}loadFormCode(){this.querySelectorAll("script").forEach((t=>{let e=document.createElement("script");e.src=t.src,document.head.appendChild(e)}))}checkAutofocus(){const t=this.querySelector("[autofocus]");null!==t&&t.focus()}updateFormAction(t){for(let e=0;e{console.log("passbook/flows: Checking for autosubmit attribute "+t),this.checkAutosubmit(t),console.log("passbook/flows: Setting action for form "+t),this.updateFormAction(t),console.log("passbook/flows: Adding handler for form "+t),t.addEventListener("submit",(e=>{e.preventDefault();let n=new FormData(t);this.flowBody=void 0,fetch(this.flowBodyUrl,{method:"post",body:n}).then((t=>t.json())).then((t=>{this.updateCard(t)})).catch((t=>{this.errorMessage(t)}))})),t.classList.add("pb-flow-wrapped")}))}errorMessage(t){this.flowBody=`\n \n \n `}loading(){return W``}render(){return this.flowBody?W([this.flowBody]):this.loading()}};t([Z()],kt.prototype,"flowBodyUrl",void 0),t([Z()],kt.prototype,"flowBody",void 0),kt=t([$("pb-flow-shell-card")],kt);var St=ct((function(t,e){t.exports=function(){var e,n;function r(){return e.apply(null,arguments)}function i(t){e=t}function o(t){return t instanceof Array||"[object Array]"===Object.prototype.toString.call(t)}function a(t){return null!=t&&"[object Object]"===Object.prototype.toString.call(t)}function s(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function l(t){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(t).length;var e;for(e in t)if(s(t,e))return!1;return!0}function u(t){return void 0===t}function c(t){return"number"==typeof t||"[object Number]"===Object.prototype.toString.call(t)}function d(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function h(t,e){var n,r=[];for(n=0;n>>0;for(e=0;e0)for(n=0;n=0?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+r}var R=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,W=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,E={},z={};function H(t,e,n,r){var i=r;"string"==typeof r&&(i=function(){return this[r]()}),t&&(z[t]=i),e&&(z[e[0]]=function(){return I(i.apply(this,arguments),e[1],e[2])}),n&&(z[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),t)})}function B(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function V(t){var e,n,r=t.match(R);for(e=0,n=r.length;e=0&&W.test(t);)t=t.replace(W,r),W.lastIndex=0,n-=1;return t}var j={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function G(t){var e=this._longDateFormat[t],n=this._longDateFormat[t.toUpperCase()];return e||!n?e:(this._longDateFormat[t]=n.match(R).map((function(t){return"MMMM"===t||"MM"===t||"DD"===t||"dddd"===t?t.slice(1):t})).join(""),this._longDateFormat[t])}var q="Invalid date";function $(){return this._invalidDate}var K="%d",Z=/\d{1,2}/;function X(t){return this._ordinal.replace("%d",t)}var J={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function Q(t,e,n,r){var i=this._relativeTime[n];return L(i)?i(t,e,n,r):i.replace(/%d/i,t)}function tt(t,e){var n=this._relativeTime[t>0?"future":"past"];return L(n)?n(e):n.replace(/%s/i,e)}var et={};function nt(t,e){var n=t.toLowerCase();et[n]=et[n+"s"]=et[e]=t}function rt(t){return"string"==typeof t?et[t]||et[t.toLowerCase()]:void 0}function it(t){var e,n,r={};for(n in t)s(t,n)&&(e=rt(n))&&(r[e]=t[n]);return r}var ot={};function at(t,e){ot[t]=e}function st(t){var e,n=[];for(e in t)s(t,e)&&n.push({unit:e,priority:ot[e]});return n.sort((function(t,e){return t.priority-e.priority})),n}function lt(t){return t%4==0&&t%100!=0||t%400==0}function ct(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function dt(t){var e=+t,n=0;return 0!==e&&isFinite(e)&&(n=ct(e)),n}function ht(t,e){return function(n){return null!=n?(pt(this,t,n),r.updateOffset(this,e),this):ft(this,t)}}function ft(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():NaN}function pt(t,e,n){t.isValid()&&!isNaN(n)&&("FullYear"===e&<(t.year())&&1===t.month()&&29===t.date()?(n=dt(n),t._d["set"+(t._isUTC?"UTC":"")+e](n,t.month(),te(n,t.month()))):t._d["set"+(t._isUTC?"UTC":"")+e](n))}function gt(t){return L(this[t=rt(t)])?this[t]():this}function mt(t,e){if("object"==typeof t){var n,r=st(t=it(t));for(n=0;n68?1900:2e3)};var ve=ht("FullYear",!0);function ye(){return lt(this.year())}function be(t,e,n,r,i,o,a){var s;return t<100&&t>=0?(s=new Date(t+400,e,n,r,i,o,a),isFinite(s.getFullYear())&&s.setFullYear(t)):s=new Date(t,e,n,r,i,o,a),s}function xe(t){var e,n;return t<100&&t>=0?((n=Array.prototype.slice.call(arguments))[0]=t+400,e=new Date(Date.UTC.apply(null,n)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t)):e=new Date(Date.UTC.apply(null,arguments)),e}function we(t,e,n){var r=7+e-n;return-(7+xe(t,0,r).getUTCDay()-e)%7+r-1}function _e(t,e,n,r,i){var o,a,s=1+7*(e-1)+(7+n-r)%7+we(t,r,i);return s<=0?a=me(o=t-1)+s:s>me(t)?(o=t+1,a=s-me(t)):(o=t,a=s),{year:o,dayOfYear:a}}function ke(t,e,n){var r,i,o=we(t.year(),e,n),a=Math.floor((t.dayOfYear()-o-1)/7)+1;return a<1?r=a+Se(i=t.year()-1,e,n):a>Se(t.year(),e,n)?(r=a-Se(t.year(),e,n),i=t.year()+1):(i=t.year(),r=a),{week:r,year:i}}function Se(t,e,n){var r=we(t,e,n),i=we(t+1,e,n);return(me(t)-r+i)/7}function Me(t){return ke(t,this._week.dow,this._week.doy).week}H("w",["ww",2],"wo","week"),H("W",["WW",2],"Wo","isoWeek"),nt("week","w"),nt("isoWeek","W"),at("week",5),at("isoWeek",5),It("w",kt),It("ww",kt,bt),It("W",kt),It("WW",kt,bt),Bt(["w","ww","W","WW"],(function(t,e,n,r){e[r.substr(0,1)]=dt(t)}));var Ce={dow:0,doy:6};function Te(){return this._week.dow}function De(){return this._week.doy}function Le(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")}function Pe(t){var e=ke(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")}function Ae(t,e){return"string"!=typeof t?t:isNaN(t)?"number"==typeof(t=e.weekdaysParse(t))?t:null:parseInt(t,10)}function Oe(t,e){return"string"==typeof t?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}function Ne(t,e){return t.slice(e,7).concat(t.slice(0,e))}H("d",0,"do","day"),H("dd",0,0,(function(t){return this.localeData().weekdaysMin(this,t)})),H("ddd",0,0,(function(t){return this.localeData().weekdaysShort(this,t)})),H("dddd",0,0,(function(t){return this.localeData().weekdays(this,t)})),H("e",0,0,"weekday"),H("E",0,0,"isoWeekday"),nt("day","d"),nt("weekday","e"),nt("isoWeekday","E"),at("day",11),at("weekday",11),at("isoWeekday",11),It("d",kt),It("e",kt),It("E",kt),It("dd",(function(t,e){return e.weekdaysMinRegex(t)})),It("ddd",(function(t,e){return e.weekdaysShortRegex(t)})),It("dddd",(function(t,e){return e.weekdaysRegex(t)})),Bt(["dd","ddd","dddd"],(function(t,e,n,r){var i=n._locale.weekdaysParse(t,r,n._strict);null!=i?e.d=i:m(n).invalidWeekday=t})),Bt(["d","e","E"],(function(t,e,n,r){e[r]=dt(t)}));var Fe="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Ie="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Re="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),We=Ft,Ee=Ft,ze=Ft;function He(t,e){var n=o(this._weekdays)?this._weekdays:this._weekdays[t&&!0!==t&&this._weekdays.isFormat.test(e)?"format":"standalone"];return!0===t?Ne(n,this._week.dow):t?n[t.day()]:n}function Be(t){return!0===t?Ne(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort}function Ve(t){return!0===t?Ne(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin}function Ye(t,e,n){var r,i,o,a=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)o=p([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(o,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(o,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(o,"").toLocaleLowerCase();return n?"dddd"===e?-1!==(i=Yt.call(this._weekdaysParse,a))?i:null:"ddd"===e?-1!==(i=Yt.call(this._shortWeekdaysParse,a))?i:null:-1!==(i=Yt.call(this._minWeekdaysParse,a))?i:null:"dddd"===e?-1!==(i=Yt.call(this._weekdaysParse,a))||-1!==(i=Yt.call(this._shortWeekdaysParse,a))||-1!==(i=Yt.call(this._minWeekdaysParse,a))?i:null:"ddd"===e?-1!==(i=Yt.call(this._shortWeekdaysParse,a))||-1!==(i=Yt.call(this._weekdaysParse,a))||-1!==(i=Yt.call(this._minWeekdaysParse,a))?i:null:-1!==(i=Yt.call(this._minWeekdaysParse,a))||-1!==(i=Yt.call(this._weekdaysParse,a))||-1!==(i=Yt.call(this._shortWeekdaysParse,a))?i:null}function Ue(t,e,n){var r,i,o;if(this._weekdaysParseExact)return Ye.call(this,t,e,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(i=p([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[r]||(o="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[r]=new RegExp(o.replace(".",""),"i")),n&&"dddd"===e&&this._fullWeekdaysParse[r].test(t))return r;if(n&&"ddd"===e&&this._shortWeekdaysParse[r].test(t))return r;if(n&&"dd"===e&&this._minWeekdaysParse[r].test(t))return r;if(!n&&this._weekdaysParse[r].test(t))return r}}function je(t){if(!this.isValid())return null!=t?this:NaN;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=Ae(t,this.localeData()),this.add(t-e,"d")):e}function Ge(t){if(!this.isValid())return null!=t?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")}function qe(t){if(!this.isValid())return null!=t?this:NaN;if(null!=t){var e=Oe(t,this.localeData());return this.day(this.day()%7?e:e-7)}return this.day()||7}function $e(t){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Xe.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(s(this,"_weekdaysRegex")||(this._weekdaysRegex=We),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)}function Ke(t){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Xe.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(s(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Ee),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Ze(t){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Xe.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(s(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=ze),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Xe(){function t(t,e){return e.length-t.length}var e,n,r,i,o,a=[],s=[],l=[],u=[];for(e=0;e<7;e++)n=p([2e3,1]).day(e),r=Et(this.weekdaysMin(n,"")),i=Et(this.weekdaysShort(n,"")),o=Et(this.weekdays(n,"")),a.push(r),s.push(i),l.push(o),u.push(r),u.push(i),u.push(o);a.sort(t),s.sort(t),l.sort(t),u.sort(t),this._weekdaysRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function Je(){return this.hours()%12||12}function Qe(){return this.hours()||24}function tn(t,e){H(t,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)}))}function en(t,e){return e._meridiemParse}function nn(t){return"p"===(t+"").toLowerCase().charAt(0)}H("H",["HH",2],0,"hour"),H("h",["hh",2],0,Je),H("k",["kk",2],0,Qe),H("hmm",0,0,(function(){return""+Je.apply(this)+I(this.minutes(),2)})),H("hmmss",0,0,(function(){return""+Je.apply(this)+I(this.minutes(),2)+I(this.seconds(),2)})),H("Hmm",0,0,(function(){return""+this.hours()+I(this.minutes(),2)})),H("Hmmss",0,0,(function(){return""+this.hours()+I(this.minutes(),2)+I(this.seconds(),2)})),tn("a",!0),tn("A",!1),nt("hour","h"),at("hour",13),It("a",en),It("A",en),It("H",kt),It("h",kt),It("k",kt),It("HH",kt,bt),It("hh",kt,bt),It("kk",kt,bt),It("hmm",St),It("hmmss",Mt),It("Hmm",St),It("Hmmss",Mt),Ht(["H","HH"],qt),Ht(["k","kk"],(function(t,e,n){var r=dt(t);e[qt]=24===r?0:r})),Ht(["a","A"],(function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t})),Ht(["h","hh"],(function(t,e,n){e[qt]=dt(t),m(n).bigHour=!0})),Ht("hmm",(function(t,e,n){var r=t.length-2;e[qt]=dt(t.substr(0,r)),e[$t]=dt(t.substr(r)),m(n).bigHour=!0})),Ht("hmmss",(function(t,e,n){var r=t.length-4,i=t.length-2;e[qt]=dt(t.substr(0,r)),e[$t]=dt(t.substr(r,2)),e[Kt]=dt(t.substr(i)),m(n).bigHour=!0})),Ht("Hmm",(function(t,e,n){var r=t.length-2;e[qt]=dt(t.substr(0,r)),e[$t]=dt(t.substr(r))})),Ht("Hmmss",(function(t,e,n){var r=t.length-4,i=t.length-2;e[qt]=dt(t.substr(0,r)),e[$t]=dt(t.substr(r,2)),e[Kt]=dt(t.substr(i))}));var rn=/[ap]\.?m?\.?/i,on=ht("Hours",!0);function an(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"}var sn,ln={calendar:N,longDateFormat:j,invalidDate:q,ordinal:K,dayOfMonthOrdinalParse:Z,relativeTime:J,months:ee,monthsShort:ne,week:Ce,weekdays:Fe,weekdaysMin:Re,weekdaysShort:Ie,meridiemParse:rn},un={},cn={};function dn(t,e){var n,r=Math.min(t.length,e.length);for(n=0;n0;){if(r=pn(i.slice(0,e).join("-")))return r;if(n&&n.length>=e&&dn(i,n)>=e-1)break;e--}o++}return sn}function pn(e){var n=null;if(void 0===un[e]&&t&&t.exports)try{n=sn._abbr,ut(),gn(n)}catch(t){un[e]=null}return un[e]}function gn(t,e){var n;return t&&((n=u(e)?yn(t):mn(t,e))?sn=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),sn._abbr}function mn(t,e){if(null!==e){var n,r=ln;if(e.abbr=t,null!=un[t])D("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),r=un[t]._config;else if(null!=e.parentLocale)if(null!=un[e.parentLocale])r=un[e.parentLocale]._config;else{if(null==(n=pn(e.parentLocale)))return cn[e.parentLocale]||(cn[e.parentLocale]=[]),cn[e.parentLocale].push({name:t,config:e}),null;r=n._config}return un[t]=new O(A(r,e)),cn[t]&&cn[t].forEach((function(t){mn(t.name,t.config)})),gn(t),un[t]}return delete un[t],null}function vn(t,e){if(null!=e){var n,r,i=ln;null!=un[t]&&null!=un[t].parentLocale?un[t].set(A(un[t]._config,e)):(null!=(r=pn(t))&&(i=r._config),e=A(i,e),null==r&&(e.abbr=t),(n=new O(e)).parentLocale=un[t],un[t]=n),gn(t)}else null!=un[t]&&(null!=un[t].parentLocale?(un[t]=un[t].parentLocale,t===gn()&&gn(t)):null!=un[t]&&delete un[t]);return un[t]}function yn(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return sn;if(!o(t)){if(e=pn(t))return e;t=[t]}return fn(t)}function bn(){return C(un)}function xn(t){var e,n=t._a;return n&&-2===m(t).overflow&&(e=n[jt]<0||n[jt]>11?jt:n[Gt]<1||n[Gt]>te(n[Ut],n[jt])?Gt:n[qt]<0||n[qt]>24||24===n[qt]&&(0!==n[$t]||0!==n[Kt]||0!==n[Zt])?qt:n[$t]<0||n[$t]>59?$t:n[Kt]<0||n[Kt]>59?Kt:n[Zt]<0||n[Zt]>999?Zt:-1,m(t)._overflowDayOfYear&&(eGt)&&(e=Gt),m(t)._overflowWeeks&&-1===e&&(e=Xt),m(t)._overflowWeekday&&-1===e&&(e=Jt),m(t).overflow=e),t}var wn=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,_n=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,kn=/Z|[+-]\d\d(?::?\d\d)?/,Sn=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Mn=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Cn=/^\/?Date\((-?\d+)/i,Tn=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Dn={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Ln(t){var e,n,r,i,o,a,s=t._i,l=wn.exec(s)||_n.exec(s);if(l){for(m(t).iso=!0,e=0,n=Sn.length;eme(o)||0===t._dayOfYear)&&(m(t)._overflowDayOfYear=!0),n=xe(o,0,t._dayOfYear),t._a[jt]=n.getUTCMonth(),t._a[Gt]=n.getUTCDate()),e=0;e<3&&null==t._a[e];++e)t._a[e]=a[e]=r[e];for(;e<7;e++)t._a[e]=a[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[qt]&&0===t._a[$t]&&0===t._a[Kt]&&0===t._a[Zt]&&(t._nextDay=!0,t._a[qt]=0),t._d=(t._useUTC?xe:be).apply(null,a),i=t._useUTC?t._d.getUTCDay():t._d.getDay(),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[qt]=24),t._w&&void 0!==t._w.d&&t._w.d!==i&&(m(t).weekdayMismatch=!0)}}function Hn(t){var e,n,r,i,o,a,s,l,u;null!=(e=t._w).GG||null!=e.W||null!=e.E?(o=1,a=4,n=Wn(e.GG,t._a[Ut],ke(Kn(),1,4).year),r=Wn(e.W,1),((i=Wn(e.E,1))<1||i>7)&&(l=!0)):(o=t._locale._week.dow,a=t._locale._week.doy,u=ke(Kn(),o,a),n=Wn(e.gg,t._a[Ut],u.year),r=Wn(e.w,u.week),null!=e.d?((i=e.d)<0||i>6)&&(l=!0):null!=e.e?(i=e.e+o,(e.e<0||e.e>6)&&(l=!0)):i=o),r<1||r>Se(n,o,a)?m(t)._overflowWeeks=!0:null!=l?m(t)._overflowWeekday=!0:(s=_e(n,r,i,o,a),t._a[Ut]=s.year,t._dayOfYear=s.dayOfYear)}function Bn(t){if(t._f!==r.ISO_8601)if(t._f!==r.RFC_2822){t._a=[],m(t).empty=!0;var e,n,i,o,a,s,l=""+t._i,u=l.length,c=0;for(i=U(t._f,t._locale).match(R)||[],e=0;e0&&m(t).unusedInput.push(a),l=l.slice(l.indexOf(n)+n.length),c+=n.length),z[o]?(n?m(t).empty=!1:m(t).unusedTokens.push(o),Vt(o,n,t)):t._strict&&!n&&m(t).unusedTokens.push(o);m(t).charsLeftOver=u-c,l.length>0&&m(t).unusedInput.push(l),t._a[qt]<=12&&!0===m(t).bigHour&&t._a[qt]>0&&(m(t).bigHour=void 0),m(t).parsedDateParts=t._a.slice(0),m(t).meridiem=t._meridiem,t._a[qt]=Vn(t._locale,t._a[qt],t._meridiem),null!==(s=m(t).era)&&(t._a[Ut]=t._locale.erasConvertYear(s,t._a[Ut])),zn(t),xn(t)}else In(t);else Ln(t)}function Vn(t,e,n){var r;return null==n?e:null!=t.meridiemHour?t.meridiemHour(e,n):null!=t.isPM?((r=t.isPM(n))&&e<12&&(e+=12),r||12!==e||(e=0),e):e}function Yn(t){var e,n,r,i,o,a,s=!1;if(0===t._f.length)return m(t).invalidFormat=!0,void(t._d=new Date(NaN));for(i=0;ithis?this:t:y()}));function Jn(t,e){var n,r;if(1===e.length&&o(e[0])&&(e=e[0]),!e.length)return Kn();for(n=e[0],r=1;rthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function _r(){if(!u(this._isDSTShifted))return this._isDSTShifted;var t,e={};return w(e,this),(e=Gn(e))._a?(t=e._isUTC?p(e._a):Kn(e._a),this._isDSTShifted=this.isValid()&&ur(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function kr(){return!!this.isValid()&&!this._isUTC}function Sr(){return!!this.isValid()&&this._isUTC}function Mr(){return!!this.isValid()&&this._isUTC&&0===this._offset}r.updateOffset=function(){};var Cr=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Tr=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Dr(t,e){var n,r,i,o=t,a=null;return sr(t)?o={ms:t._milliseconds,d:t._days,M:t._months}:c(t)||!isNaN(+t)?(o={},e?o[e]=+t:o.milliseconds=+t):(a=Cr.exec(t))?(n="-"===a[1]?-1:1,o={y:0,d:dt(a[Gt])*n,h:dt(a[qt])*n,m:dt(a[$t])*n,s:dt(a[Kt])*n,ms:dt(lr(1e3*a[Zt]))*n}):(a=Tr.exec(t))?(n="-"===a[1]?-1:1,o={y:Lr(a[2],n),M:Lr(a[3],n),w:Lr(a[4],n),d:Lr(a[5],n),h:Lr(a[6],n),m:Lr(a[7],n),s:Lr(a[8],n)}):null==o?o={}:"object"==typeof o&&("from"in o||"to"in o)&&(i=Ar(Kn(o.from),Kn(o.to)),(o={}).ms=i.milliseconds,o.M=i.months),r=new ar(o),sr(t)&&s(t,"_locale")&&(r._locale=t._locale),sr(t)&&s(t,"_isValid")&&(r._isValid=t._isValid),r}function Lr(t,e){var n=t&&parseFloat(t.replace(",","."));return(isNaN(n)?0:n)*e}function Pr(t,e){var n={};return n.months=e.month()-t.month()+12*(e.year()-t.year()),t.clone().add(n.months,"M").isAfter(e)&&--n.months,n.milliseconds=+e-+t.clone().add(n.months,"M"),n}function Ar(t,e){var n;return t.isValid()&&e.isValid()?(e=fr(e,t),t.isBefore(e)?n=Pr(t,e):((n=Pr(e,t)).milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function Or(t,e){return function(n,r){var i;return null===r||isNaN(+r)||(D(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),i=n,n=r,r=i),Nr(this,Dr(n,r),t),this}}function Nr(t,e,n,i){var o=e._milliseconds,a=lr(e._days),s=lr(e._months);t.isValid()&&(i=null==i||i,s&&ce(t,ft(t,"Month")+s*n),a&&pt(t,"Date",ft(t,"Date")+a*n),o&&t._d.setTime(t._d.valueOf()+o*n),i&&r.updateOffset(t,a||s))}Dr.fn=ar.prototype,Dr.invalid=or;var Fr=Or(1,"add"),Ir=Or(-1,"subtract");function Rr(t){return"string"==typeof t||t instanceof String}function Wr(t){return k(t)||d(t)||Rr(t)||c(t)||zr(t)||Er(t)||null==t}function Er(t){var e,n,r=a(t)&&!l(t),i=!1,o=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"];for(e=0;en.valueOf():n.valueOf()9999?Y(n,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):L(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",Y(n,"Z")):Y(n,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function ti(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t,e,n,r,i="moment",o="";return this.isLocal()||(i=0===this.utcOffset()?"moment.utc":"moment.parseZone",o="Z"),t="["+i+'("]',e=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",n="-MM-DD[T]HH:mm:ss.SSS",r=o+'[")]',this.format(t+e+n+r)}function ei(t){t||(t=this.isUtc()?r.defaultFormatUtc:r.defaultFormat);var e=Y(this,t);return this.localeData().postformat(e)}function ni(t,e){return this.isValid()&&(k(t)&&t.isValid()||Kn(t).isValid())?Dr({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function ri(t){return this.from(Kn(),t)}function ii(t,e){return this.isValid()&&(k(t)&&t.isValid()||Kn(t).isValid())?Dr({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function oi(t){return this.to(Kn(),t)}function ai(t){var e;return void 0===t?this._locale._abbr:(null!=(e=yn(t))&&(this._locale=e),this)}r.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",r.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var si=M("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",(function(t){return void 0===t?this.localeData():this.locale(t)}));function li(){return this._locale}var ui=1e3,ci=60*ui,di=60*ci,hi=3506328*di;function fi(t,e){return(t%e+e)%e}function pi(t,e,n){return t<100&&t>=0?new Date(t+400,e,n)-hi:new Date(t,e,n).valueOf()}function gi(t,e,n){return t<100&&t>=0?Date.UTC(t+400,e,n)-hi:Date.UTC(t,e,n)}function mi(t){var e,n;if(void 0===(t=rt(t))||"millisecond"===t||!this.isValid())return this;switch(n=this._isUTC?gi:pi,t){case"year":e=n(this.year(),0,1);break;case"quarter":e=n(this.year(),this.month()-this.month()%3,1);break;case"month":e=n(this.year(),this.month(),1);break;case"week":e=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":e=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":e=n(this.year(),this.month(),this.date());break;case"hour":e=this._d.valueOf(),e-=fi(e+(this._isUTC?0:this.utcOffset()*ci),di);break;case"minute":e=this._d.valueOf(),e-=fi(e,ci);break;case"second":e=this._d.valueOf(),e-=fi(e,ui)}return this._d.setTime(e),r.updateOffset(this,!0),this}function vi(t){var e,n;if(void 0===(t=rt(t))||"millisecond"===t||!this.isValid())return this;switch(n=this._isUTC?gi:pi,t){case"year":e=n(this.year()+1,0,1)-1;break;case"quarter":e=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":e=n(this.year(),this.month()+1,1)-1;break;case"week":e=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":e=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":e=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":e=this._d.valueOf(),e+=di-fi(e+(this._isUTC?0:this.utcOffset()*ci),di)-1;break;case"minute":e=this._d.valueOf(),e+=ci-fi(e,ci)-1;break;case"second":e=this._d.valueOf(),e+=ui-fi(e,ui)-1}return this._d.setTime(e),r.updateOffset(this,!0),this}function yi(){return this._d.valueOf()-6e4*(this._offset||0)}function bi(){return Math.floor(this.valueOf()/1e3)}function xi(){return new Date(this.valueOf())}function wi(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]}function _i(){var t=this;return{years:t.year(),months:t.month(),date:t.date(),hours:t.hours(),minutes:t.minutes(),seconds:t.seconds(),milliseconds:t.milliseconds()}}function ki(){return this.isValid()?this.toISOString():null}function Si(){return v(this)}function Mi(){return f({},m(this))}function Ci(){return m(this).overflow}function Ti(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function Di(t,e){var n,i,o,a=this._eras||yn("en")._eras;for(n=0,i=a.length;n=0)return l[r]}function Pi(t,e){var n=t.since<=t.until?1:-1;return void 0===e?r(t.since).year():r(t.since).year()+(e-t.offset)*n}function Ai(){var t,e,n,r=this.localeData().eras();for(t=0,e=r.length;t(o=Se(t,r,i))&&(e=o),Xi.call(this,t,e,n,r,i))}function Xi(t,e,n,r,i){var o=_e(t,e,n,r,i),a=xe(o.year,0,o.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}function Ji(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)}H("N",0,0,"eraAbbr"),H("NN",0,0,"eraAbbr"),H("NNN",0,0,"eraAbbr"),H("NNNN",0,0,"eraName"),H("NNNNN",0,0,"eraNarrow"),H("y",["y",1],"yo","eraYear"),H("y",["yy",2],0,"eraYear"),H("y",["yyy",3],0,"eraYear"),H("y",["yyyy",4],0,"eraYear"),It("N",Ei),It("NN",Ei),It("NNN",Ei),It("NNNN",zi),It("NNNNN",Hi),Ht(["N","NN","NNN","NNNN","NNNNN"],(function(t,e,n,r){var i=n._locale.erasParse(t,r,n._strict);i?m(n).era=i:m(n).invalidEra=t})),It("y",Lt),It("yy",Lt),It("yyy",Lt),It("yyyy",Lt),It("yo",Bi),Ht(["y","yy","yyy","yyyy"],Ut),Ht(["yo"],(function(t,e,n,r){var i;n._locale._eraYearOrdinalRegex&&(i=t.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?e[Ut]=n._locale.eraYearOrdinalParse(t,i):e[Ut]=parseInt(t,10)})),H(0,["gg",2],0,(function(){return this.weekYear()%100})),H(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),Yi("gggg","weekYear"),Yi("ggggg","weekYear"),Yi("GGGG","isoWeekYear"),Yi("GGGGG","isoWeekYear"),nt("weekYear","gg"),nt("isoWeekYear","GG"),at("weekYear",1),at("isoWeekYear",1),It("G",Pt),It("g",Pt),It("GG",kt,bt),It("gg",kt,bt),It("GGGG",Tt,wt),It("gggg",Tt,wt),It("GGGGG",Dt,_t),It("ggggg",Dt,_t),Bt(["gggg","ggggg","GGGG","GGGGG"],(function(t,e,n,r){e[r.substr(0,2)]=dt(t)})),Bt(["gg","GG"],(function(t,e,n,i){e[i]=r.parseTwoDigitYear(t)})),H("Q",0,"Qo","quarter"),nt("quarter","Q"),at("quarter",7),It("Q",yt),Ht("Q",(function(t,e){e[jt]=3*(dt(t)-1)})),H("D",["DD",2],"Do","date"),nt("date","D"),at("date",9),It("D",kt),It("DD",kt,bt),It("Do",(function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient})),Ht(["D","DD"],Gt),Ht("Do",(function(t,e){e[Gt]=dt(t.match(kt)[0])}));var Qi=ht("Date",!0);function to(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")}H("DDD",["DDDD",3],"DDDo","dayOfYear"),nt("dayOfYear","DDD"),at("dayOfYear",4),It("DDD",Ct),It("DDDD",xt),Ht(["DDD","DDDD"],(function(t,e,n){n._dayOfYear=dt(t)})),H("m",["mm",2],0,"minute"),nt("minute","m"),at("minute",14),It("m",kt),It("mm",kt,bt),Ht(["m","mm"],$t);var eo=ht("Minutes",!1);H("s",["ss",2],0,"second"),nt("second","s"),at("second",15),It("s",kt),It("ss",kt,bt),Ht(["s","ss"],Kt);var no,ro,io=ht("Seconds",!1);for(H("S",0,0,(function(){return~~(this.millisecond()/100)})),H(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),H(0,["SSS",3],0,"millisecond"),H(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),H(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),H(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),H(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),H(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),H(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),nt("millisecond","ms"),at("millisecond",16),It("S",Ct,yt),It("SS",Ct,bt),It("SSS",Ct,xt),no="SSSS";no.length<=9;no+="S")It(no,Lt);function oo(t,e){e[Zt]=dt(1e3*("0."+t))}for(no="S";no.length<=9;no+="S")Ht(no,oo);function ao(){return this._isUTC?"UTC":""}function so(){return this._isUTC?"Coordinated Universal Time":""}ro=ht("Milliseconds",!1),H("z",0,0,"zoneAbbr"),H("zz",0,0,"zoneName");var lo=_.prototype;function uo(t){return Kn(1e3*t)}function co(){return Kn.apply(null,arguments).parseZone()}function ho(t){return t}lo.add=Fr,lo.calendar=Vr,lo.clone=Yr,lo.diff=Zr,lo.endOf=vi,lo.format=ei,lo.from=ni,lo.fromNow=ri,lo.to=ii,lo.toNow=oi,lo.get=gt,lo.invalidAt=Ci,lo.isAfter=Ur,lo.isBefore=jr,lo.isBetween=Gr,lo.isSame=qr,lo.isSameOrAfter=$r,lo.isSameOrBefore=Kr,lo.isValid=Si,lo.lang=si,lo.locale=ai,lo.localeData=li,lo.max=Xn,lo.min=Zn,lo.parsingFlags=Mi,lo.set=mt,lo.startOf=mi,lo.subtract=Ir,lo.toArray=wi,lo.toObject=_i,lo.toDate=xi,lo.toISOString=Qr,lo.inspect=ti,"undefined"!=typeof Symbol&&null!=Symbol.for&&(lo[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),lo.toJSON=ki,lo.toString=Jr,lo.unix=bi,lo.valueOf=yi,lo.creationData=Ti,lo.eraName=Ai,lo.eraNarrow=Oi,lo.eraAbbr=Ni,lo.eraYear=Fi,lo.year=ve,lo.isLeapYear=ye,lo.weekYear=Ui,lo.isoWeekYear=ji,lo.quarter=lo.quarters=Ji,lo.month=de,lo.daysInMonth=he,lo.week=lo.weeks=Le,lo.isoWeek=lo.isoWeeks=Pe,lo.weeksInYear=$i,lo.weeksInWeekYear=Ki,lo.isoWeeksInYear=Gi,lo.isoWeeksInISOWeekYear=qi,lo.date=Qi,lo.day=lo.days=je,lo.weekday=Ge,lo.isoWeekday=qe,lo.dayOfYear=to,lo.hour=lo.hours=on,lo.minute=lo.minutes=eo,lo.second=lo.seconds=io,lo.millisecond=lo.milliseconds=ro,lo.utcOffset=gr,lo.utc=vr,lo.local=yr,lo.parseZone=br,lo.hasAlignedHourOffset=xr,lo.isDST=wr,lo.isLocal=kr,lo.isUtcOffset=Sr,lo.isUtc=Mr,lo.isUTC=Mr,lo.zoneAbbr=ao,lo.zoneName=so,lo.dates=M("dates accessor is deprecated. Use date instead.",Qi),lo.months=M("months accessor is deprecated. Use month instead",de),lo.years=M("years accessor is deprecated. Use year instead",ve),lo.zone=M("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",mr),lo.isDSTShifted=M("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",_r);var fo=O.prototype;function po(t,e,n,r){var i=yn(),o=p().set(r,e);return i[n](o,t)}function go(t,e,n){if(c(t)&&(e=t,t=void 0),t=t||"",null!=e)return po(t,e,n,"month");var r,i=[];for(r=0;r<12;r++)i[r]=po(t,r,n,"month");return i}function mo(t,e,n,r){"boolean"==typeof t?(c(e)&&(n=e,e=void 0),e=e||""):(n=e=t,t=!1,c(e)&&(n=e,e=void 0),e=e||"");var i,o=yn(),a=t?o._week.dow:0,s=[];if(null!=n)return po(e,(n+a)%7,r,"day");for(i=0;i<7;i++)s[i]=po(e,(i+a)%7,r,"day");return s}function vo(t,e){return go(t,e,"months")}function yo(t,e){return go(t,e,"monthsShort")}function bo(t,e,n){return mo(t,e,n,"weekdays")}function xo(t,e,n){return mo(t,e,n,"weekdaysShort")}function wo(t,e,n){return mo(t,e,n,"weekdaysMin")}fo.calendar=F,fo.longDateFormat=G,fo.invalidDate=$,fo.ordinal=X,fo.preparse=ho,fo.postformat=ho,fo.relativeTime=Q,fo.pastFuture=tt,fo.set=P,fo.eras=Di,fo.erasParse=Li,fo.erasConvertYear=Pi,fo.erasAbbrRegex=Ri,fo.erasNameRegex=Ii,fo.erasNarrowRegex=Wi,fo.months=ae,fo.monthsShort=se,fo.monthsParse=ue,fo.monthsRegex=pe,fo.monthsShortRegex=fe,fo.week=Me,fo.firstDayOfYear=De,fo.firstDayOfWeek=Te,fo.weekdays=He,fo.weekdaysMin=Ve,fo.weekdaysShort=Be,fo.weekdaysParse=Ue,fo.weekdaysRegex=$e,fo.weekdaysShortRegex=Ke,fo.weekdaysMinRegex=Ze,fo.isPM=nn,fo.meridiem=an,gn("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10;return t+(1===dt(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th")}}),r.lang=M("moment.lang is deprecated. Use moment.locale instead.",gn),r.langData=M("moment.langData is deprecated. Use moment.localeData instead.",yn);var _o=Math.abs;function ko(){var t=this._data;return this._milliseconds=_o(this._milliseconds),this._days=_o(this._days),this._months=_o(this._months),t.milliseconds=_o(t.milliseconds),t.seconds=_o(t.seconds),t.minutes=_o(t.minutes),t.hours=_o(t.hours),t.months=_o(t.months),t.years=_o(t.years),this}function So(t,e,n,r){var i=Dr(e,n);return t._milliseconds+=r*i._milliseconds,t._days+=r*i._days,t._months+=r*i._months,t._bubble()}function Mo(t,e){return So(this,t,e,1)}function Co(t,e){return So(this,t,e,-1)}function To(t){return t<0?Math.floor(t):Math.ceil(t)}function Do(){var t,e,n,r,i,o=this._milliseconds,a=this._days,s=this._months,l=this._data;return o>=0&&a>=0&&s>=0||o<=0&&a<=0&&s<=0||(o+=864e5*To(Po(s)+a),a=0,s=0),l.milliseconds=o%1e3,t=ct(o/1e3),l.seconds=t%60,e=ct(t/60),l.minutes=e%60,n=ct(e/60),l.hours=n%24,a+=ct(n/24),s+=i=ct(Lo(a)),a-=To(Po(i)),r=ct(s/12),s%=12,l.days=a,l.months=s,l.years=r,this}function Lo(t){return 4800*t/146097}function Po(t){return 146097*t/4800}function Ao(t){if(!this.isValid())return NaN;var e,n,r=this._milliseconds;if("month"===(t=rt(t))||"quarter"===t||"year"===t)switch(e=this._days+r/864e5,n=this._months+Lo(e),t){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(e=this._days+Math.round(Po(this._months)),t){case"week":return e/7+r/6048e5;case"day":return e+r/864e5;case"hour":return 24*e+r/36e5;case"minute":return 1440*e+r/6e4;case"second":return 86400*e+r/1e3;case"millisecond":return Math.floor(864e5*e)+r;default:throw new Error("Unknown unit "+t)}}function Oo(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*dt(this._months/12):NaN}function No(t){return function(){return this.as(t)}}var Fo=No("ms"),Io=No("s"),Ro=No("m"),Wo=No("h"),Eo=No("d"),zo=No("w"),Ho=No("M"),Bo=No("Q"),Vo=No("y");function Yo(){return Dr(this)}function Uo(t){return t=rt(t),this.isValid()?this[t+"s"]():NaN}function jo(t){return function(){return this.isValid()?this._data[t]:NaN}}var Go=jo("milliseconds"),qo=jo("seconds"),$o=jo("minutes"),Ko=jo("hours"),Zo=jo("days"),Xo=jo("months"),Jo=jo("years");function Qo(){return ct(this.days()/7)}var ta=Math.round,ea={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function na(t,e,n,r,i){return i.relativeTime(e||1,!!n,t,r)}function ra(t,e,n,r){var i=Dr(t).abs(),o=ta(i.as("s")),a=ta(i.as("m")),s=ta(i.as("h")),l=ta(i.as("d")),u=ta(i.as("M")),c=ta(i.as("w")),d=ta(i.as("y")),h=o<=n.ss&&["s",o]||o0,h[4]=r,na.apply(null,h)}function ia(t){return void 0===t?ta:"function"==typeof t&&(ta=t,!0)}function oa(t,e){return void 0!==ea[t]&&(void 0===e?ea[t]:(ea[t]=e,"s"===t&&(ea.ss=e-1),!0))}function aa(t,e){if(!this.isValid())return this.localeData().invalidDate();var n,r,i=!1,o=ea;return"object"==typeof t&&(e=t,t=!1),"boolean"==typeof t&&(i=t),"object"==typeof e&&(o=Object.assign({},ea,e),null!=e.s&&null==e.ss&&(o.ss=e.s-1)),r=ra(this,!i,o,n=this.localeData()),i&&(r=n.pastFuture(+this,r)),n.postformat(r)}var sa=Math.abs;function la(t){return(t>0)-(t<0)||+t}function ua(){if(!this.isValid())return this.localeData().invalidDate();var t,e,n,r,i,o,a,s,l=sa(this._milliseconds)/1e3,u=sa(this._days),c=sa(this._months),d=this.asSeconds();return d?(t=ct(l/60),e=ct(t/60),l%=60,t%=60,n=ct(c/12),c%=12,r=l?l.toFixed(3).replace(/\.?0+$/,""):"",i=d<0?"-":"",o=la(this._months)!==la(d)?"-":"",a=la(this._days)!==la(d)?"-":"",s=la(this._milliseconds)!==la(d)?"-":"",i+"P"+(n?o+n+"Y":"")+(c?o+c+"M":"")+(u?a+u+"D":"")+(e||t||l?"T":"")+(e?s+e+"H":"")+(t?s+t+"M":"")+(l?s+r+"S":"")):"P0D"}var ca=ar.prototype;return ca.isValid=ir,ca.abs=ko,ca.add=Mo,ca.subtract=Co,ca.as=Ao,ca.asMilliseconds=Fo,ca.asSeconds=Io,ca.asMinutes=Ro,ca.asHours=Wo,ca.asDays=Eo,ca.asWeeks=zo,ca.asMonths=Ho,ca.asQuarters=Bo,ca.asYears=Vo,ca.valueOf=Oo,ca._bubble=Do,ca.clone=Yo,ca.get=Uo,ca.milliseconds=Go,ca.seconds=qo,ca.minutes=$o,ca.hours=Ko,ca.days=Zo,ca.weeks=Qo,ca.months=Xo,ca.years=Jo,ca.humanize=aa,ca.toISOString=ua,ca.toString=ua,ca.toJSON=ua,ca.locale=ai,ca.localeData=li,ca.toIsoString=M("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",ua),ca.lang=si,H("X",0,0,"unix"),H("x",0,0,"valueOf"),It("x",Pt),It("X",Nt),Ht("X",(function(t,e,n){n._d=new Date(1e3*parseFloat(t))})),Ht("x",(function(t,e,n){n._d=new Date(dt(t))})), +(window.litElementVersions||(window.litElementVersions=[])).push("2.4.0");const et={};class nt extends q{static getStyles(){return this.styles}static _getUniqueStyles(){if(this.hasOwnProperty(JSCompiler_renameProperty("_styles",this)))return;const t=this.getStyles();if(Array.isArray(t)){const e=(t,n)=>t.reduceRight(((t,n)=>Array.isArray(n)?e(n,t):(t.add(n),t)),n),n=e(t,new Set),r=[];n.forEach((t=>r.unshift(t))),this._styles=r}else this._styles=void 0===t?[]:[t];this._styles=this._styles.map((t=>{if(t instanceof CSSStyleSheet&&!X){const e=Array.prototype.slice.call(t.cssRules).reduce(((t,e)=>t+e.cssText),"");return new Q(String(e),J)}return t}))}initialize(){super.initialize(),this.constructor._getUniqueStyles(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow({mode:"open"})}adoptStyles(){const t=this.constructor._styles;0!==t.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?X?this.renderRoot.adoptedStyleSheets=t.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(t.map((t=>t.cssText)),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}update(t){const e=this.render();super.update(t),e!==et&&this.constructor.render(e,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach((t=>{const e=document.createElement("style");e.textContent=t.cssText,this.renderRoot.appendChild(e)})))}render(){return et}}nt.finalized=!0,nt.render=(t,e,r)=>{if(!r||"object"!=typeof r||!r.scopeName)throw new Error("The `scopeName` option is required.");const i=r.scopeName,o=I.has(e),a=z&&11===e.nodeType&&!!e.host,s=a&&!V.has(i),l=s?document.createDocumentFragment():e;if(((t,e,r)=>{let i=I.get(e);void 0===i&&(n(e,e.firstChild),I.set(e,i=new C(Object.assign({templateFactory:N},r))),i.appendInto(e)),i.setValue(t),i.commit()})(t,l,Object.assign({templateFactory:H(i)},r)),s){const t=I.get(l);I.delete(l);const r=t.value instanceof y?t.value.template:void 0;Y(i,l,r),n(e,e.firstChild),e.appendChild(l),I.set(e,t)}!o&&a&&window.ShadyCSS.styleElement(e.host)};const rt={error:"fas fa-exclamation-circle",warning:"fas fa-exclamation-triangle",success:"fas fa-check-circle",info:"fas fa-info"};function it(){(null===document||void 0===document?void 0:document.querySelector("pb-messages")).fetchMessages()}let ot=class extends nt{constructor(){super(...arguments),this.url="",this.messages=[]}createRenderRoot(){return this}firstUpdated(){this.fetchMessages()}fetchMessages(){return fetch(this.url).then((t=>t.json())).then((t=>this.messages=t)).then((t=>{const e=this.querySelector(".pf-c-alert-group");t.forEach((t=>{const n=this.renderMessage(t);e.appendChild(n)}))}))}renderMessage(t){const e="pb-message"+Math.random().toString(36).substr(2,9);const n=document.createElement("template");return n.innerHTML=`
  • \n
    \n
    \n \n
    \n

    \n ${t.message}\n

    \n
    \n
  • `,setTimeout((()=>{var t;null===(t=this.querySelector("#"+e))||void 0===t||t.remove()}),1500),n.content.firstChild}render(){return W`
      `}};t([Z()],ot.prototype,"url",void 0),t([Z()],ot.prototype,"messages",void 0),ot=t([$("pb-messages")],ot);const at=["pf-m-progress","pf-m-in-progress"];let st=class extends nt{constructor(){var t;super(),this.url="",this.isRunning=!1,null===(t=this.querySelector("button"))||void 0===t||t.addEventListener("click",(t=>this.callAction()))}setLoading(){this.isRunning=!0,this.classList.add(...at)}setDone(t){this.isRunning=!1,this.classList.remove(...at),this.classList.replace("pf-m-primary",t),it(),setTimeout((()=>{this.classList.replace(t,"pf-m-primary")}),1e3)}callAction(){if(!0===this.isRunning)return;this.setLoading();const t=function(t){let e=null;if(document.cookie&&""!==document.cookie){const n=document.cookie.split(";");for(let r=0;rt.json())).then((t=>{this.setDone("pf-m-success")})).catch((()=>{this.setDone("pf-m-danger")}))}render(){return W``}};t([Z()],st.prototype,"url",void 0),st=t([$("pb-action-button")],st);let lt=class extends nt{constructor(){super(),this.paths=[],this.activePath=window.location.hash.slice(1,1/0),window.addEventListener("hashchange",(t=>{this.activePath=window.location.hash.slice(1,1/0)})),this.querySelectorAll(".pf-c-nav__link").forEach((t=>{var e;let n=null===(e=t.attributes.getNamedItem("pb-url-prefix"))||void 0===e?void 0:e.value;if(!n){const e=new URL(t.href);if(""===e.hash)return void console.log("Ignoring "+t);n=`^${e.hash.slice(1,1/0)}$`}const r=RegExp(n);this.paths.push({anchor:t,match:r})}))}render(){return this.paths.forEach((t=>{t.match.exec(this.activePath)?t.anchor.classList.add("pf-m-current"):t.anchor.classList.remove("pf-m-current")})),W``}};t([Z()],lt.prototype,"activePath",void 0),lt=t([$("pb-admin-sidebar")],lt);"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function ut(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}function ct(t,e){return t(e={exports:{}},e.exports),e.exports}var dt=ct((function(t,e){t.exports=function(){var t=navigator.userAgent,e=navigator.platform,n=/gecko\/\d/i.test(t),r=/MSIE \d/.test(t),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(t),o=/Edge\/(\d+)/.exec(t),a=r||i||o,s=a&&(r?document.documentMode||6:+(o||i)[1]),l=!o&&/WebKit\//.test(t),u=l&&/Qt\/\d+\.\d+/.test(t),c=!o&&/Chrome\//.test(t),d=/Opera\//.test(t),h=/Apple Computer/.test(navigator.vendor),f=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(t),p=/PhantomJS/.test(t),g=!o&&/AppleWebKit/.test(t)&&/Mobile\/\w+/.test(t),m=/Android/.test(t),v=g||m||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(t),y=g||/Mac/.test(e),b=/\bCrOS\b/.test(t),x=/win/i.test(e),w=d&&t.match(/Version\/(\d*\.\d*)/);w&&(w=Number(w[1])),w&&w>=15&&(d=!1,l=!0);var _=y&&(u||d&&(null==w||w<12.11)),k=n||a&&s>=9;function S(t){return new RegExp("(^|\\s)"+t+"(?:$|\\s)\\s*")}var M,C=function(t,e){var n=t.className,r=S(e).exec(n);if(r){var i=n.slice(r.index+r[0].length);t.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function T(t){for(var e=t.childNodes.length;e>0;--e)t.removeChild(t.firstChild);return t}function D(t,e){return T(t).appendChild(e)}function L(t,e,n,r){var i=document.createElement(t);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof e)i.appendChild(document.createTextNode(e));else if(e)for(var o=0;o=e)return a+(e-o);a+=s-o,a+=n-a%n,o=s+1}}g?I=function(t){t.selectionStart=0,t.selectionEnd=t.value.length}:a&&(I=function(t){try{t.select()}catch(t){}});var z=function(){this.id=null,this.f=null,this.time=0,this.handler=R(this.onTimeout,this)};function H(t,e){for(var n=0;n=e)return r+Math.min(a,e-i);if(i+=o-r,r=o+1,(i+=n-i%n)>=e)return r}}var q=[""];function $(t){for(;q.length<=t;)q.push(K(q)+" ");return q[t]}function K(t){return t[t.length-1]}function Z(t,e){for(var n=[],r=0;r"€"&&(t.toUpperCase()!=t.toLowerCase()||tt.test(t))}function nt(t,e){return e?!!(e.source.indexOf("\\w")>-1&&et(t))||e.test(t):et(t)}function rt(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e])return!1;return!0}var it=/[\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 ot(t){return t.charCodeAt(0)>=768&&it.test(t)}function at(t,e,n){for(;(n<0?e>0:en?-1:1;;){if(e==n)return e;var i=(e+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==e)return t(o)?e:n;t(o)?n=o:e=o+r}}function lt(t,e,n,r){if(!t)return r(e,n,"ltr",0);for(var i=!1,o=0;oe||e==n&&a.to==e)&&(r(Math.max(a.from,e),Math.min(a.to,n),1==a.level?"rtl":"ltr",o),i=!0)}i||r(e,n,"ltr")}var ut=null;function ct(t,e,n){var r;ut=null;for(var i=0;ie)return i;o.to==e&&(o.from!=o.to&&"before"==n?r=i:ut=i),o.from==e&&(o.from!=o.to&&"before"!=n?r=i:ut=i)}return null!=r?r:ut}var dt=function(){var t="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",e="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(n){return n<=247?t.charAt(n):1424<=n&&n<=1524?"R":1536<=n&&n<=1785?e.charAt(n-1536):1774<=n&&n<=2220?"r":8192<=n&&n<=8203?"w":8204==n?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,o=/[LRr]/,a=/[Lb1n]/,s=/[1n]/;function l(t,e,n){this.level=t,this.from=e,this.to=n}return function(t,e){var u="ltr"==e?"L":"R";if(0==t.length||"ltr"==e&&!r.test(t))return!1;for(var c=t.length,d=[],h=0;h-1&&(r[e]=i.slice(0,o).concat(i.slice(o+1)))}}}function vt(t,e){var n=gt(t,e);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i0}function wt(t){t.prototype.on=function(t,e){pt(this,t,e)},t.prototype.off=function(t,e){mt(this,t,e)}}function _t(t){t.preventDefault?t.preventDefault():t.returnValue=!1}function kt(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0}function St(t){return null!=t.defaultPrevented?t.defaultPrevented:0==t.returnValue}function Mt(t){_t(t),kt(t)}function Ct(t){return t.target||t.srcElement}function Tt(t){var e=t.which;return null==e&&(1&t.button?e=1:2&t.button?e=3:4&t.button&&(e=2)),y&&t.ctrlKey&&1==e&&(e=3),e}var Dt,Lt,Pt=function(){if(a&&s<9)return!1;var t=L("div");return"draggable"in t||"dragDrop"in t}();function At(t){if(null==Dt){var e=L("span","​");D(t,L("span",[e,document.createTextNode("x")])),0!=t.firstChild.offsetHeight&&(Dt=e.offsetWidth<=1&&e.offsetHeight>2&&!(a&&s<8))}var n=Dt?L("span","​"):L("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Ot(t){if(null!=Lt)return Lt;var e=D(t,document.createTextNode("AخA")),n=M(e,0,1).getBoundingClientRect(),r=M(e,1,2).getBoundingClientRect();return T(t),!(!n||n.left==n.right)&&(Lt=r.right-n.right<3)}var Nt,Ft=3!="\n\nb".split(/\n/).length?function(t){for(var e=0,n=[],r=t.length;e<=r;){var i=t.indexOf("\n",e);-1==i&&(i=t.length);var o=t.slice(e,"\r"==t.charAt(i-1)?i-1:i),a=o.indexOf("\r");-1!=a?(n.push(o.slice(0,a)),e+=a+1):(n.push(o),e=i+1)}return n}:function(t){return t.split(/\r\n?|\n/)},It=window.getSelection?function(t){try{return t.selectionStart!=t.selectionEnd}catch(t){return!1}}:function(t){var e;try{e=t.ownerDocument.selection.createRange()}catch(t){}return!(!e||e.parentElement()!=t)&&0!=e.compareEndPoints("StartToEnd",e)},Rt="oncopy"in(Nt=L("div"))||(Nt.setAttribute("oncopy","return;"),"function"==typeof Nt.oncopy),Wt=null;function Et(t){if(null!=Wt)return Wt;var e=D(t,L("span","x")),n=e.getBoundingClientRect(),r=M(e,0,1).getBoundingClientRect();return Wt=Math.abs(n.left-r.left)>1}var zt={},Ht={};function Bt(t,e){arguments.length>2&&(e.dependencies=Array.prototype.slice.call(arguments,2)),zt[t]=e}function Vt(t,e){Ht[t]=e}function Yt(t){if("string"==typeof t&&Ht.hasOwnProperty(t))t=Ht[t];else if(t&&"string"==typeof t.name&&Ht.hasOwnProperty(t.name)){var e=Ht[t.name];"string"==typeof e&&(e={name:e}),(t=Q(e,t)).name=e.name}else{if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return Yt("application/xml");if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+json$/.test(t))return Yt("application/json")}return"string"==typeof t?{name:t}:t||{name:"null"}}function Ut(t,e){e=Yt(e);var n=zt[e.name];if(!n)return Ut(t,"text/plain");var r=n(t,e);if(jt.hasOwnProperty(e.name)){var i=jt[e.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=e.name,e.helperType&&(r.helperType=e.helperType),e.modeProps)for(var a in e.modeProps)r[a]=e.modeProps[a];return r}var jt={};function Gt(t,e){W(e,jt.hasOwnProperty(t)?jt[t]:jt[t]={})}function qt(t,e){if(!0===e)return e;if(t.copyState)return t.copyState(e);var n={};for(var r in e){var i=e[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function $t(t,e){for(var n;t.innerMode&&(n=t.innerMode(e))&&n.mode!=t;)e=n.state,t=n.mode;return n||{mode:t,state:e}}function Kt(t,e,n){return!t.startState||t.startState(e,n)}var Zt=function(t,e,n){this.pos=this.start=0,this.string=t,this.tabSize=e||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};function Xt(t,e){if((e-=t.first)<0||e>=t.size)throw new Error("There is no line "+(e+t.first)+" in the document.");for(var n=t;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(e=t.first&&en?oe(n,Xt(t,n).text.length):fe(e,Xt(t,e.line).text.length)}function fe(t,e){var n=t.ch;return null==n||n>e?oe(t.line,e):n<0?oe(t.line,0):t}function pe(t,e){for(var n=[],r=0;r=this.string.length},Zt.prototype.sol=function(){return this.pos==this.lineStart},Zt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Zt.prototype.next=function(){if(this.pose},Zt.prototype.eatSpace=function(){for(var t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t},Zt.prototype.skipToEnd=function(){this.pos=this.string.length},Zt.prototype.skipTo=function(t){var e=this.string.indexOf(t,this.pos);if(e>-1)return this.pos=e,!0},Zt.prototype.backUp=function(t){this.pos-=t},Zt.prototype.column=function(){return this.lastColumnPos0?null:(r&&!1!==e&&(this.pos+=r[0].length),r)}var i=function(t){return n?t.toLowerCase():t};if(i(this.string.substr(this.pos,t.length))==i(t))return!1!==e&&(this.pos+=t.length),!0},Zt.prototype.current=function(){return this.string.slice(this.start,this.pos)},Zt.prototype.hideFirstChars=function(t,e){this.lineStart+=t;try{return e()}finally{this.lineStart-=t}},Zt.prototype.lookAhead=function(t){var e=this.lineOracle;return e&&e.lookAhead(t)},Zt.prototype.baseToken=function(){var t=this.lineOracle;return t&&t.baseToken(this.pos)};var ge=function(t,e){this.state=t,this.lookAhead=e},me=function(t,e,n,r){this.state=e,this.doc=t,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};function ve(t,e,n,r){var i=[t.state.modeGen],o={};Ce(t,e.text,t.doc.mode,n,(function(t,e){return i.push(t,e)}),o,r);for(var a=n.state,s=function(r){n.baseTokens=i;var s=t.state.overlays[r],l=1,u=0;n.state=!0,Ce(t,e.text,s.mode,n,(function(t,e){for(var n=l;ut&&i.splice(l,1,t,i[l+1],r),l+=2,u=Math.min(t,r)}if(e)if(s.opaque)i.splice(n,l-n,t,"overlay "+e),l=n+2;else for(;nt.options.maxHighlightLength&&qt(t.doc.mode,r.state),o=ve(t,e,r);i&&(r.state=i),e.stateAfter=r.save(!i),e.styles=o.styles,o.classes?e.styleClasses=o.classes:e.styleClasses&&(e.styleClasses=null),n===t.doc.highlightFrontier&&(t.doc.modeFrontier=Math.max(t.doc.modeFrontier,++t.doc.highlightFrontier))}return e.styles}function be(t,e,n){var r=t.doc,i=t.display;if(!r.mode.startState)return new me(r,!0,e);var o=Te(t,e,n),a=o>r.first&&Xt(r,o-1).stateAfter,s=a?me.fromSaved(r,a,o):new me(r,Kt(r.mode),o);return r.iter(o,e,(function(n){xe(t,n.text,s);var r=s.line;n.stateAfter=r==e-1||r%5==0||r>=i.viewFrom&&re.start)return o}throw new Error("Mode "+t.name+" failed to advance stream.")}me.prototype.lookAhead=function(t){var e=this.doc.getLine(this.line+t);return null!=e&&t>this.maxLookAhead&&(this.maxLookAhead=t),e},me.prototype.baseToken=function(t){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=t;)this.baseTokenPos+=2;var e=this.baseTokens[this.baseTokenPos+1];return{type:e&&e.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-t}},me.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},me.fromSaved=function(t,e,n){return e instanceof ge?new me(t,qt(t.mode,e.state),n,e.lookAhead):new me(t,qt(t.mode,e),n)},me.prototype.save=function(t){var e=!1!==t?qt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ge(e,this.maxLookAhead):e};var ke=function(t,e,n){this.start=t.start,this.end=t.pos,this.string=t.current(),this.type=e||null,this.state=n};function Se(t,e,n,r){var i,o,a=t.doc,s=a.mode,l=Xt(a,(e=he(a,e)).line),u=be(t,e.line,n),c=new Zt(l.text,t.options.tabSize,u);for(r&&(o=[]);(r||c.post.options.maxHighlightLength?(s=!1,a&&xe(t,e,r,d.pos),d.pos=e.length,l=null):l=Me(_e(n,d,r.state,h),o),h){var f=h[0].name;f&&(l="m-"+(l?f+" "+l:f))}if(!s||c!=l){for(;ua;--s){if(s<=o.first)return o.first;var l=Xt(o,s-1),u=l.stateAfter;if(u&&(!n||s+(u instanceof ge?u.lookAhead:0)<=o.modeFrontier))return s;var c=E(l.text,null,t.options.tabSize);(null==i||r>c)&&(i=s-1,r=c)}return i}function De(t,e){if(t.modeFrontier=Math.min(t.modeFrontier,e),!(t.highlightFrontiern;r--){var i=Xt(t,r).stateAfter;if(i&&(!(i instanceof ge)||r+i.lookAhead=e:o.to>e);(r||(r=[])).push(new Ne(a,o.from,s?null:o.to))}}return r}function Ee(t,e,n){var r;if(t)for(var i=0;i=e:o.to>e)||o.from==e&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=e:o.from0&&s)for(var b=0;b0)){var c=[l,1],d=ae(u.from,s.from),h=ae(u.to,s.to);(d<0||!a.inclusiveLeft&&!d)&&c.push({from:u.from,to:s.from}),(h>0||!a.inclusiveRight&&!h)&&c.push({from:s.to,to:u.to}),i.splice.apply(i,c),l+=c.length-3}}return i}function Ve(t){var e=t.markedSpans;if(e){for(var n=0;ne)&&(!n||Ge(n,o.marker)<0)&&(n=o.marker)}return n}function Xe(t,e,n,r,i){var o=Xt(t,e),a=Pe&&o.markedSpans;if(a)for(var s=0;s=0&&d<=0||c<=0&&d>=0)&&(c<=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?ae(u.to,n)>=0:ae(u.to,n)>0)||c>=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?ae(u.from,r)<=0:ae(u.from,r)<0)))return!0}}}function Je(t){for(var e;e=$e(t);)t=e.find(-1,!0).line;return t}function Qe(t){for(var e;e=Ke(t);)t=e.find(1,!0).line;return t}function tn(t){for(var e,n;e=Ke(t);)t=e.find(1,!0).line,(n||(n=[])).push(t);return n}function en(t,e){var n=Xt(t,e),r=Je(n);return n==r?e:ee(r)}function nn(t,e){if(e>t.lastLine())return e;var n,r=Xt(t,e);if(!rn(t,r))return e;for(;n=Ke(r);)r=n.find(1,!0).line;return ee(r)+1}function rn(t,e){var n=Pe&&e.markedSpans;if(n)for(var r=void 0,i=0;ie.maxLineLength&&(e.maxLineLength=n,e.maxLine=t)}))}var un=function(t,e,n){this.text=t,Ye(this,e),this.height=n?n(this):1};function cn(t,e,n,r){t.text=e,t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null),null!=t.order&&(t.order=null),Ve(t),Ye(t,n);var i=r?r(t):1;i!=t.height&&te(t,i)}function dn(t){t.parent=null,Ve(t)}un.prototype.lineNo=function(){return ee(this)},wt(un);var hn={},fn={};function pn(t,e){if(!t||/^\s*$/.test(t))return null;var n=e.addModeClass?fn:hn;return n[t]||(n[t]=t.replace(/\S+/g,"cm-$&"))}function gn(t,e){var n=P("span",null,null,l?"padding-right: .1px":null),r={pre:P("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:t,trailingSpace:!1,splitSpaces:t.getOption("lineWrapping")};e.measure={};for(var i=0;i<=(e.rest?e.rest.length:0);i++){var o=i?e.rest[i-1]:e.line,a=void 0;r.pos=0,r.addToken=vn,Ot(t.display.measure)&&(a=ht(o,t.doc.direction))&&(r.addToken=bn(r.addToken,a)),r.map=[],wn(o,r,ye(t,o,e!=t.display.externalMeasured&&ee(o))),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=F(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=F(o.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(At(t.display.measure))),0==i?(e.measure.map=r.map,e.measure.cache={}):((e.measure.maps||(e.measure.maps=[])).push(r.map),(e.measure.caches||(e.measure.caches=[])).push({}))}if(l){var s=r.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return vt(t,"renderLine",t,e.line,r.pre),r.pre.className&&(r.textClass=F(r.pre.className,r.textClass||"")),r}function mn(t){var e=L("span","•","cm-invalidchar");return e.title="\\u"+t.charCodeAt(0).toString(16),e.setAttribute("aria-label",e.title),e}function vn(t,e,n,r,i,o,l){if(e){var u,c=t.splitSpaces?yn(e,t.trailingSpace):e,d=t.cm.state.specialChars,h=!1;if(d.test(e)){u=document.createDocumentFragment();for(var f=0;;){d.lastIndex=f;var p=d.exec(e),g=p?p.index-f:e.length-f;if(g){var m=document.createTextNode(c.slice(f,f+g));a&&s<9?u.appendChild(L("span",[m])):u.appendChild(m),t.map.push(t.pos,t.pos+g,m),t.col+=g,t.pos+=g}if(!p)break;f+=g+1;var v=void 0;if("\t"==p[0]){var y=t.cm.options.tabSize,b=y-t.col%y;(v=u.appendChild(L("span",$(b),"cm-tab"))).setAttribute("role","presentation"),v.setAttribute("cm-text","\t"),t.col+=b}else"\r"==p[0]||"\n"==p[0]?((v=u.appendChild(L("span","\r"==p[0]?"␍":"␤","cm-invalidchar"))).setAttribute("cm-text",p[0]),t.col+=1):((v=t.cm.options.specialCharPlaceholder(p[0])).setAttribute("cm-text",p[0]),a&&s<9?u.appendChild(L("span",[v])):u.appendChild(v),t.col+=1);t.map.push(t.pos,t.pos+1,v),t.pos++}}else t.col+=e.length,u=document.createTextNode(c),t.map.push(t.pos,t.pos+e.length,u),a&&s<9&&(h=!0),t.pos+=e.length;if(t.trailingSpace=32==c.charCodeAt(e.length-1),n||r||i||h||o||l){var x=n||"";r&&(x+=r),i&&(x+=i);var w=L("span",[u],x,o);if(l)for(var _ in l)l.hasOwnProperty(_)&&"style"!=_&&"class"!=_&&w.setAttribute(_,l[_]);return t.content.appendChild(w)}t.content.appendChild(u)}}function yn(t,e){if(t.length>1&&!/ /.test(t))return t;for(var n=e,r="",i=0;iu&&d.from<=u);h++);if(d.to>=c)return t(n,r,i,o,a,s,l);t(n,r.slice(0,d.to-u),i,o,null,s,l),o=null,r=r.slice(d.to-u),u=d.to}}}function xn(t,e,n,r){var i=!r&&n.widgetNode;i&&t.map.push(t.pos,t.pos+e,i),!r&&t.cm.display.input.needsContentAttribute&&(i||(i=t.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(t.cm.display.input.setUneditable(i),t.content.appendChild(i)),t.pos+=e,t.trailingSpace=!1}function wn(t,e,n){var r=t.markedSpans,i=t.text,o=0;if(r)for(var a,s,l,u,c,d,h,f=i.length,p=0,g=1,m="",v=0;;){if(v==p){l=u=c=s="",h=null,d=null,v=1/0;for(var y=[],b=void 0,x=0;xp||_.collapsed&&w.to==p&&w.from==p)){if(null!=w.to&&w.to!=p&&v>w.to&&(v=w.to,u=""),_.className&&(l+=" "+_.className),_.css&&(s=(s?s+";":"")+_.css),_.startStyle&&w.from==p&&(c+=" "+_.startStyle),_.endStyle&&w.to==v&&(b||(b=[])).push(_.endStyle,w.to),_.title&&((h||(h={})).title=_.title),_.attributes)for(var k in _.attributes)(h||(h={}))[k]=_.attributes[k];_.collapsed&&(!d||Ge(d.marker,_)<0)&&(d=w)}else w.from>p&&v>w.from&&(v=w.from)}if(b)for(var S=0;S=f)break;for(var C=Math.min(f,v);;){if(m){var T=p+m.length;if(!d){var D=T>C?m.slice(0,C-p):m;e.addToken(e,D,a?a+l:l,c,p+D.length==v?u:"",s,h)}if(T>=C){m=m.slice(C-p),p=C;break}p=T,c=""}m=i.slice(o,o=n[g++]),a=pn(n[g++],e.cm.options)}}else for(var L=1;L2&&o.push((l.bottom+u.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Jn(t,e,n){if(t.line==e)return{map:t.measure.map,cache:t.measure.cache};for(var r=0;rn)return{map:t.measure.maps[i],cache:t.measure.caches[i],before:!0}}function Qn(t,e){var n=ee(e=Je(e)),r=t.display.externalMeasured=new _n(t.doc,e,n);r.lineN=n;var i=r.built=gn(t,r);return r.text=i.pre,D(t.display.lineMeasure,i.pre),r}function tr(t,e,n,r){return rr(t,nr(t,e),n,r)}function er(t,e){if(e>=t.display.viewFrom&&e=n.lineN&&ee)&&(i=(o=l-s)-1,e>=l&&(a="right")),null!=i){if(r=t[u+2],s==l&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==i)for(;u&&t[u-2]==t[u-3]&&t[u-1].insertLeft;)r=t[2+(u-=3)],a="left";if("right"==n&&i==l-s)for(;u=0&&(n=t[i]).left==n.right;i--);return n}function lr(t,e,n,r){var i,o=ar(e.map,n,r),l=o.node,u=o.start,c=o.end,d=o.collapse;if(3==l.nodeType){for(var h=0;h<4;h++){for(;u&&ot(e.line.text.charAt(o.coverStart+u));)--u;for(;o.coverStart+c0&&(d=r="right"),i=t.options.lineWrapping&&(f=l.getClientRects()).length>1?f["right"==r?f.length-1:0]:l.getBoundingClientRect()}if(a&&s<9&&!u&&(!i||!i.left&&!i.right)){var p=l.parentNode.getClientRects()[0];i=p?{left:p.left,right:p.left+Pr(t.display),top:p.top,bottom:p.bottom}:or}for(var g=i.top-e.rect.top,m=i.bottom-e.rect.top,v=(g+m)/2,y=e.view.measure.heights,b=0;b=r.text.length?(l=r.text.length,u="before"):l<=0&&(l=0,u="after"),!s)return a("before"==u?l-1:l,"before"==u);function c(t,e,n){return a(n?t-1:t,1==s[e].level!=n)}var d=ct(s,l,u),h=ut,f=c(l,d,"before"==u);return null!=h&&(f.other=c(l,h,"before"!=u)),f}function xr(t,e){var n=0;e=he(t.doc,e),t.options.lineWrapping||(n=Pr(t.display)*e.ch);var r=Xt(t.doc,e.line),i=an(r)+jn(t.display);return{left:n,right:n,top:i,bottom:i+r.height}}function wr(t,e,n,r,i){var o=oe(t,e,n);return o.xRel=i,r&&(o.outside=r),o}function _r(t,e,n){var r=t.doc;if((n+=t.display.viewOffset)<0)return wr(r.first,0,null,-1,-1);var i=ne(r,n),o=r.first+r.size-1;if(i>o)return wr(r.first+r.size-1,Xt(r,o).text.length,null,1,1);e<0&&(e=0);for(var a=Xt(r,i);;){var s=Cr(t,a,i,e,n),l=Ze(a,s.ch+(s.xRel>0||s.outside>0?1:0));if(!l)return s;var u=l.find(1);if(u.line==i)return u;a=Xt(r,i=u.line)}}function kr(t,e,n,r){r-=gr(e);var i=e.text.length,o=st((function(e){return rr(t,n,e-1).bottom<=r}),i,0);return{begin:o,end:i=st((function(e){return rr(t,n,e).top>r}),o,i)}}function Sr(t,e,n,r){return n||(n=nr(t,e)),kr(t,e,n,mr(t,e,rr(t,n,r),"line").top)}function Mr(t,e,n,r){return!(t.bottom<=n)&&(t.top>n||(r?t.left:t.right)>e)}function Cr(t,e,n,r,i){i-=an(e);var o=nr(t,e),a=gr(e),s=0,l=e.text.length,u=!0,c=ht(e,t.doc.direction);if(c){var d=(t.options.lineWrapping?Dr:Tr)(t,e,n,o,c,r,i);s=(u=1!=d.level)?d.from:d.to-1,l=u?d.to:d.from-1}var h,f,p=null,g=null,m=st((function(e){var n=rr(t,o,e);return n.top+=a,n.bottom+=a,!!Mr(n,r,i,!1)&&(n.top<=i&&n.left<=r&&(p=e,g=n),!0)}),s,l),v=!1;if(g){var y=r-g.left=x.bottom?1:0}return wr(n,m=at(e.text,m,1),f,v,r-h)}function Tr(t,e,n,r,i,o,a){var s=st((function(s){var l=i[s],u=1!=l.level;return Mr(br(t,oe(n,u?l.to:l.from,u?"before":"after"),"line",e,r),o,a,!0)}),0,i.length-1),l=i[s];if(s>0){var u=1!=l.level,c=br(t,oe(n,u?l.from:l.to,u?"after":"before"),"line",e,r);Mr(c,o,a,!0)&&c.top>a&&(l=i[s-1])}return l}function Dr(t,e,n,r,i,o,a){var s=kr(t,e,r,a),l=s.begin,u=s.end;/\s/.test(e.text.charAt(u-1))&&u--;for(var c=null,d=null,h=0;h=u||f.to<=l)){var p=rr(t,r,1!=f.level?Math.min(u,f.to)-1:Math.max(l,f.from)).right,g=pg)&&(c=f,d=g)}}return c||(c=i[i.length-1]),c.fromu&&(c={from:c.from,to:u,level:c.level}),c}function Lr(t){if(null!=t.cachedTextHeight)return t.cachedTextHeight;if(null==ir){ir=L("pre",null,"CodeMirror-line-like");for(var e=0;e<49;++e)ir.appendChild(document.createTextNode("x")),ir.appendChild(L("br"));ir.appendChild(document.createTextNode("x"))}D(t.measure,ir);var n=ir.offsetHeight/50;return n>3&&(t.cachedTextHeight=n),T(t.measure),n||1}function Pr(t){if(null!=t.cachedCharWidth)return t.cachedCharWidth;var e=L("span","xxxxxxxxxx"),n=L("pre",[e],"CodeMirror-line-like");D(t.measure,n);var r=e.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(t.cachedCharWidth=i),i||10}function Ar(t){for(var e=t.display,n={},r={},i=e.gutters.clientLeft,o=e.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var s=t.display.gutterSpecs[a].className;n[s]=o.offsetLeft+o.clientLeft+i,r[s]=o.clientWidth}return{fixedPos:Or(e),gutterTotalWidth:e.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:e.wrapper.clientWidth}}function Or(t){return t.scroller.getBoundingClientRect().left-t.sizer.getBoundingClientRect().left}function Nr(t){var e=Lr(t.display),n=t.options.lineWrapping,r=n&&Math.max(5,t.display.scroller.clientWidth/Pr(t.display)-3);return function(i){if(rn(t.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a0&&(l=Xt(t.doc,u.line).text).length==u.ch){var c=E(l,l.length,t.options.tabSize)-l.length;u=oe(u.line,Math.max(0,Math.round((o-qn(t.display).left)/Pr(t.display))-c))}return u}function Rr(t,e){if(e>=t.display.viewTo)return null;if((e-=t.display.viewFrom)<0)return null;for(var n=t.display.view,r=0;re)&&(i.updateLineNumbers=e),t.curOp.viewChanged=!0,e>=i.viewTo)Pe&&en(t.doc,e)i.viewFrom?zr(t):(i.viewFrom+=r,i.viewTo+=r);else if(e<=i.viewFrom&&n>=i.viewTo)zr(t);else if(e<=i.viewFrom){var o=Hr(t,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):zr(t)}else if(n>=i.viewTo){var a=Hr(t,e,e,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):zr(t)}else{var s=Hr(t,e,e,-1),l=Hr(t,n,n+r,1);s&&l?(i.view=i.view.slice(0,s.index).concat(kn(t,s.lineN,l.lineN)).concat(i.view.slice(l.index)),i.viewTo+=r):zr(t)}var u=i.externalMeasured;u&&(n=i.lineN&&e=r.viewTo)){var o=r.view[Rr(t,e)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==H(a,n)&&a.push(n)}}}function zr(t){t.display.viewFrom=t.display.viewTo=t.doc.first,t.display.view=[],t.display.viewOffset=0}function Hr(t,e,n,r){var i,o=Rr(t,e),a=t.display.view;if(!Pe||n==t.doc.first+t.doc.size)return{index:o,lineN:n};for(var s=t.display.viewFrom,l=0;l0){if(o==a.length-1)return null;i=s+a[o].size-e,o++}else i=s-e;e+=i,n+=i}for(;en(t.doc,n)!=n;){if(o==(r<0?0:a.length-1))return null;n+=r*a[o-(r<0?1:0)].size,o+=r}return{index:o,lineN:n}}function Br(t,e,n){var r=t.display;0==r.view.length||e>=r.viewTo||n<=r.viewFrom?(r.view=kn(t,e,n),r.viewFrom=e):(r.viewFrom>e?r.view=kn(t,e,r.viewFrom).concat(r.view):r.viewFromn&&(r.view=r.view.slice(0,Rr(t,n)))),r.viewTo=n}function Vr(t){for(var e=t.display.view,n=0,r=0;r=t.display.viewTo||s.to().line0?e.blinker=setInterval((function(){t.hasFocus()||Jr(t),e.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),t.options.cursorBlinkRate):t.options.cursorBlinkRate<0&&(e.cursorDiv.style.visibility="hidden")}}function Kr(t){t.hasFocus()||(t.display.input.focus(),t.state.focused||Xr(t))}function Zr(t){t.state.delayingBlurEvent=!0,setTimeout((function(){t.state.delayingBlurEvent&&(t.state.delayingBlurEvent=!1,t.state.focused&&Jr(t))}),100)}function Xr(t,e){t.state.delayingBlurEvent&&!t.state.draggingText&&(t.state.delayingBlurEvent=!1),"nocursor"!=t.options.readOnly&&(t.state.focused||(vt(t,"focus",t,e),t.state.focused=!0,N(t.display.wrapper,"CodeMirror-focused"),t.curOp||t.display.selForContextMenu==t.doc.sel||(t.display.input.reset(),l&&setTimeout((function(){return t.display.input.reset(!0)}),20)),t.display.input.receivedFocus()),$r(t))}function Jr(t,e){t.state.delayingBlurEvent||(t.state.focused&&(vt(t,"blur",t,e),t.state.focused=!1,C(t.display.wrapper,"CodeMirror-focused")),clearInterval(t.display.blinker),setTimeout((function(){t.state.focused||(t.display.shift=!1)}),150))}function Qr(t){for(var e=t.display,n=e.lineDiv.offsetTop,r=0;r.005||h<-.005)&&(te(i.line,l),ti(i.line),i.rest))for(var f=0;ft.display.sizerWidth){var p=Math.ceil(u/Pr(t.display));p>t.display.maxLineLength&&(t.display.maxLineLength=p,t.display.maxLine=i.line,t.display.maxLineChanged=!0)}}}}function ti(t){if(t.widgets)for(var e=0;e=a&&(o=ne(e,an(Xt(e,l))-t.wrapper.clientHeight),a=l)}return{from:o,to:Math.max(a,o+1)}}function ni(t,e){if(!yt(t,"scrollCursorIntoView")){var n=t.display,r=n.sizer.getBoundingClientRect(),i=null;if(e.top+r.top<0?i=!0:e.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!p){var o=L("div","​",null,"position: absolute;\n top: "+(e.top-n.viewOffset-jn(t.display))+"px;\n height: "+(e.bottom-e.top+$n(t)+n.barHeight)+"px;\n left: "+e.left+"px; width: "+Math.max(2,e.right-e.left)+"px;");t.display.lineSpace.appendChild(o),o.scrollIntoView(i),t.display.lineSpace.removeChild(o)}}}function ri(t,e,n,r){var i;null==r&&(r=0),t.options.lineWrapping||e!=n||(n="before"==(e=e.ch?oe(e.line,"before"==e.sticky?e.ch-1:e.ch,"after"):e).sticky?oe(e.line,e.ch+1,"before"):e);for(var o=0;o<5;o++){var a=!1,s=br(t,e),l=n&&n!=e?br(t,n):s,u=oi(t,i={left:Math.min(s.left,l.left),top:Math.min(s.top,l.top)-r,right:Math.max(s.left,l.left),bottom:Math.max(s.bottom,l.bottom)+r}),c=t.doc.scrollTop,d=t.doc.scrollLeft;if(null!=u.scrollTop&&(hi(t,u.scrollTop),Math.abs(t.doc.scrollTop-c)>1&&(a=!0)),null!=u.scrollLeft&&(pi(t,u.scrollLeft),Math.abs(t.doc.scrollLeft-d)>1&&(a=!0)),!a)break}return i}function ii(t,e){var n=oi(t,e);null!=n.scrollTop&&hi(t,n.scrollTop),null!=n.scrollLeft&&pi(t,n.scrollLeft)}function oi(t,e){var n=t.display,r=Lr(t.display);e.top<0&&(e.top=0);var i=t.curOp&&null!=t.curOp.scrollTop?t.curOp.scrollTop:n.scroller.scrollTop,o=Zn(t),a={};e.bottom-e.top>o&&(e.bottom=e.top+o);var s=t.doc.height+Gn(n),l=e.tops-r;if(e.topi+o){var c=Math.min(e.top,(u?s:e.bottom)-o);c!=i&&(a.scrollTop=c)}var d=t.options.fixedGutter?0:n.gutters.offsetWidth,h=t.curOp&&null!=t.curOp.scrollLeft?t.curOp.scrollLeft:n.scroller.scrollLeft-d,f=Kn(t)-n.gutters.offsetWidth,p=e.right-e.left>f;return p&&(e.right=e.left+f),e.left<10?a.scrollLeft=0:e.leftf+h-3&&(a.scrollLeft=e.right+(p?0:10)-f),a}function ai(t,e){null!=e&&(ci(t),t.curOp.scrollTop=(null==t.curOp.scrollTop?t.doc.scrollTop:t.curOp.scrollTop)+e)}function si(t){ci(t);var e=t.getCursor();t.curOp.scrollToPos={from:e,to:e,margin:t.options.cursorScrollMargin}}function li(t,e,n){null==e&&null==n||ci(t),null!=e&&(t.curOp.scrollLeft=e),null!=n&&(t.curOp.scrollTop=n)}function ui(t,e){ci(t),t.curOp.scrollToPos=e}function ci(t){var e=t.curOp.scrollToPos;e&&(t.curOp.scrollToPos=null,di(t,xr(t,e.from),xr(t,e.to),e.margin))}function di(t,e,n,r){var i=oi(t,{left:Math.min(e.left,n.left),top:Math.min(e.top,n.top)-r,right:Math.max(e.right,n.right),bottom:Math.max(e.bottom,n.bottom)+r});li(t,i.scrollLeft,i.scrollTop)}function hi(t,e){Math.abs(t.doc.scrollTop-e)<2||(n||Yi(t,{top:e}),fi(t,e,!0),n&&Yi(t),Ii(t,100))}function fi(t,e,n){e=Math.max(0,Math.min(t.display.scroller.scrollHeight-t.display.scroller.clientHeight,e)),(t.display.scroller.scrollTop!=e||n)&&(t.doc.scrollTop=e,t.display.scrollbars.setScrollTop(e),t.display.scroller.scrollTop!=e&&(t.display.scroller.scrollTop=e))}function pi(t,e,n,r){e=Math.max(0,Math.min(e,t.display.scroller.scrollWidth-t.display.scroller.clientWidth)),(n?e==t.doc.scrollLeft:Math.abs(t.doc.scrollLeft-e)<2)&&!r||(t.doc.scrollLeft=e,qi(t),t.display.scroller.scrollLeft!=e&&(t.display.scroller.scrollLeft=e),t.display.scrollbars.setScrollLeft(e))}function gi(t){var e=t.display,n=e.gutters.offsetWidth,r=Math.round(t.doc.height+Gn(t.display));return{clientHeight:e.scroller.clientHeight,viewHeight:e.wrapper.clientHeight,scrollWidth:e.scroller.scrollWidth,clientWidth:e.scroller.clientWidth,viewWidth:e.wrapper.clientWidth,barLeft:t.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+$n(t)+e.barHeight,nativeBarWidth:e.nativeBarWidth,gutterWidth:n}}var mi=function(t,e,n){this.cm=n;var r=this.vert=L("div",[L("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=L("div",[L("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,t(r),t(i),pt(r,"scroll",(function(){r.clientHeight&&e(r.scrollTop,"vertical")})),pt(i,"scroll",(function(){i.clientWidth&&e(i.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,a&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};mi.prototype.update=function(t){var e=t.scrollWidth>t.clientWidth+1,n=t.scrollHeight>t.clientHeight+1,r=t.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=e?r+"px":"0";var i=t.viewHeight-(e?r:0);this.vert.firstChild.style.height=Math.max(0,t.scrollHeight-t.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(e){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=t.barLeft+"px";var o=t.viewWidth-t.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,t.scrollWidth-t.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&t.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:e?r:0}},mi.prototype.setScrollLeft=function(t){this.horiz.scrollLeft!=t&&(this.horiz.scrollLeft=t),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},mi.prototype.setScrollTop=function(t){this.vert.scrollTop!=t&&(this.vert.scrollTop=t),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},mi.prototype.zeroWidthHack=function(){var t=y&&!f?"12px":"18px";this.horiz.style.height=this.vert.style.width=t,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new z,this.disableVert=new z},mi.prototype.enableZeroWidthBar=function(t,e,n){function r(){var i=t.getBoundingClientRect();("vert"==n?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))!=t?t.style.pointerEvents="none":e.set(1e3,r)}t.style.pointerEvents="auto",e.set(1e3,r)},mi.prototype.clear=function(){var t=this.horiz.parentNode;t.removeChild(this.horiz),t.removeChild(this.vert)};var vi=function(){};function yi(t,e){e||(e=gi(t));var n=t.display.barWidth,r=t.display.barHeight;bi(t,e);for(var i=0;i<4&&n!=t.display.barWidth||r!=t.display.barHeight;i++)n!=t.display.barWidth&&t.options.lineWrapping&&Qr(t),bi(t,gi(t)),n=t.display.barWidth,r=t.display.barHeight}function bi(t,e){var n=t.display,r=n.scrollbars.update(e);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&&t.options.coverGutterNextToScrollbar&&t.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=e.gutterWidth+"px"):n.gutterFiller.style.display=""}vi.prototype.update=function(){return{bottom:0,right:0}},vi.prototype.setScrollLeft=function(){},vi.prototype.setScrollTop=function(){},vi.prototype.clear=function(){};var xi={native:mi,null:vi};function wi(t){t.display.scrollbars&&(t.display.scrollbars.clear(),t.display.scrollbars.addClass&&C(t.display.wrapper,t.display.scrollbars.addClass)),t.display.scrollbars=new xi[t.options.scrollbarStyle]((function(e){t.display.wrapper.insertBefore(e,t.display.scrollbarFiller),pt(e,"mousedown",(function(){t.state.focused&&setTimeout((function(){return t.display.input.focus()}),0)})),e.setAttribute("cm-not-content","true")}),(function(e,n){"horizontal"==n?pi(t,e):hi(t,e)}),t),t.display.scrollbars.addClass&&N(t.display.wrapper,t.display.scrollbars.addClass)}var _i=0;function ki(t){t.curOp={cm:t,viewChanged:!1,startHeight:t.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:++_i},Mn(t.curOp)}function Si(t){var e=t.curOp;e&&Tn(e,(function(t){for(var e=0;e=n.viewTo)||n.maxLineChanged&&e.options.lineWrapping,t.update=t.mustUpdate&&new Wi(e,t.mustUpdate&&{top:t.scrollTop,ensure:t.scrollToPos},t.forceUpdate)}function Ti(t){t.updatedDisplay=t.mustUpdate&&Bi(t.cm,t.update)}function Di(t){var e=t.cm,n=e.display;t.updatedDisplay&&Qr(e),t.barMeasure=gi(e),n.maxLineChanged&&!e.options.lineWrapping&&(t.adjustWidthTo=tr(e,n.maxLine,n.maxLine.text.length).left+3,e.display.sizerWidth=t.adjustWidthTo,t.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+t.adjustWidthTo+$n(e)+e.display.barWidth),t.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+t.adjustWidthTo-Kn(e))),(t.updatedDisplay||t.selectionChanged)&&(t.preparedSelection=n.input.prepareSelection())}function Li(t){var e=t.cm;null!=t.adjustWidthTo&&(e.display.sizer.style.minWidth=t.adjustWidthTo+"px",t.maxScrollLeft=t.display.viewTo)){var n=+new Date+t.options.workTime,r=be(t,e.highlightFrontier),i=[];e.iter(r.line,Math.min(e.first+e.size,t.display.viewTo+500),(function(o){if(r.line>=t.display.viewFrom){var a=o.styles,s=o.text.length>t.options.maxHighlightLength?qt(e.mode,r.state):null,l=ve(t,o,r,!0);s&&(r.state=s),o.styles=l.styles;var u=o.styleClasses,c=l.classes;c?o.styleClasses=c:u&&(o.styleClasses=null);for(var d=!a||a.length!=o.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass),h=0;!d&&hn)return Ii(t,t.options.workDelay),!0})),e.highlightFrontier=r.line,e.modeFrontier=Math.max(e.modeFrontier,r.line),i.length&&Ai(t,(function(){for(var e=0;e=n.viewFrom&&e.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==Vr(t))return!1;$i(t)&&(zr(t),e.dims=Ar(t));var i=r.first+r.size,o=Math.max(e.visible.from-t.options.viewportMargin,r.first),a=Math.min(i,e.visible.to+t.options.viewportMargin);n.viewFroma&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo)),Pe&&(o=en(t.doc,o),a=nn(t.doc,a));var s=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=e.wrapperHeight||n.lastWrapWidth!=e.wrapperWidth;Br(t,o,a),n.viewOffset=an(Xt(t.doc,n.viewFrom)),t.display.mover.style.top=n.viewOffset+"px";var l=Vr(t);if(!s&&0==l&&!e.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var u=zi(t);return l>4&&(n.lineDiv.style.display="none"),Ui(t,n.updateLineNumbers,e.dims),l>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,Hi(u),T(n.cursorDiv),T(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=e.wrapperHeight,n.lastWrapWidth=e.wrapperWidth,Ii(t,400)),n.updateLineNumbers=null,!0}function Vi(t,e){for(var n=e.viewport,r=!0;;r=!1){if(r&&t.options.lineWrapping&&e.oldDisplayWidth!=Kn(t))r&&(e.visible=ei(t.display,t.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(t.doc.height+Gn(t.display)-Zn(t),n.top)}),e.visible=ei(t.display,t.doc,n),e.visible.from>=t.display.viewFrom&&e.visible.to<=t.display.viewTo)break;if(!Bi(t,e))break;Qr(t);var i=gi(t);Yr(t),yi(t,i),Gi(t,i),e.force=!1}e.signal(t,"update",t),t.display.viewFrom==t.display.reportedViewFrom&&t.display.viewTo==t.display.reportedViewTo||(e.signal(t,"viewportChange",t,t.display.viewFrom,t.display.viewTo),t.display.reportedViewFrom=t.display.viewFrom,t.display.reportedViewTo=t.display.viewTo)}function Yi(t,e){var n=new Wi(t,e);if(Bi(t,n)){Qr(t),Vi(t,n);var r=gi(t);Yr(t),yi(t,r),Gi(t,r),n.finish()}}function Ui(t,e,n){var r=t.display,i=t.options.lineNumbers,o=r.lineDiv,a=o.firstChild;function s(e){var n=e.nextSibling;return l&&y&&t.display.currentWheelTarget==e?e.style.display="none":e.parentNode.removeChild(e),n}for(var u=r.view,c=r.viewFrom,d=0;d-1&&(f=!1),An(t,h,c,n)),f&&(T(h.lineNumber),h.lineNumber.appendChild(document.createTextNode(ie(t.options,c)))),a=h.node.nextSibling}else{var p=zn(t,h,c,n);o.insertBefore(p,a)}c+=h.size}for(;a;)a=s(a)}function ji(t){var e=t.gutters.offsetWidth;t.sizer.style.marginLeft=e+"px"}function Gi(t,e){t.display.sizer.style.minHeight=e.docHeight+"px",t.display.heightForcer.style.top=e.docHeight+"px",t.display.gutters.style.height=e.docHeight+t.display.barHeight+$n(t)+"px"}function qi(t){var e=t.display,n=e.view;if(e.alignWidgets||e.gutters.firstChild&&t.options.fixedGutter){for(var r=Or(e)-e.scroller.scrollLeft+t.doc.scrollLeft,i=e.gutters.offsetWidth,o=r+"px",a=0;as.clientWidth,c=s.scrollHeight>s.clientHeight;if(i&&u||o&&c){if(o&&y&&l)t:for(var h=e.target,f=a.view;h!=s;h=h.parentNode)for(var p=0;p=0&&ae(t,r.to())<=0)return n}return-1};var oo=function(t,e){this.anchor=t,this.head=e};function ao(t,e,n){var r=t&&t.options.selectionsMayTouch,i=e[n];e.sort((function(t,e){return ae(t.from(),e.from())})),n=H(e,i);for(var o=1;o0:l>=0){var u=ce(s.from(),a.from()),c=ue(s.to(),a.to()),d=s.empty()?a.from()==a.head:s.from()==s.head;o<=n&&--n,e.splice(--o,2,new oo(d?c:u,d?u:c))}}return new io(e,n)}function so(t,e){return new io([new oo(t,e||t)],0)}function lo(t){return t.text?oe(t.from.line+t.text.length-1,K(t.text).length+(1==t.text.length?t.from.ch:0)):t.to}function uo(t,e){if(ae(t,e.from)<0)return t;if(ae(t,e.to)<=0)return lo(e);var n=t.line+e.text.length-(e.to.line-e.from.line)-1,r=t.ch;return t.line==e.to.line&&(r+=lo(e).ch-e.to.ch),oe(n,r)}function co(t,e){for(var n=[],r=0;r1&&t.remove(s.line+1,p-1),t.insert(s.line+1,v)}Ln(t,"change",t,e)}function yo(t,e,n){function r(t,i,o){if(t.linked)for(var a=0;a1&&!t.done[t.done.length-2].ranges?(t.done.pop(),K(t.done)):void 0}function Co(t,e,n,r){var i=t.history;i.undone.length=0;var o,a,s=+new Date;if((i.lastOp==r||i.lastOrigin==e.origin&&e.origin&&("+"==e.origin.charAt(0)&&i.lastModTime>s-(t.cm?t.cm.options.historyEventDelay:500)||"*"==e.origin.charAt(0)))&&(o=Mo(i,i.lastOp==r)))a=K(o.changes),0==ae(e.from,e.to)&&0==ae(e.from,a.to)?a.to=lo(e):o.changes.push(ko(t,e));else{var l=K(i.done);for(l&&l.ranges||Lo(t.sel,i.done),o={changes:[ko(t,e)],generation:i.generation},i.done.push(o);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=s,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=e.origin,a||vt(t,"historyAdded")}function To(t,e,n,r){var i=e.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-t.history.lastSelTime<=(t.cm?t.cm.options.historyEventDelay:500)}function Do(t,e,n,r){var i=t.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||To(t,o,K(i.done),e))?i.done[i.done.length-1]=e:Lo(e,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&!1!==r.clearRedo&&So(i.undone)}function Lo(t,e){var n=K(e);n&&n.ranges&&n.equals(t)||e.push(t)}function Po(t,e,n,r){var i=e["spans_"+t.id],o=0;t.iter(Math.max(t.first,n),Math.min(t.first+t.size,r),(function(n){n.markedSpans&&((i||(i=e["spans_"+t.id]={}))[o]=n.markedSpans),++o}))}function Ao(t){if(!t)return null;for(var e,n=0;n-1&&(K(s)[d]=u[d],delete u[d])}}}return r}function Io(t,e,n,r){if(r){var i=t.anchor;if(n){var o=ae(e,i)<0;o!=ae(n,i)<0?(i=e,e=n):o!=ae(e,n)<0&&(e=n)}return new oo(i,e)}return new oo(n||e,e)}function Ro(t,e,n,r,i){null==i&&(i=t.cm&&(t.cm.display.shift||t.extend)),Vo(t,new io([Io(t.sel.primary(),e,n,i)],0),r)}function Wo(t,e,n){for(var r=[],i=t.cm&&(t.cm.display.shift||t.extend),o=0;o=e.ch:s.to>e.ch))){if(i&&(vt(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!l.atomic)continue;if(n){var d=l.find(r<0?1:-1),h=void 0;if((r<0?c:u)&&(d=Ko(t,d,-r,d&&d.line==e.line?o:null)),d&&d.line==e.line&&(h=ae(d,n))&&(r<0?h<0:h>0))return qo(t,d,e,r,i)}var f=l.find(r<0?-1:1);return(r<0?u:c)&&(f=Ko(t,f,r,f.line==e.line?o:null)),f?qo(t,f,e,r,i):null}}return e}function $o(t,e,n,r,i){var o=r||1,a=qo(t,e,n,o,i)||!i&&qo(t,e,n,o,!0)||qo(t,e,n,-o,i)||!i&&qo(t,e,n,-o,!0);return a||(t.cantEdit=!0,oe(t.first,0))}function Ko(t,e,n,r){return n<0&&0==e.ch?e.line>t.first?he(t,oe(e.line-1)):null:n>0&&e.ch==(r||Xt(t,e.line)).text.length?e.line=0;--i)Qo(t,{from:r[i].from,to:r[i].to,text:i?[""]:e.text,origin:e.origin});else Qo(t,e)}}function Qo(t,e){if(1!=e.text.length||""!=e.text[0]||0!=ae(e.from,e.to)){var n=co(t,e);Co(t,e,n,t.cm?t.cm.curOp.id:NaN),na(t,e,n,ze(t,e));var r=[];yo(t,(function(t,n){n||-1!=H(r,t.history)||(sa(t.history,e),r.push(t.history)),na(t,e,null,ze(t,e))}))}}function ta(t,e,n){var r=t.cm&&t.cm.state.suppressEdits;if(!r||n){for(var i,o=t.history,a=t.sel,s="undo"==e?o.done:o.undone,l="undo"==e?o.undone:o.done,u=0;u=0;--f){var p=h(f);if(p)return p.v}}}}function ea(t,e){if(0!=e&&(t.first+=e,t.sel=new io(Z(t.sel.ranges,(function(t){return new oo(oe(t.anchor.line+e,t.anchor.ch),oe(t.head.line+e,t.head.ch))})),t.sel.primIndex),t.cm)){Wr(t.cm,t.first,t.first-e,e);for(var n=t.cm.display,r=n.viewFrom;rt.lastLine())){if(e.from.lineo&&(e={from:e.from,to:oe(o,Xt(t,o).text.length),text:[e.text[0]],origin:e.origin}),e.removed=Jt(t,e.from,e.to),n||(n=co(t,e)),t.cm?ra(t.cm,e,r):vo(t,e,r),Yo(t,n,Y),t.cantEdit&&$o(t,oe(t.firstLine(),0))&&(t.cantEdit=!1)}}function ra(t,e,n){var r=t.doc,i=t.display,o=e.from,a=e.to,s=!1,l=o.line;t.options.lineWrapping||(l=ee(Je(Xt(r,o.line))),r.iter(l,a.line+1,(function(t){if(t==i.maxLine)return s=!0,!0}))),r.sel.contains(e.from,e.to)>-1&&bt(t),vo(r,e,n,Nr(t)),t.options.lineWrapping||(r.iter(l,o.line+e.text.length,(function(t){var e=sn(t);e>i.maxLineLength&&(i.maxLine=t,i.maxLineLength=e,i.maxLineChanged=!0,s=!1)})),s&&(t.curOp.updateMaxLine=!0)),De(r,o.line),Ii(t,400);var u=e.text.length-(a.line-o.line)-1;e.full?Wr(t):o.line!=a.line||1!=e.text.length||mo(t.doc,e)?Wr(t,o.line,a.line+1,u):Er(t,o.line,"text");var c=xt(t,"changes"),d=xt(t,"change");if(d||c){var h={from:o,to:a,text:e.text,removed:e.removed,origin:e.origin};d&&Ln(t,"change",t,h),c&&(t.curOp.changeObjs||(t.curOp.changeObjs=[])).push(h)}t.display.selForContextMenu=null}function ia(t,e,n,r,i){var o;r||(r=n),ae(r,n)<0&&(n=(o=[r,n])[0],r=o[1]),"string"==typeof e&&(e=t.splitLines(e)),Jo(t,{from:n,to:r,text:e,origin:i})}function oa(t,e,n,r){n1||!(this.children[0]instanceof ua))){var s=[];this.collapse(s),this.children=[new ua(s)],this.children[0].parent=this}},collapse:function(t){for(var e=0;e50){for(var a=i.lines.length%25+25,s=a;s10);t.parent.maybeSpill()}},iterN:function(t,e,n){for(var r=0;r0||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=P("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Xe(t,e.line,e,n,o)||e.line!=n.line&&Xe(t,n.line,e,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Oe()}o.addToHistory&&Co(t,{from:e,to:n,origin:"markText"},t.sel,NaN);var s,l=e.line,u=t.cm;if(t.iter(l,n.line+1,(function(t){u&&o.collapsed&&!u.options.lineWrapping&&Je(t)==u.display.maxLine&&(s=!0),o.collapsed&&l!=e.line&&te(t,0),Re(t,new Ne(o,l==e.line?e.ch:null,l==n.line?n.ch:null)),++l})),o.collapsed&&t.iter(e.line,n.line+1,(function(e){rn(t,e)&&te(e,0)})),o.clearOnEnter&&pt(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(Ae(),(t.history.done.length||t.history.undone.length)&&t.clearHistory()),o.collapsed&&(o.id=++pa,o.atomic=!0),u){if(s&&(u.curOp.updateMaxLine=!0),o.collapsed)Wr(u,e.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var c=e.line;c<=n.line;c++)Er(u,c,"text");o.atomic&&jo(u.doc),Ln(u,"markerAdded",u,o)}return o}ga.prototype.clear=function(){if(!this.explicitlyCleared){var t=this.doc.cm,e=t&&!t.curOp;if(e&&ki(t),xt(this,"clear")){var n=this.find();n&&Ln(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;ot.display.maxLineLength&&(t.display.maxLine=u,t.display.maxLineLength=c,t.display.maxLineChanged=!0)}null!=r&&t&&this.collapsed&&Wr(t,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&jo(t.doc)),t&&Ln(t,"markerCleared",t,this,r,i),e&&Si(t),this.parent&&this.parent.clear()}},ga.prototype.find=function(t,e){var n,r;null==t&&"bookmark"==this.type&&(t=1);for(var i=0;i=0;l--)Jo(this,r[l]);s?Bo(this,s):this.cm&&si(this.cm)})),undo:Fi((function(){ta(this,"undo")})),redo:Fi((function(){ta(this,"redo")})),undoSelection:Fi((function(){ta(this,"undo",!0)})),redoSelection:Fi((function(){ta(this,"redo",!0)})),setExtending:function(t){this.extend=t},getExtending:function(){return this.extend},historySize:function(){for(var t=this.history,e=0,n=0,r=0;r=t.ch)&&e.push(i.marker.parent||i.marker)}return e},findMarks:function(t,e,n){t=he(this,t),e=he(this,e);var r=[],i=t.line;return this.iter(t.line,e.line+1,(function(o){var a=o.markedSpans;if(a)for(var s=0;s=l.to||null==l.from&&i!=t.line||null!=l.from&&i==e.line&&l.from>=e.ch||n&&!n(l.marker)||r.push(l.marker.parent||l.marker)}++i})),r},getAllMarks:function(){var t=[];return this.iter((function(e){var n=e.markedSpans;if(n)for(var r=0;rt)return e=t,!0;t-=o,++n})),he(this,oe(n,e))},indexFromPos:function(t){var e=(t=he(this,t)).ch;if(t.linee&&(e=t.from),null!=t.to&&t.to-1)return e.state.draggingText(t),void setTimeout((function(){return e.display.input.focus()}),20);try{var d=t.dataTransfer.getData("Text");if(d){var h;if(e.state.draggingText&&!e.state.draggingText.copy&&(h=e.listSelections()),Yo(e.doc,so(n,n)),h)for(var f=0;f=0;e--)ia(t.doc,"",r[e].from,r[e].to,"+delete");si(t)}))}function qa(t,e,n){var r=at(t.text,e+n,n);return r<0||r>t.text.length?null:r}function $a(t,e,n){var r=qa(t,e.ch,n);return null==r?null:new oe(e.line,r,n<0?"after":"before")}function Ka(t,e,n,r,i){if(t){"rtl"==e.doc.direction&&(i=-i);var o=ht(n,e.doc.direction);if(o){var a,s=i<0?K(o):o[0],l=i<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==e.doc.direction){var u=nr(e,n);a=i<0?n.text.length-1:0;var c=rr(e,u,a).top;a=st((function(t){return rr(e,u,t).top==c}),i<0==(1==s.level)?s.from:s.to-1,a),"before"==l&&(a=qa(n,a,1))}else a=i<0?s.to:s.from;return new oe(r,a,l)}}return new oe(r,i<0?n.text.length:0,i<0?"before":"after")}function Za(t,e,n,r){var i=ht(e,t.doc.direction);if(!i)return $a(e,n,r);n.ch>=e.text.length?(n.ch=e.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=ct(i,n.ch,n.sticky),a=i[o];if("ltr"==t.doc.direction&&a.level%2==0&&(r>0?a.to>n.ch:a.from=a.from&&h>=c.begin)){var f=d?"before":"after";return new oe(n.line,h,f)}}var p=function(t,e,r){for(var o=function(t,e){return e?new oe(n.line,l(t,1),"before"):new oe(n.line,t,"after")};t>=0&&t0==(1!=a.level),u=s?r.begin:l(r.end,-1);if(a.from<=u&&u0?c.end:l(c.begin,-1);return null==m||r>0&&m==e.text.length||!(g=p(r>0?0:i.length-1,r,u(m)))?null:g}Ea.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Ea.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Ea.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Ea.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Ea.default=y?Ea.macDefault:Ea.pcDefault;var Xa={selectAll:Zo,singleSelection:function(t){return t.setSelection(t.getCursor("anchor"),t.getCursor("head"),Y)},killLine:function(t){return Ga(t,(function(e){if(e.empty()){var n=Xt(t.doc,e.head.line).text.length;return e.head.ch==n&&e.head.line0)i=new oe(i.line,i.ch+1),t.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),oe(i.line,i.ch-2),i,"+transpose");else if(i.line>t.doc.first){var a=Xt(t.doc,i.line-1).text;a&&(i=new oe(i.line,1),t.replaceRange(o.charAt(0)+t.doc.lineSeparator()+a.charAt(a.length-1),oe(i.line-1,a.length-1),i,"+transpose"))}n.push(new oo(i,i))}t.setSelections(n)}))},newlineAndIndent:function(t){return Ai(t,(function(){for(var e=t.listSelections(),n=e.length-1;n>=0;n--)t.replaceRange(t.doc.lineSeparator(),e[n].anchor,e[n].head,"+input");e=t.listSelections();for(var r=0;r-1&&(ae((i=s.ranges[i]).from(),e)<0||e.xRel>0)&&(ae(i.to(),e)>0||e.xRel<0)?_s(t,r,e,o):Ss(t,r,e,o)}function _s(t,e,n,r){var i=t.display,o=!1,u=Oi(t,(function(e){l&&(i.scroller.draggable=!1),t.state.draggingText=!1,t.state.delayingBlurEvent&&(t.hasFocus()?t.state.delayingBlurEvent=!1:Zr(t)),mt(i.wrapper.ownerDocument,"mouseup",u),mt(i.wrapper.ownerDocument,"mousemove",c),mt(i.scroller,"dragstart",d),mt(i.scroller,"drop",u),o||(_t(e),r.addNew||Ro(t.doc,n,null,null,r.extend),l&&!h||a&&9==s?setTimeout((function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()}),20):i.input.focus())})),c=function(t){o=o||Math.abs(e.clientX-t.clientX)+Math.abs(e.clientY-t.clientY)>=10},d=function(){return o=!0};l&&(i.scroller.draggable=!0),t.state.draggingText=u,u.copy=!r.moveOnDrag,pt(i.wrapper.ownerDocument,"mouseup",u),pt(i.wrapper.ownerDocument,"mousemove",c),pt(i.scroller,"dragstart",d),pt(i.scroller,"drop",u),t.state.delayingBlurEvent=!0,setTimeout((function(){return i.input.focus()}),20),i.scroller.dragDrop&&i.scroller.dragDrop()}function ks(t,e,n){if("char"==n)return new oo(e,e);if("word"==n)return t.findWordAt(e);if("line"==n)return new oo(oe(e.line,0),he(t.doc,oe(e.line+1,0)));var r=n(t,e);return new oo(r.from,r.to)}function Ss(t,e,n,r){a&&Zr(t);var i=t.display,o=t.doc;_t(e);var s,l,u=o.sel,c=u.ranges;if(r.addNew&&!r.extend?(l=o.sel.contains(n),s=l>-1?c[l]:new oo(n,n)):(s=o.sel.primary(),l=o.sel.primIndex),"rectangle"==r.unit)r.addNew||(s=new oo(n,n)),n=Ir(t,e,!0,!0),l=-1;else{var d=ks(t,n,r.unit);s=r.extend?Io(s,d.anchor,d.head,r.extend):d}r.addNew?-1==l?(l=c.length,Vo(o,ao(t,c.concat([s]),l),{scroll:!1,origin:"*mouse"})):c.length>1&&c[l].empty()&&"char"==r.unit&&!r.extend?(Vo(o,ao(t,c.slice(0,l).concat(c.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),u=o.sel):Eo(o,l,s,U):(l=0,Vo(o,new io([s],0),U),u=o.sel);var h=n;function f(e){if(0!=ae(h,e))if(h=e,"rectangle"==r.unit){for(var i=[],a=t.options.tabSize,c=E(Xt(o,n.line).text,n.ch,a),d=E(Xt(o,e.line).text,e.ch,a),f=Math.min(c,d),p=Math.max(c,d),g=Math.min(n.line,e.line),m=Math.min(t.lastLine(),Math.max(n.line,e.line));g<=m;g++){var v=Xt(o,g).text,y=G(v,f,a);f==p?i.push(new oo(oe(g,y),oe(g,y))):v.length>y&&i.push(new oo(oe(g,y),oe(g,G(v,p,a))))}i.length||i.push(new oo(n,n)),Vo(o,ao(t,u.ranges.slice(0,l).concat(i),l),{origin:"*mouse",scroll:!1}),t.scrollIntoView(e)}else{var b,x=s,w=ks(t,e,r.unit),_=x.anchor;ae(w.anchor,_)>0?(b=w.head,_=ce(x.from(),w.anchor)):(b=w.anchor,_=ue(x.to(),w.head));var k=u.ranges.slice(0);k[l]=Ms(t,new oo(he(o,_),b)),Vo(o,ao(t,k,l),U)}}var p=i.wrapper.getBoundingClientRect(),g=0;function m(e){var n=++g,a=Ir(t,e,!0,"rectangle"==r.unit);if(a)if(0!=ae(a,h)){t.curOp.focus=O(),f(a);var s=ei(i,o);(a.line>=s.to||a.linep.bottom?20:0;l&&setTimeout(Oi(t,(function(){g==n&&(i.scroller.scrollTop+=l,m(e))})),50)}}function v(e){t.state.selectingText=!1,g=1/0,e&&(_t(e),i.input.focus()),mt(i.wrapper.ownerDocument,"mousemove",y),mt(i.wrapper.ownerDocument,"mouseup",b),o.history.lastSelOrigin=null}var y=Oi(t,(function(t){0!==t.buttons&&Tt(t)?m(t):v(t)})),b=Oi(t,v);t.state.selectingText=b,pt(i.wrapper.ownerDocument,"mousemove",y),pt(i.wrapper.ownerDocument,"mouseup",b)}function Ms(t,e){var n=e.anchor,r=e.head,i=Xt(t.doc,n.line);if(0==ae(n,r)&&n.sticky==r.sticky)return e;var o=ht(i);if(!o)return e;var a=ct(o,n.ch,n.sticky),s=o[a];if(s.from!=n.ch&&s.to!=n.ch)return e;var l,u=a+(s.from==n.ch==(1!=s.level)?0:1);if(0==u||u==o.length)return e;if(r.line!=n.line)l=(r.line-n.line)*("ltr"==t.doc.direction?1:-1)>0;else{var c=ct(o,r.ch,r.sticky),d=c-a||(r.ch-n.ch)*(1==s.level?-1:1);l=c==u-1||c==u?d<0:d>0}var h=o[u+(l?-1:0)],f=l==(1==h.level),p=f?h.from:h.to,g=f?"after":"before";return n.ch==p&&n.sticky==g?e:new oo(new oe(n.line,p,g),r)}function Cs(t,e,n,r){var i,o;if(e.touches)i=e.touches[0].clientX,o=e.touches[0].clientY;else try{i=e.clientX,o=e.clientY}catch(t){return!1}if(i>=Math.floor(t.display.gutters.getBoundingClientRect().right))return!1;r&&_t(e);var a=t.display,s=a.lineDiv.getBoundingClientRect();if(o>s.bottom||!xt(t,n))return St(e);o-=s.top-a.viewOffset;for(var l=0;l=i)return vt(t,n,t,ne(t.doc,o),t.display.gutterSpecs[l].className,e),St(e)}}function Ts(t,e){return Cs(t,e,"gutterClick",!0)}function Ds(t,e){Un(t.display,e)||Ls(t,e)||yt(t,e,"contextmenu")||k||t.display.input.onContextMenu(e)}function Ls(t,e){return!!xt(t,"gutterContextMenu")&&Cs(t,e,"gutterContextMenu",!1)}function Ps(t){t.display.wrapper.className=t.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+t.options.theme.replace(/(^|\s)\s*/g," cm-s-"),hr(t)}ms.prototype.compare=function(t,e,n){return this.time+gs>t&&0==ae(e,this.pos)&&n==this.button};var As={toString:function(){return"CodeMirror.Init"}},Os={},Ns={};function Fs(t){var e=t.optionHandlers;function n(n,r,i,o){t.defaults[n]=r,i&&(e[n]=o?function(t,e,n){n!=As&&i(t,e,n)}:i)}t.defineOption=n,t.Init=As,n("value","",(function(t,e){return t.setValue(e)}),!0),n("mode",null,(function(t,e){t.doc.modeOption=e,po(t)}),!0),n("indentUnit",2,po,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(t){go(t),hr(t),Wr(t)}),!0),n("lineSeparator",null,(function(t,e){if(t.doc.lineSep=e,e){var n=[],r=t.doc.first;t.doc.iter((function(t){for(var i=0;;){var o=t.text.indexOf(e,i);if(-1==o)break;i=o+e.length,n.push(oe(r,o))}r++}));for(var i=n.length-1;i>=0;i--)ia(t.doc,e,n[i],oe(n[i].line,n[i].ch+e.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(t,e,n){t.state.specialChars=new RegExp(e.source+(e.test("\t")?"":"|\t"),"g"),n!=As&&t.refresh()})),n("specialCharPlaceholder",mn,(function(t){return t.refresh()}),!0),n("electricChars",!0),n("inputStyle",v?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),n("spellcheck",!1,(function(t,e){return t.getInputField().spellcheck=e}),!0),n("autocorrect",!1,(function(t,e){return t.getInputField().autocorrect=e}),!0),n("autocapitalize",!1,(function(t,e){return t.getInputField().autocapitalize=e}),!0),n("rtlMoveVisually",!x),n("wholeLineUpdateBefore",!0),n("theme","default",(function(t){Ps(t),Xi(t)}),!0),n("keyMap","default",(function(t,e,n){var r=ja(e),i=n!=As&&ja(n);i&&i.detach&&i.detach(t,r),r.attach&&r.attach(t,i||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Rs,!0),n("gutters",[],(function(t,e){t.display.gutterSpecs=Ki(e,t.options.lineNumbers),Xi(t)}),!0),n("fixedGutter",!0,(function(t,e){t.display.gutters.style.left=e?Or(t.display)+"px":"0",t.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(t){return yi(t)}),!0),n("scrollbarStyle","native",(function(t){wi(t),yi(t),t.display.scrollbars.setScrollTop(t.doc.scrollTop),t.display.scrollbars.setScrollLeft(t.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(t,e){t.display.gutterSpecs=Ki(t.options.gutters,e),Xi(t)}),!0),n("firstLineNumber",1,Xi,!0),n("lineNumberFormatter",(function(t){return t}),Xi,!0),n("showCursorWhenSelecting",!1,Yr,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(t,e){"nocursor"==e&&(Jr(t),t.display.input.blur()),t.display.input.readOnlyChanged(e)})),n("screenReaderLabel",null,(function(t,e){e=""===e?null:e,t.display.input.screenReaderLabelChanged(e)})),n("disableInput",!1,(function(t,e){e||t.display.input.reset()}),!0),n("dragDrop",!0,Is),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,Yr,!0),n("singleCursorHeightPerLine",!0,Yr,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,go,!0),n("addModeClass",!1,go,!0),n("pollInterval",100),n("undoDepth",200,(function(t,e){return t.doc.history.undoDepth=e})),n("historyEventDelay",1250),n("viewportMargin",10,(function(t){return t.refresh()}),!0),n("maxHighlightLength",1e4,go,!0),n("moveInputWithCursor",!0,(function(t,e){e||t.display.input.resetPosition()})),n("tabindex",null,(function(t,e){return t.display.input.getField().tabIndex=e||""})),n("autofocus",null),n("direction","ltr",(function(t,e){return t.doc.setDirection(e)}),!0),n("phrases",null)}function Is(t,e,n){if(!e!=!(n&&n!=As)){var r=t.display.dragFunctions,i=e?pt:mt;i(t.display.scroller,"dragstart",r.start),i(t.display.scroller,"dragenter",r.enter),i(t.display.scroller,"dragover",r.over),i(t.display.scroller,"dragleave",r.leave),i(t.display.scroller,"drop",r.drop)}}function Rs(t){t.options.lineWrapping?(N(t.display.wrapper,"CodeMirror-wrap"),t.display.sizer.style.minWidth="",t.display.sizerWidth=null):(C(t.display.wrapper,"CodeMirror-wrap"),ln(t)),Fr(t),Wr(t),hr(t),setTimeout((function(){return yi(t)}),100)}function Ws(t,e){var n=this;if(!(this instanceof Ws))return new Ws(t,e);this.options=e=e?W(e):{},W(Os,e,!1);var r=e.value;"string"==typeof r?r=new ka(r,e.mode,null,e.lineSeparator,e.direction):e.mode&&(r.modeOption=e.mode),this.doc=r;var i=new Ws.inputStyles[e.inputStyle](this),o=this.display=new Ji(t,r,i,e);for(var u in o.wrapper.CodeMirror=this,Ps(this),e.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),wi(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 z,keySeq:null,specialChars:null},e.autofocus&&!v&&o.input.focus(),a&&s<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),Es(this),Aa(),ki(this),this.curOp.forceUpdate=!0,bo(this,r),e.autofocus&&!v||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&Xr(n)}),20):Jr(this),Ns)Ns.hasOwnProperty(u)&&Ns[u](this,e[u],As);$i(this),e.finishInit&&e.finishInit(this);for(var c=0;c400}pt(e.scroller,"touchstart",(function(i){if(!yt(t,i)&&!o(i)&&!Ts(t,i)){e.input.ensurePolled(),clearTimeout(n);var a=+new Date;e.activeTouch={start:a,moved:!1,prev:a-r.end<=300?r:null},1==i.touches.length&&(e.activeTouch.left=i.touches[0].pageX,e.activeTouch.top=i.touches[0].pageY)}})),pt(e.scroller,"touchmove",(function(){e.activeTouch&&(e.activeTouch.moved=!0)})),pt(e.scroller,"touchend",(function(n){var r=e.activeTouch;if(r&&!Un(e,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var o,a=t.coordsChar(e.activeTouch,"page");o=!r.prev||l(r,r.prev)?new oo(a,a):!r.prev.prev||l(r,r.prev.prev)?t.findWordAt(a):new oo(oe(a.line,0),he(t.doc,oe(a.line+1,0))),t.setSelection(o.anchor,o.head),t.focus(),_t(n)}i()})),pt(e.scroller,"touchcancel",i),pt(e.scroller,"scroll",(function(){e.scroller.clientHeight&&(hi(t,e.scroller.scrollTop),pi(t,e.scroller.scrollLeft,!0),vt(t,"scroll",t))})),pt(e.scroller,"mousewheel",(function(e){return ro(t,e)})),pt(e.scroller,"DOMMouseScroll",(function(e){return ro(t,e)})),pt(e.wrapper,"scroll",(function(){return e.wrapper.scrollTop=e.wrapper.scrollLeft=0})),e.dragFunctions={enter:function(e){yt(t,e)||Mt(e)},over:function(e){yt(t,e)||(Ta(t,e),Mt(e))},start:function(e){return Ca(t,e)},drop:Oi(t,Ma),leave:function(e){yt(t,e)||Da(t)}};var u=e.input.getField();pt(u,"keyup",(function(e){return ds.call(t,e)})),pt(u,"keydown",Oi(t,us)),pt(u,"keypress",Oi(t,hs)),pt(u,"focus",(function(e){return Xr(t,e)})),pt(u,"blur",(function(e){return Jr(t,e)}))}Ws.defaults=Os,Ws.optionHandlers=Ns;var zs=[];function Hs(t,e,n,r){var i,o=t.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=be(t,e).state:n="prev");var a=t.options.tabSize,s=Xt(o,e),l=E(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var u,c=s.text.match(/^\s*/)[0];if(r||/\S/.test(s.text)){if("smart"==n&&((u=o.mode.indent(i,s.text.slice(c.length),s.text))==V||u>150)){if(!r)return;n="prev"}}else u=0,n="not";"prev"==n?u=e>o.first?E(Xt(o,e-1).text,null,a):0:"add"==n?u=l+t.options.indentUnit:"subtract"==n?u=l-t.options.indentUnit:"number"==typeof n&&(u=l+n),u=Math.max(0,u);var d="",h=0;if(t.options.indentWithTabs)for(var f=Math.floor(u/a);f;--f)h+=a,d+="\t";if(ha,l=Ft(e),u=null;if(s&&r.ranges.length>1)if(Bs&&Bs.text.join("\n")==e){if(r.ranges.length%Bs.text.length==0){u=[];for(var c=0;c=0;h--){var f=r.ranges[h],p=f.from(),g=f.to();f.empty()&&(n&&n>0?p=oe(p.line,p.ch-n):t.state.overwrite&&!s?g=oe(g.line,Math.min(Xt(o,g.line).text.length,g.ch+K(l).length)):s&&Bs&&Bs.lineWise&&Bs.text.join("\n")==l.join("\n")&&(p=g=oe(p.line,0)));var m={from:p,to:g,text:u?u[h%u.length]:l,origin:i||(s?"paste":t.state.cutIncoming>a?"cut":"+input")};Jo(t.doc,m),Ln(t,"inputRead",t,m)}e&&!s&&js(t,e),si(t),t.curOp.updateInput<2&&(t.curOp.updateInput=d),t.curOp.typing=!0,t.state.pasteIncoming=t.state.cutIncoming=-1}function Us(t,e){var n=t.clipboardData&&t.clipboardData.getData("Text");if(n)return t.preventDefault(),e.isReadOnly()||e.options.disableInput||Ai(e,(function(){return Ys(e,n,0,null,"paste")})),!0}function js(t,e){if(t.options.electricChars&&t.options.smartIndent)for(var n=t.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 o=t.getModeAt(i.head),a=!1;if(o.electricChars){for(var s=0;s-1){a=Hs(t,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Xt(t.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Hs(t,i.head.line,"smart"));a&&Ln(t,"electricInput",t,i.head.line)}}}function Gs(t){for(var e=[],n=[],r=0;rn&&(Hs(this,i.head.line,t,!0),n=i.head.line,r==this.doc.sel.primIndex&&si(this));else{var o=i.from(),a=i.to(),s=Math.max(n,o.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var l=s;l0&&Eo(this.doc,r,new oo(o,u[r].to()),Y)}}})),getTokenAt:function(t,e){return Se(this,t,e)},getLineTokens:function(t,e){return Se(this,oe(t),e,!0)},getTokenTypeAt:function(t){t=he(this.doc,t);var e,n=ye(this,Xt(this.doc,t.line)),r=0,i=(n.length-1)/2,o=t.ch;if(0==o)e=n[2];else for(;;){var a=r+i>>1;if((a?n[2*a-1]:0)>=o)i=a;else{if(!(n[2*a+1]o&&(t=o,i=!0),r=Xt(this.doc,t)}else r=t;return mr(this,r,{top:0,left:0},e||"page",n||i).top+(i?this.doc.height-an(r):0)},defaultTextHeight:function(){return Lr(this.display)},defaultCharWidth:function(){return Pr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(t,e,n,r,i){var o=this.display,a=(t=br(this,he(this.doc,t))).bottom,s=t.left;if(e.style.position="absolute",e.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(e),o.sizer.appendChild(e),"over"==r)a=t.top;else if("above"==r||"near"==r){var l=Math.max(o.wrapper.clientHeight,this.doc.height),u=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==r||t.bottom+e.offsetHeight>l)&&t.top>e.offsetHeight?a=t.top-e.offsetHeight:t.bottom+e.offsetHeight<=l&&(a=t.bottom),s+e.offsetWidth>u&&(s=u-e.offsetWidth)}e.style.top=a+"px",e.style.left=e.style.right="","right"==i?(s=o.sizer.clientWidth-e.offsetWidth,e.style.right="0px"):("left"==i?s=0:"middle"==i&&(s=(o.sizer.clientWidth-e.offsetWidth)/2),e.style.left=s+"px"),n&&ii(this,{left:s,top:a,right:s+e.offsetWidth,bottom:a+e.offsetHeight})},triggerOnKeyDown:Ni(us),triggerOnKeyPress:Ni(hs),triggerOnKeyUp:ds,triggerOnMouseDown:Ni(ys),execCommand:function(t){if(Xa.hasOwnProperty(t))return Xa[t].call(null,this)},triggerElectric:Ni((function(t){js(this,t)})),findPosH:function(t,e,n,r){var i=1;e<0&&(i=-1,e=-e);for(var o=he(this.doc,t),a=0;a0&&a(e.charAt(n-1));)--n;for(;r.5||this.options.lineWrapping)&&Fr(this),vt(this,"refresh",this)})),swapDoc:Ni((function(t){var e=this.doc;return e.cm=null,this.state.selectingText&&this.state.selectingText(),bo(this,t),hr(this),this.display.input.reset(),li(this,t.scrollLeft,t.scrollTop),this.curOp.forceScroll=!0,Ln(this,"swapDoc",this,e),e})),phrase:function(t){var e=this.options.phrases;return e&&Object.prototype.hasOwnProperty.call(e,t)?e[t]:t},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}},wt(t),t.registerHelper=function(e,r,i){n.hasOwnProperty(e)||(n[e]=t[e]={_global:[]}),n[e][r]=i},t.registerGlobalHelper=function(e,r,i,o){t.registerHelper(e,r,o),n[e]._global.push({pred:i,val:o})}}function Zs(t,e,n,r,i){var o=e,a=n,s=Xt(t,e.line),l=i&&"rtl"==t.direction?-n:n;function u(){var n=e.line+l;return!(n=t.first+t.size)&&(e=new oe(n,e.ch,e.sticky),s=Xt(t,n))}function c(o){var a;if("codepoint"==r){var c=s.text.charCodeAt(e.ch+(r>0?0:-1));a=isNaN(c)?null:new oe(e.line,Math.max(0,Math.min(s.text.length,e.ch+n*(c>=55296&&c<56320?2:1))),-n)}else a=i?Za(t.cm,s,e,n):$a(s,e,n);if(null==a){if(o||!u())return!1;e=Ka(i,t.cm,s,e.line,l)}else e=a;return!0}if("char"==r||"codepoint"==r)c();else if("column"==r)c(!0);else if("word"==r||"group"==r)for(var d=null,h="group"==r,f=t.cm&&t.cm.getHelper(e,"wordChars"),p=!0;!(n<0)||c(!p);p=!1){var g=s.text.charAt(e.ch)||"\n",m=nt(g,f)?"w":h&&"\n"==g?"n":!h||/\s/.test(g)?null:"p";if(!h||p||m||(m="s"),d&&d!=m){n<0&&(n=1,c(),e.sticky="after");break}if(m&&(d=m),n>0&&!c(!p))break}var v=$o(t,e,o,a,!0);return se(o,v)&&(v.hitSide=!0),v}function Xs(t,e,n,r){var i,o,a=t.doc,s=e.left;if("page"==r){var l=Math.min(t.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),u=Math.max(l-.5*Lr(t.display),3);i=(n>0?e.bottom:e.top)+n*u}else"line"==r&&(i=n>0?e.bottom+3:e.top-3);for(;(o=_r(t,s,i)).outside;){if(n<0?i<=0:i>=a.height){o.hitSide=!0;break}i+=5*n}return o}var Js=function(t){this.cm=t,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new z,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Qs(t,e){var n=er(t,e.line);if(!n||n.hidden)return null;var r=Xt(t.doc,e.line),i=Jn(n,r,e.line),o=ht(r,t.doc.direction),a="left";o&&(a=ct(o,e.ch)%2?"right":"left");var s=ar(i.map,e.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function tl(t){for(var e=t;e;e=e.parentNode)if(/CodeMirror-gutter-wrapper/.test(e.className))return!0;return!1}function el(t,e){return e&&(t.bad=!0),t}function nl(t,e,n,r,i){var o="",a=!1,s=t.doc.lineSeparator(),l=!1;function u(t){return function(e){return e.id==t}}function c(){a&&(o+=s,l&&(o+=s),a=l=!1)}function d(t){t&&(c(),o+=t)}function h(e){if(1==e.nodeType){var n=e.getAttribute("cm-text");if(n)return void d(n);var o,f=e.getAttribute("cm-marker");if(f){var p=t.findMarks(oe(r,0),oe(i+1,0),u(+f));return void(p.length&&(o=p[0].find(0))&&d(Jt(t.doc,o.from,o.to).join(s)))}if("false"==e.getAttribute("contenteditable"))return;var g=/^(pre|div|p|li|table|br)$/i.test(e.nodeName);if(!/^br$/i.test(e.nodeName)&&0==e.textContent.length)return;g&&c();for(var m=0;m=e.display.viewTo||o.line=e.display.viewFrom&&Qs(e,i)||{node:l[0].measure.map[2],offset:0},c=o.liner.firstLine()&&(a=oe(a.line-1,Xt(r.doc,a.line-1).length)),s.ch==Xt(r.doc,s.line).text.length&&s.linei.viewTo-1)return!1;a.line==i.viewFrom||0==(t=Rr(r,a.line))?(e=ee(i.view[0].line),n=i.view[0].node):(e=ee(i.view[t].line),n=i.view[t-1].node.nextSibling);var l,u,c=Rr(r,s.line);if(c==i.view.length-1?(l=i.viewTo-1,u=i.lineDiv.lastChild):(l=ee(i.view[c+1].line)-1,u=i.view[c+1].node.previousSibling),!n)return!1;for(var d=r.doc.splitLines(nl(r,n,u,e,l)),h=Jt(r.doc,oe(e,0),oe(l,Xt(r.doc,l).text.length));d.length>1&&h.length>1;)if(K(d)==K(h))d.pop(),h.pop(),l--;else{if(d[0]!=h[0])break;d.shift(),h.shift(),e++}for(var f=0,p=0,g=d[0],m=h[0],v=Math.min(g.length,m.length);fa.ch&&y.charCodeAt(y.length-p-1)==b.charCodeAt(b.length-p-1);)f--,p++;d[d.length-1]=y.slice(0,y.length-p).replace(/^\u200b+/,""),d[0]=d[0].slice(f).replace(/\u200b+$/,"");var w=oe(e,f),_=oe(l,h.length?K(h).length-p:0);return d.length>1||d[0]||ae(w,_)?(ia(r.doc,d,w,_,"+input"),!0):void 0},Js.prototype.ensurePolled=function(){this.forceCompositionEnd()},Js.prototype.reset=function(){this.forceCompositionEnd()},Js.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Js.prototype.readFromDOMSoon=function(){var t=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(t.readDOMTimeout=null,t.composing){if(!t.composing.done)return;t.composing=null}t.updateFromDOM()}),80))},Js.prototype.updateFromDOM=function(){var t=this;!this.cm.isReadOnly()&&this.pollContent()||Ai(this.cm,(function(){return Wr(t.cm)}))},Js.prototype.setUneditable=function(t){t.contentEditable="false"},Js.prototype.onKeyPress=function(t){0==t.charCode||this.composing||(t.preventDefault(),this.cm.isReadOnly()||Oi(this.cm,Ys)(this.cm,String.fromCharCode(null==t.charCode?t.keyCode:t.charCode),0))},Js.prototype.readOnlyChanged=function(t){this.div.contentEditable=String("nocursor"!=t)},Js.prototype.onContextMenu=function(){},Js.prototype.resetPosition=function(){},Js.prototype.needsContentAttribute=!0;var ol=function(t){this.cm=t,this.prevInput="",this.pollingFast=!1,this.polling=new z,this.hasSelection=!1,this.composing=null};function al(t,e){if((e=e?W(e):{}).value=t.value,!e.tabindex&&t.tabIndex&&(e.tabindex=t.tabIndex),!e.placeholder&&t.placeholder&&(e.placeholder=t.placeholder),null==e.autofocus){var n=O();e.autofocus=n==t||null!=t.getAttribute("autofocus")&&n==document.body}function r(){t.value=s.getValue()}var i;if(t.form&&(pt(t.form,"submit",r),!e.leaveSubmitMethodAlone)){var o=t.form;i=o.submit;try{var a=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=a}}catch(t){}}e.finishInit=function(n){n.save=r,n.getTextArea=function(){return t},n.toTextArea=function(){n.toTextArea=isNaN,r(),t.parentNode.removeChild(n.getWrapperElement()),t.style.display="",t.form&&(mt(t.form,"submit",r),e.leaveSubmitMethodAlone||"function"!=typeof t.form.submit||(t.form.submit=i))}},t.style.display="none";var s=Ws((function(e){return t.parentNode.insertBefore(e,t.nextSibling)}),e);return s}function sl(t){t.off=mt,t.on=pt,t.wheelEventPixels=no,t.Doc=ka,t.splitLines=Ft,t.countColumn=E,t.findColumn=G,t.isWordChar=et,t.Pass=V,t.signal=vt,t.Line=un,t.changeEnd=lo,t.scrollbarModel=xi,t.Pos=oe,t.cmpPos=ae,t.modes=zt,t.mimeModes=Ht,t.resolveMode=Yt,t.getMode=Ut,t.modeExtensions=jt,t.extendMode=Gt,t.copyState=qt,t.startState=Kt,t.innerMode=$t,t.commands=Xa,t.keyMap=Ea,t.keyName=Ua,t.isModifierKey=Va,t.lookupKey=Ba,t.normalizeKeyMap=Ha,t.StringStream=Zt,t.SharedTextMarker=va,t.TextMarker=ga,t.LineWidget=da,t.e_preventDefault=_t,t.e_stopPropagation=kt,t.e_stop=Mt,t.addClass=N,t.contains=A,t.rmClass=C,t.keyNames=Fa}ol.prototype.init=function(t){var e=this,n=this,r=this.cm;this.createField(t);var i=this.textarea;function o(t){if(!yt(r,t)){if(r.somethingSelected())Vs({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var e=Gs(r);Vs({lineWise:!0,text:e.text}),"cut"==t.type?r.setSelections(e.ranges,null,Y):(n.prevInput="",i.value=e.text.join("\n"),I(i))}"cut"==t.type&&(r.state.cutIncoming=+new Date)}}t.wrapper.insertBefore(this.wrapper,t.wrapper.firstChild),g&&(i.style.width="0px"),pt(i,"input",(function(){a&&s>=9&&e.hasSelection&&(e.hasSelection=null),n.poll()})),pt(i,"paste",(function(t){yt(r,t)||Us(t,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())})),pt(i,"cut",o),pt(i,"copy",o),pt(t.scroller,"paste",(function(e){if(!Un(t,e)&&!yt(r,e)){if(!i.dispatchEvent)return r.state.pasteIncoming=+new Date,void n.focus();var o=new Event("paste");o.clipboardData=e.clipboardData,i.dispatchEvent(o)}})),pt(t.lineSpace,"selectstart",(function(e){Un(t,e)||_t(e)})),pt(i,"compositionstart",(function(){var t=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:t,range:r.markText(t,r.getCursor("to"),{className:"CodeMirror-composing"})}})),pt(i,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},ol.prototype.createField=function(t){this.wrapper=$s(),this.textarea=this.wrapper.firstChild},ol.prototype.screenReaderLabelChanged=function(t){t?this.textarea.setAttribute("aria-label",t):this.textarea.removeAttribute("aria-label")},ol.prototype.prepareSelection=function(){var t=this.cm,e=t.display,n=t.doc,r=Ur(t);if(t.options.moveInputWithCursor){var i=br(t,n.sel.primary().head,"div"),o=e.wrapper.getBoundingClientRect(),a=e.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(e.wrapper.clientHeight-10,i.top+a.top-o.top)),r.teLeft=Math.max(0,Math.min(e.wrapper.clientWidth-10,i.left+a.left-o.left))}return r},ol.prototype.showSelection=function(t){var e=this.cm.display;D(e.cursorDiv,t.cursors),D(e.selectionDiv,t.selection),null!=t.teTop&&(this.wrapper.style.top=t.teTop+"px",this.wrapper.style.left=t.teLeft+"px")},ol.prototype.reset=function(t){if(!this.contextMenuPending&&!this.composing){var e=this.cm;if(e.somethingSelected()){this.prevInput="";var n=e.getSelection();this.textarea.value=n,e.state.focused&&I(this.textarea),a&&s>=9&&(this.hasSelection=n)}else t||(this.prevInput=this.textarea.value="",a&&s>=9&&(this.hasSelection=null))}},ol.prototype.getField=function(){return this.textarea},ol.prototype.supportsTouch=function(){return!1},ol.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!v||O()!=this.textarea))try{this.textarea.focus()}catch(t){}},ol.prototype.blur=function(){this.textarea.blur()},ol.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},ol.prototype.receivedFocus=function(){this.slowPoll()},ol.prototype.slowPoll=function(){var t=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){t.poll(),t.cm.state.focused&&t.slowPoll()}))},ol.prototype.fastPoll=function(){var t=!1,e=this;function n(){e.poll()||t?(e.pollingFast=!1,e.slowPoll()):(t=!0,e.polling.set(60,n))}e.pollingFast=!0,e.polling.set(20,n)},ol.prototype.poll=function(){var t=this,e=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!e.state.focused||It(n)&&!r&&!this.composing||e.isReadOnly()||e.options.disableInput||e.state.keySeq)return!1;var i=n.value;if(i==r&&!e.somethingSelected())return!1;if(a&&s>=9&&this.hasSelection===i||y&&/[\uf700-\uf7ff]/.test(i))return e.display.input.reset(),!1;if(e.doc.sel==e.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||r||(r="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var l=0,u=Math.min(r.length,i.length);l1e3||i.indexOf("\n")>-1?n.value=t.prevInput="":t.prevInput=i,t.composing&&(t.composing.range.clear(),t.composing.range=e.markText(t.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},ol.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},ol.prototype.onKeyPress=function(){a&&s>=9&&(this.hasSelection=null),this.fastPoll()},ol.prototype.onContextMenu=function(t){var e=this,n=e.cm,r=n.display,i=e.textarea;e.contextMenuPending&&e.contextMenuPending();var o=Ir(n,t),u=r.scroller.scrollTop;if(o&&!d){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(o)&&Oi(n,Vo)(n.doc,so(o),Y);var c,h=i.style.cssText,f=e.wrapper.style.cssText,p=e.wrapper.offsetParent.getBoundingClientRect();if(e.wrapper.style.cssText="position: static",i.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(t.clientY-p.top-5)+"px; left: "+(t.clientX-p.left-5)+"px;\n z-index: 1000; background: "+(a?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",l&&(c=window.scrollY),r.input.focus(),l&&window.scrollTo(null,c),r.input.reset(),n.somethingSelected()||(i.value=e.prevInput=" "),e.contextMenuPending=v,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),a&&s>=9&&m(),k){Mt(t);var g=function(){mt(window,"mouseup",g),setTimeout(v,20)};pt(window,"mouseup",g)}else setTimeout(v,50)}function m(){if(null!=i.selectionStart){var t=n.somethingSelected(),o="​"+(t?i.value:"");i.value="⇚",i.value=o,e.prevInput=t?"":"​",i.selectionStart=1,i.selectionEnd=o.length,r.selForContextMenu=n.doc.sel}}function v(){if(e.contextMenuPending==v&&(e.contextMenuPending=!1,e.wrapper.style.cssText=f,i.style.cssText=h,a&&s<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=u),null!=i.selectionStart)){(!a||a&&s<9)&&m();var t=0,o=function(){r.selForContextMenu==n.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&"​"==e.prevInput?Oi(n,Zo)(n):t++<10?r.detectingSelectAll=setTimeout(o,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(o,200)}}},ol.prototype.readOnlyChanged=function(t){t||this.reset(),this.textarea.disabled="nocursor"==t,this.textarea.readOnly=!!t},ol.prototype.setUneditable=function(){},ol.prototype.needsContentAttribute=!1,Fs(Ws),Ks(Ws);var ll="iter insert remove copy getEditor constructor".split(" ");for(var ul in ka.prototype)ka.prototype.hasOwnProperty(ul)&&H(ll,ul)<0&&(Ws.prototype[ul]=function(t){return function(){return t.apply(this.doc,arguments)}}(ka.prototype[ul]));return wt(ka),Ws.inputStyles={textarea:ol,contenteditable:Js},Ws.defineMode=function(t){Ws.defaults.mode||"null"==t||(Ws.defaults.mode=t),Bt.apply(this,arguments)},Ws.defineMIME=Vt,Ws.defineMode("null",(function(){return{token:function(t){return t.skipToEnd()}}})),Ws.defineMIME("text/plain","null"),Ws.defineExtension=function(t,e){Ws.prototype[t]=e},Ws.defineDocExtension=function(t,e){ka.prototype[t]=e},Ws.fromTextArea=al,sl(Ws),Ws.version="5.58.3",Ws}()}));ct((function(t,e){!function(t){function e(e,r){function i(){e.display.wrapper.offsetHeight?(n(e,r),e.display.lastWrapHeight!=e.display.wrapper.clientHeight&&e.refresh()):r.timeout=setTimeout(i,r.delay)}r.timeout=setTimeout(i,r.delay),r.hurry=function(){clearTimeout(r.timeout),r.timeout=setTimeout(i,50)},t.on(window,"mouseup",r.hurry),t.on(window,"keyup",r.hurry)}function n(e,n){clearTimeout(n.timeout),t.off(window,"mouseup",n.hurry),t.off(window,"keyup",n.hurry)}t.defineOption("autoRefresh",!1,(function(t,r){t.state.autoRefresh&&(n(t,t.state.autoRefresh),t.state.autoRefresh=null),r&&0==t.display.wrapper.offsetHeight&&e(t,t.state.autoRefresh={delay:r.delay||250})}))}(dt)})),ct((function(t,e){var n,r,i;r={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},i={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1},(n=dt).defineMode("xml",(function(t,e){var o,a,s=t.indentUnit,l={},u=e.htmlMode?r:i;for(var c in u)l[c]=u[c];for(var c in e)l[c]=e[c];function d(t,e){function n(n){return e.tokenize=n,n(t,e)}var r=t.next();return"<"==r?t.eat("!")?t.eat("[")?t.match("CDATA[")?n(p("atom","]]>")):null:t.match("--")?n(p("comment","--\x3e")):t.match("DOCTYPE",!0,!0)?(t.eatWhile(/[\w\._\-]/),n(g(1))):null:t.eat("?")?(t.eatWhile(/[\w\._\-]/),e.tokenize=p("meta","?>"),"meta"):(o=t.eat("/")?"closeTag":"openTag",e.tokenize=h,"tag bracket"):"&"==r?(t.eat("#")?t.eat("x")?t.eatWhile(/[a-fA-F\d]/)&&t.eat(";"):t.eatWhile(/[\d]/)&&t.eat(";"):t.eatWhile(/[\w\.\-:]/)&&t.eat(";"))?"atom":"error":(t.eatWhile(/[^&<]/),null)}function h(t,e){var n=t.next();if(">"==n||"/"==n&&t.eat(">"))return e.tokenize=d,o=">"==n?"endTag":"selfcloseTag","tag bracket";if("="==n)return o="equals",null;if("<"==n){e.tokenize=d,e.state=b,e.tagName=e.tagStart=null;var r=e.tokenize(t,e);return r?r+" tag error":"tag error"}return/[\'\"]/.test(n)?(e.tokenize=f(n),e.stringStartCol=t.column(),e.tokenize(t,e)):(t.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function f(t){var e=function(e,n){for(;!e.eol();)if(e.next()==t){n.tokenize=h;break}return"string"};return e.isInAttribute=!0,e}function p(t,e){return function(n,r){for(;!n.eol();){if(n.match(e)){r.tokenize=d;break}n.next()}return t}}function g(t){return function(e,n){for(var r;null!=(r=e.next());){if("<"==r)return n.tokenize=g(t+1),n.tokenize(e,n);if(">"==r){if(1==t){n.tokenize=d;break}return n.tokenize=g(t-1),n.tokenize(e,n)}}return"meta"}}function m(t,e,n){this.prev=t.context,this.tagName=e||"",this.indent=t.indented,this.startOfLine=n,(l.doNotIndent.hasOwnProperty(e)||t.context&&t.context.noIndent)&&(this.noIndent=!0)}function v(t){t.context&&(t.context=t.context.prev)}function y(t,e){for(var n;;){if(!t.context)return;if(n=t.context.tagName,!l.contextGrabbers.hasOwnProperty(n)||!l.contextGrabbers[n].hasOwnProperty(e))return;v(t)}}function b(t,e,n){return"openTag"==t?(n.tagStart=e.column(),x):"closeTag"==t?w:b}function x(t,e,n){return"word"==t?(n.tagName=e.current(),a="tag",S):l.allowMissingTagName&&"endTag"==t?(a="tag bracket",S(t,e,n)):(a="error",x)}function w(t,e,n){if("word"==t){var r=e.current();return n.context&&n.context.tagName!=r&&l.implicitlyClosed.hasOwnProperty(n.context.tagName)&&v(n),n.context&&n.context.tagName==r||!1===l.matchClosing?(a="tag",_):(a="tag error",k)}return l.allowMissingTagName&&"endTag"==t?(a="tag bracket",_(t,e,n)):(a="error",k)}function _(t,e,n){return"endTag"!=t?(a="error",_):(v(n),b)}function k(t,e,n){return a="error",_(t,e,n)}function S(t,e,n){if("word"==t)return a="attribute",M;if("endTag"==t||"selfcloseTag"==t){var r=n.tagName,i=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==t||l.autoSelfClosers.hasOwnProperty(r)?y(n,r):(y(n,r),n.context=new m(n,r,i==n.indented)),b}return a="error",S}function M(t,e,n){return"equals"==t?C:(l.allowMissing||(a="error"),S(t,e,n))}function C(t,e,n){return"string"==t?T:"word"==t&&l.allowUnquoted?(a="string",S):(a="error",S(t,e,n))}function T(t,e,n){return"string"==t?T:S(t,e,n)}return d.isInText=!0,{startState:function(t){var e={tokenize:d,state:b,indented:t||0,tagName:null,tagStart:null,context:null};return null!=t&&(e.baseIndent=t),e},token:function(t,e){if(!e.tagName&&t.sol()&&(e.indented=t.indentation()),t.eatSpace())return null;o=null;var n=e.tokenize(t,e);return(n||o)&&"comment"!=n&&(a=null,e.state=e.state(o||n,t,e),a&&(n="error"==a?n+" error":a)),n},indent:function(t,e,r){var i=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+s;if(i&&i.noIndent)return n.Pass;if(t.tokenize!=h&&t.tokenize!=d)return r?r.match(/^(\s*)/)[0].length:0;if(t.tagName)return!1!==l.multilineTagIndentPastTag?t.tagStart+t.tagName.length+2:t.tagStart+s*(l.multilineTagIndentFactor||1);if(l.alignCDATA&&/$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:l.htmlMode?"html":"xml",helperType:l.htmlMode?"html":"xml",skipAttribute:function(t){t.state==C&&(t.state=S)},xmlCurrentTag:function(t){return t.tagName?{name:t.tagName,close:"closeTag"==t.type}:null},xmlCurrentContext:function(t){for(var e=[],n=t.context;n;n=n.prev)e.push(n.tagName);return e.reverse()}}})),n.defineMIME("text/xml","xml"),n.defineMIME("application/xml","xml"),n.mimeModes.hasOwnProperty("text/html")||n.defineMIME("text/html",{name:"xml",htmlMode:!0})})),ct((function(t,e){var n;(n=dt).defineMode("yaml",(function(){var t=new RegExp("\\b(("+["true","false","on","off","yes","no"].join(")|(")+"))$","i");return{token:function(e,n){var r=e.peek(),i=n.escaped;if(n.escaped=!1,"#"==r&&(0==e.pos||/\s/.test(e.string.charAt(e.pos-1))))return e.skipToEnd(),"comment";if(e.match(/^('([^']|\\.)*'?|"([^"]|\\.)*"?)/))return"string";if(n.literal&&e.indentation()>n.keyCol)return e.skipToEnd(),"string";if(n.literal&&(n.literal=!1),e.sol()){if(n.keyCol=0,n.pair=!1,n.pairStart=!1,e.match(/---/))return"def";if(e.match(/\.\.\./))return"def";if(e.match(/\s*-\s+/))return"meta"}if(e.match(/^(\{|\}|\[|\])/))return"{"==r?n.inlinePairs++:"}"==r?n.inlinePairs--:"["==r?n.inlineList++:n.inlineList--,"meta";if(n.inlineList>0&&!i&&","==r)return e.next(),"meta";if(n.inlinePairs>0&&!i&&","==r)return n.keyCol=0,n.pair=!1,n.pairStart=!1,e.next(),"meta";if(n.pairStart){if(e.match(/^\s*(\||\>)\s*/))return n.literal=!0,"meta";if(e.match(/^\s*(\&|\*)[a-z0-9\._-]+\b/i))return"variable-2";if(0==n.inlinePairs&&e.match(/^\s*-?[0-9\.\,]+\s?$/))return"number";if(n.inlinePairs>0&&e.match(/^\s*-?[0-9\.\,]+\s?(?=(,|}))/))return"number";if(e.match(t))return"keyword"}return!n.pair&&e.match(/^\s*(?:[,\[\]{}&*!|>'"%@`][^\s'":]|[^,\[\]{}#&*!|>'"%@`])[^#]*?(?=\s*:($|\s))/)?(n.pair=!0,n.keyCol=e.indentation(),"atom"):n.pair&&e.match(/^:\s*/)?(n.pairStart=!0,"meta"):(n.pairStart=!1,n.escaped="\\"==r,e.next(),null)},startState:function(){return{pair:!1,pairStart:!1,keyCol:0,inlinePairs:0,inlineList:0,literal:!1,escaped:!1}},lineComment:"#",fold:"indent"}})),n.defineMIME("text/x-yaml","yaml"),n.defineMIME("text/yaml","yaml")})),ct((function(t,e){!function(t){function e(t){return new RegExp("^(("+t.join(")|(")+"))\\b")}var n=e(["and","or","not","is"]),r=["as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","lambda","pass","raise","return","try","while","with","yield","in"],i=["abs","all","any","bin","bool","bytearray","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip","__import__","NotImplemented","Ellipsis","__debug__"];function o(t){return t.scopes[t.scopes.length-1]}t.registerHelper("hintWords","python",r.concat(i)),t.defineMode("python",(function(a,s){for(var l="error",u=s.delimiters||s.singleDelimiters||/^[\(\)\[\]\{\}@,:`=;\.\\]/,c=[s.singleOperators,s.doubleOperators,s.doubleDelimiters,s.tripleDelimiters,s.operators||/^([-+*/%\/&|^]=?|[<>=]+|\/\/=?|\*\*=?|!=|[~!@]|\.\.\.)/],d=0;dr?S(e):i0&&C(t,e)&&(a+=" "+l),a}return w(t,e)}function w(t,e,r){if(t.eatSpace())return null;if(!r&&t.match(/^#.*/))return"comment";if(t.match(/^[0-9\.]/,!1)){var i=!1;if(t.match(/^[\d_]*\.\d+(e[\+\-]?\d+)?/i)&&(i=!0),t.match(/^[\d_]+\.\d*/)&&(i=!0),t.match(/^\.\d+/)&&(i=!0),i)return t.eat(/J/i),"number";var o=!1;if(t.match(/^0x[0-9a-f_]+/i)&&(o=!0),t.match(/^0b[01_]+/i)&&(o=!0),t.match(/^0o[0-7_]+/i)&&(o=!0),t.match(/^[1-9][\d_]*(e[\+\-]?[\d_]+)?/)&&(t.eat(/J/i),o=!0),t.match(/^0(?![\dx])/i)&&(o=!0),o)return t.eat(/L/i),"number"}if(t.match(v))return-1!==t.current().toLowerCase().indexOf("f")?(e.tokenize=_(t.current(),e.tokenize),e.tokenize(t,e)):(e.tokenize=k(t.current(),e.tokenize),e.tokenize(t,e));for(var a=0;a=0;)t=t.substr(1);var n=1==t.length,r="string";function i(t){return function(e,n){var r=w(e,n,!0);return"punctuation"==r&&("{"==e.current()?n.tokenize=i(t+1):"}"==e.current()&&(n.tokenize=t>1?i(t-1):o)),r}}function o(o,a){for(;!o.eol();)if(o.eatWhile(/[^'"\{\}\\]/),o.eat("\\")){if(o.next(),n&&o.eol())return r}else{if(o.match(t))return a.tokenize=e,r;if(o.match("{{"))return r;if(o.match("{",!1))return a.tokenize=i(0),o.current()?r:a.tokenize(o,a);if(o.match("}}"))return r;if(o.match("}"))return l;o.eat(/['"]/)}if(n){if(s.singleLineStringErrors)return l;a.tokenize=e}return r}return o.isString=!0,o}function k(t,e){for(;"rubf".indexOf(t.charAt(0).toLowerCase())>=0;)t=t.substr(1);var n=1==t.length,r="string";function i(i,o){for(;!i.eol();)if(i.eatWhile(/[^'"\\]/),i.eat("\\")){if(i.next(),n&&i.eol())return r}else{if(i.match(t))return o.tokenize=e,r;i.eat(/['"]/)}if(n){if(s.singleLineStringErrors)return l;o.tokenize=e}return r}return i.isString=!0,i}function S(t){for(;"py"!=o(t).type;)t.scopes.pop();t.scopes.push({offset:o(t).offset+a.indentUnit,type:"py",align:null})}function M(t,e,n){var r=t.match(/^([\s\[\{\(]|#.*)*$/,!1)?null:t.column()+1;e.scopes.push({offset:e.indent+h,type:n,align:r})}function C(t,e){for(var n=t.indentation();e.scopes.length>1&&o(e).offset>n;){if("py"!=o(e).type)return!0;e.scopes.pop()}return o(e).offset!=n}function T(t,e){t.sol()&&(e.beginningOfLine=!0);var n=e.tokenize(t,e),r=t.current();if(e.beginningOfLine&&"@"==r)return t.match(m,!1)?"meta":g?"operator":l;if(/\S/.test(r)&&(e.beginningOfLine=!1),"variable"!=n&&"builtin"!=n||"meta"!=e.lastToken||(n="meta"),"pass"!=r&&"return"!=r||(e.dedent+=1),"lambda"==r&&(e.lambda=!0),":"!=r||e.lambda||"py"!=o(e).type||S(e),1==r.length&&!/string|comment/.test(n)){var i="[({".indexOf(r);if(-1!=i&&M(t,e,"])}".slice(i,i+1)),-1!=(i="])}".indexOf(r))){if(o(e).type!=r)return l;e.indent=e.scopes.pop().offset-h}}return e.dedent>0&&t.eol()&&"py"==o(e).type&&(e.scopes.length>1&&e.scopes.pop(),e.dedent-=1),n}return{startState:function(t){return{tokenize:x,scopes:[{offset:t||0,type:"py",align:null}],indent:t||0,lastToken:null,lambda:!1,dedent:0}},token:function(t,e){var n=e.errorToken;n&&(e.errorToken=!1);var r=T(t,e);return r&&"comment"!=r&&(e.lastToken="keyword"==r||"punctuation"==r?t.current():r),"punctuation"==r&&(r=null),t.eol()&&e.lambda&&(e.lambda=!1),n?r+" "+l:r},indent:function(e,n){if(e.tokenize!=x)return e.tokenize.isString?t.Pass:0;var r=o(e),i=r.type==n.charAt(0);return null!=r.align?r.align-(i?1:0):r.offset-(i?h:0)},electricInput:/^\s*[\}\]\)]$/,closeBrackets:{triples:"'\""},lineComment:"#",fold:"indent"}})),t.defineMIME("text/x-python","python");var a=function(t){return t.split(" ")};t.defineMIME("text/x-cython",{name:"python",extra_keywords:a("by cdef cimport cpdef ctypedef enum except extern gil include nogil property public readonly struct union DEF IF ELIF ELSE")})}(dt)}));let ht=class extends nt{constructor(){super(...arguments),this.readOnly=!1,this.mode="yaml"}createRenderRoot(){return this}firstUpdated(){const t=this.querySelector("textarea");t&&(this.editor=dt.fromTextArea(t,{mode:this.mode,theme:"monokai",lineNumbers:!1,readOnly:this.readOnly,autoRefresh:!0}),this.editor.on("blur",(t=>{var e;null===(e=this.editor)||void 0===e||e.save()})))}};t([Z()],ht.prototype,"readOnly",void 0),t([Z()],ht.prototype,"mode",void 0),ht=t([$("pb-codemirror")],ht);let ft=class extends nt{constructor(){super();const t=this.querySelector(".pf-c-dropdown__menu");this.querySelectorAll("button").forEach((e=>{e.addEventListener("click",(e=>{t.hidden=!t.hidden}))}))}render(){return W``}};ft=t([$("pb-dropdown")],ft);let pt=class extends nt{constructor(){super(...arguments),this.url="",this.key="",this.value=""}comparison(t){let e={"<":function(t,e){return t":function(t,e){return t>e},">=":function(t,e){return t>=e},"<=":function(t,e){return t<=e},"==":function(t,e){return t==e},"!=":function(t,e){return t!=e},"===":function(t,e){return t===e},"!==":function(t,e){return t!==e}};const n=t.split(" ");if(n.length<3)throw new Error("nah");let r=n[0];r="value"===r?this.value:parseInt(r,10);let i=n[2];i="value"===i?this.value:parseInt(i,10);const o=n[1];if(!(o in e))throw new Error("Invalid comparison");return e[o](r,i)}firstUpdated(){fetch(this.url).then((t=>t.json())).then((t=>t[this.key])).then((t=>this.value=t))}render(){if(void 0===this.value)return W``;let t="";return this.querySelectorAll("[slot]").forEach((e=>{const n=e.getAttribute("slot");this.comparison(n)&&(t=n)})),this.querySelectorAll("[data-value]").forEach((t=>{t.textContent=this.value})),W``}};t([Z()],pt.prototype,"url",void 0),t([Z()],pt.prototype,"key",void 0),t([Z()],pt.prototype,"value",void 0),pt=t([$("fetch-fill-slot")],pt);const gt=new CSSStyleSheet;gt.replaceSync(".pf-c-modal-box {\n --pf-c-modal-box--BackgroundColor: var(--pf-global--BackgroundColor--100);\n --pf-c-modal-box--BoxShadow: var(--pf-global--BoxShadow--xl);\n --pf-c-modal-box--ZIndex: var(--pf-global--ZIndex--xl);\n --pf-c-modal-box--Width: 100%;\n --pf-c-modal-box--MaxWidth: calc(100% - var(--pf-global--spacer--xl));\n --pf-c-modal-box--m-sm--sm--MaxWidth: 35rem;\n --pf-c-modal-box--m-md--Width: 52.5rem;\n --pf-c-modal-box--m-lg--lg--MaxWidth: 70rem;\n --pf-c-modal-box--MaxHeight: calc(100% - var(--pf-global--spacer--2xl));\n --pf-c-modal-box--m-align-top--spacer: var(--pf-global--spacer--sm);\n --pf-c-modal-box--m-align-top--xl--spacer: var(--pf-global--spacer--xl);\n --pf-c-modal-box--m-align-top--MarginTop: var(--pf-c-modal-box--m-align-top--spacer);\n --pf-c-modal-box--m-align-top--MaxHeight: calc(100% - min(var(--pf-c-modal-box--m-align-top--spacer), var(--pf-global--spacer--2xl)) - var(--pf-c-modal-box--m-align-top--spacer));\n --pf-c-modal-box--m-align-top--MaxWidth: calc(100% - min(var(--pf-c-modal-box--m-align-top--spacer) * 2, var(--pf-global--spacer--xl)));\n --pf-c-modal-box--m-danger__title-icon--Color: var(--pf-global--danger-color--100);\n --pf-c-modal-box--m-warning__title-icon--Color: var(--pf-global--warning-color--100);\n --pf-c-modal-box--m-success__title-icon--Color: var(--pf-global--success-color--100);\n --pf-c-modal-box--m-info__title-icon--Color: var(--pf-global--info-color--100);\n --pf-c-modal-box--m-default__title-icon--Color: var(--pf-global--default-color--200);\n --pf-c-modal-box__header--PaddingTop: var(--pf-global--spacer--lg);\n --pf-c-modal-box__header--PaddingRight: var(--pf-global--spacer--lg);\n --pf-c-modal-box__header--PaddingLeft: var(--pf-global--spacer--lg);\n --pf-c-modal-box__header--last-child--PaddingBottom: var(--pf-global--spacer--lg);\n --pf-c-modal-box__title--LineHeight: var(--pf-global--LineHeight--sm);\n --pf-c-modal-box__title--FontFamily: var(--pf-global--FontFamily--heading--sans-serif);\n --pf-c-modal-box__title--FontSize: var(--pf-global--FontSize--2xl);\n --pf-c-modal-box__title-icon--MarginRight: var(--pf-global--spacer--sm);\n --pf-c-modal-box__title-icon--Color: var(--pf-global--Color--100);\n --pf-c-modal-box__description--PaddingTop: var(--pf-global--spacer--xs);\n --pf-c-modal-box__body--MinHeight: calc(var(--pf-global--FontSize--md) * var(--pf-global--LineHeight--md));\n --pf-c-modal-box__body--PaddingTop: var(--pf-global--spacer--lg);\n --pf-c-modal-box__body--PaddingRight: var(--pf-global--spacer--lg);\n --pf-c-modal-box__body--PaddingLeft: var(--pf-global--spacer--lg);\n --pf-c-modal-box__body--last-child--PaddingBottom: var(--pf-global--spacer--lg);\n --pf-c-modal-box__header--body--PaddingTop: var(--pf-global--spacer--md);\n --pf-c-modal-box--c-button--Top: calc(var(--pf-global--spacer--lg));\n --pf-c-modal-box--c-button--Right: var(--pf-global--spacer--md);\n --pf-c-modal-box--c-button--sibling--MarginRight: calc(var(--pf-global--spacer--xl) + var(--pf-global--spacer--sm));\n --pf-c-modal-box__footer--PaddingTop: var(--pf-global--spacer--lg);\n --pf-c-modal-box__footer--PaddingRight: var(--pf-global--spacer--lg);\n --pf-c-modal-box__footer--PaddingBottom: var(--pf-global--spacer--lg);\n --pf-c-modal-box__footer--PaddingLeft: var(--pf-global--spacer--lg);\n --pf-c-modal-box__footer--c-button--MarginRight: var(--pf-global--spacer--md);\n --pf-c-modal-box__footer--c-button--sm--MarginRight: calc(var(--pf-c-modal-box__footer--c-button--MarginRight) / 2);\n position: relative;\n z-index: var(--pf-c-modal-box--ZIndex);\n display: flex;\n flex-direction: column;\n width: var(--pf-c-modal-box--Width);\n max-width: var(--pf-c-modal-box--MaxWidth);\n max-height: var(--pf-c-modal-box--MaxHeight);\n background-color: var(--pf-c-modal-box--BackgroundColor);\n box-shadow: var(--pf-c-modal-box--BoxShadow); }\n @media (min-width: 1200px) {\n .pf-c-modal-box {\n --pf-c-modal-box--m-align-top--spacer: var(--pf-c-modal-box--m-align-top--xl--spacer); } }\n .pf-c-modal-box.pf-m-sm {\n --pf-c-modal-box--Width: var(--pf-c-modal-box--m-sm--sm--MaxWidth); }\n .pf-c-modal-box.pf-m-md {\n --pf-c-modal-box--Width: var(--pf-c-modal-box--m-md--Width); }\n .pf-c-modal-box.pf-m-lg {\n --pf-c-modal-box--Width: var(--pf-c-modal-box--m-lg--lg--MaxWidth); }\n .pf-c-modal-box.pf-m-align-top {\n top: var(--pf-c-modal-box--m-align-top--MarginTop);\n align-self: flex-start;\n max-width: var(--pf-c-modal-box--m-align-top--MaxWidth);\n max-height: var(--pf-c-modal-box--m-align-top--MaxHeight); }\n .pf-c-modal-box.pf-m-danger {\n --pf-c-modal-box__title-icon--Color: var(--pf-c-modal-box--m-danger__title-icon--Color); }\n .pf-c-modal-box.pf-m-warning {\n --pf-c-modal-box__title-icon--Color: var(--pf-c-modal-box--m-warning__title-icon--Color); }\n .pf-c-modal-box.pf-m-success {\n --pf-c-modal-box__title-icon--Color: var(--pf-c-modal-box--m-success__title-icon--Color); }\n .pf-c-modal-box.pf-m-default {\n --pf-c-modal-box__title-icon--Color: var(--pf-c-modal-box--m-default__title-icon--Color); }\n .pf-c-modal-box.pf-m-info {\n --pf-c-modal-box__title-icon--Color: var(--pf-c-modal-box--m-info__title-icon--Color); }\n .pf-c-modal-box > .pf-c-button {\n position: absolute;\n top: var(--pf-c-modal-box--c-button--Top);\n right: var(--pf-c-modal-box--c-button--Right); }\n .pf-c-modal-box > .pf-c-button + * {\n margin-right: var(--pf-c-modal-box--c-button--sibling--MarginRight); }\n\n.pf-c-modal-box__header {\n display: flex;\n flex-direction: column;\n padding-top: var(--pf-c-modal-box__header--PaddingTop);\n padding-right: var(--pf-c-modal-box__header--PaddingRight);\n padding-left: var(--pf-c-modal-box__header--PaddingLeft); }\n .pf-c-modal-box__header.pf-m-help {\n display: flex;\n flex-direction: row; }\n .pf-c-modal-box__header:last-child {\n padding-bottom: var(--pf-c-modal-box__header--last-child--PaddingBottom); }\n .pf-c-modal-box__header + .pf-c-modal-box__body {\n --pf-c-modal-box__body--PaddingTop: var(--pf-c-modal-box__header--body--PaddingTop); }\n\n.pf-c-modal-box__header-main {\n flex-grow: 1;\n min-width: 0; }\n\n.pf-c-modal-box__title,\n.pf-c-modal-box__title-text {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap; }\n\n.pf-c-modal-box__title {\n flex: 0 0 auto;\n font-family: var(--pf-c-modal-box__title--FontFamily);\n font-size: var(--pf-c-modal-box__title--FontSize);\n line-height: var(--pf-c-modal-box__title--LineHeight); }\n .pf-c-modal-box__title.pf-m-icon {\n display: flex; }\n\n.pf-c-modal-box__title-icon {\n margin-right: var(--pf-c-modal-box__title-icon--MarginRight);\n color: var(--pf-c-modal-box__title-icon--Color); }\n\n.pf-c-modal-box__description {\n padding-top: var(--pf-c-modal-box__description--PaddingTop); }\n\n.pf-c-modal-box__body {\n flex: 1 1 auto;\n min-height: var(--pf-c-modal-box__body--MinHeight);\n padding-top: var(--pf-c-modal-box__body--PaddingTop);\n padding-right: var(--pf-c-modal-box__body--PaddingRight);\n padding-left: var(--pf-c-modal-box__body--PaddingLeft);\n overflow-x: hidden;\n overflow-y: auto;\n overscroll-behavior: contain;\n word-break: break-word;\n -webkit-overflow-scrolling: touch; }\n .pf-c-modal-box__body:last-child {\n padding-bottom: var(--pf-c-modal-box__body--last-child--PaddingBottom); }\n\n.pf-c-modal-box__footer {\n display: flex;\n flex: 0 0 auto;\n align-items: center;\n padding-top: var(--pf-c-modal-box__footer--PaddingTop);\n padding-right: var(--pf-c-modal-box__footer--PaddingRight);\n padding-bottom: var(--pf-c-modal-box__footer--PaddingBottom);\n padding-left: var(--pf-c-modal-box__footer--PaddingLeft); }\n .pf-c-modal-box__footer > .pf-c-button:not(:last-child) {\n margin-right: var(--pf-c-modal-box__footer--c-button--MarginRight); }\n @media screen and (min-width: 576px) {\n .pf-c-modal-box__footer > .pf-c-button:not(:last-child) {\n --pf-c-modal-box__footer--c-button--MarginRight: var(--pf-c-modal-box__footer--c-button--sm--MarginRight); } }\n");const mt=new CSSStyleSheet;mt.replaceSync(".pf-l-bullseye {\n --pf-l-bullseye--Padding: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n padding: var(--pf-l-bullseye--Padding);\n margin: 0; }\n");const vt=new CSSStyleSheet;vt.replaceSync(".pf-c-backdrop {\n --pf-c-backdrop--ZIndex: var(--pf-global--ZIndex--lg);\n --pf-c-backdrop--BackgroundColor: var(--pf-global--BackgroundColor--dark-transparent-100);\n position: fixed;\n top: 0;\n left: 0;\n z-index: var(--pf-c-backdrop--ZIndex);\n width: 100%;\n height: 100%;\n background-color: var(--pf-c-backdrop--BackgroundColor); }\n\n.pf-c-backdrop__open {\n overflow: hidden; }\n");let yt=class extends nt{constructor(){super(),this.href="",this.open=!1,window.addEventListener("keyup",(t=>{"Escape"===t.code&&(this.open=!1)}))}static get styles(){return[gt,mt,vt]}setContent(t){this.querySelector("[slot=modal]").innerHTML=t,this.querySelectorAll("[slot=modal] a").forEach((t=>{t.addEventListener("click",(t=>{t.preventDefault(),this.open=!1}))})),this.querySelectorAll("input[name=name]").forEach((t=>{t.addEventListener("input",(e=>{const n=t.closest("form");if(null===n)return;const r=n.querySelector("input[name=slug]");r&&(r.value=t.value.toLowerCase().replace(/ /g,"-").replace(/[^\w-]+/g,""))}))})),this.querySelectorAll("[slot=modal] form").forEach((t=>{t.addEventListener("submit",(e=>{e.preventDefault();let n=new FormData(t);fetch(t.action===window.location.toString()?this.href:t.action,{method:t.method,body:n}).then((t=>t.text())).then((t=>{-1!==t.indexOf("csrfmiddlewaretoken")?this.setContent(t):(this.open=!1,this.dispatchEvent(new CustomEvent("hashchange",{bubbles:!0})),it())})).catch((t=>{console.error(t)}))}))}))}onClick(t){const e=new Request(this.href);fetch(e,{mode:"same-origin"}).then((t=>t.text())).then((t=>{this.setContent(t),this.open=!0})).catch((t=>{console.error(t)}))}renderModal(){return W`
      `}render(){return W`${this.open?this.renderModal():""}`}};t([Z()],yt.prototype,"href",void 0),t([Z()],yt.prototype,"open",void 0),yt=t([$("pb-modal-button")],yt);let bt=class extends nt{constructor(){super(...arguments),this._currentPage="",this._firstPage=""}get currentPage(){return this._currentPage}set currentPage(t){var e,n;try{null===(e=this.querySelector(`.pf-c-tab-content[tab-name='${t}']`))||void 0===e||e.removeAttribute("hidden"),null===(n=this.querySelector(`.pf-c-tabs__item[tab-name='${t}']`))||void 0===n||n.classList.add("pf-m-current"),this.querySelectorAll(`.pf-c-tab-content:not([tab-name='${t}'])`).forEach((t=>{t.setAttribute("hidden","")})),this.querySelectorAll(`.pf-c-tabs__item:not([tab-name='${t}'])`).forEach((t=>{t.classList.remove("pf-m-current")})),window.location.hash="#"+t,this._currentPage=t}catch(t){this.currentPage=this._firstPage}}createRenderRoot(){return this}firstUpdated(){var t;this._firstPage=null===(t=this.querySelector(".pf-c-tab-content"))||void 0===t?void 0:t.getAttribute("tab-name"),window.location.hash?this.currentPage=window.location.hash:this.currentPage=this._firstPage,this.querySelectorAll(".pf-c-tabs__item > button").forEach((t=>{t.addEventListener("click",(e=>{var n;let r=null===(n=t.parentElement)||void 0===n?void 0:n.getAttribute("tab-name");this.currentPage=r}))}))}};bt=t([$("pb-tabs")],bt);const xt=new CSSStyleSheet;xt.replaceSync('.pf-c-spinner {\n --pf-c-spinner--AnimationDuration: 1.5s;\n --pf-c-spinner--AnimationTimingFunction: cubic-bezier(.77, .005, .315, 1);\n --pf-c-spinner--diameter: var(--pf-global--icon--FontSize--xl);\n --pf-c-spinner--stroke-width-multiplier: .1;\n --pf-c-spinner--stroke-width: calc(var(--pf-c-spinner--diameter) * var(--pf-c-spinner--stroke-width-multiplier));\n --pf-c-spinner--Width: var(--pf-c-spinner--diameter);\n --pf-c-spinner--Height: var(--pf-c-spinner--diameter);\n --pf-c-spinner--Color: var(--pf-global--primary-color--100);\n --pf-c-spinner--m-sm--diameter: var(--pf-global--icon--FontSize--sm);\n --pf-c-spinner--m-md--diameter: var(--pf-global--icon--FontSize--md);\n --pf-c-spinner--m-lg--diameter: var(--pf-global--icon--FontSize--lg);\n --pf-c-spinner--m-xl--diameter: var(--pf-global--icon--FontSize--xl);\n --pf-c-spinner__clipper--Width: var(--pf-c-spinner--diameter);\n --pf-c-spinner__clipper--Height: var(--pf-c-spinner--diameter);\n --pf-c-spinner__clipper--after--BoxShadowColor: var(--pf-c-spinner--Color);\n --pf-c-spinner__clipper--after--Width: var(--pf-c-spinner--diameter);\n --pf-c-spinner__clipper--after--Height: var(--pf-c-spinner--diameter);\n --pf-c-spinner__clipper--after--BoxShadowSpreadRadius: var(--pf-c-spinner--stroke-width);\n --pf-c-spinner__lead-ball--after--BackgroundColor: var(--pf-c-spinner--Color);\n --pf-c-spinner__ball--after--Width: var(--pf-c-spinner--stroke-width);\n --pf-c-spinner__ball--after--Height: var(--pf-c-spinner--stroke-width);\n --pf-c-spinner__tail-ball--after--BackgroundColor: var(--pf-c-spinner--Color);\n position: relative;\n display: inline-block;\n width: var(--pf-c-spinner--Width);\n height: var(--pf-c-spinner--Height);\n text-align: left;\n animation: pf-animation-spinner-parent calc(var(--pf-c-spinner--AnimationDuration) * 2) var(--pf-c-spinner--AnimationTimingFunction) infinite; }\n .pf-c-spinner.pf-m-sm {\n --pf-c-spinner--diameter: var(--pf-c-spinner--m-sm--diameter); }\n .pf-c-spinner.pf-m-md {\n --pf-c-spinner--diameter: var(--pf-c-spinner--m-md--diameter); }\n .pf-c-spinner.pf-m-lg {\n --pf-c-spinner--diameter: var(--pf-c-spinner--m-lg--diameter); }\n .pf-c-spinner.pf-m-xl {\n --pf-c-spinner--diameter: var(--pf-c-spinner--m-xl--diameter); }\n\n@keyframes pf-animation-spinner-parent {\n 0% {\n transform: rotate(0deg); }\n 50% {\n transform: rotate(-540deg); }\n 100% {\n transform: rotate(-1080deg); } }\n\n.pf-c-spinner__clipper {\n position: absolute;\n width: var(--pf-c-spinner__clipper--Width);\n height: var(--pf-c-spinner__clipper--Height);\n clip-path: inset(0 0 50% 50%);\n animation: pf-animation-spinner__clipper var(--pf-c-spinner--AnimationDuration) linear infinite; }\n\n@keyframes pf-animation-spinner__clipper {\n 0% {\n transform: rotate(0deg); }\n 100% {\n transform: rotate(-270deg); } }\n\n.pf-c-spinner__clipper::after {\n position: absolute;\n width: var(--pf-c-spinner__clipper--after--Width);\n height: var(--pf-c-spinner__clipper--after--Height);\n clip-path: inset(0 0 0 50%);\n content: "";\n border-radius: 50%;\n box-shadow: inset 0 0 0 var(--pf-c-spinner__clipper--after--BoxShadowSpreadRadius) var(--pf-c-spinner__clipper--after--BoxShadowColor);\n animation: pf-animation-spinner__clipper-after var(--pf-c-spinner--AnimationDuration) linear infinite; }\n\n@keyframes pf-animation-spinner__clipper-after {\n 0% {\n transform: rotate(90deg); }\n 100% {\n transform: rotate(-180deg); } }\n\n.pf-c-spinner__lead-ball {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n animation: pf-animation-spinner__lead-ball var(--pf-c-spinner--AnimationDuration) linear infinite; }\n .pf-c-spinner__lead-ball::after {\n position: absolute;\n top: calc(50% - (var(--pf-c-spinner__ball--after--Height) / 2));\n right: 0;\n width: var(--pf-c-spinner__ball--after--Width);\n height: var(--pf-c-spinner__ball--after--Height);\n content: "";\n background-color: var(--pf-c-spinner__lead-ball--after--BackgroundColor);\n border-radius: 50%;\n transform-origin: top right; }\n\n@keyframes pf-animation-spinner__lead-ball {\n 0% {\n transform: rotate(0deg); }\n 34% {\n transform: rotate(-180deg); }\n 100% {\n transform: rotate(-360deg); } }\n\n.pf-c-spinner__tail-ball {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n animation: pf-animation-spinner__tail-ball var(--pf-c-spinner--AnimationDuration) linear infinite; }\n .pf-c-spinner__tail-ball::after {\n position: absolute;\n top: calc(50% - (var(--pf-c-spinner__ball--after--Height) / 2));\n right: 0;\n width: var(--pf-c-spinner__ball--after--Width);\n height: var(--pf-c-spinner__ball--after--Height);\n content: "";\n background-color: var(--pf-c-spinner__tail-ball--after--BackgroundColor);\n border-radius: 50%;\n transform-origin: top right; }\n\n@keyframes pf-animation-spinner__tail-ball {\n 0% {\n transform: rotate(0deg); }\n 67.5% {\n transform: rotate(-180deg); }\n 100% {\n transform: rotate(-360deg); } }\n');let wt=class extends nt{constructor(){super(),this.loading=!1,this.loadContent(),window.addEventListener("hashchange",(t=>this.loadContent()))}set defaultUrl(t){""===window.location.hash&&void 0!==t&&(window.location.hash="#"+t)}static get styles(){return[tt`:host{position:relative}:host .pf-l-bullseye{position:absolute;height:100%;width:100%;top:0;left:0;z-index:2000}`,mt,xt]}loadContent(){let t=window.location.hash.slice(1,1/0);""!==t&&(this.loading=!0,fetch(t).then((t=>t.text())).then((t=>{this.querySelector("[slot=body]").innerHTML=t})).then((()=>{this.querySelectorAll("a:not(.pb-root-link)").forEach((t=>{if(""!==t.href)try{const e=new URL(t.href),n=e.search||"";t.href=`#${e.pathname}${n}`}catch(e){t.href="#"+t.href}})),this.querySelectorAll("[role=pb-refresh]").forEach((t=>{t.addEventListener("click",(t=>{this.loadContent()}))})),this.querySelectorAll("form").forEach((e=>{e.addEventListener("submit",(n=>{n.preventDefault();const r=new FormData(e),i=new URLSearchParams(r).toString();window.location.hash=`#${t}?${i}`}))})),setTimeout((()=>{this.loading=!1}),100)})))}render(){return W`${this.loading?W`
      `:""}`}};var _t;t([Z()],wt.prototype,"defaultUrl",null),t([Z()],wt.prototype,"loading",void 0),wt=t([$("pb-admin-shell")],wt),function(t){t.redirect="redirect",t.template="template"}(_t||(_t={}));let kt=class extends nt{constructor(){super(...arguments),this.flowBodyUrl=""}createRenderRoot(){return this}firstUpdated(){fetch(this.flowBodyUrl).then((t=>{if(!t.ok)throw Error(t.statusText);return t})).then((t=>t.json())).then((t=>{this.updateCard(t)})).catch((t=>{this.errorMessage(t)}))}async updateCard(t){switch(t.type){case _t.redirect:window.location.assign(t.to);break;case _t.template:this.flowBody=t.body,await this.requestUpdate(),this.checkAutofocus(),it(),this.loadFormCode(),this.setFormSubmitHandlers();default:console.log("passbook/flows: unexpected data type "+t.type)}}loadFormCode(){this.querySelectorAll("script").forEach((t=>{let e=document.createElement("script");e.src=t.src,document.head.appendChild(e)}))}checkAutofocus(){const t=this.querySelector("[autofocus]");null!==t&&t.focus()}updateFormAction(t){for(let e=0;e{console.log("passbook/flows: Checking for autosubmit attribute "+t),this.checkAutosubmit(t),console.log("passbook/flows: Setting action for form "+t),this.updateFormAction(t),console.log("passbook/flows: Adding handler for form "+t),t.addEventListener("submit",(e=>{e.preventDefault();let n=new FormData(t);this.flowBody=void 0,fetch(this.flowBodyUrl,{method:"post",body:n}).then((t=>t.json())).then((t=>{this.updateCard(t)})).catch((t=>{this.errorMessage(t)}))})),t.classList.add("pb-flow-wrapped")}))}errorMessage(t){this.flowBody=`\n \n \n `}loading(){return W``}render(){return this.flowBody?W([this.flowBody]):this.loading()}};t([Z()],kt.prototype,"flowBodyUrl",void 0),t([Z()],kt.prototype,"flowBody",void 0),kt=t([$("pb-flow-shell-card")],kt);var St=ct((function(t,e){t.exports=function(){var e,n;function r(){return e.apply(null,arguments)}function i(t){e=t}function o(t){return t instanceof Array||"[object Array]"===Object.prototype.toString.call(t)}function a(t){return null!=t&&"[object Object]"===Object.prototype.toString.call(t)}function s(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function l(t){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(t).length;var e;for(e in t)if(s(t,e))return!1;return!0}function u(t){return void 0===t}function c(t){return"number"==typeof t||"[object Number]"===Object.prototype.toString.call(t)}function d(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function h(t,e){var n,r=[];for(n=0;n>>0;for(e=0;e0)for(n=0;n=0?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+r}var R=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,W=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,E={},z={};function H(t,e,n,r){var i=r;"string"==typeof r&&(i=function(){return this[r]()}),t&&(z[t]=i),e&&(z[e[0]]=function(){return I(i.apply(this,arguments),e[1],e[2])}),n&&(z[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),t)})}function B(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function V(t){var e,n,r=t.match(R);for(e=0,n=r.length;e=0&&W.test(t);)t=t.replace(W,r),W.lastIndex=0,n-=1;return t}var j={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function G(t){var e=this._longDateFormat[t],n=this._longDateFormat[t.toUpperCase()];return e||!n?e:(this._longDateFormat[t]=n.match(R).map((function(t){return"MMMM"===t||"MM"===t||"DD"===t||"dddd"===t?t.slice(1):t})).join(""),this._longDateFormat[t])}var q="Invalid date";function $(){return this._invalidDate}var K="%d",Z=/\d{1,2}/;function X(t){return this._ordinal.replace("%d",t)}var J={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function Q(t,e,n,r){var i=this._relativeTime[n];return L(i)?i(t,e,n,r):i.replace(/%d/i,t)}function tt(t,e){var n=this._relativeTime[t>0?"future":"past"];return L(n)?n(e):n.replace(/%s/i,e)}var et={};function nt(t,e){var n=t.toLowerCase();et[n]=et[n+"s"]=et[e]=t}function rt(t){return"string"==typeof t?et[t]||et[t.toLowerCase()]:void 0}function it(t){var e,n,r={};for(n in t)s(t,n)&&(e=rt(n))&&(r[e]=t[n]);return r}var ot={};function at(t,e){ot[t]=e}function st(t){var e,n=[];for(e in t)s(t,e)&&n.push({unit:e,priority:ot[e]});return n.sort((function(t,e){return t.priority-e.priority})),n}function lt(t){return t%4==0&&t%100!=0||t%400==0}function ct(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function dt(t){var e=+t,n=0;return 0!==e&&isFinite(e)&&(n=ct(e)),n}function ht(t,e){return function(n){return null!=n?(pt(this,t,n),r.updateOffset(this,e),this):ft(this,t)}}function ft(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():NaN}function pt(t,e,n){t.isValid()&&!isNaN(n)&&("FullYear"===e&<(t.year())&&1===t.month()&&29===t.date()?(n=dt(n),t._d["set"+(t._isUTC?"UTC":"")+e](n,t.month(),te(n,t.month()))):t._d["set"+(t._isUTC?"UTC":"")+e](n))}function gt(t){return L(this[t=rt(t)])?this[t]():this}function mt(t,e){if("object"==typeof t){var n,r=st(t=it(t));for(n=0;n68?1900:2e3)};var ve=ht("FullYear",!0);function ye(){return lt(this.year())}function be(t,e,n,r,i,o,a){var s;return t<100&&t>=0?(s=new Date(t+400,e,n,r,i,o,a),isFinite(s.getFullYear())&&s.setFullYear(t)):s=new Date(t,e,n,r,i,o,a),s}function xe(t){var e,n;return t<100&&t>=0?((n=Array.prototype.slice.call(arguments))[0]=t+400,e=new Date(Date.UTC.apply(null,n)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t)):e=new Date(Date.UTC.apply(null,arguments)),e}function we(t,e,n){var r=7+e-n;return-(7+xe(t,0,r).getUTCDay()-e)%7+r-1}function _e(t,e,n,r,i){var o,a,s=1+7*(e-1)+(7+n-r)%7+we(t,r,i);return s<=0?a=me(o=t-1)+s:s>me(t)?(o=t+1,a=s-me(t)):(o=t,a=s),{year:o,dayOfYear:a}}function ke(t,e,n){var r,i,o=we(t.year(),e,n),a=Math.floor((t.dayOfYear()-o-1)/7)+1;return a<1?r=a+Se(i=t.year()-1,e,n):a>Se(t.year(),e,n)?(r=a-Se(t.year(),e,n),i=t.year()+1):(i=t.year(),r=a),{week:r,year:i}}function Se(t,e,n){var r=we(t,e,n),i=we(t+1,e,n);return(me(t)-r+i)/7}function Me(t){return ke(t,this._week.dow,this._week.doy).week}H("w",["ww",2],"wo","week"),H("W",["WW",2],"Wo","isoWeek"),nt("week","w"),nt("isoWeek","W"),at("week",5),at("isoWeek",5),It("w",kt),It("ww",kt,bt),It("W",kt),It("WW",kt,bt),Bt(["w","ww","W","WW"],(function(t,e,n,r){e[r.substr(0,1)]=dt(t)}));var Ce={dow:0,doy:6};function Te(){return this._week.dow}function De(){return this._week.doy}function Le(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")}function Pe(t){var e=ke(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")}function Ae(t,e){return"string"!=typeof t?t:isNaN(t)?"number"==typeof(t=e.weekdaysParse(t))?t:null:parseInt(t,10)}function Oe(t,e){return"string"==typeof t?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}function Ne(t,e){return t.slice(e,7).concat(t.slice(0,e))}H("d",0,"do","day"),H("dd",0,0,(function(t){return this.localeData().weekdaysMin(this,t)})),H("ddd",0,0,(function(t){return this.localeData().weekdaysShort(this,t)})),H("dddd",0,0,(function(t){return this.localeData().weekdays(this,t)})),H("e",0,0,"weekday"),H("E",0,0,"isoWeekday"),nt("day","d"),nt("weekday","e"),nt("isoWeekday","E"),at("day",11),at("weekday",11),at("isoWeekday",11),It("d",kt),It("e",kt),It("E",kt),It("dd",(function(t,e){return e.weekdaysMinRegex(t)})),It("ddd",(function(t,e){return e.weekdaysShortRegex(t)})),It("dddd",(function(t,e){return e.weekdaysRegex(t)})),Bt(["dd","ddd","dddd"],(function(t,e,n,r){var i=n._locale.weekdaysParse(t,r,n._strict);null!=i?e.d=i:m(n).invalidWeekday=t})),Bt(["d","e","E"],(function(t,e,n,r){e[r]=dt(t)}));var Fe="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Ie="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Re="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),We=Ft,Ee=Ft,ze=Ft;function He(t,e){var n=o(this._weekdays)?this._weekdays:this._weekdays[t&&!0!==t&&this._weekdays.isFormat.test(e)?"format":"standalone"];return!0===t?Ne(n,this._week.dow):t?n[t.day()]:n}function Be(t){return!0===t?Ne(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort}function Ve(t){return!0===t?Ne(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin}function Ye(t,e,n){var r,i,o,a=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)o=p([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(o,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(o,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(o,"").toLocaleLowerCase();return n?"dddd"===e?-1!==(i=Yt.call(this._weekdaysParse,a))?i:null:"ddd"===e?-1!==(i=Yt.call(this._shortWeekdaysParse,a))?i:null:-1!==(i=Yt.call(this._minWeekdaysParse,a))?i:null:"dddd"===e?-1!==(i=Yt.call(this._weekdaysParse,a))||-1!==(i=Yt.call(this._shortWeekdaysParse,a))||-1!==(i=Yt.call(this._minWeekdaysParse,a))?i:null:"ddd"===e?-1!==(i=Yt.call(this._shortWeekdaysParse,a))||-1!==(i=Yt.call(this._weekdaysParse,a))||-1!==(i=Yt.call(this._minWeekdaysParse,a))?i:null:-1!==(i=Yt.call(this._minWeekdaysParse,a))||-1!==(i=Yt.call(this._weekdaysParse,a))||-1!==(i=Yt.call(this._shortWeekdaysParse,a))?i:null}function Ue(t,e,n){var r,i,o;if(this._weekdaysParseExact)return Ye.call(this,t,e,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(i=p([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[r]||(o="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[r]=new RegExp(o.replace(".",""),"i")),n&&"dddd"===e&&this._fullWeekdaysParse[r].test(t))return r;if(n&&"ddd"===e&&this._shortWeekdaysParse[r].test(t))return r;if(n&&"dd"===e&&this._minWeekdaysParse[r].test(t))return r;if(!n&&this._weekdaysParse[r].test(t))return r}}function je(t){if(!this.isValid())return null!=t?this:NaN;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=Ae(t,this.localeData()),this.add(t-e,"d")):e}function Ge(t){if(!this.isValid())return null!=t?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")}function qe(t){if(!this.isValid())return null!=t?this:NaN;if(null!=t){var e=Oe(t,this.localeData());return this.day(this.day()%7?e:e-7)}return this.day()||7}function $e(t){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Xe.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(s(this,"_weekdaysRegex")||(this._weekdaysRegex=We),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)}function Ke(t){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Xe.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(s(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Ee),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Ze(t){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Xe.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(s(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=ze),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Xe(){function t(t,e){return e.length-t.length}var e,n,r,i,o,a=[],s=[],l=[],u=[];for(e=0;e<7;e++)n=p([2e3,1]).day(e),r=Et(this.weekdaysMin(n,"")),i=Et(this.weekdaysShort(n,"")),o=Et(this.weekdays(n,"")),a.push(r),s.push(i),l.push(o),u.push(r),u.push(i),u.push(o);a.sort(t),s.sort(t),l.sort(t),u.sort(t),this._weekdaysRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function Je(){return this.hours()%12||12}function Qe(){return this.hours()||24}function tn(t,e){H(t,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)}))}function en(t,e){return e._meridiemParse}function nn(t){return"p"===(t+"").toLowerCase().charAt(0)}H("H",["HH",2],0,"hour"),H("h",["hh",2],0,Je),H("k",["kk",2],0,Qe),H("hmm",0,0,(function(){return""+Je.apply(this)+I(this.minutes(),2)})),H("hmmss",0,0,(function(){return""+Je.apply(this)+I(this.minutes(),2)+I(this.seconds(),2)})),H("Hmm",0,0,(function(){return""+this.hours()+I(this.minutes(),2)})),H("Hmmss",0,0,(function(){return""+this.hours()+I(this.minutes(),2)+I(this.seconds(),2)})),tn("a",!0),tn("A",!1),nt("hour","h"),at("hour",13),It("a",en),It("A",en),It("H",kt),It("h",kt),It("k",kt),It("HH",kt,bt),It("hh",kt,bt),It("kk",kt,bt),It("hmm",St),It("hmmss",Mt),It("Hmm",St),It("Hmmss",Mt),Ht(["H","HH"],qt),Ht(["k","kk"],(function(t,e,n){var r=dt(t);e[qt]=24===r?0:r})),Ht(["a","A"],(function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t})),Ht(["h","hh"],(function(t,e,n){e[qt]=dt(t),m(n).bigHour=!0})),Ht("hmm",(function(t,e,n){var r=t.length-2;e[qt]=dt(t.substr(0,r)),e[$t]=dt(t.substr(r)),m(n).bigHour=!0})),Ht("hmmss",(function(t,e,n){var r=t.length-4,i=t.length-2;e[qt]=dt(t.substr(0,r)),e[$t]=dt(t.substr(r,2)),e[Kt]=dt(t.substr(i)),m(n).bigHour=!0})),Ht("Hmm",(function(t,e,n){var r=t.length-2;e[qt]=dt(t.substr(0,r)),e[$t]=dt(t.substr(r))})),Ht("Hmmss",(function(t,e,n){var r=t.length-4,i=t.length-2;e[qt]=dt(t.substr(0,r)),e[$t]=dt(t.substr(r,2)),e[Kt]=dt(t.substr(i))}));var rn=/[ap]\.?m?\.?/i,on=ht("Hours",!0);function an(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"}var sn,ln={calendar:N,longDateFormat:j,invalidDate:q,ordinal:K,dayOfMonthOrdinalParse:Z,relativeTime:J,months:ee,monthsShort:ne,week:Ce,weekdays:Fe,weekdaysMin:Re,weekdaysShort:Ie,meridiemParse:rn},un={},cn={};function dn(t,e){var n,r=Math.min(t.length,e.length);for(n=0;n0;){if(r=pn(i.slice(0,e).join("-")))return r;if(n&&n.length>=e&&dn(i,n)>=e-1)break;e--}o++}return sn}function pn(e){var n=null;if(void 0===un[e]&&t&&t.exports)try{n=sn._abbr,ut(),gn(n)}catch(t){un[e]=null}return un[e]}function gn(t,e){var n;return t&&((n=u(e)?yn(t):mn(t,e))?sn=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),sn._abbr}function mn(t,e){if(null!==e){var n,r=ln;if(e.abbr=t,null!=un[t])D("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),r=un[t]._config;else if(null!=e.parentLocale)if(null!=un[e.parentLocale])r=un[e.parentLocale]._config;else{if(null==(n=pn(e.parentLocale)))return cn[e.parentLocale]||(cn[e.parentLocale]=[]),cn[e.parentLocale].push({name:t,config:e}),null;r=n._config}return un[t]=new O(A(r,e)),cn[t]&&cn[t].forEach((function(t){mn(t.name,t.config)})),gn(t),un[t]}return delete un[t],null}function vn(t,e){if(null!=e){var n,r,i=ln;null!=un[t]&&null!=un[t].parentLocale?un[t].set(A(un[t]._config,e)):(null!=(r=pn(t))&&(i=r._config),e=A(i,e),null==r&&(e.abbr=t),(n=new O(e)).parentLocale=un[t],un[t]=n),gn(t)}else null!=un[t]&&(null!=un[t].parentLocale?(un[t]=un[t].parentLocale,t===gn()&&gn(t)):null!=un[t]&&delete un[t]);return un[t]}function yn(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return sn;if(!o(t)){if(e=pn(t))return e;t=[t]}return fn(t)}function bn(){return C(un)}function xn(t){var e,n=t._a;return n&&-2===m(t).overflow&&(e=n[jt]<0||n[jt]>11?jt:n[Gt]<1||n[Gt]>te(n[Ut],n[jt])?Gt:n[qt]<0||n[qt]>24||24===n[qt]&&(0!==n[$t]||0!==n[Kt]||0!==n[Zt])?qt:n[$t]<0||n[$t]>59?$t:n[Kt]<0||n[Kt]>59?Kt:n[Zt]<0||n[Zt]>999?Zt:-1,m(t)._overflowDayOfYear&&(eGt)&&(e=Gt),m(t)._overflowWeeks&&-1===e&&(e=Xt),m(t)._overflowWeekday&&-1===e&&(e=Jt),m(t).overflow=e),t}var wn=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,_n=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,kn=/Z|[+-]\d\d(?::?\d\d)?/,Sn=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Mn=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Cn=/^\/?Date\((-?\d+)/i,Tn=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Dn={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Ln(t){var e,n,r,i,o,a,s=t._i,l=wn.exec(s)||_n.exec(s);if(l){for(m(t).iso=!0,e=0,n=Sn.length;eme(o)||0===t._dayOfYear)&&(m(t)._overflowDayOfYear=!0),n=xe(o,0,t._dayOfYear),t._a[jt]=n.getUTCMonth(),t._a[Gt]=n.getUTCDate()),e=0;e<3&&null==t._a[e];++e)t._a[e]=a[e]=r[e];for(;e<7;e++)t._a[e]=a[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[qt]&&0===t._a[$t]&&0===t._a[Kt]&&0===t._a[Zt]&&(t._nextDay=!0,t._a[qt]=0),t._d=(t._useUTC?xe:be).apply(null,a),i=t._useUTC?t._d.getUTCDay():t._d.getDay(),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[qt]=24),t._w&&void 0!==t._w.d&&t._w.d!==i&&(m(t).weekdayMismatch=!0)}}function Hn(t){var e,n,r,i,o,a,s,l,u;null!=(e=t._w).GG||null!=e.W||null!=e.E?(o=1,a=4,n=Wn(e.GG,t._a[Ut],ke(Kn(),1,4).year),r=Wn(e.W,1),((i=Wn(e.E,1))<1||i>7)&&(l=!0)):(o=t._locale._week.dow,a=t._locale._week.doy,u=ke(Kn(),o,a),n=Wn(e.gg,t._a[Ut],u.year),r=Wn(e.w,u.week),null!=e.d?((i=e.d)<0||i>6)&&(l=!0):null!=e.e?(i=e.e+o,(e.e<0||e.e>6)&&(l=!0)):i=o),r<1||r>Se(n,o,a)?m(t)._overflowWeeks=!0:null!=l?m(t)._overflowWeekday=!0:(s=_e(n,r,i,o,a),t._a[Ut]=s.year,t._dayOfYear=s.dayOfYear)}function Bn(t){if(t._f!==r.ISO_8601)if(t._f!==r.RFC_2822){t._a=[],m(t).empty=!0;var e,n,i,o,a,s,l=""+t._i,u=l.length,c=0;for(i=U(t._f,t._locale).match(R)||[],e=0;e0&&m(t).unusedInput.push(a),l=l.slice(l.indexOf(n)+n.length),c+=n.length),z[o]?(n?m(t).empty=!1:m(t).unusedTokens.push(o),Vt(o,n,t)):t._strict&&!n&&m(t).unusedTokens.push(o);m(t).charsLeftOver=u-c,l.length>0&&m(t).unusedInput.push(l),t._a[qt]<=12&&!0===m(t).bigHour&&t._a[qt]>0&&(m(t).bigHour=void 0),m(t).parsedDateParts=t._a.slice(0),m(t).meridiem=t._meridiem,t._a[qt]=Vn(t._locale,t._a[qt],t._meridiem),null!==(s=m(t).era)&&(t._a[Ut]=t._locale.erasConvertYear(s,t._a[Ut])),zn(t),xn(t)}else In(t);else Ln(t)}function Vn(t,e,n){var r;return null==n?e:null!=t.meridiemHour?t.meridiemHour(e,n):null!=t.isPM?((r=t.isPM(n))&&e<12&&(e+=12),r||12!==e||(e=0),e):e}function Yn(t){var e,n,r,i,o,a,s=!1;if(0===t._f.length)return m(t).invalidFormat=!0,void(t._d=new Date(NaN));for(i=0;ithis?this:t:y()}));function Jn(t,e){var n,r;if(1===e.length&&o(e[0])&&(e=e[0]),!e.length)return Kn();for(n=e[0],r=1;rthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function _r(){if(!u(this._isDSTShifted))return this._isDSTShifted;var t,e={};return w(e,this),(e=Gn(e))._a?(t=e._isUTC?p(e._a):Kn(e._a),this._isDSTShifted=this.isValid()&&ur(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function kr(){return!!this.isValid()&&!this._isUTC}function Sr(){return!!this.isValid()&&this._isUTC}function Mr(){return!!this.isValid()&&this._isUTC&&0===this._offset}r.updateOffset=function(){};var Cr=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Tr=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Dr(t,e){var n,r,i,o=t,a=null;return sr(t)?o={ms:t._milliseconds,d:t._days,M:t._months}:c(t)||!isNaN(+t)?(o={},e?o[e]=+t:o.milliseconds=+t):(a=Cr.exec(t))?(n="-"===a[1]?-1:1,o={y:0,d:dt(a[Gt])*n,h:dt(a[qt])*n,m:dt(a[$t])*n,s:dt(a[Kt])*n,ms:dt(lr(1e3*a[Zt]))*n}):(a=Tr.exec(t))?(n="-"===a[1]?-1:1,o={y:Lr(a[2],n),M:Lr(a[3],n),w:Lr(a[4],n),d:Lr(a[5],n),h:Lr(a[6],n),m:Lr(a[7],n),s:Lr(a[8],n)}):null==o?o={}:"object"==typeof o&&("from"in o||"to"in o)&&(i=Ar(Kn(o.from),Kn(o.to)),(o={}).ms=i.milliseconds,o.M=i.months),r=new ar(o),sr(t)&&s(t,"_locale")&&(r._locale=t._locale),sr(t)&&s(t,"_isValid")&&(r._isValid=t._isValid),r}function Lr(t,e){var n=t&&parseFloat(t.replace(",","."));return(isNaN(n)?0:n)*e}function Pr(t,e){var n={};return n.months=e.month()-t.month()+12*(e.year()-t.year()),t.clone().add(n.months,"M").isAfter(e)&&--n.months,n.milliseconds=+e-+t.clone().add(n.months,"M"),n}function Ar(t,e){var n;return t.isValid()&&e.isValid()?(e=fr(e,t),t.isBefore(e)?n=Pr(t,e):((n=Pr(e,t)).milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function Or(t,e){return function(n,r){var i;return null===r||isNaN(+r)||(D(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),i=n,n=r,r=i),Nr(this,Dr(n,r),t),this}}function Nr(t,e,n,i){var o=e._milliseconds,a=lr(e._days),s=lr(e._months);t.isValid()&&(i=null==i||i,s&&ce(t,ft(t,"Month")+s*n),a&&pt(t,"Date",ft(t,"Date")+a*n),o&&t._d.setTime(t._d.valueOf()+o*n),i&&r.updateOffset(t,a||s))}Dr.fn=ar.prototype,Dr.invalid=or;var Fr=Or(1,"add"),Ir=Or(-1,"subtract");function Rr(t){return"string"==typeof t||t instanceof String}function Wr(t){return k(t)||d(t)||Rr(t)||c(t)||zr(t)||Er(t)||null==t}function Er(t){var e,n,r=a(t)&&!l(t),i=!1,o=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"];for(e=0;en.valueOf():n.valueOf()9999?Y(n,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):L(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",Y(n,"Z")):Y(n,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function ti(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t,e,n,r,i="moment",o="";return this.isLocal()||(i=0===this.utcOffset()?"moment.utc":"moment.parseZone",o="Z"),t="["+i+'("]',e=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",n="-MM-DD[T]HH:mm:ss.SSS",r=o+'[")]',this.format(t+e+n+r)}function ei(t){t||(t=this.isUtc()?r.defaultFormatUtc:r.defaultFormat);var e=Y(this,t);return this.localeData().postformat(e)}function ni(t,e){return this.isValid()&&(k(t)&&t.isValid()||Kn(t).isValid())?Dr({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function ri(t){return this.from(Kn(),t)}function ii(t,e){return this.isValid()&&(k(t)&&t.isValid()||Kn(t).isValid())?Dr({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function oi(t){return this.to(Kn(),t)}function ai(t){var e;return void 0===t?this._locale._abbr:(null!=(e=yn(t))&&(this._locale=e),this)}r.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",r.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var si=M("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",(function(t){return void 0===t?this.localeData():this.locale(t)}));function li(){return this._locale}var ui=1e3,ci=60*ui,di=60*ci,hi=3506328*di;function fi(t,e){return(t%e+e)%e}function pi(t,e,n){return t<100&&t>=0?new Date(t+400,e,n)-hi:new Date(t,e,n).valueOf()}function gi(t,e,n){return t<100&&t>=0?Date.UTC(t+400,e,n)-hi:Date.UTC(t,e,n)}function mi(t){var e,n;if(void 0===(t=rt(t))||"millisecond"===t||!this.isValid())return this;switch(n=this._isUTC?gi:pi,t){case"year":e=n(this.year(),0,1);break;case"quarter":e=n(this.year(),this.month()-this.month()%3,1);break;case"month":e=n(this.year(),this.month(),1);break;case"week":e=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":e=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":e=n(this.year(),this.month(),this.date());break;case"hour":e=this._d.valueOf(),e-=fi(e+(this._isUTC?0:this.utcOffset()*ci),di);break;case"minute":e=this._d.valueOf(),e-=fi(e,ci);break;case"second":e=this._d.valueOf(),e-=fi(e,ui)}return this._d.setTime(e),r.updateOffset(this,!0),this}function vi(t){var e,n;if(void 0===(t=rt(t))||"millisecond"===t||!this.isValid())return this;switch(n=this._isUTC?gi:pi,t){case"year":e=n(this.year()+1,0,1)-1;break;case"quarter":e=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":e=n(this.year(),this.month()+1,1)-1;break;case"week":e=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":e=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":e=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":e=this._d.valueOf(),e+=di-fi(e+(this._isUTC?0:this.utcOffset()*ci),di)-1;break;case"minute":e=this._d.valueOf(),e+=ci-fi(e,ci)-1;break;case"second":e=this._d.valueOf(),e+=ui-fi(e,ui)-1}return this._d.setTime(e),r.updateOffset(this,!0),this}function yi(){return this._d.valueOf()-6e4*(this._offset||0)}function bi(){return Math.floor(this.valueOf()/1e3)}function xi(){return new Date(this.valueOf())}function wi(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]}function _i(){var t=this;return{years:t.year(),months:t.month(),date:t.date(),hours:t.hours(),minutes:t.minutes(),seconds:t.seconds(),milliseconds:t.milliseconds()}}function ki(){return this.isValid()?this.toISOString():null}function Si(){return v(this)}function Mi(){return f({},m(this))}function Ci(){return m(this).overflow}function Ti(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function Di(t,e){var n,i,o,a=this._eras||yn("en")._eras;for(n=0,i=a.length;n=0)return l[r]}function Pi(t,e){var n=t.since<=t.until?1:-1;return void 0===e?r(t.since).year():r(t.since).year()+(e-t.offset)*n}function Ai(){var t,e,n,r=this.localeData().eras();for(t=0,e=r.length;t(o=Se(t,r,i))&&(e=o),Xi.call(this,t,e,n,r,i))}function Xi(t,e,n,r,i){var o=_e(t,e,n,r,i),a=xe(o.year,0,o.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}function Ji(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)}H("N",0,0,"eraAbbr"),H("NN",0,0,"eraAbbr"),H("NNN",0,0,"eraAbbr"),H("NNNN",0,0,"eraName"),H("NNNNN",0,0,"eraNarrow"),H("y",["y",1],"yo","eraYear"),H("y",["yy",2],0,"eraYear"),H("y",["yyy",3],0,"eraYear"),H("y",["yyyy",4],0,"eraYear"),It("N",Ei),It("NN",Ei),It("NNN",Ei),It("NNNN",zi),It("NNNNN",Hi),Ht(["N","NN","NNN","NNNN","NNNNN"],(function(t,e,n,r){var i=n._locale.erasParse(t,r,n._strict);i?m(n).era=i:m(n).invalidEra=t})),It("y",Lt),It("yy",Lt),It("yyy",Lt),It("yyyy",Lt),It("yo",Bi),Ht(["y","yy","yyy","yyyy"],Ut),Ht(["yo"],(function(t,e,n,r){var i;n._locale._eraYearOrdinalRegex&&(i=t.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?e[Ut]=n._locale.eraYearOrdinalParse(t,i):e[Ut]=parseInt(t,10)})),H(0,["gg",2],0,(function(){return this.weekYear()%100})),H(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),Yi("gggg","weekYear"),Yi("ggggg","weekYear"),Yi("GGGG","isoWeekYear"),Yi("GGGGG","isoWeekYear"),nt("weekYear","gg"),nt("isoWeekYear","GG"),at("weekYear",1),at("isoWeekYear",1),It("G",Pt),It("g",Pt),It("GG",kt,bt),It("gg",kt,bt),It("GGGG",Tt,wt),It("gggg",Tt,wt),It("GGGGG",Dt,_t),It("ggggg",Dt,_t),Bt(["gggg","ggggg","GGGG","GGGGG"],(function(t,e,n,r){e[r.substr(0,2)]=dt(t)})),Bt(["gg","GG"],(function(t,e,n,i){e[i]=r.parseTwoDigitYear(t)})),H("Q",0,"Qo","quarter"),nt("quarter","Q"),at("quarter",7),It("Q",yt),Ht("Q",(function(t,e){e[jt]=3*(dt(t)-1)})),H("D",["DD",2],"Do","date"),nt("date","D"),at("date",9),It("D",kt),It("DD",kt,bt),It("Do",(function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient})),Ht(["D","DD"],Gt),Ht("Do",(function(t,e){e[Gt]=dt(t.match(kt)[0])}));var Qi=ht("Date",!0);function to(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")}H("DDD",["DDDD",3],"DDDo","dayOfYear"),nt("dayOfYear","DDD"),at("dayOfYear",4),It("DDD",Ct),It("DDDD",xt),Ht(["DDD","DDDD"],(function(t,e,n){n._dayOfYear=dt(t)})),H("m",["mm",2],0,"minute"),nt("minute","m"),at("minute",14),It("m",kt),It("mm",kt,bt),Ht(["m","mm"],$t);var eo=ht("Minutes",!1);H("s",["ss",2],0,"second"),nt("second","s"),at("second",15),It("s",kt),It("ss",kt,bt),Ht(["s","ss"],Kt);var no,ro,io=ht("Seconds",!1);for(H("S",0,0,(function(){return~~(this.millisecond()/100)})),H(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),H(0,["SSS",3],0,"millisecond"),H(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),H(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),H(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),H(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),H(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),H(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),nt("millisecond","ms"),at("millisecond",16),It("S",Ct,yt),It("SS",Ct,bt),It("SSS",Ct,xt),no="SSSS";no.length<=9;no+="S")It(no,Lt);function oo(t,e){e[Zt]=dt(1e3*("0."+t))}for(no="S";no.length<=9;no+="S")Ht(no,oo);function ao(){return this._isUTC?"UTC":""}function so(){return this._isUTC?"Coordinated Universal Time":""}ro=ht("Milliseconds",!1),H("z",0,0,"zoneAbbr"),H("zz",0,0,"zoneName");var lo=_.prototype;function uo(t){return Kn(1e3*t)}function co(){return Kn.apply(null,arguments).parseZone()}function ho(t){return t}lo.add=Fr,lo.calendar=Vr,lo.clone=Yr,lo.diff=Zr,lo.endOf=vi,lo.format=ei,lo.from=ni,lo.fromNow=ri,lo.to=ii,lo.toNow=oi,lo.get=gt,lo.invalidAt=Ci,lo.isAfter=Ur,lo.isBefore=jr,lo.isBetween=Gr,lo.isSame=qr,lo.isSameOrAfter=$r,lo.isSameOrBefore=Kr,lo.isValid=Si,lo.lang=si,lo.locale=ai,lo.localeData=li,lo.max=Xn,lo.min=Zn,lo.parsingFlags=Mi,lo.set=mt,lo.startOf=mi,lo.subtract=Ir,lo.toArray=wi,lo.toObject=_i,lo.toDate=xi,lo.toISOString=Qr,lo.inspect=ti,"undefined"!=typeof Symbol&&null!=Symbol.for&&(lo[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),lo.toJSON=ki,lo.toString=Jr,lo.unix=bi,lo.valueOf=yi,lo.creationData=Ti,lo.eraName=Ai,lo.eraNarrow=Oi,lo.eraAbbr=Ni,lo.eraYear=Fi,lo.year=ve,lo.isLeapYear=ye,lo.weekYear=Ui,lo.isoWeekYear=ji,lo.quarter=lo.quarters=Ji,lo.month=de,lo.daysInMonth=he,lo.week=lo.weeks=Le,lo.isoWeek=lo.isoWeeks=Pe,lo.weeksInYear=$i,lo.weeksInWeekYear=Ki,lo.isoWeeksInYear=Gi,lo.isoWeeksInISOWeekYear=qi,lo.date=Qi,lo.day=lo.days=je,lo.weekday=Ge,lo.isoWeekday=qe,lo.dayOfYear=to,lo.hour=lo.hours=on,lo.minute=lo.minutes=eo,lo.second=lo.seconds=io,lo.millisecond=lo.milliseconds=ro,lo.utcOffset=gr,lo.utc=vr,lo.local=yr,lo.parseZone=br,lo.hasAlignedHourOffset=xr,lo.isDST=wr,lo.isLocal=kr,lo.isUtcOffset=Sr,lo.isUtc=Mr,lo.isUTC=Mr,lo.zoneAbbr=ao,lo.zoneName=so,lo.dates=M("dates accessor is deprecated. Use date instead.",Qi),lo.months=M("months accessor is deprecated. Use month instead",de),lo.years=M("years accessor is deprecated. Use year instead",ve),lo.zone=M("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",mr),lo.isDSTShifted=M("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",_r);var fo=O.prototype;function po(t,e,n,r){var i=yn(),o=p().set(r,e);return i[n](o,t)}function go(t,e,n){if(c(t)&&(e=t,t=void 0),t=t||"",null!=e)return po(t,e,n,"month");var r,i=[];for(r=0;r<12;r++)i[r]=po(t,r,n,"month");return i}function mo(t,e,n,r){"boolean"==typeof t?(c(e)&&(n=e,e=void 0),e=e||""):(n=e=t,t=!1,c(e)&&(n=e,e=void 0),e=e||"");var i,o=yn(),a=t?o._week.dow:0,s=[];if(null!=n)return po(e,(n+a)%7,r,"day");for(i=0;i<7;i++)s[i]=po(e,(i+a)%7,r,"day");return s}function vo(t,e){return go(t,e,"months")}function yo(t,e){return go(t,e,"monthsShort")}function bo(t,e,n){return mo(t,e,n,"weekdays")}function xo(t,e,n){return mo(t,e,n,"weekdaysShort")}function wo(t,e,n){return mo(t,e,n,"weekdaysMin")}fo.calendar=F,fo.longDateFormat=G,fo.invalidDate=$,fo.ordinal=X,fo.preparse=ho,fo.postformat=ho,fo.relativeTime=Q,fo.pastFuture=tt,fo.set=P,fo.eras=Di,fo.erasParse=Li,fo.erasConvertYear=Pi,fo.erasAbbrRegex=Ri,fo.erasNameRegex=Ii,fo.erasNarrowRegex=Wi,fo.months=ae,fo.monthsShort=se,fo.monthsParse=ue,fo.monthsRegex=pe,fo.monthsShortRegex=fe,fo.week=Me,fo.firstDayOfYear=De,fo.firstDayOfWeek=Te,fo.weekdays=He,fo.weekdaysMin=Ve,fo.weekdaysShort=Be,fo.weekdaysParse=Ue,fo.weekdaysRegex=$e,fo.weekdaysShortRegex=Ke,fo.weekdaysMinRegex=Ze,fo.isPM=nn,fo.meridiem=an,gn("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10;return t+(1===dt(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th")}}),r.lang=M("moment.lang is deprecated. Use moment.locale instead.",gn),r.langData=M("moment.langData is deprecated. Use moment.localeData instead.",yn);var _o=Math.abs;function ko(){var t=this._data;return this._milliseconds=_o(this._milliseconds),this._days=_o(this._days),this._months=_o(this._months),t.milliseconds=_o(t.milliseconds),t.seconds=_o(t.seconds),t.minutes=_o(t.minutes),t.hours=_o(t.hours),t.months=_o(t.months),t.years=_o(t.years),this}function So(t,e,n,r){var i=Dr(e,n);return t._milliseconds+=r*i._milliseconds,t._days+=r*i._days,t._months+=r*i._months,t._bubble()}function Mo(t,e){return So(this,t,e,1)}function Co(t,e){return So(this,t,e,-1)}function To(t){return t<0?Math.floor(t):Math.ceil(t)}function Do(){var t,e,n,r,i,o=this._milliseconds,a=this._days,s=this._months,l=this._data;return o>=0&&a>=0&&s>=0||o<=0&&a<=0&&s<=0||(o+=864e5*To(Po(s)+a),a=0,s=0),l.milliseconds=o%1e3,t=ct(o/1e3),l.seconds=t%60,e=ct(t/60),l.minutes=e%60,n=ct(e/60),l.hours=n%24,a+=ct(n/24),s+=i=ct(Lo(a)),a-=To(Po(i)),r=ct(s/12),s%=12,l.days=a,l.months=s,l.years=r,this}function Lo(t){return 4800*t/146097}function Po(t){return 146097*t/4800}function Ao(t){if(!this.isValid())return NaN;var e,n,r=this._milliseconds;if("month"===(t=rt(t))||"quarter"===t||"year"===t)switch(e=this._days+r/864e5,n=this._months+Lo(e),t){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(e=this._days+Math.round(Po(this._months)),t){case"week":return e/7+r/6048e5;case"day":return e+r/864e5;case"hour":return 24*e+r/36e5;case"minute":return 1440*e+r/6e4;case"second":return 86400*e+r/1e3;case"millisecond":return Math.floor(864e5*e)+r;default:throw new Error("Unknown unit "+t)}}function Oo(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*dt(this._months/12):NaN}function No(t){return function(){return this.as(t)}}var Fo=No("ms"),Io=No("s"),Ro=No("m"),Wo=No("h"),Eo=No("d"),zo=No("w"),Ho=No("M"),Bo=No("Q"),Vo=No("y");function Yo(){return Dr(this)}function Uo(t){return t=rt(t),this.isValid()?this[t+"s"]():NaN}function jo(t){return function(){return this.isValid()?this._data[t]:NaN}}var Go=jo("milliseconds"),qo=jo("seconds"),$o=jo("minutes"),Ko=jo("hours"),Zo=jo("days"),Xo=jo("months"),Jo=jo("years");function Qo(){return ct(this.days()/7)}var ta=Math.round,ea={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function na(t,e,n,r,i){return i.relativeTime(e||1,!!n,t,r)}function ra(t,e,n,r){var i=Dr(t).abs(),o=ta(i.as("s")),a=ta(i.as("m")),s=ta(i.as("h")),l=ta(i.as("d")),u=ta(i.as("M")),c=ta(i.as("w")),d=ta(i.as("y")),h=o<=n.ss&&["s",o]||o0,h[4]=r,na.apply(null,h)}function ia(t){return void 0===t?ta:"function"==typeof t&&(ta=t,!0)}function oa(t,e){return void 0!==ea[t]&&(void 0===e?ea[t]:(ea[t]=e,"s"===t&&(ea.ss=e-1),!0))}function aa(t,e){if(!this.isValid())return this.localeData().invalidDate();var n,r,i=!1,o=ea;return"object"==typeof t&&(e=t,t=!1),"boolean"==typeof t&&(i=t),"object"==typeof e&&(o=Object.assign({},ea,e),null!=e.s&&null==e.ss&&(o.ss=e.s-1)),r=ra(this,!i,o,n=this.localeData()),i&&(r=n.pastFuture(+this,r)),n.postformat(r)}var sa=Math.abs;function la(t){return(t>0)-(t<0)||+t}function ua(){if(!this.isValid())return this.localeData().invalidDate();var t,e,n,r,i,o,a,s,l=sa(this._milliseconds)/1e3,u=sa(this._days),c=sa(this._months),d=this.asSeconds();return d?(t=ct(l/60),e=ct(t/60),l%=60,t%=60,n=ct(c/12),c%=12,r=l?l.toFixed(3).replace(/\.?0+$/,""):"",i=d<0?"-":"",o=la(this._months)!==la(d)?"-":"",a=la(this._days)!==la(d)?"-":"",s=la(this._milliseconds)!==la(d)?"-":"",i+"P"+(n?o+n+"Y":"")+(c?o+c+"M":"")+(u?a+u+"D":"")+(e||t||l?"T":"")+(e?s+e+"H":"")+(t?s+t+"M":"")+(l?s+r+"S":"")):"P0D"}var ca=ar.prototype;return ca.isValid=ir,ca.abs=ko,ca.add=Mo,ca.subtract=Co,ca.as=Ao,ca.asMilliseconds=Fo,ca.asSeconds=Io,ca.asMinutes=Ro,ca.asHours=Wo,ca.asDays=Eo,ca.asWeeks=zo,ca.asMonths=Ho,ca.asQuarters=Bo,ca.asYears=Vo,ca.valueOf=Oo,ca._bubble=Do,ca.clone=Yo,ca.get=Uo,ca.milliseconds=Go,ca.seconds=qo,ca.minutes=$o,ca.hours=Ko,ca.days=Zo,ca.weeks=Qo,ca.months=Xo,ca.years=Jo,ca.humanize=aa,ca.toISOString=ua,ca.toString=ua,ca.toJSON=ua,ca.locale=ai,ca.localeData=li,ca.toIsoString=M("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",ua),ca.lang=si,H("X",0,0,"unix"),H("x",0,0,"valueOf"),It("x",Pt),It("X",Nt),Ht("X",(function(t,e,n){n._d=new Date(1e3*parseFloat(t))})),Ht("x",(function(t,e,n){n._d=new Date(dt(t))})), //! moment.js r.version="2.29.1",i(Kn),r.fn=lo,r.min=Qn,r.max=tr,r.now=er,r.utc=p,r.unix=uo,r.months=vo,r.isDate=d,r.locale=gn,r.invalid=y,r.duration=Dr,r.isMoment=k,r.weekdays=bo,r.parseZone=co,r.localeData=yn,r.isDuration=sr,r.monthsShort=yo,r.weekdaysMin=wo,r.defineLocale=mn,r.updateLocale=vn,r.locales=bn,r.weekdaysShort=xo,r.normalizeUnits=rt,r.relativeTimeRounding=ia,r.relativeTimeThreshold=oa,r.calendarFormat=Br,r.prototype=lo,r.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},r}()})),Mt=ct((function(t,e){ /*! diff --git a/passbook/static/static/dist/main.js.map b/passbook/static/static/dist/main.js.map index 3be629fac..4106d0955 100644 --- a/passbook/static/static/dist/main.js.map +++ b/passbook/static/static/dist/main.js.map @@ -1 +1 @@ -{"version":3,"file":"main.js","sources":["../node_modules/tslib/tslib.es6.js","../src/legacy.js","../node_modules/lit-html/src/lib/dom.ts","../node_modules/lit-html/src/lib/template.ts","../node_modules/lit-html/src/lib/modify-template.ts","../node_modules/lit-html/src/lib/directive.ts","../node_modules/lit-html/src/lib/part.ts","../node_modules/lit-html/src/lib/template-instance.ts","../node_modules/lit-html/src/lib/template-result.ts","../node_modules/lit-html/src/lib/parts.ts","../node_modules/lit-html/src/lib/template-factory.ts","../node_modules/lit-html/src/lib/render.ts","../node_modules/lit-html/src/lib/default-template-processor.ts","../node_modules/lit-html/src/lit-html.ts","../node_modules/lit-html/src/lib/shady-render.ts","../node_modules/lit-element/src/lib/updating-element.ts","../node_modules/lit-element/src/lib/decorators.ts","../node_modules/lit-element/src/lib/css-tag.ts","../node_modules/lit-element/src/lit-element.ts","../src/elements/Messages.ts","../src/elements/ActionButton.ts","../src/utils.ts","../src/elements/AdminSidebar.ts","../node_modules/codemirror/lib/codemirror.js","../node_modules/codemirror/addon/display/autorefresh.js","../node_modules/codemirror/mode/xml/xml.js","../node_modules/codemirror/mode/yaml/yaml.js","../node_modules/codemirror/mode/python/python.js","../src/elements/CodeMirror.ts","../src/elements/Dropdown.ts","../src/elements/FetchFillSlot.ts","../src/elements/ModalButton.ts","../src/elements/Tabs.ts","../src/pages/AdminSiteShell.ts","../src/pages/FlowShellCard.ts","../node_modules/moment/moment.js","../node_modules/chart.js/dist/Chart.js","../src/elements/AdminLoginsChart.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","// Search clearing\ndocument.querySelectorAll(\"input[type=search]\").forEach((si) => {\n si.addEventListener(\"search\", (e) => {\n if (si.value === \"\") {\n si.parentElement.submit();\n }\n });\n});\n\n// Fetch from data-attributes\ndocument.querySelectorAll(\"[data-pb-fetch-fill]\").forEach((el) => {\n const url = el.dataset.pbFetchFill;\n const key = el.dataset.pbFetchKey;\n fetch(url)\n .then((r) => r.json())\n .then((r) => {\n el.textContent = r[key];\n el.value = r[key];\n });\n});\n\n// Modal\ndocument.querySelectorAll(\"[data-target='modal']\").forEach((m) => {\n m.addEventListener(\"click\", (e) => {\n const parentContainer = e.target.closest('[data-target=\"modal\"]');\n const modalId = parentContainer.attributes[\"data-modal\"].value;\n document.querySelector(`#${modalId}`).removeAttribute(\"hidden\");\n });\n});\ndocument.querySelectorAll(\".pf-c-modal-box [data-modal-close]\").forEach((b) => {\n b.addEventListener(\"click\", (e) => {\n const parentContainer = e.target.closest(\".pf-c-backdrop\");\n parentContainer.setAttribute(\"hidden\", true);\n });\n});\n\n// Make Checkbox label click trigger checkbox toggle\ndocument.querySelectorAll(\".pf-c-check__label\").forEach((checkLabel) => {\n checkLabel.addEventListener(\"click\", (e) => {\n const checkbox = e.target.parentElement.querySelector(\n \"input[type=checkbox]\"\n );\n checkbox.checked = !checkbox.checked;\n });\n});\n\n// Hamburger Menu\ndocument\n .querySelectorAll(\".pf-c-page__header-brand-toggle>button\")\n .forEach((toggle) => {\n toggle.addEventListener(\"click\", (e) => {\n const sidebar = document.querySelector(\".pf-c-page__sidebar\");\n if (sidebar.classList.contains(\"pf-m-expanded\")) {\n // Sidebar already expanded\n sidebar.classList.remove(\"pf-m-expanded\");\n sidebar.style.zIndex = 0;\n } else {\n // Sidebar not expanded yet\n sidebar.classList.add(\"pf-m-expanded\");\n sidebar.style.zIndex = 200;\n }\n });\n });\n\n// Collapsable Menus in Sidebar\ndocument\n .querySelectorAll(\".pf-m-expandable>.pf-c-nav__link\")\n .forEach((menu) => {\n menu.addEventListener(\"click\", (e) => {\n e.preventDefault();\n menu.parentElement.classList.toggle(\"pf-m-expanded\");\n });\n });\n","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n\ninterface MaybePolyfilledCe extends CustomElementRegistry {\n readonly polyfillWrapFlushCallback?: object;\n}\n\n/**\n * True if the custom elements polyfill is in use.\n */\nexport const isCEPolyfill = typeof window !== 'undefined' &&\n window.customElements != null &&\n (window.customElements as MaybePolyfilledCe).polyfillWrapFlushCallback !==\n undefined;\n\n/**\n * Reparents nodes, starting from `start` (inclusive) to `end` (exclusive),\n * into another container (could be the same container), before `before`. If\n * `before` is null, it appends the nodes to the container.\n */\nexport const reparentNodes =\n (container: Node,\n start: Node|null,\n end: Node|null = null,\n before: Node|null = null): void => {\n while (start !== end) {\n const n = start!.nextSibling;\n container.insertBefore(start!, before);\n start = n;\n }\n };\n\n/**\n * Removes nodes, starting from `start` (inclusive) to `end` (exclusive), from\n * `container`.\n */\nexport const removeNodes =\n (container: Node, start: Node|null, end: Node|null = null): void => {\n while (start !== end) {\n const n = start!.nextSibling;\n container.removeChild(start!);\n start = n;\n }\n };\n","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n\nimport {TemplateResult} from './template-result.js';\n\n/**\n * An expression marker with embedded unique key to avoid collision with\n * possible text in templates.\n */\nexport const marker = `{{lit-${String(Math.random()).slice(2)}}}`;\n\n/**\n * An expression marker used text-positions, multi-binding attributes, and\n * attributes with markup-like text values.\n */\nexport const nodeMarker = ``;\n\nexport const markerRegex = new RegExp(`${marker}|${nodeMarker}`);\n\n/**\n * Suffix appended to all bound attribute names.\n */\nexport const boundAttributeSuffix = '$lit$';\n\n/**\n * An updatable Template that tracks the location of dynamic parts.\n */\nexport class Template {\n readonly parts: TemplatePart[] = [];\n readonly element: HTMLTemplateElement;\n\n constructor(result: TemplateResult, element: HTMLTemplateElement) {\n this.element = element;\n\n const nodesToRemove: Node[] = [];\n const stack: Node[] = [];\n // Edge needs all 4 parameters present; IE11 needs 3rd parameter to be null\n const walker = document.createTreeWalker(\n element.content,\n 133 /* NodeFilter.SHOW_{ELEMENT|COMMENT|TEXT} */,\n null,\n false);\n // Keeps track of the last index associated with a part. We try to delete\n // unnecessary nodes, but we never want to associate two different parts\n // to the same index. They must have a constant node between.\n let lastPartIndex = 0;\n let index = -1;\n let partIndex = 0;\n const {strings, values: {length}} = result;\n while (partIndex < length) {\n const node = walker.nextNode() as Element | Comment | Text | null;\n if (node === null) {\n // We've exhausted the content inside a nested template element.\n // Because we still have parts (the outer for-loop), we know:\n // - There is a template in the stack\n // - The walker will find a nextNode outside the template\n walker.currentNode = stack.pop()!;\n continue;\n }\n index++;\n\n if (node.nodeType === 1 /* Node.ELEMENT_NODE */) {\n if ((node as Element).hasAttributes()) {\n const attributes = (node as Element).attributes;\n const {length} = attributes;\n // Per\n // https://developer.mozilla.org/en-US/docs/Web/API/NamedNodeMap,\n // attributes are not guaranteed to be returned in document order.\n // In particular, Edge/IE can return them out of order, so we cannot\n // assume a correspondence between part index and attribute index.\n let count = 0;\n for (let i = 0; i < length; i++) {\n if (endsWith(attributes[i].name, boundAttributeSuffix)) {\n count++;\n }\n }\n while (count-- > 0) {\n // Get the template literal section leading up to the first\n // expression in this attribute\n const stringForPart = strings[partIndex];\n // Find the attribute name\n const name = lastAttributeNameRegex.exec(stringForPart)![2];\n // Find the corresponding attribute\n // All bound attributes have had a suffix added in\n // TemplateResult#getHTML to opt out of special attribute\n // handling. To look up the attribute value we also need to add\n // the suffix.\n const attributeLookupName =\n name.toLowerCase() + boundAttributeSuffix;\n const attributeValue =\n (node as Element).getAttribute(attributeLookupName)!;\n (node as Element).removeAttribute(attributeLookupName);\n const statics = attributeValue.split(markerRegex);\n this.parts.push({type: 'attribute', index, name, strings: statics});\n partIndex += statics.length - 1;\n }\n }\n if ((node as Element).tagName === 'TEMPLATE') {\n stack.push(node);\n walker.currentNode = (node as HTMLTemplateElement).content;\n }\n } else if (node.nodeType === 3 /* Node.TEXT_NODE */) {\n const data = (node as Text).data;\n if (data.indexOf(marker) >= 0) {\n const parent = node.parentNode!;\n const strings = data.split(markerRegex);\n const lastIndex = strings.length - 1;\n // Generate a new text node for each literal section\n // These nodes are also used as the markers for node parts\n for (let i = 0; i < lastIndex; i++) {\n let insert: Node;\n let s = strings[i];\n if (s === '') {\n insert = createMarker();\n } else {\n const match = lastAttributeNameRegex.exec(s);\n if (match !== null && endsWith(match[2], boundAttributeSuffix)) {\n s = s.slice(0, match.index) + match[1] +\n match[2].slice(0, -boundAttributeSuffix.length) + match[3];\n }\n insert = document.createTextNode(s);\n }\n parent.insertBefore(insert, node);\n this.parts.push({type: 'node', index: ++index});\n }\n // If there's no text, we must insert a comment to mark our place.\n // Else, we can trust it will stick around after cloning.\n if (strings[lastIndex] === '') {\n parent.insertBefore(createMarker(), node);\n nodesToRemove.push(node);\n } else {\n (node as Text).data = strings[lastIndex];\n }\n // We have a part for each match found\n partIndex += lastIndex;\n }\n } else if (node.nodeType === 8 /* Node.COMMENT_NODE */) {\n if ((node as Comment).data === marker) {\n const parent = node.parentNode!;\n // Add a new marker node to be the startNode of the Part if any of\n // the following are true:\n // * We don't have a previousSibling\n // * The previousSibling is already the start of a previous part\n if (node.previousSibling === null || index === lastPartIndex) {\n index++;\n parent.insertBefore(createMarker(), node);\n }\n lastPartIndex = index;\n this.parts.push({type: 'node', index});\n // If we don't have a nextSibling, keep this node so we have an end.\n // Else, we can remove it to save future costs.\n if (node.nextSibling === null) {\n (node as Comment).data = '';\n } else {\n nodesToRemove.push(node);\n index--;\n }\n partIndex++;\n } else {\n let i = -1;\n while ((i = (node as Comment).data.indexOf(marker, i + 1)) !== -1) {\n // Comment node has a binding marker inside, make an inactive part\n // The binding won't work, but subsequent bindings will\n // TODO (justinfagnani): consider whether it's even worth it to\n // make bindings in comments work\n this.parts.push({type: 'node', index: -1});\n partIndex++;\n }\n }\n }\n }\n\n // Remove text binding nodes after the walk to not disturb the TreeWalker\n for (const n of nodesToRemove) {\n n.parentNode!.removeChild(n);\n }\n }\n}\n\nconst endsWith = (str: string, suffix: string): boolean => {\n const index = str.length - suffix.length;\n return index >= 0 && str.slice(index) === suffix;\n};\n\n/**\n * A placeholder for a dynamic expression in an HTML template.\n *\n * There are two built-in part types: AttributePart and NodePart. NodeParts\n * always represent a single dynamic expression, while AttributeParts may\n * represent as many expressions are contained in the attribute.\n *\n * A Template's parts are mutable, so parts can be replaced or modified\n * (possibly to implement different template semantics). The contract is that\n * parts can only be replaced, not removed, added or reordered, and parts must\n * always consume the correct number of values in their `update()` method.\n *\n * TODO(justinfagnani): That requirement is a little fragile. A\n * TemplateInstance could instead be more careful about which values it gives\n * to Part.update().\n */\nexport type TemplatePart = {\n readonly type: 'node'; index: number;\n}|{\n readonly type: 'attribute';\n index: number;\n readonly name: string;\n readonly strings: ReadonlyArray;\n};\n\nexport const isTemplatePartActive = (part: TemplatePart) => part.index !== -1;\n\n// Allows `document.createComment('')` to be renamed for a\n// small manual size-savings.\nexport const createMarker = () => document.createComment('');\n\n/**\n * This regex extracts the attribute name preceding an attribute-position\n * expression. It does this by matching the syntax allowed for attributes\n * against the string literal directly preceding the expression, assuming that\n * the expression is in an attribute-value position.\n *\n * See attributes in the HTML spec:\n * https://www.w3.org/TR/html5/syntax.html#elements-attributes\n *\n * \" \\x09\\x0a\\x0c\\x0d\" are HTML space characters:\n * https://www.w3.org/TR/html5/infrastructure.html#space-characters\n *\n * \"\\0-\\x1F\\x7F-\\x9F\" are Unicode control characters, which includes every\n * space character except \" \".\n *\n * So an attribute is:\n * * The name: any character except a control character, space character, ('),\n * (\"), \">\", \"=\", or \"/\"\n * * Followed by zero or more space characters\n * * Followed by \"=\"\n * * Followed by zero or more space characters\n * * Followed by:\n * * Any character except space, ('), (\"), \"<\", \">\", \"=\", (`), or\n * * (\") then any non-(\"), or\n * * (') then any non-(')\n */\nexport const lastAttributeNameRegex =\n // eslint-disable-next-line no-control-regex\n /([ \\x09\\x0a\\x0c\\x0d])([^\\0-\\x1F\\x7F-\\x9F \"'>=/]+)([ \\x09\\x0a\\x0c\\x0d]*=[ \\x09\\x0a\\x0c\\x0d]*(?:[^ \\x09\\x0a\\x0c\\x0d\"'`<>=]*|\"[^\"]*|'[^']*))$/;\n","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n\nimport {isTemplatePartActive, Template, TemplatePart} from './template.js';\n\nconst walkerNodeFilter = 133 /* NodeFilter.SHOW_{ELEMENT|COMMENT|TEXT} */;\n\n/**\n * Removes the list of nodes from a Template safely. In addition to removing\n * nodes from the Template, the Template part indices are updated to match\n * the mutated Template DOM.\n *\n * As the template is walked the removal state is tracked and\n * part indices are adjusted as needed.\n *\n * div\n * div#1 (remove) <-- start removing (removing node is div#1)\n * div\n * div#2 (remove) <-- continue removing (removing node is still div#1)\n * div\n * div <-- stop removing since previous sibling is the removing node (div#1,\n * removed 4 nodes)\n */\nexport function removeNodesFromTemplate(\n template: Template, nodesToRemove: Set) {\n const {element: {content}, parts} = template;\n const walker =\n document.createTreeWalker(content, walkerNodeFilter, null, false);\n let partIndex = nextActiveIndexInTemplateParts(parts);\n let part = parts[partIndex];\n let nodeIndex = -1;\n let removeCount = 0;\n const nodesToRemoveInTemplate = [];\n let currentRemovingNode: Node|null = null;\n while (walker.nextNode()) {\n nodeIndex++;\n const node = walker.currentNode as Element;\n // End removal if stepped past the removing node\n if (node.previousSibling === currentRemovingNode) {\n currentRemovingNode = null;\n }\n // A node to remove was found in the template\n if (nodesToRemove.has(node)) {\n nodesToRemoveInTemplate.push(node);\n // Track node we're removing\n if (currentRemovingNode === null) {\n currentRemovingNode = node;\n }\n }\n // When removing, increment count by which to adjust subsequent part indices\n if (currentRemovingNode !== null) {\n removeCount++;\n }\n while (part !== undefined && part.index === nodeIndex) {\n // If part is in a removed node deactivate it by setting index to -1 or\n // adjust the index as needed.\n part.index = currentRemovingNode !== null ? -1 : part.index - removeCount;\n // go to the next active part.\n partIndex = nextActiveIndexInTemplateParts(parts, partIndex);\n part = parts[partIndex];\n }\n }\n nodesToRemoveInTemplate.forEach((n) => n.parentNode!.removeChild(n));\n}\n\nconst countNodes = (node: Node) => {\n let count = (node.nodeType === 11 /* Node.DOCUMENT_FRAGMENT_NODE */) ? 0 : 1;\n const walker = document.createTreeWalker(node, walkerNodeFilter, null, false);\n while (walker.nextNode()) {\n count++;\n }\n return count;\n};\n\nconst nextActiveIndexInTemplateParts =\n (parts: TemplatePart[], startIndex = -1) => {\n for (let i = startIndex + 1; i < parts.length; i++) {\n const part = parts[i];\n if (isTemplatePartActive(part)) {\n return i;\n }\n }\n return -1;\n };\n\n/**\n * Inserts the given node into the Template, optionally before the given\n * refNode. In addition to inserting the node into the Template, the Template\n * part indices are updated to match the mutated Template DOM.\n */\nexport function insertNodeIntoTemplate(\n template: Template, node: Node, refNode: Node|null = null) {\n const {element: {content}, parts} = template;\n // If there's no refNode, then put node at end of template.\n // No part indices need to be shifted in this case.\n if (refNode === null || refNode === undefined) {\n content.appendChild(node);\n return;\n }\n const walker =\n document.createTreeWalker(content, walkerNodeFilter, null, false);\n let partIndex = nextActiveIndexInTemplateParts(parts);\n let insertCount = 0;\n let walkerIndex = -1;\n while (walker.nextNode()) {\n walkerIndex++;\n const walkerNode = walker.currentNode as Element;\n if (walkerNode === refNode) {\n insertCount = countNodes(node);\n refNode.parentNode!.insertBefore(node, refNode);\n }\n while (partIndex !== -1 && parts[partIndex].index === walkerIndex) {\n // If we've inserted the node, simply adjust all subsequent parts\n if (insertCount > 0) {\n while (partIndex !== -1) {\n parts[partIndex].index += insertCount;\n partIndex = nextActiveIndexInTemplateParts(parts, partIndex);\n }\n return;\n }\n partIndex = nextActiveIndexInTemplateParts(parts, partIndex);\n }\n }\n}\n","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n\nimport {Part} from './part.js';\n\nconst directives = new WeakMap();\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type DirectiveFactory = (...args: any[]) => object;\n\nexport type DirectiveFn = (part: Part) => void;\n\n/**\n * Brands a function as a directive factory function so that lit-html will call\n * the function during template rendering, rather than passing as a value.\n *\n * A _directive_ is a function that takes a Part as an argument. It has the\n * signature: `(part: Part) => void`.\n *\n * A directive _factory_ is a function that takes arguments for data and\n * configuration and returns a directive. Users of directive usually refer to\n * the directive factory as the directive. For example, \"The repeat directive\".\n *\n * Usually a template author will invoke a directive factory in their template\n * with relevant arguments, which will then return a directive function.\n *\n * Here's an example of using the `repeat()` directive factory that takes an\n * array and a function to render an item:\n *\n * ```js\n * html`
        <${repeat(items, (item) => html`
      • ${item}
      • `)}
      `\n * ```\n *\n * When `repeat` is invoked, it returns a directive function that closes over\n * `items` and the template function. When the outer template is rendered, the\n * return directive function is called with the Part for the expression.\n * `repeat` then performs it's custom logic to render multiple items.\n *\n * @param f The directive factory function. Must be a function that returns a\n * function of the signature `(part: Part) => void`. The returned function will\n * be called with the part object.\n *\n * @example\n *\n * import {directive, html} from 'lit-html';\n *\n * const immutable = directive((v) => (part) => {\n * if (part.value !== v) {\n * part.setValue(v)\n * }\n * });\n */\nexport const directive = (f: F): F =>\n ((...args: unknown[]) => {\n const d = f(...args);\n directives.set(d, true);\n return d;\n }) as F;\n\nexport const isDirective = (o: unknown): o is DirectiveFn => {\n return typeof o === 'function' && directives.has(o);\n};\n","/**\n * @license\n * Copyright (c) 2018 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n\n/**\n * The Part interface represents a dynamic part of a template instance rendered\n * by lit-html.\n */\nexport interface Part {\n readonly value: unknown;\n\n /**\n * Sets the current part value, but does not write it to the DOM.\n * @param value The value that will be committed.\n */\n setValue(value: unknown): void;\n\n /**\n * Commits the current part value, causing it to actually be written to the\n * DOM.\n *\n * Directives are run at the start of `commit`, so that if they call\n * `part.setValue(...)` synchronously that value will be used in the current\n * commit, and there's no need to call `part.commit()` within the directive.\n * If directives set a part value asynchronously, then they must call\n * `part.commit()` manually.\n */\n commit(): void;\n}\n\n/**\n * A sentinel value that signals that a value was handled by a directive and\n * should not be written to the DOM.\n */\nexport const noChange = {};\n\n/**\n * A sentinel value that signals a NodePart to fully clear its content.\n */\nexport const nothing = {};\n","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n\nimport {isCEPolyfill} from './dom.js';\nimport {Part} from './part.js';\nimport {RenderOptions} from './render-options.js';\nimport {TemplateProcessor} from './template-processor.js';\nimport {isTemplatePartActive, Template, TemplatePart} from './template.js';\n\n/**\n * An instance of a `Template` that can be attached to the DOM and updated\n * with new values.\n */\nexport class TemplateInstance {\n private readonly __parts: Array = [];\n readonly processor: TemplateProcessor;\n readonly options: RenderOptions;\n readonly template: Template;\n\n constructor(\n template: Template, processor: TemplateProcessor,\n options: RenderOptions) {\n this.template = template;\n this.processor = processor;\n this.options = options;\n }\n\n update(values: readonly unknown[]) {\n let i = 0;\n for (const part of this.__parts) {\n if (part !== undefined) {\n part.setValue(values[i]);\n }\n i++;\n }\n for (const part of this.__parts) {\n if (part !== undefined) {\n part.commit();\n }\n }\n }\n\n _clone(): DocumentFragment {\n // There are a number of steps in the lifecycle of a template instance's\n // DOM fragment:\n // 1. Clone - create the instance fragment\n // 2. Adopt - adopt into the main document\n // 3. Process - find part markers and create parts\n // 4. Upgrade - upgrade custom elements\n // 5. Update - set node, attribute, property, etc., values\n // 6. Connect - connect to the document. Optional and outside of this\n // method.\n //\n // We have a few constraints on the ordering of these steps:\n // * We need to upgrade before updating, so that property values will pass\n // through any property setters.\n // * We would like to process before upgrading so that we're sure that the\n // cloned fragment is inert and not disturbed by self-modifying DOM.\n // * We want custom elements to upgrade even in disconnected fragments.\n //\n // Given these constraints, with full custom elements support we would\n // prefer the order: Clone, Process, Adopt, Upgrade, Update, Connect\n //\n // But Safari does not implement CustomElementRegistry#upgrade, so we\n // can not implement that order and still have upgrade-before-update and\n // upgrade disconnected fragments. So we instead sacrifice the\n // process-before-upgrade constraint, since in Custom Elements v1 elements\n // must not modify their light DOM in the constructor. We still have issues\n // when co-existing with CEv0 elements like Polymer 1, and with polyfills\n // that don't strictly adhere to the no-modification rule because shadow\n // DOM, which may be created in the constructor, is emulated by being placed\n // in the light DOM.\n //\n // The resulting order is on native is: Clone, Adopt, Upgrade, Process,\n // Update, Connect. document.importNode() performs Clone, Adopt, and Upgrade\n // in one step.\n //\n // The Custom Elements v1 polyfill supports upgrade(), so the order when\n // polyfilled is the more ideal: Clone, Process, Adopt, Upgrade, Update,\n // Connect.\n\n const fragment = isCEPolyfill ?\n this.template.element.content.cloneNode(true) as DocumentFragment :\n document.importNode(this.template.element.content, true);\n\n const stack: Node[] = [];\n const parts = this.template.parts;\n // Edge needs all 4 parameters present; IE11 needs 3rd parameter to be null\n const walker = document.createTreeWalker(\n fragment,\n 133 /* NodeFilter.SHOW_{ELEMENT|COMMENT|TEXT} */,\n null,\n false);\n let partIndex = 0;\n let nodeIndex = 0;\n let part: TemplatePart;\n let node = walker.nextNode();\n // Loop through all the nodes and parts of a template\n while (partIndex < parts.length) {\n part = parts[partIndex];\n if (!isTemplatePartActive(part)) {\n this.__parts.push(undefined);\n partIndex++;\n continue;\n }\n\n // Progress the tree walker until we find our next part's node.\n // Note that multiple parts may share the same node (attribute parts\n // on a single element), so this loop may not run at all.\n while (nodeIndex < part.index) {\n nodeIndex++;\n if (node!.nodeName === 'TEMPLATE') {\n stack.push(node!);\n walker.currentNode = (node as HTMLTemplateElement).content;\n }\n if ((node = walker.nextNode()) === null) {\n // We've exhausted the content inside a nested template element.\n // Because we still have parts (the outer for-loop), we know:\n // - There is a template in the stack\n // - The walker will find a nextNode outside the template\n walker.currentNode = stack.pop()!;\n node = walker.nextNode();\n }\n }\n\n // We've arrived at our part's node.\n if (part.type === 'node') {\n const part = this.processor.handleTextExpression(this.options);\n part.insertAfterNode(node!.previousSibling!);\n this.__parts.push(part);\n } else {\n this.__parts.push(...this.processor.handleAttributeExpressions(\n node as Element, part.name, part.strings, this.options));\n }\n partIndex++;\n }\n\n if (isCEPolyfill) {\n document.adoptNode(fragment);\n customElements.upgrade(fragment);\n }\n return fragment;\n }\n}\n","/**\n * @license\n * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.\n * This code may only be used under the BSD style license found at\n * http://polymer.github.io/LICENSE.txt\n * The complete set of authors may be found at\n * http://polymer.github.io/AUTHORS.txt\n * The complete set of contributors may be found at\n * http://polymer.github.io/CONTRIBUTORS.txt\n * Code distributed by Google as part of the polymer project is also\n * subject to an additional IP rights grant found at\n * http://polymer.github.io/PATENTS.txt\n */\n\n/**\n * @module lit-html\n */\n\nimport {reparentNodes} from './dom.js';\nimport {TemplateProcessor} from './template-processor.js';\nimport {boundAttributeSuffix, lastAttributeNameRegex, marker, nodeMarker} from './template.js';\n\ndeclare const trustedTypes: typeof window.trustedTypes;\n/**\n * Our TrustedTypePolicy for HTML which is declared using the html template\n * tag function.\n *\n * That HTML is a developer-authored constant, and is parsed with innerHTML\n * before any untrusted expressions have been mixed in. Therefor it is\n * considered safe by construction.\n */\nconst policy = window.trustedTypes &&\n trustedTypes!.createPolicy('lit-html', {createHTML: (s) => s});\n\nconst commentMarker = ` ${marker} `;\n\n/**\n * The return type of `html`, which holds a Template and the values from\n * interpolated expressions.\n */\nexport class TemplateResult {\n readonly strings: TemplateStringsArray;\n readonly values: readonly unknown[];\n readonly type: string;\n readonly processor: TemplateProcessor;\n\n constructor(\n strings: TemplateStringsArray, values: readonly unknown[], type: string,\n processor: TemplateProcessor) {\n this.strings = strings;\n this.values = values;\n this.type = type;\n this.processor = processor;\n }\n\n /**\n * Returns a string of HTML used to create a `