Edit file File name : formBuilderApp.js Content :(()=>{var e,t={3239:(e,t,n)=>{e=n.nmd(e),function(){var e=function(){return this}();e||"undefined"==typeof window||(e=window);var t=function(e,n,i){"string"==typeof e?(2==arguments.length&&(i=n),t.modules[e]||(t.payloads[e]=i,t.modules[e]=null)):t.original?t.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace())};t.modules={},t.payloads={};var n,i,o=function(e,t,n){if("string"==typeof t){var i=a(e,t);if(null!=i)return n&&n(),i}else if("[object Array]"===Object.prototype.toString.call(t)){for(var o=[],s=0,l=t.length;s<l;++s){var c=a(e,t[s]);if(null==c&&r.original)return;o.push(c)}return n&&n.apply(null,o)||!0}},r=function(e,t){var n=o("",e,t);return null==n&&r.original?r.original.apply(this,arguments):n},s=function(e,t){if(-1!==t.indexOf("!")){var n=t.split("!");return s(e,n[0])+"!"+s(e,n[1])}if("."==t.charAt(0))for(t=e.split("/").slice(0,-1).join("/")+"/"+t;-1!==t.indexOf(".")&&i!=t;){var i=t;t=t.replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}return t},a=function(e,n){n=s(e,n);var i=t.modules[n];if(!i){if("function"==typeof(i=t.payloads[n])){var r={},a={id:n,uri:"",exports:r,packaged:!0};r=i((function(e,t){return o(n,e,t)}),r,a)||a.exports,t.modules[n]=r,delete t.payloads[n]}i=t.modules[n]=r||i}return i};i=e,(n="ace")&&(e[n]||(e[n]={}),i=e[n]),i.define&&i.define.packaged||(t.original=i.define,i.define=t,i.define.packaged=!0),i.require&&i.require.packaged||(r.original=i.require,i.require=r,i.require.packaged=!0)}(),ace.define("ace/lib/es6-shim",["require","exports","module"],(function(e,t,n){function i(e,t,n){Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})}String.prototype.startsWith||i(String.prototype,"startsWith",(function(e,t){return t=t||0,this.lastIndexOf(e,t)===t})),String.prototype.endsWith||i(String.prototype,"endsWith",(function(e,t){var n=this;(void 0===t||t>n.length)&&(t=n.length),t-=e.length;var i=n.indexOf(e,t);return-1!==i&&i===t})),String.prototype.repeat||i(String.prototype,"repeat",(function(e){for(var t="",n=this;e>0;)1&e&&(t+=n),(e>>=1)&&(n+=n);return t})),String.prototype.includes||i(String.prototype,"includes",(function(e,t){return-1!=this.indexOf(e,t)})),Object.assign||(Object.assign=function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;n<arguments.length;n++){var i=arguments[n];null!=i&&Object.keys(i).forEach((function(e){t[e]=i[e]}))}return t}),Object.values||(Object.values=function(e){return Object.keys(e).map((function(t){return e[t]}))}),Array.prototype.find||i(Array.prototype,"find",(function(e){for(var t=this.length,n=arguments[1],i=0;i<t;i++){var o=this[i];if(e.call(n,o,i,this))return o}})),Array.prototype.findIndex||i(Array.prototype,"findIndex",(function(e){for(var t=this.length,n=arguments[1],i=0;i<t;i++){var o=this[i];if(e.call(n,o,i,this))return i}})),Array.prototype.includes||i(Array.prototype,"includes",(function(e,t){return-1!=this.indexOf(e,t)})),Array.prototype.fill||i(Array.prototype,"fill",(function(e){for(var t=this,n=t.length>>>0,i=arguments[1]>>0,o=i<0?Math.max(n+i,0):Math.min(i,n),r=arguments[2],s=void 0===r?n:r>>0,a=s<0?Math.max(n+s,0):Math.min(s,n);o<a;)t[o]=e,o++;return t})),Array.of||i(Array,"of",(function(){return Array.prototype.slice.call(arguments)}))})),ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/es6-shim"],(function(e,t,n){"use strict";e("./es6-shim")})),ace.define("ace/lib/lang",["require","exports","module"],(function(e,t,n){"use strict";t.last=function(e){return e[e.length-1]},t.stringReverse=function(e){return e.split("").reverse().join("")},t.stringRepeat=function(e,t){for(var n="";t>0;)1&t&&(n+=e),(t>>=1)&&(e+=e);return n};var i=/^\s\s*/,o=/\s\s*$/;t.stringTrimLeft=function(e){return e.replace(i,"")},t.stringTrimRight=function(e){return e.replace(o,"")},t.copyObject=function(e){var t={};for(var n in e)t[n]=e[n];return t},t.copyArray=function(e){for(var t=[],n=0,i=e.length;n<i;n++)e[n]&&"object"==typeof e[n]?t[n]=this.copyObject(e[n]):t[n]=e[n];return t},t.deepCopy=function e(t){if("object"!=typeof t||!t)return t;var n;if(Array.isArray(t)){n=[];for(var i=0;i<t.length;i++)n[i]=e(t[i]);return n}if("[object Object]"!==Object.prototype.toString.call(t))return t;for(var i in n={},t)n[i]=e(t[i]);return n},t.arrayToMap=function(e){for(var t={},n=0;n<e.length;n++)t[e[n]]=1;return t},t.createMap=function(e){var t=Object.create(null);for(var n in e)t[n]=e[n];return t},t.arrayRemove=function(e,t){for(var n=0;n<=e.length;n++)t===e[n]&&e.splice(n,1)},t.escapeRegExp=function(e){return e.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},t.escapeHTML=function(e){return(""+e).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<")},t.getMatchOffsets=function(e,t){var n=[];return e.replace(t,(function(e){n.push({offset:arguments[arguments.length-2],length:e.length})})),n},t.deferredCall=function(e){var t=null,n=function(){t=null,e()},i=function(e){return i.cancel(),t=setTimeout(n,e||0),i};return i.schedule=i,i.call=function(){return this.cancel(),e(),i},i.cancel=function(){return clearTimeout(t),t=null,i},i.isPending=function(){return t},i},t.delayedCall=function(e,t){var n=null,i=function(){n=null,e()},o=function(e){null==n&&(n=setTimeout(i,e||t))};return o.delay=function(e){n&&clearTimeout(n),n=setTimeout(i,e||t)},o.schedule=o,o.call=function(){this.cancel(),e()},o.cancel=function(){n&&clearTimeout(n),n=null},o.isPending=function(){return n},o},t.supportsLookbehind=function(){try{new RegExp("(?<=.)")}catch(e){return!1}return!0},t.supportsUnicodeFlag=function(){try{new RegExp("^.$","u")}catch(e){return!1}return!0}})),ace.define("ace/lib/useragent",["require","exports","module"],(function(e,t,n){"use strict";t.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},t.getOS=function(){return t.isMac?t.OS.MAC:t.isLinux?t.OS.LINUX:t.OS.WINDOWS};var i="object"==typeof navigator?navigator:{},o=(/mac|win|linux/i.exec(i.platform)||["other"])[0].toLowerCase(),r=i.userAgent||"",s=i.appName||"";t.isWin="win"==o,t.isMac="mac"==o,t.isLinux="linux"==o,t.isIE="Microsoft Internet Explorer"==s||s.indexOf("MSAppHost")>=0?parseFloat((r.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((r.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),t.isOldIE=t.isIE&&t.isIE<9,t.isGecko=t.isMozilla=r.match(/ Gecko\/\d+/),t.isOpera="object"==typeof opera&&"[object Opera]"==Object.prototype.toString.call(window.opera),t.isWebKit=parseFloat(r.split("WebKit/")[1])||void 0,t.isChrome=parseFloat(r.split(" Chrome/")[1])||void 0,t.isEdge=parseFloat(r.split(" Edge/")[1])||void 0,t.isAIR=r.indexOf("AdobeAIR")>=0,t.isAndroid=r.indexOf("Android")>=0,t.isChromeOS=r.indexOf(" CrOS ")>=0,t.isIOS=/iPad|iPhone|iPod/.test(r)&&!window.MSStream,t.isIOS&&(t.isMac=!0),t.isMobile=t.isIOS||t.isAndroid})),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],(function(e,t,n){"use strict";var i,o=e("./useragent");t.buildDom=function e(t,n,i){if("string"==typeof t&&t){var o=document.createTextNode(t);return n&&n.appendChild(o),o}if(!Array.isArray(t))return t&&t.appendChild&&n&&n.appendChild(t),t;if("string"!=typeof t[0]||!t[0]){for(var r=[],s=0;s<t.length;s++){var a=e(t[s],n,i);a&&r.push(a)}return r}var l=document.createElement(t[0]),c=t[1],h=1;for(c&&"object"==typeof c&&!Array.isArray(c)&&(h=2),s=h;s<t.length;s++)e(t[s],l,i);return 2==h&&Object.keys(c).forEach((function(e){var t=c[e];"class"===e?l.className=Array.isArray(t)?t.join(" "):t:"function"==typeof t||"value"==e||"$"==e[0]?l[e]=t:"ref"===e?i&&(i[t]=l):"style"===e?"string"==typeof t&&(l.style.cssText=t):null!=t&&l.setAttribute(e,t)})),n&&n.appendChild(l),l},t.getDocumentHead=function(e){return e||(e=document),e.head||e.getElementsByTagName("head")[0]||e.documentElement},t.createElement=function(e,t){return document.createElementNS?document.createElementNS(t||"http://www.w3.org/1999/xhtml",e):document.createElement(e)},t.removeChildren=function(e){e.innerHTML=""},t.createTextNode=function(e,t){return(t?t.ownerDocument:document).createTextNode(e)},t.createFragment=function(e){return(e?e.ownerDocument:document).createDocumentFragment()},t.hasCssClass=function(e,t){return-1!==(e.className+"").split(/\s+/g).indexOf(t)},t.addCssClass=function(e,n){t.hasCssClass(e,n)||(e.className+=" "+n)},t.removeCssClass=function(e,t){for(var n=e.className.split(/\s+/g);;){var i=n.indexOf(t);if(-1==i)break;n.splice(i,1)}e.className=n.join(" ")},t.toggleCssClass=function(e,t){for(var n=e.className.split(/\s+/g),i=!0;;){var o=n.indexOf(t);if(-1==o)break;i=!1,n.splice(o,1)}return i&&n.push(t),e.className=n.join(" "),i},t.setCssClass=function(e,n,i){i?t.addCssClass(e,n):t.removeCssClass(e,n)},t.hasCssString=function(e,t){var n,i=0;if(n=(t=t||document).querySelectorAll("style"))for(;i<n.length;)if(n[i++].id===e)return!0},t.removeElementById=function(e,t){(t=t||document).getElementById(e)&&t.getElementById(e).remove()};var r=[];function s(){var e=r;r=null,e&&e.forEach((function(e){a(e[0],e[1])}))}function a(e,n,o){if("undefined"!=typeof document){if(r)if(o)s();else if(!1===o)return r.push([e,n]);if(!i){var a=o;o&&o.getRootNode&&(a=o.getRootNode())&&a!=o||(a=document);var l=a.ownerDocument||a;if(n&&t.hasCssString(n,a))return null;n&&(e+="\n/*# sourceURL=ace/css/"+n+" */");var c=t.createElement("style");c.appendChild(l.createTextNode(e)),n&&(c.id=n),a==l&&(a=t.getDocumentHead(l)),a.insertBefore(c,a.firstChild)}}}if(t.useStrictCSP=function(e){i=e,0==e?s():r||(r=[])},t.importCssString=a,t.importCssStylsheet=function(e,n){t.buildDom(["link",{rel:"stylesheet",href:e}],t.getDocumentHead(n))},t.scrollbarWidth=function(e){var n=t.createElement("ace_inner");n.style.width="100%",n.style.minWidth="0px",n.style.height="200px",n.style.display="block";var i=t.createElement("ace_outer"),o=i.style;o.position="absolute",o.left="-10000px",o.overflow="hidden",o.width="200px",o.minWidth="0px",o.height="150px",o.display="block",i.appendChild(n);var r=e&&e.documentElement||document&&document.documentElement;if(!r)return 0;r.appendChild(i);var s=n.offsetWidth;o.overflow="scroll";var a=n.offsetWidth;return s===a&&(a=i.clientWidth),r.removeChild(i),s-a},t.computedStyle=function(e,t){return window.getComputedStyle(e,"")||{}},t.setStyle=function(e,t,n){e[t]!==n&&(e[t]=n)},t.HAS_CSS_ANIMATION=!1,t.HAS_CSS_TRANSFORMS=!1,t.HI_DPI=!o.isWin||"undefined"!=typeof window&&window.devicePixelRatio>=1.5,o.isChromeOS&&(t.HI_DPI=!1),"undefined"!=typeof document){var l=document.createElement("div");t.HI_DPI&&void 0!==l.style.transform&&(t.HAS_CSS_TRANSFORMS=!0),o.isEdge||void 0===l.style.animationName||(t.HAS_CSS_ANIMATION=!0),l=null}t.HAS_CSS_TRANSFORMS?t.translate=function(e,t,n){e.style.transform="translate("+Math.round(t)+"px, "+Math.round(n)+"px)"}:t.translate=function(e,t,n){e.style.top=Math.round(n)+"px",e.style.left=Math.round(t)+"px"}})),ace.define("ace/lib/net",["require","exports","module","ace/lib/dom"],(function(e,t,n){"use strict";var i=e("./dom");t.get=function(e,t){var n=new XMLHttpRequest;n.open("GET",e,!0),n.onreadystatechange=function(){4===n.readyState&&t(n.responseText)},n.send(null)},t.loadScript=function(e,t){var n=i.getDocumentHead(),o=document.createElement("script");o.src=e,n.appendChild(o),o.onload=o.onreadystatechange=function(e,n){!n&&o.readyState&&"loaded"!=o.readyState&&"complete"!=o.readyState||(o=o.onload=o.onreadystatechange=null,n||t())}},t.qualifyURL=function(e){var t=document.createElement("a");return t.href=e,t.href}})),ace.define("ace/lib/oop",["require","exports","module"],(function(e,t,n){"use strict";t.inherits=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})},t.mixin=function(e,t){for(var n in t)e[n]=t[n];return e},t.implement=function(e,n){t.mixin(e,n)}})),ace.define("ace/lib/event_emitter",["require","exports","module"],(function(e,t,n){"use strict";var i={},o=function(){this.propagationStopped=!0},r=function(){this.defaultPrevented=!0};i._emit=i._dispatchEvent=function(e,t){this._eventRegistry||(this._eventRegistry={}),this._defaultHandlers||(this._defaultHandlers={});var n=this._eventRegistry[e]||[],i=this._defaultHandlers[e];if(n.length||i){"object"==typeof t&&t||(t={}),t.type||(t.type=e),t.stopPropagation||(t.stopPropagation=o),t.preventDefault||(t.preventDefault=r),n=n.slice();for(var s=0;s<n.length&&(n[s](t,this),!t.propagationStopped);s++);return i&&!t.defaultPrevented?i(t,this):void 0}},i._signal=function(e,t){var n=(this._eventRegistry||{})[e];if(n){n=n.slice();for(var i=0;i<n.length;i++)n[i](t,this)}},i.once=function(e,t){var n=this;if(this.on(e,(function i(){n.off(e,i),t.apply(null,arguments)})),!t)return new Promise((function(e){t=e}))},i.setDefaultHandler=function(e,t){var n=this._defaultHandlers;if(n||(n=this._defaultHandlers={_disabled_:{}}),n[e]){var i=n[e],o=n._disabled_[e];o||(n._disabled_[e]=o=[]),o.push(i);var r=o.indexOf(t);-1!=r&&o.splice(r,1)}n[e]=t},i.removeDefaultHandler=function(e,t){var n=this._defaultHandlers;if(n){var i=n._disabled_[e];if(n[e]==t)i&&this.setDefaultHandler(e,i.pop());else if(i){var o=i.indexOf(t);-1!=o&&i.splice(o,1)}}},i.on=i.addEventListener=function(e,t,n){this._eventRegistry=this._eventRegistry||{};var i=this._eventRegistry[e];return i||(i=this._eventRegistry[e]=[]),-1==i.indexOf(t)&&i[n?"unshift":"push"](t),t},i.off=i.removeListener=i.removeEventListener=function(e,t){this._eventRegistry=this._eventRegistry||{};var n=this._eventRegistry[e];if(n){var i=n.indexOf(t);-1!==i&&n.splice(i,1)}},i.removeAllListeners=function(e){e||(this._eventRegistry=this._defaultHandlers=void 0),this._eventRegistry&&(this._eventRegistry[e]=void 0),this._defaultHandlers&&(this._defaultHandlers[e]=void 0)},t.EventEmitter=i})),ace.define("ace/lib/app_config",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],(function(e,t,n){var i,o=e("./oop"),r=e("./event_emitter").EventEmitter,s={setOptions:function(e){Object.keys(e).forEach((function(t){this.setOption(t,e[t])}),this)},getOptions:function(e){var t={};if(e)Array.isArray(e)||(t=e,e=Object.keys(t));else{var n=this.$options;e=Object.keys(n).filter((function(e){return!n[e].hidden}))}return e.forEach((function(e){t[e]=this.getOption(e)}),this),t},setOption:function(e,t){if(this["$"+e]!==t){var n=this.$options[e];if(!n)return a('misspelled option "'+e+'"');if(n.forwardTo)return this[n.forwardTo]&&this[n.forwardTo].setOption(e,t);n.handlesSet||(this["$"+e]=t),n&&n.set&&n.set.call(this,t)}},getOption:function(e){var t=this.$options[e];return t?t.forwardTo?this[t.forwardTo]&&this[t.forwardTo].getOption(e):t&&t.get?t.get.call(this):this["$"+e]:a('misspelled option "'+e+'"')}};function a(e){"undefined"!=typeof console&&console.warn&&console.warn.apply(console,arguments)}var l=function(){function e(){this.$defaultOptions={}}return e.prototype.defineOptions=function(e,t,n){return e.$options||(this.$defaultOptions[t]=e.$options={}),Object.keys(n).forEach((function(t){var i=n[t];"string"==typeof i&&(i={forwardTo:i}),i.name||(i.name=t),e.$options[i.name]=i,"initialValue"in i&&(e["$"+i.name]=i.initialValue)})),o.implement(e,s),this},e.prototype.resetOptions=function(e){Object.keys(e.$options).forEach((function(t){var n=e.$options[t];"value"in n&&e.setOption(t,n.value)}))},e.prototype.setDefaultValue=function(e,t,n){if(!e){for(e in this.$defaultOptions)if(this.$defaultOptions[e][t])break;if(!this.$defaultOptions[e][t])return!1}var i=this.$defaultOptions[e]||(this.$defaultOptions[e]={});i[t]&&(i.forwardTo?this.setDefaultValue(i.forwardTo,t,n):i[t].value=n)},e.prototype.setDefaultValues=function(e,t){Object.keys(t).forEach((function(n){this.setDefaultValue(e,n,t[n])}),this)},e.prototype.setMessages=function(e){i=e},e.prototype.nls=function(e,t){i&&!i[e]&&a("No message found for '"+e+"' in the provided messages, falling back to default English message.");var n=i&&i[e]||e;return t&&(n=n.replace(/\$(\$|[\d]+)/g,(function(e,n){return"$"==n?"$":t[n]}))),n},e}();l.prototype.warn=a,l.prototype.reportError=function(e,t){var n=new Error(e);n.data=t,"object"==typeof console&&console.error&&console.error(n),setTimeout((function(){throw n}))},o.implement(l.prototype,r),t.AppConfig=l})),ace.define("ace/theme/textmate-css",["require","exports","module"],(function(e,t,n){n.exports='.ace-tm .ace_gutter {\n background: #f0f0f0;\n color: #333;\n}\n\n.ace-tm .ace_print-margin {\n width: 1px;\n background: #e8e8e8;\n}\n\n.ace-tm .ace_fold {\n background-color: #6B72E6;\n}\n\n.ace-tm {\n background-color: #FFFFFF;\n color: black;\n}\n\n.ace-tm .ace_cursor {\n color: black;\n}\n \n.ace-tm .ace_invisible {\n color: rgb(191, 191, 191);\n}\n\n.ace-tm .ace_storage,\n.ace-tm .ace_keyword {\n color: blue;\n}\n\n.ace-tm .ace_constant {\n color: rgb(197, 6, 11);\n}\n\n.ace-tm .ace_constant.ace_buildin {\n color: rgb(88, 72, 246);\n}\n\n.ace-tm .ace_constant.ace_language {\n color: rgb(88, 92, 246);\n}\n\n.ace-tm .ace_constant.ace_library {\n color: rgb(6, 150, 14);\n}\n\n.ace-tm .ace_invalid {\n background-color: rgba(255, 0, 0, 0.1);\n color: red;\n}\n\n.ace-tm .ace_support.ace_function {\n color: rgb(60, 76, 114);\n}\n\n.ace-tm .ace_support.ace_constant {\n color: rgb(6, 150, 14);\n}\n\n.ace-tm .ace_support.ace_type,\n.ace-tm .ace_support.ace_class {\n color: rgb(109, 121, 222);\n}\n\n.ace-tm .ace_keyword.ace_operator {\n color: rgb(104, 118, 135);\n}\n\n.ace-tm .ace_string {\n color: rgb(3, 106, 7);\n}\n\n.ace-tm .ace_comment {\n color: rgb(76, 136, 107);\n}\n\n.ace-tm .ace_comment.ace_doc {\n color: rgb(0, 102, 255);\n}\n\n.ace-tm .ace_comment.ace_doc.ace_tag {\n color: rgb(128, 159, 191);\n}\n\n.ace-tm .ace_constant.ace_numeric {\n color: rgb(0, 0, 205);\n}\n\n.ace-tm .ace_variable {\n color: rgb(49, 132, 149);\n}\n\n.ace-tm .ace_xml-pe {\n color: rgb(104, 104, 91);\n}\n\n.ace-tm .ace_entity.ace_name.ace_function {\n color: #0000A2;\n}\n\n\n.ace-tm .ace_heading {\n color: rgb(12, 7, 255);\n}\n\n.ace-tm .ace_list {\n color:rgb(185, 6, 144);\n}\n\n.ace-tm .ace_meta.ace_tag {\n color:rgb(0, 22, 142);\n}\n\n.ace-tm .ace_string.ace_regex {\n color: rgb(255, 0, 0)\n}\n\n.ace-tm .ace_marker-layer .ace_selection {\n background: rgb(181, 213, 255);\n}\n.ace-tm.ace_multiselect .ace_selection.ace_start {\n box-shadow: 0 0 3px 0px white;\n}\n.ace-tm .ace_marker-layer .ace_step {\n background: rgb(252, 255, 0);\n}\n\n.ace-tm .ace_marker-layer .ace_stack {\n background: rgb(164, 229, 101);\n}\n\n.ace-tm .ace_marker-layer .ace_bracket {\n margin: -1px 0 0 -1px;\n border: 1px solid rgb(192, 192, 192);\n}\n\n.ace-tm .ace_marker-layer .ace_active-line {\n background: rgba(0, 0, 0, 0.07);\n}\n\n.ace-tm .ace_gutter-active-line {\n background-color : #dcdcdc;\n}\n\n.ace-tm .ace_marker-layer .ace_selected-word {\n background: rgb(250, 250, 255);\n border: 1px solid rgb(200, 200, 250);\n}\n\n.ace-tm .ace_indent-guide {\n background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;\n}\n\n.ace-tm .ace_indent-guide-active {\n background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAZSURBVHjaYvj///9/hivKyv8BAAAA//8DACLqBhbvk+/eAAAAAElFTkSuQmCC") right repeat-y;\n}\n'})),ace.define("ace/theme/textmate",["require","exports","module","ace/theme/textmate-css","ace/lib/dom"],(function(e,t,n){"use strict";t.isDark=!1,t.cssClass="ace-tm",t.cssText=e("./textmate-css"),t.$id="ace/theme/textmate",e("../lib/dom").importCssString(t.cssText,t.cssClass,!1)})),ace.define("ace/config",["require","exports","module","ace/lib/lang","ace/lib/net","ace/lib/dom","ace/lib/app_config","ace/theme/textmate"],(function(e,t,n){var i=e("./lib/lang"),o=e("./lib/net"),r=e("./lib/dom"),s=e("./lib/app_config").AppConfig;n.exports=t=new s;var a,l={packaged:!1,workerPath:null,modePath:null,themePath:null,basePath:"",suffix:".js",$moduleUrls:{},loadWorkerFromBlob:!0,sharedPopups:!1,useStrictCSP:null};t.get=function(e){if(!l.hasOwnProperty(e))throw new Error("Unknown config key: "+e);return l[e]},t.set=function(e,t){if(l.hasOwnProperty(e))l[e]=t;else if(0==this.setDefaultValue("",e,t))throw new Error("Unknown config key: "+e);"useStrictCSP"==e&&r.useStrictCSP(t)},t.all=function(){return i.copyObject(l)},t.$modes={},t.moduleUrl=function(e,t){if(l.$moduleUrls[e])return l.$moduleUrls[e];var n=e.split("/"),i="snippets"==(t=t||n[n.length-2]||"")?"/":"-",o=n[n.length-1];if("worker"==t&&"-"==i){var r=new RegExp("^"+t+"[\\-_]|[\\-_]"+t+"$","g");o=o.replace(r,"")}(!o||o==t)&&n.length>1&&(o=n[n.length-2]);var s=l[t+"Path"];return null==s?s=l.basePath:"/"==i&&(t=i=""),s&&"/"!=s.slice(-1)&&(s+="/"),s+t+i+o+this.get("suffix")},t.setModuleUrl=function(e,t){return l.$moduleUrls[e]=t},t.setLoader=function(e){a=e},t.dynamicModules=Object.create(null),t.$loading={},t.$loaded={},t.loadModule=function(n,i){var r,s;Array.isArray(n)&&(s=n[0],n=n[1]);var l=function(r){if(r&&!t.$loading[n])return i&&i(r);if(t.$loading[n]||(t.$loading[n]=[]),t.$loading[n].push(i),!(t.$loading[n].length>1)){var l=function(){!function(t,n){"ace/theme/textmate"===t||"./theme/textmate"===t?n(0,e("./theme/textmate")):a?a(t,n):console.error("loader is not configured")}(n,(function(e,i){i&&(t.$loaded[n]=i),t._emit("load.module",{name:n,module:i});var o=t.$loading[n];t.$loading[n]=null,o.forEach((function(e){e&&e(i)}))}))};if(!t.get("packaged"))return l();o.loadScript(t.moduleUrl(n,s),l),c()}};if(t.dynamicModules[n])t.dynamicModules[n]().then((function(e){e.default?l(e.default):l(e)}));else{try{r=this.$require(n)}catch(e){}l(r||t.$loaded[n])}},t.$require=function(e){if("function"==typeof n.require)return n.require(e)},t.setModuleLoader=function(e,n){t.dynamicModules[e]=n};var c=function(){l.basePath||l.workerPath||l.modePath||l.themePath||Object.keys(l.$moduleUrls).length||(console.error("Unable to infer path to ace from script src,","use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes","or with webpack use ace/webpack-resolver"),c=function(){})};t.version="1.24.1"})),ace.define("ace/loader_build",["require","exports","module","ace/lib/fixoldbrowsers","ace/config"],(function(e,t,i){"use strict";e("./lib/fixoldbrowsers");var o=e("./config");o.setLoader((function(t,n){e([t],(function(e){n(null,e)}))}));var r=function(){return this||"undefined"!=typeof window&&window}();function s(t){if(r&&r.document){o.set("packaged",t||e.packaged||i.packaged||r.define&&n.amdD.packaged);var s={},a="",l=document.currentScript||document._currentScript,c=l&&l.ownerDocument||document;l&&l.src&&(a=l.src.split(/[?#]/)[0].split("/").slice(0,-1).join("/")||"");for(var h,d=c.getElementsByTagName("script"),u=0;u<d.length;u++){var p=d[u],g=p.src||p.getAttribute("src");if(g){for(var f=p.attributes,m=0,v=f.length;m<v;m++){var w=f[m];0===w.name.indexOf("data-ace-")&&(s[(h=w.name.replace(/^data-ace-/,""),h.replace(/-(.)/g,(function(e,t){return t.toUpperCase()})))]=w.value)}var b=g.match(/^(.*)\/ace([\-.]\w+)?\.js(\?|$)/);b&&(a=b[1])}}for(var y in a&&(s.base=s.base||a,s.packaged=!0),s.basePath=s.base,s.workerPath=s.workerPath||s.base,s.modePath=s.modePath||s.base,s.themePath=s.themePath||s.base,delete s.base,s)void 0!==s[y]&&o.set(y,s[y])}}i.exports=function(t){o.init=s,o.$require=e,t.require=e,t.define=n.amdD},s(!0)})),ace.define("ace/range",["require","exports","module"],(function(e,t,n){"use strict";var i=function(){function e(e,t,n,i){this.start={row:e,column:t},this.end={row:n,column:i}}return e.prototype.isEqual=function(e){return this.start.row===e.start.row&&this.end.row===e.end.row&&this.start.column===e.start.column&&this.end.column===e.end.column},e.prototype.toString=function(){return"Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]"},e.prototype.contains=function(e,t){return 0==this.compare(e,t)},e.prototype.compareRange=function(e){var t,n=e.end,i=e.start;return 1==(t=this.compare(n.row,n.column))?1==(t=this.compare(i.row,i.column))?2:0==t?1:0:-1==t?-2:-1==(t=this.compare(i.row,i.column))?-1:1==t?42:0},e.prototype.comparePoint=function(e){return this.compare(e.row,e.column)},e.prototype.containsRange=function(e){return 0==this.comparePoint(e.start)&&0==this.comparePoint(e.end)},e.prototype.intersects=function(e){var t=this.compareRange(e);return-1==t||0==t||1==t},e.prototype.isEnd=function(e,t){return this.end.row==e&&this.end.column==t},e.prototype.isStart=function(e,t){return this.start.row==e&&this.start.column==t},e.prototype.setStart=function(e,t){"object"==typeof e?(this.start.column=e.column,this.start.row=e.row):(this.start.row=e,this.start.column=t)},e.prototype.setEnd=function(e,t){"object"==typeof e?(this.end.column=e.column,this.end.row=e.row):(this.end.row=e,this.end.column=t)},e.prototype.inside=function(e,t){return 0==this.compare(e,t)&&!this.isEnd(e,t)&&!this.isStart(e,t)},e.prototype.insideStart=function(e,t){return 0==this.compare(e,t)&&!this.isEnd(e,t)},e.prototype.insideEnd=function(e,t){return 0==this.compare(e,t)&&!this.isStart(e,t)},e.prototype.compare=function(e,t){return this.isMultiLine()||e!==this.start.row?e<this.start.row?-1:e>this.end.row?1:this.start.row===e?t>=this.start.column?0:-1:this.end.row===e?t<=this.end.column?0:1:0:t<this.start.column?-1:t>this.end.column?1:0},e.prototype.compareStart=function(e,t){return this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},e.prototype.compareEnd=function(e,t){return this.end.row==e&&this.end.column==t?1:this.compare(e,t)},e.prototype.compareInside=function(e,t){return this.end.row==e&&this.end.column==t?1:this.start.row==e&&this.start.column==t?-1:this.compare(e,t)},e.prototype.clipRows=function(t,n){if(this.end.row>n)var i={row:n+1,column:0};else this.end.row<t&&(i={row:t,column:0});if(this.start.row>n)var o={row:n+1,column:0};else this.start.row<t&&(o={row:t,column:0});return e.fromPoints(o||this.start,i||this.end)},e.prototype.extend=function(t,n){var i=this.compare(t,n);if(0==i)return this;if(-1==i)var o={row:t,column:n};else var r={row:t,column:n};return e.fromPoints(o||this.start,r||this.end)},e.prototype.isEmpty=function(){return this.start.row===this.end.row&&this.start.column===this.end.column},e.prototype.isMultiLine=function(){return this.start.row!==this.end.row},e.prototype.clone=function(){return e.fromPoints(this.start,this.end)},e.prototype.collapseRows=function(){return 0==this.end.column?new e(this.start.row,0,Math.max(this.start.row,this.end.row-1),0):new e(this.start.row,0,this.end.row,0)},e.prototype.toScreenRange=function(t){var n=t.documentToScreenPosition(this.start),i=t.documentToScreenPosition(this.end);return new e(n.row,n.column,i.row,i.column)},e.prototype.moveBy=function(e,t){this.start.row+=e,this.start.column+=t,this.end.row+=e,this.end.column+=t},e}();i.fromPoints=function(e,t){return new i(e.row,e.column,t.row,t.column)},i.comparePoints=function(e,t){return e.row-t.row||e.column-t.column},i.comparePoints=function(e,t){return e.row-t.row||e.column-t.column},t.Range=i})),ace.define("ace/lib/keys",["require","exports","module","ace/lib/oop"],(function(e,t,n){"use strict";var i=e("./oop"),o=function(){var e,t,n={MODIFIER_KEYS:{16:"Shift",17:"Ctrl",18:"Alt",224:"Meta",91:"MetaLeft",92:"MetaRight",93:"ContextMenu"},KEY_MODS:{ctrl:1,alt:2,option:2,shift:4,super:8,meta:8,command:8,cmd:8,control:1},FUNCTION_KEYS:{8:"Backspace",9:"Tab",13:"Return",19:"Pause",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"Print",45:"Insert",46:"Delete",96:"Numpad0",97:"Numpad1",98:"Numpad2",99:"Numpad3",100:"Numpad4",101:"Numpad5",102:"Numpad6",103:"Numpad7",104:"Numpad8",105:"Numpad9","-13":"NumpadEnter",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"Numlock",145:"Scrolllock"},PRINTABLE_KEYS:{32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"a",66:"b",67:"c",68:"d",69:"e",70:"f",71:"g",72:"h",73:"i",74:"j",75:"k",76:"l",77:"m",78:"n",79:"o",80:"p",81:"q",82:"r",83:"s",84:"t",85:"u",86:"v",87:"w",88:"x",89:"y",90:"z",107:"+",109:"-",110:".",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",111:"/",106:"*"}};for(t in n.PRINTABLE_KEYS[173]="-",n.FUNCTION_KEYS)e=n.FUNCTION_KEYS[t].toLowerCase(),n[e]=parseInt(t,10);for(t in n.PRINTABLE_KEYS)e=n.PRINTABLE_KEYS[t].toLowerCase(),n[e]=parseInt(t,10);return i.mixin(n,n.MODIFIER_KEYS),i.mixin(n,n.PRINTABLE_KEYS),i.mixin(n,n.FUNCTION_KEYS),n.enter=n.return,n.escape=n.esc,n.del=n.delete,function(){for(var e=["cmd","ctrl","alt","shift"],t=Math.pow(2,e.length);t--;)n.KEY_MODS[t]=e.filter((function(e){return t&n.KEY_MODS[e]})).join("-")+"-"}(),n.KEY_MODS[0]="",n.KEY_MODS[-1]="input-",n}();i.mixin(t,o),t.default=t,t.keyCodeToString=function(e){var t=o[e];return"string"!=typeof t&&(t=String.fromCharCode(e)),t.toLowerCase()}})),ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],(function(e,t,n){"use strict";var i,o=e("./keys"),r=e("./useragent"),s=null,a=0;function l(){return null==i&&function(){i=!1;try{document.createComment("").addEventListener("test",(function(){}),{get passive(){i={passive:!1}}})}catch(e){}}(),i}function c(e,t,n){this.elem=e,this.type=t,this.callback=n}c.prototype.destroy=function(){d(this.elem,this.type,this.callback),this.elem=this.type=this.callback=void 0};var h=t.addListener=function(e,t,n,i){e.addEventListener(t,n,l()),i&&i.$toDestroy.push(new c(e,t,n))},d=t.removeListener=function(e,t,n){e.removeEventListener(t,n,l())};t.stopEvent=function(e){return t.stopPropagation(e),t.preventDefault(e),!1},t.stopPropagation=function(e){e.stopPropagation&&e.stopPropagation()},t.preventDefault=function(e){e.preventDefault&&e.preventDefault()},t.getButton=function(e){return"dblclick"==e.type?0:"contextmenu"==e.type||r.isMac&&e.ctrlKey&&!e.altKey&&!e.shiftKey?2:e.button},t.capture=function(e,t,n){var i=e&&e.ownerDocument||document;function o(e){t&&t(e),n&&n(e),d(i,"mousemove",t),d(i,"mouseup",o),d(i,"dragstart",o)}return h(i,"mousemove",t),h(i,"mouseup",o),h(i,"dragstart",o),o},t.addMouseWheelListener=function(e,t,n){h(e,"wheel",(function(e){var n=e.deltaX||0,i=e.deltaY||0;switch(e.deltaMode){case e.DOM_DELTA_PIXEL:e.wheelX=.15*n,e.wheelY=.15*i;break;case e.DOM_DELTA_LINE:e.wheelX=15*n,e.wheelY=15*i;break;case e.DOM_DELTA_PAGE:e.wheelX=150*n,e.wheelY=150*i}t(e)}),n)},t.addMultiMouseDownListener=function(e,n,i,o,s){var a,l,c,d=0,u={2:"dblclick",3:"tripleclick",4:"quadclick"};function p(e){if(0!==t.getButton(e)?d=0:e.detail>1?++d>4&&(d=1):d=1,r.isIE){var s=Math.abs(e.clientX-a)>5||Math.abs(e.clientY-l)>5;c&&!s||(d=1),c&&clearTimeout(c),c=setTimeout((function(){c=null}),n[d-1]||600),1==d&&(a=e.clientX,l=e.clientY)}if(e._clicks=d,i[o]("mousedown",e),d>4)d=0;else if(d>1)return i[o](u[d],e)}Array.isArray(e)||(e=[e]),e.forEach((function(e){h(e,"mousedown",p,s)}))};var u=function(e){return 0|(e.ctrlKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.metaKey?8:0)};function p(e,t,n){var i=u(t);if(!r.isMac&&s){if(t.getModifierState&&(t.getModifierState("OS")||t.getModifierState("Win"))&&(i|=8),s.altGr){if(3==(3&i))return;s.altGr=0}if(18===n||17===n){var l="location"in t?t.location:t.keyLocation;17===n&&1===l?1==s[n]&&(a=t.timeStamp):18===n&&3===i&&2===l&&t.timeStamp-a<50&&(s.altGr=!0)}}if(n in o.MODIFIER_KEYS&&(n=-1),i||13!==n||3!==(l="location"in t?t.location:t.keyLocation)||(e(t,i,-n),!t.defaultPrevented)){if(r.isChromeOS&&8&i){if(e(t,i,n),t.defaultPrevented)return;i&=-9}return!!(i||n in o.FUNCTION_KEYS||n in o.PRINTABLE_KEYS)&&e(t,i,n)}}function g(){s=Object.create(null)}if(t.getModifierString=function(e){return o.KEY_MODS[u(e)]},t.addCommandKeyListener=function(e,n,i){if(r.isOldGecko||r.isOpera&&!("KeyboardEvent"in window)){var o=null;h(e,"keydown",(function(e){o=e.keyCode}),i),h(e,"keypress",(function(e){return p(n,e,o)}),i)}else{var a=null;h(e,"keydown",(function(e){s[e.keyCode]=(s[e.keyCode]||0)+1;var t=p(n,e,e.keyCode);return a=e.defaultPrevented,t}),i),h(e,"keypress",(function(e){a&&(e.ctrlKey||e.altKey||e.shiftKey||e.metaKey)&&(t.stopEvent(e),a=null)}),i),h(e,"keyup",(function(e){s[e.keyCode]=null}),i),s||(g(),h(window,"focus",g))}},"object"==typeof window&&window.postMessage&&!r.isOldIE){var f=1;t.nextTick=function(e,n){n=n||window;var i="zero-timeout-message-"+f++,o=function(r){r.data==i&&(t.stopPropagation(r),d(n,"message",o),e())};h(n,"message",o),n.postMessage(i,"*")}}t.$idleBlocked=!1,t.onIdle=function(e,n){return setTimeout((function n(){t.$idleBlocked?setTimeout(n,100):e()}),n)},t.$idleBlockId=null,t.blockIdle=function(e){t.$idleBlockId&&clearTimeout(t.$idleBlockId),t.$idleBlocked=!0,t.$idleBlockId=setTimeout((function(){t.$idleBlocked=!1}),e||100)},t.nextFrame="object"==typeof window&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame),t.nextFrame?t.nextFrame=t.nextFrame.bind(window):t.nextFrame=function(e){setTimeout(e,17)}})),ace.define("ace/clipboard",["require","exports","module"],(function(e,t,n){"use strict";var i;n.exports={lineMode:!1,pasteCancelled:function(){return!!(i&&i>Date.now()-50)||(i=!1)},cancel:function(){i=Date.now()}}})),ace.define("ace/keyboard/textinput",["require","exports","module","ace/lib/event","ace/config","ace/lib/useragent","ace/lib/dom","ace/lib/lang","ace/clipboard","ace/lib/keys"],(function(e,t,n){"use strict";var i=e("../lib/event"),o=e("../config").nls,r=e("../lib/useragent"),s=e("../lib/dom"),a=e("../lib/lang"),l=e("../clipboard"),c=r.isChrome<18,h=r.isIE,d=r.isChrome>63,u=400,p=e("../lib/keys"),g=p.KEY_MODS,f=r.isIOS,m=f?/\s/:/\n/,v=r.isMobile;t.TextInput=function(e,t){var n=s.createElement("textarea");n.className="ace_text-input",n.setAttribute("wrap","off"),n.setAttribute("autocorrect","off"),n.setAttribute("autocapitalize","off"),n.setAttribute("spellcheck",!1),n.style.opacity="0",e.insertBefore(n,e.firstChild);var w=!1,b=!1,y=!1,C=!1,$="";v||(n.style.fontSize="1px");var x=!1,_=!1,S="",E=0,k=0,A=0,L=Number.MAX_SAFE_INTEGER,M=Number.MIN_SAFE_INTEGER,T=0;try{var R=document.activeElement===n}catch(e){}this.setNumberOfExtraLines=function(e){L=Number.MAX_SAFE_INTEGER,M=Number.MIN_SAFE_INTEGER,T=e<0?0:e},this.setAriaOptions=function(e){if(e.activeDescendant?(n.setAttribute("aria-haspopup","true"),n.setAttribute("aria-autocomplete",e.inline?"both":"list"),n.setAttribute("aria-activedescendant",e.activeDescendant)):(n.setAttribute("aria-haspopup","false"),n.setAttribute("aria-autocomplete","both"),n.removeAttribute("aria-activedescendant")),e.role&&n.setAttribute("role",e.role),e.setLabel&&(n.setAttribute("aria-roledescription",o("editor")),t.session)){var i=t.session.selection.cursor.row;n.setAttribute("aria-label",o("Cursor at row $0",[i+1]))}},this.setAriaOptions({role:"textbox"}),i.addListener(n,"blur",(function(e){_||(t.onBlur(e),R=!1)}),t),i.addListener(n,"focus",(function(e){if(!_){if(R=!0,r.isEdge)try{if(!document.hasFocus())return}catch(e){}t.onFocus(e),r.isEdge?setTimeout(O):O()}}),t),this.$focusScroll=!1,this.focus=function(){if(this.setAriaOptions({setLabel:t.renderer.enableKeyboardAccessibility}),$||d||"browser"==this.$focusScroll)return n.focus({preventScroll:!0});var e=n.style.top;n.style.position="fixed",n.style.top="0px";try{var i=0!=n.getBoundingClientRect().top}catch(e){return}var o=[];if(i)for(var r=n.parentElement;r&&1==r.nodeType;)o.push(r),r.setAttribute("ace_nocontext",!0),r=!r.parentElement&&r.getRootNode?r.getRootNode().host:r.parentElement;n.focus({preventScroll:!0}),i&&o.forEach((function(e){e.removeAttribute("ace_nocontext")})),setTimeout((function(){n.style.position="","0px"==n.style.top&&(n.style.top=e)}),0)},this.blur=function(){n.blur()},this.isFocused=function(){return R},t.on("beforeEndOperation",(function(){var e=t.curOp,i=e&&e.command&&e.command.name;if("insertstring"!=i){var o=i&&(e.docChanged||e.selectionChanged);y&&o&&(S=n.value="",U()),O()}}));var I=function(e,n){for(var i=n,o=1;o<=e-L&&o<2*T+1;o++)i+=t.session.getLine(e-o).length+1;return i},O=f?function(e){if(R&&(!w||e)&&!C){e||(e="");var i="\n ab"+e+"cde fg\n";i!=n.value&&(n.value=S=i);var o=4+(e.length||(t.selection.isEmpty()?0:1));4==E&&k==o||n.setSelectionRange(4,o),E=4,k=o}}:function(){if(!y&&!C&&(R||D)){y=!0;var e=0,i=0,o="";if(t.session){var r=t.selection,s=r.getRange(),a=r.cursor.row;a===M+1?M=(L=M+1)+2*T:a===L-1?L=(M=L-1)-2*T:(a<L-1||a>M+1)&&(L=a>T?a-T:0,M=a>T?a+T:2*T);for(var l=[],c=L;c<=M;c++)l.push(t.session.getLine(c));if(o=l.join("\n"),e=I(s.start.row,s.start.column),i=I(s.end.row,s.end.column),s.start.row<L){var h=t.session.getLine(L-1);e=s.start.row<L-1?0:e,i+=h.length+1,o=h+"\n"+o}else if(s.end.row>M){var d=t.session.getLine(M+1);i=s.end.row>M+1?d.length:s.end.column,i+=o.length+1,o=o+"\n"+d}else v&&a>0&&(o="\n"+o,i+=1,e+=1);o.length>u&&(e<u&&i<u?o=o.slice(0,u):(o="\n",e==i?e=i=0:(e=0,i=1)));var p=o+"\n\n";p!=S&&(n.value=S=p,E=k=p.length)}if(D&&(E=n.selectionStart,k=n.selectionEnd),k!=i||E!=e||n.selectionEnd!=k)try{n.setSelectionRange(e,i),E=e,k=i}catch(e){}y=!1}};this.resetSelection=O,R&&t.onFocus();var N=null;this.setInputHandler=function(e){N=e},this.getInputHandler=function(){return N};var D=!1,P=function(e,i){if(D&&(D=!1),b)return O(),e&&t.onPaste(e),b=!1,"";for(var o=n.selectionStart,s=n.selectionEnd,a=E,l=S.length-k,c=e,h=e.length-o,d=e.length-s,u=0;a>0&&S[u]==e[u];)u++,a--;for(c=c.slice(u),u=1;l>0&&S.length-u>E-1&&S[S.length-u]==e[e.length-u];)u++,l--;h-=u-1,d-=u-1;var p=c.length-u+1;if(p<0&&(a=-p,p=0),c=c.slice(0,p),!(i||c||h||a||l||d))return"";C=!0;var g=!1;return r.isAndroid&&". "==c&&(c=" ",g=!0),c&&!a&&!l&&!h&&!d||x?t.onTextInput(c):t.onTextInput(c,{extendLeft:a,extendRight:l,restoreStart:h,restoreEnd:d}),C=!1,S=e,E=o,k=s,A=d,g?"\n":c},F=function(e){if(y)return j();if(e&&e.inputType){if("historyUndo"==e.inputType)return t.execCommand("undo");if("historyRedo"==e.inputType)return t.execCommand("redo")}var i=n.value,o=P(i,!0);(i.length>500||m.test(o)||v&&E<1&&E==k)&&O()},H=function(e,t,n){var i=e.clipboardData||window.clipboardData;if(i&&!c){var o=h||n?"Text":"text/plain";try{return t?!1!==i.setData(o,t):i.getData(o)}catch(e){if(!n)return H(e,t,!0)}}},B=function(e,o){var r=t.getCopyText();if(!r)return i.preventDefault(e);H(e,r)?(f&&(O(r),w=r,setTimeout((function(){w=!1}),10)),o?t.onCut():t.onCopy(),i.preventDefault(e)):(w=!0,n.value=r,n.select(),setTimeout((function(){w=!1,O(),o?t.onCut():t.onCopy()})))},W=function(e){B(e,!0)},z=function(e){B(e,!1)},V=function(e){var o=H(e);l.pasteCancelled()||("string"==typeof o?(o&&t.onPaste(o,e),r.isIE&&setTimeout(O),i.preventDefault(e)):(n.value="",b=!0))};i.addCommandKeyListener(n,t.onCommandKey.bind(t),t),i.addListener(n,"select",(function(e){y||(w?w=!1:function(e){return 0===e.selectionStart&&e.selectionEnd>=S.length&&e.value===S&&S&&e.selectionEnd!==k}(n)?(t.selectAll(),O()):v&&n.selectionStart!=E&&O())}),t),i.addListener(n,"input",F,t),i.addListener(n,"cut",W,t),i.addListener(n,"copy",z,t),i.addListener(n,"paste",V,t),"oncut"in n&&"oncopy"in n&&"onpaste"in n||i.addListener(e,"keydown",(function(e){if((!r.isMac||e.metaKey)&&e.ctrlKey)switch(e.keyCode){case 67:z(e);break;case 86:V(e);break;case 88:W(e)}}),t);var j=function(){if(y&&t.onCompositionUpdate&&!t.$readOnly){if(x)return G();if(y.useTextareaForIME)t.onCompositionUpdate(n.value);else{var e=n.value;P(e),y.markerRange&&(y.context&&(y.markerRange.start.column=y.selectionStart=y.context.compositionStartOffset),y.markerRange.end.column=y.markerRange.start.column+k-y.selectionStart+A)}}},U=function(e){t.onCompositionEnd&&!t.$readOnly&&(y=!1,t.onCompositionEnd(),t.off("mousedown",G),e&&F())};function G(){_=!0,n.blur(),n.focus(),_=!1}var K,Z=a.delayedCall(j,50).schedule.bind(null,null);function q(){clearTimeout(K),K=setTimeout((function(){$&&(n.style.cssText=$,$=""),t.renderer.$isMousePressed=!1,t.renderer.$keepTextAreaAtCursor&&t.renderer.$moveTextAreaToCursor()}),0)}i.addListener(n,"compositionstart",(function(e){if(!y&&t.onCompositionStart&&!t.$readOnly&&(y={},!x)){e.data&&(y.useTextareaForIME=!1),setTimeout(j,0),t._signal("compositionStart"),t.on("mousedown",G);var i=t.getSelectionRange();i.end.row=i.start.row,i.end.column=i.start.column,y.markerRange=i,y.selectionStart=E,t.onCompositionStart(y),y.useTextareaForIME?(S=n.value="",E=0,k=0):(n.msGetInputContext&&(y.context=n.msGetInputContext()),n.getInputContext&&(y.context=n.getInputContext()))}}),t),i.addListener(n,"compositionupdate",j,t),i.addListener(n,"keyup",(function(e){27==e.keyCode&&n.value.length<n.selectionStart&&(y||(S=n.value),E=k=-1,O()),Z()}),t),i.addListener(n,"keydown",Z,t),i.addListener(n,"compositionend",U,t),this.getElement=function(){return n},this.setCommandMode=function(e){x=e,n.readOnly=!1},this.setReadOnly=function(e){x||(n.readOnly=e)},this.setCopyWithEmptySelection=function(e){},this.onContextMenu=function(e){D=!0,O(),t._emit("nativecontextmenu",{target:t,domEvent:e}),this.moveToMouse(e,!0)},this.moveToMouse=function(e,o){$||($=n.style.cssText),n.style.cssText=(o?"z-index:100000;":"")+(r.isIE?"opacity:0.1;":"")+"text-indent: -"+(E+k)*t.renderer.characterWidth*.5+"px;";var a=t.container.getBoundingClientRect(),l=s.computedStyle(t.container),c=a.top+(parseInt(l.borderTopWidth)||0),h=a.left+(parseInt(a.borderLeftWidth)||0),d=a.bottom-c-n.clientHeight-2,u=function(e){s.translate(n,e.clientX-h-2,Math.min(e.clientY-c-2,d))};u(e),"mousedown"==e.type&&(t.renderer.$isMousePressed=!0,clearTimeout(K),r.isWin&&i.capture(t.container,u,q))},this.onContextMenuClose=q;var Y=function(e){t.textInput.onContextMenu(e),q()};i.addListener(n,"mouseup",Y,t),i.addListener(n,"mousedown",(function(e){e.preventDefault(),q()}),t),i.addListener(t.renderer.scroller,"contextmenu",Y,t),i.addListener(n,"contextmenu",Y,t),f&&function(e,t,n){var i=null,o=!1;n.addEventListener("keydown",(function(e){i&&clearTimeout(i),o=!0}),!0),n.addEventListener("keyup",(function(e){i=setTimeout((function(){o=!1}),100)}),!0);var r=function(e){if(document.activeElement===n&&!(o||y||t.$mouseHandler.isMousePressed||w)){var i=n.selectionStart,r=n.selectionEnd,s=null,a=0;if(0==i?s=p.up:1==i?s=p.home:r>k&&"\n"==S[r]?s=p.end:i<E&&" "==S[i-1]?(s=p.left,a=g.option):i<E||i==E&&k!=E&&i==r?s=p.left:r>k&&S.slice(0,r).split("\n").length>2?s=p.down:r>k&&" "==S[r-1]?(s=p.right,a=g.option):(r>k||r==k&&k!=E&&i==r)&&(s=p.right),i!==r&&(a|=g.shift),s){if(!t.onCommandKey({},a,s)&&t.commands){s=p.keyCodeToString(s);var l=t.commands.findKeyCommand(a,s);l&&t.execCommand(l)}E=i,k=r,O("")}}};document.addEventListener("selectionchange",r),t.on("destroy",(function(){document.removeEventListener("selectionchange",r)}))}(0,t,n),this.destroy=function(){n.parentElement&&n.parentElement.removeChild(n)}},t.$setUserAgentForTests=function(e,t){v=e,f=t}})),ace.define("ace/mouse/default_handlers",["require","exports","module","ace/lib/useragent"],(function(e,t,n){"use strict";var i=e("../lib/useragent"),o=function(){function e(e){e.$clickSelection=null;var t=e.editor;t.setDefaultHandler("mousedown",this.onMouseDown.bind(e)),t.setDefaultHandler("dblclick",this.onDoubleClick.bind(e)),t.setDefaultHandler("tripleclick",this.onTripleClick.bind(e)),t.setDefaultHandler("quadclick",this.onQuadClick.bind(e)),t.setDefaultHandler("mousewheel",this.onMouseWheel.bind(e)),["select","startSelect","selectEnd","selectAllEnd","selectByWordsEnd","selectByLinesEnd","dragWait","dragWaitEnd","focusWait"].forEach((function(t){e[t]=this[t]}),this),e.selectByLines=this.extendSelectionBy.bind(e,"getLineRange"),e.selectByWords=this.extendSelectionBy.bind(e,"getWordRange")}return e.prototype.onMouseDown=function(e){var t=e.inSelection(),n=e.getDocumentPosition();this.mousedownEvent=e;var o=this.editor,r=e.getButton();return 0!==r?((o.getSelectionRange().isEmpty()||1==r)&&o.selection.moveToPosition(n),void(2==r&&(o.textInput.onContextMenu(e.domEvent),i.isMozilla||e.preventDefault()))):(this.mousedownEvent.time=Date.now(),!t||o.isFocused()||(o.focus(),!this.$focusTimeout||this.$clickSelection||o.inMultiSelectMode)?(this.captureMouse(e),this.startSelect(n,e.domEvent._clicks>1),e.preventDefault()):(this.setState("focusWait"),void this.captureMouse(e)))},e.prototype.startSelect=function(e,t){e=e||this.editor.renderer.screenToTextCoordinates(this.x,this.y);var n=this.editor;this.mousedownEvent&&(this.mousedownEvent.getShiftKey()?n.selection.selectToPosition(e):t||n.selection.moveToPosition(e),t||this.select(),n.setStyle("ace_selecting"),this.setState("select"))},e.prototype.select=function(){var e,t=this.editor,n=t.renderer.screenToTextCoordinates(this.x,this.y);if(this.$clickSelection){var i=this.$clickSelection.comparePoint(n);if(-1==i)e=this.$clickSelection.end;else if(1==i)e=this.$clickSelection.start;else{var o=r(this.$clickSelection,n);n=o.cursor,e=o.anchor}t.selection.setSelectionAnchor(e.row,e.column)}t.selection.selectToPosition(n),t.renderer.scrollCursorIntoView()},e.prototype.extendSelectionBy=function(e){var t,n=this.editor,i=n.renderer.screenToTextCoordinates(this.x,this.y),o=n.selection[e](i.row,i.column);if(this.$clickSelection){var s=this.$clickSelection.comparePoint(o.start),a=this.$clickSelection.comparePoint(o.end);if(-1==s&&a<=0)t=this.$clickSelection.end,o.end.row==i.row&&o.end.column==i.column||(i=o.start);else if(1==a&&s>=0)t=this.$clickSelection.start,o.start.row==i.row&&o.start.column==i.column||(i=o.end);else if(-1==s&&1==a)i=o.end,t=o.start;else{var l=r(this.$clickSelection,i);i=l.cursor,t=l.anchor}n.selection.setSelectionAnchor(t.row,t.column)}n.selection.selectToPosition(i),n.renderer.scrollCursorIntoView()},e.prototype.selectByLinesEnd=function(){this.$clickSelection=null,this.editor.unsetStyle("ace_selecting")},e.prototype.focusWait=function(){var e,t,n,i,o=(e=this.mousedownEvent.x,t=this.mousedownEvent.y,n=this.x,i=this.y,Math.sqrt(Math.pow(n-e,2)+Math.pow(i-t,2))),r=Date.now();(o>0||r-this.mousedownEvent.time>this.$focusTimeout)&&this.startSelect(this.mousedownEvent.getDocumentPosition())},e.prototype.onDoubleClick=function(e){var t=e.getDocumentPosition(),n=this.editor,i=n.session.getBracketRange(t);i?(i.isEmpty()&&(i.start.column--,i.end.column++),this.setState("select")):(i=n.selection.getWordRange(t.row,t.column),this.setState("selectByWords")),this.$clickSelection=i,this.select()},e.prototype.onTripleClick=function(e){var t=e.getDocumentPosition(),n=this.editor;this.setState("selectByLines");var i=n.getSelectionRange();i.isMultiLine()&&i.contains(t.row,t.column)?(this.$clickSelection=n.selection.getLineRange(i.start.row),this.$clickSelection.end=n.selection.getLineRange(i.end.row).end):this.$clickSelection=n.selection.getLineRange(t.row),this.select()},e.prototype.onQuadClick=function(e){var t=this.editor;t.selectAll(),this.$clickSelection=t.getSelectionRange(),this.setState("selectAll")},e.prototype.onMouseWheel=function(e){if(!e.getAccelKey()){e.getShiftKey()&&e.wheelY&&!e.wheelX&&(e.wheelX=e.wheelY,e.wheelY=0);var t=this.editor;this.$lastScroll||(this.$lastScroll={t:0,vx:0,vy:0,allowed:0});var n=this.$lastScroll,i=e.domEvent.timeStamp,o=i-n.t,r=o?e.wheelX/o:n.vx,s=o?e.wheelY/o:n.vy;o<550&&(r=(r+n.vx)/2,s=(s+n.vy)/2);var a=Math.abs(r/s),l=!1;return a>=1&&t.renderer.isScrollableBy(e.wheelX*e.speed,0)&&(l=!0),a<=1&&t.renderer.isScrollableBy(0,e.wheelY*e.speed)&&(l=!0),l?n.allowed=i:i-n.allowed<550&&(Math.abs(r)<=1.5*Math.abs(n.vx)&&Math.abs(s)<=1.5*Math.abs(n.vy)?(l=!0,n.allowed=i):n.allowed=0),n.t=i,n.vx=r,n.vy=s,l?(t.renderer.scrollBy(e.wheelX*e.speed,e.wheelY*e.speed),e.stop()):void 0}},e}();function r(e,t){if(e.start.row==e.end.row)var n=2*t.column-e.start.column-e.end.column;else if(e.start.row!=e.end.row-1||e.start.column||e.end.column)n=2*t.row-e.start.row-e.end.row;else n=t.column-4;return n<0?{cursor:e.start,anchor:e.end}:{cursor:e.end,anchor:e.start}}o.prototype.selectEnd=o.prototype.selectByLinesEnd,o.prototype.selectAllEnd=o.prototype.selectByLinesEnd,o.prototype.selectByWordsEnd=o.prototype.selectByLinesEnd,t.DefaultHandlers=o})),ace.define("ace/tooltip",["require","exports","module","ace/lib/dom","ace/range"],(function(e,t,n){"use strict";var i,o=this&&this.__extends||(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),r=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},s=e("./lib/dom"),a=e("./range").Range,l="ace_tooltip",c=function(){function e(e){this.isOpen=!1,this.$element=null,this.$parentNode=e}return e.prototype.$init=function(){return this.$element=s.createElement("div"),this.$element.className=l,this.$element.style.display="none",this.$parentNode.appendChild(this.$element),this.$element},e.prototype.getElement=function(){return this.$element||this.$init()},e.prototype.setText=function(e){this.getElement().textContent=e},e.prototype.setHtml=function(e){this.getElement().innerHTML=e},e.prototype.setPosition=function(e,t){this.getElement().style.left=e+"px",this.getElement().style.top=t+"px"},e.prototype.setClassName=function(e){s.addCssClass(this.getElement(),e)},e.prototype.setTheme=function(e){this.$element.className=l+" "+(e.isDark?"ace_dark ":"")+(e.cssClass||"")},e.prototype.show=function(e,t,n){null!=e&&this.setText(e),null!=t&&null!=n&&this.setPosition(t,n),this.isOpen||(this.getElement().style.display="block",this.isOpen=!0)},e.prototype.hide=function(){this.isOpen&&(this.getElement().style.display="none",this.getElement().className=l,this.isOpen=!1)},e.prototype.getHeight=function(){return this.getElement().offsetHeight},e.prototype.getWidth=function(){return this.getElement().offsetWidth},e.prototype.destroy=function(){this.isOpen=!1,this.$element&&this.$element.parentNode&&this.$element.parentNode.removeChild(this.$element)},e}(),h=new(function(){function e(){this.popups=[]}return e.prototype.addPopup=function(e){this.popups.push(e),this.updatePopups()},e.prototype.removePopup=function(e){var t=this.popups.indexOf(e);-1!==t&&(this.popups.splice(t,1),this.updatePopups())},e.prototype.updatePopups=function(){var e,t,n,i;this.popups.sort((function(e,t){return t.priority-e.priority}));var o=[];try{for(var s=r(this.popups),a=s.next();!a.done;a=s.next()){var l=a.value,c=!0;try{for(var h=(n=void 0,r(o)),d=h.next();!d.done;d=h.next()){var u=d.value;if(this.doPopupsOverlap(u,l)){c=!1;break}}}catch(e){n={error:e}}finally{try{d&&!d.done&&(i=h.return)&&i.call(h)}finally{if(n)throw n.error}}c?o.push(l):l.hide()}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}},e.prototype.doPopupsOverlap=function(e,t){var n=e.getElement().getBoundingClientRect(),i=t.getElement().getBoundingClientRect();return n.left<i.right&&n.right>i.left&&n.top<i.bottom&&n.bottom>i.top},e}());t.popupManager=h,t.Tooltip=c;var d=function(e){function t(t){void 0===t&&(t=document.body);var n=e.call(this,t)||this;n.timeout=void 0,n.lastT=0,n.idleTime=350,n.lastEvent=void 0,n.onMouseOut=n.onMouseOut.bind(n),n.onMouseMove=n.onMouseMove.bind(n),n.waitForHover=n.waitForHover.bind(n),n.hide=n.hide.bind(n);var i=n.getElement();return i.style.whiteSpace="pre-wrap",i.style.pointerEvents="auto",i.addEventListener("mouseout",n.onMouseOut),i.tabIndex=-1,i.addEventListener("blur",function(){i.contains(document.activeElement)||this.hide()}.bind(n)),n}return o(t,e),t.prototype.addToEditor=function(e){e.on("mousemove",this.onMouseMove),e.on("mousedown",this.hide),e.renderer.getMouseEventTarget().addEventListener("mouseout",this.onMouseOut,!0)},t.prototype.removeFromEditor=function(e){e.off("mousemove",this.onMouseMove),e.off("mousedown",this.hide),e.renderer.getMouseEventTarget().removeEventListener("mouseout",this.onMouseOut,!0),this.timeout&&(clearTimeout(this.timeout),this.timeout=null)},t.prototype.onMouseMove=function(e,t){this.lastEvent=e,this.lastT=Date.now();var n=t.$mouseHandler.isMousePressed;if(this.isOpen){var i=this.lastEvent&&this.lastEvent.getDocumentPosition();this.range&&this.range.contains(i.row,i.column)&&!n&&!this.isOutsideOfText(this.lastEvent)||this.hide()}this.timeout||n||(this.lastEvent=e,this.timeout=setTimeout(this.waitForHover,this.idleTime))},t.prototype.waitForHover=function(){this.timeout&&clearTimeout(this.timeout);var e=Date.now()-this.lastT;this.idleTime-e>10?this.timeout=setTimeout(this.waitForHover,this.idleTime-e):(this.timeout=null,this.lastEvent&&!this.isOutsideOfText(this.lastEvent)&&this.$gatherData(this.lastEvent,this.lastEvent.editor))},t.prototype.isOutsideOfText=function(e){var t=e.editor,n=e.getDocumentPosition(),i=t.session.getLine(n.row);if(n.column==i.length){var o=t.renderer.pixelToScreenCoordinates(e.clientX,e.clientY),r=t.session.documentToScreenPosition(n.row,n.column);if(r.column!=o.column||r.row!=o.row)return!0}return!1},t.prototype.setDataProvider=function(e){this.$gatherData=e},t.prototype.showForRange=function(e,t,n,i){if(!(i&&i!=this.lastEvent||this.isOpen&&document.activeElement==this.getElement())){var o=e.renderer;this.isOpen||(h.addPopup(this),this.$registerCloseEvents(),this.setTheme(o.theme)),this.isOpen=!0,this.addMarker(t,e.session),this.range=a.fromPoints(t.start,t.end);var r=this.getElement();r.innerHTML="",r.appendChild(n),r.style.display="block";var s=o.textToScreenCoordinates(t.start.row,t.start.column),l=e.getCursorPosition(),c=r.clientHeight,d=o.scroller.getBoundingClientRect(),u=!0;this.row>l.row?u=!0:this.row<l.row&&(u=!1),s.pageY-c+o.lineHeight<d.top?u=!0:s.pageY+c>d.bottom&&(u=!1),u?s.pageY+=o.lineHeight:s.pageY-=c,r.style.maxWidth=d.width-(s.pageX-d.left)+"px",this.setPosition(s.pageX,s.pageY)}},t.prototype.addMarker=function(e,t){this.marker&&this.$markerSession.removeMarker(this.marker),this.$markerSession=t,this.marker=t&&t.addMarker(e,"ace_highlight-marker","text")},t.prototype.hide=function(e){(e||document.activeElement!=this.getElement())&&(e&&e.target&&("keydown"!=e.type||e.ctrlKey||e.metaKey)&&this.$element.contains(e.target)||(this.lastEvent=null,this.timeout&&clearTimeout(this.timeout),this.timeout=null,this.addMarker(null),this.isOpen&&(this.$removeCloseEvents(),this.getElement().style.display="none",this.isOpen=!1,h.removePopup(this))))},t.prototype.$registerCloseEvents=function(){window.addEventListener("keydown",this.hide,!0),window.addEventListener("mousewheel",this.hide,!0),window.addEventListener("mousedown",this.hide,!0)},t.prototype.$removeCloseEvents=function(){window.removeEventListener("keydown",this.hide,!0),window.removeEventListener("mousewheel",this.hide,!0),window.removeEventListener("mousedown",this.hide,!0)},t.prototype.onMouseOut=function(e){this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.lastEvent=null,this.isOpen&&e.relatedTarget&&e.relatedTarget!=this.getElement()&&(e&&e.currentTarget.contains(e.relatedTarget)||e.relatedTarget.classList.contains("ace_content")||this.hide())},t}(c);t.HoverTooltip=d})),ace.define("ace/mouse/default_gutter_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/tooltip","ace/config"],(function(e,t,n){"use strict";var i,o=this&&this.__extends||(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),r=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},s=e("../lib/dom"),a=e("../lib/event"),l=e("../tooltip").Tooltip,c=e("../config").nls;t.GutterHandler=function(e){var t,n,i=e.editor,o=i.renderer.$gutterLayer,r=new h(i);function l(){t&&(t=clearTimeout(t)),r.isOpen&&(r.hideTooltip(),i.off("mousewheel",l))}function c(e){r.setPosition(e.x,e.y)}e.editor.setDefaultHandler("guttermousedown",(function(t){if(i.isFocused()&&0==t.getButton()&&"foldWidgets"!=o.getRegion(t)){var n=t.getDocumentPosition().row,r=i.session.selection;if(t.getShiftKey())r.selectTo(n,0);else{if(2==t.domEvent.detail)return i.selectAll(),t.preventDefault();e.$clickSelection=i.selection.getLineRange(n)}return e.setState("selectByLines"),e.captureMouse(t),t.preventDefault()}})),e.editor.setDefaultHandler("guttermousemove",(function(a){var h=a.domEvent.target||a.domEvent.srcElement;if(s.hasCssClass(h,"ace_fold-widget"))return l();r.isOpen&&e.$tooltipFollowsMouse&&c(a),n=a,t||(t=setTimeout((function(){t=null,n&&!e.isMousePressed?function(){var t=n.getDocumentPosition().row;if(t==i.session.getLength()){var s=i.renderer.pixelToScreenCoordinates(0,n.y).row,a=n.$pos;if(s>i.session.documentToScreenRow(a.row,a.column))return l()}if(r.showTooltip(t),r.isOpen)if(i.on("mousewheel",l),e.$tooltipFollowsMouse)c(n);else{var h=n.getGutterRow(),d=o.$lines.get(h);if(d){var u=d.element.querySelector(".ace_gutter_annotation").getBoundingClientRect(),p=r.getElement().style;p.left=u.right+"px",p.top=u.bottom+"px"}else c(n)}}():l()}),50))})),a.addListener(i.renderer.$gutter,"mouseout",(function(e){n=null,r.isOpen&&!t&&(t=setTimeout((function(){t=null,l()}),50))}),i),i.on("changeSession",l),i.on("input",l)};var h=function(e){function t(t){var n=e.call(this,t.container)||this;return n.editor=t,n}return o(t,e),t.prototype.setPosition=function(e,t){var n=window.innerWidth||document.documentElement.clientWidth,i=window.innerHeight||document.documentElement.clientHeight,o=this.getWidth(),r=this.getHeight();(e+=15)+o>n&&(e-=e+o-n),(t+=15)+r>i&&(t-=20+r),l.prototype.setPosition.call(this,e,t)},Object.defineProperty(t,"annotationLabels",{get:function(){return{error:{singular:c("error"),plural:c("errors")},warning:{singular:c("warning"),plural:c("warnings")},info:{singular:c("information message"),plural:c("information messages")}}},enumerable:!1,configurable:!0}),t.prototype.showTooltip=function(e){var n,i=this.editor.renderer.$gutterLayer,o=i.$annotations[e];n=o?{text:Array.from(o.text),type:Array.from(o.type)}:{text:[],type:[]};var r=i.session.getFoldLine(e);if(r&&i.$showFoldedAnnotations){for(var s,a={error:[],warning:[],info:[]},l=e+1;l<=r.end.row;l++)if(i.$annotations[l])for(var c=0;c<i.$annotations[l].text.length;c++){var h=i.$annotations[l].type[c];a[h].push(i.$annotations[l].text[c]),"error"!==h?"warning"!==h||(s="warning_fold"):s="error_fold"}if("error_fold"===s||"warning_fold"===s){var d="".concat(t.annotationsToSummaryString(a)," in folded code.");n.text.push(d),n.type.push(s)}}if(0===n.text.length)return this.hide();var u={error:[],warning:[],info:[]},p=i.$useSvgGutterIcons?"ace_icon_svg":"ace_icon";for(l=0;l<n.text.length;l++){var g="<span class='ace_".concat(n.type[l]," ").concat(p,"' aria-label='").concat(t.annotationLabels[n.type[l].replace("_fold","")].singular,"' role=img> </span> ").concat(n.text[l]);u[n.type[l].replace("_fold","")].push(g)}var f=[].concat(u.error,u.warning,u.info).join("<br>");this.setHtml(f),this.$element.setAttribute("aria-live","polite"),this.isOpen||(this.setTheme(this.editor.renderer.theme),this.setClassName("ace_gutter-tooltip")),this.show(),this.editor._signal("showGutterTooltip",this)},t.prototype.hideTooltip=function(){this.$element.removeAttribute("aria-live"),this.hide(),this.editor._signal("hideGutterTooltip",this)},t.annotationsToSummaryString=function(e){var n,i,o=[];try{for(var s=r(["error","warning","info"]),a=s.next();!a.done;a=s.next()){var l=a.value;if(e[l].length){var c=1===e[l].length?t.annotationLabels[l].singular:t.annotationLabels[l].plural;o.push("".concat(e[l].length," ").concat(c))}}}catch(e){n={error:e}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(n)throw n.error}}return o.join(", ")},t}(l);t.GutterTooltip=h})),ace.define("ace/mouse/mouse_event",["require","exports","module","ace/lib/event","ace/lib/useragent"],(function(e,t,n){"use strict";var i=e("../lib/event"),o=e("../lib/useragent"),r=function(){function e(e,t){this.domEvent=e,this.editor=t,this.x=this.clientX=e.clientX,this.y=this.clientY=e.clientY,this.$pos=null,this.$inSelection=null,this.propagationStopped=!1,this.defaultPrevented=!1}return e.prototype.stopPropagation=function(){i.stopPropagation(this.domEvent),this.propagationStopped=!0},e.prototype.preventDefault=function(){i.preventDefault(this.domEvent),this.defaultPrevented=!0},e.prototype.stop=function(){this.stopPropagation(),this.preventDefault()},e.prototype.getDocumentPosition=function(){return this.$pos||(this.$pos=this.editor.renderer.screenToTextCoordinates(this.clientX,this.clientY)),this.$pos},e.prototype.getGutterRow=function(){var e=this.getDocumentPosition().row;return this.editor.session.documentToScreenRow(e,0)-this.editor.session.documentToScreenRow(this.editor.renderer.$gutterLayer.$lines.get(0).row,0)},e.prototype.inSelection=function(){if(null!==this.$inSelection)return this.$inSelection;var e=this.editor.getSelectionRange();if(e.isEmpty())this.$inSelection=!1;else{var t=this.getDocumentPosition();this.$inSelection=e.contains(t.row,t.column)}return this.$inSelection},e.prototype.getButton=function(){return i.getButton(this.domEvent)},e.prototype.getShiftKey=function(){return this.domEvent.shiftKey},e.prototype.getAccelKey=function(){return o.isMac?this.domEvent.metaKey:this.domEvent.ctrlKey},e}();t.MouseEvent=r})),ace.define("ace/mouse/dragdrop_handler",["require","exports","module","ace/lib/dom","ace/lib/event","ace/lib/useragent"],(function(e,t,n){"use strict";var i=e("../lib/dom"),o=e("../lib/event"),r=e("../lib/useragent");function s(e){var t=e.editor,n=i.createElement("div");n.style.cssText="top:-100px;position:absolute;z-index:2147483647;opacity:0.5",n.textContent=" ",["dragWait","dragWaitEnd","startDrag","dragReadyEnd","onMouseDrag"].forEach((function(t){e[t]=this[t]}),this),t.on("mousedown",this.onMouseDown.bind(e));var s,l,c,h,d,u,p,g,f,m,v,w=t.container,b=0;function y(){var e=u;(function(e,n){var i=Date.now(),o=!n||e.row!=n.row,r=!n||e.column!=n.column;!m||o||r?(t.moveCursorToPosition(e),m=i,v={x:l,y:c}):a(v.x,v.y,l,c)>5?m=null:i-m>=200&&(t.renderer.scrollCursorIntoView(),m=null)})(u=t.renderer.screenToTextCoordinates(l,c),e),function(e,n){var i=Date.now(),o=t.renderer.layerConfig.lineHeight,r=t.renderer.layerConfig.characterWidth,s=t.renderer.scroller.getBoundingClientRect(),a={x:{left:l-s.left,right:s.right-l},y:{top:c-s.top,bottom:s.bottom-c}},h=Math.min(a.x.left,a.x.right),d=Math.min(a.y.top,a.y.bottom),u={row:e.row,column:e.column};h/r<=2&&(u.column+=a.x.left<a.x.right?-3:2),d/o<=1&&(u.row+=a.y.top<a.y.bottom?-1:1);var p=e.row!=u.row,g=e.column!=u.column,m=!n||e.row!=n.row;p||g&&!m?f?i-f>=200&&t.renderer.scrollCursorIntoView(u):f=i:f=null}(u,e)}function C(){d=t.selection.toOrientedRange(),s=t.session.addMarker(d,"ace_selection",t.getSelectionStyle()),t.clearSelection(),t.isFocused()&&t.renderer.$cursorLayer.setBlinking(!1),clearInterval(h),y(),h=setInterval(y,20),b=0,o.addListener(document,"mousemove",_)}function $(){clearInterval(h),t.session.removeMarker(s),s=null,t.selection.fromOrientedRange(d),t.isFocused()&&!g&&t.$resetCursorStyle(),d=null,u=null,b=0,f=null,m=null,o.removeListener(document,"mousemove",_)}this.onDragStart=function(e){if(this.cancelDrag||!w.draggable){var i=this;return setTimeout((function(){i.startSelect(),i.captureMouse(e)}),0),e.preventDefault()}d=t.getSelectionRange();var o=e.dataTransfer;o.effectAllowed=t.getReadOnly()?"copy":"copyMove",t.container.appendChild(n),o.setDragImage&&o.setDragImage(n,0,0),setTimeout((function(){t.container.removeChild(n)})),o.clearData(),o.setData("Text",t.session.getTextRange()),g=!0,this.setState("drag")},this.onDragEnd=function(e){if(w.draggable=!1,g=!1,this.setState(null),!t.getReadOnly()){var n=e.dataTransfer.dropEffect;p||"move"!=n||t.session.remove(t.getSelectionRange()),t.$resetCursorStyle()}this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle("")},this.onDragEnter=function(e){if(!t.getReadOnly()&&S(e.dataTransfer))return l=e.clientX,c=e.clientY,s||C(),b++,e.dataTransfer.dropEffect=p=E(e),o.preventDefault(e)},this.onDragOver=function(e){if(!t.getReadOnly()&&S(e.dataTransfer))return l=e.clientX,c=e.clientY,s||(C(),b++),null!==x&&(x=null),e.dataTransfer.dropEffect=p=E(e),o.preventDefault(e)},this.onDragLeave=function(e){if(--b<=0&&s)return $(),p=null,o.preventDefault(e)},this.onDrop=function(e){if(u){var n=e.dataTransfer;if(g)switch(p){case"move":d=d.contains(u.row,u.column)?{start:u,end:u}:t.moveText(d,u);break;case"copy":d=t.moveText(d,u,!0)}else{var i=n.getData("Text");d={start:u,end:t.session.insert(u,i)},t.focus(),p=null}return $(),o.preventDefault(e)}},o.addListener(w,"dragstart",this.onDragStart.bind(e),t),o.addListener(w,"dragend",this.onDragEnd.bind(e),t),o.addListener(w,"dragenter",this.onDragEnter.bind(e),t),o.addListener(w,"dragover",this.onDragOver.bind(e),t),o.addListener(w,"dragleave",this.onDragLeave.bind(e),t),o.addListener(w,"drop",this.onDrop.bind(e),t);var x=null;function _(){null==x&&(x=setTimeout((function(){null!=x&&s&&$()}),20))}function S(e){var t=e.types;return!t||Array.prototype.some.call(t,(function(e){return"text/plain"==e||"Text"==e}))}function E(e){var t=["copy","copymove","all","uninitialized"],n=r.isMac?e.altKey:e.ctrlKey,i="uninitialized";try{i=e.dataTransfer.effectAllowed.toLowerCase()}catch(e){}var o="none";return n&&t.indexOf(i)>=0?o="copy":["move","copymove","linkmove","all","uninitialized"].indexOf(i)>=0?o="move":t.indexOf(i)>=0&&(o="copy"),o}}function a(e,t,n,i){return Math.sqrt(Math.pow(n-e,2)+Math.pow(i-t,2))}(function(){this.dragWait=function(){Date.now()-this.mousedownEvent.time>this.editor.getDragDelay()&&this.startDrag()},this.dragWaitEnd=function(){this.editor.container.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()),this.selectEnd()},this.dragReadyEnd=function(e){this.editor.$resetCursorStyle(),this.editor.unsetStyle("ace_dragging"),this.editor.renderer.setCursorStyle(""),this.dragWaitEnd()},this.startDrag=function(){this.cancelDrag=!1;var e=this.editor;e.container.draggable=!0,e.renderer.$cursorLayer.setBlinking(!1),e.setStyle("ace_dragging");var t=r.isWin?"default":"move";e.renderer.setCursorStyle(t),this.setState("dragReady")},this.onMouseDrag=function(e){var t=this.editor.container;r.isIE&&"dragReady"==this.state&&a(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)>3&&t.dragDrop(),"dragWait"===this.state&&a(this.mousedownEvent.x,this.mousedownEvent.y,this.x,this.y)>0&&(t.draggable=!1,this.startSelect(this.mousedownEvent.getDocumentPosition()))},this.onMouseDown=function(e){if(this.$dragEnabled){this.mousedownEvent=e;var t=this.editor,n=e.inSelection(),i=e.getButton();if(1===(e.domEvent.detail||1)&&0===i&&n){if(e.editor.inMultiSelectMode&&(e.getAccelKey()||e.getShiftKey()))return;this.mousedownEvent.time=Date.now();var o=e.domEvent.target||e.domEvent.srcElement;"unselectable"in o&&(o.unselectable="on"),t.getDragDelay()?(r.isWebKit&&(this.cancelDrag=!0,t.container.draggable=!0),this.setState("dragWait")):this.startDrag(),this.captureMouse(e,this.onMouseDrag.bind(this)),e.defaultPrevented=!0}}}}).call(s.prototype),t.DragdropHandler=s})),ace.define("ace/mouse/touch_handler",["require","exports","module","ace/mouse/mouse_event","ace/lib/event","ace/lib/dom"],(function(e,t,n){"use strict";var i=e("./mouse_event").MouseEvent,o=e("../lib/event"),r=e("../lib/dom");t.addTouchListeners=function(e,t){var n,s,a,l,c,h,d,u,p,g="scroll",f=0,m=0,v=0,w=0;function b(){var e,n,i;p||(e=window.navigator&&window.navigator.clipboard,n=!1,i=function(i){var o,s,a=i.target.getAttribute("action");if("more"==a||!n)return n=!n,o=t.getCopyText(),s=t.session.getUndoManager().hasUndo(),void p.replaceChild(r.buildDom(n?["span",!o&&["span",{class:"ace_mobile-button",action:"selectall"},"Select All"],o&&["span",{class:"ace_mobile-button",action:"copy"},"Copy"],o&&["span",{class:"ace_mobile-button",action:"cut"},"Cut"],e&&["span",{class:"ace_mobile-button",action:"paste"},"Paste"],s&&["span",{class:"ace_mobile-button",action:"undo"},"Undo"],["span",{class:"ace_mobile-button",action:"find"},"Find"],["span",{class:"ace_mobile-button",action:"openCommandPallete"},"Palette"]]:["span"]),p.firstChild);"paste"==a?e.readText().then((function(e){t.execCommand(a,e)})):a&&("cut"!=a&&"copy"!=a||(e?e.writeText(t.getCopyText()):document.execCommand("copy")),t.execCommand(a)),p.firstChild.style.display="none",n=!1,"openCommandPallete"!=a&&t.focus()},p=r.buildDom(["div",{class:"ace_mobile-menu",ontouchstart:function(e){g="menu",e.stopPropagation(),e.preventDefault(),t.textInput.focus()},ontouchend:function(e){e.stopPropagation(),e.preventDefault(),i(e)},onclick:i},["span"],["span",{class:"ace_mobile-button",action:"more"},"..."]],t.container));var o=t.selection.cursor,s=t.renderer.textToScreenCoordinates(o.row,o.column),a=t.renderer.textToScreenCoordinates(0,0).pageX,l=t.renderer.scrollLeft,c=t.container.getBoundingClientRect();p.style.top=s.pageY-c.top-3+"px",s.pageX-c.left<c.width-70?(p.style.left="",p.style.right="10px"):(p.style.right="",p.style.left=a+l-c.left+"px"),p.style.display="",p.firstChild.style.display="none",t.on("input",y)}function y(e){p&&(p.style.display="none"),t.off("input",y)}function C(){c=null,clearTimeout(c);var e=t.selection.getRange(),n=e.contains(d.row,d.column);!e.isEmpty()&&n||(t.selection.moveToPosition(d),t.selection.selectWord()),g="wait",b()}o.addListener(e,"contextmenu",(function(e){u&&t.textInput.getElement().focus()}),t),o.addListener(e,"touchstart",(function(e){var o=e.touches;if(c||o.length>1)return clearTimeout(c),c=null,a=-1,void(g="zoom");u=t.$mouseHandler.isMousePressed=!0;var r=t.renderer.layerConfig.lineHeight,h=t.renderer.layerConfig.lineHeight,p=e.timeStamp;l=p;var b=o[0],y=b.clientX,$=b.clientY;Math.abs(n-y)+Math.abs(s-$)>r&&(a=-1),n=e.clientX=y,s=e.clientY=$,v=w=0;var x=new i(e,t);if(d=x.getDocumentPosition(),p-a<500&&1==o.length&&!f)m++,e.preventDefault(),e.button=0,function(){c=null,clearTimeout(c),t.selection.moveToPosition(d);var e=m>=2?t.selection.getLineRange(d.row):t.session.getBracketRange(d);e&&!e.isEmpty()?t.selection.setRange(e):t.selection.selectWord(),g="wait"}();else{m=0;var _=t.selection.cursor,S=t.selection.isEmpty()?_:t.selection.anchor,E=t.renderer.$cursorLayer.getPixelPosition(_,!0),k=t.renderer.$cursorLayer.getPixelPosition(S,!0),A=t.renderer.scroller.getBoundingClientRect(),L=t.renderer.layerConfig.offset,M=t.renderer.scrollLeft,T=function(e,t){return(e/=h)*e+(t=t/r-.75)*t};if(e.clientX<A.left)return void(g="zoom");var R=T(e.clientX-A.left-E.left+M,e.clientY-A.top-E.top+L),I=T(e.clientX-A.left-k.left+M,e.clientY-A.top-k.top+L);R<3.5&&I<3.5&&(g=R>I?"cursor":"anchor"),g=I<3.5?"anchor":R<3.5?"cursor":"scroll",c=setTimeout(C,450)}a=p}),t),o.addListener(e,"touchend",(function(e){u=t.$mouseHandler.isMousePressed=!1,h&&clearInterval(h),"zoom"==g?(g="",f=0):c?(t.selection.moveToPosition(d),f=0,b()):"scroll"==g?(f+=60,h=setInterval((function(){f--<=0&&(clearInterval(h),h=null),Math.abs(v)<.01&&(v=0),Math.abs(w)<.01&&(w=0),f<20&&(v*=.9),f<20&&(w*=.9);var e=t.session.getScrollTop();t.renderer.scrollBy(10*v,10*w),e==t.session.getScrollTop()&&(f=0)}),10),y()):b(),clearTimeout(c),c=null}),t),o.addListener(e,"touchmove",(function(e){c&&(clearTimeout(c),c=null);var o=e.touches;if(!(o.length>1||"zoom"==g)){var r=o[0],a=n-r.clientX,h=s-r.clientY;if("wait"==g){if(!(a*a+h*h>4))return e.preventDefault();g="cursor"}n=r.clientX,s=r.clientY,e.clientX=r.clientX,e.clientY=r.clientY;var d=e.timeStamp,u=d-l;if(l=d,"scroll"==g){var p=new i(e,t);p.speed=1,p.wheelX=a,p.wheelY=h,10*Math.abs(a)<Math.abs(h)&&(a=0),10*Math.abs(h)<Math.abs(a)&&(h=0),0!=u&&(v=a/u,w=h/u),t._emit("mousewheel",p),p.propagationStopped||(v=w=0)}else{var f=new i(e,t).getDocumentPosition();"cursor"==g?t.selection.moveCursorToPosition(f):"anchor"==g&&t.selection.setSelectionAnchor(f.row,f.column),t.renderer.scrollCursorIntoView(f),e.preventDefault()}}}),t)}})),ace.define("ace/mouse/mouse_handler",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/mouse/default_handlers","ace/mouse/default_gutter_handler","ace/mouse/mouse_event","ace/mouse/dragdrop_handler","ace/mouse/touch_handler","ace/config"],(function(e,t,n){"use strict";var i=e("../lib/event"),o=e("../lib/useragent"),r=e("./default_handlers").DefaultHandlers,s=e("./default_gutter_handler").GutterHandler,a=e("./mouse_event").MouseEvent,l=e("./dragdrop_handler").DragdropHandler,c=e("./touch_handler").addTouchListeners,h=e("../config"),d=function(){function e(e){var t=this;this.editor=e,new r(this),new s(this),new l(this);var n=function(t){(!document.hasFocus||!document.hasFocus()||!e.isFocused()&&document.activeElement==(e.textInput&&e.textInput.getElement()))&&window.focus(),e.focus(),setTimeout((function(){e.isFocused()||e.focus()}))},a=e.renderer.getMouseEventTarget();i.addListener(a,"click",this.onMouseEvent.bind(this,"click"),e),i.addListener(a,"mousemove",this.onMouseMove.bind(this,"mousemove"),e),i.addMultiMouseDownListener([a,e.renderer.scrollBarV&&e.renderer.scrollBarV.inner,e.renderer.scrollBarH&&e.renderer.scrollBarH.inner,e.textInput&&e.textInput.getElement()].filter(Boolean),[400,300,250],this,"onMouseEvent",e),i.addMouseWheelListener(e.container,this.onMouseWheel.bind(this,"mousewheel"),e),c(e.container,e);var h=e.renderer.$gutter;i.addListener(h,"mousedown",this.onMouseEvent.bind(this,"guttermousedown"),e),i.addListener(h,"click",this.onMouseEvent.bind(this,"gutterclick"),e),i.addListener(h,"dblclick",this.onMouseEvent.bind(this,"gutterdblclick"),e),i.addListener(h,"mousemove",this.onMouseEvent.bind(this,"guttermousemove"),e),i.addListener(a,"mousedown",n,e),i.addListener(h,"mousedown",n,e),o.isIE&&e.renderer.scrollBarV&&(i.addListener(e.renderer.scrollBarV.element,"mousedown",n,e),i.addListener(e.renderer.scrollBarH.element,"mousedown",n,e)),e.on("mousemove",(function(n){if(!t.state&&!t.$dragDelay&&t.$dragEnabled){var i=e.renderer.screenToTextCoordinates(n.x,n.y),o=e.session.selection.getRange(),r=e.renderer;!o.isEmpty()&&o.insideStart(i.row,i.column)?r.setCursorStyle("default"):r.setCursorStyle("")}}),e)}return e.prototype.onMouseEvent=function(e,t){this.editor.session&&this.editor._emit(e,new a(t,this.editor))},e.prototype.onMouseMove=function(e,t){var n=this.editor._eventRegistry&&this.editor._eventRegistry.mousemove;n&&n.length&&this.editor._emit(e,new a(t,this.editor))},e.prototype.onMouseWheel=function(e,t){var n=new a(t,this.editor);n.speed=2*this.$scrollSpeed,n.wheelX=t.wheelX,n.wheelY=t.wheelY,this.editor._emit(e,n)},e.prototype.setState=function(e){this.state=e},e.prototype.captureMouse=function(e,t){this.x=e.x,this.y=e.y,this.isMousePressed=!0;var n=this.editor,r=this.editor.renderer;r.$isMousePressed=!0;var s=this,l=function(e){if(e){if(o.isWebKit&&!e.which&&s.releaseMouse)return s.releaseMouse();s.x=e.clientX,s.y=e.clientY,t&&t(e),s.mouseEvent=new a(e,s.editor),s.$mouseMoved=!0}},c=function(e){n.off("beforeEndOperation",d),clearInterval(u),n.session&&h(),s[s.state+"End"]&&s[s.state+"End"](e),s.state="",s.isMousePressed=r.$isMousePressed=!1,r.$keepTextAreaAtCursor&&r.$moveTextAreaToCursor(),s.$onCaptureMouseMove=s.releaseMouse=null,e&&s.onMouseEvent("mouseup",e),n.endOperation()},h=function(){s[s.state]&&s[s.state](),s.$mouseMoved=!1};if(o.isOldIE&&"dblclick"==e.domEvent.type)return setTimeout((function(){c(e)}));var d=function(e){s.releaseMouse&&n.curOp.command.name&&n.curOp.selectionChanged&&(s[s.state+"End"]&&s[s.state+"End"](),s.state="",s.releaseMouse())};n.on("beforeEndOperation",d),n.startOperation({command:{name:"mouse"}}),s.$onCaptureMouseMove=l,s.releaseMouse=i.capture(this.editor.container,l,c);var u=setInterval(h,20)},e.prototype.cancelContextMenu=function(){var e=function(t){t&&t.domEvent&&"contextmenu"!=t.domEvent.type||(this.editor.off("nativecontextmenu",e),t&&t.domEvent&&i.stopEvent(t.domEvent))}.bind(this);setTimeout(e,10),this.editor.on("nativecontextmenu",e)},e.prototype.destroy=function(){this.releaseMouse&&this.releaseMouse()},e}();d.prototype.releaseMouse=null,h.defineOptions(d.prototype,"mouseHandler",{scrollSpeed:{initialValue:2},dragDelay:{initialValue:o.isMac?150:0},dragEnabled:{initialValue:!0},focusTimeout:{initialValue:0},tooltipFollowsMouse:{initialValue:!0}}),t.MouseHandler=d})),ace.define("ace/mouse/fold_handler",["require","exports","module","ace/lib/dom"],(function(e,t,n){"use strict";var i=e("../lib/dom");t.FoldHandler=function(e){e.on("click",(function(t){var n=t.getDocumentPosition(),o=e.session,r=o.getFoldAt(n.row,n.column,1);r&&(t.getAccelKey()?o.removeFold(r):o.expandFold(r),t.stop());var s=t.domEvent&&t.domEvent.target;s&&i.hasCssClass(s,"ace_inline_button")&&i.hasCssClass(s,"ace_toggle_wrap")&&(o.setOption("wrap",!o.getUseWrapMode()),e.renderer.scrollCursorIntoView())})),e.on("gutterclick",(function(t){if("foldWidgets"==e.renderer.$gutterLayer.getRegion(t)){var n=t.getDocumentPosition().row,i=e.session;i.foldWidgets&&i.foldWidgets[n]&&e.session.onFoldWidgetClick(n,t),e.isFocused()||e.focus(),t.stop()}})),e.on("gutterdblclick",(function(t){if("foldWidgets"==e.renderer.$gutterLayer.getRegion(t)){var n=t.getDocumentPosition().row,i=e.session,o=i.getParentFoldRangeData(n,!0),r=o.range||o.firstRange;if(r){n=r.start.row;var s=i.getFoldAt(n,i.getLine(n).length,1);s?i.removeFold(s):(i.addFold("...",r),e.renderer.scrollCursorIntoView({row:r.start.row,column:0}))}t.stop()}}))}})),ace.define("ace/keyboard/keybinding",["require","exports","module","ace/lib/keys","ace/lib/event"],(function(e,t,n){"use strict";var i=e("../lib/keys"),o=e("../lib/event"),r=function(){function e(e){this.$editor=e,this.$data={editor:e},this.$handlers=[],this.setDefaultHandler(e.commands)}return e.prototype.setDefaultHandler=function(e){this.removeKeyboardHandler(this.$defaultHandler),this.$defaultHandler=e,this.addKeyboardHandler(e,0)},e.prototype.setKeyboardHandler=function(e){var t=this.$handlers;if(t[t.length-1]!=e){for(;t[t.length-1]&&t[t.length-1]!=this.$defaultHandler;)this.removeKeyboardHandler(t[t.length-1]);this.addKeyboardHandler(e,1)}},e.prototype.addKeyboardHandler=function(e,t){if(e){"function"!=typeof e||e.handleKeyboard||(e.handleKeyboard=e);var n=this.$handlers.indexOf(e);-1!=n&&this.$handlers.splice(n,1),null==t?this.$handlers.push(e):this.$handlers.splice(t,0,e),-1==n&&e.attach&&e.attach(this.$editor)}},e.prototype.removeKeyboardHandler=function(e){var t=this.$handlers.indexOf(e);return-1!=t&&(this.$handlers.splice(t,1),e.detach&&e.detach(this.$editor),!0)},e.prototype.getKeyboardHandler=function(){return this.$handlers[this.$handlers.length-1]},e.prototype.getStatusText=function(){var e=this.$data,t=e.editor;return this.$handlers.map((function(n){return n.getStatusText&&n.getStatusText(t,e)||""})).filter(Boolean).join(" ")},e.prototype.$callKeyboardHandlers=function(e,t,n,i){for(var r,s=!1,a=this.$editor.commands,l=this.$handlers.length;l--&&!((r=this.$handlers[l].handleKeyboard(this.$data,e,t,n,i))&&r.command&&((s="null"==r.command||a.exec(r.command,this.$editor,r.args,i))&&i&&-1!=e&&1!=r.passEvent&&1!=r.command.passEvent&&o.stopEvent(i),s)););return s||-1!=e||(r={command:"insertstring"},s=a.exec("insertstring",this.$editor,t)),s&&this.$editor._signal&&this.$editor._signal("keyboardActivity",r),s},e.prototype.onCommandKey=function(e,t,n){var o=i.keyCodeToString(n);return this.$callKeyboardHandlers(t,o,n,e)},e.prototype.onTextInput=function(e){return this.$callKeyboardHandlers(-1,e)},e}();t.KeyBinding=r})),ace.define("ace/lib/bidiutil",["require","exports","module"],(function(e,t,n){"use strict";var i=0,o=0,r=!1,s=!1,a=!1,l=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],c=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],h=11,d=18,u=[d,d,d,d,d,d,d,d,d,6,5,6,8,5,d,d,d,d,d,d,d,d,d,d,d,d,d,d,5,5,5,6,8,4,4,h,h,h,4,4,4,4,4,10,9,10,9,9,2,2,2,2,2,2,2,2,2,2,9,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,4,4,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,4,4,4,d,d,d,d,d,d,5,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,d,9,4,h,h,h,h,4,4,4,4,0,4,4,d,4,4,h,h,2,2,4,0,4,4,4,2,0,4,4,4,4,4],p=[8,8,8,8,8,8,8,8,8,8,8,d,d,d,0,1,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,8,5,13,14,15,16,17,9,h,h,h,h,h,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,9,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,8];function g(e,t,n){if(!(o<e))if(1!=e||1!=i||s)for(var r,a,l,c,h=n.length,d=0;d<h;){if(t[d]>=e){for(r=d+1;r<h&&t[r]>=e;)r++;for(a=d,l=r-1;a<l;a++,l--)c=n[a],n[a]=n[l],n[l]=c;d=r}d++}else n.reverse()}function f(e,t,n,o){var l,c,u,p,g=t[o];switch(g){case 0:case 1:r=!1;case 4:case 3:return g;case 2:return r?3:2;case 7:return r=!0,1;case 8:return 4;case 9:return o<1||o+1>=t.length||2!=(l=n[o-1])&&3!=l||2!=(c=t[o+1])&&3!=c?4:(r&&(c=3),c==l?c:4);case 10:return 2==(l=o>0?n[o-1]:5)&&o+1<t.length&&2==t[o+1]?2:4;case h:if(o>0&&2==n[o-1])return 2;if(r)return 4;for(p=o+1,u=t.length;p<u&&t[p]==h;)p++;return p<u&&2==t[p]?2:4;case 12:for(u=t.length,p=o+1;p<u&&12==t[p];)p++;if(p<u){var f=e[o],m=f>=1425&&f<=2303||64286==f;if(l=t[p],m&&(1==l||7==l))return 1}return o<1||5==(l=t[o-1])?4:n[o-1];case 5:return r=!1,s=!0,i;case 6:return a=!0,4;case 13:case 14:case 16:case 17:case 15:r=!1;case d:return 4}}function m(e){var t=e.charCodeAt(0),n=t>>8;return 0==n?t>191?0:u[t]:5==n?/[\u0591-\u05f4]/.test(e)?1:0:6==n?/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(e)?12:/[\u0660-\u0669\u066b-\u066c]/.test(e)?3:1642==t?h:/[\u06f0-\u06f9]/.test(e)?2:7:32==n&&t<=8287?p[255&t]:254==n&&t>=65136?7:4}t.L=0,t.R=1,t.EN=2,t.ON_R=3,t.AN=4,t.R_H=5,t.B=6,t.RLE=7,t.DOT="·",t.doBidiReorder=function(e,n,h){if(e.length<2)return{};var u=e.split(""),p=new Array(u.length),v=new Array(u.length),w=[];i=h?1:0,function(e,t,n,h){var d=i?c:l,u=null,p=null,g=null,v=0,w=null,b=-1,y=null,C=null,$=[];if(!h)for(y=0,h=[];y<n;y++)h[y]=m(e[y]);for(o=i,r=!1,s=!1,a=!1,C=0;C<n;C++){if(u=v,$[C]=p=f(e,h,$,C),w=240&(v=d[u][p]),v&=15,t[C]=g=d[v][5],w>0)if(16==w){for(y=b;y<C;y++)t[y]=1;b=-1}else b=-1;if(d[v][6])-1==b&&(b=C);else if(b>-1){for(y=b;y<C;y++)t[y]=g;b=-1}5==h[C]&&(t[C]=0),o|=g}if(a)for(y=0;y<n;y++)if(6==h[y]){t[y]=i;for(var x=y-1;x>=0&&8==h[x];x--)t[x]=i}}(u,w,u.length,n);for(var b=0;b<p.length;p[b]=b,b++);for(g(2,w,p),g(1,w,p),b=0;b<p.length-1;b++)3===n[b]?w[b]=t.AN:1===w[b]&&(n[b]>7&&n[b]<13||4===n[b]||n[b]===d)?w[b]=t.ON_R:b>0&&"Ù„"===u[b-1]&&/\u0622|\u0623|\u0625|\u0627/.test(u[b])&&(w[b-1]=w[b]=t.R_H,b++);for(u[u.length-1]===t.DOT&&(w[u.length-1]=t.B),"‫"===u[0]&&(w[0]=t.RLE),b=0;b<p.length;b++)v[b]=w[p[b]];return{logicalFromVisual:p,bidiLevels:v}},t.hasBidiCharacters=function(e,t){for(var n=!1,i=0;i<e.length;i++)t[i]=m(e.charAt(i)),n||1!=t[i]&&7!=t[i]&&3!=t[i]||(n=!0);return n},t.getVisualFromLogicalIdx=function(e,t){for(var n=0;n<t.logicalFromVisual.length;n++)if(t.logicalFromVisual[n]==e)return n;return 0}})),ace.define("ace/bidihandler",["require","exports","module","ace/lib/bidiutil","ace/lib/lang"],(function(e,t,n){"use strict";var i=e("./lib/bidiutil"),o=e("./lib/lang"),r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\u202B]/,s=function(){function e(e){this.session=e,this.bidiMap={},this.currentRow=null,this.bidiUtil=i,this.charWidths=[],this.EOL="¬",this.showInvisibles=!0,this.isRtlDir=!1,this.$isRtl=!1,this.line="",this.wrapIndent=0,this.EOF="¶",this.RLE="‫",this.contentWidth=0,this.fontMetrics=null,this.rtlLineOffset=0,this.wrapOffset=0,this.isMoveLeftOperation=!1,this.seenBidi=r.test(e.getValue())}return e.prototype.isBidiRow=function(e,t,n){return!!this.seenBidi&&(e!==this.currentRow&&(this.currentRow=e,this.updateRowLine(t,n),this.updateBidiMap()),this.bidiMap.bidiLevels)},e.prototype.onChange=function(e){this.seenBidi?this.currentRow=null:"insert"==e.action&&r.test(e.lines.join("\n"))&&(this.seenBidi=!0,this.currentRow=null)},e.prototype.getDocumentRow=function(){var e=0,t=this.session.$screenRowCache;if(t.length){var n=this.session.$getRowCacheIndex(t,this.currentRow);n>=0&&(e=this.session.$docRowCache[n])}return e},e.prototype.getSplitIndex=function(){var e=0,t=this.session.$screenRowCache;if(t.length)for(var n,i=this.session.$getRowCacheIndex(t,this.currentRow);this.currentRow-e>0&&(n=this.session.$getRowCacheIndex(t,this.currentRow-e-1))===i;)i=n,e++;else e=this.currentRow;return e},e.prototype.updateRowLine=function(e,t){void 0===e&&(e=this.getDocumentRow());var n=e===this.session.getLength()-1?this.EOF:this.EOL;if(this.wrapIndent=0,this.line=this.session.getLine(e),this.isRtlDir=this.$isRtl||this.line.charAt(0)===this.RLE,this.session.$useWrapMode){var r=this.session.$wrapData[e];r&&(void 0===t&&(t=this.getSplitIndex()),t>0&&r.length?(this.wrapIndent=r.indent,this.wrapOffset=this.wrapIndent*this.charWidths[i.L],this.line=t<r.length?this.line.substring(r[t-1],r[t]):this.line.substring(r[r.length-1])):this.line=this.line.substring(0,r[t]),t==r.length&&(this.line+=this.showInvisibles?n:i.DOT))}else this.line+=this.showInvisibles?n:i.DOT;var s,a=this.session,l=0;this.line=this.line.replace(/\t|[\u1100-\u2029, \u202F-\uFFE6]/g,(function(e,t){return"\t"===e||a.isFullWidth(e.charCodeAt(0))?(s="\t"===e?a.getScreenTabSize(t+l):2,l+=s-1,o.stringRepeat(i.DOT,s)):e})),this.isRtlDir&&(this.fontMetrics.$main.textContent=this.line.charAt(this.line.length-1)==i.DOT?this.line.substr(0,this.line.length-1):this.line,this.rtlLineOffset=this.contentWidth-this.fontMetrics.$main.getBoundingClientRect().width)},e.prototype.updateBidiMap=function(){var e=[];i.hasBidiCharacters(this.line,e)||this.isRtlDir?this.bidiMap=i.doBidiReorder(this.line,e,this.isRtlDir):this.bidiMap={}},e.prototype.markAsDirty=function(){this.currentRow=null},e.prototype.updateCharacterWidths=function(e){if(this.characterWidth!==e.$characterSize.width){this.fontMetrics=e;var t=this.characterWidth=e.$characterSize.width,n=e.$measureCharWidth("×”");this.charWidths[i.L]=this.charWidths[i.EN]=this.charWidths[i.ON_R]=t,this.charWidths[i.R]=this.charWidths[i.AN]=n,this.charWidths[i.R_H]=.45*n,this.charWidths[i.B]=this.charWidths[i.RLE]=0,this.currentRow=null}},e.prototype.setShowInvisibles=function(e){this.showInvisibles=e,this.currentRow=null},e.prototype.setEolChar=function(e){this.EOL=e},e.prototype.setContentWidth=function(e){this.contentWidth=e},e.prototype.isRtlLine=function(e){return!!this.$isRtl||(null!=e?this.session.getLine(e).charAt(0)==this.RLE:this.isRtlDir)},e.prototype.setRtlDirection=function(e,t){for(var n=e.getCursorPosition(),i=e.selection.getSelectionAnchor().row;i<=n.row;i++)t||e.session.getLine(i).charAt(0)!==e.session.$bidiHandler.RLE?t&&e.session.getLine(i).charAt(0)!==e.session.$bidiHandler.RLE&&e.session.doc.insert({column:0,row:i},e.session.$bidiHandler.RLE):e.session.doc.removeInLine(i,0,1)},e.prototype.getPosLeft=function(e){e-=this.wrapIndent;var t=this.line.charAt(0)===this.RLE?1:0,n=e>t?this.session.getOverwrite()?e:e-1:t,o=i.getVisualFromLogicalIdx(n,this.bidiMap),r=this.bidiMap.bidiLevels,s=0;!this.session.getOverwrite()&&e<=t&&r[o]%2!=0&&o++;for(var a=0;a<o;a++)s+=this.charWidths[r[a]];return!this.session.getOverwrite()&&e>t&&r[o]%2==0&&(s+=this.charWidths[r[o]]),this.wrapIndent&&(s+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset),this.isRtlDir&&(s+=this.rtlLineOffset),s},e.prototype.getSelections=function(e,t){var n,i=this.bidiMap,o=i.bidiLevels,r=[],s=0,a=Math.min(e,t)-this.wrapIndent,l=Math.max(e,t)-this.wrapIndent,c=!1,h=!1,d=0;this.wrapIndent&&(s+=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);for(var u,p=0;p<o.length;p++)u=i.logicalFromVisual[p],n=o[p],(c=u>=a&&u<l)&&!h?d=s:!c&&h&&r.push({left:d,width:s-d}),s+=this.charWidths[n],h=c;if(c&&p===o.length&&r.push({left:d,width:s-d}),this.isRtlDir)for(var g=0;g<r.length;g++)r[g].left+=this.rtlLineOffset;return r},e.prototype.offsetToCol=function(e){this.isRtlDir&&(e-=this.rtlLineOffset);var t=0,n=(e=Math.max(e,0),0),i=0,o=this.bidiMap.bidiLevels,r=this.charWidths[o[i]];for(this.wrapIndent&&(e-=this.isRtlDir?-1*this.wrapOffset:this.wrapOffset);e>n+r/2;){if(n+=r,i===o.length-1){r=0;break}r=this.charWidths[o[++i]]}return i>0&&o[i-1]%2!=0&&o[i]%2==0?(e<n&&i--,t=this.bidiMap.logicalFromVisual[i]):i>0&&o[i-1]%2==0&&o[i]%2!=0?t=1+(e>n?this.bidiMap.logicalFromVisual[i]:this.bidiMap.logicalFromVisual[i-1]):this.isRtlDir&&i===o.length-1&&0===r&&o[i-1]%2==0||!this.isRtlDir&&0===i&&o[i]%2!=0?t=1+this.bidiMap.logicalFromVisual[i]:(i>0&&o[i-1]%2!=0&&0!==r&&i--,t=this.bidiMap.logicalFromVisual[i]),0===t&&this.isRtlDir&&t++,t+this.wrapIndent},e}();t.BidiHandler=s})),ace.define("ace/selection",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/range"],(function(e,t,n){"use strict";var i=e("./lib/oop"),o=e("./lib/lang"),r=e("./lib/event_emitter").EventEmitter,s=e("./range").Range,a=function(e){this.session=e,this.doc=e.getDocument(),this.clearSelection(),this.cursor=this.lead=this.doc.createAnchor(0,0),this.anchor=this.doc.createAnchor(0,0),this.$silent=!1;var t=this;this.cursor.on("change",(function(e){t.$cursorChanged=!0,t.$silent||t._emit("changeCursor"),t.$isEmpty||t.$silent||t._emit("changeSelection"),t.$keepDesiredColumnOnChange||e.old.column==e.value.column||(t.$desiredColumn=null)})),this.anchor.on("change",(function(){t.$anchorChanged=!0,t.$isEmpty||t.$silent||t._emit("changeSelection")}))};(function(){i.implement(this,r),this.isEmpty=function(){return this.$isEmpty||this.anchor.row==this.lead.row&&this.anchor.column==this.lead.column},this.isMultiLine=function(){return!this.$isEmpty&&this.anchor.row!=this.cursor.row},this.getCursor=function(){return this.lead.getPosition()},this.setAnchor=function(e,t){this.$isEmpty=!1,this.anchor.setPosition(e,t)},this.setSelectionAnchor=this.setAnchor,this.getAnchor=function(){return this.$isEmpty?this.getSelectionLead():this.anchor.getPosition()},this.getSelectionAnchor=this.getAnchor,this.getSelectionLead=function(){return this.lead.getPosition()},this.isBackwards=function(){var e=this.anchor,t=this.lead;return e.row>t.row||e.row==t.row&&e.column>t.column},this.getRange=function(){var e=this.anchor,t=this.lead;return this.$isEmpty?s.fromPoints(t,t):this.isBackwards()?s.fromPoints(t,e):s.fromPoints(e,t)},this.clearSelection=function(){this.$isEmpty||(this.$isEmpty=!0,this._emit("changeSelection"))},this.selectAll=function(){this.$setSelection(0,0,Number.MAX_VALUE,Number.MAX_VALUE)},this.setRange=this.setSelectionRange=function(e,t){var n=t?e.end:e.start,i=t?e.start:e.end;this.$setSelection(n.row,n.column,i.row,i.column)},this.$setSelection=function(e,t,n,i){if(!this.$silent){var o=this.$isEmpty,r=this.inMultiSelectMode;this.$silent=!0,this.$cursorChanged=this.$anchorChanged=!1,this.anchor.setPosition(e,t),this.cursor.setPosition(n,i),this.$isEmpty=!s.comparePoints(this.anchor,this.cursor),this.$silent=!1,this.$cursorChanged&&this._emit("changeCursor"),(this.$cursorChanged||this.$anchorChanged||o!=this.$isEmpty||r)&&this._emit("changeSelection")}},this.$moveSelection=function(e){var t=this.lead;this.$isEmpty&&this.setSelectionAnchor(t.row,t.column),e.call(this)},this.selectTo=function(e,t){this.$moveSelection((function(){this.moveCursorTo(e,t)}))},this.selectToPosition=function(e){this.$moveSelection((function(){this.moveCursorToPosition(e)}))},this.moveTo=function(e,t){this.clearSelection(),this.moveCursorTo(e,t)},this.moveToPosition=function(e){this.clearSelection(),this.moveCursorToPosition(e)},this.selectUp=function(){this.$moveSelection(this.moveCursorUp)},this.selectDown=function(){this.$moveSelection(this.moveCursorDown)},this.selectRight=function(){this.$moveSelection(this.moveCursorRight)},this.selectLeft=function(){this.$moveSelection(this.moveCursorLeft)},this.selectLineStart=function(){this.$moveSelection(this.moveCursorLineStart)},this.selectLineEnd=function(){this.$moveSelection(this.moveCursorLineEnd)},this.selectFileEnd=function(){this.$moveSelection(this.moveCursorFileEnd)},this.selectFileStart=function(){this.$moveSelection(this.moveCursorFileStart)},this.selectWordRight=function(){this.$moveSelection(this.moveCursorWordRight)},this.selectWordLeft=function(){this.$moveSelection(this.moveCursorWordLeft)},this.getWordRange=function(e,t){if(void 0===t){var n=e||this.lead;e=n.row,t=n.column}return this.session.getWordRange(e,t)},this.selectWord=function(){this.setSelectionRange(this.getWordRange())},this.selectAWord=function(){var e=this.getCursor(),t=this.session.getAWordRange(e.row,e.column);this.setSelectionRange(t)},this.getLineRange=function(e,t){var n,i="number"==typeof e?e:this.lead.row,o=this.session.getFoldLine(i);return o?(i=o.start.row,n=o.end.row):n=i,!0===t?new s(i,0,n,this.session.getLine(n).length):new s(i,0,n+1,0)},this.selectLine=function(){this.setSelectionRange(this.getLineRange())},this.moveCursorUp=function(){this.moveCursorBy(-1,0)},this.moveCursorDown=function(){this.moveCursorBy(1,0)},this.wouldMoveIntoSoftTab=function(e,t,n){var i=e.column,o=e.column+t;return n<0&&(i=e.column-t,o=e.column),this.session.isTabStop(e)&&this.doc.getLine(e.row).slice(i,o).split(" ").length-1==t},this.moveCursorLeft=function(){var e,t=this.lead.getPosition();if(e=this.session.getFoldAt(t.row,t.column,-1))this.moveCursorTo(e.start.row,e.start.column);else if(0===t.column)t.row>0&&this.moveCursorTo(t.row-1,this.doc.getLine(t.row-1).length);else{var n=this.session.getTabSize();this.wouldMoveIntoSoftTab(t,n,-1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,-n):this.moveCursorBy(0,-1)}},this.moveCursorRight=function(){var e,t=this.lead.getPosition();if(e=this.session.getFoldAt(t.row,t.column,1))this.moveCursorTo(e.end.row,e.end.column);else if(this.lead.column==this.doc.getLine(this.lead.row).length)this.lead.row<this.doc.getLength()-1&&this.moveCursorTo(this.lead.row+1,0);else{var n=this.session.getTabSize();t=this.lead,this.wouldMoveIntoSoftTab(t,n,1)&&!this.session.getNavigateWithinSoftTabs()?this.moveCursorBy(0,n):this.moveCursorBy(0,1)}},this.moveCursorLineStart=function(){var e=this.lead.row,t=this.lead.column,n=this.session.documentToScreenRow(e,t),i=this.session.screenToDocumentPosition(n,0),o=this.session.getDisplayLine(e,null,i.row,i.column).match(/^\s*/);o[0].length==t||this.session.$useEmacsStyleLineStart||(i.column+=o[0].length),this.moveCursorToPosition(i)},this.moveCursorLineEnd=function(){var e=this.lead,t=this.session.getDocumentLastRowColumnPosition(e.row,e.column);if(this.lead.column==t.column){var n=this.session.getLine(t.row);if(t.column==n.length){var i=n.search(/\s+$/);i>0&&(t.column=i)}}this.moveCursorTo(t.row,t.column)},this.moveCursorFileEnd=function(){var e=this.doc.getLength()-1,t=this.doc.getLine(e).length;this.moveCursorTo(e,t)},this.moveCursorFileStart=function(){this.moveCursorTo(0,0)},this.moveCursorLongWordRight=function(){var e=this.lead.row,t=this.lead.column,n=this.doc.getLine(e),i=n.substring(t);this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0;var o=this.session.getFoldAt(e,t,1);if(o)this.moveCursorTo(o.end.row,o.end.column);else{if(this.session.nonTokenRe.exec(i)&&(t+=this.session.nonTokenRe.lastIndex,this.session.nonTokenRe.lastIndex=0,i=n.substring(t)),t>=n.length)return this.moveCursorTo(e,n.length),this.moveCursorRight(),void(e<this.doc.getLength()-1&&this.moveCursorWordRight());this.session.tokenRe.exec(i)&&(t+=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(e,t)}},this.moveCursorLongWordLeft=function(){var e,t=this.lead.row,n=this.lead.column;if(e=this.session.getFoldAt(t,n,-1))this.moveCursorTo(e.start.row,e.start.column);else{var i=this.session.getFoldStringAt(t,n,-1);null==i&&(i=this.doc.getLine(t).substring(0,n));var r=o.stringReverse(i);if(this.session.nonTokenRe.lastIndex=0,this.session.tokenRe.lastIndex=0,this.session.nonTokenRe.exec(r)&&(n-=this.session.nonTokenRe.lastIndex,r=r.slice(this.session.nonTokenRe.lastIndex),this.session.nonTokenRe.lastIndex=0),n<=0)return this.moveCursorTo(t,0),this.moveCursorLeft(),void(t>0&&this.moveCursorWordLeft());this.session.tokenRe.exec(r)&&(n-=this.session.tokenRe.lastIndex,this.session.tokenRe.lastIndex=0),this.moveCursorTo(t,n)}},this.$shortWordEndIndex=function(e){var t,n=0,i=/\s/,o=this.session.tokenRe;if(o.lastIndex=0,this.session.tokenRe.exec(e))n=this.session.tokenRe.lastIndex;else{for(;(t=e[n])&&i.test(t);)n++;if(n<1)for(o.lastIndex=0;(t=e[n])&&!o.test(t);)if(o.lastIndex=0,n++,i.test(t)){if(n>2){n--;break}for(;(t=e[n])&&i.test(t);)n++;if(n>2)break}}return o.lastIndex=0,n},this.moveCursorShortWordRight=function(){var e=this.lead.row,t=this.lead.column,n=this.doc.getLine(e),i=n.substring(t),o=this.session.getFoldAt(e,t,1);if(o)return this.moveCursorTo(o.end.row,o.end.column);if(t==n.length){var r=this.doc.getLength();do{e++,i=this.doc.getLine(e)}while(e<r&&/^\s*$/.test(i));/^\s+/.test(i)||(i=""),t=0}var s=this.$shortWordEndIndex(i);this.moveCursorTo(e,t+s)},this.moveCursorShortWordLeft=function(){var e,t=this.lead.row,n=this.lead.column;if(e=this.session.getFoldAt(t,n,-1))return this.moveCursorTo(e.start.row,e.start.column);var i=this.session.getLine(t).substring(0,n);if(0===n){do{t--,i=this.doc.getLine(t)}while(t>0&&/^\s*$/.test(i));n=i.length,/\s+$/.test(i)||(i="")}var r=o.stringReverse(i),s=this.$shortWordEndIndex(r);return this.moveCursorTo(t,n-s)},this.moveCursorWordRight=function(){this.session.$selectLongWords?this.moveCursorLongWordRight():this.moveCursorShortWordRight()},this.moveCursorWordLeft=function(){this.session.$selectLongWords?this.moveCursorLongWordLeft():this.moveCursorShortWordLeft()},this.moveCursorBy=function(e,t){var n,i=this.session.documentToScreenPosition(this.lead.row,this.lead.column);if(0===t&&(0!==e&&(this.session.$bidiHandler.isBidiRow(i.row,this.lead.row)?(n=this.session.$bidiHandler.getPosLeft(i.column),i.column=Math.round(n/this.session.$bidiHandler.charWidths[0])):n=i.column*this.session.$bidiHandler.charWidths[0]),this.$desiredColumn?i.column=this.$desiredColumn:this.$desiredColumn=i.column),0!=e&&this.session.lineWidgets&&this.session.lineWidgets[this.lead.row]){var o=this.session.lineWidgets[this.lead.row];e<0?e-=o.rowsAbove||0:e>0&&(e+=o.rowCount-(o.rowsAbove||0))}var r=this.session.screenToDocumentPosition(i.row+e,i.column,n);0!==e&&0===t&&r.row===this.lead.row&&(r.column,this.lead.column),this.moveCursorTo(r.row,r.column+t,0===t)},this.moveCursorToPosition=function(e){this.moveCursorTo(e.row,e.column)},this.moveCursorTo=function(e,t,n){var i=this.session.getFoldAt(e,t,1);i&&(e=i.start.row,t=i.start.column),this.$keepDesiredColumnOnChange=!0;var o=this.session.getLine(e);/[\uDC00-\uDFFF]/.test(o.charAt(t))&&o.charAt(t-1)&&(this.lead.row==e&&this.lead.column==t+1?t-=1:t+=1),this.lead.setPosition(e,t),this.$keepDesiredColumnOnChange=!1,n||(this.$desiredColumn=null)},this.moveCursorToScreen=function(e,t,n){var i=this.session.screenToDocumentPosition(e,t);this.moveCursorTo(i.row,i.column,n)},this.detach=function(){this.lead.detach(),this.anchor.detach()},this.fromOrientedRange=function(e){this.setSelectionRange(e,e.cursor==e.start),this.$desiredColumn=e.desiredColumn||this.$desiredColumn},this.toOrientedRange=function(e){var t=this.getRange();return e?(e.start.column=t.start.column,e.start.row=t.start.row,e.end.column=t.end.column,e.end.row=t.end.row):e=t,e.cursor=this.isBackwards()?e.start:e.end,e.desiredColumn=this.$desiredColumn,e},this.getRangeOfMovements=function(e){var t=this.getCursor();try{e(this);var n=this.getCursor();return s.fromPoints(t,n)}catch(e){return s.fromPoints(t,t)}finally{this.moveCursorToPosition(t)}},this.toJSON=function(){if(this.rangeCount)var e=this.ranges.map((function(e){var t=e.clone();return t.isBackwards=e.cursor==e.start,t}));else(e=this.getRange()).isBackwards=this.isBackwards();return e},this.fromJSON=function(e){if(null==e.start){if(this.rangeList&&e.length>1){this.toSingleRange(e[0]);for(var t=e.length;t--;){var n=s.fromPoints(e[t].start,e[t].end);e[t].isBackwards&&(n.cursor=n.start),this.addRange(n,!0)}return}e=e[0]}this.rangeList&&this.toSingleRange(e),this.setSelectionRange(e,e.isBackwards)},this.isEqual=function(e){if((e.length||this.rangeCount)&&e.length!=this.rangeCount)return!1;if(!e.length||!this.ranges)return this.getRange().isEqual(e);for(var t=this.ranges.length;t--;)if(!this.ranges[t].isEqual(e[t]))return!1;return!0}}).call(a.prototype),t.Selection=a})),ace.define("ace/tokenizer",["require","exports","module","ace/config"],(function(e,t,n){"use strict";var i=e("./config"),o=2e3,r=function(){function e(e){for(var t in this.states=e,this.regExps={},this.matchMappings={},this.states){for(var n=this.states[t],i=[],o=0,r=this.matchMappings[t]={defaultToken:"text"},s="g",a=[],l=0;l<n.length;l++){var c=n[l];if(c.defaultToken&&(r.defaultToken=c.defaultToken),c.caseInsensitive&&-1===s.indexOf("i")&&(s+="i"),c.unicode&&-1===s.indexOf("u")&&(s+="u"),null!=c.regex){c.regex instanceof RegExp&&(c.regex=c.regex.toString().slice(1,-1));var h=c.regex,d=new RegExp("(?:("+h+")|(.))").exec("a").length-2;Array.isArray(c.token)?1==c.token.length||1==d?c.token=c.token[0]:d-1!=c.token.length?(this.reportError("number of classes and regexp groups doesn't match",{rule:c,groupCount:d-1}),c.token=c.token[0]):(c.tokenArray=c.token,c.token=null,c.onMatch=this.$arrayTokens):"function"!=typeof c.token||c.onMatch||(c.onMatch=d>1?this.$applyToken:c.token),d>1&&(/\\\d/.test(c.regex)?h=c.regex.replace(/\\([0-9]+)/g,(function(e,t){return"\\"+(parseInt(t,10)+o+1)})):(d=1,h=this.removeCapturingGroups(c.regex)),c.splitRegex||"string"==typeof c.token||a.push(c)),r[o]=l,o+=d,i.push(h),c.onMatch||(c.onMatch=null)}}i.length||(r[0]=0,i.push("$")),a.forEach((function(e){e.splitRegex=this.createSplitterRegexp(e.regex,s)}),this),this.regExps[t]=new RegExp("("+i.join(")|(")+")|($)",s)}}return e.prototype.$setMaxTokenCount=function(e){o=0|e},e.prototype.$applyToken=function(e){var t=this.splitRegex.exec(e).slice(1),n=this.token.apply(this,t);if("string"==typeof n)return[{type:n,value:e}];for(var i=[],o=0,r=n.length;o<r;o++)t[o]&&(i[i.length]={type:n[o],value:t[o]});return i},e.prototype.$arrayTokens=function(e){if(!e)return[];var t=this.splitRegex.exec(e);if(!t)return"text";for(var n=[],i=this.tokenArray,o=0,r=i.length;o<r;o++)t[o+1]&&(n[n.length]={type:i[o],value:t[o+1]});return n},e.prototype.removeCapturingGroups=function(e){return e.replace(/\\.|\[(?:\\.|[^\\\]])*|\(\?[:=!<]|(\()/g,(function(e,t){return t?"(?:":e}))},e.prototype.createSplitterRegexp=function(e,t){if(-1!=e.indexOf("(?=")){var n=0,i=!1,o={};e.replace(/(\\.)|(\((?:\?[=!])?)|(\))|([\[\]])/g,(function(e,t,r,s,a,l){return i?i="]"!=a:a?i=!0:s?(n==o.stack&&(o.end=l+1,o.stack=-1),n--):r&&(n++,1!=r.length&&(o.stack=n,o.start=l)),e})),null!=o.end&&/^\)*$/.test(e.substr(o.end))&&(e=e.substring(0,o.start)+e.substr(o.end))}return"^"!=e.charAt(0)&&(e="^"+e),"$"!=e.charAt(e.length-1)&&(e+="$"),new RegExp(e,(t||"").replace("g",""))},e.prototype.getLineTokens=function(e,t){if(t&&"string"!=typeof t){var n=t.slice(0);"#tmp"===(t=n[0])&&(n.shift(),t=n.shift())}else n=[];var i=t||"start",r=this.states[i];r||(i="start",r=this.states[i]);var s=this.matchMappings[i],a=this.regExps[i];a.lastIndex=0;for(var l,c=[],h=0,d=0,u={type:null,value:""};l=a.exec(e);){var p=s.defaultToken,g=null,f=l[0],m=a.lastIndex;if(m-f.length>h){var v=e.substring(h,m-f.length);u.type==p?u.value+=v:(u.type&&c.push(u),u={type:p,value:v})}for(var w=0;w<l.length-2;w++)if(void 0!==l[w+1]){p=(g=r[s[w]]).onMatch?g.onMatch(f,i,n,e):g.token,g.next&&(i="string"==typeof g.next?g.next:g.next(i,n),(r=this.states[i])||(this.reportError("state doesn't exist",i),i="start",r=this.states[i]),s=this.matchMappings[i],h=m,(a=this.regExps[i]).lastIndex=m),g.consumeLineEnd&&(h=m);break}if(f)if("string"==typeof p)g&&!1===g.merge||u.type!==p?(u.type&&c.push(u),u={type:p,value:f}):u.value+=f;else if(p)for(u.type&&c.push(u),u={type:null,value:""},w=0;w<p.length;w++)c.push(p[w]);if(h==e.length)break;if(h=m,d++>o){for(d>2*e.length&&this.reportError("infinite loop with in ace tokenizer",{startState:t,line:e});h<e.length;)u.type&&c.push(u),u={value:e.substring(h,h+=500),type:"overflow"};i="start",n=[];break}}return u.type&&c.push(u),n.length>1&&n[0]!==i&&n.unshift("#tmp",i),{tokens:c,state:n.length?n:i}},e}();r.prototype.reportError=i.reportError,t.Tokenizer=r})),ace.define("ace/mode/text_highlight_rules",["require","exports","module","ace/lib/lang"],(function(e,t,n){"use strict";var i=e("../lib/lang"),o=function(){this.$rules={start:[{token:"empty_line",regex:"^$"},{defaultToken:"text"}]}};(function(){this.addRules=function(e,t){if(t)for(var n in e){for(var i=e[n],o=0;o<i.length;o++){var r=i[o];(r.next||r.onMatch)&&("string"==typeof r.next&&0!==r.next.indexOf(t)&&(r.next=t+r.next),r.nextState&&0!==r.nextState.indexOf(t)&&(r.nextState=t+r.nextState))}this.$rules[t+n]=i}else for(var n in e)this.$rules[n]=e[n]},this.getRules=function(){return this.$rules},this.embedRules=function(e,t,n,o,r){var s="function"==typeof e?(new e).getRules():e;if(o)for(var a=0;a<o.length;a++)o[a]=t+o[a];else for(var l in o=[],s)o.push(t+l);if(this.addRules(s,t),n){var c=Array.prototype[r?"push":"unshift"];for(a=0;a<o.length;a++)c.apply(this.$rules[o[a]],i.deepCopy(n))}this.$embeds||(this.$embeds=[]),this.$embeds.push(t)},this.getEmbeds=function(){return this.$embeds};var e=function(e,t){return("start"!=e||t.length)&&t.unshift(this.nextState,e),this.nextState},t=function(e,t){return t.shift(),t.shift()||"start"};this.normalizeRules=function(){var n=0,i=this.$rules;Object.keys(i).forEach((function o(r){var s=i[r];s.processed=!0;for(var a=0;a<s.length;a++){var l=s[a],c=null;Array.isArray(l)&&(c=l,l={}),!l.regex&&l.start&&(l.regex=l.start,l.next||(l.next=[]),l.next.push({defaultToken:l.token},{token:l.token+".end",regex:l.end||l.start,next:"pop"}),l.token=l.token+".start",l.push=!0);var h=l.next||l.push;if(h&&Array.isArray(h)){var d=l.stateName;d||("string"!=typeof(d=l.token)&&(d=d[0]||""),i[d]&&(d+=n++)),i[d]=h,l.next=d,o(d)}else"pop"==h&&(l.next=t);if(l.push&&(l.nextState=l.next||l.push,l.next=e,delete l.push),l.rules)for(var u in l.rules)i[u]?i[u].push&&i[u].push.apply(i[u],l.rules[u]):i[u]=l.rules[u];var p="string"==typeof l?l:l.include;if(p&&("$self"===p&&(p="start"),c=Array.isArray(p)?p.map((function(e){return i[e]})):i[p]),c){var g=[a,1].concat(c);l.noEscape&&(g=g.filter((function(e){return!e.next}))),s.splice.apply(s,g),a--}l.keywordMap&&(l.token=this.createKeywordMapper(l.keywordMap,l.defaultToken||"text",l.caseInsensitive),delete l.defaultToken)}}),this)},this.createKeywordMapper=function(e,t,n,i){var o=Object.create(null);return this.$keywordList=[],Object.keys(e).forEach((function(t){for(var r=e[t].split(i||"|"),s=r.length;s--;){var a=r[s];this.$keywordList.push(a),n&&(a=a.toLowerCase()),o[a]=t}}),this),e=null,n?function(e){return o[e.toLowerCase()]||t}:function(e){return o[e]||t}},this.getKeywords=function(){return this.$keywords}}).call(o.prototype),t.TextHighlightRules=o})),ace.define("ace/mode/behaviour",["require","exports","module"],(function(e,t,n){"use strict";var i=function(){this.$behaviours={}};(function(){this.add=function(e,t,n){switch(void 0){case this.$behaviours:this.$behaviours={};case this.$behaviours[e]:this.$behaviours[e]={}}this.$behaviours[e][t]=n},this.addBehaviours=function(e){for(var t in e)for(var n in e[t])this.add(t,n,e[t][n])},this.remove=function(e){this.$behaviours&&this.$behaviours[e]&&delete this.$behaviours[e]},this.inherit=function(e,t){if("function"==typeof e)var n=(new e).getBehaviours(t);else n=e.getBehaviours(t);this.addBehaviours(n)},this.getBehaviours=function(e){if(e){for(var t={},n=0;n<e.length;n++)this.$behaviours[e[n]]&&(t[e[n]]=this.$behaviours[e[n]]);return t}return this.$behaviours}}).call(i.prototype),t.Behaviour=i})),ace.define("ace/token_iterator",["require","exports","module","ace/range"],(function(e,t,n){"use strict";var i=e("./range").Range,o=function(){function e(e,t,n){this.$session=e,this.$row=t,this.$rowTokens=e.getTokens(t);var i=e.getTokenAt(t,n);this.$tokenIndex=i?i.index:-1}return e.prototype.stepBackward=function(){for(this.$tokenIndex-=1;this.$tokenIndex<0;){if(this.$row-=1,this.$row<0)return this.$row=0,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=this.$rowTokens.length-1}return this.$rowTokens[this.$tokenIndex]},e.prototype.stepForward=function(){var e;for(this.$tokenIndex+=1;this.$tokenIndex>=this.$rowTokens.length;){if(this.$row+=1,e||(e=this.$session.getLength()),this.$row>=e)return this.$row=e-1,null;this.$rowTokens=this.$session.getTokens(this.$row),this.$tokenIndex=0}return this.$rowTokens[this.$tokenIndex]},e.prototype.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex]},e.prototype.getCurrentTokenRow=function(){return this.$row},e.prototype.getCurrentTokenColumn=function(){var e=this.$rowTokens,t=this.$tokenIndex,n=e[t].start;if(void 0!==n)return n;for(n=0;t>0;)n+=e[t-=1].value.length;return n},e.prototype.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()}},e.prototype.getCurrentTokenRange=function(){var e=this.$rowTokens[this.$tokenIndex],t=this.getCurrentTokenColumn();return new i(this.$row,t,this.$row,t+e.value.length)},e}();t.TokenIterator=o})),ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],(function(e,t,n){"use strict";var i,o=e("../../lib/oop"),r=e("../behaviour").Behaviour,s=e("../../token_iterator").TokenIterator,a=e("../../lib/lang"),l=["text","paren.rparen","rparen","paren","punctuation.operator"],c=["text","paren.rparen","rparen","paren","punctuation.operator","comment"],h={},d={'"':'"',"'":"'"},u=function(e){var t=-1;if(e.multiSelect&&(t=e.selection.index,h.rangeCount!=e.multiSelect.rangeCount&&(h={rangeCount:e.multiSelect.rangeCount})),h[t])return i=h[t];i=h[t]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""}},p=function(e,t,n,i){var o=e.end.row-e.start.row;return{text:n+t+i,selection:[0,e.start.column+1,o,e.end.column+(o?0:1)]}},g=function(e){e=e||{},this.add("braces","insertion",(function(t,n,o,r,s){var l=o.getCursorPosition(),c=r.doc.getLine(l.row);if("{"==s){u(o);var h=o.getSelectionRange(),d=r.doc.getTextRange(h);if(""!==d&&"{"!==d&&o.getWrapBehavioursEnabled())return p(h,d,"{","}");if(g.isSaneInsertion(o,r))return/[\]\}\)]/.test(c[l.column])||o.inMultiSelectMode||e.braces?(g.recordAutoInsert(o,r,"}"),{text:"{}",selection:[1,1]}):(g.recordMaybeInsert(o,r,"{"),{text:"{",selection:[1,1]})}else if("}"==s){if(u(o),"}"==c.substring(l.column,l.column+1)&&null!==r.$findOpeningBracket("}",{column:l.column+1,row:l.row})&&g.isAutoInsertedClosing(l,c,s))return g.popAutoInsertedClosing(),{text:"",selection:[1,1]}}else{if("\n"==s||"\r\n"==s){u(o);var f="";if(g.isMaybeInsertedClosing(l,c)&&(f=a.stringRepeat("}",i.maybeInsertedBrackets),g.clearMaybeInsertedClosing()),"}"===c.substring(l.column,l.column+1)){var m=r.findMatchingBracket({row:l.row,column:l.column+1},"}");if(!m)return null;var v=this.$getIndent(r.getLine(m.row))}else{if(!f)return void g.clearMaybeInsertedClosing();v=this.$getIndent(c)}var w=v+r.getTabString();return{text:"\n"+w+"\n"+v+f,selection:[1,w.length,1,w.length]}}g.clearMaybeInsertedClosing()}})),this.add("braces","deletion",(function(e,t,n,o,r){var s=o.doc.getTextRange(r);if(!r.isMultiLine()&&"{"==s){if(u(n),"}"==o.doc.getLine(r.start.row).substring(r.end.column,r.end.column+1))return r.end.column++,r;i.maybeInsertedBrackets--}})),this.add("parens","insertion",(function(e,t,n,i,o){if("("==o){u(n);var r=n.getSelectionRange(),s=i.doc.getTextRange(r);if(""!==s&&n.getWrapBehavioursEnabled())return p(r,s,"(",")");if(g.isSaneInsertion(n,i))return g.recordAutoInsert(n,i,")"),{text:"()",selection:[1,1]}}else if(")"==o){u(n);var a=n.getCursorPosition(),l=i.doc.getLine(a.row);if(")"==l.substring(a.column,a.column+1)&&null!==i.$findOpeningBracket(")",{column:a.column+1,row:a.row})&&g.isAutoInsertedClosing(a,l,o))return g.popAutoInsertedClosing(),{text:"",selection:[1,1]}}})),this.add("parens","deletion",(function(e,t,n,i,o){var r=i.doc.getTextRange(o);if(!o.isMultiLine()&&"("==r&&(u(n),")"==i.doc.getLine(o.start.row).substring(o.start.column+1,o.start.column+2)))return o.end.column++,o})),this.add("brackets","insertion",(function(e,t,n,i,o){if("["==o){u(n);var r=n.getSelectionRange(),s=i.doc.getTextRange(r);if(""!==s&&n.getWrapBehavioursEnabled())return p(r,s,"[","]");if(g.isSaneInsertion(n,i))return g.recordAutoInsert(n,i,"]"),{text:"[]",selection:[1,1]}}else if("]"==o){u(n);var a=n.getCursorPosition(),l=i.doc.getLine(a.row);if("]"==l.substring(a.column,a.column+1)&&null!==i.$findOpeningBracket("]",{column:a.column+1,row:a.row})&&g.isAutoInsertedClosing(a,l,o))return g.popAutoInsertedClosing(),{text:"",selection:[1,1]}}})),this.add("brackets","deletion",(function(e,t,n,i,o){var r=i.doc.getTextRange(o);if(!o.isMultiLine()&&"["==r&&(u(n),"]"==i.doc.getLine(o.start.row).substring(o.start.column+1,o.start.column+2)))return o.end.column++,o})),this.add("string_dquotes","insertion",(function(e,t,n,i,o){var r=i.$mode.$quotes||d;if(1==o.length&&r[o]){if(this.lineCommentStart&&-1!=this.lineCommentStart.indexOf(o))return;u(n);var s=o,a=n.getSelectionRange(),l=i.doc.getTextRange(a);if(!(""===l||1==l.length&&r[l])&&n.getWrapBehavioursEnabled())return p(a,l,s,s);if(!l){var c=n.getCursorPosition(),h=i.doc.getLine(c.row),g=h.substring(c.column-1,c.column),f=h.substring(c.column,c.column+1),m=i.getTokenAt(c.row,c.column),v=i.getTokenAt(c.row,c.column+1);if("\\"==g&&m&&/escape/.test(m.type))return null;var w,b=m&&/string|escape/.test(m.type),y=!v||/string|escape/.test(v.type);if(f==s)(w=b!==y)&&/string\.end/.test(v.type)&&(w=!1);else{if(b&&!y)return null;if(b&&y)return null;var C=i.$mode.tokenRe;C.lastIndex=0;var $=C.test(g);C.lastIndex=0;var x=C.test(f),_=i.$mode.$pairQuotesAfter;if(!(_&&_[s]&&_[s].test(g))&&$||x)return null;if(f&&!/[\s;,.})\]\\]/.test(f))return null;var S=h[c.column-2];if(g==s&&(S==s||C.test(S)))return null;w=!0}return{text:w?s+s:"",selection:[1,1]}}}})),this.add("string_dquotes","deletion",(function(e,t,n,i,o){var r=i.$mode.$quotes||d,s=i.doc.getTextRange(o);if(!o.isMultiLine()&&r.hasOwnProperty(s)&&(u(n),i.doc.getLine(o.start.row).substring(o.start.column+1,o.start.column+2)==s))return o.end.column++,o})),!1!==e.closeDocComment&&this.add("doc comment end","insertion",(function(e,t,n,i,o){if("doc-start"===e&&("\n"===o||"\r\n"===o)&&n.selection.isEmpty()){var r=n.getCursorPosition(),s=i.doc.getLine(r.row),a=i.doc.getLine(r.row+1),l=this.$getIndent(s);if(/\s*\*/.test(a))return/^\s*\*/.test(s)?{text:o+l+"* ",selection:[1,3+l.length,1,3+l.length]}:{text:o+l+" * ",selection:[1,3+l.length,1,3+l.length]};if(/\/\*\*/.test(s.substring(0,r.column)))return{text:o+l+" * "+o+" "+l+"*/",selection:[1,4+l.length,1,4+l.length]}}}))};g.isSaneInsertion=function(e,t){var n=e.getCursorPosition(),i=new s(t,n.row,n.column);if(!this.$matchTokenType(i.getCurrentToken()||"text",l)){if(/[)}\]]/.test(e.session.getLine(n.row)[n.column]))return!0;var o=new s(t,n.row,n.column+1);if(!this.$matchTokenType(o.getCurrentToken()||"text",l))return!1}return i.stepForward(),i.getCurrentTokenRow()!==n.row||this.$matchTokenType(i.getCurrentToken()||"text",c)},g.$matchTokenType=function(e,t){return t.indexOf(e.type||e)>-1},g.recordAutoInsert=function(e,t,n){var o=e.getCursorPosition(),r=t.doc.getLine(o.row);this.isAutoInsertedClosing(o,r,i.autoInsertedLineEnd[0])||(i.autoInsertedBrackets=0),i.autoInsertedRow=o.row,i.autoInsertedLineEnd=n+r.substr(o.column),i.autoInsertedBrackets++},g.recordMaybeInsert=function(e,t,n){var o=e.getCursorPosition(),r=t.doc.getLine(o.row);this.isMaybeInsertedClosing(o,r)||(i.maybeInsertedBrackets=0),i.maybeInsertedRow=o.row,i.maybeInsertedLineStart=r.substr(0,o.column)+n,i.maybeInsertedLineEnd=r.substr(o.column),i.maybeInsertedBrackets++},g.isAutoInsertedClosing=function(e,t,n){return i.autoInsertedBrackets>0&&e.row===i.autoInsertedRow&&n===i.autoInsertedLineEnd[0]&&t.substr(e.column)===i.autoInsertedLineEnd},g.isMaybeInsertedClosing=function(e,t){return i.maybeInsertedBrackets>0&&e.row===i.maybeInsertedRow&&t.substr(e.column)===i.maybeInsertedLineEnd&&t.substr(0,e.column)==i.maybeInsertedLineStart},g.popAutoInsertedClosing=function(){i.autoInsertedLineEnd=i.autoInsertedLineEnd.substr(1),i.autoInsertedBrackets--},g.clearMaybeInsertedClosing=function(){i&&(i.maybeInsertedBrackets=0,i.maybeInsertedRow=-1)},o.inherits(g,r),t.CstyleBehaviour=g})),ace.define("ace/unicode",["require","exports","module"],(function(e,t,n){"use strict";for(var i=[48,9,8,25,5,0,2,25,48,0,11,0,5,0,6,22,2,30,2,457,5,11,15,4,8,0,2,0,18,116,2,1,3,3,9,0,2,2,2,0,2,19,2,82,2,138,2,4,3,155,12,37,3,0,8,38,10,44,2,0,2,1,2,1,2,0,9,26,6,2,30,10,7,61,2,9,5,101,2,7,3,9,2,18,3,0,17,58,3,100,15,53,5,0,6,45,211,57,3,18,2,5,3,11,3,9,2,1,7,6,2,2,2,7,3,1,3,21,2,6,2,0,4,3,3,8,3,1,3,3,9,0,5,1,2,4,3,11,16,2,2,5,5,1,3,21,2,6,2,1,2,1,2,1,3,0,2,4,5,1,3,2,4,0,8,3,2,0,8,15,12,2,2,8,2,2,2,21,2,6,2,1,2,4,3,9,2,2,2,2,3,0,16,3,3,9,18,2,2,7,3,1,3,21,2,6,2,1,2,4,3,8,3,1,3,2,9,1,5,1,2,4,3,9,2,0,17,1,2,5,4,2,2,3,4,1,2,0,2,1,4,1,4,2,4,11,5,4,4,2,2,3,3,0,7,0,15,9,18,2,2,7,2,2,2,22,2,9,2,4,4,7,2,2,2,3,8,1,2,1,7,3,3,9,19,1,2,7,2,2,2,22,2,9,2,4,3,8,2,2,2,3,8,1,8,0,2,3,3,9,19,1,2,7,2,2,2,22,2,15,4,7,2,2,2,3,10,0,9,3,3,9,11,5,3,1,2,17,4,23,2,8,2,0,3,6,4,0,5,5,2,0,2,7,19,1,14,57,6,14,2,9,40,1,2,0,3,1,2,0,3,0,7,3,2,6,2,2,2,0,2,0,3,1,2,12,2,2,3,4,2,0,2,5,3,9,3,1,35,0,24,1,7,9,12,0,2,0,2,0,5,9,2,35,5,19,2,5,5,7,2,35,10,0,58,73,7,77,3,37,11,42,2,0,4,328,2,3,3,6,2,0,2,3,3,40,2,3,3,32,2,3,3,6,2,0,2,3,3,14,2,56,2,3,3,66,5,0,33,15,17,84,13,619,3,16,2,25,6,74,22,12,2,6,12,20,12,19,13,12,2,2,2,1,13,51,3,29,4,0,5,1,3,9,34,2,3,9,7,87,9,42,6,69,11,28,4,11,5,11,11,39,3,4,12,43,5,25,7,10,38,27,5,62,2,28,3,10,7,9,14,0,89,75,5,9,18,8,13,42,4,11,71,55,9,9,4,48,83,2,2,30,14,230,23,280,3,5,3,37,3,5,3,7,2,0,2,0,2,0,2,30,3,52,2,6,2,0,4,2,2,6,4,3,3,5,5,12,6,2,2,6,67,1,20,0,29,0,14,0,17,4,60,12,5,0,4,11,18,0,5,0,3,9,2,0,4,4,7,0,2,0,2,0,2,3,2,10,3,3,6,4,5,0,53,1,2684,46,2,46,2,132,7,6,15,37,11,53,10,0,17,22,10,6,2,6,2,6,2,6,2,6,2,6,2,6,2,6,2,31,48,0,470,1,36,5,2,4,6,1,5,85,3,1,3,2,2,89,2,3,6,40,4,93,18,23,57,15,513,6581,75,20939,53,1164,68,45,3,268,4,27,21,31,3,13,13,1,2,24,9,69,11,1,38,8,3,102,3,1,111,44,25,51,13,68,12,9,7,23,4,0,5,45,3,35,13,28,4,64,15,10,39,54,10,13,3,9,7,22,4,1,5,66,25,2,227,42,2,1,3,9,7,11171,13,22,5,48,8453,301,3,61,3,105,39,6,13,4,6,11,2,12,2,4,2,0,2,1,2,1,2,107,34,362,19,63,3,53,41,11,5,15,17,6,13,1,25,2,33,4,2,134,20,9,8,25,5,0,2,25,12,88,4,5,3,5,3,5,3,2],o=0,r=[],s=0;s<i.length;s+=2)r.push(o+=i[s]),i[s+1]&&r.push(45,o+=i[s+1]);t.wordChars=String.fromCharCode.apply(null,r)})),ace.define("ace/mode/text",["require","exports","module","ace/config","ace/tokenizer","ace/mode/text_highlight_rules","ace/mode/behaviour/cstyle","ace/unicode","ace/lib/lang","ace/token_iterator","ace/range"],(function(e,t,n){"use strict";var i=e("../config"),o=e("../tokenizer").Tokenizer,r=e("./text_highlight_rules").TextHighlightRules,s=e("./behaviour/cstyle").CstyleBehaviour,a=e("../unicode"),l=e("../lib/lang"),c=e("../token_iterator").TokenIterator,h=e("../range").Range,d=function(){this.HighlightRules=r};(function(){this.$defaultBehaviour=new s,this.tokenRe=new RegExp("^["+a.wordChars+"\\$_]+","g"),this.nonTokenRe=new RegExp("^(?:[^"+a.wordChars+"\\$_]|\\s])+","g"),this.getTokenizer=function(){return this.$tokenizer||(this.$highlightRules=this.$highlightRules||new this.HighlightRules(this.$highlightRuleConfig),this.$tokenizer=new o(this.$highlightRules.getRules())),this.$tokenizer},this.lineCommentStart="",this.blockComment="",this.toggleCommentLines=function(e,t,n,i){var o=t.doc,r=!0,s=!0,a=1/0,c=t.getTabSize(),h=!1;if(this.lineCommentStart){Array.isArray(this.lineCommentStart)?(f=this.lineCommentStart.map(l.escapeRegExp).join("|"),p=this.lineCommentStart[0]):(f=l.escapeRegExp(this.lineCommentStart),p=this.lineCommentStart),f=new RegExp("^(\\s*)(?:"+f+") ?"),h=t.getUseSoftTabs(),w=function(e,t){var n=e.match(f);if(n){var i=n[1].length,r=n[0].length;u(e,i,r)||" "!=n[0][r-1]||r--,o.removeInLine(t,i,r)}};var d=p+" ",u=(v=function(e,t){r&&!/\S/.test(e)||(u(e,a,a)?o.insertInLine({row:t,column:a},d):o.insertInLine({row:t,column:a},p))},b=function(e,t){return f.test(e)},function(e,t,n){for(var i=0;t--&&" "==e.charAt(t);)i++;if(i%c!=0)return!1;for(i=0;" "==e.charAt(n++);)i++;return c>2?i%c!=c-1:i%c==0})}else{if(!this.blockComment)return!1;var p=this.blockComment.start,g=this.blockComment.end,f=new RegExp("^(\\s*)(?:"+l.escapeRegExp(p)+")"),m=new RegExp("(?:"+l.escapeRegExp(g)+")\\s*$"),v=function(e,t){b(e,t)||r&&!/\S/.test(e)||(o.insertInLine({row:t,column:e.length},g),o.insertInLine({row:t,column:a},p))},w=function(e,t){var n;(n=e.match(m))&&o.removeInLine(t,e.length-n[0].length,e.length),(n=e.match(f))&&o.removeInLine(t,n[1].length,n[0].length)},b=function(e,n){if(f.test(e))return!0;for(var i=t.getTokens(n),o=0;o<i.length;o++)if("comment"===i[o].type)return!0}}function y(e){for(var t=n;t<=i;t++)e(o.getLine(t),t)}var C=1/0;y((function(e,t){var n=e.search(/\S/);-1!==n?(n<a&&(a=n),s&&!b(e,t)&&(s=!1)):C>e.length&&(C=e.length)})),a==1/0&&(a=C,r=!1,s=!1),h&&a%c!=0&&(a=Math.floor(a/c)*c),y(s?w:v)},this.toggleBlockComment=function(e,t,n,i){var o=this.blockComment;if(o){!o.start&&o[0]&&(o=o[0]);var r,s,a=(f=new c(t,i.row,i.column)).getCurrentToken(),l=(t.selection,t.selection.toOrientedRange());if(a&&/comment/.test(a.type)){for(var d,u;a&&/comment/.test(a.type);){if(-1!=(m=a.value.indexOf(o.start))){var p=f.getCurrentTokenRow(),g=f.getCurrentTokenColumn()+m;d=new h(p,g,p,g+o.start.length);break}a=f.stepBackward()}var f;for(a=(f=new c(t,i.row,i.column)).getCurrentToken();a&&/comment/.test(a.type);){var m;if(-1!=(m=a.value.indexOf(o.end))){p=f.getCurrentTokenRow(),g=f.getCurrentTokenColumn()+m,u=new h(p,g,p,g+o.end.length);break}a=f.stepForward()}u&&t.remove(u),d&&(t.remove(d),r=d.start.row,s=-o.start.length)}else s=o.start.length,r=n.start.row,t.insert(n.end,o.end),t.insert(n.start,o.start);l.start.row==r&&(l.start.column+=s),l.end.row==r&&(l.end.column+=s),t.selection.fromOrientedRange(l)}},this.getNextLineIndent=function(e,t,n){return this.$getIndent(t)},this.checkOutdent=function(e,t,n){return!1},this.autoOutdent=function(e,t,n){},this.$getIndent=function(e){return e.match(/^\s*/)[0]},this.createWorker=function(e){return null},this.createModeDelegates=function(e){for(var t in this.$embeds=[],this.$modes={},e)if(e[t]){var n=e[t],o=n.prototype.$id,r=i.$modes[o];r||(i.$modes[o]=r=new n),i.$modes[t]||(i.$modes[t]=r),this.$embeds.push(t),this.$modes[t]=r}var s=["toggleBlockComment","toggleCommentLines","getNextLineIndent","checkOutdent","autoOutdent","transformAction","getCompletions"];for(t=0;t<s.length;t++)!function(e){var n=s[t],i=e[n];e[s[t]]=function(){return this.$delegator(n,arguments,i)}}(this)},this.$delegator=function(e,t,n){var i=t[0]||"start";if("string"!=typeof i){if(Array.isArray(i[2])){var o=i[2][i[2].length-1];if(s=this.$modes[o])return s[e].apply(s,[i[1]].concat([].slice.call(t,1)))}i=i[0]||"start"}for(var r=0;r<this.$embeds.length;r++)if(this.$modes[this.$embeds[r]]){var s,a=i.split(this.$embeds[r]);if(!a[0]&&a[1])return t[0]=a[1],(s=this.$modes[this.$embeds[r]])[e].apply(s,t)}var l=n.apply(this,t);return n?l:void 0},this.transformAction=function(e,t,n,i,o){if(this.$behaviour){var r=this.$behaviour.getBehaviours();for(var s in r)if(r[s][t]){var a=r[s][t].apply(this,arguments);if(a)return a}}},this.getKeywords=function(e){if(!this.completionKeywords){var t=this.$tokenizer.rules,n=[];for(var i in t)for(var o=t[i],r=0,s=o.length;r<s;r++)if("string"==typeof o[r].token)/keyword|support|storage/.test(o[r].token)&&n.push(o[r].regex);else if("object"==typeof o[r].token)for(var a=0,l=o[r].token.length;a<l;a++)/keyword|support|storage/.test(o[r].token[a])&&(i=o[r].regex.match(/\(.+?\)/g)[a],n.push(i.substr(1,i.length-2)));this.completionKeywords=n}return e?n.concat(this.$keywordList||[]):this.$keywordList},this.$createKeywordList=function(){return this.$highlightRules||this.getTokenizer(),this.$keywordList=this.$highlightRules.$keywordList||[]},this.getCompletions=function(e,t,n,i){return(this.$keywordList||this.$createKeywordList()).map((function(e){return{name:e,value:e,score:0,meta:"keyword"}}))},this.$id="ace/mode/text"}).call(d.prototype),t.Mode=d})),ace.define("ace/apply_delta",["require","exports","module"],(function(e,t,n){"use strict";t.applyDelta=function(e,t,n){var i=t.start.row,o=t.start.column,r=e[i]||"";switch(t.action){case"insert":if(1===t.lines.length)e[i]=r.substring(0,o)+t.lines[0]+r.substring(o);else{var s=[i,1].concat(t.lines);e.splice.apply(e,s),e[i]=r.substring(0,o)+e[i],e[i+t.lines.length-1]+=r.substring(o)}break;case"remove":var a=t.end.column,l=t.end.row;i===l?e[i]=r.substring(0,o)+r.substring(a):e.splice(i,l-i+1,r.substring(0,o)+e[l].substring(a))}}})),ace.define("ace/anchor",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],(function(e,t,n){"use strict";var i=e("./lib/oop"),o=e("./lib/event_emitter").EventEmitter,r=function(){function e(e,t,n){this.$onChange=this.onChange.bind(this),this.attach(e),void 0===n?this.setPosition(t.row,t.column):this.setPosition(t,n)}return e.prototype.getPosition=function(){return this.$clipPositionToDocument(this.row,this.column)},e.prototype.getDocument=function(){return this.document},e.prototype.onChange=function(e){if(!(e.start.row==e.end.row&&e.start.row!=this.row||e.start.row>this.row)){var t=function(e,t,n){var i="insert"==e.action,o=(i?1:-1)*(e.end.row-e.start.row),r=(i?1:-1)*(e.end.column-e.start.column),a=e.start,l=i?a:e.end;return s(t,a,n)?{row:t.row,column:t.column}:s(l,t,!n)?{row:t.row+o,column:t.column+(t.row==l.row?r:0)}:{row:a.row,column:a.column}}(e,{row:this.row,column:this.column},this.$insertRight);this.setPosition(t.row,t.column,!0)}},e.prototype.setPosition=function(e,t,n){var i;if(i=n?{row:e,column:t}:this.$clipPositionToDocument(e,t),this.row!=i.row||this.column!=i.column){var o={row:this.row,column:this.column};this.row=i.row,this.column=i.column,this._signal("change",{old:o,value:i})}},e.prototype.detach=function(){this.document.off("change",this.$onChange)},e.prototype.attach=function(e){this.document=e||this.document,this.document.on("change",this.$onChange)},e.prototype.$clipPositionToDocument=function(e,t){var n={};return e>=this.document.getLength()?(n.row=Math.max(0,this.document.getLength()-1),n.column=this.document.getLine(n.row).length):e<0?(n.row=0,n.column=0):(n.row=e,n.column=Math.min(this.document.getLine(n.row).length,Math.max(0,t))),t<0&&(n.column=0),n},e}();function s(e,t,n){var i=n?e.column<=t.column:e.column<t.column;return e.row<t.row||e.row==t.row&&i}r.prototype.$insertRight=!1,i.implement(r.prototype,o),t.Anchor=r})),ace.define("ace/document",["require","exports","module","ace/lib/oop","ace/apply_delta","ace/lib/event_emitter","ace/range","ace/anchor"],(function(e,t,n){"use strict";var i=e("./lib/oop"),o=e("./apply_delta").applyDelta,r=e("./lib/event_emitter").EventEmitter,s=e("./range").Range,a=e("./anchor").Anchor,l=function(){function e(e){this.$lines=[""],0===e.length?this.$lines=[""]:Array.isArray(e)?this.insertMergedLines({row:0,column:0},e):this.insert({row:0,column:0},e)}return e.prototype.setValue=function(e){var t=this.getLength()-1;this.remove(new s(0,0,t,this.getLine(t).length)),this.insert({row:0,column:0},e||"")},e.prototype.getValue=function(){return this.getAllLines().join(this.getNewLineCharacter())},e.prototype.createAnchor=function(e,t){return new a(this,e,t)},e.prototype.$detectNewLine=function(e){var t=e.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=t?t[1]:"\n",this._signal("changeNewLineMode")},e.prototype.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\r\n";case"unix":return"\n";default:return this.$autoNewLine||"\n"}},e.prototype.setNewLineMode=function(e){this.$newLineMode!==e&&(this.$newLineMode=e,this._signal("changeNewLineMode"))},e.prototype.getNewLineMode=function(){return this.$newLineMode},e.prototype.isNewLine=function(e){return"\r\n"==e||"\r"==e||"\n"==e},e.prototype.getLine=function(e){return this.$lines[e]||""},e.prototype.getLines=function(e,t){return this.$lines.slice(e,t+1)},e.prototype.getAllLines=function(){return this.getLines(0,this.getLength())},e.prototype.getLength=function(){return this.$lines.length},e.prototype.getTextRange=function(e){return this.getLinesForRange(e).join(this.getNewLineCharacter())},e.prototype.getLinesForRange=function(e){var t;if(e.start.row===e.end.row)t=[this.getLine(e.start.row).substring(e.start.column,e.end.column)];else{(t=this.getLines(e.start.row,e.end.row))[0]=(t[0]||"").substring(e.start.column);var n=t.length-1;e.end.row-e.start.row==n&&(t[n]=t[n].substring(0,e.end.column))}return t},e.prototype.insertLines=function(e,t){return console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead."),this.insertFullLines(e,t)},e.prototype.removeLines=function(e,t){return console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead."),this.removeFullLines(e,t)},e.prototype.insertNewLine=function(e){return console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."),this.insertMergedLines(e,["",""])},e.prototype.insert=function(e,t){return this.getLength()<=1&&this.$detectNewLine(t),this.insertMergedLines(e,this.$split(t))},e.prototype.insertInLine=function(e,t){var n=this.clippedPos(e.row,e.column),i=this.pos(e.row,e.column+t.length);return this.applyDelta({start:n,end:i,action:"insert",lines:[t]},!0),this.clonePos(i)},e.prototype.clippedPos=function(e,t){var n=this.getLength();void 0===e?e=n:e<0?e=0:e>=n&&(e=n-1,t=void 0);var i=this.getLine(e);return null==t&&(t=i.length),{row:e,column:t=Math.min(Math.max(t,0),i.length)}},e.prototype.clonePos=function(e){return{row:e.row,column:e.column}},e.prototype.pos=function(e,t){return{row:e,column:t}},e.prototype.$clipPosition=function(e){var t=this.getLength();return e.row>=t?(e.row=Math.max(0,t-1),e.column=this.getLine(t-1).length):(e.row=Math.max(0,e.row),e.column=Math.min(Math.max(e.column,0),this.getLine(e.row).length)),e},e.prototype.insertFullLines=function(e,t){var n=0;(e=Math.min(Math.max(e,0),this.getLength()))<this.getLength()?(t=t.concat([""]),n=0):(t=[""].concat(t),e--,n=this.$lines[e].length),this.insertMergedLines({row:e,column:n},t)},e.prototype.insertMergedLines=function(e,t){var n=this.clippedPos(e.row,e.column),i={row:n.row+t.length-1,column:(1==t.length?n.column:0)+t[t.length-1].length};return this.applyDelta({start:n,end:i,action:"insert",lines:t}),this.clonePos(i)},e.prototype.remove=function(e){var t=this.clippedPos(e.start.row,e.start.column),n=this.clippedPos(e.end.row,e.end.column);return this.applyDelta({start:t,end:n,action:"remove",lines:this.getLinesForRange({start:t,end:n})}),this.clonePos(t)},e.prototype.removeInLine=function(e,t,n){var i=this.clippedPos(e,t),o=this.clippedPos(e,n);return this.applyDelta({start:i,end:o,action:"remove",lines:this.getLinesForRange({start:i,end:o})},!0),this.clonePos(i)},e.prototype.removeFullLines=function(e,t){e=Math.min(Math.max(0,e),this.getLength()-1);var n=(t=Math.min(Math.max(0,t),this.getLength()-1))==this.getLength()-1&&e>0,i=t<this.getLength()-1,o=n?e-1:e,r=n?this.getLine(o).length:0,a=i?t+1:t,l=i?0:this.getLine(a).length,c=new s(o,r,a,l),h=this.$lines.slice(e,t+1);return this.applyDelta({start:c.start,end:c.end,action:"remove",lines:this.getLinesForRange(c)}),h},e.prototype.removeNewLine=function(e){e<this.getLength()-1&&e>=0&&this.applyDelta({start:this.pos(e,this.getLine(e).length),end:this.pos(e+1,0),action:"remove",lines:["",""]})},e.prototype.replace=function(e,t){return e instanceof s||(e=s.fromPoints(e.start,e.end)),0===t.length&&e.isEmpty()?e.start:t==this.getTextRange(e)?e.end:(this.remove(e),t?this.insert(e.start,t):e.start)},e.prototype.applyDeltas=function(e){for(var t=0;t<e.length;t++)this.applyDelta(e[t])},e.prototype.revertDeltas=function(e){for(var t=e.length-1;t>=0;t--)this.revertDelta(e[t])},e.prototype.applyDelta=function(e,t){var n="insert"==e.action;(n?e.lines.length<=1&&!e.lines[0]:!s.comparePoints(e.start,e.end))||(n&&e.lines.length>2e4?this.$splitAndapplyLargeDelta(e,2e4):(o(this.$lines,e,t),this._signal("change",e)))},e.prototype.$safeApplyDelta=function(e){var t=this.$lines.length;("remove"==e.action&&e.start.row<t&&e.end.row<t||"insert"==e.action&&e.start.row<=t)&&this.applyDelta(e)},e.prototype.$splitAndapplyLargeDelta=function(e,t){for(var n=e.lines,i=n.length-t+1,o=e.start.row,r=e.start.column,s=0,a=0;s<i;s=a){a+=t-1;var l=n.slice(s,a);l.push(""),this.applyDelta({start:this.pos(o+s,r),end:this.pos(o+a,r=0),action:e.action,lines:l},!0)}e.lines=n.slice(s),e.start.row=o+s,e.start.column=r,this.applyDelta(e,!0)},e.prototype.revertDelta=function(e){this.$safeApplyDelta({start:this.clonePos(e.start),end:this.clonePos(e.end),action:"insert"==e.action?"remove":"insert",lines:e.lines.slice()})},e.prototype.indexToPosition=function(e,t){for(var n=this.$lines||this.getAllLines(),i=this.getNewLineCharacter().length,o=t||0,r=n.length;o<r;o++)if((e-=n[o].length+i)<0)return{row:o,column:e+n[o].length+i};return{row:r-1,column:e+n[r-1].length+i}},e.prototype.positionToIndex=function(e,t){for(var n=this.$lines||this.getAllLines(),i=this.getNewLineCharacter().length,o=0,r=Math.min(e.row,n.length),s=t||0;s<r;++s)o+=n[s].length+i;return o+e.column},e.prototype.$split=function(e){return e.split(/\r\n|\r|\n/)},e}();l.prototype.$autoNewLine="",l.prototype.$newLineMode="auto",i.implement(l.prototype,r),t.Document=l})),ace.define("ace/background_tokenizer",["require","exports","module","ace/lib/oop","ace/lib/event_emitter"],(function(e,t,n){"use strict";var i=e("./lib/oop"),o=e("./lib/event_emitter").EventEmitter,r=function(){function e(e,t){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.tokenizer=e;var n=this;this.$worker=function(){if(n.running){for(var e=new Date,t=n.currentLine,i=-1,o=n.doc,r=t;n.lines[t];)t++;var s=o.getLength(),a=0;for(n.running=!1;t<s;){n.$tokenizeRow(t),i=t;do{t++}while(n.lines[t]);if(++a%5==0&&new Date-e>20){n.running=setTimeout(n.$worker,20);break}}n.currentLine=t,-1==i&&(i=t),r<=i&&n.fireUpdateEvent(r,i)}}}return e.prototype.setTokenizer=function(e){this.tokenizer=e,this.lines=[],this.states=[],this.start(0)},e.prototype.setDocument=function(e){this.doc=e,this.lines=[],this.states=[],this.stop()},e.prototype.fireUpdateEvent=function(e,t){var n={first:e,last:t};this._signal("update",{data:n})},e.prototype.start=function(e){this.currentLine=Math.min(e||0,this.currentLine,this.doc.getLength()),this.lines.splice(this.currentLine,this.lines.length),this.states.splice(this.currentLine,this.states.length),this.stop(),this.running=setTimeout(this.$worker,700)},e.prototype.scheduleStart=function(){this.running||(this.running=setTimeout(this.$worker,700))},e.prototype.$updateOnChange=function(e){var t=e.start.row,n=e.end.row-t;if(0===n)this.lines[t]=null;else if("remove"==e.action)this.lines.splice(t,n+1,null),this.states.splice(t,n+1,null);else{var i=Array(n+1);i.unshift(t,1),this.lines.splice.apply(this.lines,i),this.states.splice.apply(this.states,i)}this.currentLine=Math.min(t,this.currentLine,this.doc.getLength()),this.stop()},e.prototype.stop=function(){this.running&&clearTimeout(this.running),this.running=!1},e.prototype.getTokens=function(e){return this.lines[e]||this.$tokenizeRow(e)},e.prototype.getState=function(e){return this.currentLine==e&&this.$tokenizeRow(e),this.states[e]||"start"},e.prototype.$tokenizeRow=function(e){var t=this.doc.getLine(e),n=this.states[e-1],i=this.tokenizer.getLineTokens(t,n,e);return this.states[e]+""!=i.state+""?(this.states[e]=i.state,this.lines[e+1]=null,this.currentLine>e+1&&(this.currentLine=e+1)):this.currentLine==e&&(this.currentLine=e+1),this.lines[e]=i.tokens},e.prototype.cleanup=function(){this.running=!1,this.lines=[],this.states=[],this.currentLine=0,this.removeAllListeners()},e}();i.implement(r.prototype,o),t.BackgroundTokenizer=r})),ace.define("ace/search_highlight",["require","exports","module","ace/lib/lang","ace/range"],(function(e,t,n){"use strict";var i=e("./lib/lang"),o=e("./range").Range,r=function(){function e(e,t,n){void 0===n&&(n="text"),this.setRegexp(e),this.clazz=t,this.type=n}return e.prototype.setRegexp=function(e){this.regExp+""!=e+""&&(this.regExp=e,this.cache=[])},e.prototype.update=function(e,t,n,r){if(this.regExp)for(var s=r.firstRow,a=r.lastRow,l={},c=s;c<=a;c++){var h=this.cache[c];null==h&&((h=i.getMatchOffsets(n.getLine(c),this.regExp)).length>this.MAX_RANGES&&(h=h.slice(0,this.MAX_RANGES)),h=h.map((function(e){return new o(c,e.offset,c,e.offset+e.length)})),this.cache[c]=h.length?h:"");for(var d=h.length;d--;){var u=h[d].toScreenRange(n),p=u.toString();l[p]||(l[p]=!0,t.drawSingleLineMarker(e,u,this.clazz,r))}}},e}();r.prototype.MAX_RANGES=500,t.SearchHighlight=r})),ace.define("ace/edit_session/fold_line",["require","exports","module","ace/range"],(function(e,t,n){"use strict";var i=e("../range").Range,o=function(){function e(e,t){this.foldData=e,Array.isArray(t)?this.folds=t:t=this.folds=[t];var n=t[t.length-1];this.range=new i(t[0].start.row,t[0].start.column,n.end.row,n.end.column),this.start=this.range.start,this.end=this.range.end,this.folds.forEach((function(e){e.setFoldLine(this)}),this)}return e.prototype.shiftRow=function(e){this.start.row+=e,this.end.row+=e,this.folds.forEach((function(t){t.start.row+=e,t.end.row+=e}))},e.prototype.addFold=function(e){if(e.sameRow){if(e.start.row<this.startRow||e.endRow>this.endRow)throw new Error("Can't add a fold to this FoldLine as it has no connection");this.folds.push(e),this.folds.sort((function(e,t){return-e.range.compareEnd(t.start.row,t.start.column)})),this.range.compareEnd(e.start.row,e.start.column)>0?(this.end.row=e.end.row,this.end.column=e.end.column):this.range.compareStart(e.end.row,e.end.column)<0&&(this.start.row=e.start.row,this.start.column=e.start.column)}else if(e.start.row==this.end.row)this.folds.push(e),this.end.row=e.end.row,this.end.column=e.end.column;else{if(e.end.row!=this.start.row)throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");this.folds.unshift(e),this.start.row=e.start.row,this.start.column=e.start.column}e.foldLine=this},e.prototype.containsRow=function(e){return e>=this.start.row&&e<=this.end.row},e.prototype.walk=function(e,t,n){var i,o,r=0,s=this.folds,a=!0;null==t&&(t=this.end.row,n=this.end.column);for(var l=0;l<s.length;l++){if(-1==(o=(i=s[l]).range.compareStart(t,n)))return void e(null,t,n,r,a);if(!e(null,i.start.row,i.start.column,r,a)&&e(i.placeholder,i.start.row,i.start.column,r)||0===o)return;a=!i.sameRow,r=i.end.column}e(null,t,n,r,a)},e.prototype.getNextFoldTo=function(e,t){for(var n,i,o=0;o<this.folds.length;o++){if(-1==(i=(n=this.folds[o]).range.compareEnd(e,t)))return{fold:n,kind:"after"};if(0===i)return{fold:n,kind:"inside"}}return null},e.prototype.addRemoveChars=function(e,t,n){var i,o,r=this.getNextFoldTo(e,t);if(r)if(i=r.fold,"inside"==r.kind&&i.start.column!=t&&i.start.row!=e)window.console&&window.console.log(e,t,i);else if(i.start.row==e){var s=(o=this.folds).indexOf(i);for(0===s&&(this.start.column+=n);s<o.length;s++){if((i=o[s]).start.column+=n,!i.sameRow)return;i.end.column+=n}this.end.column+=n}},e.prototype.split=function(t,n){var i=this.getNextFoldTo(t,n);if(!i||"inside"==i.kind)return null;var o=i.fold,r=this.folds,s=this.foldData,a=r.indexOf(o),l=r[a-1];this.end.row=l.end.row,this.end.column=l.end.column;var c=new e(s,r=r.splice(a,r.length-a));return s.splice(s.indexOf(this)+1,0,c),c},e.prototype.merge=function(e){for(var t=e.folds,n=0;n<t.length;n++)this.addFold(t[n]);var i=this.foldData;i.splice(i.indexOf(e),1)},e.prototype.toString=function(){var e=[this.range.toString()+": ["];return this.folds.forEach((function(t){e.push(" "+t.toString())})),e.push("]"),e.join("\n")},e.prototype.idxToPosition=function(e){for(var t=0,n=0;n<this.folds.length;n++){var i=this.folds[n];if((e-=i.start.column-t)<0)return{row:i.start.row,column:i.start.column+e};if((e-=i.placeholder.length)<0)return i.start;t=i.end.column}return{row:this.end.row,column:this.end.column+e}},e}();t.FoldLine=o})),ace.define("ace/range_list",["require","exports","module","ace/range"],(function(e,t,n){"use strict";var i=e("./range").Range.comparePoints,o=function(){function e(){this.ranges=[],this.$bias=1}return e.prototype.pointIndex=function(e,t,n){for(var o=this.ranges,r=n||0;r<o.length;r++){var s=o[r],a=i(e,s.end);if(!(a>0)){var l=i(e,s.start);return 0===a?t&&0!==l?-r-2:r:l>0||0===l&&!t?r:-r-1}}return-r-1},e.prototype.add=function(e){var t=!e.isEmpty(),n=this.pointIndex(e.start,t);n<0&&(n=-n-1);var i=this.pointIndex(e.end,t,n);return i<0?i=-i-1:i++,this.ranges.splice(n,i-n,e)},e.prototype.addList=function(e){for(var t=[],n=e.length;n--;)t.push.apply(t,this.add(e[n]));return t},e.prototype.substractPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges.splice(t,1)},e.prototype.merge=function(){for(var e,t=[],n=this.ranges,o=(n=n.sort((function(e,t){return i(e.start,t.start)})))[0],r=1;r<n.length;r++){e=o,o=n[r];var s=i(e.end,o.start);s<0||(0!=s||e.isEmpty()||o.isEmpty())&&(i(e.end,o.end)<0&&(e.end.row=o.end.row,e.end.column=o.end.column),n.splice(r,1),t.push(o),o=e,r--)}return this.ranges=n,t},e.prototype.contains=function(e,t){return this.pointIndex({row:e,column:t})>=0},e.prototype.containsPoint=function(e){return this.pointIndex(e)>=0},e.prototype.rangeAtPoint=function(e){var t=this.pointIndex(e);if(t>=0)return this.ranges[t]},e.prototype.clipRows=function(e,t){var n=this.ranges;if(n[0].start.row>t||n[n.length-1].start.row<e)return[];var i=this.pointIndex({row:e,column:0});i<0&&(i=-i-1);var o=this.pointIndex({row:t,column:0},i);o<0&&(o=-o-1);for(var r=[],s=i;s<o;s++)r.push(n[s]);return r},e.prototype.removeAll=function(){return this.ranges.splice(0,this.ranges.length)},e.prototype.attach=function(e){this.session&&this.detach(),this.session=e,this.onChange=this.$onChange.bind(this),this.session.on("change",this.onChange)},e.prototype.detach=function(){this.session&&(this.session.removeListener("change",this.onChange),this.session=null)},e.prototype.$onChange=function(e){for(var t=e.start,n=e.end,i=t.row,o=n.row,r=this.ranges,s=0,a=r.length;s<a&&!((h=r[s]).end.row>=i);s++);if("insert"==e.action){for(var l=o-i,c=-t.column+n.column;s<a&&!((h=r[s]).start.row>i);s++)if(h.start.row==i&&h.start.column>=t.column&&(h.start.column==t.column&&this.$bias<=0||(h.start.column+=c,h.start.row+=l)),h.end.row==i&&h.end.column>=t.column){if(h.end.column==t.column&&this.$bias<0)continue;h.end.column==t.column&&c>0&&s<a-1&&h.end.column>h.start.column&&h.end.column==r[s+1].start.column&&(h.end.column-=c),h.end.column+=c,h.end.row+=l}}else for(l=i-o,c=t.column-n.column;s<a&&!((h=r[s]).start.row>o);s++)h.end.row<o&&(i<h.end.row||i==h.end.row&&t.column<h.end.column)?(h.end.row=i,h.end.column=t.column):h.end.row==o?h.end.column<=n.column?(l||h.end.column>t.column)&&(h.end.column=t.column,h.end.row=t.row):(h.end.column+=c,h.end.row+=l):h.end.row>o&&(h.end.row+=l),h.start.row<o&&(i<h.start.row||i==h.start.row&&t.column<h.start.column)?(h.start.row=i,h.start.column=t.column):h.start.row==o?h.start.column<=n.column?(l||h.start.column>t.column)&&(h.start.column=t.column,h.start.row=t.row):(h.start.column+=c,h.start.row+=l):h.start.row>o&&(h.start.row+=l);if(0!=l&&s<a)for(;s<a;s++){var h;(h=r[s]).start.row+=l,h.end.row+=l}},e}();o.prototype.comparePoints=i,t.RangeList=o})),ace.define("ace/edit_session/fold",["require","exports","module","ace/range_list"],(function(e,t,n){"use strict";var i,o=this&&this.__extends||(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),r=function(e){function t(t,n){var i=e.call(this)||this;return i.foldLine=null,i.placeholder=n,i.range=t,i.start=t.start,i.end=t.end,i.sameRow=t.start.row==t.end.row,i.subFolds=i.ranges=[],i}return o(t,e),t.prototype.toString=function(){return'"'+this.placeholder+'" '+this.range.toString()},t.prototype.setFoldLine=function(e){this.foldLine=e,this.subFolds.forEach((function(t){t.setFoldLine(e)}))},t.prototype.clone=function(){var e=new t(this.range.clone(),this.placeholder);return this.subFolds.forEach((function(t){e.subFolds.push(t.clone())})),e.collapseChildren=this.collapseChildren,e},t.prototype.addSubFold=function(e){if(!this.range.isEqual(e)){var t,n;t=e,n=this.start,s(t.start,n),s(t.end,n);for(var i=e.start.row,o=e.start.column,r=0,a=-1;r<this.subFolds.length&&1==(a=this.subFolds[r].range.compare(i,o));r++);var l=this.subFolds[r],c=0;if(0==a){if(l.range.containsRange(e))return l.addSubFold(e);c=1}i=e.range.end.row,o=e.range.end.column;var h=r;for(a=-1;h<this.subFolds.length&&1==(a=this.subFolds[h].range.compare(i,o));h++);0==a&&h++;for(var d=this.subFolds.splice(r,h-r,e),u=0==a?d.length-1:d.length,p=c;p<u;p++)e.addSubFold(d[p]);return e.setFoldLine(this.foldLine),e}},t.prototype.restoreRange=function(e){return function(e,t){a(e.start,t),a(e.end,t)}(e,this.start)},t}(e("../range_list").RangeList);function s(e,t){e.row-=t.row,0==e.row&&(e.column-=t.column)}function a(e,t){0==e.row&&(e.column+=t.column),e.row+=t.row}t.Fold=r})),ace.define("ace/edit_session/folding",["require","exports","module","ace/range","ace/edit_session/fold_line","ace/edit_session/fold","ace/token_iterator","ace/mouse/mouse_event"],(function(e,t,n){"use strict";var i=e("../range").Range,o=e("./fold_line").FoldLine,r=e("./fold").Fold,s=e("../token_iterator").TokenIterator,a=e("../mouse/mouse_event").MouseEvent;t.Folding=function(){this.getFoldAt=function(e,t,n){var i=this.getFoldLine(e);if(!i)return null;for(var o=i.folds,r=0;r<o.length;r++){var s=o[r].range;if(s.contains(e,t)){if(1==n&&s.isEnd(e,t)&&!s.isEmpty())continue;if(-1==n&&s.isStart(e,t)&&!s.isEmpty())continue;return o[r]}}},this.getFoldsInRange=function(e){var t=e.start,n=e.end,i=this.$foldData,o=[];t.column+=1,n.column-=1;for(var r=0;r<i.length;r++){var s=i[r].range.compareRange(e);if(2!=s){if(-2==s)break;for(var a=i[r].folds,l=0;l<a.length;l++){var c=a[l];if(-2==(s=c.range.compareRange(e)))break;if(2!=s){if(42==s)break;o.push(c)}}}}return t.column-=1,n.column+=1,o},this.getFoldsInRangeList=function(e){if(Array.isArray(e)){var t=[];e.forEach((function(e){t=t.concat(this.getFoldsInRange(e))}),this)}else t=this.getFoldsInRange(e);return t},this.getAllFolds=function(){for(var e=[],t=this.$foldData,n=0;n<t.length;n++)for(var i=0;i<t[n].folds.length;i++)e.push(t[n].folds[i]);return e},this.getFoldStringAt=function(e,t,n,i){if(!(i=i||this.getFoldLine(e)))return null;for(var o,r,s={end:{column:0}},a=0;a<i.folds.length;a++){var l=(r=i.folds[a]).range.compareEnd(e,t);if(-1==l){o=this.getLine(r.start.row).substring(s.end.column,r.start.column);break}if(0===l)return null;s=r}return o||(o=this.getLine(r.start.row).substring(s.end.column)),-1==n?o.substring(0,t-s.end.column):1==n?o.substring(t-s.end.column):o},this.getFoldLine=function(e,t){var n=this.$foldData,i=0;for(t&&(i=n.indexOf(t)),-1==i&&(i=0);i<n.length;i++){var o=n[i];if(o.start.row<=e&&o.end.row>=e)return o;if(o.end.row>e)return null}return null},this.getNextFoldLine=function(e,t){var n=this.$foldData,i=0;for(t&&(i=n.indexOf(t)),-1==i&&(i=0);i<n.length;i++){var o=n[i];if(o.end.row>=e)return o}return null},this.getFoldedRowCount=function(e,t){for(var n=this.$foldData,i=t-e+1,o=0;o<n.length;o++){var r=n[o],s=r.end.row,a=r.start.row;if(s>=t){a<t&&(a>=e?i-=t-a:i=0);break}s>=e&&(i-=a>=e?s-a:s-e+1)}return i},this.$addFoldLine=function(e){return this.$foldData.push(e),this.$foldData.sort((function(e,t){return e.start.row-t.start.row})),e},this.addFold=function(e,t){var n,i=this.$foldData,s=!1;e instanceof r?n=e:(n=new r(t,e)).collapseChildren=t.collapseChildren,this.$clipRangeToDocument(n.range);var a=n.start.row,l=n.start.column,c=n.end.row,h=n.end.column,d=this.getFoldAt(a,l,1),u=this.getFoldAt(c,h,-1);if(d&&u==d)return d.addSubFold(n);d&&!d.range.isStart(a,l)&&this.removeFold(d),u&&!u.range.isEnd(c,h)&&this.removeFold(u);var p=this.getFoldsInRange(n.range);p.length>0&&(this.removeFolds(p),n.collapseChildren||p.forEach((function(e){n.addSubFold(e)})));for(var g=0;g<i.length;g++){var f=i[g];if(c==f.start.row){f.addFold(n),s=!0;break}if(a==f.end.row){if(f.addFold(n),s=!0,!n.sameRow){var m=i[g+1];if(m&&m.start.row==c){f.merge(m);break}}break}if(c<=f.start.row)break}return s||(f=this.$addFoldLine(new o(this.$foldData,n))),this.$useWrapMode?this.$updateWrapData(f.start.row,f.start.row):this.$updateRowLengthCache(f.start.row,f.start.row),this.$modified=!0,this._signal("changeFold",{data:n,action:"add"}),n},this.addFolds=function(e){e.forEach((function(e){this.addFold(e)}),this)},this.removeFold=function(e){var t=e.foldLine,n=t.start.row,i=t.end.row,o=this.$foldData,r=t.folds;if(1==r.length)o.splice(o.indexOf(t),1);else if(t.range.isEnd(e.end.row,e.end.column))r.pop(),t.end.row=r[r.length-1].end.row,t.end.column=r[r.length-1].end.column;else if(t.range.isStart(e.start.row,e.start.column))r.shift(),t.start.row=r[0].start.row,t.start.column=r[0].start.column;else if(e.sameRow)r.splice(r.indexOf(e),1);else{var s=t.split(e.start.row,e.start.column);(r=s.folds).shift(),s.start.row=r[0].start.row,s.start.column=r[0].start.column}this.$updating||(this.$useWrapMode?this.$updateWrapData(n,i):this.$updateRowLengthCache(n,i)),this.$modified=!0,this._signal("changeFold",{data:e,action:"remove"})},this.removeFolds=function(e){for(var t=[],n=0;n<e.length;n++)t.push(e[n]);t.forEach((function(e){this.removeFold(e)}),this),this.$modified=!0},this.expandFold=function(e){this.removeFold(e),e.subFolds.forEach((function(t){e.restoreRange(t),this.addFold(t)}),this),e.collapseChildren>0&&this.foldAll(e.start.row+1,e.end.row,e.collapseChildren-1),e.subFolds=[]},this.expandFolds=function(e){e.forEach((function(e){this.expandFold(e)}),this)},this.unfold=function(e,t){var n,o;if(null==e)n=new i(0,0,this.getLength(),0),null==t&&(t=!0);else if("number"==typeof e)n=new i(e,0,e,this.getLine(e).length);else if("row"in e)n=i.fromPoints(e,e);else{if(Array.isArray(e))return o=[],e.forEach((function(e){o=o.concat(this.unfold(e))}),this),o;n=e}for(var r=o=this.getFoldsInRangeList(n);1==o.length&&i.comparePoints(o[0].start,n.start)<0&&i.comparePoints(o[0].end,n.end)>0;)this.expandFolds(o),o=this.getFoldsInRangeList(n);if(0!=t?this.removeFolds(o):this.expandFolds(o),r.length)return r},this.isRowFolded=function(e,t){return!!this.getFoldLine(e,t)},this.getRowFoldEnd=function(e,t){var n=this.getFoldLine(e,t);return n?n.end.row:e},this.getRowFoldStart=function(e,t){var n=this.getFoldLine(e,t);return n?n.start.row:e},this.getFoldDisplayLine=function(e,t,n,i,o){null==i&&(i=e.start.row),null==o&&(o=0),null==t&&(t=e.end.row),null==n&&(n=this.getLine(t).length);var r=this.doc,s="";return e.walk((function(e,t,n,a){if(!(t<i)){if(t==i){if(n<o)return;a=Math.max(o,a)}s+=null!=e?e:r.getLine(t).substring(a,n)}}),t,n),s},this.getDisplayLine=function(e,t,n,i){var o,r=this.getFoldLine(e);return r?this.getFoldDisplayLine(r,e,t,n,i):(o=this.doc.getLine(e)).substring(i||0,t||o.length)},this.$cloneFoldData=function(){var e=[];return e=this.$foldData.map((function(t){var n=t.folds.map((function(e){return e.clone()}));return new o(e,n)}))},this.toggleFold=function(e){var t,n,i=this.selection.getRange();if(i.isEmpty()){var o=i.start;if(t=this.getFoldAt(o.row,o.column))return void this.expandFold(t);(n=this.findMatchingBracket(o))?1==i.comparePoint(n)?i.end=n:(i.start=n,i.start.column++,i.end.column--):(n=this.findMatchingBracket({row:o.row,column:o.column+1}))?(1==i.comparePoint(n)?i.end=n:i.start=n,i.start.column++):i=this.getCommentFoldRange(o.row,o.column)||i}else{var r=this.getFoldsInRange(i);if(e&&r.length)return void this.expandFolds(r);1==r.length&&(t=r[0])}if(t||(t=this.getFoldAt(i.start.row,i.start.column)),t&&t.range.toString()==i.toString())this.expandFold(t);else{var s="...";if(!i.isMultiLine()){if((s=this.getTextRange(i)).length<4)return;s=s.trim().substring(0,2)+".."}this.addFold(s,i)}},this.getCommentFoldRange=function(e,t,n){var o=new s(this,e,t),r=o.getCurrentToken(),a=r&&r.type;if(r&&/^comment|string/.test(a)){"comment"==(a=a.match(/comment|string/)[0])&&(a+="|doc-start|\\.doc");var l=new RegExp(a),c=new i;if(1!=n){do{r=o.stepBackward()}while(r&&l.test(r.type)&&!/^comment.end/.test(r.type));r=o.stepForward()}if(c.start.row=o.getCurrentTokenRow(),c.start.column=o.getCurrentTokenColumn()+(/^comment.start/.test(r.type)?r.value.length:2),o=new s(this,e,t),-1!=n){var h=-1;do{if(r=o.stepForward(),-1==h){var d=this.getState(o.$row);l.test(d)||(h=o.$row)}else if(o.$row>h)break}while(r&&l.test(r.type)&&!/^comment.start/.test(r.type));r=o.stepBackward()}else r=o.getCurrentToken();return c.end.row=o.getCurrentTokenRow(),c.end.column=o.getCurrentTokenColumn(),/^comment.end/.test(r.type)||(c.end.column+=r.value.length-2),c}},this.foldAll=function(e,t,n,i){null==n&&(n=1e5);var o=this.foldWidgets;if(o){t=t||this.getLength();for(var r=e=e||0;r<t;r++)if(null==o[r]&&(o[r]=this.getFoldWidget(r)),"start"==o[r]&&(!i||i(r))){var s=this.getFoldWidgetRange(r);s&&s.isMultiLine()&&s.end.row<=t&&s.start.row>=e&&(r=s.end.row,s.collapseChildren=n,this.addFold("...",s))}}},this.foldToLevel=function(e){for(this.foldAll();e-- >0;)this.unfold(null,!1)},this.foldAllComments=function(){var e=this;this.foldAll(null,null,null,(function(t){for(var n=e.getTokens(t),i=0;i<n.length;i++){var o=n[i];if("text"!=o.type||!/^\s+$/.test(o.value))return!!/comment/.test(o.type)}}))},this.$foldStyles={manual:1,markbegin:1,markbeginend:1},this.$foldStyle="markbegin",this.setFoldStyle=function(e){if(!this.$foldStyles[e])throw new Error("invalid fold style: "+e+"["+Object.keys(this.$foldStyles).join(", ")+"]");if(this.$foldStyle!=e){this.$foldStyle=e,"manual"==e&&this.unfold();var t=this.$foldMode;this.$setFolding(null),this.$setFolding(t)}},this.$setFolding=function(e){this.$foldMode!=e&&(this.$foldMode=e,this.off("change",this.$updateFoldWidgets),this.off("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets),this._signal("changeAnnotation"),e&&"manual"!=this.$foldStyle?(this.foldWidgets=[],this.getFoldWidget=e.getFoldWidget.bind(e,this,this.$foldStyle),this.getFoldWidgetRange=e.getFoldWidgetRange.bind(e,this,this.$foldStyle),this.$updateFoldWidgets=this.updateFoldWidgets.bind(this),this.$tokenizerUpdateFoldWidgets=this.tokenizerUpdateFoldWidgets.bind(this),this.on("change",this.$updateFoldWidgets),this.on("tokenizerUpdate",this.$tokenizerUpdateFoldWidgets)):this.foldWidgets=null)},this.getParentFoldRangeData=function(e,t){var n=this.foldWidgets;if(!n||t&&n[e])return{};for(var i,o=e-1;o>=0;){var r=n[o];if(null==r&&(r=n[o]=this.getFoldWidget(o)),"start"==r){var s=this.getFoldWidgetRange(o);if(i||(i=s),s&&s.end.row>=e)break}o--}return{range:-1!==o&&s,firstRange:i}},this.onFoldWidgetClick=function(e,t){t instanceof a&&(t=t.domEvent);var n={children:t.shiftKey,all:t.ctrlKey||t.metaKey,siblings:t.altKey};if(!this.$toggleFoldWidget(e,n)){var i=t.target||t.srcElement;i&&/ace_fold-widget/.test(i.className)&&(i.className+=" ace_invalid")}},this.$toggleFoldWidget=function(e,t){if(this.getFoldWidget){var n=this.getFoldWidget(e),i=this.getLine(e),o="end"===n?-1:1,r=this.getFoldAt(e,-1===o?0:i.length,o);if(r)return t.children||t.all?this.removeFold(r):this.expandFold(r),r;var s=this.getFoldWidgetRange(e,!0);if(s&&!s.isMultiLine()&&(r=this.getFoldAt(s.start.row,s.start.column,1))&&s.isEqual(r.range))return this.removeFold(r),r;if(t.siblings){var a=this.getParentFoldRangeData(e);if(a.range)var l=a.range.start.row+1,c=a.range.end.row;this.foldAll(l,c,t.all?1e4:0)}else t.children?(c=s?s.end.row:this.getLength(),this.foldAll(e+1,c,t.all?1e4:0)):s&&(t.all&&(s.collapseChildren=1e4),this.addFold("...",s));return s}},this.toggleFoldWidget=function(e){var t=this.selection.getCursor().row;t=this.getRowFoldStart(t);var n=this.$toggleFoldWidget(t,{});if(!n){var i=this.getParentFoldRangeData(t,!0);if(n=i.range||i.firstRange){t=n.start.row;var o=this.getFoldAt(t,this.getLine(t).length,1);o?this.removeFold(o):this.addFold("...",n)}}},this.updateFoldWidgets=function(e){var t=e.start.row,n=e.end.row-t;if(0===n)this.foldWidgets[t]=null;else if("remove"==e.action)this.foldWidgets.splice(t,n+1,null);else{var i=Array(n+1);i.unshift(t,1),this.foldWidgets.splice.apply(this.foldWidgets,i)}},this.tokenizerUpdateFoldWidgets=function(e){var t=e.data;t.first!=t.last&&this.foldWidgets.length>t.first&&this.foldWidgets.splice(t.first,this.foldWidgets.length)}}})),ace.define("ace/edit_session/bracket_match",["require","exports","module","ace/token_iterator","ace/range"],(function(e,t,n){"use strict";var i=e("../token_iterator").TokenIterator,o=e("../range").Range;t.BracketMatch=function(){this.findMatchingBracket=function(e,t){if(0==e.column)return null;var n=t||this.getLine(e.row).charAt(e.column-1);if(""==n)return null;var i=n.match(/([\(\[\{])|([\)\]\}])/);return i?i[1]?this.$findClosingBracket(i[1],e):this.$findOpeningBracket(i[2],e):null},this.getBracketRange=function(e){var t,n=this.getLine(e.row),i=!0,r=n.charAt(e.column-1),s=r&&r.match(/([\(\[\{])|([\)\]\}])/);if(s||(r=n.charAt(e.column),e={row:e.row,column:e.column+1},s=r&&r.match(/([\(\[\{])|([\)\]\}])/),i=!1),!s)return null;if(s[1]){if(!(a=this.$findClosingBracket(s[1],e)))return null;t=o.fromPoints(e,a),i||(t.end.column++,t.start.column--),t.cursor=t.end}else{var a;if(!(a=this.$findOpeningBracket(s[2],e)))return null;t=o.fromPoints(a,e),i||(t.start.column++,t.end.column--),t.cursor=t.start}return t},this.getMatchingBracketRanges=function(e,t){var n=this.getLine(e.row),i=/([\(\[\{])|([\)\]\}])/,r=!t&&n.charAt(e.column-1),s=r&&r.match(i);if(s||(r=(void 0===t||t)&&n.charAt(e.column),e={row:e.row,column:e.column+1},s=r&&r.match(i)),!s)return null;var a=new o(e.row,e.column-1,e.row,e.column),l=s[1]?this.$findClosingBracket(s[1],e):this.$findOpeningBracket(s[2],e);return l?[a,new o(l.row,l.column,l.row,l.column+1)]:[a]},this.$brackets={")":"(","(":")","]":"[","[":"]","{":"}","}":"{","<":">",">":"<"},this.$findOpeningBracket=function(e,t,n){var o=this.$brackets[e],r=1,s=new i(this,t.row,t.column),a=s.getCurrentToken();if(a||(a=s.stepForward()),a){n||(n=new RegExp("(\\.?"+a.type.replace(".","\\.").replace("rparen",".paren").replace(/\b(?:end)\b/,"(?:start|begin|end)").replace(/-close\b/,"-(close|open)")+")+"));for(var l=t.column-s.getCurrentTokenColumn()-2,c=a.value;;){for(;l>=0;){var h=c.charAt(l);if(h==o){if(0==(r-=1))return{row:s.getCurrentTokenRow(),column:l+s.getCurrentTokenColumn()}}else h==e&&(r+=1);l-=1}do{a=s.stepBackward()}while(a&&!n.test(a.type));if(null==a)break;l=(c=a.value).length-1}return null}},this.$findClosingBracket=function(e,t,n){var o=this.$brackets[e],r=1,s=new i(this,t.row,t.column),a=s.getCurrentToken();if(a||(a=s.stepForward()),a){n||(n=new RegExp("(\\.?"+a.type.replace(".","\\.").replace("lparen",".paren").replace(/\b(?:start|begin)\b/,"(?:start|begin|end)").replace(/-open\b/,"-(close|open)")+")+"));for(var l=t.column-s.getCurrentTokenColumn();;){for(var c=a.value,h=c.length;l<h;){var d=c.charAt(l);if(d==o){if(0==(r-=1))return{row:s.getCurrentTokenRow(),column:l+s.getCurrentTokenColumn()}}else d==e&&(r+=1);l+=1}do{a=s.stepForward()}while(a&&!n.test(a.type));if(null==a)break;l=0}return null}},this.getMatchingTags=function(e){var t=new i(this,e.row,e.column),n=this.$findTagName(t);if(n)return"<"===t.stepBackward().value?this.$findClosingTag(t,n):this.$findOpeningTag(t,n)},this.$findTagName=function(e){var t=e.getCurrentToken(),n=!1,i=!1;if(t&&-1===t.type.indexOf("tag-name"))do{(t=i?e.stepBackward():e.stepForward())&&("/>"===t.value?i=!0:-1!==t.type.indexOf("tag-name")&&(n=!0))}while(t&&!n);return t},this.$findClosingTag=function(e,t){var n,i=t.value,r=t.value,s=0,a=new o(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1);t=e.stepForward();var l=new o(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+t.value.length),c=!1;do{if(n=t,t=e.stepForward()){if(">"===t.value&&!c){var h=new o(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1);c=!0}if(-1!==t.type.indexOf("tag-name")){if(r===(i=t.value))if("<"===n.value)s++;else if("</"===n.value&&--s<0){e.stepBackward();var d=new o(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+2);t=e.stepForward();var u=new o(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+t.value.length);if(!(t=e.stepForward())||">"!==t.value)return;var p=new o(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1)}}else r===i&&"/>"===t.value&&--s<0&&(p=u=d=new o(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+2),h=new o(l.end.row,l.end.column,l.end.row,l.end.column+1))}}while(t&&s>=0);if(a&&h&&d&&p&&l&&u)return{openTag:new o(a.start.row,a.start.column,h.end.row,h.end.column),closeTag:new o(d.start.row,d.start.column,p.end.row,p.end.column),openTagName:l,closeTagName:u}},this.$findOpeningTag=function(e,t){var n=e.getCurrentToken(),i=t.value,r=0,s=e.getCurrentTokenRow(),a=e.getCurrentTokenColumn(),l=a+2,c=new o(s,a,s,l);e.stepForward();var h=new o(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+t.value.length);if((t=e.stepForward())&&">"===t.value){var d=new o(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1);e.stepBackward(),e.stepBackward();do{if(t=n,s=e.getCurrentTokenRow(),l=(a=e.getCurrentTokenColumn())+t.value.length,n=e.stepBackward(),t)if(-1!==t.type.indexOf("tag-name")){if(i===t.value)if("<"===n.value){if(++r>0){var u=new o(s,a,s,l),p=new o(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1);do{t=e.stepForward()}while(t&&">"!==t.value);var g=new o(e.getCurrentTokenRow(),e.getCurrentTokenColumn(),e.getCurrentTokenRow(),e.getCurrentTokenColumn()+1)}}else"</"===n.value&&r--}else if("/>"===t.value){for(var f=0,m=n;m;){if(-1!==m.type.indexOf("tag-name")&&m.value===i){r--;break}if("<"===m.value)break;m=e.stepBackward(),f++}for(var v=0;v<f;v++)e.stepForward()}}while(n&&r<=0);return p&&g&&c&&d&&u&&h?{openTag:new o(p.start.row,p.start.column,g.end.row,g.end.column),closeTag:new o(c.start.row,c.start.column,d.end.row,d.end.column),openTagName:u,closeTagName:h}:void 0}}}})),ace.define("ace/edit_session",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/bidihandler","ace/config","ace/lib/event_emitter","ace/selection","ace/mode/text","ace/range","ace/document","ace/background_tokenizer","ace/search_highlight","ace/edit_session/folding","ace/edit_session/bracket_match"],(function(e,t,n){"use strict";var i=e("./lib/oop"),o=e("./lib/lang"),r=e("./bidihandler").BidiHandler,s=e("./config"),a=e("./lib/event_emitter").EventEmitter,l=e("./selection").Selection,c=e("./mode/text").Mode,h=e("./range").Range,d=e("./document").Document,u=e("./background_tokenizer").BackgroundTokenizer,p=e("./search_highlight").SearchHighlight,g=function(){function e(t,n){this.$breakpoints=[],this.$decorations=[],this.$frontMarkers={},this.$backMarkers={},this.$markerId=1,this.$undoSelect=!0,this.$foldData=[],this.id="session"+ ++e.$uid,this.$foldData.toString=function(){return this.join("\n")},this.bgTokenizer=new u((new c).getTokenizer(),this);var i=this;this.bgTokenizer.on("update",(function(e){i._signal("tokenizerUpdate",e)})),this.on("changeFold",this.onChangeFold.bind(this)),this.$onChange=this.onChange.bind(this),"object"==typeof t&&t.getLine||(t=new d(t)),this.setDocument(t),this.selection=new l(this),this.$bidiHandler=new r(this),s.resetOptions(this),this.setMode(n),s._signal("session",this),this.destroyed=!1}return e.prototype.setDocument=function(e){this.doc&&this.doc.off("change",this.$onChange),this.doc=e,e.on("change",this.$onChange,!0),this.bgTokenizer.setDocument(this.getDocument()),this.resetCaches()},e.prototype.getDocument=function(){return this.doc},e.prototype.$resetRowCache=function(e){if(!e)return this.$docRowCache=[],void(this.$screenRowCache=[]);var t=this.$docRowCache.length,n=this.$getRowCacheIndex(this.$docRowCache,e)+1;t>n&&(this.$docRowCache.splice(n,t),this.$screenRowCache.splice(n,t))},e.prototype.$getRowCacheIndex=function(e,t){for(var n=0,i=e.length-1;n<=i;){var o=n+i>>1,r=e[o];if(t>r)n=o+1;else{if(!(t<r))return o;i=o-1}}return n-1},e.prototype.resetCaches=function(){this.$modified=!0,this.$wrapData=[],this.$rowLengthCache=[],this.$resetRowCache(0),this.destroyed||this.bgTokenizer.start(0)},e.prototype.onChangeFold=function(e){var t=e.data;this.$resetRowCache(t.start.row)},e.prototype.onChange=function(e){this.$modified=!0,this.$bidiHandler.onChange(e),this.$resetRowCache(e.start.row);var t=this.$updateInternalDataOnChange(e);!this.$fromUndo&&this.$undoManager&&(t&&t.length&&(this.$undoManager.add({action:"removeFolds",folds:t},this.mergeUndoDeltas),this.mergeUndoDeltas=!0),this.$undoManager.add(e,this.mergeUndoDeltas),this.mergeUndoDeltas=!0,this.$informUndoManager.schedule()),this.bgTokenizer.$updateOnChange(e),this._signal("change",e)},e.prototype.setValue=function(e){this.doc.setValue(e),this.selection.moveTo(0,0),this.$resetRowCache(0),this.setUndoManager(this.$undoManager),this.getUndoManager().reset()},e.prototype.toString=function(){return this.doc.getValue()},e.prototype.getSelection=function(){return this.selection},e.prototype.getState=function(e){return this.bgTokenizer.getState(e)},e.prototype.getTokens=function(e){return this.bgTokenizer.getTokens(e)},e.prototype.getTokenAt=function(e,t){var n,i=this.bgTokenizer.getTokens(e),o=0;if(null==t){var r=i.length-1;o=this.getLine(e).length}else for(r=0;r<i.length&&!((o+=i[r].value.length)>=t);r++);return(n=i[r])?(n.index=r,n.start=o-n.value.length,n):null},e.prototype.setUndoManager=function(e){if(this.$undoManager=e,this.$informUndoManager&&this.$informUndoManager.cancel(),e){var t=this;e.addSession(this),this.$syncInformUndoManager=function(){t.$informUndoManager.cancel(),t.mergeUndoDeltas=!1},this.$informUndoManager=o.delayedCall(this.$syncInformUndoManager)}else this.$syncInformUndoManager=function(){}},e.prototype.markUndoGroup=function(){this.$syncInformUndoManager&&this.$syncInformUndoManager()},e.prototype.getUndoManager=function(){return this.$undoManager||this.$defaultUndoManager},e.prototype.getTabString=function(){return this.getUseSoftTabs()?o.stringRepeat(" ",this.getTabSize()):"\t"},e.prototype.setUseSoftTabs=function(e){this.setOption("useSoftTabs",e)},e.prototype.getUseSoftTabs=function(){return this.$useSoftTabs&&!this.$mode.$indentWithTabs},e.prototype.setTabSize=function(e){this.setOption("tabSize",e)},e.prototype.getTabSize=function(){return this.$tabSize},e.prototype.isTabStop=function(e){return this.$useSoftTabs&&e.column%this.$tabSize==0},e.prototype.setNavigateWithinSoftTabs=function(e){this.setOption("navigateWithinSoftTabs",e)},e.prototype.getNavigateWithinSoftTabs=function(){return this.$navigateWithinSoftTabs},e.prototype.setOverwrite=function(e){this.setOption("overwrite",e)},e.prototype.getOverwrite=function(){return this.$overwrite},e.prototype.toggleOverwrite=function(){this.setOverwrite(!this.$overwrite)},e.prototype.addGutterDecoration=function(e,t){this.$decorations[e]||(this.$decorations[e]=""),this.$decorations[e]+=" "+t,this._signal("changeBreakpoint",{})},e.prototype.removeGutterDecoration=function(e,t){this.$decorations[e]=(this.$decorations[e]||"").replace(" "+t,""),this._signal("changeBreakpoint",{})},e.prototype.getBreakpoints=function(){return this.$breakpoints},e.prototype.setBreakpoints=function(e){this.$breakpoints=[];for(var t=0;t<e.length;t++)this.$breakpoints[e[t]]="ace_breakpoint";this._signal("changeBreakpoint",{})},e.prototype.clearBreakpoints=function(){this.$breakpoints=[],this._signal("changeBreakpoint",{})},e.prototype.setBreakpoint=function(e,t){void 0===t&&(t="ace_breakpoint"),t?this.$breakpoints[e]=t:delete this.$breakpoints[e],this._signal("changeBreakpoint",{})},e.prototype.clearBreakpoint=function(e){delete this.$breakpoints[e],this._signal("changeBreakpoint",{})},e.prototype.addMarker=function(e,t,n,i){var o=this.$markerId++,r={range:e,type:n||"line",renderer:"function"==typeof n?n:null,clazz:t,inFront:!!i,id:o};return i?(this.$frontMarkers[o]=r,this._signal("changeFrontMarker")):(this.$backMarkers[o]=r,this._signal("changeBackMarker")),o},e.prototype.addDynamicMarker=function(e,t){if(e.update){var n=this.$markerId++;return e.id=n,e.inFront=!!t,t?(this.$frontMarkers[n]=e,this._signal("changeFrontMarker")):(this.$backMarkers[n]=e,this._signal("changeBackMarker")),e}},e.prototype.removeMarker=function(e){var t=this.$frontMarkers[e]||this.$backMarkers[e];t&&(delete(t.inFront?this.$frontMarkers:this.$backMarkers)[e],this._signal(t.inFront?"changeFrontMarker":"changeBackMarker"))},e.prototype.getMarkers=function(e){return e?this.$frontMarkers:this.$backMarkers},e.prototype.highlight=function(e){if(!this.$searchHighlight){var t=new p(null,"ace_selected-word","text");this.$searchHighlight=this.addDynamicMarker(t)}this.$searchHighlight.setRegexp(e)},e.prototype.highlightLines=function(e,t,n,i){"number"!=typeof t&&(n=t,t=e),n||(n="ace_step");var o=new h(e,0,t,1/0);return o.id=this.addMarker(o,n,"fullLine",i),o},e.prototype.setAnnotations=function(e){this.$annotations=e,this._signal("changeAnnotation",{})},e.prototype.getAnnotations=function(){return this.$annotations||[]},e.prototype.clearAnnotations=function(){this.setAnnotations([])},e.prototype.$detectNewLine=function(e){var t=e.match(/^.*?(\r?\n)/m);this.$autoNewLine=t?t[1]:"\n"},e.prototype.getWordRange=function(e,t){var n=this.getLine(e),i=!1;if(t>0&&(i=!!n.charAt(t-1).match(this.tokenRe)),i||(i=!!n.charAt(t).match(this.tokenRe)),i)var o=this.tokenRe;else o=/^\s+$/.test(n.slice(t-1,t+1))?/\s/:this.nonTokenRe;var r=t;if(r>0){do{r--}while(r>=0&&n.charAt(r).match(o));r++}for(var s=t;s<n.length&&n.charAt(s).match(o);)s++;return new h(e,r,e,s)},e.prototype.getAWordRange=function(e,t){for(var n=this.getWordRange(e,t),i=this.getLine(n.end.row);i.charAt(n.end.column).match(/[ \t]/);)n.end.column+=1;return n},e.prototype.setNewLineMode=function(e){this.doc.setNewLineMode(e)},e.prototype.getNewLineMode=function(){return this.doc.getNewLineMode()},e.prototype.setUseWorker=function(e){this.setOption("useWorker",e)},e.prototype.getUseWorker=function(){return this.$useWorker},e.prototype.onReloadTokenizer=function(e){var t=e.data;this.bgTokenizer.start(t.first),this._signal("tokenizerUpdate",e)},e.prototype.setMode=function(e,t){if(e&&"object"==typeof e){if(e.getTokenizer)return this.$onChangeMode(e);var n=e,i=n.path}else i=e||"ace/mode/text";if(this.$modes["ace/mode/text"]||(this.$modes["ace/mode/text"]=new c),this.$modes[i]&&!n)return this.$onChangeMode(this.$modes[i]),void(t&&t());this.$modeId=i,s.loadModule(["mode",i],function(e){if(this.$modeId!==i)return t&&t();this.$modes[i]&&!n?this.$onChangeMode(this.$modes[i]):e&&e.Mode&&(e=new e.Mode(n),n||(this.$modes[i]=e,e.$id=i),this.$onChangeMode(e)),t&&t()}.bind(this)),this.$mode||this.$onChangeMode(this.$modes["ace/mode/text"],!0)},e.prototype.$onChangeMode=function(e,t){if(t||(this.$modeId=e.$id),this.$mode!==e){var n=this.$mode;this.$mode=e,this.$stopWorker(),this.$useWorker&&this.$startWorker();var i=e.getTokenizer();if(void 0!==i.on){var o=this.onReloadTokenizer.bind(this);i.on("update",o)}this.bgTokenizer.setTokenizer(i),this.bgTokenizer.setDocument(this.getDocument()),this.tokenRe=e.tokenRe,this.nonTokenRe=e.nonTokenRe,t||(e.attachToSession&&e.attachToSession(this),this.$options.wrapMethod.set.call(this,this.$wrapMethod),this.$setFolding(e.foldingRules),this.bgTokenizer.start(0),this._emit("changeMode",{oldMode:n,mode:e}))}},e.prototype.$stopWorker=function(){this.$worker&&(this.$worker.terminate(),this.$worker=null)},e.prototype.$startWorker=function(){try{this.$worker=this.$mode.createWorker(this)}catch(e){s.warn("Could not load worker",e),this.$worker=null}},e.prototype.getMode=function(){return this.$mode},e.prototype.setScrollTop=function(e){this.$scrollTop===e||isNaN(e)||(this.$scrollTop=e,this._signal("changeScrollTop",e))},e.prototype.getScrollTop=function(){return this.$scrollTop},e.prototype.setScrollLeft=function(e){this.$scrollLeft===e||isNaN(e)||(this.$scrollLeft=e,this._signal("changeScrollLeft",e))},e.prototype.getScrollLeft=function(){return this.$scrollLeft},e.prototype.getScreenWidth=function(){return this.$computeWidth(),this.lineWidgets?Math.max(this.getLineWidgetMaxWidth(),this.screenWidth):this.screenWidth},e.prototype.getLineWidgetMaxWidth=function(){if(null!=this.lineWidgetsWidth)return this.lineWidgetsWidth;var e=0;return this.lineWidgets.forEach((function(t){t&&t.screenWidth>e&&(e=t.screenWidth)})),this.lineWidgetWidth=e},e.prototype.$computeWidth=function(e){if(this.$modified||e){if(this.$modified=!1,this.$useWrapMode)return this.screenWidth=this.$wrapLimit;for(var t=this.doc.getAllLines(),n=this.$rowLengthCache,i=0,o=0,r=this.$foldData[o],s=r?r.start.row:1/0,a=t.length,l=0;l<a;l++){if(l>s){if((l=r.end.row+1)>=a)break;s=(r=this.$foldData[o++])?r.start.row:1/0}null==n[l]&&(n[l]=this.$getStringScreenWidth(t[l])[0]),n[l]>i&&(i=n[l])}this.screenWidth=i}},e.prototype.getLine=function(e){return this.doc.getLine(e)},e.prototype.getLines=function(e,t){return this.doc.getLines(e,t)},e.prototype.getLength=function(){return this.doc.getLength()},e.prototype.getTextRange=function(e){return this.doc.getTextRange(e||this.selection.getRange())},e.prototype.insert=function(e,t){return this.doc.insert(e,t)},e.prototype.remove=function(e){return this.doc.remove(e)},e.prototype.removeFullLines=function(e,t){return this.doc.removeFullLines(e,t)},e.prototype.undoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var n=e.length-1;-1!=n;n--){var i=e[n];"insert"==i.action||"remove"==i.action?this.doc.revertDelta(i):i.folds&&this.addFolds(i.folds)}!t&&this.$undoSelect&&(e.selectionBefore?this.selection.fromJSON(e.selectionBefore):this.selection.setRange(this.$getUndoSelection(e,!0))),this.$fromUndo=!1}},e.prototype.redoChanges=function(e,t){if(e.length){this.$fromUndo=!0;for(var n=0;n<e.length;n++){var i=e[n];"insert"!=i.action&&"remove"!=i.action||this.doc.$safeApplyDelta(i)}!t&&this.$undoSelect&&(e.selectionAfter?this.selection.fromJSON(e.selectionAfter):this.selection.setRange(this.$getUndoSelection(e,!1))),this.$fromUndo=!1}},e.prototype.setUndoSelect=function(e){this.$undoSelect=e},e.prototype.$getUndoSelection=function(e,t){function n(e){return t?"insert"!==e.action:"insert"===e.action}for(var i,o,r=0;r<e.length;r++){var s=e[r];s.start&&(i?n(s)?(o=s.start,-1==i.compare(o.row,o.column)&&i.setStart(o),o=s.end,1==i.compare(o.row,o.column)&&i.setEnd(o)):(o=s.start,-1==i.compare(o.row,o.column)&&(i=h.fromPoints(s.start,s.start))):i=n(s)?h.fromPoints(s.start,s.end):h.fromPoints(s.start,s.start))}return i},e.prototype.replace=function(e,t){return this.doc.replace(e,t)},e.prototype.moveText=function(e,t,n){var i=this.getTextRange(e),o=this.getFoldsInRange(e),r=h.fromPoints(t,t);if(!n){this.remove(e);var s=e.start.row-e.end.row;(c=s?-e.end.column:e.start.column-e.end.column)&&(r.start.row==e.end.row&&r.start.column>e.end.column&&(r.start.column+=c),r.end.row==e.end.row&&r.end.column>e.end.column&&(r.end.column+=c)),s&&r.start.row>=e.end.row&&(r.start.row+=s,r.end.row+=s)}if(r.end=this.insert(r.start,i),o.length){var a=e.start,l=r.start,c=(s=l.row-a.row,l.column-a.column);this.addFolds(o.map((function(e){return(e=e.clone()).start.row==a.row&&(e.start.column+=c),e.end.row==a.row&&(e.end.column+=c),e.start.row+=s,e.end.row+=s,e})))}return r},e.prototype.indentRows=function(e,t,n){n=n.replace(/\t/g,this.getTabString());for(var i=e;i<=t;i++)this.doc.insertInLine({row:i,column:0},n)},e.prototype.outdentRows=function(e){for(var t=e.collapseRows(),n=new h(0,0,0,0),i=this.getTabSize(),o=t.start.row;o<=t.end.row;++o){var r=this.getLine(o);n.start.row=o,n.end.row=o;for(var s=0;s<i&&" "==r.charAt(s);++s);s<i&&"\t"==r.charAt(s)?(n.start.column=s,n.end.column=s+1):(n.start.column=0,n.end.column=s),this.remove(n)}},e.prototype.$moveLines=function(e,t,n){if(e=this.getRowFoldStart(e),t=this.getRowFoldEnd(t),n<0){if((o=this.getRowFoldStart(e+n))<0)return 0;var i=o-e}else if(n>0){var o;if((o=this.getRowFoldEnd(t+n))>this.doc.getLength()-1)return 0;i=o-t}else e=this.$clipRowToDocument(e),i=(t=this.$clipRowToDocument(t))-e+1;var r=new h(e,0,t,Number.MAX_VALUE),s=this.getFoldsInRange(r).map((function(e){return(e=e.clone()).start.row+=i,e.end.row+=i,e})),a=0==n?this.doc.getLines(e,t):this.doc.removeFullLines(e,t);return this.doc.insertFullLines(e+i,a),s.length&&this.addFolds(s),i},e.prototype.moveLinesUp=function(e,t){return this.$moveLines(e,t,-1)},e.prototype.moveLinesDown=function(e,t){return this.$moveLines(e,t,1)},e.prototype.duplicateLines=function(e,t){return this.$moveLines(e,t,0)},e.prototype.$clipRowToDocument=function(e){return Math.max(0,Math.min(e,this.doc.getLength()-1))},e.prototype.$clipColumnToRow=function(e,t){return t<0?0:Math.min(this.doc.getLine(e).length,t)},e.prototype.$clipPositionToDocument=function(e,t){if(t=Math.max(0,t),e<0)e=0,t=0;else{var n=this.doc.getLength();e>=n?(e=n-1,t=this.doc.getLine(n-1).length):t=Math.min(this.doc.getLine(e).length,t)}return{row:e,column:t}},e.prototype.$clipRangeToDocument=function(e){e.start.row<0?(e.start.row=0,e.start.column=0):e.start.column=this.$clipColumnToRow(e.start.row,e.start.column);var t=this.doc.getLength()-1;return e.end.row>t?(e.end.row=t,e.end.column=this.doc.getLine(t).length):e.end.column=this.$clipColumnToRow(e.end.row,e.end.column),e},e.prototype.setUseWrapMode=function(e){if(e!=this.$useWrapMode){if(this.$useWrapMode=e,this.$modified=!0,this.$resetRowCache(0),e){var t=this.getLength();this.$wrapData=Array(t),this.$updateWrapData(0,t-1)}this._signal("changeWrapMode")}},e.prototype.getUseWrapMode=function(){return this.$useWrapMode},e.prototype.setWrapLimitRange=function(e,t){this.$wrapLimitRange.min===e&&this.$wrapLimitRange.max===t||(this.$wrapLimitRange={min:e,max:t},this.$modified=!0,this.$bidiHandler.markAsDirty(),this.$useWrapMode&&this._signal("changeWrapMode"))},e.prototype.adjustWrapLimit=function(e,t){var n=this.$wrapLimitRange;n.max<0&&(n={min:t,max:t});var i=this.$constrainWrapLimit(e,n.min,n.max);return i!=this.$wrapLimit&&i>1&&(this.$wrapLimit=i,this.$modified=!0,this.$useWrapMode&&(this.$updateWrapData(0,this.getLength()-1),this.$resetRowCache(0),this._signal("changeWrapLimit")),!0)},e.prototype.$constrainWrapLimit=function(e,t,n){return t&&(e=Math.max(t,e)),n&&(e=Math.min(n,e)),e},e.prototype.getWrapLimit=function(){return this.$wrapLimit},e.prototype.setWrapLimit=function(e){this.setWrapLimitRange(e,e)},e.prototype.getWrapLimitRange=function(){return{min:this.$wrapLimitRange.min,max:this.$wrapLimitRange.max}},e.prototype.$updateInternalDataOnChange=function(e){var t=this.$useWrapMode,n=e.action,i=e.start,o=e.end,r=i.row,s=o.row,a=s-r,l=null;if(this.$updating=!0,0!=a)if("remove"===n){this[t?"$wrapData":"$rowLengthCache"].splice(r,a);var c=this.$foldData;l=this.getFoldsInRange(e),this.removeFolds(l);var h=0;if(f=this.getFoldLine(o.row)){f.addRemoveChars(o.row,o.column,i.column-o.column),f.shiftRow(-a);var d=this.getFoldLine(r);d&&d!==f&&(d.merge(f),f=d),h=c.indexOf(f)+1}for(;h<c.length;h++)(f=c[h]).start.row>=o.row&&f.shiftRow(-a);s=r}else{var u=Array(a);u.unshift(r,0);var p=t?this.$wrapData:this.$rowLengthCache;if(p.splice.apply(p,u),c=this.$foldData,h=0,f=this.getFoldLine(r)){var g=f.range.compareInside(i.row,i.column);0==g?(f=f.split(i.row,i.column))&&(f.shiftRow(a),f.addRemoveChars(s,0,o.column-i.column)):-1==g&&(f.addRemoveChars(r,0,o.column-i.column),f.shiftRow(a)),h=c.indexOf(f)+1}for(;h<c.length;h++){var f;(f=c[h]).start.row>=r&&f.shiftRow(a)}}else a=Math.abs(e.start.column-e.end.column),"remove"===n&&(l=this.getFoldsInRange(e),this.removeFolds(l),a=-a),(f=this.getFoldLine(r))&&f.addRemoveChars(r,i.column,a);return t&&this.$wrapData.length!=this.doc.getLength()&&console.error("doc.getLength() and $wrapData.length have to be the same!"),this.$updating=!1,t?this.$updateWrapData(r,s):this.$updateRowLengthCache(r,s),l},e.prototype.$updateRowLengthCache=function(e,t,n){this.$rowLengthCache[e]=null,this.$rowLengthCache[t]=null},e.prototype.$updateWrapData=function(e,t){var n,i,o=this.doc.getAllLines(),r=this.getTabSize(),s=this.$wrapData,a=this.$wrapLimit,l=e;for(t=Math.min(t,o.length-1);l<=t;)(i=this.getFoldLine(l,i))?(n=[],i.walk(function(e,t,i,r){var s;if(null!=e){(s=this.$getDisplayTokens(e,n.length))[0]=v;for(var a=1;a<s.length;a++)s[a]=w}else s=this.$getDisplayTokens(o[t].substring(r,i),n.length);n=n.concat(s)}.bind(this),i.end.row,o[i.end.row].length+1),s[i.start.row]=this.$computeWrapSplits(n,a,r),l=i.end.row+1):(n=this.$getDisplayTokens(o[l]),s[l]=this.$computeWrapSplits(n,a,r),l++)},e.prototype.$computeWrapSplits=function(e,t,n){if(0==e.length)return[];var i=[],o=e.length,r=0,s=0,a=this.$wrapAsCode,l=this.$indentedSoftWrap,c=t<=Math.max(2*n,8)||!1===l?0:Math.floor(t/2);function h(t){for(var o=t-r,h=r;h<t;h++){var u=e[h];12!==u&&2!==u||(o-=1)}i.length||(d=function(){var t=0;if(0===c)return t;if(l)for(var i=0;i<e.length;i++){var o=e[i];if(o==y)t+=1;else{if(o!=C){if(o==$)continue;break}t+=n}}return a&&!1!==l&&(t+=n),Math.min(t,c)}(),i.indent=d),s+=o,i.push(s),r=t}for(var d=0;o-r>t-d;){var u=r+t-d;if(e[u-1]>=y&&e[u]>=y)h(u);else if(e[u]!=v&&e[u]!=w){for(var p=Math.max(u-(t-(t>>2)),r-1);u>p&&e[u]<v;)u--;if(a){for(;u>p&&e[u]<v;)u--;for(;u>p&&e[u]==b;)u--}else for(;u>p&&e[u]<y;)u--;u>p?h(++u):(e[u=r+t]==m&&u--,h(u-d))}else{for(;u!=r-1&&e[u]!=v;u--);if(u>r){h(u);continue}for(u=r+t;u<e.length&&e[u]==w;u++);if(u==e.length)break;h(u)}}return i},e.prototype.$getDisplayTokens=function(e,t){var n,i=[];t=t||0;for(var o=0;o<e.length;o++){var r=e.charCodeAt(o);if(9==r){n=this.getScreenTabSize(i.length+t),i.push(C);for(var s=1;s<n;s++)i.push($)}else 32==r?i.push(y):r>39&&r<48||r>57&&r<64?i.push(b):r>=4352&&x(r)?i.push(f,m):i.push(f)}return i},e.prototype.$getStringScreenWidth=function(e,t,n){if(0==t)return[0,0];var i,o;for(null==t&&(t=1/0),n=n||0,o=0;o<e.length&&(9==(i=e.charCodeAt(o))?n+=this.getScreenTabSize(n):i>=4352&&x(i)?n+=2:n+=1,!(n>t));o++);return[n,o]},e.prototype.getRowLength=function(e){var t=1;return this.lineWidgets&&(t+=this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0),this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+t:t},e.prototype.getRowLineCount=function(e){return this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1:1},e.prototype.getRowWrapIndent=function(e){if(this.$useWrapMode){var t=this.screenToDocumentPosition(e,Number.MAX_VALUE),n=this.$wrapData[t.row];return n.length&&n[0]<t.column?n.indent:0}return 0},e.prototype.getScreenLastRowColumn=function(e){var t=this.screenToDocumentPosition(e,Number.MAX_VALUE);return this.documentToScreenColumn(t.row,t.column)},e.prototype.getDocumentLastRowColumn=function(e,t){var n=this.documentToScreenRow(e,t);return this.getScreenLastRowColumn(n)},e.prototype.getDocumentLastRowColumnPosition=function(e,t){var n=this.documentToScreenRow(e,t);return this.screenToDocumentPosition(n,Number.MAX_VALUE/10)},e.prototype.getRowSplitData=function(e){return this.$useWrapMode?this.$wrapData[e]:void 0},e.prototype.getScreenTabSize=function(e){return this.$tabSize-(e%this.$tabSize|0)},e.prototype.screenToDocumentRow=function(e,t){return this.screenToDocumentPosition(e,t).row},e.prototype.screenToDocumentColumn=function(e,t){return this.screenToDocumentPosition(e,t).column},e.prototype.screenToDocumentPosition=function(e,t,n){if(e<0)return{row:0,column:0};var i,o,r=0,s=0,a=0,l=0,c=this.$screenRowCache,h=this.$getRowCacheIndex(c,e),d=c.length;if(d&&h>=0){a=c[h],r=this.$docRowCache[h];var u=e>c[d-1]}else u=!d;for(var p=this.getLength()-1,g=this.getNextFoldLine(r),f=g?g.start.row:1/0;a<=e&&!(a+(l=this.getRowLength(r))>e||r>=p);)a+=l,++r>f&&(r=g.end.row+1,f=(g=this.getNextFoldLine(r,g))?g.start.row:1/0),u&&(this.$docRowCache.push(r),this.$screenRowCache.push(a));if(g&&g.start.row<=r)i=this.getFoldDisplayLine(g),r=g.start.row;else{if(a+l<=e||r>p)return{row:p,column:this.getLine(p).length};i=this.getLine(r),g=null}var m=0,v=Math.floor(e-a);if(this.$useWrapMode){var w=this.$wrapData[r];w&&(o=w[v],v>0&&w.length&&(m=w.indent,s=w[v-1]||w[w.length-1],i=i.substring(s)))}return void 0!==n&&this.$bidiHandler.isBidiRow(a+v,r,v)&&(t=this.$bidiHandler.offsetToCol(n)),s+=this.$getStringScreenWidth(i,t-m)[1],this.$useWrapMode&&s>=o&&(s=o-1),g?g.idxToPosition(s):{row:r,column:s}},e.prototype.documentToScreenPosition=function(e,t){if(void 0===t)var n=this.$clipPositionToDocument(e.row,e.column);else n=this.$clipPositionToDocument(e,t);e=n.row,t=n.column;var i,o=0,r=null;(i=this.getFoldAt(e,t,1))&&(e=i.start.row,t=i.start.column);var s,a=0,l=this.$docRowCache,c=this.$getRowCacheIndex(l,e),h=l.length;if(h&&c>=0){a=l[c],o=this.$screenRowCache[c];var d=e>l[h-1]}else d=!h;for(var u=this.getNextFoldLine(a),p=u?u.start.row:1/0;a<e;){if(a>=p){if((s=u.end.row+1)>e)break;p=(u=this.getNextFoldLine(s,u))?u.start.row:1/0}else s=a+1;o+=this.getRowLength(a),a=s,d&&(this.$docRowCache.push(a),this.$screenRowCache.push(o))}var g="";u&&a>=p?(g=this.getFoldDisplayLine(u,e,t),r=u.start.row):(g=this.getLine(e).substring(0,t),r=e);var f=0;if(this.$useWrapMode){var m=this.$wrapData[r];if(m){for(var v=0;g.length>=m[v];)o++,v++;g=g.substring(m[v-1]||0,g.length),f=v>0?m.indent:0}}return this.lineWidgets&&this.lineWidgets[a]&&this.lineWidgets[a].rowsAbove&&(o+=this.lineWidgets[a].rowsAbove),{row:o,column:f+this.$getStringScreenWidth(g)[0]}},e.prototype.documentToScreenColumn=function(e,t){return this.documentToScreenPosition(e,t).column},e.prototype.documentToScreenRow=function(e,t){return this.documentToScreenPosition(e,t).row},e.prototype.getScreenLength=function(){var e=0,t=null;if(this.$useWrapMode)for(var n=this.$wrapData.length,i=0,o=(a=0,(t=this.$foldData[a++])?t.start.row:1/0);i<n;){var r=this.$wrapData[i];e+=r?r.length+1:1,++i>o&&(i=t.end.row+1,o=(t=this.$foldData[a++])?t.start.row:1/0)}else{e=this.getLength();for(var s=this.$foldData,a=0;a<s.length;a++)e-=(t=s[a]).end.row-t.start.row}return this.lineWidgets&&(e+=this.$getWidgetScreenLength()),e},e.prototype.$setFontMetrics=function(e){this.$enableVarChar&&(this.$getStringScreenWidth=function(t,n,i){if(0===n)return[0,0];var o,r;for(n||(n=1/0),i=i||0,r=0;r<t.length&&!((i+="\t"===(o=t.charAt(r))?this.getScreenTabSize(i):e.getCharacterWidth(o))>n);r++);return[i,r]})},e.prototype.destroy=function(){this.destroyed||(this.bgTokenizer.setDocument(null),this.bgTokenizer.cleanup(),this.destroyed=!0),this.$stopWorker(),this.removeAllListeners(),this.doc&&this.doc.off("change",this.$onChange),this.selection.detach()},e}();g.$uid=0,g.prototype.$modes=s.$modes,g.prototype.getValue=g.prototype.toString,g.prototype.$defaultUndoManager={undo:function(){},redo:function(){},hasUndo:function(){},hasRedo:function(){},reset:function(){},add:function(){},addSelection:function(){},startNewGroup:function(){},addSession:function(){}},g.prototype.$overwrite=!1,g.prototype.$mode=null,g.prototype.$modeId=null,g.prototype.$scrollTop=0,g.prototype.$scrollLeft=0,g.prototype.$wrapLimit=80,g.prototype.$useWrapMode=!1,g.prototype.$wrapLimitRange={min:null,max:null},g.prototype.lineWidgets=null,g.prototype.isFullWidth=x,i.implement(g.prototype,a);var f=1,m=2,v=3,w=4,b=9,y=10,C=11,$=12;function x(e){return!(e<4352)&&(e>=4352&&e<=4447||e>=4515&&e<=4519||e>=4602&&e<=4607||e>=9001&&e<=9002||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12283||e>=12288&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12589||e>=12593&&e<=12686||e>=12688&&e<=12730||e>=12736&&e<=12771||e>=12784&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=13054||e>=13056&&e<=19903||e>=19968&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=55216&&e<=55238||e>=55243&&e<=55291||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=65281&&e<=65376||e>=65504&&e<=65510)}e("./edit_session/folding").Folding.call(g.prototype),e("./edit_session/bracket_match").BracketMatch.call(g.prototype),s.defineOptions(g.prototype,"session",{wrap:{set:function(e){if(e&&"off"!=e?"free"==e?e=!0:"printMargin"==e?e=-1:"string"==typeof e&&(e=parseInt(e,10)||!1):e=!1,this.$wrap!=e)if(this.$wrap=e,e){var t="number"==typeof e?e:null;this.setWrapLimitRange(t,t),this.setUseWrapMode(!0)}else this.setUseWrapMode(!1)},get:function(){return this.getUseWrapMode()?-1==this.$wrap?"printMargin":this.getWrapLimitRange().min?this.$wrap:"free":"off"},handlesSet:!0},wrapMethod:{set:function(e){(e="auto"==e?"text"!=this.$mode.type:"text"!=e)!=this.$wrapAsCode&&(this.$wrapAsCode=e,this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0)))},initialValue:"auto"},indentedSoftWrap:{set:function(){this.$useWrapMode&&(this.$useWrapMode=!1,this.setUseWrapMode(!0))},initialValue:!0},firstLineNumber:{set:function(){this._signal("changeBreakpoint")},initialValue:1},useWorker:{set:function(e){this.$useWorker=e,this.$stopWorker(),e&&this.$startWorker()},initialValue:!0},useSoftTabs:{initialValue:!0},tabSize:{set:function(e){(e=parseInt(e))>0&&this.$tabSize!==e&&(this.$modified=!0,this.$rowLengthCache=[],this.$tabSize=e,this._signal("changeTabSize"))},initialValue:4,handlesSet:!0},navigateWithinSoftTabs:{initialValue:!1},foldStyle:{set:function(e){this.setFoldStyle(e)},handlesSet:!0},overwrite:{set:function(e){this._signal("changeOverwrite")},initialValue:!1},newLineMode:{set:function(e){this.doc.setNewLineMode(e)},get:function(){return this.doc.getNewLineMode()},handlesSet:!0},mode:{set:function(e){this.setMode(e)},get:function(){return this.$modeId},handlesSet:!0}}),t.EditSession=g})),ace.define("ace/search",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/range"],(function(e,t,n){"use strict";var i=e("./lib/lang"),o=e("./lib/oop"),r=e("./range").Range,s=function(){function e(){this.$options={}}return e.prototype.set=function(e){return o.mixin(this.$options,e),this},e.prototype.getOptions=function(){return i.copyObject(this.$options)},e.prototype.setOptions=function(e){this.$options=e},e.prototype.find=function(e){var t=this.$options,n=this.$matchIterator(e,t);if(!n)return!1;var i=null;return n.forEach((function(e,n,o,s){return i=new r(e,n,o,s),!(n==s&&t.start&&t.start.start&&0!=t.skipCurrent&&i.isEqual(t.start)&&(i=null,1))})),i},e.prototype.findAll=function(e){var t=this.$options;if(!t.needle)return[];this.$assembleRegExp(t);var n=t.range,o=n?e.getLines(n.start.row,n.end.row):e.doc.getAllLines(),s=[],a=t.re;if(t.$isMultiLine){var l,c=a.length,h=o.length-c;e:for(var d=a.offset||0;d<=h;d++){for(var u=0;u<c;u++)if(-1==o[d+u].search(a[u]))continue e;var p=o[d],g=o[d+c-1],f=p.length-p.match(a[0])[0].length,m=g.match(a[c-1])[0].length;l&&l.end.row===d&&l.end.column>f||(s.push(l=new r(d,f,d+c-1,m)),c>2&&(d=d+c-2))}}else for(var v=0;v<o.length;v++){var w=i.getMatchOffsets(o[v],a);for(u=0;u<w.length;u++){var b=w[u];s.push(new r(v,b.offset,v,b.offset+b.length))}}if(n){var y=n.start.column,C=n.end.column;for(v=0,u=s.length-1;v<u&&s[v].start.column<y&&0==s[v].start.row;)v++;for(var $=n.end.row-n.start.row;v<u&&s[u].end.column>C&&s[u].end.row==$;)u--;for(s=s.slice(v,u+1),v=0,u=s.length;v<u;v++)s[v].start.row+=n.start.row,s[v].end.row+=n.start.row}return s},e.prototype.replace=function(e,t){var n=this.$options,i=this.$assembleRegExp(n);if(n.$isMultiLine)return t;if(i){var o=i.exec(e);if(!o||o[0].length!=e.length)return null;if(t=e.replace(i,t),n.preserveCase){t=t.split("");for(var r=Math.min(e.length,e.length);r--;){var s=e[r];s&&s.toLowerCase()!=s?t[r]=t[r].toUpperCase():t[r]=t[r].toLowerCase()}t=t.join("")}return t}},e.prototype.$assembleRegExp=function(e,t){if(e.needle instanceof RegExp)return e.re=e.needle;var n=e.needle;if(!e.needle)return e.re=!1;void 0===e.$supportsUnicodeFlag&&(e.$supportsUnicodeFlag=i.supportsUnicodeFlag());try{new RegExp(n,"u")}catch(t){e.$supportsUnicodeFlag=!1}e.regExp||(n=i.escapeRegExp(n)),e.wholeWord&&(n=function(e,t){var n=i.supportsLookbehind();function o(e,i){return void 0===i&&(i=!0),(n&&t.$supportsUnicodeFlag?new RegExp("[\\p{L}\\p{N}_]","u"):new RegExp("\\w")).test(e)||t.regExp?n&&t.$supportsUnicodeFlag?i?"(?<=^|[^\\p{L}\\p{N}_])":"(?=[^\\p{L}\\p{N}_]|$)":"\\b":""}var r=Array.from(e),s=r[0],a=r[r.length-1];return o(s)+e+o(a,!1)}(n,e));var o=e.caseSensitive?"gm":"gmi";if(e.$supportsUnicodeFlag&&(o+="u"),e.$isMultiLine=!t&&/[\n\r]/.test(n),e.$isMultiLine)return e.re=this.$assembleMultilineRegExp(n,o);try{var r=new RegExp(n,o)}catch(e){r=!1}return e.re=r},e.prototype.$assembleMultilineRegExp=function(e,t){for(var n=e.replace(/\r\n|\r|\n/g,"$\n^").split("\n"),i=[],o=0;o<n.length;o++)try{i.push(new RegExp(n[o],t))}catch(e){return!1}return i},e.prototype.$matchIterator=function(e,t){var n=this.$assembleRegExp(t);if(!n)return!1;var i=1==t.backwards,o=0!=t.skipCurrent,r=t.range,s=t.start;s||(s=r?r[i?"end":"start"]:e.selection.getRange()),s.start&&(s=s[o!=i?"end":"start"]);var a=r?r.start.row:0,l=r?r.end.row:e.getLength()-1;if(i)var c=function(e){var n=s.row;if(!d(n,s.column,e)){for(n--;n>=a;n--)if(d(n,Number.MAX_VALUE,e))return;if(0!=t.wrap)for(n=l,a=s.row;n>=a;n--)if(d(n,Number.MAX_VALUE,e))return}};else c=function(e){var n=s.row;if(!d(n,s.column,e)){for(n+=1;n<=l;n++)if(d(n,0,e))return;if(0!=t.wrap)for(n=a,l=s.row;n<=l;n++)if(d(n,0,e))return}};if(t.$isMultiLine)var h=n.length,d=function(t,o,r){var s=i?t-h+1:t;if(!(s<0||s+h>e.getLength())){var a=e.getLine(s),l=a.search(n[0]);if(!(!i&&l<o||-1===l)){for(var c=1;c<h;c++)if(-1==(a=e.getLine(s+c)).search(n[c]))return;var d=a.match(n[h-1])[0].length;if(!(i&&d>o))return!!r(s,l,s+h-1,d)||void 0}}};else d=i?function(t,i,o){var r,s=e.getLine(t),a=[],l=0;for(n.lastIndex=0;r=n.exec(s);){var c=r[0].length;if(l=r.index,!c){if(l>=s.length)break;n.lastIndex=l+=1}if(r.index+c>i)break;a.push(r.index,c)}for(var h=a.length-1;h>=0;h-=2){var d=a[h-1];if(o(t,d,t,d+(c=a[h])))return!0}}:function(t,i,o){var r,s,a=e.getLine(t);for(n.lastIndex=i;s=n.exec(a);){var l=s[0].length;if(o(t,r=s.index,t,r+l))return!0;if(!l&&(n.lastIndex=r+=1,r>=a.length))return!1}};return{forEach:c}},e}();t.Search=s})),ace.define("ace/keyboard/hash_handler",["require","exports","module","ace/lib/keys","ace/lib/useragent"],(function(e,t,n){"use strict";var i,o=this&&this.__extends||(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),r=e("../lib/keys"),s=e("../lib/useragent"),a=r.KEY_MODS,l=function(){function e(e,t){this.$init(e,t,!1)}return e.prototype.$init=function(e,t,n){this.platform=t||(s.isMac?"mac":"win"),this.commands={},this.commandKeyBinding={},this.addCommands(e),this.$singleCommand=n},e.prototype.addCommand=function(e){this.commands[e.name]&&this.removeCommand(e),this.commands[e.name]=e,e.bindKey&&this._buildKeyHash(e)},e.prototype.removeCommand=function(e,t){var n=e&&("string"==typeof e?e:e.name);e=this.commands[n],t||delete this.commands[n];var i=this.commandKeyBinding;for(var o in i){var r=i[o];if(r==e)delete i[o];else if(Array.isArray(r)){var s=r.indexOf(e);-1!=s&&(r.splice(s,1),1==r.length&&(i[o]=r[0]))}}},e.prototype.bindKey=function(e,t,n){if("object"==typeof e&&e&&(null==n&&(n=e.position),e=e[this.platform]),e)return"function"==typeof t?this.addCommand({exec:t,bindKey:e,name:t.name||e}):void e.split("|").forEach((function(e){var i="";if(-1!=e.indexOf(" ")){var o=e.split(/\s+/);e=o.pop(),o.forEach((function(e){var t=this.parseKeys(e),n=a[t.hashId]+t.key;i+=(i?" ":"")+n,this._addCommandToBinding(i,"chainKeys")}),this),i+=" "}var r=this.parseKeys(e),s=a[r.hashId]+r.key;this._addCommandToBinding(i+s,t,n)}),this)},e.prototype._addCommandToBinding=function(e,t,n){var i,o=this.commandKeyBinding;if(t)if(!o[e]||this.$singleCommand)o[e]=t;else{Array.isArray(o[e])?-1!=(i=o[e].indexOf(t))&&o[e].splice(i,1):o[e]=[o[e]],"number"!=typeof n&&(n=c(t));var r=o[e];for(i=0;i<r.length&&!(c(r[i])>n);i++);r.splice(i,0,t)}else delete o[e]},e.prototype.addCommands=function(e){e&&Object.keys(e).forEach((function(t){var n=e[t];if(n){if("string"==typeof n)return this.bindKey(n,t);"function"==typeof n&&(n={exec:n}),"object"==typeof n&&(n.name||(n.name=t),this.addCommand(n))}}),this)},e.prototype.removeCommands=function(e){Object.keys(e).forEach((function(t){this.removeCommand(e[t])}),this)},e.prototype.bindKeys=function(e){Object.keys(e).forEach((function(t){this.bindKey(t,e[t])}),this)},e.prototype._buildKeyHash=function(e){this.bindKey(e.bindKey,e)},e.prototype.parseKeys=function(e){var t=e.toLowerCase().split(/[\-\+]([\-\+])?/).filter((function(e){return e})),n=t.pop(),i=r[n];if(r.FUNCTION_KEYS[i])n=r.FUNCTION_KEYS[i].toLowerCase();else{if(!t.length)return{key:n,hashId:-1};if(1==t.length&&"shift"==t[0])return{key:n.toUpperCase(),hashId:-1}}for(var o=0,s=t.length;s--;){var a=r.KEY_MODS[t[s]];if(null==a)return"undefined"!=typeof console&&console.error("invalid modifier "+t[s]+" in "+e),!1;o|=a}return{key:n,hashId:o}},e.prototype.findKeyCommand=function(e,t){var n=a[e]+t;return this.commandKeyBinding[n]},e.prototype.handleKeyboard=function(e,t,n,i){if(!(i<0)){var o=a[t]+n,r=this.commandKeyBinding[o];return e.$keyChain&&(e.$keyChain+=" "+o,r=this.commandKeyBinding[e.$keyChain]||r),!r||"chainKeys"!=r&&"chainKeys"!=r[r.length-1]?(e.$keyChain&&(t&&4!=t||1!=n.length?(-1==t||i>0)&&(e.$keyChain=""):e.$keyChain=e.$keyChain.slice(0,-o.length-1)),{command:r}):(e.$keyChain=e.$keyChain||o,{command:"null"})}},e.prototype.getStatusText=function(e,t){return t.$keyChain||""},e}();function c(e){return"object"==typeof e&&e.bindKey&&e.bindKey.position||(e.isDefault?-100:0)}var h=function(e){function t(t,n){var i=e.call(this,t,n)||this;return i.$singleCommand=!0,i}return o(t,e),t}(l);h.call=function(e,t,n){l.prototype.$init.call(e,t,n,!0)},l.call=function(e,t,n){l.prototype.$init.call(e,t,n,!1)},t.HashHandler=h,t.MultiHashHandler=l})),ace.define("ace/commands/command_manager",["require","exports","module","ace/lib/oop","ace/keyboard/hash_handler","ace/lib/event_emitter"],(function(e,t,n){"use strict";var i,o=this&&this.__extends||(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),r=e("../lib/oop"),s=e("../keyboard/hash_handler").MultiHashHandler,a=e("../lib/event_emitter").EventEmitter,l=function(e){function t(t,n){var i=e.call(this,n,t)||this;return i.byName=i.commands,i.setDefaultHandler("exec",(function(e){return e.args?e.command.exec(e.editor,e.args,e.event,!1):e.command.exec(e.editor,{},e.event,!0)})),i}return o(t,e),t.prototype.exec=function(e,t,n){if(Array.isArray(e)){for(var i=e.length;i--;)if(this.exec(e[i],t,n))return!0;return!1}if("string"==typeof e&&(e=this.commands[e]),!e)return!1;if(t&&t.$readOnly&&!e.readOnly)return!1;if(0!=this.$checkCommandState&&e.isAvailable&&!e.isAvailable(t))return!1;var o={editor:t,command:e,args:n};return o.returnValue=this._emit("exec",o),this._signal("afterExec",o),!1!==o.returnValue},t.prototype.toggleRecording=function(e){if(!this.$inReplay)return e&&e._emit("changeStatus"),this.recording?(this.macro.pop(),this.off("exec",this.$addCommandToMacro),this.macro.length||(this.macro=this.oldMacro),this.recording=!1):(this.$addCommandToMacro||(this.$addCommandToMacro=function(e){this.macro.push([e.command,e.args])}.bind(this)),this.oldMacro=this.macro,this.macro=[],this.on("exec",this.$addCommandToMacro),this.recording=!0)},t.prototype.replay=function(e){if(!this.$inReplay&&this.macro){if(this.recording)return this.toggleRecording(e);try{this.$inReplay=!0,this.macro.forEach((function(t){"string"==typeof t?this.exec(t,e):this.exec(t[0],e,t[1])}),this)}finally{this.$inReplay=!1}}},t.prototype.trimMacro=function(e){return e.map((function(e){return"string"!=typeof e[0]&&(e[0]=e[0].name),e[1]||(e=e[0]),e}))},t}(s);r.implement(l.prototype,a),t.CommandManager=l})),ace.define("ace/commands/default_commands",["require","exports","module","ace/lib/lang","ace/config","ace/range"],(function(e,t,n){"use strict";var i=e("../lib/lang"),o=e("../config"),r=e("../range").Range;function s(e,t){return{win:e,mac:t}}t.commands=[{name:"showSettingsMenu",description:"Show settings menu",bindKey:s("Ctrl-,","Command-,"),exec:function(e){o.loadModule("ace/ext/settings_menu",(function(t){t.init(e),e.showSettingsMenu()}))},readOnly:!0},{name:"goToNextError",description:"Go to next error",bindKey:s("Alt-E","F4"),exec:function(e){o.loadModule("ace/ext/error_marker",(function(t){t.showErrorMarker(e,1)}))},scrollIntoView:"animate",readOnly:!0},{name:"goToPreviousError",description:"Go to previous error",bindKey:s("Alt-Shift-E","Shift-F4"),exec:function(e){o.loadModule("ace/ext/error_marker",(function(t){t.showErrorMarker(e,-1)}))},scrollIntoView:"animate",readOnly:!0},{name:"selectall",description:"Select all",bindKey:s("Ctrl-A","Command-A"),exec:function(e){e.selectAll()},readOnly:!0},{name:"centerselection",description:"Center selection",bindKey:s(null,"Ctrl-L"),exec:function(e){e.centerSelection()},readOnly:!0},{name:"gotoline",description:"Go to line...",bindKey:s("Ctrl-L","Command-L"),exec:function(e,t){"number"!=typeof t||isNaN(t)||e.gotoLine(t),e.prompt({$type:"gotoLine"})},readOnly:!0},{name:"fold",bindKey:s("Alt-L|Ctrl-F1","Command-Alt-L|Command-F1"),exec:function(e){e.session.toggleFold(!1)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"unfold",bindKey:s("Alt-Shift-L|Ctrl-Shift-F1","Command-Alt-Shift-L|Command-Shift-F1"),exec:function(e){e.session.toggleFold(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleFoldWidget",description:"Toggle fold widget",bindKey:s("F2","F2"),exec:function(e){e.session.toggleFoldWidget()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"toggleParentFoldWidget",description:"Toggle parent fold widget",bindKey:s("Alt-F2","Alt-F2"),exec:function(e){e.session.toggleFoldWidget(!0)},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"foldall",description:"Fold all",bindKey:s(null,"Ctrl-Command-Option-0"),exec:function(e){e.session.foldAll()},scrollIntoView:"center",readOnly:!0},{name:"foldAllComments",description:"Fold all comments",bindKey:s(null,"Ctrl-Command-Option-0"),exec:function(e){e.session.foldAllComments()},scrollIntoView:"center",readOnly:!0},{name:"foldOther",description:"Fold other",bindKey:s("Alt-0","Command-Option-0"),exec:function(e){e.session.foldAll(),e.session.unfold(e.selection.getAllRanges())},scrollIntoView:"center",readOnly:!0},{name:"unfoldall",description:"Unfold all",bindKey:s("Alt-Shift-0","Command-Option-Shift-0"),exec:function(e){e.session.unfold()},scrollIntoView:"center",readOnly:!0},{name:"findnext",description:"Find next",bindKey:s("Ctrl-K","Command-G"),exec:function(e){e.findNext()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"findprevious",description:"Find previous",bindKey:s("Ctrl-Shift-K","Command-Shift-G"),exec:function(e){e.findPrevious()},multiSelectAction:"forEach",scrollIntoView:"center",readOnly:!0},{name:"selectOrFindNext",description:"Select or find next",bindKey:s("Alt-K","Ctrl-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findNext()},readOnly:!0},{name:"selectOrFindPrevious",description:"Select or find previous",bindKey:s("Alt-Shift-K","Ctrl-Shift-G"),exec:function(e){e.selection.isEmpty()?e.selection.selectWord():e.findPrevious()},readOnly:!0},{name:"find",description:"Find",bindKey:s("Ctrl-F","Command-F"),exec:function(e){o.loadModule("ace/ext/searchbox",(function(t){t.Search(e)}))},readOnly:!0},{name:"overwrite",description:"Overwrite",bindKey:"Insert",exec:function(e){e.toggleOverwrite()},readOnly:!0},{name:"selecttostart",description:"Select to start",bindKey:s("Ctrl-Shift-Home","Command-Shift-Home|Command-Shift-Up"),exec:function(e){e.getSelection().selectFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotostart",description:"Go to start",bindKey:s("Ctrl-Home","Command-Home|Command-Up"),exec:function(e){e.navigateFileStart()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectup",description:"Select up",bindKey:s("Shift-Up","Shift-Up|Ctrl-Shift-P"),exec:function(e){e.getSelection().selectUp()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golineup",description:"Go line up",bindKey:s("Up","Up|Ctrl-P"),exec:function(e,t){e.navigateUp(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttoend",description:"Select to end",bindKey:s("Ctrl-Shift-End","Command-Shift-End|Command-Shift-Down"),exec:function(e){e.getSelection().selectFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"gotoend",description:"Go to end",bindKey:s("Ctrl-End","Command-End|Command-Down"),exec:function(e){e.navigateFileEnd()},multiSelectAction:"forEach",readOnly:!0,scrollIntoView:"animate",aceCommandGroup:"fileJump"},{name:"selectdown",description:"Select down",bindKey:s("Shift-Down","Shift-Down|Ctrl-Shift-N"),exec:function(e){e.getSelection().selectDown()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"golinedown",description:"Go line down",bindKey:s("Down","Down|Ctrl-N"),exec:function(e,t){e.navigateDown(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordleft",description:"Select word left",bindKey:s("Ctrl-Shift-Left","Option-Shift-Left"),exec:function(e){e.getSelection().selectWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordleft",description:"Go to word left",bindKey:s("Ctrl-Left","Option-Left"),exec:function(e){e.navigateWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolinestart",description:"Select to line start",bindKey:s("Alt-Shift-Left","Command-Shift-Left|Ctrl-Shift-A"),exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolinestart",description:"Go to line start",bindKey:s("Alt-Left|Home","Command-Left|Home|Ctrl-A"),exec:function(e){e.navigateLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectleft",description:"Select left",bindKey:s("Shift-Left","Shift-Left|Ctrl-Shift-B"),exec:function(e){e.getSelection().selectLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoleft",description:"Go to left",bindKey:s("Left","Left|Ctrl-B"),exec:function(e,t){e.navigateLeft(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectwordright",description:"Select word right",bindKey:s("Ctrl-Shift-Right","Option-Shift-Right"),exec:function(e){e.getSelection().selectWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotowordright",description:"Go to word right",bindKey:s("Ctrl-Right","Option-Right"),exec:function(e){e.navigateWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selecttolineend",description:"Select to line end",bindKey:s("Alt-Shift-Right","Command-Shift-Right|Shift-End|Ctrl-Shift-E"),exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotolineend",description:"Go to line end",bindKey:s("Alt-Right|End","Command-Right|End|Ctrl-E"),exec:function(e){e.navigateLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectright",description:"Select right",bindKey:s("Shift-Right","Shift-Right"),exec:function(e){e.getSelection().selectRight()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"gotoright",description:"Go to right",bindKey:s("Right","Right|Ctrl-F"),exec:function(e,t){e.navigateRight(t.times)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectpagedown",description:"Select page down",bindKey:"Shift-PageDown",exec:function(e){e.selectPageDown()},readOnly:!0},{name:"pagedown",description:"Page down",bindKey:s(null,"Option-PageDown"),exec:function(e){e.scrollPageDown()},readOnly:!0},{name:"gotopagedown",description:"Go to page down",bindKey:s("PageDown","PageDown|Ctrl-V"),exec:function(e){e.gotoPageDown()},readOnly:!0},{name:"selectpageup",description:"Select page up",bindKey:"Shift-PageUp",exec:function(e){e.selectPageUp()},readOnly:!0},{name:"pageup",description:"Page up",bindKey:s(null,"Option-PageUp"),exec:function(e){e.scrollPageUp()},readOnly:!0},{name:"gotopageup",description:"Go to page up",bindKey:"PageUp",exec:function(e){e.gotoPageUp()},readOnly:!0},{name:"scrollup",description:"Scroll up",bindKey:s("Ctrl-Up",null),exec:function(e){e.renderer.scrollBy(0,-2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"scrolldown",description:"Scroll down",bindKey:s("Ctrl-Down",null),exec:function(e){e.renderer.scrollBy(0,2*e.renderer.layerConfig.lineHeight)},readOnly:!0},{name:"selectlinestart",description:"Select line start",bindKey:"Shift-Home",exec:function(e){e.getSelection().selectLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"selectlineend",description:"Select line end",bindKey:"Shift-End",exec:function(e){e.getSelection().selectLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"togglerecording",description:"Toggle recording",bindKey:s("Ctrl-Alt-E","Command-Option-E"),exec:function(e){e.commands.toggleRecording(e)},readOnly:!0},{name:"replaymacro",description:"Replay macro",bindKey:s("Ctrl-Shift-E","Command-Shift-E"),exec:function(e){e.commands.replay(e)},readOnly:!0},{name:"jumptomatching",description:"Jump to matching",bindKey:s("Ctrl-\\|Ctrl-P","Command-\\"),exec:function(e){e.jumpToMatching()},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"selecttomatching",description:"Select to matching",bindKey:s("Ctrl-Shift-\\|Ctrl-Shift-P","Command-Shift-\\"),exec:function(e){e.jumpToMatching(!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"expandToMatching",description:"Expand to matching",bindKey:s("Ctrl-Shift-M","Ctrl-Shift-M"),exec:function(e){e.jumpToMatching(!0,!0)},multiSelectAction:"forEach",scrollIntoView:"animate",readOnly:!0},{name:"passKeysToBrowser",description:"Pass keys to browser",bindKey:s(null,null),exec:function(){},passEvent:!0,readOnly:!0},{name:"copy",description:"Copy",exec:function(e){},readOnly:!0},{name:"cut",description:"Cut",exec:function(e){var t=e.$copyWithEmptySelection&&e.selection.isEmpty()?e.selection.getLineRange():e.selection.getRange();e._emit("cut",t),t.isEmpty()||e.session.remove(t),e.clearSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"paste",description:"Paste",exec:function(e,t){e.$handlePaste(t)},scrollIntoView:"cursor"},{name:"removeline",description:"Remove line",bindKey:s("Ctrl-D","Command-D"),exec:function(e){e.removeLines()},scrollIntoView:"cursor",multiSelectAction:"forEachLine"},{name:"duplicateSelection",description:"Duplicate selection",bindKey:s("Ctrl-Shift-D","Command-Shift-D"),exec:function(e){e.duplicateSelection()},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"sortlines",description:"Sort lines",bindKey:s("Ctrl-Alt-S","Command-Alt-S"),exec:function(e){e.sortLines()},scrollIntoView:"selection",multiSelectAction:"forEachLine"},{name:"togglecomment",description:"Toggle comment",bindKey:s("Ctrl-/","Command-/"),exec:function(e){e.toggleCommentLines()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"toggleBlockComment",description:"Toggle block comment",bindKey:s("Ctrl-Shift-/","Command-Shift-/"),exec:function(e){e.toggleBlockComment()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"modifyNumberUp",description:"Modify number up",bindKey:s("Ctrl-Shift-Up","Alt-Shift-Up"),exec:function(e){e.modifyNumber(1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"modifyNumberDown",description:"Modify number down",bindKey:s("Ctrl-Shift-Down","Alt-Shift-Down"),exec:function(e){e.modifyNumber(-1)},scrollIntoView:"cursor",multiSelectAction:"forEach"},{name:"replace",description:"Replace",bindKey:s("Ctrl-H","Command-Option-F"),exec:function(e){o.loadModule("ace/ext/searchbox",(function(t){t.Search(e,!0)}))}},{name:"undo",description:"Undo",bindKey:s("Ctrl-Z","Command-Z"),exec:function(e){e.undo()}},{name:"redo",description:"Redo",bindKey:s("Ctrl-Shift-Z|Ctrl-Y","Command-Shift-Z|Command-Y"),exec:function(e){e.redo()}},{name:"copylinesup",description:"Copy lines up",bindKey:s("Alt-Shift-Up","Command-Option-Up"),exec:function(e){e.copyLinesUp()},scrollIntoView:"cursor"},{name:"movelinesup",description:"Move lines up",bindKey:s("Alt-Up","Option-Up"),exec:function(e){e.moveLinesUp()},scrollIntoView:"cursor"},{name:"copylinesdown",description:"Copy lines down",bindKey:s("Alt-Shift-Down","Command-Option-Down"),exec:function(e){e.copyLinesDown()},scrollIntoView:"cursor"},{name:"movelinesdown",description:"Move lines down",bindKey:s("Alt-Down","Option-Down"),exec:function(e){e.moveLinesDown()},scrollIntoView:"cursor"},{name:"del",description:"Delete",bindKey:s("Delete","Delete|Ctrl-D|Shift-Delete"),exec:function(e){e.remove("right")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"backspace",description:"Backspace",bindKey:s("Shift-Backspace|Backspace","Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),exec:function(e){e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"cut_or_delete",description:"Cut or delete",bindKey:s("Shift-Delete",null),exec:function(e){if(!e.selection.isEmpty())return!1;e.remove("left")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestart",description:"Remove to line start",bindKey:s("Alt-Backspace","Command-Backspace"),exec:function(e){e.removeToLineStart()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineend",description:"Remove to line end",bindKey:s("Alt-Delete","Ctrl-K|Command-Delete"),exec:function(e){e.removeToLineEnd()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolinestarthard",description:"Remove to line start hard",bindKey:s("Ctrl-Shift-Backspace",null),exec:function(e){var t=e.selection.getRange();t.start.column=0,e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removetolineendhard",description:"Remove to line end hard",bindKey:s("Ctrl-Shift-Delete",null),exec:function(e){var t=e.selection.getRange();t.end.column=Number.MAX_VALUE,e.session.remove(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordleft",description:"Remove word left",bindKey:s("Ctrl-Backspace","Alt-Backspace|Ctrl-Alt-Backspace"),exec:function(e){e.removeWordLeft()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"removewordright",description:"Remove word right",bindKey:s("Ctrl-Delete","Alt-Delete"),exec:function(e){e.removeWordRight()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"outdent",description:"Outdent",bindKey:s("Shift-Tab","Shift-Tab"),exec:function(e){e.blockOutdent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"indent",description:"Indent",bindKey:s("Tab","Tab"),exec:function(e){e.indent()},multiSelectAction:"forEach",scrollIntoView:"selectionPart"},{name:"blockoutdent",description:"Block outdent",bindKey:s("Ctrl-[","Ctrl-["),exec:function(e){e.blockOutdent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"blockindent",description:"Block indent",bindKey:s("Ctrl-]","Ctrl-]"),exec:function(e){e.blockIndent()},multiSelectAction:"forEachLine",scrollIntoView:"selectionPart"},{name:"insertstring",description:"Insert string",exec:function(e,t){e.insert(t)},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"inserttext",description:"Insert text",exec:function(e,t){e.insert(i.stringRepeat(t.text||"",t.times||1))},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"splitline",description:"Split line",bindKey:s(null,"Ctrl-O"),exec:function(e){e.splitLine()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"transposeletters",description:"Transpose letters",bindKey:s("Alt-Shift-X","Ctrl-T"),exec:function(e){e.transposeLetters()},multiSelectAction:function(e){e.transposeSelections(1)},scrollIntoView:"cursor"},{name:"touppercase",description:"To uppercase",bindKey:s("Ctrl-U","Ctrl-U"),exec:function(e){e.toUpperCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"tolowercase",description:"To lowercase",bindKey:s("Ctrl-Shift-U","Ctrl-Shift-U"),exec:function(e){e.toLowerCase()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"autoindent",description:"Auto Indent",bindKey:s(null,null),exec:function(e){e.autoIndent()},multiSelectAction:"forEachLine",scrollIntoView:"animate"},{name:"expandtoline",description:"Expand to line",bindKey:s("Ctrl-Shift-L","Command-Shift-L"),exec:function(e){var t=e.selection.getRange();t.start.column=t.end.column=0,t.end.row++,e.selection.setRange(t,!1)},multiSelectAction:"forEach",scrollIntoView:"cursor",readOnly:!0},{name:"openlink",bindKey:s("Ctrl+F3","F3"),exec:function(e){e.openLink()}},{name:"joinlines",description:"Join lines",bindKey:s(null,null),exec:function(e){for(var t=e.selection.isBackwards(),n=t?e.selection.getSelectionLead():e.selection.getSelectionAnchor(),o=t?e.selection.getSelectionAnchor():e.selection.getSelectionLead(),s=e.session.doc.getLine(n.row).length,a=e.session.doc.getTextRange(e.selection.getRange()).replace(/\n\s*/," ").length,l=e.session.doc.getLine(n.row),c=n.row+1;c<=o.row+1;c++){var h=i.stringTrimLeft(i.stringTrimRight(e.session.doc.getLine(c)));0!==h.length&&(h=" "+h),l+=h}o.row+1<e.session.doc.getLength()-1&&(l+=e.session.doc.getNewLineCharacter()),e.clearSelection(),e.session.doc.replace(new r(n.row,0,o.row+2,0),l),a>0?(e.selection.moveCursorTo(n.row,n.column),e.selection.selectTo(n.row,n.column+a)):(s=e.session.doc.getLine(n.row).length>s?s+1:s,e.selection.moveCursorTo(n.row,s))},multiSelectAction:"forEach",readOnly:!0},{name:"invertSelection",description:"Invert selection",bindKey:s(null,null),exec:function(e){var t=e.session.doc.getLength()-1,n=e.session.doc.getLine(t).length,i=e.selection.rangeList.ranges,o=[];i.length<1&&(i=[e.selection.getRange()]);for(var s=0;s<i.length;s++)s==i.length-1&&(i[s].end.row===t&&i[s].end.column===n||o.push(new r(i[s].end.row,i[s].end.column,t,n))),0===s?0===i[s].start.row&&0===i[s].start.column||o.push(new r(0,0,i[s].start.row,i[s].start.column)):o.push(new r(i[s-1].end.row,i[s-1].end.column,i[s].start.row,i[s].start.column));for(e.exitMultiSelectMode(),e.clearSelection(),s=0;s<o.length;s++)e.selection.addRange(o[s],!1)},readOnly:!0,scrollIntoView:"none"},{name:"addLineAfter",description:"Add new line after the current line",exec:function(e){e.selection.clearSelection(),e.navigateLineEnd(),e.insert("\n")},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"addLineBefore",description:"Add new line before the current line",exec:function(e){e.selection.clearSelection();var t=e.getCursorPosition();e.selection.moveTo(t.row-1,Number.MAX_VALUE),e.insert("\n"),0===t.row&&e.navigateUp()},multiSelectAction:"forEach",scrollIntoView:"cursor"},{name:"openCommandPallete",description:"Open command palette",bindKey:s("F1","F1"),exec:function(e){e.prompt({$type:"commands"})},readOnly:!0},{name:"modeSelect",description:"Change language mode...",bindKey:s(null,null),exec:function(e){e.prompt({$type:"modes"})},readOnly:!0}];for(var a=1;a<9;a++)t.commands.push({name:"foldToLevel"+a,description:"Fold To Level "+a,level:a,exec:function(e){e.session.foldToLevel(this.level)},scrollIntoView:"center",readOnly:!0})})),ace.define("ace/line_widgets",["require","exports","module","ace/lib/dom"],(function(e,t,n){"use strict";var i=e("./lib/dom"),o=function(){function e(e){this.session=e,this.session.widgetManager=this,this.session.getRowLength=this.getRowLength,this.session.$getWidgetScreenLength=this.$getWidgetScreenLength,this.updateOnChange=this.updateOnChange.bind(this),this.renderWidgets=this.renderWidgets.bind(this),this.measureWidgets=this.measureWidgets.bind(this),this.session._changedWidgets=[],this.$onChangeEditor=this.$onChangeEditor.bind(this),this.session.on("change",this.updateOnChange),this.session.on("changeFold",this.updateOnFold),this.session.on("changeEditor",this.$onChangeEditor)}return e.prototype.getRowLength=function(e){var t;return t=this.lineWidgets&&this.lineWidgets[e]&&this.lineWidgets[e].rowCount||0,this.$useWrapMode&&this.$wrapData[e]?this.$wrapData[e].length+1+t:1+t},e.prototype.$getWidgetScreenLength=function(){var e=0;return this.lineWidgets.forEach((function(t){t&&t.rowCount&&!t.hidden&&(e+=t.rowCount)})),e},e.prototype.$onChangeEditor=function(e){this.attach(e.editor)},e.prototype.attach=function(e){e&&e.widgetManager&&e.widgetManager!=this&&e.widgetManager.detach(),this.editor!=e&&(this.detach(),this.editor=e,e&&(e.widgetManager=this,e.renderer.on("beforeRender",this.measureWidgets),e.renderer.on("afterRender",this.renderWidgets)))},e.prototype.detach=function(e){var t=this.editor;if(t){this.editor=null,t.widgetManager=null,t.renderer.off("beforeRender",this.measureWidgets),t.renderer.off("afterRender",this.renderWidgets);var n=this.session.lineWidgets;n&&n.forEach((function(e){e&&e.el&&e.el.parentNode&&(e._inDocument=!1,e.el.parentNode.removeChild(e.el))}))}},e.prototype.updateOnFold=function(e,t){var n=t.lineWidgets;if(n&&e.action){for(var i=e.data,o=i.start.row,r=i.end.row,s="add"==e.action,a=o+1;a<r;a++)n[a]&&(n[a].hidden=s);n[r]&&(s?n[o]?n[r].hidden=s:n[o]=n[r]:(n[o]==n[r]&&(n[o]=void 0),n[r].hidden=s))}},e.prototype.updateOnChange=function(e){var t=this.session.lineWidgets;if(t){var n=e.start.row,i=e.end.row-n;if(0===i);else if("remove"==e.action){var o=t.splice(n+1,i);!t[n]&&o[o.length-1]&&(t[n]=o.pop()),o.forEach((function(e){e&&this.removeLineWidget(e)}),this),this.$updateRows()}else{var r=new Array(i);t[n]&&null!=t[n].column&&e.start.column>t[n].column&&n++,r.unshift(n,0),t.splice.apply(t,r),this.$updateRows()}}},e.prototype.$updateRows=function(){var e=this.session.lineWidgets;if(e){var t=!0;e.forEach((function(e,n){if(e)for(t=!1,e.row=n;e.$oldWidget;)e.$oldWidget.row=n,e=e.$oldWidget})),t&&(this.session.lineWidgets=null)}},e.prototype.$registerLineWidget=function(e){this.session.lineWidgets||(this.session.lineWidgets=new Array(this.session.getLength()));var t=this.session.lineWidgets[e.row];return t&&(e.$oldWidget=t,t.el&&t.el.parentNode&&(t.el.parentNode.removeChild(t.el),t._inDocument=!1)),this.session.lineWidgets[e.row]=e,e},e.prototype.addLineWidget=function(e){if(this.$registerLineWidget(e),e.session=this.session,!this.editor)return e;var t=this.editor.renderer;e.html&&!e.el&&(e.el=i.createElement("div"),e.el.innerHTML=e.html),e.text&&!e.el&&(e.el=i.createElement("div"),e.el.textContent=e.text),e.el&&(i.addCssClass(e.el,"ace_lineWidgetContainer"),e.className&&i.addCssClass(e.el,e.className),e.el.style.position="absolute",e.el.style.zIndex=5,t.container.appendChild(e.el),e._inDocument=!0,e.coverGutter||(e.el.style.zIndex=3),null==e.pixelHeight&&(e.pixelHeight=e.el.offsetHeight)),null==e.rowCount&&(e.rowCount=e.pixelHeight/t.layerConfig.lineHeight);var n=this.session.getFoldAt(e.row,0);if(e.$fold=n,n){var o=this.session.lineWidgets;e.row!=n.end.row||o[n.start.row]?e.hidden=!0:o[n.start.row]=e}return this.session._emit("changeFold",{data:{start:{row:e.row}}}),this.$updateRows(),this.renderWidgets(null,t),this.onWidgetChanged(e),e},e.prototype.removeLineWidget=function(e){if(e._inDocument=!1,e.session=null,e.el&&e.el.parentNode&&e.el.parentNode.removeChild(e.el),e.editor&&e.editor.destroy)try{e.editor.destroy()}catch(e){}if(this.session.lineWidgets){var t=this.session.lineWidgets[e.row];if(t==e)this.session.lineWidgets[e.row]=e.$oldWidget,e.$oldWidget&&this.onWidgetChanged(e.$oldWidget);else for(;t;){if(t.$oldWidget==e){t.$oldWidget=e.$oldWidget;break}t=t.$oldWidget}}this.session._emit("changeFold",{data:{start:{row:e.row}}}),this.$updateRows()},e.prototype.getWidgetsAtRow=function(e){for(var t=this.session.lineWidgets,n=t&&t[e],i=[];n;)i.push(n),n=n.$oldWidget;return i},e.prototype.onWidgetChanged=function(e){this.session._changedWidgets.push(e),this.editor&&this.editor.renderer.updateFull()},e.prototype.measureWidgets=function(e,t){var n=this.session._changedWidgets,i=t.layerConfig;if(n&&n.length){for(var o=1/0,r=0;r<n.length;r++){var s=n[r];if(s&&s.el&&s.session==this.session){if(!s._inDocument){if(this.session.lineWidgets[s.row]!=s)continue;s._inDocument=!0,t.container.appendChild(s.el)}s.h=s.el.offsetHeight,s.fixedWidth||(s.w=s.el.offsetWidth,s.screenWidth=Math.ceil(s.w/i.characterWidth));var a=s.h/i.lineHeight;s.coverLine&&(a-=this.session.getRowLineCount(s.row))<0&&(a=0),s.rowCount!=a&&(s.rowCount=a,s.row<o&&(o=s.row))}}o!=1/0&&(this.session._emit("changeFold",{data:{start:{row:o}}}),this.session.lineWidgetWidth=null),this.session._changedWidgets=[]}},e.prototype.renderWidgets=function(e,t){var n=t.layerConfig,i=this.session.lineWidgets;if(i){for(var o=Math.min(this.firstRow,n.firstRow),r=Math.max(this.lastRow,n.lastRow,i.length);o>0&&!i[o];)o--;this.firstRow=n.firstRow,this.lastRow=n.lastRow,t.$cursorLayer.config=n;for(var s=o;s<=r;s++){var a=i[s];if(a&&a.el)if(a.hidden)a.el.style.top=-100-(a.pixelHeight||0)+"px";else{a._inDocument||(a._inDocument=!0,t.container.appendChild(a.el));var l=t.$cursorLayer.getPixelPosition({row:s,column:0},!0).top;a.coverLine||(l+=n.lineHeight*this.session.getRowLineCount(a.row)),a.el.style.top=l-n.offset+"px";var c=a.coverGutter?0:t.gutterWidth;a.fixedWidth||(c-=t.scrollLeft),a.el.style.left=c+"px",a.fullWidth&&a.screenWidth&&(a.el.style.minWidth=n.width+2*n.padding+"px"),a.fixedWidth?a.el.style.right=t.scrollBar.getWidth()+"px":a.el.style.right=""}}}},e}();t.LineWidgets=o})),ace.define("ace/keyboard/gutter_handler",["require","exports","module","ace/lib/keys","ace/mouse/default_gutter_handler"],(function(e,t,n){"use strict";var i=e("../lib/keys"),o=e("../mouse/default_gutter_handler").GutterTooltip,r=function(){function e(e){this.editor=e,this.gutterLayer=e.renderer.$gutterLayer,this.element=e.renderer.$gutter,this.lines=e.renderer.$gutterLayer.$lines,this.activeRowIndex=null,this.activeLane=null,this.annotationTooltip=new o(this.editor)}return e.prototype.addListener=function(){this.element.addEventListener("keydown",this.$onGutterKeyDown.bind(this)),this.element.addEventListener("focusout",this.$blurGutter.bind(this)),this.editor.on("mousewheel",this.$blurGutter.bind(this))},e.prototype.removeListener=function(){this.element.removeEventListener("keydown",this.$onGutterKeyDown.bind(this)),this.element.removeEventListener("focusout",this.$blurGutter.bind(this)),this.editor.off("mousewheel",this.$blurGutter.bind(this))},e.prototype.$onGutterKeyDown=function(e){if(this.annotationTooltip.isOpen)return e.preventDefault(),void(e.keyCode===i.escape&&this.annotationTooltip.hideTooltip());if(e.target===this.element){if(e.keyCode!=i.enter)return;e.preventDefault();var t=this.editor.getCursorPosition().row;return this.editor.isRowVisible(t)||this.editor.scrollToLine(t,!0,!0),void setTimeout(function(){var e=this.$rowToRowIndex(this.gutterLayer.$cursorCell.row),t=this.$findNearestFoldWidget(e),n=this.$findNearestAnnotation(e);if(null!==t||null!==n)return null===t&&null!==n?(this.activeRowIndex=n,this.activeLane="annotation",void this.$focusAnnotation(this.activeRowIndex)):null!==t&&null===n?(this.activeRowIndex=t,this.activeLane="fold",void this.$focusFoldWidget(this.activeRowIndex)):Math.abs(n-e)<Math.abs(t-e)?(this.activeRowIndex=n,this.activeLane="annotation",void this.$focusAnnotation(this.activeRowIndex)):(this.activeRowIndex=t,this.activeLane="fold",void this.$focusFoldWidget(this.activeRowIndex))}.bind(this),10)}this.$handleGutterKeyboardInteraction(e),setTimeout(function(){this.editor._signal("gutterkeydown",new s(e,this))}.bind(this),10)},e.prototype.$handleGutterKeyboardInteraction=function(e){if(e.keyCode!==i.tab){if(e.keyCode===i.escape)return e.preventDefault(),this.$blurGutter(),this.element.focus(),void(this.lane=null);if(e.keyCode!==i.up)if(e.keyCode!==i.down){if(e.keyCode===i.left)return e.preventDefault(),void this.$switchLane("annotation");if(e.keyCode===i.right)return e.preventDefault(),void this.$switchLane("fold");if(e.keyCode!==i.enter&&e.keyCode!==i.space);else switch(e.preventDefault(),this.activeLane){case"fold":if("start"===this.gutterLayer.session.foldWidgets[this.$rowIndexToRow(this.activeRowIndex)]){var t=this.$rowIndexToRow(this.activeRowIndex);this.editor.session.onFoldWidgetClick(this.$rowIndexToRow(this.activeRowIndex),e),setTimeout(function(){this.$rowIndexToRow(this.activeRowIndex)!==t&&(this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=this.$rowToRowIndex(t),this.$focusFoldWidget(this.activeRowIndex))}.bind(this),10);break}if("end"===this.gutterLayer.session.foldWidgets[this.$rowIndexToRow(this.activeRowIndex)])break;return;case"annotation":var n=this.lines.cells[this.activeRowIndex].element.childNodes[2].getBoundingClientRect(),o=this.annotationTooltip.getElement().style;o.left=n.right+"px",o.top=n.bottom+"px",this.annotationTooltip.showTooltip(this.$rowIndexToRow(this.activeRowIndex))}}else switch(e.preventDefault(),this.activeLane){case"fold":this.$moveFoldWidgetDown();break;case"annotation":this.$moveAnnotationDown()}else switch(e.preventDefault(),this.activeLane){case"fold":this.$moveFoldWidgetUp();break;case"annotation":this.$moveAnnotationUp()}}else e.preventDefault()},e.prototype.$blurGutter=function(){if(null!==this.activeRowIndex)switch(this.activeLane){case"fold":this.$blurFoldWidget(this.activeRowIndex);break;case"annotation":this.$blurAnnotation(this.activeRowIndex)}this.annotationTooltip.isOpen&&this.annotationTooltip.hideTooltip()},e.prototype.$isFoldWidgetVisible=function(e){var t=this.editor.isRowFullyVisible(this.$rowIndexToRow(e)),n="none"!==this.$getFoldWidget(e).style.display;return t&&n},e.prototype.$isAnnotationVisible=function(e){var t=this.editor.isRowFullyVisible(this.$rowIndexToRow(e)),n="none"!==this.$getAnnotation(e).style.display;return t&&n},e.prototype.$getFoldWidget=function(e){return this.lines.get(e).element.childNodes[1]},e.prototype.$getAnnotation=function(e){return this.lines.get(e).element.childNodes[2]},e.prototype.$findNearestFoldWidget=function(e){if(this.$isFoldWidgetVisible(e))return e;for(var t=0;e-t>0||e+t<this.lines.getLength()-1;){if(e-++t>=0&&this.$isFoldWidgetVisible(e-t))return e-t;if(e+t<=this.lines.getLength()-1&&this.$isFoldWidgetVisible(e+t))return e+t}return null},e.prototype.$findNearestAnnotation=function(e){if(this.$isAnnotationVisible(e))return e;for(var t=0;e-t>0||e+t<this.lines.getLength()-1;){if(e-++t>=0&&this.$isAnnotationVisible(e-t))return e-t;if(e+t<=this.lines.getLength()-1&&this.$isAnnotationVisible(e+t))return e+t}return null},e.prototype.$focusFoldWidget=function(e){if(null!=e){var t=this.$getFoldWidget(e);t.classList.add(this.editor.renderer.keyboardFocusClassName),t.focus()}},e.prototype.$focusAnnotation=function(e){if(null!=e){var t=this.$getAnnotation(e);t.classList.add(this.editor.renderer.keyboardFocusClassName),t.focus()}},e.prototype.$blurFoldWidget=function(e){var t=this.$getFoldWidget(e);t.classList.remove(this.editor.renderer.keyboardFocusClassName),t.blur()},e.prototype.$blurAnnotation=function(e){var t=this.$getAnnotation(e);t.classList.remove(this.editor.renderer.keyboardFocusClassName),t.blur()},e.prototype.$moveFoldWidgetUp=function(){for(var e=this.activeRowIndex;e>0;)if(e--,this.$isFoldWidgetVisible(e))return this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=e,void this.$focusFoldWidget(this.activeRowIndex)},e.prototype.$moveFoldWidgetDown=function(){for(var e=this.activeRowIndex;e<this.lines.getLength()-1;)if(e++,this.$isFoldWidgetVisible(e))return this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=e,void this.$focusFoldWidget(this.activeRowIndex)},e.prototype.$moveAnnotationUp=function(){for(var e=this.activeRowIndex;e>0;)if(e--,this.$isAnnotationVisible(e))return this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=e,void this.$focusAnnotation(this.activeRowIndex)},e.prototype.$moveAnnotationDown=function(){for(var e=this.activeRowIndex;e<this.lines.getLength()-1;)if(e++,this.$isAnnotationVisible(e))return this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=e,void this.$focusAnnotation(this.activeRowIndex)},e.prototype.$switchLane=function(e){switch(e){case"annotation":if("annotation"===this.activeLane)break;var t=this.$findNearestAnnotation(this.activeRowIndex);if(null==t)break;this.activeLane="annotation",this.$blurFoldWidget(this.activeRowIndex),this.activeRowIndex=t,this.$focusAnnotation(this.activeRowIndex);break;case"fold":if("fold"===this.activeLane)break;var n=this.$findNearestFoldWidget(this.activeRowIndex);if(null==n)break;this.activeLane="fold",this.$blurAnnotation(this.activeRowIndex),this.activeRowIndex=n,this.$focusFoldWidget(this.activeRowIndex)}},e.prototype.$rowIndexToRow=function(e){var t=this.lines.get(e);return t?t.row:null},e.prototype.$rowToRowIndex=function(e){for(var t=0;t<this.lines.getLength();t++)if(this.lines.get(t).row==e)return t;return null},e}();t.GutterKeyboardHandler=r;var s=function(){function e(e,t){this.gutterKeyboardHandler=t,this.domEvent=e}return e.prototype.getKey=function(){return i.keyCodeToString(this.domEvent.keyCode)},e.prototype.getRow=function(){return this.gutterKeyboardHandler.$rowIndexToRow(this.gutterKeyboardHandler.activeRowIndex)},e.prototype.isInAnnotationLane=function(){return"annotation"===this.gutterKeyboardHandler.activeLane},e.prototype.isInFoldLane=function(){return"fold"===this.gutterKeyboardHandler.activeLane},e}();t.GutterKeyboardEvent=s})),ace.define("ace/editor",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/useragent","ace/keyboard/textinput","ace/mouse/mouse_handler","ace/mouse/fold_handler","ace/keyboard/keybinding","ace/edit_session","ace/search","ace/range","ace/lib/event_emitter","ace/commands/command_manager","ace/commands/default_commands","ace/config","ace/token_iterator","ace/line_widgets","ace/keyboard/gutter_handler","ace/config","ace/clipboard","ace/lib/keys"],(function(e,t,n){"use strict";var i=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},o=e("./lib/oop"),r=e("./lib/dom"),s=e("./lib/lang"),a=e("./lib/useragent"),l=e("./keyboard/textinput").TextInput,c=e("./mouse/mouse_handler").MouseHandler,h=e("./mouse/fold_handler").FoldHandler,d=e("./keyboard/keybinding").KeyBinding,u=e("./edit_session").EditSession,p=e("./search").Search,g=e("./range").Range,f=e("./lib/event_emitter").EventEmitter,m=e("./commands/command_manager").CommandManager,v=e("./commands/default_commands").commands,w=e("./config"),b=e("./token_iterator").TokenIterator,y=e("./line_widgets").LineWidgets,C=e("./keyboard/gutter_handler").GutterKeyboardHandler,$=e("./config").nls,x=e("./clipboard"),_=e("./lib/keys"),S=function(){function e(t,n,i){this.$toDestroy=[];var o=t.getContainerElement();this.container=o,this.renderer=t,this.id="editor"+ ++e.$uid,this.commands=new m(a.isMac?"mac":"win",v),"object"==typeof document&&(this.textInput=new l(t.getTextAreaContainer(),this),this.renderer.textarea=this.textInput.getElement(),this.$mouseHandler=new c(this),new h(this)),this.keyBinding=new d(this),this.$search=(new p).set({wrap:!0}),this.$historyTracker=this.$historyTracker.bind(this),this.commands.on("exec",this.$historyTracker),this.$initOperationListeners(),this._$emitInputEvent=s.delayedCall(function(){this._signal("input",{}),this.session&&!this.session.destroyed&&this.session.bgTokenizer.scheduleStart()}.bind(this)),this.on("change",(function(e,t){t._$emitInputEvent.schedule(31)})),this.setSession(n||i&&i.session||new u("")),w.resetOptions(this),i&&this.setOptions(i),w._signal("editor",this)}return e.prototype.$initOperationListeners=function(){this.commands.on("exec",this.startOperation.bind(this),!0),this.commands.on("afterExec",this.endOperation.bind(this),!0),this.$opResetTimer=s.delayedCall(this.endOperation.bind(this,!0)),this.on("change",function(){this.curOp||(this.startOperation(),this.curOp.selectionBefore=this.$lastSel),this.curOp.docChanged=!0}.bind(this),!0),this.on("changeSelection",function(){this.curOp||(this.startOperation(),this.curOp.selectionBefore=this.$lastSel),this.curOp.selectionChanged=!0}.bind(this),!0)},e.prototype.startOperation=function(e){if(this.curOp){if(!e||this.curOp.command)return;this.prevOp=this.curOp}e||(this.previousCommand=null,e={}),this.$opResetTimer.schedule(),this.curOp=this.session.curOp={command:e.command||{},args:e.args,scrollTop:this.renderer.scrollTop},this.curOp.selectionBefore=this.selection.toJSON()},e.prototype.endOperation=function(e){if(this.curOp&&this.session){if(e&&!1===e.returnValue||!this.session)return this.curOp=null;if(1==e&&this.curOp.command&&"mouse"==this.curOp.command.name)return;if(this._signal("beforeEndOperation"),!this.curOp)return;var t=this.curOp.command,n=t&&t.scrollIntoView;if(n){switch(n){case"center-animate":n="animate";case"center":this.renderer.scrollCursorIntoView(null,.5);break;case"animate":case"cursor":this.renderer.scrollCursorIntoView();break;case"selectionPart":var i=this.selection.getRange(),o=this.renderer.layerConfig;(i.start.row>=o.lastRow||i.end.row<=o.firstRow)&&this.renderer.scrollSelectionIntoView(this.selection.anchor,this.selection.lead)}"animate"==n&&this.renderer.animateScrolling(this.curOp.scrollTop)}var r=this.selection.toJSON();this.curOp.selectionAfter=r,this.$lastSel=this.selection.toJSON(),this.session.getUndoManager().addSelection(r),this.prevOp=this.curOp,this.curOp=null}},e.prototype.$historyTracker=function(e){if(this.$mergeUndoDeltas){var t=this.prevOp,n=this.$mergeableCommands,i=t.command&&e.command.name==t.command.name;if("insertstring"==e.command.name){var o=e.args;void 0===this.mergeNextCommand&&(this.mergeNextCommand=!0),i=i&&this.mergeNextCommand&&(!/\s/.test(o)||/\s/.test(t.args)),this.mergeNextCommand=!0}else i=i&&-1!==n.indexOf(e.command.name);"always"!=this.$mergeUndoDeltas&&Date.now()-this.sequenceStartTime>2e3&&(i=!1),i?this.session.mergeUndoDeltas=!0:-1!==n.indexOf(e.command.name)&&(this.sequenceStartTime=Date.now())}},e.prototype.setKeyboardHandler=function(e,t){if(e&&"string"==typeof e&&"ace"!=e){this.$keybindingId=e;var n=this;w.loadModule(["keybinding",e],(function(i){n.$keybindingId==e&&n.keyBinding.setKeyboardHandler(i&&i.handler),t&&t()}))}else this.$keybindingId=null,this.keyBinding.setKeyboardHandler(e),t&&t()},e.prototype.getKeyboardHandler=function(){return this.keyBinding.getKeyboardHandler()},e.prototype.setSession=function(e){if(this.session!=e){this.curOp&&this.endOperation(),this.curOp={};var t=this.session;if(t){this.session.off("change",this.$onDocumentChange),this.session.off("changeMode",this.$onChangeMode),this.session.off("tokenizerUpdate",this.$onTokenizerUpdate),this.session.off("changeTabSize",this.$onChangeTabSize),this.session.off("changeWrapLimit",this.$onChangeWrapLimit),this.session.off("changeWrapMode",this.$onChangeWrapMode),this.session.off("changeFold",this.$onChangeFold),this.session.off("changeFrontMarker",this.$onChangeFrontMarker),this.session.off("changeBackMarker",this.$onChangeBackMarker),this.session.off("changeBreakpoint",this.$onChangeBreakpoint),this.session.off("changeAnnotation",this.$onChangeAnnotation),this.session.off("changeOverwrite",this.$onCursorChange),this.session.off("changeScrollTop",this.$onScrollTopChange),this.session.off("changeScrollLeft",this.$onScrollLeftChange);var n=this.session.getSelection();n.off("changeCursor",this.$onCursorChange),n.off("changeSelection",this.$onSelectionChange)}this.session=e,e?(this.$onDocumentChange=this.onDocumentChange.bind(this),e.on("change",this.$onDocumentChange),this.renderer.setSession(e),this.$onChangeMode=this.onChangeMode.bind(this),e.on("changeMode",this.$onChangeMode),this.$onTokenizerUpdate=this.onTokenizerUpdate.bind(this),e.on("tokenizerUpdate",this.$onTokenizerUpdate),this.$onChangeTabSize=this.renderer.onChangeTabSize.bind(this.renderer),e.on("changeTabSize",this.$onChangeTabSize),this.$onChangeWrapLimit=this.onChangeWrapLimit.bind(this),e.on("changeWrapLimit",this.$onChangeWrapLimit),this.$onChangeWrapMode=this.onChangeWrapMode.bind(this),e.on("changeWrapMode",this.$onChangeWrapMode),this.$onChangeFold=this.onChangeFold.bind(this),e.on("changeFold",this.$onChangeFold),this.$onChangeFrontMarker=this.onChangeFrontMarker.bind(this),this.session.on("changeFrontMarker",this.$onChangeFrontMarker),this.$onChangeBackMarker=this.onChangeBackMarker.bind(this),this.session.on("changeBackMarker",this.$onChangeBackMarker),this.$onChangeBreakpoint=this.onChangeBreakpoint.bind(this),this.session.on("changeBreakpoint",this.$onChangeBreakpoint),this.$onChangeAnnotation=this.onChangeAnnotation.bind(this),this.session.on("changeAnnotation",this.$onChangeAnnotation),this.$onCursorChange=this.onCursorChange.bind(this),this.session.on("changeOverwrite",this.$onCursorChange),this.$onScrollTopChange=this.onScrollTopChange.bind(this),this.session.on("changeScrollTop",this.$onScrollTopChange),this.$onScrollLeftChange=this.onScrollLeftChange.bind(this),this.session.on("changeScrollLeft",this.$onScrollLeftChange),this.selection=e.getSelection(),this.selection.on("changeCursor",this.$onCursorChange),this.$onSelectionChange=this.onSelectionChange.bind(this),this.selection.on("changeSelection",this.$onSelectionChange),this.onChangeMode(),this.onCursorChange(),this.onScrollTopChange(),this.onScrollLeftChange(),this.onSelectionChange(),this.onChangeFrontMarker(),this.onChangeBackMarker(),this.onChangeBreakpoint(),this.onChangeAnnotation(),this.session.getUseWrapMode()&&this.renderer.adjustWrapLimit(),this.renderer.updateFull()):(this.selection=null,this.renderer.setSession(e)),this._signal("changeSession",{session:e,oldSession:t}),this.curOp=null,t&&t._signal("changeEditor",{oldEditor:this}),e&&e._signal("changeEditor",{editor:this}),e&&!e.destroyed&&e.bgTokenizer.scheduleStart()}},e.prototype.getSession=function(){return this.session},e.prototype.setValue=function(e,t){return this.session.doc.setValue(e),t?1==t?this.navigateFileEnd():-1==t&&this.navigateFileStart():this.selectAll(),e},e.prototype.getValue=function(){return this.session.getValue()},e.prototype.getSelection=function(){return this.selection},e.prototype.resize=function(e){this.renderer.onResize(e)},e.prototype.setTheme=function(e,t){this.renderer.setTheme(e,t)},e.prototype.getTheme=function(){return this.renderer.getTheme()},e.prototype.setStyle=function(e){this.renderer.setStyle(e)},e.prototype.unsetStyle=function(e){this.renderer.unsetStyle(e)},e.prototype.getFontSize=function(){return this.getOption("fontSize")||r.computedStyle(this.container).fontSize},e.prototype.setFontSize=function(e){this.setOption("fontSize",e)},e.prototype.$highlightBrackets=function(){if(!this.$highlightPending){var e=this;this.$highlightPending=!0,setTimeout((function(){e.$highlightPending=!1;var t=e.session;if(t&&!t.destroyed){t.$bracketHighlight&&(t.$bracketHighlight.markerIds.forEach((function(e){t.removeMarker(e)})),t.$bracketHighlight=null);var n=e.getCursorPosition(),i=e.getKeyboardHandler(),o=i&&i.$getDirectionForHighlight&&i.$getDirectionForHighlight(e),r=t.getMatchingBracketRanges(n,o);if(!r){var s=new b(t,n.row,n.column).getCurrentToken();if(s&&/\b(?:tag-open|tag-name)/.test(s.type)){var a=t.getMatchingTags(n);a&&(r=[a.openTagName,a.closeTagName])}}if(!r&&t.$mode.getMatching&&(r=t.$mode.getMatching(e.session)),r){var l="ace_bracket";Array.isArray(r)?1==r.length&&(l="ace_error_bracket"):r=[r],2==r.length&&(0==g.comparePoints(r[0].end,r[1].start)?r=[g.fromPoints(r[0].start,r[1].end)]:0==g.comparePoints(r[0].start,r[1].end)&&(r=[g.fromPoints(r[1].start,r[0].end)])),t.$bracketHighlight={ranges:r,markerIds:r.map((function(e){return t.addMarker(e,l,"text")}))},e.getHighlightIndentGuides()&&e.renderer.$textLayer.$highlightIndentGuide()}else e.getHighlightIndentGuides()&&e.renderer.$textLayer.$highlightIndentGuide()}}),50)}},e.prototype.focus=function(){this.textInput.focus()},e.prototype.isFocused=function(){return this.textInput.isFocused()},e.prototype.blur=function(){this.textInput.blur()},e.prototype.onFocus=function(e){this.$isFocused||(this.$isFocused=!0,this.renderer.showCursor(),this.renderer.visualizeFocus(),this._emit("focus",e))},e.prototype.onBlur=function(e){this.$isFocused&&(this.$isFocused=!1,this.renderer.hideCursor(),this.renderer.visualizeBlur(),this._emit("blur",e))},e.prototype.$cursorChange=function(){this.renderer.updateCursor(),this.$highlightBrackets(),this.$updateHighlightActiveLine()},e.prototype.onDocumentChange=function(e){var t=this.session.$useWrapMode,n=e.start.row==e.end.row?e.end.row:1/0;this.renderer.updateLines(e.start.row,n,t),this._signal("change",e),this.$cursorChange()},e.prototype.onTokenizerUpdate=function(e){var t=e.data;this.renderer.updateLines(t.first,t.last)},e.prototype.onScrollTopChange=function(){this.renderer.scrollToY(this.session.getScrollTop())},e.prototype.onScrollLeftChange=function(){this.renderer.scrollToX(this.session.getScrollLeft())},e.prototype.onCursorChange=function(){this.$cursorChange(),this._signal("changeSelection")},e.prototype.$updateHighlightActiveLine=function(){var e,t=this.getSession();if(this.$highlightActiveLine&&("line"==this.$selectionStyle&&this.selection.isMultiLine()||(e=this.getCursorPosition()),this.renderer.theme&&this.renderer.theme.$selectionColorConflict&&!this.selection.isEmpty()&&(e=!1),!this.renderer.$maxLines||1!==this.session.getLength()||this.renderer.$minLines>1||(e=!1)),t.$highlightLineMarker&&!e)t.removeMarker(t.$highlightLineMarker.id),t.$highlightLineMarker=null;else if(!t.$highlightLineMarker&&e){var n=new g(e.row,e.column,e.row,1/0);n.id=t.addMarker(n,"ace_active-line","screenLine"),t.$highlightLineMarker=n}else e&&(t.$highlightLineMarker.start.row=e.row,t.$highlightLineMarker.end.row=e.row,t.$highlightLineMarker.start.column=e.column,t._signal("changeBackMarker"))},e.prototype.onSelectionChange=function(e){var t=this.session;if(t.$selectionMarker&&t.removeMarker(t.$selectionMarker),t.$selectionMarker=null,this.selection.isEmpty())this.$updateHighlightActiveLine();else{var n=this.selection.getRange(),i=this.getSelectionStyle();t.$selectionMarker=t.addMarker(n,"ace_selection",i)}var o=this.$highlightSelectedWord&&this.$getSelectionHighLightRegexp();this.session.highlight(o),this._signal("changeSelection")},e.prototype.$getSelectionHighLightRegexp=function(){var e=this.session,t=this.getSelectionRange();if(!t.isEmpty()&&!t.isMultiLine()){var n=t.start.column,i=t.end.column,o=e.getLine(t.start.row),r=o.substring(n,i);if(!(r.length>5e3)&&/[\w\d]/.test(r)){var s=this.$search.$assembleRegExp({wholeWord:!0,caseSensitive:!0,needle:r}),a=o.substring(n-1,i+1);if(s.test(a))return s}}},e.prototype.onChangeFrontMarker=function(){this.renderer.updateFrontMarkers()},e.prototype.onChangeBackMarker=function(){this.renderer.updateBackMarkers()},e.prototype.onChangeBreakpoint=function(){this.renderer.updateBreakpoints()},e.prototype.onChangeAnnotation=function(){this.renderer.setAnnotations(this.session.getAnnotations())},e.prototype.onChangeMode=function(e){this.renderer.updateText(),this._emit("changeMode",e)},e.prototype.onChangeWrapLimit=function(){this.renderer.updateFull()},e.prototype.onChangeWrapMode=function(){this.renderer.onResize(!0)},e.prototype.onChangeFold=function(){this.$updateHighlightActiveLine(),this.renderer.updateFull()},e.prototype.getSelectedText=function(){return this.session.getTextRange(this.getSelectionRange())},e.prototype.getCopyText=function(){var e=this.getSelectedText(),t=this.session.doc.getNewLineCharacter(),n=!1;if(!e&&this.$copyWithEmptySelection){n=!0;for(var i=this.selection.getAllRanges(),o=0;o<i.length;o++){var r=i[o];o&&i[o-1].start.row==r.start.row||(e+=this.session.getLine(r.start.row)+t)}}var s={text:e};return this._signal("copy",s),x.lineMode=!!n&&s.text,s.text},e.prototype.onCopy=function(){this.commands.exec("copy",this)},e.prototype.onCut=function(){this.commands.exec("cut",this)},e.prototype.onPaste=function(e,t){var n={text:e,event:t};this.commands.exec("paste",this,n)},e.prototype.$handlePaste=function(e){"string"==typeof e&&(e={text:e}),this._signal("paste",e);var t=e.text,n=t===x.lineMode,i=this.session;if(!this.inMultiSelectMode||this.inVirtualSelectionMode)n?i.insert({row:this.selection.lead.row,column:0},t):this.insert(t);else if(n)this.selection.rangeList.ranges.forEach((function(e){i.insert({row:e.start.row,column:0},t)}));else{var o=t.split(/\r\n|\r|\n/),r=this.selection.rangeList.ranges,s=!(2!=o.length||o[0]&&o[1]);if(o.length!=r.length||s)return this.commands.exec("insertstring",this,t);for(var a=r.length;a--;){var l=r[a];l.isEmpty()||i.remove(l),i.insert(l.start,o[a])}}},e.prototype.execCommand=function(e,t){return this.commands.exec(e,this,t)},e.prototype.insert=function(e,t){var n=this.session,i=n.getMode(),o=this.getCursorPosition();if(this.getBehavioursEnabled()&&!t){var r=i.transformAction(n.getState(o.row),"insertion",this,n,e);r&&(e!==r.text&&(this.inVirtualSelectionMode||(this.session.mergeUndoDeltas=!1,this.mergeNextCommand=!1)),e=r.text)}if("\t"==e&&(e=this.session.getTabString()),this.selection.isEmpty())this.session.getOverwrite()&&-1==e.indexOf("\n")&&((s=new g.fromPoints(o,o)).end.column+=e.length,this.session.remove(s));else{var s=this.getSelectionRange();o=this.session.remove(s),this.clearSelection()}if("\n"==e||"\r\n"==e){var a=n.getLine(o.row);if(o.column>a.search(/\S|$/)){var l=a.substr(o.column).search(/\S|$/);n.doc.removeInLine(o.row,o.column,o.column+l)}}this.clearSelection();var c=o.column,h=n.getState(o.row),d=(a=n.getLine(o.row),i.checkOutdent(h,a,e));if(n.insert(o,e),r&&r.selection&&(2==r.selection.length?this.selection.setSelectionRange(new g(o.row,c+r.selection[0],o.row,c+r.selection[1])):this.selection.setSelectionRange(new g(o.row+r.selection[0],r.selection[1],o.row+r.selection[2],r.selection[3]))),this.$enableAutoIndent){if(n.getDocument().isNewLine(e)){var u=i.getNextLineIndent(h,a.slice(0,o.column),n.getTabString());n.insert({row:o.row+1,column:0},u)}d&&i.autoOutdent(h,n,o.row)}},e.prototype.autoIndent=function(){var e,t,n=this.session,i=n.getMode();if(this.selection.isEmpty())e=0,t=n.doc.getLength()-1;else{var o=this.getSelectionRange();e=o.start.row,t=o.end.row}for(var r,s,a,l="",c="",h="",d=n.getTabString(),u=e;u<=t;u++)u>0&&(l=n.getState(u-1),c=n.getLine(u-1),h=i.getNextLineIndent(l,c,d)),r=n.getLine(u),h!==(s=i.$getIndent(r))&&(s.length>0&&(a=new g(u,0,u,s.length),n.remove(a)),h.length>0&&n.insert({row:u,column:0},h)),i.autoOutdent(l,n,u)},e.prototype.onTextInput=function(e,t){if(!t)return this.keyBinding.onTextInput(e);this.startOperation({command:{name:"insertstring"}});var n=this.applyComposition.bind(this,e,t);this.selection.rangeCount?this.forEachSelection(n):n(),this.endOperation()},e.prototype.applyComposition=function(e,t){var n;(t.extendLeft||t.extendRight)&&((n=this.selection.getRange()).start.column-=t.extendLeft,n.end.column+=t.extendRight,n.start.column<0&&(n.start.row--,n.start.column+=this.session.getLine(n.start.row).length+1),this.selection.setRange(n),e||n.isEmpty()||this.remove()),!e&&this.selection.isEmpty()||this.insert(e,!0),(t.restoreStart||t.restoreEnd)&&((n=this.selection.getRange()).start.column-=t.restoreStart,n.end.column-=t.restoreEnd,this.selection.setRange(n))},e.prototype.onCommandKey=function(e,t,n){return this.keyBinding.onCommandKey(e,t,n)},e.prototype.setOverwrite=function(e){this.session.setOverwrite(e)},e.prototype.getOverwrite=function(){return this.session.getOverwrite()},e.prototype.toggleOverwrite=function(){this.session.toggleOverwrite()},e.prototype.setScrollSpeed=function(e){this.setOption("scrollSpeed",e)},e.prototype.getScrollSpeed=function(){return this.getOption("scrollSpeed")},e.prototype.setDragDelay=function(e){this.setOption("dragDelay",e)},e.prototype.getDragDelay=function(){return this.getOption("dragDelay")},e.prototype.setSelectionStyle=function(e){this.setOption("selectionStyle",e)},e.prototype.getSelectionStyle=function(){return this.getOption("selectionStyle")},e.prototype.setHighlightActiveLine=function(e){this.setOption("highlightActiveLine",e)},e.prototype.getHighlightActiveLine=function(){return this.getOption("highlightActiveLine")},e.prototype.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},e.prototype.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},e.prototype.setHighlightSelectedWord=function(e){this.setOption("highlightSelectedWord",e)},e.prototype.getHighlightSelectedWord=function(){return this.$highlightSelectedWord},e.prototype.setAnimatedScroll=function(e){this.renderer.setAnimatedScroll(e)},e.prototype.getAnimatedScroll=function(){return this.renderer.getAnimatedScroll()},e.prototype.setShowInvisibles=function(e){this.renderer.setShowInvisibles(e)},e.prototype.getShowInvisibles=function(){return this.renderer.getShowInvisibles()},e.prototype.setDisplayIndentGuides=function(e){this.renderer.setDisplayIndentGuides(e)},e.prototype.getDisplayIndentGuides=function(){return this.renderer.getDisplayIndentGuides()},e.prototype.setHighlightIndentGuides=function(e){this.renderer.setHighlightIndentGuides(e)},e.prototype.getHighlightIndentGuides=function(){return this.renderer.getHighlightIndentGuides()},e.prototype.setShowPrintMargin=function(e){this.renderer.setShowPrintMargin(e)},e.prototype.getShowPrintMargin=function(){return this.renderer.getShowPrintMargin()},e.prototype.setPrintMarginColumn=function(e){this.renderer.setPrintMarginColumn(e)},e.prototype.getPrintMarginColumn=function(){return this.renderer.getPrintMarginColumn()},e.prototype.setReadOnly=function(e){this.setOption("readOnly",e)},e.prototype.getReadOnly=function(){return this.getOption("readOnly")},e.prototype.setBehavioursEnabled=function(e){this.setOption("behavioursEnabled",e)},e.prototype.getBehavioursEnabled=function(){return this.getOption("behavioursEnabled")},e.prototype.setWrapBehavioursEnabled=function(e){this.setOption("wrapBehavioursEnabled",e)},e.prototype.getWrapBehavioursEnabled=function(){return this.getOption("wrapBehavioursEnabled")},e.prototype.setShowFoldWidgets=function(e){this.setOption("showFoldWidgets",e)},e.prototype.getShowFoldWidgets=function(){return this.getOption("showFoldWidgets")},e.prototype.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},e.prototype.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},e.prototype.remove=function(e){this.selection.isEmpty()&&("left"==e?this.selection.selectLeft():this.selection.selectRight());var t=this.getSelectionRange();if(this.getBehavioursEnabled()){var n=this.session,i=n.getState(t.start.row),o=n.getMode().transformAction(i,"deletion",this,n,t);if(0===t.end.column){var r=n.getTextRange(t);if("\n"==r[r.length-1]){var s=n.getLine(t.end.row);/^\s+$/.test(s)&&(t.end.column=s.length)}}o&&(t=o)}this.session.remove(t),this.clearSelection()},e.prototype.removeWordRight=function(){this.selection.isEmpty()&&this.selection.selectWordRight(),this.session.remove(this.getSelectionRange()),this.clearSelection()},e.prototype.removeWordLeft=function(){this.selection.isEmpty()&&this.selection.selectWordLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},e.prototype.removeToLineStart=function(){this.selection.isEmpty()&&this.selection.selectLineStart(),this.selection.isEmpty()&&this.selection.selectLeft(),this.session.remove(this.getSelectionRange()),this.clearSelection()},e.prototype.removeToLineEnd=function(){this.selection.isEmpty()&&this.selection.selectLineEnd();var e=this.getSelectionRange();e.start.column==e.end.column&&e.start.row==e.end.row&&(e.end.column=0,e.end.row++),this.session.remove(e),this.clearSelection()},e.prototype.splitLine=function(){this.selection.isEmpty()||(this.session.remove(this.getSelectionRange()),this.clearSelection());var e=this.getCursorPosition();this.insert("\n"),this.moveCursorToPosition(e)},e.prototype.setGhostText=function(e,t){this.session.widgetManager||(this.session.widgetManager=new y(this.session),this.session.widgetManager.attach(this)),this.renderer.setGhostText(e,t)},e.prototype.removeGhostText=function(){this.session.widgetManager&&this.renderer.removeGhostText()},e.prototype.transposeLetters=function(){if(this.selection.isEmpty()){var e=this.getCursorPosition(),t=e.column;if(0!==t){var n,i,o=this.session.getLine(e.row);t<o.length?(n=o.charAt(t)+o.charAt(t-1),i=new g(e.row,t-1,e.row,t+1)):(n=o.charAt(t-1)+o.charAt(t-2),i=new g(e.row,t-2,e.row,t)),this.session.replace(i,n),this.session.selection.moveToPosition(i.end)}}},e.prototype.toLowerCase=function(){var e=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var t=this.getSelectionRange(),n=this.session.getTextRange(t);this.session.replace(t,n.toLowerCase()),this.selection.setSelectionRange(e)},e.prototype.toUpperCase=function(){var e=this.getSelectionRange();this.selection.isEmpty()&&this.selection.selectWord();var t=this.getSelectionRange(),n=this.session.getTextRange(t);this.session.replace(t,n.toUpperCase()),this.selection.setSelectionRange(e)},e.prototype.indent=function(){var e=this.session,t=this.getSelectionRange();if(!(t.start.row<t.end.row)){if(t.start.column<t.end.column){var n=e.getTextRange(t);if(!/^\s+$/.test(n))return h=this.$getSelectedRows(),void e.indentRows(h.first,h.last,"\t")}var i=e.getLine(t.start.row),o=t.start,r=e.getTabSize(),a=e.documentToScreenColumn(o.row,o.column);if(this.session.getUseSoftTabs())var l=r-a%r,c=s.stringRepeat(" ",l);else{for(l=a%r;" "==i[t.start.column-1]&&l;)t.start.column--,l--;this.selection.setSelectionRange(t),c="\t"}return this.insert(c)}var h=this.$getSelectedRows();e.indentRows(h.first,h.last,"\t")},e.prototype.blockIndent=function(){var e=this.$getSelectedRows();this.session.indentRows(e.first,e.last,"\t")},e.prototype.blockOutdent=function(){var e=this.session.getSelection();this.session.outdentRows(e.getRange())},e.prototype.sortLines=function(){for(var e=this.$getSelectedRows(),t=this.session,n=[],i=e.first;i<=e.last;i++)n.push(t.getLine(i));n.sort((function(e,t){return e.toLowerCase()<t.toLowerCase()?-1:e.toLowerCase()>t.toLowerCase()?1:0}));var o=new g(0,0,0,0);for(i=e.first;i<=e.last;i++){var r=t.getLine(i);o.start.row=i,o.end.row=i,o.end.column=r.length,t.replace(o,n[i-e.first])}},e.prototype.toggleCommentLines=function(){var e=this.session.getState(this.getCursorPosition().row),t=this.$getSelectedRows();this.session.getMode().toggleCommentLines(e,this.session,t.first,t.last)},e.prototype.toggleBlockComment=function(){var e=this.getCursorPosition(),t=this.session.getState(e.row),n=this.getSelectionRange();this.session.getMode().toggleBlockComment(t,this.session,n,e)},e.prototype.getNumberAt=function(e,t){var n=/[\-]?[0-9]+(?:\.[0-9]+)?/g;n.lastIndex=0;for(var i=this.session.getLine(e);n.lastIndex<t;){var o=n.exec(i);if(o.index<=t&&o.index+o[0].length>=t)return{value:o[0],start:o.index,end:o.index+o[0].length}}return null},e.prototype.modifyNumber=function(e){var t=this.selection.getCursor().row,n=this.selection.getCursor().column,i=new g(t,n-1,t,n),o=this.session.getTextRange(i);if(!isNaN(parseFloat(o))&&isFinite(o)){var r=this.getNumberAt(t,n);if(r){var s=r.value.indexOf(".")>=0?r.start+r.value.indexOf(".")+1:r.end,a=r.start+r.value.length-s,l=parseFloat(r.value);l*=Math.pow(10,a),s!==r.end&&n<s?e*=Math.pow(10,r.end-n-1):e*=Math.pow(10,r.end-n),l+=e;var c=(l/=Math.pow(10,a)).toFixed(a),h=new g(t,r.start,t,r.end);this.session.replace(h,c),this.moveCursorTo(t,Math.max(r.start+1,n+c.length-r.value.length))}}else this.toggleWord()},e.prototype.toggleWord=function(){var e=this.selection.getCursor().row,t=this.selection.getCursor().column;this.selection.selectWord();var n=this.getSelectedText(),i=this.selection.getWordRange().start.column,o=n.replace(/([a-z]+|[A-Z]+)(?=[A-Z_]|$)/g,"$1 ").split(/\s/),r=t-i-1;r<0&&(r=0);var a=0,l=0,c=this;n.match(/[A-Za-z0-9_]+/)&&o.forEach((function(t,o){l=a+t.length,r>=a&&r<=l&&(n=t,c.selection.clearSelection(),c.moveCursorTo(e,a+i),c.selection.selectTo(e,l+i)),a=l}));for(var h,d=this.$toggleWordPairs,u=0;u<d.length;u++)for(var p=d[u],g=0;g<=1;g++){var f=+!g,m=n.match(new RegExp("^\\s?_?("+s.escapeRegExp(p[g])+")\\s?$","i"));m&&n.match(new RegExp("([_]|^|\\s)("+s.escapeRegExp(m[1])+")($|\\s)","g"))&&(h=n.replace(new RegExp(s.escapeRegExp(p[g]),"i"),(function(e){var t=p[f];return e.toUpperCase()==e?t=t.toUpperCase():e.charAt(0).toUpperCase()==e.charAt(0)&&(t=t.substr(0,0)+p[f].charAt(0).toUpperCase()+t.substr(1)),t})),this.insert(h),h="")}},e.prototype.findLinkAt=function(e,t){var n,o,r=this.session.getLine(e).split(/((?:https?|ftp):\/\/[\S]+)/),s=t;s<0&&(s=0);var a,l=0,c=0;try{for(var h=i(r),d=h.next();!d.done;d=h.next()){var u=d.value;if(c=l+u.length,s>=l&&s<=c&&u.match(/((?:https?|ftp):\/\/[\S]+)/)){a=u.replace(/[\s:.,'";}\]]+$/,"");break}l=c}}catch(e){n={error:e}}finally{try{d&&!d.done&&(o=h.return)&&o.call(h)}finally{if(n)throw n.error}}return a},e.prototype.openLink=function(){var e=this.selection.getCursor(),t=this.findLinkAt(e.row,e.column);return t&&window.open(t,"_blank"),null!=t},e.prototype.removeLines=function(){var e=this.$getSelectedRows();this.session.removeFullLines(e.first,e.last),this.clearSelection()},e.prototype.duplicateSelection=function(){var e=this.selection,t=this.session,n=e.getRange(),i=e.isBackwards();if(n.isEmpty()){var o=n.start.row;t.duplicateLines(o,o)}else{var r=i?n.start:n.end,s=t.insert(r,t.getTextRange(n),!1);n.start=r,n.end=s,e.setSelectionRange(n,i)}},e.prototype.moveLinesDown=function(){this.$moveLines(1,!1)},e.prototype.moveLinesUp=function(){this.$moveLines(-1,!1)},e.prototype.moveText=function(e,t,n){return this.session.moveText(e,t,n)},e.prototype.copyLinesUp=function(){this.$moveLines(-1,!0)},e.prototype.copyLinesDown=function(){this.$moveLines(1,!0)},e.prototype.$moveLines=function(e,t){var n,i,o=this.selection;if(!o.inMultiSelectMode||this.inVirtualSelectionMode){var r=o.toOrientedRange();n=this.$getSelectedRows(r),i=this.session.$moveLines(n.first,n.last,t?0:e),t&&-1==e&&(i=0),r.moveBy(i,0),o.fromOrientedRange(r)}else{var s=o.rangeList.ranges;o.rangeList.detach(this.session),this.inVirtualSelectionMode=!0;for(var a=0,l=0,c=s.length,h=0;h<c;h++){var d=h;s[h].moveBy(a,0);for(var u=(n=this.$getSelectedRows(s[h])).first,p=n.last;++h<c;){l&&s[h].moveBy(l,0);var g=this.$getSelectedRows(s[h]);if(t&&g.first!=p)break;if(!t&&g.first>p+1)break;p=g.last}for(h--,a=this.session.$moveLines(u,p,t?0:e),t&&-1==e&&(d=h+1);d<=h;)s[d].moveBy(a,0),d++;t||(a=0),l+=a}o.fromOrientedRange(o.ranges[0]),o.rangeList.attach(this.session),this.inVirtualSelectionMode=!1}},e.prototype.$getSelectedRows=function(e){return e=(e||this.getSelectionRange()).collapseRows(),{first:this.session.getRowFoldStart(e.start.row),last:this.session.getRowFoldEnd(e.end.row)}},e.prototype.onCompositionStart=function(e){this.renderer.showComposition(e)},e.prototype.onCompositionUpdate=function(e){this.renderer.setCompositionText(e)},e.prototype.onCompositionEnd=function(){this.renderer.hideComposition()},e.prototype.getFirstVisibleRow=function(){return this.renderer.getFirstVisibleRow()},e.prototype.getLastVisibleRow=function(){return this.renderer.getLastVisibleRow()},e.prototype.isRowVisible=function(e){return e>=this.getFirstVisibleRow()&&e<=this.getLastVisibleRow()},e.prototype.isRowFullyVisible=function(e){return e>=this.renderer.getFirstFullyVisibleRow()&&e<=this.renderer.getLastFullyVisibleRow()},e.prototype.$getVisibleRowCount=function(){return this.renderer.getScrollBottomRow()-this.renderer.getScrollTopRow()+1},e.prototype.$moveByPage=function(e,t){var n=this.renderer,i=this.renderer.layerConfig,o=e*Math.floor(i.height/i.lineHeight);!0===t?this.selection.$moveSelection((function(){this.moveCursorBy(o,0)})):!1===t&&(this.selection.moveCursorBy(o,0),this.selection.clearSelection());var r=n.scrollTop;n.scrollBy(0,o*i.lineHeight),null!=t&&n.scrollCursorIntoView(null,.5),n.animateScrolling(r)},e.prototype.selectPageDown=function(){this.$moveByPage(1,!0)},e.prototype.selectPageUp=function(){this.$moveByPage(-1,!0)},e.prototype.gotoPageDown=function(){this.$moveByPage(1,!1)},e.prototype.gotoPageUp=function(){this.$moveByPage(-1,!1)},e.prototype.scrollPageDown=function(){this.$moveByPage(1)},e.prototype.scrollPageUp=function(){this.$moveByPage(-1)},e.prototype.scrollToRow=function(e){this.renderer.scrollToRow(e)},e.prototype.scrollToLine=function(e,t,n,i){this.renderer.scrollToLine(e,t,n,i)},e.prototype.centerSelection=function(){var e=this.getSelectionRange(),t={row:Math.floor(e.start.row+(e.end.row-e.start.row)/2),column:Math.floor(e.start.column+(e.end.column-e.start.column)/2)};this.renderer.alignCursor(t,.5)},e.prototype.getCursorPosition=function(){return this.selection.getCursor()},e.prototype.getCursorPositionScreen=function(){return this.session.documentToScreenPosition(this.getCursorPosition())},e.prototype.getSelectionRange=function(){return this.selection.getRange()},e.prototype.selectAll=function(){this.selection.selectAll()},e.prototype.clearSelection=function(){this.selection.clearSelection()},e.prototype.moveCursorTo=function(e,t){this.selection.moveCursorTo(e,t)},e.prototype.moveCursorToPosition=function(e){this.selection.moveCursorToPosition(e)},e.prototype.jumpToMatching=function(e,t){var n=this.getCursorPosition(),i=new b(this.session,n.row,n.column),o=i.getCurrentToken(),r=0;o&&-1!==o.type.indexOf("tag-name")&&(o=i.stepBackward());var s=o||i.stepForward();if(s){var a,l,c=!1,h={},d=n.column-s.start,u={")":"(","(":"(","]":"[","[":"[","{":"{","}":"{"};do{if(s.value.match(/[{}()\[\]]/g)){for(;d<s.value.length&&!c;d++)if(u[s.value[d]])switch(l=u[s.value[d]]+"."+s.type.replace("rparen","lparen"),isNaN(h[l])&&(h[l]=0),s.value[d]){case"(":case"[":case"{":h[l]++;break;case")":case"]":case"}":h[l]--,-1===h[l]&&(a="bracket",c=!0)}}else-1!==s.type.indexOf("tag-name")&&(isNaN(h[s.value])&&(h[s.value]=0),"<"===o.value&&r>1?h[s.value]++:"</"===o.value&&h[s.value]--,-1===h[s.value]&&(a="tag",c=!0));c||(o=s,r++,s=i.stepForward(),d=0)}while(s&&!c);if(a){var p,f;if("bracket"===a)(p=this.session.getBracketRange(n))||(f=(p=new g(i.getCurrentTokenRow(),i.getCurrentTokenColumn()+d-1,i.getCurrentTokenRow(),i.getCurrentTokenColumn()+d-1)).start,(t||f.row===n.row&&Math.abs(f.column-n.column)<2)&&(p=this.session.getBracketRange(f)));else if("tag"===a){if(!s||-1===s.type.indexOf("tag-name"))return;if(0===(p=new g(i.getCurrentTokenRow(),i.getCurrentTokenColumn()-2,i.getCurrentTokenRow(),i.getCurrentTokenColumn()-2)).compare(n.row,n.column)){var m=this.session.getMatchingTags(n);m&&(m.openTag.contains(n.row,n.column)?f=(p=m.closeTag).start:(p=m.openTag,f=m.closeTag.start.row===n.row&&m.closeTag.start.column===n.column?p.end:p.start))}f=f||p.start}(f=p&&p.cursor||f)&&(e?p&&t?this.selection.setRange(p):p&&p.isEqual(this.getSelectionRange())?this.clearSelection():this.selection.selectTo(f.row,f.column):this.selection.moveTo(f.row,f.column))}}},e.prototype.gotoLine=function(e,t,n){this.selection.clearSelection(),this.session.unfold({row:e-1,column:t||0}),this.exitMultiSelectMode&&this.exitMultiSelectMode(),this.moveCursorTo(e-1,t||0),this.isRowFullyVisible(e-1)||this.scrollToLine(e-1,!0,n)},e.prototype.navigateTo=function(e,t){this.selection.moveTo(e,t)},e.prototype.navigateUp=function(e){if(this.selection.isMultiLine()&&!this.selection.isBackwards()){var t=this.selection.anchor.getPosition();return this.moveCursorToPosition(t)}this.selection.clearSelection(),this.selection.moveCursorBy(-e||-1,0)},e.prototype.navigateDown=function(e){if(this.selection.isMultiLine()&&this.selection.isBackwards()){var t=this.selection.anchor.getPosition();return this.moveCursorToPosition(t)}this.selection.clearSelection(),this.selection.moveCursorBy(e||1,0)},e.prototype.navigateLeft=function(e){if(this.selection.isEmpty())for(e=e||1;e--;)this.selection.moveCursorLeft();else{var t=this.getSelectionRange().start;this.moveCursorToPosition(t)}this.clearSelection()},e.prototype.navigateRight=function(e){if(this.selection.isEmpty())for(e=e||1;e--;)this.selection.moveCursorRight();else{var t=this.getSelectionRange().end;this.moveCursorToPosition(t)}this.clearSelection()},e.prototype.navigateLineStart=function(){this.selection.moveCursorLineStart(),this.clearSelection()},e.prototype.navigateLineEnd=function(){this.selection.moveCursorLineEnd(),this.clearSelection()},e.prototype.navigateFileEnd=function(){this.selection.moveCursorFileEnd(),this.clearSelection()},e.prototype.navigateFileStart=function(){this.selection.moveCursorFileStart(),this.clearSelection()},e.prototype.navigateWordRight=function(){this.selection.moveCursorWordRight(),this.clearSelection()},e.prototype.navigateWordLeft=function(){this.selection.moveCursorWordLeft(),this.clearSelection()},e.prototype.replace=function(e,t){t&&this.$search.set(t);var n=this.$search.find(this.session),i=0;return n?(this.$tryReplace(n,e)&&(i=1),this.selection.setSelectionRange(n),this.renderer.scrollSelectionIntoView(n.start,n.end),i):i},e.prototype.replaceAll=function(e,t){t&&this.$search.set(t);var n=this.$search.findAll(this.session),i=0;if(!n.length)return i;var o=this.getSelectionRange();this.selection.moveTo(0,0);for(var r=n.length-1;r>=0;--r)this.$tryReplace(n[r],e)&&i++;return this.selection.setSelectionRange(o),i},e.prototype.$tryReplace=function(e,t){var n=this.session.getTextRange(e);return null!==(t=this.$search.replace(n,t))?(e.end=this.session.replace(e,t),e):null},e.prototype.getLastSearchOptions=function(){return this.$search.getOptions()},e.prototype.find=function(e,t,n){t||(t={}),"string"==typeof e||e instanceof RegExp?t.needle=e:"object"==typeof e&&o.mixin(t,e);var i=this.selection.getRange();null==t.needle&&((e=this.session.getTextRange(i)||this.$search.$options.needle)||(i=this.session.getWordRange(i.start.row,i.start.column),e=this.session.getTextRange(i)),this.$search.set({needle:e})),this.$search.set(t),t.start||this.$search.set({start:i});var r=this.$search.find(this.session);return t.preventScroll?r:r?(this.revealRange(r,n),r):(t.backwards?i.start=i.end:i.end=i.start,void this.selection.setRange(i))},e.prototype.findNext=function(e,t){this.find({skipCurrent:!0,backwards:!1},e,t)},e.prototype.findPrevious=function(e,t){this.find(e,{skipCurrent:!0,backwards:!0},t)},e.prototype.revealRange=function(e,t){this.session.unfold(e),this.selection.setSelectionRange(e);var n=this.renderer.scrollTop;this.renderer.scrollSelectionIntoView(e.start,e.end,.5),!1!==t&&this.renderer.animateScrolling(n)},e.prototype.undo=function(){this.session.getUndoManager().undo(this.session),this.renderer.scrollCursorIntoView(null,.5)},e.prototype.redo=function(){this.session.getUndoManager().redo(this.session),this.renderer.scrollCursorIntoView(null,.5)},e.prototype.destroy=function(){this.$toDestroy&&(this.$toDestroy.forEach((function(e){e.destroy()})),this.$toDestroy=null),this.$mouseHandler&&this.$mouseHandler.destroy(),this.renderer.destroy(),this._signal("destroy",this),this.session&&this.session.destroy(),this._$emitInputEvent&&this._$emitInputEvent.cancel(),this.removeAllListeners()},e.prototype.setAutoScrollEditorIntoView=function(e){if(e){var t,n=this,i=!1;this.$scrollAnchor||(this.$scrollAnchor=document.createElement("div"));var o=this.$scrollAnchor;o.style.cssText="position:absolute",this.container.insertBefore(o,this.container.firstChild);var r=this.on("changeSelection",(function(){i=!0})),s=this.renderer.on("beforeRender",(function(){i&&(t=n.renderer.container.getBoundingClientRect())})),a=this.renderer.on("afterRender",(function(){if(i&&t&&(n.isFocused()||n.searchBox&&n.searchBox.isFocused())){var e=n.renderer,r=e.$cursorLayer.$pixelPos,s=e.layerConfig,a=r.top-s.offset;null!=(i=r.top>=0&&a+t.top<0||!(r.top<s.height&&r.top+t.top+s.lineHeight>window.innerHeight)&&null)&&(o.style.top=a+"px",o.style.left=r.left+"px",o.style.height=s.lineHeight+"px",o.scrollIntoView(i)),i=t=null}}));this.setAutoScrollEditorIntoView=function(e){e||(delete this.setAutoScrollEditorIntoView,this.off("changeSelection",r),this.renderer.off("afterRender",a),this.renderer.off("beforeRender",s))}}},e.prototype.$resetCursorStyle=function(){var e=this.$cursorStyle||"ace",t=this.renderer.$cursorLayer;t&&(t.setSmoothBlinking(/smooth/.test(e)),t.isBlinking=!this.$readOnly&&"wide"!=e,r.setCssClass(t.element,"ace_slim-cursors",/slim/.test(e)))},e.prototype.prompt=function(e,t,n){var i=this;w.loadModule("ace/ext/prompt",(function(o){o.prompt(i,e,t,n)}))},e}();S.$uid=0,S.prototype.curOp=null,S.prototype.prevOp={},S.prototype.$mergeableCommands=["backspace","del","insertstring"],S.prototype.$toggleWordPairs=[["first","last"],["true","false"],["yes","no"],["width","height"],["top","bottom"],["right","left"],["on","off"],["x","y"],["get","set"],["max","min"],["horizontal","vertical"],["show","hide"],["add","remove"],["up","down"],["before","after"],["even","odd"],["in","out"],["inside","outside"],["next","previous"],["increase","decrease"],["attach","detach"],["&&","||"],["==","!="]],o.implement(S.prototype,f),w.defineOptions(S.prototype,"editor",{selectionStyle:{set:function(e){this.onSelectionChange(),this._signal("changeSelectionStyle",{data:e})},initialValue:"line"},highlightActiveLine:{set:function(){this.$updateHighlightActiveLine()},initialValue:!0},highlightSelectedWord:{set:function(e){this.$onSelectionChange()},initialValue:!0},readOnly:{set:function(e){this.textInput.setReadOnly(e),this.$resetCursorStyle()},initialValue:!1},copyWithEmptySelection:{set:function(e){this.textInput.setCopyWithEmptySelection(e)},initialValue:!1},cursorStyle:{set:function(e){this.$resetCursorStyle()},values:["ace","slim","smooth","wide"],initialValue:"ace"},mergeUndoDeltas:{values:[!1,!0,"always"],initialValue:!0},behavioursEnabled:{initialValue:!0},wrapBehavioursEnabled:{initialValue:!0},enableAutoIndent:{initialValue:!0},autoScrollEditorIntoView:{set:function(e){this.setAutoScrollEditorIntoView(e)}},keyboardHandler:{set:function(e){this.setKeyboardHandler(e)},get:function(){return this.$keybindingId},handlesSet:!0},value:{set:function(e){this.session.setValue(e)},get:function(){return this.getValue()},handlesSet:!0,hidden:!0},session:{set:function(e){this.setSession(e)},get:function(){return this.session},handlesSet:!0,hidden:!0},showLineNumbers:{set:function(e){this.renderer.$gutterLayer.setShowLineNumbers(e),this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER),e&&this.$relativeLineNumbers?E.attach(this):E.detach(this)},initialValue:!0},relativeLineNumbers:{set:function(e){this.$showLineNumbers&&e?E.attach(this):E.detach(this)}},placeholder:{set:function(e){this.$updatePlaceholder||(this.$updatePlaceholder=function(){var e=this.session&&(this.renderer.$composition||this.session.getLength()>1||this.session.getLine(0).length>0);if(e&&this.renderer.placeholderNode)this.renderer.off("afterRender",this.$updatePlaceholder),r.removeCssClass(this.container,"ace_hasPlaceholder"),this.renderer.placeholderNode.remove(),this.renderer.placeholderNode=null;else if(e||this.renderer.placeholderNode)!e&&this.renderer.placeholderNode&&(this.renderer.placeholderNode.textContent=this.$placeholder||"");else{this.renderer.on("afterRender",this.$updatePlaceholder),r.addCssClass(this.container,"ace_hasPlaceholder");var t=r.createElement("div");t.className="ace_placeholder",t.textContent=this.$placeholder||"",this.renderer.placeholderNode=t,this.renderer.content.appendChild(this.renderer.placeholderNode)}}.bind(this),this.on("input",this.$updatePlaceholder)),this.$updatePlaceholder()}},enableKeyboardAccessibility:{set:function(e){var t,n={name:"blurTextInput",description:"Set focus to the editor content div to allow tabbing through the page",bindKey:"Esc",exec:function(e){e.blur(),e.renderer.scroller.focus()},readOnly:!0},i=function(e){if(e.target==this.renderer.scroller&&e.keyCode===_.enter){e.preventDefault();var t=this.getCursorPosition().row;this.isRowVisible(t)||this.scrollToLine(t,!0,!0),this.focus()}};e?(this.renderer.enableKeyboardAccessibility=!0,this.renderer.keyboardFocusClassName="ace_keyboard-focus",this.textInput.getElement().setAttribute("tabindex",-1),this.textInput.setNumberOfExtraLines(a.isWin?3:0),this.renderer.scroller.setAttribute("tabindex",0),this.renderer.scroller.setAttribute("role","group"),this.renderer.scroller.setAttribute("aria-roledescription",$("editor")),this.renderer.scroller.classList.add(this.renderer.keyboardFocusClassName),this.renderer.scroller.setAttribute("aria-label",$("Editor content, press Enter to start editing, press Escape to exit")),this.renderer.scroller.addEventListener("keyup",i.bind(this)),this.commands.addCommand(n),this.renderer.$gutter.setAttribute("tabindex",0),this.renderer.$gutter.setAttribute("aria-hidden",!1),this.renderer.$gutter.setAttribute("role","group"),this.renderer.$gutter.setAttribute("aria-roledescription",$("editor")),this.renderer.$gutter.setAttribute("aria-label",$("Editor gutter, press Enter to interact with controls using arrow keys, press Escape to exit")),this.renderer.$gutter.classList.add(this.renderer.keyboardFocusClassName),this.renderer.content.setAttribute("aria-hidden",!0),t||(t=new C(this)),t.addListener()):(this.renderer.enableKeyboardAccessibility=!1,this.textInput.getElement().setAttribute("tabindex",0),this.textInput.setNumberOfExtraLines(0),this.renderer.scroller.setAttribute("tabindex",-1),this.renderer.scroller.removeAttribute("role"),this.renderer.scroller.removeAttribute("aria-roledescription"),this.renderer.scroller.classList.remove(this.renderer.keyboardFocusClassName),this.renderer.scroller.removeAttribute("aria-label"),this.renderer.scroller.removeEventListener("keyup",i.bind(this)),this.commands.removeCommand(n),this.renderer.content.removeAttribute("aria-hidden"),this.renderer.$gutter.setAttribute("tabindex",-1),this.renderer.$gutter.setAttribute("aria-hidden",!0),this.renderer.$gutter.removeAttribute("role"),this.renderer.$gutter.removeAttribute("aria-roledescription"),this.renderer.$gutter.removeAttribute("aria-label"),this.renderer.$gutter.classList.remove(this.renderer.keyboardFocusClassName),t&&t.removeListener())},initialValue:!1},customScrollbar:"renderer",hScrollBarAlwaysVisible:"renderer",vScrollBarAlwaysVisible:"renderer",highlightGutterLine:"renderer",animatedScroll:"renderer",showInvisibles:"renderer",showPrintMargin:"renderer",printMarginColumn:"renderer",printMargin:"renderer",fadeFoldWidgets:"renderer",showFoldWidgets:"renderer",displayIndentGuides:"renderer",highlightIndentGuides:"renderer",showGutter:"renderer",fontSize:"renderer",fontFamily:"renderer",maxLines:"renderer",minLines:"renderer",scrollPastEnd:"renderer",fixedWidthGutter:"renderer",theme:"renderer",hasCssTransforms:"renderer",maxPixelHeight:"renderer",useTextareaForIME:"renderer",useResizeObserver:"renderer",useSvgGutterIcons:"renderer",showFoldedAnnotations:"renderer",scrollSpeed:"$mouseHandler",dragDelay:"$mouseHandler",dragEnabled:"$mouseHandler",focusTimeout:"$mouseHandler",tooltipFollowsMouse:"$mouseHandler",firstLineNumber:"session",overwrite:"session",newLineMode:"session",useWorker:"session",useSoftTabs:"session",navigateWithinSoftTabs:"session",tabSize:"session",wrap:"session",indentedSoftWrap:"session",foldStyle:"session",mode:"session"});var E={getText:function(e,t){return(Math.abs(e.selection.lead.row-t)||t+1+(t<9?"·":""))+""},getWidth:function(e,t,n){return Math.max(t.toString().length,(n.lastRow+1).toString().length,2)*n.characterWidth},update:function(e,t){t.renderer.$loop.schedule(t.renderer.CHANGE_GUTTER)},attach:function(e){e.renderer.$gutterLayer.$renderer=this,e.on("changeSelection",this.update),this.update(null,e)},detach:function(e){e.renderer.$gutterLayer.$renderer==this&&(e.renderer.$gutterLayer.$renderer=null),e.off("changeSelection",this.update),this.update(null,e)}};t.Editor=S})),ace.define("ace/undomanager",["require","exports","module","ace/range"],(function(e,t,n){"use strict";var i=function(){function e(){this.$maxRev=0,this.$fromUndo=!1,this.$undoDepth=1/0,this.reset()}return e.prototype.addSession=function(e){this.$session=e},e.prototype.add=function(e,t,n){if(!this.$fromUndo&&e!=this.$lastDelta){if(this.$keepRedoStack||(this.$redoStack.length=0),!1===t||!this.lastDeltas){this.lastDeltas=[];var i=this.$undoStack.length;i>this.$undoDepth-1&&this.$undoStack.splice(0,i-this.$undoDepth+1),this.$undoStack.push(this.lastDeltas),e.id=this.$rev=++this.$maxRev}"remove"!=e.action&&"insert"!=e.action||(this.$lastDelta=e),this.lastDeltas.push(e)}},e.prototype.addSelection=function(e,t){this.selections.push({value:e,rev:t||this.$rev})},e.prototype.startNewGroup=function(){return this.lastDeltas=null,this.$rev},e.prototype.markIgnored=function(e,t){null==t&&(t=this.$rev+1);for(var n=this.$undoStack,i=n.length;i--;){var o=n[i][0];if(o.id<=e)break;o.id<t&&(o.ignore=!0)}this.lastDeltas=null},e.prototype.getSelection=function(e,t){for(var n=this.selections,i=n.length;i--;){var o=n[i];if(o.rev<e)return t&&(o=n[i+1]),o}},e.prototype.getRevision=function(){return this.$rev},e.prototype.getDeltas=function(e,t){null==t&&(t=this.$rev+1);for(var n=this.$undoStack,i=null,o=0,r=n.length;r--;){var s=n[r][0];if(s.id<t&&!i&&(i=r+1),s.id<=e){o=r+1;break}}return n.slice(o,i)},e.prototype.getChangedRanges=function(e,t){null==t&&(t=this.$rev+1)},e.prototype.getChangedLines=function(e,t){null==t&&(t=this.$rev+1)},e.prototype.undo=function(e,t){this.lastDeltas=null;var n=this.$undoStack;if(function(e,t){for(var n=t;n--;){var i=e[n];if(i&&!i[0].ignore){for(;n<t-1;){var o=h(e[n],e[n+1]);e[n]=o[0],e[n+1]=o[1],n++}return!0}}}(n,n.length)){e||(e=this.$session),this.$redoStackBaseRev!==this.$rev&&this.$redoStack.length&&(this.$redoStack=[]),this.$fromUndo=!0;var i=n.pop(),o=null;return i&&(o=e.undoChanges(i,t),this.$redoStack.push(i),this.$syncRev()),this.$fromUndo=!1,o}},e.prototype.redo=function(e,t){if(this.lastDeltas=null,e||(e=this.$session),this.$fromUndo=!0,this.$redoStackBaseRev!=this.$rev){var n=this.getDeltas(this.$redoStackBaseRev,this.$rev+1);!function(e,t){for(var n=0;n<t.length;n++)for(var i=t[n],o=0;o<i.length;o++)f(e,i[o])}(this.$redoStack,n),this.$redoStackBaseRev=this.$rev,this.$redoStack.forEach((function(e){e[0].id=++this.$maxRev}),this)}var i=this.$redoStack.pop(),o=null;return i&&(o=e.redoChanges(i,t),this.$undoStack.push(i),this.$syncRev()),this.$fromUndo=!1,o},e.prototype.$syncRev=function(){var e=this.$undoStack,t=e[e.length-1],n=t&&t[0].id||0;this.$redoStackBaseRev=n,this.$rev=n},e.prototype.reset=function(){this.lastDeltas=null,this.$lastDelta=null,this.$undoStack=[],this.$redoStack=[],this.$rev=0,this.mark=0,this.$redoStackBaseRev=this.$rev,this.selections=[]},e.prototype.canUndo=function(){return this.$undoStack.length>0},e.prototype.canRedo=function(){return this.$redoStack.length>0},e.prototype.bookmark=function(e){null==e&&(e=this.$rev),this.mark=e},e.prototype.isAtBookmark=function(){return this.$rev===this.mark},e.prototype.toJSON=function(){},e.prototype.fromJSON=function(){},e.prototype.$prettyPrint=function(e){return e?a(e):a(this.$undoStack)+"\n---\n"+a(this.$redoStack)},e}();i.prototype.hasUndo=i.prototype.canUndo,i.prototype.hasRedo=i.prototype.canRedo,i.prototype.isClean=i.prototype.isAtBookmark,i.prototype.markClean=i.prototype.bookmark;var o=e("./range").Range,r=o.comparePoints;function s(e){return{row:e.row,column:e.column}}function a(e){if(e=e||this,Array.isArray(e))return e.map(a).join("\n");var t="";return e.action?(t="insert"==e.action?"+":"-",t+="["+e.lines+"]"):e.value&&(t=Array.isArray(e.value)?e.value.map(l).join("\n"):l(e.value)),e.start&&(t+=l(e)),(e.id||e.rev)&&(t+="\t("+(e.id||e.rev)+")"),t}function l(e){return e.start.row+":"+e.start.column+"=>"+e.end.row+":"+e.end.column}function c(e,t){var n="insert"==e.action,i="insert"==t.action;if(n&&i)if(r(t.start,e.end)>=0)u(t,e,-1);else{if(!(r(t.start,e.start)<=0))return null;u(e,t,1)}else if(n&&!i)if(r(t.start,e.end)>=0)u(t,e,-1);else{if(!(r(t.end,e.start)<=0))return null;u(e,t,-1)}else if(!n&&i)if(r(t.start,e.start)>=0)u(t,e,1);else{if(!(r(t.start,e.start)<=0))return null;u(e,t,1)}else if(!n&&!i)if(r(t.start,e.start)>=0)u(t,e,1);else{if(!(r(t.end,e.start)<=0))return null;u(e,t,-1)}return[t,e]}function h(e,t){for(var n=e.length;n--;)for(var i=0;i<t.length;i++)if(!c(e[n],t[i])){for(;n<e.length;){for(;i--;)c(t[i],e[n]);i=t.length,n++}return[e,t]}return e.selectionBefore=t.selectionBefore=e.selectionAfter=t.selectionAfter=null,[t,e]}function d(e,t){var n="insert"==e.action,i="insert"==t.action;if(n&&i)r(e.start,t.start)<0?u(t,e,1):u(e,t,1);else if(n&&!i)r(e.start,t.end)>=0?u(e,t,-1):(r(e.start,t.start)<=0||u(e,o.fromPoints(t.start,e.start),-1),u(t,e,1));else if(!n&&i)r(t.start,e.end)>=0?u(t,e,-1):(r(t.start,e.start)<=0||u(t,o.fromPoints(e.start,t.start),-1),u(e,t,1));else if(!n&&!i)if(r(t.start,e.end)>=0)u(t,e,-1);else{var s,a;if(!(r(t.end,e.start)<=0))return r(e.start,t.start)<0&&(s=e,e=g(e,t.start)),r(e.end,t.end)>0&&(a=g(e,t.end)),p(t.end,e.start,e.end,-1),a&&!s&&(e.lines=a.lines,e.start=a.start,e.end=a.end,a=e),[t,s,a].filter(Boolean);u(e,t,-1)}return[t,e]}function u(e,t,n){p(e.start,t.start,t.end,n),p(e.end,t.start,t.end,n)}function p(e,t,n,i){e.row==(1==i?t:n).row&&(e.column+=i*(n.column-t.column)),e.row+=i*(n.row-t.row)}function g(e,t){var n=e.lines,i=e.end;e.end=s(t);var o=e.end.row-e.start.row,r=n.splice(o,n.length),a=o?t.column:t.column-e.start.column;return n.push(r[0].substring(0,a)),r[0]=r[0].substr(a),{start:s(t),end:i,lines:r,action:e.action}}function f(e,t){t=function(e){return{start:s(e.start),end:s(e.end),action:e.action,lines:e.lines.slice()}}(t);for(var n=e.length;n--;){for(var i=e[n],o=0;o<i.length;o++){var r=d(i[o],t);t=r[0],2!=r.length&&(r[2]?(i.splice(o+1,1,r[1],r[2]),o++):r[1]||(i.splice(o,1),o--))}i.length||e.splice(n,1)}return e}o.comparePoints,t.UndoManager=i})),ace.define("ace/layer/lines",["require","exports","module","ace/lib/dom"],(function(e,t,n){"use strict";var i=e("../lib/dom"),o=function(){function e(e,t){this.element=e,this.canvasHeight=t||5e5,this.element.style.height=2*this.canvasHeight+"px",this.cells=[],this.cellCache=[],this.$offsetCoefficient=0}return e.prototype.moveContainer=function(e){i.translate(this.element,0,-e.firstRowScreen*e.lineHeight%this.canvasHeight-e.offset*this.$offsetCoefficient)},e.prototype.pageChanged=function(e,t){return Math.floor(e.firstRowScreen*e.lineHeight/this.canvasHeight)!==Math.floor(t.firstRowScreen*t.lineHeight/this.canvasHeight)},e.prototype.computeLineTop=function(e,t,n){var i=t.firstRowScreen*t.lineHeight,o=Math.floor(i/this.canvasHeight);return n.documentToScreenRow(e,0)*t.lineHeight-o*this.canvasHeight},e.prototype.computeLineHeight=function(e,t,n){return t.lineHeight*n.getRowLineCount(e)},e.prototype.getLength=function(){return this.cells.length},e.prototype.get=function(e){return this.cells[e]},e.prototype.shift=function(){this.$cacheCell(this.cells.shift())},e.prototype.pop=function(){this.$cacheCell(this.cells.pop())},e.prototype.push=function(e){if(Array.isArray(e)){this.cells.push.apply(this.cells,e);for(var t=i.createFragment(this.element),n=0;n<e.length;n++)t.appendChild(e[n].element);this.element.appendChild(t)}else this.cells.push(e),this.element.appendChild(e.element)},e.prototype.unshift=function(e){if(Array.isArray(e)){this.cells.unshift.apply(this.cells,e);for(var t=i.createFragment(this.element),n=0;n<e.length;n++)t.appendChild(e[n].element);this.element.firstChild?this.element.insertBefore(t,this.element.firstChild):this.element.appendChild(t)}else this.cells.unshift(e),this.element.insertAdjacentElement("afterbegin",e.element)},e.prototype.last=function(){return this.cells.length?this.cells[this.cells.length-1]:null},e.prototype.$cacheCell=function(e){e&&(e.element.remove(),this.cellCache.push(e))},e.prototype.createCell=function(e,t,n,o){var r=this.cellCache.pop();if(!r){var s=i.createElement("div");o&&o(s),this.element.appendChild(s),r={element:s,text:"",row:e}}return r.row=e,r},e}();t.Lines=o})),ace.define("ace/layer/gutter",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/layer/lines","ace/config"],(function(e,t,n){"use strict";var i=e("../lib/dom"),o=e("../lib/oop"),r=e("../lib/lang"),s=e("../lib/event_emitter").EventEmitter,a=e("./lines").Lines,l=e("../config").nls,c=function(){function e(e){this.element=i.createElement("div"),this.element.className="ace_layer ace_gutter-layer",e.appendChild(this.element),this.setShowFoldWidgets(this.$showFoldWidgets),this.gutterWidth=0,this.$annotations=[],this.$updateAnnotations=this.$updateAnnotations.bind(this),this.$lines=new a(this.element),this.$lines.$offsetCoefficient=1}return e.prototype.setSession=function(e){this.session&&this.session.off("change",this.$updateAnnotations),this.session=e,e&&e.on("change",this.$updateAnnotations)},e.prototype.addGutterDecoration=function(e,t){window.console&&console.warn&&console.warn("deprecated use session.addGutterDecoration"),this.session.addGutterDecoration(e,t)},e.prototype.removeGutterDecoration=function(e,t){window.console&&console.warn&&console.warn("deprecated use session.removeGutterDecoration"),this.session.removeGutterDecoration(e,t)},e.prototype.setAnnotations=function(e){this.$annotations=[];for(var t=0;t<e.length;t++){var n=e[t],i=n.row,o=this.$annotations[i];o||(o=this.$annotations[i]={text:[],type:[]});var s=n.text,a=n.type;s=s?r.escapeHTML(s):n.html||"",-1===o.text.indexOf(s)&&(o.text.push(s),o.type.push(a));var l=n.className;l?o.className=l:"error"==a?o.className=" ace_error":"warning"==a&&" ace_error"!=o.className?o.className=" ace_warning":"info"!=a||o.className||(o.className=" ace_info")}},e.prototype.$updateAnnotations=function(e){if(this.$annotations.length){var t=e.start.row,n=e.end.row-t;if(0===n);else if("remove"==e.action)this.$annotations.splice(t,n+1,null);else{var i=new Array(n+1);i.unshift(t,1),this.$annotations.splice.apply(this.$annotations,i)}}},e.prototype.update=function(e){this.config=e;var t=this.session,n=e.firstRow,i=Math.min(e.lastRow+e.gutterOffset,t.getLength()-1);this.oldLastRow=i,this.config=e,this.$lines.moveContainer(e),this.$updateCursorRow();for(var o=t.getNextFoldLine(n),r=o?o.start.row:1/0,s=null,a=-1,l=n;;){if(l>r&&(l=o.end.row+1,r=(o=t.getNextFoldLine(l,o))?o.start.row:1/0),l>i){for(;this.$lines.getLength()>a+1;)this.$lines.pop();break}(s=this.$lines.get(++a))?s.row=l:(s=this.$lines.createCell(l,e,this.session,h),this.$lines.push(s)),this.$renderCell(s,e,o,l),l++}this._signal("afterRender"),this.$updateGutterWidth(e)},e.prototype.$updateGutterWidth=function(e){var t=this.session,n=t.gutterRenderer||this.$renderer,i=t.$firstLineNumber,o=this.$lines.last()?this.$lines.last().text:"";(this.$fixedWidth||t.$useWrapMode)&&(o=t.getLength()+i-1);var r=n?n.getWidth(t,o,e):o.toString().length*e.characterWidth,s=this.$padding||this.$computePadding();(r+=s.left+s.right)===this.gutterWidth||isNaN(r)||(this.gutterWidth=r,this.element.parentNode.style.width=this.element.style.width=Math.ceil(this.gutterWidth)+"px",this._signal("changeGutterWidth",r))},e.prototype.$updateCursorRow=function(){if(this.$highlightGutterLine){var e=this.session.selection.getCursor();this.$cursorRow!==e.row&&(this.$cursorRow=e.row)}},e.prototype.updateLineHighlight=function(){if(this.$highlightGutterLine){var e=this.session.selection.cursor.row;if(this.$cursorRow=e,!this.$cursorCell||this.$cursorCell.row!=e){this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ",""));var t=this.$lines.cells;this.$cursorCell=null;for(var n=0;n<t.length;n++){var i=t[n];if(i.row>=this.$cursorRow){if(i.row>this.$cursorRow){var o=this.session.getFoldLine(this.$cursorRow);if(!(n>0&&o&&o.start.row==t[n-1].row))break;i=t[n-1]}i.element.className="ace_gutter-active-line "+i.element.className,this.$cursorCell=i;break}}}}},e.prototype.scrollLines=function(e){var t=this.config;if(this.config=e,this.$updateCursorRow(),this.$lines.pageChanged(t,e))return this.update(e);this.$lines.moveContainer(e);var n=Math.min(e.lastRow+e.gutterOffset,this.session.getLength()-1),i=this.oldLastRow;if(this.oldLastRow=n,!t||i<e.firstRow)return this.update(e);if(n<t.firstRow)return this.update(e);if(t.firstRow<e.firstRow)for(var o=this.session.getFoldedRowCount(t.firstRow,e.firstRow-1);o>0;o--)this.$lines.shift();if(i>n)for(o=this.session.getFoldedRowCount(n+1,i);o>0;o--)this.$lines.pop();e.firstRow<t.firstRow&&this.$lines.unshift(this.$renderLines(e,e.firstRow,t.firstRow-1)),n>i&&this.$lines.push(this.$renderLines(e,i+1,n)),this.updateLineHighlight(),this._signal("afterRender"),this.$updateGutterWidth(e)},e.prototype.$renderLines=function(e,t,n){for(var i=[],o=t,r=this.session.getNextFoldLine(o),s=r?r.start.row:1/0;o>s&&(o=r.end.row+1,s=(r=this.session.getNextFoldLine(o,r))?r.start.row:1/0),!(o>n);){var a=this.$lines.createCell(o,e,this.session,h);this.$renderCell(a,e,r,o),i.push(a),o++}return i},e.prototype.$renderCell=function(e,t,n,o){var r=e.element,s=this.session,a=r.childNodes[0],c=r.childNodes[1],h=r.childNodes[2],d=h.firstChild,u=s.$firstLineNumber,p=s.$breakpoints,g=s.$decorations,f=s.gutterRenderer||this.$renderer,m=this.$showFoldWidgets&&s.foldWidgets,v=n?n.start.row:Number.MAX_VALUE,w=t.lineHeight+"px",b=this.$useSvgGutterIcons?"ace_gutter-cell_svg-icons ":"ace_gutter-cell ",y=this.$useSvgGutterIcons?"ace_icon_svg":"ace_icon",C=(f?f.getText(s,o):o+u).toString();if(this.$highlightGutterLine&&(o==this.$cursorRow||n&&o<this.$cursorRow&&o>=v&&this.$cursorRow<=n.end.row)&&(b+="ace_gutter-active-line ",this.$cursorCell!=e&&(this.$cursorCell&&(this.$cursorCell.element.className=this.$cursorCell.element.className.replace("ace_gutter-active-line ","")),this.$cursorCell=e)),p[o]&&(b+=p[o]),g[o]&&(b+=g[o]),this.$annotations[o]&&o!==v&&(b+=this.$annotations[o].className),m){var $=m[o];null==$&&($=m[o]=s.getFoldWidget(o))}if($){var x="ace_fold-widget ace_"+$,_="start"==$&&o==v&&o<n.end.row;if(_){x+=" ace_closed";for(var S="",E=!1,k=o+1;k<=n.end.row;k++)if(this.$annotations[k]){if(" ace_error"===this.$annotations[k].className){E=!0,S=" ace_error_fold";break}" ace_warning"!==this.$annotations[k].className||(E=!0,S=" ace_warning_fold")}b+=S}else x+=" ace_open";c.className!=x&&(c.className=x),i.setStyle(c.style,"height",w),i.setStyle(c.style,"display","inline-block"),c.setAttribute("role","button"),c.setAttribute("tabindex","-1");var A=s.getFoldWidgetRange(o);A?c.setAttribute("aria-label",l("Toggle code folding, rows $0 through $1",[A.start.row+1,A.end.row+1])):n?c.setAttribute("aria-label",l("Toggle code folding, rows $0 through $1",[n.start.row+1,n.end.row+1])):c.setAttribute("aria-label",l("Toggle code folding, row $0",[o+1])),_?(c.setAttribute("aria-expanded","false"),c.setAttribute("title",l("Unfold code"))):(c.setAttribute("aria-expanded","true"),c.setAttribute("title",l("Fold code")))}else c&&(i.setStyle(c.style,"display","none"),c.setAttribute("tabindex","0"),c.removeAttribute("role"),c.removeAttribute("aria-label"));return E&&this.$showFoldedAnnotations?(h.className="ace_gutter_annotation",d.className=y,d.className+=S,i.setStyle(d.style,"height",w),i.setStyle(h.style,"display","block"),i.setStyle(h.style,"height",w),h.setAttribute("aria-label",l("Read annotations row $0",[C])),h.setAttribute("tabindex","-1"),h.setAttribute("role","button")):this.$annotations[o]?(h.className="ace_gutter_annotation",d.className=y,this.$useSvgGutterIcons?d.className+=this.$annotations[o].className:r.classList.add(this.$annotations[o].className.replace(" ","")),i.setStyle(d.style,"height",w),i.setStyle(h.style,"display","block"),i.setStyle(h.style,"height",w),h.setAttribute("aria-label",l("Read annotations row $0",[C])),h.setAttribute("tabindex","-1"),h.setAttribute("role","button")):(i.setStyle(h.style,"display","none"),h.removeAttribute("aria-label"),h.removeAttribute("role"),h.setAttribute("tabindex","0")),C!==a.data&&(a.data=C),r.className!=b&&(r.className=b),i.setStyle(e.element.style,"height",this.$lines.computeLineHeight(o,t,s)+"px"),i.setStyle(e.element.style,"top",this.$lines.computeLineTop(o,t,s)+"px"),e.text=C,"none"===h.style.display&&"none"===c.style.display?e.element.setAttribute("aria-hidden",!0):e.element.setAttribute("aria-hidden",!1),e},e.prototype.setHighlightGutterLine=function(e){this.$highlightGutterLine=e},e.prototype.setShowLineNumbers=function(e){this.$renderer=!e&&{getWidth:function(){return 0},getText:function(){return""}}},e.prototype.getShowLineNumbers=function(){return this.$showLineNumbers},e.prototype.setShowFoldWidgets=function(e){e?i.addCssClass(this.element,"ace_folding-enabled"):i.removeCssClass(this.element,"ace_folding-enabled"),this.$showFoldWidgets=e,this.$padding=null},e.prototype.getShowFoldWidgets=function(){return this.$showFoldWidgets},e.prototype.$computePadding=function(){if(!this.element.firstChild)return{left:0,right:0};var e=i.computedStyle(this.element.firstChild);return this.$padding={},this.$padding.left=(parseInt(e.borderLeftWidth)||0)+(parseInt(e.paddingLeft)||0)+1,this.$padding.right=(parseInt(e.borderRightWidth)||0)+(parseInt(e.paddingRight)||0),this.$padding},e.prototype.getRegion=function(e){var t=this.$padding||this.$computePadding(),n=this.element.getBoundingClientRect();return e.x<t.left+n.left?"markers":this.$showFoldWidgets&&e.x>n.right-t.right?"foldWidgets":void 0},e}();function h(e){var t=document.createTextNode("");e.appendChild(t);var n=i.createElement("span");e.appendChild(n);var o=i.createElement("span");e.appendChild(o);var r=i.createElement("span");return o.appendChild(r),e}c.prototype.$fixedWidth=!1,c.prototype.$highlightGutterLine=!0,c.prototype.$renderer="",c.prototype.$showLineNumbers=!0,c.prototype.$showFoldWidgets=!0,o.implement(c.prototype,s),t.Gutter=c})),ace.define("ace/layer/marker",["require","exports","module","ace/range","ace/lib/dom"],(function(e,t,n){"use strict";var i=e("../range").Range,o=e("../lib/dom"),r=function(){function e(e){this.element=o.createElement("div"),this.element.className="ace_layer ace_marker-layer",e.appendChild(this.element)}return e.prototype.setPadding=function(e){this.$padding=e},e.prototype.setSession=function(e){this.session=e},e.prototype.setMarkers=function(e){this.markers=e},e.prototype.elt=function(e,t){var n=-1!=this.i&&this.element.childNodes[this.i];n?this.i++:(n=document.createElement("div"),this.element.appendChild(n),this.i=-1),n.style.cssText=t,n.className=e},e.prototype.update=function(e){if(e){var t;for(var n in this.config=e,this.i=0,this.markers){var i=this.markers[n];if(i.range){var o=i.range.clipRows(e.firstRow,e.lastRow);if(!o.isEmpty())if(o=o.toScreenRange(this.session),i.renderer){var r=this.$getTop(o.start.row,e),s=this.$padding+o.start.column*e.characterWidth;i.renderer(t,o,s,r,e)}else"fullLine"==i.type?this.drawFullLineMarker(t,o,i.clazz,e):"screenLine"==i.type?this.drawScreenLineMarker(t,o,i.clazz,e):o.isMultiLine()?"text"==i.type?this.drawTextMarker(t,o,i.clazz,e):this.drawMultiLineMarker(t,o,i.clazz,e):this.drawSingleLineMarker(t,o,i.clazz+" ace_start ace_br15",e)}else i.update(t,this,this.session,e)}if(-1!=this.i)for(;this.i<this.element.childElementCount;)this.element.removeChild(this.element.lastChild)}},e.prototype.$getTop=function(e,t){return(e-t.firstRowScreen)*t.lineHeight},e.prototype.drawTextMarker=function(e,t,n,o,r){for(var s=this.session,a=t.start.row,l=t.end.row,c=a,h=0,d=0,u=s.getScreenLastRowColumn(c),p=new i(c,t.start.column,c,d);c<=l;c++)p.start.row=p.end.row=c,p.start.column=c==a?t.start.column:s.getRowWrapIndent(c),p.end.column=u,h=d,d=u,u=c+1<l?s.getScreenLastRowColumn(c+1):c==l?0:t.end.column,this.drawSingleLineMarker(e,p,n+(c==a?" ace_start":"")+" ace_br"+((c==a||c==a+1&&t.start.column?1:0)|(h<d?2:0)|(d>u?4:0)|(c==l?8:0)),o,c==l?0:1,r)},e.prototype.drawMultiLineMarker=function(e,t,n,i,o){var r=this.$padding,s=i.lineHeight,a=this.$getTop(t.start.row,i),l=r+t.start.column*i.characterWidth;if(o=o||"",this.session.$bidiHandler.isBidiRow(t.start.row)?((c=t.clone()).end.row=c.start.row,c.end.column=this.session.getLine(c.start.row).length,this.drawBidiSingleLineMarker(e,c,n+" ace_br1 ace_start",i,null,o)):this.elt(n+" ace_br1 ace_start","height:"+s+"px;right:0;top:"+a+"px;left:"+l+"px;"+(o||"")),this.session.$bidiHandler.isBidiRow(t.end.row)){var c;(c=t.clone()).start.row=c.end.row,c.start.column=0,this.drawBidiSingleLineMarker(e,c,n+" ace_br12",i,null,o)}else{a=this.$getTop(t.end.row,i);var h=t.end.column*i.characterWidth;this.elt(n+" ace_br12","height:"+s+"px;width:"+h+"px;top:"+a+"px;left:"+r+"px;"+(o||""))}if(!((s=(t.end.row-t.start.row-1)*i.lineHeight)<=0)){a=this.$getTop(t.start.row+1,i);var d=(t.start.column?1:0)|(t.end.column?0:8);this.elt(n+(d?" ace_br"+d:""),"height:"+s+"px;right:0;top:"+a+"px;left:"+r+"px;"+(o||""))}},e.prototype.drawSingleLineMarker=function(e,t,n,i,o,r){if(this.session.$bidiHandler.isBidiRow(t.start.row))return this.drawBidiSingleLineMarker(e,t,n,i,o,r);var s=i.lineHeight,a=(t.end.column+(o||0)-t.start.column)*i.characterWidth,l=this.$getTop(t.start.row,i),c=this.$padding+t.start.column*i.characterWidth;this.elt(n,"height:"+s+"px;width:"+a+"px;top:"+l+"px;left:"+c+"px;"+(r||""))},e.prototype.drawBidiSingleLineMarker=function(e,t,n,i,o,r){var s=i.lineHeight,a=this.$getTop(t.start.row,i),l=this.$padding;this.session.$bidiHandler.getSelections(t.start.column,t.end.column).forEach((function(e){this.elt(n,"height:"+s+"px;width:"+(e.width+(o||0))+"px;top:"+a+"px;left:"+(l+e.left)+"px;"+(r||""))}),this)},e.prototype.drawFullLineMarker=function(e,t,n,i,o){var r=this.$getTop(t.start.row,i),s=i.lineHeight;t.start.row!=t.end.row&&(s+=this.$getTop(t.end.row,i)-r),this.elt(n,"height:"+s+"px;top:"+r+"px;left:0;right:0;"+(o||""))},e.prototype.drawScreenLineMarker=function(e,t,n,i,o){var r=this.$getTop(t.start.row,i),s=i.lineHeight;this.elt(n,"height:"+s+"px;top:"+r+"px;left:0;right:0;"+(o||""))},e}();r.prototype.$padding=0,t.Marker=r})),ace.define("ace/layer/text",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/layer/lines","ace/lib/event_emitter","ace/config"],(function(e,t,n){"use strict";var i=e("../lib/oop"),o=e("../lib/dom"),r=e("../lib/lang"),s=e("./lines").Lines,a=e("../lib/event_emitter").EventEmitter,l=e("../config").nls,c=function(){function e(e){this.dom=o,this.element=this.dom.createElement("div"),this.element.className="ace_layer ace_text-layer",e.appendChild(this.element),this.$updateEolChar=this.$updateEolChar.bind(this),this.$lines=new s(this.element)}return e.prototype.$updateEolChar=function(){var e=this.session.doc,t="\n"==e.getNewLineCharacter()&&"windows"!=e.getNewLineMode()?this.EOL_CHAR_LF:this.EOL_CHAR_CRLF;if(this.EOL_CHAR!=t)return this.EOL_CHAR=t,!0},e.prototype.setPadding=function(e){this.$padding=e,this.element.style.margin="0 "+e+"px"},e.prototype.getLineHeight=function(){return this.$fontMetrics.$characterSize.height||0},e.prototype.getCharacterWidth=function(){return this.$fontMetrics.$characterSize.width||0},e.prototype.$setFontMetrics=function(e){this.$fontMetrics=e,this.$fontMetrics.on("changeCharacterSize",function(e){this._signal("changeCharacterSize",e)}.bind(this)),this.$pollSizeChanges()},e.prototype.checkForSizeChanges=function(){this.$fontMetrics.checkForSizeChanges()},e.prototype.$pollSizeChanges=function(){return this.$pollSizeChangesTimer=this.$fontMetrics.$pollSizeChanges()},e.prototype.setSession=function(e){this.session=e,e&&this.$computeTabString()},e.prototype.setShowInvisibles=function(e){return this.showInvisibles!=e&&(this.showInvisibles=e,"string"==typeof e?(this.showSpaces=/tab/i.test(e),this.showTabs=/space/i.test(e),this.showEOL=/eol/i.test(e)):this.showSpaces=this.showTabs=this.showEOL=e,this.$computeTabString(),!0)},e.prototype.setDisplayIndentGuides=function(e){return this.displayIndentGuides!=e&&(this.displayIndentGuides=e,this.$computeTabString(),!0)},e.prototype.setHighlightIndentGuides=function(e){return this.$highlightIndentGuides!==e&&(this.$highlightIndentGuides=e,e)},e.prototype.$computeTabString=function(){var e=this.session.getTabSize();this.tabSize=e;for(var t=this.$tabStrings=[0],n=1;n<e+1;n++)this.showTabs?((i=this.dom.createElement("span")).className="ace_invisible ace_invisible_tab",i.textContent=r.stringRepeat(this.TAB_CHAR,n),t.push(i)):t.push(this.dom.createTextNode(r.stringRepeat(" ",n),this.element));if(this.displayIndentGuides){this.$indentGuideRe=/\s\S| \t|\t |\s$/;var i,o="ace_indent-guide",s=this.showSpaces?" ace_invisible ace_invisible_space":"",a=this.showSpaces?r.stringRepeat(this.SPACE_CHAR,this.tabSize):r.stringRepeat(" ",this.tabSize),l=this.showTabs?" ace_invisible ace_invisible_tab":"",c=this.showTabs?r.stringRepeat(this.TAB_CHAR,this.tabSize):a;(i=this.dom.createElement("span")).className=o+s,i.textContent=a,this.$tabStrings[" "]=i,(i=this.dom.createElement("span")).className=o+l,i.textContent=c,this.$tabStrings["\t"]=i}},e.prototype.updateLines=function(e,t,n){if(this.config.lastRow!=e.lastRow||this.config.firstRow!=e.firstRow)return this.update(e);this.config=e;for(var i=Math.max(t,e.firstRow),o=Math.min(n,e.lastRow),r=this.element.childNodes,s=0,a=e.firstRow;a<i;a++){if(l=this.session.getFoldLine(a)){if(l.containsRow(i)){i=l.start.row;break}a=l.end.row}s++}for(var l,c=!1,h=(a=i,(l=this.session.getNextFoldLine(a))?l.start.row:1/0);a>h&&(a=l.end.row+1,h=(l=this.session.getNextFoldLine(a,l))?l.start.row:1/0),!(a>o);){var d=r[s++];if(d){this.dom.removeChildren(d),this.$renderLine(d,a,a==h&&l),c&&(d.style.top=this.$lines.computeLineTop(a,e,this.session)+"px");var u=e.lineHeight*this.session.getRowLength(a)+"px";d.style.height!=u&&(c=!0,d.style.height=u)}a++}if(c)for(;s<this.$lines.cells.length;){var p=this.$lines.cells[s++];p.element.style.top=this.$lines.computeLineTop(p.row,e,this.session)+"px"}},e.prototype.scrollLines=function(e){var t=this.config;if(this.config=e,this.$lines.pageChanged(t,e))return this.update(e);this.$lines.moveContainer(e);var n=e.lastRow,i=t?t.lastRow:-1;if(!t||i<e.firstRow)return this.update(e);if(n<t.firstRow)return this.update(e);if(!t||t.lastRow<e.firstRow)return this.update(e);if(e.lastRow<t.firstRow)return this.update(e);if(t.firstRow<e.firstRow)for(var o=this.session.getFoldedRowCount(t.firstRow,e.firstRow-1);o>0;o--)this.$lines.shift();if(t.lastRow>e.lastRow)for(o=this.session.getFoldedRowCount(e.lastRow+1,t.lastRow);o>0;o--)this.$lines.pop();e.firstRow<t.firstRow&&this.$lines.unshift(this.$renderLinesFragment(e,e.firstRow,t.firstRow-1)),e.lastRow>t.lastRow&&this.$lines.push(this.$renderLinesFragment(e,t.lastRow+1,e.lastRow)),this.$highlightIndentGuide()},e.prototype.$renderLinesFragment=function(e,t,n){for(var i=[],r=t,s=this.session.getNextFoldLine(r),a=s?s.start.row:1/0;r>a&&(r=s.end.row+1,a=(s=this.session.getNextFoldLine(r,s))?s.start.row:1/0),!(r>n);){var l=this.$lines.createCell(r,e,this.session),c=l.element;this.dom.removeChildren(c),o.setStyle(c.style,"height",this.$lines.computeLineHeight(r,e,this.session)+"px"),o.setStyle(c.style,"top",this.$lines.computeLineTop(r,e,this.session)+"px"),this.$renderLine(c,r,r==a&&s),this.$useLineGroups()?c.className="ace_line_group":c.className="ace_line",i.push(l),r++}return i},e.prototype.update=function(e){this.$lines.moveContainer(e),this.config=e;for(var t=e.firstRow,n=e.lastRow,i=this.$lines;i.getLength();)i.pop();i.push(this.$renderLinesFragment(e,t,n))},e.prototype.$renderToken=function(e,t,n,i){for(var o,s=this,a=/(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC\u2066\u2067\u2068\u202A\u202B\u202D\u202E\u202C\u2069]+)|(\u3000)|([\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]|[\uD800-\uDBFF][\uDC00-\uDFFF])/g,c=this.dom.createFragment(this.element),h=0;o=a.exec(i);){var d=o[1],u=o[2],p=o[3],g=o[4],f=o[5];if(s.showSpaces||!u){var m=h!=o.index?i.slice(h,o.index):"";if(h=o.index+o[0].length,m&&c.appendChild(this.dom.createTextNode(m,this.element)),d){var v=s.session.getScreenTabSize(t+o.index);c.appendChild(s.$tabStrings[v].cloneNode(!0)),t+=v-1}else u?s.showSpaces?((b=this.dom.createElement("span")).className="ace_invisible ace_invisible_space",b.textContent=r.stringRepeat(s.SPACE_CHAR,u.length),c.appendChild(b)):c.appendChild(this.com.createTextNode(u,this.element)):p?((b=this.dom.createElement("span")).className="ace_invisible ace_invisible_space ace_invalid",b.textContent=r.stringRepeat(s.SPACE_CHAR,p.length),c.appendChild(b)):g?(t+=1,(b=this.dom.createElement("span")).style.width=2*s.config.characterWidth+"px",b.className=s.showSpaces?"ace_cjk ace_invisible ace_invisible_space":"ace_cjk",b.textContent=s.showSpaces?s.SPACE_CHAR:g,c.appendChild(b)):f&&(t+=1,(b=this.dom.createElement("span")).style.width=2*s.config.characterWidth+"px",b.className="ace_cjk",b.textContent=f,c.appendChild(b))}}if(c.appendChild(this.dom.createTextNode(h?i.slice(h):i,this.element)),this.$textToken[n.type])e.appendChild(c);else{var w="ace_"+n.type.replace(/\./g," ace_"),b=this.dom.createElement("span");"fold"==n.type&&(b.style.width=n.value.length*this.config.characterWidth+"px",b.setAttribute("title",l("Unfold code"))),b.className=w,b.appendChild(c),e.appendChild(b)}return t+i.length},e.prototype.renderIndentGuide=function(e,t,n){var i=t.search(this.$indentGuideRe);if(i<=0||i>=n)return t;if(" "==t[0]){for(var o=(i-=i%this.tabSize)/this.tabSize,r=0;r<o;r++)e.appendChild(this.$tabStrings[" "].cloneNode(!0));return this.$highlightIndentGuide(),t.substr(i)}if("\t"==t[0]){for(r=0;r<i;r++)e.appendChild(this.$tabStrings["\t"].cloneNode(!0));return this.$highlightIndentGuide(),t.substr(i)}return this.$highlightIndentGuide(),t},e.prototype.$highlightIndentGuide=function(){if(this.$highlightIndentGuides&&this.displayIndentGuides){this.$highlightIndentGuideMarker={indentLevel:void 0,start:void 0,end:void 0,dir:void 0};var e=this.session.doc.$lines;if(e){var t=this.session.selection.getCursor(),n=/^\s*/.exec(this.session.doc.getLine(t.row))[0].length,i=Math.floor(n/this.tabSize);if(this.$highlightIndentGuideMarker={indentLevel:i,start:t.row},this.session.$bracketHighlight)for(var o=this.session.$bracketHighlight.ranges,r=0;r<o.length;r++)if(t.row!==o[r].start.row){this.$highlightIndentGuideMarker.end=o[r].start.row,t.row>o[r].start.row?this.$highlightIndentGuideMarker.dir=-1:this.$highlightIndentGuideMarker.dir=1;break}if(!this.$highlightIndentGuideMarker.end&&""!==e[t.row]&&t.column===e[t.row].length)for(this.$highlightIndentGuideMarker.dir=1,r=t.row+1;r<e.length;r++){var s=e[r],a=/^\s*/.exec(s)[0].length;if(""!==s&&(this.$highlightIndentGuideMarker.end=r,a<=n))break}this.$renderHighlightIndentGuide()}}},e.prototype.$clearActiveIndentGuide=function(){for(var e=this.$lines.cells,t=0;t<e.length;t++){var n=e[t].element.childNodes;if(n.length>0)for(var i=0;i<n.length;i++)if(n[i].classList&&n[i].classList.contains("ace_indent-guide-active")){n[i].classList.remove("ace_indent-guide-active");break}}},e.prototype.$setIndentGuideActive=function(e,t){if(""!==this.session.doc.getLine(e.row)){var n=e.element.childNodes;if(n){var i=n[t-1];i&&i.classList&&i.classList.contains("ace_indent-guide")&&i.classList.add("ace_indent-guide-active")}}},e.prototype.$renderHighlightIndentGuide=function(){if(this.$lines){var e=this.$lines.cells;this.$clearActiveIndentGuide();var t=this.$highlightIndentGuideMarker.indentLevel;if(0!==t)if(1===this.$highlightIndentGuideMarker.dir)for(var n=0;n<e.length;n++){var i=e[n];if(this.$highlightIndentGuideMarker.end&&i.row>=this.$highlightIndentGuideMarker.start+1){if(i.row>=this.$highlightIndentGuideMarker.end)break;this.$setIndentGuideActive(i,t)}}else for(n=e.length-1;n>=0;n--)if(i=e[n],this.$highlightIndentGuideMarker.end&&i.row<this.$highlightIndentGuideMarker.start){if(i.row<=this.$highlightIndentGuideMarker.end)break;this.$setIndentGuideActive(i,t)}}},e.prototype.$createLineElement=function(e){var t=this.dom.createElement("div");return t.className="ace_line",t.style.height=this.config.lineHeight+"px",t},e.prototype.$renderWrappedLine=function(e,t,n){var i=0,o=0,s=n[0],a=0,l=this.$createLineElement();e.appendChild(l);for(var c=0;c<t.length;c++){var h=t[c],d=h.value;if(0==c&&this.displayIndentGuides){if(i=d.length,!(d=this.renderIndentGuide(l,d,s)))continue;i-=d.length}if(i+d.length<s)a=this.$renderToken(l,a,h,d),i+=d.length;else{for(;i+d.length>=s;)a=this.$renderToken(l,a,h,d.substring(0,s-i)),d=d.substring(s-i),i=s,l=this.$createLineElement(),e.appendChild(l),l.appendChild(this.dom.createTextNode(r.stringRepeat(" ",n.indent),this.element)),a=0,s=n[++o]||Number.MAX_VALUE;0!=d.length&&(i+=d.length,a=this.$renderToken(l,a,h,d))}}n[n.length-1]>this.MAX_LINE_LENGTH&&this.$renderOverflowMessage(l,a,null,"",!0)},e.prototype.$renderSimpleLine=function(e,t){for(var n=0,i=0;i<t.length;i++){var o=t[i],r=o.value;if(0!=i||!this.displayIndentGuides||(r=this.renderIndentGuide(e,r))){if(n+r.length>this.MAX_LINE_LENGTH)return this.$renderOverflowMessage(e,n,o,r);n=this.$renderToken(e,n,o,r)}}},e.prototype.$renderOverflowMessage=function(e,t,n,i,o){n&&this.$renderToken(e,t,n,i.slice(0,this.MAX_LINE_LENGTH-t));var r=this.dom.createElement("span");r.className="ace_inline_button ace_keyword ace_toggle_wrap",r.textContent=o?"<hide>":"<click to see more...>",e.appendChild(r)},e.prototype.$renderLine=function(e,t,n){if(n||0==n||(n=this.session.getFoldLine(t)),n)var i=this.$getFoldLineTokens(t,n);else i=this.session.getTokens(t);var o=e;if(i.length){var r=this.session.getRowSplitData(t);r&&r.length?(this.$renderWrappedLine(e,i,r),o=e.lastChild):(o=e,this.$useLineGroups()&&(o=this.$createLineElement(),e.appendChild(o)),this.$renderSimpleLine(o,i))}else this.$useLineGroups()&&(o=this.$createLineElement(),e.appendChild(o));if(this.showEOL&&o){n&&(t=n.end.row);var s=this.dom.createElement("span");s.className="ace_invisible ace_invisible_eol",s.textContent=t==this.session.getLength()-1?this.EOF_CHAR:this.EOL_CHAR,o.appendChild(s)}},e.prototype.$getFoldLineTokens=function(e,t){var n=this.session,i=[],o=n.getTokens(e);return t.walk((function(e,t,r,s,a){null!=e?i.push({type:"fold",value:e}):(a&&(o=n.getTokens(t)),o.length&&function(e,t,n){for(var o=0,r=0;r+e[o].value.length<t;)if(r+=e[o].value.length,++o==e.length)return;for(r!=t&&((s=e[o].value.substring(t-r)).length>n-t&&(s=s.substring(0,n-t)),i.push({type:e[o].type,value:s}),r=t+s.length,o+=1);r<n&&o<e.length;){var s;(s=e[o].value).length+r>n?i.push({type:e[o].type,value:s.substring(0,n-r)}):i.push(e[o]),r+=s.length,o+=1}}(o,s,r))}),t.end.row,this.session.getLine(t.end.row).length),i},e.prototype.$useLineGroups=function(){return this.session.getUseWrapMode()},e}();c.prototype.$textToken={text:!0,rparen:!0,lparen:!0},c.prototype.EOF_CHAR="¶",c.prototype.EOL_CHAR_LF="¬",c.prototype.EOL_CHAR_CRLF="¤",c.prototype.EOL_CHAR=c.prototype.EOL_CHAR_LF,c.prototype.TAB_CHAR="—",c.prototype.SPACE_CHAR="·",c.prototype.$padding=0,c.prototype.MAX_LINE_LENGTH=1e4,c.prototype.showInvisibles=!1,c.prototype.showSpaces=!1,c.prototype.showTabs=!1,c.prototype.showEOL=!1,c.prototype.displayIndentGuides=!0,c.prototype.$highlightIndentGuides=!0,c.prototype.$tabStrings=[],c.prototype.destroy={},c.prototype.onChangeTabSize=c.prototype.$computeTabString,i.implement(c.prototype,a),t.Text=c})),ace.define("ace/layer/cursor",["require","exports","module","ace/lib/dom"],(function(e,t,n){"use strict";var i=e("../lib/dom"),o=function(){function e(e){this.element=i.createElement("div"),this.element.className="ace_layer ace_cursor-layer",e.appendChild(this.element),this.isVisible=!1,this.isBlinking=!0,this.blinkInterval=1e3,this.smoothBlinking=!1,this.cursors=[],this.cursor=this.addCursor(),i.addCssClass(this.element,"ace_hidden-cursors"),this.$updateCursors=this.$updateOpacity.bind(this)}return e.prototype.$updateOpacity=function(e){for(var t=this.cursors,n=t.length;n--;)i.setStyle(t[n].style,"opacity",e?"":"0")},e.prototype.$startCssAnimation=function(){for(var e=this.cursors,t=e.length;t--;)e[t].style.animationDuration=this.blinkInterval+"ms";this.$isAnimating=!0,setTimeout(function(){this.$isAnimating&&i.addCssClass(this.element,"ace_animate-blinking")}.bind(this))},e.prototype.$stopCssAnimation=function(){this.$isAnimating=!1,i.removeCssClass(this.element,"ace_animate-blinking")},e.prototype.setPadding=function(e){this.$padding=e},e.prototype.setSession=function(e){this.session=e},e.prototype.setBlinking=function(e){e!=this.isBlinking&&(this.isBlinking=e,this.restartTimer())},e.prototype.setBlinkInterval=function(e){e!=this.blinkInterval&&(this.blinkInterval=e,this.restartTimer())},e.prototype.setSmoothBlinking=function(e){e!=this.smoothBlinking&&(this.smoothBlinking=e,i.setCssClass(this.element,"ace_smooth-blinking",e),this.$updateCursors(!0),this.restartTimer())},e.prototype.addCursor=function(){var e=i.createElement("div");return e.className="ace_cursor",this.element.appendChild(e),this.cursors.push(e),e},e.prototype.removeCursor=function(){if(this.cursors.length>1){var e=this.cursors.pop();return e.parentNode.removeChild(e),e}},e.prototype.hideCursor=function(){this.isVisible=!1,i.addCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},e.prototype.showCursor=function(){this.isVisible=!0,i.removeCssClass(this.element,"ace_hidden-cursors"),this.restartTimer()},e.prototype.restartTimer=function(){var e=this.$updateCursors;if(clearInterval(this.intervalId),clearTimeout(this.timeoutId),this.$stopCssAnimation(),this.smoothBlinking&&(this.$isSmoothBlinking=!1,i.removeCssClass(this.element,"ace_smooth-blinking")),e(!0),this.isBlinking&&this.blinkInterval&&this.isVisible)if(this.smoothBlinking&&(this.$isSmoothBlinking=!0,setTimeout(function(){this.$isSmoothBlinking&&i.addCssClass(this.element,"ace_smooth-blinking")}.bind(this))),i.HAS_CSS_ANIMATION)this.$startCssAnimation();else{var t=function(){this.timeoutId=setTimeout((function(){e(!1)}),.6*this.blinkInterval)}.bind(this);this.intervalId=setInterval((function(){e(!0),t()}),this.blinkInterval),t()}else this.$stopCssAnimation()},e.prototype.getPixelPosition=function(e,t){if(!this.config||!this.session)return{left:0,top:0};e||(e=this.session.selection.getCursor());var n=this.session.documentToScreenPosition(e);return{left:this.$padding+(this.session.$bidiHandler.isBidiRow(n.row,e.row)?this.session.$bidiHandler.getPosLeft(n.column):n.column*this.config.characterWidth),top:(n.row-(t?this.config.firstRowScreen:0))*this.config.lineHeight}},e.prototype.isCursorInView=function(e,t){return e.top>=0&&e.top<t.maxHeight},e.prototype.update=function(e){this.config=e;var t=this.session.$selectionMarkers,n=0,o=0;void 0!==t&&0!==t.length||(t=[{cursor:null}]),n=0;for(var r=t.length;n<r;n++){var s=this.getPixelPosition(t[n].cursor,!0);if(!((s.top>e.height+e.offset||s.top<0)&&n>1)){var a=this.cursors[o++]||this.addCursor(),l=a.style;this.drawCursor?this.drawCursor(a,s,e,t[n],this.session):this.isCursorInView(s,e)?(i.setStyle(l,"display","block"),i.translate(a,s.left,s.top),i.setStyle(l,"width",Math.round(e.characterWidth)+"px"),i.setStyle(l,"height",e.lineHeight+"px")):i.setStyle(l,"display","none")}}for(;this.cursors.length>o;)this.removeCursor();var c=this.session.getOverwrite();this.$setOverwrite(c),this.$pixelPos=s,this.restartTimer()},e.prototype.$setOverwrite=function(e){e!=this.overwrite&&(this.overwrite=e,e?i.addCssClass(this.element,"ace_overwrite-cursors"):i.removeCssClass(this.element,"ace_overwrite-cursors"))},e.prototype.destroy=function(){clearInterval(this.intervalId),clearTimeout(this.timeoutId)},e}();o.prototype.$padding=0,o.prototype.drawCursor=null,t.Cursor=o})),ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],(function(e,t,n){"use strict";var i,o=this&&this.__extends||(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),r=e("./lib/oop"),s=e("./lib/dom"),a=e("./lib/event"),l=e("./lib/event_emitter").EventEmitter,c=32768,h=function(){function e(e,t){this.element=s.createElement("div"),this.element.className="ace_scrollbar ace_scrollbar"+t,this.inner=s.createElement("div"),this.inner.className="ace_scrollbar-inner",this.inner.textContent=" ",this.element.appendChild(this.inner),e.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,a.addListener(this.element,"scroll",this.onScroll.bind(this)),a.addListener(this.element,"mousedown",a.preventDefault)}return e.prototype.setVisible=function(e){this.element.style.display=e?"":"none",this.isVisible=e,this.coeff=1},e}();r.implement(h.prototype,l);var d=function(e){function t(t,n){var i=e.call(this,t,"-v")||this;return i.scrollTop=0,i.scrollHeight=0,n.$scrollbarWidth=i.width=s.scrollbarWidth(t.ownerDocument),i.inner.style.width=i.element.style.width=(i.width||15)+5+"px",i.$minWidth=0,i}return o(t,e),t.prototype.onScroll=function(){if(!this.skipEvent){if(this.scrollTop=this.element.scrollTop,1!=this.coeff){var e=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-e)/(this.coeff-e)}this._emit("scroll",{data:this.scrollTop})}this.skipEvent=!1},t.prototype.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},t.prototype.setHeight=function(e){this.element.style.height=e+"px"},t.prototype.setScrollHeight=function(e){this.scrollHeight=e,e>c?(this.coeff=c/e,e=c):1!=this.coeff&&(this.coeff=1),this.inner.style.height=e+"px"},t.prototype.setScrollTop=function(e){this.scrollTop!=e&&(this.skipEvent=!0,this.scrollTop=e,this.element.scrollTop=e*this.coeff)},t}(h);d.prototype.setInnerHeight=d.prototype.setScrollHeight;var u=function(e){function t(t,n){var i=e.call(this,t,"-h")||this;return i.scrollLeft=0,i.height=n.$scrollbarWidth,i.inner.style.height=i.element.style.height=(i.height||15)+5+"px",i}return o(t,e),t.prototype.onScroll=function(){this.skipEvent||(this.scrollLeft=this.element.scrollLeft,this._emit("scroll",{data:this.scrollLeft})),this.skipEvent=!1},t.prototype.getHeight=function(){return this.isVisible?this.height:0},t.prototype.setWidth=function(e){this.element.style.width=e+"px"},t.prototype.setInnerWidth=function(e){this.inner.style.width=e+"px"},t.prototype.setScrollWidth=function(e){this.inner.style.width=e+"px"},t.prototype.setScrollLeft=function(e){this.scrollLeft!=e&&(this.skipEvent=!0,this.scrollLeft=this.element.scrollLeft=e)},t}(h);t.ScrollBar=d,t.ScrollBarV=d,t.ScrollBarH=u,t.VScrollBar=d,t.HScrollBar=u})),ace.define("ace/scrollbar_custom",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],(function(e,t,n){"use strict";var i,o=this&&this.__extends||(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),r=e("./lib/oop"),s=e("./lib/dom"),a=e("./lib/event"),l=e("./lib/event_emitter").EventEmitter;s.importCssString(".ace_editor>.ace_sb-v div, .ace_editor>.ace_sb-h div{\n position: absolute;\n background: rgba(128, 128, 128, 0.6);\n -moz-box-sizing: border-box;\n box-sizing: border-box;\n border: 1px solid #bbb;\n border-radius: 2px;\n z-index: 8;\n}\n.ace_editor>.ace_sb-v, .ace_editor>.ace_sb-h {\n position: absolute;\n z-index: 6;\n background: none;\n overflow: hidden!important;\n}\n.ace_editor>.ace_sb-v {\n z-index: 6;\n right: 0;\n top: 0;\n width: 12px;\n}\n.ace_editor>.ace_sb-v div {\n z-index: 8;\n right: 0;\n width: 100%;\n}\n.ace_editor>.ace_sb-h {\n bottom: 0;\n left: 0;\n height: 12px;\n}\n.ace_editor>.ace_sb-h div {\n bottom: 0;\n height: 100%;\n}\n.ace_editor>.ace_sb_grabbed {\n z-index: 8;\n background: #000;\n}","ace_scrollbar.css",!1);var c=function(){function e(e,t){this.element=s.createElement("div"),this.element.className="ace_sb"+t,this.inner=s.createElement("div"),this.inner.className="",this.element.appendChild(this.inner),this.VScrollWidth=12,this.HScrollHeight=12,e.appendChild(this.element),this.setVisible(!1),this.skipEvent=!1,a.addMultiMouseDownListener(this.element,[500,300,300],this,"onMouseDown")}return e.prototype.setVisible=function(e){this.element.style.display=e?"":"none",this.isVisible=e,this.coeff=1},e}();r.implement(c.prototype,l);var h=function(e){function t(t,n){var i=e.call(this,t,"-v")||this;return i.scrollTop=0,i.scrollHeight=0,i.parent=t,i.width=i.VScrollWidth,i.renderer=n,i.inner.style.width=i.element.style.width=(i.width||15)+"px",i.$minWidth=0,i}return o(t,e),t.prototype.onMouseDown=function(e,t){if("mousedown"===e&&0===a.getButton(t)&&2!==t.detail){if(t.target===this.inner){var n=this,i=t.clientY,o=t.clientY,r=this.thumbTop;a.capture(this.inner,(function(e){i=e.clientY}),(function(){clearInterval(s)}));var s=setInterval((function(){if(void 0!==i){var e=n.scrollTopFromThumbTop(r+i-o);e!==n.scrollTop&&n._emit("scroll",{data:e})}}),20);return a.preventDefault(t)}var l=t.clientY-this.element.getBoundingClientRect().top-this.thumbHeight/2;return this._emit("scroll",{data:this.scrollTopFromThumbTop(l)}),a.preventDefault(t)}},t.prototype.getHeight=function(){return this.height},t.prototype.scrollTopFromThumbTop=function(e){var t=e*(this.pageHeight-this.viewHeight)/(this.slideHeight-this.thumbHeight);return(t>>=0)<0?t=0:t>this.pageHeight-this.viewHeight&&(t=this.pageHeight-this.viewHeight),t},t.prototype.getWidth=function(){return Math.max(this.isVisible?this.width:0,this.$minWidth||0)},t.prototype.setHeight=function(e){this.height=Math.max(0,e),this.slideHeight=this.height,this.viewHeight=this.height,this.setScrollHeight(this.pageHeight,!0)},t.prototype.setScrollHeight=function(e,t){(this.pageHeight!==e||t)&&(this.pageHeight=e,this.thumbHeight=this.slideHeight*this.viewHeight/this.pageHeight,this.thumbHeight>this.slideHeight&&(this.thumbHeight=this.slideHeight),this.thumbHeight<15&&(this.thumbHeight=15),this.inner.style.height=this.thumbHeight+"px",this.scrollTop>this.pageHeight-this.viewHeight&&(this.scrollTop=this.pageHeight-this.viewHeight,this.scrollTop<0&&(this.scrollTop=0),this._emit("scroll",{data:this.scrollTop})))},t.prototype.setScrollTop=function(e){this.scrollTop=e,e<0&&(e=0),this.thumbTop=e*(this.slideHeight-this.thumbHeight)/(this.pageHeight-this.viewHeight),this.inner.style.top=this.thumbTop+"px"},t}(c);h.prototype.setInnerHeight=h.prototype.setScrollHeight;var d=function(e){function t(t,n){var i=e.call(this,t,"-h")||this;return i.scrollLeft=0,i.scrollWidth=0,i.height=i.HScrollHeight,i.inner.style.height=i.element.style.height=(i.height||12)+"px",i.renderer=n,i}return o(t,e),t.prototype.onMouseDown=function(e,t){if("mousedown"===e&&0===a.getButton(t)&&2!==t.detail){if(t.target===this.inner){var n=this,i=t.clientX,o=t.clientX,r=this.thumbLeft;a.capture(this.inner,(function(e){i=e.clientX}),(function(){clearInterval(s)}));var s=setInterval((function(){if(void 0!==i){var e=n.scrollLeftFromThumbLeft(r+i-o);e!==n.scrollLeft&&n._emit("scroll",{data:e})}}),20);return a.preventDefault(t)}var l=t.clientX-this.element.getBoundingClientRect().left-this.thumbWidth/2;return this._emit("scroll",{data:this.scrollLeftFromThumbLeft(l)}),a.preventDefault(t)}},t.prototype.getHeight=function(){return this.isVisible?this.height:0},t.prototype.scrollLeftFromThumbLeft=function(e){var t=e*(this.pageWidth-this.viewWidth)/(this.slideWidth-this.thumbWidth);return(t>>=0)<0?t=0:t>this.pageWidth-this.viewWidth&&(t=this.pageWidth-this.viewWidth),t},t.prototype.setWidth=function(e){this.width=Math.max(0,e),this.element.style.width=this.width+"px",this.slideWidth=this.width,this.viewWidth=this.width,this.setScrollWidth(this.pageWidth,!0)},t.prototype.setScrollWidth=function(e,t){(this.pageWidth!==e||t)&&(this.pageWidth=e,this.thumbWidth=this.slideWidth*this.viewWidth/this.pageWidth,this.thumbWidth>this.slideWidth&&(this.thumbWidth=this.slideWidth),this.thumbWidth<15&&(this.thumbWidth=15),this.inner.style.width=this.thumbWidth+"px",this.scrollLeft>this.pageWidth-this.viewWidth&&(this.scrollLeft=this.pageWidth-this.viewWidth,this.scrollLeft<0&&(this.scrollLeft=0),this._emit("scroll",{data:this.scrollLeft})))},t.prototype.setScrollLeft=function(e){this.scrollLeft=e,e<0&&(e=0),this.thumbLeft=e*(this.slideWidth-this.thumbWidth)/(this.pageWidth-this.viewWidth),this.inner.style.left=this.thumbLeft+"px"},t}(c);d.prototype.setInnerWidth=d.prototype.setScrollWidth,t.ScrollBar=h,t.ScrollBarV=h,t.ScrollBarH=d,t.VScrollBar=h,t.HScrollBar=d})),ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],(function(e,t,n){"use strict";var i=e("./lib/event"),o=function(){function e(e,t){this.onRender=e,this.pending=!1,this.changes=0,this.$recursionLimit=2,this.window=t||window;var n=this;this._flush=function(e){n.pending=!1;var t=n.changes;if(t&&(i.blockIdle(100),n.changes=0,n.onRender(t)),n.changes){if(n.$recursionLimit--<0)return;n.schedule()}else n.$recursionLimit=2}}return e.prototype.schedule=function(e){this.changes=this.changes|e,this.changes&&!this.pending&&(i.nextFrame(this._flush),this.pending=!0)},e.prototype.clear=function(e){var t=this.changes;return this.changes=0,t},e}();t.RenderLoop=o})),ace.define("ace/layer/font_metrics",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/lib/useragent","ace/lib/event_emitter"],(function(e,t,n){var i=e("../lib/oop"),o=e("../lib/dom"),r=e("../lib/lang"),s=e("../lib/event"),a=e("../lib/useragent"),l=e("../lib/event_emitter").EventEmitter,c=512,h="function"==typeof ResizeObserver,d=200,u=function(){function e(e){this.el=o.createElement("div"),this.$setMeasureNodeStyles(this.el.style,!0),this.$main=o.createElement("div"),this.$setMeasureNodeStyles(this.$main.style),this.$measureNode=o.createElement("div"),this.$setMeasureNodeStyles(this.$measureNode.style),this.el.appendChild(this.$main),this.el.appendChild(this.$measureNode),e.appendChild(this.el),this.$measureNode.textContent=r.stringRepeat("X",c),this.$characterSize={width:0,height:0},h?this.$addObserver():this.checkForSizeChanges()}return e.prototype.$setMeasureNodeStyles=function(e,t){e.width=e.height="auto",e.left=e.top="0px",e.visibility="hidden",e.position="absolute",e.whiteSpace="pre",a.isIE<8?e["font-family"]="inherit":e.font="inherit",e.overflow=t?"hidden":"visible"},e.prototype.checkForSizeChanges=function(e){if(void 0===e&&(e=this.$measureSizes()),e&&(this.$characterSize.width!==e.width||this.$characterSize.height!==e.height)){this.$measureNode.style.fontWeight="bold";var t=this.$measureSizes();this.$measureNode.style.fontWeight="",this.$characterSize=e,this.charSizes=Object.create(null),this.allowBoldFonts=t&&t.width===e.width&&t.height===e.height,this._emit("changeCharacterSize",{data:e})}},e.prototype.$addObserver=function(){var e=this;this.$observer=new window.ResizeObserver((function(t){e.checkForSizeChanges()})),this.$observer.observe(this.$measureNode)},e.prototype.$pollSizeChanges=function(){if(this.$pollSizeChangesTimer||this.$observer)return this.$pollSizeChangesTimer;var e=this;return this.$pollSizeChangesTimer=s.onIdle((function t(){e.checkForSizeChanges(),s.onIdle(t,500)}),500)},e.prototype.setPolling=function(e){e?this.$pollSizeChanges():this.$pollSizeChangesTimer&&(clearInterval(this.$pollSizeChangesTimer),this.$pollSizeChangesTimer=0)},e.prototype.$measureSizes=function(e){var t={height:(e||this.$measureNode).clientHeight,width:(e||this.$measureNode).clientWidth/c};return 0===t.width||0===t.height?null:t},e.prototype.$measureCharWidth=function(e){return this.$main.textContent=r.stringRepeat(e,c),this.$main.getBoundingClientRect().width/c},e.prototype.getCharacterWidth=function(e){var t=this.charSizes[e];return void 0===t&&(t=this.charSizes[e]=this.$measureCharWidth(e)/this.$characterSize.width),t},e.prototype.destroy=function(){clearInterval(this.$pollSizeChangesTimer),this.$observer&&this.$observer.disconnect(),this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},e.prototype.$getZoom=function(e){return e&&e.parentElement?(window.getComputedStyle(e).zoom||1)*this.$getZoom(e.parentElement):1},e.prototype.$initTransformMeasureNodes=function(){var e=function(e,t){return["div",{style:"position: absolute;top:"+e+"px;left:"+t+"px;"}]};this.els=o.buildDom([e(0,0),e(d,0),e(0,d),e(d,d)],this.el)},e.prototype.transformCoordinates=function(e,t){function n(e,t,n){var i=e[1]*t[0]-e[0]*t[1];return[(-t[1]*n[0]+t[0]*n[1])/i,(+e[1]*n[0]-e[0]*n[1])/i]}function i(e,t){return[e[0]-t[0],e[1]-t[1]]}function o(e,t){return[e[0]+t[0],e[1]+t[1]]}function r(e,t){return[e*t[0],e*t[1]]}function s(e){var t=e.getBoundingClientRect();return[t.left,t.top]}e&&(e=r(1/this.$getZoom(this.el),e)),this.els||this.$initTransformMeasureNodes();var a=s(this.els[0]),l=s(this.els[1]),c=s(this.els[2]),h=s(this.els[3]),u=n(i(h,l),i(h,c),i(o(l,c),o(h,a))),p=r(1+u[0],i(l,a)),g=r(1+u[1],i(c,a));if(t){var f=t,m=u[0]*f[0]/d+u[1]*f[1]/d+1,v=o(r(f[0],p),r(f[1],g));return o(r(1/m/d,v),a)}var w=i(e,a),b=n(i(p,r(u[0],w)),i(g,r(u[1],w)),w);return r(d,b)},e}();u.prototype.$characterSize={width:0,height:0},i.implement(u.prototype,l),t.FontMetrics=u})),ace.define("ace/css/editor-css",["require","exports","module"],(function(e,t,n){n.exports='\n.ace_br1 {border-top-left-radius : 3px;}\n.ace_br2 {border-top-right-radius : 3px;}\n.ace_br3 {border-top-left-radius : 3px; border-top-right-radius: 3px;}\n.ace_br4 {border-bottom-right-radius: 3px;}\n.ace_br5 {border-top-left-radius : 3px; border-bottom-right-radius: 3px;}\n.ace_br6 {border-top-right-radius : 3px; border-bottom-right-radius: 3px;}\n.ace_br7 {border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px;}\n.ace_br8 {border-bottom-left-radius : 3px;}\n.ace_br9 {border-top-left-radius : 3px; border-bottom-left-radius: 3px;}\n.ace_br10{border-top-right-radius : 3px; border-bottom-left-radius: 3px;}\n.ace_br11{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-left-radius: 3px;}\n.ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}\n.ace_br13{border-top-left-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}\n.ace_br14{border-top-right-radius : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}\n.ace_br15{border-top-left-radius : 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}\n\n\n.ace_editor {\n position: relative;\n overflow: hidden;\n padding: 0;\n font: 12px/normal \'Monaco\', \'Menlo\', \'Ubuntu Mono\', \'Consolas\', \'Source Code Pro\', \'source-code-pro\', monospace;\n direction: ltr;\n text-align: left;\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n}\n\n.ace_scroller {\n position: absolute;\n overflow: hidden;\n top: 0;\n bottom: 0;\n background-color: inherit;\n -ms-user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n user-select: none;\n cursor: text;\n}\n\n.ace_content {\n position: absolute;\n box-sizing: border-box;\n min-width: 100%;\n contain: style size layout;\n font-variant-ligatures: no-common-ligatures;\n}\n\n.ace_keyboard-focus:focus {\n box-shadow: inset 0 0 0 2px #5E9ED6;\n outline: none;\n}\n\n.ace_dragging .ace_scroller:before{\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n content: \'\';\n background: rgba(250, 250, 250, 0.01);\n z-index: 1000;\n}\n.ace_dragging.ace_dark .ace_scroller:before{\n background: rgba(0, 0, 0, 0.01);\n}\n\n.ace_gutter {\n position: absolute;\n overflow : hidden;\n width: auto;\n top: 0;\n bottom: 0;\n left: 0;\n cursor: default;\n z-index: 4;\n -ms-user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n user-select: none;\n contain: style size layout;\n}\n\n.ace_gutter-active-line {\n position: absolute;\n left: 0;\n right: 0;\n}\n\n.ace_scroller.ace_scroll-left:after {\n content: "";\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;\n pointer-events: none;\n}\n\n.ace_gutter-cell, .ace_gutter-cell_svg-icons {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n padding-left: 19px;\n padding-right: 6px;\n background-repeat: no-repeat;\n}\n\n.ace_gutter-cell_svg-icons .ace_gutter_annotation {\n margin-left: -14px;\n float: left;\n}\n\n.ace_gutter-cell .ace_gutter_annotation {\n margin-left: -19px;\n float: left;\n}\n\n.ace_gutter-cell.ace_error, .ace_icon.ace_error, .ace_icon.ace_error_fold {\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==");\n background-repeat: no-repeat;\n background-position: 2px center;\n}\n\n.ace_gutter-cell.ace_warning, .ace_icon.ace_warning, .ace_icon.ace_warning_fold {\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==");\n background-repeat: no-repeat;\n background-position: 2px center;\n}\n\n.ace_gutter-cell.ace_info, .ace_icon.ace_info {\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=");\n background-repeat: no-repeat;\n background-position: 2px center;\n}\n.ace_dark .ace_gutter-cell.ace_info, .ace_dark .ace_icon.ace_info {\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC");\n}\n\n.ace_icon_svg.ace_error {\n -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJyZWQiIHNoYXBlLXJlbmRlcmluZz0iZ2VvbWV0cmljUHJlY2lzaW9uIj4KPGNpcmNsZSBmaWxsPSJub25lIiBjeD0iOCIgY3k9IjgiIHI9IjciIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPGxpbmUgeDE9IjExIiB5MT0iNSIgeDI9IjUiIHkyPSIxMSIvPgo8bGluZSB4MT0iMTEiIHkxPSIxMSIgeDI9IjUiIHkyPSI1Ii8+CjwvZz4KPC9zdmc+");\n background-color: crimson;\n}\n.ace_icon_svg.ace_warning {\n -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJkYXJrb3JhbmdlIiBzaGFwZS1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiI+Cjxwb2x5Z29uIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGZpbGw9Im5vbmUiIHBvaW50cz0iOCAxIDE1IDE1IDEgMTUgOCAxIi8+CjxyZWN0IHg9IjgiIHk9IjEyIiB3aWR0aD0iMC4wMSIgaGVpZ2h0PSIwLjAxIi8+CjxsaW5lIHgxPSI4IiB5MT0iNiIgeDI9IjgiIHkyPSIxMCIvPgo8L2c+Cjwvc3ZnPg==");\n background-color: darkorange;\n}\n.ace_icon_svg.ace_info {\n -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJibHVlIiBzaGFwZS1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiI+CjxjaXJjbGUgZmlsbD0ibm9uZSIgY3g9IjgiIGN5PSI4IiByPSI3IiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjxwb2x5bGluZSBwb2ludHM9IjggMTEgOCA4Ii8+Cjxwb2x5bGluZSBwb2ludHM9IjkgOCA2IDgiLz4KPGxpbmUgeDE9IjEwIiB5MT0iMTEiIHgyPSI2IiB5Mj0iMTEiLz4KPHJlY3QgeD0iOCIgeT0iNSIgd2lkdGg9IjAuMDEiIGhlaWdodD0iMC4wMSIvPgo8L2c+Cjwvc3ZnPg==");\n background-color: royalblue;\n}\n\n.ace_icon_svg.ace_error_fold {\n -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiIgZmlsbD0ibm9uZSI+CiAgPHBhdGggZD0ibSAxOC45Mjk4NTEsNy44Mjk4MDc2IGMgMC4xNDYzNTMsNi4zMzc0NjA0IC02LjMyMzE0Nyw3Ljc3Nzg0NDQgLTcuNDc3OTEyLDcuNzc3ODQ0NCAtMi4xMDcyNzI2LC0wLjEyODc1IDUuMTE3Njc4LDAuMzU2MjQ5IDUuMDUxNjk4LC03Ljg3MDA2MTggLTAuNjA0NjcyLC04LjAwMzk3MzQ5IC03LjA3NzI3MDYsLTcuNTYzMTE4OSAtNC44NTczLC03LjQzMDM5NTU2IDEuNjA2LC0wLjExNTE0MjI1IDYuODk3NDg1LDEuMjYyNTQ1OTYgNy4yODM1MTQsNy41MjI2MTI5NiB6IiBmaWxsPSJjcmltc29uIiBzdHJva2Utd2lkdGg9IjIiLz4KICA8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0ibSA4LjExNDc1NjIsMi4wNTI5ODI4IGMgMy4zNDkxNjk4LDAgNi4wNjQxMzI4LDIuNjc2ODYyNyA2LjA2NDEzMjgsNS45Nzg5NTMgMCwzLjMwMjExMjIgLTIuNzE0OTYzLDUuOTc4OTIwMiAtNi4wNjQxMzI4LDUuOTc4OTIwMiAtMy4zNDkxNDczLDAgLTYuMDY0MTc3MiwtMi42NzY4MDggLTYuMDY0MTc3MiwtNS45Nzg5MjAyIDAuMDA1MzksLTMuMjk5ODg2MSAyLjcxNzI2NTYsLTUuOTczNjQwOCA2LjA2NDE3NzIsLTUuOTc4OTUzIHogbSAwLC0xLjczNTgyNzE5IGMgLTQuMzIxNDgzNiwwIC03LjgyNDc0MDM4LDMuNDU0MDE4NDkgLTcuODI0NzQwMzgsNy43MTQ3ODAxOSAwLDQuMjYwNzI4MiAzLjUwMzI1Njc4LDcuNzE0NzQ1MiA3LjgyNDc0MDM4LDcuNzE0NzQ1MiA0LjMyMTQ0OTgsMCA3LjgyNDY5OTgsLTMuNDU0MDE3IDcuODI0Njk5OCwtNy43MTQ3NDUyIDAsLTIuMDQ2MDkxNCAtMC44MjQzOTIsLTQuMDA4MzY3MiAtMi4yOTE3NTYsLTUuNDU1MTc0NiBDIDEyLjE4MDIyNSwxLjEyOTk2NDggMTAuMTkwMDEzLDAuMzE3MTU1NjEgOC4xMTQ3NTYyLDAuMzE3MTU1NjEgWiBNIDYuOTM3NDU2Myw4LjI0MDU5ODUgNC42NzE4Njg1LDEwLjQ4NTg1MiA2LjAwODY4MTQsMTEuODc2NzI4IDguMzE3MDAzNSw5LjYwMDc5MTEgMTAuNjI1MzM3LDExLjg3NjcyOCAxMS45NjIxMzgsMTAuNDg1ODUyIDkuNjk2NTUwOCw4LjI0MDU5ODUgMTEuOTYyMTM4LDYuMDA2ODA2NiAxMC41NzMyNDYsNC42Mzc0MzM1IDguMzE3MDAzNSw2Ljg3MzQyOTcgNi4wNjA3NjA3LDQuNjM3NDMzNSA0LjY3MTg2ODUsNi4wMDY4MDY2IFoiIGZpbGw9ImNyaW1zb24iIHN0cm9rZS13aWR0aD0iMiIvPgo8L3N2Zz4=");\n background-color: crimson;\n}\n.ace_icon_svg.ace_warning_fold {\n -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAyMCAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNC43NzY5IDE0LjczMzdMOC42NTE5MiAyLjQ4MzY5QzguMzI5NDYgMS44Mzg3NyA3LjQwOTEzIDEuODM4NzcgNy4wODY2NyAyLjQ4MzY5TDAuOTYxNjY5IDE0LjczMzdDMC42NzA3NzUgMTUuMzE1NSAxLjA5MzgzIDE2IDEuNzQ0MjkgMTZIMTMuOTk0M0MxNC42NDQ4IDE2IDE1LjA2NzggMTUuMzE1NSAxNC43NzY5IDE0LjczMzdaTTMuMTYwMDcgMTQuMjVMNy44NjkyOSA0LjgzMTU2TDEyLjU3ODUgMTQuMjVIMy4xNjAwN1pNOC43NDQyOSAxMS42MjVWMTMuMzc1SDYuOTk0MjlWMTEuNjI1SDguNzQ0MjlaTTYuOTk0MjkgMTAuNzVWNy4yNUg4Ljc0NDI5VjEwLjc1SDYuOTk0MjlaIiBmaWxsPSIjRUM3MjExIi8+CjxwYXRoIGQ9Ik0xMS4xOTkxIDIuOTUyMzhDMTAuODgwOSAyLjMxNDY3IDEwLjM1MzcgMS44MDUyNiA5LjcwNTUgMS41MDlMMTEuMDQxIDEuMDY5NzhDMTEuNjg4MyAwLjk0OTgxNCAxMi4zMzcgMS4yNzI2MyAxMi42MzE3IDEuODYxNDFMMTcuNjEzNiAxMS44MTYxQzE4LjM1MjcgMTMuMjkyOSAxNy41OTM4IDE1LjA4MDQgMTYuMDE4IDE1LjU3NDVDMTYuNDA0NCAxNC40NTA3IDE2LjMyMzEgMTMuMjE4OCAxNS43OTI0IDEyLjE1NTVMMTEuMTk5MSAyLjk1MjM4WiIgZmlsbD0iI0VDNzIxMSIvPgo8L3N2Zz4=");\n background-color: darkorange;\n}\n\n.ace_scrollbar {\n contain: strict;\n position: absolute;\n right: 0;\n bottom: 0;\n z-index: 6;\n}\n\n.ace_scrollbar-inner {\n position: absolute;\n cursor: text;\n left: 0;\n top: 0;\n}\n\n.ace_scrollbar-v{\n overflow-x: hidden;\n overflow-y: scroll;\n top: 0;\n}\n\n.ace_scrollbar-h {\n overflow-x: scroll;\n overflow-y: hidden;\n left: 0;\n}\n\n.ace_print-margin {\n position: absolute;\n height: 100%;\n}\n\n.ace_text-input {\n position: absolute;\n z-index: 0;\n width: 0.5em;\n height: 1em;\n opacity: 0;\n background: transparent;\n -moz-appearance: none;\n appearance: none;\n border: none;\n resize: none;\n outline: none;\n overflow: hidden;\n font: inherit;\n padding: 0 1px;\n margin: 0 -1px;\n contain: strict;\n -ms-user-select: text;\n -moz-user-select: text;\n -webkit-user-select: text;\n user-select: text;\n /*with `pre-line` chrome inserts instead of space*/\n white-space: pre!important;\n}\n.ace_text-input.ace_composition {\n background: transparent;\n color: inherit;\n z-index: 1000;\n opacity: 1;\n}\n.ace_composition_placeholder { color: transparent }\n.ace_composition_marker { \n border-bottom: 1px solid;\n position: absolute;\n border-radius: 0;\n margin-top: 1px;\n}\n\n[ace_nocontext=true] {\n transform: none!important;\n filter: none!important;\n clip-path: none!important;\n mask : none!important;\n contain: none!important;\n perspective: none!important;\n mix-blend-mode: initial!important;\n z-index: auto;\n}\n\n.ace_layer {\n z-index: 1;\n position: absolute;\n overflow: hidden;\n /* workaround for chrome bug https://github.com/ajaxorg/ace/issues/2312*/\n word-wrap: normal;\n white-space: pre;\n height: 100%;\n width: 100%;\n box-sizing: border-box;\n /* setting pointer-events: auto; on node under the mouse, which changes\n during scroll, will break mouse wheel scrolling in Safari */\n pointer-events: none;\n}\n\n.ace_gutter-layer {\n position: relative;\n width: auto;\n text-align: right;\n pointer-events: auto;\n height: 1000000px;\n contain: style size layout;\n}\n\n.ace_text-layer {\n font: inherit !important;\n position: absolute;\n height: 1000000px;\n width: 1000000px;\n contain: style size layout;\n}\n\n.ace_text-layer > .ace_line, .ace_text-layer > .ace_line_group {\n contain: style size layout;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n}\n\n.ace_hidpi .ace_text-layer,\n.ace_hidpi .ace_gutter-layer,\n.ace_hidpi .ace_content,\n.ace_hidpi .ace_gutter {\n contain: strict;\n}\n.ace_hidpi .ace_text-layer > .ace_line, \n.ace_hidpi .ace_text-layer > .ace_line_group {\n contain: strict;\n}\n\n.ace_cjk {\n display: inline-block;\n text-align: center;\n}\n\n.ace_cursor-layer {\n z-index: 4;\n}\n\n.ace_cursor {\n z-index: 4;\n position: absolute;\n box-sizing: border-box;\n border-left: 2px solid;\n /* workaround for smooth cursor repaintng whole screen in chrome */\n transform: translatez(0);\n}\n\n.ace_multiselect .ace_cursor {\n border-left-width: 1px;\n}\n\n.ace_slim-cursors .ace_cursor {\n border-left-width: 1px;\n}\n\n.ace_overwrite-cursors .ace_cursor {\n border-left-width: 0;\n border-bottom: 1px solid;\n}\n\n.ace_hidden-cursors .ace_cursor {\n opacity: 0.2;\n}\n\n.ace_hasPlaceholder .ace_hidden-cursors .ace_cursor {\n opacity: 0;\n}\n\n.ace_smooth-blinking .ace_cursor {\n transition: opacity 0.18s;\n}\n\n.ace_animate-blinking .ace_cursor {\n animation-duration: 1000ms;\n animation-timing-function: step-end;\n animation-name: blink-ace-animate;\n animation-iteration-count: infinite;\n}\n\n.ace_animate-blinking.ace_smooth-blinking .ace_cursor {\n animation-duration: 1000ms;\n animation-timing-function: ease-in-out;\n animation-name: blink-ace-animate-smooth;\n}\n \n@keyframes blink-ace-animate {\n from, to { opacity: 1; }\n 60% { opacity: 0; }\n}\n\n@keyframes blink-ace-animate-smooth {\n from, to { opacity: 1; }\n 45% { opacity: 1; }\n 60% { opacity: 0; }\n 85% { opacity: 0; }\n}\n\n.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {\n position: absolute;\n z-index: 3;\n}\n\n.ace_marker-layer .ace_selection {\n position: absolute;\n z-index: 5;\n}\n\n.ace_marker-layer .ace_bracket {\n position: absolute;\n z-index: 6;\n}\n\n.ace_marker-layer .ace_error_bracket {\n position: absolute;\n border-bottom: 1px solid #DE5555;\n border-radius: 0;\n}\n\n.ace_marker-layer .ace_active-line {\n position: absolute;\n z-index: 2;\n}\n\n.ace_marker-layer .ace_selected-word {\n position: absolute;\n z-index: 4;\n box-sizing: border-box;\n}\n\n.ace_line .ace_fold {\n box-sizing: border-box;\n\n display: inline-block;\n height: 11px;\n margin-top: -2px;\n vertical-align: middle;\n\n background-image:\n url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),\n url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=");\n background-repeat: no-repeat, repeat-x;\n background-position: center center, top left;\n color: transparent;\n\n border: 1px solid black;\n border-radius: 2px;\n\n cursor: pointer;\n pointer-events: auto;\n}\n\n.ace_dark .ace_fold {\n}\n\n.ace_fold:hover{\n background-image:\n url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),\n url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC");\n}\n\n.ace_tooltip {\n background-color: #f5f5f5;\n border: 1px solid gray;\n border-radius: 1px;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);\n color: black;\n max-width: 100%;\n padding: 3px 4px;\n position: fixed;\n z-index: 999999;\n box-sizing: border-box;\n cursor: default;\n white-space: pre;\n word-wrap: break-word;\n line-height: normal;\n font-style: normal;\n font-weight: normal;\n letter-spacing: normal;\n pointer-events: none;\n}\n\n.ace_tooltip.ace_dark {\n background-color: #636363;\n color: #fff;\n}\n\n.ace_tooltip:focus {\n outline: 1px solid #5E9ED6;\n}\n\n.ace_icon {\n display: inline-block;\n width: 18px;\n vertical-align: top;\n}\n\n.ace_icon_svg {\n display: inline-block;\n width: 12px;\n vertical-align: top;\n -webkit-mask-repeat: no-repeat;\n -webkit-mask-size: 12px;\n -webkit-mask-position: center;\n}\n\n.ace_folding-enabled > .ace_gutter-cell, .ace_folding-enabled > .ace_gutter-cell_svg-icons {\n padding-right: 13px;\n}\n\n.ace_fold-widget {\n box-sizing: border-box;\n\n margin: 0 -12px 0 1px;\n display: none;\n width: 11px;\n vertical-align: top;\n\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==");\n background-repeat: no-repeat;\n background-position: center;\n\n border-radius: 3px;\n \n border: 1px solid transparent;\n cursor: pointer;\n}\n\n.ace_folding-enabled .ace_fold-widget {\n display: inline-block; \n}\n\n.ace_fold-widget.ace_end {\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==");\n}\n\n.ace_fold-widget.ace_closed {\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==");\n}\n\n.ace_fold-widget:hover {\n border: 1px solid rgba(0, 0, 0, 0.3);\n background-color: rgba(255, 255, 255, 0.2);\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);\n}\n\n.ace_fold-widget:active {\n border: 1px solid rgba(0, 0, 0, 0.4);\n background-color: rgba(0, 0, 0, 0.05);\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);\n}\n/**\n * Dark version for fold widgets\n */\n.ace_dark .ace_fold-widget {\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC");\n}\n.ace_dark .ace_fold-widget.ace_end {\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==");\n}\n.ace_dark .ace_fold-widget.ace_closed {\n background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==");\n}\n.ace_dark .ace_fold-widget:hover {\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);\n background-color: rgba(255, 255, 255, 0.1);\n}\n.ace_dark .ace_fold-widget:active {\n box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);\n}\n\n.ace_inline_button {\n border: 1px solid lightgray;\n display: inline-block;\n margin: -1px 8px;\n padding: 0 5px;\n pointer-events: auto;\n cursor: pointer;\n}\n.ace_inline_button:hover {\n border-color: gray;\n background: rgba(200,200,200,0.2);\n display: inline-block;\n pointer-events: auto;\n}\n\n.ace_fold-widget.ace_invalid {\n background-color: #FFB4B4;\n border-color: #DE5555;\n}\n\n.ace_fade-fold-widgets .ace_fold-widget {\n transition: opacity 0.4s ease 0.05s;\n opacity: 0;\n}\n\n.ace_fade-fold-widgets:hover .ace_fold-widget {\n transition: opacity 0.05s ease 0.05s;\n opacity:1;\n}\n\n.ace_underline {\n text-decoration: underline;\n}\n\n.ace_bold {\n font-weight: bold;\n}\n\n.ace_nobold .ace_bold {\n font-weight: normal;\n}\n\n.ace_italic {\n font-style: italic;\n}\n\n\n.ace_error-marker {\n background-color: rgba(255, 0, 0,0.2);\n position: absolute;\n z-index: 9;\n}\n\n.ace_highlight-marker {\n background-color: rgba(255, 255, 0,0.2);\n position: absolute;\n z-index: 8;\n}\n\n.ace_mobile-menu {\n position: absolute;\n line-height: 1.5;\n border-radius: 4px;\n -ms-user-select: none;\n -moz-user-select: none;\n -webkit-user-select: none;\n user-select: none;\n background: white;\n box-shadow: 1px 3px 2px grey;\n border: 1px solid #dcdcdc;\n color: black;\n}\n.ace_dark > .ace_mobile-menu {\n background: #333;\n color: #ccc;\n box-shadow: 1px 3px 2px grey;\n border: 1px solid #444;\n\n}\n.ace_mobile-button {\n padding: 2px;\n cursor: pointer;\n overflow: hidden;\n}\n.ace_mobile-button:hover {\n background-color: #eee;\n opacity:1;\n}\n.ace_mobile-button:active {\n background-color: #ddd;\n}\n\n.ace_placeholder {\n font-family: arial;\n transform: scale(0.9);\n transform-origin: left;\n white-space: pre;\n opacity: 0.7;\n margin: 0 10px;\n}\n\n.ace_ghost_text {\n opacity: 0.5;\n font-style: italic;\n white-space: pre;\n}'})),ace.define("ace/layer/decorators",["require","exports","module","ace/lib/dom","ace/lib/oop","ace/lib/event_emitter"],(function(e,t,n){"use strict";var i=e("../lib/dom"),o=e("../lib/oop"),r=e("../lib/event_emitter").EventEmitter,s=function(){function e(e,t){this.canvas=i.createElement("canvas"),this.renderer=t,this.pixelRatio=1,this.maxHeight=t.layerConfig.maxHeight,this.lineHeight=t.layerConfig.lineHeight,this.canvasHeight=e.parent.scrollHeight,this.heightRatio=this.canvasHeight/this.maxHeight,this.canvasWidth=e.width,this.minDecorationHeight=2*this.pixelRatio|0,this.halfMinDecorationHeight=this.minDecorationHeight/2|0,this.canvas.width=this.canvasWidth,this.canvas.height=this.canvasHeight,this.canvas.style.top="0px",this.canvas.style.right="0px",this.canvas.style.zIndex="7px",this.canvas.style.position="absolute",this.colors={},this.colors.dark={error:"rgba(255, 18, 18, 1)",warning:"rgba(18, 136, 18, 1)",info:"rgba(18, 18, 136, 1)"},this.colors.light={error:"rgb(255,51,51)",warning:"rgb(32,133,72)",info:"rgb(35,68,138)"},e.element.appendChild(this.canvas)}return e.prototype.$updateDecorators=function(e){var t=!0===this.renderer.theme.isDark?this.colors.dark:this.colors.light;e&&(this.maxHeight=e.maxHeight,this.lineHeight=e.lineHeight,this.canvasHeight=e.height,(e.lastRow+1)*this.lineHeight<this.canvasHeight?this.heightRatio=1:this.heightRatio=this.canvasHeight/this.maxHeight);var n=this.canvas.getContext("2d"),i=this.renderer.session.$annotations;if(n.clearRect(0,0,this.canvas.width,this.canvas.height),i){var o={info:1,warning:2,error:3};i.forEach((function(e){e.priority=o[e.type]||null})),i=i.sort((function(e,t){return e.priority<t.priority?-1:e.priority>t.priority?1:0}));for(var r=this.renderer.session.$foldData,s=0;s<i.length;s++){var a=i[s].row,l=this.compensateFoldRows(a,r),c=Math.round((a-l)*this.lineHeight*this.heightRatio),h=Math.round((a-l)*this.lineHeight*this.heightRatio),d=Math.round(((a-l)*this.lineHeight+this.lineHeight)*this.heightRatio);if(d-h<this.minDecorationHeight){var u=(h+d)/2|0;u<this.halfMinDecorationHeight?u=this.halfMinDecorationHeight:u+this.halfMinDecorationHeight>this.canvasHeight&&(u=this.canvasHeight-this.halfMinDecorationHeight),h=Math.round(u-this.halfMinDecorationHeight),d=Math.round(u+this.halfMinDecorationHeight)}n.fillStyle=t[i[s].type]||null,n.fillRect(0,c,this.canvasWidth,d-h)}}var p=this.renderer.session.selection.getCursor();p&&(l=this.compensateFoldRows(p.row,r),c=Math.round((p.row-l)*this.lineHeight*this.heightRatio),n.fillStyle="rgba(0, 0, 0, 0.5)",n.fillRect(0,c,this.canvasWidth,2))},e.prototype.compensateFoldRows=function(e,t){var n=0;if(t&&t.length>0)for(var i=0;i<t.length;i++)e>t[i].start.row&&e<t[i].end.row?n+=e-t[i].start.row:e>=t[i].end.row&&(n+=t[i].end.row-t[i].start.row);return n},e}();o.implement(s.prototype,r),t.Decorator=s})),ace.define("ace/virtual_renderer",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/config","ace/layer/gutter","ace/layer/marker","ace/layer/text","ace/layer/cursor","ace/scrollbar","ace/scrollbar","ace/scrollbar_custom","ace/scrollbar_custom","ace/renderloop","ace/layer/font_metrics","ace/lib/event_emitter","ace/css/editor-css","ace/layer/decorators","ace/lib/useragent"],(function(e,t,n){"use strict";var i=e("./lib/oop"),o=e("./lib/dom"),r=e("./lib/lang"),s=e("./config"),a=e("./layer/gutter").Gutter,l=e("./layer/marker").Marker,c=e("./layer/text").Text,h=e("./layer/cursor").Cursor,d=e("./scrollbar").HScrollBar,u=e("./scrollbar").VScrollBar,p=e("./scrollbar_custom").HScrollBar,g=e("./scrollbar_custom").VScrollBar,f=e("./renderloop").RenderLoop,m=e("./layer/font_metrics").FontMetrics,v=e("./lib/event_emitter").EventEmitter,w=e("./css/editor-css"),b=e("./layer/decorators").Decorator,y=e("./lib/useragent");o.importCssString(w,"ace_editor.css",!1);var C=function(){function e(e,t){var n=this;this.container=e||o.createElement("div"),o.addCssClass(this.container,"ace_editor"),o.HI_DPI&&o.addCssClass(this.container,"ace_hidpi"),this.setTheme(t),null==s.get("useStrictCSP")&&s.set("useStrictCSP",!1),this.$gutter=o.createElement("div"),this.$gutter.className="ace_gutter",this.container.appendChild(this.$gutter),this.$gutter.setAttribute("aria-hidden",!0),this.scroller=o.createElement("div"),this.scroller.className="ace_scroller",this.container.appendChild(this.scroller),this.content=o.createElement("div"),this.content.className="ace_content",this.scroller.appendChild(this.content),this.$gutterLayer=new a(this.$gutter),this.$gutterLayer.on("changeGutterWidth",this.onGutterResize.bind(this)),this.$markerBack=new l(this.content);var i=this.$textLayer=new c(this.content);this.canvas=i.element,this.$markerFront=new l(this.content),this.$cursorLayer=new h(this.content),this.$horizScroll=!1,this.$vScroll=!1,this.scrollBar=this.scrollBarV=new u(this.container,this),this.scrollBarH=new d(this.container,this),this.scrollBarV.on("scroll",(function(e){n.$scrollAnimation||n.session.setScrollTop(e.data-n.scrollMargin.top)})),this.scrollBarH.on("scroll",(function(e){n.$scrollAnimation||n.session.setScrollLeft(e.data-n.scrollMargin.left)})),this.scrollTop=0,this.scrollLeft=0,this.cursorPos={row:0,column:0},this.$fontMetrics=new m(this.container),this.$textLayer.$setFontMetrics(this.$fontMetrics),this.$textLayer.on("changeCharacterSize",(function(e){n.updateCharacterSize(),n.onResize(!0,n.gutterWidth,n.$size.width,n.$size.height),n._signal("changeCharacterSize",e)})),this.$size={width:0,height:0,scrollerHeight:0,scrollerWidth:0,$dirty:!0},this.layerConfig={width:1,padding:0,firstRow:0,firstRowScreen:0,lastRow:0,lineHeight:0,characterWidth:0,minHeight:1,maxHeight:1,offset:0,height:1,gutterOffset:1},this.scrollMargin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.margin={left:0,right:0,top:0,bottom:0,v:0,h:0},this.$keepTextAreaAtCursor=!y.isIOS,this.$loop=new f(this.$renderChanges.bind(this),this.container.ownerDocument.defaultView),this.$loop.schedule(this.CHANGE_FULL),this.updateCharacterSize(),this.setPadding(4),this.$addResizeObserver(),s.resetOptions(this),s._signal("renderer",this)}return e.prototype.updateCharacterSize=function(){this.$textLayer.allowBoldFonts!=this.$allowBoldFonts&&(this.$allowBoldFonts=this.$textLayer.allowBoldFonts,this.setStyle("ace_nobold",!this.$allowBoldFonts)),this.layerConfig.characterWidth=this.characterWidth=this.$textLayer.getCharacterWidth(),this.layerConfig.lineHeight=this.lineHeight=this.$textLayer.getLineHeight(),this.$updatePrintMargin(),o.setStyle(this.scroller.style,"line-height",this.lineHeight+"px")},e.prototype.setSession=function(e){this.session&&this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode),this.session=e,e&&this.scrollMargin.top&&e.getScrollTop()<=0&&e.setScrollTop(-this.scrollMargin.top),this.$cursorLayer.setSession(e),this.$markerBack.setSession(e),this.$markerFront.setSession(e),this.$gutterLayer.setSession(e),this.$textLayer.setSession(e),e&&(this.$loop.schedule(this.CHANGE_FULL),this.session.$setFontMetrics(this.$fontMetrics),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.onChangeNewLineMode=this.onChangeNewLineMode.bind(this),this.onChangeNewLineMode(),this.session.doc.on("changeNewLineMode",this.onChangeNewLineMode))},e.prototype.updateLines=function(e,t,n){if(void 0===t&&(t=1/0),this.$changedLines?(this.$changedLines.firstRow>e&&(this.$changedLines.firstRow=e),this.$changedLines.lastRow<t&&(this.$changedLines.lastRow=t)):this.$changedLines={firstRow:e,lastRow:t},this.$changedLines.lastRow<this.layerConfig.firstRow){if(!n)return;this.$changedLines.lastRow=this.layerConfig.lastRow}this.$changedLines.firstRow>this.layerConfig.lastRow||this.$loop.schedule(this.CHANGE_LINES)},e.prototype.onChangeNewLineMode=function(){this.$loop.schedule(this.CHANGE_TEXT),this.$textLayer.$updateEolChar(),this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR)},e.prototype.onChangeTabSize=function(){this.$loop.schedule(this.CHANGE_TEXT|this.CHANGE_MARKER),this.$textLayer.onChangeTabSize()},e.prototype.updateText=function(){this.$loop.schedule(this.CHANGE_TEXT)},e.prototype.updateFull=function(e){e?this.$renderChanges(this.CHANGE_FULL,!0):this.$loop.schedule(this.CHANGE_FULL)},e.prototype.updateFontSize=function(){this.$textLayer.checkForSizeChanges()},e.prototype.$updateSizeAsync=function(){this.$loop.pending?this.$size.$dirty=!0:this.onResize()},e.prototype.onResize=function(e,t,n,i){if(!(this.resizing>2)){this.resizing>0?this.resizing++:this.resizing=e?1:0;var o=this.container;i||(i=o.clientHeight||o.scrollHeight),n||(n=o.clientWidth||o.scrollWidth);var r=this.$updateCachedSize(e,t,n,i);if(this.$resizeTimer&&this.$resizeTimer.cancel(),!this.$size.scrollerHeight||!n&&!i)return this.resizing=0;e&&(this.$gutterLayer.$padding=null),e?this.$renderChanges(r|this.$changes,!0):this.$loop.schedule(r|this.$changes),this.resizing&&(this.resizing=0),this.scrollBarH.scrollLeft=this.scrollBarV.scrollTop=null,this.$customScrollbar&&this.$updateCustomScrollbar(!0)}},e.prototype.$updateCachedSize=function(e,t,n,i){i-=this.$extraHeight||0;var r=0,s=this.$size,a={width:s.width,height:s.height,scrollerHeight:s.scrollerHeight,scrollerWidth:s.scrollerWidth};if(i&&(e||s.height!=i)&&(s.height=i,r|=this.CHANGE_SIZE,s.scrollerHeight=s.height,this.$horizScroll&&(s.scrollerHeight-=this.scrollBarH.getHeight()),this.scrollBarV.setHeight(s.scrollerHeight),this.scrollBarV.element.style.bottom=this.scrollBarH.getHeight()+"px",r|=this.CHANGE_SCROLL),n&&(e||s.width!=n)){r|=this.CHANGE_SIZE,s.width=n,null==t&&(t=this.$showGutter?this.$gutter.offsetWidth:0),this.gutterWidth=t,o.setStyle(this.scrollBarH.element.style,"left",t+"px"),o.setStyle(this.scroller.style,"left",t+this.margin.left+"px"),s.scrollerWidth=Math.max(0,n-t-this.scrollBarV.getWidth()-this.margin.h),o.setStyle(this.$gutter.style,"left",this.margin.left+"px");var l=this.scrollBarV.getWidth()+"px";o.setStyle(this.scrollBarH.element.style,"right",l),o.setStyle(this.scroller.style,"right",l),o.setStyle(this.scroller.style,"bottom",this.scrollBarH.getHeight()),this.scrollBarH.setWidth(s.scrollerWidth),(this.session&&this.session.getUseWrapMode()&&this.adjustWrapLimit()||e)&&(r|=this.CHANGE_FULL)}return s.$dirty=!n||!i,r&&this._signal("resize",a),r},e.prototype.onGutterResize=function(e){var t=this.$showGutter?e:0;t!=this.gutterWidth&&(this.$changes|=this.$updateCachedSize(!0,t,this.$size.width,this.$size.height)),this.session.getUseWrapMode()&&this.adjustWrapLimit()||this.$size.$dirty?this.$loop.schedule(this.CHANGE_FULL):this.$computeLayerConfig()},e.prototype.adjustWrapLimit=function(){var e=this.$size.scrollerWidth-2*this.$padding,t=Math.floor(e/this.characterWidth);return this.session.adjustWrapLimit(t,this.$showPrintMargin&&this.$printMarginColumn)},e.prototype.setAnimatedScroll=function(e){this.setOption("animatedScroll",e)},e.prototype.getAnimatedScroll=function(){return this.$animatedScroll},e.prototype.setShowInvisibles=function(e){this.setOption("showInvisibles",e),this.session.$bidiHandler.setShowInvisibles(e)},e.prototype.getShowInvisibles=function(){return this.getOption("showInvisibles")},e.prototype.getDisplayIndentGuides=function(){return this.getOption("displayIndentGuides")},e.prototype.setDisplayIndentGuides=function(e){this.setOption("displayIndentGuides",e)},e.prototype.getHighlightIndentGuides=function(){return this.getOption("highlightIndentGuides")},e.prototype.setHighlightIndentGuides=function(e){this.setOption("highlightIndentGuides",e)},e.prototype.setShowPrintMargin=function(e){this.setOption("showPrintMargin",e)},e.prototype.getShowPrintMargin=function(){return this.getOption("showPrintMargin")},e.prototype.setPrintMarginColumn=function(e){this.setOption("printMarginColumn",e)},e.prototype.getPrintMarginColumn=function(){return this.getOption("printMarginColumn")},e.prototype.getShowGutter=function(){return this.getOption("showGutter")},e.prototype.setShowGutter=function(e){return this.setOption("showGutter",e)},e.prototype.getFadeFoldWidgets=function(){return this.getOption("fadeFoldWidgets")},e.prototype.setFadeFoldWidgets=function(e){this.setOption("fadeFoldWidgets",e)},e.prototype.setHighlightGutterLine=function(e){this.setOption("highlightGutterLine",e)},e.prototype.getHighlightGutterLine=function(){return this.getOption("highlightGutterLine")},e.prototype.$updatePrintMargin=function(){if(this.$showPrintMargin||this.$printMarginEl){if(!this.$printMarginEl){var e=o.createElement("div");e.className="ace_layer ace_print-margin-layer",this.$printMarginEl=o.createElement("div"),this.$printMarginEl.className="ace_print-margin",e.appendChild(this.$printMarginEl),this.content.insertBefore(e,this.content.firstChild)}var t=this.$printMarginEl.style;t.left=Math.round(this.characterWidth*this.$printMarginColumn+this.$padding)+"px",t.visibility=this.$showPrintMargin?"visible":"hidden",this.session&&-1==this.session.$wrap&&this.adjustWrapLimit()}},e.prototype.getContainerElement=function(){return this.container},e.prototype.getMouseEventTarget=function(){return this.scroller},e.prototype.getTextAreaContainer=function(){return this.container},e.prototype.$moveTextAreaToCursor=function(){if(!this.$isMousePressed){var e=this.textarea.style,t=this.$composition;if(this.$keepTextAreaAtCursor||t){var n=this.$cursorLayer.$pixelPos;if(n){t&&t.markerRange&&(n=this.$cursorLayer.getPixelPosition(t.markerRange.start,!0));var i=this.layerConfig,r=n.top,s=n.left;r-=i.offset;var a=t&&t.useTextareaForIME||y.isMobile?this.lineHeight:1;if(r<0||r>i.height-a)o.translate(this.textarea,0,0);else{var l=1,c=this.$size.height-a;if(t)if(t.useTextareaForIME){var h=this.textarea.value;l=this.characterWidth*this.session.$getStringScreenWidth(h)[0]}else r+=this.lineHeight+2;else r+=this.lineHeight;(s-=this.scrollLeft)>this.$size.scrollerWidth-l&&(s=this.$size.scrollerWidth-l),s+=this.gutterWidth+this.margin.left,o.setStyle(e,"height",a+"px"),o.setStyle(e,"width",l+"px"),o.translate(this.textarea,Math.min(s,this.$size.scrollerWidth-l),Math.min(r,c))}}}else o.translate(this.textarea,-100,0)}},e.prototype.getFirstVisibleRow=function(){return this.layerConfig.firstRow},e.prototype.getFirstFullyVisibleRow=function(){return this.layerConfig.firstRow+(0===this.layerConfig.offset?0:1)},e.prototype.getLastFullyVisibleRow=function(){var e=this.layerConfig,t=e.lastRow;return this.session.documentToScreenRow(t,0)*e.lineHeight-this.session.getScrollTop()>e.height-e.lineHeight?t-1:t},e.prototype.getLastVisibleRow=function(){return this.layerConfig.lastRow},e.prototype.setPadding=function(e){this.$padding=e,this.$textLayer.setPadding(e),this.$cursorLayer.setPadding(e),this.$markerFront.setPadding(e),this.$markerBack.setPadding(e),this.$loop.schedule(this.CHANGE_FULL),this.$updatePrintMargin()},e.prototype.setScrollMargin=function(e,t,n,i){var o=this.scrollMargin;o.top=0|e,o.bottom=0|t,o.right=0|i,o.left=0|n,o.v=o.top+o.bottom,o.h=o.left+o.right,o.top&&this.scrollTop<=0&&this.session&&this.session.setScrollTop(-o.top),this.updateFull()},e.prototype.setMargin=function(e,t,n,i){var o=this.margin;o.top=0|e,o.bottom=0|t,o.right=0|i,o.left=0|n,o.v=o.top+o.bottom,o.h=o.left+o.right,this.$updateCachedSize(!0,this.gutterWidth,this.$size.width,this.$size.height),this.updateFull()},e.prototype.getHScrollBarAlwaysVisible=function(){return this.$hScrollBarAlwaysVisible},e.prototype.setHScrollBarAlwaysVisible=function(e){this.setOption("hScrollBarAlwaysVisible",e)},e.prototype.getVScrollBarAlwaysVisible=function(){return this.$vScrollBarAlwaysVisible},e.prototype.setVScrollBarAlwaysVisible=function(e){this.setOption("vScrollBarAlwaysVisible",e)},e.prototype.$updateScrollBarV=function(){var e=this.layerConfig.maxHeight,t=this.$size.scrollerHeight;!this.$maxLines&&this.$scrollPastEnd&&(e-=(t-this.lineHeight)*this.$scrollPastEnd,this.scrollTop>e-t&&(e=this.scrollTop+t,this.scrollBarV.scrollTop=null)),this.scrollBarV.setScrollHeight(e+this.scrollMargin.v),this.scrollBarV.setScrollTop(this.scrollTop+this.scrollMargin.top)},e.prototype.$updateScrollBarH=function(){this.scrollBarH.setScrollWidth(this.layerConfig.width+2*this.$padding+this.scrollMargin.h),this.scrollBarH.setScrollLeft(this.scrollLeft+this.scrollMargin.left)},e.prototype.freeze=function(){this.$frozen=!0},e.prototype.unfreeze=function(){this.$frozen=!1},e.prototype.$renderChanges=function(e,t){if(this.$changes&&(e|=this.$changes,this.$changes=0),this.session&&this.container.offsetWidth&&!this.$frozen&&(e||t)){if(this.$size.$dirty)return this.$changes|=e,this.onResize(!0);this.lineHeight||this.$textLayer.checkForSizeChanges(),this._signal("beforeRender",e),this.session&&this.session.$bidiHandler&&this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);var n=this.layerConfig;if(e&this.CHANGE_FULL||e&this.CHANGE_SIZE||e&this.CHANGE_TEXT||e&this.CHANGE_LINES||e&this.CHANGE_SCROLL||e&this.CHANGE_H_SCROLL){if(e|=this.$computeLayerConfig()|this.$loop.clear(),n.firstRow!=this.layerConfig.firstRow&&n.firstRowScreen==this.layerConfig.firstRowScreen){var i=this.scrollTop+(n.firstRow-Math.max(this.layerConfig.firstRow,0))*this.lineHeight;i>0&&(this.scrollTop=i,e|=this.CHANGE_SCROLL,e|=this.$computeLayerConfig()|this.$loop.clear())}n=this.layerConfig,this.$updateScrollBarV(),e&this.CHANGE_H_SCROLL&&this.$updateScrollBarH(),o.translate(this.content,-this.scrollLeft,-n.offset);var r=n.width+2*this.$padding+"px",s=n.minHeight+"px";o.setStyle(this.content.style,"width",r),o.setStyle(this.content.style,"height",s)}if(e&this.CHANGE_H_SCROLL&&(o.translate(this.content,-this.scrollLeft,-n.offset),this.scroller.className=this.scrollLeft<=0?"ace_scroller ":"ace_scroller ace_scroll-left ",this.enableKeyboardAccessibility&&(this.scroller.className+=this.keyboardFocusClassName)),e&this.CHANGE_FULL)return this.$changedLines=null,this.$textLayer.update(n),this.$showGutter&&this.$gutterLayer.update(n),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(n),this.$markerBack.update(n),this.$markerFront.update(n),this.$cursorLayer.update(n),this.$moveTextAreaToCursor(),void this._signal("afterRender",e);if(e&this.CHANGE_SCROLL)return this.$changedLines=null,e&this.CHANGE_TEXT||e&this.CHANGE_LINES?this.$textLayer.update(n):this.$textLayer.scrollLines(n),this.$showGutter&&(e&this.CHANGE_GUTTER||e&this.CHANGE_LINES?this.$gutterLayer.update(n):this.$gutterLayer.scrollLines(n)),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(n),this.$markerBack.update(n),this.$markerFront.update(n),this.$cursorLayer.update(n),this.$moveTextAreaToCursor(),void this._signal("afterRender",e);e&this.CHANGE_TEXT?(this.$changedLines=null,this.$textLayer.update(n),this.$showGutter&&this.$gutterLayer.update(n),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(n)):e&this.CHANGE_LINES?((this.$updateLines()||e&this.CHANGE_GUTTER&&this.$showGutter)&&this.$gutterLayer.update(n),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(n)):e&this.CHANGE_TEXT||e&this.CHANGE_GUTTER?(this.$showGutter&&this.$gutterLayer.update(n),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(n)):e&this.CHANGE_CURSOR&&(this.$highlightGutterLine&&this.$gutterLayer.updateLineHighlight(n),this.$customScrollbar&&this.$scrollDecorator.$updateDecorators(n)),e&this.CHANGE_CURSOR&&(this.$cursorLayer.update(n),this.$moveTextAreaToCursor()),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_FRONT)&&this.$markerFront.update(n),e&(this.CHANGE_MARKER|this.CHANGE_MARKER_BACK)&&this.$markerBack.update(n),this._signal("afterRender",e)}else this.$changes|=e},e.prototype.$autosize=function(){var e=this.session.getScreenLength()*this.lineHeight,t=this.$maxLines*this.lineHeight,n=Math.min(t,Math.max((this.$minLines||1)*this.lineHeight,e))+this.scrollMargin.v+(this.$extraHeight||0);this.$horizScroll&&(n+=this.scrollBarH.getHeight()),this.$maxPixelHeight&&n>this.$maxPixelHeight&&(n=this.$maxPixelHeight);var i=!(n<=2*this.lineHeight)&&e>t;if(n!=this.desiredHeight||this.$size.height!=this.desiredHeight||i!=this.$vScroll){i!=this.$vScroll&&(this.$vScroll=i,this.scrollBarV.setVisible(i));var o=this.container.clientWidth;this.container.style.height=n+"px",this.$updateCachedSize(!0,this.$gutterWidth,o,n),this.desiredHeight=n,this._signal("autosize")}},e.prototype.$computeLayerConfig=function(){var e=this.session,t=this.$size,n=t.height<=2*this.lineHeight,i=this.session.getScreenLength()*this.lineHeight,o=this.$getLongestLine(),r=!n&&(this.$hScrollBarAlwaysVisible||t.scrollerWidth-o-2*this.$padding<0),s=this.$horizScroll!==r;s&&(this.$horizScroll=r,this.scrollBarH.setVisible(r));var a=this.$vScroll;this.$maxLines&&this.lineHeight>1&&this.$autosize();var l=t.scrollerHeight+this.lineHeight,c=!this.$maxLines&&this.$scrollPastEnd?(t.scrollerHeight-this.lineHeight)*this.$scrollPastEnd:0;i+=c;var h=this.scrollMargin;this.session.setScrollTop(Math.max(-h.top,Math.min(this.scrollTop,i-t.scrollerHeight+h.bottom))),this.session.setScrollLeft(Math.max(-h.left,Math.min(this.scrollLeft,o+2*this.$padding-t.scrollerWidth+h.right)));var d=!n&&(this.$vScrollBarAlwaysVisible||t.scrollerHeight-i+c<0||this.scrollTop>h.top),u=a!==d;u&&(this.$vScroll=d,this.scrollBarV.setVisible(d));var p,g,f=this.scrollTop%this.lineHeight,m=Math.ceil(l/this.lineHeight)-1,v=Math.max(0,Math.round((this.scrollTop-f)/this.lineHeight)),w=v+m,b=this.lineHeight;v=e.screenToDocumentRow(v,0);var y=e.getFoldLine(v);y&&(v=y.start.row),p=e.documentToScreenRow(v,0),g=e.getRowLength(v)*b,w=Math.min(e.screenToDocumentRow(w,0),e.getLength()-1),l=t.scrollerHeight+e.getRowLength(w)*b+g,f=this.scrollTop-p*b;var C=0;return(this.layerConfig.width!=o||s)&&(C=this.CHANGE_H_SCROLL),(s||u)&&(C|=this.$updateCachedSize(!0,this.gutterWidth,t.width,t.height),this._signal("scrollbarVisibilityChanged"),u&&(o=this.$getLongestLine())),this.layerConfig={width:o,padding:this.$padding,firstRow:v,firstRowScreen:p,lastRow:w,lineHeight:b,characterWidth:this.characterWidth,minHeight:l,maxHeight:i,offset:f,gutterOffset:b?Math.max(0,Math.ceil((f+t.height-t.scrollerHeight)/b)):0,height:this.$size.scrollerHeight},this.session.$bidiHandler&&this.session.$bidiHandler.setContentWidth(o-this.$padding),C},e.prototype.$updateLines=function(){if(this.$changedLines){var e=this.$changedLines.firstRow,t=this.$changedLines.lastRow;this.$changedLines=null;var n=this.layerConfig;if(!(e>n.lastRow+1||t<n.firstRow))return t===1/0?(this.$showGutter&&this.$gutterLayer.update(n),void this.$textLayer.update(n)):(this.$textLayer.updateLines(n,e,t),!0)}},e.prototype.$getLongestLine=function(){var e=this.session.getScreenWidth();return this.showInvisibles&&!this.session.$useWrapMode&&(e+=1),this.$textLayer&&e>this.$textLayer.MAX_LINE_LENGTH&&(e=this.$textLayer.MAX_LINE_LENGTH+30),Math.max(this.$size.scrollerWidth-2*this.$padding,Math.round(e*this.characterWidth))},e.prototype.updateFrontMarkers=function(){this.$markerFront.setMarkers(this.session.getMarkers(!0)),this.$loop.schedule(this.CHANGE_MARKER_FRONT)},e.prototype.updateBackMarkers=function(){this.$markerBack.setMarkers(this.session.getMarkers()),this.$loop.schedule(this.CHANGE_MARKER_BACK)},e.prototype.addGutterDecoration=function(e,t){this.$gutterLayer.addGutterDecoration(e,t)},e.prototype.removeGutterDecoration=function(e,t){this.$gutterLayer.removeGutterDecoration(e,t)},e.prototype.updateBreakpoints=function(e){this.$loop.schedule(this.CHANGE_GUTTER)},e.prototype.setAnnotations=function(e){this.$gutterLayer.setAnnotations(e),this.$loop.schedule(this.CHANGE_GUTTER)},e.prototype.updateCursor=function(){this.$loop.schedule(this.CHANGE_CURSOR)},e.prototype.hideCursor=function(){this.$cursorLayer.hideCursor()},e.prototype.showCursor=function(){this.$cursorLayer.showCursor()},e.prototype.scrollSelectionIntoView=function(e,t,n){this.scrollCursorIntoView(e,n),this.scrollCursorIntoView(t,n)},e.prototype.scrollCursorIntoView=function(e,t,n){if(0!==this.$size.scrollerHeight){var i=this.$cursorLayer.getPixelPosition(e),o=i.left,r=i.top,s=n&&n.top||0,a=n&&n.bottom||0;this.$scrollAnimation&&(this.$stopAnimation=!0);var l=this.$scrollAnimation?this.session.getScrollTop():this.scrollTop;l+s>r?(t&&l+s>r+this.lineHeight&&(r-=t*this.$size.scrollerHeight),0===r&&(r=-this.scrollMargin.top),this.session.setScrollTop(r)):l+this.$size.scrollerHeight-a<r+this.lineHeight&&(t&&l+this.$size.scrollerHeight-a<r-this.lineHeight&&(r+=t*this.$size.scrollerHeight),this.session.setScrollTop(r+this.lineHeight+a-this.$size.scrollerHeight));var c=this.scrollLeft,h=2*this.layerConfig.characterWidth;o-h<c?((o-=h)<this.$padding+h&&(o=-this.scrollMargin.left),this.session.setScrollLeft(o)):(o+=h,c+this.$size.scrollerWidth<o+this.characterWidth?this.session.setScrollLeft(Math.round(o+this.characterWidth-this.$size.scrollerWidth)):c<=this.$padding&&o-c<this.characterWidth&&this.session.setScrollLeft(0))}},e.prototype.getScrollTop=function(){return this.session.getScrollTop()},e.prototype.getScrollLeft=function(){return this.session.getScrollLeft()},e.prototype.getScrollTopRow=function(){return this.scrollTop/this.lineHeight},e.prototype.getScrollBottomRow=function(){return Math.max(0,Math.floor((this.scrollTop+this.$size.scrollerHeight)/this.lineHeight)-1)},e.prototype.scrollToRow=function(e){this.session.setScrollTop(e*this.lineHeight)},e.prototype.alignCursor=function(e,t){"number"==typeof e&&(e={row:e,column:0});var n=this.$cursorLayer.getPixelPosition(e),i=this.$size.scrollerHeight-this.lineHeight,o=n.top-i*(t||0);return this.session.setScrollTop(o),o},e.prototype.$calcSteps=function(e,t){var n,i,o=0,r=this.STEPS,s=[];for(o=0;o<r;++o)s.push((n=o/this.STEPS,i=e,(t-e)*(Math.pow(n-1,3)+1)+i));return s},e.prototype.scrollToLine=function(e,t,n,i){var o=this.$cursorLayer.getPixelPosition({row:e,column:0}).top;t&&(o-=this.$size.scrollerHeight/2);var r=this.scrollTop;this.session.setScrollTop(o),!1!==n&&this.animateScrolling(r,i)},e.prototype.animateScrolling=function(e,t){var n=this.scrollTop;if(this.$animatedScroll){var i=this;if(e!=n){if(this.$scrollAnimation){var o=this.$scrollAnimation.steps;if(o.length&&(e=o[0])==n)return}var r=i.$calcSteps(e,n);this.$scrollAnimation={from:e,to:n,steps:r},clearInterval(this.$timer),i.session.setScrollTop(r.shift()),i.session.$scrollTop=n,this.$timer=setInterval((function(){if(!i.$stopAnimation)return i.session?void(r.length?(i.session.setScrollTop(r.shift()),i.session.$scrollTop=n):null!=n?(i.session.$scrollTop=-1,i.session.setScrollTop(n),n=null):s()):clearInterval(i.$timer);s()}),10)}}function s(){i.$timer=clearInterval(i.$timer),i.$scrollAnimation=null,i.$stopAnimation=!1,t&&t()}},e.prototype.scrollToY=function(e){this.scrollTop!==e&&(this.$loop.schedule(this.CHANGE_SCROLL),this.scrollTop=e)},e.prototype.scrollToX=function(e){this.scrollLeft!==e&&(this.scrollLeft=e),this.$loop.schedule(this.CHANGE_H_SCROLL)},e.prototype.scrollTo=function(e,t){this.session.setScrollTop(t),this.session.setScrollLeft(e)},e.prototype.scrollBy=function(e,t){t&&this.session.setScrollTop(this.session.getScrollTop()+t),e&&this.session.setScrollLeft(this.session.getScrollLeft()+e)},e.prototype.isScrollableBy=function(e,t){return t<0&&this.session.getScrollTop()>=1-this.scrollMargin.top||t>0&&this.session.getScrollTop()+this.$size.scrollerHeight-this.layerConfig.maxHeight<-1+this.scrollMargin.bottom||e<0&&this.session.getScrollLeft()>=1-this.scrollMargin.left||e>0&&this.session.getScrollLeft()+this.$size.scrollerWidth-this.layerConfig.width<-1+this.scrollMargin.right||void 0},e.prototype.pixelToScreenCoordinates=function(e,t){var n;if(this.$hasCssTransforms){n={top:0,left:0};var i=this.$fontMetrics.transformCoordinates([e,t]);e=i[1]-this.gutterWidth-this.margin.left,t=i[0]}else n=this.scroller.getBoundingClientRect();var o=e+this.scrollLeft-n.left-this.$padding,r=o/this.characterWidth,s=Math.floor((t+this.scrollTop-n.top)/this.lineHeight),a=this.$blockCursor?Math.floor(r):Math.round(r);return{row:s,column:a,side:r-a>0?1:-1,offsetX:o}},e.prototype.screenToTextCoordinates=function(e,t){var n;if(this.$hasCssTransforms){n={top:0,left:0};var i=this.$fontMetrics.transformCoordinates([e,t]);e=i[1]-this.gutterWidth-this.margin.left,t=i[0]}else n=this.scroller.getBoundingClientRect();var o=e+this.scrollLeft-n.left-this.$padding,r=o/this.characterWidth,s=this.$blockCursor?Math.floor(r):Math.round(r),a=Math.floor((t+this.scrollTop-n.top)/this.lineHeight);return this.session.screenToDocumentPosition(a,Math.max(s,0),o)},e.prototype.textToScreenCoordinates=function(e,t){var n=this.scroller.getBoundingClientRect(),i=this.session.documentToScreenPosition(e,t),o=this.$padding+(this.session.$bidiHandler.isBidiRow(i.row,e)?this.session.$bidiHandler.getPosLeft(i.column):Math.round(i.column*this.characterWidth)),r=i.row*this.lineHeight;return{pageX:n.left+o-this.scrollLeft,pageY:n.top+r-this.scrollTop}},e.prototype.visualizeFocus=function(){o.addCssClass(this.container,"ace_focus")},e.prototype.visualizeBlur=function(){o.removeCssClass(this.container,"ace_focus")},e.prototype.showComposition=function(e){this.$composition=e,e.cssText||(e.cssText=this.textarea.style.cssText),null==e.useTextareaForIME&&(e.useTextareaForIME=this.$useTextareaForIME),this.$useTextareaForIME?(o.addCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText="",this.$moveTextAreaToCursor(),this.$cursorLayer.element.style.display="none"):e.markerId=this.session.addMarker(e.markerRange,"ace_composition_marker","text")},e.prototype.setCompositionText=function(e){var t=this.session.selection.cursor;this.addToken(e,"composition_placeholder",t.row,t.column),this.$moveTextAreaToCursor()},e.prototype.hideComposition=function(){if(this.$composition){this.$composition.markerId&&this.session.removeMarker(this.$composition.markerId),o.removeCssClass(this.textarea,"ace_composition"),this.textarea.style.cssText=this.$composition.cssText;var e=this.session.selection.cursor;this.removeExtraToken(e.row,e.column),this.$composition=null,this.$cursorLayer.element.style.display=""}},e.prototype.setGhostText=function(e,t){var n=this.session.selection.cursor,i=t||{row:n.row,column:n.column};this.removeGhostText();var o=e.split("\n");this.addToken(o[0],"ghost_text",i.row,i.column),this.$ghostText={text:e,position:{row:i.row,column:i.column}},o.length>1&&(this.$ghostTextWidget={text:o.slice(1).join("\n"),row:i.row,column:i.column,className:"ace_ghost_text"},this.session.widgetManager.addLineWidget(this.$ghostTextWidget))},e.prototype.removeGhostText=function(){if(this.$ghostText){var e=this.$ghostText.position;this.removeExtraToken(e.row,e.column),this.$ghostTextWidget&&(this.session.widgetManager.removeLineWidget(this.$ghostTextWidget),this.$ghostTextWidget=null),this.$ghostText=null}},e.prototype.addToken=function(e,t,n,i){var o=this.session;o.bgTokenizer.lines[n]=null;var r={type:t,value:e},s=o.getTokens(n);if(null!=i&&s.length)for(var a=0,l=0;l<s.length;l++){var c=s[l];if(i<=(a+=c.value.length)){var h=c.value.length-(a-i),d=c.value.slice(0,h),u=c.value.slice(h);s.splice(l,1,{type:c.type,value:d},r,{type:c.type,value:u});break}}else s.push(r);this.updateLines(n,n)},e.prototype.removeExtraToken=function(e,t){this.session.bgTokenizer.lines[e]=null,this.updateLines(e,e)},e.prototype.setTheme=function(e,t){var n=this;if(this.$themeId=e,n._dispatchEvent("themeChange",{theme:e}),e&&"string"!=typeof e)r(e);else{var i=e||this.$options.theme.initialValue;s.loadModule(["theme",i],r)}function r(i){if(n.$themeId!=e)return t&&t();if(!i||!i.cssClass)throw new Error("couldn't load module "+e+" or it didn't call define");i.$id&&(n.$themeId=i.$id),o.importCssString(i.cssText,i.cssClass,n.container),n.theme&&o.removeCssClass(n.container,n.theme.cssClass);var r="padding"in i?i.padding:"padding"in(n.theme||{})?4:n.$padding;n.$padding&&r!=n.$padding&&n.setPadding(r),n.$theme=i.cssClass,n.theme=i,o.addCssClass(n.container,i.cssClass),o.setCssClass(n.container,"ace_dark",i.isDark),n.$size&&(n.$size.width=0,n.$updateSizeAsync()),n._dispatchEvent("themeLoaded",{theme:i}),t&&t()}},e.prototype.getTheme=function(){return this.$themeId},e.prototype.setStyle=function(e,t){o.setCssClass(this.container,e,!1!==t)},e.prototype.unsetStyle=function(e){o.removeCssClass(this.container,e)},e.prototype.setCursorStyle=function(e){o.setStyle(this.scroller.style,"cursor",e)},e.prototype.setMouseCursor=function(e){o.setStyle(this.scroller.style,"cursor",e)},e.prototype.attachToShadowRoot=function(){o.importCssString(w,"ace_editor.css",this.container)},e.prototype.destroy=function(){this.freeze(),this.$fontMetrics.destroy(),this.$cursorLayer.destroy(),this.removeAllListeners(),this.container.textContent="",this.setOption("useResizeObserver",!1)},e.prototype.$updateCustomScrollbar=function(e){var t=this;this.$horizScroll=this.$vScroll=null,this.scrollBarV.element.remove(),this.scrollBarH.element.remove(),this.$scrollDecorator&&delete this.$scrollDecorator,!0===e?(this.scrollBarV=new g(this.container,this),this.scrollBarH=new p(this.container,this),this.scrollBarV.setHeight(this.$size.scrollerHeight),this.scrollBarH.setWidth(this.$size.scrollerWidth),this.scrollBarV.addEventListener("scroll",(function(e){t.$scrollAnimation||t.session.setScrollTop(e.data-t.scrollMargin.top)})),this.scrollBarH.addEventListener("scroll",(function(e){t.$scrollAnimation||t.session.setScrollLeft(e.data-t.scrollMargin.left)})),this.$scrollDecorator=new b(this.scrollBarV,this),this.$scrollDecorator.$updateDecorators()):(this.scrollBarV=new u(this.container,this),this.scrollBarH=new d(this.container,this),this.scrollBarV.addEventListener("scroll",(function(e){t.$scrollAnimation||t.session.setScrollTop(e.data-t.scrollMargin.top)})),this.scrollBarH.addEventListener("scroll",(function(e){t.$scrollAnimation||t.session.setScrollLeft(e.data-t.scrollMargin.left)})))},e.prototype.$addResizeObserver=function(){if(window.ResizeObserver&&!this.$resizeObserver){var e=this;this.$resizeTimer=r.delayedCall((function(){e.destroyed||e.onResize()}),50),this.$resizeObserver=new window.ResizeObserver((function(t){var n=t[0].contentRect.width,i=t[0].contentRect.height;Math.abs(e.$size.width-n)>1||Math.abs(e.$size.height-i)>1?e.$resizeTimer.delay():e.$resizeTimer.cancel()})),this.$resizeObserver.observe(this.container)}},e}();C.prototype.CHANGE_CURSOR=1,C.prototype.CHANGE_MARKER=2,C.prototype.CHANGE_GUTTER=4,C.prototype.CHANGE_SCROLL=8,C.prototype.CHANGE_LINES=16,C.prototype.CHANGE_TEXT=32,C.prototype.CHANGE_SIZE=64,C.prototype.CHANGE_MARKER_BACK=128,C.prototype.CHANGE_MARKER_FRONT=256,C.prototype.CHANGE_FULL=512,C.prototype.CHANGE_H_SCROLL=1024,C.prototype.$changes=0,C.prototype.$padding=null,C.prototype.$frozen=!1,C.prototype.STEPS=8,i.implement(C.prototype,v),s.defineOptions(C.prototype,"renderer",{useResizeObserver:{set:function(e){!e&&this.$resizeObserver?(this.$resizeObserver.disconnect(),this.$resizeTimer.cancel(),this.$resizeTimer=this.$resizeObserver=null):e&&!this.$resizeObserver&&this.$addResizeObserver()}},animatedScroll:{initialValue:!1},showInvisibles:{set:function(e){this.$textLayer.setShowInvisibles(e)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!1},showPrintMargin:{set:function(){this.$updatePrintMargin()},initialValue:!0},printMarginColumn:{set:function(){this.$updatePrintMargin()},initialValue:80},printMargin:{set:function(e){"number"==typeof e&&(this.$printMarginColumn=e),this.$showPrintMargin=!!e,this.$updatePrintMargin()},get:function(){return this.$showPrintMargin&&this.$printMarginColumn}},showGutter:{set:function(e){this.$gutter.style.display=e?"block":"none",this.$loop.schedule(this.CHANGE_FULL),this.onGutterResize()},initialValue:!0},useSvgGutterIcons:{set:function(e){this.$gutterLayer.$useSvgGutterIcons=e},initialValue:!1},showFoldedAnnotations:{set:function(e){this.$gutterLayer.$showFoldedAnnotations=e},initialValue:!1},fadeFoldWidgets:{set:function(e){o.setCssClass(this.$gutter,"ace_fade-fold-widgets",e)},initialValue:!1},showFoldWidgets:{set:function(e){this.$gutterLayer.setShowFoldWidgets(e),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},displayIndentGuides:{set:function(e){this.$textLayer.setDisplayIndentGuides(e)&&this.$loop.schedule(this.CHANGE_TEXT)},initialValue:!0},highlightIndentGuides:{set:function(e){1==this.$textLayer.setHighlightIndentGuides(e)?this.$textLayer.$highlightIndentGuide():this.$textLayer.$clearActiveIndentGuide(this.$textLayer.$lines.cells)},initialValue:!0},highlightGutterLine:{set:function(e){this.$gutterLayer.setHighlightGutterLine(e),this.$loop.schedule(this.CHANGE_GUTTER)},initialValue:!0},hScrollBarAlwaysVisible:{set:function(e){this.$hScrollBarAlwaysVisible&&this.$horizScroll||this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},vScrollBarAlwaysVisible:{set:function(e){this.$vScrollBarAlwaysVisible&&this.$vScroll||this.$loop.schedule(this.CHANGE_SCROLL)},initialValue:!1},fontSize:{set:function(e){"number"==typeof e&&(e+="px"),this.container.style.fontSize=e,this.updateFontSize()},initialValue:12},fontFamily:{set:function(e){this.container.style.fontFamily=e,this.updateFontSize()}},maxLines:{set:function(e){this.updateFull()}},minLines:{set:function(e){this.$minLines<562949953421311||(this.$minLines=0),this.updateFull()}},maxPixelHeight:{set:function(e){this.updateFull()},initialValue:0},scrollPastEnd:{set:function(e){e=+e||0,this.$scrollPastEnd!=e&&(this.$scrollPastEnd=e,this.$loop.schedule(this.CHANGE_SCROLL))},initialValue:0,handlesSet:!0},fixedWidthGutter:{set:function(e){this.$gutterLayer.$fixedWidth=!!e,this.$loop.schedule(this.CHANGE_GUTTER)}},customScrollbar:{set:function(e){this.$updateCustomScrollbar(e)},initialValue:!1},theme:{set:function(e){this.setTheme(e)},get:function(){return this.$themeId||this.theme},initialValue:"./theme/textmate",handlesSet:!0},hasCssTransforms:{},useTextareaForIME:{initialValue:!y.isMobile&&!y.isIE}}),t.VirtualRenderer=C})),ace.define("ace/worker/worker_client",["require","exports","module","ace/lib/oop","ace/lib/net","ace/lib/event_emitter","ace/config"],(function(e,t,n){"use strict";var i=e("../lib/oop"),o=e("../lib/net"),r=e("../lib/event_emitter").EventEmitter,s=e("../config");function a(e){if("undefined"==typeof Worker)return{postMessage:function(){},terminate:function(){}};if(s.get("loadWorkerFromBlob")){var t=function(e){var t="importScripts('"+o.qualifyURL(e)+"');";try{return new Blob([t],{type:"application/javascript"})}catch(e){var n=new(window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder);return n.append(t),n.getBlob("application/javascript")}}(e),n=(window.URL||window.webkitURL).createObjectURL(t);return new Worker(n)}return new Worker(e)}var l=function(e){e.postMessage||(e=this.$createWorkerFromOldConfig.apply(this,arguments)),this.$worker=e,this.$sendDeltaQueue=this.$sendDeltaQueue.bind(this),this.changeListener=this.changeListener.bind(this),this.onMessage=this.onMessage.bind(this),this.callbackId=1,this.callbacks={},this.$worker.onmessage=this.onMessage};(function(){i.implement(this,r),this.$createWorkerFromOldConfig=function(t,n,i,o,r){if(e.nameToUrl&&!e.toUrl&&(e.toUrl=e.nameToUrl),s.get("packaged")||!e.toUrl)o=o||s.moduleUrl(n,"worker");else{var l=this.$normalizePath;o=o||l(e.toUrl("ace/worker/worker.js",null,"_"));var c={};t.forEach((function(t){c[t]=l(e.toUrl(t,null,"_").replace(/(\.js)?(\?.*)?$/,""))}))}return this.$worker=a(o),r&&this.send("importScripts",r),this.$worker.postMessage({init:!0,tlns:c,module:n,classname:i}),this.$worker},this.onMessage=function(e){var t=e.data;switch(t.type){case"event":this._signal(t.name,{data:t.data});break;case"call":var n=this.callbacks[t.id];n&&(n(t.data),delete this.callbacks[t.id]);break;case"error":this.reportError(t.data);break;case"log":window.console&&console.log&&console.log.apply(console,t.data)}},this.reportError=function(e){window.console&&console.error&&console.error(e)},this.$normalizePath=function(e){return o.qualifyURL(e)},this.terminate=function(){this._signal("terminate",{}),this.deltaQueue=null,this.$worker.terminate(),this.$worker.onerror=function(e){e.preventDefault()},this.$worker=null,this.$doc&&this.$doc.off("change",this.changeListener),this.$doc=null},this.send=function(e,t){this.$worker.postMessage({command:e,args:t})},this.call=function(e,t,n){if(n){var i=this.callbackId++;this.callbacks[i]=n,t.push(i)}this.send(e,t)},this.emit=function(e,t){try{t.data&&t.data.err&&(t.data.err={message:t.data.err.message,stack:t.data.err.stack,code:t.data.err.code}),this.$worker&&this.$worker.postMessage({event:e,data:{data:t.data}})}catch(e){console.error(e.stack)}},this.attachToDocument=function(e){this.$doc&&this.terminate(),this.$doc=e,this.call("setValue",[e.getValue()]),e.on("change",this.changeListener,!0)},this.changeListener=function(e){this.deltaQueue||(this.deltaQueue=[],setTimeout(this.$sendDeltaQueue,0)),"insert"==e.action?this.deltaQueue.push(e.start,e.lines):this.deltaQueue.push(e.start,e.end)},this.$sendDeltaQueue=function(){var e=this.deltaQueue;e&&(this.deltaQueue=null,e.length>50&&e.length>this.$doc.getLength()>>1?this.call("setValue",[this.$doc.getValue()]):this.emit("change",{data:e}))}}).call(l.prototype),t.UIWorkerClient=function(e,t,n){var i=null,o=!1,a=Object.create(r),c=[],h=new l({messageBuffer:c,terminate:function(){},postMessage:function(e){c.push(e),i&&(o?setTimeout(d):d())}});h.setEmitSync=function(e){o=e};var d=function(){var e=c.shift();e.command?i[e.command].apply(i,e.args):e.event&&a._signal(e.event,e.data)};return a.postMessage=function(e){h.onMessage({data:e})},a.callback=function(e,t){this.postMessage({type:"call",id:t,data:e})},a.emit=function(e,t){this.postMessage({type:"event",name:e,data:t})},s.loadModule(["worker",t],(function(e){for(i=new e[n](a);c.length;)d()})),h},t.WorkerClient=l,t.createWorker=a})),ace.define("ace/placeholder",["require","exports","module","ace/range","ace/lib/event_emitter","ace/lib/oop"],(function(e,t,n){"use strict";var i=e("./range").Range,o=e("./lib/event_emitter").EventEmitter,r=e("./lib/oop"),s=function(){function e(e,t,n,i,o,r){var s=this;this.length=t,this.session=e,this.doc=e.getDocument(),this.mainClass=o,this.othersClass=r,this.$onUpdate=this.onUpdate.bind(this),this.doc.on("change",this.$onUpdate,!0),this.$others=i,this.$onCursorChange=function(){setTimeout((function(){s.onCursorChange()}))},this.$pos=n;var a=e.getUndoManager().$undoStack||e.getUndoManager().$undostack||{length:-1};this.$undoStackDepth=a.length,this.setup(),e.selection.on("changeCursor",this.$onCursorChange)}return e.prototype.setup=function(){var e=this,t=this.doc,n=this.session;this.selectionBefore=n.selection.toJSON(),n.selection.inMultiSelectMode&&n.selection.toSingleRange(),this.pos=t.createAnchor(this.$pos.row,this.$pos.column);var o=this.pos;o.$insertRight=!0,o.detach(),o.markerId=n.addMarker(new i(o.row,o.column,o.row,o.column+this.length),this.mainClass,null,!1),this.others=[],this.$others.forEach((function(n){var i=t.createAnchor(n.row,n.column);i.$insertRight=!0,i.detach(),e.others.push(i)})),n.setUndoSelect(!1)},e.prototype.showOtherMarkers=function(){if(!this.othersActive){var e=this.session,t=this;this.othersActive=!0,this.others.forEach((function(n){n.markerId=e.addMarker(new i(n.row,n.column,n.row,n.column+t.length),t.othersClass,null,!1)}))}},e.prototype.hideOtherMarkers=function(){if(this.othersActive){this.othersActive=!1;for(var e=0;e<this.others.length;e++)this.session.removeMarker(this.others[e].markerId)}},e.prototype.onUpdate=function(e){if(this.$updating)return this.updateAnchors(e);var t=e;if(t.start.row===t.end.row&&t.start.row===this.pos.row){this.$updating=!0;var n="insert"===e.action?t.end.column-t.start.column:t.start.column-t.end.column,o=t.start.column>=this.pos.column&&t.start.column<=this.pos.column+this.length+1,r=t.start.column-this.pos.column;if(this.updateAnchors(e),o&&(this.length+=n),o&&!this.session.$fromUndo)if("insert"===e.action)for(var s=this.others.length-1;s>=0;s--){var a={row:(l=this.others[s]).row,column:l.column+r};this.doc.insertMergedLines(a,e.lines)}else if("remove"===e.action)for(s=this.others.length-1;s>=0;s--){var l;a={row:(l=this.others[s]).row,column:l.column+r},this.doc.remove(new i(a.row,a.column,a.row,a.column-n))}this.$updating=!1,this.updateMarkers()}},e.prototype.updateAnchors=function(e){this.pos.onChange(e);for(var t=this.others.length;t--;)this.others[t].onChange(e);this.updateMarkers()},e.prototype.updateMarkers=function(){if(!this.$updating){var e=this,t=this.session,n=function(n,o){t.removeMarker(n.markerId),n.markerId=t.addMarker(new i(n.row,n.column,n.row,n.column+e.length),o,null,!1)};n(this.pos,this.mainClass);for(var o=this.others.length;o--;)n(this.others[o],this.othersClass)}},e.prototype.onCursorChange=function(e){if(!this.$updating&&this.session){var t=this.session.selection.getCursor();t.row===this.pos.row&&t.column>=this.pos.column&&t.column<=this.pos.column+this.length?(this.showOtherMarkers(),this._emit("cursorEnter",e)):(this.hideOtherMarkers(),this._emit("cursorLeave",e))}},e.prototype.detach=function(){this.session.removeMarker(this.pos&&this.pos.markerId),this.hideOtherMarkers(),this.doc.off("change",this.$onUpdate),this.session.selection.off("changeCursor",this.$onCursorChange),this.session.setUndoSelect(!0),this.session=null},e.prototype.cancel=function(){if(-1!==this.$undoStackDepth){for(var e=this.session.getUndoManager(),t=(e.$undoStack||e.$undostack).length-this.$undoStackDepth,n=0;n<t;n++)e.undo(this.session,!0);this.selectionBefore&&this.session.selection.fromJSON(this.selectionBefore)}},e}();r.implement(s.prototype,o),t.PlaceHolder=s})),ace.define("ace/mouse/multi_select_handler",["require","exports","module","ace/lib/event","ace/lib/useragent"],(function(e,t,n){var i=e("../lib/event"),o=e("../lib/useragent");function r(e,t){return e.row==t.row&&e.column==t.column}t.onMouseDown=function(e){var t=e.domEvent,n=t.altKey,s=t.shiftKey,a=t.ctrlKey,l=e.getAccelKey(),c=e.getButton();if(a&&o.isMac&&(c=t.button),e.editor.inMultiSelectMode&&2==c)e.editor.textInput.onContextMenu(e.domEvent);else if(a||n||l){if(0===c){var h,d=e.editor,u=d.selection,p=d.inMultiSelectMode,g=e.getDocumentPosition(),f=u.getCursor(),m=e.inSelection()||u.isEmpty()&&r(g,f),v=e.x,w=e.y,b=d.session,y=d.renderer.pixelToScreenCoordinates(v,w),C=y;if(d.$mouseHandler.$enableJumpToDef)a&&n||l&&n?h=s?"block":"add":n&&d.$blockSelectEnabled&&(h="block");else if(l&&!n){if(h="add",!p&&s)return}else n&&d.$blockSelectEnabled&&(h="block");if(h&&o.isMac&&t.ctrlKey&&d.$mouseHandler.cancelContextMenu(),"add"==h){if(!p&&m)return;if(!p){var $=u.toOrientedRange();d.addSelectionMarker($)}var x=u.rangeList.rangeAtPoint(g);d.inVirtualSelectionMode=!0,s&&(x=null,$=u.ranges[0]||$,d.removeSelectionMarker($)),d.once("mouseup",(function(){var e=u.toOrientedRange();x&&e.isEmpty()&&r(x.cursor,e.cursor)?u.substractPoint(e.cursor):(s?u.substractPoint($.cursor):$&&(d.removeSelectionMarker($),u.addRange($)),u.addRange(e)),d.inVirtualSelectionMode=!1}))}else if("block"==h){var _;e.stop(),d.inVirtualSelectionMode=!0;var S=[],E=function(){var e=d.renderer.pixelToScreenCoordinates(v,w),t=b.screenToDocumentPosition(e.row,e.column,e.offsetX);r(C,e)&&r(t,u.lead)||(C=e,d.selection.moveToPosition(t),d.renderer.scrollCursorIntoView(),d.removeSelectionMarkers(S),S=u.rectangularRangeBlock(C,y),d.$mouseHandler.$clickSelection&&1==S.length&&S[0].isEmpty()&&(S[0]=d.$mouseHandler.$clickSelection.clone()),S.forEach(d.addSelectionMarker,d),d.updateSelectionMarkers())};p&&!l?u.toSingleRange():!p&&l&&(_=u.toOrientedRange(),d.addSelectionMarker(_)),s?y=b.documentToScreenPosition(u.lead):u.moveToPosition(g),C={row:-1,column:-1};var k=E;i.capture(d.container,(function(e){v=e.clientX,w=e.clientY}),(function(e){E(),clearInterval(A),d.removeSelectionMarkers(S),S.length||(S=[u.toOrientedRange()]),_&&(d.removeSelectionMarker(_),u.toSingleRange(_));for(var t=0;t<S.length;t++)u.addRange(S[t]);d.inVirtualSelectionMode=!1,d.$mouseHandler.$clickSelection=null}));var A=setInterval((function(){k()}),20);return e.preventDefault()}}}else 0===c&&e.editor.inMultiSelectMode&&e.editor.exitMultiSelectMode()}})),ace.define("ace/commands/multi_select_commands",["require","exports","module","ace/keyboard/hash_handler"],(function(e,t,n){t.defaultCommands=[{name:"addCursorAbove",description:"Add cursor above",exec:function(e){e.selectMoreLines(-1)},bindKey:{win:"Ctrl-Alt-Up",mac:"Ctrl-Alt-Up"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorBelow",description:"Add cursor below",exec:function(e){e.selectMoreLines(1)},bindKey:{win:"Ctrl-Alt-Down",mac:"Ctrl-Alt-Down"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorAboveSkipCurrent",description:"Add cursor above (skip current)",exec:function(e){e.selectMoreLines(-1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Up",mac:"Ctrl-Alt-Shift-Up"},scrollIntoView:"cursor",readOnly:!0},{name:"addCursorBelowSkipCurrent",description:"Add cursor below (skip current)",exec:function(e){e.selectMoreLines(1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Down",mac:"Ctrl-Alt-Shift-Down"},scrollIntoView:"cursor",readOnly:!0},{name:"selectMoreBefore",description:"Select more before",exec:function(e){e.selectMore(-1)},bindKey:{win:"Ctrl-Alt-Left",mac:"Ctrl-Alt-Left"},scrollIntoView:"cursor",readOnly:!0},{name:"selectMoreAfter",description:"Select more after",exec:function(e){e.selectMore(1)},bindKey:{win:"Ctrl-Alt-Right",mac:"Ctrl-Alt-Right"},scrollIntoView:"cursor",readOnly:!0},{name:"selectNextBefore",description:"Select next before",exec:function(e){e.selectMore(-1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Left",mac:"Ctrl-Alt-Shift-Left"},scrollIntoView:"cursor",readOnly:!0},{name:"selectNextAfter",description:"Select next after",exec:function(e){e.selectMore(1,!0)},bindKey:{win:"Ctrl-Alt-Shift-Right",mac:"Ctrl-Alt-Shift-Right"},scrollIntoView:"cursor",readOnly:!0},{name:"toggleSplitSelectionIntoLines",description:"Split selection into lines",exec:function(e){e.multiSelect.rangeCount>1?e.multiSelect.joinSelections():e.multiSelect.splitIntoLines()},bindKey:{win:"Ctrl-Alt-L",mac:"Ctrl-Alt-L"},readOnly:!0},{name:"splitSelectionIntoLines",description:"Split into lines",exec:function(e){e.multiSelect.splitIntoLines()},readOnly:!0},{name:"alignCursors",description:"Align cursors",exec:function(e){e.alignCursors()},bindKey:{win:"Ctrl-Alt-A",mac:"Ctrl-Alt-A"},scrollIntoView:"cursor"},{name:"findAll",description:"Find all",exec:function(e){e.findAll()},bindKey:{win:"Ctrl-Alt-K",mac:"Ctrl-Alt-G"},scrollIntoView:"cursor",readOnly:!0}],t.multiSelectCommands=[{name:"singleSelection",description:"Single selection",bindKey:"esc",exec:function(e){e.exitMultiSelectMode()},scrollIntoView:"cursor",readOnly:!0,isAvailable:function(e){return e&&e.inMultiSelectMode}}];var i=e("../keyboard/hash_handler").HashHandler;t.keyboardHandler=new i(t.multiSelectCommands)})),ace.define("ace/multi_select",["require","exports","module","ace/range_list","ace/range","ace/selection","ace/mouse/multi_select_handler","ace/lib/event","ace/lib/lang","ace/commands/multi_select_commands","ace/search","ace/edit_session","ace/editor","ace/config"],(function(e,t,n){var i=e("./range_list").RangeList,o=e("./range").Range,r=e("./selection").Selection,s=e("./mouse/multi_select_handler").onMouseDown,a=e("./lib/event"),l=e("./lib/lang"),c=e("./commands/multi_select_commands");t.commands=c.defaultCommands.concat(c.multiSelectCommands);var h=new(0,e("./search").Search),d=e("./edit_session").EditSession;(function(){this.getSelectionMarkers=function(){return this.$selectionMarkers}}).call(d.prototype),function(){this.ranges=null,this.rangeList=null,this.addRange=function(e,t){if(e){if(!this.inMultiSelectMode&&0===this.rangeCount){var n=this.toOrientedRange();if(this.rangeList.add(n),this.rangeList.add(e),2!=this.rangeList.ranges.length)return this.rangeList.removeAll(),t||this.fromOrientedRange(e);this.rangeList.removeAll(),this.rangeList.add(n),this.$onAddRange(n)}e.cursor||(e.cursor=e.end);var i=this.rangeList.add(e);return this.$onAddRange(e),i.length&&this.$onRemoveRange(i),this.rangeCount>1&&!this.inMultiSelectMode&&(this._signal("multiSelect"),this.inMultiSelectMode=!0,this.session.$undoSelect=!1,this.rangeList.attach(this.session)),t||this.fromOrientedRange(e)}},this.toSingleRange=function(e){e=e||this.ranges[0];var t=this.rangeList.removeAll();t.length&&this.$onRemoveRange(t),e&&this.fromOrientedRange(e)},this.substractPoint=function(e){var t=this.rangeList.substractPoint(e);if(t)return this.$onRemoveRange(t),t[0]},this.mergeOverlappingRanges=function(){var e=this.rangeList.merge();e.length&&this.$onRemoveRange(e)},this.$onAddRange=function(e){this.rangeCount=this.rangeList.ranges.length,this.ranges.unshift(e),this._signal("addRange",{range:e})},this.$onRemoveRange=function(e){if(this.rangeCount=this.rangeList.ranges.length,1==this.rangeCount&&this.inMultiSelectMode){var t=this.rangeList.ranges.pop();e.push(t),this.rangeCount=0}for(var n=e.length;n--;){var i=this.ranges.indexOf(e[n]);this.ranges.splice(i,1)}this._signal("removeRange",{ranges:e}),0===this.rangeCount&&this.inMultiSelectMode&&(this.inMultiSelectMode=!1,this._signal("singleSelect"),this.session.$undoSelect=!0,this.rangeList.detach(this.session)),(t=t||this.ranges[0])&&!t.isEqual(this.getRange())&&this.fromOrientedRange(t)},this.$initRangeList=function(){this.rangeList||(this.rangeList=new i,this.ranges=[],this.rangeCount=0)},this.getAllRanges=function(){return this.rangeCount?this.rangeList.ranges.concat():[this.getRange()]},this.splitIntoLines=function(){for(var e=this.ranges.length?this.ranges:[this.getRange()],t=[],n=0;n<e.length;n++){var i=e[n],r=i.start.row,s=i.end.row;if(r===s)t.push(i.clone());else{for(t.push(new o(r,i.start.column,r,this.session.getLine(r).length));++r<s;)t.push(this.getLineRange(r,!0));t.push(new o(s,0,s,i.end.column))}0!=n||this.isBackwards()||(t=t.reverse())}for(this.toSingleRange(),n=t.length;n--;)this.addRange(t[n])},this.joinSelections=function(){var e=this.rangeList.ranges,t=e[e.length-1],n=o.fromPoints(e[0].start,t.end);this.toSingleRange(),this.setSelectionRange(n,t.cursor==t.start)},this.toggleBlockSelection=function(){if(this.rangeCount>1){var e=this.rangeList.ranges,t=e[e.length-1],n=o.fromPoints(e[0].start,t.end);this.toSingleRange(),this.setSelectionRange(n,t.cursor==t.start)}else{var i=this.session.documentToScreenPosition(this.cursor),r=this.session.documentToScreenPosition(this.anchor);this.rectangularRangeBlock(i,r).forEach(this.addRange,this)}},this.rectangularRangeBlock=function(e,t,n){var i=[],r=e.column<t.column;if(r)var s=e.column,a=t.column,l=e.offsetX,c=t.offsetX;else s=t.column,a=e.column,l=t.offsetX,c=e.offsetX;var h,d,u,p=e.row<t.row;if(p)var g=e.row,f=t.row;else g=t.row,f=e.row;s<0&&(s=0),g<0&&(g=0),g==f&&(n=!0);for(var m=g;m<=f;m++){var v=o.fromPoints(this.session.screenToDocumentPosition(m,s,l),this.session.screenToDocumentPosition(m,a,c));if(v.isEmpty()){if(h&&(u=h,(d=v.end).row==u.row&&d.column==u.column))break;h=v.end}v.cursor=r?v.start:v.end,i.push(v)}if(p&&i.reverse(),!n){for(var w=i.length-1;i[w].isEmpty()&&w>0;)w--;if(w>0)for(var b=0;i[b].isEmpty();)b++;for(var y=w;y>=b;y--)i[y].isEmpty()&&i.splice(y,1)}return i}}.call(r.prototype);var u=e("./editor").Editor;function p(e){e.$multiselectOnSessionChange||(e.$onAddRange=e.$onAddRange.bind(e),e.$onRemoveRange=e.$onRemoveRange.bind(e),e.$onMultiSelect=e.$onMultiSelect.bind(e),e.$onSingleSelect=e.$onSingleSelect.bind(e),e.$multiselectOnSessionChange=t.onSessionChange.bind(e),e.$checkMultiselectChange=e.$checkMultiselectChange.bind(e),e.$multiselectOnSessionChange(e),e.on("changeSession",e.$multiselectOnSessionChange),e.on("mousedown",s),e.commands.addCommands(c.defaultCommands),function(e){if(e.textInput){var t=e.textInput.getElement(),n=!1;a.addListener(t,"keydown",(function(t){var o=18==t.keyCode&&!(t.ctrlKey||t.shiftKey||t.metaKey);e.$blockSelectEnabled&&o?n||(e.renderer.setMouseCursor("crosshair"),n=!0):n&&i()}),e),a.addListener(t,"keyup",i,e),a.addListener(t,"blur",i,e)}function i(t){n&&(e.renderer.setMouseCursor(""),n=!1)}}(e))}(function(){this.updateSelectionMarkers=function(){this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.addSelectionMarker=function(e){e.cursor||(e.cursor=e.end);var t=this.getSelectionStyle();return e.marker=this.session.addMarker(e,"ace_selection",t),this.session.$selectionMarkers.push(e),this.session.selectionMarkerCount=this.session.$selectionMarkers.length,e},this.removeSelectionMarker=function(e){if(e.marker){this.session.removeMarker(e.marker);var t=this.session.$selectionMarkers.indexOf(e);-1!=t&&this.session.$selectionMarkers.splice(t,1),this.session.selectionMarkerCount=this.session.$selectionMarkers.length}},this.removeSelectionMarkers=function(e){for(var t=this.session.$selectionMarkers,n=e.length;n--;){var i=e[n];if(i.marker){this.session.removeMarker(i.marker);var o=t.indexOf(i);-1!=o&&t.splice(o,1)}}this.session.selectionMarkerCount=t.length},this.$onAddRange=function(e){this.addSelectionMarker(e.range),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onRemoveRange=function(e){this.removeSelectionMarkers(e.ranges),this.renderer.updateCursor(),this.renderer.updateBackMarkers()},this.$onMultiSelect=function(e){this.inMultiSelectMode||(this.inMultiSelectMode=!0,this.setStyle("ace_multiselect"),this.keyBinding.addKeyboardHandler(c.keyboardHandler),this.commands.setDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers())},this.$onSingleSelect=function(e){this.session.multiSelect.inVirtualMode||(this.inMultiSelectMode=!1,this.unsetStyle("ace_multiselect"),this.keyBinding.removeKeyboardHandler(c.keyboardHandler),this.commands.removeDefaultHandler("exec",this.$onMultiSelectExec),this.renderer.updateCursor(),this.renderer.updateBackMarkers(),this._emit("changeSelection"))},this.$onMultiSelectExec=function(e){var t=e.command,n=e.editor;if(n.multiSelect){if(t.multiSelectAction)"forEach"==t.multiSelectAction?i=n.forEachSelection(t,e.args):"forEachLine"==t.multiSelectAction?i=n.forEachSelection(t,e.args,!0):"single"==t.multiSelectAction?(n.exitMultiSelectMode(),i=t.exec(n,e.args||{})):i=t.multiSelectAction(n,e.args||{});else{var i=t.exec(n,e.args||{});n.multiSelect.addRange(n.multiSelect.toOrientedRange()),n.multiSelect.mergeOverlappingRanges()}return i}},this.forEachSelection=function(e,t,n){if(!this.inVirtualSelectionMode){var i,o=n&&n.keepOrder,s=1==n||n&&n.$byLines,a=this.session,l=this.selection,c=l.rangeList,h=(o?l:c).ranges;if(!h.length)return e.exec?e.exec(this,t||{}):e(this,t||{});var d=l._eventRegistry;l._eventRegistry={};var u=new r(a);this.inVirtualSelectionMode=!0;for(var p=h.length;p--;){if(s)for(;p>0&&h[p].start.row==h[p-1].end.row;)p--;u.fromOrientedRange(h[p]),u.index=p,this.selection=a.selection=u;var g=e.exec?e.exec(this,t||{}):e(this,t||{});i||void 0===g||(i=g),u.toOrientedRange(h[p])}u.detach(),this.selection=a.selection=l,this.inVirtualSelectionMode=!1,l._eventRegistry=d,l.mergeOverlappingRanges(),l.ranges[0]&&l.fromOrientedRange(l.ranges[0]);var f=this.renderer.$scrollAnimation;return this.onCursorChange(),this.onSelectionChange(),f&&f.from==f.to&&this.renderer.animateScrolling(f.from),i}},this.exitMultiSelectMode=function(){this.inMultiSelectMode&&!this.inVirtualSelectionMode&&this.multiSelect.toSingleRange()},this.getSelectedText=function(){var e="";if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){for(var t=this.multiSelect.rangeList.ranges,n=[],i=0;i<t.length;i++)n.push(this.session.getTextRange(t[i]));var o=this.session.getDocument().getNewLineCharacter();(e=n.join(o)).length==(n.length-1)*o.length&&(e="")}else this.selection.isEmpty()||(e=this.session.getTextRange(this.getSelectionRange()));return e},this.$checkMultiselectChange=function(e,t){if(this.inMultiSelectMode&&!this.inVirtualSelectionMode){var n=this.multiSelect.ranges[0];if(this.multiSelect.isEmpty()&&t==this.multiSelect.anchor)return;var i=t==this.multiSelect.anchor?n.cursor==n.start?n.end:n.start:n.cursor;i.row!=t.row||this.session.$clipPositionToDocument(i.row,i.column).column!=t.column?this.multiSelect.toSingleRange(this.multiSelect.toOrientedRange()):this.multiSelect.mergeOverlappingRanges()}},this.findAll=function(e,t,n){if((t=t||{}).needle=e||t.needle,null==t.needle){var i=this.selection.isEmpty()?this.selection.getWordRange():this.selection.getRange();t.needle=this.session.getTextRange(i)}this.$search.set(t);var o=this.$search.findAll(this.session);if(!o.length)return 0;var r=this.multiSelect;n||r.toSingleRange(o[0]);for(var s=o.length;s--;)r.addRange(o[s],!0);return i&&r.rangeList.rangeAtPoint(i.start)&&r.addRange(i,!0),o.length},this.selectMoreLines=function(e,t){var n=this.selection.toOrientedRange(),i=n.cursor==n.end,r=this.session.documentToScreenPosition(n.cursor);this.selection.$desiredColumn&&(r.column=this.selection.$desiredColumn);var s,a=this.session.screenToDocumentPosition(r.row+e,r.column);if(n.isEmpty())c=a;else var l=this.session.documentToScreenPosition(i?n.end:n.start),c=this.session.screenToDocumentPosition(l.row+e,l.column);if(i?(s=o.fromPoints(a,c)).cursor=s.start:(s=o.fromPoints(c,a)).cursor=s.end,s.desiredColumn=r.column,this.selection.inMultiSelectMode){if(t)var h=n.cursor}else this.selection.addRange(n);this.selection.addRange(s),h&&this.selection.substractPoint(h)},this.transposeSelections=function(e){for(var t=this.session,n=t.multiSelect,i=n.ranges,o=i.length;o--;)if((a=i[o]).isEmpty()){var r=t.getWordRange(a.start.row,a.start.column);a.start.row=r.start.row,a.start.column=r.start.column,a.end.row=r.end.row,a.end.column=r.end.column}n.mergeOverlappingRanges();var s=[];for(o=i.length;o--;){var a=i[o];s.unshift(t.getTextRange(a))}for(e<0?s.unshift(s.pop()):s.push(s.shift()),o=i.length;o--;)r=(a=i[o]).clone(),t.replace(a,s[o]),a.start.row=r.start.row,a.start.column=r.start.column;n.fromOrientedRange(n.ranges[0])},this.selectMore=function(e,t,n){var i=this.session,o=i.multiSelect.toOrientedRange();if(!o.isEmpty()||((o=i.getWordRange(o.start.row,o.start.column)).cursor=-1==e?o.start:o.end,this.multiSelect.addRange(o),!n)){var r=i.getTextRange(o),s=function(e,t,n){return h.$options.wrap=!0,h.$options.needle=t,h.$options.backwards=-1==n,h.find(e)}(i,r,e);s&&(s.cursor=-1==e?s.start:s.end,this.session.unfold(s),this.multiSelect.addRange(s),this.renderer.scrollCursorIntoView(null,.5)),t&&this.multiSelect.substractPoint(o.cursor)}},this.alignCursors=function(){var e=this.session,t=e.multiSelect,n=t.ranges,i=-1,r=n.filter((function(e){if(e.cursor.row==i)return!0;i=e.cursor.row}));if(n.length&&r.length!=n.length-1){r.forEach((function(e){t.substractPoint(e.cursor)}));var s=0,a=1/0,c=n.map((function(t){var n=t.cursor,i=e.getLine(n.row).substr(n.column).search(/\S/g);return-1==i&&(i=0),n.column>s&&(s=n.column),i<a&&(a=i),i}));n.forEach((function(t,n){var i=t.cursor,r=s-i.column,h=c[n]-a;r>h?e.insert(i,l.stringRepeat(" ",r-h)):e.remove(new o(i.row,i.column,i.row,i.column-r+h)),t.start.column=t.end.column=s,t.start.row=t.end.row=i.row,t.cursor=t.end})),t.fromOrientedRange(n[0]),this.renderer.updateCursor(),this.renderer.updateBackMarkers()}else{var h=this.selection.getRange(),d=h.start.row,u=h.end.row,p=d==u;if(p){var g,f=this.session.getLength();do{g=this.session.getLine(u)}while(/[=:]/.test(g)&&++u<f);do{g=this.session.getLine(d)}while(/[=:]/.test(g)&&--d>0);d<0&&(d=0),u>=f&&(u=f-1)}var m=this.session.removeFullLines(d,u);m=this.$reAlignText(m,p),this.session.insert({row:d,column:0},m.join("\n")+"\n"),p||(h.start.column=0,h.end.column=m[m.length-1].length),this.selection.setRange(h)}},this.$reAlignText=function(e,t){var n,i,o,r=!0,s=!0;return e.map((function(e){var t=e.match(/(\s*)(.*?)(\s*)([=:].*)/);return t?null==n?(n=t[1].length,i=t[2].length,o=t[3].length,t):(n+i+o!=t[1].length+t[2].length+t[3].length&&(s=!1),n!=t[1].length&&(r=!1),n>t[1].length&&(n=t[1].length),i<t[2].length&&(i=t[2].length),o>t[3].length&&(o=t[3].length),t):[e]})).map(t?c:r?s?function(e){return e[2]?a(n+i-e[2].length)+e[2]+a(o)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}:c:function(e){return e[2]?a(n)+e[2]+a(o)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]});function a(e){return l.stringRepeat(" ",e)}function c(e){return e[2]?a(n)+e[2]+a(i-e[2].length+o)+e[4].replace(/^([=:])\s+/,"$1 "):e[0]}}}).call(u.prototype),t.onSessionChange=function(e){var t=e.session;t&&!t.multiSelect&&(t.$selectionMarkers=[],t.selection.$initRangeList(),t.multiSelect=t.selection),this.multiSelect=t&&t.multiSelect;var n=e.oldSession;n&&(n.multiSelect.off("addRange",this.$onAddRange),n.multiSelect.off("removeRange",this.$onRemoveRange),n.multiSelect.off("multiSelect",this.$onMultiSelect),n.multiSelect.off("singleSelect",this.$onSingleSelect),n.multiSelect.lead.off("change",this.$checkMultiselectChange),n.multiSelect.anchor.off("change",this.$checkMultiselectChange)),t&&(t.multiSelect.on("addRange",this.$onAddRange),t.multiSelect.on("removeRange",this.$onRemoveRange),t.multiSelect.on("multiSelect",this.$onMultiSelect),t.multiSelect.on("singleSelect",this.$onSingleSelect),t.multiSelect.lead.on("change",this.$checkMultiselectChange),t.multiSelect.anchor.on("change",this.$checkMultiselectChange)),t&&this.inMultiSelectMode!=t.selection.inMultiSelectMode&&(t.selection.inMultiSelectMode?this.$onMultiSelect():this.$onSingleSelect())},t.MultiSelect=p,e("./config").defineOptions(u.prototype,"editor",{enableMultiselect:{set:function(e){p(this),e?this.on("mousedown",s):this.off("mousedown",s)},value:!0},enableBlockSelect:{set:function(e){this.$blockSelectEnabled=e},value:!0}})})),ace.define("ace/mode/folding/fold_mode",["require","exports","module","ace/range"],(function(e,t,n){"use strict";var i=e("../../range").Range,o=t.FoldMode=function(){};(function(){this.foldingStartMarker=null,this.foldingStopMarker=null,this.getFoldWidget=function(e,t,n){var i=e.getLine(n);return this.foldingStartMarker.test(i)?"start":"markbeginend"==t&&this.foldingStopMarker&&this.foldingStopMarker.test(i)?"end":""},this.getFoldWidgetRange=function(e,t,n){return null},this.indentationBlock=function(e,t,n){var o=/\S/,r=e.getLine(t),s=r.search(o);if(-1!=s){for(var a=n||r.length,l=e.getLength(),c=t,h=t;++t<l;){var d=e.getLine(t).search(o);if(-1!=d){if(d<=s){var u=e.getTokenAt(t,0);if(!u||"string"!==u.type)break}h=t}}if(h>c){var p=e.getLine(h).length;return new i(c,a,h,p)}}},this.openingBracketBlock=function(e,t,n,o,r){var s={row:n,column:o+1},a=e.$findClosingBracket(t,s,r);if(a){var l=e.foldWidgets[a.row];return null==l&&(l=e.getFoldWidget(a.row)),"start"==l&&a.row>s.row&&(a.row--,a.column=e.getLine(a.row).length),i.fromPoints(s,a)}},this.closingBracketBlock=function(e,t,n,o,r){var s={row:n,column:o},a=e.$findOpeningBracket(t,s);if(a)return a.column++,s.column--,i.fromPoints(a,s)}}).call(o.prototype)})),ace.define("ace/ext/error_marker",["require","exports","module","ace/line_widgets","ace/lib/dom","ace/range","ace/config"],(function(e,t,n){"use strict";var i=e("../line_widgets").LineWidgets,o=e("../lib/dom"),r=e("../range").Range,s=e("../config").nls;t.showErrorMarker=function(e,t){var n=e.session;n.widgetManager||(n.widgetManager=new i(n),n.widgetManager.attach(e));var a=e.getCursorPosition(),l=a.row,c=n.widgetManager.getWidgetsAtRow(l).filter((function(e){return"errorMarker"==e.type}))[0];c?c.destroy():l-=t;var h,d=function(e,t,n){var i=e.getAnnotations().sort(r.comparePoints);if(i.length){var o=function(e,t,n){for(var i=0,o=e.length-1;i<=o;){var r=i+o>>1,s=n(t,e[r]);if(s>0)i=r+1;else{if(!(s<0))return r;o=r-1}}return-(i+1)}(i,{row:t,column:-1},r.comparePoints);o<0&&(o=-o-1),o>=i.length?o=n>0?0:i.length-1:0===o&&n<0&&(o=i.length-1);var s=i[o];if(s&&n){if(s.row===t){do{s=i[o+=n]}while(s&&s.row===t);if(!s)return i.slice()}var a=[];t=s.row;do{a[n<0?"unshift":"push"](s),s=i[o+=n]}while(s&&s.row==t);return a.length&&a}}}(n,l,t);if(d){var u=d[0];a.column=(u.pos&&"number"!=typeof u.column?u.pos.sc:u.column)||0,a.row=u.row,h=e.renderer.$gutterLayer.$annotations[a.row]}else{if(c)return;h={text:[s("Looks good!")],className:"ace_ok"}}e.session.unfold(a.row),e.selection.moveToPosition(a);var p={row:a.row,fixedWidth:!0,coverGutter:!0,el:o.createElement("div"),type:"errorMarker"},g=p.el.appendChild(o.createElement("div")),f=p.el.appendChild(o.createElement("div"));f.className="error_widget_arrow "+h.className;var m=e.renderer.$cursorLayer.getPixelPosition(a).left;f.style.left=m+e.renderer.gutterWidth-5+"px",p.el.className="error_widget_wrapper",g.className="error_widget "+h.className,g.innerHTML=h.text.join("<br>"),g.appendChild(o.createElement("div"));var v=function(e,t,n){if(0===t&&("esc"===n||"return"===n))return p.destroy(),{command:"null"}};p.destroy=function(){e.$mouseHandler.isMousePressed||(e.keyBinding.removeKeyboardHandler(v),n.widgetManager.removeLineWidget(p),e.off("changeSelection",p.destroy),e.off("changeSession",p.destroy),e.off("mouseup",p.destroy),e.off("change",p.destroy))},e.keyBinding.addKeyboardHandler(v),e.on("changeSelection",p.destroy),e.on("changeSession",p.destroy),e.on("mouseup",p.destroy),e.on("change",p.destroy),e.session.widgetManager.addLineWidget(p),p.el.onmousedown=e.focus.bind(e),e.renderer.scrollCursorIntoView(null,.5,{bottom:p.el.offsetHeight})},o.importCssString("\n .error_widget_wrapper {\n background: inherit;\n color: inherit;\n border:none\n }\n .error_widget {\n border-top: solid 2px;\n border-bottom: solid 2px;\n margin: 5px 0;\n padding: 10px 40px;\n white-space: pre-wrap;\n }\n .error_widget.ace_error, .error_widget_arrow.ace_error{\n border-color: #ff5a5a\n }\n .error_widget.ace_warning, .error_widget_arrow.ace_warning{\n border-color: #F1D817\n }\n .error_widget.ace_info, .error_widget_arrow.ace_info{\n border-color: #5a5a5a\n }\n .error_widget.ace_ok, .error_widget_arrow.ace_ok{\n border-color: #5aaa5a\n }\n .error_widget_arrow {\n position: absolute;\n border: solid 5px;\n border-top-color: transparent!important;\n border-right-color: transparent!important;\n border-left-color: transparent!important;\n top: -5px;\n }\n","error_marker.css",!1)})),ace.define("ace/ace",["require","exports","module","ace/lib/dom","ace/range","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/multi_select","ace/mode/folding/fold_mode","ace/theme/textmate","ace/ext/error_marker","ace/config","ace/loader_build"],(function(e,t,n){"use strict";e("./loader_build")(t);var i=e("./lib/dom"),o=e("./range").Range,r=e("./editor").Editor,s=e("./edit_session").EditSession,a=e("./undomanager").UndoManager,l=e("./virtual_renderer").VirtualRenderer;e("./worker/worker_client"),e("./keyboard/hash_handler"),e("./placeholder"),e("./multi_select"),e("./mode/folding/fold_mode"),e("./theme/textmate"),e("./ext/error_marker"),t.config=e("./config"),t.edit=function(e,n){if("string"==typeof e){var o=e;if(!(e=document.getElementById(o)))throw new Error("ace.edit can't find div #"+o)}if(e&&e.env&&e.env.editor instanceof r)return e.env.editor;var s="";if(e&&/input|textarea/i.test(e.tagName)){var a=e;s=a.value,e=i.createElement("pre"),a.parentNode.replaceChild(e,a)}else e&&(s=e.textContent,e.innerHTML="");var c=t.createEditSession(s),h=new r(new l(e),c,n),d={document:c,editor:h,onResize:h.resize.bind(h,null)};return a&&(d.textarea=a),h.on("destroy",(function(){d.editor.container.env=null})),h.container.env=h.env=d,h},t.createEditSession=function(e,t){var n=new s(e,t);return n.setUndoManager(new a),n},t.Range=o,t.Editor=r,t.EditSession=s,t.UndoManager=a,t.VirtualRenderer=l,t.version=t.config.version})),ace.require(["ace/ace"],(function(t){t&&(t.config.init(!0),t.define=ace.define);var n=function(){return this}();for(var i in n||"undefined"==typeof window||(n=window),n||"undefined"==typeof self||(n=self),n.ace||(n.ace=t),t)t.hasOwnProperty(i)&&(n.ace[i]=t[i]);n.ace.default=n.ace,e&&(e.exports=n.ace)}))},3083:(e,t,n)=>{e=n.nmd(e),ace.define("ace/split",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/lib/event_emitter","ace/editor","ace/virtual_renderer","ace/edit_session"],(function(e,t,n){"use strict";var i=e("./lib/oop"),o=(e("./lib/lang"),e("./lib/event_emitter").EventEmitter),r=e("./editor").Editor,s=e("./virtual_renderer").VirtualRenderer,a=e("./edit_session").EditSession,l=function(e,t,n){this.BELOW=1,this.BESIDE=0,this.$container=e,this.$theme=t,this.$splits=0,this.$editorCSS="",this.$editors=[],this.$orientation=this.BESIDE,this.setSplits(n||1),this.$cEditor=this.$editors[0],this.on("focus",function(e){this.$cEditor=e}.bind(this))};(function(){i.implement(this,o),this.$createEditor=function(){var e=document.createElement("div");e.className=this.$editorCSS,e.style.cssText="position: absolute; top:0px; bottom:0px",this.$container.appendChild(e);var t=new r(new s(e,this.$theme));return t.on("focus",function(){this._emit("focus",t)}.bind(this)),this.$editors.push(t),t.setFontSize(this.$fontSize),t},this.setSplits=function(e){var t;if(e<1)throw"The number of splits have to be > 0!";if(e!=this.$splits){if(e>this.$splits){for(;this.$splits<this.$editors.length&&this.$splits<e;)t=this.$editors[this.$splits],this.$container.appendChild(t.container),t.setFontSize(this.$fontSize),this.$splits++;for(;this.$splits<e;)this.$createEditor(),this.$splits++}else for(;this.$splits>e;)t=this.$editors[this.$splits-1],this.$container.removeChild(t.container),this.$splits--;this.resize()}},this.getSplits=function(){return this.$splits},this.getEditor=function(e){return this.$editors[e]},this.getCurrentEditor=function(){return this.$cEditor},this.focus=function(){this.$cEditor.focus()},this.blur=function(){this.$cEditor.blur()},this.setTheme=function(e){this.$editors.forEach((function(t){t.setTheme(e)}))},this.setKeyboardHandler=function(e){this.$editors.forEach((function(t){t.setKeyboardHandler(e)}))},this.forEach=function(e,t){this.$editors.forEach(e,t)},this.$fontSize="",this.setFontSize=function(e){this.$fontSize=e,this.forEach((function(t){t.setFontSize(e)}))},this.$cloneSession=function(e){var t=new a(e.getDocument(),e.getMode()),n=e.getUndoManager();return t.setUndoManager(n),t.setTabSize(e.getTabSize()),t.setUseSoftTabs(e.getUseSoftTabs()),t.setOverwrite(e.getOverwrite()),t.setBreakpoints(e.getBreakpoints()),t.setUseWrapMode(e.getUseWrapMode()),t.setUseWorker(e.getUseWorker()),t.setWrapLimitRange(e.$wrapLimitRange.min,e.$wrapLimitRange.max),t.$foldData=e.$cloneFoldData(),t},this.setSession=function(e,t){var n;n=null==t?this.$cEditor:this.$editors[t];var i=this.$editors.some((function(t){return t.session===e}));return i&&(e=this.$cloneSession(e)),n.setSession(e),e},this.getOrientation=function(){return this.$orientation},this.setOrientation=function(e){this.$orientation!=e&&(this.$orientation=e,this.resize())},this.resize=function(){var e,t=this.$container.clientWidth,n=this.$container.clientHeight;if(this.$orientation==this.BESIDE)for(var i=t/this.$splits,o=0;o<this.$splits;o++)(e=this.$editors[o]).container.style.width=i+"px",e.container.style.top="0px",e.container.style.left=o*i+"px",e.container.style.height=n+"px",e.resize();else{var r=n/this.$splits;for(o=0;o<this.$splits;o++)(e=this.$editors[o]).container.style.width=t+"px",e.container.style.top=o*r+"px",e.container.style.left="0px",e.container.style.height=r+"px",e.resize()}}}).call(l.prototype),t.Split=l})),ace.define("ace/ext/split",["require","exports","module","ace/split"],(function(e,t,n){"use strict";n.exports=e("../split")})),ace.require(["ace/ext/split"],(function(t){e&&(e.exports=t)}))},1549:(e,t,n)=>{e=n.nmd(e),ace.define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"],(function(e,t,n){"use strict";var i=e("../lib/oop"),o=(e("../lib/lang"),e("./text_highlight_rules").TextHighlightRules),r=t.supportType="align-content|align-items|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|border|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|bottom|box-shadow|box-sizing|caption-side|clear|clip|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|cursor|direction|display|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|font|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|hanging-punctuation|height|justify-content|left|letter-spacing|line-height|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|max-height|max-width|max-zoom|min-height|min-width|min-zoom|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|order|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page-break-after|page-break-before|page-break-inside|perspective|perspective-origin|position|quotes|resize|right|tab-size|table-layout|text-align|text-align-last|text-decoration|text-decoration-color|text-decoration-line|text-decoration-style|text-indent|text-justify|text-overflow|text-shadow|text-transform|top|transform|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|user-select|user-zoom|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index",s=t.supportFunction="rgb|rgba|url|attr|counter|counters",a=t.supportConstant="absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|flex-end|flex-start|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero|zoom",l=t.supportConstantColor="aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen",c=t.supportConstantFonts="arial|century|comic|courier|cursive|fantasy|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace",h=t.numRe="\\-?(?:(?:[0-9]+(?:\\.[0-9]+)?)|(?:\\.[0-9]+))",d=t.pseudoElements="(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b",u=t.pseudoClasses="(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b",p=function(){var e=this.createKeywordMapper({"support.function":s,"support.constant":a,"support.type":r,"support.constant.color":l,"support.constant.fonts":c},"text",!0);this.$rules={start:[{include:["strings","url","comments"]},{token:"paren.lparen",regex:"\\{",next:"ruleset"},{token:"paren.rparen",regex:"\\}"},{token:"string",regex:"@(?!viewport)",next:"media"},{token:"keyword",regex:"#[a-z0-9-_]+"},{token:"keyword",regex:"%"},{token:"variable",regex:"\\.[a-z0-9-_]+"},{token:"string",regex:":[a-z0-9-_]+"},{token:"constant.numeric",regex:h},{token:"constant",regex:"[a-z0-9-_]+"},{caseInsensitive:!0}],media:[{include:["strings","url","comments"]},{token:"paren.lparen",regex:"\\{",next:"start"},{token:"paren.rparen",regex:"\\}",next:"start"},{token:"string",regex:";",next:"start"},{token:"keyword",regex:"(?:media|supports|document|charset|import|namespace|media|supports|document|page|font|keyframes|viewport|counter-style|font-feature-values|swash|ornaments|annotation|stylistic|styleset|character-variant)"}],comments:[{token:"comment",regex:"\\/\\*",push:[{token:"comment",regex:"\\*\\/",next:"pop"},{defaultToken:"comment"}]}],ruleset:[{regex:"-(webkit|ms|moz|o)-",token:"text"},{token:"punctuation.operator",regex:"[:;]"},{token:"paren.rparen",regex:"\\}",next:"start"},{include:["strings","url","comments"]},{token:["constant.numeric","keyword"],regex:"("+h+")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vmax|vmin|vm|vw|%)"},{token:"constant.numeric",regex:h},{token:"constant.numeric",regex:"#[a-f0-9]{6}"},{token:"constant.numeric",regex:"#[a-f0-9]{3}"},{token:["punctuation","entity.other.attribute-name.pseudo-element.css"],regex:d},{token:["punctuation","entity.other.attribute-name.pseudo-class.css"],regex:u},{include:"url"},{token:e,regex:"\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"},{caseInsensitive:!0}],url:[{token:"support.function",regex:"(?:url(:?-prefix)?|domain|regexp)\\(",push:[{token:"support.function",regex:"\\)",next:"pop"},{defaultToken:"string"}]}],strings:[{token:"string.start",regex:"'",push:[{token:"string.end",regex:"'|$",next:"pop"},{include:"escapes"},{token:"constant.language.escape",regex:/\\$/,consumeLineEnd:!0},{defaultToken:"string"}]},{token:"string.start",regex:'"',push:[{token:"string.end",regex:'"|$',next:"pop"},{include:"escapes"},{token:"constant.language.escape",regex:/\\$/,consumeLineEnd:!0},{defaultToken:"string"}]}],escapes:[{token:"constant.language.escape",regex:/\\([a-fA-F\d]{1,6}|[^a-fA-F\d])/}]},this.normalizeRules()};i.inherits(p,o),t.CssHighlightRules=p})),ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],(function(e,t,n){"use strict";var i=e("../range").Range,o=function(){};(function(){this.checkOutdent=function(e,t){return!!/^\s+$/.test(e)&&/^\s*\}/.test(t)},this.autoOutdent=function(e,t){var n=e.getLine(t).match(/^(\s*\})/);if(!n)return 0;var o=n[1].length,r=e.findMatchingBracket({row:t,column:o});if(!r||r.row==t)return 0;var s=this.$getIndent(e.getLine(r.row));e.replace(new i(t,0,t,o-1),s)},this.$getIndent=function(e){return e.match(/^\s*/)[0]}}).call(o.prototype),t.MatchingBraceOutdent=o})),ace.define("ace/mode/css_completions",["require","exports","module"],(function(e,t,n){"use strict";var i={background:{"#$0":1},"background-color":{"#$0":1,transparent:1,fixed:1},"background-image":{"url('/$0')":1},"background-repeat":{repeat:1,"repeat-x":1,"repeat-y":1,"no-repeat":1,inherit:1},"background-position":{bottom:2,center:2,left:2,right:2,top:2,inherit:2},"background-attachment":{scroll:1,fixed:1},"background-size":{cover:1,contain:1},"background-clip":{"border-box":1,"padding-box":1,"content-box":1},"background-origin":{"border-box":1,"padding-box":1,"content-box":1},border:{"solid $0":1,"dashed $0":1,"dotted $0":1,"#$0":1},"border-color":{"#$0":1},"border-style":{solid:2,dashed:2,dotted:2,double:2,groove:2,hidden:2,inherit:2,inset:2,none:2,outset:2,ridged:2},"border-collapse":{collapse:1,separate:1},bottom:{px:1,em:1,"%":1},clear:{left:1,right:1,both:1,none:1},color:{"#$0":1,"rgb(#$00,0,0)":1},cursor:{default:1,pointer:1,move:1,text:1,wait:1,help:1,progress:1,"n-resize":1,"ne-resize":1,"e-resize":1,"se-resize":1,"s-resize":1,"sw-resize":1,"w-resize":1,"nw-resize":1},display:{none:1,block:1,inline:1,"inline-block":1,"table-cell":1},"empty-cells":{show:1,hide:1},float:{left:1,right:1,none:1},"font-family":{Arial:2,"Comic Sans MS":2,Consolas:2,"Courier New":2,Courier:2,Georgia:2,Monospace:2,"Sans-Serif":2,"Segoe UI":2,Tahoma:2,"Times New Roman":2,"Trebuchet MS":2,Verdana:1},"font-size":{px:1,em:1,"%":1},"font-weight":{bold:1,normal:1},"font-style":{italic:1,normal:1},"font-variant":{normal:1,"small-caps":1},height:{px:1,em:1,"%":1},left:{px:1,em:1,"%":1},"letter-spacing":{normal:1},"line-height":{normal:1},"list-style-type":{none:1,disc:1,circle:1,square:1,decimal:1,"decimal-leading-zero":1,"lower-roman":1,"upper-roman":1,"lower-greek":1,"lower-latin":1,"upper-latin":1,georgian:1,"lower-alpha":1,"upper-alpha":1},margin:{px:1,em:1,"%":1},"margin-right":{px:1,em:1,"%":1},"margin-left":{px:1,em:1,"%":1},"margin-top":{px:1,em:1,"%":1},"margin-bottom":{px:1,em:1,"%":1},"max-height":{px:1,em:1,"%":1},"max-width":{px:1,em:1,"%":1},"min-height":{px:1,em:1,"%":1},"min-width":{px:1,em:1,"%":1},overflow:{hidden:1,visible:1,auto:1,scroll:1},"overflow-x":{hidden:1,visible:1,auto:1,scroll:1},"overflow-y":{hidden:1,visible:1,auto:1,scroll:1},padding:{px:1,em:1,"%":1},"padding-top":{px:1,em:1,"%":1},"padding-right":{px:1,em:1,"%":1},"padding-bottom":{px:1,em:1,"%":1},"padding-left":{px:1,em:1,"%":1},"page-break-after":{auto:1,always:1,avoid:1,left:1,right:1},"page-break-before":{auto:1,always:1,avoid:1,left:1,right:1},position:{absolute:1,relative:1,fixed:1,static:1},right:{px:1,em:1,"%":1},"table-layout":{fixed:1,auto:1},"text-decoration":{none:1,underline:1,"line-through":1,blink:1},"text-align":{left:1,right:1,center:1,justify:1},"text-transform":{capitalize:1,uppercase:1,lowercase:1,none:1},top:{px:1,em:1,"%":1},"vertical-align":{top:1,bottom:1},visibility:{hidden:1,visible:1},"white-space":{nowrap:1,normal:1,pre:1,"pre-line":1,"pre-wrap":1},width:{px:1,em:1,"%":1},"word-spacing":{normal:1},filter:{"alpha(opacity=$0100)":1},"text-shadow":{"$02px 2px 2px #777":1},"text-overflow":{"ellipsis-word":1,clip:1,ellipsis:1},"-moz-border-radius":1,"-moz-border-radius-topright":1,"-moz-border-radius-bottomright":1,"-moz-border-radius-topleft":1,"-moz-border-radius-bottomleft":1,"-webkit-border-radius":1,"-webkit-border-top-right-radius":1,"-webkit-border-top-left-radius":1,"-webkit-border-bottom-right-radius":1,"-webkit-border-bottom-left-radius":1,"-moz-box-shadow":1,"-webkit-box-shadow":1,transform:{"rotate($00deg)":1,"skew($00deg)":1},"-moz-transform":{"rotate($00deg)":1,"skew($00deg)":1},"-webkit-transform":{"rotate($00deg)":1,"skew($00deg)":1}},o=function(){};(function(){this.completionsDefined=!1,this.defineCompletions=function(){if(document){var e=document.createElement("c").style;for(var t in e)if("string"==typeof e[t]){var n=t.replace(/[A-Z]/g,(function(e){return"-"+e.toLowerCase()}));i.hasOwnProperty(n)||(i[n]=1)}}this.completionsDefined=!0},this.getCompletions=function(e,t,n,i){if(this.completionsDefined||this.defineCompletions(),"ruleset"===e||"ace/mode/scss"==t.$mode.$id){var o=t.getLine(n.row).substr(0,n.column),r=/\([^)]*$/.test(o);return r&&(o=o.substr(o.lastIndexOf("(")+1)),/:[^;]+$/.test(o)?(/([\w\-]+):[^:]*$/.test(o),this.getPropertyValueCompletions(e,t,n,i)):this.getPropertyCompletions(e,t,n,i,r)}return[]},this.getPropertyCompletions=function(e,t,n,o,r){return r=r||!1,Object.keys(i).map((function(e){return{caption:e,snippet:e+": $0"+(r?"":";"),meta:"property",score:1e6}}))},this.getPropertyValueCompletions=function(e,t,n,o){var r=t.getLine(n.row).substr(0,n.column),s=(/([\w\-]+):[^:]*$/.exec(r)||{})[1];if(!s)return[];var a=[];return s in i&&"object"==typeof i[s]&&(a=Object.keys(i[s])),a.map((function(e){return{caption:e,snippet:e,meta:"property value",score:1e6}}))}}).call(o.prototype),t.CssCompletions=o})),ace.define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"],(function(e,t,n){"use strict";var i=e("../../lib/oop"),o=(e("../behaviour").Behaviour,e("./cstyle").CstyleBehaviour),r=e("../../token_iterator").TokenIterator,s=function(){this.inherit(o),this.add("colon","insertion",(function(e,t,n,i,o){if(":"===o&&n.selection.isEmpty()){var s=n.getCursorPosition(),a=new r(i,s.row,s.column),l=a.getCurrentToken();if(l&&l.value.match(/\s+/)&&(l=a.stepBackward()),l&&"support.type"===l.type){var c=i.doc.getLine(s.row);if(":"===c.substring(s.column,s.column+1))return{text:"",selection:[1,1]};if(/^(\s+[^;]|\s*$)/.test(c.substring(s.column)))return{text:":;",selection:[1,1]}}}})),this.add("colon","deletion",(function(e,t,n,i,o){var s=i.doc.getTextRange(o);if(!o.isMultiLine()&&":"===s){var a=n.getCursorPosition(),l=new r(i,a.row,a.column),c=l.getCurrentToken();if(c&&c.value.match(/\s+/)&&(c=l.stepBackward()),c&&"support.type"===c.type&&";"===i.doc.getLine(o.start.row).substring(o.end.column,o.end.column+1))return o.end.column++,o}})),this.add("semicolon","insertion",(function(e,t,n,i,o){if(";"===o&&n.selection.isEmpty()){var r=n.getCursorPosition();if(";"===i.doc.getLine(r.row).substring(r.column,r.column+1))return{text:"",selection:[1,1]}}})),this.add("!important","insertion",(function(e,t,n,i,o){if("!"===o&&n.selection.isEmpty()){var r=n.getCursorPosition(),s=i.doc.getLine(r.row);if(/^\s*(;|}|$)/.test(s.substring(r.column)))return{text:"!important",selection:[10,10]}}}))};i.inherits(s,o),t.CssBehaviour=s})),ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],(function(e,t,n){"use strict";var i=e("../../lib/oop"),o=e("../../range").Range,r=e("./fold_mode").FoldMode,s=t.FoldMode=function(e){e&&(this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+e.start)),this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+e.end)))};i.inherits(s,r),function(){this.foldingStartMarker=/([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/,this.foldingStopMarker=/^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/,this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/,this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/,this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/,this._getFoldWidgetBase=this.getFoldWidget,this.getFoldWidget=function(e,t,n){var i=e.getLine(n);if(this.singleLineBlockCommentRe.test(i)&&!this.startRegionRe.test(i)&&!this.tripleStarBlockCommentRe.test(i))return"";var o=this._getFoldWidgetBase(e,t,n);return!o&&this.startRegionRe.test(i)?"start":o},this.getFoldWidgetRange=function(e,t,n,i){var o,r=e.getLine(n);if(this.startRegionRe.test(r))return this.getCommentRegionBlock(e,r,n);if(o=r.match(this.foldingStartMarker)){var s=o.index;if(o[1])return this.openingBracketBlock(e,o[1],n,s);var a=e.getCommentFoldRange(n,s+o[0].length,1);return a&&!a.isMultiLine()&&(i?a=this.getSectionRange(e,n):"all"!=t&&(a=null)),a}return"markbegin"!==t&&(o=r.match(this.foldingStopMarker))?(s=o.index+o[0].length,o[1]?this.closingBracketBlock(e,o[1],n,s):e.getCommentFoldRange(n,s,-1)):void 0},this.getSectionRange=function(e,t){for(var n=e.getLine(t),i=n.search(/\S/),r=t,s=n.length,a=t+=1,l=e.getLength();++t<l;){var c=(n=e.getLine(t)).search(/\S/);if(-1!==c){if(i>c)break;var h=this.getFoldWidgetRange(e,"all",t);if(h){if(h.start.row<=r)break;if(h.isMultiLine())t=h.end.row;else if(i==c)break}a=t}}return new o(r,s,a,e.getLine(a).length)},this.getCommentRegionBlock=function(e,t,n){for(var i=t.search(/\s*$/),r=e.getLength(),s=n,a=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/,l=1;++n<r;){t=e.getLine(n);var c=a.exec(t);if(c&&(c[1]?l--:l++,!l))break}if(n>s)return new o(s,i,n,t.length)}}.call(s.prototype)})),ace.define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/css_completions","ace/mode/behaviour/css","ace/mode/folding/cstyle"],(function(e,t,n){"use strict";var i=e("../lib/oop"),o=e("./text").Mode,r=e("./css_highlight_rules").CssHighlightRules,s=e("./matching_brace_outdent").MatchingBraceOutdent,a=e("../worker/worker_client").WorkerClient,l=e("./css_completions").CssCompletions,c=e("./behaviour/css").CssBehaviour,h=e("./folding/cstyle").FoldMode,d=function(){this.HighlightRules=r,this.$outdent=new s,this.$behaviour=new c,this.$completer=new l,this.foldingRules=new h};i.inherits(d,o),function(){this.foldingRules="cStyle",this.blockComment={start:"/*",end:"*/"},this.getNextLineIndent=function(e,t,n){var i=this.$getIndent(t),o=this.getTokenizer().getLineTokens(t,e).tokens;return o.length&&"comment"==o[o.length-1].type||t.match(/^.*\{\s*$/)&&(i+=n),i},this.checkOutdent=function(e,t,n){return this.$outdent.checkOutdent(t,n)},this.autoOutdent=function(e,t,n){this.$outdent.autoOutdent(t,n)},this.getCompletions=function(e,t,n,i){return this.$completer.getCompletions(e,t,n,i)},this.createWorker=function(e){var t=new a(["ace"],"ace/mode/css_worker","Worker");return t.attachToDocument(e.getDocument()),t.on("annotate",(function(t){e.setAnnotations(t.data)})),t.on("terminate",(function(){e.clearAnnotations()})),t},this.$id="ace/mode/css",this.snippetFileId="ace/snippets/css"}.call(d.prototype),t.Mode=d})),ace.require(["ace/mode/css"],(function(t){e&&(e.exports=t)}))},7466:(e,t,n)=>{e=n.nmd(e),ace.define("ace/snippets/css.snippets",["require","exports","module"],(function(e,t,n){n.exports="snippet .\n\t${1} {\n\t\t${2}\n\t}\nsnippet !\n\t !important\nsnippet bdi:m+\n\t-moz-border-image: url(${1}) ${2:0} ${3:0} ${4:0} ${5:0} ${6:stretch} ${7:stretch};\nsnippet bdi:m\n\t-moz-border-image: ${1};\nsnippet bdrz:m\n\t-moz-border-radius: ${1};\nsnippet bxsh:m+\n\t-moz-box-shadow: ${1:0} ${2:0} ${3:0} #${4:000};\nsnippet bxsh:m\n\t-moz-box-shadow: ${1};\nsnippet bdi:w+\n\t-webkit-border-image: url(${1}) ${2:0} ${3:0} ${4:0} ${5:0} ${6:stretch} ${7:stretch};\nsnippet bdi:w\n\t-webkit-border-image: ${1};\nsnippet bdrz:w\n\t-webkit-border-radius: ${1};\nsnippet bxsh:w+\n\t-webkit-box-shadow: ${1:0} ${2:0} ${3:0} #${4:000};\nsnippet bxsh:w\n\t-webkit-box-shadow: ${1};\nsnippet @f\n\t@font-face {\n\t\tfont-family: ${1};\n\t\tsrc: url(${2});\n\t}\nsnippet @i\n\t@import url(${1});\nsnippet @m\n\t@media ${1:print} {\n\t\t${2}\n\t}\nsnippet bg+\n\tbackground: #${1:FFF} url(${2}) ${3:0} ${4:0} ${5:no-repeat};\nsnippet bga\n\tbackground-attachment: ${1};\nsnippet bga:f\n\tbackground-attachment: fixed;\nsnippet bga:s\n\tbackground-attachment: scroll;\nsnippet bgbk\n\tbackground-break: ${1};\nsnippet bgbk:bb\n\tbackground-break: bounding-box;\nsnippet bgbk:c\n\tbackground-break: continuous;\nsnippet bgbk:eb\n\tbackground-break: each-box;\nsnippet bgcp\n\tbackground-clip: ${1};\nsnippet bgcp:bb\n\tbackground-clip: border-box;\nsnippet bgcp:cb\n\tbackground-clip: content-box;\nsnippet bgcp:nc\n\tbackground-clip: no-clip;\nsnippet bgcp:pb\n\tbackground-clip: padding-box;\nsnippet bgc\n\tbackground-color: #${1:FFF};\nsnippet bgc:t\n\tbackground-color: transparent;\nsnippet bgi\n\tbackground-image: url(${1});\nsnippet bgi:n\n\tbackground-image: none;\nsnippet bgo\n\tbackground-origin: ${1};\nsnippet bgo:bb\n\tbackground-origin: border-box;\nsnippet bgo:cb\n\tbackground-origin: content-box;\nsnippet bgo:pb\n\tbackground-origin: padding-box;\nsnippet bgpx\n\tbackground-position-x: ${1};\nsnippet bgpy\n\tbackground-position-y: ${1};\nsnippet bgp\n\tbackground-position: ${1:0} ${2:0};\nsnippet bgr\n\tbackground-repeat: ${1};\nsnippet bgr:n\n\tbackground-repeat: no-repeat;\nsnippet bgr:x\n\tbackground-repeat: repeat-x;\nsnippet bgr:y\n\tbackground-repeat: repeat-y;\nsnippet bgr:r\n\tbackground-repeat: repeat;\nsnippet bgz\n\tbackground-size: ${1};\nsnippet bgz:a\n\tbackground-size: auto;\nsnippet bgz:ct\n\tbackground-size: contain;\nsnippet bgz:cv\n\tbackground-size: cover;\nsnippet bg\n\tbackground: ${1};\nsnippet bg:ie\n\tfilter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='${1}',sizingMethod='${2:crop}');\nsnippet bg:n\n\tbackground: none;\nsnippet bd+\n\tborder: ${1:1px} ${2:solid} #${3:000};\nsnippet bdb+\n\tborder-bottom: ${1:1px} ${2:solid} #${3:000};\nsnippet bdbc\n\tborder-bottom-color: #${1:000};\nsnippet bdbi\n\tborder-bottom-image: url(${1});\nsnippet bdbi:n\n\tborder-bottom-image: none;\nsnippet bdbli\n\tborder-bottom-left-image: url(${1});\nsnippet bdbli:c\n\tborder-bottom-left-image: continue;\nsnippet bdbli:n\n\tborder-bottom-left-image: none;\nsnippet bdblrz\n\tborder-bottom-left-radius: ${1};\nsnippet bdbri\n\tborder-bottom-right-image: url(${1});\nsnippet bdbri:c\n\tborder-bottom-right-image: continue;\nsnippet bdbri:n\n\tborder-bottom-right-image: none;\nsnippet bdbrrz\n\tborder-bottom-right-radius: ${1};\nsnippet bdbs\n\tborder-bottom-style: ${1};\nsnippet bdbs:n\n\tborder-bottom-style: none;\nsnippet bdbw\n\tborder-bottom-width: ${1};\nsnippet bdb\n\tborder-bottom: ${1};\nsnippet bdb:n\n\tborder-bottom: none;\nsnippet bdbk\n\tborder-break: ${1};\nsnippet bdbk:c\n\tborder-break: close;\nsnippet bdcl\n\tborder-collapse: ${1};\nsnippet bdcl:c\n\tborder-collapse: collapse;\nsnippet bdcl:s\n\tborder-collapse: separate;\nsnippet bdc\n\tborder-color: #${1:000};\nsnippet bdci\n\tborder-corner-image: url(${1});\nsnippet bdci:c\n\tborder-corner-image: continue;\nsnippet bdci:n\n\tborder-corner-image: none;\nsnippet bdf\n\tborder-fit: ${1};\nsnippet bdf:c\n\tborder-fit: clip;\nsnippet bdf:of\n\tborder-fit: overwrite;\nsnippet bdf:ow\n\tborder-fit: overwrite;\nsnippet bdf:r\n\tborder-fit: repeat;\nsnippet bdf:sc\n\tborder-fit: scale;\nsnippet bdf:sp\n\tborder-fit: space;\nsnippet bdf:st\n\tborder-fit: stretch;\nsnippet bdi\n\tborder-image: url(${1}) ${2:0} ${3:0} ${4:0} ${5:0} ${6:stretch} ${7:stretch};\nsnippet bdi:n\n\tborder-image: none;\nsnippet bdl+\n\tborder-left: ${1:1px} ${2:solid} #${3:000};\nsnippet bdlc\n\tborder-left-color: #${1:000};\nsnippet bdli\n\tborder-left-image: url(${1});\nsnippet bdli:n\n\tborder-left-image: none;\nsnippet bdls\n\tborder-left-style: ${1};\nsnippet bdls:n\n\tborder-left-style: none;\nsnippet bdlw\n\tborder-left-width: ${1};\nsnippet bdl\n\tborder-left: ${1};\nsnippet bdl:n\n\tborder-left: none;\nsnippet bdlt\n\tborder-length: ${1};\nsnippet bdlt:a\n\tborder-length: auto;\nsnippet bdrz\n\tborder-radius: ${1};\nsnippet bdr+\n\tborder-right: ${1:1px} ${2:solid} #${3:000};\nsnippet bdrc\n\tborder-right-color: #${1:000};\nsnippet bdri\n\tborder-right-image: url(${1});\nsnippet bdri:n\n\tborder-right-image: none;\nsnippet bdrs\n\tborder-right-style: ${1};\nsnippet bdrs:n\n\tborder-right-style: none;\nsnippet bdrw\n\tborder-right-width: ${1};\nsnippet bdr\n\tborder-right: ${1};\nsnippet bdr:n\n\tborder-right: none;\nsnippet bdsp\n\tborder-spacing: ${1};\nsnippet bds\n\tborder-style: ${1};\nsnippet bds:ds\n\tborder-style: dashed;\nsnippet bds:dtds\n\tborder-style: dot-dash;\nsnippet bds:dtdtds\n\tborder-style: dot-dot-dash;\nsnippet bds:dt\n\tborder-style: dotted;\nsnippet bds:db\n\tborder-style: double;\nsnippet bds:g\n\tborder-style: groove;\nsnippet bds:h\n\tborder-style: hidden;\nsnippet bds:i\n\tborder-style: inset;\nsnippet bds:n\n\tborder-style: none;\nsnippet bds:o\n\tborder-style: outset;\nsnippet bds:r\n\tborder-style: ridge;\nsnippet bds:s\n\tborder-style: solid;\nsnippet bds:w\n\tborder-style: wave;\nsnippet bdt+\n\tborder-top: ${1:1px} ${2:solid} #${3:000};\nsnippet bdtc\n\tborder-top-color: #${1:000};\nsnippet bdti\n\tborder-top-image: url(${1});\nsnippet bdti:n\n\tborder-top-image: none;\nsnippet bdtli\n\tborder-top-left-image: url(${1});\nsnippet bdtli:c\n\tborder-corner-image: continue;\nsnippet bdtli:n\n\tborder-corner-image: none;\nsnippet bdtlrz\n\tborder-top-left-radius: ${1};\nsnippet bdtri\n\tborder-top-right-image: url(${1});\nsnippet bdtri:c\n\tborder-top-right-image: continue;\nsnippet bdtri:n\n\tborder-top-right-image: none;\nsnippet bdtrrz\n\tborder-top-right-radius: ${1};\nsnippet bdts\n\tborder-top-style: ${1};\nsnippet bdts:n\n\tborder-top-style: none;\nsnippet bdtw\n\tborder-top-width: ${1};\nsnippet bdt\n\tborder-top: ${1};\nsnippet bdt:n\n\tborder-top: none;\nsnippet bdw\n\tborder-width: ${1};\nsnippet bd\n\tborder: ${1};\nsnippet bd:n\n\tborder: none;\nsnippet b\n\tbottom: ${1};\nsnippet b:a\n\tbottom: auto;\nsnippet bxsh+\n\tbox-shadow: ${1:0} ${2:0} ${3:0} #${4:000};\nsnippet bxsh\n\tbox-shadow: ${1};\nsnippet bxsh:n\n\tbox-shadow: none;\nsnippet bxz\n\tbox-sizing: ${1};\nsnippet bxz:bb\n\tbox-sizing: border-box;\nsnippet bxz:cb\n\tbox-sizing: content-box;\nsnippet cps\n\tcaption-side: ${1};\nsnippet cps:b\n\tcaption-side: bottom;\nsnippet cps:t\n\tcaption-side: top;\nsnippet cl\n\tclear: ${1};\nsnippet cl:b\n\tclear: both;\nsnippet cl:l\n\tclear: left;\nsnippet cl:n\n\tclear: none;\nsnippet cl:r\n\tclear: right;\nsnippet cp\n\tclip: ${1};\nsnippet cp:a\n\tclip: auto;\nsnippet cp:r\n\tclip: rect(${1:0} ${2:0} ${3:0} ${4:0});\nsnippet c\n\tcolor: #${1:000};\nsnippet ct\n\tcontent: ${1};\nsnippet ct:a\n\tcontent: attr(${1});\nsnippet ct:cq\n\tcontent: close-quote;\nsnippet ct:c\n\tcontent: counter(${1});\nsnippet ct:cs\n\tcontent: counters(${1});\nsnippet ct:ncq\n\tcontent: no-close-quote;\nsnippet ct:noq\n\tcontent: no-open-quote;\nsnippet ct:n\n\tcontent: normal;\nsnippet ct:oq\n\tcontent: open-quote;\nsnippet coi\n\tcounter-increment: ${1};\nsnippet cor\n\tcounter-reset: ${1};\nsnippet cur\n\tcursor: ${1};\nsnippet cur:a\n\tcursor: auto;\nsnippet cur:c\n\tcursor: crosshair;\nsnippet cur:d\n\tcursor: default;\nsnippet cur:ha\n\tcursor: hand;\nsnippet cur:he\n\tcursor: help;\nsnippet cur:m\n\tcursor: move;\nsnippet cur:p\n\tcursor: pointer;\nsnippet cur:t\n\tcursor: text;\nsnippet d\n\tdisplay: ${1};\nsnippet d:mib\n\tdisplay: -moz-inline-box;\nsnippet d:mis\n\tdisplay: -moz-inline-stack;\nsnippet d:b\n\tdisplay: block;\nsnippet d:cp\n\tdisplay: compact;\nsnippet d:ib\n\tdisplay: inline-block;\nsnippet d:itb\n\tdisplay: inline-table;\nsnippet d:i\n\tdisplay: inline;\nsnippet d:li\n\tdisplay: list-item;\nsnippet d:n\n\tdisplay: none;\nsnippet d:ri\n\tdisplay: run-in;\nsnippet d:tbcp\n\tdisplay: table-caption;\nsnippet d:tbc\n\tdisplay: table-cell;\nsnippet d:tbclg\n\tdisplay: table-column-group;\nsnippet d:tbcl\n\tdisplay: table-column;\nsnippet d:tbfg\n\tdisplay: table-footer-group;\nsnippet d:tbhg\n\tdisplay: table-header-group;\nsnippet d:tbrg\n\tdisplay: table-row-group;\nsnippet d:tbr\n\tdisplay: table-row;\nsnippet d:tb\n\tdisplay: table;\nsnippet ec\n\tempty-cells: ${1};\nsnippet ec:h\n\tempty-cells: hide;\nsnippet ec:s\n\tempty-cells: show;\nsnippet exp\n\texpression()\nsnippet fl\n\tfloat: ${1};\nsnippet fl:l\n\tfloat: left;\nsnippet fl:n\n\tfloat: none;\nsnippet fl:r\n\tfloat: right;\nsnippet f+\n\tfont: ${1:1em} ${2:Arial},${3:sans-serif};\nsnippet fef\n\tfont-effect: ${1};\nsnippet fef:eb\n\tfont-effect: emboss;\nsnippet fef:eg\n\tfont-effect: engrave;\nsnippet fef:n\n\tfont-effect: none;\nsnippet fef:o\n\tfont-effect: outline;\nsnippet femp\n\tfont-emphasize-position: ${1};\nsnippet femp:a\n\tfont-emphasize-position: after;\nsnippet femp:b\n\tfont-emphasize-position: before;\nsnippet fems\n\tfont-emphasize-style: ${1};\nsnippet fems:ac\n\tfont-emphasize-style: accent;\nsnippet fems:c\n\tfont-emphasize-style: circle;\nsnippet fems:ds\n\tfont-emphasize-style: disc;\nsnippet fems:dt\n\tfont-emphasize-style: dot;\nsnippet fems:n\n\tfont-emphasize-style: none;\nsnippet fem\n\tfont-emphasize: ${1};\nsnippet ff\n\tfont-family: ${1};\nsnippet ff:c\n\tfont-family: ${1:'Monotype Corsiva','Comic Sans MS'},cursive;\nsnippet ff:f\n\tfont-family: ${1:Capitals,Impact},fantasy;\nsnippet ff:m\n\tfont-family: ${1:Monaco,'Courier New'},monospace;\nsnippet ff:ss\n\tfont-family: ${1:Helvetica,Arial},sans-serif;\nsnippet ff:s\n\tfont-family: ${1:Georgia,'Times New Roman'},serif;\nsnippet fza\n\tfont-size-adjust: ${1};\nsnippet fza:n\n\tfont-size-adjust: none;\nsnippet fz\n\tfont-size: ${1};\nsnippet fsm\n\tfont-smooth: ${1};\nsnippet fsm:aw\n\tfont-smooth: always;\nsnippet fsm:a\n\tfont-smooth: auto;\nsnippet fsm:n\n\tfont-smooth: never;\nsnippet fst\n\tfont-stretch: ${1};\nsnippet fst:c\n\tfont-stretch: condensed;\nsnippet fst:e\n\tfont-stretch: expanded;\nsnippet fst:ec\n\tfont-stretch: extra-condensed;\nsnippet fst:ee\n\tfont-stretch: extra-expanded;\nsnippet fst:n\n\tfont-stretch: normal;\nsnippet fst:sc\n\tfont-stretch: semi-condensed;\nsnippet fst:se\n\tfont-stretch: semi-expanded;\nsnippet fst:uc\n\tfont-stretch: ultra-condensed;\nsnippet fst:ue\n\tfont-stretch: ultra-expanded;\nsnippet fs\n\tfont-style: ${1};\nsnippet fs:i\n\tfont-style: italic;\nsnippet fs:n\n\tfont-style: normal;\nsnippet fs:o\n\tfont-style: oblique;\nsnippet fv\n\tfont-variant: ${1};\nsnippet fv:n\n\tfont-variant: normal;\nsnippet fv:sc\n\tfont-variant: small-caps;\nsnippet fw\n\tfont-weight: ${1};\nsnippet fw:b\n\tfont-weight: bold;\nsnippet fw:br\n\tfont-weight: bolder;\nsnippet fw:lr\n\tfont-weight: lighter;\nsnippet fw:n\n\tfont-weight: normal;\nsnippet f\n\tfont: ${1};\nsnippet h\n\theight: ${1};\nsnippet h:a\n\theight: auto;\nsnippet l\n\tleft: ${1};\nsnippet l:a\n\tleft: auto;\nsnippet lts\n\tletter-spacing: ${1};\nsnippet lh\n\tline-height: ${1};\nsnippet lisi\n\tlist-style-image: url(${1});\nsnippet lisi:n\n\tlist-style-image: none;\nsnippet lisp\n\tlist-style-position: ${1};\nsnippet lisp:i\n\tlist-style-position: inside;\nsnippet lisp:o\n\tlist-style-position: outside;\nsnippet list\n\tlist-style-type: ${1};\nsnippet list:c\n\tlist-style-type: circle;\nsnippet list:dclz\n\tlist-style-type: decimal-leading-zero;\nsnippet list:dc\n\tlist-style-type: decimal;\nsnippet list:d\n\tlist-style-type: disc;\nsnippet list:lr\n\tlist-style-type: lower-roman;\nsnippet list:n\n\tlist-style-type: none;\nsnippet list:s\n\tlist-style-type: square;\nsnippet list:ur\n\tlist-style-type: upper-roman;\nsnippet lis\n\tlist-style: ${1};\nsnippet lis:n\n\tlist-style: none;\nsnippet mb\n\tmargin-bottom: ${1};\nsnippet mb:a\n\tmargin-bottom: auto;\nsnippet ml\n\tmargin-left: ${1};\nsnippet ml:a\n\tmargin-left: auto;\nsnippet mr\n\tmargin-right: ${1};\nsnippet mr:a\n\tmargin-right: auto;\nsnippet mt\n\tmargin-top: ${1};\nsnippet mt:a\n\tmargin-top: auto;\nsnippet m\n\tmargin: ${1};\nsnippet m:4\n\tmargin: ${1:0} ${2:0} ${3:0} ${4:0};\nsnippet m:3\n\tmargin: ${1:0} ${2:0} ${3:0};\nsnippet m:2\n\tmargin: ${1:0} ${2:0};\nsnippet m:0\n\tmargin: 0;\nsnippet m:a\n\tmargin: auto;\nsnippet mah\n\tmax-height: ${1};\nsnippet mah:n\n\tmax-height: none;\nsnippet maw\n\tmax-width: ${1};\nsnippet maw:n\n\tmax-width: none;\nsnippet mih\n\tmin-height: ${1};\nsnippet miw\n\tmin-width: ${1};\nsnippet op\n\topacity: ${1};\nsnippet op:ie\n\tfilter: progid:DXImageTransform.Microsoft.Alpha(Opacity=${1:100});\nsnippet op:ms\n\t-ms-filter: 'progid:DXImageTransform.Microsoft.Alpha(Opacity=${1:100})';\nsnippet orp\n\torphans: ${1};\nsnippet o+\n\toutline: ${1:1px} ${2:solid} #${3:000};\nsnippet oc\n\toutline-color: ${1:#000};\nsnippet oc:i\n\toutline-color: invert;\nsnippet oo\n\toutline-offset: ${1};\nsnippet os\n\toutline-style: ${1};\nsnippet ow\n\toutline-width: ${1};\nsnippet o\n\toutline: ${1};\nsnippet o:n\n\toutline: none;\nsnippet ovs\n\toverflow-style: ${1};\nsnippet ovs:a\n\toverflow-style: auto;\nsnippet ovs:mq\n\toverflow-style: marquee;\nsnippet ovs:mv\n\toverflow-style: move;\nsnippet ovs:p\n\toverflow-style: panner;\nsnippet ovs:s\n\toverflow-style: scrollbar;\nsnippet ovx\n\toverflow-x: ${1};\nsnippet ovx:a\n\toverflow-x: auto;\nsnippet ovx:h\n\toverflow-x: hidden;\nsnippet ovx:s\n\toverflow-x: scroll;\nsnippet ovx:v\n\toverflow-x: visible;\nsnippet ovy\n\toverflow-y: ${1};\nsnippet ovy:a\n\toverflow-y: auto;\nsnippet ovy:h\n\toverflow-y: hidden;\nsnippet ovy:s\n\toverflow-y: scroll;\nsnippet ovy:v\n\toverflow-y: visible;\nsnippet ov\n\toverflow: ${1};\nsnippet ov:a\n\toverflow: auto;\nsnippet ov:h\n\toverflow: hidden;\nsnippet ov:s\n\toverflow: scroll;\nsnippet ov:v\n\toverflow: visible;\nsnippet pb\n\tpadding-bottom: ${1};\nsnippet pl\n\tpadding-left: ${1};\nsnippet pr\n\tpadding-right: ${1};\nsnippet pt\n\tpadding-top: ${1};\nsnippet p\n\tpadding: ${1};\nsnippet p:4\n\tpadding: ${1:0} ${2:0} ${3:0} ${4:0};\nsnippet p:3\n\tpadding: ${1:0} ${2:0} ${3:0};\nsnippet p:2\n\tpadding: ${1:0} ${2:0};\nsnippet p:0\n\tpadding: 0;\nsnippet pgba\n\tpage-break-after: ${1};\nsnippet pgba:aw\n\tpage-break-after: always;\nsnippet pgba:a\n\tpage-break-after: auto;\nsnippet pgba:l\n\tpage-break-after: left;\nsnippet pgba:r\n\tpage-break-after: right;\nsnippet pgbb\n\tpage-break-before: ${1};\nsnippet pgbb:aw\n\tpage-break-before: always;\nsnippet pgbb:a\n\tpage-break-before: auto;\nsnippet pgbb:l\n\tpage-break-before: left;\nsnippet pgbb:r\n\tpage-break-before: right;\nsnippet pgbi\n\tpage-break-inside: ${1};\nsnippet pgbi:a\n\tpage-break-inside: auto;\nsnippet pgbi:av\n\tpage-break-inside: avoid;\nsnippet pos\n\tposition: ${1};\nsnippet pos:a\n\tposition: absolute;\nsnippet pos:f\n\tposition: fixed;\nsnippet pos:r\n\tposition: relative;\nsnippet pos:s\n\tposition: static;\nsnippet q\n\tquotes: ${1};\nsnippet q:en\n\tquotes: '\\201C' '\\201D' '\\2018' '\\2019';\nsnippet q:n\n\tquotes: none;\nsnippet q:ru\n\tquotes: '\\00AB' '\\00BB' '\\201E' '\\201C';\nsnippet rz\n\tresize: ${1};\nsnippet rz:b\n\tresize: both;\nsnippet rz:h\n\tresize: horizontal;\nsnippet rz:n\n\tresize: none;\nsnippet rz:v\n\tresize: vertical;\nsnippet r\n\tright: ${1};\nsnippet r:a\n\tright: auto;\nsnippet tbl\n\ttable-layout: ${1};\nsnippet tbl:a\n\ttable-layout: auto;\nsnippet tbl:f\n\ttable-layout: fixed;\nsnippet tal\n\ttext-align-last: ${1};\nsnippet tal:a\n\ttext-align-last: auto;\nsnippet tal:c\n\ttext-align-last: center;\nsnippet tal:l\n\ttext-align-last: left;\nsnippet tal:r\n\ttext-align-last: right;\nsnippet ta\n\ttext-align: ${1};\nsnippet ta:c\n\ttext-align: center;\nsnippet ta:l\n\ttext-align: left;\nsnippet ta:r\n\ttext-align: right;\nsnippet td\n\ttext-decoration: ${1};\nsnippet td:l\n\ttext-decoration: line-through;\nsnippet td:n\n\ttext-decoration: none;\nsnippet td:o\n\ttext-decoration: overline;\nsnippet td:u\n\ttext-decoration: underline;\nsnippet te\n\ttext-emphasis: ${1};\nsnippet te:ac\n\ttext-emphasis: accent;\nsnippet te:a\n\ttext-emphasis: after;\nsnippet te:b\n\ttext-emphasis: before;\nsnippet te:c\n\ttext-emphasis: circle;\nsnippet te:ds\n\ttext-emphasis: disc;\nsnippet te:dt\n\ttext-emphasis: dot;\nsnippet te:n\n\ttext-emphasis: none;\nsnippet th\n\ttext-height: ${1};\nsnippet th:a\n\ttext-height: auto;\nsnippet th:f\n\ttext-height: font-size;\nsnippet th:m\n\ttext-height: max-size;\nsnippet th:t\n\ttext-height: text-size;\nsnippet ti\n\ttext-indent: ${1};\nsnippet ti:-\n\ttext-indent: -9999px;\nsnippet tj\n\ttext-justify: ${1};\nsnippet tj:a\n\ttext-justify: auto;\nsnippet tj:d\n\ttext-justify: distribute;\nsnippet tj:ic\n\ttext-justify: inter-cluster;\nsnippet tj:ii\n\ttext-justify: inter-ideograph;\nsnippet tj:iw\n\ttext-justify: inter-word;\nsnippet tj:k\n\ttext-justify: kashida;\nsnippet tj:t\n\ttext-justify: tibetan;\nsnippet to+\n\ttext-outline: ${1:0} ${2:0} #${3:000};\nsnippet to\n\ttext-outline: ${1};\nsnippet to:n\n\ttext-outline: none;\nsnippet tr\n\ttext-replace: ${1};\nsnippet tr:n\n\ttext-replace: none;\nsnippet tsh+\n\ttext-shadow: ${1:0} ${2:0} ${3:0} #${4:000};\nsnippet tsh\n\ttext-shadow: ${1};\nsnippet tsh:n\n\ttext-shadow: none;\nsnippet tt\n\ttext-transform: ${1};\nsnippet tt:c\n\ttext-transform: capitalize;\nsnippet tt:l\n\ttext-transform: lowercase;\nsnippet tt:n\n\ttext-transform: none;\nsnippet tt:u\n\ttext-transform: uppercase;\nsnippet tw\n\ttext-wrap: ${1};\nsnippet tw:no\n\ttext-wrap: none;\nsnippet tw:n\n\ttext-wrap: normal;\nsnippet tw:s\n\ttext-wrap: suppress;\nsnippet tw:u\n\ttext-wrap: unrestricted;\nsnippet t\n\ttop: ${1};\nsnippet t:a\n\ttop: auto;\nsnippet va\n\tvertical-align: ${1};\nsnippet va:bl\n\tvertical-align: baseline;\nsnippet va:b\n\tvertical-align: bottom;\nsnippet va:m\n\tvertical-align: middle;\nsnippet va:sub\n\tvertical-align: sub;\nsnippet va:sup\n\tvertical-align: super;\nsnippet va:tb\n\tvertical-align: text-bottom;\nsnippet va:tt\n\tvertical-align: text-top;\nsnippet va:t\n\tvertical-align: top;\nsnippet v\n\tvisibility: ${1};\nsnippet v:c\n\tvisibility: collapse;\nsnippet v:h\n\tvisibility: hidden;\nsnippet v:v\n\tvisibility: visible;\nsnippet whsc\n\twhite-space-collapse: ${1};\nsnippet whsc:ba\n\twhite-space-collapse: break-all;\nsnippet whsc:bs\n\twhite-space-collapse: break-strict;\nsnippet whsc:k\n\twhite-space-collapse: keep-all;\nsnippet whsc:l\n\twhite-space-collapse: loose;\nsnippet whsc:n\n\twhite-space-collapse: normal;\nsnippet whs\n\twhite-space: ${1};\nsnippet whs:n\n\twhite-space: normal;\nsnippet whs:nw\n\twhite-space: nowrap;\nsnippet whs:pl\n\twhite-space: pre-line;\nsnippet whs:pw\n\twhite-space: pre-wrap;\nsnippet whs:p\n\twhite-space: pre;\nsnippet wid\n\twidows: ${1};\nsnippet w\n\twidth: ${1};\nsnippet w:a\n\twidth: auto;\nsnippet wob\n\tword-break: ${1};\nsnippet wob:ba\n\tword-break: break-all;\nsnippet wob:bs\n\tword-break: break-strict;\nsnippet wob:k\n\tword-break: keep-all;\nsnippet wob:l\n\tword-break: loose;\nsnippet wob:n\n\tword-break: normal;\nsnippet wos\n\tword-spacing: ${1};\nsnippet wow\n\tword-wrap: ${1};\nsnippet wow:no\n\tword-wrap: none;\nsnippet wow:n\n\tword-wrap: normal;\nsnippet wow:s\n\tword-wrap: suppress;\nsnippet wow:u\n\tword-wrap: unrestricted;\nsnippet z\n\tz-index: ${1};\nsnippet z:a\n\tz-index: auto;\nsnippet zoo\n\tzoom: 1;\n"})),ace.define("ace/snippets/css",["require","exports","module","ace/snippets/css.snippets"],(function(e,t,n){"use strict";t.snippetText=e("./css.snippets"),t.scope="css"})),ace.require(["ace/snippets/css"],(function(t){e&&(e.exports=t)}))},2777:(e,t,n)=>{e=n.nmd(e),ace.define("ace/theme/textmate",["require","exports","module","ace/theme/textmate-css","ace/lib/dom"],(function(e,t,n){"use strict";t.isDark=!1,t.cssClass="ace-tm",t.cssText=e("./textmate-css"),t.$id="ace/theme/textmate",e("../lib/dom").importCssString(t.cssText,t.cssClass,!1)})),ace.require(["ace/theme/textmate"],(function(t){e&&(e.exports=t)}))},7353:(e,t,n)=>{"use strict";var i={};n.r(i),n.d(i,{closeModal:()=>nt,disableComplementaryArea:()=>qe,enableComplementaryArea:()=>Ze,openModal:()=>tt,pinItem:()=>Ye,setDefaultComplementaryArea:()=>Ke,setFeatureDefaults:()=>et,setFeatureValue:()=>Je,toggleFeature:()=>Qe,unpinItem:()=>Xe});var o={};n.r(o),n.d(o,{getActiveComplementaryArea:()=>it,isComplementaryAreaLoading:()=>ot,isFeatureActive:()=>st,isItemPinned:()=>rt,isModalActive:()=>at});var r=n(9196),s=n.n(r);const a=window.wp.element,l=window.wp.blocks,c=window.wp.blockLibrary;function h(){return window.giveStorageData}function d(){return window.giveStorageData}const u=window.givewp.form.blocks,p={customClassName:!1,html:!1},g=window.wp.hooks,f=window.wp.blockEditor,m=window.wp.i18n;function v(e){if(void 0===e||!1===e)return null;const t=(t,n,i)=>!1!==e[t]&&(!0===e[t]?{default:i}:!0===e||void 0===e[t]?!!n&&{default:i}:{default:e[t].default});return{label:t("label",!0,(0,m.__)("Custom field","give")),metaKey:!!t("metaKey",!0,null),description:t("description",!1,""),placeholder:t("placeholder",!1,""),required:t("required",!0,!1),storeAsDonorMeta:t("storeAsDonorMeta",!0,!1),displayInAdmin:t("displayInAdmin",!0,!0),displayInReceipt:t("displayInReceipt",!0,!0),defaultValue:t("defaultValue",!1,""),emailTag:t("emailTag",!0,"")}}const w=window.wp.data,b=window.giveStorageData,y=window.jQuery,C=({blocks:e,formSettings:t})=>new Promise(((n,i)=>{y.post({url:b.resourceURL,headers:{"X-WP-Nonce":b.nonce},data:{blocks:JSON.stringify(e),settings:JSON.stringify(t)}}).done((e=>{n(JSON.parse(e.settings))})).fail((e=>{console.error(e);const t={code:e?.responseJSON?.code||"unknown",message:e?.responseJSON?.message||(0,m.__)("An unknown error has occurred. Please try saving again and contact support if the problem persists.","give"),status:e?.responseJSON?.data?.status||500};i(new Error(t.message,{cause:t}))}))})),$=()=>({blocks:JSON.parse(b.blockData),formSettings:JSON.parse(b.settings||"{}")}),x=({blocks:e,formSettings:t})=>new Promise(((n,i)=>{y.post({url:b.previewURL,headers:{"X-WP-Nonce":b.nonce},data:{"form-blocks":JSON.stringify(e),"form-settings":JSON.stringify(t)}}).then(n)})),{disallowedFieldNames:_}=h(),S=(e,t)=>{const[n]=e.split(/^(.*)_([0-9]*)$/g).filter(Boolean),i=t.filter((e=>e.startsWith(n))).flatMap((e=>e.split(/^.*_([0-9]*)$/g).filter(Number)))||[0],o=i.length?Math.max(...i)+1:1;return`${n}_${o}`},E=e=>[e,...e.innerBlocks.flatMap(E)],k=(e=!1)=>{const[t,n]=(0,r.useState)(e);return{state:t,update:n,toggle:()=>n((e=>!e))}},A=window.wp.components,L=window.lodash;var M=n.n(L);function T({label:e,setAttributes:t,onBlur:n=L.noop}){return(0,r.createElement)(A.TextControl,{label:(0,m.__)("Label","give"),value:e,onChange:e=>t({label:e}),onBlur:n})}const{Slot:R,Fill:I}=(0,A.createSlotFill)("GiveWP/FieldSettings/FieldSettingSlot"),{Slot:O,Fill:N}=(0,A.createSlotFill)("GiveWP/FieldSettings/AfterFieldSettingsSlot"),{Slot:D,Fill:P}=(0,A.createSlotFill)("GiveWP/FieldSettings/DisplaySettingSlot"),{Slot:F,Fill:H}=(0,A.createSlotFill)("GiveWP/FieldSettings/AfterDisplaySettingsSlot"),B=window.wp.compose,W={textControl:"H5q0IXOPpF2tVDhlJcLS",button:"KSEd61yf_ClfsbFL1san",popover:"HEcBPZ9AlMIQkn4r4Smk",popoverContents:"NptdaGbID6tgiP7IKwE_",popoverButtons:"me_Y1RK7VB0cXjSxPRxY"};function z({value:e,lockValue:t,onChange:n,onBlur:i}){const[o,s]=(0,a.useState)(!1),[l,c]=(0,a.useState)(t);return(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",null,(0,r.createElement)(A.TextControl,{className:W.textControl,label:[(0,m.__)("Meta Key","give"),t?(0,r.createElement)(j,{onClick:()=>s((e=>!e))}):null],value:e,help:(0,m.__)("The name of the meta key this field will to in the database. Can only be letters, numbers, and underscores.","give"),readOnly:l,onChange:n,onBlur:i})),(0,r.createElement)(U,{visible:o,onCancel:()=>s(!1),onConfirm:()=>{s(!1),c(!1)}}))}function V(e){return e.trim().slice(0,255).toLowerCase().replace(/^_/g,"").replace(/\s/g,"_").replace(/[^a-zA-Z\d\s_]/g,"").replace(/-$/g,"")}function j({onClick:e}){return(0,r.createElement)("button",{onClick:e,type:"button",className:W.button},(0,r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},(0,r.createElement)("path",{d:"M6.02157 10.1075L12.666 3.39785L11.2216 2L4.57713 8.70968L3.99935 10.6667L6.02157 10.1075Z",fill:"#0E0E0E"}),(0,r.createElement)("path",{d:"M2.66602 13.3333H7.99935M12.666 3.39785L6.02157 10.1075L3.99935 10.6667L4.57713 8.70968L11.2216 2L12.666 3.39785Z",stroke:"#0E0E0E"})))}function U({visible:e,onCancel:t,onConfirm:n}){return e?(0,r.createElement)(A.Popover,{placement:"left",offset:35},(0,r.createElement)("div",{className:W.popover},(0,r.createElement)("div",null,(0,r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},(0,r.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.0007 0.833984C4.93804 0.833984 0.833984 4.93804 0.833984 10.0007C0.833984 15.0633 4.93804 19.1673 10.0007 19.1673C15.0633 19.1673 19.1673 15.0633 19.1673 10.0007C19.1673 4.93804 15.0633 0.833984 10.0007 0.833984ZM10.834 6.66732C10.834 6.20708 10.4609 5.83398 10.0007 5.83398C9.54041 5.83398 9.16732 6.20708 9.16732 6.66732V10.0007C9.16732 10.4609 9.54041 10.834 10.0007 10.834C10.4609 10.834 10.834 10.4609 10.834 10.0007V6.66732ZM10.0007 12.5007C9.54041 12.5007 9.16732 12.8737 9.16732 13.334C9.16732 13.7942 9.54041 14.1673 10.0007 14.1673H10.009C10.4692 14.1673 10.8423 13.7942 10.8423 13.334C10.8423 12.8737 10.4692 12.5007 10.009 12.5007H10.0007Z",fill:"#F29718"}))),(0,r.createElement)("div",{className:W.popoverContents},(0,r.createElement)("h3",null,(0,m.__)("Edit field meta key","give")),(0,r.createElement)("p",null,(0,m.__)("Changing the meta key value will affect the visibility of existing donation data. Would you like to proceed?","give")),(0,r.createElement)("div",{className:W.popoverButtons},(0,r.createElement)(A.Button,{onClick:()=>t(),variant:"secondary"},(0,m.__)("No, cancel","give")),(0,r.createElement)(A.Button,{onClick:()=>n(),variant:"primary"},(0,m.__)("Yes, proceed","give")))))):null}const G=(0,B.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:i,setAttributes:o,clientId:s}=t,c=(0,a.useMemo)((()=>{const e=(0,l.getBlockSupport)(n,"givewp");return v(e?.fieldSettings)}),[n]);return c?(0,r.createElement)(r.Fragment,null,(0,r.createElement)(e,{...t}),(0,r.createElement)(Z,{attributes:i,setAttributes:o,fieldSettings:c,clientId:s})):(0,r.createElement)(e,{...t})}),"withInspectorControl"),K=(e,t)=>t?`meta_donor_${e}`:`meta_donation_${e}`;function Z({attributes:e,setAttributes:t,fieldSettings:n,clientId:i}){const o=(()=>{const e=(0,w.useSelect)((e=>e("core/block-editor").getBlocks()),[]).flatMap(E).map((e=>e.attributes.fieldName)).filter((e=>e));return(t,n=!1)=>{if(_.includes(t))return[!1,S(t,null!=e?e:[])];const i=((e,t)=>t.filter((t=>t===e)).length)(t,null!=e?e:[]),o=n?i<=1:0===i;return[o,o?null:S(t,null!=e?e:[])]}})(),[s,l]=(0,r.useState)(e.hasOwnProperty("fieldName")),[c]=(0,r.useState)(e.metaUUID!==i),h=(0,a.useCallback)(((n=null,i=!1)=>{let r=n?V(n):null;r||(r=V(e.label));const[s,a]=o(r,i);s||(r=a),t({fieldName:r,emailTag:K(r,e.storeAsDonorMeta)})}),[t,e.label]),d=(0,a.useCallback)((e=>{s||(h(e.target.value),l(!0))}),[s,h]),u=(0,a.useCallback)((()=>{e.fieldName?h(e.fieldName,!0):h()}),[e.fieldName,h]);return(0,r.useEffect)((()=>{c&&(h(),l(!1),t({metaUUID:i}))}),[]),e.hasOwnProperty("fieldName")||h(),(0,r.createElement)(r.Fragment,null,(0,r.createElement)(f.InspectorControls,null,(n.label||n.placeholder||n.description||n.required)&&(0,r.createElement)(A.PanelBody,{title:(0,m.__)("Field Settings","give"),initialOpen:!0},n.label&&(0,r.createElement)(A.PanelRow,null,(0,r.createElement)(T,{label:e.label,setAttributes:t,onBlur:d})),n.placeholder&&(0,r.createElement)(A.PanelRow,null,(0,r.createElement)(A.TextControl,{label:(0,m.__)("Placeholder","give"),value:e.placeholder,onChange:e=>{t({placeholder:e})}})),n.description&&(0,r.createElement)(A.PanelRow,null,(0,r.createElement)(A.TextareaControl,{label:(0,m.__)("Description","give"),value:e.description,onChange:e=>{t({description:e})}})),n.required&&(0,r.createElement)(A.PanelRow,null,(0,r.createElement)(A.ToggleControl,{label:(0,m.__)("Required","give"),checked:e.isRequired,onChange:()=>t({isRequired:!e.isRequired})})),(0,r.createElement)(R,null)),(0,r.createElement)(O,null),(n.displayInAdmin||n.displayInReceipt)&&(0,r.createElement)(A.PanelBody,{title:(0,m.__)("Display Settings","give"),initialOpen:!0},n.displayInAdmin&&(0,r.createElement)(A.PanelRow,null,(0,r.createElement)(A.ToggleControl,{label:(0,m.__)("Display in Admin","give"),checked:e.displayInAdmin,onChange:()=>t({displayInAdmin:!e.displayInAdmin})})),n.displayInReceipt&&(0,r.createElement)(A.PanelRow,null,(0,r.createElement)(A.ToggleControl,{label:(0,m.__)("Display in Receipt","give"),checked:e.displayInReceipt,onChange:()=>t({displayInReceipt:!e.displayInReceipt})})),(0,r.createElement)(D,null)),(0,r.createElement)(F,null)),(n.defaultValue||n.metaKey||n.storeAsDonorMeta||n.emailTag)&&(0,r.createElement)(f.InspectorAdvancedControls,null,n.defaultValue&&(0,r.createElement)(A.PanelRow,null,(0,r.createElement)(A.TextControl,{label:(0,m.__)("Default Value","give"),value:e.defaultValue,help:[(0,m.__)("The value of the field if the donor does not fill out this field. Leave blank in most cases.","give")],onChange:e=>t({defaultValue:e})})),n.metaKey&&(0,r.createElement)(A.PanelRow,null,(0,r.createElement)(z,{value:e.fieldName,onChange:e=>t({fieldName:e}),onBlur:u,lockValue:!c})),n.metaKey&&n.emailTag&&(0,r.createElement)(A.PanelRow,null,(0,r.createElement)(A.TextControl,{label:(0,m.__)("Email Tag","give"),value:"{"+e.emailTag+"}",readOnly:!0,help:[(0,m.__)("Use this email tag to dynamically output the data in supported GiveWP emails.","give")],onChange:()=>{}})),n.storeAsDonorMeta&&(0,r.createElement)(A.PanelRow,null,(0,r.createElement)(A.ToggleControl,{label:(0,m.__)("Save to Donor Record","give"),checked:e.storeAsDonorMeta,onChange:()=>{const n=!e.storeAsDonorMeta;t({storeAsDonorMeta:n,emailTag:K(e.fieldName,n)})},help:(0,m.__)("If enabled, the data collected by this field is saved to the Donor record instead of the Donation record. This is useful for data that doesn't normally change between donations, like a phone number or t-shirt size.","give")}))))}var q=function(){return q=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},q.apply(this,arguments)};function Y(e,t,n){if(n||2===arguments.length)for(var i,o=0,r=t.length;o<r;o++)!i&&o in t||(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||t)}var X=function(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")},Q={k:1e3,m:1e6,b:1e9},J=function(e){var t=e.value,n=e.groupSeparator,i=void 0===n?",":n,o=e.decimalSeparator,r=void 0===o?".":o,s=e.allowDecimals,a=void 0===s||s,l=e.decimalsLimit,c=void 0===l?2:l,h=e.allowNegativeValue,d=void 0===h||h,u=e.disableAbbreviations,p=void 0!==u&&u,g=e.prefix,f=void 0===g?"":g,m=e.transformRawValue,v=(void 0===m?function(e){return e}:m)(t);if("-"===v)return v;var w=p?[]:["k","m","b"],b=new RegExp("((^|\\D)-\\d)|(-"+X(f)+")").test(v),y=RegExp("(\\d+)-?"+X(f)).exec(t)||[],C=y[0],$=y[1],x=function(e,t){void 0===t&&(t=",");var n=new RegExp(X(t),"g");return e.replace(n,"")}(f?C?v.replace(C,"").concat($):v.replace(f,""):v,i),_=function(e,t){var n=X(t.join("")),i=new RegExp("[^\\d"+n+"]","gi");return e.replace(i,"")}(x,Y([i,r],w)),S=_;if(!p){if(w.some((function(e){return e===_.toLowerCase().replace(r,"")})))return"";var E=function(e,t){void 0===t&&(t=".");var n=new RegExp("(\\d+("+X(t)+"\\d*)?)([kmb])$","i"),i=e.match(n);if(i){var o=i[1],r=i[3],s=Q[r.toLowerCase()];return Number(o.replace(t,"."))*s}}(_,r);E&&(S=String(E))}var k=b&&d?"-":"";if(r&&S.includes(r)){var A=_.split(r),L=A[0],M=A[1],T=c&&M?M.slice(0,c):M;return""+k+L+(a?""+r+T:"")}return""+k+S},ee=function(e,t){var n=t.groupSeparator,i=void 0===n?",":n,o=t.decimalSeparator,r=void 0===o?".":o,s=new RegExp("\\d([^"+X(i)+X(r)+"0-9]+)"),a=e.match(s);return a?a[1]:void 0},te=function(e){var t=e.value,n=e.decimalSeparator,i=e.intlConfig,o=e.decimalScale,r=e.prefix,s=void 0===r?"":r,a=e.suffix,l=void 0===a?"":a;if(""===t||void 0===t)return"";if("-"===t)return"-";var c=new RegExp("^\\d?-"+(s?X(s)+"?":"")+"\\d").test(t),h="."!==n?ne(t,n,c):t,d={minimumFractionDigits:o||0,maximumFractionDigits:20},u=(i?new Intl.NumberFormat(i.locale,i.currency?q(q({},d),{style:"currency",currency:i.currency}):d):new Intl.NumberFormat(void 0,d)).formatToParts(Number(h)),p=ie(u,e),g=ee(p,q({},e)),f=t.slice(-1)===n?n:"",m=(h.match(RegExp("\\d+\\.(\\d+)"))||[])[1];return void 0===o&&m&&n&&(p=p.includes(n)?p.replace(RegExp("(\\d+)("+X(n)+")(\\d+)","g"),"$1$2"+m):g&&!l?p.replace(g,""+n+m+g):""+p+n+m),l&&f?""+p+f+l:g&&f?p.replace(g,""+f+g):g&&l?p.replace(g,""+f+l):[p,f,l].join("")},ne=function(e,t,n){var i=e;return t&&"."!==t&&(i=i.replace(RegExp(X(t),"g"),"."),n&&"-"===t&&(i="-"+i.slice(1))),i},ie=function(e,t){var n=t.prefix,i=t.groupSeparator,o=t.decimalSeparator,r=t.decimalScale,s=t.disableGroupSeparators,a=void 0!==s&&s;return e.reduce((function(e,t,s){var l=t.type,c=t.value;return 0===s&&n?"minusSign"===l?[c,n]:"currency"===l?Y(Y([],e),[n]):[n,c]:"currency"===l?n?e:Y(Y([],e),[c]):"group"===l?a?e:Y(Y([],e),[void 0!==i?i:c]):"decimal"===l?void 0!==r&&0===r?e:Y(Y([],e),[void 0!==o?o:c]):Y(Y([],e),"fraction"===l?[void 0!==r?c.slice(0,r):c]:[c])}),[""]).join("")},oe={currencySymbol:"",groupSeparator:"",decimalSeparator:"",prefix:"",suffix:""},re=function(e){return RegExp(/\d/,"gi").test(e)},se=(0,r.forwardRef)((function(e,t){var n=e.allowDecimals,i=void 0===n||n,o=e.allowNegativeValue,a=void 0===o||o,l=e.id,c=e.name,h=e.className,d=e.customInput,u=e.decimalsLimit,p=e.defaultValue,g=e.disabled,f=void 0!==g&&g,m=e.maxLength,v=e.value,w=e.onValueChange,b=e.fixedDecimalLength,y=e.placeholder,C=e.decimalScale,$=e.prefix,x=e.suffix,_=e.intlConfig,S=e.step,E=e.min,k=e.max,A=e.disableGroupSeparators,L=void 0!==A&&A,M=e.disableAbbreviations,T=void 0!==M&&M,R=e.decimalSeparator,I=e.groupSeparator,O=e.onChange,N=e.onFocus,D=e.onBlur,P=e.onKeyDown,F=e.onKeyUp,H=e.transformRawValue,B=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]])}return n}(e,["allowDecimals","allowNegativeValue","id","name","className","customInput","decimalsLimit","defaultValue","disabled","maxLength","value","onValueChange","fixedDecimalLength","placeholder","decimalScale","prefix","suffix","intlConfig","step","min","max","disableGroupSeparators","disableAbbreviations","decimalSeparator","groupSeparator","onChange","onFocus","onBlur","onKeyDown","onKeyUp","transformRawValue"]);if(R&&re(R))throw new Error("decimalSeparator cannot be a number");if(I&&re(I))throw new Error("groupSeparator cannot be a number");var W=(0,r.useMemo)((function(){return function(e){var t=e||{},n=t.locale,i=t.currency;return(n?new Intl.NumberFormat(n,i?{currency:i,style:"currency"}:void 0):new Intl.NumberFormat).formatToParts(1000.1).reduce((function(e,t,n){return"currency"===t.type?q(q({},e),0===n?{currencySymbol:t.value,prefix:t.value}:{currencySymbol:t.value,suffix:t.value}):"group"===t.type?q(q({},e),{groupSeparator:t.value}):"decimal"===t.type?q(q({},e),{decimalSeparator:t.value}):e}),oe)}(_)}),[_]),z=R||W.decimalSeparator||"",V=I||W.groupSeparator||"";if(z&&V&&z===V&&!1===L)throw new Error("decimalSeparator cannot be the same as groupSeparator");var j={decimalSeparator:z,groupSeparator:V,disableGroupSeparators:L,intlConfig:_,prefix:$||W.prefix,suffix:x},U={decimalSeparator:z,groupSeparator:V,allowDecimals:i,decimalsLimit:u||b||2,allowNegativeValue:a,disableAbbreviations:T,prefix:$||W.prefix,transformRawValue:H},G=null!=p?te(q(q({},j),{decimalScale:C,value:String(p)})):null!=v?te(q(q({},j),{decimalScale:C,value:String(v)})):"",K=(0,r.useState)(G),Z=K[0],Y=K[1],X=(0,r.useState)(!1),Q=X[0],ne=X[1],ie=(0,r.useState)(0),se=ie[0],ae=ie[1],le=(0,r.useState)(0),ce=le[0],he=le[1],de=(0,r.useState)(null),ue=de[0],pe=de[1],ge=(0,r.useRef)(null);(0,r.useImperativeHandle)(t,(function(){return ge.current}));var fe=function(e,t){ne(!0);var n=function(e){var t=e.selectionStart,n=e.value,i=e.lastKeyStroke,o=e.stateValue,r=e.groupSeparator,s=t,a=n;if(o&&s){var l=n.split("");return"Backspace"===i&&o[s]===r&&(l.splice(s-1,1),s-=1),"Delete"===i&&o[s]===r&&(l.splice(s,1),s+=1),{modifiedValue:a=l.join(""),cursorPosition:s}}return{modifiedValue:a,cursorPosition:t}}({selectionStart:t,value:e,lastKeyStroke:ue,stateValue:Z,groupSeparator:V}),i=n.modifiedValue,o=n.cursorPosition,r=J(q({value:i},U));if(!(m&&r.replace(/-/g,"").length>m)){if(""===r||"-"===r||r===z)return w&&w(void 0,c,{float:null,formatted:"",value:""}),Y(r),void ae(1);var s=z?r.replace(z,"."):r,a=parseFloat(s),l=te(q({value:r},j));if(null!=o){var h=o+(l.length-e.length);h=h<=0?$?$.length:0:h,ae(h),he(ce+1)}Y(l),w&&w(r,c,{float:a,formatted:l,value:r})}};(0,r.useEffect)((function(){Q&&"-"!==Z&&ge.current&&document.activeElement===ge.current&&ge.current.setSelectionRange(se,se)}),[Z,se,ge,Q,ce]);var me=q({type:"text",inputMode:"decimal",id:l,name:c,className:h,onChange:function(e){var t=e.target,n=t.value,i=t.selectionStart;fe(n,i),O&&O(e)},onBlur:function(e){var t=e.target.value,n=J(q({value:t},U));if("-"===n||n===z||!n)return Y(""),void(D&&D(e));var i=function(e,t,n){if(n&&e.length>1){if(e.includes(t)){var i=e.split(t),o=i[0];if((r=i[1]).length>n)return""+o+t+r.slice(0,n)}var r,s=e.length>n?new RegExp("(\\d+)(\\d{"+n+"})"):new RegExp("(\\d)(\\d+)"),a=e.match(s);if(a)return""+(o=a[1])+t+a[2]}return e}(n,z,b),o=function(e,t,n){if(void 0===t&&(t="."),void 0===n||""===e||void 0===e)return e;if(!e.match(/\d/g))return"";var i=e.split(t),o=i[0],r=i[1];if(0===n)return o;var s=r||"";if(s.length<n)for(;s.length<n;)s+="0";else s=s.slice(0,n);return""+o+t+s}(i,z,void 0!==C?C:b),r=parseFloat(o.replace(z,".")),s=te(q(q({},j),{value:o}));w&&w(o,c,{float:r,formatted:s,value:o}),Y(s),D&&D(e)},onFocus:function(e){return N&&N(e),Z?Z.length:0},onKeyDown:function(e){var t=e.key;if(pe(t),S&&("ArrowUp"===t||"ArrowDown"===t)){e.preventDefault(),ae(Z.length);var n=parseFloat(null!=v?String(v).replace(z,"."):J(q({value:Z},U)))||0,i="ArrowUp"===t?n+S:n-S;if(void 0!==E&&i<E)return;if(void 0!==k&&i>k)return;var o=String(S).includes(".")?Number(String(S).split(".")[1].length):void 0;fe(String(o?i.toFixed(o):i).replace(".",z))}P&&P(e)},onKeyUp:function(e){var t=e.key,n=e.currentTarget.selectionStart;if("ArrowUp"!==t&&"ArrowDown"!==t&&"-"!==Z){var i=ee(Z,{groupSeparator:V,decimalSeparator:z});if(i&&n&&n>Z.length-i.length&&ge.current){var o=Z.length-i.length;ge.current.setSelectionRange(o,o)}}F&&F(e)},placeholder:y,disabled:f,value:null==v||"-"===Z||z&&Z===z?Z:te(q(q({},j),{decimalScale:Q?void 0:C,value:String(v)})),ref:ge},B);if(d){var ve=d;return s().createElement(ve,q({},me))}return s().createElement("input",q({},me))}));se.displayName="CurrencyInput";const ae=se,le=({label:e,help:t,hideLabelFromVision:n,value:i,onValueChange:o,...s})=>{const[l,c]=(0,a.useState)(i),{currency:h="USD"}=d(),u=(0,B.useInstanceId)(A.BaseControl,"wp-components-base-control");return(0,r.createElement)(A.BaseControl,{label:e,help:t,id:u,hideLabelFromVision:n},(0,r.createElement)(ae,{id:u,value:l,onValueChange:e=>{c(e),o(function(e){if(!e)return e;const t=new Intl.NumberFormat(window.navigator.language).formatToParts(1234.56);let n,i;for(const e of t)"group"===e.type?n=e.value:"decimal"===e.type&&(i=e.value);return e.replaceAll(n,"").replace(i,".")}(e))},className:"components-text-control__input",allowDecimals:!0,allowNegativeValue:!1,maxLength:9,intlConfig:{locale:window.navigator.language,currency:h},...s}))};function ce({contentLeft:e,contentMiddle:t,contentRight:n}){return(0,r.createElement)("header",{style:{height:"60px",display:"flex",justifyContent:"space-between",alignItems:"center",paddingLeft:"1rem",paddingRight:"1rem"}},(0,r.createElement)("section",{style:{flex:1,display:"flex",gap:"0.5rem",alignItems:"center",justifyContent:"flex-start",maxWidth:"33%"}},e),(0,r.createElement)("section",{style:{flex:1,textAlign:"center"}},t),(0,r.createElement)("section",{style:{flex:1,display:"flex",gap:"0.5rem",alignItems:"center",justifyContent:"flex-end",maxWidth:"33%"}},n))}const he="update_settings",de="update_blocks",ue="update_dirty",pe="update_transfer_state";function ge(e,t){switch(t.type){case he:return{...e,isDirty:!0,settings:{...e.settings,...t.settings}};case de:return{...e,isDirty:!0,blocks:t.blocks};case ue:return{...e,isDirty:t.isDirty};case pe:return{...e,isDirty:t.isDirty,transfer:{...e.transfer,...t.transfer}};default:return e}}function fe(e){return{type:he,settings:e}}function me(e){return{type:de,blocks:e}}function ve(e){return{type:ue,isDirty:e}}function we(e){return{type:pe,transfer:e}}const be=(0,r.createContext)(null);be.displayName="FormState";const ye=(0,r.createContext)(null);ye.displayName="FormStateDispatch";const Ce=({initialState:e,children:t})=>{const[n,i]=(0,r.useReducer)(ge,e);return(0,r.createElement)(be.Provider,{value:n},(0,r.createElement)(ye.Provider,{value:i},t))},$e=()=>(0,r.useContext)(be),xe=()=>(0,r.useContext)(ye),_e=()=>(0,r.createElement)(A.Slot,{name:"InspectorPopout"}),{Slot:Se,Fill:Ee}=(0,A.createSlotFill)("StandAloneBlockEditorSidebarInspector");function ke(){return(0,r.createElement)("div",{id:"sidebar-primary",className:"givewp-next-gen-sidebar givewp-next-gen-sidebar-primary",role:"region","aria-label":(0,m.__)("Standalone Block Editor advanced settings."),tabIndex:-1},(0,r.createElement)(_e,null),(0,r.createElement)("div",{className:"sidebar-panel"},(0,r.createElement)("div",{className:"block-editor-block-inspector"},(0,r.createElement)("h2",null,(0,m.__)("Block","give")),(0,r.createElement)(Se,{bubblesVirtually:!0}))))}window.givewp.form.settings={setFormSettings:fe,useFormState:$e,useFormStateDispatch:xe},(0,m.__)("Block"),ke.InspectorFill=Ee;const Ae=ke;function Le(){return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(A.PanelHeader,{label:(0,m.__)("List View","give")}),(0,r.createElement)(f.__experimentalListView,{showNestedBlocks:!0,expandNested:!0}))}function Me(){return(0,r.createElement)(A.SVG,{width:"14",height:"16",viewBox:"0 0 14 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)(A.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M7.00001 0C6.31001 0 5.15701 0.265 4.07201 0.56C2.96201 0.86 1.84301 1.215 1.18501 1.43C0.909897 1.52085 0.665996 1.68747 0.481322 1.9107C0.296648 2.13394 0.178693 2.40474 0.141005 2.692C-0.454995 7.169 0.928005 10.487 2.60601 12.682C3.31759 13.621 4.16603 14.4478 5.12301 15.135C5.50901 15.408 5.86701 15.617 6.17101 15.76C6.45101 15.892 6.75201 16 7.00001 16C7.24801 16 7.54801 15.892 7.82901 15.76C8.19549 15.5819 8.5461 15.3728 8.87701 15.135C9.834 14.4479 10.6824 13.621 11.394 12.682C13.072 10.487 14.455 7.169 13.859 2.692C13.8214 2.4046 13.7035 2.13364 13.5188 1.91023C13.3341 1.68683 13.0902 1.52003 12.815 1.429C11.8598 1.11581 10.8972 0.825729 9.92801 0.559C8.84301 0.266 7.69001 0 7.00001 0ZM7.00001 5C7.35424 4.99947 7.69724 5.12433 7.96824 5.35246C8.23924 5.58059 8.42076 5.89727 8.48065 6.24641C8.54054 6.59555 8.47493 6.95462 8.29544 7.26002C8.11595 7.56542 7.83417 7.79745 7.50001 7.915L7.88501 9.905C7.89901 9.97738 7.89684 10.052 7.87865 10.1234C7.86045 10.1948 7.82668 10.2614 7.77976 10.3182C7.73284 10.3751 7.67392 10.4209 7.60723 10.4523C7.54054 10.4837 7.46773 10.5 7.39401 10.5H6.60601C6.53237 10.4999 6.45967 10.4835 6.3931 10.452C6.32653 10.4205 6.26774 10.3747 6.22093 10.3179C6.17412 10.261 6.14044 10.1945 6.1223 10.1232C6.10416 10.0518 6.10201 9.9773 6.11601 9.905L6.50001 7.915C6.16584 7.79745 5.88406 7.56542 5.70457 7.26002C5.52508 6.95462 5.45947 6.59555 5.51936 6.24641C5.57925 5.89727 5.76077 5.58059 6.03177 5.35246C6.30277 5.12433 6.64577 4.99947 7.00001 5Z",fill:"#A6A6A6"}))}function Te(){return(0,r.createElement)(A.SVG,{width:"288",height:"282",viewBox:"0 0 288 282",fill:"none",xmlns:"http://www.w3.org/2000/SVG"},(0,r.createElement)(A.Path,{d:"M53 27H56L54.5 29L53 27ZM39 24H57C57.5304 24 58.0391 24.2107 58.4142 24.5858C58.7893 24.9609 59 25.4696 59 26V30C59 31.11 58.11 32 57 32H52V42C52 43.11 51.11 44 50 44H39C38.4696 44 37.9609 43.7893 37.5858 43.4142C37.2107 43.0391 37 42.5304 37 42V26C37 24.9 37.9 24 39 24ZM39 26V30H50V26H39ZM57 30V26H52V30H57ZM39 42H50V32H39V42ZM41 34H48V36H41V34ZM41 38H48V40H41V38Z",fill:"#A6A6A6"}),(0,r.createElement)(A.Path,{d:"M20.0508 68V59.5449H22.9512C25.459 59.5449 26.9414 61.1094 26.9414 63.7637V63.7754C26.9414 66.4355 25.4648 68 22.9512 68H20.0508ZM21.1055 67.0508H22.8809C24.7676 67.0508 25.8633 65.8438 25.8633 63.7871V63.7754C25.8633 61.7129 24.7559 60.4941 22.8809 60.4941H21.1055V67.0508ZM28.6406 68V61.6836H29.6602V62.6211H29.7539C29.9941 61.959 30.5859 61.5723 31.4414 61.5723C31.6348 61.5723 31.8516 61.5957 31.9512 61.6133V62.6035C31.7402 62.5684 31.5469 62.5449 31.3242 62.5449C30.3516 62.5449 29.6602 63.1602 29.6602 64.0859V68H28.6406ZM35.6309 68.1113C33.832 68.1113 32.7188 66.8691 32.7188 64.8477V64.8359C32.7188 62.8086 33.832 61.5723 35.6309 61.5723C37.4297 61.5723 38.543 62.8086 38.543 64.8359V64.8477C38.543 66.8691 37.4297 68.1113 35.6309 68.1113ZM35.6309 67.209C36.8262 67.209 37.5 66.3359 37.5 64.8477V64.8359C37.5 63.3418 36.8262 62.4746 35.6309 62.4746C34.4355 62.4746 33.7617 63.3418 33.7617 64.8359V64.8477C33.7617 66.3359 34.4355 67.209 35.6309 67.209ZM40.125 70.1094V61.6836H41.1445V62.6914H41.2383C41.625 61.9883 42.3281 61.5723 43.207 61.5723C44.8066 61.5723 45.8555 62.8672 45.8555 64.8359V64.8477C45.8555 66.8281 44.8125 68.1113 43.207 68.1113C42.3398 68.1113 41.584 67.6777 41.2383 67.0039H41.1445V70.1094H40.125ZM42.9727 67.209C44.127 67.209 44.8125 66.3184 44.8125 64.8477V64.8359C44.8125 63.3652 44.127 62.4746 42.9727 62.4746C41.8242 62.4746 41.1211 63.377 41.1211 64.8359V64.8477C41.1211 66.3066 41.8242 67.209 42.9727 67.209ZM49.7812 68.1113C48.1816 68.1113 47.1328 66.8164 47.1328 64.8477V64.8359C47.1328 62.8555 48.1758 61.5723 49.7812 61.5723C50.6484 61.5723 51.4043 62.0059 51.75 62.6797H51.8438V59.1758H52.8633V68H51.8438V66.9922H51.75C51.3633 67.6953 50.6602 68.1113 49.7812 68.1113ZM50.0156 67.209C51.1641 67.209 51.8672 66.3066 51.8672 64.8477V64.8359C51.8672 63.377 51.1641 62.4746 50.0156 62.4746C48.8613 62.4746 48.1758 63.3652 48.1758 64.8359V64.8477C48.1758 66.3184 48.8613 67.209 50.0156 67.209ZM57.416 68.1113C55.6172 68.1113 54.5039 66.8691 54.5039 64.8477V64.8359C54.5039 62.8086 55.6172 61.5723 57.416 61.5723C59.2148 61.5723 60.3281 62.8086 60.3281 64.8359V64.8477C60.3281 66.8691 59.2148 68.1113 57.416 68.1113ZM57.416 67.209C58.6113 67.209 59.2852 66.3359 59.2852 64.8477V64.8359C59.2852 63.3418 58.6113 62.4746 57.416 62.4746C56.2207 62.4746 55.5469 63.3418 55.5469 64.8359V64.8477C55.5469 66.3359 56.2207 67.209 57.416 67.209ZM62.8945 68L61.125 61.6836H62.1445L63.3867 66.7344H63.4805L64.8926 61.6836H65.8594L67.2715 66.7344H67.3652L68.6074 61.6836H69.6211L67.8516 68H66.8262L65.4141 63.1133H65.3203L63.9141 68H62.8945ZM70.9688 68V61.6836H71.9883V62.6328H72.082C72.3984 61.9648 72.9902 61.5723 73.9219 61.5723C75.3398 61.5723 76.1309 62.4102 76.1309 63.9102V68H75.1113V64.1562C75.1113 63.0195 74.6426 62.4746 73.6348 62.4746C72.627 62.4746 71.9883 63.1543 71.9883 64.2617V68H70.9688Z",fill:"#A6A6A6"}),(0,r.createElement)(A.Path,{d:"M153 34L141 34M153 28L141 28M153 40L141 40M137 34C137 34.5523 136.552 35 136 35C135.448 35 135 34.5523 135 34C135 33.4477 135.448 33 136 33C136.552 33 137 33.4477 137 34ZM137 28C137 28.5523 136.552 29 136 29C135.448 29 135 28.5523 135 28C135 27.4477 135.448 27 136 27C136.552 27 137 27.4477 137 28ZM137 40C137 40.5523 136.552 41 136 41C135.448 41 135 40.5523 135 40C135 39.4477 135.448 39 136 39C136.552 39 137 39.4477 137 40Z",stroke:"#A6A6A6",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.createElement)(A.Path,{d:"M111.211 68V59.5449H112.436L115.33 66.5996H115.424L118.318 59.5449H119.543V68H118.559V61.543H118.494L115.822 68H114.932L112.26 61.543H112.195V68H111.211ZM123.686 68.1113C122.25 68.1113 121.512 67.2676 121.512 65.7734V61.6836H122.531V65.5273C122.531 66.6641 122.941 67.209 123.949 67.209C125.062 67.209 125.654 66.5293 125.654 65.4219V61.6836H126.674V68H125.654V67.0566H125.561C125.25 67.7305 124.611 68.1113 123.686 68.1113ZM128.637 68V59.1758H129.656V68H128.637ZM133.857 68.0469C132.557 68.0469 132.012 67.5664 132.012 66.3594V62.5273H131.016V61.6836H132.012V60.0488H133.066V61.6836H134.449V62.5273H133.066V66.1016C133.066 66.8457 133.324 67.1445 133.98 67.1445C134.162 67.1445 134.262 67.1387 134.449 67.1211V67.9883C134.25 68.0234 134.057 68.0469 133.857 68.0469ZM136.512 60.4648C136.125 60.4648 135.809 60.1484 135.809 59.7617C135.809 59.375 136.125 59.0586 136.512 59.0586C136.898 59.0586 137.215 59.375 137.215 59.7617C137.215 60.1484 136.898 60.4648 136.512 60.4648ZM135.996 68V61.6836H137.016V68H135.996ZM138.85 65.0703V64.1211H142.787V65.0703H138.85ZM146.766 68.1113C145.359 68.1113 144.393 67.4316 144.275 66.3887H145.318C145.488 66.916 145.992 67.2617 146.801 67.2617C147.65 67.2617 148.254 66.8574 148.254 66.2832V66.2715C148.254 65.8438 147.932 65.5449 147.152 65.3574L146.174 65.123C144.99 64.8418 144.457 64.3262 144.457 63.418V63.4121C144.457 62.3633 145.465 61.5723 146.807 61.5723C148.131 61.5723 149.051 62.2344 149.191 63.2656H148.189C148.055 62.7676 147.562 62.4219 146.801 62.4219C146.051 62.4219 145.5 62.8086 145.5 63.3652V63.377C145.5 63.8047 145.816 64.0742 146.561 64.2559L147.533 64.4902C148.723 64.7773 149.297 65.293 149.297 66.1953V66.207C149.297 67.332 148.201 68.1113 146.766 68.1113ZM153.457 68.1113C151.652 68.1113 150.562 66.8457 150.562 64.8652V64.8594C150.562 62.9082 151.676 61.5723 153.393 61.5723C155.109 61.5723 156.152 62.8496 156.152 64.7363V65.1348H151.605C151.635 66.4414 152.355 67.2031 153.48 67.2031C154.336 67.2031 154.863 66.7988 155.033 66.418L155.057 66.3652H156.076L156.064 66.4121C155.848 67.2676 154.945 68.1113 153.457 68.1113ZM153.387 62.4805C152.449 62.4805 151.734 63.1191 151.623 64.3203H155.115C155.01 63.0723 154.318 62.4805 153.387 62.4805ZM157.793 68V59.1758H158.812V68H157.793ZM163.348 68.1113C161.543 68.1113 160.453 66.8457 160.453 64.8652V64.8594C160.453 62.9082 161.566 61.5723 163.283 61.5723C165 61.5723 166.043 62.8496 166.043 64.7363V65.1348H161.496C161.525 66.4414 162.246 67.2031 163.371 67.2031C164.227 67.2031 164.754 66.7988 164.924 66.418L164.947 66.3652H165.967L165.955 66.4121C165.738 67.2676 164.836 68.1113 163.348 68.1113ZM163.277 62.4805C162.34 62.4805 161.625 63.1191 161.514 64.3203H165.006C164.9 63.0723 164.209 62.4805 163.277 62.4805ZM170.209 68.1113C168.439 68.1113 167.309 66.8281 167.309 64.8242V64.8125C167.309 62.8496 168.434 61.5723 170.203 61.5723C171.738 61.5723 172.658 62.457 172.846 63.582L172.852 63.6172H171.838L171.832 63.5996C171.674 62.9785 171.111 62.4746 170.203 62.4746C169.066 62.4746 168.352 63.3887 168.352 64.8125V64.8242C168.352 66.2773 169.078 67.209 170.203 67.209C171.053 67.209 171.592 66.834 171.826 66.1309L171.838 66.0957L172.846 66.0898L172.834 66.1543C172.576 67.2969 171.727 68.1113 170.209 68.1113ZM176.701 68.0469C175.4 68.0469 174.855 67.5664 174.855 66.3594V62.5273H173.859V61.6836H174.855V60.0488H175.91V61.6836H177.293V62.5273H175.91V66.1016C175.91 66.8457 176.168 67.1445 176.824 67.1445C177.006 67.1445 177.105 67.1387 177.293 67.1211V67.9883C177.094 68.0234 176.9 68.0469 176.701 68.0469Z",fill:"#A6A6A6"}),(0,r.createElement)(A.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M244.056 43.8806C240.862 42.9743 237.85 41.2639 235.338 38.7523C232.826 36.2406 231.116 33.2277 230.21 30.0345C230.204 30.0156 230.199 29.9968 230.194 29.9782C230.046 29.4592 229.932 29.0567 229.93 28.5048C229.928 27.874 230.134 27.0838 230.443 26.5338C230.974 25.5881 232.115 24.376 233.1 23.8776C233.951 23.447 234.957 23.447 235.808 23.8776C236.65 24.3036 237.588 25.2572 238.111 26.0615C238.758 27.0558 238.758 28.3377 238.111 29.332C237.938 29.5985 237.691 29.845 237.404 30.1311C237.315 30.2203 237.217 30.2846 237.282 30.4205C237.93 31.7698 238.813 33.0354 239.934 34.1561C241.055 35.2768 242.32 36.1603 243.67 36.8081C243.81 36.8756 243.866 36.7792 243.959 36.6858C244.245 36.3991 244.492 36.1522 244.758 35.979C245.753 35.3325 247.034 35.3325 248.029 35.979C248.811 36.4879 249.79 37.4465 250.213 38.2821C250.643 39.1335 250.643 40.1389 250.213 40.9902C249.714 41.9755 248.502 43.1163 247.556 43.6476C247.006 43.9565 246.216 44.162 245.585 44.1601C245.034 44.1585 244.631 44.0441 244.112 43.8966C244.093 43.8913 244.075 43.886 244.056 43.8806Z",fill:"#A6A6A6"}),(0,r.createElement)(A.Path,{d:"M223.254 68V59.5449H226.441C228.029 59.5449 229.154 60.6406 229.154 62.2461V62.2578C229.154 63.8633 228.029 64.9824 226.441 64.9824H224.309V68H223.254ZM226.172 60.4824H224.309V64.0449H226.172C227.379 64.0449 228.076 63.3828 228.076 62.2695V62.2578C228.076 61.1445 227.379 60.4824 226.172 60.4824ZM230.812 68V59.1758H231.832V62.6328H231.926C232.242 61.9648 232.834 61.5723 233.766 61.5723C235.184 61.5723 235.975 62.4102 235.975 63.9102V68H234.955V64.1562C234.955 63.0195 234.486 62.4746 233.479 62.4746C232.471 62.4746 231.832 63.1543 231.832 64.2617V68H230.812ZM240.416 68.1113C238.617 68.1113 237.504 66.8691 237.504 64.8477V64.8359C237.504 62.8086 238.617 61.5723 240.416 61.5723C242.215 61.5723 243.328 62.8086 243.328 64.8359V64.8477C243.328 66.8691 242.215 68.1113 240.416 68.1113ZM240.416 67.209C241.611 67.209 242.285 66.3359 242.285 64.8477V64.8359C242.285 63.3418 241.611 62.4746 240.416 62.4746C239.221 62.4746 238.547 63.3418 238.547 64.8359V64.8477C238.547 66.3359 239.221 67.209 240.416 67.209ZM244.91 68V61.6836H245.93V62.6328H246.023C246.34 61.9648 246.932 61.5723 247.863 61.5723C249.281 61.5723 250.072 62.4102 250.072 63.9102V68H249.053V64.1562C249.053 63.0195 248.584 62.4746 247.576 62.4746C246.568 62.4746 245.93 63.1543 245.93 64.2617V68H244.91ZM254.496 68.1113C252.691 68.1113 251.602 66.8457 251.602 64.8652V64.8594C251.602 62.9082 252.715 61.5723 254.432 61.5723C256.148 61.5723 257.191 62.8496 257.191 64.7363V65.1348H252.645C252.674 66.4414 253.395 67.2031 254.52 67.2031C255.375 67.2031 255.902 66.7988 256.072 66.418L256.096 66.3652H257.115L257.104 66.4121C256.887 67.2676 255.984 68.1113 254.496 68.1113ZM254.426 62.4805C253.488 62.4805 252.773 63.1191 252.662 64.3203H256.154C256.049 63.0723 255.357 62.4805 254.426 62.4805Z",fill:"#A6A6A6"}),(0,r.createElement)(A.Path,{d:"M38 123L46.1649 128.715C46.8261 129.178 47.1567 129.41 47.5163 129.499C47.8339 129.578 48.1661 129.578 48.4837 129.499C48.8433 129.41 49.1739 129.178 49.8351 128.715L58 123M42.8 136H53.2C54.8802 136 55.7202 136 56.362 135.673C56.9265 135.385 57.3854 134.926 57.673 134.362C58 133.72 58 132.88 58 131.2V124.8C58 123.12 58 122.28 57.673 121.638C57.3854 121.074 56.9265 120.615 56.362 120.327C55.7202 120 54.8802 120 53.2 120H42.8C41.1198 120 40.2798 120 39.638 120.327C39.0735 120.615 38.6146 121.074 38.327 121.638C38 122.28 38 123.12 38 124.8V131.2C38 132.88 38 133.72 38.327 134.362C38.6146 134.926 39.0735 135.385 39.638 135.673C40.2798 136 41.1198 136 42.8 136Z",stroke:"#A6A6A6",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.createElement)(A.Path,{d:"M33.9727 162V153.545H39.2109V154.494H35.0273V157.207H38.9941V158.145H35.0273V161.051H39.2109V162H33.9727ZM40.9922 162V155.684H42.0117V156.645H42.1055C42.3867 155.965 42.9844 155.572 43.8105 155.572C44.666 155.572 45.2637 156.023 45.5566 156.68H45.6504C45.9902 156.012 46.7109 155.572 47.584 155.572C48.873 155.572 49.5938 156.311 49.5938 157.635V162H48.5742V157.869C48.5742 156.938 48.1465 156.475 47.2559 156.475C46.377 156.475 45.7969 157.137 45.7969 157.939V162H44.7773V157.711C44.7773 156.961 44.2617 156.475 43.4648 156.475C42.6387 156.475 42.0117 157.195 42.0117 158.086V162H40.9922ZM53.168 162.111C51.9668 162.111 51.0586 161.385 51.0586 160.236V160.225C51.0586 159.1 51.8906 158.449 53.3613 158.361L55.1719 158.25V157.676C55.1719 156.896 54.6973 156.475 53.7539 156.475C52.998 156.475 52.5 156.756 52.3359 157.248L52.3301 157.266H51.3105L51.3164 157.23C51.4805 156.24 52.4414 155.572 53.7891 155.572C55.3301 155.572 56.1914 156.363 56.1914 157.676V162H55.1719V161.068H55.0781C54.6797 161.742 54.0176 162.111 53.168 162.111ZM52.1016 160.213C52.1016 160.852 52.6465 161.227 53.3789 161.227C54.416 161.227 55.1719 160.547 55.1719 159.645V159.07L53.4844 159.176C52.5234 159.234 52.1016 159.574 52.1016 160.201V160.213ZM58.5938 154.465C58.207 154.465 57.8906 154.148 57.8906 153.762C57.8906 153.375 58.207 153.059 58.5938 153.059C58.9805 153.059 59.2969 153.375 59.2969 153.762C59.2969 154.148 58.9805 154.465 58.5938 154.465ZM58.0781 162V155.684H59.0977V162H58.0781ZM61.0781 162V153.176H62.0977V162H61.0781Z",fill:"#A6A6A6"}),(0,r.createElement)(A.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M149 118C149 117.448 148.552 117 148 117C147.448 117 147 117.448 147 118V119H141V118C141 117.448 140.552 117 140 117C139.448 117 139 117.448 139 118V119.002C138.525 119.005 138.109 119.015 137.748 119.044C137.186 119.09 136.669 119.189 136.184 119.436C135.431 119.819 134.819 120.431 134.436 121.184C134.189 121.669 134.09 122.186 134.044 122.748C134 123.289 134 123.954 134 124.759V133.241C134 134.046 134 134.711 134.044 135.252C134.09 135.814 134.189 136.331 134.436 136.816C134.819 137.569 135.431 138.181 136.184 138.564C136.669 138.811 137.186 138.91 137.748 138.956C138.289 139 138.954 139 139.759 139H148.241C149.046 139 149.711 139 150.252 138.956C150.814 138.91 151.331 138.811 151.816 138.564C152.569 138.181 153.181 137.569 153.564 136.816C153.811 136.331 153.91 135.814 153.956 135.252C154 134.711 154 134.046 154 133.241V124.759C154 123.954 154 123.289 153.956 122.748C153.91 122.186 153.811 121.669 153.564 121.184C153.181 120.431 152.569 119.819 151.816 119.436C151.331 119.189 150.814 119.09 150.252 119.044C149.891 119.015 149.475 119.005 149 119.002V118ZM139 122V121.002C138.554 121.005 138.205 121.014 137.911 121.038C137.473 121.073 137.248 121.138 137.092 121.218C136.716 121.41 136.41 121.716 136.218 122.092C136.138 122.248 136.073 122.473 136.038 122.911C136.001 123.361 136 123.943 136 124.8V125H152V124.8C152 123.943 151.999 123.361 151.962 122.911C151.927 122.473 151.862 122.248 151.782 122.092C151.59 121.716 151.284 121.41 150.908 121.218C150.752 121.138 150.527 121.073 150.089 121.038C149.795 121.014 149.446 121.005 149 121.002V122C149 122.552 148.552 123 148 123C147.448 123 147 122.552 147 122V121H141V122C141 122.552 140.552 123 140 123C139.448 123 139 122.552 139 122ZM144.472 128.118C144.797 128.292 145 128.631 145 129V133H145.25C145.802 133 146.25 133.448 146.25 134C146.25 134.552 145.802 135 145.25 135H142.75C142.198 135 141.75 134.552 141.75 134C141.75 133.448 142.198 133 142.75 133H143V130.866C142.547 131.128 141.962 130.996 141.668 130.555C141.362 130.095 141.486 129.474 141.945 129.168L143.445 128.168C143.752 127.963 144.147 127.944 144.472 128.118Z",fill:"#A6A6A6"}),(0,r.createElement)(A.Path,{d:"M131.848 162V153.545H134.748C137.256 153.545 138.738 155.109 138.738 157.764V157.775C138.738 160.436 137.262 162 134.748 162H131.848ZM132.902 161.051H134.678C136.564 161.051 137.66 159.844 137.66 157.787V157.775C137.66 155.713 136.553 154.494 134.678 154.494H132.902V161.051ZM142.172 162.111C140.971 162.111 140.062 161.385 140.062 160.236V160.225C140.062 159.1 140.895 158.449 142.365 158.361L144.176 158.25V157.676C144.176 156.896 143.701 156.475 142.758 156.475C142.002 156.475 141.504 156.756 141.34 157.248L141.334 157.266H140.314L140.32 157.23C140.484 156.24 141.445 155.572 142.793 155.572C144.334 155.572 145.195 156.363 145.195 157.676V162H144.176V161.068H144.082C143.684 161.742 143.021 162.111 142.172 162.111ZM141.105 160.213C141.105 160.852 141.65 161.227 142.383 161.227C143.42 161.227 144.176 160.547 144.176 159.645V159.07L142.488 159.176C141.527 159.234 141.105 159.574 141.105 160.201V160.213ZM149.303 162.047C148.002 162.047 147.457 161.566 147.457 160.359V156.527H146.461V155.684H147.457V154.049H148.512V155.684H149.895V156.527H148.512V160.102C148.512 160.846 148.77 161.145 149.426 161.145C149.607 161.145 149.707 161.139 149.895 161.121V161.988C149.695 162.023 149.502 162.047 149.303 162.047ZM153.902 162.111C152.098 162.111 151.008 160.846 151.008 158.865V158.859C151.008 156.908 152.121 155.572 153.838 155.572C155.555 155.572 156.598 156.85 156.598 158.736V159.135H152.051C152.08 160.441 152.801 161.203 153.926 161.203C154.781 161.203 155.309 160.799 155.479 160.418L155.502 160.365H156.521L156.51 160.412C156.293 161.268 155.391 162.111 153.902 162.111ZM153.832 156.48C152.895 156.48 152.18 157.119 152.068 158.32H155.561C155.455 157.072 154.764 156.48 153.832 156.48Z",fill:"#A6A6A6"}),(0,r.createElement)(A.Path,{d:"M247.41 123.41L242.58 118.58C242.21 118.21 241.7 118 241.17 118H234C232.9 118 232.01 118.9 232.01 120L232 136C232 137.1 232.89 138 233.99 138H246C247.1 138 248 137.1 248 136V124.83C248 124.3 247.79 123.79 247.41 123.41ZM242.8 131H241V134C241 134.55 240.55 135 240 135C239.45 135 239 134.55 239 134V131H237.21C236.76 131 236.54 130.46 236.86 130.15L239.66 127.36C239.86 127.17 240.17 127.17 240.37 127.36L243.16 130.15C243.46 130.46 243.24 131 242.8 131ZM242 125C241.45 125 241 124.55 241 124V119.5L246.5 125H242Z",fill:"#A6A6A6"}),(0,r.createElement)(A.Path,{d:"M210.305 162V153.545H215.438V154.494H211.359V157.4H215.104V158.338H211.359V162H210.305ZM217.582 154.465C217.195 154.465 216.879 154.148 216.879 153.762C216.879 153.375 217.195 153.059 217.582 153.059C217.969 153.059 218.285 153.375 218.285 153.762C218.285 154.148 217.969 154.465 217.582 154.465ZM217.066 162V155.684H218.086V162H217.066ZM220.066 162V153.176H221.086V162H220.066ZM225.621 162.111C223.816 162.111 222.727 160.846 222.727 158.865V158.859C222.727 156.908 223.84 155.572 225.557 155.572C227.273 155.572 228.316 156.85 228.316 158.736V159.135H223.77C223.799 160.441 224.52 161.203 225.645 161.203C226.5 161.203 227.027 160.799 227.197 160.418L227.221 160.365H228.24L228.229 160.412C228.012 161.268 227.109 162.111 225.621 162.111ZM225.551 156.48C224.613 156.48 223.898 157.119 223.787 158.32H227.279C227.174 157.072 226.482 156.48 225.551 156.48ZM235.389 162.111C233.953 162.111 233.215 161.268 233.215 159.773V155.684H234.234V159.527C234.234 160.664 234.645 161.209 235.652 161.209C236.766 161.209 237.357 160.529 237.357 159.422V155.684H238.377V162H237.357V161.057H237.264C236.953 161.73 236.314 162.111 235.389 162.111ZM240.281 164.109V155.684H241.301V156.691H241.395C241.781 155.988 242.484 155.572 243.363 155.572C244.963 155.572 246.012 156.867 246.012 158.836V158.848C246.012 160.828 244.969 162.111 243.363 162.111C242.496 162.111 241.74 161.678 241.395 161.004H241.301V164.109H240.281ZM243.129 161.209C244.283 161.209 244.969 160.318 244.969 158.848V158.836C244.969 157.365 244.283 156.475 243.129 156.475C241.98 156.475 241.277 157.377 241.277 158.836V158.848C241.277 160.307 241.98 161.209 243.129 161.209ZM247.664 162V153.176H248.684V162H247.664ZM253.236 162.111C251.438 162.111 250.324 160.869 250.324 158.848V158.836C250.324 156.809 251.438 155.572 253.236 155.572C255.035 155.572 256.148 156.809 256.148 158.836V158.848C256.148 160.869 255.035 162.111 253.236 162.111ZM253.236 161.209C254.432 161.209 255.105 160.336 255.105 158.848V158.836C255.105 157.342 254.432 156.475 253.236 156.475C252.041 156.475 251.367 157.342 251.367 158.836V158.848C251.367 160.336 252.041 161.209 253.236 161.209ZM259.465 162.111C258.264 162.111 257.355 161.385 257.355 160.236V160.225C257.355 159.1 258.188 158.449 259.658 158.361L261.469 158.25V157.676C261.469 156.896 260.994 156.475 260.051 156.475C259.295 156.475 258.797 156.756 258.633 157.248L258.627 157.266H257.607L257.613 157.23C257.777 156.24 258.738 155.572 260.086 155.572C261.627 155.572 262.488 156.363 262.488 157.676V162H261.469V161.068H261.375C260.977 161.742 260.314 162.111 259.465 162.111ZM258.398 160.213C258.398 160.852 258.943 161.227 259.676 161.227C260.713 161.227 261.469 160.547 261.469 159.645V159.07L259.781 159.176C258.82 159.234 258.398 159.574 258.398 160.201V160.213ZM266.684 162.111C265.084 162.111 264.035 160.816 264.035 158.848V158.836C264.035 156.855 265.078 155.572 266.684 155.572C267.551 155.572 268.307 156.006 268.652 156.68H268.746V153.176H269.766V162H268.746V160.992H268.652C268.266 161.695 267.562 162.111 266.684 162.111ZM266.918 161.209C268.066 161.209 268.77 160.307 268.77 158.848V158.836C268.77 157.377 268.066 156.475 266.918 156.475C265.764 156.475 265.078 157.365 265.078 158.836V158.848C265.078 160.318 265.764 161.209 266.918 161.209Z",fill:"#A6A6A6"}),(0,r.createElement)(A.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M42 222C42 221.448 42.4477 221 43 221L53 221C53.5523 221 54 221.448 54 222C54 222.552 53.5523 223 53 223L43 223C42.4477 223 42 222.552 42 222Z",fill:"#A6A6A6"}),(0,r.createElement)(A.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M43 218C40.7909 218 39 219.791 39 222C39 224.209 40.7909 226 43 226H45C45.5523 226 46 226.448 46 227C46 227.552 45.5523 228 45 228H43C39.6863 228 37 225.314 37 222C37 218.686 39.6863 216 43 216H45C45.5523 216 46 216.448 46 217C46 217.552 45.5523 218 45 218H43Z",fill:"#A6A6A6"}),(0,r.createElement)(A.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M50 217C50 216.448 50.4477 216 51 216H53C56.3137 216 59 218.686 59 222C59 225.314 56.3137 228 53 228H51C50.4477 228 50 227.552 50 227C50 226.448 50.4477 226 51 226H53C55.2091 226 57 224.209 57 222C57 219.791 55.2091 218 53 218H51C50.4477 218 50 217.552 50 217Z",fill:"#A6A6A6"}),(0,r.createElement)(A.Path,{d:"M40.6758 256.199C38.5781 256.199 37.3125 254.934 37.3125 253.094V247.545H38.3672V253.023C38.3672 254.324 39.2109 255.227 40.6758 255.227C42.1406 255.227 42.9727 254.324 42.9727 253.023V247.545H44.0273V253.094C44.0273 254.934 42.7734 256.199 40.6758 256.199ZM46.1719 256V247.545H49.4004C51.0293 247.545 52.0957 248.541 52.0957 250.059V250.07C52.0957 251.242 51.457 252.156 50.3965 252.49L52.3535 256H51.1172L49.3066 252.654H47.2266V256H46.1719ZM47.2266 251.717H49.3066C50.3906 251.717 51.0059 251.137 51.0059 250.105V250.094C51.0059 249.086 50.3496 248.482 49.2598 248.482H47.2266V251.717ZM54.0117 256V247.545H55.0664V255.051H59.1445V256H54.0117Z",fill:"#A6A6A6"}),(0,r.createElement)(A.Path,{d:"M149 227L154 222L149 217M139 217L134 222L139 227M146 213L142 231",stroke:"#A6A6A6",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.createElement)(A.Path,{d:"M128.168 256V247.545H129.223V251.201H133.863V247.545H134.918V256H133.863V252.15H129.223V256H128.168ZM139.271 256V248.494H136.547V247.545H143.051V248.494H140.326V256H139.271ZM144.68 256V247.545H145.904L148.799 254.6H148.893L151.787 247.545H153.012V256H152.027V249.543H151.963L149.291 256H148.4L145.729 249.543H145.664V256H144.68ZM155.168 256V247.545H156.223V255.051H160.301V256H155.168Z",fill:"#A6A6A6"}),(0,r.createElement)(A.Path,{opacity:"0.12",d:"M237 222C237 223.657 238.343 225 240 225C240.828 225 241.578 224.664 242.121 224.122L237.879 219.879C237.336 220.422 237 221.172 237 222Z",fill:"#A6A6A6"}),(0,r.createElement)(A.Path,{d:"M238.743 215.092C239.149 215.032 239.568 215 240 215C245.105 215 248.455 219.505 249.58 221.287C249.717 221.503 249.785 221.61 249.823 221.777C249.851 221.902 249.851 222.099 249.823 222.224C249.785 222.39 249.716 222.498 249.579 222.716C249.279 223.19 248.822 223.857 248.216 224.58M234.724 216.715C232.562 218.182 231.094 220.219 230.421 221.285C230.284 221.502 230.216 221.61 230.177 221.776C230.149 221.901 230.149 222.098 230.177 222.223C230.215 222.39 230.284 222.498 230.42 222.713C231.545 224.495 234.895 229 240 229C242.058 229 243.832 228.268 245.288 227.277M231 213L249 231M237.879 219.879C237.336 220.422 237 221.172 237 222C237 223.657 238.343 225 240 225C240.828 225 241.578 224.664 242.121 224.121",stroke:"#A6A6A6",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.createElement)(A.Path,{d:"M220.84 256V247.545H221.895V251.201H226.535V247.545H227.59V256H226.535V252.15H221.895V256H220.84ZM230.156 248.465C229.77 248.465 229.453 248.148 229.453 247.762C229.453 247.375 229.77 247.059 230.156 247.059C230.543 247.059 230.859 247.375 230.859 247.762C230.859 248.148 230.543 248.465 230.156 248.465ZM229.641 256V249.684H230.66V256H229.641ZM234.914 256.111C233.314 256.111 232.266 254.816 232.266 252.848V252.836C232.266 250.855 233.309 249.572 234.914 249.572C235.781 249.572 236.537 250.006 236.883 250.68H236.977V247.176H237.996V256H236.977V254.992H236.883C236.496 255.695 235.793 256.111 234.914 256.111ZM235.148 255.209C236.297 255.209 237 254.307 237 252.848V252.836C237 251.377 236.297 250.475 235.148 250.475C233.994 250.475 233.309 251.365 233.309 252.836V252.848C233.309 254.318 233.994 255.209 235.148 255.209ZM242.285 256.111C240.686 256.111 239.637 254.816 239.637 252.848V252.836C239.637 250.855 240.68 249.572 242.285 249.572C243.152 249.572 243.908 250.006 244.254 250.68H244.348V247.176H245.367V256H244.348V254.992H244.254C243.867 255.695 243.164 256.111 242.285 256.111ZM242.52 255.209C243.668 255.209 244.371 254.307 244.371 252.848V252.836C244.371 251.377 243.668 250.475 242.52 250.475C241.365 250.475 240.68 251.365 240.68 252.836V252.848C240.68 254.318 241.365 255.209 242.52 255.209ZM249.902 256.111C248.098 256.111 247.008 254.846 247.008 252.865V252.859C247.008 250.908 248.121 249.572 249.838 249.572C251.555 249.572 252.598 250.85 252.598 252.736V253.135H248.051C248.08 254.441 248.801 255.203 249.926 255.203C250.781 255.203 251.309 254.799 251.479 254.418L251.502 254.365H252.521L252.51 254.412C252.293 255.268 251.391 256.111 249.902 256.111ZM249.832 250.48C248.895 250.48 248.18 251.119 248.068 252.32H251.561C251.455 251.072 250.764 250.48 249.832 250.48ZM254.18 256V249.684H255.199V250.633H255.293C255.609 249.965 256.201 249.572 257.133 249.572C258.551 249.572 259.342 250.41 259.342 251.91V256H258.322V252.156C258.322 251.02 257.854 250.475 256.846 250.475C255.838 250.475 255.199 251.154 255.199 252.262V256H254.18Z",fill:"#A6A6A6"}))}function Re(){return(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:"block-editor-inserter__panel-header"},(0,r.createElement)("h2",{className:"block-editor-inserter__panel-title block-editor-inserter__panel-additional-fields-header"},(0,m.__)("Additional Fields","give"),(0,r.createElement)(Me,null))),(0,r.createElement)("div",{className:"block-editor-inserter__panel-content"},(0,r.createElement)("a",{className:"block-editor-inserter__panel-content-link",href:"https://docs.givewp.com/vb-add-fields",target:"_blank",rel:"noopener noreferrer"},(0,m.__)("Upgrade to unlock additional fields","give")),(0,r.createElement)(Te,null)))}const Ie=()=>{const{formFieldManagerData:{isInstalled:e}}=d();return(0,r.createElement)("div",null,(0,r.createElement)(f.__experimentalLibrary,{showInserterHelpPanel:!1}),!e&&(0,r.createElement)(Re,null))},Oe=({selected:e})=>{const t={add:Ie,list:Le}[e];return(0,r.createElement)("div",{id:"sidebar-secondary",className:"givewp-next-gen-sidebar givewp-next-gen-sidebar-secondary",role:"region","aria-label":(0,m.__)("Standalone Block Editor advanced settings."),tabIndex:-1},(0,r.createElement)(t,null))},Ne=window.wp.primitives,De=(0,r.createElement)(Ne.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(Ne.Path,{d:"M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z"})),Pe=({label:e,value:t,onChange:n,help:i})=>{let o;return M().noConflict(),(0,r.createElement)(A.BaseControl,{label:e,help:i},(0,r.createElement)("div",{className:"email-settings__logo-upload"},(0,r.createElement)("input",{type:"url",value:t,onChange:n,className:"components-text-control__input",style:{flex:1}}),(0,r.createElement)(A.Button,{className:"email-settings__logo-upload__button",icon:De,variant:"secondary",onClick:e=>{e.preventDefault(),o||(o=window.wp.media({title:(0,m.__)("Add or upload file","give"),button:{text:(0,m.__)("Use this media","gie")},multiple:!1}),o.on("select",(function(){var e=o.state().get("selection").first().toJSON();n(e.url)}))),o.open()}},(0,m.__)("Add or upload file","give"))))},Fe=window.wp.keyboardShortcuts;var He=n(4184),Be=n.n(He);function We({children:e,className:t,ariaLabel:n,as:i="div",...o}){return(0,a.createElement)(i,{className:Be()("interface-navigable-region",t),"aria-label":n,role:"region",tabIndex:"-1",...o},e)}const ze={hidden:{opacity:0},hover:{opacity:1,transition:{type:"tween",delay:.2,delayChildren:.2}},distractionFreeInactive:{opacity:1,transition:{delay:0}}},Ve=(0,a.forwardRef)((function({isDistractionFree:e,footer:t,header:n,editorNotices:i,sidebar:o,secondarySidebar:r,notices:s,content:l,actions:c,labels:h,className:d,enableRegionNavigation:u=!0,shortcuts:p},g){const f=(0,A.__unstableUseNavigateRegions)(p);!function(e){(0,a.useEffect)((()=>{const t=document&&document.querySelector(`html:not(.${e})`);if(t)return t.classList.toggle(e),()=>{t.classList.toggle(e)}}),[e])}("interface-interface-skeleton__html-container");const v={ /* translators: accessibility text for the top bar landmark region. */ header:(0,m.__)("Header"), /* translators: accessibility text for the content landmark region. */ body:(0,m.__)("Content"), /* translators: accessibility text for the secondary sidebar landmark region. */ secondarySidebar:(0,m.__)("Block Library"), /* translators: accessibility text for the settings landmark region. */ sidebar:(0,m.__)("Settings"), /* translators: accessibility text for the publish landmark region. */ actions:(0,m.__)("Publish"), /* translators: accessibility text for the footer landmark region. */ footer:(0,m.__)("Footer"),...h};return(0,a.createElement)("div",{...u?f:{},ref:(0,B.useMergeRefs)([g,u?f.ref:void 0]),className:Be()(d,"interface-interface-skeleton",f.className,!!t&&"has-footer")},(0,a.createElement)("div",{className:"interface-interface-skeleton__editor"},!!n&&(0,a.createElement)(We,{as:A.__unstableMotion.div,className:"interface-interface-skeleton__header","aria-label":v.header,initial:e?"hidden":"distractionFreeInactive",whileHover:e?"hover":"distractionFreeInactive",animate:e?"hidden":"distractionFreeInactive",variants:ze,transition:e?{type:"tween",delay:.8}:void 0},n),e&&(0,a.createElement)("div",{className:"interface-interface-skeleton__header"},i),(0,a.createElement)("div",{className:"interface-interface-skeleton__body"},!!r&&(0,a.createElement)(We,{className:"interface-interface-skeleton__secondary-sidebar",ariaLabel:v.secondarySidebar},r),!!s&&(0,a.createElement)("div",{className:"interface-interface-skeleton__notices"},s),(0,a.createElement)(We,{className:"interface-interface-skeleton__content",ariaLabel:v.body},l),!!o&&(0,a.createElement)(We,{className:"interface-interface-skeleton__sidebar",ariaLabel:v.sidebar},o),!!c&&(0,a.createElement)(We,{className:"interface-interface-skeleton__actions",ariaLabel:v.actions},c))),!!t&&(0,a.createElement)(We,{className:"interface-interface-skeleton__footer",ariaLabel:v.footer},t))})),je=window.wp.deprecated;var Ue=n.n(je);const Ge=window.wp.preferences,Ke=(e,t)=>({type:"SET_DEFAULT_COMPLEMENTARY_AREA",scope:e,area:t}),Ze=(e,t)=>({registry:n,dispatch:i})=>{t&&(n.select(Ge.store).get(e,"isComplementaryAreaVisible")||n.dispatch(Ge.store).set(e,"isComplementaryAreaVisible",!0),i({type:"ENABLE_COMPLEMENTARY_AREA",scope:e,area:t}))},qe=e=>({registry:t})=>{t.select(Ge.store).get(e,"isComplementaryAreaVisible")&&t.dispatch(Ge.store).set(e,"isComplementaryAreaVisible",!1)},Ye=(e,t)=>({registry:n})=>{if(!t)return;const i=n.select(Ge.store).get(e,"pinnedItems");!0!==i?.[t]&&n.dispatch(Ge.store).set(e,"pinnedItems",{...i,[t]:!0})},Xe=(e,t)=>({registry:n})=>{if(!t)return;const i=n.select(Ge.store).get(e,"pinnedItems");n.dispatch(Ge.store).set(e,"pinnedItems",{...i,[t]:!1})};function Qe(e,t){return function({registry:n}){Ue()("dispatch( 'core/interface' ).toggleFeature",{since:"6.0",alternative:"dispatch( 'core/preferences' ).toggle"}),n.dispatch(Ge.store).toggle(e,t)}}function Je(e,t,n){return function({registry:i}){Ue()("dispatch( 'core/interface' ).setFeatureValue",{since:"6.0",alternative:"dispatch( 'core/preferences' ).set"}),i.dispatch(Ge.store).set(e,t,!!n)}}function et(e,t){return function({registry:n}){Ue()("dispatch( 'core/interface' ).setFeatureDefaults",{since:"6.0",alternative:"dispatch( 'core/preferences' ).setDefaults"}),n.dispatch(Ge.store).setDefaults(e,t)}}function tt(e){return{type:"OPEN_MODAL",name:e}}function nt(){return{type:"CLOSE_MODAL"}}const it=(0,w.createRegistrySelector)((e=>(t,n)=>{const i=e(Ge.store).get(n,"isComplementaryAreaVisible");if(void 0!==i)return!1===i?null:t?.complementaryAreas?.[n]})),ot=(0,w.createRegistrySelector)((e=>(t,n)=>{const i=e(Ge.store).get(n,"isComplementaryAreaVisible"),o=t?.complementaryAreas?.[n];return i&&void 0===o})),rt=(0,w.createRegistrySelector)((e=>(t,n,i)=>{var o;const r=e(Ge.store).get(n,"pinnedItems");return null===(o=r?.[i])||void 0===o||o})),st=(0,w.createRegistrySelector)((e=>(t,n,i)=>(Ue()("select( 'core/interface' ).isFeatureActive( scope, featureName )",{since:"6.0",alternative:"select( 'core/preferences' ).get( scope, featureName )"}),!!e(Ge.store).get(n,i))));function at(e,t){return e.activeModal===t}const lt=(0,w.combineReducers)({complementaryAreas:function(e={},t){switch(t.type){case"SET_DEFAULT_COMPLEMENTARY_AREA":{const{scope:n,area:i}=t;return e[n]?e:{...e,[n]:i}}case"ENABLE_COMPLEMENTARY_AREA":{const{scope:n,area:i}=t;return{...e,[n]:i}}}return e},activeModal:function(e=null,t){switch(t.type){case"OPEN_MODAL":return t.name;case"CLOSE_MODAL":return null}return e}}),ct=(0,w.createReduxStore)("core/interface",{reducer:lt,actions:i,selectors:o});(0,w.register)(ct);const ht=function(){return(0,r.createElement)("svg",{width:"36",height:"36",viewBox:"0 0 130 131",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)("g",{clipPath:"url(#clip0)"},(0,r.createElement)("path",{d:"M130 65.8535C130 29.9689 100.885 0.853516 65 0.853516C29.1154 0.853516 0 29.9689 0 65.8535C0 101.738 29.1154 130.854 65 130.854C100.885 130.854 130 101.738 130 65.8535Z",fill:"#66BB6A"}),(0,r.createElement)("mask",{id:"mask0","mask-type":"alpha",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"130",height:"131"},(0,r.createElement)("path",{d:"M130 65.8535C130 29.9689 100.885 0.853516 65 0.853516C29.1154 0.853516 0 29.9689 0 65.8535C0 101.738 29.1154 130.854 65 130.854C100.885 130.854 130 101.738 130 65.8535Z",fill:"black"})),(0,r.createElement)("g",{mask:"url(#mask0)"},(0,r.createElement)("path",{d:"M74.2303 70.4697C74.4995 71.0466 75.038 71.5466 75.038 71.5466C86.538 72.9697 102.807 71.3927 115.23 69.7004C108.115 84.9697 95.4226 95.2004 83.6919 95.2004C61.8457 95.2004 44.9226 68.662 44.9226 68.662C51.6919 62.662 62.8842 43.162 79.038 43.162C95.1919 43.162 102.192 52.0081 102.192 52.0081L104 49.162C104 49.162 96.4611 22.7773 75.1149 22.7773C53.7688 22.7773 31.1149 57.7389 17.8457 65.8158C17.8457 65.8158 36.0765 109.008 75.8842 109.008C109.346 109.008 117.73 77.0466 119.307 69.1235C123.769 68.4697 127.461 67.8158 129.923 67.3927C130.73 65.5466 131.653 62.3543 130.961 58.085C117.73 63.162 97.538 68.9312 73.8457 68.9312C73.8457 68.9312 73.9226 69.7389 74.2303 70.4697Z",fill:"white"}))),(0,r.createElement)("defs",null,(0,r.createElement)("clipPath",{id:"clip0"},(0,r.createElement)("path",{d:"M0 0.853516H130V130.854H0V0.853516Z",fill:"white"}))))},dt=()=>(0,r.createElement)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)("path",{d:"m14.5 15 3-3-3-3m-5 0-3 3 3 3m-1.7 6h8.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C21 18.72 21 17.88 21 16.2V7.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C18.72 3 17.88 3 16.2 3H7.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C3 5.28 3 6.12 3 7.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C5.28 21 6.12 21 7.8 21z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})),ut=()=>(0,r.createElement)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)("g",{clipPath:"url(#1n657i9cka)"},(0,r.createElement)("path",{d:"m5 8 2 2 4-4m3.667 2A6.667 6.667 0 1 1 1.333 8a6.667 6.667 0 0 1 13.334 0z",stroke:"#2271B1",strokeWidth:"1.333",strokeLinecap:"round",strokeLinejoin:"round"})),(0,r.createElement)("defs",null,(0,r.createElement)("clipPath",{id:"1n657i9cka"},(0,r.createElement)("path",{fill:"#fff",d:"M0 0h16v16H0z"})))),pt=()=>(0,r.createElement)("svg",{width:"14",height:"15",viewBox:"0 0 14 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)("path",{d:"M4.375 2.25h4.142c1.306 0 1.96 0 2.459.254.439.224.796.581 1.02 1.02.254.5.254 1.153.254 2.46v4.141M3.617 12.75h4.725c.653 0 .98 0 1.23-.127.219-.112.397-.29.51-.51.126-.25.126-.576.126-1.23V6.158c0-.653 0-.98-.127-1.23a1.167 1.167 0 0 0-.51-.51c-.25-.126-.576-.126-1.23-.126H3.618c-.654 0-.98 0-1.23.127-.22.112-.398.29-.51.51-.127.25-.127.576-.127 1.23v4.724c0 .654 0 .98.127 1.23.112.22.29.398.51.51.25.127.576.127 1.23.127z",stroke:"#007CBA","stroke-width":"1.167","stroke-linecap":"round","stroke-linejoin":"round"})),gt=()=>(0,r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},(0,r.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.9287 18C15.2424 18 17.9287 15.3137 17.9287 12C17.9287 8.68629 15.2424 6 11.9287 6C8.615 6 5.92871 8.68629 5.92871 12C5.92871 15.3137 8.615 18 11.9287 18ZM11.9287 15C13.5856 15 14.9287 13.6569 14.9287 12C14.9287 10.3431 13.5856 9 11.9287 9C10.2719 9 8.92871 10.3431 8.92871 12C8.92871 13.6569 10.2719 15 11.9287 15Z",fill:"#1E1E1E"}),(0,r.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.2758 4C10.787 4 10.3698 4.35341 10.2894 4.8356L9.92871 7H13.9287L13.568 4.8356C13.4876 4.35341 13.0704 4 12.5816 4H11.2758ZM12.5816 20C13.0704 20 13.4876 19.6466 13.568 19.1644L13.9287 17H9.92871L10.2894 19.1644C10.3698 19.6466 10.787 20 11.2758 20H12.5816Z",fill:"#1E1E1E"}),(0,r.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.53 7.43422C18.2856 7.01088 17.7709 6.82629 17.3132 6.99778L15.2584 7.76758L17.2584 11.2317L18.9524 9.83708C19.3298 9.52638 19.4273 8.98838 19.1829 8.56503L18.53 7.43422ZM5.32647 16.565C5.57089 16.9884 6.08555 17.173 6.54332 17.0015L8.59811 16.2317L6.59811 12.7676L4.90406 14.1622C4.52665 14.4729 4.42918 15.0109 4.6736 15.4342L5.32647 16.565Z",fill:"#1E1E1E"}),(0,r.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.67454 8.56578C4.43012 8.98912 4.52759 9.52713 4.90499 9.83782L6.59905 11.2324L8.59905 7.76832L6.54426 6.99852C6.08649 6.82703 5.57183 7.01162 5.32741 7.43497L4.67454 8.56578ZM19.1838 15.435C19.4282 15.0116 19.3308 14.4736 18.9534 14.1629L17.2593 12.7683L15.2593 16.2324L17.3141 17.0022C17.7719 17.1737 18.2865 16.9891 18.5309 16.5658L19.1838 15.435Z",fill:"#1E1E1E"})),ft=(0,r.createElement)(Ne.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(Ne.Path,{d:"M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z"})),mt=(0,r.createElement)(Ne.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(Ne.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4 14.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h8v13zm4.5-.5c0 .3-.2.5-.5.5h-2.5v-13H18c.3 0 .5.2.5.5v12z"})),vt=(0,r.createElement)(Ne.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(Ne.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})),wt={a:{content:9,self:!1,type:105},address:{invalid:["h1","h2","h3","h4","h5","h6","address","article","aside","section","div","header","footer"],self:!1},audio:{children:["track","source"]},br:{type:9,void:!0},body:{content:127},button:{content:8,type:105},caption:{content:1,parent:["table"]},col:{parent:["colgroup"],void:!0},colgroup:{children:["col"],parent:["table"]},details:{children:["summary"],type:97},dd:{content:1,parent:["dl"]},dl:{children:["dt","dd"],type:1},dt:{content:1,invalid:["footer","header"],parent:["dl"]},figcaption:{content:1,parent:["figure"]},footer:{invalid:["footer","header"]},header:{invalid:["footer","header"]},hr:{type:1,void:!0},img:{void:!0},li:{content:1,parent:["ul","ol","menu"]},main:{self:!1},ol:{children:["li"],type:1},picture:{children:["source","img"],type:25},rb:{parent:["ruby","rtc"]},rp:{parent:["ruby","rtc"]},rt:{content:8,parent:["ruby","rtc"]},rtc:{content:8,parent:["ruby"]},ruby:{children:["rb","rp","rt","rtc"]},source:{parent:["audio","video","picture"],void:!0},summary:{content:8,parent:["details"]},table:{children:["caption","colgroup","thead","tbody","tfoot","tr"],type:1},tbody:{parent:["table"],children:["tr"]},td:{content:1,parent:["tr"]},tfoot:{parent:["table"],children:["tr"]},th:{content:1,parent:["tr"]},thead:{parent:["table"],children:["tr"]},tr:{parent:["table","tbody","thead","tfoot"],children:["th","td"]},track:{parent:["audio","video"],void:!0},ul:{children:["li"],type:1},video:{children:["track","source"]},wbr:{type:9,void:!0}};function bt(e){return t=>{wt[t]={...e,...wt[t]}}}["address","main","div","figure","p","pre"].forEach(bt({content:1,type:65})),["abbr","b","bdi","bdo","cite","code","data","dfn","em","i","kbd","mark","q","ruby","samp","strong","sub","sup","time","u","var"].forEach(bt({content:8,type:73})),["p","pre"].forEach(bt({content:8,type:65})),["s","small","span","del","ins"].forEach(bt({content:8,type:9})),["article","aside","footer","header","nav","section","blockquote"].forEach(bt({content:1,type:67})),["h1","h2","h3","h4","h5","h6"].forEach(bt({content:8,type:69})),["audio","canvas","iframe","img","video"].forEach(bt({type:89}));const yt=Object.freeze(wt),Ct=["applet","base","body","command","embed","frame","frameset","head","html","link","meta","noscript","object","script","style","title"],$t=Object.keys(yt).filter((e=>"canvas"!==e&&"iframe"!==e)),xt=Object.freeze({alt:1,cite:1,class:1,colspan:3,controls:4,datetime:1,default:4,disabled:4,dir:1,height:1,href:1,id:1,kind:1,label:1,lang:1,loading:1,loop:4,media:1,muted:4,poster:1,rel:1,role:1,rowspan:3,scope:1,sizes:1,span:3,start:3,style:5,src:1,srclang:1,srcset:1,tabindex:1,target:1,title:1,type:1,width:1}),_t=Object.freeze({class:"className",colspan:"colSpan",datetime:"dateTime",rowspan:"rowSpan",srclang:"srcLang",srcset:"srcSet",tabindex:"tabIndex"});function St(){return St=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},St.apply(this,arguments)}function Et({attributes:e={},className:t,children:n=null,selfClose:i=!1,tagName:o}){const r=o;return i?s().createElement(r,St({className:t},e)):s().createElement(r,St({className:t},e),n)}class kt{attribute(e,t){return t}node(e,t){return t}}var At=n(5573),Lt=n.n(At);function Mt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Tt=/(url|image|image-set)\(/i;class Rt extends kt{attribute(e,t){return"style"===e&&Object.keys(t).forEach((e=>{String(t[e]).match(Tt)&&delete t[e]})),t}}const It=/^<(!doctype|(html|head|body)(\s|>))/i,Ot=/^(aria-|data-|\w+:)/iu,Nt=/{{{(\w+)\/?}}}/;function Dt(){if("undefined"!=typeof window&&"undefined"!=typeof document)return document.implementation.createHTMLDocument("Interweave")}class Pt{constructor(e,t={},n=[],i=[]){var o;Mt(this,"allowed",void 0),Mt(this,"banned",void 0),Mt(this,"blocked",void 0),Mt(this,"container",void 0),Mt(this,"content",[]),Mt(this,"props",void 0),Mt(this,"matchers",void 0),Mt(this,"filters",void 0),Mt(this,"keyIndex",void 0),this.props=t,this.matchers=n,this.filters=[...i,new Rt],this.keyIndex=-1,this.container=this.createContainer(e||""),this.allowed=new Set(null!==(o=t.allowList)&&void 0!==o?o:$t),this.banned=new Set(Ct),this.blocked=new Set(t.blockList)}applyAttributeFilters(e,t){return this.filters.reduce(((t,n)=>null!==t&&"function"==typeof n.attribute?n.attribute(e,t):t),t)}applyNodeFilters(e,t){return this.filters.reduce(((t,n)=>null!==t&&"function"==typeof n.node?n.node(e,t):t),t)}applyMatchers(e,t){const n={},{props:i}=this;let o=e,r=0,s=null;return this.matchers.forEach((e=>{const a=e.asTag().toLowerCase(),l=this.getTagConfig(a);if(i[e.inverseName]||!this.isTagAllowed(a))return;if(!this.canRenderChild(t,l))return;let c="";for(;o&&(s=e.match(o));){const{index:t,length:a,match:l,valid:h,void:d,...u}=s,p=e.propName+String(r);t>0&&(c+=o.slice(0,t)),h?(c+=d?`{{{${p}/}}}`:`{{{${p}}}}${l}{{{/${p}}}}`,this.keyIndex+=1,r+=1,n[p]={children:l,matcher:e,props:{...i,...u,key:this.keyIndex}}):c+=l,e.greedy?(o=c+o.slice(t+a),c=""):o=o.slice(t+(a||l.length))}e.greedy||(o=c+o)})),0===r?e:this.replaceTokens(o,n)}canRenderChild(e,t){return!(!e.tagName||!t.tagName)&&!e.void&&(e.children.length>0?e.children.includes(t.tagName):!(e.invalid.length>0&&e.invalid.includes(t.tagName))&&(t.parent.length>0?t.parent.includes(e.tagName):!(!e.self&&e.tagName===t.tagName)&&Boolean(e&&e.content&t.type)))}convertLineBreaks(e){const{noHtml:t,disableLineBreaks:n}=this.props;if(t||n||e.match(/<((?:\/[ a-z]+)|(?:[ a-z]+\/))>/gi))return e;let i=e.replace(/\r\n/g,"\n");return i=i.replace(/\n{3,}/g,"\n\n\n"),i=i.replace(/\n/g,"<br/>"),i}createContainer(e){var t;const i=(void 0!==n.g&&n.g.INTERWEAVE_SSR_POLYFILL||Dt)();if(!i)return;const o=null!==(t=this.props.containerTagName)&&void 0!==t?t:"body",r="body"===o||"fragment"===o?i.body:i.createElement(o);return e.match(It)||(r.innerHTML=this.convertLineBreaks(this.props.escapeHtml?Lt()(e):e)),r}extractAttributes(e){const{allowAttributes:t}=this.props,n={};let i=0;return 1===e.nodeType&&e.attributes?([...e.attributes].forEach((o=>{const{name:r,value:s}=o,a=r.toLowerCase(),l=xt[a]||xt[r];if(!this.isSafe(e))return;if(!a.match(Ot)&&(!t&&(!l||2===l)||a.startsWith("on")||s.replace(/(\s|\0|�([9AD]);)/,"").match(/(javascript|vbscript|livescript|xss):/i)))return;let c="style"===a?this.extractStyleAttribute(e):s;4===l?c=!0:3===l?c=Number.parseFloat(String(c)):5!==l&&(c=String(c)),n[_t[a]||a]=this.applyAttributeFilters(a,c),i+=1})),0===i?null:n):null}extractStyleAttribute(e){const t={};return Array.from(e.style).forEach((n=>{const i=e.style[n];"string"!=typeof i&&"number"!=typeof i||(t[n.replace(/-([a-z])/g,((e,t)=>String(t).toUpperCase()))]=i)})),t}getTagConfig(e){const t={children:[],content:0,invalid:[],parent:[],self:!0,tagName:"",type:0,void:!1};return yt[e]?{...t,...yt[e],tagName:e}:t}isSafe(e){if("undefined"!=typeof HTMLAnchorElement&&e instanceof HTMLAnchorElement){const t=e.getAttribute("href");if(null!=t&&t.startsWith("#"))return!0;const n=e.protocol.toLowerCase();return":"===n||"http:"===n||"https:"===n||"mailto:"===n||"tel:"===n}return!0}isTagAllowed(e){return!this.banned.has(e)&&!this.blocked.has(e)&&(this.props.allowElements||this.allowed.has(e))}parse(){return this.container?this.parseNode(this.container,this.getTagConfig(this.container.nodeName.toLowerCase())):[]}parseNode(e,t){const{noHtml:n,noHtmlExceptMatchers:i,allowElements:o,transform:r,transformOnlyAllowList:a}=this.props;let l=[],c="";return[...e.childNodes].forEach((e=>{if(1===e.nodeType){const d=e.nodeName.toLowerCase(),u=this.getTagConfig(d);c&&(l.push(c),c="");const p=this.applyNodeFilters(d,e);if(!p)return;let g;if(r&&(!a||this.isTagAllowed(d))){this.keyIndex+=1;const e=this.keyIndex;g=this.parseNode(p,u);const t=r(p,g,u);if(null===t)return;if(void 0!==t)return void l.push(s().cloneElement(t,{key:e}));this.keyIndex=e-1}if(this.banned.has(d))return;if(n||i&&"br"!==d||!this.isTagAllowed(d)||!o&&!this.canRenderChild(t,u))l=[...l,...this.parseNode(p,u.tagName?u:t)];else{var h;this.keyIndex+=1;const e=this.extractAttributes(p),t={tagName:d};e&&(t.attributes=e),u.void&&(t.selfClose=u.void),l.push(s().createElement(Et,{...t,key:this.keyIndex},null!==(h=g)&&void 0!==h?h:this.parseNode(p,u)))}}else if(3===e.nodeType){const o=n&&!i?e.textContent:this.applyMatchers(e.textContent||"",t);Array.isArray(o)?l=[...l,...o]:c+=o}})),c&&l.push(c),l}replaceTokens(e,t){if(!e.includes("{{{"))return e;const n=[];let i=e,o=null;for(;o=i.match(Nt);){const[e,r]=o,s=o.index,a=e.includes("/");s>0&&(n.push(i.slice(0,s)),i=i.slice(s));const{children:l,matcher:c,props:h}=t[r];let d;if(a)d=e.length,n.push(c.createElement(l,h));else{const o=i.match(new RegExp(`{{{/${r}}}}`));d=o.index+o[0].length,n.push(c.createElement(this.replaceTokens(i.slice(e.length,o.index),t),h))}i=i.slice(d)}return i.length>0&&n.push(i),0===n.length?"":1===n.length&&"string"==typeof n[0]?n[0]:n}}function Ft(e){var t;const{attributes:n,className:i,containerTagName:o,content:r,emptyContent:a,parsedContent:l,tagName:c,noWrap:h}=e,d=null!==(t=null!=o?o:c)&&void 0!==t?t:"span",u="fragment"===d||h;let p;if(l)p=l;else{const t=new Pt(null!=r?r:"",e).parse();t.length>0&&(p=t)}return p||(p=a),u?s().createElement(s().Fragment,null,p):s().createElement(Et,{attributes:n,className:i,tagName:d},p)}function Ht(e){const{attributes:t,className:n,content:i="",disableFilters:o=!1,disableMatchers:r=!1,emptyContent:a=null,filters:l=[],matchers:c=[],onAfterParse:h=null,onBeforeParse:d=null,tagName:u="span",noWrap:p=!1,...g}=e,f=r?[]:c,m=o?[]:l,v=d?[d]:[],w=h?[h]:[];f.forEach((e=>{e.onBeforeParse&&v.push(e.onBeforeParse.bind(e)),e.onAfterParse&&w.push(e.onAfterParse.bind(e))}));const b=v.reduce(((t,n)=>n(t,e)),null!=i?i:""),y=new Pt(b,g,f,m),C=w.reduce(((t,n)=>n(t,e)),y.parse());return s().createElement(Ft,{attributes:t,className:n,containerTagName:e.containerTagName,emptyContent:a,noWrap:p,parsedContent:0===C.length?void 0:C,tagName:u})}const Bt=(0,r.createElement)(Ne.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(Ne.Path,{d:"M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"})),Wt=(0,r.createElement)(Ne.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,r.createElement)(Ne.Path,{d:"M10 2c4.42 0 8 3.58 8 8s-3.58 8-8 8-8-3.58-8-8 3.58-8 8-8zm1.13 9.38l.35-6.46H8.52l.35 6.46h2.26zm-.09 3.36c.24-.23.37-.55.37-.96 0-.42-.12-.74-.36-.97s-.59-.35-1.06-.35-.82.12-1.07.35-.37.55-.37.97c0 .41.13.73.38.96.26.23.61.34 1.06.34s.8-.11 1.05-.34z"}));function zt({onRequestClose:e,closeButtonCaption:t,className:n,children:i,...o}){return(0,r.createElement)(A.Modal,{className:Be()("give-modal",n),onRequestClose:e,...o},i,t&&(0,r.createElement)(A.Button,{variant:"primary",className:"give-modal__dismiss-button",onClick:e},t))}let Vt=function(e){return e.Info="info",e.Warning="warning",e.Error="error",e}({});const jt={[Vt.Info]:Bt,[Vt.Warning]:Wt,[Vt.Error]:Wt};function Ut({type:e=Vt.Info,onRequestClose:t,children:n,...i}){const o=Be()("give-modal--has-icon",{"give-modal--warning":e===Vt.Warning,"give-modal--error":e===Vt.Error}),s=jt[e];return(0,r.createElement)(zt,{icon:(0,r.createElement)(A.Icon,{icon:s}),className:o,onRequestClose:t,...i},n)}const Gt=window.ReactDOM,Kt=window.wp.url,{formPage:{isEnabled:Zt,rewriteSlug:qt,baseUrl:Yt}}=h(),Xt=({pageSlug:e})=>{const t=xe(),[n,i]=(0,r.useState)((0,Kt.safeDecodeURIComponent)(e));(0,r.useEffect)((()=>{i((0,Kt.safeDecodeURIComponent)(e))}),[e]);const o=(0,r.useCallback)((()=>{const o=(0,Kt.cleanForSlug)(n);i(o),o!==e&&t(fe({pageSlug:o}))}),[e,n,t]);return!!Zt&&(0,r.createElement)(A.PanelRow,null,(0,r.createElement)(A.BaseControl,{label:(0,m.__)("URL","give"),help:(0,m.__)("The last part of the URL","give")},(0,r.createElement)("div",{className:"givewp-form-slug"},(0,r.createElement)("span",null,`${Yt}/${qt}`),(0,r.createElement)(A.TextControl,{value:n,onChange:e=>i(e),onBlur:()=>o(),spellCheck:!1}))))},{isExcerptEnabled:Qt}=h(),Jt=({settings:e,setSettings:t})=>{const{formTitle:n,pageSlug:i,formStatus:o,newFormStatus:s,formExcerpt:a}=e,l=["publish","private"].includes(o),c=!l&&(0,Kt.cleanForSlug)(n)===i;return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(A.PanelRow,null,(0,r.createElement)(A.TextControl,{label:(0,m.__)("Title"),value:n,onChange:e=>{!l&&t({pageSlug:(0,Kt.cleanForSlug)(e)}),t({formTitle:e})}})),!!Zt&&(0,r.createElement)(Xt,{pageSlug:c?(0,Kt.cleanForSlug)(n):i}),(0,r.createElement)(A.PanelRow,null,(0,r.createElement)(A.SelectControl,{label:(0,m.__)("Visibility","give"),help:(s?"private"===s:"private"===o)?(0,m.__)("Only visible to site admins and editors","give"):(0,m.__)("Visible to everyone","give"),value:null!=s?s:"draft"===o?"publish":o,options:[{label:(0,m.__)("Public","give"),value:"publish"},{label:(0,m.__)("Private","give"),value:"private"}],onChange:e=>t({newFormStatus:e})})),Qt&&(0,r.createElement)(A.PanelRow,null,(0,r.createElement)(A.TextareaControl,{label:"Excerpt",help:(0,m.__)("The excerpt is an optional summary or description of a donation form; in short, a summary as to why the user should give.","give"),value:a,onChange:e=>t({formExcerpt:e})})))};function en({isSaving:e,isPublished:t,handleSave:n,handleClose:i}){const o=(0,r.createRef)(),{settings:s}=$e(),{formTitle:a,formStatus:l,newFormStatus:c}=s,d=xe(),{formPage:{permalink:u}}=h(),[p,g]=(0,r.useState)(!1);return(0,Gt.createPortal)((0,r.createElement)("div",{className:Be()("givewp-next-gen-prepublish-panel",{"givewp-next-gen-prepublish-panel__animate":!t})},e?(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:"givewp-next-gen-prepublish-panel__header"},(0,r.createElement)("div",{className:"givewp-next-gen-prepublish-panel__header-actions"},(0,r.createElement)(A.Button,{variant:"primary",isBusy:!0,isPressed:!0},(0,m.__)("Publishing","give")))),(0,r.createElement)("div",{className:"givewp-next-gen-prepublish-panel__spinner"},(0,r.createElement)(A.Spinner,null))):(0,r.createElement)(r.Fragment,null,t?(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:"givewp-next-gen-prepublish-panel__header"},(0,r.createElement)("div",{className:"givewp-next-gen-prepublish-panel__header-actions"},(0,r.createElement)(A.Button,{variant:"secondary",onClick:i},(0,m.__)("Close panel","give")))),(0,r.createElement)("div",{className:"givewp-next-gen-prepublish-panel__content_publish"},(0,r.createElement)("strong",null,(0,r.createElement)(Ht,{content:(0,m.sprintf)((0,m.__)("%s is now live.","give"),`<a href="${u}" target="_blank">${a}</a>`)}))),(0,r.createElement)(A.PanelBody,{title:(0,m.__)("What's next?","give"),initialOpen:!0},(0,r.createElement)(A.PanelRow,{className:"givewp-next-gen-prepublish-panel_link"},(0,r.createElement)("span",null,(0,m.__)("PAGE ADDRESS","give")),(0,r.createElement)("span",null,(0,r.createElement)(A.Button,{href:"#",icon:pt,variant:"tertiary",onClick:()=>{g(!0),o.current.select(),document.execCommand("copy"),setTimeout((()=>{g(!1)}),3e3)},className:"givewp-next-gen-prepublish-panel_copy_link"},p?(0,m.__)("Copied","give"):(0,m.__)("Copy","give")))),(0,r.createElement)(A.PanelRow,{className:"givewp-next-gen-prepublish-panel_input"},(0,r.createElement)(A.TextControl,{ref:o,value:u,onChange:null})),(0,r.createElement)(A.PanelRow,{className:"givewp-next-gen-prepublish-panel_view"},(0,r.createElement)(A.Button,{className:"givewp-next-gen-prepublish-panel_view_button",variant:"primary",href:u,target:"_blank"},(0,m.__)("View form","give"))))):(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:"givewp-next-gen-prepublish-panel__header"},(0,r.createElement)("div",{className:"givewp-next-gen-prepublish-panel__header-actions"},(0,r.createElement)(A.Button,{variant:"primary",onClick:n},(0,m.__)("Publish","give")),(0,r.createElement)(A.Button,{variant:"secondary",onClick:i},(0,m.__)("Cancel","give")))),(0,r.createElement)("div",{className:"givewp-next-gen-prepublish-panel__content"},(0,r.createElement)("div",null,(0,r.createElement)("strong",null,(0,m.__)("Are you ready to publish?","give"))),(0,r.createElement)("p",null,(0,m.__)("Double-check your settings before publishing","give"))),(0,r.createElement)(A.PanelBody,{className:"givewp-panel-body--summary",title:(0,m.__)("Summary","give"),initialOpen:!0},(0,r.createElement)(Jt,{settings:s,setSettings:e=>d(fe(e))}))))),document.body)}const tn="update_editor_mode";function nn(e,t){return t.type===tn?{...e,mode:t.mode}:e}const on=(0,r.createContext)(null);on.displayName="EditorState";const rn=(0,r.createContext)(null);rn.displayName="EditorStateDispatch";const sn=({initialState:e,children:t})=>{const[n,i]=(0,r.useReducer)(nn,e);return(0,r.createElement)(on.Provider,{value:n},(0,r.createElement)(rn.Provider,{value:i},t))},an=()=>(0,r.useContext)(on);var ln=function(e){return e.design="design",e.schema="schema",e.settings="settings",e}(ln||{});const cn=ln,hn=window.wp.coreData;function dn({...e}){return(0,r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"23",height:"23",viewBox:"0 0 24 24",...e},(0,r.createElement)("path",{d:"M18.707 6.707a1 1 0 0 0-1.414-1.414L12 10.586 6.707 5.293a1 1 0 0 0-1.414 1.414L10.586 12l-5.293 5.293a1 1 0 1 0 1.414 1.414L12 13.414l5.293 5.293a1 1 0 0 0 1.414-1.414L13.414 12l5.293-5.293z"}))}function un(){return(0,r.createElement)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)("g",{id:"alert-triangle"},(0,r.createElement)("path",{id:"Solid",fillRule:"evenodd",clipRule:"evenodd",d:"M8.54285 1.11111C8.19798 0.957756 7.80426 0.957756 7.45939 1.11111C7.19304 1.22954 7.02001 1.43815 6.89961 1.60814C6.78124 1.77526 6.6545 1.99421 6.51512 2.23501L1.00368 11.7548C0.863739 11.9964 0.73657 12.2161 0.650343 12.4024C0.56271 12.5919 0.46764 12.8465 0.49794 13.1371C0.537147 13.5132 0.734174 13.8549 1.03998 14.0773C1.27631 14.2491 1.54431 14.2944 1.75215 14.3135C1.95665 14.3322 2.21042 14.3322 2.48968 14.3322H13.5125C13.7918 14.3322 14.0456 14.3322 14.2501 14.3135C14.4579 14.2944 14.7259 14.2491 14.9623 14.0773C15.2681 13.8549 15.4651 13.5132 15.5043 13.1371C15.5346 12.8465 15.4395 12.5919 15.3519 12.4024C15.2657 12.2161 15.1385 11.9965 14.9986 11.7548L9.48711 2.23499C9.34774 1.9942 9.221 1.77526 9.10263 1.60814C8.98223 1.43815 8.80921 1.22954 8.54285 1.11111ZM8.66781 5.99886C8.66781 5.63067 8.36933 5.33219 8.00114 5.33219C7.63295 5.33219 7.33447 5.63067 7.33447 5.99886V8.66553C7.33447 9.03372 7.63295 9.33219 8.00114 9.33219C8.36933 9.33219 8.66781 9.03372 8.66781 8.66553V5.99886ZM8.00114 10.6655C7.63295 10.6655 7.33447 10.964 7.33447 11.3322C7.33447 11.7004 7.63295 11.9989 8.00114 11.9989H8.00781C8.376 11.9989 8.67447 11.7004 8.67447 11.3322C8.67447 10.964 8.376 10.6655 8.00781 10.6655H8.00114Z",fill:"#F29718"})))}function pn(){return(0,r.createElement)("svg",{width:"30",height:"30",viewBox:"0 0 30 30",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15 1.25C7.406 1.25 1.25 7.406 1.25 15S7.406 28.75 15 28.75 28.75 22.594 28.75 15 22.594 1.25 15 1.25zm6.509 10.884a1.25 1.25 0 0 0-1.768-1.768l-6.616 6.616-2.866-2.866a1.25 1.25 0 0 0-1.768 1.768l3.75 3.75a1.25 1.25 0 0 0 1.768 0l7.5-7.5z",fill:"#459948"}))}function gn(){return(0,r.createElement)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)("path",{d:"M17 17 7 7m0 0v10M7 7h10",stroke:"#fff",strokeWidth:"1.333",strokeLinecap:"round","stroke-linejoin":"round"}))}const fn=()=>(0,r.createElement)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)("path",{d:"M4.334 4.143v-1.54a.938.938 0 0 1 .938-.937h8.124a.938.938 0 0 1 .938.938v8.125a.938.938 0 0 1-.938.937H11.84",stroke:"#2271B1",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.createElement)("path",{d:"M10.73 4.332H2.604a.938.938 0 0 0-.937.938v8.124a.938.938 0 0 0 .938.938h8.125a.938.938 0 0 0 .937-.938V5.27a.939.939 0 0 0-.938-.938z",stroke:"#2271B1",strokeLinejoin:"round"}));function mn({handleClose:e}){const{formId:t}=h(),n=(0,r.useRef)(null),i=(0,r.useRef)(null),o=(0,r.useRef)(null),s=(0,r.useRef)(null),[a,l]=(0,r.useState)({posts:[],insertPostType:"page",createPostType:"page",currentPostType:"page",newPostName:"",selectedPost:"",selectedStyle:"onpage",openFormButton:"",isCopied:!1,isInserting:!1,insertPageNotSelected:!1,isCreating:!1,isInserted:!1,isCreated:!1,createdLink:null,insertedLink:null}),{editEntityRecord:c,saveEditedEntityRecord:d,saveEntityRecord:u}=(0,w.useDispatch)(hn.store),p=(0,r.useCallback)((t=>{27===t.keyCode&&e(t)}),[]);(0,r.useEffect)((()=>(document.addEventListener("keydown",p,!1),()=>document.removeEventListener("keydown",p,!1))),[]);const g=[{label:"Page",value:"page"},{label:"Post",value:"post"}],f=[{label:(0,m.__)("Full form","give"),value:"onpage",description:(0,m.__)("All fields are visible on one page with the donate button at the bottom","give")},{label:(0,m.__)("Modal","give"),value:"modal",description:(0,m.__)("Only a button is visible; clicking it opens the form in a modal window","give")},{label:(0,m.__)("New Tab","give"),value:"newTab",description:(0,m.__)("Only a button is visible; clicking it opens the form in a new window","give")}],v=(0,w.useSelect)((e=>{const t=[],n=e(hn.store).getEntityRecords("postType",a.currentPostType,{status:["publish","draft"],per_page:-1});return n&&(n?.forEach((e=>{t.push({value:e.id,label:e.title.raw||(0,m.__)("(no title)","give"),content:e.content.raw})})),l((e=>({...e,isInserting:!1,posts:{...e.posts,[a.currentPostType]:t}})))),!n}),[a.createPostType,a.insertPostType]),b=!a.isCreated&&a.newPostName&&a.posts[a.createPostType]?.filter((e=>e.label==a.newPostName)).length>0,y=["newTab","modal"].includes(a.selectedStyle),C=(0,r.useCallback)((()=>{const e=[];if(v)e.push({value:"",label:(0,m.__)("Loading...","give"),disabled:!0});else{const t="page"===a.insertPostType?(0,m.__)("Select a page","give"):(0,m.__)("Select a post","give");e.push({value:"",label:t,disabled:!0})}return a.posts[a.insertPostType]&&e.push(...a.posts[a.insertPostType]),e}),[a.posts,v]),$=()=>{const e={id:t};return y&&(e.displayStyle=a.selectedStyle,e.continueButtonTitle=a.openFormButton),`\x3c!-- wp:give/donation-form ${JSON.stringify(e)} /--\x3e`},x=()=>{const e=[],n={id:t};y&&(n.display_style=a.selectedStyle,n.continue_button_title=a.openFormButton);for(const t in n)e.push(`${t}="${n[t]}"`);return`[give_form ${e.join(" ")}]`},_=e=>"page"===e?(0,m.__)("page","give"):(0,m.__)("post","give");return(0,Gt.createPortal)((0,r.createElement)("div",{className:"give-embed-modal"},(0,r.createElement)("div",{className:"give-embed-modal-header"},(0,m.__)("Embed Form","give"),(0,r.createElement)("span",{className:"give-embed-modal-badge"},(0,m.__)("Form ID","give"),": ",t),(0,r.createElement)("button",{"aria-label":(0,m.__)("Close Embed Form modal window","give"),onClick:e},(0,r.createElement)(dn,null))),(0,r.createElement)("div",{className:"give-embed-modal-row"},(0,r.createElement)("strong",null,(0,m.__)("Form settings","give")),(0,r.createElement)(A.SelectControl,{label:(0,m.__)("Display style","give"),value:a.selectedStyle,options:f,onChange:e=>l((t=>({...t,selectedStyle:e}))),help:f.find((e=>e.value===a.selectedStyle)).description}),y&&(0,r.createElement)(A.TextControl,{ref:i,placeholder:(0,m.__)("Donate","give"),label:(0,m.__)("Button label","give"),value:a.openFormButton,onChange:e=>l((t=>({...t,openFormButton:e})))})),(0,r.createElement)("div",{className:"give-embed-modal-row"},(0,r.createElement)("strong",null,(0,m.__)("Add to existing content","give")),(0,r.createElement)(A.RadioControl,{className:"give-embed-modal-radio",selected:a.insertPostType,options:g,onChange:e=>l((t=>({...t,insertPostType:e,currentPostType:e,selectedPost:"",isInserted:!1})))}),(0,r.createElement)(A.SelectControl,{value:a.selectedPost,options:C(),disabled:a.isInserted,help:a.insertPageNotSelected?(0,r.createElement)("p",{className:"give-embed-modal-select-error"},(0,m.sprintf)((0,m.__)("Please select a %s","give"),_(a.insertPostType))):null,onChange:e=>l((t=>({...t,insertPageNotSelected:!1,selectedPost:e})))}),a.isInserted?(0,r.createElement)("div",{className:"give-embed-modal-items"},(0,r.createElement)("div",null,(0,r.createElement)(A.Button,{icon:ut,variant:"secondary",onClick:()=>o.current?.focus()},(0,m.__)("Form inserted","give"))),(0,r.createElement)("div",null,(0,r.createElement)(A.Button,{ref:o,href:a.insertedLink,target:"_blank",icon:ft,variant:"tertiary"},(0,m.sprintf)((0,m.__)("View %s","give"),_(a.insertPostType))))):(0,r.createElement)(A.Button,{variant:"secondary",onClick:async()=>{if(y&&!a.openFormButton)return void i.current?.focus();if(!a.selectedPost)return void l((e=>({...e,insertPageNotSelected:!0})));l((e=>({...e,isInserting:!0})));const e=a?.posts[a.insertPostType]?.find((e=>e.value==a.selectedPost))?.content+$();await c("postType",a.insertPostType,a.selectedPost,{content:e});const t=await d("postType",a.insertPostType,a.selectedPost,{content:e});l((e=>({...e,isInserting:!1,insertPageNotSelected:!1,isInserted:!0,insertedLink:t?.link})))}},a.isInserting&&(0,r.createElement)(A.Spinner,null),a.isInserting?(0,m.__)("Inserting form","give"):(0,m.__)("Insert form","give"))),(0,r.createElement)("div",{className:"give-embed-modal-row"},(0,r.createElement)("strong",null,(0,m.__)("Create new","give")),(0,r.createElement)(A.RadioControl,{className:"give-embed-modal-radio",selected:a.createPostType,options:g,onChange:e=>l((t=>({...t,createPostType:e,currentPostType:e,isCreated:!1})))}),(0,r.createElement)(A.TextControl,{readOnly:a.isCreated,ref:n,value:a.newPostName,onChange:e=>l((t=>({...t,newPostName:e}))),className:Be()({"give-embed-modal-input-error":b}),help:b?(0,r.createElement)("p",{className:"give-embed-modal-select-error"},(0,m.sprintf)((0,m.__)("%s with that name already exists","give"),_(a.createPostType))):null}),a.isCreated?(0,r.createElement)("div",{className:"give-embed-modal-items"},(0,r.createElement)("div",null,(0,r.createElement)(A.Button,{icon:ut,variant:"secondary",onClick:()=>s.current?.focus()},(0,m.__)("Created page","give"))),(0,r.createElement)("div",null,(0,r.createElement)(A.Button,{ref:s,href:a.createdLink,target:"_blank",icon:ft,variant:"tertiary"},(0,m.sprintf)((0,m.__)("View %s","give"),_(a.createPostType))))):(0,r.createElement)(r.Fragment,null,!b&&(0,r.createElement)(A.Button,{variant:"secondary",onClick:async()=>{if(!a.newPostName)return void n.current?.focus();if(y&&!a.openFormButton)return void i.current?.focus();l((e=>({...e,isCreating:!0})));const e=await u("postType",a.createPostType,{title:a.newPostName,content:$()});l((t=>({...t,isCreating:!1,isCreated:!0,createdLink:e?.link})))}},a.isCreating&&(0,r.createElement)(A.Spinner,null),a.isCreating?(0,m.sprintf)((0,m.__)("Creating %s","give"),_(a.createPostType)):(0,m.__)("Create","give")))),(0,r.createElement)("div",{className:"give-embed-modal-row"},(0,r.createElement)("strong",null,(0,m.__)("Not using the block editor?","give")),(0,r.createElement)("div",{className:"give-embed-modal-helptext"},(0,m.__)("Copy and paste the shortcode within your page builder.","give")),(0,r.createElement)("div",{className:"give-embed-modal-items give-embed-modal-copy"},(0,r.createElement)("div",null,(0,r.createElement)(A.Button,{icon:a.isCopied?ut:fn,variant:"secondary",onClick:async()=>{if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(x());else{const e=document.createElement("textarea");e.value=x(),e.style.display="hidden",document.body.appendChild(e),e.focus(),e.select();try{document.execCommand("copy")}catch(e){console.error(e)}finally{e.remove()}}l((e=>({...e,isCopied:!0}))),setTimeout((()=>{l((e=>({...e,isCopied:!1})))}),2e3)}},a.isCopied?(0,m.__)("Copied","give"):(0,m.__)("Copy Shortcode","give"))),(0,r.createElement)("div",null,(0,r.createElement)(Ht,{content:(0,m.sprintf)((0,m.__)("%s about the shortcode","give"),`<a href="https://givewp.com/documentation/core/shortcodes/" target="_blank">${(0,m.__)("Learn more","give")}</a>`)}))))),document.body)}const vn=()=>(0,r.createElement)("div",{style:{height:"60px",width:"50px",backgroundColor:"#FFF",display:"flex",alignItems:"center"}},(0,r.createElement)("a",{style:{display:"flex",boxShadow:"none"},href:"edit.php?post_type=give_forms&page=give-forms",title:(0,m.__)("Return to GiveWP","give")},(0,r.createElement)(ht,null))),wn=({SecondarySidebarButtons:e=null,showSidebar:t,toggleShowSidebar:n})=>{const{blocks:i,settings:o,isDirty:s,transfer:a}=$e(),{formTitle:c}=o,d=xe(),[u,p]=(0,r.useState)(null),[g,f]=(0,r.useState)(null),[v,b]=(0,r.useState)(!1),[y,$]=(0,r.useState)(!1),x=(u||!s)&&"draft"===o.formStatus,_=(u||!s)&&["publish","private"].includes(o.formStatus),S=["publish","private"].includes(o.formStatus),{isMigratedForm:E,isTransferredForm:k}=window.migrationOnboardingData,{createSuccessNotice:L}=(0,w.useDispatch)("core/notices"),{formPage:{permalink:M}}=h(),T=e=>{var t;p(e);const n="draft"===e?e:null!==(t=o.newFormStatus)&&void 0!==t?t:e;d(fe({formStatus:n,newFormStatus:null})),function(e){e.forEach(((t,n)=>{t.innerBlocks?.forEach(((t,i)=>{(0,l.getBlockType)(t.name).name===(0,l.getUnregisteredTypeHandlerName)()&&t.attributes?.originalContent&&(e[n].innerBlocks[i]=JSON.parse(t.attributes.originalContent))}))}))}(i),C({blocks:i,formSettings:{...o,formStatus:n}}).catch((e=>{d(ve(!1)),p(null),f(e.message),$(!1)})).then((({formTitle:t,pageSlug:n})=>{d(fe({formTitle:t,pageSlug:n})),d(ve(!1)),p(null),R(e)}))},R=e=>{if("draft"===e)L((0,m.__)("Draft saved.","give"),{type:"snackbar"});else{const t="publish"===e&&"draft"!==o.formStatus?(0,m.__)("Form updated.","give"):(0,m.__)("Form published.","give");L(t,{type:"snackbar",actions:[{label:(0,m.__)("View form","give"),url:M}]})}},{mode:I}=an(),O=(0,r.useContext)(rn),N=e=>{e&&Object.keys(cn).includes(e)&&O(function(e){return{type:tn,mode:e}}(e))};return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(ce,{contentLeft:(0,r.createElement)(r.Fragment,null,(0,r.createElement)(vn,null),e&&(0,r.createElement)(e,null),(0,r.createElement)(A.TextControl,{className:"givewp-form-title",value:c,onChange:e=>{!S&&d(fe({pageSlug:(0,Kt.cleanForSlug)(e)})),d(fe({formTitle:e}))},label:(0,r.createElement)(r.Fragment,null,(0,r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},(0,r.createElement)("path",{d:"M6.02157 10.1075L12.666 3.39785L11.2216 2L4.57713 8.70968L3.99935 10.6667L6.02157 10.1075Z",fill:"currentColor"}),(0,r.createElement)("path",{d:"M2.66602 13.3333H7.99935M12.666 3.39785L6.02157 10.1075L3.99935 10.6667L4.57713 8.70968L11.2216 2L12.666 3.39785Z",stroke:"currentColor"})))})),contentMiddle:(0,r.createElement)("div",{className:"givewp-header-tabs"},(0,r.createElement)(A.Button,{id:"editor-state-switch-schema",className:Be()("givewp-header-tabs__tab",{"is-active":I===cn.schema}),onClick:()=>N(cn.schema)},(0,m.__)("Build","give")),(0,r.createElement)(A.Button,{id:"editor-state-switch-design",className:Be()("givewp-header-tabs__tab",{"is-active":I===cn.design}),onClick:()=>N(cn.design)},(0,m.__)("Design","give")),(0,r.createElement)(A.Button,{id:"editor-state-switch-settings",className:Be()("givewp-header-tabs__tab",{"is-active":I===cn.settings}),onClick:()=>N(cn.settings)},(0,m.__)("Settings","give"))),contentRight:(0,r.createElement)(r.Fragment,null,!y&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)(A.Button,{onClick:()=>T("draft"),"aria-disabled":x,disabled:x,variant:"tertiary"},u&&"draft"===u?(0,m.__)("Saving...","give"):"draft"===o.formStatus?(0,m.__)("Save as Draft","give"):(0,m.__)("Switch to Draft","give")),(0,r.createElement)(A.Button,{icon:dt,className:"givewp-embed-button",isPressed:v,onClick:()=>b(!v),label:(0,m.__)("Embed form","give")}),S&&(0,r.createElement)(A.Button,{label:(0,m.__)("View form","give"),href:M,target:"_blank",icon:ft}),(0,r.createElement)(A.Button,{onClick:()=>S?T("publish"):$(!0),"aria-disabled":_,disabled:_,variant:"primary"},u&&"publish"===u?(0,m.__)("Updating...","give"):S?(0,m.__)("Update","give"):(0,m.__)("Publish","give")),I!==cn.settings&&(0,r.createElement)(A.Button,{onClick:n,isPressed:t,icon:mt})),(0,r.createElement)(A.Dropdown,{popoverProps:{placement:"bottom-start"},focusOnMount:"container",renderToggle:({isOpen:e,onToggle:t})=>(0,r.createElement)(A.Button,{id:"FormBuilderSidebarToggle",icon:vt,onClick:()=>{a.showTooltip&&d(we({showTooltip:!1})),t()}}),renderContent:({onClose:e})=>(0,r.createElement)("div",{style:{minWidth:"280px",maxWidth:"400px"}},(0,r.createElement)(A.MenuGroup,{label:(0,m.__)("Support","give")},I!==cn.settings&&(0,r.createElement)(A.MenuItem,{className:"givewp-block-editor-tools__tour",onClick:()=>{window.tour.isActive()||(window.tour.start(),e())}},(0,m.__)("Show Guided Tour","give")),E&&!k&&!a.showNotice&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)(A.MenuItem,{className:a.showTooltip&&"givewp-transfer-selected-menuitem",onClick:()=>{d(we({showTransferModal:!0})),e()}},(0,m.__)("Transfer Donation Data","give")),a.showTooltip&&(0,r.createElement)("div",{className:"givewp-transfer-tooltip"},(0,m.__)("Want to transfer donation data later? Access this option in the three dots menu above at any time.","give")))),(0,r.createElement)(A.ExternalLink,{className:"givewp-support-link",href:"https://docs.givewp.com/nextgenfeedback",rel:"noopener noreferrer"},(0,r.createElement)(A.MenuItem,{icon:ft},(0,m.__)("Submit Feedback","give"))))}))}),g&&(0,r.createElement)(Ut,{title:(0,m.__)("Error saving form","give"),type:Vt.Error,onRequestClose:()=>f(null),closeButtonCaption:(0,m.__)("Got it!","give")},(0,r.createElement)(Ft,{content:g})),v&&(0,r.createElement)(mn,{handleClose:()=>b(!1)}),y&&(0,r.createElement)(en,{isSaving:u,isPublished:S,handleSave:()=>T("publish"),handleClose:()=>$(!1)}))},bn=()=>(0,r.createElement)("div",{id:"form-blocks-canvas"},(0,r.createElement)(f.BlockTools,null,(0,r.createElement)(f.WritingFlow,null,(0,r.createElement)(f.ObserveTyping,null,(0,r.createElement)(f.BlockList,{renderAppender:f.DefaultBlockAppender})))));var yn=n(5697),Cn=n.n(yn);function $n(){return $n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},$n.apply(this,arguments)}function xn(e,t){if(null==e)return{};var n,i,o={},r=Object.keys(e);for(i=0;i<r.length;i++)n=r[i],t.indexOf(n)>=0||(o[n]=e[n]);return o}var Sn,En,kn=(Sn=function(e){!function(t){if("undefined"!=typeof window){var n,i=0,o=!1,r=!1,s=7,a="[iFrameSizer]",l=a.length,c=null,h=window.requestAnimationFrame,d={max:1,scroll:1,bodyScroll:1,documentElementScroll:1},u={},p=null,g={autoResize:!0,bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:!0,inPageLinks:!1,enablePublicMethods:!0,heightCalculationMethod:"bodyOffset",id:"iFrameResizer",interval:32,log:!1,maxHeight:1/0,maxWidth:1/0,minHeight:0,minWidth:0,resizeFrom:"parent",scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,widthCalculationMethod:"scroll",onClose:function(){return!0},onClosed:function(){},onInit:function(){},onMessage:function(){$("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return!0}},f={};window.jQuery&&((n=window.jQuery).fn?n.fn.iFrameResize||(n.fn.iFrameResize=function(e){return this.filter("iframe").each((function(t,n){D(n,e)})).end()}):C("","Unable to bind to jQuery, it is not fully loaded.")),"function"==typeof t&&t.amd?t([],B):e.exports=B(),window.iFrameResize=window.iFrameResize||B()}function m(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function v(e,t,n){e.addEventListener(t,n,!1)}function w(e,t,n){e.removeEventListener(t,n,!1)}function b(e){return u[e]?u[e].log:o}function y(e,t){x("log",e,t,b(e))}function C(e,t){x("info",e,t,b(e))}function $(e,t){x("warn",e,t,!0)}function x(e,t,n,i){!0===i&&"object"==typeof window.console&&console[e](function(e){return a+"["+function(e){var t="Host page: "+e;return window.top!==window.self&&(t=window.parentIFrame&&window.parentIFrame.getId?window.parentIFrame.getId()+": "+e:"Nested host page: "+e),t}(e)+"]"}(t),n)}function _(e){function t(){n("Height"),n("Width"),I((function(){R(F),L(H),g("onResized",F)}),F,"init")}function n(e){var t=Number(u[H]["max"+e]),n=Number(u[H]["min"+e]),i=e.toLowerCase(),o=Number(F[i]);y(H,"Checking "+i+" is in range "+n+"-"+t),o<n&&(o=n,y(H,"Set "+i+" to min value")),o>t&&(o=t,y(H,"Set "+i+" to max value")),F[i]=""+o}function i(e){return P.substr(P.indexOf(":")+s+e)}function o(e,t){var n,i;n=function(){var n,i;O("Send Page Info","pageInfo:"+(n=document.body.getBoundingClientRect(),i=F.iframe.getBoundingClientRect(),JSON.stringify({iframeHeight:i.height,iframeWidth:i.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(i.top-n.top,10),offsetLeft:parseInt(i.left-n.left,10),scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,documentHeight:document.documentElement.clientHeight,documentWidth:document.documentElement.clientWidth,windowHeight:window.innerHeight,windowWidth:window.innerWidth})),e,t)},f[i=t]||(f[i]=setTimeout((function(){f[i]=null,n()}),32))}function r(e){var t=e.getBoundingClientRect();return A(H),{x:Math.floor(Number(t.left)+Number(c.x)),y:Math.floor(Number(t.top)+Number(c.y))}}function h(e){var t=e?r(F.iframe):{x:0,y:0},n={x:Number(F.width)+t.x,y:Number(F.height)+t.y};y(H,"Reposition requested from iFrame (offset x:"+t.x+" y:"+t.y+")"),window.top!==window.self?window.parentIFrame?window.parentIFrame["scrollTo"+(e?"Offset":"")](n.x,n.y):$(H,"Unable to scroll to requested position, window.parentIFrame not found"):(c=n,d(),y(H,"--"))}function d(){!1!==g("onScroll",c)?L(H):M()}function p(e){g(e,{iframe:F.iframe,screenX:F.width,screenY:F.height,type:F.type})}function g(e,t){return S(H,e,t)}var m,b,x,_,E,D,P=e.data,F={},H=null;"[iFrameResizerChild]Ready"===P?function(){for(var e in u)O("iFrame requested init",N(e),u[e].iframe,e)}():a===(""+P).substr(0,l)&&P.substr(l).split(":")[0]in u?(_=(x=P.substr(l).split(":"))[1]?parseInt(x[1],10):0,E=u[x[0]]&&u[x[0]].iframe,D=getComputedStyle(E),F={iframe:E,id:x[0],height:_+function(e){return"border-box"!==e.boxSizing?0:(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}(D)+function(e){return"border-box"!==e.boxSizing?0:(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}(D),width:x[2],type:x[3]},H=F.id,u[H]&&(u[H].loaded=!0),(b=F.type in{true:1,false:1,undefined:1})&&y(H,"Ignoring init message from meta parent page"),!b&&function(e){var t=!0;return u[e]||(t=!1,$(F.type+" No settings for "+e+". Message was: "+P)),t}(H)&&(y(H,"Received: "+P),m=!0,null===F.iframe&&($(H,"IFrame ("+F.id+") not found"),m=!1),m&&function(){var t,n=e.origin,i=u[H]&&u[H].checkOrigin;if(i&&""+n!="null"&&!(i.constructor===Array?function(){var e=0,t=!1;for(y(H,"Checking connection is from allowed list of origins: "+i);e<i.length;e++)if(i[e]===n){t=!0;break}return t}():(t=u[H]&&u[H].remoteHost,y(H,"Checking connection is from: "+t),n===t)))throw new Error("Unexpected message received from: "+n+" for "+F.iframe.id+". Message was: "+e.data+". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.");return!0}()&&function(){switch(u[H]&&u[H].firstRun&&u[H]&&(u[H].firstRun=!1),F.type){case"close":k(F.iframe);break;case"message":e=i(6),y(H,"onMessage passed: {iframe: "+F.iframe.id+", message: "+e+"}"),g("onMessage",{iframe:F.iframe,message:JSON.parse(e)}),y(H,"--");break;case"mouseenter":p("onMouseEnter");break;case"mouseleave":p("onMouseLeave");break;case"autoResize":u[H].autoResize=JSON.parse(i(9));break;case"scrollTo":h(!1);break;case"scrollToOffset":h(!0);break;case"pageInfo":o(u[H]&&u[H].iframe,H),function(){function e(e,i){function r(){u[n]?o(u[n].iframe,n):t()}["scroll","resize"].forEach((function(t){y(n,e+t+" listener for sendPageInfo"),i(window,t,r)}))}function t(){e("Remove ",w)}var n=H;e("Add ",v),u[n]&&(u[n].stopPageInfo=t)}();break;case"pageInfoStop":u[H]&&u[H].stopPageInfo&&(u[H].stopPageInfo(),delete u[H].stopPageInfo);break;case"inPageLink":!function(e){var t,n=e.split("#")[1]||"",i=decodeURIComponent(n),o=document.getElementById(i)||document.getElementsByName(i)[0];o?(t=r(o),y(H,"Moving to in page link (#"+n+") at x: "+t.x+" y: "+t.y),c={x:t.x,y:t.y},d(),y(H,"--")):window.top!==window.self?window.parentIFrame?window.parentIFrame.moveToAnchor(n):y(H,"In page link #"+n+" not found and window.parentIFrame not found"):y(H,"In page link #"+n+" not found")}(i(9));break;case"reset":T(F);break;case"init":t(),g("onInit",F.iframe);break;default:t()}var e}())):C(H,"Ignored: "+P)}function S(e,t,n){var i=null,o=null;if(u[e]){if("function"!=typeof(i=u[e][t]))throw new TypeError(t+" on iFrame["+e+"] is not a function");o=i(n)}return o}function E(e){var t=e.id;delete u[t]}function k(e){var t=e.id;if(!1!==S(t,"onClose",t)){y(t,"Removing iFrame: "+t);try{e.parentNode&&e.parentNode.removeChild(e)}catch(e){$(e)}S(t,"onClosed",t),y(t,"--"),E(e)}else y(t,"Close iframe cancelled by onClose event")}function A(e){null===c&&y(e,"Get page position: "+(c={x:window.pageXOffset!==t?window.pageXOffset:document.documentElement.scrollLeft,y:window.pageYOffset!==t?window.pageYOffset:document.documentElement.scrollTop}).x+","+c.y)}function L(e){null!==c&&(window.scrollTo(c.x,c.y),y(e,"Set page position: "+c.x+","+c.y),M())}function M(){c=null}function T(e){y(e.id,"Size reset requested by "+("init"===e.type?"host page":"iFrame")),A(e.id),I((function(){R(e),O("reset","reset",e.iframe,e.id)}),e,"reset")}function R(e){function t(t){r||"0"!==e[t]||(r=!0,y(i,"Hidden iFrame detected, creating visibility listener"),function(){function e(){Object.keys(u).forEach((function(e){!function(e){function t(t){return"0px"===(u[e]&&u[e].iframe.style[t])}u[e]&&null!==u[e].iframe.offsetParent&&(t("height")||t("width"))&&O("Visibility change","resize",u[e].iframe,e)}(e)}))}function t(t){y("window","Mutation observed: "+t[0].target+" "+t[0].type),P(e,16)}var n,i=m();i&&(n=document.querySelector("body"),new i(t).observe(n,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}))}())}function n(n){!function(t){e.id?(e.iframe.style[t]=e[t]+"px",y(e.id,"IFrame ("+i+") "+t+" set to "+e[t]+"px")):y("undefined","messageData id not set")}(n),t(n)}var i=e.iframe.id;u[i]&&(u[i].sizeHeight&&n("height"),u[i].sizeWidth&&n("width"))}function I(e,t,n){n!==t.type&&h&&!window.jasmine?(y(t.id,"Requesting animation frame"),h(e)):e()}function O(e,t,n,i,o){var r,s=!1;i=i||n.id,u[i]&&(n&&"contentWindow"in n&&null!==n.contentWindow?(r=u[i]&&u[i].targetOrigin,y(i,"["+e+"] Sending msg to iframe["+i+"] ("+t+") targetOrigin: "+r),n.contentWindow.postMessage(a+t,r)):$(i,"["+e+"] IFrame("+i+") not found"),o&&u[i]&&u[i].warningTimeout&&(u[i].msgTimeout=setTimeout((function(){!u[i]||u[i].loaded||s||(s=!0,$(i,"IFrame has not responded within "+u[i].warningTimeout/1e3+" seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning."))}),u[i].warningTimeout)))}function N(e){return e+":"+u[e].bodyMarginV1+":"+u[e].sizeWidth+":"+u[e].log+":"+u[e].interval+":"+u[e].enablePublicMethods+":"+u[e].autoResize+":"+u[e].bodyMargin+":"+u[e].heightCalculationMethod+":"+u[e].bodyBackground+":"+u[e].bodyPadding+":"+u[e].tolerance+":"+u[e].inPageLinks+":"+u[e].resizeFrom+":"+u[e].widthCalculationMethod}function D(e,n){function r(e){var t=e.split("Callback");if(2===t.length){var n="on"+t[0].charAt(0).toUpperCase()+t[0].slice(1);this[n]=this[e],delete this[e],$(l,"Deprecated: '"+e+"' has been renamed '"+n+"'. The old method will be removed in the next major version.")}}var s,a,l=function(t){var r;return""===t&&(e.id=(r=n&&n.id||g.id+i++,null!==document.getElementById(r)&&(r+=i++),t=r),o=(n||{}).log,y(t,"Added missing iframe ID: "+t+" ("+e.src+")")),t}(e.id);l in u&&"iFrameResizer"in e?$(l,"Ignored iFrame, already setup."):(function(t){var n;t=t||{},u[l]={firstRun:!0,iframe:e,remoteHost:e.src&&e.src.split("/").slice(0,3).join("/")},function(e){if("object"!=typeof e)throw new TypeError("Options is not an object")}(t),Object.keys(t).forEach(r,t),function(e){for(var t in g)Object.prototype.hasOwnProperty.call(g,t)&&(u[l][t]=Object.prototype.hasOwnProperty.call(e,t)?e[t]:g[t])}(t),u[l]&&(u[l].targetOrigin=!0===u[l].checkOrigin?""===(n=u[l].remoteHost)||null!==n.match(/^(about:blank|javascript:|file:\/\/)/)?"*":n:"*")}(n),function(){switch(y(l,"IFrame scrolling "+(u[l]&&u[l].scrolling?"enabled":"disabled")+" for "+l),e.style.overflow=!1===(u[l]&&u[l].scrolling)?"hidden":"auto",u[l]&&u[l].scrolling){case"omit":break;case!0:e.scrolling="yes";break;case!1:e.scrolling="no";break;default:e.scrolling=u[l]?u[l].scrolling:"no"}}(),function(){function t(t){1/0!==u[l][t]&&0!==u[l][t]&&(e.style[t]=u[l][t]+"px",y(l,"Set "+t+" = "+u[l][t]+"px"))}function n(e){if(u[l]["min"+e]>u[l]["max"+e])throw new Error("Value for min"+e+" can not be greater than max"+e)}n("Height"),n("Width"),t("maxHeight"),t("minHeight"),t("maxWidth"),t("minWidth")}(),"number"!=typeof(u[l]&&u[l].bodyMargin)&&"0"!==(u[l]&&u[l].bodyMargin)||(u[l].bodyMarginV1=u[l].bodyMargin,u[l].bodyMargin=u[l].bodyMargin+"px"),s=N(l),(a=m())&&function(t){e.parentNode&&new t((function(t){t.forEach((function(t){Array.prototype.slice.call(t.removedNodes).forEach((function(t){t===e&&k(e)}))}))})).observe(e.parentNode,{childList:!0})}(a),v(e,"load",(function(){var n,i;O("iFrame.onload",s,e,t,!0),n=u[l]&&u[l].firstRun,i=u[l]&&u[l].heightCalculationMethod in d,!n&&i&&T({iframe:e,height:0,width:0,type:"init"})})),O("init",s,e,t,!0),u[l]&&(u[l].iframe.iFrameResizer={close:k.bind(null,u[l].iframe),removeListeners:E.bind(null,u[l].iframe),resize:O.bind(null,"Window resize","resize",u[l].iframe),moveToAnchor:function(e){O("Move to anchor","moveToAnchor:"+e,u[l].iframe,l)},sendMessage:function(e){O("Send Message","message:"+(e=JSON.stringify(e)),u[l].iframe,l)}}))}function P(e,t){null===p&&(p=setTimeout((function(){p=null,e()}),t))}function F(){"hidden"!==document.visibilityState&&(y("document","Trigger event: Visiblity change"),P((function(){H("Tab Visable","resize")}),16))}function H(e,t){Object.keys(u).forEach((function(n){(function(e){return u[e]&&"parent"===u[e].resizeFrom&&u[e].autoResize&&!u[e].firstRun})(n)&&O(e,t,u[n].iframe,n)}))}function B(){function e(e,t){t&&(function(){if(!t.tagName)throw new TypeError("Object is not a valid DOM element");if("IFRAME"!==t.tagName.toUpperCase())throw new TypeError("Expected <IFRAME> tag, found <"+t.tagName+">")}(),D(t,e),n.push(t))}var n;return function(){var e,t=["moz","webkit","o","ms"];for(e=0;e<t.length&&!h;e+=1)h=window[t[e]+"RequestAnimationFrame"];h?h=h.bind(window):y("setup","RequestAnimationFrame not supported")}(),v(window,"message",_),v(window,"resize",(function(){y("window","Trigger event: resize"),P((function(){H("Window resize","resize")}),16)})),v(document,"visibilitychange",F),v(document,"-webkit-visibilitychange",F),function(i,o){switch(n=[],function(e){e&&e.enablePublicMethods&&$("enablePublicMethods option has been removed, public methods are now always available in the iFrame")}(i),typeof o){case"undefined":case"string":Array.prototype.forEach.call(document.querySelectorAll(o||"iframe"),e.bind(t,i));break;case"object":e(i,o);break;default:throw new TypeError("Unexpected data type ("+typeof o+")")}return n}}}()},Sn(En={exports:{}}),En.exports),An=function(){},Ln=function(e){var t=e.title,n=e.forwardRef,i=xn(e,["title","forwardRef"]),o=function(e){return e.autoResize,e.bodyBackground,e.bodyMargin,e.bodyPadding,e.checkOrigin,e.inPageLinks,e.heightCalculationMethod,e.interval,e.log,e.maxHeight,e.maxWidth,e.minHeight,e.minWidth,e.resizeFrom,e.scrolling,e.sizeHeight,e.sizeWidth,e.warningTimeout,e.tolerance,e.widthCalculationMethod,e.onClosed,e.onInit,e.onMessage,e.onMouseEnter,e.onMouseLeave,e.onResized,xn(e,["autoResize","bodyBackground","bodyMargin","bodyPadding","checkOrigin","inPageLinks","heightCalculationMethod","interval","log","maxHeight","maxWidth","minHeight","minWidth","resizeFrom","scrolling","sizeHeight","sizeWidth","warningTimeout","tolerance","widthCalculationMethod","onClosed","onInit","onMessage","onMouseEnter","onMouseLeave","onResized"])}(i),a=(0,r.useRef)(null),l=function(){return An(!a.current,"[iframeSizerReact]["+(a&&a.current&&a.current.id)+"] Close event ignored, to remove the iframe update your React component"),!a.current};return(0,r.useEffect)((function(){var e=a.current;return kn($n({},i,{onClose:l}),e),function(){return e.iFrameResizer&&e.iFrameResizer.removeListeners()}}),[]),(0,r.useImperativeHandle)(n,(function(){return{resize:function(){return a.current.iFrameResizer.resize()},moveToAnchor:function(e){return a.current.iFrameResizer.moveToAnchor(e)},sendMessage:function(e,t){a.current.iFrameResizer.sendMessage(e,t)}}})),s().createElement("iframe",$n({title:t},o,{ref:a}))};Ln.defaultProps={title:"iframe"},Ln.propTypes={title:Cn().string};const Mn=Ln;function Tn(){return(0,r.createElement)("div",{className:"givewp__component-DesignPreview-container-classic"},(0,r.createElement)("div",{className:"givewp__component-DesignPreview-container-classic-headerwrap"},(0,r.createElement)("div",{className:"givewp__component-DesignPreview-container-classic-header"}),(0,r.createElement)("div",{className:"givewp__component-DesignPreview-container-classic-title"},(0,r.createElement)("div",null)),(0,r.createElement)("div",{className:"givewp__component-DesignPreview-container-classic-donation-levels"},(0,r.createElement)("div",null,(0,r.createElement)("div",null)),(0,r.createElement)("div",null,(0,r.createElement)("div",null)),(0,r.createElement)("div",null,(0,r.createElement)("div",null))),(0,r.createElement)("div",{className:"givewp__component-DesignPreview-container-classic-progressbar"},(0,r.createElement)("div",null))),(0,r.createElement)("div",{className:"givewp__component-DesignPreview-container-classic-wrap"},(0,r.createElement)("div",{className:"givewp__component-DesignPreview-container-classic-bar"}),(0,r.createElement)("div",{className:"givewp__component-DesignPreview-container-classic-doublebar"},(0,r.createElement)("div",null),(0,r.createElement)("div",null)),(0,r.createElement)("div",{className:"givewp__component-DesignPreview-container-classic-barshort"}),(0,r.createElement)("div",{className:"givewp__component-DesignPreview-container-classic-grid"},(0,r.createElement)("div",null),(0,r.createElement)("div",null),(0,r.createElement)("div",null),(0,r.createElement)("div",null),(0,r.createElement)("div",null),(0,r.createElement)("div",null),(0,r.createElement)("div",null)),(0,r.createElement)("div",{className:"givewp__component-DesignPreview-container-classic-bar"}),(0,r.createElement)("div",{className:"givewp__component-DesignPreview-container-classic-doublebar-small"},(0,r.createElement)("div",null,(0,r.createElement)("div",null)),(0,r.createElement)("div",null,(0,r.createElement)("div",null)))))}function Rn(){return(0,r.createElement)("div",{className:"givewp__component-DesignPreview-container-multistep"},(0,r.createElement)("div",{className:"givewp__component-DesignPreview-container-multistep-header"}),(0,r.createElement)("div",{className:"givewp__component-DesignPreview-container-multistep-image"}),(0,r.createElement)("div",{className:"givewp__component-DesignPreview-container-multistep-donation-levels"},(0,r.createElement)("div",null,(0,r.createElement)("div",null)),(0,r.createElement)("div",null,(0,r.createElement)("div",null)),(0,r.createElement)("div",null,(0,r.createElement)("div",null))),(0,r.createElement)("div",{className:"givewp__component-DesignPreview-container-multistep-progressbar"},(0,r.createElement)("div",null)),(0,r.createElement)("div",{className:"givewp__component-DesignPreview-container-multistep-button"},(0,r.createElement)("div",null)),(0,r.createElement)("div",{className:"givewp__component-DesignPreview-container-multistep-footer"},(0,r.createElement)("div",null)))}function In({design:e,editing:t,designUpdated:n}){return(0,r.createElement)("div",{className:"givewp__component-DesignPreview"},(0,r.createElement)("div",{className:"givewp__component-DesignPreview-spinner"},(0,r.createElement)(A.Spinner,null),t?(0,m.__)("Updating your changes","give"):(0,m.__)("Preparing your form design","give"),"..."),n&&(0,r.createElement)("div",{className:"givewp__component-DesignPreview-container"},(e=>{switch(e){case"classic":return(0,r.createElement)(Tn,null);case"multi-step":return(0,r.createElement)(Rn,null)}return null})(e)))}const On=(0,r.createRef)(),Nn=()=>{const{blocks:e,settings:t}=$e(),[n,i]=(0,r.useState)(!1),[o,s]=(0,r.useState)(!1),[a,l]=(0,r.useState)(!0),[c,h]=(0,r.useState)(null),[d,u]=(0,r.useState)(null);return(0,r.useEffect)((()=>{i(!0),x({blocks:e,formSettings:t}).then((e=>{h(e)}))}),[t.designId,t.goalType,t.goalStartDate,t.goalEndDate,t.goalProgressType,JSON.stringify(e)]),(0,r.useEffect)((()=>{l(!0)}),[t.designId]),(0,r.createElement)(r.Fragment,null,n&&(0,r.createElement)(In,{design:t.designId,editing:o,designUpdated:a}),(0,r.createElement)(Mn,{forwardRef:On,srcDoc:d,checkOrigin:!1,style:{width:"1px",minWidth:"100%",border:"0",display:n&&a?"none":"inherit",opacity:n?.5:1,transition:"opacity 0.3s ease-in-out"},onInit:e=>{e.iFrameResizer.resize(),i(!1),s(!0),l(!1)}}),(0,r.createElement)("iframe",{onLoad:e=>{const t=e.target;u(t.contentWindow.document.documentElement.innerHTML)},srcDoc:c,style:{display:"none"}}))},Dn="UPDATE_MENU_STATE",Pn="NAVIGATE_BACK_IN_MENU",Fn=(e,t)=>{switch(t.type){case Dn:const{hasChildren:n,path:i}=t.payload;return n?{...e,menuPage:e.menuPage+1,activeMenu:i}:{...e,activeMenu:i,activeRoute:i};case Pn:return{...e,menuPage:e.menuPage-1};default:return e}},Hn=(e,t)=>({type:Dn,payload:{hasChildren:e,path:t}}),Bn=()=>({type:Pn}),Wn=(0,r.createElement)(Ne.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(Ne.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})),zn=(0,r.createElement)(Ne.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(Ne.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"}));function Vn({item:e}){const[t,n]=Zn(),{settings:i}=$e(),o=t.activeMenu===e.path,s=e.childRoutes&&e.childRoutes.length>0,a=s&&t.activeMenu.split("/").includes(e.path),l="givewp-form-settings__menu";return e.showWhen&&!e.showWhen({item:e,settings:i})?null:(0,r.createElement)("li",{className:Be()({[`${l}__item`]:!0,[`${l}__item--is-active`]:o,[`${l}__item--has-children`]:s})},(0,r.createElement)("button",{onClick:()=>{n(Hn(s,e.path))}},e.name,s&&(0,r.createElement)(A.Icon,{icon:Wn})),a&&(0,r.createElement)("ul",null,(0,r.createElement)("li",null,(0,r.createElement)("button",{onClick:()=>{n(Bn())},className:`${l}__back-button`},(0,r.createElement)(A.Icon,{icon:zn})," ",(0,m.__)("Back to main menu","give"))),e.childRoutes.map(((e,t)=>(0,r.createElement)(Vn,{item:e,key:t})))))}function jn({routes:e}){const[t]=Zn();return(0,r.createElement)("div",{className:"givewp-form-settings__menu"},(0,r.createElement)("ul",{className:`givewp-form-settings__menu__page-${t.menuPage}`},e.map(((e,t)=>(0,r.createElement)(Vn,{item:e,key:t})))))}function Un({routes:e}){const[t]=Zn(),{settings:n}=$e(),i=xe(),o=e=>i(fe(e));return(0,r.createElement)(r.Fragment,null,e.map((e=>{if(e.childRoutes&&e.childRoutes.length>0)return(0,r.createElement)(Un,{key:e.path,routes:e.childRoutes});const i=e.element;return t.activeRoute===e.path&&(0,r.createElement)(i,{key:e.path,settings:n,setSettings:o})})))}function Gn({routes:e}){return(0,r.createElement)("div",{className:"givewp-form-settings__content"},(0,r.createElement)(Un,{routes:e}))}const Kn=(0,r.createContext)(void 0);function Zn(){const e=(0,r.useContext)(Kn);if(!e)throw new Error("useFormSettingsContext must be used within a FormSettingsContextProvider");return e}function qn({routes:e}){const[t,n]=(0,r.useReducer)(Fn,{menuPage:1,activeMenu:"general",activeRoute:"general"});return(0,r.createElement)(Kn.Provider,{value:[t,n]},(0,r.createElement)("div",{className:"givewp-form-settings"},(0,r.createElement)(jn,{routes:e}),(0,r.createElement)(Gn,{routes:e})))}var Yn=n(5893);const Xn=window.wp.keycodes;function Qn(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&i.firstChild?i.insertBefore(o,i.firstChild):i.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}"function"==typeof SuppressedError&&SuppressedError,Qn(".mce-floatpanel,.mce-inline-toolbar-grp,.mce-notification{z-index:9999999999!important}.components-popover__content .givewp-classic-editor{margin:0!important}.givewp-classic-editor{width:100%}.givewp-classic-editor>label{box-sizing:border-box;display:block;font-size:11px;font-weight:500;line-height:1.4;margin-bottom:.7rem;margin-top:1.5rem;max-width:100%;overflow:hidden;padding-bottom:0;padding-top:0;text-overflow:ellipsis;text-transform:uppercase;white-space:nowrap;z-index:1}.givewp-classic-editor .wp-editor-tools{z-index:auto}.givewp-classic-editor .wp-editor-tabs{display:none}.givewp-classic-editor .wp-editor-container{border-radius:.125rem;overflow:hidden}.givewp-classic-editor .mce-top-part:before{display:none}.givewp-classic-editor .mce-tinymce,.givewp-classic-editor .wp-editor-container{box-shadow:none}.givewp-classic-editor textarea{width:100%}.givewp-classic-editor .wp-switch-editor{box-sizing:content-box!important}.givewp-classic-editor.show-editor-tabs .wp-editor-tabs{display:block!important}.givewp-classic-editor.show-editor-tabs .quicktags-toolbar input.button.button-small{background:#f6f7f7;border-color:var(--wp-admin-theme-color)!important;color:var(--wp-admin-theme-color);font-size:12px!important;inline-size:auto;line-height:2;min-height:26px;padding:0 8px;vertical-align:top}.givewp-classic-editor.show-editor-tabs .wp-editor-wrap.html-active textarea{border:0}");var Jn,ei=window.wp;function ti(e){var t=e.id,n=e.label,i=void 0===n?null:n,o=e.content,r=e.setContent,s=e.rows,l=void 0===s?20:s,c=e.showEditorTabs,h=void 0!==c&&c,d=e.showMediaButtons,u=void 0!==d&&d,p=e.plugins,g=void 0===p?"charmap,colorpicker,hr,lists,media,paste,tabfocus,textcolor,fullscreen,wordpress,wpautoresize,wpeditimage,wpemoji,wpgallery,wplink,wpdialogs,wptextpattern,wpview":p,f=e.toolbar1,m=void 0===f?"bold,italic,wp_add_media,bullist,numlist,blockquote,alignleft,aligncenter,alignright,link,fullscreen,wp_adv":f,v=e.toolbar2,w=void 0===v?"formatselect,strikethrough,hr,forecolor,pastetext,removeformat,unlink,outdent,indent,undo,redo":v,b=(0,a.useRef)(!1),y=(0,a.useState)(o),C=y[0],$=y[1];return(0,a.useEffect)((function(){b.current&&r(C)}),[C]),(0,a.useEffect)((function(){b.current&&C!==o&&window.tinymce.get("editor-".concat(t)).setContent(o)}),[o]),(0,a.useEffect)((function(){function e(e){var t;C&&e.on("loadContent",(function(){e._lastChange&&e._lastChange!==C?e.setContent(e.getContent()):e.setContent(C)})),e.on("blur",(function(){t=e.selection.getBookmark(2,!0);var n=document.querySelector(".interface-interface-skeleton__content"),i=n.scrollTop;return e.once("focus",(function(){t&&(e.selection.moveToBookmark(t),n.scrollTop!==i&&(n.scrollTop=i))})),!1})),e.on("mousedown touchstart",(function(){t=null}));var n=(0,B.debounce)((function(){var t=e.getContent();t!==e._lastChange&&(e._lastChange=t,$(t))}),250);e.on("Paste Change input Undo Redo",n),e.on("remove",n.cancel),e.on("keydown",(function(t){Xn.isKeyboardEvent.primary(t,"z")&&t.stopPropagation(),t.keyCode!==Xn.BACKSPACE&&t.keyCode!==Xn.DELETE||!function(e){var t=e.getBody();return!(t.childNodes.length>1)&&(0===t.childNodes.length||!(t.childNodes[0].childNodes.length>1)&&/^\n?$/.test(t.innerText||t.textContent))}(e)||(t.preventDefault(),t.stopImmediatePropagation()),t.altKey&&t.keyCode===Xn.F10&&t.stopPropagation()})),e.on("init",(function(){var t=e.getBody();t.ownerDocument.activeElement===t&&(t.blur(),e.focus())}))}function n(){setTimeout((function(){ei.editor.initialize("editor-".concat(t),{mediaButtons:u,tinymce:{tinymce:!0,plugins:g,toolbar1:m,toolbar2:w,setup:e,resize:!1,statusbar:!1},quicktags:!0})}),250)}function i(){"complete"===document.readyState&&n()}return b.current=!0,"complete"===document.readyState?n():document.addEventListener("readystatechange",i),function(){document.removeEventListener("readystatechange",i),ei.editor.remove("editor-".concat(t))}}),[]),(0,Yn.jsx)("div",{className:"givewp-classic-editor ".concat(!!h&&"show-editor-tabs"),children:(0,Yn.jsx)(A.BaseControl,{id:"editor-base-control-".concat(t),label:i,children:(0,Yn.jsx)("textarea",{rows:l,id:"editor-".concat(t),onChange:function(e){window.tinymce.get("editor-".concat(t))._lastChange=e.target.value,$(e.target.value)}})})})}function ni(e){var t=e.title,n=e.description,i=void 0===n?null:n,o=e.children;return(0,Yn.jsxs)("div",{className:"givewp-form-settings__section",children:[(0,Yn.jsxs)("div",{className:"givewp-form-settings__section__header",children:[(0,Yn.jsx)("h4",{children:t}),i&&(0,Yn.jsx)("p",{children:i})]}),(0,Yn.jsx)("div",{className:"givewp-form-settings__section__body",children:o})]})}!function(e){e.USD="USD",e.CAD="CAD",e.EUR="EUR",e.AED="AED",e.AFN="AFN",e.ALL="ALL",e.AMD="AMD",e.ARS="ARS",e.AUD="AUD",e.AZN="AZN",e.BAM="BAM",e.BDT="BDT",e.BGN="BGN",e.BHD="BHD",e.BIF="BIF",e.BND="BND",e.BOB="BOB",e.BRL="BRL",e.BWP="BWP",e.BYN="BYN",e.BZD="BZD",e.CDF="CDF",e.CHF="CHF",e.CLP="CLP",e.CNY="CNY",e.COP="COP",e.CRC="CRC",e.CVE="CVE",e.CZK="CZK",e.DJF="DJF",e.DKK="DKK",e.DOP="DOP",e.DZD="DZD",e.EEK="EEK",e.EGP="EGP",e.ERN="ERN",e.ETB="ETB",e.GBP="GBP",e.GEL="GEL",e.GHS="GHS",e.GNF="GNF",e.GTQ="GTQ",e.HKD="HKD",e.HNL="HNL",e.HRK="HRK",e.HUF="HUF",e.IDR="IDR",e.ILS="ILS",e.INR="INR",e.IQD="IQD",e.IRR="IRR",e.ISK="ISK",e.JMD="JMD",e.JOD="JOD",e.JPY="JPY",e.KES="KES",e.KHR="KHR",e.KMF="KMF",e.KRW="KRW",e.KWD="KWD",e.KZT="KZT",e.LBP="LBP",e.LKR="LKR",e.LTL="LTL",e.LVL="LVL",e.LYD="LYD",e.MAD="MAD",e.MDL="MDL",e.MGA="MGA",e.MKD="MKD",e.MMK="MMK",e.MOP="MOP",e.MUR="MUR",e.MXN="MXN",e.MYR="MYR",e.MZN="MZN",e.NAD="NAD",e.NGN="NGN",e.NIO="NIO",e.NOK="NOK",e.NPR="NPR",e.NZD="NZD",e.OMR="OMR",e.PAB="PAB",e.PEN="PEN",e.PHP="PHP",e.PKR="PKR",e.PLN="PLN",e.PYG="PYG",e.QAR="QAR",e.RON="RON",e.RSD="RSD",e.RUB="RUB",e.RWF="RWF",e.SAR="SAR",e.SDG="SDG",e.SEK="SEK",e.SGD="SGD",e.SOS="SOS",e.SYP="SYP",e.THB="THB",e.TND="TND",e.TOP="TOP",e.TRY="TRY",e.TTD="TTD",e.TWD="TWD",e.TZS="TZS",e.UAH="UAH",e.UGX="UGX",e.UYU="UYU",e.UZS="UZS",e.VEF="VEF",e.VND="VND",e.XAF="XAF",e.XOF="XOF",e.YER="YER",e.ZAR="ZAR",e.ZMK="ZMK",e.ZWL="ZWL"}(Jn||(Jn={})),Qn(".givewp-options-header{align-items:center;display:flex;flex-direction:row;gap:.5rem;justify-content:space-between;width:100%}.givewp-options-header--label{margin-bottom:0}.givewp-options-header--button{color:var(--givewp-grey-500);height:fit-content!important;min-width:fit-content!important;padding:0!important}.givewp-options-header--button svg{height:1.25rem;width:1.25rem}.givewp-options-list--item{display:grid;gap:.5rem;grid-template-columns:auto auto 1fr auto;grid-template-rows:2rem;margin-top:.5rem}.givewp-options-list--item>*{align-self:center}.givewp-options-list--item--draggable{color:var(--givewp-grey-500);cursor:grab;display:flex;user-select:none}.givewp-options-list--item--checked{margin:0!important;width:1rem!important}.givewp-options-list--item--inputs{display:flex;flex-direction:column;gap:.25rem}.givewp-options-list--item--inputs .components-base-control{margin-bottom:0!important}.givewp-options-list--item--inputs--open{grid-row:span 2}.givewp-options-list--item--inputs .givewp-options-list__textarea-wrapper{display:grid;gap:2px;width:calc(100% + 20px + .5rem)}.givewp-options-list--item--inputs .givewp-options-list__textarea-wrapper .givewp-options-list__textarea{border:1px solid #8c8c8c;border-radius:2px;height:64px}.givewp-options-list--item--inputs .givewp-options-list__textarea-counter{color:var(--givewp-grey-500);font-size:.625rem;line-height:1.4;text-align:right}.givewp-options-list--item--button{color:var(--givewp-grey-500);height:fit-content!important;min-width:fit-content!important;padding:0!important}"),Qn(".givewp-form-settings__section{border-bottom:1px solid var(--givewp-grey-50);display:flex;gap:3.5rem;margin-bottom:2.5rem;padding-bottom:2.5rem}@media (max-width:1279px){.givewp-form-settings__section{flex-direction:column;gap:2rem}}.givewp-form-settings__section__header{width:20rem}@media (max-width:1279px){.givewp-form-settings__section__header{padding-left:3.25rem;width:100%}}.givewp-form-settings__section__header h4{color:var(--givewp-grey-900);font-size:1rem;line-height:1.5rem;margin:0 0 var(--givewp-spacing-2)}.givewp-form-settings__section__header p{color:var(--givewp-grey-500);font-size:.75rem;line-height:1.125rem;margin:0}.givewp-form-settings__section__body{flex:1;max-width:33.25rem}.givewp-form-settings__section__body>:not(.no-extra-gap){padding-left:3.25rem}"),Qn(".givewp-block-notice{background:#fffaf2;border-left:2px solid var(--givewp-orange-400);border-radius:2px;padding:var(--givewp-spacing-3) var(--givewp-spacing-4)}.givewp-block-notice span{display:block;font-size:12px}.givewp-block-notice__title{color:var(--givewp-grey-900);font-size:.75rem;font-stretch:normal;font-style:normal;font-weight:600;line-height:1.33}.givewp-block-notice__description{color:var(--givewp-grey-700);margin:var(--givewp-spacing-2) 0 var(--givewp-spacing-4) 0}.givewp-block-notice__anchor{color:var(--givewp-grey-900);cursor:pointer}");const ii=({settings:e,setSettings:t})=>{const{formGridCustomize:n,formGridRedirectUrl:i,formGridDonateButtonText:o}=e;return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(A.PanelRow,{className:"no-extra-gap"},(0,r.createElement)(A.ToggleControl,{label:(0,m.__)("Customize form grid","give"),help:(0,m.__)("Customize the Redirect URL and Donate button text for this form in the Form Grid.","give"),checked:n,onChange:()=>{t({formGridCustomize:!n})}})),n&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)(A.PanelRow,null,(0,r.createElement)(A.TextControl,{label:(0,m.__)("Redirect URL","give"),placeholder:"https://example.com/donation",help:(0,m.__)('The full URL of the page you want this form to redirect to when clicked on from the Form Grid. This only applies when the Form Grid uses the "Redirect" method.',"give"),value:i,onChange:e=>t({formGridRedirectUrl:e})})),(0,r.createElement)(A.PanelRow,null,(0,r.createElement)(A.TextControl,{label:(0,m.__)("Donate Button Text","give"),placeholder:(0,m.__)("Donate","give"),help:(0,m.__)("The text on the Donate Button for this form when displayed on the Form Grid. This setting only applies if the Donate Button display option is enabled in your Form Grid.","give"),value:o,onChange:e=>t({formGridDonateButtonText:e})}))))},oi=({settings:e,setSettings:t})=>{const{registrationNotification:n}=e;return(0,r.createElement)(A.PanelRow,{className:"no-extra-gap"},(0,r.createElement)(A.ToggleControl,{label:(0,m.__)("Send new account notifications","give"),checked:n,onChange:()=>t({registrationNotification:!n}),help:(0,m.__)("When enabled, donors will be notified that they have an account they can use to manage their donations. Disable if you do not want donors to be aware of their account.","give")}))},ri=({id:e,content:t,onChange:n})=>(0,r.createElement)(A.PanelRow,null,(0,r.createElement)(ti,{id:e,content:t,setContent:e=>n(e),rows:10})),si=(0,r.createElement)(Ne.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(Ne.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5 4.5h11a.5.5 0 0 1 .5.5v11a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V5a.5.5 0 0 1 .5-.5ZM3 5a2 2 0 0 1 2-2h11a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5Zm17 3v10.75c0 .69-.56 1.25-1.25 1.25H6v1.5h12.75a2.75 2.75 0 0 0 2.75-2.75V8H20Z"}));function ai({textToCopy:e}){const[t,n]=(0,r.useState)(!1),i=(0,B.useCopyToClipboard)(e,(()=>(n(!0),setTimeout((()=>n(!1)),1e3))));return(0,r.createElement)(A.Button,{className:"givewp-template-tags__copy-button",isSmall:!0,variant:"tertiary",ref:i,icon:si},t?(0,m.__)("Copied!","give"):(0,m.__)("Copy Tag","give"))}function li({templateTags:e,templateTagsRef:t}){return(0,r.createElement)("ul",{className:"givewp-template-tags__list",ref:t},e.map((({id:e,description:t})=>{const n=`{${e}}`;return(0,r.createElement)("li",{className:"givewp-template-tags__list-item",key:e},(0,r.createElement)("div",{className:"givewp-template-tags__list-item-top"},(0,r.createElement)("span",{className:"givewp-template-tags__tag"},n),(0,r.createElement)(ai,{textToCopy:n})),(0,r.createElement)("div",{className:"givewp-template-tags__list-item-bottom"},(0,r.createElement)("span",{className:"givewp-template-tags__description"},t)))})))}const{donationConfirmationTemplateTags:ci}=d(),hi=({emailType:e,defaultEmailAddress:t,settings:n})=>{const[i,o]=(0,r.useState)(t),{emailTemplateOptions:s,emailTemplate:a,emailLogo:l,emailFromName:c,emailFromEmail:h}=n,{formId:u,emailPreviewURL:p,nonce:g}=d();return(0,r.createElement)("div",{className:"email-settings__send-preview-email"},null!==t&&(0,r.createElement)(A.TextControl,{onChange:o,value:i}),(0,r.createElement)(A.Button,{className:"email-settings__email-btn",variant:"secondary",onClick:()=>{jQuery.post({url:p+"/send",headers:{"X-WP-Nonce":g},data:{form_id:u,email_address:i,email_type:e,email_template:a,email_logo:l,email_from_name:c,email_from_email:h,...s[e]}}).then((e=>{alert("email sent")})).fail((e=>{console.log(e),alert("error sending email")}))}},(0,m.__)("Send test email","give")))},di=({emailType:e,settings:t})=>{const[n,i]=(0,r.useState)(null),{emailTemplateOptions:o,emailTemplate:s,emailLogo:a,emailFromName:l,emailFromEmail:c}=t,{formId:h,nonce:u,emailPreviewURL:p}=d();return(0,r.useEffect)((()=>{jQuery.post({url:p+"/show?query",headers:{"X-WP-Nonce":u},data:{form_id:h,email_type:e,email_template:s,email_logo:a,email_from_name:l,email_from_email:c,...o[e]}}).then((e=>{i(e)})).fail((e=>{i("Error loading preview.")}))}),[]),n?(0,r.createElement)("iframe",{srcDoc:n,className:"email-settings-preview-iframe",style:{width:"100%",height:"100%",border:"none"}}):(0,r.createElement)("div",{className:"email-settings-preview-generating"},(0,m.__)("Generating preview...","give"))},ui=(0,a.forwardRef)((function({icon:e,size:t=24,...n},i){return(0,a.cloneElement)(e,{width:t,height:t,...n,ref:i})})),pi=(0,r.createElement)(Ne.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(Ne.Path,{d:"M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z"}));function gi(){return(0,r.createElement)(A.SVG,{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)(A.Path,{d:"M5.336 2c0-.368.298-.667.667-.667h4a.667.667 0 1 1 0 1.334h-4A.667.667 0 0 1 5.336 2z",fill:"currentColor"}),(0,r.createElement)(A.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M1.336 4c0-.368.298-.667.667-.667h12a.667.667 0 1 1 0 1.334h-.71l-.428 6.417c-.033.503-.061.92-.111 1.26-.052.353-.134.675-.305.976-.267.468-.67.845-1.155 1.08-.311.15-.639.211-.994.24-.342.027-.76.027-1.265.027H6.97c-.505 0-.923 0-1.264-.027-.356-.029-.684-.09-.995-.24a2.667 2.667 0 0 1-1.154-1.08c-.172-.3-.254-.623-.306-.977-.05-.339-.077-.756-.11-1.26l-.429-6.416h-.71A.667.667 0 0 1 1.337 4z",fill:"currentColor"}))}const fi=({notification:e,templateTagsRef:t,settings:n,setSettings:i})=>{var o,s;const{emailTemplateOptions:a}=n,{emailNotifications:l,emailDefaultAddress:c}=d(),h=l.find((t=>t.id===e)),u={status:null!==(o=h.defaultValues.notification)&&void 0!==o?o:"global",email_subject:h.defaultValues.email_subject,email_header:h.defaultValues.email_header,email_message:h.defaultValues.email_message.replace(/\n/g,"<br />"),email_content_type:h.defaultValues.email_content_type,recipient:[c],...a[e]},p=u.recipient?Object.values(u.recipient):[""],g=(t,n)=>{i({emailTemplateOptions:{...a,[e]:{...u,[t]:n}}})};return(0,r.createElement)("div",{className:"email-settings-template__container"},(0,r.createElement)(ni,{title:(0,m.__)("Email notification","give"),description:(0,m.__)("Global options are set in GiveWP settings. You may override them for this form here.","give")},(0,r.createElement)(A.PanelRow,null,(0,r.createElement)(A.RadioControl,{className:"radio-control--email-options",label:(0,m.__)("Email options","givewp"),hideLabelFromVision:!0,selected:null!==(s=u.status)&&void 0!==s?s:"global",options:h.statusOptions,onChange:e=>g("status",e)}))),"enabled"===u.status&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)(ni,{title:(0,m.__)("Template details","give"),description:(0,m.__)("Set the content structure for the email","give")},(0,r.createElement)(A.PanelRow,null,(0,r.createElement)(A.TextControl,{label:(0,m.__)("Email Subject","givewp"),help:(0,m.__)("Enter the email subject line","givewp"),onChange:e=>g("email_subject",e),value:u.email_subject||h.defaultValues.email_subject})),(0,r.createElement)(A.PanelRow,null,(0,r.createElement)(A.TextControl,{label:(0,m.__)("Email Header","givewp"),help:(0,m.__)("Enter the email header that appears at the top of the email","givewp"),onChange:e=>g("email_header",e),value:u.email_header||h.defaultValues.email_header})),(0,r.createElement)(A.PanelRow,null,(0,r.createElement)(A.SelectControl,{className:"select-control--email-options",onChange:e=>g("email_content_type",e),label:(0,m.__)("Email content type","givewp"),help:(0,m.__)("Choose email type","givewp"),value:u.email_content_type||h.defaultValues.email_content_type,options:[{label:(0,m.__)("HTML","givewp"),value:"text/html"},{label:(0,m.__)("Plain","givewp"),value:"text/plain"}]})),(0,r.createElement)(A.PanelRow,null,(0,r.createElement)("div",{style:{width:"100%"}},(0,r.createElement)(ti,{key:"give-email-template-message__"+e,id:"give-email-template-message__"+e,label:(0,m.__)("Email message","give"),content:u.email_message,setContent:e=>g("email_message",e),rows:10}),(0,r.createElement)(A.Button,{variant:"secondary",onClick:()=>t.current.scrollIntoView({behavior:"smooth"}),style:{width:"100%",marginTop:"0.5rem",height:"2.5rem",justifyContent:"center"}},(0,m.__)("View template tags","give"))))),(0,r.createElement)(ni,{title:(0,m.__)("Email recipient","give"),description:(0,m.__)("Email address that should receive a notification","give")},h.supportsRecipients&&(0,r.createElement)("div",{className:"email-settings-template__recipient"},(0,r.createElement)(A.BaseControl,{id:"give-email-template-recipient",label:(0,m.__)("Email","givewp")},p.map(((e,t)=>(0,r.createElement)("li",{key:"level-option-inspector-"+t,className:"base-control--email-options"},(0,r.createElement)(A.TextControl,{hideLabelFromVision:!0,value:e,onChange:e=>{const n=[...p];n[t]=e,g("recipient",n)}}),(0,r.createElement)(A.Button,{className:"email-settings-template__recipient-delete-btn",onClick:()=>{p.splice(t,1),g("recipient",p.slice())}},(0,r.createElement)(gi,null))))),(0,r.createElement)(A.Button,{className:"email-settings-template__recipient-add-email-btn",variant:"secondary",onClick:()=>g("recipient",[...p,""])},(0,r.createElement)(ui,{size:17,icon:pi})," ",(0,m.__)("Add email","givewp")))),!h.supportsRecipients&&(0,r.createElement)(A.TextControl,{disabled:!0,label:(0,m.__)("Email","givewp"),help:(0,m.__)("This email is automatically sent to the individual fundraiser and the recipient cannot be customized.","givewp"),onChange:()=>null,value:"{donor_email}"}))))};function mi({notification:e,settings:t,setSettings:n}){var i;const[o,s]=(0,r.useState)(!1),l=(0,r.useRef)(null),{emailTemplateOptions:c}=t,h=null!==(i=c[e]?.status)&&void 0!==i?i:"global",{emailTemplateTags:u,emailDefaultAddress:p}=d(),g=(0,a.createInterpolateElement)((0,m.__)("Available template tags for this email. HTML is accepted. <a>See our documentation</a> for examples of how to use custom meta email tags to output additional donor or donation information in your GiveWP emails","give"),{a:(0,r.createElement)("a",{href:"https://givewp.com/documentation/core/settings/emails/email-tags/",target:"_blank"})});return(0,r.useEffect)((()=>{o&&s(!1)}),[e]),(0,r.createElement)(r.Fragment,null,o&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)(di,{emailType:e,settings:t}),(0,r.createElement)(A.Button,{className:"email-preview__back-btn",variant:"secondary",onClick:()=>s(!1)},(0,m.__)("Back to template settings","give"))),!o&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:"email-settings"},(0,r.createElement)(fi,{notification:e,settings:t,setSettings:n,templateTagsRef:l}),"enabled"===h&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)(ni,{title:(0,m.__)("Send a test email","give"),description:(0,m.__)("Enter the email address you want to send a test email to.","give")},(0,r.createElement)(A.PanelRow,null,(0,r.createElement)(hi,{defaultEmailAddress:p,emailType:e,settings:t}))),(0,r.createElement)(ni,{title:(0,m.__)("Template tags","give"),description:g},(0,r.createElement)(A.PanelRow,null,(0,r.createElement)(li,{templateTags:u,templateTagsRef:l}))),(0,r.createElement)(A.Button,{className:"email-settings__email-btn email-settings__email-btn--preview",variant:"secondary",onClick:()=>s(!0)},(0,m.__)("Preview email","give"))))))}const vi=({settings:e})=>{const{emailOptionsStatus:t}=e;return"enabled"===t},wi=[{name:(0,m.__)("General","give"),path:"general",element:function({settings:e,setSettings:t}){const n=(0,a.createInterpolateElement)((0,m.__)("The GiveWP Form Grid provides a way to add a grid layout of multiple forms into posts and pages using either a block or shortcode. <a>Learn more about the Form Grid</a>","give"),{a:(0,r.createElement)("a",{href:"https://docs.givewp.com/form-grid-addon",target:"_blank"})});return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(ni,{title:(0,m.__)("General","give"),description:(0,m.__)("This includes the form name, the permalink and the visibility of this form.","give")},(0,r.createElement)(Jt,{settings:e,setSettings:t})),(0,r.createElement)(ni,{title:(0,m.__)("User Registration","give"),description:(0,m.__)("Notify donors that they have an account they can use to manage their donations","give")},(0,r.createElement)(oi,{settings:e,setSettings:t})),(0,r.createElement)(ni,{title:(0,m.__)("Form Grid","give"),description:n},(0,r.createElement)(ii,{settings:e,setSettings:t})))}},{name:(0,m.__)("Donation Confirmation","give"),path:"donation-confirmation",element:function({settings:e,setSettings:t}){const{receiptHeading:n,receiptDescription:i}=e;return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(ni,{title:(0,m.__)("Header","give"),description:(0,m.__)("This is the first message that displays in the donation confirmation.","give")},(0,r.createElement)(ri,{id:"give-form-settings__donation-confirmation-heading",content:n,onChange:e=>t({receiptHeading:e})})),(0,r.createElement)(ni,{title:(0,m.__)("Description","give"),description:(0,m.__)("This is the second message that displays in the donation confirmation.","give")},(0,r.createElement)(ri,{id:"give-form-settings__donation-confirmation-description",content:i,onChange:e=>t({receiptDescription:e})})),(0,r.createElement)(ni,{title:(0,m.__)("Template tags","give"),description:(0,m.__)("Available template tags for the header and description of the donation confirmation.","give")},(0,r.createElement)(A.PanelRow,null,(0,r.createElement)(li,{templateTags:ci}))))}},{name:(0,m.__)("Email Settings","give"),path:"email-settings",element:null,childRoutes:[{name:(0,m.__)("General","give"),path:"email-settings/general",element:function({settings:e,setSettings:t}){const{emailOptionsStatus:n,emailTemplate:i,emailLogo:o,emailFromName:s,emailFromEmail:a}=e;return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(ni,{title:(0,m.__)("Email notifications","give"),description:(0,m.__)("GiveWP sends emails to both donors and specified site admins for various purposes.","give")},(0,r.createElement)(A.PanelRow,{className:"no-extra-gap"},(0,r.createElement)(A.ToggleControl,{label:(0,m.__)("Customize email options","give"),help:(0,m.__)("Uses global settings when disabled.","give"),checked:"enabled"===n,onChange:e=>{t({emailOptionsStatus:e?"enabled":"global"})}}))),"enabled"===n&&(0,r.createElement)(ni,{title:(0,m.__)("Template details","give"),description:(0,m.__)("Set the content structure for the email","give")},(0,r.createElement)(A.PanelRow,null,(0,r.createElement)(A.SelectControl,{label:(0,m.__)("Email Template","givewp"),help:(0,m.__)("Choose your template from the available registered template types","givewp"),options:[{label:(0,m.__)("Default template","givewp"),value:"default"},{label:(0,m.__)("No template, plain text only","givewp"),value:"none"}],value:i,onChange:e=>t({emailTemplate:e})})),(0,r.createElement)(A.PanelRow,null,(0,r.createElement)(A.TextControl,{label:(0,m.__)("From Name","givewp"),help:(0,m.__)('The name which appears in the "From" field in all GiveWP donation emails.',"givewp"),value:s,onChange:e=>t({emailFromName:e})})),(0,r.createElement)(A.PanelRow,null,(0,r.createElement)(A.TextControl,{label:(0,m.__)("From Email","givewp"),help:(0,m.__)('Email address from which all GiveWP emails are sent from. This will act as the "from" and "reply-to" email address.',"givewp"),value:a,onChange:e=>t({emailFromEmail:e})})),(0,r.createElement)(A.PanelRow,null,(0,r.createElement)(Pe,{label:(0,m.__)("Logo URL","give"),value:o,onChange:e=>t({emailLogo:e}),help:(0,m.__)("Upload or choose a logo to be displayed at the top of the donation receipt emails. Displayed on HTML emails only.","give")}))))}},...(()=>{const{emailNotifications:e}=d();return e.map((e=>{const{id:t,title:n}=e;return{name:n,path:`email-settings/${t}`,element:e=>(0,r.createElement)(mi,{notification:t,...e}),showWhen:vi}}))})()]},...wp.hooks.applyFilters("givewp_form_builder_settings_additional_routes",[])];function bi(){return(0,r.createElement)(qn,{routes:yi(wi)})}function yi(e){const t=[];return e.filter((e=>{let n=function(e){return e.name&&"string"==typeof e.name&&e.path&&"string"==typeof e.path&&"element"in e}(e);return t.includes(e.path)?(console.error(`${(0,m.__)("Duplicate path found in FormSettings routes:","give")} ${e.path}`),n=!1):t.push(e.path),e.childRoutes&&(Array.isArray(e.childRoutes)?e.childRoutes=yi(e.childRoutes):(delete e.childRoutes,n=!1)),n}))}const Ci=window.wp.notices;function $i(){const e=(0,w.useSelect)((e=>e(Ci.store).getNotices()),[]),{removeNotice:t}=(0,w.useDispatch)(Ci.store),n=(0,L.filter)(e,{type:"snackbar"});return(0,r.createElement)(A.SnackbarList,{notices:n,className:"components-editor-notices__snackbar",onRemove:t})}const xi={SETTINGS:"preview:settings",GOAL:"preview:goal",COLORS:"preview:colors",CSS:"preview:css",DESIGN_SETTINGS:"preview:design-settings"};function _i(){const e={};(0,r.useEffect)((()=>(addEventListener("message",t,!1),()=>removeEventListener("message",t))),[]);const t=t=>{const{event:n,data:i}=(e=>"string"==typeof e.data&&e.data.includes("[iFrameSizer]message:")?JSON.parse(e.data.replace("[iFrameSizer]message:","")):e.data)(t);if(e[n]){const t={};Object.entries(i).forEach((([e,n])=>{"function"!=typeof n&&"object"!=typeof n&&(t[e]=n)})),e[n].forEach((e=>{e(t)}))}},n=(t,n)=>{e[t]||(e[t]=[]),e[t].push(n)},i=(e,t,n)=>{n.current?.sendMessage&&n.current.sendMessage({event:e,data:t})};return{unsubscribe:t=>{e[t]&&delete e[t]},unsubscribeAll:()=>{for(const t in xi)delete e[t]},publishGoal:e=>{i(xi.GOAL,e,On)},publishGoalType:e=>{const t=["amount","amountFromSubscriptions"].includes(e);i(xi.GOAL,{type:e,label:e,typeIsCount:!t,typeIsMoney:t},On)},publishColors:e=>{i(xi.COLORS,e,On)},publishCss:e=>{i(xi.CSS,e,On)},publishSettings:e=>{i(xi.SETTINGS,e,On)},publishDesignSettings:e=>{i(xi.DESIGN_SETTINGS,e,On)},subscribeToGoal:e=>{n(xi.GOAL,e)},subscribeToColors:e=>{n(xi.COLORS,e)},subscribeToSettings:e=>{n(xi.SETTINGS,e)},subscribeToCss:e=>{n(xi.CSS,e)},subscribeToDesignSettings:e=>{n(xi.DESIGN_SETTINGS,e)}}}const Si=(0,r.createElement)(Ne.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(Ne.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"})),Ei=({label:e,placeholder:t,date:n,onSelect:i,invalidDateBefore:o=null,invalidDateAfter:s=null,is12Hour:a=!0,showTimeSelector:l=!1})=>{const c=(0,r.useRef)(),[h,d]=(0,r.useState)(n||(new Date).toISOString().slice(0,19)),[u,p]=(0,r.useState)(!1),g=()=>{p((e=>!e))},f=e=>o&&s?!(e>new Date(o)&&e<new Date(s)):!!(o&&e<new Date(o))||!!(s&&e>new Date(s));return(0,r.createElement)(A.PanelRow,{ref:c},(0,r.createElement)(A.TextControl,{type:"text",value:n,label:e,placeholder:t,className:"givewp-date-picker_input",onChange:()=>{},onClick:g}),u&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)(A.Popover,{shift:!0,anchor:c.current,position:"middle left bottom",className:"givewp-date-picker_popover",offset:window?.chrome?30:0},(0,r.createElement)(A.Button,{className:"givewp-date-picker_popover__close-button",icon:Si,label:(0,m.__)("Close","give"),onClick:g}),(0,r.createElement)("label",null,e),l?(0,r.createElement)(A.DateTimePicker,{is12Hour:a,currentDate:h,isInvalidDate:e=>f(e),onChange:e=>{d(e)}}):(0,r.createElement)(A.DatePicker,{currentDate:h,isInvalidDate:e=>f(e),onChange:e=>{d(e)}}),(0,r.createElement)("div",{className:"givewp-date-picker_popover__buttons"},(0,r.createElement)(A.Button,{variant:"primary",onClick:()=>{i(h.replace("T"," ")),p(!1)}},(0,m.__)("Set Date","give")),(0,r.createElement)(A.Button,{variant:"secondary",onClick:()=>{i(""),p(!1)}},(0,m.__)("Reset","give")),(0,r.createElement)(A.Button,{onClick:g},(0,m.__)("Cancel","give"))))))},{goalTypeOptions:ki,goalProgressOptions:Ai}=d(),Li=({dispatch:e})=>{const{settings:{enableDonationGoal:t,enableAutoClose:n,goalAchievedMessage:i,goalType:o,goalProgressType:s,goalAmount:a,goalStartDate:l,goalEndDate:c}}=$e(),{publishGoal:h,publishGoalType:d}=_i(),[u,p]=(0,r.useState)(!window.goalNotificationData.isDismissed),g=ki.find((e=>e.value===o)),f=g?g.description:"",v=Ai.find((e=>e.value===s)),w=v?v.description:"",b={container:{position:"relative",display:"flex",flexDirection:"column",gap:8,padding:12,borderRadius:2,backgroundColor:"#f2f2f2",color:"#0e0e0e",fontSize:12},title:{fontWeight:600},closeIcon:{cursor:"pointer",height:16,width:16,position:"absolute",right:12,top:12},externalIcon:{height:18,width:18,fill:"#2271b1",float:"left",marginTop:2,marginRight:8}};return(0,r.createElement)(A.PanelBody,{title:(0,m.__)("Donation Goal","give"),initialOpen:!1},(0,r.createElement)(A.PanelRow,null,(0,r.createElement)(A.ToggleControl,{label:(0,m.__)("Enable Donation Goal","give"),help:(0,m.__)("Do you want to set a donation goal for this form?","give"),checked:t,onChange:()=>{e(fe({enableDonationGoal:!t})),h({show:!t})}})),t&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)(A.PanelRow,null,(0,r.createElement)(A.SelectControl,{label:(0,m.__)("Goal Type","give"),value:o,options:ki,onChange:t=>{e(fe({goalType:t})),d(t)},help:f})),(0,r.createElement)(A.PanelRow,null,g.isCurrency?(0,r.createElement)(le,{label:(0,m.__)("Goal Amount","give"),min:0,value:a,onValueChange:t=>{e(fe({goalAmount:t})),h({targetAmount:Number(t)})}}):(0,r.createElement)(A.__experimentalNumberControl,{label:(0,m.__)("Goal Amount","give"),min:0,value:a,onChange:t=>{e(fe({goalAmount:t})),h({targetAmount:Number(t)})}})),(0,r.createElement)(A.PanelRow,null,(0,r.createElement)(A.ToggleControl,{label:(0,m.__)("Auto-Close Form","give"),help:(0,m.__)("Do you want to close the donation forms and stop accepting donations once this goal has been met?","give"),checked:n,onChange:()=>e(fe({enableAutoClose:!n}))})),n&&(0,r.createElement)(A.PanelRow,null,(0,r.createElement)(A.TextareaControl,{label:(0,m.__)("Goal Achieved Message","give"),value:i,onChange:t=>e(fe({goalAchievedMessage:t}))})),(0,r.createElement)(A.PanelRow,null,(0,r.createElement)(A.SelectControl,{label:(0,m.__)("Goal Progress","give"),value:s,options:Ai,onChange:t=>{e(fe({goalProgressType:t}))},help:w})),"custom"===s&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)(Ei,{showTimeSelector:!0,label:(0,m.__)("Start Date","give"),placeholder:(0,m.__)("Select Date","give"),date:l,invalidDateAfter:c,onSelect:t=>{e(fe({goalStartDate:t}))}}),(0,r.createElement)(Ei,{showTimeSelector:!0,label:(0,m.__)("End Date","give"),placeholder:(0,m.__)("Select Date","give"),date:c,invalidDateBefore:l,onSelect:t=>{e(fe({goalEndDate:t}))}}),u&&(0,r.createElement)(A.PanelRow,null,(0,r.createElement)("div",{style:b.container},(0,r.createElement)("span",{style:b.title},(0,m.__)("What is custom goal progress?","give"),(0,r.createElement)(A.Icon,{icon:Si,style:b.closeIcon,onClick:()=>{fetch(window.goalNotificationData.actionUrl,{method:"POST"}).then((()=>{p(!1)}))}})),(0,r.createElement)("span",null,(0,m.__)("You can now set a time frame to show progress toward your goal.","give")),(0,r.createElement)("span",null,(0,r.createElement)("a",{href:"https://docs.givewp.com/goal-timeframe",target:"_blank"},(0,r.createElement)(A.Icon,{style:b.externalIcon,icon:ft}),(0,m.__)("Learn more about how to use the custom goal progress.","give"))))))))};function Mi({id:e,value:t,onChange:n,label:i,help:o,actionLabel:s,icon:a,reset:l}){let c;M().noConflict();const h=e=>{e.preventDefault(),c||(c=window.wp.media({title:(0,m.__)("Upload Image","give"),button:{text:(0,m.__)("Use this media","gie")},multiple:!1}),c.on("select",(function(){var e=c.state().get("selection").first().toJSON();n(e.url,e.alt)}))),c.open()};return(0,r.createElement)(A.BaseControl,{label:i,help:o,id:e},(0,r.createElement)("div",{className:"givewp-media-library-control"},t?(0,r.createElement)(r.Fragment,null,(0,r.createElement)(A.Button,{className:"givewp-media-library-control__reset",onClick:e=>{l()}},(0,r.createElement)("img",{className:"givewp-media-library-control__image",src:t,alt:(0,m.__)("uploaded image","give")}),(0,r.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 14 14",fill:"#fff"},(0,r.createElement)("path",{d:"M4.66675 1.74935C4.66675 1.42718 4.92792 1.16602 5.25008 1.16602H8.75008C9.07225 1.16602 9.33342 1.42718 9.33342 1.74935C9.33342 2.07152 9.07225 2.33268 8.75008 2.33268H5.25008C4.92792 2.33268 4.66675 2.07152 4.66675 1.74935Z",fill:"#fff"}),(0,r.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1.16675 3.49935C1.16675 3.17718 1.42792 2.91602 1.75008 2.91602H12.2501C12.5722 2.91602 12.8334 3.17718 12.8334 3.49935C12.8334 3.82152 12.5722 4.08268 12.2501 4.08268H11.6292L11.2549 9.69755C11.2255 10.1382 11.2012 10.5029 11.1576 10.7997C11.1122 11.1088 11.0402 11.3912 10.8903 11.6544C10.6569 12.0641 10.3048 12.3935 9.88046 12.5991C9.60788 12.7312 9.3213 12.7843 9.00992 12.809C8.71085 12.8327 8.34537 12.8327 7.90372 12.8327H6.09648C5.65483 12.8327 5.28935 12.8327 4.99028 12.809C4.6789 12.7843 4.39232 12.7312 4.11973 12.5991C3.69539 12.3935 3.34332 12.0641 3.1099 11.6544C2.95996 11.3912 2.88798 11.1088 2.84261 10.7997C2.79903 10.5029 2.77472 10.1382 2.74535 9.69754L2.37102 4.08268H1.75008C1.42792 4.08268 1.16675 3.82152 1.16675 3.49935ZM5.83342 5.54102C6.15558 5.54102 6.41675 5.80218 6.41675 6.12435V9.04102C6.41675 9.36318 6.15558 9.62435 5.83342 9.62435C5.51125 9.62435 5.25008 9.36318 5.25008 9.04102V6.12435C5.25008 5.80218 5.51125 5.54102 5.83342 5.54102ZM8.75008 6.12435C8.75008 5.80218 8.48891 5.54102 8.16675 5.54102C7.84458 5.54102 7.58342 5.80218 7.58342 6.12435V9.04102C7.58342 9.36318 7.84458 9.62435 8.16675 9.62435C8.48891 9.62435 8.75008 9.36318 8.75008 9.04102V6.12435Z",fill:"#fff"}))),(0,r.createElement)(A.Button,{className:"givewp-media-library-control__button givewp-media-library-control__button--update",variant:"secondary",onClick:h},(0,m.__)("Change Image","give"))):(0,r.createElement)(A.Button,{className:"givewp-media-library-control__button",icon:a,variant:"secondary",onClick:h},s)))}function Ti({dispatch:e,publishSettings:t}){const{settings:{showHeader:n,showHeading:i,heading:o,showDescription:s,description:a,designSettingsImageUrl:l,designSettingsImageStyle:c="background"}}=$e();return(0,r.createElement)(A.PanelBody,{title:(0,m.__)("Header","give"),initialOpen:!1},(0,r.createElement)(A.PanelRow,null,(0,r.createElement)(A.ToggleControl,{label:(0,m.__)("Show Header","give"),checked:n,onChange:()=>{e(fe({showHeader:!n})),t({showHeader:!n})}})),n&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)(A.PanelRow,null,(0,r.createElement)(A.ToggleControl,{label:(0,m.__)("Show Heading","give"),checked:i,onChange:()=>{e(fe({showHeading:!i})),t({showHeading:!i})}})),(0,r.createElement)(A.PanelRow,null,(0,r.createElement)(A.ToggleControl,{label:(0,m.__)("Show Description","give"),checked:s,onChange:()=>{e(fe({showDescription:!s})),t({showDescription:!s})}})),i&&(0,r.createElement)(A.PanelRow,null,(0,r.createElement)(A.TextControl,{label:(0,m.__)("Heading","give"),value:o,onChange:n=>{e(fe({heading:n})),t({heading:n})}})),s&&(0,r.createElement)(A.PanelRow,null,(0,r.createElement)(A.TextareaControl,{label:(0,m.__)("Description","give"),value:a,onChange:n=>{e(fe({description:n})),t({description:n})}})),(0,r.createElement)(A.PanelRow,null,(0,r.createElement)(Mi,{id:"givewp-header-media-library-control",icon:De,label:(0,m.__)("Image","give"),actionLabel:(0,m.__)("Upload Image","give"),value:l,onChange:(n,i)=>{e(fe({designSettingsImageUrl:n,designSettingsImageAlt:i,designSettingsImageStyle:c})),t({designSettingsImageUrl:n,designSettingsImageAlt:i,designSettingsImageStyle:c})},reset:()=>{const n={designSettingsImageUrl:""};e(fe(n)),t(n)}})),l&&(0,r.createElement)(A.PanelRow,null,(0,r.createElement)(A.SelectControl,{label:(0,m.__)("Image Style","give"),help:(0,m.__)("Determines how the image will be applied in the header for this form.","give"),onChange:n=>{e(fe({designSettingsImageUrl:l,designSettingsImageStyle:n})),t({designSettingsImageUrl:l,designSettingsImageStyle:n})},value:c,options:[{label:(0,m.__)("Background","give"),value:"background"},{label:(0,m.__)("Above","give"),value:"above"},{label:(0,m.__)("Center","give"),value:"center"}]}))))}function Ri({dispatch:e,formDesigns:t,designId:n}){const i=Object.values(t).map((({id:e,name:t})=>({value:e,label:t})));return(0,r.createElement)(A.PanelBody,{title:(0,m.__)("Donation Form","give"),initialOpen:!0},(0,r.createElement)(A.PanelRow,null,(0,r.createElement)(A.SelectControl,{label:(0,m.__)("Form layout","give"),value:n,onChange:t=>e(fe({designId:t})),options:i,help:(0,m.__)("Change the appearance of your donation form on your site. Each option has a different layout.","give")})))}function Ii({dispatch:e,publishSettings:t}){const{settings:{donateButtonCaption:n,designSettingsImageUrl:i,designSettingsImageStyle:o,designSettingsLogoUrl:s,designSettingsLogoPosition:a}}=$e();return(0,r.createElement)(A.PanelBody,{title:(0,m.__)("Donate Button","give"),initialOpen:!1},(0,r.createElement)(A.PanelRow,null,(0,r.createElement)(A.TextControl,{label:(0,m.__)("Button caption","give"),value:n,onChange:n=>{e(fe({donateButtonCaption:n,designSettingsImageUrl:i,designSettingsImageStyle:o,designSettingsLogoUrl:s,designSettingsLogoPosition:a})),t({donateButtonCaption:n,designSettingsImageUrl:i,designSettingsImageStyle:o,designSettingsLogoUrl:s,designSettingsLogoPosition:a})},help:(0,m.__)("Enter the text you want to display on the donation button.","give")})))}function Oi({dispatch:e,publishSettings:t}){const{settings:{multiStepNextButtonText:n,multiStepFirstButtonText:i,donateButtonCaption:o}}=$e();return(0,r.createElement)(A.PanelBody,{title:(0,m.__)("Buttons","give"),initialOpen:!1},(0,r.createElement)(A.PanelRow,null,(0,r.createElement)(A.TextControl,{label:(0,m.__)("First Step Button Text","give"),value:i,onChange:n=>{e(fe({multiStepFirstButtonText:n})),t({multiStepFirstButtonText:n})},help:(0,m.__)("Customize the text that appears in the first step, prompting the user to go to the next step.","give")})),(0,r.createElement)(A.PanelRow,null,(0,r.createElement)(A.TextControl,{label:(0,m.__)("Next Step Button Text","give"),value:n,onChange:n=>{e(fe({multiStepNextButtonText:n})),t({multiStepNextButtonText:n})},help:(0,m.__)("Customize the text that appears prompting the user to go to the next step.","give")})),(0,r.createElement)(A.PanelRow,null,(0,r.createElement)(A.TextControl,{label:(0,m.__)("Donate Button","give"),value:o,onChange:n=>{e(fe({donateButtonCaption:n})),t({donateButtonCaption:n})},help:(0,m.__)("Enter the text you want to display on the donation button.","give")})))}function Ni({title:e,description:t,children:n}){return(0,r.createElement)("div",{className:"givewp-block-editor-design-sidebar__settings"},(0,r.createElement)("div",{className:"block-editor-block-inspector"},(0,r.createElement)("div",{className:"block-editor-block-card"},(0,r.createElement)("span",{className:"block-editor-block-icon has-colors"},(0,r.createElement)(gt,null)),(0,r.createElement)("div",{className:"block-editor-block-card__content"},(0,r.createElement)("h4",{className:"block-editor-block-card__title"},e),(0,r.createElement)("span",{className:"block-editor-block-card__description"},t))),n))}const{formDesigns:Di}=h();function Pi(){const{settings:{designId:e}}=$e(),t=xe(),{publishSettings:n}=_i(),i=(e=>Di[e])(e);return(0,r.createElement)(Ni,{title:(0,m.__)("General","give"),description:(0,m.__)("These settings affect the basic appearance of the form","give")},(0,r.createElement)(Ri,{dispatch:t,formDesigns:Di,designId:e}),(0,r.createElement)(Ti,{dispatch:t,publishSettings:n}),i?.isMultiStep&&(0,r.createElement)(Oi,{dispatch:t,publishSettings:n}),(0,r.createElement)(Li,{dispatch:t}),!i?.isMultiStep&&(0,r.createElement)(Ii,{dispatch:t,publishSettings:n}))}function Fi({dispatch:e}){const{settings:{primaryColor:t,secondaryColor:n}}=$e(),{publishColors:i}=_i(),o=[{name:"Black",slug:"black",color:"#000000"},{name:"Dark Blue",slug:"dark-blue",color:"#1E1AE2"},{name:"Give Primary Default",slug:"give-primary-default",color:"#69b86b"},{name:"Red",slug:"red",color:"#BD3D36"},{name:"Orange",slug:"orange",color:"#EB712E"},{name:"Gray",slug:"gray",color:"#5F7385"},{name:"Light Blue",slug:"light-blue",color:"#4492DD"},{name:"Light Green",slug:"light-green",color:"#63CC8A"},{name:"Purple",slug:"purple",color:"#9058D8"},{name:"Teal",slug:"teal",color:"#2BBAB1"},{name:"Yellow",slug:"yellow",color:"#F1BB40"}];return(0,r.createElement)(A.PanelBody,{title:(0,m.__)("Color","give")},(0,r.createElement)(f.PanelColorSettings,{colorSettings:[{value:t,onChange:t=>{e(fe({primaryColor:t})),i({primaryColor:t})},label:(0,m.__)("Primary Color","give"),disableCustomColors:!1,colors:o},{value:n,onChange:t=>{e(fe({secondaryColor:t})),i({secondaryColor:t})},label:(0,m.__)("Secondary Color","give"),disableCustomColors:!1,colors:o}]}))}var Hi=n(4981),Bi=n(7954),Wi=n.n(Bi);const zi=(0,r.createElement)(Ne.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(Ne.Path,{d:"M6 4a2 2 0 0 0-2 2v3h1.5V6a.5.5 0 0 1 .5-.5h3V4H6Zm3 14.5H6a.5.5 0 0 1-.5-.5v-3H4v3a2 2 0 0 0 2 2h3v-1.5Zm6 1.5v-1.5h3a.5.5 0 0 0 .5-.5v-3H20v3a2 2 0 0 1-2 2h-3Zm3-16a2 2 0 0 1 2 2v3h-1.5V6a.5.5 0 0 0-.5-.5h-3V4h3Z"}));n(1549),n(7466),n(2777);const Vi=()=>{const{settings:{customCss:e}}=$e(),t=xe(),{publishCss:n}=_i();return(0,r.createElement)(Hi.ZP,{mode:"css",theme:"textmate",onLoad:e=>{e.renderer.setScrollMargin(8,8,8,8),e.renderer.setPadding(8)},onChange:Wi()((e=>{t(fe({customCss:e})),n({customCss:e})}),500),showPrintMargin:!1,highlightActiveLine:!1,showGutter:!0,value:e,maxLines:1/0,minLines:5,width:"100%",setOptions:{enableBasicAutocompletion:!0,enableLiveAutocompletion:!0,enableSnippets:!0,showLineNumbers:!0,tabSize:2,useWorker:!1}})},ji=()=>{const[e,t]=(0,r.useState)(!1);return(0,r.createElement)(A.PanelBody,{title:(0,m.__)("Custom Styles","give"),initialOpen:!1},(0,r.createElement)(A.PanelRow,null,(0,r.createElement)("div",{style:{width:"100%",display:"flex",flexDirection:"column",gap:"10px"}},(0,r.createElement)(A.Button,{icon:zi,onClick:()=>t(!0)},(0,m.__)("Edit in Modal","give")),(0,r.createElement)("div",{style:{margin:".5rem -16px -16px -16px"}},(0,r.createElement)(Vi,null))),!!e&&(0,r.createElement)(A.Modal,{overlayClassName:"components-modal__screen-overlay--givewpwp-custom-css",title:(0,m.__)("Custom Styles","give"),onRequestClose:()=>t(!1),style:{height:"100%",maxHeight:"100%",width:"500px",position:"absolute",right:"0"}},(0,r.createElement)("div",{style:{margin:"0 -31px -23px -31px"}},(0,r.createElement)(Vi,null)))))};function Ui({dispatch:e}){const{settings:{designSettingsImageOpacity:t,designSettingsImageColor:n}}=$e(),{publishSettings:i}=_i();return(0,r.createElement)(A.PanelBody,{className:"givewp-header-image-filter",title:(0,m.__)("Header Image","give")},(0,r.createElement)(A.BaseControl,{id:"givewp-header-image-filter__control",label:(0,m.__)("Color","give")},(0,r.createElement)(f.PanelColorSettings,{colorSettings:[{value:n,onChange:n=>{if(!n)return e(fe({designSettingsImageColor:""})),void i({designSettingsImageColor:""});t||(e(fe({designSettingsImageOpacity:"25"})),i({designSettingsImageOpacity:"25"})),e(fe({designSettingsImageColor:n})),i({designSettingsImageColor:n})},label:(0,m.__)("Overlay","give"),disableCustomColors:!1,colors:f.SETTINGS_DEFAULTS.colors}]})),n&&(0,r.createElement)(A.BaseControl,{id:"givewp-header-image-filter__range-control",label:(0,m.__)("Overlay Opacity","give")},(0,r.createElement)(A.RangeControl,{value:t?Number(t):25,onChange:t=>{e(fe({designSettingsImageOpacity:String(t)})),i({designSettingsImageOpacity:String(t)})},min:0,max:100})))}function Gi(){const{settings:{designSettingsImageUrl:e}}=$e(),t=xe();return(0,r.createElement)(Ni,{title:(0,m.__)("Advanced","give"),description:(0,m.__)("These settings gives you the ability to change the overall appearance of your form to suit your brand","give")},(0,r.createElement)(Fi,{dispatch:t}),e&&(0,r.createElement)(Ui,{dispatch:t})," ",(0,r.createElement)(ji,null))}let Ki=function(e){return e.General="general",e.Styles="styles",e}({});const Zi=({tab:e})=>e==Ki.General?(0,r.createElement)(Pi,null):e==Ki.Styles?(0,r.createElement)(Gi,null):void 0;function qi({close:e,selectTab:t,selected:n,tabs:i}){return(0,r.createElement)("div",{className:"components-panel__header interface-complementary-area-header edit-post-sidebar__panel-tabs"},(0,r.createElement)("ul",{className:"givewp-block-editor-sidebar__tabs"},i.map((({name:e,label:i})=>(0,r.createElement)("li",{className:"givewp-block-editor-sidebar__tab"},(0,r.createElement)(A.Button,{type:"button","aria-label":i,"aria-selected":n===e,className:` components-button edit-post-sidebar__panel-tab ${n===e&&"is-active"}`,onClick:()=>t(e)},i))))),(0,r.createElement)(A.Button,{type:"button",className:"components-button has-icon","aria-label":"Close Settings","aria-controls":"edit-post:document",onClick:e},(0,r.createElement)(A.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":"true",focusable:"false"},(0,r.createElement)(A.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"}))))}const Yi=({toggleShowSidebar:e})=>{const[t,n]=(0,r.useState)(Ki.General),i=[{name:Ki.General,label:(0,m.__)("General","give")},{name:Ki.Styles,label:(0,m.__)("Styles","give")}];return(0,r.createElement)("div",{id:"sidebar-primary",className:"givewp-next-gen-sidebar givewp-next-gen-sidebar-primary",role:"region","aria-label":(0,m.__)("Form design settings"),tabIndex:-1},(0,r.createElement)(qi,{close:e,selectTab:e=>n(e),selected:t,tabs:i}),(0,r.createElement)(Zi,{tab:t}))},Xi=(0,r.createElement)(Ne.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)(Ne.Path,{d:"M3 6h11v1.5H3V6Zm3.5 5.5h11V13h-11v-1.5ZM21 17H10v1.5h11V17Z"}));function Qi(){const{mode:e}=an();return cn.schema===e?(0,r.createElement)(eo,null):cn.design===e?(0,r.createElement)(Ji,null):cn.settings===e?(0,r.createElement)(to,null):void 0}const Ji=()=>{const{state:e,toggle:t}=k(!0);return(0,r.createElement)(Ve,{header:(0,r.createElement)(wn,{showSidebar:e,toggleShowSidebar:t}),content:(0,r.createElement)(Nn,null),sidebar:!!e&&(0,r.createElement)(Yi,{toggleShowSidebar:t}),notices:(0,r.createElement)($i,null),className:"givewp-form-builder__design-tab"})},eo=()=>{const{state:e,toggle:t}=k(!0),[n,i]=(0,r.useState)("add"),o=e=>i(e!==n&&e);return(0,r.createElement)(Ve,{header:(0,r.createElement)(wn,{SecondarySidebarButtons:()=>(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{id:"AddBlockButtonContainer",style:{padding:"var(--givewp-spacing-2)",marginLeft:"var(--givewp-spacing-4)"}},(0,r.createElement)(A.Button,{style:{width:"32px",height:"32px",minWidth:"32px"},className:"rotate-icon",onClick:()=>o("add"),isPressed:"add"===n,icon:pi,variant:"primary"})),(0,r.createElement)(A.Button,{style:{width:"32px",height:"32px"},onClick:()=>o("list"),isPressed:"list"===n,icon:Xi})),showSidebar:e,toggleShowSidebar:t}),content:(0,r.createElement)(bn,null),sidebar:!!e&&(0,r.createElement)(Ae,null),secondarySidebar:!!n&&(0,r.createElement)(Oe,{selected:n}),notices:(0,r.createElement)($i,null)})},to=()=>{const{state:e,toggle:t}=k(!0);return(0,r.createElement)(Ve,{header:(0,r.createElement)(wn,{showSidebar:e,toggleShowSidebar:t}),content:(0,r.createElement)(bi,null),notices:(0,r.createElement)($i,null),className:"givewp-form-settings__editor"})};var no=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===io}(e)}(e)},io="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function oo(e,t){return!1!==t.clone&&t.isMergeableObject(e)?lo((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function ro(e,t,n){return e.concat(t).map((function(e){return oo(e,n)}))}function so(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return e.propertyIsEnumerable(t)})):[]}(e))}function ao(e,t){try{return t in e}catch(e){return!1}}function lo(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||ro,n.isMergeableObject=n.isMergeableObject||no,n.cloneUnlessOtherwiseSpecified=oo;var i=Array.isArray(t);return i===Array.isArray(e)?i?n.arrayMerge(e,t,n):function(e,t,n){var i={};return n.isMergeableObject(e)&&so(e).forEach((function(t){i[t]=oo(e[t],n)})),so(t).forEach((function(o){(function(e,t){return ao(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,o)||(ao(e,o)&&n.isMergeableObject(t[o])?i[o]=function(e,t){if(!t.customMerge)return lo;var n=t.customMerge(e);return"function"==typeof n?n:lo}(o,n)(e[o],t[o],n):i[o]=oo(t[o],n))})),i}(e,t,n):oo(t,n)}lo.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return lo(e,n,t)}),{})};var co=lo;function ho(e){return e instanceof HTMLElement}function uo(e){return"function"==typeof e}function po(e){return"string"==typeof e}function go(e){return void 0===e}class fo{on(e,t,n,i){return void 0===i&&(i=!1),go(this.bindings)&&(this.bindings={}),go(this.bindings[e])&&(this.bindings[e]=[]),this.bindings[e].push({handler:t,ctx:n,once:i}),this}once(e,t,n){return this.on(e,t,n,!0)}off(e,t){return go(this.bindings)||go(this.bindings[e])||(go(t)?delete this.bindings[e]:this.bindings[e].forEach(((n,i)=>{n.handler===t&&this.bindings[e].splice(i,1)}))),this}trigger(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return!go(this.bindings)&&this.bindings[e]&&this.bindings[e].forEach(((t,i)=>{const{ctx:o,handler:r,once:s}=t,a=o||this;r.apply(a,n),s&&this.bindings[e].splice(i,1)})),this}}function mo(e){const t=Object.getOwnPropertyNames(e.constructor.prototype);for(let n=0;n<t.length;n++){const i=t[n],o=e[i];"constructor"!==i&&"function"==typeof o&&(e[i]=o.bind(e))}return e}function vo(e){return po(e)&&""!==e?"-"!==e.charAt(e.length-1)?`${e}-`:e:""}function wo(e){return null==e||!e.element||!e.on}function bo(){let e=Date.now();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(t=>{const n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"==t?n:3&n|8).toString(16)}))}function yo(){return yo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},yo.apply(this,arguments)}function Co(e,t){if(null==e)return{};var n,i,o={},r=Object.keys(e);for(i=0;i<r.length;i++)n=r[i],t.indexOf(n)>=0||(o[n]=e[n]);return o}const $o=["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","flipAlignment"],xo=["mainAxis","crossAxis","limiter"];function _o(e){return e.split("-")[0]}function So(e){return e.split("-")[1]}function Eo(e){return["top","bottom"].includes(_o(e))?"x":"y"}function ko(e){return"y"===e?"height":"width"}function Ao(e,t,n){let{reference:i,floating:o}=e;const r=i.x+i.width/2-o.width/2,s=i.y+i.height/2-o.height/2,a=Eo(t),l=ko(a),c=i[l]/2-o[l]/2,h="x"===a;let d;switch(_o(t)){case"top":d={x:r,y:i.y-o.height};break;case"bottom":d={x:r,y:i.y+i.height};break;case"right":d={x:i.x+i.width,y:s};break;case"left":d={x:i.x-o.width,y:s};break;default:d={x:i.x,y:i.y}}switch(So(t)){case"start":d[a]-=c*(n&&h?-1:1);break;case"end":d[a]+=c*(n&&h?-1:1)}return d}function Lo(e){return"number"!=typeof e?function(e){return yo({top:0,right:0,bottom:0,left:0},e)}(e):{top:e,right:e,bottom:e,left:e}}function Mo(e){return yo({},e,{top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height})}async function To(e,t){var n;void 0===t&&(t={});const{x:i,y:o,platform:r,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:h="viewport",elementContext:d="floating",altBoundary:u=!1,padding:p=0}=t,g=Lo(p),f=a[u?"floating"===d?"reference":"floating":d],m=Mo(await r.getClippingRect({element:null==(n=await(null==r.isElement?void 0:r.isElement(f)))||n?f:f.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(a.floating)),boundary:c,rootBoundary:h,strategy:l})),v="floating"===d?yo({},s.floating,{x:i,y:o}):s.reference,w=await(null==r.getOffsetParent?void 0:r.getOffsetParent(a.floating)),b=await(null==r.isElement?void 0:r.isElement(w))&&await(null==r.getScale?void 0:r.getScale(w))||{x:1,y:1},y=Mo(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({rect:v,offsetParent:w,strategy:l}):v);return{top:(m.top-y.top+g.top)/b.y,bottom:(y.bottom-m.bottom+g.bottom)/b.y,left:(m.left-y.left+g.left)/b.x,right:(y.right-m.right+g.right)/b.x}}const Ro=Math.min,Io=Math.max;function Oo(e,t,n){return Io(e,Ro(t,n))}const No={left:"right",right:"left",bottom:"top",top:"bottom"};function Do(e){return e.replace(/left|right|bottom|top/g,(e=>No[e]))}const Po={start:"end",end:"start"};function Fo(e){return e.replace(/start|end/g,(e=>Po[e]))}function Ho(e){return"x"===e?"y":"x"}const Bo=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:i,placement:o,rects:r,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=e,h={x:n,y:i},d=Eo(o),u=Ho(d);let p=h[d],g=h[u];const f="function"==typeof a?a(t):a,m="number"==typeof f?{mainAxis:f,crossAxis:0}:yo({mainAxis:0,crossAxis:0},f);if(l){const e="y"===d?"height":"width",t=r.reference[d]-r.floating[e]+m.mainAxis,n=r.reference[d]+r.reference[e]-m.mainAxis;p<t?p=t:p>n&&(p=n)}if(c){var v,w,b,y;const e="y"===d?"width":"height",t=["top","left"].includes(_o(o)),n=r.reference[u]-r.floating[e]+(t&&null!=(v=null==(w=s.offset)?void 0:w[u])?v:0)+(t?0:m.crossAxis),i=r.reference[u]+r.reference[e]+(t?0:null!=(b=null==(y=s.offset)?void 0:y[u])?b:0)-(t?m.crossAxis:0);g<n?g=n:g>i&&(g=i)}return{[d]:p,[u]:g}}}};function Wo(e){var t;return(null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function zo(e){return Wo(e).getComputedStyle(e)}function Vo(e){return Zo(e)?(e.nodeName||"").toLowerCase():""}let jo;function Uo(){if(jo)return jo;const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?(jo=e.brands.map((e=>e.brand+"/"+e.version)).join(" "),jo):navigator.userAgent}function Go(e){return e instanceof Wo(e).HTMLElement}function Ko(e){return e instanceof Wo(e).Element}function Zo(e){return e instanceof Wo(e).Node}function qo(e){return"undefined"!=typeof ShadowRoot&&(e instanceof Wo(e).ShadowRoot||e instanceof ShadowRoot)}function Yo(e){const{overflow:t,overflowX:n,overflowY:i,display:o}=zo(e);return/auto|scroll|overlay|hidden/.test(t+i+n)&&!["inline","contents"].includes(o)}function Xo(e){return["table","td","th"].includes(Vo(e))}function Qo(e){const t=/firefox/i.test(Uo()),n=zo(e),i=n.backdropFilter||n.WebkitBackdropFilter;return"none"!==n.transform||"none"!==n.perspective||!!i&&"none"!==i||t&&"filter"===n.willChange||t&&!!n.filter&&"none"!==n.filter||["transform","perspective"].some((e=>n.willChange.includes(e)))||["paint","layout","strict","content"].some((e=>{const t=n.contain;return null!=t&&t.includes(e)}))}function Jo(){return!/^((?!chrome|android).)*safari/i.test(Uo())}function er(e){return["html","body","#document"].includes(Vo(e))}const tr={x:1,y:1};function nr(e){const t=!Ko(e)&&e.contextElement?e.contextElement:Ko(e)?e:null;if(!t)return tr;const n=t.getBoundingClientRect(),i=zo(t);let o=n.width/parseFloat(i.width),r=n.height/parseFloat(i.height);return o&&Number.isFinite(o)||(o=1),r&&Number.isFinite(r)||(r=1),{x:o,y:r}}function ir(e,t,n,i){var o,r,s,a;void 0===t&&(t=!1),void 0===n&&(n=!1);const l=e.getBoundingClientRect();let c=tr;t&&(i?Ko(i)&&(c=nr(i)):c=nr(e));const h=Ko(e)?Wo(e):window,d=!Jo()&&n,u=(l.left+(d&&null!=(o=null==(r=h.visualViewport)?void 0:r.offsetLeft)?o:0))/c.x,p=(l.top+(d&&null!=(s=null==(a=h.visualViewport)?void 0:a.offsetTop)?s:0))/c.y,g=l.width/c.x,f=l.height/c.y;return{width:g,height:f,top:p,right:u+g,bottom:p+f,left:u,x:u,y:p}}function or(e){return((Zo(e)?e.ownerDocument:e.document)||window.document).documentElement}function rr(e){return Ko(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function sr(e){return ir(or(e)).left+rr(e).scrollLeft}function ar(e,t,n){const i=Go(t),o=or(t),r=ir(e,!0,"fixed"===n,t);let s={scrollLeft:0,scrollTop:0};const a={x:0,y:0};if(i||!i&&"fixed"!==n)if(("body"!==Vo(t)||Yo(o))&&(s=rr(t)),Go(t)){const e=ir(t,!0);a.x=e.x+t.clientLeft,a.y=e.y+t.clientTop}else o&&(a.x=sr(o));return{x:r.left+s.scrollLeft-a.x,y:r.top+s.scrollTop-a.y,width:r.width,height:r.height}}function lr(e){if("html"===Vo(e))return e;const t=e.assignedSlot||e.parentNode||(qo(e)?e.host:null)||or(e);return qo(t)?t.host:t}function cr(e){return Go(e)&&"fixed"!==zo(e).position?e.offsetParent:null}function hr(e){const t=Wo(e);let n=cr(e);for(;n&&Xo(n)&&"static"===zo(n).position;)n=cr(n);return n&&("html"===Vo(n)||"body"===Vo(n)&&"static"===zo(n).position&&!Qo(n))?t:n||function(e){let t=lr(e);for(;Go(t)&&!er(t);){if(Qo(t))return t;t=lr(t)}return null}(e)||t}const dr=Math.min,ur=Math.max;function pr(e){const t=lr(e);return er(t)?e.ownerDocument.body:Go(t)&&Yo(t)?t:pr(t)}function gr(e,t){var n;void 0===t&&(t=[]);const i=pr(e),o=i===(null==(n=e.ownerDocument)?void 0:n.body),r=Wo(i);return o?t.concat(r,r.visualViewport||[],Yo(i)?i:[]):t.concat(i,gr(i))}function fr(e,t,n){return"viewport"===t?Mo(function(e,t){const n=Wo(e),i=or(e),o=n.visualViewport;let r=i.clientWidth,s=i.clientHeight,a=0,l=0;if(o){r=o.width,s=o.height;const e=Jo();(e||!e&&"fixed"===t)&&(a=o.offsetLeft,l=o.offsetTop)}return{width:r,height:s,x:a,y:l}}(e,n)):Ko(t)?function(e,t){const n=ir(e,!0,"fixed"===t),i=n.top+e.clientTop,o=n.left+e.clientLeft,r=Go(e)?nr(e):{x:1,y:1},s=e.clientWidth*r.x,a=e.clientHeight*r.y,l=o*r.x,c=i*r.y;return{top:c,left:l,right:l+s,bottom:c+a,x:l,y:c,width:s,height:a}}(t,n):Mo(function(e){var t;const n=or(e),i=rr(e),o=null==(t=e.ownerDocument)?void 0:t.body,r=ur(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=ur(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0);let a=-i.scrollLeft+sr(e);const l=-i.scrollTop;return"rtl"===zo(o||n).direction&&(a+=ur(n.clientWidth,o?o.clientWidth:0)-r),{width:r,height:s,x:a,y:l}}(or(e)))}const mr={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:i,strategy:o}=e;const r=[..."clippingAncestors"===n?function(e,t){const n=t.get(e);if(n)return n;let i=gr(e).filter((e=>Ko(e)&&"body"!==Vo(e))),o=null;const r="fixed"===zo(e).position;let s=r?lr(e):e;for(;Ko(s)&&!er(s);){const e=zo(s),t=Qo(s);(r?t||o:t||"static"!==e.position||!o||!["absolute","fixed"].includes(o.position))?o=e:i=i.filter((e=>e!==s)),s=lr(s)}return t.set(e,i),i}(t,this._c):[].concat(n),i],s=r[0],a=r.reduce(((e,n)=>{const i=fr(t,n,o);return e.top=ur(i.top,e.top),e.right=dr(i.right,e.right),e.bottom=dr(i.bottom,e.bottom),e.left=ur(i.left,e.left),e}),fr(t,s,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:i}=e;const o=Go(n),r=or(n);if(n===r)return t;let s={scrollLeft:0,scrollTop:0},a={x:1,y:1};const l={x:0,y:0};if((o||!o&&"fixed"!==i)&&(("body"!==Vo(n)||Yo(r))&&(s=rr(n)),Go(n))){const e=ir(n);a=nr(n),l.x=e.x+n.clientLeft,l.y=e.y+n.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-s.scrollLeft*a.x+l.x,y:t.y*a.y-s.scrollTop*a.y+l.y}},isElement:Ko,getDimensions:function(e){if(Go(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=ir(e);return{width:t.width,height:t.height}},getOffsetParent:hr,getDocumentElement:or,getScale:nr,async getElementRects(e){let{reference:t,floating:n,strategy:i}=e;const o=this.getOffsetParent||hr,r=this.getDimensions;return{reference:ar(t,await o(n),i),floating:yo({x:0,y:0},await r(n))}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>"rtl"===zo(e).direction};function vr(e){e.cleanup&&e.cleanup();const t=e._getResolvedAttachToOptions();let n=t.element;const i=function(e,t){const n={strategy:"absolute",middleware:[]},i=function(e){return!(!e.options.arrow||!e.el)&&e.el.querySelector(".shepherd-arrow")}(t);return wo(e)||(n.middleware.push(function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:i,middlewareData:o,rects:r,initialPlacement:s,platform:a,elements:l}=t,{mainAxis:c=!0,crossAxis:h=!0,fallbackPlacements:d,fallbackStrategy:u="bestFit",flipAlignment:p=!0}=e,g=Co(e,$o),f=_o(i),m=d||(f!==s&&p?function(e){const t=Do(e);return[Fo(e),t,Fo(t)]}(s):[Do(s)]),v=[s,...m],w=await To(t,g),b=[];let y=(null==(n=o.flip)?void 0:n.overflows)||[];if(c&&b.push(w[f]),h){const{main:e,cross:t}=function(e,t,n){void 0===n&&(n=!1);const i=So(e),o=Eo(e),r=ko(o);let s="x"===o?i===(n?"end":"start")?"right":"left":"start"===i?"bottom":"top";return t.reference[r]>t.floating[r]&&(s=Do(s)),{main:s,cross:Do(s)}}(i,r,await(null==a.isRTL?void 0:a.isRTL(l.floating)));b.push(w[e],w[t])}if(y=[...y,{placement:i,overflows:b}],!b.every((e=>e<=0))){var C,$;const e=(null!=(C=null==($=o.flip)?void 0:$.index)?C:0)+1,t=v[e];if(t)return{data:{index:e,overflows:y},reset:{placement:t}};let n="bottom";switch(u){case"bestFit":{var x;const e=null==(x=y.map((e=>[e,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:x[0].placement;e&&(n=e);break}case"initialPlacement":n=s}if(i!==n)return{reset:{placement:n}}}return{}}}}(),function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:i,placement:o}=t,{mainAxis:r=!0,crossAxis:s=!1,limiter:a={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}}}=e,l=Co(e,xo),c={x:n,y:i},h=await To(t,l),d=Eo(_o(o)),u=Ho(d);let p=c[d],g=c[u];if(r){const e="y"===d?"bottom":"right";p=Oo(p+h["y"===d?"top":"left"],p,p-h[e])}if(s){const e="y"===u?"bottom":"right";g=Oo(g+h["y"===u?"top":"left"],g,g-h[e])}const f=a.fn(yo({},t,{[d]:p,[u]:g}));return yo({},f,{data:{x:f.x-n,y:f.y-i}})}}}({limiter:Bo(),crossAxis:!0})),i&&n.middleware.push((e=>({name:"arrow",options:e,async fn(t){const{element:n,padding:i=0}=null!=e?e:{},{x:o,y:r,placement:s,rects:a,platform:l}=t;if(null==n)return{};const c=Lo(i),h={x:o,y:r},d=Eo(s),u=So(s),p=ko(d),g=await l.getDimensions(n),f="y"===d?"top":"left",m="y"===d?"bottom":"right",v=a.reference[p]+a.reference[d]-h[d]-a.floating[p],w=h[d]-a.reference[d],b=await(null==l.getOffsetParent?void 0:l.getOffsetParent(n));let y=b?"y"===d?b.clientHeight||0:b.clientWidth||0:0;0===y&&(y=a.floating[p]);const C=v/2-w/2,$=c[f],x=y-g[p]-c[m],_=y/2-g[p]/2+C,S=Oo($,_,x),E=("start"===u?c[f]:c[m])>0&&_!==S&&a.reference[p]<=a.floating[p];return{[d]:h[d]-(E?_<$?$-_:x-_:0),data:{[d]:S,centerOffset:_-S}}}}))({element:i})),n.placement=e.on),co(t.options.floatingUIOptions||{},n)}(t,e),o=wo(t);return o&&(n=document.body,e.shepherdElementComponent.getElement().classList.add("shepherd-centered")),e.cleanup=function(e,t,n,i){void 0===i&&(i={});const{ancestorScroll:o=!0,ancestorResize:r=!0,elementResize:s=!0,animationFrame:a=!1}=i,l=o&&!a,c=l||r?[...Ko(e)?gr(e):e.contextElement?gr(e.contextElement):[],...gr(t)]:[];c.forEach((e=>{l&&e.addEventListener("scroll",n,{passive:!0}),r&&e.addEventListener("resize",n)}));let h,d=null;if(s){let i=!0;d=new ResizeObserver((()=>{i||n(),i=!1})),Ko(e)&&!a&&d.observe(e),Ko(e)||!e.contextElement||a||d.observe(e.contextElement),d.observe(t)}let u=a?ir(e):null;return a&&function t(){const i=ir(e);!u||i.x===u.x&&i.y===u.y&&i.width===u.width&&i.height===u.height||n(),u=i,h=requestAnimationFrame(t)}(),n(),()=>{var e;c.forEach((e=>{l&&e.removeEventListener("scroll",n),r&&e.removeEventListener("resize",n)})),null==(e=d)||e.disconnect(),d=null,a&&cancelAnimationFrame(h)}}(n,e.el,(()=>{e.el?function(e,t,n,i){((e,t,n)=>{const i=new Map,o=yo({platform:mr},n),r=yo({},o.platform,{_c:i});return(async(e,t,n)=>{const{placement:i="bottom",strategy:o="absolute",middleware:r=[],platform:s}=n,a=r.filter(Boolean),l=await(null==s.isRTL?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:h,y:d}=Ao(c,i,l),u=i,p={},g=0;for(let n=0;n<a.length;n++){const{name:r,fn:f}=a[n],{x:m,y:v,data:w,reset:b}=await f({x:h,y:d,initialPlacement:i,placement:u,strategy:o,middlewareData:p,rects:c,platform:s,elements:{reference:e,floating:t}});h=null!=m?m:h,d=null!=v?v:d,p=yo({},p,{[r]:yo({},p[r],w)}),b&&g<=50&&(g++,"object"==typeof b&&(b.placement&&(u=b.placement),b.rects&&(c=!0===b.rects?await s.getElementRects({reference:e,floating:t,strategy:o}):b.rects),({x:h,y:d}=Ao(c,u,l))),n=-1)}return{x:h,y:d,placement:u,strategy:o,middlewareData:p}})(e,t,yo({},o,{platform:r}))})(e,t.el,n).then(function(e,t){return n=>{let{x:i,y:o,placement:r,middlewareData:s}=n;return e.el?(t?Object.assign(e.el.style,{position:"fixed",left:"50%",top:"50%",transform:"translate(-50%, -50%)"}):Object.assign(e.el.style,{position:"absolute",left:`${i}px`,top:`${o}px`}),e.el.dataset.popperPlacement=r,function(e,t){const n=e.querySelector(".shepherd-arrow");if(n){let e,i,o,r;if(t.arrow){const{x:n,y:o}=t.arrow;e=null!=n?`${n}px`:"",i=null!=o?`${o}px`:""}Object.assign(n.style,{left:e,top:i,right:o,bottom:r})}}(e.el,s),e):e}}(t,i)).then((e=>new Promise((t=>{setTimeout((()=>t(e)),300)})))).then((e=>{e&&e.el&&e.el.focus({preventScroll:!0})}))}(n,e,i,o):e.cleanup()})),e.target=t.element,i}function wr(){}function br(e,t){for(const n in t)e[n]=t[n];return e}function yr(e){return e()}function Cr(){return Object.create(null)}function $r(e){e.forEach(yr)}function xr(e){return"function"==typeof e}function _r(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}function Sr(e,t){e.appendChild(t)}function Er(e,t,n){e.insertBefore(t,n||null)}function kr(e){e.parentNode&&e.parentNode.removeChild(e)}function Ar(e){return document.createElement(e)}function Lr(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function Mr(e){return document.createTextNode(e)}function Tr(){return Mr(" ")}function Rr(e,t,n,i){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n,i)}function Ir(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function Or(e,t){const n=Object.getOwnPropertyDescriptors(e.__proto__);for(const i in t)null==t[i]?e.removeAttribute(i):"style"===i?e.style.cssText=t[i]:"__value"===i?e.value=e[i]=t[i]:n[i]&&n[i].set?e[i]=t[i]:Ir(e,i,t[i])}function Nr(e,t,n){e.classList[n?"add":"remove"](t)}let Dr;function Pr(e){Dr=e}function Fr(){if(!Dr)throw new Error("Function called outside component initialization");return Dr}function Hr(e){Fr().$$.after_update.push(e)}const Br=[],Wr=[],zr=[],Vr=[],jr=Promise.resolve();let Ur=!1;function Gr(e){zr.push(e)}const Kr=new Set;let Zr=0;function qr(){const e=Dr;do{for(;Zr<Br.length;){const e=Br[Zr];Zr++,Pr(e),Yr(e.$$)}for(Pr(null),Br.length=0,Zr=0;Wr.length;)Wr.pop()();for(let e=0;e<zr.length;e+=1){const t=zr[e];Kr.has(t)||(Kr.add(t),t())}zr.length=0}while(Br.length);for(;Vr.length;)Vr.pop()();Ur=!1,Kr.clear(),Pr(e)}function Yr(e){if(null!==e.fragment){e.update(),$r(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(Gr)}}const Xr=new Set;let Qr;function Jr(){Qr={r:0,c:[],p:Qr}}function es(){Qr.r||$r(Qr.c),Qr=Qr.p}function ts(e,t){e&&e.i&&(Xr.delete(e),e.i(t))}function ns(e,t,n,i){if(e&&e.o){if(Xr.has(e))return;Xr.add(e),Qr.c.push((()=>{Xr.delete(e),i&&(n&&e.d(1),i())})),e.o(t)}else i&&i()}function is(e){e&&e.c()}function os(e,t,n,i){const{fragment:o,after_update:r}=e.$$;o&&o.m(t,n),i||Gr((()=>{const t=e.$$.on_mount.map(yr).filter(xr);e.$$.on_destroy?e.$$.on_destroy.push(...t):$r(t),e.$$.on_mount=[]})),r.forEach(Gr)}function rs(e,t){const n=e.$$;null!==n.fragment&&($r(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function ss(e,t,n,i,o,r,s,a){void 0===a&&(a=[-1]);const l=Dr;Pr(e);const c=e.$$={fragment:null,ctx:[],props:r,update:wr,not_equal:o,bound:Cr(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(l?l.$$.context:[])),callbacks:Cr(),dirty:a,skip_bound:!1,root:t.target||l.$$.root};s&&s(c.root);let h=!1;if(c.ctx=n?n(e,t.props||{},(function(t,n){const i=!(arguments.length<=2)&&arguments.length-2?arguments.length<=2?void 0:arguments[2]:n;return c.ctx&&o(c.ctx[t],c.ctx[t]=i)&&(!c.skip_bound&&c.bound[t]&&c.bound[t](i),h&&function(e,t){-1===e.$$.dirty[0]&&(Br.push(e),Ur||(Ur=!0,jr.then(qr)),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}(e,t)),n})):[],c.update(),h=!0,$r(c.before_update),c.fragment=!!i&&i(c.ctx),t.target){if(t.hydrate){const e=(d=t.target,Array.from(d.childNodes));c.fragment&&c.fragment.l(e),e.forEach(kr)}else c.fragment&&c.fragment.c();t.intro&&ts(e.$$.fragment),os(e,t.target,t.anchor,t.customElement),qr()}var d;Pr(l)}class as{$destroy(){rs(this,1),this.$destroy=wr}$on(e,t){if(!xr(t))return wr;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}$set(e){var t;this.$$set&&(t=e,0!==Object.keys(t).length)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}function ls(e){let t,n,i,o,r;return{c(){t=Ar("button"),Ir(t,"aria-label",n=e[3]?e[3]:null),Ir(t,"class",i=`${e[1]||""} shepherd-button ${e[4]?"shepherd-button-secondary":""}`),t.disabled=e[2],Ir(t,"tabindex","0")},m(n,i){Er(n,t,i),t.innerHTML=e[5],o||(r=Rr(t,"click",(function(){xr(e[0])&&e[0].apply(this,arguments)})),o=!0)},p(o,r){let[s]=r;e=o,32&s&&(t.innerHTML=e[5]),8&s&&n!==(n=e[3]?e[3]:null)&&Ir(t,"aria-label",n),18&s&&i!==(i=`${e[1]||""} shepherd-button ${e[4]?"shepherd-button-secondary":""}`)&&Ir(t,"class",i),4&s&&(t.disabled=e[2])},i:wr,o:wr,d(e){e&&kr(t),o=!1,r()}}}function cs(e,t,n){let i,o,r,s,a,l,{config:c,step:h}=t;function d(e){return uo(e)?e.call(h):e}return e.$$set=e=>{"config"in e&&n(6,c=e.config),"step"in e&&n(7,h=e.step)},e.$$.update=()=>{192&e.$$.dirty&&(n(0,i=c.action?c.action.bind(h.tour):null),n(1,o=c.classes),n(2,r=!!c.disabled&&d(c.disabled)),n(3,s=c.label?d(c.label):null),n(4,a=c.secondary),n(5,l=c.text?d(c.text):null))},[i,o,r,s,a,l,c,h]}class hs extends as{constructor(e){super(),ss(this,e,cs,ls,_r,{config:6,step:7})}}function ds(e,t,n){const i=e.slice();return i[2]=t[n],i}function us(e){let t,n,i=e[1],o=[];for(let t=0;t<i.length;t+=1)o[t]=ps(ds(e,i,t));const r=e=>ns(o[e],1,1,(()=>{o[e]=null}));return{c(){for(let e=0;e<o.length;e+=1)o[e].c();t=Mr("")},m(e,i){for(let t=0;t<o.length;t+=1)o[t].m(e,i);Er(e,t,i),n=!0},p(e,n){if(3&n){let s;for(i=e[1],s=0;s<i.length;s+=1){const r=ds(e,i,s);o[s]?(o[s].p(r,n),ts(o[s],1)):(o[s]=ps(r),o[s].c(),ts(o[s],1),o[s].m(t.parentNode,t))}for(Jr(),s=i.length;s<o.length;s+=1)r(s);es()}},i(e){if(!n){for(let e=0;e<i.length;e+=1)ts(o[e]);n=!0}},o(e){o=o.filter(Boolean);for(let e=0;e<o.length;e+=1)ns(o[e]);n=!1},d(e){!function(e,t){for(let n=0;n<e.length;n+=1)e[n]&&e[n].d(t)}(o,e),e&&kr(t)}}}function ps(e){let t,n;return t=new hs({props:{config:e[2],step:e[0]}}),{c(){is(t.$$.fragment)},m(e,i){os(t,e,i),n=!0},p(e,n){const i={};2&n&&(i.config=e[2]),1&n&&(i.step=e[0]),t.$set(i)},i(e){n||(ts(t.$$.fragment,e),n=!0)},o(e){ns(t.$$.fragment,e),n=!1},d(e){rs(t,e)}}}function gs(e){let t,n,i=e[1]&&us(e);return{c(){t=Ar("footer"),i&&i.c(),Ir(t,"class","shepherd-footer")},m(e,o){Er(e,t,o),i&&i.m(t,null),n=!0},p(e,n){let[o]=n;e[1]?i?(i.p(e,o),2&o&&ts(i,1)):(i=us(e),i.c(),ts(i,1),i.m(t,null)):i&&(Jr(),ns(i,1,1,(()=>{i=null})),es())},i(e){n||(ts(i),n=!0)},o(e){ns(i),n=!1},d(e){e&&kr(t),i&&i.d()}}}function fs(e,t,n){let i,{step:o}=t;return e.$$set=e=>{"step"in e&&n(0,o=e.step)},e.$$.update=()=>{1&e.$$.dirty&&n(1,i=o.options.buttons)},[o,i]}class ms extends as{constructor(e){super(),ss(this,e,fs,gs,_r,{step:0})}}function vs(e){let t,n,i,o,r;return{c(){t=Ar("button"),n=Ar("span"),n.textContent="×",Ir(n,"aria-hidden","true"),Ir(t,"aria-label",i=e[0].label?e[0].label:"Close Tour"),Ir(t,"class","shepherd-cancel-icon"),Ir(t,"type","button")},m(i,s){Er(i,t,s),Sr(t,n),o||(r=Rr(t,"click",e[1]),o=!0)},p(e,n){let[o]=n;1&o&&i!==(i=e[0].label?e[0].label:"Close Tour")&&Ir(t,"aria-label",i)},i:wr,o:wr,d(e){e&&kr(t),o=!1,r()}}}function ws(e,t,n){let{cancelIcon:i,step:o}=t;return e.$$set=e=>{"cancelIcon"in e&&n(0,i=e.cancelIcon),"step"in e&&n(2,o=e.step)},[i,e=>{e.preventDefault(),o.cancel()},o]}class bs extends as{constructor(e){super(),ss(this,e,ws,vs,_r,{cancelIcon:0,step:2})}}function ys(e){let t;return{c(){t=Ar("h3"),Ir(t,"id",e[1]),Ir(t,"class","shepherd-title")},m(n,i){Er(n,t,i),e[3](t)},p(e,n){let[i]=n;2&i&&Ir(t,"id",e[1])},i:wr,o:wr,d(n){n&&kr(t),e[3](null)}}}function Cs(e,t,n){let{labelId:i,element:o,title:r}=t;return Hr((()=>{uo(r)&&n(2,r=r()),n(0,o.innerHTML=r,o)})),e.$$set=e=>{"labelId"in e&&n(1,i=e.labelId),"element"in e&&n(0,o=e.element),"title"in e&&n(2,r=e.title)},[o,i,r,function(e){Wr[e?"unshift":"push"]((()=>{o=e,n(0,o)}))}]}class $s extends as{constructor(e){super(),ss(this,e,Cs,ys,_r,{labelId:1,element:0,title:2})}}function xs(e){let t,n;return t=new $s({props:{labelId:e[0],title:e[2]}}),{c(){is(t.$$.fragment)},m(e,i){os(t,e,i),n=!0},p(e,n){const i={};1&n&&(i.labelId=e[0]),4&n&&(i.title=e[2]),t.$set(i)},i(e){n||(ts(t.$$.fragment,e),n=!0)},o(e){ns(t.$$.fragment,e),n=!1},d(e){rs(t,e)}}}function _s(e){let t,n;return t=new bs({props:{cancelIcon:e[3],step:e[1]}}),{c(){is(t.$$.fragment)},m(e,i){os(t,e,i),n=!0},p(e,n){const i={};8&n&&(i.cancelIcon=e[3]),2&n&&(i.step=e[1]),t.$set(i)},i(e){n||(ts(t.$$.fragment,e),n=!0)},o(e){ns(t.$$.fragment,e),n=!1},d(e){rs(t,e)}}}function Ss(e){let t,n,i,o=e[2]&&xs(e),r=e[3]&&e[3].enabled&&_s(e);return{c(){t=Ar("header"),o&&o.c(),n=Tr(),r&&r.c(),Ir(t,"class","shepherd-header")},m(e,s){Er(e,t,s),o&&o.m(t,null),Sr(t,n),r&&r.m(t,null),i=!0},p(e,i){let[s]=i;e[2]?o?(o.p(e,s),4&s&&ts(o,1)):(o=xs(e),o.c(),ts(o,1),o.m(t,n)):o&&(Jr(),ns(o,1,1,(()=>{o=null})),es()),e[3]&&e[3].enabled?r?(r.p(e,s),8&s&&ts(r,1)):(r=_s(e),r.c(),ts(r,1),r.m(t,null)):r&&(Jr(),ns(r,1,1,(()=>{r=null})),es())},i(e){i||(ts(o),ts(r),i=!0)},o(e){ns(o),ns(r),i=!1},d(e){e&&kr(t),o&&o.d(),r&&r.d()}}}function Es(e,t,n){let i,o,{labelId:r,step:s}=t;return e.$$set=e=>{"labelId"in e&&n(0,r=e.labelId),"step"in e&&n(1,s=e.step)},e.$$.update=()=>{2&e.$$.dirty&&(n(2,i=s.options.title),n(3,o=s.options.cancelIcon))},[r,s,i,o]}class ks extends as{constructor(e){super(),ss(this,e,Es,Ss,_r,{labelId:0,step:1})}}function As(e){let t;return{c(){t=Ar("div"),Ir(t,"class","shepherd-text"),Ir(t,"id",e[1])},m(n,i){Er(n,t,i),e[3](t)},p(e,n){let[i]=n;2&i&&Ir(t,"id",e[1])},i:wr,o:wr,d(n){n&&kr(t),e[3](null)}}}function Ls(e,t,n){let{descriptionId:i,element:o,step:r}=t;return Hr((()=>{let{text:e}=r.options;uo(e)&&(e=e.call(r)),ho(e)?o.appendChild(e):n(0,o.innerHTML=e,o)})),e.$$set=e=>{"descriptionId"in e&&n(1,i=e.descriptionId),"element"in e&&n(0,o=e.element),"step"in e&&n(2,r=e.step)},[o,i,r,function(e){Wr[e?"unshift":"push"]((()=>{o=e,n(0,o)}))}]}class Ms extends as{constructor(e){super(),ss(this,e,Ls,As,_r,{descriptionId:1,element:0,step:2})}}function Ts(e){let t,n;return t=new ks({props:{labelId:e[1],step:e[2]}}),{c(){is(t.$$.fragment)},m(e,i){os(t,e,i),n=!0},p(e,n){const i={};2&n&&(i.labelId=e[1]),4&n&&(i.step=e[2]),t.$set(i)},i(e){n||(ts(t.$$.fragment,e),n=!0)},o(e){ns(t.$$.fragment,e),n=!1},d(e){rs(t,e)}}}function Rs(e){let t,n;return t=new Ms({props:{descriptionId:e[0],step:e[2]}}),{c(){is(t.$$.fragment)},m(e,i){os(t,e,i),n=!0},p(e,n){const i={};1&n&&(i.descriptionId=e[0]),4&n&&(i.step=e[2]),t.$set(i)},i(e){n||(ts(t.$$.fragment,e),n=!0)},o(e){ns(t.$$.fragment,e),n=!1},d(e){rs(t,e)}}}function Is(e){let t,n;return t=new ms({props:{step:e[2]}}),{c(){is(t.$$.fragment)},m(e,i){os(t,e,i),n=!0},p(e,n){const i={};4&n&&(i.step=e[2]),t.$set(i)},i(e){n||(ts(t.$$.fragment,e),n=!0)},o(e){ns(t.$$.fragment,e),n=!1},d(e){rs(t,e)}}}function Os(e){let t,n,i,o,r=!go(e[2].options.title)||e[2].options.cancelIcon&&e[2].options.cancelIcon.enabled,s=!go(e[2].options.text),a=Array.isArray(e[2].options.buttons)&&e[2].options.buttons.length,l=r&&Ts(e),c=s&&Rs(e),h=a&&Is(e);return{c(){t=Ar("div"),l&&l.c(),n=Tr(),c&&c.c(),i=Tr(),h&&h.c(),Ir(t,"class","shepherd-content")},m(e,r){Er(e,t,r),l&&l.m(t,null),Sr(t,n),c&&c.m(t,null),Sr(t,i),h&&h.m(t,null),o=!0},p(e,o){let[d]=o;4&d&&(r=!go(e[2].options.title)||e[2].options.cancelIcon&&e[2].options.cancelIcon.enabled),r?l?(l.p(e,d),4&d&&ts(l,1)):(l=Ts(e),l.c(),ts(l,1),l.m(t,n)):l&&(Jr(),ns(l,1,1,(()=>{l=null})),es()),4&d&&(s=!go(e[2].options.text)),s?c?(c.p(e,d),4&d&&ts(c,1)):(c=Rs(e),c.c(),ts(c,1),c.m(t,i)):c&&(Jr(),ns(c,1,1,(()=>{c=null})),es()),4&d&&(a=Array.isArray(e[2].options.buttons)&&e[2].options.buttons.length),a?h?(h.p(e,d),4&d&&ts(h,1)):(h=Is(e),h.c(),ts(h,1),h.m(t,null)):h&&(Jr(),ns(h,1,1,(()=>{h=null})),es())},i(e){o||(ts(l),ts(c),ts(h),o=!0)},o(e){ns(l),ns(c),ns(h),o=!1},d(e){e&&kr(t),l&&l.d(),c&&c.d(),h&&h.d()}}}function Ns(e,t,n){let{descriptionId:i,labelId:o,step:r}=t;return e.$$set=e=>{"descriptionId"in e&&n(0,i=e.descriptionId),"labelId"in e&&n(1,o=e.labelId),"step"in e&&n(2,r=e.step)},[i,o,r]}class Ds extends as{constructor(e){super(),ss(this,e,Ns,Os,_r,{descriptionId:0,labelId:1,step:2})}}function Ps(e){let t;return{c(){t=Ar("div"),Ir(t,"class","shepherd-arrow"),Ir(t,"data-popper-arrow","")},m(e,n){Er(e,t,n)},d(e){e&&kr(t)}}}function Fs(e){let t,n,i,o,r,s,a,l,c=e[4].options.arrow&&e[4].options.attachTo&&e[4].options.attachTo.element&&e[4].options.attachTo.on&&Ps();i=new Ds({props:{descriptionId:e[2],labelId:e[3],step:e[4]}});let h=[{"aria-describedby":o=go(e[4].options.text)?null:e[2]},{"aria-labelledby":r=e[4].options.title?e[3]:null},e[1],{role:"dialog"},{tabindex:"0"}],d={};for(let e=0;e<h.length;e+=1)d=br(d,h[e]);return{c(){t=Ar("div"),c&&c.c(),n=Tr(),is(i.$$.fragment),Or(t,d),Nr(t,"shepherd-has-cancel-icon",e[5]),Nr(t,"shepherd-has-title",e[6]),Nr(t,"shepherd-element",!0)},m(o,r){Er(o,t,r),c&&c.m(t,null),Sr(t,n),os(i,t,null),e[13](t),s=!0,a||(l=Rr(t,"keydown",e[7]),a=!0)},p(e,a){let[l]=a;e[4].options.arrow&&e[4].options.attachTo&&e[4].options.attachTo.element&&e[4].options.attachTo.on?c||(c=Ps(),c.c(),c.m(t,n)):c&&(c.d(1),c=null);const u={};4&l&&(u.descriptionId=e[2]),8&l&&(u.labelId=e[3]),16&l&&(u.step=e[4]),i.$set(u),Or(t,d=function(e,t){const n={},i={},o={$$scope:1};let r=e.length;for(;r--;){const s=e[r],a=t[r];if(a){for(const e in s)e in a||(i[e]=1);for(const e in a)o[e]||(n[e]=a[e],o[e]=1);e[r]=a}else for(const e in s)o[e]=1}for(const e in i)e in n||(n[e]=void 0);return n}(h,[(!s||20&l&&o!==(o=go(e[4].options.text)?null:e[2]))&&{"aria-describedby":o},(!s||24&l&&r!==(r=e[4].options.title?e[3]:null))&&{"aria-labelledby":r},2&l&&e[1],{role:"dialog"},{tabindex:"0"}])),Nr(t,"shepherd-has-cancel-icon",e[5]),Nr(t,"shepherd-has-title",e[6]),Nr(t,"shepherd-element",!0)},i(e){s||(ts(i.$$.fragment,e),s=!0)},o(e){ns(i.$$.fragment,e),s=!1},d(n){n&&kr(t),c&&c.d(),rs(i),e[13](null),a=!1,l()}}}function Hs(e){return e.split(" ").filter((e=>!!e.length))}function Bs(e,t,n){let i,o,r,{classPrefix:s,element:a,descriptionId:l,firstFocusableElement:c,focusableElements:h,labelId:d,lastFocusableElement:u,step:p,dataStepId:g}=t;return Fr().$$.on_mount.push((()=>{n(1,g={[`data-${s}shepherd-step-id`]:p.id}),n(9,h=a.querySelectorAll('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex="0"]')),n(8,c=h[0]),n(10,u=h[h.length-1])})),Hr((()=>{r!==p.options.classes&&(function(e){if(po(e)){const t=Hs(e);t.length&&a.classList.remove(...t)}}(r),r=p.options.classes,function(e){if(po(e)){const t=Hs(e);t.length&&a.classList.add(...t)}}(r))})),e.$$set=e=>{"classPrefix"in e&&n(11,s=e.classPrefix),"element"in e&&n(0,a=e.element),"descriptionId"in e&&n(2,l=e.descriptionId),"firstFocusableElement"in e&&n(8,c=e.firstFocusableElement),"focusableElements"in e&&n(9,h=e.focusableElements),"labelId"in e&&n(3,d=e.labelId),"lastFocusableElement"in e&&n(10,u=e.lastFocusableElement),"step"in e&&n(4,p=e.step),"dataStepId"in e&&n(1,g=e.dataStepId)},e.$$.update=()=>{16&e.$$.dirty&&(n(5,i=p.options&&p.options.cancelIcon&&p.options.cancelIcon.enabled),n(6,o=p.options&&p.options.title))},[a,g,l,d,p,i,o,e=>{const{tour:t}=p;switch(e.keyCode){case 9:if(0===h.length){e.preventDefault();break}e.shiftKey?(document.activeElement===c||document.activeElement.classList.contains("shepherd-element"))&&(e.preventDefault(),u.focus()):document.activeElement===u&&(e.preventDefault(),c.focus());break;case 27:t.options.exitOnEsc&&p.cancel();break;case 37:t.options.keyboardNavigation&&t.back();break;case 39:t.options.keyboardNavigation&&t.next()}},c,h,u,s,()=>a,function(e){Wr[e?"unshift":"push"]((()=>{a=e,n(0,a)}))}]}class Ws extends as{constructor(e){super(),ss(this,e,Bs,Fs,_r,{classPrefix:11,element:0,descriptionId:2,firstFocusableElement:8,focusableElements:9,labelId:3,lastFocusableElement:10,step:4,dataStepId:1,getElement:12})}get getElement(){return this.$$.ctx[12]}}class zs extends fo{constructor(e,t){return void 0===t&&(t={}),super(e,t),this.tour=e,this.classPrefix=this.tour.options?vo(this.tour.options.classPrefix):"",this.styles=e.styles,this._resolvedAttachTo=null,mo(this),this._setOptions(t),this}cancel(){this.tour.cancel(),this.trigger("cancel")}complete(){this.tour.complete(),this.trigger("complete")}destroy(){this.cleanup&&this.cleanup(),this.cleanup=null,ho(this.el)&&(this.el.remove(),this.el=null),this._updateStepTargetOnHide(),this.trigger("destroy")}getTour(){return this.tour}hide(){this.tour.modal.hide(),this.trigger("before-hide"),this.el&&(this.el.hidden=!0),this._updateStepTargetOnHide(),this.trigger("hide")}_resolveAttachToOptions(){return this._resolvedAttachTo=function(e){const t=e.options.attachTo||{},n=Object.assign({},t);if(uo(n.element)&&(n.element=n.element.call(e)),po(n.element)){try{n.element=document.querySelector(n.element)}catch(e){}n.element||console.error(`The element for this Shepherd step was not found ${t.element}`)}return n}(this),this._resolvedAttachTo}_getResolvedAttachToOptions(){return null===this._resolvedAttachTo?this._resolveAttachToOptions():this._resolvedAttachTo}isOpen(){return Boolean(this.el&&!this.el.hidden)}show(){return uo(this.options.beforeShowPromise)?Promise.resolve(this.options.beforeShowPromise()).then((()=>this._show())):Promise.resolve(this._show())}updateStepOptions(e){Object.assign(this.options,e),this.shepherdElementComponent&&this.shepherdElementComponent.$set({step:this})}getElement(){return this.el}getTarget(){return this.target}_createTooltipContent(){const e=`${this.id}-description`,t=`${this.id}-label`;return this.shepherdElementComponent=new Ws({target:this.tour.options.stepsContainer||document.body,props:{classPrefix:this.classPrefix,descriptionId:e,labelId:t,step:this,styles:this.styles}}),this.shepherdElementComponent.getElement()}_scrollTo(e){const{element:t}=this._getResolvedAttachToOptions();uo(this.options.scrollToHandler)?this.options.scrollToHandler(t):t instanceof Element&&"function"==typeof t.scrollIntoView&&t.scrollIntoView(e)}_getClassOptions(e){const t=this.tour&&this.tour.options&&this.tour.options.defaultStepOptions,n=e.classes?e.classes:"",i=t&&t.classes?t.classes:"",o=[...n.split(" "),...i.split(" ")],r=new Set(o);return Array.from(r).join(" ").trim()}_setOptions(e){void 0===e&&(e={});let t=this.tour&&this.tour.options&&this.tour.options.defaultStepOptions;t=co({},t||{}),this.options=Object.assign({arrow:!0},t,e,function(e,t){return{floatingUIOptions:co(e.floatingUIOptions||{},t.floatingUIOptions||{})}}(t,e));const{when:n}=this.options;this.options.classes=this._getClassOptions(e),this.destroy(),this.id=this.options.id||`step-${bo()}`,n&&Object.keys(n).forEach((e=>{this.on(e,n[e],this)}))}_setupElements(){go(this.el)||this.destroy(),this.el=this._createTooltipContent(),this.options.advanceOn&&function(e){const{event:t,selector:n}=e.options.advanceOn||{};if(!t)return console.error("advanceOn was defined, but no event name was passed.");{const i=function(e,t){return n=>{if(t.isOpen()){const i=t.el&&n.currentTarget===t.el;(!go(e)&&n.currentTarget.matches(e)||i)&&t.tour.next()}}}(n,e);let o;try{o=document.querySelector(n)}catch(e){}if(!go(n)&&!o)return console.error(`No element was found for the selector supplied to advanceOn: ${n}`);o?(o.addEventListener(t,i),e.on("destroy",(()=>o.removeEventListener(t,i)))):(document.body.addEventListener(t,i,!0),e.on("destroy",(()=>document.body.removeEventListener(t,i,!0))))}}(this),vr(this)}_show(){this.trigger("before-show"),this._resolveAttachToOptions(),this._setupElements(),this.tour.modal||this.tour._setupModal(),this.tour.modal.setupForStep(this),this._styleTargetElementForStep(this),this.el.hidden=!1,this.options.scrollTo&&setTimeout((()=>{this._scrollTo(this.options.scrollTo)})),this.el.hidden=!1;const e=this.shepherdElementComponent.getElement(),t=this.target||document.body;t.classList.add(`${this.classPrefix}shepherd-enabled`),t.classList.add(`${this.classPrefix}shepherd-target`),e.classList.add("shepherd-enabled"),this.trigger("show")}_styleTargetElementForStep(e){const t=e.target;t&&(e.options.highlightClass&&t.classList.add(e.options.highlightClass),t.classList.remove("shepherd-target-click-disabled"),!1===e.options.canClickTarget&&t.classList.add("shepherd-target-click-disabled"))}_updateStepTargetOnHide(){const e=this.target||document.body;this.options.highlightClass&&e.classList.remove(this.options.highlightClass),e.classList.remove("shepherd-target-click-disabled",`${this.classPrefix}shepherd-enabled`,`${this.classPrefix}shepherd-target`)}}function Vs(e){let t,n,i,o,r;return{c(){t=Lr("svg"),n=Lr("path"),Ir(n,"d",e[2]),Ir(t,"class",i=(e[1]?"shepherd-modal-is-visible":"")+" shepherd-modal-overlay-container")},m(i,s){Er(i,t,s),Sr(t,n),e[11](t),o||(r=Rr(t,"touchmove",e[3]),o=!0)},p(e,o){let[r]=o;4&r&&Ir(n,"d",e[2]),2&r&&i!==(i=(e[1]?"shepherd-modal-is-visible":"")+" shepherd-modal-overlay-container")&&Ir(t,"class",i)},i:wr,o:wr,d(n){n&&kr(t),e[11](null),o=!1,r()}}}function js(e){if(!e)return null;const t=e instanceof HTMLElement&&window.getComputedStyle(e).overflowY;return"hidden"!==t&&"visible"!==t&&e.scrollHeight>=e.clientHeight?e:js(e.parentElement)}function Us(e,t,n){let{element:i,openingProperties:o}=t;bo();let r,s,a=!1;function l(){n(4,o={width:0,height:0,x:0,y:0,r:0})}function c(){n(1,a=!1),p()}function h(e,t,i,r){if(void 0===e&&(e=0),void 0===t&&(t=0),r){const{y:s,height:a}=function(e,t){const n=e.getBoundingClientRect();let i=n.y||n.top,o=n.bottom||i+n.height;if(t){const e=t.getBoundingClientRect(),n=e.y||e.top,r=e.bottom||n+e.height;i=Math.max(i,n),o=Math.min(o,r)}return{y:i,height:Math.max(o-i,0)}}(r,i),{x:l,width:c,left:h}=r.getBoundingClientRect();n(4,o={width:c+2*e,height:a+2*e,x:(l||h)-e,y:s-e,r:t})}else l()}function d(){n(1,a=!0)}l();const u=e=>{e.preventDefault()};function p(){r&&(cancelAnimationFrame(r),r=void 0),window.removeEventListener("touchmove",u,{passive:!1})}return e.$$set=e=>{"element"in e&&n(0,i=e.element),"openingProperties"in e&&n(4,o=e.openingProperties)},e.$$.update=()=>{16&e.$$.dirty&&n(2,s=function(e){let{width:t,height:n,x:i=0,y:o=0,r=0}=e;const{innerWidth:s,innerHeight:a}=window,{topLeft:l=0,topRight:c=0,bottomRight:h=0,bottomLeft:d=0}="number"==typeof r?{topLeft:r,topRight:r,bottomRight:r,bottomLeft:r}:r;return`M${s},${a}H0V0H${s}V${a}ZM${i+l},${o}a${l},${l},0,0,0-${l},${l}V${n+o-d}a${d},${d},0,0,0,${d},${d}H${t+i-h}a${h},${h},0,0,0,${h}-${h}V${o+c}a${c},${c},0,0,0-${c}-${c}Z`}(o))},[i,a,s,e=>{e.stopPropagation()},o,()=>i,l,c,h,function(e){p(),e.tour.options.useModalOverlay?(function(e){const{modalOverlayOpeningPadding:t,modalOverlayOpeningRadius:n}=e.options,i=js(e.target),o=()=>{r=void 0,h(t,n,i,e.target),r=requestAnimationFrame(o)};o(),window.addEventListener("touchmove",u,{passive:!1})}(e),d()):c()},d,function(e){Wr[e?"unshift":"push"]((()=>{i=e,n(0,i)}))}]}class Gs extends as{constructor(e){super(),ss(this,e,Us,Vs,_r,{element:0,openingProperties:4,getElement:5,closeModalOpening:6,hide:7,positionModal:8,setupForStep:9,show:10})}get getElement(){return this.$$.ctx[5]}get closeModalOpening(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[7]}get positionModal(){return this.$$.ctx[8]}get setupForStep(){return this.$$.ctx[9]}get show(){return this.$$.ctx[10]}}const Ks=new fo;const Zs="undefined"==typeof window;class qs{constructor(){}}Zs?Object.assign(Ks,{Tour:qs,Step:qs}):Object.assign(Ks,{Tour:class extends fo{constructor(e){return void 0===e&&(e={}),super(e),mo(this),this.options=Object.assign({},{exitOnEsc:!0,keyboardNavigation:!0},e),this.classPrefix=vo(this.options.classPrefix),this.steps=[],this.addSteps(this.options.steps),["active","cancel","complete","inactive","show","start"].map((e=>{(e=>{this.on(e,(t=>{(t=t||{}).tour=this,Ks.trigger(e,t)}))})(e)})),this._setTourID(),this}addStep(e,t){let n=e;return n instanceof zs?n.tour=this:n=new zs(this,n),go(t)?this.steps.push(n):this.steps.splice(t,0,n),n}addSteps(e){return Array.isArray(e)&&e.forEach((e=>{this.addStep(e)})),this}back(){const e=this.steps.indexOf(this.currentStep);this.show(e-1,!1)}cancel(){if(this.options.confirmCancel){const e=this.options.confirmCancelMessage||"Are you sure you want to stop the tour?";window.confirm(e)&&this._done("cancel")}else this._done("cancel")}complete(){this._done("complete")}getById(e){return this.steps.find((t=>t.id===e))}getCurrentStep(){return this.currentStep}hide(){const e=this.getCurrentStep();if(e)return e.hide()}isActive(){return Ks.activeTour===this}next(){const e=this.steps.indexOf(this.currentStep);e===this.steps.length-1?this.complete():this.show(e+1,!0)}removeStep(e){const t=this.getCurrentStep();this.steps.some(((t,n)=>{if(t.id===e)return t.isOpen()&&t.hide(),t.destroy(),this.steps.splice(n,1),!0})),t&&t.id===e&&(this.currentStep=void 0,this.steps.length?this.show(0):this.cancel())}show(e,t){void 0===e&&(e=0),void 0===t&&(t=!0);const n=po(e)?this.getById(e):this.steps[e];n&&(this._updateStateBeforeShow(),uo(n.options.showOn)&&!n.options.showOn()?this._skipStep(n,t):(this.trigger("show",{step:n,previous:this.currentStep}),this.currentStep=n,n.show()))}start(){this.trigger("start"),this.focusedElBeforeOpen=document.activeElement,this.currentStep=null,this._setupModal(),this._setupActiveTour(),this.next()}_done(e){const t=this.steps.indexOf(this.currentStep);if(Array.isArray(this.steps)&&this.steps.forEach((e=>e.destroy())),function(e){if(e){const{steps:t}=e;t.forEach((e=>{e.options&&!1===e.options.canClickTarget&&e.options.attachTo&&e.target instanceof HTMLElement&&e.target.classList.remove("shepherd-target-click-disabled")}))}}(this),this.trigger(e,{index:t}),Ks.activeTour=null,this.trigger("inactive",{tour:this}),this.modal&&this.modal.hide(),("cancel"===e||"complete"===e)&&this.modal){const e=document.querySelector(".shepherd-modal-overlay-container");e&&e.remove()}ho(this.focusedElBeforeOpen)&&this.focusedElBeforeOpen.focus()}_setupActiveTour(){this.trigger("active",{tour:this}),Ks.activeTour=this}_setupModal(){this.modal=new Gs({target:this.options.modalContainer||document.body,props:{classPrefix:this.classPrefix,styles:this.styles}})}_skipStep(e,t){const n=this.steps.indexOf(e);if(n===this.steps.length-1)this.complete();else{const e=t?n+1:n-1;this.show(e,t)}}_updateStateBeforeShow(){this.currentStep&&this.currentStep.hide(),this.isActive()||this._setupActiveTour()}_setTourID(){const e=this.options.tourName||"tour";this.id=`${e}--${bo()}`}},Step:zs});var Ys=s().createContext(null),Xs=(Ys.Consumer,function(e){var t=e.children,n=e.tourOptions,i=e.steps,o=(0,r.useMemo)((function(){var e=new Ks.Tour(n);return function(e,t){e.length&&e.map((function(e){var n=e.buttons;return n&&(e.buttons=n.map((function(e){var n=e.action,i=e.classes,o=e.disabled,r=e.label,s=e.secondary,a=e.text,l=e.type;return{action:l?t[l]:n,classes:i,disabled:o,label:r,secondary:s,text:a,type:l}}))),e})).forEach((function(e){return t.addStep(e)}))}(i,e),e}),[n,i]);return s().createElement(Ys.Provider,{value:o},t)});const Qs={defaultStepOptions:{cancelIcon:{enabled:!0}},useModalOverlay:!0},Js=e=>{const t={classes:"shepherd-button-secondary",text:"Previous",type:"back"},n={classes:"shepherd-button-primary",text:"Next",type:"next"},i={classes:"shepherd-button-primary",text:"Got it",type:"next"},o={classes:"shepherd-button-primary",text:"Got it",type:"complete"},r={classes:"shepherd-button-primary shepherd-button-primary--tools",text:"Okay",type:"complete"},s=e.some((({id:e})=>"schema-find-tour"===e));return e.map(((a,l)=>0===l?{...a,buttons:[n]}:"schema-find-tour"===a.id?{...a,buttons:[r]}:s&&"schema-edit-block"===a.id?{...a,buttons:[t,i]}:l===e.length-1?{...a,buttons:[t,o]}:{...a,buttons:[t,n]}))},ea=({title:e,description:t,stepNumber:n,stepCount:i})=>{const o=(0,a.createInterpolateElement)((0,m.__)("<strong>Step <stepNumber /></strong> of <stepCount />","give"),{strong:(0,r.createElement)("strong",null),stepNumber:(0,r.createElement)("span",null,n),stepCount:(0,r.createElement)("span",null,i)});return(0,r.createElement)("div",{className:"givewp-shepherd"},(0,r.createElement)("div",{className:"givewp-shepherd__steps"},(0,r.createElement)("div",null,o),(0,r.createElement)(A.Button,{variant:"link",className:"js-exit-tour"},(0,m.__)("Exit tour","give"))),(0,r.createElement)("h3",{className:"givewp-shepherd__title",style:{textWrap:"balance"}},e),(0,r.createElement)("p",{className:"givewp-shepherd__description"},t))},ta=e=>e.map(((t,n)=>{const i=e.some((e=>"schema-find-tour"===e.id)),o=i?e.length-1:e.length,s=t.component,l=(0,r.createElement)(ea,{title:t.title,description:t.text,stepNumber:n+1,stepCount:o}),c=document.createElement("div");return(0,a.render)(null!=s?s:l,c),{...t,text:c.innerHTML}}));function na(e){return e.split("-")[0]}Math.min,Math.max,Math.round,Math.floor;const ia=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:i}=t,o=await async function(e,t){const{placement:n,platform:i,elements:o}=e,r=await(null==i.isRTL?void 0:i.isRTL(o.floating)),s=na(n),a=function(e){return e.split("-")[1]}(n),l="y"===function(e){return["top","bottom"].includes(na(e))?"y":"x"}(n),c=["left","top"].includes(s)?-1:1,h=r&&l?-1:1,d="function"==typeof(u=t)?u(e):u;var u;let{mainAxis:p,crossAxis:g,alignmentAxis:f}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&"number"==typeof f&&(g="end"===a?-1*f:f),l?{x:g*h,y:p*c}:{x:p*c,y:g*h}}(t,e);return{x:n+o.x,y:i+o.y,data:o}}}},oa=e=>e.map((e=>({...e,canClickTarget:!1,scrollTo:!1,cancelIcon:{enabled:!1},arrow:!1,floatingUIOptions:{middleware:[ia(20)]}}))),ra=[{id:"design-edit-settings",attachTo:{element:"#sidebar-primary",on:"left-start"},title:(0,m.__)("Editing a form layout","give"),text:(0,m.__)("This is where you can customize the appearance (i.e. colors and features) of your form based on the selected form layout.","give")},{id:"design-edit-form",attachTo:{element:"#editor-state-switch-schema",on:"bottom-center"},title:(0,m.__)("Build","give"),text:(0,m.__)("This is where you add and edit various blocks and sections to make up your form.","give")}],sa=[{id:"schema-canvas",attachTo:{element:"#form-blocks-canvas > div",on:"right-start"},title:(0,m.__)("Canvas","give"),text:(0,m.__)("Add, reorder, and edit blocks and sections here to make up your form.","give")},{id:"schema-section",attachTo:{element:".block-editor-block-list__layout .wp-block > div",on:"right-start"},title:(0,m.__)("Form Sections","give"),text:(0,m.__)("Forms are broken into sections, which contain blocks for fields or content.","give"),modalOverlayOpeningRadius:5},{id:"schema-add-button",attachTo:{element:"#AddBlockButtonContainer",on:"bottom-end"},title:(0,m.__)("Sidebar Toggles","give"),text:(0,m.__)("These two buttons give you the ability to add and reorder sections and blocks to the canvas, with drag-and-drop ease.","give")},{id:"schema-add-block",attachTo:{element:"#sidebar-secondary",on:"right-start"},title:(0,m.__)("Add section/block","give"),text:(0,m.__)("Drag and drop the block you need onto the canvas. Input fields that can only be inserted once are greyed out when in use.","give"),beforeShowPromise:function(){return new Promise((function(e){const t=document.getElementById("AddBlockButtonContainer").querySelector("button");t.classList.contains("is-pressed")||t.click(),e()}))}},{id:"schema-edit-block",attachTo:{element:"#sidebar-primary",on:"left-start"},title:(0,m.__)("Block Settings","give"),text:(0,m.__)("Select a block to edit the settings for that individual block on the Block tab of the editor. Settings will vary depending on the type of block selected.","give"),beforeShowPromise:function(){return new Promise((function(e){document.dispatchEvent(new CustomEvent("selectAmountBlock")),e()}))}}],aa={id:"schema-find-tour",attachTo:{element:".givewp-block-editor-tools__tour",on:"bottom-end"},title:"",highlightClass:"givewp-block-editor-tools__item",text:(0,m.__)("Want to view the guided tour later? Access this option in the three dots menu above at any time.","give"),beforeShowPromise:function(){return new Promise((function(e){document.dispatchEvent(new CustomEvent("openToolsMenu")),setTimeout((function(){e()}),100)}))}};window.onboardingTourData.autoStartSchemaTour&&sa.push(aa);const la=sa,ca=Object.values((0,B.compose)(ta,Js,oa)(ra)),ha=Object.values((0,B.compose)(ta,Js,oa)(la)),da=()=>(0,r.createElement)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 1C5.925 1 1 5.925 1 12s4.925 11 11 11 11-4.925 11-11S18.075 1 12 1zm5.207 8.707a1 1 0 0 0-1.414-1.414L10.5 13.586l-2.293-2.293a1 1 0 0 0-1.414 1.414l3 3a1 1 0 0 0 1.414 0l6-6z",fill:"#459948"})),ua=({title:e,description:t,image:n,alt:i,selected:o,onSelected:s})=>(0,r.createElement)("div",{className:Be()("givewp-design-selector--card",{selected:o}),onClick:s},(0,r.createElement)("img",{src:n,alt:i}),(0,r.createElement)("strong",null,e),(0,r.createElement)("p",null,t),o&&(0,r.createElement)(da,null)),pa=n.p+"images/classic-design-screenshot.63db7d16.png",ga=n.p+"images/multi-step-design-screenshot.9381174a.png",fa=n.p+"images/two-panel-steps-design-screenshot.5aa12927.png",ma=({onContinue:e})=>{const t=(0,r.useContext)(Ys),n=xe(),[i,o]=(0,r.useState)(null),s=e=>{o(e),n(fe({designId:e}))};return(0,r.createElement)(A.Modal,{bodyOpenClassName:"show-design-selector-modal",title:null,isDismissible:!1,shouldCloseOnEsc:!1,shouldCloseOnClickOutside:!1,onRequestClose:()=>null},(0,r.createElement)("div",{className:"givewp-design-selector--container"},(0,r.createElement)("header",{className:"givewp-design-selector--header"},(0,r.createElement)("h3",null,(0,m.__)("Choose your form layout","give")),(0,r.createElement)("p",null,(0,m.__)("Select one that suits your taste and requirements for your cause.","give"))),(0,r.createElement)("div",{className:"givewp-design-selector--cards"},(0,r.createElement)(ua,{selected:"classic"===i,onSelected:()=>s("classic"),image:pa,alt:(0,m.__)("Classic form design","give"),title:(0,m.__)("Classic","give"),description:(0,m.__)("This displays all form fields on one page. Donors fill out the form as they scroll down the page","give")}),(0,r.createElement)(ua,{selected:"multi-step"===i,onSelected:()=>s("multi-step"),image:ga,alt:(0,m.__)("Multi-Step form design","give"),title:(0,m.__)("Multi-step","give"),description:(0,m.__)("This walks the donor through a number of steps to the donation process. The sections are broken into steps in the form","give")}),(0,r.createElement)(ua,{selected:"two-panel-steps"===i,onSelected:()=>s("two-panel-steps"),image:fa,alt:(0,m.__)("Two Panel form design","give"),title:(0,m.__)("Two Panel","give"),description:(0,m.__)("This has a side-by-side layout which breaks the sections of the donation process into steps.","give")})),(0,r.createElement)(A.Button,{disabled:!i,className:"givewp-design-selector--button",variant:"primary",onClick:()=>{e(),window.onboardingTourData.autoStartDesignTour&&t.start()}},(0,m.__)("Proceed","give"))))},va=({onContinue:e})=>{const t=(0,r.useContext)(Ys);return(0,r.createElement)(A.Modal,{bodyOpenClassName:"show-schema-welcome-modal",title:null,isDismissible:!1,shouldCloseOnEsc:!1,shouldCloseOnClickOutside:!1,onRequestClose:()=>null},(0,r.createElement)("div",{className:"givewp-schema-welcome--container"},(0,r.createElement)("div",null,(0,r.createElement)("div",{style:{display:"flex",justifyContent:"center",margin:"0 auto var(--givewp-spacing-4)"}},(0,r.createElement)(ht,null)),(0,r.createElement)("h3",null,(0,m.__)("Learn how to edit your form","give")),(0,r.createElement)("p",null,(0,m.__)("Let’s quickly explore the new visual donation form builder. This will take less than a minute.","give"))),(0,r.createElement)(A.Button,{className:"givewp-schema-welcome--button",variant:"primary",onClick:()=>{e(),t.start()}},(0,m.__)("Get started","give"))))};function wa(){const e=window.tour=(0,r.useContext)(Ys),{mode:t}=an(),{selectBlock:n}=(xe(),(0,w.useDispatch)("core/block-editor")),[i,o]=(0,r.useState)(!!window.onboardingTourData.autoStartSchemaTour);return(0,r.useEffect)((()=>{const e=()=>{const e=document.querySelector('[data-type="givewp/donation-amount"]').getAttribute("data-block");n(e).then((()=>console.log("Amount block selected")))};return document.addEventListener("selectAmountBlock",e),()=>{window.removeEventListener("selectAmountBlock",e)}}),[t]),(0,r.useEffect)((()=>{const t=t=>{var n=t.target;e.isActive()&&n.classList.contains("js-exit-tour")&&(e.steps.some((e=>"schema-find-tour"===e.id))?e.show("schema-find-tour"):e.complete())};return document.addEventListener("click",t),()=>{window.removeEventListener("click",t)}}),[t]),(0,r.useEffect)((()=>{const n=()=>{const e=new FormData;e.append("mode",t),fetch(window.onboardingTourData.actionUrl,{method:"POST",body:e})};return e.on("complete",n),()=>{e.off("complete",n)}}),[t]),(0,r.useEffect)((()=>{const e=()=>{document.getElementById("FormBuilderSidebarToggle")?.click()};return document.addEventListener("openToolsMenu",e),()=>{window.removeEventListener("openToolsMenu",e)}}),[t]),(0,r.createElement)(r.Fragment,null)}const ba=()=>{const{transfer:e,settings:{designId:t}}=$e(),{mode:n}=an(),[i,o]=(0,r.useState)(!t),[s,a]=(0,r.useState)(!!window.onboardingTourData.autoStartSchemaTour);if(e.showUpgradeModal)return null;const l="schema"===n?ha:ca;return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(Xs,{steps:l,tourOptions:Qs},(0,r.createElement)(wa,null),"design"===n&&i&&(0,r.createElement)(ma,{onContinue:()=>o(!1)}),"schema"===n&&s&&(0,r.createElement)(va,{onContinue:()=>a(!1)})))};function ya(){const{blocks:e}=$e(),t=xe(),n=e=>{if(!e.some((e=>"givewp/section"!==e.name)))return t(me(e));t(me(e.map((e=>"givewp/section"==e.name?e:{...e,name:"givewp/section",attributes:{title:(0,m.__)("Section Title","give"),description:(0,m.__)("Section Description","give"),innerBlocksTemplate:[[e.name,e.attributes]]}}))))};return function(e){e.forEach(((t,n)=>{t.innerBlocks?.forEach(((t,i)=>{const o=(0,l.getBlockType)(t.name);if(void 0===o){const o=(0,l.getBlockType)((0,l.getUnregisteredTypeHandlerName)()),r={...o,attributes:{...o.attributes,originalName:t.name,originalContent:JSON.stringify(t),originalUndelimitedContent:""}};e[n].innerBlocks[i]={...t,...r}}else o.name===(0,l.getUnregisteredTypeHandlerName)()&&void 0!==(0,l.getBlockType)(t.attributes.originalName)&&(e[n].innerBlocks[i]=JSON.parse(t.attributes.originalContent))}))}))}(e),(0,r.createElement)(f.BlockEditorProvider,{value:e,onInput:n,onChange:n},(0,r.createElement)(ba,null),(0,r.createElement)(A.SlotFillProvider,null,(0,r.createElement)(Ae.InspectorFill,null,(0,r.createElement)(f.BlockInspector,null)),(0,r.createElement)(Qi,null),(0,r.createElement)(A.Popover.Slot,null)))}const Ca=JSON.parse('[{"clientId":"8371d4c7-0e8d-4aff-a1a1-b4520f008132","name":"givewp/section","isValid":true,"attributes":{"title":"How much would you like to donate today?","description":"All donations directly impact our organization and help us further our mission."},"innerBlocks":[{"clientId":"bddaa0ea-29bf-4143-b62d-aae3396e9b0f","name":"givewp/donation-amount","isValid":true,"attributes":{"label":"Donation Amount","levels":[{"value":10,"checked":true},{"value":25},{"value":50},{"value":100},{"value":250},{"value":500}],"priceOption":"multi","setPrice":25,"customAmount":true,"customAmountMin":1,"recurringBillingPeriodOptions":["month"],"recurringBillingInterval":1,"recurringEnabled":false,"recurringLengthOfTime":"0","recurringOptInDefaultBillingPeriod":"month","recurringEnableOneTimeDonations":true},"innerBlocks":[]}]},{"clientId":"2d74bf4b-4b82-4bea-aed7-431801709351","name":"givewp/section","isValid":true,"attributes":{"title":"Who\'s Giving Today?","description":"We\'ll never share this information with anyone."},"innerBlocks":[{"clientId":"1dc9cc78-698b-443a-8679-572d0667b7d8","name":"givewp/donor-name","isValid":true,"attributes":{"showHonorific":false,"honorifics":["Mr","Ms","Mrs"],"firstNameLabel":"First name","firstNamePlaceholder":"First name","lastNameLabel":"Last name","lastNamePlaceholder":"Last name","requireLastName":false},"innerBlocks":[]},{"clientId":"6f0af86f-703d-400d-9cf9-322d5691307b","name":"givewp/email","isValid":true,"attributes":{"label":"Email Address","isRequired":true},"innerBlocks":[]}]},{"clientId":"52596cc5-ab49-433e-b8e9-23fb4871fb5c","name":"givewp/section","isValid":true,"attributes":{"title":"Payment Details","description":"How would you like to pay for your donation?"},"innerBlocks":[{"name":"givewp/donation-summary","clientId":"b7114360-8542-4043-8296-26d2ae995d24","isValid":true,"attributes":[],"innerBlocks":[]},{"clientId":"145d8b8a-1870-4516-b0d5-fa7848578819","name":"givewp/payment-gateways","isValid":true,"attributes":{},"innerBlocks":[]}]}]');var $a=n(5800);const xa=({error:e,resetErrorBoundary:t})=>(0,r.createElement)("div",{role:"alert"},(0,r.createElement)("p",null,(0,m.__)("An error occurred in the form. Please notify the site administrator. The error message is:","give")),(0,r.createElement)("pre",{style:{padding:"0.5rem"}},e.message),(0,r.createElement)("button",{type:"button",onClick:t},(0,m.__)("Reload form","give")));function _a({children:e}){return(0,r.createElement)($a.ErrorBoundary,{FallbackComponent:xa,onReset:()=>{window.location.reload()}},e)}function Sa(){const{transfer:e}=$e(),t=xe(),{transferActionUrl:n,formId:i}=window.migrationOnboardingData;return e.showNotice?(0,r.createElement)("div",{className:"givewp-transfer-notice-container"},(0,r.createElement)("div",{style:{flex:1}},(0,m.__)("Once you're happy with your new form, permanently transfer your existing donation data to this new form.","give")),(0,r.createElement)("div",null,(0,r.createElement)("button",{className:"givewp-transfer-button",onClick:()=>t(we({showTransferModal:!0}))},(0,m.__)("Transfer data","give"))),(0,r.createElement)("div",{className:"givewp-transfer-close-icon-container"},(0,r.createElement)(dn,{onClick:()=>{t(we({showNotice:!1,showTooltip:!0})),fetch(n+`&formId=${i}`,{method:"POST"}),document.getElementById("FormBuilderSidebarToggle")?.click()}}))):null}function Ea({title:e,icon:t,children:n,insertInto:i,handleClose:o,isOpen:s=!0,showHeader:a=!0,showCloseIcon:l=!0,wrapperClassName:c=""}){const h=(0,r.useCallback)((e=>{27===e.keyCode&&"function"==typeof o&&o(e)}),[]);return(0,r.useEffect)((()=>(document.addEventListener("keydown",h,!1),()=>{document.removeEventListener("keydown",h,!1)})),[]),s?(0,Gt.createPortal)((0,r.createElement)("div",{className:`givewp-modal-wrapper ${c}`},(0,r.createElement)("div",{role:"dialog","aria-label":e,className:"givewp-modal-dialog"},a?(0,r.createElement)("div",{className:"givewp-modal-header"},t&&(0,r.createElement)("div",{className:"givewp-modal-icon-header"},t),e,l&&o&&(0,r.createElement)("button",{"aria-label":(0,m.__)("Close dialog","give"),className:"givewp-modal-close",onClick:o},(0,r.createElement)(dn,{"aria-label":(0,m.__)("Close dialog icon","give")}))):(0,r.createElement)(r.Fragment,null,l&&o&&(0,r.createElement)("button",{"aria-label":(0,m.__)("Close dialog","give"),className:"givewp-modal-close-headless",onClick:o},(0,r.createElement)(dn,{"aria-label":(0,m.__)("Close dialog icon","give")})),t&&(0,r.createElement)("div",{className:"givewp-modal-icon-center"},t)),(0,r.createElement)("div",{className:"givewp-modal-content"},n))),i?document.querySelector(i):document.body):null}const ka=(0,r.forwardRef)((({children:e,type:t="button",variant:n="primary",size:i="small",disabled:o=!1,className:s,...a},l)=>(0,r.createElement)("button",{ref:l,disabled:o,type:t,className:Be()("givewp-button",n,i,s),...a},e))),Aa=(0,r.forwardRef)((({name:e,value:t,placeholder:n,onChange:i,label:o,disabled:s=!1,type:a="text",...l},c)=>{const h=()=>(0,r.createElement)("input",{ref:c,type:a,name:e,"aria-label":e,placeholder:n,className:"givewp-input",onChange:i,disabled:s,value:t,...l});return o?(0,r.createElement)("label",{className:"label"},h(),o):h()}));function La({handleTransferConfirmation:e}){const[t,n]=(0,r.useState)({input:"",delete:!1});return(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:"givewp-dialog-title"},(0,m.__)("Transferring donation data to the upgraded form","give")),(0,r.createElement)("div",{className:"givewp-dialog-content"},(0,r.createElement)(Ht,{content:(0,m.__)("Type <strong>transfer</strong> to confirm transfer of donation data for the form selected. This means all blocks, shortcodes, and the form URL will automatically redirect to the upgraded form.","give")})),(0,r.createElement)("div",null,(0,r.createElement)(Aa,{value:t.input,onChange:function(e){e.persist(),n((t=>({...t,input:e.target.value})))}})),(0,r.createElement)("br",null),(0,r.createElement)("div",{className:"givewp-dialog-checkbox"},(0,r.createElement)(Aa,{label:(0,m.__)("Delete the existing form after transfer","give"),type:"checkbox",checked:t.delete,onChange:e=>function(e,t){e.persist(),n((t=>({...t,delete:e.target.checked})))}(e)})),(0,r.createElement)("br",null),(0,r.createElement)(ka,{disabled:"transfer"!==t.input,size:"large",style:{width:"100%"},onClick:()=>e({delete:t.delete})},(0,m.__)("Yes, proceed","give")))}function Ma(){const{transfer:e,settings:t}=$e(),n=xe(),i={isOpen:e.showTransferModal,step:0,showHeader:!0,dialogTitle:(0,m.__)("Transfer existing donation data","give"),dialogIcon:(0,r.createElement)(un,null)},[o,s]=(0,r.useState)(i);function a(){n(we({showTransferModal:!1})),s(i)}function l(e){fetch(window.migrationOnboardingData.apiRoot+"/transfer",{method:"POST",headers:{"Content-Type":"application/json","X-WP-Nonce":window.migrationOnboardingData.apiNonce},body:JSON.stringify({...e,formId:window.migrationOnboardingData.isMigratedForm})}).then((e=>{e.ok&&(window.migrationOnboardingData.isTransferredForm=!0),n(we({showNotice:!e.ok})),s((t=>({...t,showHeader:!1,step:e.ok?2:3,dialogIcon:e.ok?(0,r.createElement)(pn,null):(0,r.createElement)(un,null)})))})),fetch(window.migrationOnboardingData.transferActionUrl+`&formId=${window.migrationOnboardingData.formId}`,{method:"POST"})}const c=()=>(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:"givewp-dialog-title"},(0,m.__)("Transferring donation data cannot be undone","give")),(0,r.createElement)("div",{className:"givewp-dialog-content"},(0,r.createElement)(Ht,{content:(0,m.__)((0,m.sprintf)("Transferring donations involves moving all donations from the existing form %s to the upgraded form, leaving no donations associated with the existing form after the transfer.",`<span class="givewp-dialog-form-name">[${t.formTitle}]</span>`),"give")})),(0,r.createElement)(ka,{size:"large",onClick:()=>{s((e=>({...e,step:1,dialogTitle:(0,m.__)("Confirm transfer","give")})))},style:{width:"100%"}},(0,m.__)("Transfer","give"))),h=()=>(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:Be()("givewp-dialog-title-small","givewp-dialog-center")},(0,m.__)("Transfer completed successfully","give")),(0,r.createElement)("div",{className:Be()("givewp-dialog-content-small","givewp-dialog-center")},(0,m.__)("Your donation data was successfully transferred to the upgraded form.","give")),(0,r.createElement)(ka,{size:"large",onClick:()=>window.location.href="edit.php?post_type=give_forms&page=give-forms",style:{width:"100%"}},(0,m.__)("Go back to your donation form list","give"))),d=()=>(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:Be()("givewp-dialog-title","givewp-dialog-center")},(0,m.__)("Transfer not completed!","give")),(0,r.createElement)("div",{className:Be()("givewp-dialog-content","givewp-dialog-center")},(0,m.__)("Something went wrong with the transfer.","give")),(0,r.createElement)(ka,{size:"large",onClick:a,style:{width:"100%"}},(0,m.__)("Close","give")));return e.showTransferModal?(0,r.createElement)(Ea,{isOpen:e.showTransferModal,icon:o.dialogIcon,showHeader:o.showHeader,handleClose:a,title:o.dialogTitle},(0,r.createElement)((()=>{switch(o.step){case 1:return(0,r.createElement)(La,{handleTransferConfirmation:l});case 2:return(0,r.createElement)(h,null);case 3:return(0,r.createElement)(d,null);default:return(0,r.createElement)(c,null)}}),null)):null}function Ta({children:e,align:t="left"}){return(0,r.createElement)("div",{className:Be()("givewp-button-group",t)},e)}function Ra(){const{transfer:e,settings:t}=$e(),n=xe(),{migrationActionUrl:i,formId:o}=window.migrationOnboardingData;function s(){n(we({showUpgradeModal:!1})),fetch(i+`&formId=${o}`,{method:"POST"})}return e.showUpgradeModal?(0,r.createElement)(Ea,{showHeader:!1,handleClose:s,title:(0,m.__)("Your form has been upgraded","give")},(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:"givewp-dialog-image-container"},(0,r.createElement)("img",{src:("form.jpg",`${window.migrationOnboardingData.pluginUrl}assets/dist/images/form-migration/form.jpg`),alt:(0,m.__)("Upgraded form","give")})),(0,r.createElement)("div",{className:"givewp-dialog-title"},(0,m.__)("Your form has been upgraded","give")),(0,r.createElement)("div",{className:"givewp-dialog-info"},(0,m.__)("Make sure to check the settings for each section and block, and maybe even run some test donations to ensure your new form is good to go.","give")),(0,r.createElement)(Ta,{align:"right"},(0,r.createElement)(ka,{size:"large",onClick:s},(0,m.__)("Got it","give"))))):null}const Ia={zIndex:99999999,position:"fixed",left:"10%",bottom:30,display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",backgroundColor:"var(--givewp-grey-900)",color:"var(--givewp-shades-white)",borderRadius:2,boxShadow:"0 2px 6px 0 rgba(0, 0, 0, 0.3)",fontSize:"0.875rem",cursor:"pointer"},Oa={display:"flex",alignItems:"center",gap:5,padding:"10px 15px 8px 15px",borderRight:"1px solid var(--givewp-grey-700)"},Na={fill:"var(--givewp-shades-white)",width:"18px",height:"18px"};function Da(){const[e,t]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{t(!sessionStorage.getItem("givewp-show-return-btn")),sessionStorage.removeItem("givewp-show-return-btn")}),[]),e?null:(0,r.createElement)("div",{style:Ia},(0,r.createElement)("div",{style:Oa,onClick:()=>history.back()},(0,r.createElement)("span",null,(0,r.createElement)(gn,null)),(0,r.createElement)("span",{style:{marginTop:"-5px"}},(0,m.__)("Return to editing form","give"))),(0,r.createElement)("div",{onClick:()=>t(!0),style:{padding:"10px 15px 8px 15px"}},(0,r.createElement)(dn,{style:Na})))}function Pa(){return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(Sa,null),(0,r.createElement)(Ma,null),(0,r.createElement)(Ra,null),(0,r.createElement)(Da,null))}const{blocks:Fa,formSettings:Ha}=$(),Ba={blocks:Fa||Ca,settings:{...Ha},transfer:{showNotice:Boolean(window.migrationOnboardingData.transferShowNotice),showUpgradeModal:Boolean(window.migrationOnboardingData.showUpgradeDialog),showTransferModal:!1,showTooltip:!1}};function Wa(){return(0,r.createElement)(_a,null,(0,r.createElement)(sn,{initialState:{mode:"design"}},(0,r.createElement)(Ce,{initialState:Ba},(0,r.createElement)(Fe.ShortcutProvider,null,(0,r.createElement)(ya,null),(0,r.createElement)(Pa,null)))))}Fa instanceof Error&&(alert("Unable to load initial blocks."),console.error(Fa)),void 0===Fe.ShortcutProvider&&console.error("ShortcutProvider is undefined."),document.addEventListener("dragend",(()=>{document.body.classList.remove("is-dragging-components-draggable"),document.getElementsByClassName("interface-interface-skeleton__body")[0].scrollBy(0,1)})),(0,l.setCategories)([...(0,l.getCategories)(),{slug:"input",title:(0,m.__)("Input Fields","give")},{slug:"content",title:(0,m.__)("Content & Media","give")},{slug:"section",title:(0,m.__)("Layout","give")},{slug:"custom",title:(0,m.__)("Custom Fields","give")},{slug:"addons",title:(0,m.__)("Add-ons","give")}]),(0,g.addFilter)("editor.BlockEdit","givewp/supports/field-settings-hoc",G),(0,g.addFilter)("blocks.registerBlockType","givewp/supports/field-settings-attributes",(function(e){const t=v(e.supports.givewp?.fieldSettings);if(null===t)return e;let n={};return t.label&&(n.label={type:"string",default:t.label.default}),t.metaKey&&(n.metaUUID={type:"string"},n.fieldName={type:"string"}),t.description&&(n.description={type:"string",default:t.description.default}),t.required&&(n.isRequired={type:"boolean",default:t.required.default}),t.placeholder&&(n.placeholder={type:"string",default:t.placeholder.default}),t.storeAsDonorMeta&&(n.storeAsDonorMeta={type:"boolean",default:t.storeAsDonorMeta.default}),t.displayInAdmin&&(n.displayInAdmin={type:"boolean",default:t.displayInAdmin.default}),t.displayInReceipt&&(n.displayInReceipt={type:"boolean",default:t.displayInReceipt.default}),t.defaultValue&&(n.defaultValue={type:"string",default:t.defaultValue.default}),t.emailTag&&(n.emailTag={type:"string",default:t.emailTag.default}),e.attributes={...e.attributes,...n},e})),window.givewp.form.slots=window.givewp.form.slots||{},window.givewp.form.slots.FieldSettingsFill=I,window.givewp.form.slots.AfterFieldSettingsFill=N,window.givewp.form.slots.DisplaySettingsFill=P,window.givewp.form.slots.AfterDisplaySettingsFill=H,window.givewp.form.components=window.givewp.form.components||{},window.givewp.form.components.CurrencyControl=le,(()=>{const e=(0,c.__experimentalGetCoreBlocks)().find((e=>"core/missing"===e.name));if(e){const{name:t,metadata:n,settings:i}=e;(0,l.registerBlockType)({name:t,...n},i),(0,l.setUnregisteredTypeHandlerName)(t)}})(),u.getAll().forEach((({name:e,settings:t})=>{(0,l.registerBlockType)(e,{...t,supports:{...t.supports,...p}})}));const za=document.getElementById("root"),Va=()=>(0,r.createElement)(a.StrictMode,null,(0,r.createElement)(Wa,null));a.createRoot?(0,a.createRoot)(za).render((0,r.createElement)(Va,null)):(0,a.render)((0,r.createElement)(Va,null),za)},4184:(e,t)=>{var n;!function(){"use strict";var i={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var r=typeof n;if("string"===r||"number"===r)e.push(n);else if(Array.isArray(n)){if(n.length){var s=o.apply(null,n);s&&e.push(s)}}else if("object"===r){if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]")){e.push(n.toString());continue}for(var a in n)i.call(n,a)&&n[a]&&e.push(a)}}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},2027:e=>{var t=function(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32},n=-1;t.Diff=function(e,t){return[e,t]},t.prototype.diff_main=function(e,n,i,o){void 0===o&&(o=this.Diff_Timeout<=0?Number.MAX_VALUE:(new Date).getTime()+1e3*this.Diff_Timeout);var r=o;if(null==e||null==n)throw new Error("Null input. (diff_main)");if(e==n)return e?[new t.Diff(0,e)]:[];void 0===i&&(i=!0);var s=i,a=this.diff_commonPrefix(e,n),l=e.substring(0,a);e=e.substring(a),n=n.substring(a),a=this.diff_commonSuffix(e,n);var c=e.substring(e.length-a);e=e.substring(0,e.length-a),n=n.substring(0,n.length-a);var h=this.diff_compute_(e,n,s,r);return l&&h.unshift(new t.Diff(0,l)),c&&h.push(new t.Diff(0,c)),this.diff_cleanupMerge(h),h},t.prototype.diff_compute_=function(e,i,o,r){var s;if(!e)return[new t.Diff(1,i)];if(!i)return[new t.Diff(n,e)];var a=e.length>i.length?e:i,l=e.length>i.length?i:e,c=a.indexOf(l);if(-1!=c)return s=[new t.Diff(1,a.substring(0,c)),new t.Diff(0,l),new t.Diff(1,a.substring(c+l.length))],e.length>i.length&&(s[0][0]=s[2][0]=n),s;if(1==l.length)return[new t.Diff(n,e),new t.Diff(1,i)];var h=this.diff_halfMatch_(e,i);if(h){var d=h[0],u=h[1],p=h[2],g=h[3],f=h[4],m=this.diff_main(d,p,o,r),v=this.diff_main(u,g,o,r);return m.concat([new t.Diff(0,f)],v)}return o&&e.length>100&&i.length>100?this.diff_lineMode_(e,i,r):this.diff_bisect_(e,i,r)},t.prototype.diff_lineMode_=function(e,i,o){var r=this.diff_linesToChars_(e,i);e=r.chars1,i=r.chars2;var s=r.lineArray,a=this.diff_main(e,i,!1,o);this.diff_charsToLines_(a,s),this.diff_cleanupSemantic(a),a.push(new t.Diff(0,""));for(var l=0,c=0,h=0,d="",u="";l<a.length;){switch(a[l][0]){case 1:h++,u+=a[l][1];break;case n:c++,d+=a[l][1];break;case 0:if(c>=1&&h>=1){a.splice(l-c-h,c+h),l=l-c-h;for(var p=this.diff_main(d,u,!1,o),g=p.length-1;g>=0;g--)a.splice(l,0,p[g]);l+=p.length}h=0,c=0,d="",u=""}l++}return a.pop(),a},t.prototype.diff_bisect_=function(e,i,o){for(var r=e.length,s=i.length,a=Math.ceil((r+s)/2),l=a,c=2*a,h=new Array(c),d=new Array(c),u=0;u<c;u++)h[u]=-1,d[u]=-1;h[l+1]=0,d[l+1]=0;for(var p=r-s,g=p%2!=0,f=0,m=0,v=0,w=0,b=0;b<a&&!((new Date).getTime()>o);b++){for(var y=-b+f;y<=b-m;y+=2){for(var C=l+y,$=(k=y==-b||y!=b&&h[C-1]<h[C+1]?h[C+1]:h[C-1]+1)-y;k<r&&$<s&&e.charAt(k)==i.charAt($);)k++,$++;if(h[C]=k,k>r)m+=2;else if($>s)f+=2;else if(g&&(S=l+p-y)>=0&&S<c&&-1!=d[S]&&k>=(_=r-d[S]))return this.diff_bisectSplit_(e,i,k,$,o)}for(var x=-b+v;x<=b-w;x+=2){for(var _,S=l+x,E=(_=x==-b||x!=b&&d[S-1]<d[S+1]?d[S+1]:d[S-1]+1)-x;_<r&&E<s&&e.charAt(r-_-1)==i.charAt(s-E-1);)_++,E++;if(d[S]=_,_>r)w+=2;else if(E>s)v+=2;else if(!g){var k;if((C=l+p-x)>=0&&C<c&&-1!=h[C])if($=l+(k=h[C])-C,k>=(_=r-_))return this.diff_bisectSplit_(e,i,k,$,o)}}}return[new t.Diff(n,e),new t.Diff(1,i)]},t.prototype.diff_bisectSplit_=function(e,t,n,i,o){var r=e.substring(0,n),s=t.substring(0,i),a=e.substring(n),l=t.substring(i),c=this.diff_main(r,s,!1,o),h=this.diff_main(a,l,!1,o);return c.concat(h)},t.prototype.diff_linesToChars_=function(e,t){var n=[],i={};function o(e){for(var t="",o=0,s=-1,a=n.length;s<e.length-1;){-1==(s=e.indexOf("\n",o))&&(s=e.length-1);var l=e.substring(o,s+1);(i.hasOwnProperty?i.hasOwnProperty(l):void 0!==i[l])?t+=String.fromCharCode(i[l]):(a==r&&(l=e.substring(o),s=e.length),t+=String.fromCharCode(a),i[l]=a,n[a++]=l),o=s+1}return t}n[0]="";var r=4e4,s=o(e);return r=65535,{chars1:s,chars2:o(t),lineArray:n}},t.prototype.diff_charsToLines_=function(e,t){for(var n=0;n<e.length;n++){for(var i=e[n][1],o=[],r=0;r<i.length;r++)o[r]=t[i.charCodeAt(r)];e[n][1]=o.join("")}},t.prototype.diff_commonPrefix=function(e,t){if(!e||!t||e.charAt(0)!=t.charAt(0))return 0;for(var n=0,i=Math.min(e.length,t.length),o=i,r=0;n<o;)e.substring(r,o)==t.substring(r,o)?r=n=o:i=o,o=Math.floor((i-n)/2+n);return o},t.prototype.diff_commonSuffix=function(e,t){if(!e||!t||e.charAt(e.length-1)!=t.charAt(t.length-1))return 0;for(var n=0,i=Math.min(e.length,t.length),o=i,r=0;n<o;)e.substring(e.length-o,e.length-r)==t.substring(t.length-o,t.length-r)?r=n=o:i=o,o=Math.floor((i-n)/2+n);return o},t.prototype.diff_commonOverlap_=function(e,t){var n=e.length,i=t.length;if(0==n||0==i)return 0;n>i?e=e.substring(n-i):n<i&&(t=t.substring(0,n));var o=Math.min(n,i);if(e==t)return o;for(var r=0,s=1;;){var a=e.substring(o-s),l=t.indexOf(a);if(-1==l)return r;s+=l,0!=l&&e.substring(o-s)!=t.substring(0,s)||(r=s,s++)}},t.prototype.diff_halfMatch_=function(e,t){if(this.Diff_Timeout<=0)return null;var n=e.length>t.length?e:t,i=e.length>t.length?t:e;if(n.length<4||2*i.length<n.length)return null;var o=this;function r(e,t,n){for(var i,r,s,a,l=e.substring(n,n+Math.floor(e.length/4)),c=-1,h="";-1!=(c=t.indexOf(l,c+1));){var d=o.diff_commonPrefix(e.substring(n),t.substring(c)),u=o.diff_commonSuffix(e.substring(0,n),t.substring(0,c));h.length<u+d&&(h=t.substring(c-u,c)+t.substring(c,c+d),i=e.substring(0,n-u),r=e.substring(n+d),s=t.substring(0,c-u),a=t.substring(c+d))}return 2*h.length>=e.length?[i,r,s,a,h]:null}var s,a,l,c,h,d=r(n,i,Math.ceil(n.length/4)),u=r(n,i,Math.ceil(n.length/2));return d||u?(s=u?d&&d[4].length>u[4].length?d:u:d,e.length>t.length?(a=s[0],l=s[1],c=s[2],h=s[3]):(c=s[0],h=s[1],a=s[2],l=s[3]),[a,l,c,h,s[4]]):null},t.prototype.diff_cleanupSemantic=function(e){for(var i=!1,o=[],r=0,s=null,a=0,l=0,c=0,h=0,d=0;a<e.length;)0==e[a][0]?(o[r++]=a,l=h,c=d,h=0,d=0,s=e[a][1]):(1==e[a][0]?h+=e[a][1].length:d+=e[a][1].length,s&&s.length<=Math.max(l,c)&&s.length<=Math.max(h,d)&&(e.splice(o[r-1],0,new t.Diff(n,s)),e[o[r-1]+1][0]=1,r--,a=--r>0?o[r-1]:-1,l=0,c=0,h=0,d=0,s=null,i=!0)),a++;for(i&&this.diff_cleanupMerge(e),this.diff_cleanupSemanticLossless(e),a=1;a<e.length;){if(e[a-1][0]==n&&1==e[a][0]){var u=e[a-1][1],p=e[a][1],g=this.diff_commonOverlap_(u,p),f=this.diff_commonOverlap_(p,u);g>=f?(g>=u.length/2||g>=p.length/2)&&(e.splice(a,0,new t.Diff(0,p.substring(0,g))),e[a-1][1]=u.substring(0,u.length-g),e[a+1][1]=p.substring(g),a++):(f>=u.length/2||f>=p.length/2)&&(e.splice(a,0,new t.Diff(0,u.substring(0,f))),e[a-1][0]=1,e[a-1][1]=p.substring(0,p.length-f),e[a+1][0]=n,e[a+1][1]=u.substring(f),a++),a++}a++}},t.prototype.diff_cleanupSemanticLossless=function(e){function n(e,n){if(!e||!n)return 6;var i=e.charAt(e.length-1),o=n.charAt(0),r=i.match(t.nonAlphaNumericRegex_),s=o.match(t.nonAlphaNumericRegex_),a=r&&i.match(t.whitespaceRegex_),l=s&&o.match(t.whitespaceRegex_),c=a&&i.match(t.linebreakRegex_),h=l&&o.match(t.linebreakRegex_),d=c&&e.match(t.blanklineEndRegex_),u=h&&n.match(t.blanklineStartRegex_);return d||u?5:c||h?4:r&&!a&&l?3:a||l?2:r||s?1:0}for(var i=1;i<e.length-1;){if(0==e[i-1][0]&&0==e[i+1][0]){var o=e[i-1][1],r=e[i][1],s=e[i+1][1],a=this.diff_commonSuffix(o,r);if(a){var l=r.substring(r.length-a);o=o.substring(0,o.length-a),r=l+r.substring(0,r.length-a),s=l+s}for(var c=o,h=r,d=s,u=n(o,r)+n(r,s);r.charAt(0)===s.charAt(0);){o+=r.charAt(0),r=r.substring(1)+s.charAt(0),s=s.substring(1);var p=n(o,r)+n(r,s);p>=u&&(u=p,c=o,h=r,d=s)}e[i-1][1]!=c&&(c?e[i-1][1]=c:(e.splice(i-1,1),i--),e[i][1]=h,d?e[i+1][1]=d:(e.splice(i+1,1),i--))}i++}},t.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,t.whitespaceRegex_=/\s/,t.linebreakRegex_=/[\r\n]/,t.blanklineEndRegex_=/\n\r?\n$/,t.blanklineStartRegex_=/^\r?\n\r?\n/,t.prototype.diff_cleanupEfficiency=function(e){for(var i=!1,o=[],r=0,s=null,a=0,l=!1,c=!1,h=!1,d=!1;a<e.length;)0==e[a][0]?(e[a][1].length<this.Diff_EditCost&&(h||d)?(o[r++]=a,l=h,c=d,s=e[a][1]):(r=0,s=null),h=d=!1):(e[a][0]==n?d=!0:h=!0,s&&(l&&c&&h&&d||s.length<this.Diff_EditCost/2&&l+c+h+d==3)&&(e.splice(o[r-1],0,new t.Diff(n,s)),e[o[r-1]+1][0]=1,r--,s=null,l&&c?(h=d=!0,r=0):(a=--r>0?o[r-1]:-1,h=d=!1),i=!0)),a++;i&&this.diff_cleanupMerge(e)},t.prototype.diff_cleanupMerge=function(e){e.push(new t.Diff(0,""));for(var i,o=0,r=0,s=0,a="",l="";o<e.length;)switch(e[o][0]){case 1:s++,l+=e[o][1],o++;break;case n:r++,a+=e[o][1],o++;break;case 0:r+s>1?(0!==r&&0!==s&&(0!==(i=this.diff_commonPrefix(l,a))&&(o-r-s>0&&0==e[o-r-s-1][0]?e[o-r-s-1][1]+=l.substring(0,i):(e.splice(0,0,new t.Diff(0,l.substring(0,i))),o++),l=l.substring(i),a=a.substring(i)),0!==(i=this.diff_commonSuffix(l,a))&&(e[o][1]=l.substring(l.length-i)+e[o][1],l=l.substring(0,l.length-i),a=a.substring(0,a.length-i))),o-=r+s,e.splice(o,r+s),a.length&&(e.splice(o,0,new t.Diff(n,a)),o++),l.length&&(e.splice(o,0,new t.Diff(1,l)),o++),o++):0!==o&&0==e[o-1][0]?(e[o-1][1]+=e[o][1],e.splice(o,1)):o++,s=0,r=0,a="",l=""}""===e[e.length-1][1]&&e.pop();var c=!1;for(o=1;o<e.length-1;)0==e[o-1][0]&&0==e[o+1][0]&&(e[o][1].substring(e[o][1].length-e[o-1][1].length)==e[o-1][1]?(e[o][1]=e[o-1][1]+e[o][1].substring(0,e[o][1].length-e[o-1][1].length),e[o+1][1]=e[o-1][1]+e[o+1][1],e.splice(o-1,1),c=!0):e[o][1].substring(0,e[o+1][1].length)==e[o+1][1]&&(e[o-1][1]+=e[o+1][1],e[o][1]=e[o][1].substring(e[o+1][1].length)+e[o+1][1],e.splice(o+1,1),c=!0)),o++;c&&this.diff_cleanupMerge(e)},t.prototype.diff_xIndex=function(e,t){var i,o=0,r=0,s=0,a=0;for(i=0;i<e.length&&(1!==e[i][0]&&(o+=e[i][1].length),e[i][0]!==n&&(r+=e[i][1].length),!(o>t));i++)s=o,a=r;return e.length!=i&&e[i][0]===n?a:a+(t-s)},t.prototype.diff_prettyHtml=function(e){for(var t=[],i=/&/g,o=/</g,r=/>/g,s=/\n/g,a=0;a<e.length;a++){var l=e[a][0],c=e[a][1].replace(i,"&").replace(o,"<").replace(r,">").replace(s,"¶<br>");switch(l){case 1:t[a]='<ins style="background:#e6ffe6;">'+c+"</ins>";break;case n:t[a]='<del style="background:#ffe6e6;">'+c+"</del>";break;case 0:t[a]="<span>"+c+"</span>"}}return t.join("")},t.prototype.diff_text1=function(e){for(var t=[],n=0;n<e.length;n++)1!==e[n][0]&&(t[n]=e[n][1]);return t.join("")},t.prototype.diff_text2=function(e){for(var t=[],i=0;i<e.length;i++)e[i][0]!==n&&(t[i]=e[i][1]);return t.join("")},t.prototype.diff_levenshtein=function(e){for(var t=0,i=0,o=0,r=0;r<e.length;r++){var s=e[r][0],a=e[r][1];switch(s){case 1:i+=a.length;break;case n:o+=a.length;break;case 0:t+=Math.max(i,o),i=0,o=0}}return t+Math.max(i,o)},t.prototype.diff_toDelta=function(e){for(var t=[],i=0;i<e.length;i++)switch(e[i][0]){case 1:t[i]="+"+encodeURI(e[i][1]);break;case n:t[i]="-"+e[i][1].length;break;case 0:t[i]="="+e[i][1].length}return t.join("\t").replace(/%20/g," ")},t.prototype.diff_fromDelta=function(e,i){for(var o=[],r=0,s=0,a=i.split(/\t/g),l=0;l<a.length;l++){var c=a[l].substring(1);switch(a[l].charAt(0)){case"+":try{o[r++]=new t.Diff(1,decodeURI(c))}catch(e){throw new Error("Illegal escape in diff_fromDelta: "+c)}break;case"-":case"=":var h=parseInt(c,10);if(isNaN(h)||h<0)throw new Error("Invalid number in diff_fromDelta: "+c);var d=e.substring(s,s+=h);"="==a[l].charAt(0)?o[r++]=new t.Diff(0,d):o[r++]=new t.Diff(n,d);break;default:if(a[l])throw new Error("Invalid diff operation in diff_fromDelta: "+a[l])}}if(s!=e.length)throw new Error("Delta length ("+s+") does not equal source text length ("+e.length+").");return o},t.prototype.match_main=function(e,t,n){if(null==e||null==t||null==n)throw new Error("Null input. (match_main)");return n=Math.max(0,Math.min(n,e.length)),e==t?0:e.length?e.substring(n,n+t.length)==t?n:this.match_bitap_(e,t,n):-1},t.prototype.match_bitap_=function(e,t,n){if(t.length>this.Match_MaxBits)throw new Error("Pattern too long for this browser.");var i=this.match_alphabet_(t),o=this;function r(e,i){var r=e/t.length,s=Math.abs(n-i);return o.Match_Distance?r+s/o.Match_Distance:s?1:r}var s=this.Match_Threshold,a=e.indexOf(t,n);-1!=a&&(s=Math.min(r(0,a),s),-1!=(a=e.lastIndexOf(t,n+t.length))&&(s=Math.min(r(0,a),s)));var l,c,h=1<<t.length-1;a=-1;for(var d,u=t.length+e.length,p=0;p<t.length;p++){for(l=0,c=u;l<c;)r(p,n+c)<=s?l=c:u=c,c=Math.floor((u-l)/2+l);u=c;var g=Math.max(1,n-c+1),f=Math.min(n+c,e.length)+t.length,m=Array(f+2);m[f+1]=(1<<p)-1;for(var v=f;v>=g;v--){var w=i[e.charAt(v-1)];if(m[v]=0===p?(m[v+1]<<1|1)&w:(m[v+1]<<1|1)&w|(d[v+1]|d[v])<<1|1|d[v+1],m[v]&h){var b=r(p,v-1);if(b<=s){if(s=b,!((a=v-1)>n))break;g=Math.max(1,2*n-a)}}}if(r(p+1,n)>s)break;d=m}return a},t.prototype.match_alphabet_=function(e){for(var t={},n=0;n<e.length;n++)t[e.charAt(n)]=0;for(n=0;n<e.length;n++)t[e.charAt(n)]|=1<<e.length-n-1;return t},t.prototype.patch_addContext_=function(e,n){if(0!=n.length){if(null===e.start2)throw Error("patch not initialized");for(var i=n.substring(e.start2,e.start2+e.length1),o=0;n.indexOf(i)!=n.lastIndexOf(i)&&i.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)o+=this.Patch_Margin,i=n.substring(e.start2-o,e.start2+e.length1+o);o+=this.Patch_Margin;var r=n.substring(e.start2-o,e.start2);r&&e.diffs.unshift(new t.Diff(0,r));var s=n.substring(e.start2+e.length1,e.start2+e.length1+o);s&&e.diffs.push(new t.Diff(0,s)),e.start1-=r.length,e.start2-=r.length,e.length1+=r.length+s.length,e.length2+=r.length+s.length}},t.prototype.patch_make=function(e,i,o){var r,s;if("string"==typeof e&&"string"==typeof i&&void 0===o)r=e,(s=this.diff_main(r,i,!0)).length>2&&(this.diff_cleanupSemantic(s),this.diff_cleanupEfficiency(s));else if(e&&"object"==typeof e&&void 0===i&&void 0===o)s=e,r=this.diff_text1(s);else if("string"==typeof e&&i&&"object"==typeof i&&void 0===o)r=e,s=i;else{if("string"!=typeof e||"string"!=typeof i||!o||"object"!=typeof o)throw new Error("Unknown call format to patch_make.");r=e,s=o}if(0===s.length)return[];for(var a=[],l=new t.patch_obj,c=0,h=0,d=0,u=r,p=r,g=0;g<s.length;g++){var f=s[g][0],m=s[g][1];switch(c||0===f||(l.start1=h,l.start2=d),f){case 1:l.diffs[c++]=s[g],l.length2+=m.length,p=p.substring(0,d)+m+p.substring(d);break;case n:l.length1+=m.length,l.diffs[c++]=s[g],p=p.substring(0,d)+p.substring(d+m.length);break;case 0:m.length<=2*this.Patch_Margin&&c&&s.length!=g+1?(l.diffs[c++]=s[g],l.length1+=m.length,l.length2+=m.length):m.length>=2*this.Patch_Margin&&c&&(this.patch_addContext_(l,u),a.push(l),l=new t.patch_obj,c=0,u=p,h=d)}1!==f&&(h+=m.length),f!==n&&(d+=m.length)}return c&&(this.patch_addContext_(l,u),a.push(l)),a},t.prototype.patch_deepCopy=function(e){for(var n=[],i=0;i<e.length;i++){var o=e[i],r=new t.patch_obj;r.diffs=[];for(var s=0;s<o.diffs.length;s++)r.diffs[s]=new t.Diff(o.diffs[s][0],o.diffs[s][1]);r.start1=o.start1,r.start2=o.start2,r.length1=o.length1,r.length2=o.length2,n[i]=r}return n},t.prototype.patch_apply=function(e,t){if(0==e.length)return[t,[]];e=this.patch_deepCopy(e);var i=this.patch_addPadding(e);t=i+t+i,this.patch_splitMax(e);for(var o=0,r=[],s=0;s<e.length;s++){var a,l,c=e[s].start2+o,h=this.diff_text1(e[s].diffs),d=-1;if(h.length>this.Match_MaxBits?-1!=(a=this.match_main(t,h.substring(0,this.Match_MaxBits),c))&&(-1==(d=this.match_main(t,h.substring(h.length-this.Match_MaxBits),c+h.length-this.Match_MaxBits))||a>=d)&&(a=-1):a=this.match_main(t,h,c),-1==a)r[s]=!1,o-=e[s].length2-e[s].length1;else if(r[s]=!0,o=a-c,h==(l=-1==d?t.substring(a,a+h.length):t.substring(a,d+this.Match_MaxBits)))t=t.substring(0,a)+this.diff_text2(e[s].diffs)+t.substring(a+h.length);else{var u=this.diff_main(h,l,!1);if(h.length>this.Match_MaxBits&&this.diff_levenshtein(u)/h.length>this.Patch_DeleteThreshold)r[s]=!1;else{this.diff_cleanupSemanticLossless(u);for(var p,g=0,f=0;f<e[s].diffs.length;f++){var m=e[s].diffs[f];0!==m[0]&&(p=this.diff_xIndex(u,g)),1===m[0]?t=t.substring(0,a+p)+m[1]+t.substring(a+p):m[0]===n&&(t=t.substring(0,a+p)+t.substring(a+this.diff_xIndex(u,g+m[1].length))),m[0]!==n&&(g+=m[1].length)}}}}return[t=t.substring(i.length,t.length-i.length),r]},t.prototype.patch_addPadding=function(e){for(var n=this.Patch_Margin,i="",o=1;o<=n;o++)i+=String.fromCharCode(o);for(o=0;o<e.length;o++)e[o].start1+=n,e[o].start2+=n;var r=e[0],s=r.diffs;if(0==s.length||0!=s[0][0])s.unshift(new t.Diff(0,i)),r.start1-=n,r.start2-=n,r.length1+=n,r.length2+=n;else if(n>s[0][1].length){var a=n-s[0][1].length;s[0][1]=i.substring(s[0][1].length)+s[0][1],r.start1-=a,r.start2-=a,r.length1+=a,r.length2+=a}return 0==(s=(r=e[e.length-1]).diffs).length||0!=s[s.length-1][0]?(s.push(new t.Diff(0,i)),r.length1+=n,r.length2+=n):n>s[s.length-1][1].length&&(a=n-s[s.length-1][1].length,s[s.length-1][1]+=i.substring(0,a),r.length1+=a,r.length2+=a),i},t.prototype.patch_splitMax=function(e){for(var i=this.Match_MaxBits,o=0;o<e.length;o++)if(!(e[o].length1<=i)){var r=e[o];e.splice(o--,1);for(var s=r.start1,a=r.start2,l="";0!==r.diffs.length;){var c=new t.patch_obj,h=!0;for(c.start1=s-l.length,c.start2=a-l.length,""!==l&&(c.length1=c.length2=l.length,c.diffs.push(new t.Diff(0,l)));0!==r.diffs.length&&c.length1<i-this.Patch_Margin;){var d=r.diffs[0][0],u=r.diffs[0][1];1===d?(c.length2+=u.length,a+=u.length,c.diffs.push(r.diffs.shift()),h=!1):d===n&&1==c.diffs.length&&0==c.diffs[0][0]&&u.length>2*i?(c.length1+=u.length,s+=u.length,h=!1,c.diffs.push(new t.Diff(d,u)),r.diffs.shift()):(u=u.substring(0,i-c.length1-this.Patch_Margin),c.length1+=u.length,s+=u.length,0===d?(c.length2+=u.length,a+=u.length):h=!1,c.diffs.push(new t.Diff(d,u)),u==r.diffs[0][1]?r.diffs.shift():r.diffs[0][1]=r.diffs[0][1].substring(u.length))}l=(l=this.diff_text2(c.diffs)).substring(l.length-this.Patch_Margin);var p=this.diff_text1(r.diffs).substring(0,this.Patch_Margin);""!==p&&(c.length1+=p.length,c.length2+=p.length,0!==c.diffs.length&&0===c.diffs[c.diffs.length-1][0]?c.diffs[c.diffs.length-1][1]+=p:c.diffs.push(new t.Diff(0,p))),h||e.splice(++o,0,c)}}},t.prototype.patch_toText=function(e){for(var t=[],n=0;n<e.length;n++)t[n]=e[n];return t.join("")},t.prototype.patch_fromText=function(e){var i=[];if(!e)return i;for(var o=e.split("\n"),r=0,s=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;r<o.length;){var a=o[r].match(s);if(!a)throw new Error("Invalid patch string: "+o[r]);var l=new t.patch_obj;for(i.push(l),l.start1=parseInt(a[1],10),""===a[2]?(l.start1--,l.length1=1):"0"==a[2]?l.length1=0:(l.start1--,l.length1=parseInt(a[2],10)),l.start2=parseInt(a[3],10),""===a[4]?(l.start2--,l.length2=1):"0"==a[4]?l.length2=0:(l.start2--,l.length2=parseInt(a[4],10)),r++;r<o.length;){var c=o[r].charAt(0);try{var h=decodeURI(o[r].substring(1))}catch(e){throw new Error("Illegal escape in patch_fromText: "+h)}if("-"==c)l.diffs.push(new t.Diff(n,h));else if("+"==c)l.diffs.push(new t.Diff(1,h));else if(" "==c)l.diffs.push(new t.Diff(0,h));else{if("@"==c)break;if(""!==c)throw new Error('Invalid patch mode "'+c+'" in: '+h)}r++}}return i},(t.patch_obj=function(){this.diffs=[],this.start1=null,this.start2=null,this.length1=0,this.length2=0}).prototype.toString=function(){for(var e,t=["@@ -"+(0===this.length1?this.start1+",0":1==this.length1?this.start1+1:this.start1+1+","+this.length1)+" +"+(0===this.length2?this.start2+",0":1==this.length2?this.start2+1:this.start2+1+","+this.length2)+" @@\n"],i=0;i<this.diffs.length;i++){switch(this.diffs[i][0]){case 1:e="+";break;case n:e="-";break;case 0:e=" "}t[i+1]=e+encodeURI(this.diffs[i][1])+"\n"}return t.join("").replace(/%20/g," ")},e.exports=t,e.exports.diff_match_patch=t,e.exports.DIFF_DELETE=n,e.exports.DIFF_INSERT=1,e.exports.DIFF_EQUAL=0},5573:e=>{"use strict";var t=/["'&<>]/;e.exports=function(e){var n,i=""+e,o=t.exec(i);if(!o)return i;var r="",s=0,a=0;for(s=o.index;s<i.length;s++){switch(i.charCodeAt(s)){case 34:n=""";break;case 38:n="&";break;case 39:n="'";break;case 60:n="<";break;case 62:n=">";break;default:continue}a!==s&&(r+=i.substring(a,s)),a=s+1,r+=n}return a!==s?r+i.substring(a,s):r}},7954:(e,t,n)=>{var i=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,r=/^0b[01]+$/i,s=/^0o[0-7]+$/i,a=parseInt,l="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,c="object"==typeof self&&self&&self.Object===Object&&self,h=l||c||Function("return this")(),d=Object.prototype.toString,u=Math.max,p=Math.min,g=function(){return h.Date.now()};function f(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function m(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==d.call(e)}(e))return NaN;if(f(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=f(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var n=r.test(e);return n||s.test(e)?a(e.slice(2),n?2:8):o.test(e)?NaN:+e}e.exports=function(e,t,n){var i,o,r,s,a,l,c=0,h=!1,d=!1,v=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function w(t){var n=i,r=o;return i=o=void 0,c=t,s=e.apply(r,n)}function b(e){var n=e-l;return void 0===l||n>=t||n<0||d&&e-c>=r}function y(){var e=g();if(b(e))return C(e);a=setTimeout(y,function(e){var n=t-(e-l);return d?p(n,r-(e-c)):n}(e))}function C(e){return a=void 0,v&&i?w(e):(i=o=void 0,s)}function $(){var e=g(),n=b(e);if(i=arguments,o=this,l=e,n){if(void 0===a)return function(e){return c=e,a=setTimeout(y,t),h?w(e):s}(l);if(d)return a=setTimeout(y,t),w(l)}return void 0===a&&(a=setTimeout(y,t)),s}return t=m(t)||0,f(n)&&(h=!!n.leading,r=(d="maxWait"in n)?u(m(n.maxWait)||0,t):r,v="trailing"in n?!!n.trailing:v),$.cancel=function(){void 0!==a&&clearTimeout(a),c=0,i=l=o=a=void 0},$.flush=function(){return void 0===a?s:C(g())},$}},9208:(e,t,n)=>{var i,o="__lodash_hash_undefined__",r=1/0,s="[object Function]",a="[object GeneratorFunction]",l="[object Symbol]",c=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,h=/^\w*$/,d=/^\./,u=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,p=/\\(\\)?/g,g=/^\[object .+?Constructor\]$/,f="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,m="object"==typeof self&&self&&self.Object===Object&&self,v=f||m||Function("return this")(),w=Array.prototype,b=Function.prototype,y=Object.prototype,C=v["__core-js_shared__"],$=(i=/[^.]+$/.exec(C&&C.keys&&C.keys.IE_PROTO||""))?"Symbol(src)_1."+i:"",x=b.toString,_=y.hasOwnProperty,S=y.toString,E=RegExp("^"+x.call(_).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),k=v.Symbol,A=w.splice,L=F(v,"Map"),M=F(Object,"create"),T=k?k.prototype:void 0,R=T?T.toString:void 0;function I(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function O(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function N(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function D(e,t){for(var n,i,o=e.length;o--;)if((n=e[o][0])===(i=t)||n!=n&&i!=i)return o;return-1}function P(e,t){var n,i,o=e.__data__;return("string"==(i=typeof(n=t))||"number"==i||"symbol"==i||"boolean"==i?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function F(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){if(!V(e)||$&&$ in e)return!1;var t=function(e){var t=V(e)?S.call(e):"";return t==s||t==a}(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?E:g;return t.test(function(e){if(null!=e){try{return x.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}(n)?n:void 0}I.prototype.clear=function(){this.__data__=M?M(null):{}},I.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},I.prototype.get=function(e){var t=this.__data__;if(M){var n=t[e];return n===o?void 0:n}return _.call(t,e)?t[e]:void 0},I.prototype.has=function(e){var t=this.__data__;return M?void 0!==t[e]:_.call(t,e)},I.prototype.set=function(e,t){return this.__data__[e]=M&&void 0===t?o:t,this},O.prototype.clear=function(){this.__data__=[]},O.prototype.delete=function(e){var t=this.__data__,n=D(t,e);return!(n<0||(n==t.length-1?t.pop():A.call(t,n,1),0))},O.prototype.get=function(e){var t=this.__data__,n=D(t,e);return n<0?void 0:t[n][1]},O.prototype.has=function(e){return D(this.__data__,e)>-1},O.prototype.set=function(e,t){var n=this.__data__,i=D(n,e);return i<0?n.push([e,t]):n[i][1]=t,this},N.prototype.clear=function(){this.__data__={hash:new I,map:new(L||O),string:new I}},N.prototype.delete=function(e){return P(this,e).delete(e)},N.prototype.get=function(e){return P(this,e).get(e)},N.prototype.has=function(e){return P(this,e).has(e)},N.prototype.set=function(e,t){return P(this,e).set(e,t),this};var H=W((function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(j(e))return R?R.call(e):"";var t=e+"";return"0"==t&&1/e==-r?"-0":t}(t);var n=[];return d.test(e)&&n.push(""),e.replace(u,(function(e,t,i,o){n.push(i?o.replace(p,"$1"):t||e)})),n}));function B(e){if("string"==typeof e||j(e))return e;var t=e+"";return"0"==t&&1/e==-r?"-0":t}function W(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var i=arguments,o=t?t.apply(this,i):i[0],r=n.cache;if(r.has(o))return r.get(o);var s=e.apply(this,i);return n.cache=r.set(o,s),s};return n.cache=new(W.Cache||N),n}W.Cache=N;var z=Array.isArray;function V(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function j(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&S.call(e)==l}e.exports=function(e,t,n){var i=null==e?void 0:function(e,t){var n;t=function(e,t){if(z(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!j(e))||h.test(e)||!c.test(e)||null!=t&&e in Object(t)}(t,e)?[t]:z(n=t)?n:H(n);for(var i=0,o=t.length;null!=e&&i<o;)e=e[B(t[i++])];return i&&i==o?e:void 0}(e,t);return void 0===i?n:i}},2307:(e,t,n)=>{e=n.nmd(e);var i="__lodash_hash_undefined__",o=1,r=2,s=9007199254740991,a="[object Arguments]",l="[object Array]",c="[object AsyncFunction]",h="[object Boolean]",d="[object Date]",u="[object Error]",p="[object Function]",g="[object GeneratorFunction]",f="[object Map]",m="[object Number]",v="[object Null]",w="[object Object]",b="[object Promise]",y="[object Proxy]",C="[object RegExp]",$="[object Set]",x="[object String]",_="[object Undefined]",S="[object WeakMap]",E="[object ArrayBuffer]",k="[object DataView]",A=/^\[object .+?Constructor\]$/,L=/^(?:0|[1-9]\d*)$/,M={};M["[object Float32Array]"]=M["[object Float64Array]"]=M["[object Int8Array]"]=M["[object Int16Array]"]=M["[object Int32Array]"]=M["[object Uint8Array]"]=M["[object Uint8ClampedArray]"]=M["[object Uint16Array]"]=M["[object Uint32Array]"]=!0,M[a]=M[l]=M[E]=M[h]=M[k]=M[d]=M[u]=M[p]=M[f]=M[m]=M[w]=M[C]=M[$]=M[x]=M[S]=!1;var T="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,R="object"==typeof self&&self&&self.Object===Object&&self,I=T||R||Function("return this")(),O=t&&!t.nodeType&&t,N=O&&e&&!e.nodeType&&e,D=N&&N.exports===O,P=D&&T.process,F=function(){try{return P&&P.binding&&P.binding("util")}catch(e){}}(),H=F&&F.isTypedArray;function B(e,t){for(var n=-1,i=null==e?0:e.length;++n<i;)if(t(e[n],n,e))return!0;return!1}function W(e){var t=-1,n=Array(e.size);return e.forEach((function(e,i){n[++t]=[i,e]})),n}function z(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var V,j,U,G=Array.prototype,K=Function.prototype,Z=Object.prototype,q=I["__core-js_shared__"],Y=K.toString,X=Z.hasOwnProperty,Q=(V=/[^.]+$/.exec(q&&q.keys&&q.keys.IE_PROTO||""))?"Symbol(src)_1."+V:"",J=Z.toString,ee=RegExp("^"+Y.call(X).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),te=D?I.Buffer:void 0,ne=I.Symbol,ie=I.Uint8Array,oe=Z.propertyIsEnumerable,re=G.splice,se=ne?ne.toStringTag:void 0,ae=Object.getOwnPropertySymbols,le=te?te.isBuffer:void 0,ce=(j=Object.keys,U=Object,function(e){return j(U(e))}),he=Ne(I,"DataView"),de=Ne(I,"Map"),ue=Ne(I,"Promise"),pe=Ne(I,"Set"),ge=Ne(I,"WeakMap"),fe=Ne(Object,"create"),me=He(he),ve=He(de),we=He(ue),be=He(pe),ye=He(ge),Ce=ne?ne.prototype:void 0,$e=Ce?Ce.valueOf:void 0;function xe(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function _e(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function Se(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var i=e[t];this.set(i[0],i[1])}}function Ee(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Se;++t<n;)this.add(e[t])}function ke(e){var t=this.__data__=new _e(e);this.size=t.size}function Ae(e,t){for(var n=e.length;n--;)if(Be(e[n][0],t))return n;return-1}function Le(e){return null==e?void 0===e?_:v:se&&se in Object(e)?function(e){var t=X.call(e,se),n=e[se];try{e[se]=void 0;var i=!0}catch(e){}var o=J.call(e);return i&&(t?e[se]=n:delete e[se]),o}(e):function(e){return J.call(e)}(e)}function Me(e){return Ke(e)&&Le(e)==a}function Te(e,t,n,i,s){return e===t||(null==e||null==t||!Ke(e)&&!Ke(t)?e!=e&&t!=t:function(e,t,n,i,s,c){var p=ze(e),g=ze(t),v=p?l:Pe(e),b=g?l:Pe(t),y=(v=v==a?w:v)==w,_=(b=b==a?w:b)==w,S=v==b;if(S&&Ve(e)){if(!Ve(t))return!1;p=!0,y=!1}if(S&&!y)return c||(c=new ke),p||Ze(e)?Re(e,t,n,i,s,c):function(e,t,n,i,s,a,l){switch(n){case k:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case E:return!(e.byteLength!=t.byteLength||!a(new ie(e),new ie(t)));case h:case d:case m:return Be(+e,+t);case u:return e.name==t.name&&e.message==t.message;case C:case x:return e==t+"";case f:var c=W;case $:var p=i&o;if(c||(c=z),e.size!=t.size&&!p)return!1;var g=l.get(e);if(g)return g==t;i|=r,l.set(e,t);var v=Re(c(e),c(t),i,s,a,l);return l.delete(e),v;case"[object Symbol]":if($e)return $e.call(e)==$e.call(t)}return!1}(e,t,v,n,i,s,c);if(!(n&o)){var A=y&&X.call(e,"__wrapped__"),L=_&&X.call(t,"__wrapped__");if(A||L){var M=A?e.value():e,T=L?t.value():t;return c||(c=new ke),s(M,T,n,i,c)}}return!!S&&(c||(c=new ke),function(e,t,n,i,r,s){var a=n&o,l=Ie(e),c=l.length;if(c!=Ie(t).length&&!a)return!1;for(var h=c;h--;){var d=l[h];if(!(a?d in t:X.call(t,d)))return!1}var u=s.get(e);if(u&&s.get(t))return u==t;var p=!0;s.set(e,t),s.set(t,e);for(var g=a;++h<c;){var f=e[d=l[h]],m=t[d];if(i)var v=a?i(m,f,d,t,e,s):i(f,m,d,e,t,s);if(!(void 0===v?f===m||r(f,m,n,i,s):v)){p=!1;break}g||(g="constructor"==d)}if(p&&!g){var w=e.constructor,b=t.constructor;w==b||!("constructor"in e)||!("constructor"in t)||"function"==typeof w&&w instanceof w&&"function"==typeof b&&b instanceof b||(p=!1)}return s.delete(e),s.delete(t),p}(e,t,n,i,s,c))}(e,t,n,i,Te,s))}function Re(e,t,n,i,s,a){var l=n&o,c=e.length,h=t.length;if(c!=h&&!(l&&h>c))return!1;var d=a.get(e);if(d&&a.get(t))return d==t;var u=-1,p=!0,g=n&r?new Ee:void 0;for(a.set(e,t),a.set(t,e);++u<c;){var f=e[u],m=t[u];if(i)var v=l?i(m,f,u,t,e,a):i(f,m,u,e,t,a);if(void 0!==v){if(v)continue;p=!1;break}if(g){if(!B(t,(function(e,t){if(o=t,!g.has(o)&&(f===e||s(f,e,n,i,a)))return g.push(t);var o}))){p=!1;break}}else if(f!==m&&!s(f,m,n,i,a)){p=!1;break}}return a.delete(e),a.delete(t),p}function Ie(e){return function(e,t,n){var i=t(e);return ze(e)?i:function(e,t){for(var n=-1,i=t.length,o=e.length;++n<i;)e[o+n]=t[n];return e}(i,n(e))}(e,qe,De)}function Oe(e,t){var n,i,o=e.__data__;return("string"==(i=typeof(n=t))||"number"==i||"symbol"==i||"boolean"==i?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function Ne(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!Ge(e)||function(e){return!!Q&&Q in e}(e))&&(je(e)?ee:A).test(He(e))}(n)?n:void 0}xe.prototype.clear=function(){this.__data__=fe?fe(null):{},this.size=0},xe.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},xe.prototype.get=function(e){var t=this.__data__;if(fe){var n=t[e];return n===i?void 0:n}return X.call(t,e)?t[e]:void 0},xe.prototype.has=function(e){var t=this.__data__;return fe?void 0!==t[e]:X.call(t,e)},xe.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=fe&&void 0===t?i:t,this},_e.prototype.clear=function(){this.__data__=[],this.size=0},_e.prototype.delete=function(e){var t=this.__data__,n=Ae(t,e);return!(n<0||(n==t.length-1?t.pop():re.call(t,n,1),--this.size,0))},_e.prototype.get=function(e){var t=this.__data__,n=Ae(t,e);return n<0?void 0:t[n][1]},_e.prototype.has=function(e){return Ae(this.__data__,e)>-1},_e.prototype.set=function(e,t){var n=this.__data__,i=Ae(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this},Se.prototype.clear=function(){this.size=0,this.__data__={hash:new xe,map:new(de||_e),string:new xe}},Se.prototype.delete=function(e){var t=Oe(this,e).delete(e);return this.size-=t?1:0,t},Se.prototype.get=function(e){return Oe(this,e).get(e)},Se.prototype.has=function(e){return Oe(this,e).has(e)},Se.prototype.set=function(e,t){var n=Oe(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this},Ee.prototype.add=Ee.prototype.push=function(e){return this.__data__.set(e,i),this},Ee.prototype.has=function(e){return this.__data__.has(e)},ke.prototype.clear=function(){this.__data__=new _e,this.size=0},ke.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},ke.prototype.get=function(e){return this.__data__.get(e)},ke.prototype.has=function(e){return this.__data__.has(e)},ke.prototype.set=function(e,t){var n=this.__data__;if(n instanceof _e){var i=n.__data__;if(!de||i.length<199)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new Se(i)}return n.set(e,t),this.size=n.size,this};var De=ae?function(e){return null==e?[]:(e=Object(e),function(t,n){for(var i=-1,o=null==t?0:t.length,r=0,s=[];++i<o;){var a=t[i];l=a,oe.call(e,l)&&(s[r++]=a)}var l;return s}(ae(e)))}:function(){return[]},Pe=Le;function Fe(e,t){return!!(t=null==t?s:t)&&("number"==typeof e||L.test(e))&&e>-1&&e%1==0&&e<t}function He(e){if(null!=e){try{return Y.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Be(e,t){return e===t||e!=e&&t!=t}(he&&Pe(new he(new ArrayBuffer(1)))!=k||de&&Pe(new de)!=f||ue&&Pe(ue.resolve())!=b||pe&&Pe(new pe)!=$||ge&&Pe(new ge)!=S)&&(Pe=function(e){var t=Le(e),n=t==w?e.constructor:void 0,i=n?He(n):"";if(i)switch(i){case me:return k;case ve:return f;case we:return b;case be:return $;case ye:return S}return t});var We=Me(function(){return arguments}())?Me:function(e){return Ke(e)&&X.call(e,"callee")&&!oe.call(e,"callee")},ze=Array.isArray,Ve=le||function(){return!1};function je(e){if(!Ge(e))return!1;var t=Le(e);return t==p||t==g||t==c||t==y}function Ue(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=s}function Ge(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Ke(e){return null!=e&&"object"==typeof e}var Ze=H?function(e){return function(t){return e(t)}}(H):function(e){return Ke(e)&&Ue(e.length)&&!!M[Le(e)]};function qe(e){return null!=(t=e)&&Ue(t.length)&&!je(t)?function(e,t){var n=ze(e),i=!n&&We(e),o=!n&&!i&&Ve(e),r=!n&&!i&&!o&&Ze(e),s=n||i||o||r,a=s?function(e,t){for(var n=-1,i=Array(e);++n<e;)i[n]=t(n);return i}(e.length,String):[],l=a.length;for(var c in e)!t&&!X.call(e,c)||s&&("length"==c||o&&("offset"==c||"parent"==c)||r&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Fe(c,l))||a.push(c);return a}(e):function(e){if(n=(t=e)&&t.constructor,t!==("function"==typeof n&&n.prototype||Z))return ce(e);var t,n,i=[];for(var o in Object(e))X.call(e,o)&&"constructor"!=o&&i.push(o);return i}(e);var t}e.exports=function(e,t){return Te(e,t)}},2703:(e,t,n)=>{"use strict";var i=n(414);function o(){}function r(){}r.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,r,s){if(s!==i){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:r,resetWarningCache:o};return n.PropTypes=n,n}},5697:(e,t,n)=>{e.exports=n(2703)()},414:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},2038:function(e,t,n){"use strict";var i,o=this&&this.__extends||(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var s=n(3239),a=n(5697),l=n(9196),c=n(2307),h=n(1048),d=(0,h.getAceInstance)(),u=function(e){function t(t){var n=e.call(this,t)||this;return h.editorEvents.forEach((function(e){n[e]=n[e].bind(n)})),n.debounce=h.debounce,n}return o(t,e),t.prototype.isInShadow=function(e){for(var t=e&&e.parentNode;t;){if("[object ShadowRoot]"===t.toString())return!0;t=t.parentNode}return!1},t.prototype.componentDidMount=function(){var e=this,t=this.props,n=t.className,i=t.onBeforeLoad,o=t.onValidate,r=t.mode,s=t.focus,a=t.theme,l=t.fontSize,c=t.value,u=t.defaultValue,p=t.showGutter,g=t.wrapEnabled,f=t.showPrintMargin,m=t.scrollMargin,v=void 0===m?[0,0,0,0]:m,w=t.keyboardHandler,b=t.onLoad,y=t.commands,C=t.annotations,$=t.markers,x=t.placeholder;this.editor=d.edit(this.refEditor),i&&i(d);for(var _=Object.keys(this.props.editorProps),S=0;S<_.length;S++)this.editor[_[S]]=this.props.editorProps[_[S]];this.props.debounceChangePeriod&&(this.onChange=this.debounce(this.onChange,this.props.debounceChangePeriod)),this.editor.renderer.setScrollMargin(v[0],v[1],v[2],v[3]),this.isInShadow(this.refEditor)&&this.editor.renderer.attachToShadowRoot(),this.editor.getSession().setMode("string"==typeof r?"ace/mode/".concat(r):r),a&&""!==a&&this.editor.setTheme("ace/theme/".concat(a)),this.editor.setFontSize("number"==typeof l?"".concat(l,"px"):l),this.editor.getSession().setValue(u||c||""),this.props.navigateToFileEnd&&this.editor.navigateFileEnd(),this.editor.renderer.setShowGutter(p),this.editor.getSession().setUseWrapMode(g),this.editor.setShowPrintMargin(f),this.editor.on("focus",this.onFocus),this.editor.on("blur",this.onBlur),this.editor.on("copy",this.onCopy),this.editor.on("paste",this.onPaste),this.editor.on("change",this.onChange),this.editor.on("input",this.onInput),x&&this.updatePlaceholder(),this.editor.getSession().selection.on("changeSelection",this.onSelectionChange),this.editor.getSession().selection.on("changeCursor",this.onCursorChange),o&&this.editor.getSession().on("changeAnnotation",(function(){var t=e.editor.getSession().getAnnotations();e.props.onValidate(t)})),this.editor.session.on("changeScrollTop",this.onScroll),this.editor.getSession().setAnnotations(C||[]),$&&$.length>0&&this.handleMarkers($);var E=this.editor.$options;h.editorOptions.forEach((function(t){E.hasOwnProperty(t)?e.editor.setOption(t,e.props[t]):e.props[t]&&console.warn("ReactAce: editor option ".concat(t," was activated but not found. Did you need to import a related tool or did you possibly mispell the option?"))})),this.handleOptions(this.props),Array.isArray(y)&&y.forEach((function(t){"string"==typeof t.exec?e.editor.commands.bindKey(t.bindKey,t.exec):e.editor.commands.addCommand(t)})),w&&this.editor.setKeyboardHandler("ace/keyboard/"+w),n&&(this.refEditor.className+=" "+n),b&&b(this.editor),this.editor.resize(),s&&this.editor.focus()},t.prototype.componentDidUpdate=function(e){for(var t=e,n=this.props,i=0;i<h.editorOptions.length;i++){var o=h.editorOptions[i];n[o]!==t[o]&&this.editor.setOption(o,n[o])}if(n.className!==t.className){var r=this.refEditor.className.trim().split(" ");t.className.trim().split(" ").forEach((function(e){var t=r.indexOf(e);r.splice(t,1)})),this.refEditor.className=" "+n.className+" "+r.join(" ")}var s=this.editor&&null!=n.value&&this.editor.getValue()!==n.value;if(s){this.silent=!0;var a=this.editor.session.selection.toJSON();this.editor.setValue(n.value,n.cursorStart),this.editor.session.selection.fromJSON(a),this.silent=!1}n.placeholder!==t.placeholder&&this.updatePlaceholder(),n.mode!==t.mode&&this.editor.getSession().setMode("string"==typeof n.mode?"ace/mode/".concat(n.mode):n.mode),n.theme!==t.theme&&this.editor.setTheme("ace/theme/"+n.theme),n.keyboardHandler!==t.keyboardHandler&&(n.keyboardHandler?this.editor.setKeyboardHandler("ace/keyboard/"+n.keyboardHandler):this.editor.setKeyboardHandler(null)),n.fontSize!==t.fontSize&&this.editor.setFontSize("number"==typeof n.fontSize?"".concat(n.fontSize,"px"):n.fontSize),n.wrapEnabled!==t.wrapEnabled&&this.editor.getSession().setUseWrapMode(n.wrapEnabled),n.showPrintMargin!==t.showPrintMargin&&this.editor.setShowPrintMargin(n.showPrintMargin),n.showGutter!==t.showGutter&&this.editor.renderer.setShowGutter(n.showGutter),c(n.setOptions,t.setOptions)||this.handleOptions(n),!s&&c(n.annotations,t.annotations)||this.editor.getSession().setAnnotations(n.annotations||[]),!c(n.markers,t.markers)&&Array.isArray(n.markers)&&this.handleMarkers(n.markers),c(n.scrollMargin,t.scrollMargin)||this.handleScrollMargins(n.scrollMargin),e.height===this.props.height&&e.width===this.props.width||this.editor.resize(),this.props.focus&&!e.focus&&this.editor.focus()},t.prototype.handleScrollMargins=function(e){void 0===e&&(e=[0,0,0,0]),this.editor.renderer.setScrollMargin(e[0],e[1],e[2],e[3])},t.prototype.componentWillUnmount=function(){this.editor&&(this.editor.destroy(),this.editor=null)},t.prototype.onChange=function(e){if(this.props.onChange&&!this.silent){var t=this.editor.getValue();this.props.onChange(t,e)}},t.prototype.onSelectionChange=function(e){if(this.props.onSelectionChange){var t=this.editor.getSelection();this.props.onSelectionChange(t,e)}},t.prototype.onCursorChange=function(e){if(this.props.onCursorChange){var t=this.editor.getSelection();this.props.onCursorChange(t,e)}},t.prototype.onInput=function(e){this.props.onInput&&this.props.onInput(e),this.props.placeholder&&this.updatePlaceholder()},t.prototype.onFocus=function(e){this.props.onFocus&&this.props.onFocus(e,this.editor)},t.prototype.onBlur=function(e){this.props.onBlur&&this.props.onBlur(e,this.editor)},t.prototype.onCopy=function(e){var t=e.text;this.props.onCopy&&this.props.onCopy(t)},t.prototype.onPaste=function(e){var t=e.text;this.props.onPaste&&this.props.onPaste(t)},t.prototype.onScroll=function(){this.props.onScroll&&this.props.onScroll(this.editor)},t.prototype.handleOptions=function(e){for(var t=Object.keys(e.setOptions),n=0;n<t.length;n++)this.editor.setOption(t[n],e.setOptions[t[n]])},t.prototype.handleMarkers=function(e){var t=this,n=this.editor.getSession().getMarkers(!0);for(var i in n)n.hasOwnProperty(i)&&this.editor.getSession().removeMarker(n[i].id);for(var i in n=this.editor.getSession().getMarkers(!1))n.hasOwnProperty(i)&&"ace_active-line"!==n[i].clazz&&"ace_selected-word"!==n[i].clazz&&this.editor.getSession().removeMarker(n[i].id);e.forEach((function(e){var n=e.startRow,i=e.startCol,o=e.endRow,r=e.endCol,a=e.className,l=e.type,c=e.inFront,h=void 0!==c&&c,d=new s.Range(n,i,o,r);t.editor.getSession().addMarker(d,a,l,h)}))},t.prototype.updatePlaceholder=function(){var e=this.editor,t=this.props.placeholder,n=!e.session.getValue().length,i=e.renderer.placeholderNode;!n&&i?(e.renderer.scroller.removeChild(e.renderer.placeholderNode),e.renderer.placeholderNode=null):n&&!i?((i=e.renderer.placeholderNode=document.createElement("div")).textContent=t||"",i.className="ace_comment ace_placeholder",i.style.padding="0 9px",i.style.position="absolute",i.style.zIndex="3",e.renderer.scroller.appendChild(i)):n&&i&&(i.textContent=t)},t.prototype.updateRef=function(e){this.refEditor=e},t.prototype.render=function(){var e=this.props,t=e.name,n=e.width,i=e.height,o=e.style,s=r({width:n,height:i},o);return l.createElement("div",{ref:this.updateRef,id:t,style:s})},t.propTypes={mode:a.oneOfType([a.string,a.object]),focus:a.bool,theme:a.string,name:a.string,className:a.string,height:a.string,width:a.string,fontSize:a.oneOfType([a.number,a.string]),showGutter:a.bool,onChange:a.func,onCopy:a.func,onPaste:a.func,onFocus:a.func,onInput:a.func,onBlur:a.func,onScroll:a.func,value:a.string,defaultValue:a.string,onLoad:a.func,onSelectionChange:a.func,onCursorChange:a.func,onBeforeLoad:a.func,onValidate:a.func,minLines:a.number,maxLines:a.number,readOnly:a.bool,highlightActiveLine:a.bool,tabSize:a.number,showPrintMargin:a.bool,cursorStart:a.number,debounceChangePeriod:a.number,editorProps:a.object,setOptions:a.object,style:a.object,scrollMargin:a.array,annotations:a.array,markers:a.array,keyboardHandler:a.string,wrapEnabled:a.bool,enableSnippets:a.bool,enableBasicAutocompletion:a.oneOfType([a.bool,a.array]),enableLiveAutocompletion:a.oneOfType([a.bool,a.array]),navigateToFileEnd:a.bool,commands:a.array,placeholder:a.string},t.defaultProps={name:"ace-editor",focus:!1,mode:"",theme:"",height:"500px",width:"500px",fontSize:12,enableSnippets:!1,showGutter:!0,onChange:null,onPaste:null,onLoad:null,onScroll:null,minLines:null,maxLines:null,readOnly:!1,highlightActiveLine:!0,showPrintMargin:!0,tabSize:4,cursorStart:1,editorProps:{},style:{},scrollMargin:[0,0,0,0],setOptions:{},wrapEnabled:!1,enableBasicAutocompletion:!1,enableLiveAutocompletion:!1,placeholder:null,navigateToFileEnd:!0},t}(l.Component);t.default=u},3532:function(e,t,n){"use strict";var i,o=this&&this.__extends||(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)});Object.defineProperty(t,"__esModule",{value:!0});var r=n(5697),s=n(9196),a=n(8663),l=n(2027),c=function(e){function t(t){var n=e.call(this,t)||this;return n.state={value:n.props.value},n.onChange=n.onChange.bind(n),n.diff=n.diff.bind(n),n}return o(t,e),t.prototype.componentDidUpdate=function(){var e=this.props.value;e!==this.state.value&&this.setState({value:e})},t.prototype.onChange=function(e){this.setState({value:e}),this.props.onChange&&this.props.onChange(e)},t.prototype.diff=function(){var e=new l,t=this.state.value[0],n=this.state.value[1];if(0===t.length&&0===n.length)return[];var i=e.diff_main(t,n);e.diff_cleanupSemantic(i);var o=this.generateDiffedLines(i);return this.setCodeMarkers(o)},t.prototype.generateDiffedLines=function(e){var t={left:[],right:[]},n={left:1,right:1};return e.forEach((function(e){var i=e[0],o=e[1],r=o.split("\n").length-1;if(0!==o.length){var s=o[0],a=o[o.length-1],l=0;switch(i){case 0:n.left+=r,n.right+=r;break;case-1:"\n"===s&&(n.left++,r--),0===(l=r)&&t.right.push({startLine:n.right,endLine:n.right}),"\n"===a&&(l-=1),t.left.push({startLine:n.left,endLine:n.left+l}),n.left+=r;break;case 1:"\n"===s&&(n.right++,r--),0===(l=r)&&t.left.push({startLine:n.left,endLine:n.left}),"\n"===a&&(l-=1),t.right.push({startLine:n.right,endLine:n.right+l}),n.right+=r;break;default:throw new Error("Diff type was not defined.")}}})),t},t.prototype.setCodeMarkers=function(e){void 0===e&&(e={left:[],right:[]});for(var t=[],n={left:[],right:[]},i=0;i<e.left.length;i++){var o={startRow:e.left[i].startLine-1,endRow:e.left[i].endLine,type:"text",className:"codeMarker"};n.left.push(o)}for(i=0;i<e.right.length;i++)o={startRow:e.right[i].startLine-1,endRow:e.right[i].endLine,type:"text",className:"codeMarker"},n.right.push(o);return t[0]=n.left,t[1]=n.right,t},t.prototype.render=function(){var e=this.diff();return s.createElement(a.default,{name:this.props.name,className:this.props.className,focus:this.props.focus,orientation:this.props.orientation,splits:this.props.splits,mode:this.props.mode,theme:this.props.theme,height:this.props.height,width:this.props.width,fontSize:this.props.fontSize,showGutter:this.props.showGutter,onChange:this.onChange,onPaste:this.props.onPaste,onLoad:this.props.onLoad,onScroll:this.props.onScroll,minLines:this.props.minLines,maxLines:this.props.maxLines,readOnly:this.props.readOnly,highlightActiveLine:this.props.highlightActiveLine,showPrintMargin:this.props.showPrintMargin,tabSize:this.props.tabSize,cursorStart:this.props.cursorStart,editorProps:this.props.editorProps,style:this.props.style,scrollMargin:this.props.scrollMargin,setOptions:this.props.setOptions,wrapEnabled:this.props.wrapEnabled,enableBasicAutocompletion:this.props.enableBasicAutocompletion,enableLiveAutocompletion:this.props.enableLiveAutocompletion,value:this.state.value,markers:e})},t.propTypes={cursorStart:r.number,editorProps:r.object,enableBasicAutocompletion:r.bool,enableLiveAutocompletion:r.bool,focus:r.bool,fontSize:r.number,height:r.string,highlightActiveLine:r.bool,maxLines:r.number,minLines:r.number,mode:r.string,name:r.string,className:r.string,onLoad:r.func,onPaste:r.func,onScroll:r.func,onChange:r.func,orientation:r.string,readOnly:r.bool,scrollMargin:r.array,setOptions:r.object,showGutter:r.bool,showPrintMargin:r.bool,splits:r.number,style:r.object,tabSize:r.number,theme:r.string,value:r.array,width:r.string,wrapEnabled:r.bool},t.defaultProps={cursorStart:1,editorProps:{},enableBasicAutocompletion:!1,enableLiveAutocompletion:!1,focus:!1,fontSize:12,height:"500px",highlightActiveLine:!0,maxLines:null,minLines:null,mode:"",name:"ace-editor",onLoad:null,onScroll:null,onPaste:null,onChange:null,orientation:"beside",readOnly:!1,scrollMargin:[0,0,0,0],setOptions:{},showGutter:!0,showPrintMargin:!0,splits:2,style:{},tabSize:4,theme:"github",value:["",""],width:"500px",wrapEnabled:!0},t}(s.Component);t.default=c},1048:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getAceInstance=t.debounce=t.editorEvents=t.editorOptions=void 0,t.editorOptions=["minLines","maxLines","readOnly","highlightActiveLine","tabSize","enableBasicAutocompletion","enableLiveAutocompletion","enableSnippets"],t.editorEvents=["onChange","onFocus","onInput","onBlur","onCopy","onPaste","onSelectionChange","onCursorChange","onScroll","handleOptions","updateRef"],t.getAceInstance=function(){var e;return"undefined"==typeof window?(n.g.window={},e=n(3239),delete n.g.window):window.ace?(e=window.ace).acequire=window.ace.require||window.ace.acequire:e=n(3239),e},t.debounce=function(e,t){var n=null;return function(){var i=this,o=arguments;clearTimeout(n),n=setTimeout((function(){e.apply(i,o)}),t)}}},4981:(e,t,n)=>{"use strict";var i=n(2038);n(3532).default,n(8663).default,t.ZP=i.default},8663:function(e,t,n){"use strict";var i,o=this&&this.__extends||(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),r=this&&this.__assign||function(){return r=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var s=n(1048),a=(0,s.getAceInstance)(),l=n(3239),c=n(3083),h=n(5697),d=n(9196),u=n(2307),p=n(9208),g=function(e){function t(t){var n=e.call(this,t)||this;return s.editorEvents.forEach((function(e){n[e]=n[e].bind(n)})),n.debounce=s.debounce,n}return o(t,e),t.prototype.isInShadow=function(e){for(var t=e&&e.parentNode;t;){if("[object ShadowRoot]"===t.toString())return!0;t=t.parentNode}return!1},t.prototype.componentDidMount=function(){var e=this,t=this.props,n=t.className,i=t.onBeforeLoad,o=t.mode,r=t.focus,l=t.theme,h=t.fontSize,d=t.value,u=t.defaultValue,g=t.cursorStart,f=t.showGutter,m=t.wrapEnabled,v=t.showPrintMargin,w=t.scrollMargin,b=void 0===w?[0,0,0,0]:w,y=t.keyboardHandler,C=t.onLoad,$=t.commands,x=t.annotations,_=t.markers,S=t.splits;this.editor=a.edit(this.refEditor),this.isInShadow(this.refEditor)&&this.editor.renderer.attachToShadowRoot(),this.editor.setTheme("ace/theme/".concat(l)),i&&i(a);var E=Object.keys(this.props.editorProps),k=new c.Split(this.editor.container,"ace/theme/".concat(l),S);this.editor.env.split=k,this.splitEditor=k.getEditor(0),this.split=k,this.editor.setShowPrintMargin(!1),this.editor.renderer.setShowGutter(!1);var A=this.splitEditor.$options;this.props.debounceChangePeriod&&(this.onChange=this.debounce(this.onChange,this.props.debounceChangePeriod)),k.forEach((function(t,n){for(var i=0;i<E.length;i++)t[E[i]]=e.props.editorProps[E[i]];var r=p(u,n),c=p(d,n,"");t.session.setUndoManager(new a.UndoManager),t.setTheme("ace/theme/".concat(l)),t.renderer.setScrollMargin(b[0],b[1],b[2],b[3]),t.getSession().setMode("ace/mode/".concat(o)),t.setFontSize(h),t.renderer.setShowGutter(f),t.getSession().setUseWrapMode(m),t.setShowPrintMargin(v),t.on("focus",e.onFocus),t.on("blur",e.onBlur),t.on("input",e.onInput),t.on("copy",e.onCopy),t.on("paste",e.onPaste),t.on("change",e.onChange),t.getSession().selection.on("changeSelection",e.onSelectionChange),t.getSession().selection.on("changeCursor",e.onCursorChange),t.session.on("changeScrollTop",e.onScroll),t.setValue(void 0===r?c:r,g);var w=p(x,n,[]),C=p(_,n,[]);for(t.getSession().setAnnotations(w),C&&C.length>0&&e.handleMarkers(C,t),i=0;i<s.editorOptions.length;i++){var S=s.editorOptions[i];A.hasOwnProperty(S)?t.setOption(S,e.props[S]):e.props[S]&&console.warn("ReaceAce: editor option ".concat(S," was activated but not found. Did you need to import a related tool or did you possibly mispell the option?"))}e.handleOptions(e.props,t),Array.isArray($)&&$.forEach((function(e){"string"==typeof e.exec?t.commands.bindKey(e.bindKey,e.exec):t.commands.addCommand(e)})),y&&t.setKeyboardHandler("ace/keyboard/"+y)})),n&&(this.refEditor.className+=" "+n),r&&this.splitEditor.focus();var L=this.editor.env.split;L.setOrientation("below"===this.props.orientation?L.BELOW:L.BESIDE),L.resize(!0),C&&C(L)},t.prototype.componentDidUpdate=function(e){var t=this,n=e,i=this.props,o=this.editor.env.split;if(i.splits!==n.splits&&o.setSplits(i.splits),i.orientation!==n.orientation&&o.setOrientation("below"===i.orientation?o.BELOW:o.BESIDE),o.forEach((function(e,o){i.mode!==n.mode&&e.getSession().setMode("ace/mode/"+i.mode),i.keyboardHandler!==n.keyboardHandler&&(i.keyboardHandler?e.setKeyboardHandler("ace/keyboard/"+i.keyboardHandler):e.setKeyboardHandler(null)),i.fontSize!==n.fontSize&&e.setFontSize(i.fontSize),i.wrapEnabled!==n.wrapEnabled&&e.getSession().setUseWrapMode(i.wrapEnabled),i.showPrintMargin!==n.showPrintMargin&&e.setShowPrintMargin(i.showPrintMargin),i.showGutter!==n.showGutter&&e.renderer.setShowGutter(i.showGutter);for(var r=0;r<s.editorOptions.length;r++){var a=s.editorOptions[r];i[a]!==n[a]&&e.setOption(a,i[a])}u(i.setOptions,n.setOptions)||t.handleOptions(i,e);var l=p(i.value,o,"");if(e.getValue()!==l){t.silent=!0;var c=e.session.selection.toJSON();e.setValue(l,i.cursorStart),e.session.selection.fromJSON(c),t.silent=!1}var h=p(i.annotations,o,[]),d=p(n.annotations,o,[]);u(h,d)||e.getSession().setAnnotations(h);var g=p(i.markers,o,[]),f=p(n.markers,o,[]);!u(g,f)&&Array.isArray(g)&&t.handleMarkers(g,e)})),i.className!==n.className){var r=this.refEditor.className.trim().split(" ");n.className.trim().split(" ").forEach((function(e){var t=r.indexOf(e);r.splice(t,1)})),this.refEditor.className=" "+i.className+" "+r.join(" ")}i.theme!==n.theme&&o.setTheme("ace/theme/"+i.theme),i.focus&&!n.focus&&this.splitEditor.focus(),i.height===this.props.height&&i.width===this.props.width||this.editor.resize()},t.prototype.componentWillUnmount=function(){this.editor.destroy(),this.editor=null},t.prototype.onChange=function(e){if(this.props.onChange&&!this.silent){var t=[];this.editor.env.split.forEach((function(e){t.push(e.getValue())})),this.props.onChange(t,e)}},t.prototype.onSelectionChange=function(e){if(this.props.onSelectionChange){var t=[];this.editor.env.split.forEach((function(e){t.push(e.getSelection())})),this.props.onSelectionChange(t,e)}},t.prototype.onCursorChange=function(e){if(this.props.onCursorChange){var t=[];this.editor.env.split.forEach((function(e){t.push(e.getSelection())})),this.props.onCursorChange(t,e)}},t.prototype.onFocus=function(e){this.props.onFocus&&this.props.onFocus(e)},t.prototype.onInput=function(e){this.props.onInput&&this.props.onInput(e)},t.prototype.onBlur=function(e){this.props.onBlur&&this.props.onBlur(e)},t.prototype.onCopy=function(e){this.props.onCopy&&this.props.onCopy(e)},t.prototype.onPaste=function(e){this.props.onPaste&&this.props.onPaste(e)},t.prototype.onScroll=function(){this.props.onScroll&&this.props.onScroll(this.editor)},t.prototype.handleOptions=function(e,t){for(var n=Object.keys(e.setOptions),i=0;i<n.length;i++)t.setOption(n[i],e.setOptions[n[i]])},t.prototype.handleMarkers=function(e,t){var n=t.getSession().getMarkers(!0);for(var i in n)n.hasOwnProperty(i)&&t.getSession().removeMarker(n[i].id);for(var i in n=t.getSession().getMarkers(!1))n.hasOwnProperty(i)&&t.getSession().removeMarker(n[i].id);e.forEach((function(e){var n=e.startRow,i=e.startCol,o=e.endRow,r=e.endCol,s=e.className,a=e.type,c=e.inFront,h=void 0!==c&&c,d=new l.Range(n,i,o,r);t.getSession().addMarker(d,s,a,h)}))},t.prototype.updateRef=function(e){this.refEditor=e},t.prototype.render=function(){var e=this.props,t=e.name,n=e.width,i=e.height,o=e.style,s=r({width:n,height:i},o);return d.createElement("div",{ref:this.updateRef,id:t,style:s})},t.propTypes={className:h.string,debounceChangePeriod:h.number,defaultValue:h.arrayOf(h.string),focus:h.bool,fontSize:h.oneOfType([h.number,h.string]),height:h.string,mode:h.string,name:h.string,onBlur:h.func,onChange:h.func,onCopy:h.func,onFocus:h.func,onInput:h.func,onLoad:h.func,onPaste:h.func,onScroll:h.func,orientation:h.string,showGutter:h.bool,splits:h.number,theme:h.string,value:h.arrayOf(h.string),width:h.string,onSelectionChange:h.func,onCursorChange:h.func,onBeforeLoad:h.func,minLines:h.number,maxLines:h.number,readOnly:h.bool,highlightActiveLine:h.bool,tabSize:h.number,showPrintMargin:h.bool,cursorStart:h.number,editorProps:h.object,setOptions:h.object,style:h.object,scrollMargin:h.array,annotations:h.array,markers:h.array,keyboardHandler:h.string,wrapEnabled:h.bool,enableBasicAutocompletion:h.oneOfType([h.bool,h.array]),enableLiveAutocompletion:h.oneOfType([h.bool,h.array]),commands:h.array},t.defaultProps={name:"ace-editor",focus:!1,orientation:"beside",splits:2,mode:"",theme:"",height:"500px",width:"500px",value:[],fontSize:12,showGutter:!0,onChange:null,onPaste:null,onLoad:null,onScroll:null,minLines:null,maxLines:null,readOnly:!1,highlightActiveLine:!0,showPrintMargin:!0,tabSize:4,cursorStart:1,editorProps:{},style:{},scrollMargin:[0,0,0,0],setOptions:{},wrapEnabled:!1,enableBasicAutocompletion:!1,enableLiveAutocompletion:!1},t}(d.Component);t.default=g},5800:function(e,t,n){!function(e,t){"use strict";function n(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var i=n(t);function o(e,t){return o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},o(e,t)}var r={error:null},s=function(e){function t(){for(var t,n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return(t=e.call.apply(e,[this].concat(i))||this).state=r,t.resetErrorBoundary=function(){for(var e,n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];null==t.props.onReset||(e=t.props).onReset.apply(e,i),t.reset()},t}var n,s;s=e,(n=t).prototype=Object.create(s.prototype),n.prototype.constructor=n,o(n,s),t.getDerivedStateFromError=function(e){return{error:e}};var a=t.prototype;return a.reset=function(){this.setState(r)},a.componentDidCatch=function(e,t){var n,i;null==(n=(i=this.props).onError)||n.call(i,e,t)},a.componentDidUpdate=function(e,t){var n,i,o,r,s=this.state.error,a=this.props.resetKeys;null!==s&&null!==t.error&&(void 0===(o=e.resetKeys)&&(o=[]),void 0===(r=a)&&(r=[]),o.length!==r.length||o.some((function(e,t){return!Object.is(e,r[t])})))&&(null==(n=(i=this.props).onResetKeysChange)||n.call(i,e.resetKeys,a),this.reset())},a.render=function(){var e=this.state.error,t=this.props,n=t.fallbackRender,o=t.FallbackComponent,r=t.fallback;if(null!==e){var s={error:e,resetErrorBoundary:this.resetErrorBoundary};if(i.isValidElement(r))return r;if("function"==typeof n)return n(s);if(o)return i.createElement(o,s);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},t}(i.Component);e.ErrorBoundary=s,e.useErrorHandler=function(e){var t=i.useState(null),n=t[0],o=t[1];if(null!=e)throw e;if(null!=n)throw n;return o},e.withErrorBoundary=function(e,t){var n=function(n){return i.createElement(s,t,i.createElement(e,n))},o=e.displayName||e.name||"Unknown";return n.displayName="withErrorBoundary("+o+")",n},Object.defineProperty(e,"__esModule",{value:!0})}(t,n(9196))},5251:(e,t,n)=>{"use strict";var i=n(9196),o=Symbol.for("react.element"),r=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),s=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function l(e,t,n){var i,l={},c=null,h=null;for(i in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(h=t.ref),t)r.call(t,i)&&!a.hasOwnProperty(i)&&(l[i]=t[i]);if(e&&e.defaultProps)for(i in t=e.defaultProps)void 0===l[i]&&(l[i]=t[i]);return{$$typeof:o,type:e,key:c,ref:h,props:l,_owner:s.current}}t.jsx=l,t.jsxs=l},5893:(e,t,n)=>{"use strict";e.exports=n(5251)},9196:e=>{"use strict";e.exports=window.React}},n={};function i(e){var o=n[e];if(void 0!==o)return o.exports;var r=n[e]={id:e,loaded:!1,exports:{}};return t[e].call(r.exports,r,r.exports,i),r.loaded=!0,r.exports}i.m=t,i.amdD=function(){throw new Error("define cannot be used indirect")},e=[],i.O=(t,n,o,r)=>{if(!n){var s=1/0;for(h=0;h<e.length;h++){for(var[n,o,r]=e[h],a=!0,l=0;l<n.length;l++)(!1&r||s>=r)&&Object.keys(i.O).every((e=>i.O[e](n[l])))?n.splice(l--,1):(a=!1,r<s&&(s=r));if(a){e.splice(h--,1);var c=o();void 0!==c&&(t=c)}}return t}r=r||0;for(var h=e.length;h>0&&e[h-1][2]>r;h--)e[h]=e[h-1];e[h]=[n,o,r]},i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;i.g.importScripts&&(e=i.g.location+"");var t=i.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var o=n.length-1;o>-1&&!e;)e=n[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),i.p=e})(),(()=>{var e={91:0,152:0};i.O.j=t=>0===e[t];var t=(t,n)=>{var o,r,[s,a,l]=n,c=0;if(s.some((t=>0!==e[t]))){for(o in a)i.o(a,o)&&(i.m[o]=a[o]);if(l)var h=l(i)}for(t&&t(n);c<s.length;c++)r=s[c],i.o(e,r)&&e[r]&&e[r][0](),e[r]=0;return i.O(h)},n=globalThis.webpackChunkgive=globalThis.webpackChunkgive||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();var o=i.O(void 0,[152],(()=>i(7353)));o=i.O(o)})();Save